@slipstream-ui/core 0.9.0 → 0.10.0

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 (255) hide show
  1. package/dist/index.d.mts +19 -0
  2. package/dist/index.d.ts +19 -0
  3. package/dist/index.js +96 -46
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +96 -46
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/manifests/accordion.manifest.json +1 -1
  8. package/dist/manifests/alert.manifest.json +1 -1
  9. package/dist/manifests/announcement-bar.manifest.json +1 -1
  10. package/dist/manifests/app-shell.manifest.json +1 -1
  11. package/dist/manifests/applied-filters.manifest.json +1 -1
  12. package/dist/manifests/article-card.manifest.json +1 -1
  13. package/dist/manifests/auth-layout.manifest.json +1 -1
  14. package/dist/manifests/autocomplete.manifest.json +1 -1
  15. package/dist/manifests/avatar.manifest.json +1 -1
  16. package/dist/manifests/badge.manifest.json +1 -1
  17. package/dist/manifests/block.manifest.json +1 -1
  18. package/dist/manifests/bottom-nav.manifest.json +1 -1
  19. package/dist/manifests/breadcrumb.manifest.json +1 -1
  20. package/dist/manifests/button-group.manifest.json +1 -1
  21. package/dist/manifests/button.manifest.json +1 -1
  22. package/dist/manifests/calendar.manifest.json +1 -1
  23. package/dist/manifests/card.manifest.json +1 -1
  24. package/dist/manifests/checkbox.manifest.json +1 -1
  25. package/dist/manifests/comparison-table.manifest.json +1 -1
  26. package/dist/manifests/confirm-dialog.manifest.json +1 -1
  27. package/dist/manifests/contact-strip.manifest.json +1 -1
  28. package/dist/manifests/container.manifest.json +1 -1
  29. package/dist/manifests/cta-section.manifest.json +1 -1
  30. package/dist/manifests/data-table.manifest.json +1 -1
  31. package/dist/manifests/date-picker-popover.manifest.json +1 -1
  32. package/dist/manifests/date-picker.manifest.json +1 -1
  33. package/dist/manifests/date-range-picker.manifest.json +1 -1
  34. package/dist/manifests/deal-card.manifest.json +1 -1
  35. package/dist/manifests/dialog.manifest.json +1 -1
  36. package/dist/manifests/document-card.manifest.json +1 -1
  37. package/dist/manifests/drawer.manifest.json +1 -1
  38. package/dist/manifests/empty-state.manifest.json +1 -1
  39. package/dist/manifests/entity-card.manifest.json +1 -1
  40. package/dist/manifests/feature-grid.manifest.json +1 -1
  41. package/dist/manifests/feature-row.manifest.json +1 -1
  42. package/dist/manifests/fieldset.manifest.json +1 -1
  43. package/dist/manifests/file-upload.manifest.json +1 -1
  44. package/dist/manifests/filter-bar.manifest.json +1 -1
  45. package/dist/manifests/filter-chips.manifest.json +13 -1
  46. package/dist/manifests/filter-panel.manifest.json +1 -1
  47. package/dist/manifests/flex.manifest.json +1 -1
  48. package/dist/manifests/form-field.manifest.json +1 -1
  49. package/dist/manifests/form-layout.manifest.json +1 -1
  50. package/dist/manifests/form.manifest.json +1 -1
  51. package/dist/manifests/grid.manifest.json +1 -1
  52. package/dist/manifests/heading.manifest.json +1 -1
  53. package/dist/manifests/hero.manifest.json +1 -1
  54. package/dist/manifests/image.manifest.json +1 -1
  55. package/dist/manifests/input-group.manifest.json +1 -1
  56. package/dist/manifests/input.manifest.json +1 -1
  57. package/dist/manifests/label.manifest.json +1 -1
  58. package/dist/manifests/link-tabs.manifest.json +1 -1
  59. package/dist/manifests/link.manifest.json +1 -1
  60. package/dist/manifests/list.manifest.json +1 -1
  61. package/dist/manifests/load-more.manifest.json +1 -1
  62. package/dist/manifests/logo-cloud.manifest.json +1 -1
  63. package/dist/manifests/menu.manifest.json +1 -1
  64. package/dist/manifests/metric-card.manifest.json +1 -1
  65. package/dist/manifests/multi-select.manifest.json +1 -1
  66. package/dist/manifests/newsletter.manifest.json +1 -1
  67. package/dist/manifests/page-header.manifest.json +1 -1
  68. package/dist/manifests/pagination.manifest.json +1 -1
  69. package/dist/manifests/password-input.manifest.json +1 -1
  70. package/dist/manifests/popover.manifest.json +1 -1
  71. package/dist/manifests/process-steps.manifest.json +1 -1
  72. package/dist/manifests/progress.manifest.json +1 -1
  73. package/dist/manifests/prose.manifest.json +1 -1
  74. package/dist/manifests/radio.manifest.json +1 -1
  75. package/dist/manifests/range-slider.manifest.json +1 -1
  76. package/dist/manifests/search.manifest.json +1 -1
  77. package/dist/manifests/section-heading.manifest.json +1 -1
  78. package/dist/manifests/section.manifest.json +1 -1
  79. package/dist/manifests/segmented-control.manifest.json +1 -1
  80. package/dist/manifests/select-menu.manifest.json +1 -1
  81. package/dist/manifests/select.manifest.json +8 -1
  82. package/dist/manifests/separator.manifest.json +1 -1
  83. package/dist/manifests/site-footer.manifest.json +1 -1
  84. package/dist/manifests/site-header.manifest.json +1 -1
  85. package/dist/manifests/skeleton.manifest.json +1 -1
  86. package/dist/manifests/spinner.manifest.json +1 -1
  87. package/dist/manifests/stat-band.manifest.json +1 -1
  88. package/dist/manifests/stepper.manifest.json +1 -1
  89. package/dist/manifests/switch.manifest.json +1 -1
  90. package/dist/manifests/table-card.manifest.json +1 -1
  91. package/dist/manifests/table-of-contents.manifest.json +1 -1
  92. package/dist/manifests/table.manifest.json +1 -1
  93. package/dist/manifests/tabs.manifest.json +1 -1
  94. package/dist/manifests/testimonial.manifest.json +1 -1
  95. package/dist/manifests/text.manifest.json +1 -1
  96. package/dist/manifests/textarea.manifest.json +1 -1
  97. package/dist/manifests/theme-toggle.manifest.json +1 -1
  98. package/dist/manifests/time-picker.manifest.json +1 -1
  99. package/dist/manifests/timeline.manifest.json +1 -1
  100. package/dist/manifests/toast.manifest.json +1 -1
  101. package/dist/manifests/tombstone-card.manifest.json +1 -1
  102. package/dist/manifests/tooltip.manifest.json +12 -1
  103. package/dist/src/components/accordion/Accordion.js +26 -19
  104. package/dist/src/components/accordion/Accordion.js.map +1 -1
  105. package/dist/src/components/accordion/Accordion.mjs +26 -19
  106. package/dist/src/components/accordion/Accordion.mjs.map +1 -1
  107. package/dist/src/components/checkbox/Checkbox.js +1 -1
  108. package/dist/src/components/checkbox/Checkbox.js.map +1 -1
  109. package/dist/src/components/checkbox/Checkbox.mjs +1 -1
  110. package/dist/src/components/checkbox/Checkbox.mjs.map +1 -1
  111. package/dist/src/components/drawer/Drawer.js +2 -1
  112. package/dist/src/components/drawer/Drawer.js.map +1 -1
  113. package/dist/src/components/drawer/Drawer.mjs +2 -1
  114. package/dist/src/components/drawer/Drawer.mjs.map +1 -1
  115. package/dist/src/components/filter-chips/FilterChips.d.ts +4 -0
  116. package/dist/src/components/filter-chips/FilterChips.js +35 -4
  117. package/dist/src/components/filter-chips/FilterChips.js.map +1 -1
  118. package/dist/src/components/filter-chips/FilterChips.mjs +35 -4
  119. package/dist/src/components/filter-chips/FilterChips.mjs.map +1 -1
  120. package/dist/src/components/radio/Radio.js +1 -1
  121. package/dist/src/components/radio/Radio.js.map +1 -1
  122. package/dist/src/components/radio/Radio.mjs +1 -1
  123. package/dist/src/components/radio/Radio.mjs.map +1 -1
  124. package/dist/src/components/range-slider/RangeSlider.js +3 -3
  125. package/dist/src/components/range-slider/RangeSlider.js.map +1 -1
  126. package/dist/src/components/range-slider/RangeSlider.mjs +3 -3
  127. package/dist/src/components/range-slider/RangeSlider.mjs.map +1 -1
  128. package/dist/src/components/select/Select.d.ts +10 -0
  129. package/dist/src/components/select/Select.js +2 -2
  130. package/dist/src/components/select/Select.js.map +1 -1
  131. package/dist/src/components/select/Select.mjs +2 -2
  132. package/dist/src/components/select/Select.mjs.map +1 -1
  133. package/dist/src/components/timeline/Timeline.js +17 -13
  134. package/dist/src/components/timeline/Timeline.js.map +1 -1
  135. package/dist/src/components/timeline/Timeline.mjs +17 -13
  136. package/dist/src/components/timeline/Timeline.mjs.map +1 -1
  137. package/dist/src/components/tooltip/Tooltip.d.ts +5 -0
  138. package/dist/src/components/tooltip/Tooltip.js +9 -2
  139. package/dist/src/components/tooltip/Tooltip.js.map +1 -1
  140. package/dist/src/components/tooltip/Tooltip.mjs +9 -2
  141. package/dist/src/components/tooltip/Tooltip.mjs.map +1 -1
  142. package/dist/styles-full.css +1 -1
  143. package/dist/styles.css +1 -1
  144. package/package.json +1 -1
  145. package/src/components/accordion/Accordion.test.tsx +14 -3
  146. package/src/components/accordion/Accordion.tsx +34 -21
  147. package/src/components/checkbox/Checkbox.tsx +1 -1
  148. package/src/components/drawer/Drawer.test.tsx +12 -0
  149. package/src/components/drawer/Drawer.tsx +8 -1
  150. package/src/components/filter-chips/FilterChips.test.tsx +11 -0
  151. package/src/components/filter-chips/FilterChips.tsx +40 -4
  152. package/src/components/radio/Radio.tsx +1 -1
  153. package/src/components/range-slider/RangeSlider.tsx +3 -3
  154. package/src/components/select/Select.test.tsx +14 -0
  155. package/src/components/select/Select.tsx +7 -2
  156. package/src/components/timeline/Timeline.test.tsx +11 -0
  157. package/src/components/timeline/Timeline.tsx +13 -2
  158. package/src/components/tooltip/Tooltip.test.tsx +15 -0
  159. package/src/components/tooltip/Tooltip.tsx +19 -2
  160. package/src/manifests/accordion.manifest.json +1 -1
  161. package/src/manifests/alert.manifest.json +1 -1
  162. package/src/manifests/announcement-bar.manifest.json +1 -1
  163. package/src/manifests/app-shell.manifest.json +1 -1
  164. package/src/manifests/applied-filters.manifest.json +1 -1
  165. package/src/manifests/article-card.manifest.json +1 -1
  166. package/src/manifests/auth-layout.manifest.json +1 -1
  167. package/src/manifests/autocomplete.manifest.json +1 -1
  168. package/src/manifests/avatar.manifest.json +1 -1
  169. package/src/manifests/badge.manifest.json +1 -1
  170. package/src/manifests/block.manifest.json +1 -1
  171. package/src/manifests/bottom-nav.manifest.json +1 -1
  172. package/src/manifests/breadcrumb.manifest.json +1 -1
  173. package/src/manifests/button-group.manifest.json +1 -1
  174. package/src/manifests/button.manifest.json +1 -1
  175. package/src/manifests/calendar.manifest.json +1 -1
  176. package/src/manifests/card.manifest.json +1 -1
  177. package/src/manifests/checkbox.manifest.json +1 -1
  178. package/src/manifests/comparison-table.manifest.json +1 -1
  179. package/src/manifests/confirm-dialog.manifest.json +1 -1
  180. package/src/manifests/contact-strip.manifest.json +1 -1
  181. package/src/manifests/container.manifest.json +1 -1
  182. package/src/manifests/cta-section.manifest.json +1 -1
  183. package/src/manifests/data-table.manifest.json +1 -1
  184. package/src/manifests/date-picker-popover.manifest.json +1 -1
  185. package/src/manifests/date-picker.manifest.json +1 -1
  186. package/src/manifests/date-range-picker.manifest.json +1 -1
  187. package/src/manifests/deal-card.manifest.json +1 -1
  188. package/src/manifests/dialog.manifest.json +1 -1
  189. package/src/manifests/document-card.manifest.json +1 -1
  190. package/src/manifests/drawer.manifest.json +1 -1
  191. package/src/manifests/empty-state.manifest.json +1 -1
  192. package/src/manifests/entity-card.manifest.json +1 -1
  193. package/src/manifests/feature-grid.manifest.json +1 -1
  194. package/src/manifests/feature-row.manifest.json +1 -1
  195. package/src/manifests/fieldset.manifest.json +1 -1
  196. package/src/manifests/file-upload.manifest.json +1 -1
  197. package/src/manifests/filter-bar.manifest.json +1 -1
  198. package/src/manifests/filter-chips.manifest.json +13 -1
  199. package/src/manifests/filter-panel.manifest.json +1 -1
  200. package/src/manifests/flex.manifest.json +1 -1
  201. package/src/manifests/form-field.manifest.json +1 -1
  202. package/src/manifests/form-layout.manifest.json +1 -1
  203. package/src/manifests/form.manifest.json +1 -1
  204. package/src/manifests/grid.manifest.json +1 -1
  205. package/src/manifests/heading.manifest.json +1 -1
  206. package/src/manifests/hero.manifest.json +1 -1
  207. package/src/manifests/image.manifest.json +1 -1
  208. package/src/manifests/input-group.manifest.json +1 -1
  209. package/src/manifests/input.manifest.json +1 -1
  210. package/src/manifests/label.manifest.json +1 -1
  211. package/src/manifests/link-tabs.manifest.json +1 -1
  212. package/src/manifests/link.manifest.json +1 -1
  213. package/src/manifests/list.manifest.json +1 -1
  214. package/src/manifests/load-more.manifest.json +1 -1
  215. package/src/manifests/logo-cloud.manifest.json +1 -1
  216. package/src/manifests/menu.manifest.json +1 -1
  217. package/src/manifests/metric-card.manifest.json +1 -1
  218. package/src/manifests/multi-select.manifest.json +1 -1
  219. package/src/manifests/newsletter.manifest.json +1 -1
  220. package/src/manifests/page-header.manifest.json +1 -1
  221. package/src/manifests/pagination.manifest.json +1 -1
  222. package/src/manifests/password-input.manifest.json +1 -1
  223. package/src/manifests/popover.manifest.json +1 -1
  224. package/src/manifests/process-steps.manifest.json +1 -1
  225. package/src/manifests/progress.manifest.json +1 -1
  226. package/src/manifests/prose.manifest.json +1 -1
  227. package/src/manifests/radio.manifest.json +1 -1
  228. package/src/manifests/range-slider.manifest.json +1 -1
  229. package/src/manifests/search.manifest.json +1 -1
  230. package/src/manifests/section-heading.manifest.json +1 -1
  231. package/src/manifests/section.manifest.json +1 -1
  232. package/src/manifests/segmented-control.manifest.json +1 -1
  233. package/src/manifests/select-menu.manifest.json +1 -1
  234. package/src/manifests/select.manifest.json +8 -1
  235. package/src/manifests/separator.manifest.json +1 -1
  236. package/src/manifests/site-footer.manifest.json +1 -1
  237. package/src/manifests/site-header.manifest.json +1 -1
  238. package/src/manifests/skeleton.manifest.json +1 -1
  239. package/src/manifests/spinner.manifest.json +1 -1
  240. package/src/manifests/stat-band.manifest.json +1 -1
  241. package/src/manifests/stepper.manifest.json +1 -1
  242. package/src/manifests/switch.manifest.json +1 -1
  243. package/src/manifests/table-card.manifest.json +1 -1
  244. package/src/manifests/table-of-contents.manifest.json +1 -1
  245. package/src/manifests/table.manifest.json +1 -1
  246. package/src/manifests/tabs.manifest.json +1 -1
  247. package/src/manifests/testimonial.manifest.json +1 -1
  248. package/src/manifests/text.manifest.json +1 -1
  249. package/src/manifests/textarea.manifest.json +1 -1
  250. package/src/manifests/theme-toggle.manifest.json +1 -1
  251. package/src/manifests/time-picker.manifest.json +1 -1
  252. package/src/manifests/timeline.manifest.json +1 -1
  253. package/src/manifests/toast.manifest.json +1 -1
  254. package/src/manifests/tombstone-card.manifest.json +1 -1
  255. package/src/manifests/tooltip.manifest.json +12 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/radio/Radio.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type RadioProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n /** Controlled checked state; omit for uncontrolled usage. */\n checked?: boolean;\n /** Fired when the user selects this radio. */\n onCheckedChange?: (checked: boolean) => void;\n};\n\n/**\n * Accessible radio built on the native input, to be used inside a\n * `RadioGroup` (which provides the shared `name`). Platform keyboard\n * navigation and form semantics come for free.\n */\nconst Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n ({ className, checked, onCheckedChange, onChange, ...props }, ref) => (\n <input\n type=\"radio\"\n ref={ref}\n checked={checked}\n onChange={(event) => {\n onCheckedChange?.(event.target.checked);\n onChange?.(event);\n }}\n className={cn(\n 'h-4 w-4 shrink-0 rounded-full border border-primary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'checked:bg-primary checked:text-primary-foreground',\n className\n )}\n {...props}\n />\n )\n);\nRadio.displayName = 'Radio';\n\nexport type RadioGroupProps = {\n /** Shared name applied to every radio in the group. */\n name: string;\n /** Accessible group label; rendered as <legend> inside a fieldset. */\n legend?: string;\n /** Currently selected value (controlled). */\n value?: string;\n /** Initial value (uncontrolled). */\n defaultValue?: string;\n /** Called with the newly selected value. */\n onValueChange?: (value: string) => void;\n /** Stack options (default) or lay them out in a wrapping row. */\n orientation?: 'vertical' | 'horizontal';\n /** Group-level validation message; announced via role=alert. */\n error?: string;\n className?: string;\n children: React.ReactNode;\n};\n\n/**\n * Groups related radios with a shared name and accessible legend.\n * Renders a native <fieldset>/<legend> so screen readers announce the\n * group context alongside each option.\n */\nconst RadioGroup = React.forwardRef<HTMLFieldSetElement, RadioGroupProps>(\n ({ name, legend, value, defaultValue, onValueChange, orientation = 'vertical', error, className, children }, ref) => {\n const [internalValue, setInternalValue] = React.useState(defaultValue ?? '');\n const currentValue = value ?? internalValue;\n\n const handleChange = (next: string) => {\n if (value === undefined) setInternalValue(next);\n onValueChange?.(next);\n };\n\n return (\n <fieldset\n ref={ref}\n className={cn(\n orientation === 'vertical' ? 'space-y-2' : 'flex flex-row flex-wrap gap-x-4 gap-y-2',\n className\n )}\n >\n {legend && <legend className=\"text-sm font-medium\">{legend}</legend>}\n <RadioGroupContext.Provider value={{ name, value: currentValue, onChange: handleChange }}>\n {children}\n </RadioGroupContext.Provider>\n {error && (\n <p role=\"alert\" className=\"text-xs text-destructive\">\n {error}\n </p>\n )}\n </fieldset>\n );\n }\n);\nRadioGroup.displayName = 'RadioGroup';\n\ntype RadioGroupContextValue = {\n name: string;\n value: string;\n onChange: (value: string) => void;\n};\n\n/** Shared group state — exported so custom option controls (RadioCard) can join a RadioGroup. */\nexport const RadioGroupContext = React.createContext<RadioGroupContextValue>({\n name: '',\n value: '',\n onChange: () => {},\n});\n\nexport type RadioGroupItemProps = Omit<RadioProps, 'name' | 'checked' | 'onCheckedChange' | 'value'> & {\n /** The value this item contributes to the group. */\n value: string;\n /** Visible label rendered next to the radio. */\n label?: string;\n};\n\n/** A single radio option inside a `RadioGroup`. */\nconst RadioGroupItem = React.forwardRef<HTMLInputElement, RadioGroupItemProps>(\n ({ value, label, className, id, ...props }, ref) => {\n const group = React.useContext(RadioGroupContext);\n const generatedId = React.useId();\n const inputId = id ?? generatedId;\n\n return (\n <div className=\"flex items-center gap-2\">\n <Radio\n ref={ref}\n id={inputId}\n name={group.name}\n value={value}\n checked={group.value === value}\n onCheckedChange={(checked) => checked && group.onChange(value)}\n className={className}\n {...props}\n />\n {label && (\n <label htmlFor={inputId} className=\"text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\">\n {label}\n </label>\n )}\n </div>\n );\n }\n);\nRadioGroupItem.displayName = 'RadioGroupItem';\n\nexport { Radio, RadioGroup, RadioGroupItem };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBI;AAjBJ,YAAuB;AACvB,gBAAmB;AAcnB,MAAM,QAAQ,MAAM;AAAA,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AAE,OAAO,OAAO,WAAW,IAAI,GAAG,MAAM,GAAG,QAAQ;AAClD,UAAM,QAAQ,MAAM,WAAW,iBAAiB;AAChD,UAAM,cAAc,MAAM,MAAM;AAChC,UAAM,UAAU,MAAM;AAEtB,WACE,6CAAC,SAAI,WAAU,2BACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,IAAI;AAAA,UACJ,MAAM,MAAM;AAAA,UACZ;AAAA,UACA,SAAS,MAAM,UAAU;AAAA,UACzB,iBAAiB,CAAC,YAAY,WAAW,MAAM,SAAS,KAAK;AAAA,UAC7D;AAAA,UACC,GAAG;AAAA;AAAA,MACN;AAAA,MACC,SACC,4CAAC,WAAM,SAAS,SAAS,WAAU,kFAChC,iBACH;AAAA,OAEJ;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/radio/Radio.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type RadioProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n /** Controlled checked state; omit for uncontrolled usage. */\n checked?: boolean;\n /** Fired when the user selects this radio. */\n onCheckedChange?: (checked: boolean) => void;\n};\n\n/**\n * Accessible radio built on the native input, to be used inside a\n * `RadioGroup` (which provides the shared `name`). Platform keyboard\n * navigation and form semantics come for free.\n */\nconst Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n ({ className, checked, onCheckedChange, onChange, ...props }, ref) => (\n <input\n type=\"radio\"\n ref={ref}\n checked={checked}\n onChange={(event) => {\n onCheckedChange?.(event.target.checked);\n onChange?.(event);\n }}\n className={cn(\n 'h-4 w-4 shrink-0 rounded-full border border-primary accent-primary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'checked:bg-primary checked:text-primary-foreground',\n className\n )}\n {...props}\n />\n )\n);\nRadio.displayName = 'Radio';\n\nexport type RadioGroupProps = {\n /** Shared name applied to every radio in the group. */\n name: string;\n /** Accessible group label; rendered as <legend> inside a fieldset. */\n legend?: string;\n /** Currently selected value (controlled). */\n value?: string;\n /** Initial value (uncontrolled). */\n defaultValue?: string;\n /** Called with the newly selected value. */\n onValueChange?: (value: string) => void;\n /** Stack options (default) or lay them out in a wrapping row. */\n orientation?: 'vertical' | 'horizontal';\n /** Group-level validation message; announced via role=alert. */\n error?: string;\n className?: string;\n children: React.ReactNode;\n};\n\n/**\n * Groups related radios with a shared name and accessible legend.\n * Renders a native <fieldset>/<legend> so screen readers announce the\n * group context alongside each option.\n */\nconst RadioGroup = React.forwardRef<HTMLFieldSetElement, RadioGroupProps>(\n ({ name, legend, value, defaultValue, onValueChange, orientation = 'vertical', error, className, children }, ref) => {\n const [internalValue, setInternalValue] = React.useState(defaultValue ?? '');\n const currentValue = value ?? internalValue;\n\n const handleChange = (next: string) => {\n if (value === undefined) setInternalValue(next);\n onValueChange?.(next);\n };\n\n return (\n <fieldset\n ref={ref}\n className={cn(\n orientation === 'vertical' ? 'space-y-2' : 'flex flex-row flex-wrap gap-x-4 gap-y-2',\n className\n )}\n >\n {legend && <legend className=\"text-sm font-medium\">{legend}</legend>}\n <RadioGroupContext.Provider value={{ name, value: currentValue, onChange: handleChange }}>\n {children}\n </RadioGroupContext.Provider>\n {error && (\n <p role=\"alert\" className=\"text-xs text-destructive\">\n {error}\n </p>\n )}\n </fieldset>\n );\n }\n);\nRadioGroup.displayName = 'RadioGroup';\n\ntype RadioGroupContextValue = {\n name: string;\n value: string;\n onChange: (value: string) => void;\n};\n\n/** Shared group state — exported so custom option controls (RadioCard) can join a RadioGroup. */\nexport const RadioGroupContext = React.createContext<RadioGroupContextValue>({\n name: '',\n value: '',\n onChange: () => {},\n});\n\nexport type RadioGroupItemProps = Omit<RadioProps, 'name' | 'checked' | 'onCheckedChange' | 'value'> & {\n /** The value this item contributes to the group. */\n value: string;\n /** Visible label rendered next to the radio. */\n label?: string;\n};\n\n/** A single radio option inside a `RadioGroup`. */\nconst RadioGroupItem = React.forwardRef<HTMLInputElement, RadioGroupItemProps>(\n ({ value, label, className, id, ...props }, ref) => {\n const group = React.useContext(RadioGroupContext);\n const generatedId = React.useId();\n const inputId = id ?? generatedId;\n\n return (\n <div className=\"flex items-center gap-2\">\n <Radio\n ref={ref}\n id={inputId}\n name={group.name}\n value={value}\n checked={group.value === value}\n onCheckedChange={(checked) => checked && group.onChange(value)}\n className={className}\n {...props}\n />\n {label && (\n <label htmlFor={inputId} className=\"text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\">\n {label}\n </label>\n )}\n </div>\n );\n }\n);\nRadioGroupItem.displayName = 'RadioGroupItem';\n\nexport { Radio, RadioGroup, RadioGroupItem };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBI;AAjBJ,YAAuB;AACvB,gBAAmB;AAcnB,MAAM,QAAQ,MAAM;AAAA,EAClB,CAAC,EAAE,WAAW,SAAS,iBAAiB,UAAU,GAAG,MAAM,GAAG,QAC5D;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU,CAAC,UAAU;AACnB,0BAAkB,MAAM,OAAO,OAAO;AACtC,mBAAW,KAAK;AAAA,MAClB;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,MAAM,cAAc;AA0BpB,MAAM,aAAa,MAAM;AAAA,EACvB,CAAC,EAAE,MAAM,QAAQ,OAAO,cAAc,eAAe,cAAc,YAAY,OAAO,WAAW,SAAS,GAAG,QAAQ;AACnH,UAAM,CAAC,eAAe,gBAAgB,IAAI,MAAM,SAAS,gBAAgB,EAAE;AAC3E,UAAM,eA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onChange?.(event);
15
15
  },
16
16
  className: cn(
17
- "h-4 w-4 shrink-0 rounded-full border border-primary",
17
+ "h-4 w-4 shrink-0 rounded-full border border-primary accent-primary",
18
18
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
19
19
  "disabled:cursor-not-allowed disabled:opacity-50",
20
20
  "checked:bg-primary checked:text-primary-foreground",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/radio/Radio.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type RadioProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n /** Controlled checked state; omit for uncontrolled usage. */\n checked?: boolean;\n /** Fired when the user selects this radio. */\n onCheckedChange?: (checked: boolean) => void;\n};\n\n/**\n * Accessible radio built on the native input, to be used inside a\n * `RadioGroup` (which provides the shared `name`). Platform keyboard\n * navigation and form semantics come for free.\n */\nconst Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n ({ className, checked, onCheckedChange, onChange, ...props }, ref) => (\n <input\n type=\"radio\"\n ref={ref}\n checked={checked}\n onChange={(event) => {\n onCheckedChange?.(event.target.checked);\n onChange?.(event);\n }}\n className={cn(\n 'h-4 w-4 shrink-0 rounded-full border border-primary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'checked:bg-primary checked:text-primary-foreground',\n className\n )}\n {...props}\n />\n )\n);\nRadio.displayName = 'Radio';\n\nexport type RadioGroupProps = {\n /** Shared name applied to every radio in the group. */\n name: string;\n /** Accessible group label; rendered as <legend> inside a fieldset. */\n legend?: string;\n /** Currently selected value (controlled). */\n value?: string;\n /** Initial value (uncontrolled). */\n defaultValue?: string;\n /** Called with the newly selected value. */\n onValueChange?: (value: string) => void;\n /** Stack options (default) or lay them out in a wrapping row. */\n orientation?: 'vertical' | 'horizontal';\n /** Group-level validation message; announced via role=alert. */\n error?: string;\n className?: string;\n children: React.ReactNode;\n};\n\n/**\n * Groups related radios with a shared name and accessible legend.\n * Renders a native <fieldset>/<legend> so screen readers announce the\n * group context alongside each option.\n */\nconst RadioGroup = React.forwardRef<HTMLFieldSetElement, RadioGroupProps>(\n ({ name, legend, value, defaultValue, onValueChange, orientation = 'vertical', error, className, children }, ref) => {\n const [internalValue, setInternalValue] = React.useState(defaultValue ?? '');\n const currentValue = value ?? internalValue;\n\n const handleChange = (next: string) => {\n if (value === undefined) setInternalValue(next);\n onValueChange?.(next);\n };\n\n return (\n <fieldset\n ref={ref}\n className={cn(\n orientation === 'vertical' ? 'space-y-2' : 'flex flex-row flex-wrap gap-x-4 gap-y-2',\n className\n )}\n >\n {legend && <legend className=\"text-sm font-medium\">{legend}</legend>}\n <RadioGroupContext.Provider value={{ name, value: currentValue, onChange: handleChange }}>\n {children}\n </RadioGroupContext.Provider>\n {error && (\n <p role=\"alert\" className=\"text-xs text-destructive\">\n {error}\n </p>\n )}\n </fieldset>\n );\n }\n);\nRadioGroup.displayName = 'RadioGroup';\n\ntype RadioGroupContextValue = {\n name: string;\n value: string;\n onChange: (value: string) => void;\n};\n\n/** Shared group state — exported so custom option controls (RadioCard) can join a RadioGroup. */\nexport const RadioGroupContext = React.createContext<RadioGroupContextValue>({\n name: '',\n value: '',\n onChange: () => {},\n});\n\nexport type RadioGroupItemProps = Omit<RadioProps, 'name' | 'checked' | 'onCheckedChange' | 'value'> & {\n /** The value this item contributes to the group. */\n value: string;\n /** Visible label rendered next to the radio. */\n label?: string;\n};\n\n/** A single radio option inside a `RadioGroup`. */\nconst RadioGroupItem = React.forwardRef<HTMLInputElement, RadioGroupItemProps>(\n ({ value, label, className, id, ...props }, ref) => {\n const group = React.useContext(RadioGroupContext);\n const generatedId = React.useId();\n const inputId = id ?? generatedId;\n\n return (\n <div className=\"flex items-center gap-2\">\n <Radio\n ref={ref}\n id={inputId}\n name={group.name}\n value={value}\n checked={group.value === value}\n onCheckedChange={(checked) => checked && group.onChange(value)}\n className={className}\n {...props}\n />\n {label && (\n <label htmlFor={inputId} className=\"text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\">\n {label}\n </label>\n )}\n </div>\n );\n }\n);\nRadioGroupItem.displayName = 'RadioGroupItem';\n\nexport { Radio, RadioGroup, RadioGroupItem };\n"],"mappings":";AAmBI,cAwDE,YAxDF;AAjBJ,YAAY,WAAW;AACvB,SAAS,UAAU;AAcnB,MAAM,QAAQ,MAAM;AAAA,EAClB,CAAC,EAAE,WAAW,SAAS,iBAAiB,UAAU,GAAG,MAAM,GAAG,QAC5D;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU,CAAC,UAAU;AACnB,0BAAkB,MAAM,OAAO,OAAO;AACtC,mBAAW,KAAK;AAAA,MAClB;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,MAAM,cAAc;AA0BpB,MAAM,aAAa,MAAM;AAAA,EACvB,CAAC,EAAE,MAAM,QAAQ,OAAO,cAAc,eAAe,cAAc,YAAY,OAAO,WAAW,SAAS,GAAG,QAAQ;AACnH,UAAM,CAAC,eAAe,gBAAgB,IAAI,MAAM,SAAS,gBAAgB,EAAE;AAC3E,UAAM,eAAe,SAAS;AAE9B,UAAM,eAAe,CAAC,SAAiB;AACrC,UAAI,UAAU,OAAW,kBAAiB,IAAI;AAC9C,sBAAgB,IAAI;AAAA,IACtB;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT,gBAAgB,aAAa,cAAc;AAAA,UAC3C;AAAA,QACF;AAAA,QAEC;AAAA,oBAAU,oBAAC,YAAO,WAAU,uBAAuB,kBAAO;AAAA,UAC3D,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,EAAE,MAAM,OAAO,cAAc,UAAU,aAAa,GACpF,UACH;AAAA,UACC,SACC,oBAAC,OAAE,MAAK,SAAQ,WAAU,4BACvB,iBACH;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;AASlB,MAAM,oBAAoB,MAAM,cAAsC;AAAA,EAC3E,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU,MAAM;AAAA,EAAC;AACnB,CAAC;AAUD,MAAM,iBAAiB,MAAM;AAAA,EAC3B,CAAC,EAAE,OAAO,OAAO,WAAW,IAAI,GAAG,MAAM,GAAG,QAAQ;AAClD,UAAM,QAAQ,MAAM,WAAW,iBAAiB;AAChD,UAAM,cAAc,MAAM,MAAM;AAChC,UAAM,UAAU,MAAM;AAEtB,WACE,qBAAC,SAAI,WAAU,2BACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,IAAI;AAAA,UACJ,MAAM,MAAM;AAAA,UACZ;AAAA,UACA,SAAS,MAAM,UAAU;AAAA,UACzB,iBAAiB,CAAC,YAAY,WAAW,MAAM,SAAS,KAAK;AAAA,UAC7D;AAAA,UACC,GAAG;AAAA;AAAA,MACN;AAAA,MACC,SACC,oBAAC,WAAM,SAAS,SAAS,WAAU,kFAChC,iBACH;AAAA,OAEJ;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/radio/Radio.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type RadioProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n /** Controlled checked state; omit for uncontrolled usage. */\n checked?: boolean;\n /** Fired when the user selects this radio. */\n onCheckedChange?: (checked: boolean) => void;\n};\n\n/**\n * Accessible radio built on the native input, to be used inside a\n * `RadioGroup` (which provides the shared `name`). Platform keyboard\n * navigation and form semantics come for free.\n */\nconst Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n ({ className, checked, onCheckedChange, onChange, ...props }, ref) => (\n <input\n type=\"radio\"\n ref={ref}\n checked={checked}\n onChange={(event) => {\n onCheckedChange?.(event.target.checked);\n onChange?.(event);\n }}\n className={cn(\n 'h-4 w-4 shrink-0 rounded-full border border-primary accent-primary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'checked:bg-primary checked:text-primary-foreground',\n className\n )}\n {...props}\n />\n )\n);\nRadio.displayName = 'Radio';\n\nexport type RadioGroupProps = {\n /** Shared name applied to every radio in the group. */\n name: string;\n /** Accessible group label; rendered as <legend> inside a fieldset. */\n legend?: string;\n /** Currently selected value (controlled). */\n value?: string;\n /** Initial value (uncontrolled). */\n defaultValue?: string;\n /** Called with the newly selected value. */\n onValueChange?: (value: string) => void;\n /** Stack options (default) or lay them out in a wrapping row. */\n orientation?: 'vertical' | 'horizontal';\n /** Group-level validation message; announced via role=alert. */\n error?: string;\n className?: string;\n children: React.ReactNode;\n};\n\n/**\n * Groups related radios with a shared name and accessible legend.\n * Renders a native <fieldset>/<legend> so screen readers announce the\n * group context alongside each option.\n */\nconst RadioGroup = React.forwardRef<HTMLFieldSetElement, RadioGroupProps>(\n ({ name, legend, value, defaultValue, onValueChange, orientation = 'vertical', error, className, children }, ref) => {\n const [internalValue, setInternalValue] = React.useState(defaultValue ?? '');\n const currentValue = value ?? internalValue;\n\n const handleChange = (next: string) => {\n if (value === undefined) setInternalValue(next);\n onValueChange?.(next);\n };\n\n return (\n <fieldset\n ref={ref}\n className={cn(\n orientation === 'vertical' ? 'space-y-2' : 'flex flex-row flex-wrap gap-x-4 gap-y-2',\n className\n )}\n >\n {legend && <legend className=\"text-sm font-medium\">{legend}</legend>}\n <RadioGroupContext.Provider value={{ name, value: currentValue, onChange: handleChange }}>\n {children}\n </RadioGroupContext.Provider>\n {error && (\n <p role=\"alert\" className=\"text-xs text-destructive\">\n {error}\n </p>\n )}\n </fieldset>\n );\n }\n);\nRadioGroup.displayName = 'RadioGroup';\n\ntype RadioGroupContextValue = {\n name: string;\n value: string;\n onChange: (value: string) => void;\n};\n\n/** Shared group state — exported so custom option controls (RadioCard) can join a RadioGroup. */\nexport const RadioGroupContext = React.createContext<RadioGroupContextValue>({\n name: '',\n value: '',\n onChange: () => {},\n});\n\nexport type RadioGroupItemProps = Omit<RadioProps, 'name' | 'checked' | 'onCheckedChange' | 'value'> & {\n /** The value this item contributes to the group. */\n value: string;\n /** Visible label rendered next to the radio. */\n label?: string;\n};\n\n/** A single radio option inside a `RadioGroup`. */\nconst RadioGroupItem = React.forwardRef<HTMLInputElement, RadioGroupItemProps>(\n ({ value, label, className, id, ...props }, ref) => {\n const group = React.useContext(RadioGroupContext);\n const generatedId = React.useId();\n const inputId = id ?? generatedId;\n\n return (\n <div className=\"flex items-center gap-2\">\n <Radio\n ref={ref}\n id={inputId}\n name={group.name}\n value={value}\n checked={group.value === value}\n onCheckedChange={(checked) => checked && group.onChange(value)}\n className={className}\n {...props}\n />\n {label && (\n <label htmlFor={inputId} className=\"text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\">\n {label}\n </label>\n )}\n </div>\n );\n }\n);\nRadioGroupItem.displayName = 'RadioGroupItem';\n\nexport { Radio, RadioGroup, RadioGroupItem };\n"],"mappings":";AAmBI,cAwDE,YAxDF;AAjBJ,YAAY,WAAW;AACvB,SAAS,UAAU;AAcnB,MAAM,QAAQ,MAAM;AAAA,EAClB,CAAC,EAAE,WAAW,SAAS,iBAAiB,UAAU,GAAG,MAAM,GAAG,QAC5D;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU,CAAC,UAAU;AACnB,0BAAkB,MAAM,OAAO,OAAO;AACtC,mBAAW,KAAK;AAAA,MAClB;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;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ACZ;AAAA,UACA,SAAS,MAAM,UAAU;AAAA,UACzB,iBAAiB,CAAC,YAAY,WAAW,MAAM,SAAS,KAAK;AAAA,UAC7D;AAAA,UACC,GAAG;AAAA;AAAA,MACN;AAAA,MACC,SACC,oBAAC,WAAM,SAAS,SAAS,WAAU,kFAChC,iBACH;AAAA,OAEJ;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;","names":[]}
@@ -38,9 +38,9 @@ var import_cn = require("../../utils/cn.js");
38
38
  const rangeInputClass = (0, import_cn.cn)(
39
39
  "pointer-events-none absolute inset-x-0 top-1/2 h-6 w-full -translate-y-1/2 appearance-none bg-transparent",
40
40
  "[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent",
41
- "[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background [&::-webkit-slider-thumb]:shadow",
41
+ "[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-md",
42
42
  "[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent",
43
- "[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary [&::-moz-range-thumb]:bg-background [&::-moz-range-thumb]:shadow",
43
+ "[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-md",
44
44
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
45
45
  "disabled:cursor-not-allowed disabled:opacity-50"
46
46
  );
@@ -80,7 +80,7 @@ const RangeSlider = React.forwardRef(function RangeSlider2({
80
80
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: formatValue(high) })
81
81
  ] }),
82
82
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative h-6 w-full", children: [
83
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-muted" }),
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-border" }),
84
84
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
85
85
  "div",
86
86
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/range-slider/RangeSlider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type RangeSliderProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> & {\n /** Controlled low/high pair. */\n value?: [number, number];\n /** Initial low/high pair when uncontrolled. Defaults to [min, max]. */\n defaultValue?: [number, number];\n /** Fires with the next low/high pair. */\n onValueChange?: (value: [number, number]) => void;\n /** Lower bound. Default 0. */\n min?: number;\n /** Upper bound. Default 100. */\n max?: number;\n /** Increment. Default 1. */\n step?: number;\n /** Accessible label for the low thumb. Default \"Minimum\". */\n startLabel?: string;\n /** Accessible label for the high thumb. Default \"Maximum\". */\n endLabel?: string;\n /** Formats the displayed values and aria-valuetext. */\n formatValue?: (value: number) => string;\n /** Show the current low/high values above the track. Default true. */\n showValues?: boolean;\n disabled?: boolean;\n};\n\n// The track is 4px (h-1) and the thumb is 16px (h-4). WebKit positions the\n// thumb from the top of the track, so it needs a -6px margin to share the\n// track's centre line instead of sitting flush against its top edge. Firefox\n// centres the thumb on the track by itself.\nconst rangeInputClass = cn(\n 'pointer-events-none absolute inset-x-0 top-1/2 h-6 w-full -translate-y-1/2 appearance-none bg-transparent',\n '[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent',\n '[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background [&::-webkit-slider-thumb]:shadow',\n '[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent',\n '[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary [&::-moz-range-thumb]:bg-background [&::-moz-range-thumb]:shadow',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50'\n);\n\n/**\n * Dual-thumb range slider for numeric ranges such as revenue or EBITDA.\n * Uses two native range inputs for keyboard and screen-reader behavior, and\n * keeps the low and high thumbs from crossing. Pair it with a FilterBar or\n * FilterPanel for data dashboards.\n */\nexport const RangeSlider = React.forwardRef<HTMLDivElement, RangeSliderProps>(function RangeSlider(\n {\n value,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n startLabel = 'Minimum',\n endLabel = 'Maximum',\n formatValue = (entry) => String(entry),\n showValues = true,\n disabled = false,\n className,\n ...props\n },\n ref\n) {\n const clamp = (entry: number) => Math.min(Math.max(entry, min), max);\n const [internal, setInternal] = React.useState<[number, number]>(() => {\n const initial = defaultValue ?? [min, max];\n return [clamp(initial[0]), clamp(initial[1])];\n });\n const current = value ?? internal;\n const low = Math.min(clamp(current[0]), clamp(current[1]));\n const high = Math.max(clamp(current[0]), clamp(current[1]));\n\n const commit = (next: [number, number]) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n };\n\n const span = max - min || 1;\n const lowPercent = ((low - min) / span) * 100;\n const highPercent = ((high - min) / span) * 100;\n\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {showValues && (\n <div className=\"mb-2 flex items-center justify-between text-sm font-medium tabular-nums\">\n <span>{formatValue(low)}</span>\n <span>{formatValue(high)}</span>\n </div>\n )}\n <div className=\"relative h-6 w-full\">\n <div className=\"absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-muted\" />\n <div\n className=\"absolute top-1/2 h-1 -translate-y-1/2 rounded-full bg-primary\"\n style={{ left: `${lowPercent}%`, right: `${100 - highPercent}%` }}\n />\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={low}\n disabled={disabled}\n aria-label={startLabel}\n aria-valuetext={formatValue(low)}\n onChange={(event) => commit([Math.min(Number(event.target.value), high), high])}\n className={cn(rangeInputClass, 'z-10')}\n />\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={high}\n disabled={disabled}\n aria-label={endLabel}\n aria-valuetext={formatValue(high)}\n onChange={(event) => commit([low, Math.max(Number(event.target.value), low)])}\n className={cn(rangeInputClass, 'z-20')}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwFQ;AAtFR,YAAuB;AACvB,gBAAmB;AA8BnB,MAAM,sBAAkB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQO,MAAM,cAAc,MAAM,WAA6C,SAASA,aACrF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,WAAW;AAAA,EACX,cAAc,CAAC,UAAU,OAAO,KAAK;AAAA,EACrC,aAAa;AAAA,EACb,WAAW;AAAA,EACX;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,QAAQ,CAAC,UAAkB,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAAG;AACnE,QAAM,CAAC,UAAU,WAAW,IAAI,MAAM,SAA2B,MAAM;AACrE,UAAM,UAAU,gBAAgB,CAAC,KAAK,GAAG;AACzC,WAAO,CAAC,MAAM,QAAQ,CAAC,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC;AAAA,EAC9C,CAAC;AACD,QAAM,UAAU,SAAS;AACzB,QAAM,MAAM,KAAK,IAAI,MAAM,QAAQ,CAAC,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC;AACzD,QAAM,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC;AAE1D,QAAM,SAAS,CAAC,SAA2B;AACzC,QAAI,UAAU,OAAW,aAAY,IAAI;AACzC,oBAAgB,IAAI;AAAA,EACtB;AAEA,QAAM,OAAO,MAAM,OAAO;A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ider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type RangeSliderProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> & {\n /** Controlled low/high pair. */\n value?: [number, number];\n /** Initial low/high pair when uncontrolled. Defaults to [min, max]. */\n defaultValue?: [number, number];\n /** Fires with the next low/high pair. */\n onValueChange?: (value: [number, number]) => void;\n /** Lower bound. Default 0. */\n min?: number;\n /** Upper bound. Default 100. */\n max?: number;\n /** Increment. Default 1. */\n step?: number;\n /** Accessible label for the low thumb. Default \"Minimum\". */\n startLabel?: string;\n /** Accessible label for the high thumb. Default \"Maximum\". */\n endLabel?: string;\n /** Formats the displayed values and aria-valuetext. */\n formatValue?: (value: number) => string;\n /** Show the current low/high values above the track. Default true. */\n showValues?: boolean;\n disabled?: boolean;\n};\n\n// The track is 4px (h-1) and the thumb is 16px (h-4). WebKit positions the\n// thumb from the top of the track, so it needs a -6px margin to share the\n// track's centre line instead of sitting flush against its top edge. Firefox\n// centres the thumb on the track by itself.\nconst rangeInputClass = cn(\n 'pointer-events-none absolute inset-x-0 top-1/2 h-6 w-full -translate-y-1/2 appearance-none bg-transparent',\n '[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent',\n '[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-md',\n '[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent',\n '[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-md',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50'\n);\n\n/**\n * Dual-thumb range slider for numeric ranges such as revenue or EBITDA.\n * Uses two native range inputs for keyboard and screen-reader behavior, and\n * keeps the low and high thumbs from crossing. Pair it with a FilterBar or\n * FilterPanel for data dashboards.\n */\nexport const RangeSlider = React.forwardRef<HTMLDivElement, RangeSliderProps>(function RangeSlider(\n {\n value,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n startLabel = 'Minimum',\n endLabel = 'Maximum',\n formatValue = (entry) => String(entry),\n showValues = true,\n disabled = false,\n className,\n ...props\n },\n ref\n) {\n const clamp = (entry: number) => Math.min(Math.max(entry, min), max);\n const [internal, setInternal] = React.useState<[number, number]>(() => {\n const initial = defaultValue ?? [min, max];\n return [clamp(initial[0]), clamp(initial[1])];\n });\n const current = value ?? internal;\n const low = Math.min(clamp(current[0]), clamp(current[1]));\n const high = Math.max(clamp(current[0]), clamp(current[1]));\n\n const commit = (next: [number, number]) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n };\n\n const span = max - min || 1;\n const lowPercent = ((low - min) / span) * 100;\n const highPercent = ((high - min) / span) * 100;\n\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {showValues && (\n <div className=\"mb-2 flex items-center justify-between text-sm font-medium tabular-nums\">\n <span>{formatValue(low)}</span>\n <span>{formatValue(high)}</span>\n </div>\n )}\n <div className=\"relative h-6 w-full\">\n <div className=\"absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-border\" />\n <div\n className=\"absolute top-1/2 h-1 -translate-y-1/2 rounded-full bg-primary\"\n style={{ left: `${lowPercent}%`, right: `${100 - highPercent}%` }}\n />\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={low}\n disabled={disabled}\n aria-label={startLabel}\n aria-valuetext={formatValue(low)}\n onChange={(event) => commit([Math.min(Number(event.target.value), high), high])}\n className={cn(rangeInputClass, 'z-10')}\n />\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={high}\n disabled={disabled}\n aria-label={endLabel}\n aria-valuetext={formatValue(high)}\n onChange={(event) => commit([low, Math.max(Number(event.target.value), low)])}\n className={cn(rangeInputClass, 'z-20')}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwFQ;AAtFR,YAAuB;AACvB,gBAAmB;AA8BnB,MAAM,sBAAkB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQO,MAAM,cAAc,MAAM,WAA6C,SAASA,aACrF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,WAAW;AAAA,EACX,cAAc,CAAC,UAAU,OAAO,KAAK;AAAA,EACrC,aAAa;AAAA,EACb,WAAW;AAAA,EACX;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,QAAQ,CAAC,UAAkB,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAAG;AACnE,QAAM,CAAC,UAAU,WAAW,IAAI,MAAM,SAA2B,MAAM;AACrE,UAAM,UAAU,gBAAgB,CAAC,KAAK,GAAG;AACzC,WAAO,CAAC,MAAM,QAAQ,CAAC,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC;AAAA,EAC9C,CAAC;AACD,QAAM,UAAU,SAAS;AACzB,QAAM,MAAM,KAAK,IAAI,MA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,UACZ,kBAAgB,YAAY,IAAI;AAAA,UAChC,UAAU,CAAC,UAAU,OAAO,CAAC,KAAK,KAAK,IAAI,OAAO,MAAM,OAAO,KAAK,GAAG,GAAG,CAAC,CAAC;AAAA,UAC5E,eAAW,cAAG,iBAAiB,MAAM;AAAA;AAAA,MACvC;AAAA,OACF;AAAA,KACF;AAEJ,CAAC;","names":["RangeSlider"]}
@@ -5,9 +5,9 @@ import { cn } from "../../utils/cn.mjs";
5
5
  const rangeInputClass = cn(
6
6
  "pointer-events-none absolute inset-x-0 top-1/2 h-6 w-full -translate-y-1/2 appearance-none bg-transparent",
7
7
  "[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent",
8
- "[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background [&::-webkit-slider-thumb]:shadow",
8
+ "[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-md",
9
9
  "[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent",
10
- "[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary [&::-moz-range-thumb]:bg-background [&::-moz-range-thumb]:shadow",
10
+ "[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-md",
11
11
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
12
12
  "disabled:cursor-not-allowed disabled:opacity-50"
13
13
  );
@@ -47,7 +47,7 @@ const RangeSlider = React.forwardRef(function RangeSlider2({
47
47
  /* @__PURE__ */ jsx("span", { children: formatValue(high) })
48
48
  ] }),
49
49
  /* @__PURE__ */ jsxs("div", { className: "relative h-6 w-full", children: [
50
- /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-muted" }),
50
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-border" }),
51
51
  /* @__PURE__ */ jsx(
52
52
  "div",
53
53
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/range-slider/RangeSlider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type RangeSliderProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> & {\n /** Controlled low/high pair. */\n value?: [number, number];\n /** Initial low/high pair when uncontrolled. Defaults to [min, max]. */\n defaultValue?: [number, number];\n /** Fires with the next low/high pair. */\n onValueChange?: (value: [number, number]) => void;\n /** Lower bound. Default 0. */\n min?: number;\n /** Upper bound. Default 100. */\n max?: number;\n /** Increment. Default 1. */\n step?: number;\n /** Accessible label for the low thumb. Default \"Minimum\". */\n startLabel?: string;\n /** Accessible label for the high thumb. Default \"Maximum\". */\n endLabel?: string;\n /** Formats the displayed values and aria-valuetext. */\n formatValue?: (value: number) => string;\n /** Show the current low/high values above the track. Default true. */\n showValues?: boolean;\n disabled?: boolean;\n};\n\n// The track is 4px (h-1) and the thumb is 16px (h-4). WebKit positions the\n// thumb from the top of the track, so it needs a -6px margin to share the\n// track's centre line instead of sitting flush against its top edge. Firefox\n// centres the thumb on the track by itself.\nconst rangeInputClass = cn(\n 'pointer-events-none absolute inset-x-0 top-1/2 h-6 w-full -translate-y-1/2 appearance-none bg-transparent',\n '[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent',\n '[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background [&::-webkit-slider-thumb]:shadow',\n '[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent',\n '[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary [&::-moz-range-thumb]:bg-background [&::-moz-range-thumb]:shadow',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50'\n);\n\n/**\n * Dual-thumb range slider for numeric ranges such as revenue or EBITDA.\n * Uses two native range inputs for keyboard and screen-reader behavior, and\n * keeps the low and high thumbs from crossing. Pair it with a FilterBar or\n * FilterPanel for data dashboards.\n */\nexport const RangeSlider = React.forwardRef<HTMLDivElement, RangeSliderProps>(function RangeSlider(\n {\n value,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n startLabel = 'Minimum',\n endLabel = 'Maximum',\n formatValue = (entry) => String(entry),\n showValues = true,\n disabled = false,\n className,\n ...props\n },\n ref\n) {\n const clamp = (entry: number) => Math.min(Math.max(entry, min), max);\n const [internal, setInternal] = React.useState<[number, number]>(() => {\n const initial = defaultValue ?? [min, max];\n return [clamp(initial[0]), clamp(initial[1])];\n });\n const current = value ?? internal;\n const low = Math.min(clamp(current[0]), clamp(current[1]));\n const high = Math.max(clamp(current[0]), clamp(current[1]));\n\n const commit = (next: [number, number]) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n };\n\n const span = max - min || 1;\n const lowPercent = ((low - min) / span) * 100;\n const highPercent = ((high - min) / span) * 100;\n\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {showValues && (\n <div className=\"mb-2 flex items-center justify-between text-sm font-medium tabular-nums\">\n <span>{formatValue(low)}</span>\n <span>{formatValue(high)}</span>\n </div>\n )}\n <div className=\"relative h-6 w-full\">\n <div className=\"absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-muted\" />\n <div\n className=\"absolute top-1/2 h-1 -translate-y-1/2 rounded-full bg-primary\"\n style={{ left: `${lowPercent}%`, right: `${100 - highPercent}%` }}\n />\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={low}\n disabled={disabled}\n aria-label={startLabel}\n aria-valuetext={formatValue(low)}\n onChange={(event) => commit([Math.min(Number(event.target.value), high), high])}\n className={cn(rangeInputClass, 'z-10')}\n />\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={high}\n disabled={disabled}\n aria-label={endLabel}\n aria-valuetext={formatValue(high)}\n onChange={(event) => commit([low, Math.max(Number(event.target.value), low)])}\n className={cn(rangeInputClass, 'z-20')}\n />\n </div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D;AAAA,kBACC,qBAAC,SAAI,WAAU,2EACb;AAAA,0BAAC,UAAM,sBAAY,GAAG,GAAE;AAAA,MACxB,oBAAC,UAAM,sBAAY,IAAI,GAAE;AAAA,OAC3B;AAAA,IAEF,qBAAC,SAAI,WAAU,uBACb;AAAA,0BAAC,SAAI,WAAU,yEAAwE;AAAA,MACvF;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO,EAAE,MAAM,GAAG,UAAU,KAAK,OAAO,GAAG,MAAM,WAAW,IAAI;AAAA;AAAA,MAClE;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA,OAAO;AAAA,UACP;AAAA,UACA,cAAY;AAAA,UACZ,kBAAgB,YAAY,GAAG;AAAA,UAC/B,UAAU,CAAC,UAAU,OAAO,CAAC,KAAK,IAAI,OAAO,MAAM,OAAO,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;AAAA,UAC9E,WAAW,GAAG,iBAAiB,MAAM;AAAA;AAAA,MACvC;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA,OAAO;AAAA,UACP;AAAA,UACA,cAAY;AAAA,UACZ,kBAAgB,YAAY,IAAI;AAAA,UAChC,UAAU,CAAC,UAAU,OAAO,CAAC,KAAK,KAAK,IAAI,OAAO,MAAM,OAAO,KAAK,GAAG,GAAG,CAAC,CAAC;AAAA,UAC5E,WAAW,GAAG,iBAAiB,MAAM;AAAA;AAAA,MACvC;AAAA,OACF;AAAA,KACF;AAEJ,CAAC;","names":["RangeSlider"]}
1
+ {"version":3,"sources":["../../../../src/components/range-slider/RangeSlider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type RangeSliderProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> & {\n /** Controlled low/high pair. */\n value?: [number, number];\n /** Initial low/high pair when uncontrolled. Defaults to [min, max]. */\n defaultValue?: [number, number];\n /** Fires with the next low/high pair. */\n onValueChange?: (value: [number, number]) => void;\n /** Lower bound. Default 0. */\n min?: number;\n /** Upper bound. Default 100. */\n max?: number;\n /** Increment. Default 1. */\n step?: number;\n /** Accessible label for the low thumb. Default \"Minimum\". */\n startLabel?: string;\n /** Accessible label for the high thumb. Default \"Maximum\". */\n endLabel?: string;\n /** Formats the displayed values and aria-valuetext. */\n formatValue?: (value: number) => string;\n /** Show the current low/high values above the track. Default true. */\n showValues?: boolean;\n disabled?: boolean;\n};\n\n// The track is 4px (h-1) and the thumb is 16px (h-4). WebKit positions the\n// thumb from the top of the track, so it needs a -6px margin to share the\n// track's centre line instead of sitting flush against its top edge. Firefox\n// centres the thumb on the track by itself.\nconst rangeInputClass = cn(\n 'pointer-events-none absolute inset-x-0 top-1/2 h-6 w-full -translate-y-1/2 appearance-none bg-transparent',\n '[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent',\n '[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-md',\n '[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent',\n '[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-md',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50'\n);\n\n/**\n * Dual-thumb range slider for numeric ranges such as revenue or EBITDA.\n * Uses two native range inputs for keyboard and screen-reader behavior, and\n * keeps the low and high thumbs from crossing. Pair it with a FilterBar or\n * FilterPanel for data dashboards.\n */\nexport const RangeSlider = React.forwardRef<HTMLDivElement, RangeSliderProps>(function RangeSlider(\n {\n value,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n startLabel = 'Minimum',\n endLabel = 'Maximum',\n formatValue = (entry) => String(entry),\n showValues = true,\n disabled = false,\n className,\n ...props\n },\n ref\n) {\n const clamp = (entry: number) => Math.min(Math.max(entry, min), max);\n const [internal, setInternal] = React.useState<[number, number]>(() => {\n const initial = defaultValue ?? [min, max];\n return [clamp(initial[0]), clamp(initial[1])];\n });\n const current = value ?? internal;\n const low = Math.min(clamp(current[0]), clamp(current[1]));\n const high = Math.max(clamp(current[0]), clamp(current[1]));\n\n const commit = (next: [number, number]) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n };\n\n const span = max - min || 1;\n const lowPercent = ((low - min) / span) * 100;\n const highPercent = ((high - min) / span) * 100;\n\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {showValues && (\n <div className=\"mb-2 flex items-center justify-between text-sm font-medium tabular-nums\">\n <span>{formatValue(low)}</span>\n <span>{formatValue(high)}</span>\n </div>\n )}\n <div className=\"relative h-6 w-full\">\n <div className=\"absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-border\" />\n <div\n className=\"absolute top-1/2 h-1 -translate-y-1/2 rounded-full bg-primary\"\n style={{ left: `${lowPercent}%`, right: `${100 - highPercent}%` }}\n />\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={low}\n disabled={disabled}\n aria-label={startLabel}\n aria-valuetext={formatValue(low)}\n onChange={(event) => commit([Math.min(Number(event.target.value), high), high])}\n className={cn(rangeInputClass, 'z-10')}\n />\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={high}\n disabled={disabled}\n aria-label={endLabel}\n aria-valuetext={formatValue(high)}\n onChange={(event) => commit([low, Math.max(Number(event.target.value), low)])}\n className={cn(rangeInputClass, 'z-20')}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";AAwFQ,SACE,KADF;AAtFR,YAAY,WAAW;AACvB,SAAS,UAAU;AA8BnB,MAAM,kBAAkB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQO,MAAM,cAAc,MAAM,WAA6C,SAASA,aACrF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,WAAW;AAAA,EACX,cAAc,CAAC,UAAU,OAAO,KAAK;AAAA,EACrC,aAAa;AAAA,EACb,WAAW;AAAA,EACX;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,QAAQ,CAAC,UAAkB,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAAG;AACnE,QAAM,CAAC,UAAU,WAAW,IAAI,MAAM,SAA2B,MAAM;AACrE,UAAM,UAAU,gBAAgB,CAAC,KAAK,GAAG;AACzC,WAAO,CAAC,MAAM,QAAQ,CAAC,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC;AAAA,EAC9C,CAAC;AACD,QAAM,UAAU,SAAS;AACzB,QAAM,MAAM,KAAK,IAAI,MAAM,QAAQ,CAAC,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC;AACzD,QAAM,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC;AAE1D,QAAM,SAAS,CAAC,SAA2B;AACzC,QA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AAAA,OACF;AAAA,KACF;AAEJ,CAAC;","names":["RangeSlider"]}
@@ -14,6 +14,11 @@ export type SelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'v
14
14
  /** Optgroups with a heading per section. Takes precedence over `options` and `children`. */
15
15
  groups?: SelectOptionGroup[];
16
16
  label?: string;
17
+ /**
18
+ * Keep the label for assistive tech but hide it visually, so the control
19
+ * lines up with sibling inputs in a filter bar or toolbar.
20
+ */
21
+ labelHidden?: boolean;
17
22
  /** Renders a disabled empty option — the native "choose one" affordance. */
18
23
  placeholder?: string;
19
24
  /** Native multi-select: value/onChange switch to string[]. */
@@ -38,6 +43,11 @@ export declare const Select: React.ForwardRefExoticComponent<Omit<React.SelectHT
38
43
  /** Optgroups with a heading per section. Takes precedence over `options` and `children`. */
39
44
  groups?: SelectOptionGroup[];
40
45
  label?: string;
46
+ /**
47
+ * Keep the label for assistive tech but hide it visually, so the control
48
+ * lines up with sibling inputs in a filter bar or toolbar.
49
+ */
50
+ labelHidden?: boolean;
41
51
  /** Renders a disabled empty option — the native "choose one" affordance. */
42
52
  placeholder?: string;
43
53
  /** Native multi-select: value/onChange switch to string[]. */
@@ -35,13 +35,13 @@ module.exports = __toCommonJS(Select_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var React = __toESM(require("react"));
37
37
  var import_cn = require("../../utils/cn.js");
38
- const Select = React.forwardRef(function Select2({ options, groups, label, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props }, ref) {
38
+ const Select = React.forwardRef(function Select2({ options, groups, label, labelHidden = false, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props }, ref) {
39
39
  const generatedId = React.useId();
40
40
  const selectId = id ?? generatedId;
41
41
  const labelId = `${selectId}-label`;
42
42
  const renderOption = (option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value);
43
43
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex w-full flex-col gap-1.5", children: [
44
- label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { id: labelId, htmlFor: selectId, className: "text-sm font-medium", children: label }),
44
+ label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { id: labelId, htmlFor: selectId, className: labelHidden ? "sr-only" : "text-sm font-medium", children: label }),
45
45
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
46
46
  "select",
47
47
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/select/Select.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type SelectOption = {\n value: string;\n label: string;\n disabled?: boolean;\n};\n\nexport type SelectOptionGroup = {\n label: string;\n options: SelectOption[];\n};\n\nexport type SelectProps = Omit<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n 'value' | 'defaultValue' | 'multiple'\n> & {\n /** Flat options. Ignored when `groups` is provided. Takes precedence over `children`. */\n options?: SelectOption[];\n /** Optgroups with a heading per section. Takes precedence over `options` and `children`. */\n groups?: SelectOptionGroup[];\n label?: string;\n /** Renders a disabled empty option — the native \"choose one\" affordance. */\n placeholder?: string;\n /** Native multi-select: value/onChange switch to string[]. */\n multiple?: boolean;\n value?: string | string[];\n defaultValue?: string | string[];\n /** Native change event - compatible with react-hook-form's register(). */\n onChange?: React.ChangeEventHandler<HTMLSelectElement>;\n /** Value-based callback for controlled usage. */\n onValueChange?: (value: string | string[]) => void;\n};\n\n/**\n * Accessible select primitive built on the native <select>: full keyboard,\n * screen-reader and mobile platform behavior comes from the platform rather\n * than a re-implemented listbox. Accepts flat `options`, `groups`, a\n * `placeholder` row, native multi-select (string[] contract), or plain\n * <option>/<optgroup> children for dynamic lists.\n */\nexport const Select = React.forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { options, groups, label, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props },\n ref,\n) {\n const generatedId = React.useId();\n const selectId = id ?? generatedId;\n const labelId = `${selectId}-label`;\n\n const renderOption = (option: SelectOption) => (\n <option key={option.value} value={option.value} disabled={option.disabled}>\n {option.label}\n </option>\n );\n\n return (\n <div className=\"flex w-full flex-col gap-1.5\">\n {label && (\n <label id={labelId} htmlFor={selectId} className=\"text-sm font-medium\">\n {label}\n </label>\n )}\n <select\n ref={ref}\n id={selectId}\n multiple={multiple}\n aria-labelledby={label ? labelId : undefined}\n className={cn(\n 'w-full rounded-md border border-input bg-background px-3 py-2 text-sm',\n multiple && 'min-h-32',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20',\n className\n )}\n value={value as string | string[] | undefined}\n defaultValue={defaultValue as string | string[] | undefined}\n onChange={(event) => {\n const next = multiple\n ? Array.from(event.target.selectedOptions, (option) => option.value)\n : event.target.value;\n onChange?.(event);\n onValueChange?.(next);\n }}\n {...props}\n >\n {placeholder && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {groups\n ? groups.map((group) => (\n <optgroup key={group.label} label={group.label}>\n {group.options.map(renderOption)}\n </optgroup>\n ))\n : options\n ? options.map(renderOption)\n : children}\n </select>\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqDI;AAnDJ,YAAuB;AACvB,gBAAmB;AAyCZ,MAAM,SAAS,MAAM,WAA2C,SAASA,QAC9E,EAAE,SAAS,QAAQ,OAAO,aAAa,WAAW,OAAO,OAAO,cAAc,UAAU,eAAe,UAAU,IAAI,WAAW,GAAG,MAAM,GACzI,KACA;AACA,QAAM,cAAc,MAAM,MAAM;AAChC,QAAM,WAAW,MAAM;AACvB,QAAM,UAAU,GAAG,QAAQ;AAE3B,QAAM,eAAe,CAAC,WACpB,4CAAC,YAA0B,OAAO,OAAO,OAAO,UAAU,OAAO,UAC9D,iBAAO,SADG,OAAO,KAEpB;AAGF,SACE,6CAAC,SAAI,WAAU,gCACZ;AAAA,aACC,4CAAC,WAAM,IAAI,SAAS,SAAS,UAAU,WAAU,uBAC9C,iBACH;AAAA,IAEF;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,IAAI;AAAA,QACJ;AAAA,QACA,mBAAiB,QAAQ,UAAU;AAAA,QACnC,eAAW;AAAA,UACT;AAAA,UACA,YAAY;AAAA,UACZ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,CAAC,UAAU;AACnB,gBAAM,OAAO,WACT,MAAM,KAAK,MAAM,OAAO,iBAAiB,CAAC,WAAW,OAAO,KAAK,IACjE,MAAM,OAAO;AACjB,qBAAW,KAAK;AAChB,0BAAgB,IAAI;AAAA,QACtB;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,yBACC,4CAAC,YAAO,OAAM,IAAG,UAAQ,MACtB,uBACH;AAAA,UAED,SACG,OAAO,IAAI,CAAC,UACV,4CAAC,cAA2B,OAAO,MAAM,OACtC,gBAAM,QAAQ,IAAI,YAAY,KADlB,MAAM,KAErB,CACD,IACD,UACE,QAAQ,IAAI,YAAY,IACxB;AAAA;AAAA;AAAA,IACR;AAAA,KACF;AAEJ,CAAC;","names":["Select"]}
1
+ {"version":3,"sources":["../../../../src/components/select/Select.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type SelectOption = {\n value: string;\n label: string;\n disabled?: boolean;\n};\n\nexport type SelectOptionGroup = {\n label: string;\n options: SelectOption[];\n};\n\nexport type SelectProps = Omit<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n 'value' | 'defaultValue' | 'multiple'\n> & {\n /** Flat options. Ignored when `groups` is provided. Takes precedence over `children`. */\n options?: SelectOption[];\n /** Optgroups with a heading per section. Takes precedence over `options` and `children`. */\n groups?: SelectOptionGroup[];\n label?: string;\n /**\n * Keep the label for assistive tech but hide it visually, so the control\n * lines up with sibling inputs in a filter bar or toolbar.\n */\n labelHidden?: boolean;\n /** Renders a disabled empty option — the native \"choose one\" affordance. */\n placeholder?: string;\n /** Native multi-select: value/onChange switch to string[]. */\n multiple?: boolean;\n value?: string | string[];\n defaultValue?: string | string[];\n /** Native change event - compatible with react-hook-form's register(). */\n onChange?: React.ChangeEventHandler<HTMLSelectElement>;\n /** Value-based callback for controlled usage. */\n onValueChange?: (value: string | string[]) => void;\n};\n\n/**\n * Accessible select primitive built on the native <select>: full keyboard,\n * screen-reader and mobile platform behavior comes from the platform rather\n * than a re-implemented listbox. Accepts flat `options`, `groups`, a\n * `placeholder` row, native multi-select (string[] contract), or plain\n * <option>/<optgroup> children for dynamic lists.\n */\nexport const Select = React.forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { options, groups, label, labelHidden = false, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props },\n ref,\n) {\n const generatedId = React.useId();\n const selectId = id ?? generatedId;\n const labelId = `${selectId}-label`;\n\n const renderOption = (option: SelectOption) => (\n <option key={option.value} value={option.value} disabled={option.disabled}>\n {option.label}\n </option>\n );\n\n return (\n <div className=\"flex w-full flex-col gap-1.5\">\n {label && (\n <label id={labelId} htmlFor={selectId} className={labelHidden ? 'sr-only' : 'text-sm font-medium'}>\n {label}\n </label>\n )}\n <select\n ref={ref}\n id={selectId}\n multiple={multiple}\n aria-labelledby={label ? labelId : undefined}\n className={cn(\n 'w-full rounded-md border border-input bg-background px-3 py-2 text-sm',\n multiple && 'min-h-32',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20',\n className\n )}\n value={value as string | string[] | undefined}\n defaultValue={defaultValue as string | string[] | undefined}\n onChange={(event) => {\n const next = multiple\n ? Array.from(event.target.selectedOptions, (option) => option.value)\n : event.target.value;\n onChange?.(event);\n onValueChange?.(next);\n }}\n {...props}\n >\n {placeholder && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {groups\n ? groups.map((group) => (\n <optgroup key={group.label} label={group.label}>\n {group.options.map(renderOption)}\n </optgroup>\n ))\n : options\n ? options.map(renderOption)\n : children}\n </select>\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0DI;AAxDJ,YAAuB;AACvB,gBAAmB;AA8CZ,MAAM,SAAS,MAAM,WAA2C,SAASA,QAC9E,EAAE,SAAS,QAAQ,OAAO,cAAc,OAAO,aAAa,WAAW,OAAO,OAAO,cAAc,UAAU,eAAe,UAAU,IAAI,WAAW,GAAG,MAAM,GAC9J,KACA;AACA,QAAM,cAAc,MAAM,MAAM;AAChC,QAAM,WAAW,MAAM;AACvB,QAAM,UAAU,GAAG,QAAQ;AAE3B,QAAM,eAAe,CAAC,WACpB,4CAAC,YAA0B,OAAO,OAAO,OAAO,UAAU,OAAO,UAC9D,iBAAO,SADG,OAAO,KAEpB;AAGF,SACE,6CAAC,SAAI,WAAU,gCACZ;AAAA,aACC,4CAAC,WAAM,IAAI,SAAS,SAAS,UAAU,WAAW,cAAc,YAAY,uBACzE,iBACH;AAAA,IAEF;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,IAAI;AAAA,QACJ;AAAA,QACA,mBAAiB,QAAQ,UAAU;AAAA,QACnC,eAAW;AAAA,UACT;AAAA,UACA,YAAY;AAAA,UACZ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,CAAC,UAAU;AACnB,gBAAM,OAAO,WACT,MAAM,KAAK,MAAM,OAAO,iBAAiB,CAAC,WAAW,OAAO,KAAK,IACjE,MAAM,OAAO;AACjB,qBAAW,KAAK;AAChB,0BAAgB,IAAI;AAAA,QACtB;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,yBACC,4CAAC,YAAO,OAAM,IAAG,UAAQ,MACtB,uBACH;AAAA,UAED,SACG,OAAO,IAAI,CAAC,UACV,4CAAC,cAA2B,OAAO,MAAM,OACtC,gBAAM,QAAQ,IAAI,YAAY,KADlB,MAAM,KAErB,CACD,IACD,UACE,QAAQ,IAAI,YAAY,IACxB;AAAA;AAAA;AAAA,IACR;AAAA,KACF;AAEJ,CAAC;","names":["Select"]}
@@ -2,13 +2,13 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { cn } from "../../utils/cn.mjs";
5
- const Select = React.forwardRef(function Select2({ options, groups, label, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props }, ref) {
5
+ const Select = React.forwardRef(function Select2({ options, groups, label, labelHidden = false, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props }, ref) {
6
6
  const generatedId = React.useId();
7
7
  const selectId = id ?? generatedId;
8
8
  const labelId = `${selectId}-label`;
9
9
  const renderOption = (option) => /* @__PURE__ */ jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value);
10
10
  return /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-1.5", children: [
11
- label && /* @__PURE__ */ jsx("label", { id: labelId, htmlFor: selectId, className: "text-sm font-medium", children: label }),
11
+ label && /* @__PURE__ */ jsx("label", { id: labelId, htmlFor: selectId, className: labelHidden ? "sr-only" : "text-sm font-medium", children: label }),
12
12
  /* @__PURE__ */ jsxs(
13
13
  "select",
14
14
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/select/Select.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type SelectOption = {\n value: string;\n label: string;\n disabled?: boolean;\n};\n\nexport type SelectOptionGroup = {\n label: string;\n options: SelectOption[];\n};\n\nexport type SelectProps = Omit<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n 'value' | 'defaultValue' | 'multiple'\n> & {\n /** Flat options. Ignored when `groups` is provided. Takes precedence over `children`. */\n options?: SelectOption[];\n /** Optgroups with a heading per section. Takes precedence over `options` and `children`. */\n groups?: SelectOptionGroup[];\n label?: string;\n /** Renders a disabled empty option — the native \"choose one\" affordance. */\n placeholder?: string;\n /** Native multi-select: value/onChange switch to string[]. */\n multiple?: boolean;\n value?: string | string[];\n defaultValue?: string | string[];\n /** Native change event - compatible with react-hook-form's register(). */\n onChange?: React.ChangeEventHandler<HTMLSelectElement>;\n /** Value-based callback for controlled usage. */\n onValueChange?: (value: string | string[]) => void;\n};\n\n/**\n * Accessible select primitive built on the native <select>: full keyboard,\n * screen-reader and mobile platform behavior comes from the platform rather\n * than a re-implemented listbox. Accepts flat `options`, `groups`, a\n * `placeholder` row, native multi-select (string[] contract), or plain\n * <option>/<optgroup> children for dynamic lists.\n */\nexport const Select = React.forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { options, groups, label, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props },\n ref,\n) {\n const generatedId = React.useId();\n const selectId = id ?? generatedId;\n const labelId = `${selectId}-label`;\n\n const renderOption = (option: SelectOption) => (\n <option key={option.value} value={option.value} disabled={option.disabled}>\n {option.label}\n </option>\n );\n\n return (\n <div className=\"flex w-full flex-col gap-1.5\">\n {label && (\n <label id={labelId} htmlFor={selectId} className=\"text-sm font-medium\">\n {label}\n </label>\n )}\n <select\n ref={ref}\n id={selectId}\n multiple={multiple}\n aria-labelledby={label ? labelId : undefined}\n className={cn(\n 'w-full rounded-md border border-input bg-background px-3 py-2 text-sm',\n multiple && 'min-h-32',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20',\n className\n )}\n value={value as string | string[] | undefined}\n defaultValue={defaultValue as string | string[] | undefined}\n onChange={(event) => {\n const next = multiple\n ? Array.from(event.target.selectedOptions, (option) => option.value)\n : event.target.value;\n onChange?.(event);\n onValueChange?.(next);\n }}\n {...props}\n >\n {placeholder && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {groups\n ? groups.map((group) => (\n <optgroup key={group.label} label={group.label}>\n {group.options.map(renderOption)}\n </optgroup>\n ))\n : options\n ? options.map(renderOption)\n : children}\n </select>\n </div>\n );\n});\n"],"mappings":";AAqDI,cAYE,YAZF;AAnDJ,YAAY,WAAW;AACvB,SAAS,UAAU;AAyCZ,MAAM,SAAS,MAAM,WAA2C,SAASA,QAC9E,EAAE,SAAS,QAAQ,OAAO,aAAa,WAAW,OAAO,OAAO,cAAc,UAAU,eAAe,UAAU,IAAI,WAAW,GAAG,MAAM,GACzI,KACA;AACA,QAAM,cAAc,MAAM,MAAM;AAChC,QAAM,WAAW,MAAM;AACvB,QAAM,UAAU,GAAG,QAAQ;AAE3B,QAAM,eAAe,CAAC,WACpB,oBAAC,YAA0B,OAAO,OAAO,OAAO,UAAU,OAAO,UAC9D,iBAAO,SADG,OAAO,KAEpB;AAGF,SACE,qBAAC,SAAI,WAAU,gCACZ;AAAA,aACC,oBAAC,WAAM,IAAI,SAAS,SAAS,UAAU,WAAU,uBAC9C,iBACH;AAAA,IAEF;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,IAAI;AAAA,QACJ;AAAA,QACA,mBAAiB,QAAQ,UAAU;AAAA,QACnC,WAAW;AAAA,UACT;AAAA,UACA,YAAY;AAAA,UACZ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,CAAC,UAAU;AACnB,gBAAM,OAAO,WACT,MAAM,KAAK,MAAM,OAAO,iBAAiB,CAAC,WAAW,OAAO,KAAK,IACjE,MAAM,OAAO;AACjB,qBAAW,KAAK;AAChB,0BAAgB,IAAI;AAAA,QACtB;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,yBACC,oBAAC,YAAO,OAAM,IAAG,UAAQ,MACtB,uBACH;AAAA,UAED,SACG,OAAO,IAAI,CAAC,UACV,oBAAC,cAA2B,OAAO,MAAM,OACtC,gBAAM,QAAQ,IAAI,YAAY,KADlB,MAAM,KAErB,CACD,IACD,UACE,QAAQ,IAAI,YAAY,IACxB;AAAA;AAAA;AAAA,IACR;AAAA,KACF;AAEJ,CAAC;","names":["Select"]}
1
+ {"version":3,"sources":["../../../../src/components/select/Select.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type SelectOption = {\n value: string;\n label: string;\n disabled?: boolean;\n};\n\nexport type SelectOptionGroup = {\n label: string;\n options: SelectOption[];\n};\n\nexport type SelectProps = Omit<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n 'value' | 'defaultValue' | 'multiple'\n> & {\n /** Flat options. Ignored when `groups` is provided. Takes precedence over `children`. */\n options?: SelectOption[];\n /** Optgroups with a heading per section. Takes precedence over `options` and `children`. */\n groups?: SelectOptionGroup[];\n label?: string;\n /**\n * Keep the label for assistive tech but hide it visually, so the control\n * lines up with sibling inputs in a filter bar or toolbar.\n */\n labelHidden?: boolean;\n /** Renders a disabled empty option — the native \"choose one\" affordance. */\n placeholder?: string;\n /** Native multi-select: value/onChange switch to string[]. */\n multiple?: boolean;\n value?: string | string[];\n defaultValue?: string | string[];\n /** Native change event - compatible with react-hook-form's register(). */\n onChange?: React.ChangeEventHandler<HTMLSelectElement>;\n /** Value-based callback for controlled usage. */\n onValueChange?: (value: string | string[]) => void;\n};\n\n/**\n * Accessible select primitive built on the native <select>: full keyboard,\n * screen-reader and mobile platform behavior comes from the platform rather\n * than a re-implemented listbox. Accepts flat `options`, `groups`, a\n * `placeholder` row, native multi-select (string[] contract), or plain\n * <option>/<optgroup> children for dynamic lists.\n */\nexport const Select = React.forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { options, groups, label, labelHidden = false, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props },\n ref,\n) {\n const generatedId = React.useId();\n const selectId = id ?? generatedId;\n const labelId = `${selectId}-label`;\n\n const renderOption = (option: SelectOption) => (\n <option key={option.value} value={option.value} disabled={option.disabled}>\n {option.label}\n </option>\n );\n\n return (\n <div className=\"flex w-full flex-col gap-1.5\">\n {label && (\n <label id={labelId} htmlFor={selectId} className={labelHidden ? 'sr-only' : 'text-sm font-medium'}>\n {label}\n </label>\n )}\n <select\n ref={ref}\n id={selectId}\n multiple={multiple}\n aria-labelledby={label ? labelId : undefined}\n className={cn(\n 'w-full rounded-md border border-input bg-background px-3 py-2 text-sm',\n multiple && 'min-h-32',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20',\n className\n )}\n value={value as string | string[] | undefined}\n defaultValue={defaultValue as string | string[] | undefined}\n onChange={(event) => {\n const next = multiple\n ? Array.from(event.target.selectedOptions, (option) => option.value)\n : event.target.value;\n onChange?.(event);\n onValueChange?.(next);\n }}\n {...props}\n >\n {placeholder && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {groups\n ? groups.map((group) => (\n <optgroup key={group.label} label={group.label}>\n {group.options.map(renderOption)}\n </optgroup>\n ))\n : options\n ? options.map(renderOption)\n : children}\n </select>\n </div>\n );\n});\n"],"mappings":";AA0DI,cAYE,YAZF;AAxDJ,YAAY,WAAW;AACvB,SAAS,UAAU;AA8CZ,MAAM,SAAS,MAAM,WAA2C,SAASA,QAC9E,EAAE,SAAS,QAAQ,OAAO,cAAc,OAAO,aAAa,WAAW,OAAO,OAAO,cAAc,UAAU,eAAe,UAAU,IAAI,WAAW,GAAG,MAAM,GAC9J,KACA;AACA,QAAM,cAAc,MAAM,MAAM;AAChC,QAAM,WAAW,MAAM;AACvB,QAAM,UAAU,GAAG,QAAQ;AAE3B,QAAM,eAAe,CAAC,WACpB,oBAAC,YAA0B,OAAO,OAAO,OAAO,UAAU,OAAO,UAC9D,iBAAO,SADG,OAAO,KAEpB;AAGF,SACE,qBAAC,SAAI,WAAU,gCACZ;AAAA,aACC,oBAAC,WAAM,IAAI,SAAS,SAAS,UAAU,WAAW,cAAc,YAAY,uBACzE,iBACH;AAAA,IAEF;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,IAAI;AAAA,QACJ;AAAA,QACA,mBAAiB,QAAQ,UAAU;AAAA,QACnC,WAAW;AAAA,UACT;AAAA,UACA,YAAY;AAAA,UACZ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,CAAC,UAAU;AACnB,gBAAM,OAAO,WACT,MAAM,KAAK,MAAM,OAAO,iBAAiB,CAAC,WAAW,OAAO,KAAK,IACjE,MAAM,OAAO;AACjB,qBAAW,KAAK;AAChB,0BAAgB,IAAI;AAAA,QACtB;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,yBACC,oBAAC,YAAO,OAAM,IAAG,UAAQ,MACtB,uBACH;AAAA,UAED,SACG,OAAO,IAAI,CAAC,UACV,oBAAC,cAA2B,OAAO,MAAM,OACtC,gBAAM,QAAQ,IAAI,YAAY,KADlB,MAAM,KAErB,CACD,IACD,UACE,QAAQ,IAAI,YAAY,IACxB;AAAA;AAAA;AAAA,IACR;AAAA,KACF;AAEJ,CAAC;","names":["Select"]}
@@ -36,19 +36,23 @@ var React = __toESM(require("react"));
36
36
  var import_cn = require("../../utils/cn.js");
37
37
  const Timeline = React.forwardRef(function Timeline2({ items, className, ...props }, ref) {
38
38
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { ref, className: (0, import_cn.cn)("relative flex flex-col gap-6", className), ...props, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: "relative flex gap-4", children: [
39
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-center", children: [
40
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
41
- "span",
42
- {
43
- "aria-hidden": "true",
44
- className: (0, import_cn.cn)(
45
- "mt-1 flex h-3 w-3 shrink-0 items-center justify-center rounded-full border-2",
46
- item.muted ? "border-border bg-background" : "border-primary bg-primary"
47
- )
48
- }
49
- ),
50
- index < items.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", className: "mt-1 w-px flex-1 bg-border" })
51
- ] }),
39
+ index < items.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
40
+ "span",
41
+ {
42
+ "aria-hidden": "true",
43
+ className: "absolute left-[5.5px] top-4 -bottom-7 w-px bg-border"
44
+ }
45
+ ),
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative z-10 flex flex-col items-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ "span",
48
+ {
49
+ "aria-hidden": "true",
50
+ className: (0, import_cn.cn)(
51
+ "mt-1 flex h-3 w-3 shrink-0 items-center justify-center rounded-full border-2",
52
+ item.muted ? "border-border bg-background" : "border-primary bg-primary"
53
+ )
54
+ }
55
+ ) }),
52
56
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 pb-1", children: [
53
57
  item.period && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: item.period }),
54
58
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: (0, import_cn.cn)("text-sm font-semibold", item.muted && "text-muted-foreground"), children: item.title }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/timeline/Timeline.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type TimelineItem = {\n title: string;\n /** Period/date label (e.g. \"2023 — Present\"). */\n period?: string;\n description?: string;\n icon?: React.ReactNode;\n /** Muted items render dimmed (upcoming/archived). */\n muted?: boolean;\n};\n\nexport type TimelineProps = Omit<React.OlHTMLAttributes<HTMLOListElement>, 'children'> & {\n items: TimelineItem[];\n};\n\n/**\n * Vertical chronology (experience, activity, audit trail). Renders an\n * ordered list with a connector rule, so the sequence is conveyed\n * structurally instead of by decoration alone.\n */\nexport const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(function Timeline(\n { items, className, ...props },\n ref\n) {\n return (\n <ol ref={ref} className={cn('relative flex flex-col gap-6', className)} {...props}>\n {items.map((item, index) => (\n <li key={`${item.title}-${index}`} className=\"relative flex gap-4\">\n <div className=\"flex flex-col items-center\">\n <span\n aria-hidden=\"true\"\n className={cn(\n 'mt-1 flex h-3 w-3 shrink-0 items-center justify-center rounded-full border-2',\n item.muted ? 'border-border bg-background' : 'border-primary bg-primary'\n )}\n />\n {index < items.length - 1 && <span aria-hidden=\"true\" className=\"mt-1 w-px flex-1 bg-border\" />}\n </div>\n <div className=\"min-w-0 pb-1\">\n {item.period && (\n <p className=\"text-xs font-medium uppercase tracking-wide text-muted-foreground\">{item.period}</p>\n )}\n <p className={cn('text-sm font-semibold', item.muted && 'text-muted-foreground')}>{item.title}</p>\n {item.description && <p className=\"mt-1 text-sm text-muted-foreground\">{item.description}</p>}\n {item.icon && <div className=\"mt-1 text-muted-foreground [&_svg]:size-4\">{item.icon}</div>}\n </div>\n </li>\n ))}\n </ol>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BU;AA9BV,YAAuB;AACvB,gBAAmB;AAqBZ,MAAM,WAAW,MAAM,WAA4C,SAASA,UACjF,EAAE,OAAO,WAAW,GAAG,MAAM,GAC7B,KACA;AACA,SACE,4CAAC,QAAG,KAAU,eAAW,cAAG,gCAAgC,SAAS,GAAI,GAAG,OACzE,gBAAM,IAAI,CAAC,MAAM,UAChB,6CAAC,QAAkC,WAAU,uBAC3C;AAAA,iDAAC,SAAI,WAAU,8BACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,eAAY;AAAA,UACZ,eAAW;AAAA,YACT;AAAA,YACA,KAAK,QAAQ,gCAAgC;AAAA,UAC/C;AAAA;AAAA,MACF;AAAA,MACC,QAAQ,MAAM,SAAS,KAAK,4CAAC,UAAK,eAAY,QAAO,WAAU,8BAA6B;AAAA,OAC/F;AAAA,IACA,6CAAC,SAAI,WAAU,gBACZ;AAAA,WAAK,UACJ,4CAAC,OAAE,WAAU,qEAAqE,eAAK,QAAO;AAAA,MAEhG,4CAAC,OAAE,eAAW,cAAG,yBAAyB,KAAK,SAAS,uBAAuB,GAAI,eAAK,OAAM;AAAA,MAC7F,KAAK,eAAe,4CAAC,OAAE,WAAU,sCAAsC,eAAK,aAAY;AAAA,MACxF,KAAK,QAAQ,4CAAC,SAAI,WAAU,6CAA6C,eAAK,MAAK;AAAA,OACtF;AAAA,OAlBO,GAAG,KAAK,KAAK,IAAI,KAAK,EAmB/B,CACD,GACH;AAEJ,CAAC;","names":["Timeline"]}
1
+ {"version":3,"sources":["../../../../src/components/timeline/Timeline.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type TimelineItem = {\n title: string;\n /** Period/date label (e.g. \"2023 — Present\"). */\n period?: string;\n description?: string;\n icon?: React.ReactNode;\n /** Muted items render dimmed (upcoming/archived). */\n muted?: boolean;\n};\n\nexport type TimelineProps = Omit<React.OlHTMLAttributes<HTMLOListElement>, 'children'> & {\n items: TimelineItem[];\n};\n\n/**\n * Vertical chronology (experience, activity, audit trail). Renders an\n * ordered list with a connector rule, so the sequence is conveyed\n * structurally instead of by decoration alone.\n */\nexport const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(function Timeline(\n { items, className, ...props },\n ref\n) {\n return (\n <ol ref={ref} className={cn('relative flex flex-col gap-6', className)} {...props}>\n {items.map((item, index) => (\n <li key={`${item.title}-${index}`} className=\"relative flex gap-4\">\n {/*\n One rail per item, absolutely positioned so it starts at the dot's\n bottom edge and runs through the list gap into the next dot. A\n flex-column connector stops at the item box, which left a visible\n break at every item boundary.\n */}\n {index < items.length - 1 && (\n <span\n aria-hidden=\"true\"\n className=\"absolute left-[5.5px] top-4 -bottom-7 w-px bg-border\"\n />\n )}\n <div className=\"relative z-10 flex flex-col items-center\">\n <span\n aria-hidden=\"true\"\n className={cn(\n 'mt-1 flex h-3 w-3 shrink-0 items-center justify-center rounded-full border-2',\n item.muted ? 'border-border bg-background' : 'border-primary bg-primary'\n )}\n />\n </div>\n <div className=\"min-w-0 pb-1\">\n {item.period && (\n <p className=\"text-xs font-medium uppercase tracking-wide text-muted-foreground\">{item.period}</p>\n )}\n <p className={cn('text-sm font-semibold', item.muted && 'text-muted-foreground')}>{item.title}</p>\n {item.description && <p className=\"mt-1 text-sm text-muted-foreground\">{item.description}</p>}\n {item.icon && <div className=\"mt-1 text-muted-foreground [&_svg]:size-4\">{item.icon}</div>}\n </div>\n </li>\n ))}\n </ol>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCY;AArCZ,YAAuB;AACvB,gBAAmB;AAqBZ,MAAM,WAAW,MAAM,WAA4C,SAASA,UACjF,EAAE,OAAO,WAAW,GAAG,MAAM,GAC7B,KACA;AACA,SACE,4CAAC,QAAG,KAAU,eAAW,cAAG,gCAAgC,SAAS,GAAI,GAAG,OACzE,gBAAM,IAAI,CAAC,MAAM,UAChB,6CAAC,QAAkC,WAAU,uBAO1C;AAAA,YAAQ,MAAM,SAAS,KACtB;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,WAAU;AAAA;AAAA,IACZ;AAAA,IAEF,4CAAC,SAAI,WAAU,4CACb;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,eAAW;AAAA,UACT;AAAA,UACA,KAAK,QAAQ,gCAAgC;AAAA,QAC/C;AAAA;AAAA,IACF,GACF;AAAA,IACA,6CAAC,SAAI,WAAU,gBACZ;AAAA,WAAK,UACJ,4CAAC,OAAE,WAAU,qEAAqE,eAAK,QAAO;AAAA,MAEhG,4CAAC,OAAE,eAAW,cAAG,yBAAyB,KAAK,SAAS,uBAAuB,GAAI,eAAK,OAAM;AAAA,MAC7F,KAAK,eAAe,4CAAC,OAAE,WAAU,sCAAsC,eAAK,aAAY;AAAA,MACxF,KAAK,QAAQ,4CAAC,SAAI,WAAU,6CAA6C,eAAK,MAAK;AAAA,OACtF;AAAA,OA7BO,GAAG,KAAK,KAAK,IAAI,KAAK,EA8B/B,CACD,GACH;AAEJ,CAAC;","names":["Timeline"]}
@@ -3,19 +3,23 @@ import * as React from "react";
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  const Timeline = React.forwardRef(function Timeline2({ items, className, ...props }, ref) {
5
5
  return /* @__PURE__ */ jsx("ol", { ref, className: cn("relative flex flex-col gap-6", className), ...props, children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "relative flex gap-4", children: [
6
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
7
- /* @__PURE__ */ jsx(
8
- "span",
9
- {
10
- "aria-hidden": "true",
11
- className: cn(
12
- "mt-1 flex h-3 w-3 shrink-0 items-center justify-center rounded-full border-2",
13
- item.muted ? "border-border bg-background" : "border-primary bg-primary"
14
- )
15
- }
16
- ),
17
- index < items.length - 1 && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "mt-1 w-px flex-1 bg-border" })
18
- ] }),
6
+ index < items.length - 1 && /* @__PURE__ */ jsx(
7
+ "span",
8
+ {
9
+ "aria-hidden": "true",
10
+ className: "absolute left-[5.5px] top-4 -bottom-7 w-px bg-border"
11
+ }
12
+ ),
13
+ /* @__PURE__ */ jsx("div", { className: "relative z-10 flex flex-col items-center", children: /* @__PURE__ */ jsx(
14
+ "span",
15
+ {
16
+ "aria-hidden": "true",
17
+ className: cn(
18
+ "mt-1 flex h-3 w-3 shrink-0 items-center justify-center rounded-full border-2",
19
+ item.muted ? "border-border bg-background" : "border-primary bg-primary"
20
+ )
21
+ }
22
+ ) }),
19
23
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 pb-1", children: [
20
24
  item.period && /* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: item.period }),
21
25
  /* @__PURE__ */ jsx("p", { className: cn("text-sm font-semibold", item.muted && "text-muted-foreground"), children: item.title }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/timeline/Timeline.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type TimelineItem = {\n title: string;\n /** Period/date label (e.g. \"2023 — Present\"). */\n period?: string;\n description?: string;\n icon?: React.ReactNode;\n /** Muted items render dimmed (upcoming/archived). */\n muted?: boolean;\n};\n\nexport type TimelineProps = Omit<React.OlHTMLAttributes<HTMLOListElement>, 'children'> & {\n items: TimelineItem[];\n};\n\n/**\n * Vertical chronology (experience, activity, audit trail). Renders an\n * ordered list with a connector rule, so the sequence is conveyed\n * structurally instead of by decoration alone.\n */\nexport const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(function Timeline(\n { items, className, ...props },\n ref\n) {\n return (\n <ol ref={ref} className={cn('relative flex flex-col gap-6', className)} {...props}>\n {items.map((item, index) => (\n <li key={`${item.title}-${index}`} className=\"relative flex gap-4\">\n <div className=\"flex flex-col items-center\">\n <span\n aria-hidden=\"true\"\n className={cn(\n 'mt-1 flex h-3 w-3 shrink-0 items-center justify-center rounded-full border-2',\n item.muted ? 'border-border bg-background' : 'border-primary bg-primary'\n )}\n />\n {index < items.length - 1 && <span aria-hidden=\"true\" className=\"mt-1 w-px flex-1 bg-border\" />}\n </div>\n <div className=\"min-w-0 pb-1\">\n {item.period && (\n <p className=\"text-xs font-medium uppercase tracking-wide text-muted-foreground\">{item.period}</p>\n )}\n <p className={cn('text-sm font-semibold', item.muted && 'text-muted-foreground')}>{item.title}</p>\n {item.description && <p className=\"mt-1 text-sm text-muted-foreground\">{item.description}</p>}\n {item.icon && <div className=\"mt-1 text-muted-foreground [&_svg]:size-4\">{item.icon}</div>}\n </div>\n </li>\n ))}\n </ol>\n );\n});\n"],"mappings":"AA8BU,SACE,KADF;AA9BV,YAAY,WAAW;AACvB,SAAS,UAAU;AAqBZ,MAAM,WAAW,MAAM,WAA4C,SAASA,UACjF,EAAE,OAAO,WAAW,GAAG,MAAM,GAC7B,KACA;AACA,SACE,oBAAC,QAAG,KAAU,WAAW,GAAG,gCAAgC,SAAS,GAAI,GAAG,OACzE,gBAAM,IAAI,CAAC,MAAM,UAChB,qBAAC,QAAkC,WAAU,uBAC3C;AAAA,yBAAC,SAAI,WAAU,8BACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,eAAY;AAAA,UACZ,WAAW;AAAA,YACT;AAAA,YACA,KAAK,QAAQ,gCAAgC;AAAA,UAC/C;AAAA;AAAA,MACF;AAAA,MACC,QAAQ,MAAM,SAAS,KAAK,oBAAC,UAAK,eAAY,QAAO,WAAU,8BAA6B;AAAA,OAC/F;AAAA,IACA,qBAAC,SAAI,WAAU,gBACZ;AAAA,WAAK,UACJ,oBAAC,OAAE,WAAU,qEAAqE,eAAK,QAAO;AAAA,MAEhG,oBAAC,OAAE,WAAW,GAAG,yBAAyB,KAAK,SAAS,uBAAuB,GAAI,eAAK,OAAM;AAAA,MAC7F,KAAK,eAAe,oBAAC,OAAE,WAAU,sCAAsC,eAAK,aAAY;AAAA,MACxF,KAAK,QAAQ,oBAAC,SAAI,WAAU,6CAA6C,eAAK,MAAK;AAAA,OACtF;AAAA,OAlBO,GAAG,KAAK,KAAK,IAAI,KAAK,EAmB/B,CACD,GACH;AAEJ,CAAC;","names":["Timeline"]}
1
+ {"version":3,"sources":["../../../../src/components/timeline/Timeline.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type TimelineItem = {\n title: string;\n /** Period/date label (e.g. \"2023 — Present\"). */\n period?: string;\n description?: string;\n icon?: React.ReactNode;\n /** Muted items render dimmed (upcoming/archived). */\n muted?: boolean;\n};\n\nexport type TimelineProps = Omit<React.OlHTMLAttributes<HTMLOListElement>, 'children'> & {\n items: TimelineItem[];\n};\n\n/**\n * Vertical chronology (experience, activity, audit trail). Renders an\n * ordered list with a connector rule, so the sequence is conveyed\n * structurally instead of by decoration alone.\n */\nexport const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(function Timeline(\n { items, className, ...props },\n ref\n) {\n return (\n <ol ref={ref} className={cn('relative flex flex-col gap-6', className)} {...props}>\n {items.map((item, index) => (\n <li key={`${item.title}-${index}`} className=\"relative flex gap-4\">\n {/*\n One rail per item, absolutely positioned so it starts at the dot's\n bottom edge and runs through the list gap into the next dot. A\n flex-column connector stops at the item box, which left a visible\n break at every item boundary.\n */}\n {index < items.length - 1 && (\n <span\n aria-hidden=\"true\"\n className=\"absolute left-[5.5px] top-4 -bottom-7 w-px bg-border\"\n />\n )}\n <div className=\"relative z-10 flex flex-col items-center\">\n <span\n aria-hidden=\"true\"\n className={cn(\n 'mt-1 flex h-3 w-3 shrink-0 items-center justify-center rounded-full border-2',\n item.muted ? 'border-border bg-background' : 'border-primary bg-primary'\n )}\n />\n </div>\n <div className=\"min-w-0 pb-1\">\n {item.period && (\n <p className=\"text-xs font-medium uppercase tracking-wide text-muted-foreground\">{item.period}</p>\n )}\n <p className={cn('text-sm font-semibold', item.muted && 'text-muted-foreground')}>{item.title}</p>\n {item.description && <p className=\"mt-1 text-sm text-muted-foreground\">{item.description}</p>}\n {item.icon && <div className=\"mt-1 text-muted-foreground [&_svg]:size-4\">{item.icon}</div>}\n </div>\n </li>\n ))}\n </ol>\n );\n});\n"],"mappings":"AAqCY,cAcF,YAdE;AArCZ,YAAY,WAAW;AACvB,SAAS,UAAU;AAqBZ,MAAM,WAAW,MAAM,WAA4C,SAASA,UACjF,EAAE,OAAO,WAAW,GAAG,MAAM,GAC7B,KACA;AACA,SACE,oBAAC,QAAG,KAAU,WAAW,GAAG,gCAAgC,SAAS,GAAI,GAAG,OACzE,gBAAM,IAAI,CAAC,MAAM,UAChB,qBAAC,QAAkC,WAAU,uBAO1C;AAAA,YAAQ,MAAM,SAAS,KACtB;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,WAAU;AAAA;AAAA,IACZ;AAAA,IAEF,oBAAC,SAAI,WAAU,4CACb;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA,KAAK,QAAQ,gCAAgC;AAAA,QAC/C;AAAA;AAAA,IACF,GACF;AAAA,IACA,qBAAC,SAAI,WAAU,gBACZ;AAAA,WAAK,UACJ,oBAAC,OAAE,WAAU,qEAAqE,eAAK,QAAO;AAAA,MAEhG,oBAAC,OAAE,WAAW,GAAG,yBAAyB,KAAK,SAAS,uBAAuB,GAAI,eAAK,OAAM;AAAA,MAC7F,KAAK,eAAe,oBAAC,OAAE,WAAU,sCAAsC,eAAK,aAAY;AAAA,MACxF,KAAK,QAAQ,oBAAC,SAAI,WAAU,6CAA6C,eAAK,MAAK;AAAA,OACtF;AAAA,OA7BO,GAAG,KAAK,KAAK,IAAI,KAAK,EA8B/B,CACD,GACH;AAEJ,CAAC;","names":["Timeline"]}
@@ -6,6 +6,11 @@ export type TooltipProps = {
6
6
  side?: 'top' | 'bottom' | 'left' | 'right';
7
7
  /** Delay before showing on hover, in milliseconds. */
8
8
  delay?: number;
9
+ /**
10
+ * Bubble palette. `default` uses the popover surface; `inverse` flips the
11
+ * surface (dark bubble in light mode, light bubble in dark mode).
12
+ */
13
+ variant?: 'default' | 'inverse';
9
14
  className?: string;
10
15
  /** A single focusable element; receives aria-describedby when open. */
11
16
  children: React.ReactElement;
@@ -37,8 +37,12 @@ var React = __toESM(require("react"));
37
37
  var import_react_dom = require("react-dom");
38
38
  var import_cn = require("../../utils/cn.js");
39
39
  const GAP = 8;
40
+ const VARIANTS = {
41
+ default: "border-border bg-popover text-popover-foreground",
42
+ inverse: "border-inverse-border bg-inverse text-inverse-foreground"
43
+ };
40
44
  const Tooltip = React.forwardRef(
41
- ({ content, side = "top", delay = 300, className, children }, ref) => {
45
+ ({ content, side = "top", delay = 300, variant = "default", className, children }, ref) => {
42
46
  const [open, setOpen] = React.useState(false);
43
47
  const [pos, setPos] = React.useState(null);
44
48
  const anchorRef = React.useRef(null);
@@ -104,7 +108,10 @@ const Tooltip = React.forwardRef(
104
108
  id,
105
109
  role: "tooltip",
106
110
  style: { position: "fixed", top: pos.top, left: pos.left, transform: pos.transform, zIndex: 60 },
107
- className: "pointer-events-none w-max max-w-xs rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md",
111
+ className: (0, import_cn.cn)(
112
+ "pointer-events-none w-max max-w-xs rounded-md border px-3 py-1.5 text-xs shadow-md",
113
+ VARIANTS[variant]
114
+ ),
108
115
  children: content
109
116
  }
110
117
  ),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/cn';\n\nexport type TooltipProps = {\n /** The tooltip text. */\n content: string;\n /** Placement relative to the trigger (defaults to top). */\n side?: 'top' | 'bottom' | 'left' | 'right';\n /** Delay before showing on hover, in milliseconds. */\n delay?: number;\n className?: string;\n /** A single focusable element; receives aria-describedby when open. */\n children: React.ReactElement;\n};\n\ntype Position = { top: number; left: number; transform: string };\n\nconst GAP = 8;\n\n/**\n * Hover/focus tooltip built on aria-describedby. Shows on pointer\n * hover and keyboard focus (not click), dismisses on Escape, and\n * never traps focus.\n *\n * The bubble portals to document.body with position:fixed, measured from\n * the trigger — overflowing a scrollable ancestor can never clip it or\n * scroll the container (the reported \"tooltip causes scroll\" bug).\n */\nconst Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(\n ({ content, side = 'top', delay = 300, className, children }, ref) => {\n const [open, setOpen] = React.useState(false);\n const [pos, setPos] = React.useState<Position | null>(null);\n const anchorRef = React.useRef<HTMLDivElement | null>(null);\n const timerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const id = React.useId();\n\n const show = React.useCallback(() => {\n if (timerRef.current) clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => setOpen(true), delay);\n }, [delay]);\n\n const hide = React.useCallback(() => {\n if (timerRef.current) clearTimeout(timerRef.current);\n setOpen(false);\n setPos(null);\n }, []);\n\n React.useEffect(\n () => () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n },\n []\n );\n\n // Measure the trigger for fixed positioning; scroll/resize dismisses\n // the bubble so it can never drift from (or scroll with) its anchor.\n React.useLayoutEffect(() => {\n if (!open) return;\n const rect = anchorRef.current?.getBoundingClientRect();\n if (!rect) return;\n const next: Position =\n side === 'top'\n ? { top: rect.top - GAP, left: rect.left + rect.width / 2, transform: 'translate(-50%, -100%)' }\n : side === 'bottom'\n ? { top: rect.bottom + GAP, left: rect.left + rect.width / 2, transform: 'translate(-50%, 0)' }\n : side === 'left'\n ? { top: rect.top + rect.height / 2, left: rect.left - GAP, transform: 'translate(-100%, -50%)' }\n : { top: rect.top + rect.height / 2, left: rect.right + GAP, transform: 'translate(0, -50%)' };\n setPos(next);\n const onScrollOrResize = () => hide();\n window.addEventListener('scroll', onScrollOrResize, true);\n window.addEventListener('resize', onScrollOrResize);\n return () => {\n window.removeEventListener('scroll', onScrollOrResize, true);\n window.removeEventListener('resize', onScrollOrResize);\n };\n }, [open, side, hide]);\n\n // Inject aria-describedby into the trigger so the hint is announced\n // alongside the trigger's own accessible name.\n const trigger = React.cloneElement(children, {\n 'aria-describedby': open ? id : undefined,\n } as React.Attributes);\n\n return (\n <div\n ref={(node) => {\n anchorRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn('relative inline-flex', className)}\n onMouseEnter={show}\n onMouseLeave={hide}\n onFocusCapture={show}\n onBlurCapture={hide}\n onKeyDown={(event) => {\n if (event.key === 'Escape' && open) {\n event.stopPropagation();\n hide();\n }\n }}\n >\n {trigger}\n {open &&\n pos &&\n typeof document !== 'undefined' &&\n createPortal(\n <div\n id={id}\n role=\"tooltip\"\n style={{ position: 'fixed', top: pos.top, left: pos.left, transform: pos.transform, zIndex: 60 }}\n className=\"pointer-events-none w-max max-w-xs rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md\"\n >\n {content}\n </div>,\n document.body\n )}\n </div>\n );\n }\n);\nTooltip.displayName = 'Tooltip';\n\nexport { Tooltip };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwFM;AAtFN,YAAuB;AACvB,uBAA6B;AAC7B,gBAAmB;AAgBnB,MAAM,MAAM;AAWZ,MAAM,UAAU,MAAM;AAAA,EACpB,CAAC,EAAE,SAAS,OAAO,OAAO,QAAQ,KAAK,WAAW,SAAS,GAAG,QAAQ;AACpE,UAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,UAAM,CAAC,KAAK,MAAM,IAAI,MAAM,SAA0B,IAAI;AAC1D,UAAM,YAAY,MAAM,OAA8B,IAAI;AAC1D,UAAM,WAAW,MAAM,OAA6C,IAAI;AACxE,UAAM,KAAK,MAAM,MAAM;AAEvB,UAAM,OAAO,MAAM,YAAY,MAAM;AACnC,UAAI,SAAS,QAAS,cAAa,SAAS,OAAO;AACnD,eAAS,UAAU,WAAW,MAAM,QAAQ,IAAI,GAAG,KAAK;AAAA,IAC1D,GAAG,CAAC,KAAK,CAAC;AAEV,UAAM,OAAO,MAAM,YAAY,MAAM;AACnC,UAAI,SAAS,QAAS,cAAa,SAAS,OAAO;AACnD,cAAQ,KAAK;AACb,aAAO,IAAI;AAAA,IACb,GAAG,CAAC,CAA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Ac;AAAA,QACd,gBAAgB;AAAA,QAChB,eAAe;AAAA,QACf,WAAW,CAAC,UAAU;AACpB,cAAI,MAAM,QAAQ,YAAY,MAAM;AAClC,kBAAM,gBAAgB;AACtB,iBAAK;AAAA,UACP;AAAA,QACF;AAAA,QAEC;AAAA;AAAA,UACA,QACC,OACA,OAAO,aAAa,mBACpB;AAAA,YACE;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA,MAAK;AAAA,gBACL,OAAO,EAAE,UAAU,SAAS,KAAK,IAAI,KAAK,MAAM,IAAI,MAAM,WAAW,IAAI,WAAW,QAAQ,GAAG;AAAA,gBAC/F,WAAU;AAAA,gBAET;AAAA;AAAA,YACH;AAAA,YACA,SAAS;AAAA,UACX;AAAA;AAAA;AAAA,IACJ;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/cn';\n\nexport type TooltipProps = {\n /** The tooltip text. */\n content: string;\n /** Placement relative to the trigger (defaults to top). */\n side?: 'top' | 'bottom' | 'left' | 'right';\n /** Delay before showing on hover, in milliseconds. */\n delay?: number;\n /**\n * Bubble palette. `default` uses the popover surface; `inverse` flips the\n * surface (dark bubble in light mode, light bubble in dark mode).\n */\n variant?: 'default' | 'inverse';\n className?: string;\n /** A single focusable element; receives aria-describedby when open. */\n children: React.ReactElement;\n};\n\ntype Position = { top: number; left: number; transform: string };\n\nconst GAP = 8;\n\n/**\n * Literal class maps so the Tailwind scanner keeps both palettes. `inverse`\n * reuses the inverse surface tokens: navy in light mode, white in dark mode.\n */\nconst VARIANTS: Record<NonNullable<TooltipProps['variant']>, string> = {\n default: 'border-border bg-popover text-popover-foreground',\n inverse: 'border-inverse-border bg-inverse text-inverse-foreground',\n};\n\n/**\n * Hover/focus tooltip built on aria-describedby. Shows on pointer\n * hover and keyboard focus (not click), dismisses on Escape, and\n * never traps focus.\n *\n * The bubble portals to document.body with position:fixed, measured from\n * the trigger — overflowing a scrollable ancestor can never clip it or\n * scroll the container (the reported \"tooltip causes scroll\" bug).\n */\nconst Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(\n ({ content, side = 'top', delay = 300, variant = 'default', className, children }, ref) => {\n const [open, setOpen] = React.useState(false);\n const [pos, setPos] = React.useState<Position | null>(null);\n const anchorRef = React.useRef<HTMLDivElement | null>(null);\n const timerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const id = React.useId();\n\n const show = React.useCallback(() => {\n if (timerRef.current) clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => setOpen(true), delay);\n }, [delay]);\n\n const hide = React.useCallback(() => {\n if (timerRef.current) clearTimeout(timerRef.current);\n setOpen(false);\n setPos(null);\n }, []);\n\n React.useEffect(\n () => () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n },\n []\n );\n\n // Measure the trigger for fixed positioning; scroll/resize dismisses\n // the bubble so it can never drift from (or scroll with) its anchor.\n React.useLayoutEffect(() => {\n if (!open) return;\n const rect = anchorRef.current?.getBoundingClientRect();\n if (!rect) return;\n const next: Position =\n side === 'top'\n ? { top: rect.top - GAP, left: rect.left + rect.width / 2, transform: 'translate(-50%, -100%)' }\n : side === 'bottom'\n ? { top: rect.bottom + GAP, left: rect.left + rect.width / 2, transform: 'translate(-50%, 0)' }\n : side === 'left'\n ? { top: rect.top + rect.height / 2, left: rect.left - GAP, transform: 'translate(-100%, -50%)' }\n : { top: rect.top + rect.height / 2, left: rect.right + GAP, transform: 'translate(0, -50%)' };\n setPos(next);\n const onScrollOrResize = () => hide();\n window.addEventListener('scroll', onScrollOrResize, true);\n window.addEventListener('resize', onScrollOrResize);\n return () => {\n window.removeEventListener('scroll', onScrollOrResize, true);\n window.removeEventListener('resize', onScrollOrResize);\n };\n }, [open, side, hide]);\n\n // Inject aria-describedby into the trigger so the hint is announced\n // alongside the trigger's own accessible name.\n const trigger = React.cloneElement(children, {\n 'aria-describedby': open ? id : undefined,\n } as React.Attributes);\n\n return (\n <div\n ref={(node) => {\n anchorRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn('relative inline-flex', className)}\n onMouseEnter={show}\n onMouseLeave={hide}\n onFocusCapture={show}\n onBlurCapture={hide}\n onKeyDown={(event) => {\n if (event.key === 'Escape' && open) {\n event.stopPropagation();\n hide();\n }\n }}\n >\n {trigger}\n {open &&\n pos &&\n typeof document !== 'undefined' &&\n createPortal(\n <div\n id={id}\n role=\"tooltip\"\n style={{ position: 'fixed', top: pos.top, left: pos.left, transform: pos.transform, zIndex: 60 }}\n className={cn(\n 'pointer-events-none w-max max-w-xs rounded-md border px-3 py-1.5 text-xs shadow-md',\n VARIANTS[variant]\n )}\n >\n {content}\n </div>,\n document.body\n )}\n </div>\n );\n }\n);\nTooltip.displayName = 'Tooltip';\n\nexport { Tooltip };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsGM;AApGN,YAAuB;AACvB,uBAA6B;AAC7B,gBAAmB;AAqBnB,MAAM,MAAM;AAMZ,MAAM,WAAiE;AAAA,EACrE,SAAS;AAAA,EACT,SAAS;AACX;AAWA,MAAM,UAAU,MAAM;AAAA,EACpB,CAAC,EAAE,SAAS,OAAO,OAAO,QAAQ,KAAK,UAAU,WAAW,WAAW,SAAS,GAAG,QAAQ;AACzF,UAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,UAAM,CAAC,KAAK,MAAM,IAAI,MAAM,SAA0B,IAAI;AAC1D,UAAM,YAAY,MAAM,OAA8B,IAAI;AAC1D,UAAM,WAAW,MAAM,OAA6C,IAAI;AACxE,UAAM,KAAK,MAAM,MAAM;AAEvB,UAAM,OAAO,MAAM,YAAY,MAAM;AACnC,UAAI,SAAS,QAAS,cAAa,SAAS,OAAO;AACnD,eAAS,UAAU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AAC;AAAA;AAAA,QACC,KAAK,CAAC,SAAS;AACb,oBAAU,UAAU;AACpB,cAAI,OAAO,QAAQ,WAAY,KAAI,IAAI;AAAA,mBAC9B,IAAK,KAAI,UAAU;AAAA,QAC9B;AAAA,QACA,eAAW,cAAG,wBAAwB,SAAS;AAAA,QAC/C,cAAc;AAAA,QACd,cAAc;AAAA,QACd,gBAAgB;AAAA,QAChB,eAAe;AAAA,QACf,WAAW,CAAC,UAAU;AACpB,cAAI,MAAM,QAAQ,YAAY,MAAM;AAClC,kBAAM,gBAAgB;AACtB,iBAAK;AAAA,UACP;AAAA,QACF;AAAA,QAEC;AAAA;AAAA,UACA,QACC,OACA,OAAO,aAAa,mBACpB;AAAA,YACE;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA,MAAK;AAAA,gBACL,OAAO,EAAE,UAAU,SAAS,KAAK,IAAI,KAAK,MAAM,IAAI,MAAM,WAAW,IAAI,WAAW,QAAQ,GAAG;AAAA,gBAC/F,eAAW;AAAA,kBACT;AAAA,kBACA,SAAS,OAAO;AAAA,gBAClB;AAAA,gBAEC;AAAA;AAAA,YACH;AAAA,YACA,SAAS;AAAA,UACX;AAAA;AAAA;AAAA,IACJ;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;","names":[]}
@@ -4,8 +4,12 @@ import * as React from "react";
4
4
  import { createPortal } from "react-dom";
5
5
  import { cn } from "../../utils/cn.mjs";
6
6
  const GAP = 8;
7
+ const VARIANTS = {
8
+ default: "border-border bg-popover text-popover-foreground",
9
+ inverse: "border-inverse-border bg-inverse text-inverse-foreground"
10
+ };
7
11
  const Tooltip = React.forwardRef(
8
- ({ content, side = "top", delay = 300, className, children }, ref) => {
12
+ ({ content, side = "top", delay = 300, variant = "default", className, children }, ref) => {
9
13
  const [open, setOpen] = React.useState(false);
10
14
  const [pos, setPos] = React.useState(null);
11
15
  const anchorRef = React.useRef(null);
@@ -71,7 +75,10 @@ const Tooltip = React.forwardRef(
71
75
  id,
72
76
  role: "tooltip",
73
77
  style: { position: "fixed", top: pos.top, left: pos.left, transform: pos.transform, zIndex: 60 },
74
- className: "pointer-events-none w-max max-w-xs rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md",
78
+ className: cn(
79
+ "pointer-events-none w-max max-w-xs rounded-md border px-3 py-1.5 text-xs shadow-md",
80
+ VARIANTS[variant]
81
+ ),
75
82
  children: content
76
83
  }
77
84
  ),