@allxsmith/bestax-bulma 5.56.0 → 5.57.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 (335) hide show
  1. package/dist/esm/columns/Column.js +1 -0
  2. package/dist/esm/columns/Column.js.map +1 -1
  3. package/dist/esm/columns/Columns.js +1 -0
  4. package/dist/esm/columns/Columns.js.map +1 -1
  5. package/dist/esm/components/Avatar.js +1 -0
  6. package/dist/esm/components/Avatar.js.map +1 -1
  7. package/dist/esm/components/Avatars.js +1 -0
  8. package/dist/esm/components/Avatars.js.map +1 -1
  9. package/dist/esm/components/Badge.js +1 -0
  10. package/dist/esm/components/Badge.js.map +1 -1
  11. package/dist/esm/components/Breadcrumb.js +1 -0
  12. package/dist/esm/components/Breadcrumb.js.map +1 -1
  13. package/dist/esm/components/Card.js +1 -0
  14. package/dist/esm/components/Card.js.map +1 -1
  15. package/dist/esm/components/Carousel.js +1 -0
  16. package/dist/esm/components/Carousel.js.map +1 -1
  17. package/dist/esm/components/Collapse.js +1 -0
  18. package/dist/esm/components/Collapse.js.map +1 -1
  19. package/dist/esm/components/Collapses.js +1 -0
  20. package/dist/esm/components/Collapses.js.map +1 -1
  21. package/dist/esm/components/Command.js +1 -0
  22. package/dist/esm/components/Command.js.map +1 -1
  23. package/dist/esm/components/ContextMenu.js +1 -0
  24. package/dist/esm/components/ContextMenu.js.map +1 -1
  25. package/dist/esm/components/DataTable.js +1 -0
  26. package/dist/esm/components/DataTable.js.map +1 -1
  27. package/dist/esm/components/Dialog.js +1 -0
  28. package/dist/esm/components/Dialog.js.map +1 -1
  29. package/dist/esm/components/Dropdown.js +1 -0
  30. package/dist/esm/components/Dropdown.js.map +1 -1
  31. package/dist/esm/components/EmptyState.js +1 -0
  32. package/dist/esm/components/EmptyState.js.map +1 -1
  33. package/dist/esm/components/HoverCard.js +1 -0
  34. package/dist/esm/components/HoverCard.js.map +1 -1
  35. package/dist/esm/components/Loading.js +1 -0
  36. package/dist/esm/components/Loading.js.map +1 -1
  37. package/dist/esm/components/Menu.js +1 -0
  38. package/dist/esm/components/Menu.js.map +1 -1
  39. package/dist/esm/components/Message.js +1 -0
  40. package/dist/esm/components/Message.js.map +1 -1
  41. package/dist/esm/components/Modal.js +1 -0
  42. package/dist/esm/components/Modal.js.map +1 -1
  43. package/dist/esm/components/Navbar.js +1 -0
  44. package/dist/esm/components/Navbar.js.map +1 -1
  45. package/dist/esm/components/Pagination.js +1 -0
  46. package/dist/esm/components/Pagination.js.map +1 -1
  47. package/dist/esm/components/Panel.js +1 -0
  48. package/dist/esm/components/Panel.js.map +1 -1
  49. package/dist/esm/components/Popover.js +1 -0
  50. package/dist/esm/components/Popover.js.map +1 -1
  51. package/dist/esm/components/Reveal.js +1 -0
  52. package/dist/esm/components/Reveal.js.map +1 -1
  53. package/dist/esm/components/ScrollArea.js +1 -0
  54. package/dist/esm/components/ScrollArea.js.map +1 -1
  55. package/dist/esm/components/SegmentedControl.js +1 -0
  56. package/dist/esm/components/SegmentedControl.js.map +1 -1
  57. package/dist/esm/components/Sidebar.js +1 -0
  58. package/dist/esm/components/Sidebar.js.map +1 -1
  59. package/dist/esm/components/Steps.js +1 -0
  60. package/dist/esm/components/Steps.js.map +1 -1
  61. package/dist/esm/components/Tabs.js +1 -0
  62. package/dist/esm/components/Tabs.js.map +1 -1
  63. package/dist/esm/components/Timeline.js +1 -0
  64. package/dist/esm/components/Timeline.js.map +1 -1
  65. package/dist/esm/components/Toast.js +1 -0
  66. package/dist/esm/components/Toast.js.map +1 -1
  67. package/dist/esm/components/Tooltip.js +1 -0
  68. package/dist/esm/components/Tooltip.js.map +1 -1
  69. package/dist/esm/components/TreeView.js +1 -0
  70. package/dist/esm/components/TreeView.js.map +1 -1
  71. package/dist/esm/components/collapsesContext.js +1 -0
  72. package/dist/esm/components/collapsesContext.js.map +1 -1
  73. package/dist/esm/components/useDataTable.js +1 -0
  74. package/dist/esm/components/useDataTable.js.map +1 -1
  75. package/dist/esm/elements/Block.js +1 -0
  76. package/dist/esm/elements/Block.js.map +1 -1
  77. package/dist/esm/elements/Box.js +1 -0
  78. package/dist/esm/elements/Box.js.map +1 -1
  79. package/dist/esm/elements/Button.js +1 -0
  80. package/dist/esm/elements/Button.js.map +1 -1
  81. package/dist/esm/elements/Buttons.js +1 -0
  82. package/dist/esm/elements/Buttons.js.map +1 -1
  83. package/dist/esm/elements/Code.js +1 -0
  84. package/dist/esm/elements/Code.js.map +1 -1
  85. package/dist/esm/elements/ColorSwatch.js +1 -0
  86. package/dist/esm/elements/ColorSwatch.js.map +1 -1
  87. package/dist/esm/elements/Content.js +1 -0
  88. package/dist/esm/elements/Content.js.map +1 -1
  89. package/dist/esm/elements/Delete.js +1 -0
  90. package/dist/esm/elements/Delete.js.map +1 -1
  91. package/dist/esm/elements/DescriptionList.js +1 -0
  92. package/dist/esm/elements/DescriptionList.js.map +1 -1
  93. package/dist/esm/elements/Divider.js +1 -0
  94. package/dist/esm/elements/Divider.js.map +1 -1
  95. package/dist/esm/elements/Emphasis.js +1 -0
  96. package/dist/esm/elements/Emphasis.js.map +1 -1
  97. package/dist/esm/elements/Figure.js +1 -0
  98. package/dist/esm/elements/Figure.js.map +1 -1
  99. package/dist/esm/elements/Icon.js +1 -0
  100. package/dist/esm/elements/Icon.js.map +1 -1
  101. package/dist/esm/elements/IconText.js +1 -0
  102. package/dist/esm/elements/IconText.js.map +1 -1
  103. package/dist/esm/elements/Image.js +1 -0
  104. package/dist/esm/elements/Image.js.map +1 -1
  105. package/dist/esm/elements/Kbd.js +1 -0
  106. package/dist/esm/elements/Kbd.js.map +1 -1
  107. package/dist/esm/elements/Link.js +1 -0
  108. package/dist/esm/elements/Link.js.map +1 -1
  109. package/dist/esm/elements/LinkButton.js +1 -0
  110. package/dist/esm/elements/LinkButton.js.map +1 -1
  111. package/dist/esm/elements/ListItem.js +1 -0
  112. package/dist/esm/elements/ListItem.js.map +1 -1
  113. package/dist/esm/elements/Loader.js +1 -0
  114. package/dist/esm/elements/Loader.js.map +1 -1
  115. package/dist/esm/elements/Notification.js +1 -0
  116. package/dist/esm/elements/Notification.js.map +1 -1
  117. package/dist/esm/elements/OrderedList.js +1 -0
  118. package/dist/esm/elements/OrderedList.js.map +1 -1
  119. package/dist/esm/elements/Paragraph.js +1 -0
  120. package/dist/esm/elements/Paragraph.js.map +1 -1
  121. package/dist/esm/elements/Pre.js +1 -0
  122. package/dist/esm/elements/Pre.js.map +1 -1
  123. package/dist/esm/elements/Progress.js +1 -0
  124. package/dist/esm/elements/Progress.js.map +1 -1
  125. package/dist/esm/elements/RingProgress.js +1 -0
  126. package/dist/esm/elements/RingProgress.js.map +1 -1
  127. package/dist/esm/elements/Skeleton.js +1 -0
  128. package/dist/esm/elements/Skeleton.js.map +1 -1
  129. package/dist/esm/elements/Span.js +1 -0
  130. package/dist/esm/elements/Span.js.map +1 -1
  131. package/dist/esm/elements/Strong.js +1 -0
  132. package/dist/esm/elements/Strong.js.map +1 -1
  133. package/dist/esm/elements/SubTitle.js +1 -0
  134. package/dist/esm/elements/SubTitle.js.map +1 -1
  135. package/dist/esm/elements/Table.js +1 -0
  136. package/dist/esm/elements/Table.js.map +1 -1
  137. package/dist/esm/elements/Tag.js +1 -0
  138. package/dist/esm/elements/Tag.js.map +1 -1
  139. package/dist/esm/elements/Tags.js +1 -0
  140. package/dist/esm/elements/Tags.js.map +1 -1
  141. package/dist/esm/elements/Tbody.js +1 -0
  142. package/dist/esm/elements/Tbody.js.map +1 -1
  143. package/dist/esm/elements/Td.js +1 -0
  144. package/dist/esm/elements/Td.js.map +1 -1
  145. package/dist/esm/elements/Tfoot.js +1 -0
  146. package/dist/esm/elements/Tfoot.js.map +1 -1
  147. package/dist/esm/elements/Th.js +1 -0
  148. package/dist/esm/elements/Th.js.map +1 -1
  149. package/dist/esm/elements/Thead.js +1 -0
  150. package/dist/esm/elements/Thead.js.map +1 -1
  151. package/dist/esm/elements/Title.js +1 -0
  152. package/dist/esm/elements/Title.js.map +1 -1
  153. package/dist/esm/elements/ToggleButton.js +1 -0
  154. package/dist/esm/elements/ToggleButton.js.map +1 -1
  155. package/dist/esm/elements/Tr.js +1 -0
  156. package/dist/esm/elements/Tr.js.map +1 -1
  157. package/dist/esm/elements/UnorderedList.js +1 -0
  158. package/dist/esm/elements/UnorderedList.js.map +1 -1
  159. package/dist/esm/elements/iconProps.js +1 -0
  160. package/dist/esm/elements/iconProps.js.map +1 -1
  161. package/dist/esm/form/Autocomplete.js +1 -0
  162. package/dist/esm/form/Autocomplete.js.map +1 -1
  163. package/dist/esm/form/Checkbox.js +1 -0
  164. package/dist/esm/form/Checkbox.js.map +1 -1
  165. package/dist/esm/form/CheckboxCard.js +1 -0
  166. package/dist/esm/form/CheckboxCard.js.map +1 -1
  167. package/dist/esm/form/Checkboxes.js +1 -0
  168. package/dist/esm/form/Checkboxes.js.map +1 -1
  169. package/dist/esm/form/ColorInput.js +1 -0
  170. package/dist/esm/form/ColorInput.js.map +1 -1
  171. package/dist/esm/form/ColorInputBase.js +1 -0
  172. package/dist/esm/form/ColorInputBase.js.map +1 -1
  173. package/dist/esm/form/ColorPicker.js +1 -0
  174. package/dist/esm/form/ColorPicker.js.map +1 -1
  175. package/dist/esm/form/Combobox.js +1 -0
  176. package/dist/esm/form/Combobox.js.map +1 -1
  177. package/dist/esm/form/Control.js +1 -0
  178. package/dist/esm/form/Control.js.map +1 -1
  179. package/dist/esm/form/DateInput.js +1 -0
  180. package/dist/esm/form/DateInput.js.map +1 -1
  181. package/dist/esm/form/DateInputBase.js +1 -0
  182. package/dist/esm/form/DateInputBase.js.map +1 -1
  183. package/dist/esm/form/DateRangeInput.js +1 -0
  184. package/dist/esm/form/DateRangeInput.js.map +1 -1
  185. package/dist/esm/form/DateRangeInputBase.js +1 -0
  186. package/dist/esm/form/DateRangeInputBase.js.map +1 -1
  187. package/dist/esm/form/DateTimeInput.js +1 -0
  188. package/dist/esm/form/DateTimeInput.js.map +1 -1
  189. package/dist/esm/form/DateTimeInputBase.js +1 -0
  190. package/dist/esm/form/DateTimeInputBase.js.map +1 -1
  191. package/dist/esm/form/Dropzone.js +1 -0
  192. package/dist/esm/form/Dropzone.js.map +1 -1
  193. package/dist/esm/form/Field.js +1 -0
  194. package/dist/esm/form/Field.js.map +1 -1
  195. package/dist/esm/form/Fieldset.js +1 -0
  196. package/dist/esm/form/Fieldset.js.map +1 -1
  197. package/dist/esm/form/File.js +1 -0
  198. package/dist/esm/form/File.js.map +1 -1
  199. package/dist/esm/form/FormContext.js +1 -0
  200. package/dist/esm/form/FormContext.js.map +1 -1
  201. package/dist/esm/form/Input.js +1 -0
  202. package/dist/esm/form/Input.js.map +1 -1
  203. package/dist/esm/form/InputBase.js +1 -0
  204. package/dist/esm/form/InputBase.js.map +1 -1
  205. package/dist/esm/form/Numberinput.js +1 -0
  206. package/dist/esm/form/Numberinput.js.map +1 -1
  207. package/dist/esm/form/PinInput.js +1 -0
  208. package/dist/esm/form/PinInput.js.map +1 -1
  209. package/dist/esm/form/Radio.js +1 -0
  210. package/dist/esm/form/Radio.js.map +1 -1
  211. package/dist/esm/form/RadioCard.js +1 -0
  212. package/dist/esm/form/RadioCard.js.map +1 -1
  213. package/dist/esm/form/Radios.js +1 -0
  214. package/dist/esm/form/Radios.js.map +1 -1
  215. package/dist/esm/form/Rate.js +1 -0
  216. package/dist/esm/form/Rate.js.map +1 -1
  217. package/dist/esm/form/Select.js +1 -0
  218. package/dist/esm/form/Select.js.map +1 -1
  219. package/dist/esm/form/SelectBase.js +1 -0
  220. package/dist/esm/form/SelectBase.js.map +1 -1
  221. package/dist/esm/form/Slider.js +1 -0
  222. package/dist/esm/form/Slider.js.map +1 -1
  223. package/dist/esm/form/Switch.js +1 -0
  224. package/dist/esm/form/Switch.js.map +1 -1
  225. package/dist/esm/form/Taginput.js +1 -0
  226. package/dist/esm/form/Taginput.js.map +1 -1
  227. package/dist/esm/form/TextArea.js +1 -0
  228. package/dist/esm/form/TextArea.js.map +1 -1
  229. package/dist/esm/form/TextAreaBase.js +1 -0
  230. package/dist/esm/form/TextAreaBase.js.map +1 -1
  231. package/dist/esm/form/TimeInput.js +1 -0
  232. package/dist/esm/form/TimeInput.js.map +1 -1
  233. package/dist/esm/form/TimeInputBase.js +1 -0
  234. package/dist/esm/form/TimeInputBase.js.map +1 -1
  235. package/dist/esm/form/_colorInternals/EyeDropperButton.js +1 -0
  236. package/dist/esm/form/_colorInternals/EyeDropperButton.js.map +1 -1
  237. package/dist/esm/form/_colorInternals/pickerState.js +1 -0
  238. package/dist/esm/form/_colorInternals/pickerState.js.map +1 -1
  239. package/dist/esm/form/_pickerInternals/Calendar.js +1 -0
  240. package/dist/esm/form/_pickerInternals/Calendar.js.map +1 -1
  241. package/dist/esm/form/_pickerInternals/PickerPopover.js +1 -0
  242. package/dist/esm/form/_pickerInternals/PickerPopover.js.map +1 -1
  243. package/dist/esm/form/_pickerInternals/TimeWheels.js +1 -0
  244. package/dist/esm/form/_pickerInternals/TimeWheels.js.map +1 -1
  245. package/dist/esm/form/_pickerInternals/useLocaleDefaults.js +1 -0
  246. package/dist/esm/form/_pickerInternals/useLocaleDefaults.js.map +1 -1
  247. package/dist/esm/form/_pickerInternals/useNativeMobilePicker.js +1 -0
  248. package/dist/esm/form/_pickerInternals/useNativeMobilePicker.js.map +1 -1
  249. package/dist/esm/form/_pickerInternals/useSegmentedEntry.js +1 -0
  250. package/dist/esm/form/_pickerInternals/useSegmentedEntry.js.map +1 -1
  251. package/dist/esm/form/controlLoading.js +1 -0
  252. package/dist/esm/form/controlLoading.js.map +1 -1
  253. package/dist/esm/form/groupFieldset.js +1 -0
  254. package/dist/esm/form/groupFieldset.js.map +1 -1
  255. package/dist/esm/form/useAutoLabelId.js +1 -0
  256. package/dist/esm/form/useAutoLabelId.js.map +1 -1
  257. package/dist/esm/grid/Cell.js +1 -0
  258. package/dist/esm/grid/Cell.js.map +1 -1
  259. package/dist/esm/grid/Grid.js +1 -0
  260. package/dist/esm/grid/Grid.js.map +1 -1
  261. package/dist/esm/helpers/ClientOnly.js +1 -0
  262. package/dist/esm/helpers/ClientOnly.js.map +1 -1
  263. package/dist/esm/helpers/Config.js +1 -0
  264. package/dist/esm/helpers/Config.js.map +1 -1
  265. package/dist/esm/helpers/LocaleProvider.js +1 -0
  266. package/dist/esm/helpers/LocaleProvider.js.map +1 -1
  267. package/dist/esm/helpers/Theme.js +1 -0
  268. package/dist/esm/helpers/Theme.js.map +1 -1
  269. package/dist/esm/helpers/flattenChildren.js +1 -0
  270. package/dist/esm/helpers/flattenChildren.js.map +1 -1
  271. package/dist/esm/helpers/inertProps.js +1 -0
  272. package/dist/esm/helpers/inertProps.js.map +1 -1
  273. package/dist/esm/helpers/localeFormat.js +1 -0
  274. package/dist/esm/helpers/localeFormat.js.map +1 -1
  275. package/dist/esm/helpers/overlayStack.js +1 -0
  276. package/dist/esm/helpers/overlayStack.js.map +1 -1
  277. package/dist/esm/helpers/portal.js +1 -0
  278. package/dist/esm/helpers/portal.js.map +1 -1
  279. package/dist/esm/helpers/scrollLock.js +1 -0
  280. package/dist/esm/helpers/scrollLock.js.map +1 -1
  281. package/dist/esm/helpers/statusRegion.js +1 -0
  282. package/dist/esm/helpers/statusRegion.js.map +1 -1
  283. package/dist/esm/helpers/typeahead.js +1 -0
  284. package/dist/esm/helpers/typeahead.js.map +1 -1
  285. package/dist/esm/helpers/useAnchoredPosition.js +1 -0
  286. package/dist/esm/helpers/useAnchoredPosition.js.map +1 -1
  287. package/dist/esm/helpers/useBulmaClasses.js +1 -0
  288. package/dist/esm/helpers/useBulmaClasses.js.map +1 -1
  289. package/dist/esm/helpers/useClientLayoutEffect.js +1 -0
  290. package/dist/esm/helpers/useClientLayoutEffect.js.map +1 -1
  291. package/dist/esm/helpers/useColorClasses.js +1 -0
  292. package/dist/esm/helpers/useColorClasses.js.map +1 -1
  293. package/dist/esm/helpers/useComboboxEngine.js +1 -0
  294. package/dist/esm/helpers/useComboboxEngine.js.map +1 -1
  295. package/dist/esm/helpers/useContextMenuTrigger.js +1 -0
  296. package/dist/esm/helpers/useContextMenuTrigger.js.map +1 -1
  297. package/dist/esm/helpers/useFlexboxClasses.js +1 -0
  298. package/dist/esm/helpers/useFlexboxClasses.js.map +1 -1
  299. package/dist/esm/helpers/useFocusTrap.js +1 -0
  300. package/dist/esm/helpers/useFocusTrap.js.map +1 -1
  301. package/dist/esm/helpers/useHoverOpen.js +1 -0
  302. package/dist/esm/helpers/useHoverOpen.js.map +1 -1
  303. package/dist/esm/helpers/useInertSiblings.js +1 -0
  304. package/dist/esm/helpers/useInertSiblings.js.map +1 -1
  305. package/dist/esm/helpers/useIsHydrated.js +1 -0
  306. package/dist/esm/helpers/useIsHydrated.js.map +1 -1
  307. package/dist/esm/helpers/useLatestRef.js +1 -0
  308. package/dist/esm/helpers/useLatestRef.js.map +1 -1
  309. package/dist/esm/helpers/useMenuKeys.js +1 -0
  310. package/dist/esm/helpers/useMenuKeys.js.map +1 -1
  311. package/dist/esm/helpers/useOtherClasses.js +1 -0
  312. package/dist/esm/helpers/useOtherClasses.js.map +1 -1
  313. package/dist/esm/helpers/useSpacingClasses.js +1 -0
  314. package/dist/esm/helpers/useSpacingClasses.js.map +1 -1
  315. package/dist/esm/helpers/useTreeView.js +1 -0
  316. package/dist/esm/helpers/useTreeView.js.map +1 -1
  317. package/dist/esm/helpers/useTypographyClasses.js +1 -0
  318. package/dist/esm/helpers/useTypographyClasses.js.map +1 -1
  319. package/dist/esm/helpers/useVisibilityClasses.js +1 -0
  320. package/dist/esm/helpers/useVisibilityClasses.js.map +1 -1
  321. package/dist/esm/layout/Container.js +1 -0
  322. package/dist/esm/layout/Container.js.map +1 -1
  323. package/dist/esm/layout/Footer.js +1 -0
  324. package/dist/esm/layout/Footer.js.map +1 -1
  325. package/dist/esm/layout/Hero.js +1 -0
  326. package/dist/esm/layout/Hero.js.map +1 -1
  327. package/dist/esm/layout/Level.js +1 -0
  328. package/dist/esm/layout/Level.js.map +1 -1
  329. package/dist/esm/layout/Media.js +1 -0
  330. package/dist/esm/layout/Media.js.map +1 -1
  331. package/dist/esm/layout/Section.js +1 -0
  332. package/dist/esm/layout/Section.js.map +1 -1
  333. package/dist/esm/layout/Splitter.js +1 -0
  334. package/dist/esm/layout/Splitter.js.map +1 -1
  335. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Rate.js","sources":["../../../src/form/Rate.tsx"],"sourcesContent":["import React, { forwardRef, useState, useCallback, useId } from 'react';\nimport {\n classNames,\n prefixedClassNames,\n usePrefixedClassNames,\n} from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { Icon } from '../elements/Icon';\nimport { useClassPrefix, useIconLibrary } from '../helpers/Config';\nimport { useNumberFormat } from '../helpers/localeFormat';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n useFieldsetDisabled,\n} from './FormContext';\nimport { Field } from './Field';\nimport { Control } from './Control';\nimport { FormFieldProps } from './fieldProps';\nimport { useAutoLabelledBy } from './useAutoLabelId';\n\n/** Available size modifiers for the Rate component. */\nexport type RateSize = 'small' | 'medium' | 'large';\ntype IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';\ntype BulmaColor =\n 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n\n/**\n * Props for individual rate icons.\n */\nexport interface RateIconProps {\n /** The index of this icon (0-based) */\n index: number;\n /** Whether this icon is currently active (filled) */\n isActive: boolean;\n /** Whether this icon is currently hovered */\n isHovered: boolean;\n /** The current value */\n value: number;\n /** Fill percentage for partial icons (0-100). Used with precision < 1. */\n fillPercent: number;\n}\n\n/**\n * Props for the Rate component.\n * Inside an existing `Control` it renders no `Control` of its own. Inside an\n * outer `Field`, or a `Control` with no `Field` around it, it renders no\n * `Field` of its own either. The exception is `label`, `message`, `horizontal`\n * or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,\n * nested in the `.control`, and warns in development. Wrap the `Control` in a\n * `Field` instead, and set the `label`, `horizontal` and class name on that\n * `Field`.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the container element.\n */\nexport interface RateProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'>,\n Omit<BulmaClassesProps, 'size'>,\n FormFieldProps {\n /** Field label naming the rating group. Automatically associated via `aria-labelledby` on the `role=\"radiogroup\"` container — uses your `labelProps.id` when provided, otherwise a generated one; it also replaces the default `aria-label=\"Rating\"`. Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`), and replaces the `aria-label=\"Rating\"` fallback too. An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own, and leaves the `\"Rating\"` fallback. */\n label?: React.ReactNode;\n /** Props for the label element. An explicit `id` here is used as the `aria-labelledby` target instead of a generated one; any `htmlFor` is ignored (a group label names the group, never a single control). */\n labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {\n [key: string]: unknown;\n };\n /** Form field name. When set, a hidden input is rendered. */\n name?: string;\n /** Optional id of the form this hidden input belongs to (use when the input lives outside the form element). */\n form?: string;\n /** Controlled value (0 to max). */\n value?: number;\n /** Default value for uncontrolled usage. */\n defaultValue?: number;\n /** Maximum rating value. */\n max?: number;\n /** Size variant. */\n size?: RateSize;\n /** Whether the rating is disabled. */\n disabled?: boolean;\n /**\n * Show the numeric score next to stars, written the way the `locale` of a\n * `LocaleProvider` around it writes numbers.\n */\n showScore?: boolean;\n /** Show custom text based on value. */\n showText?: boolean;\n /** Array of text labels for each rating value. */\n texts?: string[];\n /** Callback when rating changes. */\n onChange?: (value: number) => void;\n /** Custom icon renderer. */\n customIcon?: (props: RateIconProps) => React.ReactNode;\n /** Add spacing between icons. */\n spaced?: boolean;\n /** Right-to-left direction. */\n rtl?: boolean;\n /** Custom icon name for the rating stars. */\n iconName?: string;\n /** Icon library to use (defaults to ConfigProvider value or 'fa'). */\n iconLibrary?: IconLibrary;\n /** Icon style variant (e.g., 'solid', 'outlined'). */\n iconVariant?: string;\n /** Additional icon modifiers. */\n iconFeatures?: string | string[];\n /** Color of the active rating icons. */\n color?: BulmaColor;\n /** Rating precision (e.g., `0.5` for half stars). */\n precision?: number;\n /** Custom text displayed next to the rating. */\n customText?: string;\n}\n\n/**\n * Default star icon component.\n */\nconst StarIcon: React.FC<{ filled: boolean }> = ({ filled }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill={filled ? 'currentColor' : 'none'}\n stroke=\"currentColor\"\n strokeWidth={filled ? 0 : 2}\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z\"\n />\n </svg>\n);\n\n/** Snap a value to the nearest precision step. */\nfunction snapToPrecision(val: number, precision: number): number {\n return Math.round(val / precision) * precision;\n}\n\n/** Get fill percentage for a given icon index based on current value. */\nfunction getFillPercent(iconIndex: number, value: number): number {\n if (value >= iconIndex + 1) return 100;\n if (value <= iconIndex) return 0;\n return Math.round((value - iconIndex) * 100);\n}\n\n/**\n * The `Rate` component provides a star/icon-based rating system.\n *\n * @function\n * @param {RateProps} props - Props for the Rate component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the container element.\n * @returns {JSX.Element} The rendered rating component.\n *\n * @example\n * // Basic 5-star rating\n * <Rate defaultValue={3} />\n *\n * @example\n * // With color and precision\n * <Rate defaultValue={3.5} color=\"warning\" precision={0.5} showScore />\n *\n * @example\n * // With Font Awesome icons\n * <Rate iconName=\"star\" iconLibrary=\"fa\" iconVariant=\"solid\" />\n */\nexport const Rate = forwardRef<HTMLDivElement, RateProps>(\n (\n {\n label,\n labelSize,\n labelProps,\n horizontal,\n message,\n messageColor,\n fieldClassName,\n value: controlledValue,\n defaultValue = 0,\n max = 5,\n size,\n disabled: disabledProp,\n showScore = false,\n showText = false,\n texts,\n onChange,\n customIcon,\n spaced = false,\n rtl = false,\n iconName,\n iconLibrary: iconLibraryProp,\n iconVariant,\n iconFeatures,\n color,\n precision = 1,\n customText,\n name,\n form,\n className,\n ...props\n },\n ref\n ) => {\n const disabled = useFieldsetDisabled(disabledProp);\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Rate', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n const { ariaLabelledBy, fieldLabelProps } = useAutoLabelledBy({\n label,\n labelProps,\n rendersLabel: ownField,\n callerProps: props,\n });\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n const formatNumber = useNumberFormat();\n const starBaseId = useId();\n const [internalValue, setInternalValue] = useState(defaultValue);\n const [hoverValue, setHoverValue] = useState<number | null>(null);\n\n const defaultIconLibrary = useIconLibrary();\n const resolvedLibrary = iconLibraryProp || defaultIconLibrary || 'fa';\n\n // Determine if controlled\n const isControlled = controlledValue !== undefined;\n const currentValue = isControlled ? controlledValue : internalValue;\n const displayValue = hoverValue !== null ? hoverValue : currentValue;\n\n // Update value\n const updateValue = useCallback(\n (newValue: number) => {\n if (disabled) return;\n\n // Allow clicking same value to deselect (set to 0)\n const finalValue = newValue === currentValue ? 0 : newValue;\n\n if (!isControlled) {\n setInternalValue(finalValue);\n }\n onChange?.(finalValue);\n },\n [isControlled, currentValue, disabled, onChange]\n );\n\n // Handle click with precision support\n const handleClick = useCallback(\n (iconIndex: number, e: React.MouseEvent<HTMLSpanElement>) => {\n if (disabled) return;\n\n if (precision < 1) {\n const rect = e.currentTarget.getBoundingClientRect();\n let relativeX = (e.clientX - rect.left) / rect.width;\n if (rtl) relativeX = 1 - relativeX;\n const rawValue = iconIndex + relativeX;\n const snapped = snapToPrecision(rawValue, precision);\n const clamped = Math.max(precision, Math.min(snapped, max));\n updateValue(clamped);\n } else {\n updateValue(iconIndex + 1);\n }\n },\n [disabled, precision, rtl, max, updateValue]\n );\n\n // Handle mouse enter on icon\n const handleMouseEnter = useCallback(\n (iconIndex: number) => {\n if (disabled) return;\n setHoverValue(iconIndex + 1);\n },\n [disabled]\n );\n\n // Handle mouse move with precision support\n const handleMouseMove = useCallback(\n (iconIndex: number, e: React.MouseEvent<HTMLSpanElement>) => {\n if (disabled || precision >= 1) return;\n const rect = e.currentTarget.getBoundingClientRect();\n let relativeX = (e.clientX - rect.left) / rect.width;\n if (rtl) relativeX = 1 - relativeX;\n const rawValue = iconIndex + relativeX;\n const snapped = snapToPrecision(rawValue, precision);\n const clamped = Math.max(precision, Math.min(snapped, max));\n setHoverValue(clamped);\n },\n [disabled, precision, rtl, max]\n );\n\n // Handle mouse leave\n const handleMouseLeave = useCallback(() => {\n setHoverValue(null);\n }, []);\n\n // Handle keyboard\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled) return;\n\n let newValue = currentValue;\n const step = precision < 1 ? precision : 1;\n\n if (e.key === 'ArrowRight' || e.key === 'ArrowUp') {\n e.preventDefault();\n newValue = Math.min(currentValue + step, max);\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') {\n e.preventDefault();\n newValue = Math.max(currentValue - step, 0);\n } else if (e.key === 'Home') {\n e.preventDefault();\n newValue = 0;\n } else if (e.key === 'End') {\n e.preventDefault();\n newValue = max;\n }\n\n // Round to avoid floating point issues\n newValue = Math.round(newValue * 1000) / 1000;\n\n if (newValue !== currentValue) {\n if (!isControlled) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n }\n },\n [currentValue, max, precision, disabled, isControlled, onChange]\n );\n\n // Get text for current value\n const getText = () => {\n if (!showText || !texts) return null;\n const wholeIndex = Math.ceil(displayValue) - 1;\n const baseText = texts[wholeIndex] || null;\n if (!baseText) return null;\n // For fractional hover values with precision < 1, append \"+\"\n if (precision < 1 && hoverValue !== null && hoverValue % 1 !== 0) {\n return `${baseText}+`;\n }\n return baseText;\n };\n\n // Format score display\n const getScoreDisplay = () => {\n const fractional = precision < 1 && currentValue % 1 !== 0;\n if (formatNumber) {\n return formatNumber(\n currentValue,\n fractional\n ? { minimumFractionDigits: 1, maximumFractionDigits: 1 }\n : undefined\n );\n }\n if (fractional) {\n return currentValue.toFixed(1);\n }\n return currentValue;\n };\n\n // Generate classes\n const classPrefix = useClassPrefix();\n const rateClasses = usePrefixedClassNames('rate', {\n [`is-${size}`]: size,\n 'is-disabled': disabled,\n 'is-spaced': spaced,\n 'is-rtl': rtl,\n [`is-${color}`]: color,\n });\n\n const combinedClasses = classNames(\n rateClasses,\n bulmaHelperClasses,\n className\n );\n\n // Render a single icon based on priority: customIcon > iconName > default SVG\n const renderIcon = (\n iconIndex: number,\n isActive: boolean,\n fillPercent: number\n ) => {\n const iconProps: RateIconProps = {\n index: iconIndex,\n isActive,\n isHovered: hoverValue !== null && iconIndex < hoverValue,\n value: displayValue,\n fillPercent,\n };\n\n if (customIcon) {\n return customIcon(iconProps);\n }\n\n if (iconName) {\n return (\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n );\n }\n\n return <StarIcon filled={isActive} />;\n };\n\n // Render partial icon with layered approach\n const renderPartialIcon = (iconIndex: number, fillPercent: number) => {\n if (customIcon) {\n // For custom icons, pass fillPercent and let consumer handle it\n const iconProps: RateIconProps = {\n index: iconIndex,\n isActive: fillPercent > 0,\n isHovered: hoverValue !== null && iconIndex < (hoverValue ?? 0),\n value: displayValue,\n fillPercent,\n };\n return customIcon(iconProps);\n }\n\n if (iconName) {\n return (\n <span\n className={prefixedClassNames(classPrefix, 'rate-icon-partial')}\n style={\n {\n '--rate-fill-percent': `${fillPercent}%`,\n } as React.CSSProperties\n }\n >\n <span className={prefixedClassNames(classPrefix, 'rate-icon-bg')}>\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n </span>\n <span className={prefixedClassNames(classPrefix, 'rate-icon-fg')}>\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n </span>\n </span>\n );\n }\n\n // Default SVG with clipPath for partial fill\n const clipId = `rate-clip-${iconIndex}`;\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <defs>\n <clipPath id={clipId}>\n <rect\n x=\"0\"\n y=\"0\"\n width={`${(fillPercent / 100) * 24}`}\n height=\"24\"\n />\n </clipPath>\n </defs>\n {/* Background: empty star */}\n <path\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z\"\n />\n {/* Foreground: filled portion */}\n <path\n clipPath={`url(#${clipId})`}\n fill=\"currentColor\"\n d=\"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z\"\n />\n </svg>\n );\n };\n\n // The star the value falls in is the checked radio, and it carries the\n // value: a radiogroup takes no aria-value* of its own. A fractional value\n // names that star by the value itself (\"3.5 stars\"). Both go by the value\n // as that name writes it, to hundredths, so a value a hair over a whole\n // number checks that number's star under its own name, and no two stars\n // share a name.\n const shownValue = Number(currentValue.toFixed(2));\n const checkedIndex =\n shownValue > 0 ? Math.min(Math.ceil(shownValue), max) - 1 : -1;\n\n // Render icons\n const renderIcons = () => {\n const icons = [];\n\n for (let i = 0; i < max; i++) {\n const iconIndex = rtl ? max - 1 - i : i;\n const fillPercent = getFillPercent(iconIndex, displayValue);\n const isActive = fillPercent === 100;\n const isHovered = hoverValue !== null && iconIndex < hoverValue;\n const isPartial = fillPercent > 0 && fillPercent < 100;\n\n const icon = isPartial\n ? renderPartialIcon(iconIndex, fillPercent)\n : renderIcon(iconIndex, isActive, fillPercent);\n\n icons.push(\n <span\n key={iconIndex}\n className={prefixedClassNames(classPrefix, 'rate-item', {\n 'is-active': isActive,\n 'is-hovered': isHovered,\n })}\n onClick={e => handleClick(iconIndex, e)}\n onMouseEnter={() => handleMouseEnter(iconIndex)}\n onMouseMove={e => handleMouseMove(iconIndex, e)}\n onMouseLeave={handleMouseLeave}\n id={`${starBaseId}-${iconIndex}`}\n role=\"radio\"\n aria-checked={iconIndex === checkedIndex}\n aria-label={\n iconIndex === checkedIndex && shownValue % 1 !== 0\n ? `${shownValue} stars`\n : `${iconIndex + 1} star${iconIndex === 0 ? '' : 's'}`\n }\n tabIndex={-1}\n >\n {icon}\n </span>\n );\n }\n\n return icons;\n };\n\n const text = getText();\n\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n const rateItemsClass = usePrefixedClassNames('rate-items');\n const rateScoreClass = usePrefixedClassNames('rate-score');\n const rateTextClass = usePrefixedClassNames('rate-text');\n const rateCustomTextClass = usePrefixedClassNames('rate-custom-text');\n\n const rateElement = (\n <div\n ref={ref}\n className={combinedClasses}\n role=\"radiogroup\"\n // Fallback name only: a wired label names the group via labelledby.\n aria-label={ariaLabelledBy ? undefined : 'Rating'}\n aria-labelledby={ariaLabelledBy}\n // Focus stays on the group, so point it at the checked star for\n // assistive technology to announce as the value changes.\n aria-activedescendant={\n checkedIndex >= 0 ? `${starBaseId}-${checkedIndex}` : undefined\n }\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n <div className={rateItemsClass}>{renderIcons()}</div>\n {showScore && (\n <span className={rateScoreClass}>{getScoreDisplay()}</span>\n )}\n {text && <span className={rateTextClass}>{text}</span>}\n {customText && (\n <span className={rateCustomTextClass}>{customText}</span>\n )}\n {name && (\n <input type=\"hidden\" name={name} value={currentValue} form={form} />\n )}\n </div>\n );\n\n let content = rateElement;\n\n if (rendersOwnControl('Rate', { insideControl })) {\n content = <Control>{content}</Control>;\n }\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nRate.displayName = 'Rate';\n\nexport default Rate;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;AAkHA;;AAEG;AACH,MAAM,QAAQ,GAAkC,CAAC,EAAE,MAAM,EAAE,MACzDA,GAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,MAAM,EACtC,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,MAAM,GAAG,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,EAAG,IAAI,EAAA,CAAQ,EACrD,UAAU,KACTA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,mBAAmB,EAAA,QAAA,EAAG,UAAU,EAAA,CAAQ,CAC1D,EACA,IAAI,KACHA,GAAA,CAAA,OAAA,EAAA,EAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAA,CAAI,CACrE,CAAA,EAAA,CACG,CACP;IAED,IAAI,OAAO,GAAG,WAAW;IAEzB,IAAI,iBAAiB,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AAChD,QAAA,OAAO,GAAGA,GAAA,CAAC,OAAO,EAAA,EAAA,QAAA,EAAE,OAAO,GAAW;IACxC;IAEA,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEC,IAAA,CAAC,KAAK,EAAA,EACJ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EAAA,QAAA,EAAA,CAExB,OAAO,EACP,SAAS,CAAA,EAAA,CACJ;IAEZ;AAEA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,OAAO,EACP,SAAS,CAAA,EAAA,CACT;AAEP,CAAC;AAGH,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
1
+ {"version":3,"file":"Rate.js","sources":["../../../src/form/Rate.tsx"],"sourcesContent":["import React, { forwardRef, useState, useCallback, useId } from 'react';\nimport {\n classNames,\n prefixedClassNames,\n usePrefixedClassNames,\n} from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { Icon } from '../elements/Icon';\nimport { useClassPrefix, useIconLibrary } from '../helpers/Config';\nimport { useNumberFormat } from '../helpers/localeFormat';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n useFieldsetDisabled,\n} from './FormContext';\nimport { Field } from './Field';\nimport { Control } from './Control';\nimport { FormFieldProps } from './fieldProps';\nimport { useAutoLabelledBy } from './useAutoLabelId';\n\n/** Available size modifiers for the Rate component. */\nexport type RateSize = 'small' | 'medium' | 'large';\ntype IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';\ntype BulmaColor =\n 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n\n/**\n * Props for individual rate icons.\n */\nexport interface RateIconProps {\n /** The index of this icon (0-based) */\n index: number;\n /** Whether this icon is currently active (filled) */\n isActive: boolean;\n /** Whether this icon is currently hovered */\n isHovered: boolean;\n /** The current value */\n value: number;\n /** Fill percentage for partial icons (0-100). Used with precision < 1. */\n fillPercent: number;\n}\n\n/**\n * Props for the Rate component.\n * Inside an existing `Control` it renders no `Control` of its own. Inside an\n * outer `Field`, or a `Control` with no `Field` around it, it renders no\n * `Field` of its own either. The exception is `label`, `message`, `horizontal`\n * or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,\n * nested in the `.control`, and warns in development. Wrap the `Control` in a\n * `Field` instead, and set the `label`, `horizontal` and class name on that\n * `Field`.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the container element.\n */\nexport interface RateProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'>,\n Omit<BulmaClassesProps, 'size'>,\n FormFieldProps {\n /** Field label naming the rating group. Automatically associated via `aria-labelledby` on the `role=\"radiogroup\"` container — uses your `labelProps.id` when provided, otherwise a generated one; it also replaces the default `aria-label=\"Rating\"`. Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`), and replaces the `aria-label=\"Rating\"` fallback too. An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own, and leaves the `\"Rating\"` fallback. */\n label?: React.ReactNode;\n /** Props for the label element. An explicit `id` here is used as the `aria-labelledby` target instead of a generated one; any `htmlFor` is ignored (a group label names the group, never a single control). */\n labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {\n [key: string]: unknown;\n };\n /** Form field name. When set, a hidden input is rendered. */\n name?: string;\n /** Optional id of the form this hidden input belongs to (use when the input lives outside the form element). */\n form?: string;\n /** Controlled value (0 to max). */\n value?: number;\n /** Default value for uncontrolled usage. */\n defaultValue?: number;\n /** Maximum rating value. */\n max?: number;\n /** Size variant. */\n size?: RateSize;\n /** Whether the rating is disabled. */\n disabled?: boolean;\n /**\n * Show the numeric score next to stars, written the way the `locale` of a\n * `LocaleProvider` around it writes numbers.\n */\n showScore?: boolean;\n /** Show custom text based on value. */\n showText?: boolean;\n /** Array of text labels for each rating value. */\n texts?: string[];\n /** Callback when rating changes. */\n onChange?: (value: number) => void;\n /** Custom icon renderer. */\n customIcon?: (props: RateIconProps) => React.ReactNode;\n /** Add spacing between icons. */\n spaced?: boolean;\n /** Right-to-left direction. */\n rtl?: boolean;\n /** Custom icon name for the rating stars. */\n iconName?: string;\n /** Icon library to use (defaults to ConfigProvider value or 'fa'). */\n iconLibrary?: IconLibrary;\n /** Icon style variant (e.g., 'solid', 'outlined'). */\n iconVariant?: string;\n /** Additional icon modifiers. */\n iconFeatures?: string | string[];\n /** Color of the active rating icons. */\n color?: BulmaColor;\n /** Rating precision (e.g., `0.5` for half stars). */\n precision?: number;\n /** Custom text displayed next to the rating. */\n customText?: string;\n}\n\n/**\n * Default star icon component.\n */\nconst StarIcon: React.FC<{ filled: boolean }> = ({ filled }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill={filled ? 'currentColor' : 'none'}\n stroke=\"currentColor\"\n strokeWidth={filled ? 0 : 2}\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z\"\n />\n </svg>\n);\n\n/** Snap a value to the nearest precision step. */\nfunction snapToPrecision(val: number, precision: number): number {\n return Math.round(val / precision) * precision;\n}\n\n/** Get fill percentage for a given icon index based on current value. */\nfunction getFillPercent(iconIndex: number, value: number): number {\n if (value >= iconIndex + 1) return 100;\n if (value <= iconIndex) return 0;\n return Math.round((value - iconIndex) * 100);\n}\n\n/**\n * The `Rate` component provides a star/icon-based rating system.\n *\n * @function\n * @param {RateProps} props - Props for the Rate component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the container element.\n * @returns {JSX.Element} The rendered rating component.\n *\n * @example\n * // Basic 5-star rating\n * <Rate defaultValue={3} />\n *\n * @example\n * // With color and precision\n * <Rate defaultValue={3.5} color=\"warning\" precision={0.5} showScore />\n *\n * @example\n * // With Font Awesome icons\n * <Rate iconName=\"star\" iconLibrary=\"fa\" iconVariant=\"solid\" />\n */\nexport const Rate = forwardRef<HTMLDivElement, RateProps>(\n (\n {\n label,\n labelSize,\n labelProps,\n horizontal,\n message,\n messageColor,\n fieldClassName,\n value: controlledValue,\n defaultValue = 0,\n max = 5,\n size,\n disabled: disabledProp,\n showScore = false,\n showText = false,\n texts,\n onChange,\n customIcon,\n spaced = false,\n rtl = false,\n iconName,\n iconLibrary: iconLibraryProp,\n iconVariant,\n iconFeatures,\n color,\n precision = 1,\n customText,\n name,\n form,\n className,\n ...props\n },\n ref\n ) => {\n const disabled = useFieldsetDisabled(disabledProp);\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Rate', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n const { ariaLabelledBy, fieldLabelProps } = useAutoLabelledBy({\n label,\n labelProps,\n rendersLabel: ownField,\n callerProps: props,\n });\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n const formatNumber = useNumberFormat();\n const starBaseId = useId();\n const [internalValue, setInternalValue] = useState(defaultValue);\n const [hoverValue, setHoverValue] = useState<number | null>(null);\n\n const defaultIconLibrary = useIconLibrary();\n const resolvedLibrary = iconLibraryProp || defaultIconLibrary || 'fa';\n\n // Determine if controlled\n const isControlled = controlledValue !== undefined;\n const currentValue = isControlled ? controlledValue : internalValue;\n const displayValue = hoverValue !== null ? hoverValue : currentValue;\n\n // Update value\n const updateValue = useCallback(\n (newValue: number) => {\n if (disabled) return;\n\n // Allow clicking same value to deselect (set to 0)\n const finalValue = newValue === currentValue ? 0 : newValue;\n\n if (!isControlled) {\n setInternalValue(finalValue);\n }\n onChange?.(finalValue);\n },\n [isControlled, currentValue, disabled, onChange]\n );\n\n // Handle click with precision support\n const handleClick = useCallback(\n (iconIndex: number, e: React.MouseEvent<HTMLSpanElement>) => {\n if (disabled) return;\n\n if (precision < 1) {\n const rect = e.currentTarget.getBoundingClientRect();\n let relativeX = (e.clientX - rect.left) / rect.width;\n if (rtl) relativeX = 1 - relativeX;\n const rawValue = iconIndex + relativeX;\n const snapped = snapToPrecision(rawValue, precision);\n const clamped = Math.max(precision, Math.min(snapped, max));\n updateValue(clamped);\n } else {\n updateValue(iconIndex + 1);\n }\n },\n [disabled, precision, rtl, max, updateValue]\n );\n\n // Handle mouse enter on icon\n const handleMouseEnter = useCallback(\n (iconIndex: number) => {\n if (disabled) return;\n setHoverValue(iconIndex + 1);\n },\n [disabled]\n );\n\n // Handle mouse move with precision support\n const handleMouseMove = useCallback(\n (iconIndex: number, e: React.MouseEvent<HTMLSpanElement>) => {\n if (disabled || precision >= 1) return;\n const rect = e.currentTarget.getBoundingClientRect();\n let relativeX = (e.clientX - rect.left) / rect.width;\n if (rtl) relativeX = 1 - relativeX;\n const rawValue = iconIndex + relativeX;\n const snapped = snapToPrecision(rawValue, precision);\n const clamped = Math.max(precision, Math.min(snapped, max));\n setHoverValue(clamped);\n },\n [disabled, precision, rtl, max]\n );\n\n // Handle mouse leave\n const handleMouseLeave = useCallback(() => {\n setHoverValue(null);\n }, []);\n\n // Handle keyboard\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled) return;\n\n let newValue = currentValue;\n const step = precision < 1 ? precision : 1;\n\n if (e.key === 'ArrowRight' || e.key === 'ArrowUp') {\n e.preventDefault();\n newValue = Math.min(currentValue + step, max);\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') {\n e.preventDefault();\n newValue = Math.max(currentValue - step, 0);\n } else if (e.key === 'Home') {\n e.preventDefault();\n newValue = 0;\n } else if (e.key === 'End') {\n e.preventDefault();\n newValue = max;\n }\n\n // Round to avoid floating point issues\n newValue = Math.round(newValue * 1000) / 1000;\n\n if (newValue !== currentValue) {\n if (!isControlled) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n }\n },\n [currentValue, max, precision, disabled, isControlled, onChange]\n );\n\n // Get text for current value\n const getText = () => {\n if (!showText || !texts) return null;\n const wholeIndex = Math.ceil(displayValue) - 1;\n const baseText = texts[wholeIndex] || null;\n if (!baseText) return null;\n // For fractional hover values with precision < 1, append \"+\"\n if (precision < 1 && hoverValue !== null && hoverValue % 1 !== 0) {\n return `${baseText}+`;\n }\n return baseText;\n };\n\n // Format score display\n const getScoreDisplay = () => {\n const fractional = precision < 1 && currentValue % 1 !== 0;\n if (formatNumber) {\n return formatNumber(\n currentValue,\n fractional\n ? { minimumFractionDigits: 1, maximumFractionDigits: 1 }\n : undefined\n );\n }\n if (fractional) {\n return currentValue.toFixed(1);\n }\n return currentValue;\n };\n\n // Generate classes\n const classPrefix = useClassPrefix();\n const rateClasses = usePrefixedClassNames('rate', {\n [`is-${size}`]: size,\n 'is-disabled': disabled,\n 'is-spaced': spaced,\n 'is-rtl': rtl,\n [`is-${color}`]: color,\n });\n\n const combinedClasses = classNames(\n rateClasses,\n bulmaHelperClasses,\n className\n );\n\n // Render a single icon based on priority: customIcon > iconName > default SVG\n const renderIcon = (\n iconIndex: number,\n isActive: boolean,\n fillPercent: number\n ) => {\n const iconProps: RateIconProps = {\n index: iconIndex,\n isActive,\n isHovered: hoverValue !== null && iconIndex < hoverValue,\n value: displayValue,\n fillPercent,\n };\n\n if (customIcon) {\n return customIcon(iconProps);\n }\n\n if (iconName) {\n return (\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n );\n }\n\n return <StarIcon filled={isActive} />;\n };\n\n // Render partial icon with layered approach\n const renderPartialIcon = (iconIndex: number, fillPercent: number) => {\n if (customIcon) {\n // For custom icons, pass fillPercent and let consumer handle it\n const iconProps: RateIconProps = {\n index: iconIndex,\n isActive: fillPercent > 0,\n isHovered: hoverValue !== null && iconIndex < (hoverValue ?? 0),\n value: displayValue,\n fillPercent,\n };\n return customIcon(iconProps);\n }\n\n if (iconName) {\n return (\n <span\n className={prefixedClassNames(classPrefix, 'rate-icon-partial')}\n style={\n {\n '--rate-fill-percent': `${fillPercent}%`,\n } as React.CSSProperties\n }\n >\n <span className={prefixedClassNames(classPrefix, 'rate-icon-bg')}>\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n </span>\n <span className={prefixedClassNames(classPrefix, 'rate-icon-fg')}>\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n </span>\n </span>\n );\n }\n\n // Default SVG with clipPath for partial fill\n const clipId = `rate-clip-${iconIndex}`;\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <defs>\n <clipPath id={clipId}>\n <rect\n x=\"0\"\n y=\"0\"\n width={`${(fillPercent / 100) * 24}`}\n height=\"24\"\n />\n </clipPath>\n </defs>\n {/* Background: empty star */}\n <path\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z\"\n />\n {/* Foreground: filled portion */}\n <path\n clipPath={`url(#${clipId})`}\n fill=\"currentColor\"\n d=\"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z\"\n />\n </svg>\n );\n };\n\n // The star the value falls in is the checked radio, and it carries the\n // value: a radiogroup takes no aria-value* of its own. A fractional value\n // names that star by the value itself (\"3.5 stars\"). Both go by the value\n // as that name writes it, to hundredths, so a value a hair over a whole\n // number checks that number's star under its own name, and no two stars\n // share a name.\n const shownValue = Number(currentValue.toFixed(2));\n const checkedIndex =\n shownValue > 0 ? Math.min(Math.ceil(shownValue), max) - 1 : -1;\n\n // Render icons\n const renderIcons = () => {\n const icons = [];\n\n for (let i = 0; i < max; i++) {\n const iconIndex = rtl ? max - 1 - i : i;\n const fillPercent = getFillPercent(iconIndex, displayValue);\n const isActive = fillPercent === 100;\n const isHovered = hoverValue !== null && iconIndex < hoverValue;\n const isPartial = fillPercent > 0 && fillPercent < 100;\n\n const icon = isPartial\n ? renderPartialIcon(iconIndex, fillPercent)\n : renderIcon(iconIndex, isActive, fillPercent);\n\n icons.push(\n <span\n key={iconIndex}\n className={prefixedClassNames(classPrefix, 'rate-item', {\n 'is-active': isActive,\n 'is-hovered': isHovered,\n })}\n onClick={e => handleClick(iconIndex, e)}\n onMouseEnter={() => handleMouseEnter(iconIndex)}\n onMouseMove={e => handleMouseMove(iconIndex, e)}\n onMouseLeave={handleMouseLeave}\n id={`${starBaseId}-${iconIndex}`}\n role=\"radio\"\n aria-checked={iconIndex === checkedIndex}\n aria-label={\n iconIndex === checkedIndex && shownValue % 1 !== 0\n ? `${shownValue} stars`\n : `${iconIndex + 1} star${iconIndex === 0 ? '' : 's'}`\n }\n tabIndex={-1}\n >\n {icon}\n </span>\n );\n }\n\n return icons;\n };\n\n const text = getText();\n\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n const rateItemsClass = usePrefixedClassNames('rate-items');\n const rateScoreClass = usePrefixedClassNames('rate-score');\n const rateTextClass = usePrefixedClassNames('rate-text');\n const rateCustomTextClass = usePrefixedClassNames('rate-custom-text');\n\n const rateElement = (\n <div\n ref={ref}\n className={combinedClasses}\n role=\"radiogroup\"\n // Fallback name only: a wired label names the group via labelledby.\n aria-label={ariaLabelledBy ? undefined : 'Rating'}\n aria-labelledby={ariaLabelledBy}\n // Focus stays on the group, so point it at the checked star for\n // assistive technology to announce as the value changes.\n aria-activedescendant={\n checkedIndex >= 0 ? `${starBaseId}-${checkedIndex}` : undefined\n }\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n <div className={rateItemsClass}>{renderIcons()}</div>\n {showScore && (\n <span className={rateScoreClass}>{getScoreDisplay()}</span>\n )}\n {text && <span className={rateTextClass}>{text}</span>}\n {customText && (\n <span className={rateCustomTextClass}>{customText}</span>\n )}\n {name && (\n <input type=\"hidden\" name={name} value={currentValue} form={form} />\n )}\n </div>\n );\n\n let content = rateElement;\n\n if (rendersOwnControl('Rate', { insideControl })) {\n content = <Control>{content}</Control>;\n }\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nRate.displayName = 'Rate';\n\nexport default Rate;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;AAkHA;;AAEG;AACH,MAAM,QAAQ,GAAkC,CAAC,EAAE,MAAM,EAAE,MACzDA,GAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,MAAM,EACtC,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,iBACf,MAAM,EAAA,QAAA,EAElBA,GAAA,CAAA,MAAA,EAAA,EACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,CAAC,EAAC,yWAAyW,EAAA,CAC3W,EAAA,CACE,CACP;AAED;AACA,SAAS,eAAe,CAAC,GAAW,EAAE,SAAiB,EAAA;IACrD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG,SAAS;AAChD;AAEA;AACA,SAAS,cAAc,CAAC,SAAiB,EAAE,KAAa,EAAA;AACtD,IAAA,IAAI,KAAK,IAAI,SAAS,GAAG,CAAC;AAAE,QAAA,OAAO,GAAG;IACtC,IAAI,KAAK,IAAI,SAAS;AAAE,QAAA,OAAO,CAAC;AAChC,IAAA,OAAO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EA,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEC,IAAA,CAAC,KAAK,EAAA,EACJ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EAAA,QAAA,EAAA,CAExB,OAAO,EACP,SAAS,CAAA,EAAA,CACJ;IAEZ;AAEA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,OAAO,EACP,SAAS,CAAA,EAAA,CACT;AAEP,CAAC;AAGH,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
@@ -1,4 +1,5 @@
1
1
  /* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
2
+ 'use client';
2
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
4
  import { forwardRef } from 'react';
4
5
  import { usePrefixedClassNames } from '../helpers/classNames.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../src/form/Select.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { usePrefixedClassNames } from '../helpers/classNames';\nimport { Field, FieldProps } from './Field';\nimport { Control, ControlBaseProps } from './Control';\nimport { SelectBase, SelectBaseProps } from './SelectBase';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n} from './FormContext';\nimport { useAutoLabelId } from './useAutoLabelId';\n\n/**\n * Props for the Select component.\n *\n * Composes Field, Control, and SelectBase into a single convenience component.\n * Supports all SelectBase props, plus Field-level (label, horizontal) and\n * Control-level (icons) props.\n * Inside an existing `Control` it renders no `Control` of its own, so its\n * Control-level props do nothing there and warn in development; set them on\n * that `Control` instead. Inside an outer `Field`, or a `Control` with no\n * `Field` around it, it renders no `Field` of its own either.\n * The exception is `label`, `message`, `horizontal` or `fieldClassName` in that\n * bare `Control`: it keeps a `Field` for them, nested in the `.control`, and\n * warns in development. Wrap the `Control` in a `Field` instead, and set the\n * `label`, `horizontal` and class name on that `Field`.\n */\nexport interface SelectProps extends SelectBaseProps {\n /** Field label. Automatically associated with the select via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here. */\n label?: React.ReactNode;\n /** Size for the label. */\n labelSize?: FieldProps['labelSize'];\n /** Props for the label element when the component renders its own `Field`; dropped inside an outer `Field` (use that `Field`'s `labelProps` instead). An explicit `htmlFor` key — even `undefined` — overrides the automatic association and no id is generated. */\n labelProps?: FieldProps['labelProps'];\n /** Horizontal field layout. */\n horizontal?: boolean;\n /**\n * Icon props for left icon.\n * Bulma gives control icons `pointer-events: none`, so a clickable node here\n * never receives a click. Put a button beside the input in its own addon `Control` instead.\n */\n iconLeft?: ControlBaseProps['iconLeft'];\n /** Shortcut for left icon name. */\n iconLeftName?: string;\n /** Shortcut for left icon size. */\n iconLeftSize?: ControlBaseProps['iconLeftSize'];\n /** Force left icon container. */\n hasIconsLeft?: boolean;\n /**\n * Replaces the chevron with a loading spinner.\n * Under `prefers-reduced-motion: reduce` the spinner stops and stays\n * drawn (with bestax's CSS loaded).\n */\n isLoading?: boolean;\n /** Expand the control. */\n isExpanded?: boolean;\n /** Control size. */\n controlSize?: ControlBaseProps['size'];\n /** Help/validation message below the select. */\n message?: React.ReactNode;\n /** Bulma color for the message. */\n messageColor?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Additional CSS classes for the Field. */\n fieldClassName?: string;\n /** Additional CSS classes for the Control. */\n controlClassName?: string;\n}\n\n/**\n * The `Select` component provides a Bulma-styled dropdown for selecting one or more options.\n *\n * @function\n * @param {SelectProps} props - Props for Select.\n * @returns {JSX.Element} The composed field element.\n *\n * @example\n * <Select label=\"Country\" iconLeftName=\"globe\">\n * <option>United States</option>\n * <option>Canada</option>\n * </Select>\n */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n // Field props\n label,\n labelSize,\n labelProps,\n horizontal,\n // Control props\n iconLeft,\n iconLeftName,\n iconLeftSize,\n hasIconsLeft,\n isExpanded,\n controlSize,\n // Message props\n message,\n messageColor,\n // Container class overrides\n fieldClassName,\n controlClassName,\n // Everything else (including isLoading) goes to Select.\n // Note: isLoading on a select is rendered on the .select wrapper itself\n // (replacing the chevron with a spinner), not on .control — this matches\n // Bulma's documented behavior for `<div class=\"select is-loading\">`.\n ...selectProps\n },\n ref\n ) => {\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Select', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n // Not isLoading, which the select draws itself and so keeps in a Control.\n const ownControl = rendersOwnControl('Select', {\n insideControl,\n iconLeft,\n iconLeftName,\n iconLeftSize,\n hasIconsLeft,\n isExpanded,\n controlSize,\n controlClassName,\n });\n const { controlId, fieldLabelProps } = useAutoLabelId({\n label,\n id: selectProps.id,\n labelProps,\n rendersLabel: ownField,\n });\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n\n let content = <SelectBase ref={ref} {...selectProps} id={controlId} />;\n\n if (ownControl) {\n content = (\n <Control\n iconLeft={iconLeft}\n iconLeftName={iconLeftName}\n iconLeftSize={iconLeftSize}\n hasIconsLeft={hasIconsLeft}\n isExpanded={isExpanded}\n size={controlSize}\n className={controlClassName}\n >\n {content}\n </Control>\n );\n }\n\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nSelect.displayName = 'Select';\n\nexport default Select;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;AAqEA;;;;;;;;;;;;AAY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Y,EAC1B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,gBAAgB,EAAA,QAAA,EAE1B,OAAO,EAAA,CACA,CACX;IACH;AAEA,IAAA,MAAM,SAAS,GAAG,OAAO,GAAGA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,SAAS,YAAG,OAAO,EAAA,CAAK,GAAG,IAAI;IAEzE,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEC,IAAA,CAAC,KAAK,EAAA,EACJ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EAAA,QAAA,EAAA,CAExB,OAAO,EACP,SAAS,CAAA,EAAA,CACJ;IAEZ;AAEA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,OAAO,EACP,SAAS,CAAA,EAAA,CACT;AAEP,CAAC;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../src/form/Select.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { usePrefixedClassNames } from '../helpers/classNames';\nimport { Field, FieldProps } from './Field';\nimport { Control, ControlBaseProps } from './Control';\nimport { SelectBase, SelectBaseProps } from './SelectBase';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n} from './FormContext';\nimport { useAutoLabelId } from './useAutoLabelId';\n\n/**\n * Props for the Select component.\n *\n * Composes Field, Control, and SelectBase into a single convenience component.\n * Supports all SelectBase props, plus Field-level (label, horizontal) and\n * Control-level (icons) props.\n * Inside an existing `Control` it renders no `Control` of its own, so its\n * Control-level props do nothing there and warn in development; set them on\n * that `Control` instead. Inside an outer `Field`, or a `Control` with no\n * `Field` around it, it renders no `Field` of its own either.\n * The exception is `label`, `message`, `horizontal` or `fieldClassName` in that\n * bare `Control`: it keeps a `Field` for them, nested in the `.control`, and\n * warns in development. Wrap the `Control` in a `Field` instead, and set the\n * `label`, `horizontal` and class name on that `Field`.\n */\nexport interface SelectProps extends SelectBaseProps {\n /** Field label. Automatically associated with the select via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here. */\n label?: React.ReactNode;\n /** Size for the label. */\n labelSize?: FieldProps['labelSize'];\n /** Props for the label element when the component renders its own `Field`; dropped inside an outer `Field` (use that `Field`'s `labelProps` instead). An explicit `htmlFor` key — even `undefined` — overrides the automatic association and no id is generated. */\n labelProps?: FieldProps['labelProps'];\n /** Horizontal field layout. */\n horizontal?: boolean;\n /**\n * Icon props for left icon.\n * Bulma gives control icons `pointer-events: none`, so a clickable node here\n * never receives a click. Put a button beside the input in its own addon `Control` instead.\n */\n iconLeft?: ControlBaseProps['iconLeft'];\n /** Shortcut for left icon name. */\n iconLeftName?: string;\n /** Shortcut for left icon size. */\n iconLeftSize?: ControlBaseProps['iconLeftSize'];\n /** Force left icon container. */\n hasIconsLeft?: boolean;\n /**\n * Replaces the chevron with a loading spinner.\n * Under `prefers-reduced-motion: reduce` the spinner stops and stays\n * drawn (with bestax's CSS loaded).\n */\n isLoading?: boolean;\n /** Expand the control. */\n isExpanded?: boolean;\n /** Control size. */\n controlSize?: ControlBaseProps['size'];\n /** Help/validation message below the select. */\n message?: React.ReactNode;\n /** Bulma color for the message. */\n messageColor?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Additional CSS classes for the Field. */\n fieldClassName?: string;\n /** Additional CSS classes for the Control. */\n controlClassName?: string;\n}\n\n/**\n * The `Select` component provides a Bulma-styled dropdown for selecting one or more options.\n *\n * @function\n * @param {SelectProps} props - Props for Select.\n * @returns {JSX.Element} The composed field element.\n *\n * @example\n * <Select label=\"Country\" iconLeftName=\"globe\">\n * <option>United States</option>\n * <option>Canada</option>\n * </Select>\n */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n // Field props\n label,\n labelSize,\n labelProps,\n horizontal,\n // Control props\n iconLeft,\n iconLeftName,\n iconLeftSize,\n hasIconsLeft,\n isExpanded,\n controlSize,\n // Message props\n message,\n messageColor,\n // Container class overrides\n fieldClassName,\n controlClassName,\n // Everything else (including isLoading) goes to Select.\n // Note: isLoading on a select is rendered on the .select wrapper itself\n // (replacing the chevron with a spinner), not on .control — this matches\n // Bulma's documented behavior for `<div class=\"select is-loading\">`.\n ...selectProps\n },\n ref\n ) => {\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Select', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n // Not isLoading, which the select draws itself and so keeps in a Control.\n const ownControl = rendersOwnControl('Select', {\n insideControl,\n iconLeft,\n iconLeftName,\n iconLeftSize,\n hasIconsLeft,\n isExpanded,\n controlSize,\n controlClassName,\n });\n const { controlId, fieldLabelProps } = useAutoLabelId({\n label,\n id: selectProps.id,\n labelProps,\n rendersLabel: ownField,\n });\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n\n let content = <SelectBase ref={ref} {...selectProps} id={controlId} />;\n\n if (ownControl) {\n content = (\n <Control\n iconLeft={iconLeft}\n iconLeftName={iconLeftName}\n iconLeftSize={iconLeftSize}\n hasIconsLeft={hasIconsLeft}\n isExpanded={isExpanded}\n size={controlSize}\n className={controlClassName}\n >\n {content}\n </Control>\n );\n }\n\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nSelect.displayName =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ACd,QAAA,OAAO,IACLA,GAAA,CAAC,OAAO,EAAA,EACN,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,gBAAgB,EAAA,QAAA,EAE1B,OAAO,EAAA,CACA,CACX;IACH;AAEA,IAAA,MAAM,SAAS,GAAG,OAAO,GAAGA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,SAAS,YAAG,OAAO,EAAA,CAAK,GAAG,IAAI;IAEzE,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEC,IAAA,CAAC,KAAK,EAAA,EACJ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EAAA,QAAA,EAAA,CAExB,OAAO,EACP,SAAS,CAAA,EAAA,CACJ;IAEZ;AAEA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,OAAO,EACP,SAAS,CAAA,EAAA,CACT;AAEP,CAAC;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;"}
@@ -1,4 +1,5 @@
1
1
  /* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
2
+ 'use client';
2
3
  import { jsx } from 'react/jsx-runtime';
3
4
  import { forwardRef } from 'react';
4
5
  import { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
@@ -1 +1 @@
1
- {"version":3,"file":"SelectBase.js","sources":["../../../src/form/SelectBase.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { useFieldLabelTarget, useFieldsetDisabled } from './FormContext';\n\n/**\n * Props for the Select component.\n *\n * @helperProps Helper props go on the `.select` wrapper `<div>`, with\n * `className`. The other attributes go on the `<select>`.\n */\nexport interface SelectBaseProps\n extends\n Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'>,\n Omit<BulmaClassesProps, 'color'> {\n /** Bulma color modifier for the select. */\n color?:\n | 'primary'\n | 'link'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger'\n | 'black'\n | 'dark'\n | 'light'\n | 'white';\n /** Size modifier for the select. */\n size?: 'small' | 'medium' | 'large';\n /** Rounded select corners. */\n isRounded?: boolean;\n /**\n * Replaces the chevron with a loading spinner.\n * Under `prefers-reduced-motion: reduce` the spinner stops and stays\n * drawn (with bestax's CSS loaded).\n */\n isLoading?: boolean;\n /** Applies Bulma's is-active modifier. */\n isActive?: boolean;\n /** Forces hovered state on the inner select. */\n isHovered?: boolean;\n /** Forces focused state on the inner select. */\n isFocused?: boolean;\n /** Makes the select span the full width of parent. */\n isFullwidth?: boolean;\n /** Makes the select span the full width of parent. @deprecated Use `isFullwidth` instead — `isFullwidth` wins if both are set. */\n isFullWidth?: boolean;\n /** Additional CSS classes to apply. */\n className?: string;\n /** Disables the select. */\n disabled?: boolean;\n /** Allows multiple selections. */\n multiple?: boolean;\n /** Number of visible options in multiselect. */\n multipleSize?: number;\n /** `<option>` elements. */\n children?: React.ReactNode;\n}\n\n/**\n * Bulma Select component with full Bulma helper class support.\n *\n * @function\n * @param {SelectBaseProps} props - Props for the SelectBase component.\n * @returns {JSX.Element} The rendered select element.\n * @see {@link https://bulma.io/documentation/form/select/ | Bulma Select documentation}\n */\nexport const SelectBase = forwardRef<HTMLSelectElement, SelectBaseProps>(\n (\n {\n color,\n size,\n isRounded,\n isLoading,\n isActive,\n isHovered,\n isFocused,\n isFullwidth,\n isFullWidth,\n className,\n disabled: disabledProp,\n children,\n multiple,\n multipleSize,\n ...props\n },\n ref\n ) => {\n const disabled = useFieldsetDisabled(disabledProp);\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color,\n ...props,\n });\n // A labeled Field's generated id when no user id arrived (rest.id may be\n // an undefined own key), reported to that Field (#1004).\n const id = useFieldLabelTarget(rest.id);\n\n const mainClass = usePrefixedClassNames('select', {\n [`is-${color}`]: !!color,\n [`is-${size}`]: !!size,\n 'is-rounded': isRounded,\n 'is-loading': isLoading,\n 'is-active': isActive,\n 'is-multiple': !!multiple,\n 'is-fullwidth': isFullwidth ?? isFullWidth,\n });\n const selectClass = classNames(mainClass, bulmaHelperClasses, className);\n\n // is-hovered / is-focused belong on the inner <select> element, not the wrapper.\n const innerSelectClass = usePrefixedClassNames('', {\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n });\n\n // Only set size attribute when multiple is true and multipleSize is specified\n const selectProps: React.SelectHTMLAttributes<HTMLSelectElement> = {\n disabled,\n multiple,\n ...rest,\n };\n\n if (multiple && typeof multipleSize === 'number') {\n selectProps.size = multipleSize;\n }\n\n return (\n <div className={selectClass}>\n <select\n ref={ref}\n className={innerSelectClass || undefined}\n {...selectProps}\n // After the spread, which may carry an undefined id key; the id\n // belongs on the inner <select>.\n id={id}\n >\n {children}\n </select>\n </div>\n );\n }\n);\n\nSelectBase.displayName = 'SelectBase';\n\nexport default SelectBase;\n"],"names":["_jsx"],"mappings":";;;;;;;AA2DA;;;;;;;AAOG;MACU,UAAU,GAAG,UAAU,CAClC,CACE,EACE,KAAK,EACL,IAAI,EACJ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,QAAQ,EAAE,YAAY,EACtB,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,GAAG,KAAK,EACT,EACD,GAAG,KACD;AACF,IAAA,MAAM,QAAQ,GAAG,mBAAmB,CAAC,YAAY,CAAC;AAClD,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;QACnD,KAAK;AACL,QAAA,GAAG,KAAK;AACT,KAAA,CAAC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';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { useFieldLabelTarget, useFieldsetDisabled } from './FormContext';\n\n/**\n * Props for the Select component.\n *\n * @helperProps Helper props go on the `.select` wrapper `<div>`, with\n * `className`. The other attributes go on the `<select>`.\n */\nexport interface SelectBaseProps\n extends\n Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'>,\n Omit<BulmaClassesProps, 'color'> {\n /** Bulma color modifier for the select. */\n color?:\n | 'primary'\n | 'link'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger'\n | 'black'\n | 'dark'\n | 'light'\n | 'white';\n /** Size modifier for the select. */\n size?: 'small' | 'medium' | 'large';\n /** Rounded select corners. */\n isRounded?: boolean;\n /**\n * Replaces the chevron with a loading spinner.\n * Under `prefers-reduced-motion: reduce` the spinner stops and stays\n * drawn (with bestax's CSS loaded).\n */\n isLoading?: boolean;\n /** Applies Bulma's is-active modifier. */\n isActive?: boolean;\n /** Forces hovered state on the inner select. */\n isHovered?: boolean;\n /** Forces focused state on the inner select. */\n isFocused?: boolean;\n /** Makes the select span the full width of parent. */\n isFullwidth?: boolean;\n /** Makes the select span the full width of parent. @deprecated Use `isFullwidth` instead — `isFullwidth` wins if both are set. */\n isFullWidth?: boolean;\n /** Additional CSS classes to apply. */\n className?: string;\n /** Disables the select. */\n disabled?: boolean;\n /** Allows multiple selections. */\n multiple?: boolean;\n /** Number of visible options in multiselect. */\n multipleSize?: number;\n /** `<option>` elements. */\n children?: React.ReactNode;\n}\n\n/**\n * Bulma Select component with full Bulma helper class support.\n *\n * @function\n * @param {SelectBaseProps} props - Props for the SelectBase component.\n * @returns {JSX.Element} The rendered select element.\n * @see {@link https://bulma.io/documentation/form/select/ | Bulma Select documentation}\n */\nexport const SelectBase = forwardRef<HTMLSelectElement, SelectBaseProps>(\n (\n {\n color,\n size,\n isRounded,\n isLoading,\n isActive,\n isHovered,\n isFocused,\n isFullwidth,\n isFullWidth,\n className,\n disabled: disabledProp,\n children,\n multiple,\n multipleSize,\n ...props\n },\n ref\n ) => {\n const disabled = useFieldsetDisabled(disabledProp);\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color,\n ...props,\n });\n // A labeled Field's generated id when no user id arrived (rest.id may be\n // an undefined own key), reported to that Field (#1004).\n const id = useFieldLabelTarget(rest.id);\n\n const mainClass = usePrefixedClassNames('select', {\n [`is-${color}`]: !!color,\n [`is-${size}`]: !!size,\n 'is-rounded': isRounded,\n 'is-loading': isLoading,\n 'is-active': isActive,\n 'is-multiple': !!multiple,\n 'is-fullwidth': isFullwidth ?? isFullWidth,\n });\n const selectClass = classNames(mainClass, bulmaHelperClasses, className);\n\n // is-hovered / is-focused belong on the inner <select> element, not the wrapper.\n const innerSelectClass = usePrefixedClassNames('', {\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n });\n\n // Only set size attribute when multiple is true and multipleSize is specified\n const selectProps: React.SelectHTMLAttributes<HTMLSelectElement> = {\n disabled,\n multiple,\n ...rest,\n };\n\n if (multiple && typeof multipleSize === 'number') {\n selectProps.size = multipleSize;\n }\n\n return (\n <div className={selectClass}>\n <select\n ref={ref}\n className={innerSelectClass || undefined}\n {...selectProps}\n // After the spread, which may carry an undefined id key; the id\n // belongs on the inner <select>.\n id={id}\n >\n {children}\n </select>\n </div>\n );\n }\n);\n\nSelectBase.displayName = 'SelectBase';\n\nexport default SelectBase;\n"],"names":["_jsx"],"mappings":";;;;;;;;AA2DA;;;;;;;AAOG;MACU,UAAU,GAAG,UAAU,CAClC,CACE,EACE,KAAK,EACL,IAAI,EACJ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,QAAQ,EAAE,YAAY,EACtB,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,GAAG,KAAK,EACT,EACD,GAAG,KACD;AACF,IAAA,MAAM,QAAQ,GAAG,mBAAm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,CACL;AAEV,CAAC;AAGH,UAAU,CAAC,WAAW,GAAG,YAAY;;"}
@@ -1,4 +1,5 @@
1
1
  /* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
2
+ 'use client';
2
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
4
  import { forwardRef, useId, useState, useRef, useCallback, useMemo } from 'react';
4
5
  import { usePrefixedClassNames, classNames, prefixedClassNames } from '../helpers/classNames.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sources":["../../../src/form/Slider.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useState,\n useCallback,\n useRef,\n useMemo,\n useId,\n} from 'react';\nimport {\n classNames,\n prefixedClassNames,\n usePrefixedClassNames,\n} from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { useClassPrefix } from '../helpers/Config';\nimport { useNumberFormat } from '../helpers/localeFormat';\nimport { useClientLayoutEffect } from '../helpers/useClientLayoutEffect';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n useFieldsetDisabled,\n} from './FormContext';\nimport { Field } from './Field';\nimport { Control } from './Control';\nimport { FormFieldProps } from './fieldProps';\nimport { useAutoLabelId } from './useAutoLabelId';\n\n/** Valid sizes for the Slider component. */\nexport type SliderSize = 'small' | 'medium' | 'large';\n\n/** Valid colors for the Slider component. */\nexport type SliderColor =\n 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n\n/** Tooltip display mode for the Slider component. */\nexport type SliderTooltip = 'auto' | 'always' | 'hidden';\n\n/** Orientation of the Slider component. */\nexport type SliderOrientation = 'horizontal' | 'vertical';\n\n/**\n * A tick mark displayed along the Slider track.\n */\nexport interface SliderMark {\n /** Controlled value. */\n value: number;\n /** Optional label rendered below the tick mark. */\n label?: React.ReactNode;\n}\n\n/**\n * Shared base props for single and range Slider modes.\n */\ninterface SliderBaseProps\n extends\n Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'color' | 'size' | 'onChange' | 'value' | 'defaultValue'\n >,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>,\n FormFieldProps {\n /** Field label. Automatically associated with the slider input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In range mode the `htmlFor` targets the low (minimum) thumb, and the label also starts each thumb's name through `aria-labelledby`, as in \"Price Minimum value\" and \"Price Maximum value\", unless an `aria-label` or `aria-labelledby` on the Slider takes its place there. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here, naming a range Slider's thumbs the same way. A `Field` label you wire by hand to the low thumb with `labelProps.htmlFor` names the thumbs too when you also give it an `id` there, since the `Field` generates none for it. */\n label?: React.ReactNode;\n /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). In range mode an `id` here is the one the thumbs' `aria-labelledby` points at, in place of a generated one. */\n labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {\n [key: string]: unknown;\n };\n /** Minimum value. */\n min?: number;\n /** Maximum value. */\n max?: number;\n /** Step increment (default: 1). */\n step?: number;\n /** Size variant. */\n size?: SliderSize;\n /** Color variant. */\n color?: SliderColor;\n /** Use rounded track ends. */\n isRounded?: boolean;\n /** Use circular thumb. */\n isCircle?: boolean;\n /** Show current value tooltip. */\n showOutput?: boolean;\n /** Controls tooltip visibility on the thumb. */\n tooltip?: SliderTooltip;\n /** Shows tick marks along the track. */\n ticks?: boolean;\n /** Custom labeled marks along the track. Each mark has `{ value: number; label?: ReactNode }`. */\n marks?: SliderMark[];\n /** Orientation of the slider. */\n orientation?: SliderOrientation;\n /**\n * Function to scale the displayed value. With it, and no `getAriaValueText`,\n * the scaled value is also the thumb's `aria-valuetext`.\n */\n scale?: (value: number) => number;\n /** Function to generate the `aria-valuetext` attribute. */\n getAriaValueText?: (value: number) => string;\n /**\n * Format function for output display. Without it, the output shows the\n * value as it is, or inside a `LocaleProvider` with a `locale`, written\n * the way that locale writes numbers, to at most three decimals.\n */\n formatOutput?: (value: number) => string;\n}\n\n/**\n * Props for the Slider in single-value mode.\n */\nexport interface SliderSingleProps extends SliderBaseProps {\n /**\n * Enables range mode with two thumbs.\n * @defaultValue false\n */\n range?: false;\n /** Controlled value. */\n value?: number;\n /**\n * Default value for uncontrolled usage.\n * @defaultValue 0\n */\n defaultValue?: number;\n /** Callback when value changes. */\n onChange?: (value: number) => void;\n /**\n * Minimum distance between thumbs in range mode.\n * @defaultValue 0\n */\n minDistance?: never;\n /** ARIA label(s) for the slider thumb(s), which win over a label, the Slider's own or a surrounding `Field`'s. In range mode each entry is that thumb's whole name, and a thumb without one is named \"Minimum value\" or \"Maximum value\", after whatever names the Slider: a label, or in its place an `aria-label` or `aria-labelledby` given to the Slider, as in \"Budget Minimum value\" and \"Budget Maximum value\". An `aria-labelledby` set to `undefined` keeps every label out of both names. */\n ariaLabel?: string;\n}\n\n/**\n * Props for the Slider in range (dual-thumb) mode.\n */\nexport interface SliderRangeProps extends SliderBaseProps {\n /**\n * Enables range mode with two thumbs.\n * @defaultValue false\n */\n range: true;\n /** Controlled value. */\n value?: [number, number];\n /**\n * Default value for uncontrolled usage.\n * @defaultValue 0\n */\n defaultValue?: [number, number];\n /** Callback when value changes. */\n onChange?: (value: [number, number]) => void;\n /**\n * Minimum distance between thumbs in range mode.\n * @defaultValue 0\n */\n minDistance?: number;\n /** ARIA label(s) for the slider thumb(s), which win over a label, the Slider's own or a surrounding `Field`'s. In range mode each entry is that thumb's whole name, and a thumb without one is named \"Minimum value\" or \"Maximum value\", after whatever names the Slider: a label, or in its place an `aria-label` or `aria-labelledby` given to the Slider, as in \"Budget Minimum value\" and \"Budget Maximum value\". An `aria-labelledby` set to `undefined` keeps every label out of both names. */\n ariaLabel?: [string, string];\n /** Form field name for the low thumb. Use this in range mode so each thumb submits with its own name. */\n nameLow?: string;\n /** Form field name for the high thumb. */\n nameHigh?: string;\n}\n\n/**\n * Props for the Slider component — a discriminated union of single and range modes.\n * Inside an existing `Control` it renders no `Control` of its own. Inside an\n * outer `Field`, or a `Control` with no `Field` around it, it renders no\n * `Field` of its own either. The exception is `label`, `message`, `horizontal`\n * or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,\n * nested in the `.control`, and warns in development. Wrap the `Control` in a\n * `Field` instead, and set the `label`, `horizontal` and class name on that\n * `Field`.\n * @helperProps Helper props go on the `.slider` wrapper `<div>`, with\n * `className`. The other attributes go on the `<input>`, the low thumb's in\n * range mode.\n * @extraProp {boolean} [disabled=false] - Whether the slider is disabled.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the input element.\n */\nexport type SliderProps = SliderSingleProps | SliderRangeProps;\n\n/**\n * Helper to compute tick positions.\n * If `marks` are provided, those positions are used.\n * If `ticks` is true, generates ticks at every step (capped at 100).\n */\nfunction getTickPositions(\n min: number,\n max: number,\n step: number,\n ticks?: boolean,\n marks?: SliderMark[]\n): SliderMark[] {\n if (marks && marks.length > 0) return marks;\n if (!ticks) return [];\n const positions: SliderMark[] = [];\n const count = Math.round((max - min) / step);\n if (count > 100) {\n // Cap at 100 ticks to prevent perf issues\n const tickStep = (max - min) / 100;\n // Skip first (i=0) and last (i=100) — no ticks at endpoints\n for (let i = 1; i < 100; i++) {\n positions.push({ value: min + i * tickStep });\n }\n } else {\n // Skip first (i=0) and last (i=count) — no ticks at endpoints\n for (let i = 1; i < count; i++) {\n positions.push({ value: min + i * step });\n }\n }\n return positions;\n}\n\n/**\n * The `Slider` component provides a range slider input for selecting values within a range.\n *\n * @function\n * @param {SliderProps} props - Props for the Slider component.\n * @returns {JSX.Element} The rendered slider element.\n *\n * @example\n * // Basic slider\n * <Slider defaultValue={50} />\n *\n * @example\n * // Range slider\n * <Slider range defaultValue={[20, 80]} onChange={([low, high]) => {}} />\n */\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(\n (props, ref) => {\n // Pull out fields that differ between the single and range branches\n // *first*, by narrowing on the `range` discriminator. We then destructure\n // the remaining base props from a `SliderBaseProps` view of `props`.\n //\n // Why not destructure everything via `props as SliderRangeProps & SliderSingleProps`?\n // Because intersecting the two halves of a discriminated union collapses\n // overlapping fields (e.g. `range: true & false`, `value: number & [number, number]`,\n // `onChange`, `ariaLabel`) to `never`, which breaks call sites and rest spreads.\n let range: boolean | undefined;\n let controlledValue: number | [number, number] | undefined;\n let defaultValue: number | [number, number] | undefined;\n let onChange:\n ((v: number) => void) | ((v: [number, number]) => void) | undefined;\n let ariaLabel: string | [string, string] | undefined;\n let minDistance = 0;\n let nameLow: string | undefined;\n let nameHigh: string | undefined;\n if (props.range === true) {\n range = true;\n controlledValue = props.value;\n defaultValue = props.defaultValue;\n onChange = props.onChange;\n ariaLabel = props.ariaLabel;\n minDistance = props.minDistance ?? 0;\n nameLow = props.nameLow;\n nameHigh = props.nameHigh;\n } else {\n range = props.range;\n controlledValue = props.value;\n defaultValue = props.defaultValue;\n onChange = props.onChange;\n ariaLabel = props.ariaLabel;\n }\n\n // Destructure base / shared props from a `SliderBaseProps` view. None of\n // these fields differ between the two branches, so this view is safe.\n const {\n label,\n labelSize,\n labelProps,\n horizontal,\n message,\n messageColor,\n fieldClassName,\n min = 0,\n max = 100,\n step = 1,\n size,\n color,\n isRounded = false,\n isCircle = false,\n disabled: disabledProp,\n showOutput = false,\n tooltip,\n ticks,\n marks,\n orientation = 'horizontal',\n scale,\n getAriaValueText,\n formatOutput,\n className,\n // Strip the discriminated/union fields from `restProps` so they don't\n // flow back into `useBulmaClasses` / spread onto inputs.\n range: _range,\n value: _value,\n defaultValue: _defaultValue,\n onChange: _onChange,\n ariaLabel: _ariaLabel,\n minDistance: _minDistance,\n nameLow: _nameLow,\n nameHigh: _nameHigh,\n ...restProps\n } = props as SliderBaseProps & {\n range?: boolean;\n value?: number | [number, number];\n defaultValue?: number | [number, number];\n onChange?: (v: never) => void;\n ariaLabel?: string | [string, string];\n minDistance?: number;\n nameLow?: string;\n nameHigh?: string;\n };\n void _range;\n void _value;\n void _defaultValue;\n void _onChange;\n void _ariaLabel;\n void _minDistance;\n void _nameLow;\n void _nameHigh;\n\n const disabled = useFieldsetDisabled(disabledProp);\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Slider', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n const { bulmaHelperClasses, rest } = useBulmaClasses(restProps);\n // In range mode the low thumb carries `rest` (and any user id), so the\n // label's `for` targets it.\n const { controlId, fieldLabelProps, labelId } = useAutoLabelId({\n label,\n id: restProps.id,\n labelProps,\n rendersLabel: ownField,\n needsLabelId: !!range,\n });\n\n // A range thumb's default name is an `aria-label`, which outranks the\n // label's `for`, so a label naming the Slider reaches each thumb through\n // `aria-labelledby` instead: the label, then a hidden span holding the\n // thumb's own text, as in \"Price Minimum value\" (#981). An `ariaLabel`\n // entry is that thumb's whole name and wins.\n const thumbTextId = useId();\n const thumbLabels = range\n ? (ariaLabel as [string, string] | undefined)\n : undefined;\n // A caller's `aria-label` or `aria-labelledby` names the Slider in the\n // label's place, so both thumbs read it before their own text. They are\n // routed here rather than spread, since the spread reaches only the low\n // thumb and would leave the pair with two unrelated names. Presence for\n // aria-labelledby, as on a group (#974): the caller's key takes the naming\n // over whatever its value, so an undefined one keeps every label out and\n // leaves both thumbs their bare text. A non-empty one wins over an\n // aria-label, as it does in the browser's name computation.\n const {\n 'aria-label': callerLabel,\n 'aria-labelledby': callerLabelledBy,\n ...thumbRest\n } = rest;\n const callerNamed = !!callerLabel || 'aria-labelledby' in rest;\n const stemRef = callerLabelledBy || (callerNamed ? undefined : labelId);\n const stemText = stemRef ? undefined : callerLabel;\n const nameThumb = (\n own: string | undefined,\n text: string,\n textId: string\n ) => {\n const wired = !!stemRef && !own;\n return {\n text,\n textId,\n wired,\n aria: wired\n ? { 'aria-labelledby': `${stemRef} ${textId}` }\n : { 'aria-label': own || (stemText ? `${stemText} ${text}` : text) },\n };\n };\n const lowThumb = nameThumb(\n thumbLabels?.[0],\n 'Minimum value',\n `${thumbTextId}-min`\n );\n const highThumb = nameThumb(\n thumbLabels?.[1],\n 'Maximum value',\n `${thumbTextId}-max`\n );\n\n // Resolve tooltip mode: explicit tooltip prop takes precedence, else showOutput maps to 'auto'\n const tooltipMode: SliderTooltip =\n tooltip ?? (showOutput ? 'auto' : 'hidden');\n\n // --- Range mode state ---\n const [internalRange, setInternalRange] = useState<[number, number]>(() =>\n range ? ((defaultValue as [number, number]) ?? [min, max]) : [min, min]\n );\n const [internalSingle, setInternalSingle] = useState<number>(() =>\n !range ? ((defaultValue as number) ?? 0) : 0\n );\n const [showTooltip, setShowTooltip] = useState(false);\n const [showTooltipHigh, setShowTooltipHigh] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputHighRef = useRef<HTMLInputElement>(null);\n const outputRef = useRef<HTMLOutputElement>(null);\n const outputHighRef = useRef<HTMLOutputElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [flipped, setFlipped] = useState(false);\n const [flippedHigh, setFlippedHigh] = useState(false);\n const [nudgeX, setNudgeX] = useState(0);\n const [nudgeXHigh, setNudgeXHigh] = useState(0);\n const [verticalFlippedLeft, setVerticalFlippedLeft] = useState(false);\n\n const isControlled = controlledValue !== undefined;\n\n // Current values\n const currentRange: [number, number] = range\n ? isControlled\n ? (controlledValue as [number, number])\n : internalRange\n : [0, 0];\n const currentSingle: number = !range\n ? isControlled\n ? (controlledValue as number)\n : internalSingle\n : 0;\n\n // Progress percentages\n const progressSingle = !range\n ? ((currentSingle - min) / (max - min)) * 100\n : 0;\n const progressLow = range\n ? ((currentRange[0] - min) / (max - min)) * 100\n : 0;\n const progressHigh = range\n ? ((currentRange[1] - min) / (max - min)) * 100\n : 0;\n\n // Scale helper\n const scaleValue = useCallback(\n (v: number) => (scale ? scale(v) : v),\n [scale]\n );\n\n // Format helper: the caller's, else the locale's, else the number as is.\n const formatNumber = useNumberFormat();\n const writeNumber = useCallback(\n (v: number) => (formatNumber ? formatNumber(v) : v.toString()),\n [formatNumber]\n );\n const formatValue = useCallback(\n (v: number) => {\n const scaled = scaleValue(v);\n return formatOutput ? formatOutput(scaled) : writeNumber(scaled);\n },\n [formatOutput, scaleValue, writeNumber]\n );\n\n // --- Handlers ---\n const handleSingleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = parseFloat(e.target.value);\n if (!isControlled) setInternalSingle(newValue);\n (onChange as ((v: number) => void) | undefined)?.(newValue);\n },\n [isControlled, onChange]\n );\n\n const handleRangeLowChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const raw = parseFloat(e.target.value);\n const clamped = Math.min(raw, currentRange[1] - minDistance);\n const newRange: [number, number] = [clamped, currentRange[1]];\n if (!isControlled) setInternalRange(newRange);\n (onChange as ((v: [number, number]) => void) | undefined)?.(newRange);\n },\n [isControlled, onChange, currentRange, minDistance]\n );\n\n const handleRangeHighChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const raw = parseFloat(e.target.value);\n const clamped = Math.max(raw, currentRange[0] + minDistance);\n const newRange: [number, number] = [currentRange[0], clamped];\n if (!isControlled) setInternalRange(newRange);\n (onChange as ((v: [number, number]) => void) | undefined)?.(newRange);\n },\n [isControlled, onChange, currentRange, minDistance]\n );\n\n // Key handler for Home/End\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Home') {\n e.preventDefault();\n if (!range) {\n if (!isControlled) setInternalSingle(min);\n (onChange as ((v: number) => void) | undefined)?.(min);\n }\n } else if (e.key === 'End') {\n e.preventDefault();\n if (!range) {\n if (!isControlled) setInternalSingle(max);\n (onChange as ((v: number) => void) | undefined)?.(max);\n }\n }\n },\n [range, isControlled, onChange, min, max]\n );\n\n // Tick positions\n const tickPositions = useMemo(\n () => getTickPositions(min, max, step, ticks, marks),\n [min, max, step, ticks, marks]\n );\n\n const hasLabels = tickPositions.some(t => t.label !== undefined);\n const isVertical = orientation === 'vertical';\n\n // Compute corrected thumb position CSS calc expression.\n // The browser insets the range input thumb by half its size from each edge,\n // so the tooltip left must account for this to align with the thumb center.\n const thumbVarName = size\n ? `slider-thumb-size-${size}`\n : 'slider-thumb-size';\n const thumbCssVar = `var(--bulma-${thumbVarName})`;\n const effectiveThumbExpr = isCircle\n ? `(${thumbCssVar} * 1.2)`\n : thumbCssVar;\n\n const getThumbLeft = (progressPct: number) => {\n const fraction = progressPct / 100;\n return `calc(${effectiveThumbExpr} / 2 + ${fraction} * (100% - ${effectiveThumbExpr}))`;\n };\n\n // Vertical tooltip offset: position to the right or left of the thumb\n const verticalTooltipOffset = `calc(50% + ${effectiveThumbExpr} / 2 + 0.5rem)`;\n\n // Get effective thumb size in px for nudge computation\n const getThumbSizePx = (): number => {\n const el = inputRef.current;\n if (!el) return 0;\n const style = getComputedStyle(el);\n const raw = style.getPropertyValue(`--bulma-${thumbVarName}`).trim();\n const value = parseFloat(raw);\n if (isNaN(value)) return 0;\n let px: number;\n if (raw.includes('rem')) {\n const rootFs =\n parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n px = value * rootFs;\n } else {\n px = value;\n }\n return isCircle ? px * 1.2 : px;\n };\n\n // Generate wrapper classes\n const classPrefix = useClassPrefix();\n const sliderClasses = usePrefixedClassNames('slider', {\n [`is-${size}`]: size,\n [`is-${color}`]: color,\n 'is-rounded': isRounded,\n 'is-circle': isCircle,\n 'is-disabled': disabled,\n 'has-output': tooltipMode !== 'hidden',\n 'has-output-always': tooltipMode === 'always',\n 'is-vertical': isVertical,\n 'is-range': range,\n 'has-ticks': tickPositions.length > 0,\n 'has-tick-labels': hasLabels,\n });\n\n const combinedClasses = classNames(\n sliderClasses,\n bulmaHelperClasses,\n className\n );\n\n // Combined ref for the first (or only) input\n const combinedRef = (node: HTMLInputElement | null) => {\n (inputRef as React.MutableRefObject<HTMLInputElement | null>).current =\n node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLInputElement | null>).current = node;\n }\n };\n\n // Tooltip show/hide for auto mode\n const showTipLow =\n tooltipMode === 'always' || (tooltipMode === 'auto' && showTooltip);\n const showTipHigh =\n tooltipMode === 'always' || (tooltipMode === 'auto' && showTooltipHigh);\n\n // Aria value text\n const getAriaProps = (value: number) => {\n const ariaProps: Record<string, string> = {};\n if (getAriaValueText) {\n ariaProps['aria-valuetext'] = getAriaValueText(value);\n } else if (scale) {\n ariaProps['aria-valuetext'] = writeNumber(scaleValue(value));\n }\n return ariaProps;\n };\n\n // Detect tooltip overflow: flip vertically if clipped at top,\n // nudge horizontally if clipped at left/right edge.\n // We compute the un-nudged tooltip position from the progress %\n // and wrapper rect to avoid feedback loops.\n const computeNudge = useCallback(\n (\n el: HTMLElement,\n wrapper: HTMLElement,\n progressPct: number,\n thumbSizePx: number\n ): number => {\n const wr = wrapper.getBoundingClientRect();\n const tooltipWidth = el.offsetWidth;\n // Corrected center: accounts for thumb inset from track edges\n const fraction = progressPct / 100;\n const centerX =\n wr.left + thumbSizePx / 2 + fraction * (wr.width - thumbSizePx);\n const tooltipLeft = centerX - tooltipWidth / 2;\n const tooltipRight = centerX + tooltipWidth / 2;\n if (tooltipLeft < wr.left) {\n return wr.left - tooltipLeft; // nudge right\n }\n if (tooltipRight > wr.right) {\n return wr.right - tooltipRight; // nudge left (negative)\n }\n return 0;\n },\n []\n );\n\n useClientLayoutEffect(() => {\n if (isVertical) return;\n const wrapper = wrapperRef.current;\n const el = outputRef.current;\n if (wrapper && el) {\n const wrapperTop = wrapper.getBoundingClientRect().top;\n const tooltipHeight = el.offsetHeight + 10;\n setFlipped(wrapperTop < tooltipHeight);\n const pct = range ? progressLow : progressSingle;\n const thumbPx = getThumbSizePx();\n setNudgeX(computeNudge(el, wrapper, pct, thumbPx));\n }\n });\n\n useClientLayoutEffect(() => {\n if (isVertical || !range) return;\n const wrapper = wrapperRef.current;\n const el = outputHighRef.current;\n if (wrapper && el) {\n const wrapperTop = wrapper.getBoundingClientRect().top;\n const tooltipHeight = el.offsetHeight + 10;\n setFlippedHigh(wrapperTop < tooltipHeight);\n const thumbPx = getThumbSizePx();\n setNudgeXHigh(computeNudge(el, wrapper, progressHigh, thumbPx));\n }\n });\n\n // Detect vertical tooltip overflow: flip to left if no space on right\n useClientLayoutEffect(() => {\n if (!isVertical) return;\n const wrapper = wrapperRef.current;\n const el = outputRef.current;\n if (!wrapper || !el) return;\n const wrapperRect = wrapper.getBoundingClientRect();\n const tooltipWidth = el.offsetWidth;\n const thumbPx = getThumbSizePx();\n const gap = 8; // 0.5rem\n // Tooltip right edge if placed to the right of the thumb\n const tooltipRightEdge =\n wrapperRect.left +\n wrapperRect.width / 2 +\n thumbPx / 2 +\n gap +\n tooltipWidth;\n setVerticalFlippedLeft(tooltipRightEdge > window.innerWidth);\n });\n\n // Vertical wrapper style\n const wrapperStyle = isVertical\n ? ({\n height: 'var(--bulma-slider-vertical-height, 200px)',\n } as React.CSSProperties)\n : undefined;\n\n // Render ticks\n const renderTicks = () => {\n if (tickPositions.length === 0) return null;\n return (\n <div className={prefixedClassNames(classPrefix, 'slider-ticks')}>\n {tickPositions.map((tick, i) => {\n const pct = ((tick.value - min) / (max - min)) * 100;\n const posStyle = isVertical\n ? { bottom: `${pct}%` }\n : { left: `${pct}%` };\n const isEndpoint = tick.value === min || tick.value === max;\n return (\n <span\n key={i}\n className={prefixedClassNames(classPrefix, 'slider-tick', {\n 'is-endpoint': isEndpoint,\n })}\n style={posStyle}\n >\n {tick.label !== undefined && (\n <span\n className={prefixedClassNames(\n classPrefix,\n 'slider-tick-label'\n )}\n >\n {tick.label}\n </span>\n )}\n </span>\n );\n })}\n </div>\n );\n };\n\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n // --- Single slider ---\n const sliderElement = !range ? (\n <div ref={wrapperRef} className={combinedClasses} style={wrapperStyle}>\n <input\n ref={combinedRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentSingle}\n disabled={disabled}\n onChange={handleSingleChange}\n onKeyDown={handleKeyDown}\n onMouseEnter={() => setShowTooltip(true)}\n onMouseLeave={() => setShowTooltip(false)}\n onFocus={() => setShowTooltip(true)}\n onBlur={() => setShowTooltip(false)}\n className={prefixedClassNames(classPrefix, 'slider-input')}\n style={\n {\n '--slider-progress': `${progressSingle}%`,\n } as React.CSSProperties\n }\n aria-valuenow={currentSingle}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n aria-label={ariaLabel as string | undefined}\n {...getAriaProps(currentSingle)}\n {...rest}\n // After the spread: an undefined `id` key in rest would wipe it.\n id={controlId}\n />\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputRef}\n className={prefixedClassNames(classPrefix, 'slider-output', {\n 'is-visible': showTipLow,\n 'is-flipped': flipped,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n })}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressSingle),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressSingle),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressSingle),\n transform: `translateX(calc(-50% + ${nudgeX}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentSingle)}\n </output>\n )}\n {renderTicks()}\n </div>\n ) : (\n // --- Range slider ---\n <div ref={wrapperRef} className={combinedClasses} style={wrapperStyle}>\n {/* Visible track background */}\n <div\n className={prefixedClassNames(classPrefix, 'slider-track')}\n style={\n isVertical\n ? ({\n '--slider-progress-low': `${progressLow}%`,\n '--slider-progress-high': `${progressHigh}%`,\n } as React.CSSProperties)\n : ({\n '--slider-progress-low': `${progressLow}%`,\n '--slider-progress-high': `${progressHigh}%`,\n } as React.CSSProperties)\n }\n />\n {/* Low thumb. nameLow overrides any `name` from rest so each thumb has its own form field. */}\n <input\n ref={combinedRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentRange[0]}\n disabled={disabled}\n onChange={handleRangeLowChange}\n onKeyDown={handleKeyDown}\n onMouseEnter={() => setShowTooltip(true)}\n onMouseLeave={() => setShowTooltip(false)}\n onFocus={() => setShowTooltip(true)}\n onBlur={() => setShowTooltip(false)}\n className={prefixedClassNames(\n classPrefix,\n 'slider-input',\n 'slider-input-low'\n )}\n aria-valuenow={currentRange[0]}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n {...lowThumb.aria}\n {...getAriaProps(currentRange[0])}\n {...thumbRest}\n id={controlId}\n {...(nameLow !== undefined ? { name: nameLow } : {})}\n />\n {/* High thumb */}\n <input\n ref={inputHighRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentRange[1]}\n disabled={disabled}\n onChange={handleRangeHighChange}\n onMouseEnter={() => setShowTooltipHigh(true)}\n onMouseLeave={() => setShowTooltipHigh(false)}\n onFocus={() => setShowTooltipHigh(true)}\n onBlur={() => setShowTooltipHigh(false)}\n className={prefixedClassNames(\n classPrefix,\n 'slider-input',\n 'slider-input-high'\n )}\n aria-valuenow={currentRange[1]}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n {...highThumb.aria}\n {...getAriaProps(currentRange[1])}\n name={nameHigh}\n />\n {/* Each wired thumb's own text, read after the label. A hidden element\n still names whatever points aria-labelledby at it. */}\n {[lowThumb, highThumb].map(\n thumb =>\n thumb.wired && (\n <span key={thumb.textId} id={thumb.textId} hidden>\n {thumb.text}\n </span>\n )\n )}\n {/* Low tooltip */}\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputRef}\n className={prefixedClassNames(\n classPrefix,\n 'slider-output',\n 'slider-output-low',\n {\n 'is-visible': showTipLow,\n 'is-flipped': flipped,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n }\n )}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressLow),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressLow),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressLow),\n transform: `translateX(calc(-50% + ${nudgeX}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentRange[0])}\n </output>\n )}\n {/* High tooltip */}\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputHighRef}\n className={prefixedClassNames(\n classPrefix,\n 'slider-output',\n 'slider-output-high',\n {\n 'is-visible': showTipHigh,\n 'is-flipped': flippedHigh,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n }\n )}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressHigh),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressHigh),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressHigh),\n transform: `translateX(calc(-50% + ${nudgeXHigh}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeXHigh}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentRange[1])}\n </output>\n )}\n {renderTicks()}\n </div>\n );\n\n let content = sliderElement;\n\n if (rendersOwnControl('Slider', { insideControl })) {\n content = <Control>{content}</Control>;\n }\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nSlider.displayName = 'Slider';\n\nexport default Slider;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;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4BAAA,KAAK,EAAE,MAAM;yBACd;AACP,sBAAG;AACC,wBAAA,IAAI,EAAE,YAAY,CAAC,YAAY,CAAC;wBAChC,SAAS,EAAE,CAAA,uBAAA,EAA0B,UAAU,CAAA,IAAA,CAAM;wBACrD,8BAA8B,EAAE,CAAA,WAAA,EAAc,UAAU,CAAA,GAAA,CAAK;AACtC,qBAAA,EAAA,QAAA,EAG9B,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAA,CACtB,CACV,EACA,WAAW,EAAE,CAAA,EAAA,CACV,CACP;IAED,IAAI,OAAO,GAAG,aAAa;IAE3B,IAAI,iBAAiB,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AAClD,QAAA,OAAO,GAAGA,GAAA,CAAC,OAAO,EAAA,EAAA,QAAA,EAAE,OAAO,GAAW;IACxC;IAEA,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEC,IAAA,CAAC,KAAK,EAAA,EACJ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EAAA,QAAA,EAAA,CAExB,OAAO,EACP,SAAS,CAAA,EAAA,CACJ;IAEZ;AAEA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,OAAO,EACP,SAAS,CAAA,EAAA,CACT;AAEP,CAAC;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;"}
1
+ {"version":3,"file":"Slider.js","sources":["../../../src/form/Slider.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useState,\n useCallback,\n useRef,\n useMemo,\n useId,\n} from 'react';\nimport {\n classNames,\n prefixedClassNames,\n usePrefixedClassNames,\n} from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { useClassPrefix } from '../helpers/Config';\nimport { useNumberFormat } from '../helpers/localeFormat';\nimport { useClientLayoutEffect } from '../helpers/useClientLayoutEffect';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n useFieldsetDisabled,\n} from './FormContext';\nimport { Field } from './Field';\nimport { Control } from './Control';\nimport { FormFieldProps } from './fieldProps';\nimport { useAutoLabelId } from './useAutoLabelId';\n\n/** Valid sizes for the Slider component. */\nexport type SliderSize = 'small' | 'medium' | 'large';\n\n/** Valid colors for the Slider component. */\nexport type SliderColor =\n 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n\n/** Tooltip display mode for the Slider component. */\nexport type SliderTooltip = 'auto' | 'always' | 'hidden';\n\n/** Orientation of the Slider component. */\nexport type SliderOrientation = 'horizontal' | 'vertical';\n\n/**\n * A tick mark displayed along the Slider track.\n */\nexport interface SliderMark {\n /** Controlled value. */\n value: number;\n /** Optional label rendered below the tick mark. */\n label?: React.ReactNode;\n}\n\n/**\n * Shared base props for single and range Slider modes.\n */\ninterface SliderBaseProps\n extends\n Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'color' | 'size' | 'onChange' | 'value' | 'defaultValue'\n >,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>,\n FormFieldProps {\n /** Field label. Automatically associated with the slider input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In range mode the `htmlFor` targets the low (minimum) thumb, and the label also starts each thumb's name through `aria-labelledby`, as in \"Price Minimum value\" and \"Price Maximum value\", unless an `aria-label` or `aria-labelledby` on the Slider takes its place there. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here, naming a range Slider's thumbs the same way. A `Field` label you wire by hand to the low thumb with `labelProps.htmlFor` names the thumbs too when you also give it an `id` there, since the `Field` generates none for it. */\n label?: React.ReactNode;\n /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). In range mode an `id` here is the one the thumbs' `aria-labelledby` points at, in place of a generated one. */\n labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {\n [key: string]: unknown;\n };\n /** Minimum value. */\n min?: number;\n /** Maximum value. */\n max?: number;\n /** Step increment (default: 1). */\n step?: number;\n /** Size variant. */\n size?: SliderSize;\n /** Color variant. */\n color?: SliderColor;\n /** Use rounded track ends. */\n isRounded?: boolean;\n /** Use circular thumb. */\n isCircle?: boolean;\n /** Show current value tooltip. */\n showOutput?: boolean;\n /** Controls tooltip visibility on the thumb. */\n tooltip?: SliderTooltip;\n /** Shows tick marks along the track. */\n ticks?: boolean;\n /** Custom labeled marks along the track. Each mark has `{ value: number; label?: ReactNode }`. */\n marks?: SliderMark[];\n /** Orientation of the slider. */\n orientation?: SliderOrientation;\n /**\n * Function to scale the displayed value. With it, and no `getAriaValueText`,\n * the scaled value is also the thumb's `aria-valuetext`.\n */\n scale?: (value: number) => number;\n /** Function to generate the `aria-valuetext` attribute. */\n getAriaValueText?: (value: number) => string;\n /**\n * Format function for output display. Without it, the output shows the\n * value as it is, or inside a `LocaleProvider` with a `locale`, written\n * the way that locale writes numbers, to at most three decimals.\n */\n formatOutput?: (value: number) => string;\n}\n\n/**\n * Props for the Slider in single-value mode.\n */\nexport interface SliderSingleProps extends SliderBaseProps {\n /**\n * Enables range mode with two thumbs.\n * @defaultValue false\n */\n range?: false;\n /** Controlled value. */\n value?: number;\n /**\n * Default value for uncontrolled usage.\n * @defaultValue 0\n */\n defaultValue?: number;\n /** Callback when value changes. */\n onChange?: (value: number) => void;\n /**\n * Minimum distance between thumbs in range mode.\n * @defaultValue 0\n */\n minDistance?: never;\n /** ARIA label(s) for the slider thumb(s), which win over a label, the Slider's own or a surrounding `Field`'s. In range mode each entry is that thumb's whole name, and a thumb without one is named \"Minimum value\" or \"Maximum value\", after whatever names the Slider: a label, or in its place an `aria-label` or `aria-labelledby` given to the Slider, as in \"Budget Minimum value\" and \"Budget Maximum value\". An `aria-labelledby` set to `undefined` keeps every label out of both names. */\n ariaLabel?: string;\n}\n\n/**\n * Props for the Slider in range (dual-thumb) mode.\n */\nexport interface SliderRangeProps extends SliderBaseProps {\n /**\n * Enables range mode with two thumbs.\n * @defaultValue false\n */\n range: true;\n /** Controlled value. */\n value?: [number, number];\n /**\n * Default value for uncontrolled usage.\n * @defaultValue 0\n */\n defaultValue?: [number, number];\n /** Callback when value changes. */\n onChange?: (value: [number, number]) => void;\n /**\n * Minimum distance between thumbs in range mode.\n * @defaultValue 0\n */\n minDistance?: number;\n /** ARIA label(s) for the slider thumb(s), which win over a label, the Slider's own or a surrounding `Field`'s. In range mode each entry is that thumb's whole name, and a thumb without one is named \"Minimum value\" or \"Maximum value\", after whatever names the Slider: a label, or in its place an `aria-label` or `aria-labelledby` given to the Slider, as in \"Budget Minimum value\" and \"Budget Maximum value\". An `aria-labelledby` set to `undefined` keeps every label out of both names. */\n ariaLabel?: [string, string];\n /** Form field name for the low thumb. Use this in range mode so each thumb submits with its own name. */\n nameLow?: string;\n /** Form field name for the high thumb. */\n nameHigh?: string;\n}\n\n/**\n * Props for the Slider component — a discriminated union of single and range modes.\n * Inside an existing `Control` it renders no `Control` of its own. Inside an\n * outer `Field`, or a `Control` with no `Field` around it, it renders no\n * `Field` of its own either. The exception is `label`, `message`, `horizontal`\n * or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,\n * nested in the `.control`, and warns in development. Wrap the `Control` in a\n * `Field` instead, and set the `label`, `horizontal` and class name on that\n * `Field`.\n * @helperProps Helper props go on the `.slider` wrapper `<div>`, with\n * `className`. The other attributes go on the `<input>`, the low thumb's in\n * range mode.\n * @extraProp {boolean} [disabled=false] - Whether the slider is disabled.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the input element.\n */\nexport type SliderProps = SliderSingleProps | SliderRangeProps;\n\n/**\n * Helper to compute tick positions.\n * If `marks` are provided, those positions are used.\n * If `ticks` is true, generates ticks at every step (capped at 100).\n */\nfunction getTickPositions(\n min: number,\n max: number,\n step: number,\n ticks?: boolean,\n marks?: SliderMark[]\n): SliderMark[] {\n if (marks && marks.length > 0) return marks;\n if (!ticks) return [];\n const positions: SliderMark[] = [];\n const count = Math.round((max - min) / step);\n if (count > 100) {\n // Cap at 100 ticks to prevent perf issues\n const tickStep = (max - min) / 100;\n // Skip first (i=0) and last (i=100) — no ticks at endpoints\n for (let i = 1; i < 100; i++) {\n positions.push({ value: min + i * tickStep });\n }\n } else {\n // Skip first (i=0) and last (i=count) — no ticks at endpoints\n for (let i = 1; i < count; i++) {\n positions.push({ value: min + i * step });\n }\n }\n return positions;\n}\n\n/**\n * The `Slider` component provides a range slider input for selecting values within a range.\n *\n * @function\n * @param {SliderProps} props - Props for the Slider component.\n * @returns {JSX.Element} The rendered slider element.\n *\n * @example\n * // Basic slider\n * <Slider defaultValue={50} />\n *\n * @example\n * // Range slider\n * <Slider range defaultValue={[20, 80]} onChange={([low, high]) => {}} />\n */\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(\n (props, ref) => {\n // Pull out fields that differ between the single and range branches\n // *first*, by narrowing on the `range` discriminator. We then destructure\n // the remaining base props from a `SliderBaseProps` view of `props`.\n //\n // Why not destructure everything via `props as SliderRangeProps & SliderSingleProps`?\n // Because intersecting the two halves of a discriminated union collapses\n // overlapping fields (e.g. `range: true & false`, `value: number & [number, number]`,\n // `onChange`, `ariaLabel`) to `never`, which breaks call sites and rest spreads.\n let range: boolean | undefined;\n let controlledValue: number | [number, number] | undefined;\n let defaultValue: number | [number, number] | undefined;\n let onChange:\n ((v: number) => void) | ((v: [number, number]) => void) | undefined;\n let ariaLabel: string | [string, string] | undefined;\n let minDistance = 0;\n let nameLow: string | undefined;\n let nameHigh: string | undefined;\n if (props.range === true) {\n range = true;\n controlledValue = props.value;\n defaultValue = props.defaultValue;\n onChange = props.onChange;\n ariaLabel = props.ariaLabel;\n minDistance = props.minDistance ?? 0;\n nameLow = props.nameLow;\n nameHigh = props.nameHigh;\n } else {\n range = props.range;\n controlledValue = props.value;\n defaultValue = props.defaultValue;\n onChange = props.onChange;\n ariaLabel = props.ariaLabel;\n }\n\n // Destructure base / shared props from a `SliderBaseProps` view. None of\n // these fields differ between the two branches, so this view is safe.\n const {\n label,\n labelSize,\n labelProps,\n horizontal,\n message,\n messageColor,\n fieldClassName,\n min = 0,\n max = 100,\n step = 1,\n size,\n color,\n isRounded = false,\n isCircle = false,\n disabled: disabledProp,\n showOutput = false,\n tooltip,\n ticks,\n marks,\n orientation = 'horizontal',\n scale,\n getAriaValueText,\n formatOutput,\n className,\n // Strip the discriminated/union fields from `restProps` so they don't\n // flow back into `useBulmaClasses` / spread onto inputs.\n range: _range,\n value: _value,\n defaultValue: _defaultValue,\n onChange: _onChange,\n ariaLabel: _ariaLabel,\n minDistance: _minDistance,\n nameLow: _nameLow,\n nameHigh: _nameHigh,\n ...restProps\n } = props as SliderBaseProps & {\n range?: boolean;\n value?: number | [number, number];\n defaultValue?: number | [number, number];\n onChange?: (v: never) => void;\n ariaLabel?: string | [string, string];\n minDistance?: number;\n nameLow?: string;\n nameHigh?: string;\n };\n void _range;\n void _value;\n void _defaultValue;\n void _onChange;\n void _ariaLabel;\n void _minDistance;\n void _nameLow;\n void _nameHigh;\n\n const disabled = useFieldsetDisabled(disabledProp);\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Slider', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n const { bulmaHelperClasses, rest } = useBulmaClasses(restProps);\n // In range mode the low thumb carries `rest` (and any user id), so the\n // label's `for` targets it.\n const { controlId, fieldLabelProps, labelId } = useAutoLabelId({\n label,\n id: restProps.id,\n labelProps,\n rendersLabel: ownField,\n needsLabelId: !!range,\n });\n\n // A range thumb's default name is an `aria-label`, which outranks the\n // label's `for`, so a label naming the Slider reaches each thumb through\n // `aria-labelledby` instead: the label, then a hidden span holding the\n // thumb's own text, as in \"Price Minimum value\" (#981). An `ariaLabel`\n // entry is that thumb's whole name and wins.\n const thumbTextId = useId();\n const thumbLabels = range\n ? (ariaLabel as [string, string] | undefined)\n : undefined;\n // A caller's `aria-label` or `aria-labelledby` names the Slider in the\n // label's place, so both thumbs read it before their own text. They are\n // routed here rather than spread, since the spread reaches only the low\n // thumb and would leave the pair with two unrelated names. Presence for\n // aria-labelledby, as on a group (#974): the caller's key takes the naming\n // over whatever its value, so an undefined one keeps every label out and\n // leaves both thumbs their bare text. A non-empty one wins over an\n // aria-label, as it does in the browser's name computation.\n const {\n 'aria-label': callerLabel,\n 'aria-labelledby': callerLabelledBy,\n ...thumbRest\n } = rest;\n const callerNamed = !!callerLabel || 'aria-labelledby' in rest;\n const stemRef = callerLabelledBy || (callerNamed ? undefined : labelId);\n const stemText = stemRef ? undefined : callerLabel;\n const nameThumb = (\n own: string | undefined,\n text: string,\n textId: string\n ) => {\n const wired = !!stemRef && !own;\n return {\n text,\n textId,\n wired,\n aria: wired\n ? { 'aria-labelledby': `${stemRef} ${textId}` }\n : { 'aria-label': own || (stemText ? `${stemText} ${text}` : text) },\n };\n };\n const lowThumb = nameThumb(\n thumbLabels?.[0],\n 'Minimum value',\n `${thumbTextId}-min`\n );\n const highThumb = nameThumb(\n thumbLabels?.[1],\n 'Maximum value',\n `${thumbTextId}-max`\n );\n\n // Resolve tooltip mode: explicit tooltip prop takes precedence, else showOutput maps to 'auto'\n const tooltipMode: SliderTooltip =\n tooltip ?? (showOutput ? 'auto' : 'hidden');\n\n // --- Range mode state ---\n const [internalRange, setInternalRange] = useState<[number, number]>(() =>\n range ? ((defaultValue as [number, number]) ?? [min, max]) : [min, min]\n );\n const [internalSingle, setInternalSingle] = useState<number>(() =>\n !range ? ((defaultValue as number) ?? 0) : 0\n );\n const [showTooltip, setShowTooltip] = useState(false);\n const [showTooltipHigh, setShowTooltipHigh] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputHighRef = useRef<HTMLInputElement>(null);\n const outputRef = useRef<HTMLOutputElement>(null);\n const outputHighRef = useRef<HTMLOutputElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [flipped, setFlipped] = useState(false);\n const [flippedHigh, setFlippedHigh] = useState(false);\n const [nudgeX, setNudgeX] = useState(0);\n const [nudgeXHigh, setNudgeXHigh] = useState(0);\n const [verticalFlippedLeft, setVerticalFlippedLeft] = useState(false);\n\n const isControlled = controlledValue !== undefined;\n\n // Current values\n const currentRange: [number, number] = range\n ? isControlled\n ? (controlledValue as [number, number])\n : internalRange\n : [0, 0];\n const currentSingle: number = !range\n ? isControlled\n ? (controlledValue as number)\n : internalSingle\n : 0;\n\n // Progress percentages\n const progressSingle = !range\n ? ((currentSingle - min) / (max - min)) * 100\n : 0;\n const progressLow = range\n ? ((currentRange[0] - min) / (max - min)) * 100\n : 0;\n const progressHigh = range\n ? ((currentRange[1] - min) / (max - min)) * 100\n : 0;\n\n // Scale helper\n const scaleValue = useCallback(\n (v: number) => (scale ? scale(v) : v),\n [scale]\n );\n\n // Format helper: the caller's, else the locale's, else the number as is.\n const formatNumber = useNumberFormat();\n const writeNumber = useCallback(\n (v: number) => (formatNumber ? formatNumber(v) : v.toString()),\n [formatNumber]\n );\n const formatValue = useCallback(\n (v: number) => {\n const scaled = scaleValue(v);\n return formatOutput ? formatOutput(scaled) : writeNumber(scaled);\n },\n [formatOutput, scaleValue, writeNumber]\n );\n\n // --- Handlers ---\n const handleSingleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = parseFloat(e.target.value);\n if (!isControlled) setInternalSingle(newValue);\n (onChange as ((v: number) => void) | undefined)?.(newValue);\n },\n [isControlled, onChange]\n );\n\n const handleRangeLowChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const raw = parseFloat(e.target.value);\n const clamped = Math.min(raw, currentRange[1] - minDistance);\n const newRange: [number, number] = [clamped, currentRange[1]];\n if (!isControlled) setInternalRange(newRange);\n (onChange as ((v: [number, number]) => void) | undefined)?.(newRange);\n },\n [isControlled, onChange, currentRange, minDistance]\n );\n\n const handleRangeHighChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const raw = parseFloat(e.target.value);\n const clamped = Math.max(raw, currentRange[0] + minDistance);\n const newRange: [number, number] = [currentRange[0], clamped];\n if (!isControlled) setInternalRange(newRange);\n (onChange as ((v: [number, number]) => void) | undefined)?.(newRange);\n },\n [isControlled, onChange, currentRange, minDistance]\n );\n\n // Key handler for Home/End\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Home') {\n e.preventDefault();\n if (!range) {\n if (!isControlled) setInternalSingle(min);\n (onChange as ((v: number) => void) | undefined)?.(min);\n }\n } else if (e.key === 'End') {\n e.preventDefault();\n if (!range) {\n if (!isControlled) setInternalSingle(max);\n (onChange as ((v: number) => void) | undefined)?.(max);\n }\n }\n },\n [range, isControlled, onChange, min, max]\n );\n\n // Tick positions\n const tickPositions = useMemo(\n () => getTickPositions(min, max, step, ticks, marks),\n [min, max, step, ticks, marks]\n );\n\n const hasLabels = tickPositions.some(t => t.label !== undefined);\n const isVertical = orientation === 'vertical';\n\n // Compute corrected thumb position CSS calc expression.\n // The browser insets the range input thumb by half its size from each edge,\n // so the tooltip left must account for this to align with the thumb center.\n const thumbVarName = size\n ? `slider-thumb-size-${size}`\n : 'slider-thumb-size';\n const thumbCssVar = `var(--bulma-${thumbVarName})`;\n const effectiveThumbExpr = isCircle\n ? `(${thumbCssVar} * 1.2)`\n : thumbCssVar;\n\n const getThumbLeft = (progressPct: number) => {\n const fraction = progressPct / 100;\n return `calc(${effectiveThumbExpr} / 2 + ${fraction} * (100% - ${effectiveThumbExpr}))`;\n };\n\n // Vertical tooltip offset: position to the right or left of the thumb\n const verticalTooltipOffset = `calc(50% + ${effectiveThumbExpr} / 2 + 0.5rem)`;\n\n // Get effective thumb size in px for nudge computation\n const getThumbSizePx = (): number => {\n const el = inputRef.current;\n if (!el) return 0;\n const style = getComputedStyle(el);\n const raw = style.getPropertyValue(`--bulma-${thumbVarName}`).trim();\n const value = parseFloat(raw);\n if (isNaN(value)) return 0;\n let px: number;\n if (raw.includes('rem')) {\n const rootFs =\n parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n px = value * rootFs;\n } else {\n px = value;\n }\n return isCircle ? px * 1.2 : px;\n };\n\n // Generate wrapper classes\n const classPrefix = useClassPrefix();\n const sliderClasses = usePrefixedClassNames('slider', {\n [`is-${size}`]: size,\n [`is-${color}`]: color,\n 'is-rounded': isRounded,\n 'is-circle': isCircle,\n 'is-disabled': disabled,\n 'has-output': tooltipMode !== 'hidden',\n 'has-output-always': tooltipMode === 'always',\n 'is-vertical': isVertical,\n 'is-range': range,\n 'has-ticks': tickPositions.length > 0,\n 'has-tick-labels': hasLabels,\n });\n\n const combinedClasses = classNames(\n sliderClasses,\n bulmaHelperClasses,\n className\n );\n\n // Combined ref for the first (or only) input\n const combinedRef = (node: HTMLInputElement | null) => {\n (inputRef as React.MutableRefObject<HTMLInputElement | null>).current =\n node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLInputElement | null>).current = node;\n }\n };\n\n // Tooltip show/hide for auto mode\n const showTipLow =\n tooltipMode === 'always' || (tooltipMode === 'auto' && showTooltip);\n const showTipHigh =\n tooltipMode === 'always' || (tooltipMode === 'auto' && showTooltipHigh);\n\n // Aria value text\n const getAriaProps = (value: number) => {\n const ariaProps: Record<string, string> = {};\n if (getAriaValueText) {\n ariaProps['aria-valuetext'] = getAriaValueText(value);\n } else if (scale) {\n ariaProps['aria-valuetext'] = writeNumber(scaleValue(value));\n }\n return ariaProps;\n };\n\n // Detect tooltip overflow: flip vertically if clipped at top,\n // nudge horizontally if clipped at left/right edge.\n // We compute the un-nudged tooltip position from the progress %\n // and wrapper rect to avoid feedback loops.\n const computeNudge = useCallback(\n (\n el: HTMLElement,\n wrapper: HTMLElement,\n progressPct: number,\n thumbSizePx: number\n ): number => {\n const wr = wrapper.getBoundingClientRect();\n const tooltipWidth = el.offsetWidth;\n // Corrected center: accounts for thumb inset from track edges\n const fraction = progressPct / 100;\n const centerX =\n wr.left + thumbSizePx / 2 + fraction * (wr.width - thumbSizePx);\n const tooltipLeft = centerX - tooltipWidth / 2;\n const tooltipRight = centerX + tooltipWidth / 2;\n if (tooltipLeft < wr.left) {\n return wr.left - tooltipLeft; // nudge right\n }\n if (tooltipRight > wr.right) {\n return wr.right - tooltipRight; // nudge left (negative)\n }\n return 0;\n },\n []\n );\n\n useClientLayoutEffect(() => {\n if (isVertical) return;\n const wrapper = wrapperRef.current;\n const el = outputRef.current;\n if (wrapper && el) {\n const wrapperTop = wrapper.getBoundingClientRect().top;\n const tooltipHeight = el.offsetHeight + 10;\n setFlipped(wrapperTop < tooltipHeight);\n const pct = range ? progressLow : progressSingle;\n const thumbPx = getThumbSizePx();\n setNudgeX(computeNudge(el, wrapper, pct, thumbPx));\n }\n });\n\n useClientLayoutEffect(() => {\n if (isVertical || !range) return;\n const wrapper = wrapperRef.current;\n const el = outputHighRef.current;\n if (wrapper && el) {\n const wrapperTop = wrapper.getBoundingClientRect().top;\n const tooltipHeight = el.offsetHeight + 10;\n setFlippedHigh(wrapperTop < tooltipHeight);\n const thumbPx = getThumbSizePx();\n setNudgeXHigh(computeNudge(el, wrapper, progressHigh, thumbPx));\n }\n });\n\n // Detect vertical tooltip overflow: flip to left if no space on right\n useClientLayoutEffect(() => {\n if (!isVertical) return;\n const wrapper = wrapperRef.current;\n const el = outputRef.current;\n if (!wrapper || !el) return;\n const wrapperRect = wrapper.getBoundingClientRect();\n const tooltipWidth = el.offsetWidth;\n const thumbPx = getThumbSizePx();\n const gap = 8; // 0.5rem\n // Tooltip right edge if placed to the right of the thumb\n const tooltipRightEdge =\n wrapperRect.left +\n wrapperRect.width / 2 +\n thumbPx / 2 +\n gap +\n tooltipWidth;\n setVerticalFlippedLeft(tooltipRightEdge > window.innerWidth);\n });\n\n // Vertical wrapper style\n const wrapperStyle = isVertical\n ? ({\n height: 'var(--bulma-slider-vertical-height, 200px)',\n } as React.CSSProperties)\n : undefined;\n\n // Render ticks\n const renderTicks = () => {\n if (tickPositions.length === 0) return null;\n return (\n <div className={prefixedClassNames(classPrefix, 'slider-ticks')}>\n {tickPositions.map((tick, i) => {\n const pct = ((tick.value - min) / (max - min)) * 100;\n const posStyle = isVertical\n ? { bottom: `${pct}%` }\n : { left: `${pct}%` };\n const isEndpoint = tick.value === min || tick.value === max;\n return (\n <span\n key={i}\n className={prefixedClassNames(classPrefix, 'slider-tick', {\n 'is-endpoint': isEndpoint,\n })}\n style={posStyle}\n >\n {tick.label !== undefined && (\n <span\n className={prefixedClassNames(\n classPrefix,\n 'slider-tick-label'\n )}\n >\n {tick.label}\n </span>\n )}\n </span>\n );\n })}\n </div>\n );\n };\n\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n // --- Single slider ---\n const sliderElement = !range ? (\n <div ref={wrapperRef} className={combinedClasses} style={wrapperStyle}>\n <input\n ref={combinedRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentSingle}\n disabled={disabled}\n onChange={handleSingleChange}\n onKeyDown={handleKeyDown}\n onMouseEnter={() => setShowTooltip(true)}\n onMouseLeave={() => setShowTooltip(false)}\n onFocus={() => setShowTooltip(true)}\n onBlur={() => setShowTooltip(false)}\n className={prefixedClassNames(classPrefix, 'slider-input')}\n style={\n {\n '--slider-progress': `${progressSingle}%`,\n } as React.CSSProperties\n }\n aria-valuenow={currentSingle}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n aria-label={ariaLabel as string | undefined}\n {...getAriaProps(currentSingle)}\n {...rest}\n // After the spread: an undefined `id` key in rest would wipe it.\n id={controlId}\n />\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputRef}\n className={prefixedClassNames(classPrefix, 'slider-output', {\n 'is-visible': showTipLow,\n 'is-flipped': flipped,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n })}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressSingle),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressSingle),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressSingle),\n transform: `translateX(calc(-50% + ${nudgeX}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentSingle)}\n </output>\n )}\n {renderTicks()}\n </div>\n ) : (\n // --- Range slider ---\n <div ref={wrapperRef} className={combinedClasses} style={wrapperStyle}>\n {/* Visible track background */}\n <div\n className={prefixedClassNames(classPrefix, 'slider-track')}\n style={\n isVertical\n ? ({\n '--slider-progress-low': `${progressLow}%`,\n '--slider-progress-high': `${progressHigh}%`,\n } as React.CSSProperties)\n : ({\n '--slider-progress-low': `${progressLow}%`,\n '--slider-progress-high': `${progressHigh}%`,\n } as React.CSSProperties)\n }\n />\n {/* Low thumb. nameLow overrides any `name` from rest so each thumb has its own form field. */}\n <input\n ref={combinedRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentRange[0]}\n disabled={disabled}\n onChange={handleRangeLowChange}\n onKeyDown={handleKeyDown}\n onMouseEnter={() => setShowTooltip(true)}\n onMouseLeave={() => setShowTooltip(false)}\n onFocus={() => setShowTooltip(true)}\n onBlur={() => setShowTooltip(false)}\n className={prefixedClassNames(\n classPrefix,\n 'slider-input',\n 'slider-input-low'\n )}\n aria-valuenow={currentRange[0]}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n {...lowThumb.aria}\n {...getAriaProps(currentRange[0])}\n {...thumbRest}\n id={controlId}\n {...(nameLow !== undefined ? { name: nameLow } : {})}\n />\n {/* High thumb */}\n <input\n ref={inputHighRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentRange[1]}\n disabled={disabled}\n onChange={handleRangeHighChange}\n onMouseEnter={() => setShowTooltipHigh(true)}\n onMouseLeave={() => setShowTooltipHigh(false)}\n onFocus={() => setShowTooltipHigh(true)}\n onBlur={() => setShowTooltipHigh(false)}\n className={prefixedClassNames(\n classPrefix,\n 'slider-input',\n 'slider-input-high'\n )}\n aria-valuenow={currentRange[1]}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n {...highThumb.aria}\n {...getAriaProps(currentRange[1])}\n name={nameHigh}\n />\n {/* Each wired thumb's own text, read after the label. A hidden element\n still names whatever points aria-labelledby at it. */}\n {[lowThumb, highThumb].map(\n thumb =>\n thumb.wired && (\n <span key={thumb.textId} id={thumb.textId} hidden>\n {thumb.text}\n </span>\n )\n )}\n {/* Low tooltip */}\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputRef}\n className={prefixedClassNames(\n classPrefix,\n 'slider-output',\n 'slider-output-low',\n {\n 'is-visible': showTipLow,\n 'is-flipped': flipped,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n }\n )}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressLow),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressLow),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressLow),\n transform: `translateX(calc(-50% + ${nudgeX}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentRange[0])}\n </output>\n )}\n {/* High tooltip */}\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputHighRef}\n className={prefixedClassNames(\n classPrefix,\n 'slider-output',\n 'slider-output-high',\n {\n 'is-visible': showTipHigh,\n 'is-flipped': flippedHigh,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n }\n )}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressHigh),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressHigh),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressHigh),\n transform: `translateX(calc(-50% + ${nudgeXHigh}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeXHigh}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentRange[1])}\n </output>\n )}\n {renderTicks()}\n </div>\n );\n\n let content = sliderElement;\n\n if (rendersOwnControl('Slider', { insideControl })) {\n content = <Control>{content}</Control>;\n }\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nSlider.displayName = 'Slider';\n\nexport default Slider;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;AAwLA;;;;AAIG;AACH,SAAS,gBAAgB,CACvB,GAAW,EACX,GAAW,EACX,IAAY,EACZ,KAAe,EACf,KAAoB,EAAA;AAEpB,IAAA,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;AAAE,QAAA,OAAO,KAAK;AAC3C,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,EAAE;IACrB,MAAM,SAAS,GAAiB,EAAE;AAClC,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC;AAC5C,IAAA,IAAI,KAAK,GAAG,GAAG,EAAE;;QAEf,MAAM,QAAQ,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,GAAG;;AAElC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;AAC5B,YAAA,SAAS,CAAC,IAAI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EACJ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EAAA,QAAA,EAAA,CAExB,OAAO,EACP,SAAS,CAAA,EAAA,CACJ;IAEZ;AAEA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,OAAO,EACP,SAAS,CAAA,EAAA,CACT;AAEP,CAAC;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;"}
@@ -1,4 +1,5 @@
1
1
  /* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
2
+ 'use client';
2
3
  import { jsxs, jsx } from 'react/jsx-runtime';
3
4
  import { forwardRef } from 'react';
4
5
  import { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../../../src/form/Switch.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\nimport { useFieldsetDisabled } from './FormContext';\n\n/**\n * The values the Switch `color` and `passiveType` props accept, as a readonly\n * tuple.\n *\n * Both props are typed from it, so they list the same values. Map over it to\n * build a color picker, or check a value that arrives at runtime before\n * passing it in: the component adds no class for a value outside the tuple.\n *\n * @example\n * import { Switch, switchColors } from '@allxsmith/bestax-bulma';\n *\n * switchColors.map(color => (\n * <Switch key={color} color={color} defaultChecked>\n * {color}\n * </Switch>\n * ));\n */\nexport const switchColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n] as const;\n\n/**\n * The values the Switch `size` prop accepts, as a readonly tuple.\n *\n * `SwitchProps['size']` is typed from it, so the two list the same values. Use\n * it to offer a size choice or to check a value that arrives at runtime: the\n * component adds no size class for a value outside the tuple. These are\n * element sizes, not the spacing scale in `validSizes`.\n *\n * @example\n * import { switchSizes } from '@allxsmith/bestax-bulma';\n *\n * type SwitchSize = (typeof switchSizes)[number];\n */\nexport const switchSizes = ['small', 'normal', 'medium', 'large'] as const;\n\n/**\n * Props for the Switch component.\n * @helperProps Helper props go on the outer `<label>`, with `className`. The\n * other attributes go on the `<input>`.\n * @extraProp {boolean} [checked] - Controlled checked state.\n * @extraProp {boolean} [defaultChecked=false] - Default checked state for uncontrolled usage.\n * @extraProp {boolean} [disabled=false] - Whether the switch is disabled.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {(event: React.ChangeEvent<HTMLInputElement>) => void} [onChange] - Callback when switch state changes.\n * @extraProp {React.Ref<HTMLInputElement>} [ref] - Ref forwarded to the input element.\n */\nexport interface SwitchProps\n extends\n Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'type' | 'color'\n >,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'> {\n /** Color variant for the switch. */\n color?: (typeof switchColors)[number];\n /** Size of the switch. */\n size?: (typeof switchSizes)[number];\n /** Use rounded switch style. */\n isRounded?: boolean;\n /** Use thin switch style. */\n isThin?: boolean;\n /** Use outlined switch style. */\n isOutlined?: boolean;\n /** Right-to-left layout (label on left). */\n isRtl?: boolean;\n /** Color when the switch is in the off/passive state. */\n passiveType?: (typeof switchColors)[number];\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Label content for the switch. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Switch` component provides a toggle switch for boolean on/off states.\n *\n * @function\n * @param {SwitchProps} props - Props for the Switch component.\n * @returns {JSX.Element} The rendered switch element.\n *\n * @example\n * // Basic switch\n * <Switch>Enable notifications</Switch>\n *\n * @example\n * // Colored and rounded switch\n * <Switch color=\"success\" isRounded checked>\n * Active\n * </Switch>\n *\n * @example\n * // Controlled switch\n * <Switch\n * checked={isEnabled}\n * onChange={(e) => setIsEnabled(e.target.checked)}\n * >\n * Feature enabled\n * </Switch>\n */\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n color,\n size,\n isRounded,\n isThin,\n isOutlined,\n isRtl,\n passiveType,\n className,\n children,\n textColor,\n disabled: disabledProp,\n ...props\n },\n ref\n ) => {\n const disabled = useFieldsetDisabled(disabledProp);\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n ...props,\n });\n\n // Generate Bulma classes with prefix\n const switchClasses = usePrefixedClassNames('switch', {\n [`is-${color}`]: color && switchColors.includes(color),\n [`is-${size}`]: size && switchSizes.includes(size),\n 'is-rounded': isRounded,\n 'is-thin': isThin,\n 'is-outlined': isOutlined,\n 'is-rtl': isRtl,\n [`is-${passiveType}-passive`]:\n passiveType && switchColors.includes(passiveType),\n });\n\n // Combine prefixed Bulma classes with unprefixed user className and helper classes\n const labelClasses = classNames(\n switchClasses,\n bulmaHelperClasses,\n className\n );\n const checkClass = usePrefixedClassNames('check');\n const controlLabelClass = usePrefixedClassNames('control-label');\n\n return (\n <label className={labelClasses}>\n <input ref={ref} type=\"checkbox\" disabled={disabled} {...rest} />\n <span className={checkClass} />\n {children && <span className={controlLabelClass}>{children}</span>}\n </label>\n );\n }\n);\n\nSwitch.displayName = 'Switch';\n\nexport default Switch;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AASA;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,YAAY,GAAG;IAC1B,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;;AAGV;;;;;;;;;;;;AAYG;AACI,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO;AAwChE;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACI,MAAM,MAAM,GAAG,UAAU,CAC9B,CACE,EACE,KAAK,EACL,IAAI,EACJ,SAAS,EACT,MAAM,EACN,UAAU,EACV,KAAK,EACL,WAAW,EACX,SAAS,EACT,QAAQ,E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SAAS,EAAE,UAAU,EAAA,CAAI,EAC9B,QAAQ,IAAIA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,iBAAiB,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAQ,CAAA,EAAA,CAC5D;AAEZ,CAAC;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;"}
1
+ {"version":3,"file":"Switch.js","sources":["../../../src/form/Switch.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\nimport { useFieldsetDisabled } from './FormContext';\n\n/**\n * The values the Switch `color` and `passiveType` props accept, as a readonly\n * tuple.\n *\n * Both props are typed from it, so they list the same values. Map over it to\n * build a color picker, or check a value that arrives at runtime before\n * passing it in: the component adds no class for a value outside the tuple.\n *\n * @example\n * import { Switch, switchColors } from '@allxsmith/bestax-bulma';\n *\n * switchColors.map(color => (\n * <Switch key={color} color={color} defaultChecked>\n * {color}\n * </Switch>\n * ));\n */\nexport const switchColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n] as const;\n\n/**\n * The values the Switch `size` prop accepts, as a readonly tuple.\n *\n * `SwitchProps['size']` is typed from it, so the two list the same values. Use\n * it to offer a size choice or to check a value that arrives at runtime: the\n * component adds no size class for a value outside the tuple. These are\n * element sizes, not the spacing scale in `validSizes`.\n *\n * @example\n * import { switchSizes } from '@allxsmith/bestax-bulma';\n *\n * type SwitchSize = (typeof switchSizes)[number];\n */\nexport const switchSizes = ['small', 'normal', 'medium', 'large'] as const;\n\n/**\n * Props for the Switch component.\n * @helperProps Helper props go on the outer `<label>`, with `className`. The\n * other attributes go on the `<input>`.\n * @extraProp {boolean} [checked] - Controlled checked state.\n * @extraProp {boolean} [defaultChecked=false] - Default checked state for uncontrolled usage.\n * @extraProp {boolean} [disabled=false] - Whether the switch is disabled.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {(event: React.ChangeEvent<HTMLInputElement>) => void} [onChange] - Callback when switch state changes.\n * @extraProp {React.Ref<HTMLInputElement>} [ref] - Ref forwarded to the input element.\n */\nexport interface SwitchProps\n extends\n Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'type' | 'color'\n >,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'> {\n /** Color variant for the switch. */\n color?: (typeof switchColors)[number];\n /** Size of the switch. */\n size?: (typeof switchSizes)[number];\n /** Use rounded switch style. */\n isRounded?: boolean;\n /** Use thin switch style. */\n isThin?: boolean;\n /** Use outlined switch style. */\n isOutlined?: boolean;\n /** Right-to-left layout (label on left). */\n isRtl?: boolean;\n /** Color when the switch is in the off/passive state. */\n passiveType?: (typeof switchColors)[number];\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Label content for the switch. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Switch` component provides a toggle switch for boolean on/off states.\n *\n * @function\n * @param {SwitchProps} props - Props for the Switch component.\n * @returns {JSX.Element} The rendered switch element.\n *\n * @example\n * // Basic switch\n * <Switch>Enable notifications</Switch>\n *\n * @example\n * // Colored and rounded switch\n * <Switch color=\"success\" isRounded checked>\n * Active\n * </Switch>\n *\n * @example\n * // Controlled switch\n * <Switch\n * checked={isEnabled}\n * onChange={(e) => setIsEnabled(e.target.checked)}\n * >\n * Feature enabled\n * </Switch>\n */\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n color,\n size,\n isRounded,\n isThin,\n isOutlined,\n isRtl,\n passiveType,\n className,\n children,\n textColor,\n disabled: disabledProp,\n ...props\n },\n ref\n ) => {\n const disabled = useFieldsetDisabled(disabledProp);\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n ...props,\n });\n\n // Generate Bulma classes with prefix\n const switchClasses = usePrefixedClassNames('switch', {\n [`is-${color}`]: color && switchColors.includes(color),\n [`is-${size}`]: size && switchSizes.includes(size),\n 'is-rounded': isRounded,\n 'is-thin': isThin,\n 'is-outlined': isOutlined,\n 'is-rtl': isRtl,\n [`is-${passiveType}-passive`]:\n passiveType && switchColors.includes(passiveType),\n });\n\n // Combine prefixed Bulma classes with unprefixed user className and helper classes\n const labelClasses = classNames(\n switchClasses,\n bulmaHelperClasses,\n className\n );\n const checkClass = usePrefixedClassNames('check');\n const controlLabelClass = usePrefixedClassNames('control-label');\n\n return (\n <label className={labelClasses}>\n <input ref={ref} type=\"checkbox\" disabled={disabled} {...rest} />\n <span className={checkClass} />\n {children && <span className={controlLabelClass}>{children}</span>}\n </label>\n );\n }\n);\n\nSwitch.displayName = 'Switch';\n\nexport default Switch;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,YAAY,GAAG;IAC1B,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;;AAGV;;;;;;;;;;;;AAYG;AACI,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO;AAwChE;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACI,MAAM,MAAM,GAAG,UAAU,CAC9B,CACE,EACE,KAAK,EACL,IAAI,EACJ,SAAS,EACT,MAAM,EACN,UAAU,EACV,KAAK,EACL,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EAAE,YAAY,EACtB,GAAG,KAAK,EACT,EACD,GAAG,KACD;AACF,IAAA,MAAM,QAAQ,GAAG,mBAAmB,CAAC,YAAY,CAAC;AAClD,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;;AAGF,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,QAAQ,EAAE;AACpD,QAAA,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