@castui/cast-ui 4.1.1 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +129 -19
  2. package/dist/components/Alert/Alert.d.ts +40 -0
  3. package/dist/components/Alert/Alert.js +71 -0
  4. package/dist/components/Alert/index.d.ts +1 -0
  5. package/dist/components/Alert/index.js +5 -0
  6. package/dist/components/Avatar/Avatar.d.ts +31 -0
  7. package/dist/components/Avatar/Avatar.js +55 -0
  8. package/dist/components/Avatar/index.d.ts +1 -0
  9. package/dist/components/Avatar/index.js +5 -0
  10. package/dist/components/Badge/Badge.d.ts +41 -0
  11. package/dist/components/Badge/Badge.js +71 -0
  12. package/dist/components/Badge/index.d.ts +1 -0
  13. package/dist/components/Badge/index.js +5 -0
  14. package/dist/components/Button/Button.d.ts +0 -1
  15. package/dist/components/Button/Button.js +21 -19
  16. package/dist/components/Button/index.d.ts +0 -1
  17. package/dist/components/Button/index.js +5 -2
  18. package/dist/components/Card/Card.d.ts +41 -0
  19. package/dist/components/Card/Card.js +91 -0
  20. package/dist/components/Card/index.d.ts +1 -0
  21. package/dist/components/Card/index.js +5 -0
  22. package/dist/components/Checkbox/Checkbox.d.ts +32 -0
  23. package/dist/components/Checkbox/Checkbox.js +107 -0
  24. package/dist/components/Checkbox/index.d.ts +1 -0
  25. package/dist/components/Checkbox/index.js +5 -0
  26. package/dist/components/Chip/Chip.d.ts +46 -0
  27. package/dist/components/Chip/Chip.js +82 -0
  28. package/dist/components/Chip/index.d.ts +1 -0
  29. package/dist/components/Chip/index.js +5 -0
  30. package/dist/components/Dialog/Dialog.d.ts +0 -1
  31. package/dist/components/Dialog/Dialog.js +33 -26
  32. package/dist/components/Dialog/index.d.ts +0 -1
  33. package/dist/components/Dialog/index.js +6 -2
  34. package/dist/components/Divider/Divider.d.ts +22 -0
  35. package/dist/components/Divider/Divider.js +19 -0
  36. package/dist/components/Divider/index.d.ts +1 -0
  37. package/dist/components/Divider/index.js +5 -0
  38. package/dist/components/Icon/Icon.d.ts +26 -9
  39. package/dist/components/Icon/Icon.js +16 -6
  40. package/dist/components/Icon/index.d.ts +0 -1
  41. package/dist/components/Icon/index.js +5 -2
  42. package/dist/components/Input/Input.d.ts +62 -0
  43. package/dist/components/Input/Input.js +141 -0
  44. package/dist/components/Input/index.d.ts +1 -0
  45. package/dist/components/Input/index.js +5 -0
  46. package/dist/components/List/List.d.ts +58 -0
  47. package/dist/components/List/List.js +116 -0
  48. package/dist/components/List/index.d.ts +1 -0
  49. package/dist/components/List/index.js +8 -0
  50. package/dist/components/Popover/Popover.d.ts +34 -0
  51. package/dist/components/Popover/Popover.js +62 -0
  52. package/dist/components/Popover/index.d.ts +1 -0
  53. package/dist/components/Popover/index.js +5 -0
  54. package/dist/components/Radio/Radio.d.ts +52 -0
  55. package/dist/components/Radio/Radio.js +127 -0
  56. package/dist/components/Radio/index.d.ts +1 -0
  57. package/dist/components/Radio/index.js +6 -0
  58. package/dist/components/Select/Select.d.ts +0 -1
  59. package/dist/components/Select/Select.js +114 -96
  60. package/dist/components/Select/index.d.ts +0 -1
  61. package/dist/components/Select/index.js +10 -2
  62. package/dist/components/Skeleton/Skeleton.d.ts +33 -0
  63. package/dist/components/Skeleton/Skeleton.js +66 -0
  64. package/dist/components/Skeleton/index.d.ts +1 -0
  65. package/dist/components/Skeleton/index.js +5 -0
  66. package/dist/components/Toast/Toast.d.ts +35 -0
  67. package/dist/components/Toast/Toast.js +79 -0
  68. package/dist/components/Toast/index.d.ts +1 -0
  69. package/dist/components/Toast/index.js +5 -0
  70. package/dist/components/Toggle/Toggle.d.ts +31 -0
  71. package/dist/components/Toggle/Toggle.js +91 -0
  72. package/dist/components/Toggle/index.d.ts +1 -0
  73. package/dist/components/Toggle/index.js +5 -0
  74. package/dist/components/Tooltip/Tooltip.d.ts +34 -0
  75. package/dist/components/Tooltip/Tooltip.js +67 -0
  76. package/dist/components/Tooltip/index.d.ts +1 -0
  77. package/dist/components/Tooltip/index.js +5 -0
  78. package/dist/index.d.ts +17 -3
  79. package/dist/index.js +81 -7
  80. package/dist/theme/ThemeContext.d.ts +24 -8
  81. package/dist/theme/ThemeContext.js +41 -22
  82. package/dist/theme/index.d.ts +1 -2
  83. package/dist/theme/index.js +8 -3
  84. package/dist/theme/themes.d.ts +0 -1
  85. package/dist/theme/themes.js +214 -2
  86. package/dist/theme/types.d.ts +183 -1
  87. package/dist/theme/types.js +2 -2
  88. package/dist/tokens/colors.d.ts +294 -26
  89. package/dist/tokens/colors.js +324 -99
  90. package/dist/tokens/index.d.ts +1 -2
  91. package/dist/tokens/index.js +29 -3
  92. package/dist/tokens/typography.d.ts +0 -1
  93. package/dist/tokens/typography.js +13 -11
  94. package/package.json +13 -2
  95. package/dist/components/Button/Button.d.ts.map +0 -1
  96. package/dist/components/Button/Button.js.map +0 -1
  97. package/dist/components/Button/index.d.ts.map +0 -1
  98. package/dist/components/Button/index.js.map +0 -1
  99. package/dist/components/Dialog/Dialog.d.ts.map +0 -1
  100. package/dist/components/Dialog/Dialog.js.map +0 -1
  101. package/dist/components/Dialog/index.d.ts.map +0 -1
  102. package/dist/components/Dialog/index.js.map +0 -1
  103. package/dist/components/Icon/Icon.d.ts.map +0 -1
  104. package/dist/components/Icon/Icon.js.map +0 -1
  105. package/dist/components/Icon/index.d.ts.map +0 -1
  106. package/dist/components/Icon/index.js.map +0 -1
  107. package/dist/components/Select/Select.d.ts.map +0 -1
  108. package/dist/components/Select/Select.js.map +0 -1
  109. package/dist/components/Select/index.d.ts.map +0 -1
  110. package/dist/components/Select/index.js.map +0 -1
  111. package/dist/index.d.ts.map +0 -1
  112. package/dist/index.js.map +0 -1
  113. package/dist/theme/ThemeContext.d.ts.map +0 -1
  114. package/dist/theme/ThemeContext.js.map +0 -1
  115. package/dist/theme/index.d.ts.map +0 -1
  116. package/dist/theme/index.js.map +0 -1
  117. package/dist/theme/themes.d.ts.map +0 -1
  118. package/dist/theme/themes.js.map +0 -1
  119. package/dist/theme/types.d.ts.map +0 -1
  120. package/dist/theme/types.js.map +0 -1
  121. package/dist/tokens/colors.d.ts.map +0 -1
  122. package/dist/tokens/colors.js.map +0 -1
  123. package/dist/tokens/index.d.ts.map +0 -1
  124. package/dist/tokens/index.js.map +0 -1
  125. package/dist/tokens/typography.d.ts.map +0 -1
  126. package/dist/tokens/typography.js.map +0 -1
@@ -1,9 +1,17 @@
1
1
  /**
2
- * Semantic intent colors — derived from semantic.tokens.json
2
+ * Semantic intent colours — derived from semantic.tokens.json
3
3
  * Maps: intent → prominence → state → { bg, fg, border }
4
4
  *
5
5
  * Source tokens: intent/{intent}/{prominence}/{state}/{bg|fg|border}
6
6
  * Primitive palette refs: blue (brand), cool-grey (neutral), red (danger)
7
+ *
8
+ * Two colour schemes are exported — `lightColors` and `darkColors` — matching
9
+ * the `semantic-light` / `semantic-dark` modes of the Figma semantic variable
10
+ * collection. The active scheme is resolved by ThemeProvider via the
11
+ * `colorMode` prop; components read colours from `useTheme().scheme`.
12
+ *
13
+ * The flat named exports at the bottom (intentColors, surfaceTokens, …) are
14
+ * the light-scheme values, kept for backwards compatibility.
7
15
  */
8
16
  type StateColors = {
9
17
  bg: string;
@@ -23,18 +31,202 @@ type IntentColors = {
23
31
  export type IntentName = 'brand' | 'neutral' | 'danger';
24
32
  export type ProminenceName = 'default' | 'bold' | 'subtle';
25
33
  export type StateName = 'default' | 'hover' | 'active';
34
+ /** Colour mode — matches the semantic-light/semantic-dark Figma variable modes */
35
+ export type ColorMode = 'light' | 'dark';
36
+ type OptionStateColors = {
37
+ default: {
38
+ bg: string;
39
+ fg: string;
40
+ };
41
+ hover: {
42
+ bg: string;
43
+ fg: string;
44
+ };
45
+ selected: {
46
+ bg: string;
47
+ fg: string;
48
+ };
49
+ selectedHover: {
50
+ bg: string;
51
+ fg: string;
52
+ };
53
+ disabled: {
54
+ bg: string;
55
+ fg: string;
56
+ };
57
+ };
58
+ export type ColorScheme = {
59
+ /** intent → prominence → state → { bg, fg, border } */
60
+ intents: Record<IntentName, IntentColors>;
61
+ /** Disabled state — shared across all intents */
62
+ disabled: StateColors;
63
+ /** Focus ring colour — control/focus-ring-colour */
64
+ focusRing: {
65
+ color: string;
66
+ };
67
+ /** Surface tokens — backgrounds and overlay styling */
68
+ surface: {
69
+ /** Page/screen background — surface/base */
70
+ base: string;
71
+ /** Subtle background for sections/cards — surface/subtle */
72
+ subtle: string;
73
+ /** Overlay surfaces (Dialog, Popover, Tooltip, Select, etc.) */
74
+ overlay: {
75
+ bg: string;
76
+ border: string;
77
+ borderRadius: number;
78
+ };
79
+ };
80
+ /** Semantic text tokens */
81
+ text: {
82
+ description: string;
83
+ /** Placeholder text in form fields — intent/neutral/placeholder */
84
+ placeholder: string;
85
+ };
86
+ /** Overlay/scrim opacity */
87
+ overlay: {
88
+ scrimOpacity: number;
89
+ };
90
+ /** Option state colours — used by SelectOption (neutral intent) */
91
+ select: {
92
+ option: OptionStateColors;
93
+ /** Separator line colour */
94
+ separator: string;
95
+ };
96
+ /** Tag tokens — multi-select pill styling (layout constant across modes) */
97
+ tag: {
98
+ bg: string;
99
+ fg: string;
100
+ borderRadius: number;
101
+ paddingX: number;
102
+ paddingY: number;
103
+ gap: number;
104
+ closeSize: number;
105
+ };
106
+ /** Error/danger colour for form field borders and helper text */
107
+ error: {
108
+ border: string;
109
+ fg: string;
110
+ };
111
+ /** Checkbox colours — indicator box, icon, and label */
112
+ checkbox: {
113
+ box: {
114
+ uncheckedDefault: {
115
+ bg: string;
116
+ border: string;
117
+ };
118
+ uncheckedHover: {
119
+ bg: string;
120
+ border: string;
121
+ };
122
+ checked: {
123
+ bg: string;
124
+ border: string;
125
+ };
126
+ disabled: {
127
+ bg: string;
128
+ border: string;
129
+ };
130
+ };
131
+ icon: {
132
+ default: string;
133
+ disabled: string;
134
+ };
135
+ label: {
136
+ default: string;
137
+ disabled: string;
138
+ };
139
+ };
140
+ /** Radio colours — indicator ring/fill, centre dot, and label */
141
+ radio: {
142
+ indicator: {
143
+ uncheckedDefault: {
144
+ bg: string;
145
+ border: string;
146
+ };
147
+ uncheckedHover: {
148
+ bg: string;
149
+ border: string;
150
+ };
151
+ checked: {
152
+ bg: string;
153
+ border: string;
154
+ };
155
+ checkedHover: {
156
+ bg: string;
157
+ border: string;
158
+ };
159
+ disabled: {
160
+ bg: string;
161
+ border: string;
162
+ };
163
+ };
164
+ dot: {
165
+ default: string;
166
+ disabled: string;
167
+ };
168
+ label: {
169
+ default: string;
170
+ disabled: string;
171
+ };
172
+ };
173
+ /** Toggle colours — track (on/off/disabled) + thumb + label */
174
+ toggle: {
175
+ track: {
176
+ off: string;
177
+ offHover: string;
178
+ on: string;
179
+ onHover: string;
180
+ disabledOff: string;
181
+ disabledOn: string;
182
+ };
183
+ thumb: string;
184
+ label: {
185
+ default: string;
186
+ disabled: string;
187
+ };
188
+ };
189
+ /** Avatar colours — initials/icon fallback surface + foreground */
190
+ avatar: {
191
+ bg: string;
192
+ fg: string;
193
+ };
194
+ /** Skeleton colours — placeholder surface for loading states */
195
+ skeleton: {
196
+ bg: string;
197
+ highlight: string;
198
+ };
199
+ /** List colours — used by List / ListItem / ListSubheader */
200
+ list: {
201
+ item: OptionStateColors;
202
+ subheaderFg: string;
203
+ descriptionFg: string;
204
+ separator: string;
205
+ containerBg: string;
206
+ };
207
+ };
208
+ export declare const lightColors: ColorScheme;
209
+ export declare const darkColors: ColorScheme;
210
+ /** Scheme lookup by colour mode */
211
+ export declare const colorSchemes: Record<ColorMode, ColorScheme>;
26
212
  export declare const intentColors: Record<IntentName, IntentColors>;
27
213
  /** Disabled state — shared across all intents */
28
214
  export declare const disabledColors: StateColors;
29
215
  /** Semantic control constants */
30
216
  export declare const controlTokens: {
31
217
  borderWidth: number;
218
+ /** Focus ring width — control/focus-ring-width */
219
+ focusRingWidth: number;
220
+ /** Focus ring offset — control/focus-ring-offset */
221
+ focusRingOffset: number;
222
+ /** Focus ring colour — control/focus-ring-colour (blue/500). Mode-aware value: useTheme().scheme.focusRing.color */
223
+ focusRingColor: string;
32
224
  };
33
225
  /** Surface tokens — backgrounds and overlay styling */
34
226
  export declare const surfaceTokens: {
35
- /** Page/screen background — cool-grey/50 */
227
+ /** Page/screen background — surface/base */
36
228
  base: string;
37
- /** Subtle background for sections/cards — cool-grey/100 */
229
+ /** Subtle background for sections/cards — surface/subtle */
38
230
  subtle: string;
39
231
  /** Overlay surfaces (Dialog, Popover, Tooltip, Select, etc.) */
40
232
  overlay: {
@@ -46,6 +238,8 @@ export declare const surfaceTokens: {
46
238
  /** Semantic text tokens */
47
239
  export declare const textTokens: {
48
240
  description: string;
241
+ /** Placeholder text in form fields — intent/neutral/placeholder */
242
+ placeholder: string;
49
243
  };
50
244
  /** Overlay/scrim opacity */
51
245
  export declare const overlayTokens: {
@@ -53,28 +247,7 @@ export declare const overlayTokens: {
53
247
  };
54
248
  /** Option state colours — used by SelectOption (neutral intent) */
55
249
  export declare const selectColors: {
56
- option: {
57
- default: {
58
- bg: string;
59
- fg: string;
60
- };
61
- hover: {
62
- bg: string;
63
- fg: string;
64
- };
65
- selected: {
66
- bg: string;
67
- fg: string;
68
- };
69
- selectedHover: {
70
- bg: string;
71
- fg: string;
72
- };
73
- disabled: {
74
- bg: string;
75
- fg: string;
76
- };
77
- };
250
+ option: OptionStateColors;
78
251
  /** Separator line colour */
79
252
  separator: string;
80
253
  };
@@ -93,5 +266,100 @@ export declare const errorTokens: {
93
266
  border: string;
94
267
  fg: string;
95
268
  };
269
+ /** Checkbox colours — indicator box, icon, and label */
270
+ export declare const checkboxColors: {
271
+ box: {
272
+ uncheckedDefault: {
273
+ bg: string;
274
+ border: string;
275
+ };
276
+ uncheckedHover: {
277
+ bg: string;
278
+ border: string;
279
+ };
280
+ checked: {
281
+ bg: string;
282
+ border: string;
283
+ };
284
+ disabled: {
285
+ bg: string;
286
+ border: string;
287
+ };
288
+ };
289
+ icon: {
290
+ default: string;
291
+ disabled: string;
292
+ };
293
+ label: {
294
+ default: string;
295
+ disabled: string;
296
+ };
297
+ };
298
+ /** Radio colours — indicator ring/fill, centre dot, and label */
299
+ export declare const radioColors: {
300
+ indicator: {
301
+ uncheckedDefault: {
302
+ bg: string;
303
+ border: string;
304
+ };
305
+ uncheckedHover: {
306
+ bg: string;
307
+ border: string;
308
+ };
309
+ checked: {
310
+ bg: string;
311
+ border: string;
312
+ };
313
+ checkedHover: {
314
+ bg: string;
315
+ border: string;
316
+ };
317
+ disabled: {
318
+ bg: string;
319
+ border: string;
320
+ };
321
+ };
322
+ dot: {
323
+ default: string;
324
+ disabled: string;
325
+ };
326
+ label: {
327
+ default: string;
328
+ disabled: string;
329
+ };
330
+ };
331
+ /** Toggle colours — track (on/off/disabled) + thumb + label */
332
+ export declare const toggleColors: {
333
+ track: {
334
+ off: string;
335
+ offHover: string;
336
+ on: string;
337
+ onHover: string;
338
+ disabledOff: string;
339
+ disabledOn: string;
340
+ };
341
+ thumb: string;
342
+ label: {
343
+ default: string;
344
+ disabled: string;
345
+ };
346
+ };
347
+ /** Avatar colours — initials/icon fallback surface + foreground */
348
+ export declare const avatarColors: {
349
+ bg: string;
350
+ fg: string;
351
+ };
352
+ /** Skeleton colours — placeholder surface for loading states */
353
+ export declare const skeletonColors: {
354
+ bg: string;
355
+ highlight: string;
356
+ };
357
+ /** List colours — used by List / ListItem / ListSubheader */
358
+ export declare const listColors: {
359
+ item: OptionStateColors;
360
+ subheaderFg: string;
361
+ descriptionFg: string;
362
+ separator: string;
363
+ containerBg: string;
364
+ };
96
365
  export {};
97
- //# sourceMappingURL=colors.d.ts.map