@rovula/ui 0.1.6 → 0.1.8
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/cjs/bundle.css +630 -467
- package/dist/cjs/bundle.js +1545 -1545
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/AlertDialog/AlertDialog.stories.d.ts +3 -0
- package/dist/cjs/types/components/Dialog/Dialog.d.ts +7 -1
- package/dist/cjs/types/components/Dialog/Dialog.stories.d.ts +3 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +2 -0
- package/dist/cjs/types/components/Form/Field.d.ts +26 -0
- package/dist/cjs/types/components/Form/FieldMessage.d.ts +7 -0
- package/dist/cjs/types/components/Form/Form.d.ts +49 -11
- package/dist/cjs/types/components/Form/Form.stories.d.ts +23 -0
- package/dist/cjs/types/components/Form/ValidationHintList.d.ts +17 -0
- package/dist/cjs/types/components/Form/ValidationHintList.stories.d.ts +9 -0
- package/dist/cjs/types/components/Form/index.d.ts +10 -0
- package/dist/cjs/types/components/Form/useOptionBridge.d.ts +17 -0
- package/dist/cjs/types/components/OtpInput/OtpInput.d.ts +17 -0
- package/dist/cjs/types/components/OtpInput/OtpInput.stories.d.ts +15 -0
- package/dist/cjs/types/components/OtpInput/OtpInputGroup.d.ts +25 -0
- package/dist/cjs/types/components/OtpInput/index.d.ts +5 -0
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +3 -0
- package/dist/cjs/types/index.d.ts +5 -0
- package/dist/cjs/types/theme/ThemeColorCoverageRuntime.stories.d.ts +10 -0
- package/dist/cjs/types/utils/colors.d.ts +351 -267
- package/dist/components/ActionButton/ActionButton.stories.js +2 -2
- package/dist/components/ActionButton/ActionButton.styles.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +6 -6
- package/dist/components/AlertDialog/AlertDialog.stories.js +3 -0
- package/dist/components/Avatar/Avatar.stories.js +1 -1
- package/dist/components/Avatar/Avatar.styles.js +1 -1
- package/dist/components/Avatar/AvatarBase.js +1 -1
- package/dist/components/Avatar/AvatarGroup.stories.js +1 -1
- package/dist/components/Button/Buttons.stories.js +2 -2
- package/dist/components/Calendar/Calendar.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +17 -7
- package/dist/components/Collapsible/Collapsible.styles.js +1 -1
- package/dist/components/DataTable/DataTable.js +2 -2
- package/dist/components/Dialog/Dialog.js +12 -7
- package/dist/components/Dialog/Dialog.stories.js +90 -2
- package/dist/components/Dropdown/Dropdown.js +2 -2
- package/dist/components/DropdownMenu/DropdownMenu.js +3 -3
- package/dist/components/FocusedScrollView/FocusedScrollView.stories.js +6 -6
- package/dist/components/Form/Field.js +60 -0
- package/dist/components/Form/FieldMessage.js +24 -0
- package/dist/components/Form/Form.js +73 -41
- package/dist/components/Form/Form.stories.js +221 -0
- package/dist/components/Form/ValidationHintList.js +30 -0
- package/dist/components/Form/ValidationHintList.stories.js +50 -0
- package/dist/components/Form/index.js +5 -0
- package/dist/components/Form/useOptionBridge.js +27 -0
- package/dist/components/InputFilter/InputFilter.js +5 -4
- package/dist/components/InputFilter/InputFilter.stories.js +1 -1
- package/dist/components/InputFilter/InputFilter.styles.js +14 -1
- package/dist/components/Label/Label.styles.js +1 -1
- package/dist/components/Menu/Menu.js +2 -2
- package/dist/components/NumberInput/NumberInput.stories.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +118 -0
- package/dist/components/OtpInput/OtpInput.stories.js +60 -0
- package/dist/components/OtpInput/OtpInputGroup.js +23 -0
- package/dist/components/OtpInput/index.js +3 -0
- package/dist/components/PasswordInput/PasswordInput.stories.js +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +2 -2
- package/dist/components/Search/Search.js +13 -1
- package/dist/components/Search/Search.stories.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider.stories.js +5 -5
- package/dist/components/Switch/Switch.stories.js +2 -2
- package/dist/components/Switch/Switch.styles.js +1 -1
- package/dist/components/Table/Table.js +5 -5
- package/dist/components/Tabs/Tabs.js +12 -9
- package/dist/components/Tabs/Tabs.stories.js +1 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/Text/Text.stories.js +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.styles.js +3 -3
- package/dist/components/TextInput/TextInput.js +3 -2
- package/dist/components/TextInput/TextInput.stories.js +3 -3
- package/dist/components/TextInput/TextInput.styles.js +41 -19
- package/dist/components/Toast/Toast.js +4 -2
- package/dist/components/Toast/Toast.stories.js +1 -1
- package/dist/components/Toast/Toast.styles.js +4 -4
- package/dist/components/Toast/Toaster.js +2 -2
- package/dist/components/Tree/Tree.stories.js +1 -1
- package/dist/components/Tree/TreeItem.js +1 -1
- package/dist/esm/bundle.css +630 -467
- package/dist/esm/bundle.js +1545 -1545
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/AlertDialog/AlertDialog.stories.d.ts +3 -0
- package/dist/esm/types/components/Dialog/Dialog.d.ts +7 -1
- package/dist/esm/types/components/Dialog/Dialog.stories.d.ts +3 -0
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +2 -0
- package/dist/esm/types/components/Form/Field.d.ts +26 -0
- package/dist/esm/types/components/Form/FieldMessage.d.ts +7 -0
- package/dist/esm/types/components/Form/Form.d.ts +49 -11
- package/dist/esm/types/components/Form/Form.stories.d.ts +23 -0
- package/dist/esm/types/components/Form/ValidationHintList.d.ts +17 -0
- package/dist/esm/types/components/Form/ValidationHintList.stories.d.ts +9 -0
- package/dist/esm/types/components/Form/index.d.ts +10 -0
- package/dist/esm/types/components/Form/useOptionBridge.d.ts +17 -0
- package/dist/esm/types/components/OtpInput/OtpInput.d.ts +17 -0
- package/dist/esm/types/components/OtpInput/OtpInput.stories.d.ts +15 -0
- package/dist/esm/types/components/OtpInput/OtpInputGroup.d.ts +25 -0
- package/dist/esm/types/components/OtpInput/index.d.ts +5 -0
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +3 -0
- package/dist/esm/types/index.d.ts +5 -0
- package/dist/esm/types/theme/ThemeColorCoverageRuntime.stories.d.ts +10 -0
- package/dist/esm/types/utils/colors.d.ts +351 -267
- package/dist/index.d.ts +512 -269
- package/dist/index.js +3 -0
- package/dist/src/theme/global.css +2739 -2681
- package/dist/theme/ThemeColorCoverageRuntime.stories.js +91 -0
- package/dist/utils/colors.js +359 -267
- package/package.json +4 -2
- package/src/components/ActionButton/ActionButton.stories.tsx +6 -6
- package/src/components/ActionButton/ActionButton.styles.ts +1 -1
- package/src/components/AlertDialog/AlertDialog.stories.tsx +22 -0
- package/src/components/AlertDialog/AlertDialog.tsx +6 -6
- package/src/components/Avatar/Avatar.stories.tsx +1 -1
- package/src/components/Avatar/Avatar.styles.ts +1 -1
- package/src/components/Avatar/AvatarBase.tsx +1 -1
- package/src/components/Avatar/AvatarGroup.stories.tsx +1 -1
- package/src/components/Button/Buttons.stories.tsx +25 -17
- package/src/components/Calendar/Calendar.tsx +3 -3
- package/src/components/Checkbox/Checkbox.stories.tsx +35 -12
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/Collapsible/Collapsible.styles.ts +1 -1
- package/src/components/DataTable/DataTable.tsx +2 -2
- package/src/components/Dialog/Dialog.stories.tsx +173 -0
- package/src/components/Dialog/Dialog.tsx +32 -15
- package/src/components/Dropdown/Dropdown.styles.ts +1 -1
- package/src/components/Dropdown/Dropdown.tsx +16 -14
- package/src/components/DropdownMenu/DropdownMenu.tsx +3 -3
- package/src/components/FocusedScrollView/FocusedScrollView.stories.tsx +10 -10
- package/src/components/Form/Field.tsx +160 -0
- package/src/components/Form/FieldMessage.tsx +38 -0
- package/src/components/Form/Form.docs.mdx +67 -0
- package/src/components/Form/Form.stories.tsx +490 -0
- package/src/components/Form/Form.tsx +185 -87
- package/src/components/Form/README.md +284 -0
- package/src/components/Form/ValidationHintList.stories.tsx +118 -0
- package/src/components/Form/ValidationHintList.tsx +82 -0
- package/src/components/Form/index.ts +28 -0
- package/src/components/Form/useOptionBridge.ts +55 -0
- package/src/components/InputFilter/InputFilter.stories.tsx +1 -1
- package/src/components/InputFilter/InputFilter.styles.ts +14 -1
- package/src/components/InputFilter/InputFilter.tsx +33 -28
- package/src/components/Label/Label.styles.ts +2 -2
- package/src/components/Label/Label.tsx +1 -1
- package/src/components/Menu/Menu.tsx +12 -12
- package/src/components/NumberInput/NumberInput.stories.tsx +1 -1
- package/src/components/OtpInput/OtpInput.stories.tsx +168 -0
- package/src/components/OtpInput/OtpInput.tsx +210 -0
- package/src/components/OtpInput/OtpInputGroup.tsx +74 -0
- package/src/components/OtpInput/index.ts +5 -0
- package/src/components/PasswordInput/PasswordInput.stories.tsx +1 -1
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/RadioGroup/RadioGroup.stories.tsx +4 -4
- package/src/components/RadioGroup/RadioGroup.tsx +2 -1
- package/src/components/Search/Search.stories.tsx +1 -1
- package/src/components/Search/Search.tsx +6 -2
- package/src/components/Slider/Slider.stories.tsx +7 -7
- package/src/components/Slider/Slider.tsx +1 -1
- package/src/components/Switch/Switch.stories.tsx +4 -4
- package/src/components/Switch/Switch.styles.ts +1 -1
- package/src/components/Table/Table.tsx +5 -5
- package/src/components/Tabs/Tabs.stories.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +29 -18
- package/src/components/Text/Text.stories.tsx +1 -1
- package/src/components/Text/Text.tsx +1 -1
- package/src/components/TextArea/TextArea.stories.tsx +1 -1
- package/src/components/TextArea/TextArea.styles.ts +3 -3
- package/src/components/TextInput/TextInput.stories.tsx +7 -7
- package/src/components/TextInput/TextInput.styles.ts +42 -19
- package/src/components/TextInput/TextInput.tsx +3 -1
- package/src/components/Toast/Toast.stories.tsx +1 -1
- package/src/components/Toast/Toast.styles.tsx +7 -7
- package/src/components/Toast/Toast.tsx +5 -4
- package/src/components/Toast/Toaster.tsx +17 -20
- package/src/components/Tree/Tree.stories.tsx +1 -1
- package/src/components/Tree/TreeItem.tsx +1 -1
- package/src/index.ts +5 -0
- package/src/theme/THEME_MAPPING.md +36 -37
- package/src/theme/ThemeColorCoverageRuntime.stories.tsx +236 -0
- package/src/theme/direct-token-migration-plan.md +121 -0
- package/src/theme/figma-mcp-check-report.md +225 -0
- package/src/theme/figma-mcp-component-checklist.json +1250 -0
- package/src/theme/global.css +7 -3
- package/src/theme/presets/colors.js +173 -64
- package/src/theme/themes/skyller/baseline.css +0 -4
- package/src/theme/themes/variable-mapping.css +1064 -0
- package/src/theme/themes/variable.css +248 -230
- package/src/theme/themes/xspector/baseline.css +0 -4
- package/src/theme/themes/xspector/components/dropdown-menu.css +4 -4
- package/src/theme/themes/xspector/components/loading.css +2 -2
- package/src/theme/tokens/baseline.css +0 -3
- package/src/theme/tokens/color.css +36 -65
- package/src/theme/tokens/components/action-button.css +6 -6
- package/src/theme/tokens/components/button.css +189 -189
- package/src/theme/tokens/components/dropdown-menu.css +5 -5
- package/src/theme/tokens/components/footer.css +1 -1
- package/src/theme/tokens/components/loading.css +2 -2
- package/src/theme/tokens/components/switch.css +11 -11
- package/src/theme/tokens/typography.css +28 -28
- package/src/theme/tokens_old/baseline.css +13 -0
- package/src/theme/tokens_old/color.css +78 -0
- package/src/theme/tokens_old/components/action-button.css +127 -0
- package/src/theme/tokens_old/components/button.css +512 -0
- package/src/theme/tokens_old/components/dropdown-menu.css +27 -0
- package/src/theme/tokens_old/components/footer.css +9 -0
- package/src/theme/tokens_old/components/loading.css +11 -0
- package/src/theme/tokens_old/components/navbar.css +9 -0
- package/src/theme/tokens_old/components/progress-bar.css +8 -0
- package/src/theme/tokens_old/components/switch.css +29 -0
- package/src/theme/tokens_old/typography.css +199 -0
- package/src/theme/tokens_old/variables.css +28 -0
- package/src/theme/utils.js +172 -33
- package/src/utils/colors.ts +367 -278
- package/src/theme/themes/skyller/color.css +0 -79
- package/src/theme/themes/skyller/palette.css +0 -143
- package/src/theme/themes/skyller/state.css +0 -94
- package/src/theme/themes/skyller/transparent.css +0 -94
- package/src/theme/themes/xspector/color.css +0 -83
- package/src/theme/themes/xspector/palette.css +0 -142
- package/src/theme/themes/xspector/state.css +0 -94
- package/src/theme/themes/xspector/transparent.css +0 -93
- /package/src/theme/{tokens → tokens_old}/palette.css +0 -0
- /package/src/theme/{tokens → tokens_old}/state.css +0 -0
- /package/src/theme/{tokens → tokens_old}/transparent.css +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* TYPE */
|
|
3
|
+
--h1-family: "Montserrat";
|
|
4
|
+
--h1-size: 64px;
|
|
5
|
+
--h1-size-rem: 4rem;
|
|
6
|
+
--h1-weight: 700;
|
|
7
|
+
--h1-style: normal;
|
|
8
|
+
--h1-line-height: 80px;
|
|
9
|
+
--h1-line-height-rem: 5rem;
|
|
10
|
+
--h2-family: "Montserrat";
|
|
11
|
+
--h2-size: 48px;
|
|
12
|
+
--h2-size-rem: 3rem;
|
|
13
|
+
--h2-weight: 700;
|
|
14
|
+
--h2-style: normal;
|
|
15
|
+
--h2-line-height: 60px;
|
|
16
|
+
--h2-line-height-rem: 3.75rem;
|
|
17
|
+
--h3-family: "Montserrat";
|
|
18
|
+
--h3-size: 32px;
|
|
19
|
+
--h3-size-rem: 2rem;
|
|
20
|
+
--h3-weight: 700;
|
|
21
|
+
--h3-style: normal;
|
|
22
|
+
--h3-line-height: 48px;
|
|
23
|
+
--h3-line-height-rem: 3rem;
|
|
24
|
+
--h4-family: "Montserrat";
|
|
25
|
+
--h4-size: 24px;
|
|
26
|
+
--h4-size-rem: 1.5rem;
|
|
27
|
+
--h4-weight: 700;
|
|
28
|
+
--h4-style: normal;
|
|
29
|
+
--h4-line-height: 32px;
|
|
30
|
+
--h4-line-height-rem: 2rem;
|
|
31
|
+
--h5-family: "Montserrat";
|
|
32
|
+
--h5-size: 20px;
|
|
33
|
+
--h5-size-rem: 1.25rem;
|
|
34
|
+
--h5-weight: 700;
|
|
35
|
+
--h5-style: normal;
|
|
36
|
+
--h5-line-height: 28px;
|
|
37
|
+
--h5-line-height-rem: 1.75rem;
|
|
38
|
+
--h6-family: "Montserrat";
|
|
39
|
+
--h6-size: 18px;
|
|
40
|
+
--h6-size-rem: 1.125rem;
|
|
41
|
+
--h6-weight: 700;
|
|
42
|
+
--h6-style: normal;
|
|
43
|
+
--h6-line-height: 24px;
|
|
44
|
+
--h6-line-height-rem: 1.5rem;
|
|
45
|
+
--subtitle1-family: "Montserrat";
|
|
46
|
+
--subtitle1-size: 16px;
|
|
47
|
+
--subtitle1-size-rem: 1rem;
|
|
48
|
+
--subtitle1-weight: 400;
|
|
49
|
+
--subtitle1-style: normal;
|
|
50
|
+
--subtitle1-line-height: 24px;
|
|
51
|
+
--subtitle1-line-height-rem: 1.5rem;
|
|
52
|
+
--subtitle2-family: "Montserrat";
|
|
53
|
+
--subtitle2-size: 16px;
|
|
54
|
+
--subtitle2-size-rem: 1rem;
|
|
55
|
+
--subtitle2-weight: 500;
|
|
56
|
+
--subtitle2-style: normal;
|
|
57
|
+
--subtitle2-line-height: 24px;
|
|
58
|
+
--subtitle2-line-height-rem: 1.5rem;
|
|
59
|
+
--subtitle3-family: "Montserrat";
|
|
60
|
+
--subtitle3-size: 16px;
|
|
61
|
+
--subtitle3-size-rem: 1rem;
|
|
62
|
+
--subtitle3-weight: 600;
|
|
63
|
+
--subtitle3-style: normal;
|
|
64
|
+
--subtitle3-line-height: 24px;
|
|
65
|
+
--subtitle3-line-height-rem: 1.5rem;
|
|
66
|
+
--subtitle4-family: "Montserrat";
|
|
67
|
+
--subtitle4-size: 14px;
|
|
68
|
+
--subtitle4-size-rem: 0.875rem;
|
|
69
|
+
--subtitle4-weight: 400;
|
|
70
|
+
--subtitle4-style: normal;
|
|
71
|
+
--subtitle4-line-height: 22px;
|
|
72
|
+
--subtitle4-line-height-rem: 1.375rem;
|
|
73
|
+
--subtitle5-family: "Montserrat";
|
|
74
|
+
--subtitle5-size: 14px;
|
|
75
|
+
--subtitle5-size-rem: 0.875rem;
|
|
76
|
+
--subtitle5-weight: 500;
|
|
77
|
+
--subtitle5-style: normal;
|
|
78
|
+
--subtitle5-line-height: 22px;
|
|
79
|
+
--subtitle5-line-height-rem: 1.375rem;
|
|
80
|
+
--subtitle6-family: "Montserrat";
|
|
81
|
+
--subtitle6-size: 14px;
|
|
82
|
+
--subtitle6-size-rem: 0.875rem;
|
|
83
|
+
--subtitle6-weight: 600;
|
|
84
|
+
--subtitle6-style: normal;
|
|
85
|
+
--subtitle6-line-height: 22px;
|
|
86
|
+
--subtitle6-line-height-rem: 1.375rem;
|
|
87
|
+
--body1-family: "Montserrat";
|
|
88
|
+
--body1-size: 16px;
|
|
89
|
+
--body1-size-rem: 1rem;
|
|
90
|
+
--body1-weight: 400;
|
|
91
|
+
--body1-style: normal;
|
|
92
|
+
--body1-line-height: 20px;
|
|
93
|
+
--body1-line-height-rem: 1.25rem;
|
|
94
|
+
--body2-family: "Montserrat";
|
|
95
|
+
--body2-size: 16px;
|
|
96
|
+
--body2-size-rem: 1rem;
|
|
97
|
+
--body2-weight: 500;
|
|
98
|
+
--body2-style: normal;
|
|
99
|
+
--body2-line-height: 20px;
|
|
100
|
+
--body2-line-height-rem: 1.25rem;
|
|
101
|
+
--body3-family: "Montserrat";
|
|
102
|
+
--body3-size: 14px;
|
|
103
|
+
--body3-size-rem: 0.875rem;
|
|
104
|
+
--body3-weight: 400;
|
|
105
|
+
--body3-style: normal;
|
|
106
|
+
--body3-line-height: 18px;
|
|
107
|
+
--body3-line-height-rem: 1.125rem;
|
|
108
|
+
--body4-family: "Montserrat";
|
|
109
|
+
--body4-size: 14px;
|
|
110
|
+
--body4-size-rem: 0.875rem;
|
|
111
|
+
--body4-weight: 500;
|
|
112
|
+
--body4-style: normal;
|
|
113
|
+
--body4-line-height: 18px;
|
|
114
|
+
--body4-line-height-rem: 1.125rem;
|
|
115
|
+
--small1-family: "Montserrat";
|
|
116
|
+
--small1-size: 12px;
|
|
117
|
+
--small1-size-rem: 0.75rem;
|
|
118
|
+
--small1-weight: 400;
|
|
119
|
+
--small1-style: normal;
|
|
120
|
+
--small1-line-height: 14px;
|
|
121
|
+
--small1-line-height-rem: 0.875rem;
|
|
122
|
+
--small2-family: "Montserrat";
|
|
123
|
+
--small2-size: 12px;
|
|
124
|
+
--small2-size-rem: 0.75rem;
|
|
125
|
+
--small2-weight: 500;
|
|
126
|
+
--small2-style: normal;
|
|
127
|
+
--small2-line-height: 14px;
|
|
128
|
+
--small2-line-height-rem: 0.875rem;
|
|
129
|
+
--small3-family: "Montserrat";
|
|
130
|
+
--small3-size: 12px;
|
|
131
|
+
--small3-size-rem: 0.75rem;
|
|
132
|
+
--small3-weight: 600;
|
|
133
|
+
--small3-style: normal;
|
|
134
|
+
--small3-line-height: 14px;
|
|
135
|
+
--small3-line-height-rem: 0.875rem;
|
|
136
|
+
--small4-family: "Montserrat";
|
|
137
|
+
--small4-size: 10px;
|
|
138
|
+
--small4-size-rem: 0.625rem;
|
|
139
|
+
--small4-weight: 400;
|
|
140
|
+
--small4-style: normal;
|
|
141
|
+
--small4-line-height: 12px;
|
|
142
|
+
--small4-line-height-rem: 0.75rem;
|
|
143
|
+
--small5-family: "Montserrat";
|
|
144
|
+
--small5-size: 10px;
|
|
145
|
+
--small5-size-rem: 0.625rem;
|
|
146
|
+
--small5-weight: 500;
|
|
147
|
+
--small5-style: normal;
|
|
148
|
+
--small5-line-height: 12px;
|
|
149
|
+
--small5-line-height-rem: 0.75rem;
|
|
150
|
+
--small6-family: "Montserrat";
|
|
151
|
+
--small6-size: 10px;
|
|
152
|
+
--small6-size-rem: 0.625rem;
|
|
153
|
+
--small6-weight: 600;
|
|
154
|
+
--small6-style: normal;
|
|
155
|
+
--small6-line-height: 12px;
|
|
156
|
+
--small6-line-height-rem: 0.75rem;
|
|
157
|
+
--small7-family: "Montserrat";
|
|
158
|
+
--small7-size: 8px;
|
|
159
|
+
--small7-size-rem: 0.5rem;
|
|
160
|
+
--small7-weight: 600;
|
|
161
|
+
--small7-style: normal;
|
|
162
|
+
--small7-line-height: 10px;
|
|
163
|
+
--small7-line-height-rem: 0.625rem;
|
|
164
|
+
--small8-family: "Montserrat";
|
|
165
|
+
--small8-size: 8px;
|
|
166
|
+
--small8-size-rem: 0.5rem;
|
|
167
|
+
--small8-weight: 700;
|
|
168
|
+
--small8-style: normal;
|
|
169
|
+
--small8-line-height: 10px;
|
|
170
|
+
--small8-line-height-rem: 0.625rem;
|
|
171
|
+
--label-label1-family: "Montserrat";
|
|
172
|
+
--label-label1-size: 12px;
|
|
173
|
+
--label-label1-size-rem: 0.75rem;
|
|
174
|
+
--label-label1-weight: 400;
|
|
175
|
+
--label-label1-style: normal;
|
|
176
|
+
--label-label1-line-height: 12px;
|
|
177
|
+
--label-label1-line-height-rem: 0.75rem;
|
|
178
|
+
--label-label2-family: "Montserrat";
|
|
179
|
+
--label-label2-size: 10px;
|
|
180
|
+
--label-label2-size-rem: 0.625rem;
|
|
181
|
+
--label-label2-weight: 400;
|
|
182
|
+
--label-label2-style: normal;
|
|
183
|
+
--label-label2-line-height: 10px;
|
|
184
|
+
--label-label2-line-height-rem: 0.625rem;
|
|
185
|
+
--button-button-l-family: "Montserrat";
|
|
186
|
+
--button-button-l-size: 16px;
|
|
187
|
+
--button-button-l-size-rem: 1rem;
|
|
188
|
+
--button-button-l-weight: 700;
|
|
189
|
+
--button-button-l-style: normal;
|
|
190
|
+
--button-button-l-line-height: 24px;
|
|
191
|
+
--button-button-l-line-height-rem: 1.5rem;
|
|
192
|
+
--button-button-ms-family: "Montserrat";
|
|
193
|
+
--button-button-ms-size: 14px;
|
|
194
|
+
--button-button-ms-size-rem: 0.875rem;
|
|
195
|
+
--button-button-ms-weight: 700;
|
|
196
|
+
--button-button-ms-style: normal;
|
|
197
|
+
--button-button-ms-line-height: 22px;
|
|
198
|
+
--button-button-ms-line-height-rem: 1.375rem;
|
|
199
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--radius-radius-xl: 16px;
|
|
3
|
+
--radius-radius-xl-rem: 1rem;
|
|
4
|
+
--radius-radius-l: 12px;
|
|
5
|
+
--radius-radius-l-rem: 0.75rem;
|
|
6
|
+
--radius-radius-m: 8px;
|
|
7
|
+
--radius-radius-m-rem: 0.5rem;
|
|
8
|
+
--radius-radius-s: 6px;
|
|
9
|
+
--radius-radius-s-rem: 0.375rem;
|
|
10
|
+
--radius-radius-xs: 4px;
|
|
11
|
+
--radius-radius-xs-rem: 0.25rem;
|
|
12
|
+
--spacing-spacing-xxs: 2px;
|
|
13
|
+
--spacing-spacing-xxs-rem: 0.125rem;
|
|
14
|
+
--spacing-spacing-xs: 4px;
|
|
15
|
+
--spacing-spacing-xs-rem: 0.25rem;
|
|
16
|
+
--spacing-spacing-s: 8px;
|
|
17
|
+
--spacing-spacing-s-rem: 0.5rem;
|
|
18
|
+
--spacing-spacing-m: 12px;
|
|
19
|
+
--spacing-spacing-m-rem: 0.75rem;
|
|
20
|
+
--spacing-spacing-l: 16px;
|
|
21
|
+
--spacing-spacing-l-rem: 1rem;
|
|
22
|
+
--spacing-spacing-xl: 24px;
|
|
23
|
+
--spacing-spacing-xl-rem: 1.5rem;
|
|
24
|
+
--spacing-spacing-xxl: 32px;
|
|
25
|
+
--spacing-spacing-xxl-rem: 2rem;
|
|
26
|
+
--spacing-spacing-xxxl: 48px;
|
|
27
|
+
--spacing-spacing-xxxl-rem: 3rem;
|
|
28
|
+
}
|
package/src/theme/utils.js
CHANGED
|
@@ -1,52 +1,161 @@
|
|
|
1
|
+
const DEFAULT_COLOR_RANGE = [
|
|
2
|
+
5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150,
|
|
3
|
+
];
|
|
4
|
+
const DEFAULT_TRANSPARENT_RANGE = [8, 12, 16, 24, 32, 48];
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Create Tailwind-compatible alpha color from a CSS variable.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} variable CSS variable name including `--` prefix.
|
|
10
|
+
* @returns {string} `color-mix(...)` expression that Tailwind can inject alpha into.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* withColorMixin("--main-primary");
|
|
14
|
+
* // => "color-mix(in srgb, var(--main-primary) calc(100% * <alpha-value>), transparent)"
|
|
15
|
+
*/
|
|
1
16
|
export const withColorMixin = (variable) =>
|
|
2
17
|
`color-mix(in srgb, var(${variable}) calc(100% * <alpha-value>), transparent)`;
|
|
3
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Generate palette/state color aliases for Tailwind `theme.extend.colors`.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} baseName Base key used for generated token names (e.g. `primary`).
|
|
23
|
+
* @param {string} variablePrefix Prefix for ramp variables (e.g. `ramps-primary`).
|
|
24
|
+
* @param {{
|
|
25
|
+
* range?: Array<number | string>,
|
|
26
|
+
* count?: number,
|
|
27
|
+
* stateVars?: boolean,
|
|
28
|
+
* foreground?: boolean,
|
|
29
|
+
* includeStatePrefixedAliases?: boolean,
|
|
30
|
+
* includeOriginalVarAliases?: boolean
|
|
31
|
+
* }} [options]
|
|
32
|
+
* @returns {Record<string, string>} Map of token -> `color-mix(...)` CSS values.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* generateColorConfig("primary", "ramps-primary", { range: [50, 100] });
|
|
36
|
+
* // => {
|
|
37
|
+
* // "primary-50": "color-mix(...var(--ramps-primary-50)... )",
|
|
38
|
+
* // "primary-100": "color-mix(...var(--ramps-primary-100)... )",
|
|
39
|
+
* // "primary-foreground": "color-mix(...var(--primary-foreground)... )",
|
|
40
|
+
* // "primary": "color-mix(...var(--state-primary-default)... )",
|
|
41
|
+
* // ...state aliases
|
|
42
|
+
* // }
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* generateColorConfig("others", "others", {
|
|
46
|
+
* count: 3,
|
|
47
|
+
* stateVars: false,
|
|
48
|
+
* foreground: false,
|
|
49
|
+
* });
|
|
50
|
+
* // => { "others-1": "color-mix(...)", "others-2": "color-mix(...)", "others-3": "color-mix(...)" }
|
|
51
|
+
*/
|
|
4
52
|
export const generateColorConfig = (
|
|
5
53
|
baseName,
|
|
6
54
|
variablePrefix,
|
|
7
|
-
|
|
55
|
+
{
|
|
56
|
+
range,
|
|
57
|
+
count,
|
|
58
|
+
stateVars = true,
|
|
59
|
+
foreground = true,
|
|
60
|
+
includeStatePrefixedAliases = true,
|
|
61
|
+
includeOriginalVarAliases = false,
|
|
62
|
+
} = {},
|
|
8
63
|
) => {
|
|
64
|
+
const resolvedRange = Number.isInteger(count)
|
|
65
|
+
? Array.from({ length: count }, (_, i) => i + 1)
|
|
66
|
+
: range ?? DEFAULT_COLOR_RANGE;
|
|
67
|
+
|
|
9
68
|
const colors = {};
|
|
10
69
|
|
|
11
|
-
|
|
70
|
+
resolvedRange.forEach((num) => {
|
|
12
71
|
colors[`${baseName}-${num}`] = withColorMixin(`--${variablePrefix}-${num}`);
|
|
72
|
+
if (includeOriginalVarAliases) {
|
|
73
|
+
colors[`${variablePrefix}-${num}`] = withColorMixin(
|
|
74
|
+
`--${variablePrefix}-${num}`,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
13
77
|
});
|
|
14
78
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
colors[`${baseName}
|
|
24
|
-
|
|
25
|
-
);
|
|
79
|
+
if (foreground) {
|
|
80
|
+
colors[`${baseName}-foreground`] = withColorMixin(
|
|
81
|
+
`--${baseName}-foreground`,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (!stateVars) return colors;
|
|
86
|
+
|
|
87
|
+
colors[`${baseName}`] = withColorMixin(`--state-${baseName}-default`);
|
|
88
|
+
colors[`${baseName}-default`] = withColorMixin(`--state-${baseName}-default`);
|
|
89
|
+
colors[`${baseName}-hover`] = withColorMixin(`--state-${baseName}-hover`);
|
|
90
|
+
colors[`${baseName}-stroke`] = withColorMixin(`--state-${baseName}-stroke`);
|
|
26
91
|
colors[`${baseName}-hover-bg`] = withColorMixin(
|
|
27
|
-
`--state
|
|
28
|
-
);
|
|
29
|
-
colors[`${baseName}-pressed`] = withColorMixin(
|
|
30
|
-
`--state-color-${baseName}-pressed`
|
|
31
|
-
);
|
|
32
|
-
colors[`${baseName}-active`] = withColorMixin(
|
|
33
|
-
`--state-color-${baseName}-active`
|
|
92
|
+
`--state-${baseName}-hover-bg`,
|
|
34
93
|
);
|
|
94
|
+
colors[`${baseName}-pressed`] = withColorMixin(`--state-${baseName}-pressed`);
|
|
95
|
+
colors[`${baseName}-active`] = withColorMixin(`--state-${baseName}-active`);
|
|
35
96
|
|
|
36
97
|
// text
|
|
37
98
|
colors[`${baseName}-text-solid`] = withColorMixin(
|
|
38
|
-
`--state
|
|
99
|
+
`--state-${baseName}-text-solid`,
|
|
39
100
|
);
|
|
40
101
|
colors[`${baseName}-text-outline`] = withColorMixin(
|
|
41
|
-
`--state
|
|
102
|
+
`--state-${baseName}-text-outline`,
|
|
103
|
+
);
|
|
104
|
+
colors[`${baseName}-text-hover`] = withColorMixin(
|
|
105
|
+
`--state-${baseName}-text-hover`,
|
|
42
106
|
);
|
|
43
107
|
colors[`${baseName}-text-pressed`] = withColorMixin(
|
|
44
|
-
`--state
|
|
108
|
+
`--state-${baseName}-text-pressed`,
|
|
45
109
|
);
|
|
46
110
|
|
|
111
|
+
if (includeStatePrefixedAliases) {
|
|
112
|
+
colors[`state-${baseName}-default`] = withColorMixin(
|
|
113
|
+
`--state-${baseName}-default`,
|
|
114
|
+
);
|
|
115
|
+
colors[`state-${baseName}-hover`] = withColorMixin(
|
|
116
|
+
`--state-${baseName}-hover`,
|
|
117
|
+
);
|
|
118
|
+
colors[`state-${baseName}-stroke`] = withColorMixin(
|
|
119
|
+
`--state-${baseName}-stroke`,
|
|
120
|
+
);
|
|
121
|
+
colors[`state-${baseName}-hover-bg`] = withColorMixin(
|
|
122
|
+
`--state-${baseName}-hover-bg`,
|
|
123
|
+
);
|
|
124
|
+
colors[`state-${baseName}-pressed`] = withColorMixin(
|
|
125
|
+
`--state-${baseName}-pressed`,
|
|
126
|
+
);
|
|
127
|
+
colors[`state-${baseName}-active`] = withColorMixin(
|
|
128
|
+
`--state-${baseName}-active`,
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
// Text
|
|
132
|
+
colors[`state-${baseName}-text-solid`] = withColorMixin(
|
|
133
|
+
`--state-${baseName}-text-solid`,
|
|
134
|
+
);
|
|
135
|
+
colors[`state-${baseName}-text-outline`] = withColorMixin(
|
|
136
|
+
`--state-${baseName}-text-outline`,
|
|
137
|
+
);
|
|
138
|
+
colors[`state-${baseName}-text-hover`] = withColorMixin(
|
|
139
|
+
`--state-${baseName}-text-hover`,
|
|
140
|
+
);
|
|
141
|
+
colors[`state-${baseName}-text-pressed`] = withColorMixin(
|
|
142
|
+
`--state-${baseName}-text-pressed`,
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
47
146
|
return colors;
|
|
48
147
|
};
|
|
49
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Generate button semantic aliases by style `type` (`bg`, `text`, `border`).
|
|
151
|
+
*
|
|
152
|
+
* @param {"bg" | "text" | "border"} type Token type suffix.
|
|
153
|
+
* @returns {Record<string, string>} Map like `button-primary-solid-default`.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* generateButtonStyles("bg");
|
|
157
|
+
* // => { "button-primary-solid-default": "color-mix(...)", ... }
|
|
158
|
+
*/
|
|
50
159
|
export function generateButtonStyles(type) {
|
|
51
160
|
const themes = [
|
|
52
161
|
"primary",
|
|
@@ -65,14 +174,23 @@ export function generateButtonStyles(type) {
|
|
|
65
174
|
prev[`${prefix}-hover`] = withColorMixin(`--${prefix}-hover-${type}`);
|
|
66
175
|
prev[`${prefix}-active`] = withColorMixin(`--${prefix}-active-${type}`);
|
|
67
176
|
prev[`${prefix}-disabled`] = withColorMixin(
|
|
68
|
-
`--${prefix}-disabled-${type}
|
|
177
|
+
`--${prefix}-disabled-${type}`,
|
|
69
178
|
);
|
|
70
179
|
});
|
|
71
180
|
return prev;
|
|
72
181
|
}, {});
|
|
73
182
|
}
|
|
74
183
|
|
|
75
|
-
|
|
184
|
+
/**
|
|
185
|
+
* Generate action-button semantic aliases by style `type` (`bg`, `text`, `border`).
|
|
186
|
+
*
|
|
187
|
+
* @param {"bg" | "text" | "border"} type Token type suffix.
|
|
188
|
+
* @returns {Record<string, string>} Map like `action-button-solid-default`.
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* generateActionButtonStyles("text");
|
|
192
|
+
* // => { "action-button-solid-default": "color-mix(...)", ... }
|
|
193
|
+
*/
|
|
76
194
|
export function generateActionButtonStyles(type) {
|
|
77
195
|
const modes = ["solid", "outline", "icon"];
|
|
78
196
|
|
|
@@ -83,26 +201,47 @@ export function generateActionButtonStyles(type) {
|
|
|
83
201
|
prev[`${prefix}-pressed`] = withColorMixin(`--${prefix}-pressed-${type}`);
|
|
84
202
|
prev[`${prefix}-active`] = withColorMixin(`--${prefix}-active-${type}`);
|
|
85
203
|
prev[`${prefix}-active-pressed`] = withColorMixin(
|
|
86
|
-
`--${prefix}-active-pressed-${type}
|
|
204
|
+
`--${prefix}-active-pressed-${type}`,
|
|
87
205
|
);
|
|
88
206
|
prev[`${prefix}-active-hover`] = withColorMixin(
|
|
89
|
-
`--${prefix}-active-hover-${type}
|
|
207
|
+
`--${prefix}-active-hover-${type}`,
|
|
90
208
|
);
|
|
91
209
|
prev[`${prefix}-disabled`] = withColorMixin(`--${prefix}-disabled-${type}`);
|
|
92
210
|
return prev;
|
|
93
211
|
}, {});
|
|
94
212
|
}
|
|
95
213
|
|
|
96
|
-
|
|
97
|
-
|
|
214
|
+
/**
|
|
215
|
+
* Generate transparent color aliases for a base color family.
|
|
216
|
+
*
|
|
217
|
+
* @param {string} baseName Base key such as `primary` or `warning`.
|
|
218
|
+
* @param {{ includeOriginalVarAliases?: boolean }} [options]
|
|
219
|
+
* @returns {Record<string, string>} Map like `primary-transparent-8`.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* generateTransparentColorConfig("primary");
|
|
223
|
+
* // => {
|
|
224
|
+
* // "primary-transparent-8": "color-mix(...var(--transparent-primary-8)... )",
|
|
225
|
+
* // "primary-transparent-12": "color-mix(...var(--transparent-primary-12)... )",
|
|
226
|
+
* // ...
|
|
227
|
+
* // }
|
|
228
|
+
*/
|
|
229
|
+
export const generateTransparentColorConfig = (
|
|
230
|
+
baseName,
|
|
231
|
+
{ includeOriginalVarAliases = false } = {},
|
|
232
|
+
) => {
|
|
98
233
|
const colors = {};
|
|
99
234
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
range.forEach((num) => {
|
|
235
|
+
DEFAULT_TRANSPARENT_RANGE.forEach((num) => {
|
|
103
236
|
colors[`${baseName}-transparent-${num}`] = withColorMixin(
|
|
104
|
-
|
|
237
|
+
`--transparent-${baseName}-${num}`,
|
|
105
238
|
);
|
|
239
|
+
|
|
240
|
+
if (includeOriginalVarAliases) {
|
|
241
|
+
colors[`transparent-${baseName}-${num}`] = withColorMixin(
|
|
242
|
+
`--transparent-${baseName}-${num}`,
|
|
243
|
+
);
|
|
244
|
+
}
|
|
106
245
|
});
|
|
107
246
|
|
|
108
247
|
return colors;
|