@titan-design/react-ui 0.1.0 → 0.2.5
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/README.md +47 -1
- package/dist/{chunk-MGW37MPO.mjs → chunk-UXVRPOME.mjs} +173 -3
- package/dist/chunk-UXVRPOME.mjs.map +1 -0
- package/dist/index.d.mts +101 -12
- package/dist/index.d.ts +101 -12
- package/dist/index.js +1267 -468
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +734 -112
- package/dist/index.mjs.map +1 -1
- package/dist/theme/index.d.mts +86 -1
- package/dist/theme/index.d.ts +86 -1
- package/dist/theme/index.js +166 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +1 -1
- package/package.json +22 -6
- package/src/components/custom/DateTime/DateTime.stories.tsx +180 -0
- package/src/components/custom/DateTime/DateTime.test.tsx +152 -0
- package/src/components/custom/DateTime/DateTime.tsx +235 -0
- package/src/components/custom/DateTime/index.ts +2 -0
- package/src/components/custom/EmptyState/EmptyState.stories.tsx +99 -0
- package/src/components/custom/EmptyState/EmptyState.test.tsx +106 -0
- package/src/components/custom/EmptyState/EmptyState.tsx +68 -0
- package/src/components/custom/EmptyState/index.ts +2 -0
- package/src/components/custom/Metric/Metric.stories.tsx +133 -0
- package/src/components/custom/Metric/Metric.test.tsx +120 -0
- package/src/components/custom/Metric/Metric.tsx +92 -0
- package/src/components/custom/Metric/index.ts +2 -0
- package/src/components/custom/Sidebar/Sidebar.stories.tsx +227 -0
- package/src/components/custom/Sidebar/Sidebar.test.tsx +185 -0
- package/src/components/custom/Sidebar/Sidebar.tsx +257 -0
- package/src/components/custom/Sidebar/index.ts +18 -0
- package/src/components/custom/Table/Table.stories.tsx +481 -0
- package/src/components/custom/Table/Table.test.tsx +531 -0
- package/src/components/custom/Table/Table.tsx +696 -0
- package/src/components/custom/Table/index.ts +22 -0
- package/src/components/custom/Typography/Typography.stories.tsx +153 -0
- package/src/components/custom/Typography/Typography.test.tsx +107 -0
- package/src/components/custom/Typography/Typography.tsx +218 -0
- package/src/components/custom/Typography/index.ts +19 -0
- package/src/components/custom/Workout/RestTimer.stories.tsx +71 -0
- package/src/components/custom/Workout/RestTimer.test.tsx +145 -0
- package/src/components/custom/Workout/RestTimer.tsx +172 -0
- package/src/components/custom/Workout/SupersetWrapper.stories.tsx +144 -0
- package/src/components/custom/Workout/SupersetWrapper.test.tsx +130 -0
- package/src/components/custom/Workout/SupersetWrapper.tsx +63 -0
- package/src/components/custom/Workout/index.ts +2 -0
- package/src/components/custom/index.ts +9 -0
- package/src/components/custom/stepper/Stepper.stories.tsx +245 -0
- package/src/components/custom/stepper/Stepper.test.tsx +230 -0
- package/src/components/custom/stepper/Stepper.tsx +250 -0
- package/src/components/custom/stepper/index.ts +10 -0
- package/src/components/index.ts +5 -0
- package/src/components/ui/alert/Alert.stories.tsx +154 -0
- package/src/components/ui/alert/Alert.test.tsx +202 -0
- package/src/components/ui/alert/Alert.tsx +170 -0
- package/src/components/ui/alert/index.ts +8 -0
- package/src/components/ui/autocomplete/Autocomplete.stories.tsx +299 -0
- package/src/components/ui/autocomplete/Autocomplete.test.tsx +247 -0
- package/src/components/ui/autocomplete/Autocomplete.tsx +332 -0
- package/src/components/ui/autocomplete/index.ts +2 -0
- package/src/components/ui/avatar/Avatar.stories.tsx +105 -0
- package/src/components/ui/avatar/Avatar.test.tsx +152 -0
- package/src/components/ui/avatar/Avatar.tsx +176 -0
- package/src/components/ui/avatar/index.ts +2 -0
- package/src/components/ui/badge/Badge.stories.tsx +100 -0
- package/src/components/ui/badge/Badge.test.tsx +103 -0
- package/src/components/ui/badge/Badge.tsx +119 -0
- package/src/components/ui/badge/index.ts +3 -0
- package/src/components/ui/breadcrumbs/Breadcrumbs.stories.tsx +70 -0
- package/src/components/ui/breadcrumbs/Breadcrumbs.test.tsx +156 -0
- package/src/components/ui/breadcrumbs/Breadcrumbs.tsx +127 -0
- package/src/components/ui/breadcrumbs/index.ts +2 -0
- package/src/components/ui/button/Button.stories.tsx +216 -0
- package/src/components/ui/button/Button.test.tsx +132 -0
- package/src/components/ui/button/Button.tsx +297 -0
- package/src/components/ui/button/index.ts +10 -0
- package/src/components/ui/card/Card.stories.tsx +443 -0
- package/src/components/ui/card/Card.test.tsx +294 -0
- package/src/components/ui/card/Card.tsx +401 -0
- package/src/components/ui/card/index.ts +20 -0
- package/src/components/ui/checkbox/Checkbox.stories.tsx +126 -0
- package/src/components/ui/checkbox/Checkbox.test.tsx +152 -0
- package/src/components/ui/checkbox/Checkbox.tsx +163 -0
- package/src/components/ui/checkbox/index.ts +2 -0
- package/src/components/ui/chip/Chip.stories.tsx +112 -0
- package/src/components/ui/chip/Chip.test.tsx +119 -0
- package/src/components/ui/chip/Chip.tsx +151 -0
- package/src/components/ui/chip/index.ts +2 -0
- package/src/components/ui/collapse/Collapse.stories.tsx +313 -0
- package/src/components/ui/collapse/Collapse.test.tsx +298 -0
- package/src/components/ui/collapse/Collapse.tsx +275 -0
- package/src/components/ui/collapse/index.ts +18 -0
- package/src/components/ui/data-row/DataRow.stories.tsx +78 -0
- package/src/components/ui/data-row/DataRow.test.tsx +78 -0
- package/src/components/ui/data-row/DataRow.tsx +29 -0
- package/src/components/ui/data-row/index.ts +2 -0
- package/src/components/ui/divider/Divider.stories.tsx +71 -0
- package/src/components/ui/divider/Divider.test.tsx +55 -0
- package/src/components/ui/divider/Divider.tsx +37 -0
- package/src/components/ui/divider/index.ts +2 -0
- package/src/components/ui/drawer/Drawer.stories.tsx +228 -0
- package/src/components/ui/drawer/Drawer.test.tsx +142 -0
- package/src/components/ui/drawer/Drawer.tsx +228 -0
- package/src/components/ui/drawer/index.ts +9 -0
- package/src/components/ui/form-field/FormField.stories.tsx +260 -0
- package/src/components/ui/form-field/FormField.test.tsx +280 -0
- package/src/components/ui/form-field/FormField.tsx +308 -0
- package/src/components/ui/form-field/index.ts +2 -0
- package/src/components/ui/help-tip/HelpTip.stories.tsx +250 -0
- package/src/components/ui/help-tip/HelpTip.test.tsx +198 -0
- package/src/components/ui/help-tip/HelpTip.tsx +229 -0
- package/src/components/ui/help-tip/index.ts +2 -0
- package/src/components/ui/icon-box/IconBox.stories.tsx +139 -0
- package/src/components/ui/icon-box/IconBox.test.tsx +120 -0
- package/src/components/ui/icon-box/IconBox.tsx +57 -0
- package/src/components/ui/icon-box/index.ts +1 -0
- package/src/components/ui/index.ts +38 -0
- package/src/components/ui/indicator/Indicator.stories.tsx +74 -0
- package/src/components/ui/indicator/Indicator.test.tsx +55 -0
- package/src/components/ui/indicator/Indicator.tsx +73 -0
- package/src/components/ui/indicator/index.ts +2 -0
- package/src/components/ui/input/Input.stories.tsx +192 -0
- package/src/components/ui/input/Input.test.tsx +86 -0
- package/src/components/ui/input/Input.tsx +273 -0
- package/src/components/ui/input/index.ts +2 -0
- package/src/components/ui/link/Link.stories.tsx +78 -0
- package/src/components/ui/link/Link.test.tsx +94 -0
- package/src/components/ui/link/Link.tsx +86 -0
- package/src/components/ui/link/index.ts +2 -0
- package/src/components/ui/list-item/ListItem.stories.tsx +146 -0
- package/src/components/ui/list-item/ListItem.test.tsx +128 -0
- package/src/components/ui/list-item/ListItem.tsx +89 -0
- package/src/components/ui/list-item/index.ts +14 -0
- package/src/components/ui/menu/Menu.stories.tsx +180 -0
- package/src/components/ui/menu/Menu.test.tsx +353 -0
- package/src/components/ui/menu/Menu.tsx +222 -0
- package/src/components/ui/menu/index.ts +2 -0
- package/src/components/ui/modal/Modal.stories.tsx +350 -0
- package/src/components/ui/modal/Modal.test.tsx +159 -0
- package/src/components/ui/modal/Modal.tsx +254 -0
- package/src/components/ui/modal/index.ts +19 -0
- package/src/components/ui/pill/Pill.stories.tsx +71 -0
- package/src/components/ui/pill/Pill.test.tsx +69 -0
- package/src/components/ui/pill/Pill.tsx +104 -0
- package/src/components/ui/pill/index.ts +2 -0
- package/src/components/ui/popover/Popover.stories.tsx +190 -0
- package/src/components/ui/popover/Popover.test.tsx +419 -0
- package/src/components/ui/popover/Popover.tsx +237 -0
- package/src/components/ui/popover/index.ts +2 -0
- package/src/components/ui/progress/Progress.stories.tsx +190 -0
- package/src/components/ui/progress/Progress.test.tsx +210 -0
- package/src/components/ui/progress/Progress.tsx +339 -0
- package/src/components/ui/progress/index.ts +9 -0
- package/src/components/ui/radio/Radio.stories.tsx +199 -0
- package/src/components/ui/radio/Radio.test.tsx +166 -0
- package/src/components/ui/radio/Radio.tsx +200 -0
- package/src/components/ui/radio/index.ts +2 -0
- package/src/components/ui/section/Section.stories.tsx +111 -0
- package/src/components/ui/section/Section.test.tsx +121 -0
- package/src/components/ui/section/Section.tsx +52 -0
- package/src/components/ui/section/index.ts +6 -0
- package/src/components/ui/select/Select.stories.tsx +286 -0
- package/src/components/ui/select/Select.test.tsx +200 -0
- package/src/components/ui/select/Select.tsx +243 -0
- package/src/components/ui/select/index.ts +2 -0
- package/src/components/ui/skeleton/Skeleton.stories.tsx +153 -0
- package/src/components/ui/skeleton/Skeleton.test.tsx +162 -0
- package/src/components/ui/skeleton/Skeleton.tsx +229 -0
- package/src/components/ui/skeleton/index.ts +16 -0
- package/src/components/ui/spinner/Spinner.stories.tsx +67 -0
- package/src/components/ui/spinner/Spinner.test.tsx +67 -0
- package/src/components/ui/spinner/Spinner.tsx +72 -0
- package/src/components/ui/spinner/index.ts +2 -0
- package/src/components/ui/stack/Stack.stories.tsx +127 -0
- package/src/components/ui/stack/Stack.test.tsx +184 -0
- package/src/components/ui/stack/Stack.tsx +76 -0
- package/src/components/ui/stack/index.ts +2 -0
- package/src/components/ui/surface/Surface.stories.tsx +91 -0
- package/src/components/ui/surface/Surface.test.tsx +63 -0
- package/src/components/ui/surface/Surface.tsx +51 -0
- package/src/components/ui/surface/index.ts +1 -0
- package/src/components/ui/switch/Switch.stories.tsx +111 -0
- package/src/components/ui/switch/Switch.test.tsx +112 -0
- package/src/components/ui/switch/Switch.tsx +103 -0
- package/src/components/ui/switch/index.ts +2 -0
- package/src/components/ui/tabs/Tabs.stories.tsx +213 -0
- package/src/components/ui/tabs/Tabs.test.tsx +192 -0
- package/src/components/ui/tabs/Tabs.tsx +253 -0
- package/src/components/ui/tabs/index.ts +16 -0
- package/src/components/ui/toast/Toast.stories.tsx +255 -0
- package/src/components/ui/toast/Toast.test.tsx +207 -0
- package/src/components/ui/toast/Toast.tsx +327 -0
- package/src/components/ui/toast/index.ts +9 -0
- package/src/components/ui/toolbar-button/ToolbarButton.stories.tsx +415 -0
- package/src/components/ui/toolbar-button/ToolbarButton.test.tsx +224 -0
- package/src/components/ui/toolbar-button/ToolbarButton.tsx +307 -0
- package/src/components/ui/toolbar-button/index.ts +7 -0
- package/src/components/ui/tooltip/Tooltip.stories.tsx +126 -0
- package/src/components/ui/tooltip/Tooltip.test.tsx +262 -0
- package/src/components/ui/tooltip/Tooltip.tsx +234 -0
- package/src/components/ui/tooltip/index.ts +2 -0
- package/src/index.ts +10 -0
- package/src/stories/PresetShowcase.stories.tsx +462 -0
- package/src/stories/ThemePresets.stories.tsx +85 -0
- package/src/test/setup.ts +19 -0
- package/src/theme/Colors.stories.tsx +258 -0
- package/src/theme/config.ts +193 -0
- package/src/theme/elevation.stories.tsx +346 -0
- package/src/theme/elevation.test.ts +27 -0
- package/src/theme/elevation.ts +567 -0
- package/src/theme/global.css +129 -1
- package/src/theme/index.ts +40 -0
- package/src/theme/presets/apply.ts +97 -0
- package/src/theme/presets/audiobook.ts +93 -0
- package/src/theme/presets/default.ts +6 -0
- package/src/theme/presets/index.ts +4 -0
- package/src/theme/presets/presets.test.ts +51 -0
- package/src/theme/presets/types.ts +76 -0
- package/src/theme/shadows.stories.tsx +523 -0
- package/src/theme/shadows.ts +439 -0
- package/src/theme/tokens/index.ts +2 -0
- package/src/theme/tokens/primitives.ts +354 -0
- package/src/theme/tokens/semantic.ts +381 -0
- package/src/types/jest-axe.d.ts +16 -0
- package/src/types/nativewind.d.ts +54 -0
- package/src/utils/avatar-color.test.ts +30 -0
- package/src/utils/avatar-color.ts +20 -0
- package/src/utils/cn.ts +14 -0
- package/src/utils/colors.ts +140 -0
- package/src/utils/form.ts +188 -0
- package/src/utils/index.ts +29 -0
- package/src/utils/useTheme.ts +72 -0
- package/src/web-jsx/jsx-dev-runtime.ts +28 -0
- package/src/web-jsx/jsx-runtime.ts +41 -0
- package/tailwind.config.js +53 -3
- package/dist/chunk-MGW37MPO.mjs.map +0 -1
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primitive Design Tokens
|
|
3
|
+
*
|
|
4
|
+
* Raw values with no semantic meaning. These are the foundation of the design system
|
|
5
|
+
* and should rarely be used directly in components. Use semantic tokens instead.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const primitiveColors = {
|
|
9
|
+
// Blue scale (primary brand)
|
|
10
|
+
blue: {
|
|
11
|
+
50: '#EFF6FF',
|
|
12
|
+
100: '#DBEAFE',
|
|
13
|
+
200: '#BFDBFE',
|
|
14
|
+
300: '#93C5FD',
|
|
15
|
+
400: '#60A5FA',
|
|
16
|
+
500: '#3B82F6',
|
|
17
|
+
600: '#5048E5', // Primary main
|
|
18
|
+
700: '#3832A0', // Primary dark
|
|
19
|
+
800: '#1E40AF',
|
|
20
|
+
900: '#1E3A8A',
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Green scale (secondary brand)
|
|
24
|
+
green: {
|
|
25
|
+
50: '#ECFDF5',
|
|
26
|
+
100: '#D1FAE5',
|
|
27
|
+
200: '#A7F3D0',
|
|
28
|
+
300: '#6EE7B7',
|
|
29
|
+
400: '#3FC79A', // Secondary light
|
|
30
|
+
500: '#10B981', // Secondary main
|
|
31
|
+
600: '#059669',
|
|
32
|
+
700: '#0B815A', // Secondary dark
|
|
33
|
+
800: '#065F46',
|
|
34
|
+
900: '#064E3B',
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
// Teal scale (success)
|
|
38
|
+
teal: {
|
|
39
|
+
50: '#F0FDFA',
|
|
40
|
+
100: '#CCFBF1',
|
|
41
|
+
200: '#99F6E4',
|
|
42
|
+
300: '#5EEAD4',
|
|
43
|
+
400: '#43C6B7', // Success light
|
|
44
|
+
500: '#14B8A6', // Success main
|
|
45
|
+
600: '#0D9488',
|
|
46
|
+
700: '#0E8074', // Success dark
|
|
47
|
+
800: '#115E59',
|
|
48
|
+
900: '#134E4A',
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// Red scale (error)
|
|
52
|
+
red: {
|
|
53
|
+
50: '#FEF2F2',
|
|
54
|
+
100: '#FEE2E2',
|
|
55
|
+
200: '#FECACA',
|
|
56
|
+
300: '#FCA5A5',
|
|
57
|
+
400: '#DA6868', // Error light
|
|
58
|
+
500: '#EF4444',
|
|
59
|
+
600: '#D14343', // Error main
|
|
60
|
+
700: '#922E2E', // Error dark
|
|
61
|
+
800: '#991B1B',
|
|
62
|
+
900: '#7F1D1D',
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
// Amber scale (warning)
|
|
66
|
+
amber: {
|
|
67
|
+
50: '#FFFBEB',
|
|
68
|
+
100: '#FEF3C7',
|
|
69
|
+
200: '#FDE68A',
|
|
70
|
+
300: '#FCD34D',
|
|
71
|
+
400: '#FFBF4C', // Warning light
|
|
72
|
+
500: '#FFB020', // Warning main
|
|
73
|
+
600: '#B27B16', // Warning dark
|
|
74
|
+
700: '#B45309',
|
|
75
|
+
800: '#92400E',
|
|
76
|
+
900: '#78350F',
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
// Sky/Blue scale (info)
|
|
80
|
+
sky: {
|
|
81
|
+
50: '#F0F9FF',
|
|
82
|
+
100: '#E0F2FE',
|
|
83
|
+
200: '#BAE6FD',
|
|
84
|
+
300: '#7DD3FC',
|
|
85
|
+
400: '#64B6F7', // Info light
|
|
86
|
+
500: '#2196F3', // Info main
|
|
87
|
+
600: '#0284C7',
|
|
88
|
+
700: '#0B79D0', // Info dark
|
|
89
|
+
800: '#075985',
|
|
90
|
+
900: '#0C4A6E',
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
// Neutral/Gray scale
|
|
94
|
+
neutral: {
|
|
95
|
+
50: '#FAFAFA',
|
|
96
|
+
100: '#F3F4F6',
|
|
97
|
+
200: '#E5E7EB',
|
|
98
|
+
300: '#D1D5DB',
|
|
99
|
+
400: '#9CA3AF',
|
|
100
|
+
500: '#6B7280',
|
|
101
|
+
600: '#4B5563',
|
|
102
|
+
700: '#374151',
|
|
103
|
+
800: '#1F2937',
|
|
104
|
+
900: '#111827',
|
|
105
|
+
950: '#030712',
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
// Orange scale (accent/brand color)
|
|
109
|
+
accent: {
|
|
110
|
+
100: '#FFA860',
|
|
111
|
+
200: '#FF9630',
|
|
112
|
+
300: '#FF8500',
|
|
113
|
+
400: '#FF7900',
|
|
114
|
+
500: '#F56C00',
|
|
115
|
+
600: '#E06D10',
|
|
116
|
+
700: '#D0620C',
|
|
117
|
+
800: '#B75500',
|
|
118
|
+
900: '#A34900',
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
// Charcoal scale (dark backgrounds)
|
|
122
|
+
charcoal: {
|
|
123
|
+
0: '#6E6E6E',
|
|
124
|
+
50: '#5D5D5D',
|
|
125
|
+
100: '#4C4C4C',
|
|
126
|
+
200: '#3C3C3C',
|
|
127
|
+
300: '#2C2C2C',
|
|
128
|
+
400: '#1F1F1F',
|
|
129
|
+
500: '#1C1C1C',
|
|
130
|
+
600: '#191919',
|
|
131
|
+
700: '#161616',
|
|
132
|
+
800: '#131313',
|
|
133
|
+
900: '#101010',
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
// Steel scale (cool accent)
|
|
137
|
+
steel: {
|
|
138
|
+
100: '#8AA4B8',
|
|
139
|
+
200: '#7894A8',
|
|
140
|
+
300: '#678498',
|
|
141
|
+
400: '#557488',
|
|
142
|
+
500: '#406D87',
|
|
143
|
+
600: '#39617A',
|
|
144
|
+
700: '#32556D',
|
|
145
|
+
800: '#243D53',
|
|
146
|
+
900: '#1D3146',
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
// Pure colors
|
|
150
|
+
white: '#FFFFFF',
|
|
151
|
+
black: '#000000',
|
|
152
|
+
transparent: 'transparent',
|
|
153
|
+
} as const
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Discrete rainbow palette for data visualization
|
|
157
|
+
* Based on Paul Tol's color schemes: https://personal.sron.nl/~pault/#fig:scheme_rainbow_discrete
|
|
158
|
+
*/
|
|
159
|
+
export const discreteRainbow = [
|
|
160
|
+
'#E8ECFB',
|
|
161
|
+
'#D9CCE3',
|
|
162
|
+
'#D1BBD7',
|
|
163
|
+
'#CAACCB',
|
|
164
|
+
'#BA8DB4',
|
|
165
|
+
'#AE76A3',
|
|
166
|
+
'#AA6F9E',
|
|
167
|
+
'#994F88',
|
|
168
|
+
'#882E72',
|
|
169
|
+
'#1965B0',
|
|
170
|
+
'#437DBF',
|
|
171
|
+
'#5289C7',
|
|
172
|
+
'#6195CF',
|
|
173
|
+
'#7BAFDE',
|
|
174
|
+
'#4EB265',
|
|
175
|
+
'#90C987',
|
|
176
|
+
'#CAE0AB',
|
|
177
|
+
'#F7F056',
|
|
178
|
+
'#F7CB45',
|
|
179
|
+
'#F6C141',
|
|
180
|
+
'#F4A736',
|
|
181
|
+
'#F1932D',
|
|
182
|
+
'#EE8026',
|
|
183
|
+
'#E8601C',
|
|
184
|
+
'#E65518',
|
|
185
|
+
'#DC050C',
|
|
186
|
+
'#A5170E',
|
|
187
|
+
'#72190E',
|
|
188
|
+
'#42150A',
|
|
189
|
+
] as const
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Palette indices for discrete rainbow colors at different palette sizes.
|
|
193
|
+
* For a given palette size (index + 1), returns the indices of colors to use.
|
|
194
|
+
*/
|
|
195
|
+
const discreteRainbowPalettes: number[][] = [
|
|
196
|
+
[10],
|
|
197
|
+
[10, 26],
|
|
198
|
+
[10, 18, 26],
|
|
199
|
+
[10, 15, 18, 26],
|
|
200
|
+
[10, 14, 15, 18, 26],
|
|
201
|
+
[10, 14, 15, 17, 18, 26],
|
|
202
|
+
[9, 10, 14, 15, 17, 18, 26],
|
|
203
|
+
[9, 10, 14, 15, 17, 18, 23, 26],
|
|
204
|
+
[9, 10, 14, 15, 17, 18, 23, 26, 28],
|
|
205
|
+
[9, 10, 14, 15, 17, 18, 21, 24, 26, 28],
|
|
206
|
+
[9, 10, 12, 14, 15, 17, 18, 21, 24, 26, 28],
|
|
207
|
+
[3, 6, 9, 10, 12, 14, 15, 17, 18, 21, 24, 26],
|
|
208
|
+
[3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 21, 24, 26],
|
|
209
|
+
[3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26],
|
|
210
|
+
[3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],
|
|
211
|
+
[3, 5, 7, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],
|
|
212
|
+
[3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],
|
|
213
|
+
[3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],
|
|
214
|
+
[2, 4, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],
|
|
215
|
+
[2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],
|
|
216
|
+
[2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28],
|
|
217
|
+
[2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],
|
|
218
|
+
[1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],
|
|
219
|
+
]
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Get a color from the discrete rainbow palette for a given index and palette size.
|
|
223
|
+
* Colors are optimized for visual distinction at each palette size.
|
|
224
|
+
*
|
|
225
|
+
* @param index - The index of the color in the series (0-based)
|
|
226
|
+
* @param size - The total number of colors needed (1-23)
|
|
227
|
+
* @returns The hex color string
|
|
228
|
+
*/
|
|
229
|
+
export function getDiscreteRainbowColor(index: number, size: number): string {
|
|
230
|
+
index = Math.max(0, index)
|
|
231
|
+
size = Math.min(Math.max(1, size), discreteRainbowPalettes.length)
|
|
232
|
+
|
|
233
|
+
const palette = discreteRainbowPalettes[size - 1]
|
|
234
|
+
if (index >= palette.length) index = index % palette.length
|
|
235
|
+
|
|
236
|
+
return discreteRainbow[palette[index] - 1]
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export const primitiveTypography = {
|
|
240
|
+
fontFamilies: {
|
|
241
|
+
sans: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Helvetica', 'Arial', 'sans-serif'],
|
|
242
|
+
body: ['Nunito Sans', 'sans-serif'],
|
|
243
|
+
heading: ['Space Grotesk', 'sans-serif'],
|
|
244
|
+
mono: ['SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', 'monospace'],
|
|
245
|
+
},
|
|
246
|
+
fontSizes: {
|
|
247
|
+
xs: '0.75rem', // 12px
|
|
248
|
+
sm: '0.875rem', // 14px
|
|
249
|
+
base: '1rem', // 16px
|
|
250
|
+
lg: '1.125rem', // 18px
|
|
251
|
+
xl: '1.5rem', // 24px
|
|
252
|
+
'2xl': '2rem', // 32px
|
|
253
|
+
'3xl': '2.25rem', // 36px
|
|
254
|
+
'4xl': '3rem', // 48px
|
|
255
|
+
'5xl': '3.5rem', // 56px
|
|
256
|
+
},
|
|
257
|
+
fontWeights: {
|
|
258
|
+
normal: 400,
|
|
259
|
+
medium: 500,
|
|
260
|
+
semibold: 600,
|
|
261
|
+
bold: 700,
|
|
262
|
+
},
|
|
263
|
+
lineHeights: {
|
|
264
|
+
none: 1,
|
|
265
|
+
tight: 1.375,
|
|
266
|
+
snug: 1.5,
|
|
267
|
+
normal: 1.57,
|
|
268
|
+
relaxed: 1.66,
|
|
269
|
+
loose: 1.75,
|
|
270
|
+
},
|
|
271
|
+
letterSpacing: {
|
|
272
|
+
tighter: '-0.05em',
|
|
273
|
+
tight: '-0.025em',
|
|
274
|
+
normal: '0em',
|
|
275
|
+
wide: '0.025em',
|
|
276
|
+
wider: '0.05em',
|
|
277
|
+
widest: '0.5px',
|
|
278
|
+
},
|
|
279
|
+
} as const
|
|
280
|
+
|
|
281
|
+
export const primitiveSpacing = {
|
|
282
|
+
0: '0',
|
|
283
|
+
px: '1px',
|
|
284
|
+
0.5: '0.125rem', // 2px
|
|
285
|
+
1: '0.25rem', // 4px
|
|
286
|
+
1.5: '0.375rem', // 6px
|
|
287
|
+
2: '0.5rem', // 8px
|
|
288
|
+
2.5: '0.625rem', // 10px
|
|
289
|
+
3: '0.75rem', // 12px
|
|
290
|
+
3.5: '0.875rem', // 14px
|
|
291
|
+
4: '1rem', // 16px
|
|
292
|
+
5: '1.25rem', // 20px
|
|
293
|
+
6: '1.5rem', // 24px
|
|
294
|
+
7: '1.75rem', // 28px
|
|
295
|
+
8: '2rem', // 32px
|
|
296
|
+
9: '2.25rem', // 36px
|
|
297
|
+
10: '2.5rem', // 40px
|
|
298
|
+
11: '2.75rem', // 44px
|
|
299
|
+
12: '3rem', // 48px
|
|
300
|
+
14: '3.5rem', // 56px
|
|
301
|
+
16: '4rem', // 64px
|
|
302
|
+
20: '5rem', // 80px
|
|
303
|
+
24: '6rem', // 96px
|
|
304
|
+
28: '7rem', // 112px
|
|
305
|
+
32: '8rem', // 128px
|
|
306
|
+
} as const
|
|
307
|
+
|
|
308
|
+
export const primitiveBorderRadius = {
|
|
309
|
+
none: '0',
|
|
310
|
+
sm: '4px',
|
|
311
|
+
DEFAULT: '8px',
|
|
312
|
+
md: '8px',
|
|
313
|
+
lg: '12px',
|
|
314
|
+
xl: '16px',
|
|
315
|
+
'2xl': '24px',
|
|
316
|
+
full: '9999px',
|
|
317
|
+
} as const
|
|
318
|
+
|
|
319
|
+
export const primitiveShadows = {
|
|
320
|
+
none: 'none',
|
|
321
|
+
sm: '0px 1px 2px rgba(100, 116, 139, 0.12)',
|
|
322
|
+
DEFAULT: '0px 1px 3px rgba(100, 116, 139, 0.12), 0px 1px 2px rgba(100, 116, 139, 0.24)',
|
|
323
|
+
md: '0px 4px 6px rgba(100, 116, 139, 0.12)',
|
|
324
|
+
lg: '0px 10px 15px rgba(100, 116, 139, 0.12)',
|
|
325
|
+
xl: '0px 20px 25px rgba(100, 116, 139, 0.12)',
|
|
326
|
+
'2xl': '0px 25px 50px rgba(100, 116, 139, 0.25)',
|
|
327
|
+
inner: 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)',
|
|
328
|
+
} as const
|
|
329
|
+
|
|
330
|
+
export const primitiveBreakpoints = {
|
|
331
|
+
xs: 0,
|
|
332
|
+
sm: 600,
|
|
333
|
+
md: 1000,
|
|
334
|
+
lg: 1200,
|
|
335
|
+
xl: 1920,
|
|
336
|
+
} as const
|
|
337
|
+
|
|
338
|
+
export const primitiveZIndex = {
|
|
339
|
+
hide: -1,
|
|
340
|
+
auto: 'auto',
|
|
341
|
+
base: 0,
|
|
342
|
+
docked: 10,
|
|
343
|
+
dropdown: 1000,
|
|
344
|
+
sticky: 1100,
|
|
345
|
+
drawer: 1100,
|
|
346
|
+
banner: 1200,
|
|
347
|
+
appBar: 1200,
|
|
348
|
+
overlay: 1300,
|
|
349
|
+
modal: 1400,
|
|
350
|
+
popover: 1500,
|
|
351
|
+
skipLink: 1600,
|
|
352
|
+
toast: 1700,
|
|
353
|
+
tooltip: 1800,
|
|
354
|
+
} as const
|