Skip to content

Commit 79eca2d

Browse files
committed
feat(esm,themes,fonts): include esm build and fonts in the package
includes ESM build and fonts in the package. Themes are now now moved from main bundle to 'react95/dist/themes' BREAKING CHANGE: themes moved from the main bundle to 'react95/dist/themes'
1 parent adc04c0 commit 79eca2d

File tree

193 files changed

+2027
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+2027
-146
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
# testing
99
/coverage
1010

11-
# production
11+
# library build
12+
/cjs
13+
/esm
14+
/themes
15+
/images
16+
/fonts
1217
/dist
1318

1419
# storybook

.storybook/config.js

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,36 @@
11
import { configure, addDecorator } from '@storybook/react';
22
import { withThemesProvider } from 'storybook-addon-styled-component-theme';
3-
import themes from '../src/components/common/themes';
3+
import themes from '../src/common/themes';
44
import GlobalStyle from './decorators/globalStyle';
55

6+
const {
7+
original,
8+
rainyDay,
9+
vaporTeal,
10+
theSixtiesUSA,
11+
olive,
12+
tokyoDark,
13+
rose,
14+
plum,
15+
matrix,
16+
travel,
17+
...otherThemes
18+
} = themes;
19+
20+
const reorderedThemes = {
21+
original,
22+
rainyDay,
23+
vaporTeal,
24+
theSixtiesUSA,
25+
olive,
26+
tokyoDark,
27+
rose,
28+
plum,
29+
matrix,
30+
travel,
31+
...otherThemes
32+
};
33+
634
addDecorator(GlobalStyle);
7-
addDecorator(withThemesProvider(Object.values(themes)));
35+
addDecorator(withThemesProvider(Object.values(reorderedThemes)));
836
configure(require.context('../src/', true, /\.stories\.js$/), module);

.storybook/decorators/globalStyle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
22
import { createGlobalStyle } from 'styled-components';
33

4-
import styleReset from '../../src/components/common/styleReset';
5-
import MSSansSerif from '../../src/components/assets/fonts/MS-Sans-Serif.woff2';
4+
import styleReset from '../../src/common/styleReset';
5+
import MSSansSerif from '../../src/assets/fonts/MS-Sans-Serif.woff2';
66

77
const GlobalStyle = createGlobalStyle`
88
${styleReset}

.storybook/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = ({ config }) => {
1010
config.resolve = Object.assign(config.resolve, {
1111
alias: {
1212
...config.resolve.alias,
13-
react95: path.resolve(__dirname, '../src/components/index')
13+
react95: path.resolve(__dirname, '../src/index')
1414
}
1515
});
1616

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,28 @@ Apply style reset, wrap your app content with ThemeProvider with theme of your c
4444
```jsx
4545
import React from 'react';
4646
import { createGlobalStyle, ThemeProvider } from 'styled-components';
47-
import { styleReset, themes, List, ListItem, Divider } from 'react95';
47+
48+
import { styleReset, List, ListItem, Divider } from 'react95';
49+
// pick a theme of your choice
50+
import original from "react95/dist/themes/original";
51+
// original Windows95 font (optionally)
52+
import MSSansSerif from "react95/dist/fonts/MS-Sans-Serif.woff2";
4853

4954
const GlobalStyles = createGlobalStyle`
55+
@font-face {
56+
font-family: 'MS-Sans-Serif';
57+
src: url('${MSSansSerif}') format('woff2');
58+
}
59+
body {
60+
font-family: "MS-Sans-Serif";
61+
}
5062
${styleReset}
5163
`;
5264

5365
const App = () => (
5466
<div>
5567
<GlobalStyles />
56-
<ThemeProvider theme={themes.default}>
68+
<ThemeProvider theme={original}>
5769
<List>
5870
<ListItem>🎤 Sing</ListItem>
5971
<ListItem>💃🏻 Dance</ListItem>

docs/usage.mdx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,28 @@ Apply style reset, wrap your app content with ThemeProvider with theme of your c
1111
```jsx
1212
import React from 'react';
1313
import { createGlobalStyle, ThemeProvider } from 'styled-components';
14-
import { reset, themes, List, ListItem, Divider } from 'react95';
1514

16-
const ResetStyles = createGlobalStyle`
17-
${reset}
15+
import { styleReset, List, ListItem, Divider } from 'react95';
16+
// pick a theme of your choice
17+
import original from "react95/dist/themes/original";
18+
// original Windows95 font (optionally)
19+
import MSSansSerif from "react95/dist/fonts/MS-Sans-Serif.woff2";
20+
21+
const GlobalStyles = createGlobalStyle`
22+
@font-face {
23+
font-family: 'MS-Sans-Serif';
24+
src: url('${MSSansSerif}') format('woff2');
25+
}
26+
body {
27+
font-family: "MS-Sans-Serif";
28+
}
29+
${styleReset}
1830
`;
1931

2032
const App = () => (
2133
<div>
22-
<ResetStyles />
23-
<ThemeProvider theme={themes.default}>
34+
<GlobalStyles />
35+
<ThemeProvider theme={original}>
2436
<List>
2537
<ListItem>🎤 Sing</ListItem>
2638
<ListItem>💃🏻 Dance</ListItem>

0 commit comments

Comments
 (0)