@rarui/styles 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +37 -0
  3. package/dist/index.css +1 -0
  4. package/dist/index.d.ts +185 -0
  5. package/dist/index.js +1 -0
  6. package/dist/styles.css +1 -0
  7. package/dist/themes/dark.css +1 -0
  8. package/dist/themes/dark.d.ts +9 -0
  9. package/dist/themes/dark.js +1 -0
  10. package/package.json +33 -0
  11. package/src/components/ThemeProvider.tsx +30 -0
  12. package/src/components/contexts/ThemeProviderContext/ThemeProviderContext.tsx +6 -0
  13. package/src/components/contexts/ThemeProviderContext/index.ts +5 -0
  14. package/src/components/contexts/ThemeProviderContext/themeProviderContext.types.ts +7 -0
  15. package/src/components/contexts/index.ts +1 -0
  16. package/src/components/hooks/index.ts +1 -0
  17. package/src/components/hooks/useTheme/index.ts +1 -0
  18. package/src/components/hooks/useTheme/useTheme.spec.tsx +27 -0
  19. package/src/components/hooks/useTheme/useTheme.ts +9 -0
  20. package/src/components/index.ts +6 -0
  21. package/src/components/themeProvider.definitions.ts +6 -0
  22. package/src/components/themeProvider.spec.tsx +41 -0
  23. package/src/components/themeProvider.types.ts +10 -0
  24. package/src/index.ts +8 -0
  25. package/src/index.types.ts +71 -0
  26. package/src/packages/atomic/button/index.ts +6 -0
  27. package/src/packages/atomic/button/rarui-button.commons.ts +82 -0
  28. package/src/packages/atomic/button/rarui-button.css.ts +331 -0
  29. package/src/packages/atomic/button/rarui-button.types.ts +4 -0
  30. package/src/themes/contract.css.ts +241 -0
  31. package/src/themes/globals.css.ts +256 -0
  32. package/src/themes/index.ts +2 -0
  33. package/src/themes/mediaQueries.ts +10 -0
  34. package/src/themes/rarui-theme-dark.css.ts +126 -0
  35. package/tsconfig.json +4 -0
  36. package/webpack.config.ts +30 -0
@@ -0,0 +1,241 @@
1
+ import { createGlobalThemeContract } from "@vanilla-extract/css";
2
+
3
+ export const vars = createGlobalThemeContract(
4
+ {
5
+ colors: {
6
+ surface: {
7
+ background: "",
8
+ brand: "",
9
+ "brand-hover": "",
10
+ "brand-press": "",
11
+ "brand-secondary": "",
12
+ "brand-secondary-hover": "",
13
+ "brand-secondary-press": "",
14
+ "brand-secondary-subdued": "",
15
+ "brand-subdued": "",
16
+ disabled: "",
17
+ error: "",
18
+ "error-hover": "",
19
+ "error-press": "",
20
+ "error-subdued": "",
21
+ hover: "",
22
+ info: "",
23
+ "info-hover": "",
24
+ "info-press": "",
25
+ "info-subdued": "",
26
+ invert: "",
27
+ "invert-disabled": "",
28
+ "invert-hover": "",
29
+ "invert-press": "",
30
+ "invert-secondary": "",
31
+ "on-brand-hover": "",
32
+ "on-brand-press": "",
33
+ "on-brand-secondary-hover": "",
34
+ "on-brand-secondary-press": "",
35
+ "on-error-hover": "",
36
+ "on-error-press": "",
37
+ "on-info-hover": "",
38
+ "on-info-press": "",
39
+ "on-success-hover": "",
40
+ "on-success-press": "",
41
+ "on-warning-hover": "",
42
+ "on-warning-press": "",
43
+ overlay: "",
44
+ press: "",
45
+ primary: "",
46
+ secondary: "",
47
+ success: "",
48
+ "success-hover": "",
49
+ "success-press": "",
50
+ "success-subdued": "",
51
+ warning: "",
52
+ "warning-hover": "",
53
+ "warning-press": "",
54
+ "warning-subdued": "",
55
+ },
56
+ content: {
57
+ brand: "",
58
+ "brand-alt": "",
59
+ "brand-secondary": "",
60
+ disabled: "",
61
+ error: "",
62
+ info: "",
63
+ invert: "",
64
+ "invert-disabled": "",
65
+ "invert-secondary": "",
66
+ "on-brand": "",
67
+ "on-brand-secondary": "",
68
+ "on-error": "",
69
+ "on-info": "",
70
+ "on-success": "",
71
+ "on-warning": "",
72
+ primary: "",
73
+ secondary: "",
74
+ success: "",
75
+ warning: "",
76
+ "warning-alt": "",
77
+ },
78
+ border: {
79
+ brand: "",
80
+ "brand-alt": "",
81
+ "brand-secondary": "",
82
+ disabled: "",
83
+ divider: "",
84
+ error: "",
85
+ info: "",
86
+ invert: "",
87
+ "invert-disabled": "",
88
+ primary: "",
89
+ secondary: "",
90
+ subdued: "",
91
+ success: "",
92
+ warning: "",
93
+ },
94
+ },
95
+ fontFamily: {
96
+ inter: "",
97
+ },
98
+ fontSize: {
99
+ hero: {
100
+ caption: "",
101
+ },
102
+ body: {
103
+ xxs: "",
104
+ xs: "",
105
+ s: "",
106
+ m: "",
107
+ l: "",
108
+ xl: "",
109
+ },
110
+ heading: {
111
+ xs: "",
112
+ s: "",
113
+ m: "",
114
+ l: "",
115
+ xl: "",
116
+ },
117
+ button: {
118
+ s: "",
119
+ m: "",
120
+ l: "",
121
+ },
122
+ label: {
123
+ s: "",
124
+ m: "",
125
+ l: "",
126
+ },
127
+ },
128
+ fontWeight: {
129
+ regular: "",
130
+ medium: "",
131
+ semiBold: "",
132
+ bold: "",
133
+ },
134
+ lineWeight: {
135
+ hero: {
136
+ caption: "",
137
+ },
138
+ body: {
139
+ xxs: "",
140
+ xs: "",
141
+ s: "",
142
+ m: "",
143
+ l: "",
144
+ xl: "",
145
+ },
146
+ heading: {
147
+ xs: "",
148
+ s: "",
149
+ m: "",
150
+ l: "",
151
+ xl: "",
152
+ },
153
+ button: {
154
+ s: "",
155
+ m: "",
156
+ l: "",
157
+ },
158
+ label: {
159
+ s: "",
160
+ m: "",
161
+ l: "",
162
+ },
163
+ },
164
+ elevation: {
165
+ none: "",
166
+ top: {
167
+ "1": "",
168
+ "2": "",
169
+ "3": "",
170
+ "4": "",
171
+ "5": "",
172
+ },
173
+ bottom: {
174
+ "1": "",
175
+ "2": "",
176
+ "3": "",
177
+ "4": "",
178
+ "5": "",
179
+ },
180
+ },
181
+ shape: {
182
+ border: {
183
+ radius: {
184
+ none: "",
185
+ "2xs": "",
186
+ xs: "",
187
+ sm: "",
188
+ md: "",
189
+ lg: "",
190
+ xl: "",
191
+ "2xl": "",
192
+ pill: "",
193
+ button: "",
194
+ input: "",
195
+ },
196
+ width: {
197
+ "1": "",
198
+ "2": "",
199
+ "3": "",
200
+ "4": "",
201
+ "5": "",
202
+ },
203
+ },
204
+ },
205
+ spacing: {
206
+ "4xs": "",
207
+ "3xs": "",
208
+ "2xs": "",
209
+ xs: "",
210
+ s: "",
211
+ md: "",
212
+ lg: "",
213
+ xl: "",
214
+ "2xl": "",
215
+ "3xl": "",
216
+ "4xl": "",
217
+ "5xl": "",
218
+ "6xl": "",
219
+ "7xl": "",
220
+ "8xl": "",
221
+ },
222
+ zIndex: {
223
+ 100: "",
224
+ 200: "",
225
+ 300: "",
226
+ 400: "",
227
+ 500: "",
228
+ 600: "",
229
+ 700: "",
230
+ 800: "",
231
+ 900: "",
232
+ },
233
+ breakpoint: {
234
+ xs: "",
235
+ md: "",
236
+ lg: "",
237
+ xl: "",
238
+ },
239
+ },
240
+ (_value, path) => `rarui-${path.join("-")}`,
241
+ );
@@ -0,0 +1,256 @@
1
+ import { createGlobalTheme } from "@vanilla-extract/css";
2
+ import tokens from "@rarui/tokens/dist/js/tokens";
3
+
4
+ import { vars } from "./contract.css";
5
+
6
+ const colors = tokens.color.light;
7
+ const elevation = tokens.elevation.light;
8
+ const fontFamily = tokens.font.family;
9
+ const fontSize = tokens.font.size;
10
+ const fontWeight = tokens.font.weight;
11
+ const lineWeight = tokens.line.height;
12
+ const { spacing, breakpoint, zIndex, shape } = tokens;
13
+
14
+ export const globalTheme = {
15
+ colors: {
16
+ surface: {
17
+ background: colors.surface.background.value,
18
+ brand: colors.surface.brand.value,
19
+ "brand-hover": colors.surface["brand-hover"].value,
20
+ "brand-press": colors.surface["brand-press"].value,
21
+ "brand-secondary": colors.surface["brand-secondary"].value,
22
+ "brand-secondary-hover": colors.surface["brand-secondary-hover"].value,
23
+ "brand-secondary-press": colors.surface["brand-secondary-press"].value,
24
+ "brand-secondary-subdued":
25
+ colors.surface["brand-secondary-subdued"].value,
26
+ "brand-subdued": colors.surface["brand-subdued"].value,
27
+ disabled: colors.surface.disabled.value,
28
+ error: colors.surface.error.value,
29
+ "error-hover": colors.surface["error-hover"].value,
30
+ "error-press": colors.surface["error-press"].value,
31
+ "error-subdued": colors.surface["error-subdued"].value,
32
+ hover: colors.surface.hover.value,
33
+ info: colors.surface.info.value,
34
+ "info-hover": colors.surface["info-hover"].value,
35
+ "info-press": colors.surface["info-press"].value,
36
+ "info-subdued": colors.surface["info-subdued"].value,
37
+ invert: colors.surface.invert.value,
38
+ "invert-disabled": colors.surface["invert-disabled"].value,
39
+ "invert-hover": colors.surface["invert-hover"].value,
40
+ "invert-press": colors.surface["invert-press"].value,
41
+ "invert-secondary": colors.surface["invert-secondary"].value,
42
+ "on-brand-hover": colors.surface["on-brand-hover"].value,
43
+ "on-brand-press": colors.surface["on-brand-press"].value,
44
+ "on-brand-secondary-hover":
45
+ colors.surface["on-brand-secondary-hover"].value,
46
+ "on-brand-secondary-press":
47
+ colors.surface["on-brand-secondary-press"].value,
48
+ "on-error-hover": colors.surface["on-error-hover"].value,
49
+ "on-error-press": colors.surface["on-error-press"].value,
50
+ "on-info-hover": colors.surface["on-info-hover"].value,
51
+ "on-info-press": colors.surface["on-info-press"].value,
52
+ "on-success-hover": colors.surface["on-success-hover"].value,
53
+ "on-success-press": colors.surface["on-success-press"].value,
54
+ "on-warning-hover": colors.surface["on-warning-hover"].value,
55
+ "on-warning-press": colors.surface["on-warning-press"].value,
56
+ overlay: colors.surface.overlay.value,
57
+ press: colors.surface.press.value,
58
+ primary: colors.surface.primary.value,
59
+ secondary: colors.surface.secondary.value,
60
+ success: colors.surface.success.value,
61
+ "success-hover": colors.surface["success-hover"].value,
62
+ "success-press": colors.surface["success-press"].value,
63
+ "success-subdued": colors.surface["success-subdued"].value,
64
+ warning: colors.surface.warning.value,
65
+ "warning-hover": colors.surface["warning-hover"].value,
66
+ "warning-press": colors.surface["warning-press"].value,
67
+ "warning-subdued": colors.surface["warning-subdued"].value,
68
+ },
69
+ content: {
70
+ brand: colors.content.brand.value,
71
+ "brand-alt": colors.content["brand-alt"].value,
72
+ "brand-secondary": colors.content["brand-secondary"].value,
73
+ disabled: colors.content.disabled.value,
74
+ error: colors.content.error.value,
75
+ info: colors.content.info.value,
76
+ invert: colors.content.invert.value,
77
+ "invert-disabled": colors.content["invert-disabled"].value,
78
+ "invert-secondary": colors.content["invert-secondary"].value,
79
+ "on-brand": colors.content["on-brand"].value,
80
+ "on-brand-secondary": colors.content["on-brand-secondary"].value,
81
+ "on-error": colors.content["on-error"].value,
82
+ "on-info": colors.content["on-info"].value,
83
+ "on-success": colors.content["on-success"].value,
84
+ "on-warning": colors.content["on-warning"].value,
85
+ primary: colors.content.primary.value,
86
+ secondary: colors.content.secondary.value,
87
+ success: colors.content.success.value,
88
+ warning: colors.content.warning.value,
89
+ "warning-alt": colors.content["warning-alt"].value,
90
+ },
91
+ border: {
92
+ brand: colors.border.brand.value,
93
+ "brand-alt": colors.border["brand-alt"].value,
94
+ "brand-secondary": colors.border["brand-secondary"].value,
95
+ disabled: colors.border.disabled.value,
96
+ divider: colors.border.divider.value,
97
+ error: colors.border.error.value,
98
+ info: colors.border.info.value,
99
+ invert: colors.border.invert.value,
100
+ "invert-disabled": colors.border["invert-disabled"].value,
101
+ primary: colors.border.primary.value,
102
+ secondary: colors.border.secondary.value,
103
+ subdued: colors.border.subdued.value,
104
+ success: colors.border.success.value,
105
+ warning: colors.border.warning.value,
106
+ },
107
+ },
108
+ fontFamily: {
109
+ inter: fontFamily.inter.value,
110
+ },
111
+ fontSize: {
112
+ hero: {
113
+ caption: fontSize.hero.value,
114
+ },
115
+ body: {
116
+ xxs: fontSize.body.xxs.value,
117
+ xs: fontSize.body.xs.value,
118
+ s: fontSize.body.s.value,
119
+ m: fontSize.body.m.value,
120
+ l: fontSize.body.l.value,
121
+ xl: fontSize.body.xl.value,
122
+ },
123
+ heading: {
124
+ xs: fontSize.heading.xs.value,
125
+ s: fontSize.heading.s.value,
126
+ m: fontSize.heading.m.value,
127
+ l: fontSize.heading.l.value,
128
+ xl: fontSize.heading.xl.value,
129
+ },
130
+ button: {
131
+ s: fontSize.button.s.value,
132
+ m: fontSize.button.m.value,
133
+ l: fontSize.button.l.value,
134
+ },
135
+ label: {
136
+ s: fontSize.label.s.value,
137
+ m: fontSize.label.m.value,
138
+ l: fontSize.label.l.value,
139
+ },
140
+ },
141
+ fontWeight: {
142
+ regular: fontWeight.regular.value,
143
+ medium: fontWeight.medium.value,
144
+ semiBold: fontWeight["semi-bold"].value,
145
+ bold: fontWeight.bold.value,
146
+ },
147
+ lineWeight: {
148
+ hero: {
149
+ caption: lineWeight.hero.value,
150
+ },
151
+ body: {
152
+ xxs: lineWeight.body.xxs.value,
153
+ xs: lineWeight.body.xs.value,
154
+ s: lineWeight.body.s.value,
155
+ m: lineWeight.body.m.value,
156
+ l: lineWeight.body.l.value,
157
+ xl: lineWeight.body.xl.value,
158
+ },
159
+ heading: {
160
+ xs: lineWeight.heading.xs.value,
161
+ s: lineWeight.heading.s.value,
162
+ m: lineWeight.heading.m.value,
163
+ l: lineWeight.heading.l.value,
164
+ xl: lineWeight.heading.xl.value,
165
+ },
166
+ button: {
167
+ s: lineWeight.button.s.value,
168
+ m: lineWeight.button.m.value,
169
+ l: lineWeight.button.l.value,
170
+ },
171
+ label: {
172
+ s: lineWeight.label.s.value,
173
+ m: lineWeight.label.m.value,
174
+ l: lineWeight.label.l.value,
175
+ },
176
+ },
177
+ elevation: {
178
+ none: elevation.none.value,
179
+ top: {
180
+ "1": elevation.top[1].value,
181
+ "2": elevation.top[2].value,
182
+ "3": elevation.top[3].value,
183
+ "4": elevation.top[4].value,
184
+ "5": elevation.top[5].value,
185
+ },
186
+ bottom: {
187
+ "1": elevation.bottom[1].value,
188
+ "2": elevation.bottom[2].value,
189
+ "3": elevation.bottom[3].value,
190
+ "4": elevation.bottom[4].value,
191
+ "5": elevation.bottom[5].value,
192
+ },
193
+ },
194
+ shape: {
195
+ border: {
196
+ radius: {
197
+ none: shape.border.radius.none.value,
198
+ "2xs": shape.border.radius["2xs"].value,
199
+ xs: shape.border.radius.xs.value,
200
+ sm: shape.border.radius.sm.value,
201
+ md: shape.border.radius.md.value,
202
+ lg: shape.border.radius.lg.value,
203
+ xl: shape.border.radius.xl.value,
204
+ "2xl": shape.border.radius["2xl"].value,
205
+ pill: shape.border.radius.pill.value,
206
+ button: shape.border.radius.button.value,
207
+ input: shape.border.radius.input.value,
208
+ },
209
+ width: {
210
+ "1": shape.border.width[1].value,
211
+ "2": shape.border.width[2].value,
212
+ "3": shape.border.width[3].value,
213
+ "4": shape.border.width[4].value,
214
+ "5": shape.border.width[5].value,
215
+ },
216
+ },
217
+ },
218
+ spacing: {
219
+ "4xs": spacing["4xs"].value,
220
+ "3xs": spacing["3xs"].value,
221
+ "2xs": spacing["2xs"].value,
222
+ xs: spacing.xs.value,
223
+ s: spacing.s.value,
224
+ md: spacing.md.value,
225
+ lg: spacing.lg.value,
226
+ xl: spacing.xl.value,
227
+ "2xl": spacing["2xl"].value,
228
+ "3xl": spacing["3xl"].value,
229
+ "4xl": spacing["4xl"].value,
230
+ "5xl": spacing["5xl"].value,
231
+ "6xl": spacing["6xl"].value,
232
+ "7xl": spacing["7xl"].value,
233
+ "8xl": spacing["8xl"].value,
234
+ },
235
+ zIndex: {
236
+ 100: zIndex[100].value,
237
+ 200: zIndex[200].value,
238
+ 300: zIndex[300].value,
239
+ 400: zIndex[400].value,
240
+ 500: zIndex[500].value,
241
+ 600: zIndex[600].value,
242
+ 700: zIndex[700].value,
243
+ 800: zIndex[800].value,
244
+ 900: zIndex[900].value,
245
+ },
246
+ breakpoint: {
247
+ xs: breakpoint.xs.value,
248
+ md: breakpoint.md.value,
249
+ lg: breakpoint.lg.value,
250
+ xl: breakpoint.xl.value,
251
+ },
252
+ };
253
+
254
+ createGlobalTheme(":root", vars, globalTheme);
255
+
256
+ export const varsThemeBase = vars;
@@ -0,0 +1,2 @@
1
+ export * from "./mediaQueries";
2
+ export * from "./globals.css";
@@ -0,0 +1,10 @@
1
+ import tokens from "@rarui/tokens/dist/js/tokens";
2
+
3
+ const { breakpoint } = tokens;
4
+
5
+ export const mediaQueries = {
6
+ xs: () => `screen and (min-width: ${breakpoint.xs.value})`,
7
+ md: () => `screen and (min-width: ${breakpoint.md.value})`,
8
+ lg: () => `screen and (min-width: ${breakpoint.lg.value})`,
9
+ xl: () => `screen and (min-width: ${breakpoint.xl.value})`,
10
+ };
@@ -0,0 +1,126 @@
1
+ import { createTheme } from "@vanilla-extract/css";
2
+ import tokens from "@rarui/tokens/dist/js/tokens";
3
+
4
+ import { vars } from "./contract.css";
5
+ import { globalTheme } from "./globals.css";
6
+
7
+ const colors = tokens.color.dark;
8
+ const elevation = tokens.elevation.dark;
9
+
10
+ const darkTheme = {
11
+ ...globalTheme,
12
+ colors: {
13
+ surface: {
14
+ background: colors.surface.background.value,
15
+ brand: colors.surface.brand.value,
16
+ "brand-hover": colors.surface["brand-hover"].value,
17
+ "brand-press": colors.surface["brand-press"].value,
18
+ "brand-secondary": colors.surface["brand-secondary"].value,
19
+ "brand-secondary-hover": colors.surface["brand-secondary-hover"].value,
20
+ "brand-secondary-press": colors.surface["brand-secondary-press"].value,
21
+ "brand-secondary-subdued":
22
+ colors.surface["brand-secondary-subdued"].value,
23
+ "brand-subdued": colors.surface["brand-subdued"].value,
24
+ disabled: colors.surface.disabled.value,
25
+ error: colors.surface.error.value,
26
+ "error-hover": colors.surface["error-hover"].value,
27
+ "error-press": colors.surface["error-press"].value,
28
+ "error-subdued": colors.surface["error-subdued"].value,
29
+ hover: colors.surface.hover.value,
30
+ info: colors.surface.info.value,
31
+ "info-hover": colors.surface["info-hover"].value,
32
+ "info-press": colors.surface["info-press"].value,
33
+ "info-subdued": colors.surface["info-subdued"].value,
34
+ invert: colors.surface.invert.value,
35
+ "invert-disabled": colors.surface["invert-disabled"].value,
36
+ "invert-hover": colors.surface["invert-hover"].value,
37
+ "invert-press": colors.surface["invert-press"].value,
38
+ "invert-secondary": colors.surface["invert-secondary"].value,
39
+ "on-brand-hover": colors.surface["on-brand-hover"].value,
40
+ "on-brand-press": colors.surface["on-brand-press"].value,
41
+ "on-brand-secondary-hover":
42
+ colors.surface["on-brand-secondary-hover"].value,
43
+ "on-brand-secondary-press":
44
+ colors.surface["on-brand-secondary-press"].value,
45
+ "on-error-hover": colors.surface["on-error-hover"].value,
46
+ "on-error-press": colors.surface["on-error-press"].value,
47
+ "on-info-hover": colors.surface["on-info-hover"].value,
48
+ "on-info-press": colors.surface["on-info-press"].value,
49
+ "on-success-hover": colors.surface["on-success-hover"].value,
50
+ "on-success-press": colors.surface["on-success-press"].value,
51
+ "on-warning-hover": colors.surface["on-warning-hover"].value,
52
+ "on-warning-press": colors.surface["on-warning-press"].value,
53
+ overlay: colors.surface.overlay.value,
54
+ press: colors.surface.press.value,
55
+ primary: colors.surface.primary.value,
56
+ secondary: colors.surface.secondary.value,
57
+ success: colors.surface.success.value,
58
+ "success-hover": colors.surface["success-hover"].value,
59
+ "success-press": colors.surface["success-press"].value,
60
+ "success-subdued": colors.surface["success-subdued"].value,
61
+ warning: colors.surface.warning.value,
62
+ "warning-hover": colors.surface["warning-hover"].value,
63
+ "warning-press": colors.surface["warning-press"].value,
64
+ "warning-subdued": colors.surface["warning-subdued"].value,
65
+ },
66
+ content: {
67
+ brand: colors.content.brand.value,
68
+ "brand-alt": colors.content["brand-alt"].value,
69
+ "brand-secondary": colors.content["brand-secondary"].value,
70
+ disabled: colors.content.disabled.value,
71
+ error: colors.content.error.value,
72
+ info: colors.content.info.value,
73
+ invert: colors.content.invert.value,
74
+ "invert-disabled": colors.content["invert-disabled"].value,
75
+ "invert-secondary": colors.content["invert-secondary"].value,
76
+ "on-brand": colors.content["on-brand"].value,
77
+ "on-brand-secondary": colors.content["on-brand-secondary"].value,
78
+ "on-error": colors.content["on-error"].value,
79
+ "on-info": colors.content["on-info"].value,
80
+ "on-success": colors.content["on-success"].value,
81
+ "on-warning": colors.content["on-warning"].value,
82
+ primary: colors.content.primary.value,
83
+ secondary: colors.content.secondary.value,
84
+ success: colors.content.success.value,
85
+ warning: colors.content.warning.value,
86
+ "warning-alt": colors.content["warning-alt"].value,
87
+ },
88
+ border: {
89
+ brand: colors.border.brand.value,
90
+ "brand-alt": colors.border["brand-alt"].value,
91
+ "brand-secondary": colors.border["brand-secondary"].value,
92
+ disabled: colors.border.disabled.value,
93
+ divider: colors.border.divider.value,
94
+ error: colors.border.error.value,
95
+ info: colors.border.info.value,
96
+ invert: colors.border.invert.value,
97
+ "invert-disabled": colors.border["invert-disabled"].value,
98
+ primary: colors.border.primary.value,
99
+ secondary: colors.border.secondary.value,
100
+ subdued: colors.border.subdued.value,
101
+ success: colors.border.success.value,
102
+ warning: colors.border.warning.value,
103
+ },
104
+ },
105
+ elevation: {
106
+ none: elevation.none.value,
107
+ top: {
108
+ "1": elevation.top[1].value,
109
+ "2": elevation.top[2].value,
110
+ "3": elevation.top[3].value,
111
+ "4": elevation.top[4].value,
112
+ "5": elevation.top[5].value,
113
+ },
114
+ bottom: {
115
+ "1": elevation.bottom[1].value,
116
+ "2": elevation.bottom[2].value,
117
+ "3": elevation.bottom[3].value,
118
+ "4": elevation.bottom[4].value,
119
+ "5": elevation.bottom[5].value,
120
+ },
121
+ },
122
+ };
123
+
124
+ export const variables = createTheme(vars, darkTheme);
125
+
126
+ export default variables;
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "include": ["./src"]
4
+ }
@@ -0,0 +1,30 @@
1
+ import path from "path";
2
+ import { plugins, rules, configuration, utils } from "@rarui/webpack";
3
+
4
+ const baseConfig = {
5
+ entry: {
6
+ "./themes/dark": "./src/themes/rarui-theme-dark.css.ts",
7
+ },
8
+ output: {
9
+ path: path.resolve(__dirname, "dist"),
10
+ library: "@rarui/styles",
11
+ },
12
+ module: { rules: [rules.cssLoaderExtractRule] },
13
+ };
14
+
15
+ const config = configuration.getConfiguration(baseConfig);
16
+
17
+ delete config.plugins;
18
+ config.plugins = [
19
+ plugins.vanillaExtractPlugin,
20
+ plugins.miniCssExtractPlugin,
21
+ plugins.cssHashRemoverPlugin,
22
+ plugins.dtsBundleGeneratorPlugin({
23
+ entries: [
24
+ `node ${utils.rootDir}/node_modules/.bin/dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts`,
25
+ `node ${utils.rootDir}/node_modules/.bin/dts-bundle-generator -o ./dist/themes/dark.d.ts ./src/themes/rarui-theme-dark.css.ts`,
26
+ ],
27
+ }),
28
+ ];
29
+
30
+ export default () => config;