Skip to content

Commit

Permalink
fix: storybook missing assets (#1814)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelAlev authored Apr 18, 2024
1 parent ae4d6ea commit 54d2882
Show file tree
Hide file tree
Showing 26 changed files with 293 additions and 30 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ const App = () => <Button>Click Me</Button>;
If you are using the old components, you can continue to import them directly from the `@frontify/fondue` package.

```tsx
import { FondueButton } from "@frontify/fondue";
import { Button } from "@frontify/fondue";

const App = () => <FondueButton>Click Me</FondueButton>;
const App = () => <Button>Click Me</Button>;
```

## Contributing
Expand Down
1 change: 1 addition & 0 deletions packages/charts/.storybook/assets/img/logo-charcoal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/charts/.storybook/assets/img/logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions packages/charts/.storybook/frontifyTheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { create } from '@storybook/theming/create';

export const light = create({
base: 'light',

colorPrimary: '#2d3232',
colorSecondary: '#825fff',

// UI
appBg: 'white',
appBorderColor: '#EAEBEE',
appBorderRadius: 4,

// Typography
fontBase:
"'Space Grotesk Frontify', Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",
fontCode: 'Menlo, Courier, monospace',

// Text colors
textColor: '#2d3232',

// Toolbar default and active colors
barTextColor: '#2d3232',
barSelectedColor: '#2d3232',
barBg: '#FFFFFF',

// Form colors
inputBg: '#FFFFFF',
inputBorder: '#EAEBEE',
inputTextColor: '#2d3232',
inputBorderRadius: 4,

brandTitle: 'Frontify Storybook',
brandUrl: 'https://frontify.com',
brandImage: '/img/logo-charcoal.svg',
});

export const dark = create({
base: 'dark',

colorPrimary: '#fafafa',
colorSecondary: '#825fff',

// UI
appBg: '#1a1c1c',
appBorderColor: '#424747',
appBorderRadius: 4,

// Typography
fontBase:
"'Space Grotesk Frontify', Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",
fontCode: 'Menlo, Courier, monospace',

// Text colors
textColor: '#fafafa',

// Toolbar default and active colors
barTextColor: '#fafafa',
barSelectedColor: '#fafafa',
barBg: '#1a1d1d',

// Form colors
inputBg: '#1a1c1c',
inputBorder: '#424747',
inputTextColor: '#fafafa',
inputBorderRadius: 4,

brandTitle: 'Frontify Storybook',
brandUrl: 'https://frontify.com',
brandImage: '/img/logo-white.svg',
});
13 changes: 13 additions & 0 deletions packages/charts/.storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Custom CSS for Storybook interface goes here -->
<style>
.sidebar-header {
/* Center dropdown button */
align-items: center !important;
}

.sidebar-header img {
/* Responsive sidebar header image */
width: 100%;
max-width: 200px;
}
</style>
8 changes: 8 additions & 0 deletions packages/charts/.storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* (c) Copyright Frontify Ltd., all rights reserved. */

import { addons } from '@storybook/manager-api';
import { light } from './frontifyTheme';

addons.setConfig({
theme: light,
});
2 changes: 2 additions & 0 deletions packages/charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@
"@storybook/addon-actions": "^8.0.8",
"@storybook/addon-essentials": "^8.0.8",
"@storybook/addon-links": "^8.0.8",
"@storybook/manager-api": "^8.0.8",
"@storybook/react": "^8.0.8",
"@storybook/react-vite": "^8.0.8",
"@storybook/theming": "^8.0.8",
"@testing-library/react": "^15.0.0",
"@types/d3-hierarchy": "^3.1.7",
"@types/d3-scale": "^4.0.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/postcss.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
tailwindcss: {},
},
};
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/components/.storybook/assets/img/logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions packages/components/.storybook/frontifyTheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { create } from '@storybook/theming/create';

export const light = create({
base: 'light',

colorPrimary: '#2d3232',
colorSecondary: '#825fff',

// UI
appBg: 'white',
appBorderColor: '#EAEBEE',
appBorderRadius: 4,

// Typography
fontBase:
"'Space Grotesk Frontify', Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",
fontCode: 'Menlo, Courier, monospace',

// Text colors
textColor: '#2d3232',

// Toolbar default and active colors
barTextColor: '#2d3232',
barSelectedColor: '#2d3232',
barBg: '#FFFFFF',

// Form colors
inputBg: '#FFFFFF',
inputBorder: '#EAEBEE',
inputTextColor: '#2d3232',
inputBorderRadius: 4,

brandTitle: 'Frontify Storybook',
brandUrl: 'https://frontify.com',
brandImage: '/img/logo-charcoal.svg',
});

export const dark = create({
base: 'dark',

colorPrimary: '#fafafa',
colorSecondary: '#825fff',

// UI
appBg: '#1a1c1c',
appBorderColor: '#424747',
appBorderRadius: 4,

// Typography
fontBase:
"'Space Grotesk Frontify', Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",
fontCode: 'Menlo, Courier, monospace',

// Text colors
textColor: '#fafafa',

// Toolbar default and active colors
barTextColor: '#fafafa',
barSelectedColor: '#fafafa',
barBg: '#1a1d1d',

// Form colors
inputBg: '#1a1c1c',
inputBorder: '#424747',
inputTextColor: '#fafafa',
inputBorderRadius: 4,

brandTitle: 'Frontify Storybook',
brandUrl: 'https://frontify.com',
brandImage: '/img/logo-white.svg',
});
1 change: 1 addition & 0 deletions packages/components/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
staticDirs: ['assets'],
addons: [
'@etchteam/storybook-addon-status',
'@storybook/addon-a11y',
Expand Down
13 changes: 13 additions & 0 deletions packages/components/.storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Custom CSS for Storybook interface goes here -->
<style>
.sidebar-header {
/* Center dropdown button */
align-items: center !important;
}

.sidebar-header img {
/* Responsive sidebar header image */
width: 100%;
max-width: 200px;
}
</style>
8 changes: 8 additions & 0 deletions packages/components/.storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* (c) Copyright Frontify Ltd., all rights reserved. */

import { addons } from '@storybook/manager-api';
import { light } from './frontifyTheme';

addons.setConfig({
theme: light,
});
74 changes: 74 additions & 0 deletions packages/components/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<style>
@font-face {
font-display: swap;
font-family: 'Space Grotesk Frontify';
font-style: normal;
font-weight: 300;
src:
url('/fonts/SpaceGroteskFrontify-Light.woff2') format('woff2'),
url('/fonts/SpaceGroteskFrontify-Light.woff') format('woff');
}

@font-face {
font-display: swap;
font-family: 'Space Grotesk Frontify';
font-style: normal;
font-weight: 400;
src:
url('/fonts/SpaceGroteskFrontify-Regular.woff2') format('woff2'),
url('/fonts/SpaceGroteskFrontify-Regular.woff') format('woff');
}

@font-face {
font-display: swap;
font-family: 'Space Grotesk Frontify';
font-style: normal;
font-weight: 500;
src:
url('/fonts/SpaceGroteskFrontify-Medium.woff2') format('woff2'),
url('/fonts/SpaceGroteskFrontify-Medium.woff') format('woff');
}

@font-face {
font-display: swap;
font-family: 'Space Grotesk Frontify';
font-style: normal;
font-weight: 600;
src:
url('/fonts/SpaceGroteskFrontify-SemiBold.woff2') format('woff2'),
url('/fonts/SpaceGroteskFrontify-SemiBold.woff') format('woff');
}

@font-face {
font-display: swap;
font-family: 'Space Grotesk Frontify';
font-style: normal;
font-weight: 700;
src:
url('/fonts/SpaceGroteskFrontify-Bold.woff2') format('woff2'),
url('/fonts/SpaceGroteskFrontify-Bold.woff') format('woff');
}

.side-by-side {
display: grid;
grid-template-columns: 1fr 1fr;
height: 100%;
min-height: 100vh;
}

.light.theme {
background: white;
padding: 1rem;
}

.tw-dark.theme {
background: #1a1c1c;
padding: 1rem;
height: 100%;
min-height: 100vh;
}
</style>

<script>
const global = globalThis;
</script>
Loading

0 comments on commit 54d2882

Please sign in to comment.