@titan-design/react-ui 0.0.2 → 0.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.
Files changed (206) hide show
  1. package/dist/{chunk-NA3EES23.mjs → chunk-MGW37MPO.mjs} +26 -4
  2. package/dist/chunk-MGW37MPO.mjs.map +1 -0
  3. package/dist/index.d.mts +115 -2
  4. package/dist/index.d.ts +115 -2
  5. package/dist/index.js +262 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +225 -3
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/theme/index.d.mts +124 -109
  10. package/dist/theme/index.d.ts +124 -109
  11. package/dist/theme/index.js +24 -1
  12. package/dist/theme/index.js.map +1 -1
  13. package/dist/theme/index.mjs +1 -1
  14. package/package.json +12 -5
  15. package/src/components/custom/DateTime/DateTime.stories.tsx +180 -0
  16. package/src/components/custom/DateTime/DateTime.test.tsx +152 -0
  17. package/src/components/custom/DateTime/DateTime.tsx +235 -0
  18. package/src/components/custom/DateTime/index.ts +2 -0
  19. package/src/components/custom/EmptyState/EmptyState.stories.tsx +99 -0
  20. package/src/components/custom/EmptyState/EmptyState.test.tsx +106 -0
  21. package/src/components/custom/EmptyState/EmptyState.tsx +68 -0
  22. package/src/components/custom/EmptyState/index.ts +2 -0
  23. package/src/components/custom/Metric/Metric.stories.tsx +133 -0
  24. package/src/components/custom/Metric/Metric.test.tsx +120 -0
  25. package/src/components/custom/Metric/Metric.tsx +92 -0
  26. package/src/components/custom/Metric/index.ts +2 -0
  27. package/src/components/custom/Sidebar/Sidebar.stories.tsx +227 -0
  28. package/src/components/custom/Sidebar/Sidebar.test.tsx +185 -0
  29. package/src/components/custom/Sidebar/Sidebar.tsx +257 -0
  30. package/src/components/custom/Sidebar/index.ts +18 -0
  31. package/src/components/custom/Table/Table.stories.tsx +481 -0
  32. package/src/components/custom/Table/Table.test.tsx +531 -0
  33. package/src/components/custom/Table/Table.tsx +696 -0
  34. package/src/components/custom/Table/index.ts +22 -0
  35. package/src/components/custom/Typography/Typography.stories.tsx +153 -0
  36. package/src/components/custom/Typography/Typography.test.tsx +107 -0
  37. package/src/components/custom/Typography/Typography.tsx +218 -0
  38. package/src/components/custom/Typography/index.ts +19 -0
  39. package/src/components/custom/index.ts +8 -0
  40. package/src/components/custom/stepper/Stepper.stories.tsx +245 -0
  41. package/src/components/custom/stepper/Stepper.test.tsx +230 -0
  42. package/src/components/custom/stepper/Stepper.tsx +250 -0
  43. package/src/components/custom/stepper/index.ts +10 -0
  44. package/src/components/index.ts +5 -0
  45. package/src/components/ui/alert/Alert.stories.tsx +154 -0
  46. package/src/components/ui/alert/Alert.test.tsx +202 -0
  47. package/src/components/ui/alert/Alert.tsx +170 -0
  48. package/src/components/ui/alert/index.ts +8 -0
  49. package/src/components/ui/autocomplete/Autocomplete.stories.tsx +299 -0
  50. package/src/components/ui/autocomplete/Autocomplete.test.tsx +247 -0
  51. package/src/components/ui/autocomplete/Autocomplete.tsx +332 -0
  52. package/src/components/ui/autocomplete/index.ts +2 -0
  53. package/src/components/ui/avatar/Avatar.stories.tsx +105 -0
  54. package/src/components/ui/avatar/Avatar.test.tsx +135 -0
  55. package/src/components/ui/avatar/Avatar.tsx +168 -0
  56. package/src/components/ui/avatar/index.ts +2 -0
  57. package/src/components/ui/badge/Badge.stories.tsx +100 -0
  58. package/src/components/ui/badge/Badge.test.tsx +86 -0
  59. package/src/components/ui/badge/Badge.tsx +105 -0
  60. package/src/components/ui/badge/index.ts +2 -0
  61. package/src/components/ui/breadcrumbs/Breadcrumbs.stories.tsx +70 -0
  62. package/src/components/ui/breadcrumbs/Breadcrumbs.test.tsx +156 -0
  63. package/src/components/ui/breadcrumbs/Breadcrumbs.tsx +127 -0
  64. package/src/components/ui/breadcrumbs/index.ts +2 -0
  65. package/src/components/ui/button/Button.stories.tsx +216 -0
  66. package/src/components/ui/button/Button.test.tsx +132 -0
  67. package/src/components/ui/button/Button.tsx +242 -0
  68. package/src/components/ui/button/index.ts +10 -0
  69. package/src/components/ui/card/Card.stories.tsx +443 -0
  70. package/src/components/ui/card/Card.test.tsx +265 -0
  71. package/src/components/ui/card/Card.tsx +380 -0
  72. package/src/components/ui/card/index.ts +20 -0
  73. package/src/components/ui/checkbox/Checkbox.stories.tsx +126 -0
  74. package/src/components/ui/checkbox/Checkbox.test.tsx +152 -0
  75. package/src/components/ui/checkbox/Checkbox.tsx +163 -0
  76. package/src/components/ui/checkbox/index.ts +2 -0
  77. package/src/components/ui/chip/Chip.stories.tsx +112 -0
  78. package/src/components/ui/chip/Chip.test.tsx +119 -0
  79. package/src/components/ui/chip/Chip.tsx +151 -0
  80. package/src/components/ui/chip/index.ts +2 -0
  81. package/src/components/ui/collapse/Collapse.stories.tsx +313 -0
  82. package/src/components/ui/collapse/Collapse.test.tsx +298 -0
  83. package/src/components/ui/collapse/Collapse.tsx +275 -0
  84. package/src/components/ui/collapse/index.ts +18 -0
  85. package/src/components/ui/data-row/DataRow.stories.tsx +78 -0
  86. package/src/components/ui/data-row/DataRow.test.tsx +78 -0
  87. package/src/components/ui/data-row/DataRow.tsx +29 -0
  88. package/src/components/ui/data-row/index.ts +2 -0
  89. package/src/components/ui/divider/Divider.stories.tsx +71 -0
  90. package/src/components/ui/divider/Divider.test.tsx +55 -0
  91. package/src/components/ui/divider/Divider.tsx +37 -0
  92. package/src/components/ui/divider/index.ts +2 -0
  93. package/src/components/ui/drawer/Drawer.stories.tsx +228 -0
  94. package/src/components/ui/drawer/Drawer.test.tsx +142 -0
  95. package/src/components/ui/drawer/Drawer.tsx +228 -0
  96. package/src/components/ui/drawer/index.ts +9 -0
  97. package/src/components/ui/form-field/FormField.stories.tsx +260 -0
  98. package/src/components/ui/form-field/FormField.test.tsx +280 -0
  99. package/src/components/ui/form-field/FormField.tsx +308 -0
  100. package/src/components/ui/form-field/index.ts +2 -0
  101. package/src/components/ui/help-tip/HelpTip.stories.tsx +250 -0
  102. package/src/components/ui/help-tip/HelpTip.test.tsx +198 -0
  103. package/src/components/ui/help-tip/HelpTip.tsx +229 -0
  104. package/src/components/ui/help-tip/index.ts +2 -0
  105. package/src/components/ui/icon-box/IconBox.stories.tsx +139 -0
  106. package/src/components/ui/icon-box/IconBox.test.tsx +120 -0
  107. package/src/components/ui/icon-box/IconBox.tsx +57 -0
  108. package/src/components/ui/icon-box/index.ts +1 -0
  109. package/src/components/ui/index.ts +36 -0
  110. package/src/components/ui/input/Input.stories.tsx +192 -0
  111. package/src/components/ui/input/Input.test.tsx +86 -0
  112. package/src/components/ui/input/Input.tsx +273 -0
  113. package/src/components/ui/input/index.ts +2 -0
  114. package/src/components/ui/link/Link.stories.tsx +78 -0
  115. package/src/components/ui/link/Link.test.tsx +94 -0
  116. package/src/components/ui/link/Link.tsx +86 -0
  117. package/src/components/ui/link/index.ts +2 -0
  118. package/src/components/ui/list-item/ListItem.stories.tsx +146 -0
  119. package/src/components/ui/list-item/ListItem.test.tsx +128 -0
  120. package/src/components/ui/list-item/ListItem.tsx +89 -0
  121. package/src/components/ui/list-item/index.ts +14 -0
  122. package/src/components/ui/menu/Menu.stories.tsx +180 -0
  123. package/src/components/ui/menu/Menu.test.tsx +353 -0
  124. package/src/components/ui/menu/Menu.tsx +222 -0
  125. package/src/components/ui/menu/index.ts +2 -0
  126. package/src/components/ui/modal/Modal.stories.tsx +350 -0
  127. package/src/components/ui/modal/Modal.test.tsx +159 -0
  128. package/src/components/ui/modal/Modal.tsx +254 -0
  129. package/src/components/ui/modal/index.ts +19 -0
  130. package/src/components/ui/popover/Popover.stories.tsx +190 -0
  131. package/src/components/ui/popover/Popover.test.tsx +277 -0
  132. package/src/components/ui/popover/Popover.tsx +162 -0
  133. package/src/components/ui/popover/index.ts +2 -0
  134. package/src/components/ui/progress/Progress.stories.tsx +190 -0
  135. package/src/components/ui/progress/Progress.test.tsx +181 -0
  136. package/src/components/ui/progress/Progress.tsx +320 -0
  137. package/src/components/ui/progress/index.ts +9 -0
  138. package/src/components/ui/radio/Radio.stories.tsx +199 -0
  139. package/src/components/ui/radio/Radio.test.tsx +166 -0
  140. package/src/components/ui/radio/Radio.tsx +200 -0
  141. package/src/components/ui/radio/index.ts +2 -0
  142. package/src/components/ui/section/Section.stories.tsx +111 -0
  143. package/src/components/ui/section/Section.test.tsx +121 -0
  144. package/src/components/ui/section/Section.tsx +52 -0
  145. package/src/components/ui/section/index.ts +6 -0
  146. package/src/components/ui/select/Select.stories.tsx +286 -0
  147. package/src/components/ui/select/Select.test.tsx +180 -0
  148. package/src/components/ui/select/Select.tsx +236 -0
  149. package/src/components/ui/select/index.ts +2 -0
  150. package/src/components/ui/skeleton/Skeleton.stories.tsx +153 -0
  151. package/src/components/ui/skeleton/Skeleton.test.tsx +162 -0
  152. package/src/components/ui/skeleton/Skeleton.tsx +229 -0
  153. package/src/components/ui/skeleton/index.ts +16 -0
  154. package/src/components/ui/spinner/Spinner.stories.tsx +67 -0
  155. package/src/components/ui/spinner/Spinner.test.tsx +67 -0
  156. package/src/components/ui/spinner/Spinner.tsx +72 -0
  157. package/src/components/ui/spinner/index.ts +2 -0
  158. package/src/components/ui/stack/Stack.stories.tsx +127 -0
  159. package/src/components/ui/stack/Stack.test.tsx +184 -0
  160. package/src/components/ui/stack/Stack.tsx +76 -0
  161. package/src/components/ui/stack/index.ts +2 -0
  162. package/src/components/ui/surface/Surface.stories.tsx +91 -0
  163. package/src/components/ui/surface/Surface.test.tsx +63 -0
  164. package/src/components/ui/surface/Surface.tsx +51 -0
  165. package/src/components/ui/surface/index.ts +1 -0
  166. package/src/components/ui/switch/Switch.stories.tsx +111 -0
  167. package/src/components/ui/switch/Switch.test.tsx +112 -0
  168. package/src/components/ui/switch/Switch.tsx +103 -0
  169. package/src/components/ui/switch/index.ts +2 -0
  170. package/src/components/ui/tabs/Tabs.stories.tsx +213 -0
  171. package/src/components/ui/tabs/Tabs.test.tsx +192 -0
  172. package/src/components/ui/tabs/Tabs.tsx +253 -0
  173. package/src/components/ui/tabs/index.ts +16 -0
  174. package/src/components/ui/toast/Toast.stories.tsx +255 -0
  175. package/src/components/ui/toast/Toast.test.tsx +207 -0
  176. package/src/components/ui/toast/Toast.tsx +327 -0
  177. package/src/components/ui/toast/index.ts +8 -0
  178. package/src/components/ui/toolbar-button/ToolbarButton.stories.tsx +415 -0
  179. package/src/components/ui/toolbar-button/ToolbarButton.test.tsx +224 -0
  180. package/src/components/ui/toolbar-button/ToolbarButton.tsx +307 -0
  181. package/src/components/ui/toolbar-button/index.ts +7 -0
  182. package/src/components/ui/tooltip/Tooltip.stories.tsx +126 -0
  183. package/src/components/ui/tooltip/Tooltip.test.tsx +179 -0
  184. package/src/components/ui/tooltip/Tooltip.tsx +143 -0
  185. package/src/components/ui/tooltip/index.ts +2 -0
  186. package/src/index.ts +10 -0
  187. package/src/test/setup.ts +19 -0
  188. package/src/theme/Colors.stories.tsx +258 -0
  189. package/src/theme/config.ts +193 -0
  190. package/src/theme/elevation.stories.tsx +346 -0
  191. package/src/theme/elevation.test.ts +27 -0
  192. package/src/theme/elevation.ts +567 -0
  193. package/src/theme/index.ts +39 -0
  194. package/src/theme/shadows.stories.tsx +523 -0
  195. package/src/theme/shadows.ts +439 -0
  196. package/src/theme/tokens/index.ts +2 -0
  197. package/src/theme/tokens/primitives.ts +354 -0
  198. package/src/theme/tokens/semantic.ts +381 -0
  199. package/src/types/jest-axe.d.ts +16 -0
  200. package/src/types/nativewind.d.ts +54 -0
  201. package/src/utils/cn.ts +14 -0
  202. package/src/utils/colors.ts +140 -0
  203. package/src/utils/form.ts +188 -0
  204. package/src/utils/index.ts +29 -0
  205. package/src/utils/useTheme.ts +72 -0
  206. package/dist/chunk-NA3EES23.mjs.map +0 -1
@@ -1,5 +1,128 @@
1
1
  import { ViewStyle } from 'react-native';
2
2
 
3
+ /**
4
+ * Elevation System
5
+ *
6
+ * A unified depth system where each elevation level corresponds to:
7
+ * - Calculated surface color (derived from base using lighten)
8
+ * - Shadow intensity and style (raised/pressed)
9
+ * - Dynamically calculated shadow colors (derived from surface color)
10
+ * - Semantic name for reference
11
+ *
12
+ * Elevation range: -2 (deep inset) to +5 (floating overlay)
13
+ *
14
+ * Negative elevations: Inset/pressed elements (sunken into surface)
15
+ * Zero elevation: Base surface (background/page level)
16
+ * Positive elevations: Raised elements (floating above surface)
17
+ *
18
+ * All colors are calculated dynamically from a base surface color,
19
+ * allowing for custom surfaces and consistent color relationships.
20
+ *
21
+ * Lighting Model: Light source from upper-right corner
22
+ * - Raised elements are always lighter than base (consistent across themes)
23
+ * - Base colors must allow sufficient lightening in both themes
24
+ */
25
+
26
+ type ElevationLevel = -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5;
27
+ interface ElevationConfig {
28
+ /** Semantic name for this elevation level */
29
+ name: string;
30
+ /** Amount to lighten base color (0-1) */
31
+ colorAdjustment: number;
32
+ /** Shadow intensity */
33
+ shadowIntensity: 'subtle' | 'medium' | 'strong';
34
+ /** Shadow style: raised (floating) or pressed (inset) */
35
+ shadowStyle: 'raised' | 'pressed';
36
+ /** Description of use case */
37
+ description: string;
38
+ }
39
+ declare const elevationSystem: Record<ElevationLevel, ElevationConfig>;
40
+ /**
41
+ * Get elevation configuration for a given level
42
+ */
43
+ declare function getElevationConfig(level: ElevationLevel): ElevationConfig;
44
+ /**
45
+ * Calculate surface color for an elevation level from a base color.
46
+ * Results are cached to avoid redundant calculations.
47
+ *
48
+ * @param baseColor - Base surface color (hex)
49
+ * @param level - Elevation level
50
+ * @param theme - Current theme ('light' or 'dark')
51
+ * @returns Calculated surface color (hex)
52
+ */
53
+ declare function getElevationSurface(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark'): string;
54
+ /**
55
+ * Get shadow style for an elevation level, calculated dynamically from surface color.
56
+ * Results are cached to avoid redundant calculations.
57
+ *
58
+ * @param baseColor - Base surface color (hex)
59
+ * @param level - Elevation level
60
+ * @param theme - Current theme ('light' or 'dark')
61
+ * @param isHovered - Whether element is hovered
62
+ * @returns ViewStyle with shadow properties
63
+ */
64
+ declare function getElevationShadow(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark', isHovered?: boolean): ViewStyle;
65
+ /**
66
+ * Get base surface color from theme.
67
+ * This is the foundation color that all elevations are calculated from.
68
+ *
69
+ * IMPORTANT: Base colors must be chosen to allow sufficient lightening.
70
+ *
71
+ * **Light Mode**: Cannot use `#FFFFFF` (white) - cannot lighten white!
72
+ * - Use `#F3F4F6` (neutral[100]) - can lighten to `#FAFAFA` → `#FFFFFF`
73
+ * - This allows raised elevations to be lighter (closer to white)
74
+ *
75
+ * **Dark Mode**: Need lighter base to allow sufficient lightening
76
+ * - Use `#191919` (charcoal[600]) - allows lightening to `#2A2A2A` at max elevation
77
+ *
78
+ * Can be overridden to use custom base colors for special cases.
79
+ */
80
+ declare function getBaseSurfaceColor(theme: 'light' | 'dark'): string;
81
+ /**
82
+ * Component-specific elevation ranges
83
+ * Defines which elevation levels each component type can use
84
+ */
85
+ declare const componentElevationRanges: {
86
+ readonly button: {
87
+ readonly allowed: readonly [2];
88
+ readonly default: 2;
89
+ readonly hover: 3;
90
+ };
91
+ readonly card: {
92
+ readonly allowed: readonly [1, 2, 3];
93
+ readonly default: 2;
94
+ readonly hover: 3;
95
+ };
96
+ readonly input: {
97
+ readonly allowed: readonly [-2, -1, 0];
98
+ readonly default: -1;
99
+ };
100
+ readonly overlay: {
101
+ readonly allowed: readonly [4, 5];
102
+ readonly default: 4;
103
+ };
104
+ };
105
+ type ComponentType = keyof typeof componentElevationRanges;
106
+ /**
107
+ * Validate and clamp elevation to component's allowed range
108
+ */
109
+ declare function getValidatedElevation(component: ComponentType, requested: ElevationLevel): ElevationLevel;
110
+ type GlowIntensity = 'subtle' | 'medium' | 'strong';
111
+ /**
112
+ * Get a glow shadow style for emphasis/active states.
113
+ *
114
+ * Creates a colored radial glow around an element, useful for:
115
+ * - Active recording indicators (orange glow)
116
+ * - Success states (green glow)
117
+ * - Error/danger indicators (red glow)
118
+ * - Focus rings and attention-drawing elements
119
+ *
120
+ * @param color - Glow color (hex string, e.g. '#FF7900')
121
+ * @param intensity - Glow intensity level
122
+ * @returns ViewStyle with platform-specific shadow properties
123
+ */
124
+ declare function getGlowShadow(color: string, intensity?: GlowIntensity): ViewStyle;
125
+
3
126
  /**
4
127
  * Primitive Design Tokens
5
128
  *
@@ -1176,112 +1299,4 @@ declare const neumorphicShadows: {
1176
1299
  };
1177
1300
  };
1178
1301
 
1179
- /**
1180
- * Elevation System
1181
- *
1182
- * A unified depth system where each elevation level corresponds to:
1183
- * - Calculated surface color (derived from base using lighten)
1184
- * - Shadow intensity and style (raised/pressed)
1185
- * - Dynamically calculated shadow colors (derived from surface color)
1186
- * - Semantic name for reference
1187
- *
1188
- * Elevation range: -2 (deep inset) to +5 (floating overlay)
1189
- *
1190
- * Negative elevations: Inset/pressed elements (sunken into surface)
1191
- * Zero elevation: Base surface (background/page level)
1192
- * Positive elevations: Raised elements (floating above surface)
1193
- *
1194
- * All colors are calculated dynamically from a base surface color,
1195
- * allowing for custom surfaces and consistent color relationships.
1196
- *
1197
- * Lighting Model: Light source from upper-right corner
1198
- * - Raised elements are always lighter than base (consistent across themes)
1199
- * - Base colors must allow sufficient lightening in both themes
1200
- */
1201
-
1202
- type ElevationLevel = -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5;
1203
- interface ElevationConfig {
1204
- /** Semantic name for this elevation level */
1205
- name: string;
1206
- /** Amount to lighten base color (0-1) */
1207
- colorAdjustment: number;
1208
- /** Shadow intensity */
1209
- shadowIntensity: 'subtle' | 'medium' | 'strong';
1210
- /** Shadow style: raised (floating) or pressed (inset) */
1211
- shadowStyle: 'raised' | 'pressed';
1212
- /** Description of use case */
1213
- description: string;
1214
- }
1215
- declare const elevationSystem: Record<ElevationLevel, ElevationConfig>;
1216
- /**
1217
- * Get elevation configuration for a given level
1218
- */
1219
- declare function getElevationConfig(level: ElevationLevel): ElevationConfig;
1220
- /**
1221
- * Calculate surface color for an elevation level from a base color.
1222
- * Results are cached to avoid redundant calculations.
1223
- *
1224
- * @param baseColor - Base surface color (hex)
1225
- * @param level - Elevation level
1226
- * @param theme - Current theme ('light' or 'dark')
1227
- * @returns Calculated surface color (hex)
1228
- */
1229
- declare function getElevationSurface(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark'): string;
1230
- /**
1231
- * Get shadow style for an elevation level, calculated dynamically from surface color.
1232
- * Results are cached to avoid redundant calculations.
1233
- *
1234
- * @param baseColor - Base surface color (hex)
1235
- * @param level - Elevation level
1236
- * @param theme - Current theme ('light' or 'dark')
1237
- * @param isHovered - Whether element is hovered
1238
- * @returns ViewStyle with shadow properties
1239
- */
1240
- declare function getElevationShadow(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark', isHovered?: boolean): ViewStyle;
1241
- /**
1242
- * Get base surface color from theme.
1243
- * This is the foundation color that all elevations are calculated from.
1244
- *
1245
- * IMPORTANT: Base colors must be chosen to allow sufficient lightening.
1246
- *
1247
- * **Light Mode**: Cannot use `#FFFFFF` (white) - cannot lighten white!
1248
- * - Use `#F3F4F6` (neutral[100]) - can lighten to `#FAFAFA` → `#FFFFFF`
1249
- * - This allows raised elevations to be lighter (closer to white)
1250
- *
1251
- * **Dark Mode**: Need lighter base to allow sufficient lightening
1252
- * - Use `#191919` (charcoal[600]) - allows lightening to `#2A2A2A` at max elevation
1253
- *
1254
- * Can be overridden to use custom base colors for special cases.
1255
- */
1256
- declare function getBaseSurfaceColor(theme: 'light' | 'dark'): string;
1257
- /**
1258
- * Component-specific elevation ranges
1259
- * Defines which elevation levels each component type can use
1260
- */
1261
- declare const componentElevationRanges: {
1262
- readonly button: {
1263
- readonly allowed: readonly [2];
1264
- readonly default: 2;
1265
- readonly hover: 3;
1266
- };
1267
- readonly card: {
1268
- readonly allowed: readonly [1, 2, 3];
1269
- readonly default: 2;
1270
- readonly hover: 3;
1271
- };
1272
- readonly input: {
1273
- readonly allowed: readonly [-2, -1, 0];
1274
- readonly default: -1;
1275
- };
1276
- readonly overlay: {
1277
- readonly allowed: readonly [4, 5];
1278
- readonly default: 4;
1279
- };
1280
- };
1281
- type ComponentType = keyof typeof componentElevationRanges;
1282
- /**
1283
- * Validate and clamp elevation to component's allowed range
1284
- */
1285
- declare function getValidatedElevation(component: ComponentType, requested: ElevationLevel): ElevationLevel;
1286
-
1287
- export { type ComponentType, type ElevationConfig, type ElevationLevel, type ShadowIntensity, type ShadowSurface, type ThemeConfig, type ThemeMode, buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors };
1302
+ export { type ComponentType, type ElevationConfig, type ElevationLevel, type GlowIntensity, type ShadowIntensity, type ShadowSurface, type ThemeConfig, type ThemeMode, buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors };
@@ -1,5 +1,128 @@
1
1
  import { ViewStyle } from 'react-native';
2
2
 
3
+ /**
4
+ * Elevation System
5
+ *
6
+ * A unified depth system where each elevation level corresponds to:
7
+ * - Calculated surface color (derived from base using lighten)
8
+ * - Shadow intensity and style (raised/pressed)
9
+ * - Dynamically calculated shadow colors (derived from surface color)
10
+ * - Semantic name for reference
11
+ *
12
+ * Elevation range: -2 (deep inset) to +5 (floating overlay)
13
+ *
14
+ * Negative elevations: Inset/pressed elements (sunken into surface)
15
+ * Zero elevation: Base surface (background/page level)
16
+ * Positive elevations: Raised elements (floating above surface)
17
+ *
18
+ * All colors are calculated dynamically from a base surface color,
19
+ * allowing for custom surfaces and consistent color relationships.
20
+ *
21
+ * Lighting Model: Light source from upper-right corner
22
+ * - Raised elements are always lighter than base (consistent across themes)
23
+ * - Base colors must allow sufficient lightening in both themes
24
+ */
25
+
26
+ type ElevationLevel = -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5;
27
+ interface ElevationConfig {
28
+ /** Semantic name for this elevation level */
29
+ name: string;
30
+ /** Amount to lighten base color (0-1) */
31
+ colorAdjustment: number;
32
+ /** Shadow intensity */
33
+ shadowIntensity: 'subtle' | 'medium' | 'strong';
34
+ /** Shadow style: raised (floating) or pressed (inset) */
35
+ shadowStyle: 'raised' | 'pressed';
36
+ /** Description of use case */
37
+ description: string;
38
+ }
39
+ declare const elevationSystem: Record<ElevationLevel, ElevationConfig>;
40
+ /**
41
+ * Get elevation configuration for a given level
42
+ */
43
+ declare function getElevationConfig(level: ElevationLevel): ElevationConfig;
44
+ /**
45
+ * Calculate surface color for an elevation level from a base color.
46
+ * Results are cached to avoid redundant calculations.
47
+ *
48
+ * @param baseColor - Base surface color (hex)
49
+ * @param level - Elevation level
50
+ * @param theme - Current theme ('light' or 'dark')
51
+ * @returns Calculated surface color (hex)
52
+ */
53
+ declare function getElevationSurface(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark'): string;
54
+ /**
55
+ * Get shadow style for an elevation level, calculated dynamically from surface color.
56
+ * Results are cached to avoid redundant calculations.
57
+ *
58
+ * @param baseColor - Base surface color (hex)
59
+ * @param level - Elevation level
60
+ * @param theme - Current theme ('light' or 'dark')
61
+ * @param isHovered - Whether element is hovered
62
+ * @returns ViewStyle with shadow properties
63
+ */
64
+ declare function getElevationShadow(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark', isHovered?: boolean): ViewStyle;
65
+ /**
66
+ * Get base surface color from theme.
67
+ * This is the foundation color that all elevations are calculated from.
68
+ *
69
+ * IMPORTANT: Base colors must be chosen to allow sufficient lightening.
70
+ *
71
+ * **Light Mode**: Cannot use `#FFFFFF` (white) - cannot lighten white!
72
+ * - Use `#F3F4F6` (neutral[100]) - can lighten to `#FAFAFA` → `#FFFFFF`
73
+ * - This allows raised elevations to be lighter (closer to white)
74
+ *
75
+ * **Dark Mode**: Need lighter base to allow sufficient lightening
76
+ * - Use `#191919` (charcoal[600]) - allows lightening to `#2A2A2A` at max elevation
77
+ *
78
+ * Can be overridden to use custom base colors for special cases.
79
+ */
80
+ declare function getBaseSurfaceColor(theme: 'light' | 'dark'): string;
81
+ /**
82
+ * Component-specific elevation ranges
83
+ * Defines which elevation levels each component type can use
84
+ */
85
+ declare const componentElevationRanges: {
86
+ readonly button: {
87
+ readonly allowed: readonly [2];
88
+ readonly default: 2;
89
+ readonly hover: 3;
90
+ };
91
+ readonly card: {
92
+ readonly allowed: readonly [1, 2, 3];
93
+ readonly default: 2;
94
+ readonly hover: 3;
95
+ };
96
+ readonly input: {
97
+ readonly allowed: readonly [-2, -1, 0];
98
+ readonly default: -1;
99
+ };
100
+ readonly overlay: {
101
+ readonly allowed: readonly [4, 5];
102
+ readonly default: 4;
103
+ };
104
+ };
105
+ type ComponentType = keyof typeof componentElevationRanges;
106
+ /**
107
+ * Validate and clamp elevation to component's allowed range
108
+ */
109
+ declare function getValidatedElevation(component: ComponentType, requested: ElevationLevel): ElevationLevel;
110
+ type GlowIntensity = 'subtle' | 'medium' | 'strong';
111
+ /**
112
+ * Get a glow shadow style for emphasis/active states.
113
+ *
114
+ * Creates a colored radial glow around an element, useful for:
115
+ * - Active recording indicators (orange glow)
116
+ * - Success states (green glow)
117
+ * - Error/danger indicators (red glow)
118
+ * - Focus rings and attention-drawing elements
119
+ *
120
+ * @param color - Glow color (hex string, e.g. '#FF7900')
121
+ * @param intensity - Glow intensity level
122
+ * @returns ViewStyle with platform-specific shadow properties
123
+ */
124
+ declare function getGlowShadow(color: string, intensity?: GlowIntensity): ViewStyle;
125
+
3
126
  /**
4
127
  * Primitive Design Tokens
5
128
  *
@@ -1176,112 +1299,4 @@ declare const neumorphicShadows: {
1176
1299
  };
1177
1300
  };
1178
1301
 
1179
- /**
1180
- * Elevation System
1181
- *
1182
- * A unified depth system where each elevation level corresponds to:
1183
- * - Calculated surface color (derived from base using lighten)
1184
- * - Shadow intensity and style (raised/pressed)
1185
- * - Dynamically calculated shadow colors (derived from surface color)
1186
- * - Semantic name for reference
1187
- *
1188
- * Elevation range: -2 (deep inset) to +5 (floating overlay)
1189
- *
1190
- * Negative elevations: Inset/pressed elements (sunken into surface)
1191
- * Zero elevation: Base surface (background/page level)
1192
- * Positive elevations: Raised elements (floating above surface)
1193
- *
1194
- * All colors are calculated dynamically from a base surface color,
1195
- * allowing for custom surfaces and consistent color relationships.
1196
- *
1197
- * Lighting Model: Light source from upper-right corner
1198
- * - Raised elements are always lighter than base (consistent across themes)
1199
- * - Base colors must allow sufficient lightening in both themes
1200
- */
1201
-
1202
- type ElevationLevel = -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5;
1203
- interface ElevationConfig {
1204
- /** Semantic name for this elevation level */
1205
- name: string;
1206
- /** Amount to lighten base color (0-1) */
1207
- colorAdjustment: number;
1208
- /** Shadow intensity */
1209
- shadowIntensity: 'subtle' | 'medium' | 'strong';
1210
- /** Shadow style: raised (floating) or pressed (inset) */
1211
- shadowStyle: 'raised' | 'pressed';
1212
- /** Description of use case */
1213
- description: string;
1214
- }
1215
- declare const elevationSystem: Record<ElevationLevel, ElevationConfig>;
1216
- /**
1217
- * Get elevation configuration for a given level
1218
- */
1219
- declare function getElevationConfig(level: ElevationLevel): ElevationConfig;
1220
- /**
1221
- * Calculate surface color for an elevation level from a base color.
1222
- * Results are cached to avoid redundant calculations.
1223
- *
1224
- * @param baseColor - Base surface color (hex)
1225
- * @param level - Elevation level
1226
- * @param theme - Current theme ('light' or 'dark')
1227
- * @returns Calculated surface color (hex)
1228
- */
1229
- declare function getElevationSurface(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark'): string;
1230
- /**
1231
- * Get shadow style for an elevation level, calculated dynamically from surface color.
1232
- * Results are cached to avoid redundant calculations.
1233
- *
1234
- * @param baseColor - Base surface color (hex)
1235
- * @param level - Elevation level
1236
- * @param theme - Current theme ('light' or 'dark')
1237
- * @param isHovered - Whether element is hovered
1238
- * @returns ViewStyle with shadow properties
1239
- */
1240
- declare function getElevationShadow(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark', isHovered?: boolean): ViewStyle;
1241
- /**
1242
- * Get base surface color from theme.
1243
- * This is the foundation color that all elevations are calculated from.
1244
- *
1245
- * IMPORTANT: Base colors must be chosen to allow sufficient lightening.
1246
- *
1247
- * **Light Mode**: Cannot use `#FFFFFF` (white) - cannot lighten white!
1248
- * - Use `#F3F4F6` (neutral[100]) - can lighten to `#FAFAFA` → `#FFFFFF`
1249
- * - This allows raised elevations to be lighter (closer to white)
1250
- *
1251
- * **Dark Mode**: Need lighter base to allow sufficient lightening
1252
- * - Use `#191919` (charcoal[600]) - allows lightening to `#2A2A2A` at max elevation
1253
- *
1254
- * Can be overridden to use custom base colors for special cases.
1255
- */
1256
- declare function getBaseSurfaceColor(theme: 'light' | 'dark'): string;
1257
- /**
1258
- * Component-specific elevation ranges
1259
- * Defines which elevation levels each component type can use
1260
- */
1261
- declare const componentElevationRanges: {
1262
- readonly button: {
1263
- readonly allowed: readonly [2];
1264
- readonly default: 2;
1265
- readonly hover: 3;
1266
- };
1267
- readonly card: {
1268
- readonly allowed: readonly [1, 2, 3];
1269
- readonly default: 2;
1270
- readonly hover: 3;
1271
- };
1272
- readonly input: {
1273
- readonly allowed: readonly [-2, -1, 0];
1274
- readonly default: -1;
1275
- };
1276
- readonly overlay: {
1277
- readonly allowed: readonly [4, 5];
1278
- readonly default: 4;
1279
- };
1280
- };
1281
- type ComponentType = keyof typeof componentElevationRanges;
1282
- /**
1283
- * Validate and clamp elevation to component's allowed range
1284
- */
1285
- declare function getValidatedElevation(component: ComponentType, requested: ElevationLevel): ElevationLevel;
1286
-
1287
- export { type ComponentType, type ElevationConfig, type ElevationLevel, type ShadowIntensity, type ShadowSurface, type ThemeConfig, type ThemeMode, buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors };
1302
+ export { type ComponentType, type ElevationConfig, type ElevationLevel, type GlowIntensity, type ShadowIntensity, type ShadowSurface, type ThemeConfig, type ThemeMode, buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors };
@@ -926,7 +926,7 @@ function hsvToRgb(h, s, v) {
926
926
  const c = v * s;
927
927
  const x = c * (1 - Math.abs(h / 60 % 2 - 1));
928
928
  const m = v - c;
929
- let rPrime = 0, gPrime = 0, bPrime = 0;
929
+ let rPrime, gPrime, bPrime;
930
930
  if (h >= 0 && h < 60) {
931
931
  rPrime = c;
932
932
  gPrime = x;
@@ -1477,6 +1477,28 @@ function getValidatedElevation(component, requested) {
1477
1477
  (prev, curr) => Math.abs(curr - requested) < Math.abs(prev - requested) ? curr : prev
1478
1478
  );
1479
1479
  }
1480
+ var glowConfig = {
1481
+ subtle: { blur: 12, spread: 0, opacity: 0.25 },
1482
+ medium: { blur: 20, spread: 2, opacity: 0.4 },
1483
+ strong: { blur: 30, spread: 4, opacity: 0.55 }
1484
+ };
1485
+ function getGlowShadow(color, intensity = "medium") {
1486
+ const config = glowConfig[intensity];
1487
+ const rgb = hexToRgb(color);
1488
+ if (!rgb) return {};
1489
+ return reactNative.Platform.select({
1490
+ web: {
1491
+ boxShadow: `0 0 ${config.blur}px ${config.spread}px rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${config.opacity})`
1492
+ },
1493
+ default: {
1494
+ shadowColor: color,
1495
+ shadowOffset: { width: 0, height: 0 },
1496
+ shadowOpacity: config.opacity,
1497
+ shadowRadius: config.blur / 2,
1498
+ elevation: 0
1499
+ }
1500
+ });
1501
+ }
1480
1502
 
1481
1503
  exports.buttonSizes = buttonSizes;
1482
1504
  exports.componentElevationRanges = componentElevationRanges;
@@ -1494,6 +1516,7 @@ exports.getDiscreteRainbowColor = getDiscreteRainbowColor;
1494
1516
  exports.getElevationConfig = getElevationConfig;
1495
1517
  exports.getElevationShadow = getElevationShadow;
1496
1518
  exports.getElevationSurface = getElevationSurface;
1519
+ exports.getGlowShadow = getGlowShadow;
1497
1520
  exports.getHoverColors = getHoverColors;
1498
1521
  exports.getSemanticColors = getSemanticColors;
1499
1522
  exports.getThemeCSSVars = getThemeCSSVars;