flikkui 0.2.0-beta.2 → 0.2.0-beta.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.
Files changed (269) hide show
  1. package/README.md +92 -0
  2. package/dist/components/ai/PromptInput/PromptInput.js +23 -15
  3. package/dist/components/ai/PromptSuggestions/PromptSuggestion.d.ts +27 -0
  4. package/dist/components/ai/PromptSuggestions/PromptSuggestion.js +62 -0
  5. package/dist/components/ai/PromptSuggestions/PromptSuggestion.theme.d.ts +10 -0
  6. package/dist/components/ai/PromptSuggestions/PromptSuggestion.theme.js +12 -0
  7. package/dist/components/ai/PromptSuggestions/PromptSuggestion.types.d.ts +53 -0
  8. package/dist/components/ai/PromptSuggestions/index.d.ts +4 -2
  9. package/dist/components/ai/index.d.ts +2 -12
  10. package/dist/components/charts/ActivityRings/ActivityRings.js +70 -58
  11. package/dist/components/charts/ActivityRings/ActivityRings.theme.js +0 -1
  12. package/dist/components/charts/ActivityRings/ActivityRings.types.d.ts +17 -0
  13. package/dist/components/charts/BarChart/BarChart.js +8 -4
  14. package/dist/components/charts/BarChart/BarChart.types.d.ts +14 -0
  15. package/dist/components/charts/DonutChart/DonutChart.js +11 -8
  16. package/dist/components/charts/DonutChart/DonutChart.theme.d.ts +3 -0
  17. package/dist/components/charts/DonutChart/DonutChart.theme.js +5 -4
  18. package/dist/components/charts/DonutChart/donut-utils.d.ts +5 -0
  19. package/dist/components/charts/DonutChart/donut-utils.js +26 -1
  20. package/dist/components/charts/Heatmap/Heatmap.theme.js +2 -2
  21. package/dist/components/charts/shared/ChartAxis/XAxis.d.ts +2 -2
  22. package/dist/components/charts/shared/ChartAxis/XAxis.js +4 -4
  23. package/dist/components/charts/shared/ChartAxis/YAxis.d.ts +2 -2
  24. package/dist/components/charts/shared/ChartAxis/YAxis.js +8 -7
  25. package/dist/components/charts/shared/ChartGrid/HorizontalGrid.d.ts +1 -1
  26. package/dist/components/charts/shared/ChartGrid/HorizontalGrid.js +2 -2
  27. package/dist/components/charts/theme/chart.theme.d.ts +1 -1
  28. package/dist/components/charts/theme/chart.theme.js +39 -39
  29. package/dist/components/core/Accordion/Accordion.d.ts +1 -1
  30. package/dist/components/core/Accordion/Accordion.js +2 -2
  31. package/dist/components/core/Accordion/Accordion.types.d.ts +8 -0
  32. package/dist/components/core/Badge/Badge.js +11 -15
  33. package/dist/components/core/Badge/Badge.theme.js +7 -21
  34. package/dist/components/core/Badge/Badge.types.d.ts +9 -1
  35. package/dist/components/core/Button/Button.js +2 -2
  36. package/dist/components/core/Button/Button.theme.js +1 -1
  37. package/dist/components/core/Button/Button.types.d.ts +8 -0
  38. package/dist/components/core/Card/Card.js +8 -2
  39. package/dist/components/core/Card/Card.theme.js +1 -1
  40. package/dist/components/core/Card/Card.types.d.ts +24 -1
  41. package/dist/components/core/Drawer/Drawer.d.ts +1 -1
  42. package/dist/components/core/Drawer/Drawer.js +10 -40
  43. package/dist/components/core/Drawer/Drawer.theme.js +2 -1
  44. package/dist/components/core/Drawer/Drawer.types.d.ts +8 -0
  45. package/dist/components/core/Dropdown/Dropdown.d.ts +1 -1
  46. package/dist/components/core/Dropdown/Dropdown.js +2 -2
  47. package/dist/components/core/Dropdown/Dropdown.types.d.ts +8 -0
  48. package/dist/components/core/Metric/Metric.d.ts +1 -1
  49. package/dist/components/core/Metric/Metric.js +9 -5
  50. package/dist/components/core/Metric/Metric.theme.d.ts +1 -1
  51. package/dist/components/core/Metric/Metric.theme.js +38 -28
  52. package/dist/components/core/Metric/Metric.types.d.ts +27 -8
  53. package/dist/components/core/Modal/Modal.d.ts +1 -1
  54. package/dist/components/core/Modal/Modal.js +17 -40
  55. package/dist/components/core/Modal/Modal.theme.js +8 -3
  56. package/dist/components/core/Modal/Modal.types.d.ts +18 -0
  57. package/dist/components/core/Modal/index.d.ts +1 -1
  58. package/dist/components/core/Notification/Notification.js +2 -0
  59. package/dist/components/core/Pill/Pill.d.ts +6 -11
  60. package/dist/components/core/Pill/Pill.theme.d.ts +2 -2
  61. package/dist/components/core/Pill/Pill.types.d.ts +9 -22
  62. package/dist/components/core/Pill/index.d.ts +1 -1
  63. package/dist/components/core/Popover/Popover.d.ts +1 -1
  64. package/dist/components/core/Popover/Popover.js +2 -2
  65. package/dist/components/core/Popover/Popover.types.d.ts +8 -0
  66. package/dist/components/core/Progress/Progress.d.ts +28 -0
  67. package/dist/components/core/Progress/Progress.js +114 -0
  68. package/dist/components/core/Progress/Progress.theme.d.ts +5 -0
  69. package/dist/components/core/Progress/Progress.theme.js +33 -0
  70. package/dist/components/core/Progress/Progress.types.d.ts +92 -0
  71. package/dist/components/core/Progress/index.d.ts +2 -0
  72. package/dist/components/core/Table/Table.animations.d.ts +5 -16
  73. package/dist/components/core/Table/Table.animations.js +46 -0
  74. package/dist/components/core/Table/Table.d.ts +0 -27
  75. package/dist/components/core/Table/Table.js +58 -156
  76. package/dist/components/core/Table/Table.theme.js +28 -19
  77. package/dist/components/core/Table/Table.types.d.ts +95 -8
  78. package/dist/components/core/Table/Table.utils.d.ts +7 -0
  79. package/dist/components/core/Table/Table.utils.js +11 -1
  80. package/dist/components/core/Table/{components/TableActions/TableActions.d.ts → TableActions.d.ts} +3 -3
  81. package/dist/components/core/Table/{components/TableActions/TableActions.js → TableActions.js} +14 -24
  82. package/dist/components/core/Table/{components/TableActions/TableActionsMenu.d.ts → TableActionsMenu.d.ts} +1 -1
  83. package/dist/components/core/Table/{components/TableActions/TableActionsMenu.js → TableActionsMenu.js} +4 -4
  84. package/dist/components/core/Table/{components/core/TableBody.d.ts → TableBody.d.ts} +1 -1
  85. package/dist/components/core/Table/{components/core/TableBody.js → TableBody.js} +14 -20
  86. package/dist/components/core/Table/{components/core/TableCell.d.ts → TableCell.d.ts} +1 -9
  87. package/dist/components/core/Table/{components/core/TableCell.js → TableCell.js} +5 -13
  88. package/dist/components/core/Table/TableColumnManager.d.ts +3 -0
  89. package/dist/components/core/Table/TableColumnManager.js +34 -0
  90. package/dist/components/core/Table/{components/DeclarativeComponents.d.ts → TableDeclarative.d.ts} +1 -1
  91. package/dist/components/core/Table/{components/DeclarativeComponents.js → TableDeclarative.js} +6 -56
  92. package/dist/components/core/Table/TableFilter.d.ts +3 -0
  93. package/dist/components/core/Table/TableFilter.js +122 -0
  94. package/dist/components/core/Table/{components/core/TableHeader.d.ts → TableHeader.d.ts} +1 -1
  95. package/dist/components/core/Table/{components/core/TableHeader.js → TableHeader.js} +15 -29
  96. package/dist/components/core/Table/TablePagination.d.ts +7 -0
  97. package/dist/components/core/Table/{components/TablePagination/TablePagination.js → TablePagination.js} +5 -16
  98. package/dist/components/core/Table/TableRow.d.ts +8 -0
  99. package/dist/components/core/Table/TableRow.js +45 -0
  100. package/dist/components/core/Table/TableSelectionHeader.d.ts +7 -0
  101. package/dist/components/core/Table/{components/TableSelectionHeader/TableSelectionHeader.js → TableSelectionHeader.js} +4 -5
  102. package/dist/components/core/Table/hooks/index.d.ts +10 -0
  103. package/dist/components/core/Table/hooks/useTableColumns.d.ts +16 -0
  104. package/dist/components/core/Table/hooks/useTableColumns.js +67 -0
  105. package/dist/components/core/Table/hooks/useTableExpansion.d.ts +8 -0
  106. package/dist/components/core/Table/hooks/useTableExpansion.js +15 -0
  107. package/dist/components/core/Table/hooks/useTableFilter.d.ts +12 -0
  108. package/dist/components/core/Table/hooks/useTableFilter.js +37 -0
  109. package/dist/components/core/Table/hooks/useTablePagination.d.ts +12 -0
  110. package/dist/components/core/Table/hooks/useTablePagination.js +13 -0
  111. package/dist/components/core/Table/hooks/useTableSelection.d.ts +17 -0
  112. package/dist/components/core/Table/hooks/useTableSelection.js +40 -0
  113. package/dist/components/core/Table/index.d.ts +9 -8
  114. package/dist/components/core/Table/index.js +7 -5
  115. package/dist/components/core/Tabs/Tabs.js +2 -2
  116. package/dist/components/core/Tabs/Tabs.types.d.ts +8 -0
  117. package/dist/components/core/Tag/Tag.animations.d.ts +3 -0
  118. package/dist/components/core/Tag/Tag.animations.js +31 -0
  119. package/dist/components/core/Tag/Tag.d.ts +14 -0
  120. package/dist/components/core/Tag/Tag.js +45 -0
  121. package/dist/components/core/Tag/Tag.theme.d.ts +2 -0
  122. package/dist/components/core/Tag/Tag.theme.js +21 -0
  123. package/dist/components/core/Tag/Tag.types.d.ts +40 -0
  124. package/dist/components/core/Tag/index.d.ts +3 -0
  125. package/dist/components/core/Tooltip/Tooltip.d.ts +1 -1
  126. package/dist/components/core/Tooltip/Tooltip.js +3 -3
  127. package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
  128. package/dist/components/core/Tooltip/Tooltip.types.d.ts +17 -0
  129. package/dist/components/core/index.d.ts +2 -1
  130. package/dist/components/core/index.js +12 -5
  131. package/dist/components/effects/CustomCursor/CustomCursor.d.ts +0 -13
  132. package/dist/components/effects/CustomCursor/CustomCursor.js +26 -2
  133. package/dist/components/effects/CustomCursor/CustomCursor.theme.js +12 -1
  134. package/dist/components/effects/CustomCursor/CustomCursor.types.d.ts +14 -1
  135. package/dist/components/forms/Combobox/Combobox.d.ts +25 -0
  136. package/dist/components/forms/Combobox/Combobox.js +412 -0
  137. package/dist/components/forms/Combobox/Combobox.theme.d.ts +6 -0
  138. package/dist/components/forms/Combobox/Combobox.theme.js +60 -0
  139. package/dist/components/forms/Combobox/Combobox.types.d.ts +111 -0
  140. package/dist/components/forms/Combobox/index.d.ts +3 -0
  141. package/dist/components/forms/FileUpload/FileUpload.js +2 -0
  142. package/dist/components/forms/Input/Input.js +25 -28
  143. package/dist/components/forms/Input/inputMasks.d.ts +15 -0
  144. package/dist/components/forms/Input/inputMasks.js +72 -1
  145. package/dist/components/forms/InputTag/InputTag.d.ts +40 -0
  146. package/dist/components/forms/InputTag/InputTag.js +491 -0
  147. package/dist/components/forms/InputTag/InputTag.theme.d.ts +2 -0
  148. package/dist/components/forms/InputTag/InputTag.theme.js +16 -0
  149. package/dist/components/forms/InputTag/InputTag.types.d.ts +107 -0
  150. package/dist/components/forms/InputTag/index.d.ts +3 -0
  151. package/dist/components/forms/Select/Select.d.ts +101 -2
  152. package/dist/components/forms/Select/Select.js +128 -132
  153. package/dist/components/forms/Select/Select.theme.js +10 -14
  154. package/dist/components/forms/Select/Select.types.d.ts +6 -2
  155. package/dist/components/forms/Select/index.d.ts +7 -4
  156. package/dist/components/forms/Select/useSelectState.d.ts +66 -0
  157. package/dist/components/forms/Select/useSelectState.js +134 -0
  158. package/dist/components/forms/SelectExpand/SelectExpand.animations.d.ts +20 -0
  159. package/dist/components/forms/SelectExpand/SelectExpand.animations.js +74 -0
  160. package/dist/components/forms/SelectExpand/SelectExpand.d.ts +9 -0
  161. package/dist/components/forms/SelectExpand/SelectExpand.js +223 -0
  162. package/dist/components/forms/SelectExpand/SelectExpand.theme.d.ts +5 -0
  163. package/dist/components/forms/SelectExpand/SelectExpand.theme.js +74 -0
  164. package/dist/components/forms/SelectExpand/SelectExpand.types.d.ts +126 -0
  165. package/dist/components/forms/SelectExpand/index.d.ts +4 -0
  166. package/dist/components/forms/Switch/Switch.js +3 -3
  167. package/dist/components/forms/Switch/Switch.theme.d.ts +1 -1
  168. package/dist/components/forms/Switch/Switch.theme.js +2 -2
  169. package/dist/components/forms/TimePicker/TimePicker.animations.d.ts +0 -46
  170. package/dist/components/forms/TimePicker/TimePicker.d.ts +15 -6
  171. package/dist/components/forms/TimePicker/TimePicker.js +285 -124
  172. package/dist/components/forms/TimePicker/TimePicker.theme.d.ts +1 -1
  173. package/dist/components/forms/TimePicker/TimePicker.theme.js +39 -22
  174. package/dist/components/forms/TimePicker/TimePicker.types.d.ts +88 -34
  175. package/dist/components/forms/TimePicker/TimePickerContent.d.ts +7 -10
  176. package/dist/components/forms/TimePicker/TimePickerContent.js +149 -16
  177. package/dist/components/forms/TimePicker/TimePickerTrigger.d.ts +3 -3
  178. package/dist/components/forms/TimePicker/TimePickerTrigger.js +22 -19
  179. package/dist/components/forms/TimePicker/WheelColumn.d.ts +14 -0
  180. package/dist/components/forms/TimePicker/WheelColumn.js +90 -0
  181. package/dist/components/forms/TimePicker/index.d.ts +4 -1
  182. package/dist/components/forms/TimePicker/useWheelPicker.d.ts +37 -0
  183. package/dist/components/forms/TimePicker/useWheelPicker.js +138 -0
  184. package/dist/components/forms/forms.theme.d.ts +14 -0
  185. package/dist/components/forms/forms.theme.js +31 -0
  186. package/dist/components/forms/index.d.ts +9 -3
  187. package/dist/components/forms/index.js +73 -2
  188. package/dist/hooks/index.d.ts +0 -4
  189. package/dist/icons/Icon.d.ts +7 -0
  190. package/dist/icons/Icon.js +6 -2
  191. package/dist/index.js +21 -19
  192. package/dist/styles.css +1 -1
  193. package/dist/utils/index.d.ts +0 -1
  194. package/dist/utils/optimisticErrors.js +1 -70
  195. package/package.json +1 -1
  196. package/dist/components/ai/EditingIndicator/EditingIndicator.animations.d.ts +0 -31
  197. package/dist/components/ai/EditingIndicator/EditingIndicator.animations.js +0 -115
  198. package/dist/components/ai/EditingIndicator/EditingIndicator.d.ts +0 -35
  199. package/dist/components/ai/EditingIndicator/EditingIndicator.js +0 -94
  200. package/dist/components/ai/EditingIndicator/EditingIndicator.theme.d.ts +0 -2
  201. package/dist/components/ai/EditingIndicator/EditingIndicator.theme.js +0 -13
  202. package/dist/components/ai/EditingIndicator/EditingIndicator.types.d.ts +0 -54
  203. package/dist/components/ai/EditingIndicator/index.d.ts +0 -9
  204. package/dist/components/ai/GenerativeRenderer/GenerativeRenderer.d.ts +0 -3
  205. package/dist/components/ai/GenerativeRenderer/GenerativeRenderer.js +0 -126
  206. package/dist/components/ai/GenerativeRenderer/GenerativeRenderer.theme.d.ts +0 -2
  207. package/dist/components/ai/GenerativeRenderer/GenerativeRenderer.theme.js +0 -8
  208. package/dist/components/ai/GenerativeRenderer/GenerativeRenderer.types.d.ts +0 -45
  209. package/dist/components/ai/GenerativeRenderer/index.d.ts +0 -3
  210. package/dist/components/ai/PresenceIndicator/PresenceIndicator.animations.d.ts +0 -17
  211. package/dist/components/ai/PresenceIndicator/PresenceIndicator.animations.js +0 -56
  212. package/dist/components/ai/PresenceIndicator/PresenceIndicator.d.ts +0 -38
  213. package/dist/components/ai/PresenceIndicator/PresenceIndicator.js +0 -110
  214. package/dist/components/ai/PresenceIndicator/PresenceIndicator.theme.d.ts +0 -2
  215. package/dist/components/ai/PresenceIndicator/PresenceIndicator.theme.js +0 -13
  216. package/dist/components/ai/PresenceIndicator/PresenceIndicator.types.d.ts +0 -53
  217. package/dist/components/ai/PresenceIndicator/index.d.ts +0 -8
  218. package/dist/components/ai/PresenceProvider/PresenceContext.d.ts +0 -24
  219. package/dist/components/ai/PresenceProvider/PresenceContext.js +0 -34
  220. package/dist/components/ai/PresenceProvider/PresenceProvider.d.ts +0 -32
  221. package/dist/components/ai/PresenceProvider/PresenceProvider.js +0 -321
  222. package/dist/components/ai/PresenceProvider/PresenceProvider.types.d.ts +0 -140
  223. package/dist/components/ai/PresenceProvider/adapters/MockAdapter.d.ts +0 -102
  224. package/dist/components/ai/PresenceProvider/adapters/MockAdapter.js +0 -331
  225. package/dist/components/ai/PresenceProvider/adapters/PresenceAdapter.d.ts +0 -93
  226. package/dist/components/ai/PresenceProvider/adapters/SupabaseAdapter.d.ts +0 -134
  227. package/dist/components/ai/PresenceProvider/adapters/WebSocketAdapter.d.ts +0 -149
  228. package/dist/components/ai/PresenceProvider/adapters/index.d.ts +0 -11
  229. package/dist/components/ai/PresenceProvider/index.d.ts +0 -10
  230. package/dist/components/ai/PromptSuggestions/PromptSuggestions.d.ts +0 -27
  231. package/dist/components/ai/PromptSuggestions/PromptSuggestions.js +0 -61
  232. package/dist/components/ai/PromptSuggestions/PromptSuggestions.types.d.ts +0 -65
  233. package/dist/components/ai/VersionSlider/VersionSlider.d.ts +0 -3
  234. package/dist/components/ai/VersionSlider/VersionSlider.js +0 -97
  235. package/dist/components/ai/VersionSlider/VersionSlider.theme.d.ts +0 -2
  236. package/dist/components/ai/VersionSlider/VersionSlider.theme.js +0 -18
  237. package/dist/components/ai/VersionSlider/VersionSlider.types.d.ts +0 -77
  238. package/dist/components/ai/VersionSlider/index.d.ts +0 -3
  239. package/dist/components/core/Pill/Pill.animations.js +0 -25
  240. package/dist/components/core/Pill/Pill.js +0 -145
  241. package/dist/components/core/Pill/Pill.theme.js +0 -65
  242. package/dist/components/core/RetryBoundary/RetryBoundary.d.ts +0 -35
  243. package/dist/components/core/RetryBoundary/RetryBoundary.js +0 -154
  244. package/dist/components/core/RetryBoundary/RetryBoundary.theme.d.ts +0 -2
  245. package/dist/components/core/RetryBoundary/RetryBoundary.theme.js +0 -7
  246. package/dist/components/core/RetryBoundary/RetryBoundary.types.d.ts +0 -51
  247. package/dist/components/core/RetryBoundary/index.d.ts +0 -3
  248. package/dist/components/core/Table/components/TableActions/TableActions.types.d.ts +0 -40
  249. package/dist/components/core/Table/components/TableActions/index.d.ts +0 -3
  250. package/dist/components/core/Table/components/TableActionsMenu.d.ts +0 -6
  251. package/dist/components/core/Table/components/TablePagination/TablePagination.d.ts +0 -17
  252. package/dist/components/core/Table/components/TablePagination/TablePagination.types.d.ts +0 -21
  253. package/dist/components/core/Table/components/TablePagination/index.d.ts +0 -2
  254. package/dist/components/core/Table/components/TableSelectionHeader/TableSelectionHeader.d.ts +0 -15
  255. package/dist/components/core/Table/components/TableSelectionHeader/index.d.ts +0 -3
  256. package/dist/components/core/Table/components/core/TableRow.d.ts +0 -3
  257. package/dist/components/core/Table/components/core/TableRow.js +0 -44
  258. package/dist/components/core/Table/components/core/index.d.ts +0 -4
  259. package/dist/components/forms/OptimisticForm/OptimisticForm.d.ts +0 -33
  260. package/dist/components/forms/OptimisticForm/OptimisticForm.js +0 -87
  261. package/dist/components/forms/OptimisticForm/OptimisticForm.theme.d.ts +0 -2
  262. package/dist/components/forms/OptimisticForm/OptimisticForm.theme.js +0 -8
  263. package/dist/components/forms/OptimisticForm/OptimisticForm.types.d.ts +0 -74
  264. package/dist/components/forms/OptimisticForm/index.d.ts +0 -3
  265. package/dist/hooks/useOptimisticMutation.d.ts +0 -109
  266. package/dist/hooks/useOptimisticMutation.js +0 -171
  267. package/dist/hooks/usePresence.d.ts +0 -88
  268. package/dist/utils/presenceUtils.d.ts +0 -66
  269. package/dist/utils/presenceUtils.js +0 -107
@@ -3,7 +3,7 @@ import { useReducedMotion, motion } from 'motion/react';
3
3
  import { cn } from '../../../utils/cn.js';
4
4
  import { donutChartTheme } from './DonutChart.theme.js';
5
5
  import { getSpringAnimation, CIRCULAR_CHART_ANIMATIONS, getStaggerDelay } from '../utils/animation-utils.js';
6
- import { describeRingSegmentPath, interpolateHexColor, clamp } from './donut-utils.js';
6
+ import { resolveCssVariable, describeRingSegmentPath, interpolateHexColor, clamp } from './donut-utils.js';
7
7
 
8
8
  /**
9
9
  * DonutChart component for displaying a percentage value with a circular progress indicator
@@ -36,28 +36,31 @@ const DonutChart = ({ variant = "solid", percentage, label, subtitle, size = 200
36
36
  // Generate stable gradient ID based on component instance
37
37
  const gradientId = useMemo(() => `donut-gradient-${Math.random().toString(36).substr(2, 9)}`, []);
38
38
  // Determine colors based on props or theme - simplified logic
39
+ // Resolves CSS variables to computed values for SVG attribute compatibility
39
40
  const getColors = useMemo(() => {
40
41
  var _a, _b;
41
42
  // If colors prop has both from and to, use gradient
42
43
  if ((colors === null || colors === void 0 ? void 0 : colors.from) && (colors === null || colors === void 0 ? void 0 : colors.to)) {
43
44
  return {
44
45
  type: "gradient",
45
- from: colors.from,
46
- to: colors.to,
46
+ from: resolveCssVariable(colors.from),
47
+ to: resolveCssVariable(colors.to),
47
48
  };
48
49
  }
49
50
  // If colors prop has primary, use solid color
50
51
  if (colors === null || colors === void 0 ? void 0 : colors.primary) {
51
52
  return {
52
53
  type: "solid",
53
- color: colors.primary,
54
+ color: resolveCssVariable(colors.primary),
54
55
  };
55
56
  }
56
- // Use theme defaults (gradient)
57
+ // Use theme defaults (gradient) - resolve CSS variables
58
+ const primaryColor = resolveCssVariable(((_a = theme.colors) === null || _a === void 0 ? void 0 : _a.primary) || "", "#3b82f6");
59
+ const secondaryColor = resolveCssVariable(((_b = theme.colors) === null || _b === void 0 ? void 0 : _b.secondary) || "", "#10b981");
57
60
  return {
58
61
  type: "gradient",
59
- from: ((_a = theme.colors) === null || _a === void 0 ? void 0 : _a.primary) || "#3b82f6",
60
- to: ((_b = theme.colors) === null || _b === void 0 ? void 0 : _b.secondary) || "#10b981",
62
+ from: primaryColor,
63
+ to: secondaryColor,
61
64
  };
62
65
  }, [colors, theme.colors]);
63
66
  const segmentDefinitions = useMemo(() => {
@@ -148,7 +151,7 @@ const DonutChart = ({ variant = "solid", percentage, label, subtitle, size = 200
148
151
  isSegmentedVariant ? (React__default.createElement("g", null,
149
152
  segmentDefinitions.map((segment, index) => {
150
153
  var _a;
151
- return (React__default.createElement("path", { key: `donut-track-${index}`, d: segment.trackPath, fill: ((_a = theme.colors) === null || _a === void 0 ? void 0 : _a.track) || "#e5e7eb", opacity: 0.25 }));
154
+ return (React__default.createElement("path", { key: `donut-track-${index}`, d: segment.trackPath, fill: resolveCssVariable(((_a = theme.colors) === null || _a === void 0 ? void 0 : _a.track) || "", "#e5e7eb"), opacity: 0.25 }));
152
155
  }),
153
156
  segmentDefinitions.map((segment, index) => segment.activePath ? (React__default.createElement(motion.path, { key: `donut-active-${index}`, d: segment.activePath, fill: resolveSegmentFill(segment.colorFactor), initial: { opacity: 0, scale: 0.95 }, animate: hasAnimated ? { opacity: 1, scale: 1 } : {}, transition: showAnimation && !shouldReduceMotion
154
157
  ? {
@@ -5,6 +5,9 @@ import { DonutChartThemeOverrides } from "./DonutChart.types";
5
5
  export declare const donutChartTheme: DonutChartThemeOverrides;
6
6
  /**
7
7
  * Pre-defined color schemes for quick customization
8
+ * Note: These use hex values as they're required for gradient interpolation
9
+ * via the interpolateHexColor function. Users can also pass CSS variables
10
+ * which will be resolved at runtime.
8
11
  */
9
12
  export declare const donutChartColorSchemes: {
10
13
  readonly default: {
@@ -13,11 +13,12 @@ const donutChartTheme = {
13
13
  label: "text-2xl font-bold text-[var(--color-text-primary)] transition-colors duration-300 tracking-tight",
14
14
  subtitle: "text-sm text-[var(--color-text-secondary)] mt-1 transition-colors duration-300",
15
15
  },
16
- // Default color palette
16
+ // Default color palette (CSS variables for dark mode support)
17
+ // Note: These are resolved at runtime via getComputedStyle
17
18
  colors: {
18
- primary: "#3b82f6", // blue-500
19
- secondary: "#10b981", // emerald-500
20
- track: "#e5e7eb", // neutral-200
19
+ primary: "var(--color-primary)",
20
+ secondary: "var(--color-success)",
21
+ track: "var(--color-border)",
21
22
  },
22
23
  };
23
24
 
@@ -1,6 +1,11 @@
1
1
  /**
2
2
  * Shared utility functions for DonutChart components
3
3
  */
4
+ /**
5
+ * Resolves a CSS variable to its computed value
6
+ * Falls back to the provided value if not a CSS variable or resolution fails
7
+ */
8
+ export declare const resolveCssVariable: (value: string, fallback?: string) => string;
4
9
  /**
5
10
  * Clamps a value between a minimum and maximum
6
11
  */
@@ -1,6 +1,31 @@
1
1
  /**
2
2
  * Shared utility functions for DonutChart components
3
3
  */
4
+ /**
5
+ * Resolves a CSS variable to its computed value
6
+ * Falls back to the provided value if not a CSS variable or resolution fails
7
+ */
8
+ const resolveCssVariable = (value, fallback) => {
9
+ var _a;
10
+ // If not a CSS variable, return as-is
11
+ if (!value.startsWith("var(")) {
12
+ return value;
13
+ }
14
+ // Check if we're in a browser environment
15
+ if (typeof window === "undefined" || typeof document === "undefined") {
16
+ return fallback || value;
17
+ }
18
+ // Extract variable name from var(--name) or var(--name, fallback)
19
+ const match = value.match(/var\(([^,)]+)(?:,\s*([^)]+))?\)/);
20
+ if (!match) {
21
+ return fallback || value;
22
+ }
23
+ const varName = match[1].trim();
24
+ const cssDefault = (_a = match[2]) === null || _a === void 0 ? void 0 : _a.trim();
25
+ // Get computed value from document root
26
+ const computed = getComputedStyle(document.documentElement).getPropertyValue(varName).trim();
27
+ return computed || cssDefault || fallback || value;
28
+ };
4
29
  /**
5
30
  * Clamps a value between a minimum and maximum
6
31
  */
@@ -112,4 +137,4 @@ const interpolateHexColor = (from, to, factor) => {
112
137
  return `rgb(${r}, ${g}, ${b})`;
113
138
  };
114
139
 
115
- export { clamp, describeArcPathClockwise, describeRingSegmentPath, hexToRgb, interpolateHexColor, polarToCartesian };
140
+ export { clamp, describeArcPathClockwise, describeRingSegmentPath, hexToRgb, interpolateHexColor, polarToCartesian, resolveCssVariable };
@@ -9,8 +9,8 @@ const heatmapTheme = {
9
9
  gridStyle: "absolute inset-0",
10
10
  // Base cell styles (individual cells add opacity via inline styles)
11
11
  cellBaseStyle: "relative w-full h-full cursor-pointer border border-transparent transition-all duration-500 animate-[flicker_0.6s_ease-out_forwards]",
12
- // Axis labels using standard Tailwind classes (acceptable for labels)
13
- axisLabelStyle: "text-xs text-gray-600 dark:text-gray-400 font-medium select-none",
12
+ // Axis labels using CSS variables for dark mode support
13
+ axisLabelStyle: "text-xs text-[var(--color-text-secondary)] font-medium select-none",
14
14
  // Legend using correct CSS variables
15
15
  legendStyle: "w-full space-y-1.5 mt-3",
16
16
  };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import type { XAxisProps } from './ChartAxis.types';
1
+ import React from "react";
2
+ import type { XAxisProps } from "./ChartAxis.types";
3
3
  /**
4
4
  * XAxis component for charts
5
5
  * Renders horizontal axis with labels and optional tick marks
@@ -6,7 +6,7 @@ import { ChartText } from '../ChartText/ChartText.js';
6
6
  * XAxis component for charts
7
7
  * Renders horizontal axis with labels and optional tick marks
8
8
  */
9
- const XAxis = ({ data, x, y, width, categoryWidth, categoryGap = 0, show = true, className, color = 'currentColor', showTicks = true, tickLength = 6, tickPadding = 12, textAnchor = 'middle', labelRotation = 0, labelFormatter, maxLabelWidth = 100, alignWithEdge = false, }) => {
9
+ const XAxis = ({ data, x, y, width, categoryWidth, categoryGap = 0, show = true, className, color = "currentColor", showTicks = true, tickLength = 6, tickPadding = 12, textAnchor = "middle", labelRotation = 0, labelFormatter, maxLabelWidth = 100, alignWithEdge = false, }) => {
10
10
  if (!show)
11
11
  return null;
12
12
  const formatLabel = (item, index) => {
@@ -25,13 +25,13 @@ const XAxis = ({ data, x, y, width, categoryWidth, categoryGap = 0, show = true,
25
25
  }
26
26
  return x + index * (categoryWidth + categoryGap) + categoryWidth / 2;
27
27
  };
28
- return (React__default.createElement("g", { className: cn('chart-x-axis', className) },
29
- React__default.createElement("line", { x1: x, y1: y, x2: x + width, y2: y, stroke: color, className: "opacity-20", strokeWidth: 1 }),
28
+ return (React__default.createElement("g", { className: cn("chart-x-axis", className) },
29
+ React__default.createElement("line", { x1: x, y1: y, x2: x + width, y2: y, className: "stroke-[var(--color-border)]", strokeWidth: 1 }),
30
30
  data.map((item, index) => {
31
31
  const tickX = getTickX(index);
32
32
  const label = formatLabel(item, index);
33
33
  return (React__default.createElement("g", { key: index },
34
- showTicks && (React__default.createElement("line", { x1: tickX, y1: y, x2: tickX, y2: y + tickLength, stroke: color, className: "opacity-40", strokeWidth: 1 })),
34
+ showTicks && (React__default.createElement("line", { x1: tickX, y1: y, x2: tickX, y2: y + tickLength, className: "stroke-[var(--color-border)]", strokeWidth: 1 })),
35
35
  React__default.createElement(ChartText, { x: tickX, y: y + tickLength + tickPadding, textAnchor: textAnchor, maxWidth: maxLabelWidth, truncate: !!maxLabelWidth, rotation: labelRotation }, label)));
36
36
  })));
37
37
  };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import type { YAxisProps } from './ChartAxis.types';
1
+ import React from "react";
2
+ import type { YAxisProps } from "./ChartAxis.types";
3
3
  /**
4
4
  * YAxis component for charts
5
5
  * Renders vertical axis with labels, optional tick marks, and grid lines
@@ -6,7 +6,7 @@ import { ChartText } from '../ChartText/ChartText.js';
6
6
  * YAxis component for charts
7
7
  * Renders vertical axis with labels, optional tick marks, and grid lines
8
8
  */
9
- const YAxis = ({ min, max, tickCount = 5, x, y, height, show = true, className, color = 'currentColor', showTicks = true, tickLength = 6, tickPadding = 8, textAnchor = 'end', tickFormatter, showGrid = false, gridWidth = 0, ticks: customTicks, }) => {
9
+ const YAxis = ({ min, max, tickCount = 5, x, y, height, show = true, className, color = "currentColor", showTicks = true, tickLength = 6, tickPadding = 8, textAnchor = "end", tickFormatter, showGrid = false, gridWidth = 0, ticks: customTicks, }) => {
10
10
  if (!show)
11
11
  return null;
12
12
  // Generate tick values
@@ -68,7 +68,8 @@ const YAxis = ({ min, max, tickCount = 5, x, y, height, show = true, className,
68
68
  else if (Math.abs(value) >= 1000) {
69
69
  return `${Math.round(value / 1000)}K`;
70
70
  }
71
- else if (Number.isInteger(value) || Math.abs(value - Math.round(value)) < 0.01) {
71
+ else if (Number.isInteger(value) ||
72
+ Math.abs(value - Math.round(value)) < 0.01) {
72
73
  return Math.round(value).toString();
73
74
  }
74
75
  else {
@@ -80,15 +81,15 @@ const YAxis = ({ min, max, tickCount = 5, x, y, height, show = true, className,
80
81
  return y + height / 2; // Center position when no range
81
82
  }
82
83
  const ratio = (value - min) / (max - min);
83
- return y + height - (ratio * height);
84
+ return y + height - ratio * height;
84
85
  };
85
- return (React__default.createElement("g", { className: cn('chart-y-axis', className) },
86
- React__default.createElement("line", { x1: x, y1: y, x2: x, y2: y + height, stroke: color, className: "opacity-10", strokeWidth: 1 }),
86
+ return (React__default.createElement("g", { className: cn("chart-y-axis", className) },
87
+ React__default.createElement("line", { x1: x, y1: y, x2: x, y2: y + height, className: "stroke-[var(--color-border)]", strokeWidth: 1 }),
87
88
  ticks.map((tick, index) => {
88
89
  const tickY = getTickY(tick);
89
90
  return (React__default.createElement("g", { key: index },
90
- showGrid && gridWidth > 0 && (React__default.createElement("line", { x1: x, y1: tickY, x2: x + gridWidth, y2: tickY, stroke: color, className: "opacity-10", strokeWidth: 1 })),
91
- showTicks && (React__default.createElement("line", { x1: x - tickLength, y1: tickY, x2: x, y2: tickY, stroke: color, className: "opacity-40", strokeWidth: 1 })),
91
+ showGrid && gridWidth > 0 && (React__default.createElement("line", { x1: x, y1: tickY, x2: x + gridWidth, y2: tickY, className: "opacity-80 stroke-[var(--color-border)]", strokeWidth: 1 })),
92
+ showTicks && (React__default.createElement("line", { x1: x - tickLength, y1: tickY, x2: x, y2: tickY, className: "stroke-[var(--color-border)]", strokeWidth: 1 })),
92
93
  React__default.createElement(ChartText, { x: x - tickLength - tickPadding, y: tickY, textAnchor: textAnchor, dominantBaseline: "middle" }, formatTick(tick))));
93
94
  })));
94
95
  };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  export interface HorizontalGridProps {
3
3
  /** X position to start the grid */
4
4
  x: number;
@@ -5,7 +5,7 @@ import { cn } from '../../../../utils/cn.js';
5
5
  * HorizontalGrid component for charts
6
6
  * Renders horizontal grid lines at specified intervals
7
7
  */
8
- const HorizontalGrid = ({ x, y, width, height, lineCount = 5, show = true, color = 'currentColor', className, tickPositions, }) => {
8
+ const HorizontalGrid = ({ x, y, width, height, lineCount = 5, show = true, color = "currentColor", className, tickPositions, }) => {
9
9
  if (!show)
10
10
  return null;
11
11
  // Generate grid line positions
@@ -15,7 +15,7 @@ const HorizontalGrid = ({ x, y, width, height, lineCount = 5, show = true, color
15
15
  return y;
16
16
  return y + (i * height) / (lineCount - 1);
17
17
  });
18
- return (React__default.createElement("g", { className: cn('chart-horizontal-grid', className) }, positions.map((lineY, index) => (React__default.createElement("line", { key: index, x1: x, y1: lineY, x2: x + width, y2: lineY, stroke: color, className: "opacity-10", strokeWidth: 1 })))));
18
+ return (React__default.createElement("g", { className: cn("chart-horizontal-grid", className) }, positions.map((lineY, index) => (React__default.createElement("line", { key: index, x1: x, y1: lineY, x2: x + width, y2: lineY, className: "opacity-80 stroke-[var(--color-border)]", strokeWidth: 1 })))));
19
19
  };
20
20
 
21
21
  export { HorizontalGrid };
@@ -1,4 +1,4 @@
1
- import { ChartThemeConfig } from '../types/chart.types';
1
+ import { ChartThemeConfig } from "../types/chart.types";
2
2
  /**
3
3
  * Default theme for Chart components
4
4
  * Uses Tailwind classes with CSS variables for consistency with the design system
@@ -7,64 +7,64 @@ const chartTheme = {
7
7
  colors: {
8
8
  // Default series colors using your design system colors
9
9
  series: [
10
- 'fill-[var(--color-primary)] stroke-[var(--color-primary)]', // Primary
11
- 'fill-[var(--color-warning)] stroke-[var(--color-warning)]', // Warning/Orange
12
- 'fill-[var(--color-success)] stroke-[var(--color-success)]', // Success/Green
13
- 'fill-[var(--color-danger)] stroke-[var(--color-danger)]', // Danger/Red
14
- 'fill-[var(--color-primary-400)] stroke-[var(--color-primary-400)]', // Primary lighter
15
- 'fill-[var(--color-warning-400)] stroke-[var(--color-warning-400)]', // Warning lighter
16
- 'fill-[var(--color-success-400)] stroke-[var(--color-success-400)]', // Success lighter
17
- 'fill-[var(--color-danger-400)] stroke-[var(--color-danger-400)]', // Danger lighter
10
+ "fill-[var(--color-primary)] stroke-[var(--color-primary)]", // Primary
11
+ "fill-[var(--color-warning)] stroke-[var(--color-warning)]", // Warning/Orange
12
+ "fill-[var(--color-success)] stroke-[var(--color-success)]", // Success/Green
13
+ "fill-[var(--color-danger)] stroke-[var(--color-danger)]", // Danger/Red
14
+ "fill-[var(--color-primary-400)] stroke-[var(--color-primary-400)]", // Primary lighter
15
+ "fill-[var(--color-warning-400)] stroke-[var(--color-warning-400)]", // Warning lighter
16
+ "fill-[var(--color-success-400)] stroke-[var(--color-success-400)]", // Success lighter
17
+ "fill-[var(--color-danger-400)] stroke-[var(--color-danger-400)]", // Danger lighter
18
18
  ],
19
19
  // Chart infrastructure colors
20
- grid: 'stroke-neutral-200',
21
- axis: 'stroke-neutral-300',
22
- text: 'fill-[var(--color-text-secondary)]',
23
- background: 'fill-white',
24
- hover: 'fill-neutral-100',
25
- disabled: 'fill-neutral-200',
20
+ grid: "stroke-[var(--color-border)]",
21
+ axis: "stroke-[var(--color-border)]",
22
+ text: "fill-[var(--color-text-secondary)]",
23
+ background: "fill-[var(--color-background)]",
24
+ hover: "fill-[var(--color-background-secondary)]",
25
+ disabled: "fill-[var(--color-background-disabled)]",
26
26
  },
27
27
  opacity: {
28
- default: 'opacity-100',
29
- hover: 'opacity-80',
30
- disabled: 'opacity-50',
28
+ default: "opacity-100",
29
+ hover: "opacity-80",
30
+ disabled: "opacity-50",
31
31
  },
32
32
  transitions: {
33
- default: 'transition-all duration-200',
34
- hover: 'transition-all duration-150',
33
+ default: "transition-all duration-200",
34
+ hover: "transition-all duration-150",
35
35
  },
36
36
  },
37
37
  variants: {
38
38
  default: {
39
39
  colors: [
40
- 'fill-[var(--color-primary)] stroke-[var(--color-primary)]',
41
- 'fill-[var(--color-warning)] stroke-[var(--color-warning)]',
42
- 'fill-[var(--color-success)] stroke-[var(--color-success)]',
43
- 'fill-[var(--color-danger)] stroke-[var(--color-danger)]',
44
- 'fill-[var(--color-primary-400)] stroke-[var(--color-primary-400)]',
45
- 'fill-[var(--color-warning-400)] stroke-[var(--color-warning-400)]',
46
- 'fill-[var(--color-success-400)] stroke-[var(--color-success-400)]',
47
- 'fill-[var(--color-danger-400)] stroke-[var(--color-danger-400)]',
40
+ "fill-[var(--color-primary)] stroke-[var(--color-primary)]",
41
+ "fill-[var(--color-warning)] stroke-[var(--color-warning)]",
42
+ "fill-[var(--color-success)] stroke-[var(--color-success)]",
43
+ "fill-[var(--color-danger)] stroke-[var(--color-danger)]",
44
+ "fill-[var(--color-primary-400)] stroke-[var(--color-primary-400)]",
45
+ "fill-[var(--color-warning-400)] stroke-[var(--color-warning-400)]",
46
+ "fill-[var(--color-success-400)] stroke-[var(--color-success-400)]",
47
+ "fill-[var(--color-danger-400)] stroke-[var(--color-danger-400)]",
48
48
  ],
49
49
  },
50
50
  minimal: {
51
51
  colors: [
52
- 'fill-neutral-600 stroke-neutral-600',
53
- 'fill-neutral-500 stroke-neutral-500',
54
- 'fill-neutral-400 stroke-neutral-400',
55
- 'fill-neutral-300 stroke-neutral-300',
56
- 'fill-neutral-700 stroke-neutral-700',
57
- 'fill-neutral-800 stroke-neutral-800',
52
+ "fill-[var(--color-neutral-600)] stroke-[var(--color-neutral-600)]",
53
+ "fill-[var(--color-neutral-500)] stroke-[var(--color-neutral-500)]",
54
+ "fill-[var(--color-neutral-400)] stroke-[var(--color-neutral-400)]",
55
+ "fill-[var(--color-neutral-300)] stroke-[var(--color-neutral-300)]",
56
+ "fill-[var(--color-neutral-700)] stroke-[var(--color-neutral-700)]",
57
+ "fill-[var(--color-neutral-800)] stroke-[var(--color-neutral-800)]",
58
58
  ],
59
59
  },
60
60
  gradient: {
61
61
  colors: [
62
- 'fill-[var(--color-primary)] stroke-[var(--color-primary)]',
63
- 'fill-[var(--color-primary-400)] stroke-[var(--color-primary-400)]',
64
- 'fill-[var(--color-primary-500)] stroke-[var(--color-primary-500)]',
65
- 'fill-[var(--color-primary-600)] stroke-[var(--color-primary-600)]',
66
- 'fill-[var(--color-primary-700)] stroke-[var(--color-primary-700)]',
67
- 'fill-[var(--color-primary-800)] stroke-[var(--color-primary-800)]',
62
+ "fill-[var(--color-primary)] stroke-[var(--color-primary)]",
63
+ "fill-[var(--color-primary-400)] stroke-[var(--color-primary-400)]",
64
+ "fill-[var(--color-primary-500)] stroke-[var(--color-primary-500)]",
65
+ "fill-[var(--color-primary-600)] stroke-[var(--color-primary-600)]",
66
+ "fill-[var(--color-primary-700)] stroke-[var(--color-primary-700)]",
67
+ "fill-[var(--color-primary-800)] stroke-[var(--color-primary-800)]",
68
68
  ],
69
69
  },
70
70
  },
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { AccordionProps, AccordionContextValue } from "./Accordion.types";
3
3
  export declare const useAccordionContext: () => AccordionContextValue;
4
4
  export declare const Accordion: {
5
- ({ children, className, type, variant, collapsible, defaultValue, value, onValueChange, theme: themeOverrides, ...props }: AccordionProps): React.JSX.Element;
5
+ ({ children, className, type, variant, collapsible, defaultValue, value, onValueChange, theme: themeOverrides, darkMode, ...props }: AccordionProps): React.JSX.Element;
6
6
  displayName: string;
7
7
  } & {
8
8
  Item: React.ForwardRefExoticComponent<import("./Accordion.types").AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
@@ -13,7 +13,7 @@ const useAccordionContext = () => {
13
13
  throw new Error("Accordion compound components must be used within <Accordion>");
14
14
  return ctx;
15
15
  };
16
- const AccordionRoot = ({ children, className, type = "single", variant = "separated", collapsible = false, defaultValue, value, onValueChange, theme: themeOverrides, ...props }) => {
16
+ const AccordionRoot = ({ children, className, type = "single", variant = "separated", collapsible = false, defaultValue, value, onValueChange, theme: themeOverrides, darkMode = false, ...props }) => {
17
17
  // State for uncontrolled component
18
18
  const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue || (type === "single" ? "" : []));
19
19
  // Determine if component is controlled
@@ -43,7 +43,7 @@ const AccordionRoot = ({ children, className, type = "single", variant = "separa
43
43
  // Select base style based on variant
44
44
  const baseStyleClass = variant === "stacked" ? theme.baseStyleStacked : theme.baseStyle;
45
45
  return (React__default.createElement(AccordionContext.Provider, { value: contextValue },
46
- React__default.createElement("div", { className: cn(baseStyleClass, className), "data-variant": variant, ...props }, children)));
46
+ React__default.createElement("div", { className: cn(baseStyleClass, darkMode && "dark", className), "data-variant": variant, ...props }, children)));
47
47
  };
48
48
  AccordionRoot.displayName = "Accordion";
49
49
  // Attach compound subcomponents
@@ -32,6 +32,14 @@ export interface AccordionProps extends React.HTMLAttributes<HTMLDivElement> {
32
32
  */
33
33
  theme?: AccordionThemeOverrides;
34
34
  children: React.ReactNode;
35
+ /**
36
+ * Force dark mode styling for the component. Use when placing the component
37
+ * on a dark background while the page is in light mode. This applies the
38
+ * 'dark' class to the container, making text, borders, and other elements
39
+ * use light colors for visibility.
40
+ * @default false
41
+ */
42
+ darkMode?: boolean;
35
43
  }
36
44
  /**
37
45
  * Accordion context value
@@ -30,8 +30,8 @@ const getShouldAnimate = () => {
30
30
  * <Badge dismissible onDismiss={handleDismiss}>Removable</Badge>
31
31
  * ```
32
32
  */
33
- const Badge = React__default.memo(React__default.forwardRef(({ children, variant = "filled", color = "primary", size = "md", pill = false, withDot = false, iconStart, avatar, dismissible = false, onDismiss, selectable = false, selected = false, onSelect, disabled = false, maxWidth, className, theme: customTheme = {}, onClick, ...props }, ref) => {
34
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
33
+ const Badge = React__default.memo(React__default.forwardRef(({ children, variant = "filled", color = "primary", size = "md", pill = false, withDot = false, iconStart, avatar, dismissible = false, onDismiss, selectable = false, selected = false, onSelect, disabled = false, maxWidth, className, theme: customTheme = {}, onClick, darkMode = false, ...props }, ref) => {
34
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
35
35
  // State management
36
36
  const [isVisible, setIsVisible] = useState(true);
37
37
  const [isSelected, setIsSelected] = useState(selected);
@@ -93,10 +93,6 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
93
93
  ...(_e = badgeTheme.variantColors) === null || _e === void 0 ? void 0 : _e.ghost,
94
94
  ...(_f = customTheme.variantColors) === null || _f === void 0 ? void 0 : _f.ghost,
95
95
  },
96
- glass: {
97
- ...(_g = badgeTheme.variantColors) === null || _g === void 0 ? void 0 : _g.glass,
98
- ...(_h = customTheme.variantColors) === null || _h === void 0 ? void 0 : _h.glass,
99
- },
100
96
  },
101
97
  sizes: {
102
98
  ...badgeTheme.sizes,
@@ -132,16 +128,16 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
132
128
  },
133
129
  };
134
130
  // Get styles from theme
135
- const variantStyles = ((_j = theme.variants) === null || _j === void 0 ? void 0 : _j[variant]) || "";
136
- const colorStyles = ((_l = (_k = theme.variantColors) === null || _k === void 0 ? void 0 : _k[variant]) === null || _l === void 0 ? void 0 : _l[color]) || "";
137
- const sizeStyle = ((_m = theme.sizes) === null || _m === void 0 ? void 0 : _m[size]) || "";
131
+ const variantStyles = ((_g = theme.variants) === null || _g === void 0 ? void 0 : _g[variant]) || "";
132
+ const colorStyles = ((_j = (_h = theme.variantColors) === null || _h === void 0 ? void 0 : _h[variant]) === null || _j === void 0 ? void 0 : _j[color]) || "";
133
+ const sizeStyle = ((_k = theme.sizes) === null || _k === void 0 ? void 0 : _k[size]) || "";
138
134
  const shapeStyle = pill
139
135
  ? "rounded-full"
140
136
  : "rounded-[var(--badge-rounded)]";
141
- const dotColorStyle = ((_o = theme.dotColors) === null || _o === void 0 ? void 0 : _o[color]) || "";
137
+ const dotColorStyle = ((_l = theme.dotColors) === null || _l === void 0 ? void 0 : _l[color]) || "";
142
138
  // Build base styles with all states
143
139
  const isInteractive = selectable || dismissible;
144
- const baseStyles = cn(theme.baseStyle, shapeStyle, variantStyles, colorStyles, sizeStyle, pill && ((_p = theme.pillSizes) === null || _p === void 0 ? void 0 : _p[size]), isInteractive && "cursor-pointer", disabled && ((_q = theme.states) === null || _q === void 0 ? void 0 : _q.disabled), className);
140
+ const baseStyles = cn(theme.baseStyle, shapeStyle, variantStyles, colorStyles, sizeStyle, pill && ((_m = theme.pillSizes) === null || _m === void 0 ? void 0 : _m[size]), isInteractive && "cursor-pointer", disabled && ((_o = theme.states) === null || _o === void 0 ? void 0 : _o.disabled), darkMode && "dark", className);
145
141
  // Create data attributes for styling hooks
146
142
  const dataAttributes = {
147
143
  "data-variant": variant,
@@ -198,8 +194,8 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
198
194
  : maxWidth,
199
195
  }
200
196
  : undefined }, children),
201
- dismissible && (React__default.createElement("button", { type: "button", onClick: handleDismiss, className: cn("badge-dismiss-btn -ml-1 -mr-1 rounded-full p-0.5 cursor-pointer", (_r = theme.dismissButtonSizes) === null || _r === void 0 ? void 0 : _r[size]), "aria-label": "Dismiss", disabled: disabled },
202
- React__default.createElement(XMarkIcon, { className: cn("badge-dismiss-icon", (_s = theme.dismissIconSizes) === null || _s === void 0 ? void 0 : _s[size]), "aria-hidden": "true" }))))) : null;
197
+ dismissible && (React__default.createElement("button", { type: "button", onClick: handleDismiss, className: cn("badge-dismiss-btn -ml-1 -mr-1 rounded-full p-0.5 cursor-pointer", (_p = theme.dismissButtonSizes) === null || _p === void 0 ? void 0 : _p[size]), "aria-label": "Dismiss", disabled: disabled },
198
+ React__default.createElement(XMarkIcon, { className: cn("badge-dismiss-icon", (_q = theme.dismissIconSizes) === null || _q === void 0 ? void 0 : _q[size]), "aria-hidden": "true" }))))) : null;
203
199
  }
204
200
  return (React__default.createElement(AnimatePresence, { mode: "wait" }, isVisible && (React__default.createElement(motion.span, { ref: ref, className: baseStyles, onClick: handleClick, role: selectable ? "button" : undefined, tabIndex: selectable && !disabled ? 0 : undefined, "aria-pressed": selectable ? isSelected : undefined, "aria-disabled": disabled || undefined, variants: dismissible ? dismissVariants : badgeVariants, initial: "initial", animate: "animate", exit: "exit", whileTap: selectable && !disabled ? { scale: 0.98 } : undefined, ...dataAttributes, ...props },
205
201
  renderLeftContent(),
@@ -210,8 +206,8 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
210
206
  : maxWidth,
211
207
  }
212
208
  : undefined }, children),
213
- dismissible && (React__default.createElement(motion.button, { type: "button", onClick: handleDismiss, className: cn("badge-dismiss-btn -ml-1 -mr-1 rounded-full p-0.5 cursor-pointer", (_t = theme.dismissButtonSizes) === null || _t === void 0 ? void 0 : _t[size]), "aria-label": "Dismiss", disabled: disabled, variants: dismissButtonVariants, initial: "initial", whileHover: "hover", whileTap: "tap" },
214
- React__default.createElement(XMarkIcon, { className: cn("badge-dismiss-icon", (_u = theme.dismissIconSizes) === null || _u === void 0 ? void 0 : _u[size]), "aria-hidden": "true" })))))));
209
+ dismissible && (React__default.createElement(motion.button, { type: "button", onClick: handleDismiss, className: cn("badge-dismiss-btn -ml-1 -mr-1 rounded-full p-0.5 cursor-pointer", (_r = theme.dismissButtonSizes) === null || _r === void 0 ? void 0 : _r[size]), "aria-label": "Dismiss", disabled: disabled, variants: dismissButtonVariants, initial: "initial", whileHover: "hover", whileTap: "tap" },
210
+ React__default.createElement(XMarkIcon, { className: cn("badge-dismiss-icon", (_s = theme.dismissIconSizes) === null || _s === void 0 ? void 0 : _s[size]), "aria-hidden": "true" })))))));
215
211
  }));
216
212
  Badge.displayName = "Badge";
217
213
 
@@ -7,10 +7,9 @@ const badgeTheme = {
7
7
  baseStyle: "inline-flex items-center font-medium select-none whitespace-nowrap transition-all duration-300 h-fit",
8
8
  // Visual style variants (structure only, no colors)
9
9
  variants: {
10
- filled: "ring-1",
10
+ filled: "",
11
11
  outline: "bg-transparent border",
12
12
  ghost: "ring-transparent border-0",
13
- glass: "glass-effect !ring-1",
14
13
  },
15
14
  // Color styles organized PER VARIANT
16
15
  // This structure enables reliable dark: variants and className overrides
@@ -54,23 +53,10 @@ const badgeTheme = {
54
53
  danger: "bg-[var(--color-danger-50)] text-[var(--color-danger-600)] " +
55
54
  "dark:bg-[var(--color-danger-900)]/30 dark:text-[var(--color-danger-400)]",
56
55
  },
57
- // Glass variant - glass effect with subtle styling
58
- glass: {
59
- neutral: "text-[var(--color-text-primary)] !ring-[var(--color-border)] bg-[var(--color-neutral-100)] " +
60
- "dark:!text-[var(--color-text-primary)] ",
61
- primary: "text-[var(--color-primary)] !ring-[var(--color-border)] bg-[var(--color-primary-500)] " +
62
- "dark:text-[var(--color-primary-300)] ",
63
- success: "text-[var(--color-success)] !ring-[var(--color-border)] " +
64
- "dark:text-[var(--color-success-300)] ",
65
- warning: "text-[var(--color-warning)] !ring-[var(--color-border)] " +
66
- "dark:text-[var(--color-warning-200)] ",
67
- danger: "text-[var(--color-danger)] !ring-[var(--color-border)] " +
68
- "dark:text-[var(--color-danger-400)] ",
69
- },
70
56
  },
71
57
  // Flat size structure (no nested objects)
72
58
  sizes: {
73
- sm: "text-xs px-2 py-0.5 gap-1",
59
+ sm: "text-xs px-1.5 py-0.5 gap-1",
74
60
  md: "text-sm px-2 py-0.5 gap-1",
75
61
  lg: "text-sm px-2.5 py-1 gap-1",
76
62
  },
@@ -106,11 +92,11 @@ const badgeTheme = {
106
92
  },
107
93
  // Dot indicator colors (simple, no dark mode needed - inherits from parent)
108
94
  dotColors: {
109
- neutral: "bg-[var(--color-text-primary)] dark:bg-[var(--color-text-inverse)]",
110
- primary: "bg-[var(--color-primary-700)] dark:bg-[var(--color-primary-300)]",
111
- success: "bg-[var(--color-success-700)] dark:bg-[var(--color-success-300)]",
112
- warning: "bg-[var(--color-warning-700)] dark:bg-[var(--color-warning-300)]",
113
- danger: "bg-[var(--color-danger-600)] dark:bg-[var(--color-danger-300)]",
95
+ neutral: "bg-[var(--color-text-primary-50)] dark:bg-[var(--color-text-inverse)]",
96
+ primary: "bg-[var(--color-primary-50)] dark:bg-[var(--color-primary-300)]",
97
+ success: "bg-[var(--color-success-50)] dark:bg-[var(--color-success-300)]",
98
+ warning: "bg-[var(--color-warning-50)] dark:bg-[var(--color-warning-300)]",
99
+ danger: "bg-[var(--color-danger-50)] dark:bg-[var(--color-danger-300)]",
114
100
  },
115
101
  // State styles
116
102
  states: {
@@ -1,6 +1,6 @@
1
1
  import { ReactNode, MouseEvent } from "react";
2
2
  import { HTMLMotionProps } from "motion/react";
3
- export type BadgeVariant = "filled" | "outline" | "ghost" | "glass";
3
+ export type BadgeVariant = "filled" | "outline" | "ghost";
4
4
  export type BadgeColor = "neutral" | "primary" | "success" | "warning" | "danger";
5
5
  export type BadgeSize = "sm" | "md" | "lg";
6
6
  /**
@@ -163,4 +163,12 @@ export interface BadgeProps extends Omit<HTMLMotionProps<"span">, "onSelect" | "
163
163
  * Component-level theme overrides
164
164
  */
165
165
  theme?: BadgeThemeOverrides;
166
+ /**
167
+ * Force dark mode styling for the component. Use when placing the component
168
+ * on a dark background while the page is in light mode. This applies the
169
+ * 'dark' class to the container, making text, borders, and other elements
170
+ * use light colors for visibility.
171
+ * @default false
172
+ */
173
+ darkMode?: boolean;
166
174
  }
@@ -17,7 +17,7 @@ const BUTTON_TAP_ANIMATION = {
17
17
  },
18
18
  },
19
19
  };
20
- const Button = React__default.forwardRef(({ children, className = "", iconOnly = false, state = "default", size = "md", color, variant, block = false, onClick, enableRipple = true, rippleEffect = "default", rippleClassName, rippleScale = 10, showReflection = true, ...props }, ref) => {
20
+ const Button = React__default.forwardRef(({ children, className = "", iconOnly = false, state = "default", size = "md", color, variant, block = false, onClick, enableRipple = true, rippleEffect = "default", rippleClassName, rippleScale = 10, showReflection = true, darkMode = false, ...props }, ref) => {
21
21
  var _a, _b, _c, _d, _e, _f, _g;
22
22
  const shouldReduceMotion = useReducedMotion();
23
23
  const shouldDisableAnimations = !!shouldReduceMotion;
@@ -109,7 +109,7 @@ const Button = React__default.forwardRef(({ children, className = "", iconOnly =
109
109
  node;
110
110
  }
111
111
  }, [ref, buttonRef]);
112
- return (React__default.createElement(motion.button, { ref: mergedRef, type: "button", className: cn(buttonTheme.baseStyle, colorClasses, variantClasses, sizeClasses, blockStyle, stateClasses, className), disabled: isDisabled, "data-state": state, "data-color": resolvedColor, "data-variant": resolvedVariant, "data-size": size, "data-icon-only": iconOnly ? "true" : "false", "data-block": block ? "true" : "false", "aria-disabled": isDisabled || undefined, "aria-invalid": isError || undefined, "aria-label": ariaLabel, "aria-describedby": undefined, onClick: handleClick, ...animationProps, ...props },
112
+ return (React__default.createElement(motion.button, { ref: mergedRef, type: "button", className: cn(buttonTheme.baseStyle, colorClasses, variantClasses, sizeClasses, blockStyle, stateClasses, darkMode && "dark", className), disabled: isDisabled, "data-state": state, "data-color": resolvedColor, "data-variant": resolvedVariant, "data-size": size, "data-icon-only": iconOnly ? "true" : "false", "data-block": block ? "true" : "false", "aria-disabled": isDisabled || undefined, "aria-invalid": isError || undefined, "aria-label": ariaLabel, "aria-describedby": undefined, onClick: handleClick, ...animationProps, ...props },
113
113
  showReflection &&
114
114
  resolvedVariant !== "link" &&
115
115
  resolvedVariant !== "outline" && (React__default.createElement("div", { className: "absolute top-0.25 right-0.25 left-0.25 h-3 bg-gradient-to-b border-t-[0.5px] border-white/40 rounded-t-[calc(var(--button-rounded)-1.25px)] opacity-60" })),
@@ -137,7 +137,7 @@ const buttonTheme = {
137
137
  },
138
138
  // State styles
139
139
  states: {
140
- disabled: "opacity-50 cursor-not-allowed pointer-events-none text-opacity-50",
140
+ disabled: "opacity-50 cursor-not-allowed pointer-events-none saturate-0",
141
141
  error: "ring-2 ring-[var(--color-danger-500)]",
142
142
  loading: "cursor-not-allowed",
143
143
  // default state has no additional classes
@@ -41,6 +41,14 @@ export interface ButtonProps extends HTMLMotionProps<"button"> {
41
41
  rippleScale?: number;
42
42
  /** Whether to show the glass reflection effect (default: true) */
43
43
  showReflection?: boolean;
44
+ /**
45
+ * Force dark mode styling for the component. Use when placing the component
46
+ * on a dark background while the page is in light mode. This applies the
47
+ * 'dark' class to the container, making text, borders, and other elements
48
+ * use light colors for visibility.
49
+ * @default false
50
+ */
51
+ darkMode?: boolean;
44
52
  }
45
53
  export type ButtonColor = "neutral" | "dark" | "primary" | "success" | "warning" | "danger";
46
54
  export type ButtonVariant = "filled" | "outline" | "ghost" | "link";