@impulse-ui-native/theme 2.1.0 → 2.1.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.
- package/dist/constants/index.d.mts +10 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/style.constants.d.mts +14 -0
- package/dist/constants/style.constants.js +100 -0
- package/dist/constants/style.constants.js.map +1 -0
- package/dist/hooks/index.d.mts +28 -0
- package/dist/hooks/index.js +19 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-border.hook.d.mts +5 -0
- package/dist/hooks/use-border.hook.js +10 -0
- package/dist/hooks/use-border.hook.js.map +1 -0
- package/dist/hooks/use-colors.hook.d.mts +16 -0
- package/dist/hooks/use-colors.hook.js +10 -0
- package/dist/hooks/use-colors.hook.js.map +1 -0
- package/dist/hooks/use-components-tokens.hook.d.mts +16 -0
- package/dist/hooks/use-components-tokens.hook.js +10 -0
- package/dist/hooks/use-components-tokens.hook.js.map +1 -0
- package/dist/hooks/use-radii.hook.d.mts +5 -0
- package/dist/hooks/use-radii.hook.js +10 -0
- package/dist/hooks/use-radii.hook.js.map +1 -0
- package/dist/hooks/use-space.hook.d.mts +5 -0
- package/dist/hooks/use-space.hook.js +10 -0
- package/dist/hooks/use-space.hook.js.map +1 -0
- package/dist/hooks/use-style-props.hook.d.mts +13 -0
- package/dist/hooks/use-style-props.hook.js +10 -0
- package/dist/hooks/use-style-props.hook.js.map +1 -0
- package/dist/hooks/use-theme.hook.d.mts +16 -0
- package/dist/hooks/use-theme.hook.js +8 -0
- package/dist/hooks/use-theme.hook.js.map +1 -0
- package/dist/hooks/use-themed-styles.d.mts +22 -0
- package/dist/hooks/use-themed-styles.js +16 -0
- package/dist/hooks/use-themed-styles.js.map +1 -0
- package/dist/index.d.mts +39 -574
- package/dist/index.js +6 -1069
- package/dist/index.js.map +1 -1
- package/dist/providers/index.d.mts +16 -0
- package/dist/providers/index.js +2 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/theme.provider.d.mts +29 -0
- package/dist/providers/theme.provider.js +35 -0
- package/dist/providers/theme.provider.js.map +1 -0
- package/dist/theme/create-button-tokens.d.mts +16 -0
- package/dist/theme/create-button-tokens.js +78 -0
- package/dist/theme/create-button-tokens.js.map +1 -0
- package/dist/theme/create-control-tokens.d.mts +20 -0
- package/dist/theme/create-control-tokens.js +153 -0
- package/dist/theme/create-control-tokens.js.map +1 -0
- package/dist/theme/create-data-state-tokens.d.mts +16 -0
- package/dist/theme/create-data-state-tokens.js +23 -0
- package/dist/theme/create-data-state-tokens.js.map +1 -0
- package/dist/theme/create-datetime-picker.d.mts +16 -0
- package/dist/theme/create-datetime-picker.js +43 -0
- package/dist/theme/create-datetime-picker.js.map +1 -0
- package/dist/theme/create-flyout-tokens.d.mts +16 -0
- package/dist/theme/create-flyout-tokens.js +27 -0
- package/dist/theme/create-flyout-tokens.js.map +1 -0
- package/dist/theme/create-icon-button-tokens.d.mts +16 -0
- package/dist/theme/create-icon-button-tokens.js +72 -0
- package/dist/theme/create-icon-button-tokens.js.map +1 -0
- package/dist/theme/create-select-tokens.d.mts +16 -0
- package/dist/theme/create-select-tokens.js +14 -0
- package/dist/theme/create-select-tokens.js.map +1 -0
- package/dist/theme/create-skeleton-tokens.d.mts +16 -0
- package/dist/theme/create-skeleton-tokens.js +21 -0
- package/dist/theme/create-skeleton-tokens.js.map +1 -0
- package/dist/theme/create-tag-tokens.d.mts +16 -0
- package/dist/theme/create-tag-tokens.js +102 -0
- package/dist/theme/create-tag-tokens.js.map +1 -0
- package/dist/theme/create-time-picker-tokens.d.mts +16 -0
- package/dist/theme/create-time-picker-tokens.js +40 -0
- package/dist/theme/create-time-picker-tokens.js.map +1 -0
- package/dist/theme/dark.theme.d.mts +16 -0
- package/dist/theme/dark.theme.js +24 -0
- package/dist/theme/dark.theme.js.map +1 -0
- package/dist/theme/index.d.mts +16 -0
- package/dist/theme/index.js +8 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/light.theme.d.mts +16 -0
- package/dist/theme/light.theme.js +24 -0
- package/dist/theme/light.theme.js.map +1 -0
- package/dist/theme/tokens.theme.d.mts +29 -0
- package/dist/theme/tokens.theme.js +257 -0
- package/dist/theme/tokens.theme.js.map +1 -0
- package/dist/types/border.types.d.mts +22 -0
- package/dist/types/border.types.js +1 -0
- package/dist/types/border.types.js.map +1 -0
- package/dist/types/buttons-tokens.types.d.mts +42 -0
- package/dist/types/buttons-tokens.types.js +1 -0
- package/dist/types/buttons-tokens.types.js.map +1 -0
- package/dist/types/chart.types.d.mts +19 -0
- package/dist/types/chart.types.js +1 -0
- package/dist/types/chart.types.js.map +1 -0
- package/dist/types/color.types.d.mts +9 -0
- package/dist/types/color.types.js +1 -0
- package/dist/types/color.types.js.map +1 -0
- package/dist/types/components.types.d.mts +4 -0
- package/dist/types/components.types.js +1 -0
- package/dist/types/components.types.js.map +1 -0
- package/dist/types/control-tokes.types.d.mts +59 -0
- package/dist/types/control-tokes.types.js +1 -0
- package/dist/types/control-tokes.types.js.map +1 -0
- package/dist/types/data-state-tokens.types.d.mts +23 -0
- package/dist/types/data-state-tokens.types.js +1 -0
- package/dist/types/data-state-tokens.types.js.map +1 -0
- package/dist/types/datetime-picker-tokens.types.d.mts +47 -0
- package/dist/types/datetime-picker-tokens.types.js +1 -0
- package/dist/types/datetime-picker-tokens.types.js.map +1 -0
- package/dist/types/dimension.types.d.mts +14 -0
- package/dist/types/dimension.types.js +1 -0
- package/dist/types/dimension.types.js.map +1 -0
- package/dist/types/flex.types.d.mts +25 -0
- package/dist/types/flex.types.js +1 -0
- package/dist/types/flex.types.js.map +1 -0
- package/dist/types/flyout-tokens.types.d.mts +25 -0
- package/dist/types/flyout-tokens.types.js +1 -0
- package/dist/types/flyout-tokens.types.js.map +1 -0
- package/dist/types/index.d.mts +22 -0
- package/dist/types/index.js +22 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/select-tokens.types.d.mts +11 -0
- package/dist/types/select-tokens.types.js +1 -0
- package/dist/types/select-tokens.types.js.map +1 -0
- package/dist/types/shadow.types.d.mts +20 -0
- package/dist/types/shadow.types.js +1 -0
- package/dist/types/shadow.types.js.map +1 -0
- package/dist/types/skeleton-tokens.types.d.mts +18 -0
- package/dist/types/skeleton-tokens.types.js +1 -0
- package/dist/types/skeleton-tokens.types.js.map +1 -0
- package/dist/types/spacing.types.d.mts +20 -0
- package/dist/types/spacing.types.js +1 -0
- package/dist/types/spacing.types.js.map +1 -0
- package/dist/types/style.types.d.mts +14 -0
- package/dist/types/style.types.js +1 -0
- package/dist/types/style.types.js.map +1 -0
- package/dist/types/tag-tokens.types.d.mts +28 -0
- package/dist/types/tag-tokens.types.js +1 -0
- package/dist/types/tag-tokens.types.js.map +1 -0
- package/dist/types/theme-provider.types.d.mts +90 -0
- package/dist/types/theme-provider.types.js +1 -0
- package/dist/types/theme-provider.types.js.map +1 -0
- package/dist/types/time-picker-token.types.d.mts +34 -0
- package/dist/types/time-picker-token.types.js +1 -0
- package/dist/types/time-picker-token.types.js.map +1 -0
- package/dist/types/tokens.types.d.mts +27 -0
- package/dist/types/tokens.types.js +1 -0
- package/dist/types/tokens.types.js.map +1 -0
- package/dist/types/typography.types.d.mts +23 -0
- package/dist/types/typography.types.js +1 -0
- package/dist/types/typography.types.js.map +1 -0
- package/dist/utils/index.d.mts +22 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/style.utils.d.mts +27 -0
- package/dist/utils/style.utils.js +49 -0
- package/dist/utils/style.utils.js.map +1 -0
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1,1070 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
marginRight: 0,
|
|
8
|
-
marginHorizontal: 0,
|
|
9
|
-
marginVertical: 0,
|
|
10
|
-
padding: 0,
|
|
11
|
-
paddingTop: 0,
|
|
12
|
-
paddingBottom: 0,
|
|
13
|
-
paddingLeft: 0,
|
|
14
|
-
paddingRight: 0,
|
|
15
|
-
paddingHorizontal: 0,
|
|
16
|
-
paddingVertical: 0,
|
|
17
|
-
color: 0,
|
|
18
|
-
backgroundColor: 0,
|
|
19
|
-
opacity: 0,
|
|
20
|
-
shadow: 0,
|
|
21
|
-
shadowPosition: 0,
|
|
22
|
-
shadowColor: 0,
|
|
23
|
-
shadowOpacity: 0,
|
|
24
|
-
shadowRadius: 0,
|
|
25
|
-
shadowOffset: 0,
|
|
26
|
-
elevation: 0,
|
|
27
|
-
borderRadius: 0,
|
|
28
|
-
borderTopLeftRadius: 0,
|
|
29
|
-
borderTopRightRadius: 0,
|
|
30
|
-
borderBottomLeftRadius: 0,
|
|
31
|
-
borderBottomRightRadius: 0,
|
|
32
|
-
borderWidth: 0,
|
|
33
|
-
borderTopWidth: 0,
|
|
34
|
-
borderRightWidth: 0,
|
|
35
|
-
borderBottomWidth: 0,
|
|
36
|
-
borderLeftWidth: 0,
|
|
37
|
-
borderColor: 0,
|
|
38
|
-
borderTopColor: 0,
|
|
39
|
-
borderRightColor: 0,
|
|
40
|
-
borderBottomColor: 0,
|
|
41
|
-
borderLeftColor: 0,
|
|
42
|
-
borderStyle: 0,
|
|
43
|
-
fontSize: 0,
|
|
44
|
-
fontFamily: 0,
|
|
45
|
-
fontWeight: 0,
|
|
46
|
-
fontStyle: 0,
|
|
47
|
-
fontVariant: 0,
|
|
48
|
-
letterSpacing: 0,
|
|
49
|
-
lineHeight: 0,
|
|
50
|
-
textAlign: 0,
|
|
51
|
-
textDecorationLine: 0,
|
|
52
|
-
textDecorationStyle: 0,
|
|
53
|
-
textDecorationColor: 0,
|
|
54
|
-
textTransform: 0,
|
|
55
|
-
includeFontPadding: 0,
|
|
56
|
-
textAlignVertical: 0,
|
|
57
|
-
writingDirection: 0,
|
|
58
|
-
flex: 0,
|
|
59
|
-
flexGrow: 0,
|
|
60
|
-
flexShrink: 0,
|
|
61
|
-
flexBasis: 0,
|
|
62
|
-
flexDirection: 0,
|
|
63
|
-
flexWrap: 0,
|
|
64
|
-
justifyContent: 0,
|
|
65
|
-
alignItems: 0,
|
|
66
|
-
alignSelf: 0,
|
|
67
|
-
alignContent: 0,
|
|
68
|
-
gap: 0,
|
|
69
|
-
rowGap: 0,
|
|
70
|
-
columnGap: 0,
|
|
71
|
-
position: 0,
|
|
72
|
-
top: 0,
|
|
73
|
-
right: 0,
|
|
74
|
-
bottom: 0,
|
|
75
|
-
left: 0,
|
|
76
|
-
zIndex: 0,
|
|
77
|
-
width: 0,
|
|
78
|
-
height: 0,
|
|
79
|
-
minWidth: 0,
|
|
80
|
-
maxWidth: 0,
|
|
81
|
-
minHeight: 0,
|
|
82
|
-
maxHeight: 0,
|
|
83
|
-
aspectRatio: 0,
|
|
84
|
-
overflow: 0
|
|
85
|
-
};
|
|
86
|
-
var StylePropsSet = new Set(
|
|
87
|
-
Object.keys(StylePropsRecord)
|
|
88
|
-
);
|
|
89
|
-
var shadowScale = {
|
|
90
|
-
none: { radius: 0, opacity: 0, elevation: 0 },
|
|
91
|
-
xs: { radius: 2, opacity: 0.08, elevation: 1 },
|
|
92
|
-
sm: { radius: 4, opacity: 0.1, elevation: 2 },
|
|
93
|
-
md: { radius: 8, opacity: 0.15, elevation: 4 },
|
|
94
|
-
lg: { radius: 16, opacity: 0.18, elevation: 8 },
|
|
95
|
-
xl: { radius: 24, opacity: 0.22, elevation: 12 }
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// src/hooks/use-border.hook.ts
|
|
99
|
-
import { useMemo as useMemo2 } from "react";
|
|
100
|
-
|
|
101
|
-
// src/providers/theme.provider.tsx
|
|
102
|
-
import {
|
|
103
|
-
createContext,
|
|
104
|
-
memo,
|
|
105
|
-
useContext,
|
|
106
|
-
useMemo
|
|
107
|
-
} from "react";
|
|
108
|
-
import { merge } from "@impulse-ui-native/core";
|
|
109
|
-
|
|
110
|
-
// src/theme/create-button-tokens.ts
|
|
111
|
-
function createButtonTokens(tokens) {
|
|
112
|
-
const primary = tokens.colors.primary.value;
|
|
113
|
-
const primaryContrast = tokens.colors.primary.contrast;
|
|
114
|
-
const secondary = tokens.colors.secondary.value;
|
|
115
|
-
const secondaryContrast = tokens.colors.secondary.contrast;
|
|
116
|
-
const neutral = tokens.colors.neutral;
|
|
117
|
-
const disabledColor = tokens.colors.text.disabled;
|
|
118
|
-
return {
|
|
119
|
-
borderWidth: tokens.borderSize.sm,
|
|
120
|
-
borderRadius: tokens.radii.md,
|
|
121
|
-
sizes: {
|
|
122
|
-
small: {
|
|
123
|
-
height: 32,
|
|
124
|
-
paddingVertical: 6,
|
|
125
|
-
paddingHorizontal: 12,
|
|
126
|
-
fontSize: tokens.fontSize.xsm
|
|
127
|
-
},
|
|
128
|
-
medium: {
|
|
129
|
-
height: 40,
|
|
130
|
-
paddingVertical: 8,
|
|
131
|
-
paddingHorizontal: 16,
|
|
132
|
-
fontSize: tokens.fontSize.sm
|
|
133
|
-
},
|
|
134
|
-
large: {
|
|
135
|
-
height: 48,
|
|
136
|
-
paddingVertical: 10,
|
|
137
|
-
paddingHorizontal: 20,
|
|
138
|
-
fontSize: tokens.fontSize.sm
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
variants: {
|
|
142
|
-
filled: {
|
|
143
|
-
backgroundColor: primary,
|
|
144
|
-
borderColor: primary,
|
|
145
|
-
color: primaryContrast,
|
|
146
|
-
disabledBackgroundColor: neutral["5"],
|
|
147
|
-
disabledBorderColor: neutral["5"],
|
|
148
|
-
disabledColor
|
|
149
|
-
},
|
|
150
|
-
outlined: {
|
|
151
|
-
backgroundColor: "transparent",
|
|
152
|
-
borderColor: primary,
|
|
153
|
-
color: primary,
|
|
154
|
-
disabledBackgroundColor: "transparent",
|
|
155
|
-
disabledBorderColor: neutral["5"],
|
|
156
|
-
disabledColor
|
|
157
|
-
},
|
|
158
|
-
soft: {
|
|
159
|
-
backgroundColor: secondary,
|
|
160
|
-
borderColor: secondary,
|
|
161
|
-
color: secondaryContrast,
|
|
162
|
-
disabledBackgroundColor: neutral["3"],
|
|
163
|
-
disabledBorderColor: neutral["3"],
|
|
164
|
-
disabledColor
|
|
165
|
-
},
|
|
166
|
-
ghost: {
|
|
167
|
-
backgroundColor: "transparent",
|
|
168
|
-
borderColor: "transparent",
|
|
169
|
-
color: primary,
|
|
170
|
-
disabledBackgroundColor: "transparent",
|
|
171
|
-
disabledBorderColor: "transparent",
|
|
172
|
-
disabledColor
|
|
173
|
-
},
|
|
174
|
-
plain: {
|
|
175
|
-
backgroundColor: "transparent",
|
|
176
|
-
borderColor: "transparent",
|
|
177
|
-
color: primary,
|
|
178
|
-
disabledBackgroundColor: "transparent",
|
|
179
|
-
disabledBorderColor: "transparent",
|
|
180
|
-
disabledColor
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// src/theme/create-control-tokens.ts
|
|
187
|
-
function createControlAddonTokens(tokens) {
|
|
188
|
-
return {
|
|
189
|
-
marginHorizontal: tokens.space.xxs,
|
|
190
|
-
hitSlop: tokens.space.sm,
|
|
191
|
-
iconColor: tokens.colors.text.secondary,
|
|
192
|
-
errorIconColor: tokens.colors.feedback.error.value,
|
|
193
|
-
disabledIconColor: tokens.colors.text.disabled
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
function createControlContainerTokens(tokens) {
|
|
197
|
-
const ErrorColor = tokens.colors.feedback.error.value;
|
|
198
|
-
const TransparentColor = "transparent";
|
|
199
|
-
return {
|
|
200
|
-
borderWidth: tokens.borderSize.sm,
|
|
201
|
-
borderRadius: tokens.radii.sm,
|
|
202
|
-
disabledOpacity: 0.7,
|
|
203
|
-
sizes: {
|
|
204
|
-
small: {
|
|
205
|
-
height: 32,
|
|
206
|
-
paddingHorizontal: tokens.space.xs
|
|
207
|
-
},
|
|
208
|
-
medium: {
|
|
209
|
-
height: 40,
|
|
210
|
-
paddingHorizontal: tokens.space.xs
|
|
211
|
-
},
|
|
212
|
-
large: {
|
|
213
|
-
height: 48,
|
|
214
|
-
paddingHorizontal: tokens.space.xs
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
variants: {
|
|
218
|
-
filled: {
|
|
219
|
-
backgroundColor: tokens.colors.surface.secondary.value,
|
|
220
|
-
borderColor: TransparentColor,
|
|
221
|
-
errorBorderColor: ErrorColor,
|
|
222
|
-
disabledBackgroundColor: tokens.colors.neutral["2"],
|
|
223
|
-
disabledBorderColor: TransparentColor
|
|
224
|
-
},
|
|
225
|
-
outlined: {
|
|
226
|
-
backgroundColor: TransparentColor,
|
|
227
|
-
borderColor: tokens.colors.neutral["5"],
|
|
228
|
-
errorBorderColor: ErrorColor,
|
|
229
|
-
disabledBackgroundColor: TransparentColor,
|
|
230
|
-
disabledBorderColor: tokens.colors.neutral["5"]
|
|
231
|
-
},
|
|
232
|
-
soft: {
|
|
233
|
-
backgroundColor: tokens.colors.accent.value,
|
|
234
|
-
borderColor: TransparentColor,
|
|
235
|
-
errorBorderColor: ErrorColor,
|
|
236
|
-
disabledBackgroundColor: tokens.colors.neutral["2"],
|
|
237
|
-
disabledBorderColor: TransparentColor
|
|
238
|
-
},
|
|
239
|
-
ghost: {
|
|
240
|
-
backgroundColor: TransparentColor,
|
|
241
|
-
borderColor: TransparentColor,
|
|
242
|
-
errorBorderColor: ErrorColor,
|
|
243
|
-
disabledBackgroundColor: TransparentColor,
|
|
244
|
-
disabledBorderColor: TransparentColor
|
|
245
|
-
},
|
|
246
|
-
plain: {
|
|
247
|
-
backgroundColor: TransparentColor,
|
|
248
|
-
borderColor: TransparentColor,
|
|
249
|
-
errorBorderColor: ErrorColor,
|
|
250
|
-
disabledBackgroundColor: TransparentColor,
|
|
251
|
-
disabledBorderColor: TransparentColor
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
function createControlErrorTokens(tokens) {
|
|
257
|
-
return {
|
|
258
|
-
marginTop: tokens.space.xxs,
|
|
259
|
-
color: tokens.colors.feedback.error.value,
|
|
260
|
-
fontSize: tokens.fontSize.xs
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
function createControlInputTokens(tokens) {
|
|
264
|
-
return {
|
|
265
|
-
flex: 1,
|
|
266
|
-
fontFamily: tokens.fontFamily.normal[400],
|
|
267
|
-
paddingHorizontal: tokens.space.xxs,
|
|
268
|
-
sizes: {
|
|
269
|
-
small: {
|
|
270
|
-
fontSize: tokens.fontSize.xs
|
|
271
|
-
},
|
|
272
|
-
medium: {
|
|
273
|
-
fontSize: tokens.fontSize.xsm
|
|
274
|
-
},
|
|
275
|
-
large: {
|
|
276
|
-
fontSize: tokens.fontSize.sm
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
variants: {
|
|
280
|
-
filled: {
|
|
281
|
-
color: tokens.colors.text.primary,
|
|
282
|
-
placeholderColor: tokens.colors.text.disabled,
|
|
283
|
-
disabledColor: tokens.colors.text.disabled,
|
|
284
|
-
disabledPlaceholderColor: tokens.colors.text.disabled,
|
|
285
|
-
errorColor: tokens.colors.text.primary,
|
|
286
|
-
errorPlaceholderColor: tokens.colors.feedback.error.value
|
|
287
|
-
},
|
|
288
|
-
outlined: {
|
|
289
|
-
color: tokens.colors.text.primary,
|
|
290
|
-
placeholderColor: tokens.colors.text.disabled,
|
|
291
|
-
disabledColor: tokens.colors.text.disabled,
|
|
292
|
-
disabledPlaceholderColor: tokens.colors.text.disabled,
|
|
293
|
-
errorColor: tokens.colors.text.primary,
|
|
294
|
-
errorPlaceholderColor: tokens.colors.feedback.error.value
|
|
295
|
-
},
|
|
296
|
-
soft: {
|
|
297
|
-
color: tokens.colors.accent.contrast,
|
|
298
|
-
placeholderColor: tokens.colors.accent.contrast,
|
|
299
|
-
disabledColor: tokens.colors.text.disabled,
|
|
300
|
-
disabledPlaceholderColor: tokens.colors.text.disabled,
|
|
301
|
-
errorColor: tokens.colors.accent.contrast,
|
|
302
|
-
errorPlaceholderColor: tokens.colors.feedback.error.value
|
|
303
|
-
},
|
|
304
|
-
ghost: {
|
|
305
|
-
color: tokens.colors.text.primary,
|
|
306
|
-
placeholderColor: tokens.colors.text.disabled,
|
|
307
|
-
disabledColor: tokens.colors.text.disabled,
|
|
308
|
-
disabledPlaceholderColor: tokens.colors.text.disabled,
|
|
309
|
-
errorColor: tokens.colors.text.primary,
|
|
310
|
-
errorPlaceholderColor: tokens.colors.feedback.error.value
|
|
311
|
-
},
|
|
312
|
-
plain: {
|
|
313
|
-
color: tokens.colors.text.primary,
|
|
314
|
-
placeholderColor: tokens.colors.text.disabled,
|
|
315
|
-
disabledColor: tokens.colors.text.disabled,
|
|
316
|
-
disabledPlaceholderColor: tokens.colors.text.disabled,
|
|
317
|
-
errorColor: tokens.colors.text.primary,
|
|
318
|
-
errorPlaceholderColor: tokens.colors.feedback.error.value
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
function createControlLabelTokens(tokens) {
|
|
324
|
-
return {
|
|
325
|
-
marginBottom: tokens.space.xxs,
|
|
326
|
-
fontSize: tokens.fontSize.xsm,
|
|
327
|
-
color: tokens.colors.text.secondary,
|
|
328
|
-
disabledColor: tokens.colors.text.disabled,
|
|
329
|
-
errorColor: tokens.colors.feedback.error.value
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
// src/theme/create-data-state-tokens.ts
|
|
334
|
-
function createDataStateTokens(tokens) {
|
|
335
|
-
return {
|
|
336
|
-
details: {
|
|
337
|
-
gap: 10,
|
|
338
|
-
iconSize: 150,
|
|
339
|
-
iconColor: tokens.colors.primary.value
|
|
340
|
-
},
|
|
341
|
-
actionsFooter: {
|
|
342
|
-
gap: 10
|
|
343
|
-
},
|
|
344
|
-
content: {
|
|
345
|
-
zIndex: 1
|
|
346
|
-
},
|
|
347
|
-
loading: {
|
|
348
|
-
transitionDuration: 250,
|
|
349
|
-
loaderZIndex: 1
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
// src/theme/create-datetime-picker.ts
|
|
355
|
-
function createDatetimePickerTokens(tokens) {
|
|
356
|
-
return {
|
|
357
|
-
calendar: {
|
|
358
|
-
dayNamesMarginBottom: tokens.space.msm,
|
|
359
|
-
weeksGap: tokens.space.xxs
|
|
360
|
-
},
|
|
361
|
-
day: {
|
|
362
|
-
size: 40,
|
|
363
|
-
borderRadius: tokens.radii.sm,
|
|
364
|
-
color: tokens.colors.text.primary,
|
|
365
|
-
outsideMonthColor: tokens.colors.neutral["5"],
|
|
366
|
-
selectedBackgroundColor: tokens.colors.primary.value,
|
|
367
|
-
selectedColor: tokens.colors.primary.contrast,
|
|
368
|
-
rangeBackgroundColor: tokens.colors.secondary.value,
|
|
369
|
-
rangeColor: tokens.colors.secondary.contrast
|
|
370
|
-
},
|
|
371
|
-
datePickerFlyout: {
|
|
372
|
-
gap: tokens.space.msm
|
|
373
|
-
},
|
|
374
|
-
datetimePickerFlyout: {
|
|
375
|
-
gap: tokens.space.msm
|
|
376
|
-
},
|
|
377
|
-
datetimeRangePickerFlyout: {
|
|
378
|
-
gap: tokens.space.msm,
|
|
379
|
-
timeInputsGap: tokens.space.xs
|
|
380
|
-
},
|
|
381
|
-
flyoutActions: {
|
|
382
|
-
gap: tokens.space.msm,
|
|
383
|
-
buttonsGap: tokens.space.xs,
|
|
384
|
-
clearColor: tokens.colors.primary.value
|
|
385
|
-
},
|
|
386
|
-
quickDateOptions: {
|
|
387
|
-
gap: tokens.space.xs
|
|
388
|
-
},
|
|
389
|
-
visibleDateSelect: {
|
|
390
|
-
gap: tokens.space.xs
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
// src/theme/create-flyout-tokens.ts
|
|
396
|
-
function createFlyoutTokens(tokens) {
|
|
397
|
-
return {
|
|
398
|
-
zIndexBase: 100,
|
|
399
|
-
maxHeightRatio: 0.7,
|
|
400
|
-
overlayColor: tokens.colors.black,
|
|
401
|
-
overlayVisibleOpacity: 0.4,
|
|
402
|
-
backgroundColor: tokens.colors.surface.secondary.value,
|
|
403
|
-
contentPaddingHorizontal: tokens.space.md,
|
|
404
|
-
borderRadius: tokens.radii.xl,
|
|
405
|
-
hiddenOpacity: 0,
|
|
406
|
-
title: {
|
|
407
|
-
paddingVertical: tokens.space.msm,
|
|
408
|
-
paddingHorizontal: tokens.space.md
|
|
409
|
-
},
|
|
410
|
-
handle: {
|
|
411
|
-
containerHeight: 32,
|
|
412
|
-
width: "25%",
|
|
413
|
-
height: 6,
|
|
414
|
-
borderRadius: tokens.radii.round,
|
|
415
|
-
backgroundColor: tokens.colors.surface.primary.value
|
|
416
|
-
}
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
// src/theme/create-icon-button-tokens.ts
|
|
421
|
-
function createIconButtonTokens(tokens) {
|
|
422
|
-
const primary = tokens.colors.primary.value;
|
|
423
|
-
const primaryContrast = tokens.colors.primary.contrast;
|
|
424
|
-
const secondary = tokens.colors.secondary.value;
|
|
425
|
-
const secondaryContrast = tokens.colors.secondary.contrast;
|
|
426
|
-
const neutral = tokens.colors.neutral;
|
|
427
|
-
const disabledColor = tokens.colors.text.disabled;
|
|
428
|
-
return {
|
|
429
|
-
borderWidth: tokens.borderSize.sm,
|
|
430
|
-
borderRadius: tokens.radii.md,
|
|
431
|
-
sizes: {
|
|
432
|
-
small: {
|
|
433
|
-
size: 32,
|
|
434
|
-
padding: 6
|
|
435
|
-
},
|
|
436
|
-
medium: {
|
|
437
|
-
size: 40,
|
|
438
|
-
padding: 8
|
|
439
|
-
},
|
|
440
|
-
large: {
|
|
441
|
-
size: 48,
|
|
442
|
-
padding: 10
|
|
443
|
-
}
|
|
444
|
-
},
|
|
445
|
-
variants: {
|
|
446
|
-
filled: {
|
|
447
|
-
backgroundColor: primary,
|
|
448
|
-
borderColor: primary,
|
|
449
|
-
color: primaryContrast,
|
|
450
|
-
disabledBackgroundColor: neutral["5"],
|
|
451
|
-
disabledBorderColor: neutral["5"],
|
|
452
|
-
disabledColor
|
|
453
|
-
},
|
|
454
|
-
outlined: {
|
|
455
|
-
backgroundColor: "transparent",
|
|
456
|
-
borderColor: primary,
|
|
457
|
-
color: primary,
|
|
458
|
-
disabledBackgroundColor: "transparent",
|
|
459
|
-
disabledBorderColor: neutral["5"],
|
|
460
|
-
disabledColor
|
|
461
|
-
},
|
|
462
|
-
soft: {
|
|
463
|
-
backgroundColor: secondary,
|
|
464
|
-
borderColor: secondary,
|
|
465
|
-
color: secondaryContrast,
|
|
466
|
-
disabledBackgroundColor: neutral["3"],
|
|
467
|
-
disabledBorderColor: neutral["3"],
|
|
468
|
-
disabledColor
|
|
469
|
-
},
|
|
470
|
-
ghost: {
|
|
471
|
-
backgroundColor: "transparent",
|
|
472
|
-
borderColor: "transparent",
|
|
473
|
-
color: primary,
|
|
474
|
-
disabledBackgroundColor: "transparent",
|
|
475
|
-
disabledBorderColor: "transparent",
|
|
476
|
-
disabledColor
|
|
477
|
-
},
|
|
478
|
-
plain: {
|
|
479
|
-
backgroundColor: "transparent",
|
|
480
|
-
borderColor: "transparent",
|
|
481
|
-
color: primary,
|
|
482
|
-
disabledBackgroundColor: "transparent",
|
|
483
|
-
disabledBorderColor: "transparent",
|
|
484
|
-
disabledColor
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
// src/theme/create-select-tokens.ts
|
|
491
|
-
function createSelectTokens(tokens) {
|
|
492
|
-
return {
|
|
493
|
-
option: {
|
|
494
|
-
padding: tokens.space.sm,
|
|
495
|
-
selectedIconColor: tokens.colors.primary.value,
|
|
496
|
-
selectedIconVisibleOpacity: 1,
|
|
497
|
-
selectedIconHiddenOpacity: 0
|
|
498
|
-
}
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
// src/theme/create-skeleton-tokens.ts
|
|
503
|
-
function createSkeletonTokens(tokens) {
|
|
504
|
-
const boneColor = tokens.colors.neutral["5"];
|
|
505
|
-
return {
|
|
506
|
-
bone: {
|
|
507
|
-
backgroundColor: boneColor,
|
|
508
|
-
borderColor: boneColor,
|
|
509
|
-
initialOpacity: 1,
|
|
510
|
-
animatedOpacity: 0.4,
|
|
511
|
-
animationDuration: 1e3
|
|
512
|
-
},
|
|
513
|
-
text: {
|
|
514
|
-
alignSelf: "flex-start",
|
|
515
|
-
textTransform: "uppercase",
|
|
516
|
-
opacity: 0
|
|
517
|
-
}
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
// src/theme/create-tag-tokens.ts
|
|
522
|
-
function createTagTokens(tokens) {
|
|
523
|
-
const neutral = tokens.colors.neutral;
|
|
524
|
-
const disabledColor = tokens.colors.text.disabled;
|
|
525
|
-
const createVariants = (value, contrast) => ({
|
|
526
|
-
filled: {
|
|
527
|
-
backgroundColor: value,
|
|
528
|
-
borderColor: value,
|
|
529
|
-
color: contrast,
|
|
530
|
-
disabledBackgroundColor: neutral["4"],
|
|
531
|
-
disabledBorderColor: neutral["6"],
|
|
532
|
-
disabledColor
|
|
533
|
-
},
|
|
534
|
-
outlined: {
|
|
535
|
-
backgroundColor: "transparent",
|
|
536
|
-
borderColor: value,
|
|
537
|
-
color: value,
|
|
538
|
-
disabledBackgroundColor: "transparent",
|
|
539
|
-
disabledBorderColor: neutral["6"],
|
|
540
|
-
disabledColor
|
|
541
|
-
},
|
|
542
|
-
soft: {
|
|
543
|
-
backgroundColor: contrast,
|
|
544
|
-
borderColor: contrast,
|
|
545
|
-
color: value,
|
|
546
|
-
disabledBackgroundColor: neutral["3"],
|
|
547
|
-
disabledBorderColor: neutral["3"],
|
|
548
|
-
disabledColor
|
|
549
|
-
},
|
|
550
|
-
ghost: {
|
|
551
|
-
backgroundColor: "transparent",
|
|
552
|
-
borderColor: "transparent",
|
|
553
|
-
color: value,
|
|
554
|
-
disabledBackgroundColor: "transparent",
|
|
555
|
-
disabledBorderColor: "transparent",
|
|
556
|
-
disabledColor
|
|
557
|
-
},
|
|
558
|
-
plain: {
|
|
559
|
-
backgroundColor: "transparent",
|
|
560
|
-
borderColor: "transparent",
|
|
561
|
-
color: value,
|
|
562
|
-
disabledBackgroundColor: "transparent",
|
|
563
|
-
disabledBorderColor: "transparent",
|
|
564
|
-
disabledColor
|
|
565
|
-
}
|
|
566
|
-
});
|
|
567
|
-
return {
|
|
568
|
-
borderWidth: tokens.borderSize.sm,
|
|
569
|
-
borderRadius: tokens.radii.round,
|
|
570
|
-
gap: tokens.space.xxs,
|
|
571
|
-
iconMarginLeft: tokens.borderSize.md,
|
|
572
|
-
sizes: {
|
|
573
|
-
small: {
|
|
574
|
-
height: 24,
|
|
575
|
-
paddingHorizontal: tokens.space.xs,
|
|
576
|
-
minWidth: tokens.space.xl,
|
|
577
|
-
fontSize: tokens.fontSize.xs
|
|
578
|
-
},
|
|
579
|
-
medium: {
|
|
580
|
-
height: 28,
|
|
581
|
-
paddingHorizontal: tokens.space.xs,
|
|
582
|
-
minWidth: tokens.space.xxl,
|
|
583
|
-
fontSize: tokens.fontSize.xsm
|
|
584
|
-
},
|
|
585
|
-
large: {
|
|
586
|
-
height: 32,
|
|
587
|
-
paddingHorizontal: tokens.space.mxs,
|
|
588
|
-
minWidth: tokens.space.xxl,
|
|
589
|
-
fontSize: tokens.fontSize.xsm
|
|
590
|
-
}
|
|
591
|
-
},
|
|
592
|
-
colors: {
|
|
593
|
-
primary: createVariants(
|
|
594
|
-
tokens.colors.primary.value,
|
|
595
|
-
tokens.colors.primary.contrast
|
|
596
|
-
),
|
|
597
|
-
secondary: createVariants(
|
|
598
|
-
tokens.colors.secondary.value,
|
|
599
|
-
tokens.colors.secondary.contrast
|
|
600
|
-
),
|
|
601
|
-
error: createVariants(
|
|
602
|
-
tokens.colors.feedback.error.value,
|
|
603
|
-
tokens.colors.feedback.error.contrast
|
|
604
|
-
),
|
|
605
|
-
warning: createVariants(
|
|
606
|
-
tokens.colors.feedback.warning.value,
|
|
607
|
-
tokens.colors.feedback.warning.contrast
|
|
608
|
-
),
|
|
609
|
-
success: createVariants(
|
|
610
|
-
tokens.colors.feedback.success.value,
|
|
611
|
-
tokens.colors.feedback.success.contrast
|
|
612
|
-
),
|
|
613
|
-
info: createVariants(
|
|
614
|
-
tokens.colors.feedback.info.value,
|
|
615
|
-
tokens.colors.feedback.info.contrast
|
|
616
|
-
)
|
|
617
|
-
}
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
// src/theme/create-time-picker-tokens.ts
|
|
622
|
-
function createTimePickerTokens(tokens) {
|
|
623
|
-
const ItemHeight = 50;
|
|
624
|
-
const VisibleItems = 5;
|
|
625
|
-
const ContainerHeight = ItemHeight * VisibleItems;
|
|
626
|
-
const VerticalPadding = ContainerHeight / 2 - ItemHeight / 2;
|
|
627
|
-
const ColumnWidth = 70;
|
|
628
|
-
return {
|
|
629
|
-
column: {
|
|
630
|
-
width: ColumnWidth,
|
|
631
|
-
height: ContainerHeight,
|
|
632
|
-
gap: tokens.space.xxs,
|
|
633
|
-
listWidth: 30,
|
|
634
|
-
itemHeight: ItemHeight,
|
|
635
|
-
visibleItems: VisibleItems,
|
|
636
|
-
verticalPadding: VerticalPadding,
|
|
637
|
-
initialScrollIndexViewOffset: -VerticalPadding,
|
|
638
|
-
fontSize: tokens.fontSize.xl,
|
|
639
|
-
selectedColor: tokens.colors.primary.value,
|
|
640
|
-
color: tokens.colors.text.primary,
|
|
641
|
-
selectedFontWeight: tokens.fontWeight.semiBold,
|
|
642
|
-
fontWeight: tokens.fontWeight.regular
|
|
643
|
-
},
|
|
644
|
-
flyout: {
|
|
645
|
-
gap: tokens.space.msm
|
|
646
|
-
},
|
|
647
|
-
columns: {
|
|
648
|
-
height: ContainerHeight,
|
|
649
|
-
gap: tokens.space.xs,
|
|
650
|
-
indicatorHeight: ItemHeight,
|
|
651
|
-
indicatorWidth: ColumnWidth * 3 + 70,
|
|
652
|
-
indicatorTop: VerticalPadding,
|
|
653
|
-
indicatorBorderRadius: tokens.radii.round,
|
|
654
|
-
indicatorBackgroundColor: tokens.colors.surface.primary.value
|
|
655
|
-
}
|
|
656
|
-
};
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
// src/theme/tokens.theme.ts
|
|
660
|
-
var ChartColorTokens = [
|
|
661
|
-
"#f55d6b",
|
|
662
|
-
"#2563eb",
|
|
663
|
-
"#16a34a",
|
|
664
|
-
"#9333ea",
|
|
665
|
-
"#ea580c",
|
|
666
|
-
"#0891b2",
|
|
667
|
-
"#db2777",
|
|
668
|
-
"#65a30d",
|
|
669
|
-
"#4f46e5",
|
|
670
|
-
"#0d9488",
|
|
671
|
-
"#ca8a04",
|
|
672
|
-
"#c026d3",
|
|
673
|
-
"#0284c7",
|
|
674
|
-
"#7c3aed",
|
|
675
|
-
"#9f5f3f"
|
|
676
|
-
];
|
|
677
|
-
var SpaceTokens = {
|
|
678
|
-
none: 0,
|
|
679
|
-
xxs: 4,
|
|
680
|
-
xs: 8,
|
|
681
|
-
mxs: 12,
|
|
682
|
-
sm: 16,
|
|
683
|
-
msm: 24,
|
|
684
|
-
md: 32,
|
|
685
|
-
lg: 48,
|
|
686
|
-
xl: 64,
|
|
687
|
-
xxl: 96
|
|
688
|
-
};
|
|
689
|
-
var BorderSizeTokens = {
|
|
690
|
-
sm: 1,
|
|
691
|
-
md: 2,
|
|
692
|
-
lg: 3,
|
|
693
|
-
xl: 5,
|
|
694
|
-
xxl: 10
|
|
695
|
-
};
|
|
696
|
-
var RadiiTokens = {
|
|
697
|
-
sm: 4,
|
|
698
|
-
md: 8,
|
|
699
|
-
lg: 16,
|
|
700
|
-
xl: 32,
|
|
701
|
-
xxl: 64,
|
|
702
|
-
xxxl: 128,
|
|
703
|
-
round: 1e5
|
|
704
|
-
};
|
|
705
|
-
var FontSizeTokens = {
|
|
706
|
-
xxs: 8,
|
|
707
|
-
xs: 12,
|
|
708
|
-
xsm: 14,
|
|
709
|
-
sm: 16,
|
|
710
|
-
md: 18,
|
|
711
|
-
lg: 20,
|
|
712
|
-
xl: 24,
|
|
713
|
-
xxl: 28,
|
|
714
|
-
xxxl: 32,
|
|
715
|
-
huge: 36,
|
|
716
|
-
massive: 40,
|
|
717
|
-
giant: 48,
|
|
718
|
-
colossal: 56
|
|
719
|
-
};
|
|
720
|
-
var LineHeightTokens = {
|
|
721
|
-
xxs: 12,
|
|
722
|
-
xs: 16,
|
|
723
|
-
xsm: 20,
|
|
724
|
-
sm: 24,
|
|
725
|
-
md: 26,
|
|
726
|
-
lg: 28,
|
|
727
|
-
xl: 32,
|
|
728
|
-
xxl: 36,
|
|
729
|
-
xxxl: 40,
|
|
730
|
-
huge: 44,
|
|
731
|
-
massive: 48,
|
|
732
|
-
giant: 56,
|
|
733
|
-
colossal: 64
|
|
734
|
-
};
|
|
735
|
-
var FontWeightTokens = {
|
|
736
|
-
thin: 100,
|
|
737
|
-
extraLight: 200,
|
|
738
|
-
light: 300,
|
|
739
|
-
regular: 400,
|
|
740
|
-
medium: 500,
|
|
741
|
-
semiBold: 600,
|
|
742
|
-
bold: 700,
|
|
743
|
-
extraBold: 800,
|
|
744
|
-
black: 900
|
|
745
|
-
};
|
|
746
|
-
var FontFamilyWeightsNormalTokens = {
|
|
747
|
-
100: "Montserrat_100Thin",
|
|
748
|
-
200: "Montserrat_200ExtraLight",
|
|
749
|
-
300: "Montserrat_300Light",
|
|
750
|
-
400: "Montserrat_400Regular",
|
|
751
|
-
500: "Montserrat_500Medium",
|
|
752
|
-
600: "Montserrat_600SemiBold",
|
|
753
|
-
700: "Montserrat_700Bold",
|
|
754
|
-
800: "Montserrat_800ExtraBold",
|
|
755
|
-
900: "Montserrat_900Black"
|
|
756
|
-
};
|
|
757
|
-
var FontFamilyWeightsItalicTokens = {
|
|
758
|
-
100: "Montserrat_100Thin_Italic",
|
|
759
|
-
200: "Montserrat_200ExtraLight_Italic",
|
|
760
|
-
300: "Montserrat_300Light_Italic",
|
|
761
|
-
400: "Montserrat_400Regular_Italic",
|
|
762
|
-
500: "Montserrat_500Medium_Italic",
|
|
763
|
-
600: "Montserrat_600SemiBold_Italic",
|
|
764
|
-
700: "Montserrat_700Bold_Italic",
|
|
765
|
-
800: "Montserrat_800ExtraBold_Italic",
|
|
766
|
-
900: "Montserrat_900Black_Italic"
|
|
767
|
-
};
|
|
768
|
-
var FontFamilyTokens = {
|
|
769
|
-
normal: FontFamilyWeightsNormalTokens,
|
|
770
|
-
italic: FontFamilyWeightsItalicTokens
|
|
771
|
-
};
|
|
772
|
-
var NeutralColorTokens = {
|
|
773
|
-
"0": "#ffffff",
|
|
774
|
-
"1": "#f8f9fa",
|
|
775
|
-
"2": "#f1f3f5",
|
|
776
|
-
"3": "#e9ecef",
|
|
777
|
-
"4": "#dee2e6",
|
|
778
|
-
"5": "#ced4da",
|
|
779
|
-
"6": "#adb5bd",
|
|
780
|
-
"7": "#868e96",
|
|
781
|
-
"8": "#495057",
|
|
782
|
-
"9": "#343a40",
|
|
783
|
-
"10": "#212529",
|
|
784
|
-
"11": "#16191d",
|
|
785
|
-
"12": "#0d0f12",
|
|
786
|
-
"13": "#000000"
|
|
787
|
-
};
|
|
788
|
-
var LightColors = {
|
|
789
|
-
primary: {
|
|
790
|
-
value: "#f55d6b",
|
|
791
|
-
contrast: NeutralColorTokens["0"]
|
|
792
|
-
},
|
|
793
|
-
accent: {
|
|
794
|
-
value: "#FA9EA7",
|
|
795
|
-
contrast: NeutralColorTokens["0"]
|
|
796
|
-
},
|
|
797
|
-
secondary: {
|
|
798
|
-
value: "#FEE7E9",
|
|
799
|
-
contrast: "#f55d6b"
|
|
800
|
-
},
|
|
801
|
-
neutral: NeutralColorTokens,
|
|
802
|
-
surface: {
|
|
803
|
-
primary: {
|
|
804
|
-
value: NeutralColorTokens["2"],
|
|
805
|
-
contrast: NeutralColorTokens["11"]
|
|
806
|
-
},
|
|
807
|
-
secondary: {
|
|
808
|
-
value: NeutralColorTokens["0"],
|
|
809
|
-
contrast: NeutralColorTokens["11"]
|
|
810
|
-
},
|
|
811
|
-
elevated: {
|
|
812
|
-
value: NeutralColorTokens["0"],
|
|
813
|
-
contrast: NeutralColorTokens["11"]
|
|
814
|
-
},
|
|
815
|
-
inverse: {
|
|
816
|
-
value: NeutralColorTokens["13"],
|
|
817
|
-
contrast: NeutralColorTokens["0"]
|
|
818
|
-
}
|
|
819
|
-
},
|
|
820
|
-
text: {
|
|
821
|
-
primary: NeutralColorTokens["11"],
|
|
822
|
-
secondary: NeutralColorTokens["10"],
|
|
823
|
-
tertiary: NeutralColorTokens["9"],
|
|
824
|
-
inverse: NeutralColorTokens["0"],
|
|
825
|
-
disabled: NeutralColorTokens["7"]
|
|
826
|
-
},
|
|
827
|
-
border: {
|
|
828
|
-
subtle: {
|
|
829
|
-
value: NeutralColorTokens["3"],
|
|
830
|
-
contrast: NeutralColorTokens["9"]
|
|
831
|
-
},
|
|
832
|
-
default: {
|
|
833
|
-
value: NeutralColorTokens["4"],
|
|
834
|
-
contrast: NeutralColorTokens["10"]
|
|
835
|
-
},
|
|
836
|
-
strong: {
|
|
837
|
-
value: NeutralColorTokens["6"],
|
|
838
|
-
contrast: NeutralColorTokens["11"]
|
|
839
|
-
},
|
|
840
|
-
focus: {
|
|
841
|
-
value: "#f55d6b",
|
|
842
|
-
contrast: NeutralColorTokens["0"]
|
|
843
|
-
}
|
|
844
|
-
},
|
|
845
|
-
feedback: {
|
|
846
|
-
error: {
|
|
847
|
-
value: "#c92a2a",
|
|
848
|
-
contrast: "#fff5f5"
|
|
849
|
-
},
|
|
850
|
-
warning: {
|
|
851
|
-
value: "#e67700",
|
|
852
|
-
contrast: "#fff4e6"
|
|
853
|
-
},
|
|
854
|
-
success: {
|
|
855
|
-
value: "#7a9908",
|
|
856
|
-
contrast: "#f4fce3"
|
|
857
|
-
},
|
|
858
|
-
info: {
|
|
859
|
-
value: "#1864ab",
|
|
860
|
-
contrast: "#e7f5ff"
|
|
861
|
-
}
|
|
862
|
-
},
|
|
863
|
-
overlay: "rgba(0, 0, 0, 0.45)",
|
|
864
|
-
white: NeutralColorTokens["0"],
|
|
865
|
-
black: NeutralColorTokens["13"]
|
|
866
|
-
};
|
|
867
|
-
function createComponentsTokens(tokens) {
|
|
868
|
-
return {
|
|
869
|
-
button: createButtonTokens(tokens),
|
|
870
|
-
iconButton: createIconButtonTokens(tokens),
|
|
871
|
-
tag: createTagTokens(tokens),
|
|
872
|
-
controlAddon: createControlAddonTokens(tokens),
|
|
873
|
-
controlContainer: createControlContainerTokens(tokens),
|
|
874
|
-
controlError: createControlErrorTokens(tokens),
|
|
875
|
-
controlInput: createControlInputTokens(tokens),
|
|
876
|
-
controlLabel: createControlLabelTokens(tokens),
|
|
877
|
-
select: createSelectTokens(tokens),
|
|
878
|
-
datetimePicker: createDatetimePickerTokens(tokens),
|
|
879
|
-
timePicker: createTimePickerTokens(tokens),
|
|
880
|
-
flyout: createFlyoutTokens(tokens),
|
|
881
|
-
skeleton: createSkeletonTokens(tokens),
|
|
882
|
-
dataState: createDataStateTokens(tokens)
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
// src/theme/dark.theme.ts
|
|
887
|
-
var DarkTheme = {
|
|
888
|
-
colors: LightColors,
|
|
889
|
-
space: SpaceTokens,
|
|
890
|
-
radii: RadiiTokens,
|
|
891
|
-
fontFamily: FontFamilyTokens,
|
|
892
|
-
borderSize: BorderSizeTokens,
|
|
893
|
-
fontSize: FontSizeTokens,
|
|
894
|
-
fontWeight: FontWeightTokens,
|
|
895
|
-
lineHeight: LineHeightTokens
|
|
896
|
-
};
|
|
897
|
-
|
|
898
|
-
// src/theme/light.theme.ts
|
|
899
|
-
var LightTheme = {
|
|
900
|
-
colors: LightColors,
|
|
901
|
-
space: SpaceTokens,
|
|
902
|
-
radii: RadiiTokens,
|
|
903
|
-
fontFamily: FontFamilyTokens,
|
|
904
|
-
borderSize: BorderSizeTokens,
|
|
905
|
-
fontSize: FontSizeTokens,
|
|
906
|
-
fontWeight: FontWeightTokens,
|
|
907
|
-
lineHeight: LineHeightTokens
|
|
908
|
-
};
|
|
909
|
-
|
|
910
|
-
// src/providers/theme.provider.tsx
|
|
911
|
-
import { jsx } from "react/jsx-runtime";
|
|
912
|
-
var ThemeContext = createContext(void 0);
|
|
913
|
-
var ThemeProvider = memo(function ThemeProvider2(props) {
|
|
914
|
-
const scheme = props?.scheme ?? "light";
|
|
915
|
-
const context = useMemo(() => {
|
|
916
|
-
const baseTheme = scheme === "light" ? LightTheme : DarkTheme;
|
|
917
|
-
const customBaseTheme = props.theme?.[scheme];
|
|
918
|
-
const theme = merge(baseTheme, customBaseTheme);
|
|
919
|
-
return {
|
|
920
|
-
...theme,
|
|
921
|
-
components: createComponentsTokens(theme)
|
|
922
|
-
};
|
|
923
|
-
}, [scheme, props.theme?.light, props.theme?.dark, props.components]);
|
|
924
|
-
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: context, children: props.children });
|
|
925
|
-
});
|
|
926
|
-
function useThemeContext() {
|
|
927
|
-
const context = useContext(ThemeContext);
|
|
928
|
-
if (!context) {
|
|
929
|
-
throw new Error("useThemeContext must be used within a ThemeProvider");
|
|
930
|
-
}
|
|
931
|
-
return context;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
// src/hooks/use-border.hook.ts
|
|
935
|
-
function useBorder() {
|
|
936
|
-
const context = useThemeContext();
|
|
937
|
-
return useMemo2(() => context.borderSize, [context.borderSize]);
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
// src/hooks/use-colors.hook.ts
|
|
941
|
-
import { useMemo as useMemo3 } from "react";
|
|
942
|
-
function useColors() {
|
|
943
|
-
const context = useThemeContext();
|
|
944
|
-
return useMemo3(() => context.colors, [context.colors]);
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
// src/hooks/use-components-tokens.hook.ts
|
|
948
|
-
import { useMemo as useMemo4 } from "react";
|
|
949
|
-
function useComponentsTokens() {
|
|
950
|
-
const context = useThemeContext();
|
|
951
|
-
return useMemo4(() => context.components, [context.components]);
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
// src/hooks/use-radii.hook.ts
|
|
955
|
-
import { useMemo as useMemo5 } from "react";
|
|
956
|
-
function useRadii() {
|
|
957
|
-
const context = useThemeContext();
|
|
958
|
-
return useMemo5(() => context.radii, [context.radii]);
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
// src/hooks/use-space.hook.ts
|
|
962
|
-
import { useMemo as useMemo6 } from "react";
|
|
963
|
-
function useSpace() {
|
|
964
|
-
const context = useThemeContext();
|
|
965
|
-
return useMemo6(() => context.space, [context.space]);
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
// src/hooks/use-style-props.hook.ts
|
|
969
|
-
import { useMemo as useMemo7 } from "react";
|
|
970
|
-
|
|
971
|
-
// src/utils/style.utils.ts
|
|
972
|
-
import { Platform } from "react-native";
|
|
973
|
-
var isStylePropKey = (k) => StylePropsSet.has(k);
|
|
974
|
-
var extractStyleProps = (props) => {
|
|
975
|
-
const style = {};
|
|
976
|
-
for (const k in props) {
|
|
977
|
-
if (isStylePropKey(k) && props[k] !== void 0) {
|
|
978
|
-
style[k] = props[k];
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
return style;
|
|
982
|
-
};
|
|
983
|
-
var createStyleKey = (props) => {
|
|
984
|
-
let key = "";
|
|
985
|
-
for (const k in props) {
|
|
986
|
-
if (isStylePropKey(k)) {
|
|
987
|
-
key += String(props[k]);
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
return key;
|
|
991
|
-
};
|
|
992
|
-
var getShadowStyle = (level = "none", position = "bottom", colors) => {
|
|
993
|
-
const token = shadowScale[level];
|
|
994
|
-
if (level === "none") return {};
|
|
995
|
-
if (Platform.OS === "android") {
|
|
996
|
-
return {
|
|
997
|
-
elevation: token.elevation
|
|
998
|
-
};
|
|
999
|
-
}
|
|
1000
|
-
let offsetY = 0;
|
|
1001
|
-
if (position === "bottom") offsetY = token.radius / 2;
|
|
1002
|
-
if (position === "top") offsetY = -token.radius / 2;
|
|
1003
|
-
if (position === "around") offsetY = 0;
|
|
1004
|
-
return {
|
|
1005
|
-
shadowColor: colors.black,
|
|
1006
|
-
shadowOpacity: token.opacity,
|
|
1007
|
-
shadowRadius: token.radius,
|
|
1008
|
-
shadowOffset: {
|
|
1009
|
-
width: 0,
|
|
1010
|
-
height: offsetY
|
|
1011
|
-
}
|
|
1012
|
-
};
|
|
1013
|
-
};
|
|
1014
|
-
|
|
1015
|
-
// src/hooks/use-style-props.hook.ts
|
|
1016
|
-
function useStyleProps(props) {
|
|
1017
|
-
const key = useMemo7(() => createStyleKey(props), [props]);
|
|
1018
|
-
return useMemo7(() => extractStyleProps(props), [key]);
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
// src/hooks/use-theme.hook.ts
|
|
1022
|
-
function useTheme() {
|
|
1023
|
-
return useThemeContext();
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
// src/hooks/use-themed-styles.ts
|
|
1027
|
-
import { useMemo as useMemo8 } from "react";
|
|
1028
|
-
function useThemedStyles(styledFunction, props, dependencies) {
|
|
1029
|
-
const theme = useTheme();
|
|
1030
|
-
const memoDependencies = dependencies ?? (props === void 0 ? [] : [props]);
|
|
1031
|
-
return useMemo8(() => {
|
|
1032
|
-
if (props === void 0) {
|
|
1033
|
-
return styledFunction(theme);
|
|
1034
|
-
}
|
|
1035
|
-
return styledFunction(theme, props);
|
|
1036
|
-
}, [theme, styledFunction, ...memoDependencies]);
|
|
1037
|
-
}
|
|
1038
|
-
export {
|
|
1039
|
-
BorderSizeTokens,
|
|
1040
|
-
ChartColorTokens,
|
|
1041
|
-
DarkTheme,
|
|
1042
|
-
FontFamilyTokens,
|
|
1043
|
-
FontFamilyWeightsItalicTokens,
|
|
1044
|
-
FontFamilyWeightsNormalTokens,
|
|
1045
|
-
FontSizeTokens,
|
|
1046
|
-
FontWeightTokens,
|
|
1047
|
-
LightColors,
|
|
1048
|
-
LightTheme,
|
|
1049
|
-
LineHeightTokens,
|
|
1050
|
-
NeutralColorTokens,
|
|
1051
|
-
RadiiTokens,
|
|
1052
|
-
SpaceTokens,
|
|
1053
|
-
StylePropsSet,
|
|
1054
|
-
ThemeProvider,
|
|
1055
|
-
createComponentsTokens,
|
|
1056
|
-
createStyleKey,
|
|
1057
|
-
extractStyleProps,
|
|
1058
|
-
getShadowStyle,
|
|
1059
|
-
shadowScale,
|
|
1060
|
-
useBorder,
|
|
1061
|
-
useColors,
|
|
1062
|
-
useComponentsTokens,
|
|
1063
|
-
useRadii,
|
|
1064
|
-
useSpace,
|
|
1065
|
-
useStyleProps,
|
|
1066
|
-
useTheme,
|
|
1067
|
-
useThemeContext,
|
|
1068
|
-
useThemedStyles
|
|
1069
|
-
};
|
|
1
|
+
export * from "./constants";
|
|
2
|
+
export * from "./hooks";
|
|
3
|
+
export * from "./providers";
|
|
4
|
+
export * from "./theme";
|
|
5
|
+
export * from "./types";
|
|
6
|
+
export * from "./utils";
|
|
1070
7
|
//# sourceMappingURL=index.js.map
|