@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":"Delete.js","sources":["../../../src/elements/Delete.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\nimport { buttonType } from '../helpers/buttonType';\n\n/**\n * Props for the Delete component.\n */\ninterface DeleteProps\n extends React.HTMLAttributes<HTMLButtonElement>, BulmaClassesProps {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Text color alias: renders `has-text-<color>`, exactly like `textColor`.\n * Not a filled variant (no `.delete.is-<color>` CSS exists). Prefer\n * `textColor`, which takes precedence when both are set; use `bgColor` for\n * a colored surface.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Click handler for the button. */\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Size modifier for the delete button. */\n size?: 'small' | 'medium' | 'large';\n /**\n * Accessible name for the button. An `aria-label` you pass takes precedence\n * over it, unless it is empty or arrives as `undefined` through a spread.\n * An empty `ariaLabel` falls back to the default too, so the button is never\n * left unnamed.\n * @defaultValue 'Close'\n */\n ariaLabel?: string;\n /** Whether the button is disabled (default: false). */\n disabled?: boolean;\n}\n\n/**\n * The `Delete` component provides a Bulma-styled close/delete button for dismissing modals, notifications, tags, messages, and more.\n *\n * It renders `type=\"button\"`, so a delete button inside a form does not submit it.\n *\n * @function\n * @param {DeleteProps} props - Props for the Delete component.\n * @returns {JSX.Element} The rendered delete button.\n * @see {@link https://bulma.io/documentation/elements/delete/ | Bulma Delete documentation}\n */\nexport const Delete: React.FC<DeleteProps> = ({\n className,\n textColor,\n color,\n bgColor,\n onClick,\n size,\n ariaLabel,\n disabled = false,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n\n const bulmaClasses = usePrefixedClassNames('delete', {\n [`is-${size}`]: size,\n 'is-disabled': disabled,\n });\n\n const classes = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <button\n className={classes}\n onClick={onClick}\n disabled={disabled}\n {...rest}\n // After the spread, reading through it: a key the spread carries with no\n // value would otherwise erase the default, leaving a nameless button\n // that submits the form around it. An empty label falls back too: the\n // button is drawn as an icon, so `''` would leave it unnamed. A caller's\n // own value still wins; `buttonType` says more.\n aria-label={rest['aria-label'] || ariaLabel || 'Close'}\n type={buttonType((rest as { type?: unknown }).type)}\n />\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AA2CA;;;;;;;;;AASG;AACI,MAAM,MAAM,GAA0B,CAAC,EAC5C,SAAS,EACT,SAAS,EACT,KAAK,EACL,OAAO,EACP,OAAO,EACP,IAAI,EACJ,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;QACnD,KAAK,EAAE,SAAS,IAAI,KAAK;AACzB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;AAEF,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,QAAQ,EAAE;AACnD,QAAA,CAAC,CAAA,GAAA,EAAM,IAAI,CAAA,CAAE,GAAG,IAAI;AACpB,QAAA,aAAa,EAAE,QAAQ;AACxB,KAAA,CAAC;IAEF,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAEvE,IAAA,QACEA,GAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAAA,GACd,IAAI,EAAA,YAAA,EAMI,IAAI,CAAC,YAAY,CAAC,IAAI,SAAS,IAAI,OAAO,EACtD,IAAI,EAAE,UAAU,CAAE,IAA2B,CAAC,IAAI,CAAC,EAAA,CACnD;AAEN;;"}
1
+ {"version":3,"file":"Delete.js","sources":["../../../src/elements/Delete.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\nimport { buttonType } from '../helpers/buttonType';\n\n/**\n * Props for the Delete component.\n */\ninterface DeleteProps\n extends React.HTMLAttributes<HTMLButtonElement>, BulmaClassesProps {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Text color alias: renders `has-text-<color>`, exactly like `textColor`.\n * Not a filled variant (no `.delete.is-<color>` CSS exists). Prefer\n * `textColor`, which takes precedence when both are set; use `bgColor` for\n * a colored surface.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Click handler for the button. */\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Size modifier for the delete button. */\n size?: 'small' | 'medium' | 'large';\n /**\n * Accessible name for the button. An `aria-label` you pass takes precedence\n * over it, unless it is empty or arrives as `undefined` through a spread.\n * An empty `ariaLabel` falls back to the default too, so the button is never\n * left unnamed.\n * @defaultValue 'Close'\n */\n ariaLabel?: string;\n /** Whether the button is disabled (default: false). */\n disabled?: boolean;\n}\n\n/**\n * The `Delete` component provides a Bulma-styled close/delete button for dismissing modals, notifications, tags, messages, and more.\n *\n * It renders `type=\"button\"`, so a delete button inside a form does not submit it.\n *\n * @function\n * @param {DeleteProps} props - Props for the Delete component.\n * @returns {JSX.Element} The rendered delete button.\n * @see {@link https://bulma.io/documentation/elements/delete/ | Bulma Delete documentation}\n */\nexport const Delete: React.FC<DeleteProps> = ({\n className,\n textColor,\n color,\n bgColor,\n onClick,\n size,\n ariaLabel,\n disabled = false,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n\n const bulmaClasses = usePrefixedClassNames('delete', {\n [`is-${size}`]: size,\n 'is-disabled': disabled,\n });\n\n const classes = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <button\n className={classes}\n onClick={onClick}\n disabled={disabled}\n {...rest}\n // After the spread, reading through it: a key the spread carries with no\n // value would otherwise erase the default, leaving a nameless button\n // that submits the form around it. An empty label falls back too: the\n // button is drawn as an icon, so `''` would leave it unnamed. A caller's\n // own value still wins; `buttonType` says more.\n aria-label={rest['aria-label'] || ariaLabel || 'Close'}\n type={buttonType((rest as { type?: unknown }).type)}\n />\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;;AA2CA;;;;;;;;;AASG;AACI,MAAM,MAAM,GAA0B,CAAC,EAC5C,SAAS,EACT,SAAS,EACT,KAAK,EACL,OAAO,EACP,OAAO,EACP,IAAI,EACJ,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;QACnD,KAAK,EAAE,SAAS,IAAI,KAAK;AACzB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;AAEF,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,QAAQ,EAAE;AACnD,QAAA,CAAC,CAAA,GAAA,EAAM,IAAI,CAAA,CAAE,GAAG,IAAI;AACpB,QAAA,aAAa,EAAE,QAAQ;AACxB,KAAA,CAAC;IAEF,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAEvE,IAAA,QACEA,GAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAAA,GACd,IAAI,EAAA,YAAA,EAMI,IAAI,CAAC,YAAY,CAAC,IAAI,SAAS,IAAI,OAAO,EACtD,IAAI,EAAE,UAAU,CAAE,IAA2B,CAAC,IAAI,CAAC,EAAA,CACnD;AAEN;;"}
@@ -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 } 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":"DescriptionList.js","sources":["../../../src/elements/DescriptionList.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 { withSubComponents } from '../helpers/withSubComponents';\n\nconst validDescriptionListOrientations = ['vertical', 'horizontal'] as const;\n/** Whether each label sits above its value (`vertical`) or beside it (`horizontal`). */\nexport type DescriptionListOrientation =\n (typeof validDescriptionListOrientations)[number];\n\nconst isOrientation = (\n orientation?: string\n): orientation is DescriptionListOrientation =>\n !!orientation &&\n (validDescriptionListOrientations as readonly string[]).includes(orientation);\n\n/** Whether a prop was given something to render. */\nconst isGiven = (node: React.ReactNode) =>\n node !== undefined &&\n node !== null &&\n typeof node !== 'boolean' &&\n node !== '';\n\n/**\n * Props for the DescriptionList component. The helper props, the other\n * attributes and the `ref` land on the `<dl>`.\n *\n * @extraProp {React.Ref<HTMLDListElement>} [ref] - Ref forwarded to the `<dl>`.\n * @extraProp {string} [aria-labelledby] - The id of the heading above the list, which names it.\n */\nexport interface DescriptionListProps\n extends\n Omit<React.HTMLAttributes<HTMLDListElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** `DescriptionList.Item`s, one for each fact. */\n children?: React.ReactNode;\n /**\n * Whether each label sits above its value or beside it, at every width no\n * `orientation<Viewport>` prop covers. Those props read the way a\n * `Column`'s `size<Viewport>` props do: `orientationMobile` applies below\n * Bulma's tablet breakpoint, each of the others from its own breakpoint\n * up, and where several apply the widest one wins. With none of them,\n * labels sit above their values below the tablet breakpoint and beside\n * them from it up. Beside, the labels share one column as wide as the\n * longest label, up to `--bulma-description-list-label-max-width`, so the\n * values line up.\n */\n orientation?: DescriptionListOrientation;\n /**\n * The orientation below Bulma's tablet breakpoint (769px). Falls back to\n * `orientation`, then to `vertical`.\n */\n orientationMobile?: DescriptionListOrientation;\n /**\n * The orientation from Bulma's tablet breakpoint (769px) up, until a wider\n * viewport's prop takes over. Falls back to `orientation`, then to\n * `horizontal`.\n */\n orientationTablet?: DescriptionListOrientation;\n /**\n * The orientation from Bulma's desktop breakpoint (1024px) up, until a\n * wider viewport's prop takes over. Falls back to `orientationTablet`, and\n * on down.\n */\n orientationDesktop?: DescriptionListOrientation;\n /**\n * The orientation from Bulma's widescreen breakpoint (1216px) up, until\n * `orientationFullhd` takes over. Falls back to `orientationDesktop`, and\n * on down.\n */\n orientationWidescreen?: DescriptionListOrientation;\n /**\n * The orientation from Bulma's fullhd breakpoint (1408px) up. Falls back to\n * `orientationWidescreen`, and on down.\n */\n orientationFullhd?: DescriptionListOrientation;\n /**\n * Draws a line between items, which helps the eye from a label to its\n * value across a wide list, and shows where each item ends to someone\n * zoomed in.\n */\n hasDividers?: boolean;\n /** Text color helper. It colors the values; the labels keep their own color. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * Props for DescriptionList.Item, one fact. The helper props, the other\n * attributes and the `ref` land on its `<div>`.\n *\n * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the `<div>`.\n */\nexport interface DescriptionListItemProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /**\n * The label, such as \"Order\", as a `DescriptionList.Label` before the\n * children.\n */\n label?: React.ReactNode;\n /**\n * The value, such as \"#1234\", as a `DescriptionList.Value` after the\n * children. Text, a link, a `Tag`: anything that renders. `undefined`,\n * `null` and `''` render nothing, so when a value is missing, say so in\n * words, such as \"Not given\", rather than leave a label with nothing after\n * it.\n */\n value?: React.ReactNode;\n /**\n * `DescriptionList.Label`s and `DescriptionList.Value`s, for what `label`\n * and `value` don't cover, such as a label with an info tip or several\n * values. They render between the two, so a `Label` here reads before\n * `value`, and a `Value` here after `label`.\n */\n children?: React.ReactNode;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * Props for DescriptionList.Label. The helper props, the other attributes and\n * the `ref` land on its `<dt>`.\n *\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the `<dt>`.\n */\nexport interface DescriptionListLabelProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /**\n * The label. A button may sit in it, such as one that opens a `Popover`\n * about the label, but not a heading, which HTML doesn't allow here.\n */\n children?: React.ReactNode;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * Props for DescriptionList.Value. The helper props, the other attributes and\n * the `ref` land on its `<dd>`.\n *\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the `<dd>`.\n */\nexport interface DescriptionListValueProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** The value. Anything goes, a list or a paragraph included. */\n children?: React.ReactNode;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * A label, the name of a fact: a `<dt>`, in the weaker text color.\n *\n * @function\n * @param {DescriptionListLabelProps} props - Props for DescriptionList.Label.\n * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the `<dt>`.\n * @returns {JSX.Element} The rendered label.\n *\n * @example\n * <DescriptionList.Label>Placed on</DescriptionList.Label>\n */\nexport const DescriptionListLabel = forwardRef<\n HTMLElement,\n DescriptionListLabelProps\n>(({ className, textColor, bgColor, children, ...props }, ref) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n const labelClass = usePrefixedClassNames('description-list-label');\n return (\n <dt\n ref={ref}\n className={classNames(labelClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {children}\n </dt>\n );\n});\n\nDescriptionListLabel.displayName = 'DescriptionList.Label';\n\n/**\n * A value, what the label says about the thing: a `<dd>`. An item may have several.\n *\n * @function\n * @param {DescriptionListValueProps} props - Props for DescriptionList.Value.\n * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the `<dd>`.\n * @returns {JSX.Element} The rendered value.\n *\n * @example\n * <DescriptionList.Value>14 October 2026</DescriptionList.Value>\n */\nexport const DescriptionListValue = forwardRef<\n HTMLElement,\n DescriptionListValueProps\n>(({ className, textColor, bgColor, children, ...props }, ref) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n const valueClass = usePrefixedClassNames('description-list-value');\n return (\n <dd\n ref={ref}\n className={classNames(valueClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {children}\n </dd>\n );\n});\n\nDescriptionListValue.displayName = 'DescriptionList.Value';\n\n/**\n * One fact: its label and its value, in a `<div>`, from the `label` and `value` props or from `Label` and `Value` children.\n *\n * @function\n * @param {DescriptionListItemProps} props - Props for DescriptionList.Item.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the `<div>`.\n * @returns {JSX.Element} The rendered item.\n *\n * @example\n * <DescriptionList.Item label=\"Order\" value=\"#1234\" />\n *\n * @example\n * <DescriptionList.Item label=\"Tags\">\n * <DescriptionList.Value>Gift</DescriptionList.Value>\n * <DescriptionList.Value>Priority</DescriptionList.Value>\n * </DescriptionList.Item>\n */\nexport const DescriptionListItem = forwardRef<\n HTMLDivElement,\n DescriptionListItemProps\n>(\n (\n { className, label, value, textColor, bgColor, children, ...props },\n ref\n ) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n const itemClass = usePrefixedClassNames('description-list-item');\n return (\n <div\n ref={ref}\n className={classNames(itemClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {isGiven(label) && <DescriptionListLabel>{label}</DescriptionListLabel>}\n {children}\n {isGiven(value) && <DescriptionListValue>{value}</DescriptionListValue>}\n </div>\n );\n }\n);\n\nDescriptionListItem.displayName = 'DescriptionList.Item';\n\n/**\n * The `DescriptionList` component lists facts about one thing, each a label and its value, such as an order's details or a profile.\n *\n * It's a `<dl>`, with a `<div>` for each item, a `<dt>` for each label and\n * a `<dd>` for each value, so assistive tech gets HTML's own list of terms\n * and definitions and no roles are added. Labels sit above their values on\n * a phone and beside them from Bulma's tablet breakpoint up, where every\n * label shares one column so the values line up. For data with two\n * dimensions, such as several records with the same fields, use a `Table`.\n *\n * @function\n * @param {DescriptionListProps} props - Props for the DescriptionList component.\n * @param {React.Ref<HTMLDListElement>} ref - Forwarded ref to the `<dl>`.\n * @returns {JSX.Element} The rendered list.\n *\n * @example\n * <DescriptionList aria-labelledby=\"order-heading\">\n * <DescriptionList.Item label=\"Order\" value=\"#1234\" />\n * <DescriptionList.Item label=\"Placed on\" value=\"14 October 2026\" />\n * </DescriptionList>\n */\nconst DescriptionListRoot = forwardRef<HTMLDListElement, DescriptionListProps>(\n (\n {\n className,\n orientation,\n orientationMobile,\n orientationTablet,\n orientationDesktop,\n orientationWidescreen,\n orientationFullhd,\n hasDividers,\n textColor,\n bgColor,\n children,\n ...props\n },\n ref\n ) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n // A class for each orientation given, which the stylesheet applies from\n // that viewport's breakpoint, so the layout is right on the first paint\n // and on the server. With none, the stylesheet's default is responsive.\n const rootClass = usePrefixedClassNames('description-list', {\n [`is-${orientation}`]: isOrientation(orientation),\n [`is-${orientationMobile}-mobile`]: isOrientation(orientationMobile),\n [`is-${orientationTablet}-tablet`]: isOrientation(orientationTablet),\n [`is-${orientationDesktop}-desktop`]: isOrientation(orientationDesktop),\n [`is-${orientationWidescreen}-widescreen`]: isOrientation(\n orientationWidescreen\n ),\n [`is-${orientationFullhd}-fullhd`]: isOrientation(orientationFullhd),\n 'has-dividers': !!hasDividers,\n });\n return (\n <dl\n ref={ref}\n className={classNames(rootClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {children}\n </dl>\n );\n }\n);\n\nexport const DescriptionList = withSubComponents(\n DescriptionListRoot,\n {\n Item: DescriptionListItem,\n Label: DescriptionListLabel,\n Value: DescriptionListValue,\n },\n 'DescriptionList'\n);\n\nexport default DescriptionList;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;AASA,MAAM,gCAAgC,GAAG,CAAC,UAAU,EAAE,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+ {"version":3,"file":"DescriptionList.js","sources":["../../../src/elements/DescriptionList.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 { withSubComponents } from '../helpers/withSubComponents';\n\nconst validDescriptionListOrientations = ['vertical', 'horizontal'] as const;\n/** Whether each label sits above its value (`vertical`) or beside it (`horizontal`). */\nexport type DescriptionListOrientation =\n (typeof validDescriptionListOrientations)[number];\n\nconst isOrientation = (\n orientation?: string\n): orientation is DescriptionListOrientation =>\n !!orientation &&\n (validDescriptionListOrientations as readonly string[]).includes(orientation);\n\n/** Whether a prop was given something to render. */\nconst isGiven = (node: React.ReactNode) =>\n node !== undefined &&\n node !== null &&\n typeof node !== 'boolean' &&\n node !== '';\n\n/**\n * Props for the DescriptionList component. The helper props, the other\n * attributes and the `ref` land on the `<dl>`.\n *\n * @extraProp {React.Ref<HTMLDListElement>} [ref] - Ref forwarded to the `<dl>`.\n * @extraProp {string} [aria-labelledby] - The id of the heading above the list, which names it.\n */\nexport interface DescriptionListProps\n extends\n Omit<React.HTMLAttributes<HTMLDListElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** `DescriptionList.Item`s, one for each fact. */\n children?: React.ReactNode;\n /**\n * Whether each label sits above its value or beside it, at every width no\n * `orientation<Viewport>` prop covers. Those props read the way a\n * `Column`'s `size<Viewport>` props do: `orientationMobile` applies below\n * Bulma's tablet breakpoint, each of the others from its own breakpoint\n * up, and where several apply the widest one wins. With none of them,\n * labels sit above their values below the tablet breakpoint and beside\n * them from it up. Beside, the labels share one column as wide as the\n * longest label, up to `--bulma-description-list-label-max-width`, so the\n * values line up.\n */\n orientation?: DescriptionListOrientation;\n /**\n * The orientation below Bulma's tablet breakpoint (769px). Falls back to\n * `orientation`, then to `vertical`.\n */\n orientationMobile?: DescriptionListOrientation;\n /**\n * The orientation from Bulma's tablet breakpoint (769px) up, until a wider\n * viewport's prop takes over. Falls back to `orientation`, then to\n * `horizontal`.\n */\n orientationTablet?: DescriptionListOrientation;\n /**\n * The orientation from Bulma's desktop breakpoint (1024px) up, until a\n * wider viewport's prop takes over. Falls back to `orientationTablet`, and\n * on down.\n */\n orientationDesktop?: DescriptionListOrientation;\n /**\n * The orientation from Bulma's widescreen breakpoint (1216px) up, until\n * `orientationFullhd` takes over. Falls back to `orientationDesktop`, and\n * on down.\n */\n orientationWidescreen?: DescriptionListOrientation;\n /**\n * The orientation from Bulma's fullhd breakpoint (1408px) up. Falls back to\n * `orientationWidescreen`, and on down.\n */\n orientationFullhd?: DescriptionListOrientation;\n /**\n * Draws a line between items, which helps the eye from a label to its\n * value across a wide list, and shows where each item ends to someone\n * zoomed in.\n */\n hasDividers?: boolean;\n /** Text color helper. It colors the values; the labels keep their own color. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * Props for DescriptionList.Item, one fact. The helper props, the other\n * attributes and the `ref` land on its `<div>`.\n *\n * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the `<div>`.\n */\nexport interface DescriptionListItemProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /**\n * The label, such as \"Order\", as a `DescriptionList.Label` before the\n * children.\n */\n label?: React.ReactNode;\n /**\n * The value, such as \"#1234\", as a `DescriptionList.Value` after the\n * children. Text, a link, a `Tag`: anything that renders. `undefined`,\n * `null` and `''` render nothing, so when a value is missing, say so in\n * words, such as \"Not given\", rather than leave a label with nothing after\n * it.\n */\n value?: React.ReactNode;\n /**\n * `DescriptionList.Label`s and `DescriptionList.Value`s, for what `label`\n * and `value` don't cover, such as a label with an info tip or several\n * values. They render between the two, so a `Label` here reads before\n * `value`, and a `Value` here after `label`.\n */\n children?: React.ReactNode;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * Props for DescriptionList.Label. The helper props, the other attributes and\n * the `ref` land on its `<dt>`.\n *\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the `<dt>`.\n */\nexport interface DescriptionListLabelProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /**\n * The label. A button may sit in it, such as one that opens a `Popover`\n * about the label, but not a heading, which HTML doesn't allow here.\n */\n children?: React.ReactNode;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * Props for DescriptionList.Value. The helper props, the other attributes and\n * the `ref` land on its `<dd>`.\n *\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the `<dd>`.\n */\nexport interface DescriptionListValueProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** The value. Anything goes, a list or a paragraph included. */\n children?: React.ReactNode;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * A label, the name of a fact: a `<dt>`, in the weaker text color.\n *\n * @function\n * @param {DescriptionListLabelProps} props - Props for DescriptionList.Label.\n * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the `<dt>`.\n * @returns {JSX.Element} The rendered label.\n *\n * @example\n * <DescriptionList.Label>Placed on</DescriptionList.Label>\n */\nexport const DescriptionListLabel = forwardRef<\n HTMLElement,\n DescriptionListLabelProps\n>(({ className, textColor, bgColor, children, ...props }, ref) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n const labelClass = usePrefixedClassNames('description-list-label');\n return (\n <dt\n ref={ref}\n className={classNames(labelClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {children}\n </dt>\n );\n});\n\nDescriptionListLabel.displayName = 'DescriptionList.Label';\n\n/**\n * A value, what the label says about the thing: a `<dd>`. An item may have several.\n *\n * @function\n * @param {DescriptionListValueProps} props - Props for DescriptionList.Value.\n * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the `<dd>`.\n * @returns {JSX.Element} The rendered value.\n *\n * @example\n * <DescriptionList.Value>14 October 2026</DescriptionList.Value>\n */\nexport const DescriptionListValue = forwardRef<\n HTMLElement,\n DescriptionListValueProps\n>(({ className, textColor, bgColor, children, ...props }, ref) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n const valueClass = usePrefixedClassNames('description-list-value');\n return (\n <dd\n ref={ref}\n className={classNames(valueClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {children}\n </dd>\n );\n});\n\nDescriptionListValue.displayName = 'DescriptionList.Value';\n\n/**\n * One fact: its label and its value, in a `<div>`, from the `label` and `value` props or from `Label` and `Value` children.\n *\n * @function\n * @param {DescriptionListItemProps} props - Props for DescriptionList.Item.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the `<div>`.\n * @returns {JSX.Element} The rendered item.\n *\n * @example\n * <DescriptionList.Item label=\"Order\" value=\"#1234\" />\n *\n * @example\n * <DescriptionList.Item label=\"Tags\">\n * <DescriptionList.Value>Gift</DescriptionList.Value>\n * <DescriptionList.Value>Priority</DescriptionList.Value>\n * </DescriptionList.Item>\n */\nexport const DescriptionListItem = forwardRef<\n HTMLDivElement,\n DescriptionListItemProps\n>(\n (\n { className, label, value, textColor, bgColor, children, ...props },\n ref\n ) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n const itemClass = usePrefixedClassNames('description-list-item');\n return (\n <div\n ref={ref}\n className={classNames(itemClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {isGiven(label) && <DescriptionListLabel>{label}</DescriptionListLabel>}\n {children}\n {isGiven(value) && <DescriptionListValue>{value}</DescriptionListValue>}\n </div>\n );\n }\n);\n\nDescriptionListItem.displayName = 'DescriptionList.Item';\n\n/**\n * The `DescriptionList` component lists facts about one thing, each a label and its value, such as an order's details or a profile.\n *\n * It's a `<dl>`, with a `<div>` for each item, a `<dt>` for each label and\n * a `<dd>` for each value, so assistive tech gets HTML's own list of terms\n * and definitions and no roles are added. Labels sit above their values on\n * a phone and beside them from Bulma's tablet breakpoint up, where every\n * label shares one column so the values line up. For data with two\n * dimensions, such as several records with the same fields, use a `Table`.\n *\n * @function\n * @param {DescriptionListProps} props - Props for the DescriptionList component.\n * @param {React.Ref<HTMLDListElement>} ref - Forwarded ref to the `<dl>`.\n * @returns {JSX.Element} The rendered list.\n *\n * @example\n * <DescriptionList aria-labelledby=\"order-heading\">\n * <DescriptionList.Item label=\"Order\" value=\"#1234\" />\n * <DescriptionList.Item label=\"Placed on\" value=\"14 October 2026\" />\n * </DescriptionList>\n */\nconst DescriptionListRoot = forwardRef<HTMLDListElement, DescriptionListProps>(\n (\n {\n className,\n orientation,\n orientationMobile,\n orientationTablet,\n orientationDesktop,\n orientationWidescreen,\n orientationFullhd,\n hasDividers,\n textColor,\n bgColor,\n children,\n ...props\n },\n ref\n ) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n // A class for each orientation given, which the stylesheet applies from\n // that viewport's breakpoint, so the layout is right on the first paint\n // and on the server. With none, the stylesheet's default is responsive.\n const rootClass = usePrefixedClassNames('description-list', {\n [`is-${orientation}`]: isOrientation(orientation),\n [`is-${orientationMobile}-mobile`]: isOrientation(orientationMobile),\n [`is-${orientationTablet}-tablet`]: isOrientation(orientationTablet),\n [`is-${orientationDesktop}-desktop`]: isOrientation(orientationDesktop),\n [`is-${orientationWidescreen}-widescreen`]: isOrientation(\n orientationWidescreen\n ),\n [`is-${orientationFullhd}-fullhd`]: isOrientation(orientationFullhd),\n 'has-dividers': !!hasDividers,\n });\n return (\n <dl\n ref={ref}\n className={classNames(rootClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {children}\n </dl>\n );\n }\n);\n\nexport const DescriptionList = withSubComponents(\n DescriptionListRoot,\n {\n Item: DescriptionListItem,\n Label: DescriptionListLabel,\n Value: DescriptionListValue,\n },\n 'DescriptionList'\n);\n\nexport default DescriptionList;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;AASA,MAAM,gCAAgC,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU;AAK5E,MAAM,aAAa,GAAG,CACpB,WAAoB,KAEpB,CAAC,CAAC,WAAW;AACZ,IAAA,gCAAsD,CAAC,QAAQ,CAAC,WAAW,CAAC;AAE/E;AACA,MAAM,OAAO,GAAG,CAAC,IAAqB,KACpC,IAAI,KAAK,SAAS;AAClB,IAAA,IAAI,KAAK,IAAI;IACb,OAAO,IAAI,KAAK,SAAS;IACzB,IAAI,KAAK,EAAE;AAsJb;;;;;;;;;;AAUG;MACU,oBAAoB,GAAG,UAAU,CAG5C,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AAC/D,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;AACF,IAAA,MAAM,UAAU,GAAG,qBAAqB,CAAC,wBAAwB,CAAC;IAClE,QACEA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,EAAM,qBAAqB,CAAA,WAAA,CAAa,GAAG,aAAa,CACvD,qBAAqB,CACtB;QACD,CAAC,CAAA,GAAA,EAAM,iBAAiB,CAAA,OAAA,CAAS,GAAG,aAAa,CAAC,iBAAiB,CAAC;QACpE,cAAc,EAAE,CAAC,CAAC,WAAW;AAC9B,KAAA,CAAC;IACF,QACEA,YACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,kBAAkB,EAAE,SAAS,CAAC,EAAA,GAC3D,IAAI,EAAA,QAAA,EAEP,QAAQ,EAAA,CACN;AAET,CAAC,CACF;AAEM,MAAM,eAAe,GAAG,iBAAiB,CAC9C,mBAAmB,EACnB;AACE,IAAA,IAAI,EAAE,mBAAmB;AACzB,IAAA,KAAK,EAAE,oBAAoB;AAC3B,IAAA,KAAK,EAAE,oBAAoB;CAC5B,EACD,iBAAiB;;"}
@@ -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 { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
4
5
  import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Divider.js","sources":["../../../src/elements/Divider.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the Divider component.\n */\nexport interface DividerProps\n extends\n React.HTMLAttributes<HTMLHRElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * The `Divider` component renders a styled horizontal rule (`<hr>`) element with Bulma helper class integration.\n *\n * @function\n * @param {DividerProps} props - Props for the Divider component.\n * @returns {JSX.Element} The rendered hr element.\n */\nexport const Divider: React.FC<DividerProps> = ({\n className,\n bgColor,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const dividerClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return <hr className={dividerClasses || undefined} {...rest} />;\n};\n"],"names":["_jsx"],"mappings":";;;;;AAqBA;;;;;;AAMG;AACI,MAAM,OAAO,GAA2B,CAAC,EAC9C,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;AAEtC,IAAA,MAAM,YAAY,GAAG,qBAAqB,EAAE;IAC5C,MAAM,cAAc,GAAG,UAAU,CAC/B,YAAY,EACZ,kBAAkB,EAClB,SAAS,CACV;IAED,OAAOA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,cAAc,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,CAAI;AACjE;;"}
1
+ {"version":3,"file":"Divider.js","sources":["../../../src/elements/Divider.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the Divider component.\n */\nexport interface DividerProps\n extends\n React.HTMLAttributes<HTMLHRElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * The `Divider` component renders a styled horizontal rule (`<hr>`) element with Bulma helper class integration.\n *\n * @function\n * @param {DividerProps} props - Props for the Divider component.\n * @returns {JSX.Element} The rendered hr element.\n */\nexport const Divider: React.FC<DividerProps> = ({\n className,\n bgColor,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const dividerClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return <hr className={dividerClasses || undefined} {...rest} />;\n};\n"],"names":["_jsx"],"mappings":";;;;;;AAqBA;;;;;;AAMG;AACI,MAAM,OAAO,GAA2B,CAAC,EAC9C,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;AAEtC,IAAA,MAAM,YAAY,GAAG,qBAAqB,EAAE;IAC5C,MAAM,cAAc,GAAG,UAAU,CAC/B,YAAY,EACZ,kBAAkB,EAClB,SAAS,CACV;IAED,OAAOA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,cAAc,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,CAAI;AACjE;;"}
@@ -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 { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
4
5
  import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Emphasis.js","sources":["../../../src/elements/Emphasis.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the Emphasis component.\n */\nexport interface EmphasisProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Content to render inside the em element. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Emphasis` component renders a styled `<em>` element with Bulma helper class integration.\n *\n * @function\n * @param {EmphasisProps} props - Props for the Emphasis component.\n * @returns {JSX.Element} The rendered em element.\n */\nexport const Emphasis: React.FC<EmphasisProps> = ({\n className,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const emphasisClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return (\n <em className={emphasisClasses || undefined} {...rest}>\n {children}\n </em>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAyBA;;;;;;AAMG;AACI,MAAM,QAAQ,GAA4B,CAAC,EAChD,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;AAEtC,IAAA,MAAM,YAAY,GAAG,qBAAqB,EAAE;IAC5C,MAAM,eAAe,GAAG,UAAU,CAChC,YAAY,EACZ,kBAAkB,EAClB,SAAS,CACV;AAED,IAAA,QACEA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,eAAe,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAClD,QAAQ,EAAA,CACN;AAET;;"}
1
+ {"version":3,"file":"Emphasis.js","sources":["../../../src/elements/Emphasis.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the Emphasis component.\n */\nexport interface EmphasisProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Content to render inside the em element. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Emphasis` component renders a styled `<em>` element with Bulma helper class integration.\n *\n * @function\n * @param {EmphasisProps} props - Props for the Emphasis component.\n * @returns {JSX.Element} The rendered em element.\n */\nexport const Emphasis: React.FC<EmphasisProps> = ({\n className,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const emphasisClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return (\n <em className={emphasisClasses || undefined} {...rest}>\n {children}\n </em>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AAyBA;;;;;;AAMG;AACI,MAAM,QAAQ,GAA4B,CAAC,EAChD,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;AAEtC,IAAA,MAAM,YAAY,GAAG,qBAAqB,EAAE;IAC5C,MAAM,eAAe,GAAG,UAAU,CAChC,YAAY,EACZ,kBAAkB,EAClB,SAAS,CACV;AAED,IAAA,QACEA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,eAAe,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAClD,QAAQ,EAAA,CACN;AAET;;"}
@@ -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 { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
4
5
  import { withSubComponents } from '../helpers/withSubComponents.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Figure.js","sources":["../../../src/elements/Figure.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the FigureCaption component.\n */\nexport interface FigureCaptionProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color (Bulma color, 'inherit', or 'current'). */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color (Bulma color, 'inherit', or 'current'). */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Content to be rendered inside the figcaption. */\n children?: React.ReactNode;\n}\n\n/**\n * FigureCaption component for rendering a styled figcaption element.\n *\n * A FigureCaption wraps the HTML `<figcaption>` element with Bulma helper class integration.\n * Use it inside Figure components to provide captions for images or other media.\n *\n * @function\n * @param {FigureCaptionProps} props - Props for the FigureCaption component.\n * @returns {JSX.Element} The rendered figcaption element.\n */\nconst FigureCaption: React.FC<FigureCaptionProps> = ({\n className,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const captionClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return (\n <figcaption className={captionClasses || undefined} {...rest}>\n {children}\n </figcaption>\n );\n};\n\n/**\n * Props for the Figure component.\n */\nexport interface FigureProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Content to render inside the figure. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Figure` component renders a styled `<figure>` element with Bulma helper class integration.\n *\n * @function\n * @param {FigureProps} props - Props for the Figure component.\n * @returns {JSX.Element} The rendered figure element.\n */\nconst FigureComponent: React.FC<FigureProps> = ({\n className,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const figureClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <figure className={figureClasses || undefined} {...rest}>\n {children}\n </figure>\n );\n};\n\n/**\n * Figure component with Caption subcomponent.\n *\n * @example\n * <Figure>\n * <img src=\"image.jpg\" alt=\"Description\" />\n * <Figure.Caption>Image caption text</Figure.Caption>\n * </Figure>\n */\nexport const Figure = withSubComponents(\n FigureComponent,\n {\n Caption: FigureCaption,\n },\n 'Figure'\n);\n"],"names":["_js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aAAa;CACvB,EACD,QAAQ;;"}
1
+ {"version":3,"file":"Figure.js","sources":["../../../src/elements/Figure.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the FigureCaption component.\n */\nexport interface FigureCaptionProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color (Bulma color, 'inherit', or 'current'). */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color (Bulma color, 'inherit', or 'current'). */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Content to be rendered inside the figcaption. */\n children?: React.ReactNode;\n}\n\n/**\n * FigureCaption component for rendering a styled figcaption element.\n *\n * A FigureCaption wraps the HTML `<figcaption>` element with Bulma helper class integration.\n * Use it inside Figure components to provide captions for images or other media.\n *\n * @function\n * @param {FigureCaptionProps} props - Props for the FigureCaption component.\n * @returns {JSX.Element} The rendered figcaption element.\n */\nconst FigureCaption: React.FC<FigureCaptionProps> = ({\n className,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const captionClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return (\n <figcaption className={captionClasses || undefined} {...rest}>\n {children}\n </figcaption>\n );\n};\n\n/**\n * Props for the Figure component.\n */\nexport interface FigureProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Content to render inside the figure. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Figure` component renders a styled `<figure>` element with Bulma helper class integration.\n *\n * @function\n * @param {FigureProps} props - Props for the Figure component.\n * @returns {JSX.Element} The rendered figure element.\n */\nconst FigureComponent: React.FC<FigureProps> = ({\n className,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const figureClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <figure className={figureClasses || undefined} {...rest}>\n {children}\n </figure>\n );\n};\n\n/**\n * Figure component with Caption subcomponent.\n *\n * @example\n * <Figure>\n * <img src=\"image.jpg\" alt=\"Description\" />\n * <Figure.Caption>Image caption text</Figure.Caption>\n * </Figure>\n */\nexport const Figure = withSubComponents(\n FigureComponent,\n {\n Caption: FigureCaption,\n },\n 'Figure'\n);\n"],"names":["_jsx"],"mappings":";;;;;;;AA0BA;;;;;;;;;AASG;AACH,MAAM,aAAa,GAAiC,CAAC,EACnD,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;AAEtC,IAAA,MAAM,YAAY,GAAG,qBAAqB,EAAE;IAC5C,MAAM,cAAc,GAAG,UAAU,CAC/B,YAAY,EACZ,kBAAkB,EAClB,SAAS,CACV;AAED,IAAA,QACEA,GAAA,CAAA,YAAA,EAAA,EAAY,SAAS,EAAE,cAAc,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EACzD,QAAQ,EAAA,CACE;AAEjB,CAAC;AAmBD;;;;;;AAMG;AACH,MAAM,eAAe,GAA0B,CAAC,EAC9C,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;AAEtC,IAAA,MAAM,YAAY,GAAG,qBAAqB,EAAE;IAC5C,MAAM,aAAa,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAE7E,IAAA,QACEA,GAAA,CAAA,QAAA,EAAA,EAAQ,SAAS,EAAE,aAAa,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EACpD,QAAQ,EAAA,CACF;AAEb,CAAC;AAED;;;;;;;;AAQG;AACI,MAAM,MAAM,GAAG,iBAAiB,CACrC,eAAe,EACf;AACE,IAAA,OAAO,EAAE,aAAa;CACvB,EACD,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 { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
4
5
  import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sources":["../../../src/elements/Icon.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\nimport { useIconLibrary } from '../helpers/Config';\n\n// TypeScript declaration for Ionicons web component\ninterface IonIconProps extends React.HTMLAttributes<HTMLElement> {\n name?: string;\n src?: string;\n icon?: unknown;\n size?: string;\n lazy?: boolean;\n sanitize?: boolean;\n color?: string;\n flipRtl?: boolean;\n ariaLabel?: string;\n ariaHidden?: string;\n}\n\n// React 19 moved the global `JSX` namespace under the `react` module, so the\n// `<ion-icon>` web-component augmentation must target `React.JSX` to take effect.\ndeclare module 'react' {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'ion-icon': IonIconProps;\n }\n }\n}\n\ntype IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols'; // 'fa' = Font Awesome, 'mdi' = Material Design Icons, 'ion' = Ionicons Web Components, 'material-icons' = Google Material Icons, 'material-symbols' = Google Material Symbols\n\n/**\n * Shared props for the Icon component, independent of whether a class-based `name` or a\n * custom `children` node supplies the glyph.\n */\ninterface IconBaseProps\n extends React.HTMLAttributes<HTMLSpanElement>, BulmaClassesProps {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Text color alias: renders `has-text-<color>`, exactly like `textColor`.\n * Not a filled variant (no `.icon.is-<color>` CSS exists). Prefer\n * `textColor`, which takes precedence when both are set; use `bgColor` for\n * a colored surface.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Legacy icon class string (e.g. `'fas fa-star'`). Only its last segment is read, as the\n * glyph name; the library still comes from `library` or `ConfigProvider`, so\n * `'mdi mdi-rocket'` renders an `fa` class unless the effective library is already `mdi` —\n * set it here or on the provider.\n *\n * @deprecated Use `name` instead.\n */\n icon?: string;\n /**\n * The icon library to use ('fa' = Font Awesome, 'mdi' = Material Design Icons, 'ion' = Ionicons Web Components, 'material-icons' = Google Material Icons, 'material-symbols' = Google Material Symbols). Defaults to the value set in ConfigProvider or 'fa' if not configured. Ignored when `children` supplies the glyph instead of `name`.\n * @defaultValue 'fa'\n */\n library?: IconLibrary; // defaults to ConfigProvider iconLibrary or 'fa'\n /** Icon style variant (e.g. `'solid'`, `'outlined'`, `'rounded'`). Ignored when `children` supplies the glyph instead of `name`. */\n variant?: string; // e.g., 'solid', 'outlined', 'rounded', 'sharp'\n /** Additional modifiers (e.g. `'fa-lg'`, `'fa-spin'`, `'is-size-1'`). Ignored when `children` supplies the glyph instead of `name`. */\n features?: string | string[]; // e.g., 'fa-lg', 'fa-spin', 'is-size-1'\n /**\n * Additional modifiers in the older combined form, parsed into `variant` and `features`.\n *\n * @deprecated Use `variant` and `features` instead.\n */\n libraryFeatures?: string | string[];\n /** Size modifier for the icon container. */\n size?: 'small' | 'medium' | 'large';\n /**\n * Accessible name for an icon that means something on its own. Set it and the container\n * span gets `role=\"img\"` with this `aria-label`, so the name is exactly this text: a\n * Material ligature such as `rocket_launch` inside stays out of it. Leave it unset (or\n * empty) and the icon is decorative: the span renders `aria-hidden=\"true\"` and no name,\n * so it adds nothing to the accessible name of a `Button` or text around it. For an\n * icon-only control, put the name on the control (e.g. `Button`'s `aria-label`) and leave\n * this unset. A non-empty native `aria-label` or `aria-labelledby` passed instead also\n * counts as a name, and an explicit `role` or `aria-hidden` wins over both defaults. An\n * unnamed icon given a `role` or a `tabIndex` of its own isn't hidden, since hiding\n * something focusable is a failure of its own.\n */\n ariaLabel?: string;\n /** Inline style object. */\n style?: React.CSSProperties;\n /** Override the default `'icon'` container class (e.g., `'panel-icon'`). */\n containerClassName?: string; // Override the default 'icon' container class (e.g., 'panel-icon')\n}\n\n/**\n * Props for `Icon` rendering a class-based glyph from an icon library.\n */\nexport interface IconNameProps extends IconBaseProps {\n /** The icon name, with or without its library prefix (e.g. `'star'` or `'fa-star'`). Mutually exclusive with `children`. */\n name: string; // e.g., 'star', 'account', 'home-outline'\n /** A custom node (an inline SVG, a `react-icons` component, …) rendered inside the icon container in place of a class-based glyph. Mutually exclusive with `name`. */\n children?: never;\n}\n\n/**\n * Props for `Icon` rendering a custom node (an inline SVG, a `react-icons` component, a Font\n * Awesome React `<FontAwesomeIcon>`, …) in place of a class-based glyph.\n */\nexport interface IconChildrenProps extends IconBaseProps {\n /** The icon name, with or without its library prefix (e.g. `'star'` or `'fa-star'`). Mutually exclusive with `children`. */\n name?: undefined;\n /** A custom node (an inline SVG, a `react-icons` component, …) rendered inside the icon container in place of a class-based glyph. Mutually exclusive with `name`. */\n // `undefined` is excluded deliberately: the renderer discriminates on `children !== undefined`,\n // so `children={undefined}` would satisfy the type but fall through to the `name` path with no\n // name and render an `fa-undefined` glyph. Excluding it keeps the advertised\n // exactly-one-of-`name`-or-`children` constraint matching what actually renders.\n children: Exclude<React.ReactNode, undefined>;\n}\n\n/**\n * Props for `Icon` naming its glyph through the deprecated `icon` prop instead of `name`.\n *\n * The runtime has always accepted `icon` on its own — it strips a leading library prefix off\n * the class string and falls through to the `name` path — but the type offered no member without\n * a `name` or `children`, so every caller still on the deprecated prop got an error the\n * package could not see — until #663 nothing here type-checked a test or a story, so the\n * three `Icon.test.tsx` cases exercising this path proved the runtime and said nothing about\n * the type. Declaring the path is the honest resolution: it is deprecated, not removed, and a\n * deprecation that does not type-check is a removal announced only to whoever tries it.\n *\n * @deprecated Pass `name` instead. This member goes when `icon` does.\n */\nexport interface IconDeprecatedProps extends IconBaseProps {\n /**\n * Legacy icon class string (e.g. `'fas fa-star'`). Only its last segment is read, as the\n * glyph name; the library still comes from `library` or `ConfigProvider`, so\n * `'mdi mdi-rocket'` renders an `fa` class unless the effective library is already `mdi` —\n * set it here or on the provider.\n *\n * @deprecated Use `name` instead.\n */\n // Required here, optional on `IconBaseProps`: the other two members allow it\n // alongside `name`, and this one is the member where it IS the glyph. Same\n // prose in both places on purpose — the API-docs extractor reads whichever it\n // reaches first, and the two must not drift apart.\n icon: string;\n /** The icon name. Absent on this path — `icon` supplies the glyph. */\n name?: undefined;\n /** A custom node. Mutually exclusive with `icon`. */\n children?: never;\n}\n\n/**\n * Props for the Icon component — a discriminated union of a class-based `name`, a custom\n * `children` node, and the deprecated `icon` class string.\n */\nexport type IconProps = IconNameProps | IconChildrenProps | IconDeprecatedProps;\n\n/**\n * Strips a redundant leading library prefix from an icon name (e.g. `fa-check` -> `check`\n * for the `fa` library, `mdi-account` -> `account` for `mdi`), so `name` behaves the same\n * whether or not the caller includes the prefix. Font Awesome and Material Design Icons docs\n * conventionally refer to icons with their class prefix (`fa-check`), which otherwise gets\n * doubled by `getIconClasses` (producing `fa-fa-check`, matching no glyph).\n *\n * @param {string} name - The icon name, possibly including a redundant library prefix.\n * @param {IconLibrary} library - The icon library the name will be rendered with.\n * @returns {string} The icon name with any redundant leading library prefix removed.\n */\nfunction stripRedundantLibraryPrefix(\n name: string,\n library: IconLibrary\n): string {\n if (!name) {\n return name;\n }\n if (library === 'fa' && name.startsWith('fa-')) {\n return name.substring(3);\n }\n if (library === 'mdi' && name.startsWith('mdi-')) {\n return name.substring(4);\n }\n return name;\n}\n\n/**\n * Gets the correct classes for the icon element based on the library and features.\n *\n * @param {IconLibrary} library - The icon library.\n * @param {string} name - The icon name.\n * @param {string} [variant] - Icon style variant (e.g., 'solid', 'outlined', 'rounded').\n * @param {string | string[]} [features] - Additional library-specific modifiers.\n * @returns {string} The combined class string for the icon.\n */\nfunction getIconClasses(\n library: IconLibrary,\n name: string,\n variant?: string,\n features?: string | string[]\n): string {\n let baseClass: string;\n let iconClass: string;\n const featureList = Array.isArray(features)\n ? features\n : features\n ? [features]\n : [];\n\n switch (library) {\n case 'fa': {\n // Font Awesome: use variant as style ('solid' -> 'fas', 'regular' -> 'far', etc.)\n const styleMap: Record<string, string> = {\n solid: 'fas',\n regular: 'far',\n brands: 'fab',\n light: 'fal',\n duotone: 'fad',\n thin: 'fat',\n };\n const faStyle = variant ? styleMap[variant] || variant : 'fas';\n baseClass = faStyle;\n iconClass = `fa-${name}`;\n return [baseClass, iconClass, ...featureList].join(' ');\n }\n case 'mdi':\n // Material Design Icons: no variants, just features\n baseClass = 'mdi';\n iconClass = `mdi-${name}`;\n return [baseClass, iconClass, ...featureList].join(' ');\n case 'material-icons': {\n // Google Material Icons: map variants to full class names\n const styleVariants: Record<string, string> = {\n filled: 'material-icons',\n outlined: 'material-icons-outlined',\n round: 'material-icons-round',\n sharp: 'material-icons-sharp',\n };\n baseClass = variant\n ? styleVariants[variant] || `material-icons-${variant}`\n : 'material-icons';\n return [baseClass, ...featureList].join(' ');\n }\n case 'material-symbols': {\n // Google Material Symbols: map variants to full class names\n const styleVariants: Record<string, string> = {\n outlined: 'material-symbols-outlined',\n rounded: 'material-symbols-rounded',\n sharp: 'material-symbols-sharp',\n };\n baseClass = variant\n ? styleVariants[variant] || `material-symbols-${variant}`\n : 'material-symbols-outlined';\n return [baseClass, ...featureList].join(' ');\n }\n default:\n // fallback: just icon name and features\n return [name, ...featureList].join(' ');\n }\n}\n\n/**\n * The `Icon` component is a Bulma-styled wrapper for displaying icons from various libraries (Font Awesome, Material Design Icons, Ionicons, Google Material Icons, Material Symbols, etc.).\n *\n * @function\n * @param {IconProps} props - Props for the Icon component.\n * @returns {JSX.Element} The rendered icon element.\n * @see {@link https://bulma.io/documentation/elements/icon/ | Bulma Icon documentation}\n */\nexport const Icon: React.FC<IconProps> = ({\n className,\n textColor,\n bgColor,\n name,\n library,\n variant,\n features,\n libraryFeatures, // Deprecated but maintained for backward compatibility\n size,\n ariaLabel,\n style,\n icon, // Capture and exclude the deprecated 'icon' prop from DOM\n color,\n containerClassName,\n children,\n ...restProps\n}) => {\n // Get the default icon library from context, fallback to 'fa' if not set\n const defaultLibrary = useIconLibrary();\n\n /**\n * Generates Bulma helper classes and separates out remaining props.\n * Note: variant, features, and libraryFeatures are excluded from props spread\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...restProps,\n });\n\n // Hoisted unconditionally to respect rules-of-hooks; the branches below\n // pick which result to consume.\n const defaultIconClasses = usePrefixedClassNames('icon', {\n [`is-${size}`]: size,\n });\n const sizeModifierClass = usePrefixedClassNames(\n size ? `is-${size}` : undefined\n );\n\n const bulmaClasses = containerClassName\n ? containerClassName\n : defaultIconClasses;\n\n const iconContainerClasses = classNames(\n bulmaClasses,\n containerClassName && size ? sizeModifierClass : undefined,\n bulmaHelperClasses,\n className\n );\n\n // A named icon is an image, whose name is its label alone, so a ligature inside\n // never leaks into it. An unnamed one is decorative and hidden outright. Spread\n // before `rest`, so a caller's own `role` or `aria-hidden` still wins.\n const named =\n !!ariaLabel || !!restProps['aria-label'] || !!restProps['aria-labelledby'];\n // A caller's own `role` or `tabIndex` on an unnamed icon means it isn't decoration (an\n // icon made a button, say), so it isn't hidden either: `aria-hidden` on something\n // focusable is a failure of its own.\n const a11yProps = named\n ? { role: 'img', 'aria-label': ariaLabel || undefined }\n : restProps.role !== undefined || restProps.tabIndex !== undefined\n ? {}\n : { 'aria-hidden': true };\n\n if (children !== undefined) {\n // `IconChildrenProps`: render the caller's node (an inline SVG, a `react-icons`\n // component, …) in place of a class-based glyph. Library/variant/features don't apply.\n return (\n <span\n className={iconContainerClasses}\n {...a11yProps}\n style={style}\n {...rest}\n >\n {children}\n </span>\n );\n }\n\n // `name` is guaranteed once `children` is absent UNLESS the caller is on the deprecated\n // `icon` path, which `IconDeprecatedProps` declares with `name?: undefined`.\n // (`IconChildrenProps['children']` excludes `undefined`, so `children={undefined}` can't\n // slip past into this branch.) The cast covers that third member, and the `!name && icon`\n // fallback below is what fills it in.\n let finalName = name as string;\n if (!name && icon) {\n // If icon prop is provided instead of name, try to parse it\n // e.g., \"mdi mdi-rocket-launch\" -> \"rocket-launch\"\n if (typeof icon === 'string') {\n const parts = icon.split(' ');\n const lastPart = parts[parts.length - 1];\n if (lastPart.startsWith('mdi-')) {\n finalName = lastPart.substring(4); // Remove \"mdi-\" prefix\n } else if (lastPart.startsWith('fa-')) {\n finalName = lastPart.substring(3); // Remove \"fa-\" prefix\n } else {\n finalName = lastPart;\n }\n }\n }\n\n const finalLibrary = library || defaultLibrary || 'fa';\n\n // Normalize a redundant leading library prefix (e.g. \"fa-check\" -> \"check\" when the\n // library is 'fa'), so `name` behaves identically with or without the prefix.\n finalName = stripRedundantLibraryPrefix(finalName, finalLibrary);\n\n if (!finalName) {\n // No glyph to name. Reachable through the public type only as `icon=\"\"`, and otherwise\n // by a plain-JS caller (or one that casts). Building a class off an absent name produced\n // a bogus `fa-undefined` glyph; render the bare container instead, matching the\n // `children` branch.\n return (\n <span\n className={iconContainerClasses}\n {...a11yProps}\n style={style}\n {...rest}\n />\n );\n }\n\n // Backward compatibility: if libraryFeatures is provided, parse it for variant and features\n let finalVariant = variant;\n let finalFeatures = features;\n\n if (libraryFeatures && !variant && !features) {\n const legacyFeatures = Array.isArray(libraryFeatures)\n ? libraryFeatures\n : [libraryFeatures];\n\n // For Font Awesome, extract style from features\n if (finalLibrary === 'fa') {\n const faStyle = legacyFeatures.find(f =>\n [\n 'fas',\n 'far',\n 'fab',\n 'fal',\n 'fad',\n 'fat',\n 'solid',\n 'regular',\n 'brands',\n 'light',\n 'duotone',\n 'thin',\n ].includes(f)\n );\n if (faStyle) {\n finalVariant = faStyle;\n finalFeatures = legacyFeatures.filter(f => f !== faStyle);\n } else {\n finalFeatures = legacyFeatures;\n }\n }\n // For Material Icons/Symbols, extract style variant\n else if (\n finalLibrary === 'material-icons' ||\n finalLibrary === 'material-symbols'\n ) {\n const styleVariants =\n finalLibrary === 'material-icons'\n ? ['filled', 'outlined', 'round', 'sharp']\n : ['outlined', 'rounded', 'sharp'];\n\n const styleVariant = legacyFeatures.find(f => styleVariants.includes(f));\n if (styleVariant) {\n finalVariant = styleVariant;\n finalFeatures = legacyFeatures.filter(f => f !== styleVariant);\n } else {\n finalFeatures = legacyFeatures;\n }\n }\n // For others, all features go to finalFeatures\n else {\n finalFeatures = legacyFeatures;\n }\n }\n\n // Handle web components vs CSS-based icons\n if (finalLibrary === 'ion') {\n // For Ionicons, handle variant in the name\n let ionName = finalName;\n if (finalVariant === 'outline') {\n ionName = `${finalName}-outline`;\n } else if (finalVariant === 'sharp') {\n ionName = `${finalName}-sharp`;\n }\n\n return (\n <span\n className={iconContainerClasses}\n {...a11yProps}\n style={style}\n {...rest}\n >\n <ion-icon name={ionName} />\n </span>\n );\n }\n\n // Legacy CSS-based icons\n const iClasses = getIconClasses(\n finalLibrary,\n finalName,\n finalVariant,\n finalFeatures\n );\n\n // Material Icons and Material Symbols use text content, not CSS classes for the icon name\n if (\n finalLibrary === 'material-icons' ||\n finalLibrary === 'material-symbols'\n ) {\n return (\n <span\n className={iconContainerClasses}\n {...a11yProps}\n style={style}\n {...rest}\n >\n <i className={iClasses}>{finalName}</i>\n </span>\n );\n }\n\n return (\n <span\n className={iconContainerClasses}\n {...a11yProps}\n style={style}\n {...rest}\n >\n <i className={iClasses} />\n </span>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AAoKA;;;;;;;;;;AAUG;AACH,SAAS,2BAA2B,CAClC,IAAY,EACZ,OAAoB,EAAA;IAEpB,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAO,IAAI;IACb;IACA,IAAI,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;AAC9C,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1B;IACA,IAAI,OAAO,KAAK,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAChD,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1B;AACA,IAAA,OAAO,IAAI;AACb;AAEA;;;;;;;;AAQG;AACH,SAAS,cAAc,CACrB,OAAoB,EACpB,IAAY,EACZ,OAAgB,EAChB,QAA4B,EAAA;AAE5B,IAAA,IAAI,SAAiB;AACrB,IAAA,IAAI,SAAiB;AACrB,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ;AACxC,UAAE;AACF,UAAE;cACE,CAAC,QAAQ;cACT,EAAE;IAER,QAAQ,OAAO;QACb,KAAK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AAA,CAAI,EAAA,CACrB;AAEX;;"}
1
+ {"version":3,"file":"Icon.js","sources":["../../../src/elements/Icon.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\nimport { useIconLibrary } from '../helpers/Config';\n\n// TypeScript declaration for Ionicons web component\ninterface IonIconProps extends React.HTMLAttributes<HTMLElement> {\n name?: string;\n src?: string;\n icon?: unknown;\n size?: string;\n lazy?: boolean;\n sanitize?: boolean;\n color?: string;\n flipRtl?: boolean;\n ariaLabel?: string;\n ariaHidden?: string;\n}\n\n// React 19 moved the global `JSX` namespace under the `react` module, so the\n// `<ion-icon>` web-component augmentation must target `React.JSX` to take effect.\ndeclare module 'react' {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'ion-icon': IonIconProps;\n }\n }\n}\n\ntype IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols'; // 'fa' = Font Awesome, 'mdi' = Material Design Icons, 'ion' = Ionicons Web Components, 'material-icons' = Google Material Icons, 'material-symbols' = Google Material Symbols\n\n/**\n * Shared props for the Icon component, independent of whether a class-based `name` or a\n * custom `children` node supplies the glyph.\n */\ninterface IconBaseProps\n extends React.HTMLAttributes<HTMLSpanElement>, BulmaClassesProps {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Text color alias: renders `has-text-<color>`, exactly like `textColor`.\n * Not a filled variant (no `.icon.is-<color>` CSS exists). Prefer\n * `textColor`, which takes precedence when both are set; use `bgColor` for\n * a colored surface.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Legacy icon class string (e.g. `'fas fa-star'`). Only its last segment is read, as the\n * glyph name; the library still comes from `library` or `ConfigProvider`, so\n * `'mdi mdi-rocket'` renders an `fa` class unless the effective library is already `mdi` —\n * set it here or on the provider.\n *\n * @deprecated Use `name` instead.\n */\n icon?: string;\n /**\n * The icon library to use ('fa' = Font Awesome, 'mdi' = Material Design Icons, 'ion' = Ionicons Web Components, 'material-icons' = Google Material Icons, 'material-symbols' = Google Material Symbols). Defaults to the value set in ConfigProvider or 'fa' if not configured. Ignored when `children` supplies the glyph instead of `name`.\n * @defaultValue 'fa'\n */\n library?: IconLibrary; // defaults to ConfigProvider iconLibrary or 'fa'\n /** Icon style variant (e.g. `'solid'`, `'outlined'`, `'rounded'`). Ignored when `children` supplies the glyph instead of `name`. */\n variant?: string; // e.g., 'solid', 'outlined', 'rounded', 'sharp'\n /** Additional modifiers (e.g. `'fa-lg'`, `'fa-spin'`, `'is-size-1'`). Ignored when `children` supplies the glyph instead of `name`. */\n features?: string | string[]; // e.g., 'fa-lg', 'fa-spin', 'is-size-1'\n /**\n * Additional modifiers in the older combined form, parsed into `variant` and `features`.\n *\n * @deprecated Use `variant` and `features` instead.\n */\n libraryFeatures?: string | string[];\n /** Size modifier for the icon container. */\n size?: 'small' | 'medium' | 'large';\n /**\n * Accessible name for an icon that means something on its own. Set it and the container\n * span gets `role=\"img\"` with this `aria-label`, so the name is exactly this text: a\n * Material ligature such as `rocket_launch` inside stays out of it. Leave it unset (or\n * empty) and the icon is decorative: the span renders `aria-hidden=\"true\"` and no name,\n * so it adds nothing to the accessible name of a `Button` or text around it. For an\n * icon-only control, put the name on the control (e.g. `Button`'s `aria-label`) and leave\n * this unset. A non-empty native `aria-label` or `aria-labelledby` passed instead also\n * counts as a name, and an explicit `role` or `aria-hidden` wins over both defaults. An\n * unnamed icon given a `role` or a `tabIndex` of its own isn't hidden, since hiding\n * something focusable is a failure of its own.\n */\n ariaLabel?: string;\n /** Inline style object. */\n style?: React.CSSProperties;\n /** Override the default `'icon'` container class (e.g., `'panel-icon'`). */\n containerClassName?: string; // Override the default 'icon' container class (e.g., 'panel-icon')\n}\n\n/**\n * Props for `Icon` rendering a class-based glyph from an icon library.\n */\nexport interface IconNameProps extends IconBaseProps {\n /** The icon name, with or without its library prefix (e.g. `'star'` or `'fa-star'`). Mutually exclusive with `children`. */\n name: string; // e.g., 'star', 'account', 'home-outline'\n /** A custom node (an inline SVG, a `react-icons` component, …) rendered inside the icon container in place of a class-based glyph. Mutually exclusive with `name`. */\n children?: never;\n}\n\n/**\n * Props for `Icon` rendering a custom node (an inline SVG, a `react-icons` component, a Font\n * Awesome React `<FontAwesomeIcon>`, …) in place of a class-based glyph.\n */\nexport interface IconChildrenProps extends IconBaseProps {\n /** The icon name, with or without its library prefix (e.g. `'star'` or `'fa-star'`). Mutually exclusive with `children`. */\n name?: undefined;\n /** A custom node (an inline SVG, a `react-icons` component, …) rendered inside the icon container in place of a class-based glyph. Mutually exclusive with `name`. */\n // `undefined` is excluded deliberately: the renderer discriminates on `children !== undefined`,\n // so `children={undefined}` would satisfy the type but fall through to the `name` path with no\n // name and render an `fa-undefined` glyph. Excluding it keeps the advertised\n // exactly-one-of-`name`-or-`children` constraint matching what actually renders.\n children: Exclude<React.ReactNode, undefined>;\n}\n\n/**\n * Props for `Icon` naming its glyph through the deprecated `icon` prop instead of `name`.\n *\n * The runtime has always accepted `icon` on its own — it strips a leading library prefix off\n * the class string and falls through to the `name` path — but the type offered no member without\n * a `name` or `children`, so every caller still on the deprecated prop got an error the\n * package could not see — until #663 nothing here type-checked a test or a story, so the\n * three `Icon.test.tsx` cases exercising this path proved the runtime and said nothing about\n * the type. Declaring the path is the honest resolution: it is deprecated, not removed, and a\n * deprecation that does not type-check is a removal announced only to whoever tries it.\n *\n * @deprecated Pass `name` instead. This member goes when `icon` does.\n */\nexport interface IconDeprecatedProps extends IconBaseProps {\n /**\n * Legacy icon class string (e.g. `'fas fa-star'`). Only its last segment is read, as the\n * glyph name; the library still comes from `library` or `ConfigProvider`, so\n * `'mdi mdi-rocket'` renders an `fa` class unless the effective library is already `mdi` —\n * set it here or on the provider.\n *\n * @deprecated Use `name` instead.\n */\n // Required here, optional on `IconBaseProps`: the other two members allow it\n // alongside `name`, and this one is the member where it IS the glyph. Same\n // prose in both places on purpose — the API-docs extractor reads whichever it\n // reaches first, and the two must not drift apart.\n icon: string;\n /** The icon name. Absent on this path — `icon` supplies the glyph. */\n name?: undefined;\n /** A custom node. Mutually exclusive with `icon`. */\n children?: never;\n}\n\n/**\n * Props for the Icon component — a discriminated union of a class-based `name`, a custom\n * `children` node, and the deprecated `icon` class string.\n */\nexport type IconProps = IconNameProps | IconChildrenProps | IconDeprecatedProps;\n\n/**\n * Strips a redundant leading library prefix from an icon name (e.g. `fa-check` -> `check`\n * for the `fa` library, `mdi-account` -> `account` for `mdi`), so `name` behaves the same\n * whether or not the caller includes the prefix. Font Awesome and Material Design Icons docs\n * conventionally refer to icons with their class prefix (`fa-check`), which otherwise gets\n * doubled by `getIconClasses` (producing `fa-fa-check`, matching no glyph).\n *\n * @param {string} name - The icon name, possibly including a redundant library prefix.\n * @param {IconLibrary} library - The icon library the name will be rendered with.\n * @returns {string} The icon name with any redundant leading library prefix removed.\n */\nfunction stripRedundantLibraryPrefix(\n name: string,\n library: IconLibrary\n): string {\n if (!name) {\n return name;\n }\n if (library === 'fa' && name.startsWith('fa-')) {\n return name.substring(3);\n }\n if (library === 'mdi' && name.startsWith('mdi-')) {\n return name.substring(4);\n }\n return name;\n}\n\n/**\n * Gets the correct classes for the icon element based on the library and features.\n *\n * @param {IconLibrary} library - The icon library.\n * @param {string} name - The icon name.\n * @param {string} [variant] - Icon style variant (e.g., 'solid', 'outlined', 'rounded').\n * @param {string | string[]} [features] - Additional library-specific modifiers.\n * @returns {string} The combined class string for the icon.\n */\nfunction getIconClasses(\n library: IconLibrary,\n name: string,\n variant?: string,\n features?: string | string[]\n): string {\n let baseClass: string;\n let iconClass: string;\n const featureList = Array.isArray(features)\n ? features\n : features\n ? [features]\n : [];\n\n switch (library) {\n case 'fa': {\n // Font Awesome: use variant as style ('solid' -> 'fas', 'regular' -> 'far', etc.)\n const styleMap: Record<string, string> = {\n solid: 'fas',\n regular: 'far',\n brands: 'fab',\n light: 'fal',\n duotone: 'fad',\n thin: 'fat',\n };\n const faStyle = variant ? styleMap[variant] || variant : 'fas';\n baseClass = faStyle;\n iconClass = `fa-${name}`;\n return [baseClass, iconClass, ...featureList].join(' ');\n }\n case 'mdi':\n // Material Design Icons: no variants, just features\n baseClass = 'mdi';\n iconClass = `mdi-${name}`;\n return [baseClass, iconClass, ...featureList].join(' ');\n case 'material-icons': {\n // Google Material Icons: map variants to full class names\n const styleVariants: Record<string, string> = {\n filled: 'material-icons',\n outlined: 'material-icons-outlined',\n round: 'material-icons-round',\n sharp: 'material-icons-sharp',\n };\n baseClass = variant\n ? styleVariants[variant] || `material-icons-${variant}`\n : 'material-icons';\n return [baseClass, ...featureList].join(' ');\n }\n case 'material-symbols': {\n // Google Material Symbols: map variants to full class names\n const styleVariants: Record<string, string> = {\n outlined: 'material-symbols-outlined',\n rounded: 'material-symbols-rounded',\n sharp: 'material-symbols-sharp',\n };\n baseClass = variant\n ? styleVariants[variant] || `material-symbols-${variant}`\n : 'material-symbols-outlined';\n return [baseClass, ...featureList].join(' ');\n }\n default:\n // fallback: just icon name and features\n return [name, ...featureList].join(' ');\n }\n}\n\n/**\n * The `Icon` component is a Bulma-styled wrapper for displaying icons from various libraries (Font Awesome, Material Design Icons, Ionicons, Google Material Icons, Material Symbols, etc.).\n *\n * @function\n * @param {IconProps} props - Props for the Icon component.\n * @returns {JSX.Element} The rendered icon element.\n * @see {@link https://bulma.io/documentation/elements/icon/ | Bulma Icon documentation}\n */\nexport const Icon: React.FC<IconProps> = ({\n className,\n textColor,\n bgColor,\n name,\n library,\n variant,\n features,\n libraryFeatures, // Deprecated but maintained for backward compatibility\n size,\n ariaLabel,\n style,\n icon, // Capture and exclude the deprecated 'icon' prop from DOM\n color,\n containerClassName,\n children,\n ...restProps\n}) => {\n // Get the default icon library from context, fallback to 'fa' if not set\n const defaultLibrary = useIconLibrary();\n\n /**\n * Generates Bulma helper classes and separates out remaining props.\n * Note: variant, features, and libraryFeatures are excluded from props spread\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...restProps,\n });\n\n // Hoisted unconditionally to respect rules-of-hooks; the branches below\n // pick which result to consume.\n const defaultIconClasses = usePrefixedClassNames('icon', {\n [`is-${size}`]: size,\n });\n const sizeModifierClass = usePrefixedClassNames(\n size ? `is-${size}` : undefined\n );\n\n const bulmaClasses = containerClassName\n ? containerClassName\n : defaultIconClasses;\n\n const iconContainerClasses = classNames(\n bulmaClasses,\n containerClassName && size ? sizeModifierClass : undefined,\n bulmaHelperClasses,\n className\n );\n\n // A named icon is an image, whose name is its label alone, so a ligature inside\n // never leaks into it. An unnamed one is decorative and hidden outright. Spread\n // before `rest`, so a caller's own `role` or `aria-hidden` still wins.\n const named =\n !!ariaLabel || !!restProps['aria-label'] || !!restProps['aria-labelledby'];\n // A caller's own `role` or `tabIndex` on an unnamed icon means it isn't decoration (an\n // icon made a button, say), so it isn't hidden either: `aria-hidden` on something\n // focusable is a failure of its own.\n const a11yProps = named\n ? { role: 'img', 'aria-label': ariaLabel || undefined }\n : restProps.role !== undefined || restProps.tabIndex !== undefined\n ? {}\n : { 'aria-hidden': true };\n\n if (children !== undefined) {\n // `IconChildrenProps`: render the caller's node (an inline SVG, a `react-icons`\n // component, …) in place of a class-based glyph. Library/variant/features don't apply.\n return (\n <span\n className={iconContainerClasses}\n {...a11yProps}\n style={style}\n {...rest}\n >\n {children}\n </span>\n );\n }\n\n // `name` is guaranteed once `children` is absent UNLESS the caller is on the deprecated\n // `icon` path, which `IconDeprecatedProps` declares with `name?: undefined`.\n // (`IconChildrenProps['children']` excludes `undefined`, so `children={undefined}` can't\n // slip past into this branch.) The cast covers that third member, and the `!name && icon`\n // fallback below is what fills it in.\n let finalName = name as string;\n if (!name && icon) {\n // If icon prop is provided instead of name, try to parse it\n // e.g., \"mdi mdi-rocket-launch\" -> \"rocket-launch\"\n if (typeof icon === 'string') {\n const parts = icon.split(' ');\n const lastPart = parts[parts.length - 1];\n if (lastPart.startsWith('mdi-')) {\n finalName = lastPart.substring(4); // Remove \"mdi-\" prefix\n } else if (lastPart.startsWith('fa-')) {\n finalName = lastPart.substring(3); // Remove \"fa-\" prefix\n } else {\n finalName = lastPart;\n }\n }\n }\n\n const finalLibrary = library || defaultLibrary || 'fa';\n\n // Normalize a redundant leading library prefix (e.g. \"fa-check\" -> \"check\" when the\n // library is 'fa'), so `name` behaves identically with or without the prefix.\n finalName = stripRedundantLibraryPrefix(finalName, finalLibrary);\n\n if (!finalName) {\n // No glyph to name. Reachable through the public type only as `icon=\"\"`, and otherwise\n // by a plain-JS caller (or one that casts). Building a class off an absent name produced\n // a bogus `fa-undefined` glyph; render the bare container instead, matching the\n // `children` branch.\n return (\n <span\n className={iconContainerClasses}\n {...a11yProps}\n style={style}\n {...rest}\n />\n );\n }\n\n // Backward compatibility: if libraryFeatures is provided, parse it for variant and features\n let finalVariant = variant;\n let finalFeatures = features;\n\n if (libraryFeatures && !variant && !features) {\n const legacyFeatures = Array.isArray(libraryFeatures)\n ? libraryFeatures\n : [libraryFeatures];\n\n // For Font Awesome, extract style from features\n if (finalLibrary === 'fa') {\n const faStyle = legacyFeatures.find(f =>\n [\n 'fas',\n 'far',\n 'fab',\n 'fal',\n 'fad',\n 'fat',\n 'solid',\n 'regular',\n 'brands',\n 'light',\n 'duotone',\n 'thin',\n ].includes(f)\n );\n if (faStyle) {\n finalVariant = faStyle;\n finalFeatures = legacyFeatures.filter(f => f !== faStyle);\n } else {\n finalFeatures = legacyFeatures;\n }\n }\n // For Material Icons/Symbols, extract style variant\n else if (\n finalLibrary === 'material-icons' ||\n finalLibrary === 'material-symbols'\n ) {\n const styleVariants =\n finalLibrary === 'material-icons'\n ? ['filled', 'outlined', 'round', 'sharp']\n : ['outlined', 'rounded', 'sharp'];\n\n const styleVariant = legacyFeatures.find(f => styleVariants.includes(f));\n if (styleVariant) {\n finalVariant = styleVariant;\n finalFeatures = legacyFeatures.filter(f => f !== styleVariant);\n } else {\n finalFeatures = legacyFeatures;\n }\n }\n // For others, all features go to finalFeatures\n else {\n finalFeatures = legacyFeatures;\n }\n }\n\n // Handle web components vs CSS-based icons\n if (finalLibrary === 'ion') {\n // For Ionicons, handle variant in the name\n let ionName = finalName;\n if (finalVariant === 'outline') {\n ionName = `${finalName}-outline`;\n } else if (finalVariant === 'sharp') {\n ionName = `${finalName}-sharp`;\n }\n\n return (\n <span\n className={iconContainerClasses}\n {...a11yProps}\n style={style}\n {...rest}\n >\n <ion-icon name={ionName} />\n </span>\n );\n }\n\n // Legacy CSS-based icons\n const iClasses = getIconClasses(\n finalLibrary,\n finalName,\n finalVariant,\n finalFeatures\n );\n\n // Material Icons and Material Symbols use text content, not CSS classes for the icon name\n if (\n finalLibrary === 'material-icons' ||\n finalLibrary === 'material-symbols'\n ) {\n return (\n <span\n className={iconContainerClasses}\n {...a11yProps}\n style={style}\n {...rest}\n >\n <i className={iClasses}>{finalName}</i>\n </span>\n );\n }\n\n return (\n <span\n className={iconContainerClasses}\n {...a11yProps}\n style={style}\n {...rest}\n >\n <i className={iClasses} />\n </span>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;;AAoKA;;;;;;;;;;AAUG;AACH,SAAS,2BAA2B,CAClC,IAAY,EACZ,OAAoB,EAAA;IAEpB,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAO,IAAI;IACb;IACA,IAAI,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;AAC9C,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1B;IACA,IAAI,OAAO,KAAK,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAChD,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IA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AoB,EAAA,GAC3B,SAAS,EACb,KAAK,EAAE,KAAK,KACR,IAAI,EAAA,QAAA,EAERA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,QAAQ,YAAG,SAAS,EAAA,CAAK,EAAA,CAClC;IAEX;IAEA,QACEA,cACE,SAAS,EAAE,oBAAoB,EAAA,GAC3B,SAAS,EACb,KAAK,EAAE,KAAK,EAAA,GACR,IAAI,YAERA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,QAAQ,EAAA,CAAI,EAAA,CACrB;AAEX;;"}
@@ -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 React from 'react';
4
5
  import { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
@@ -1 +1 @@
1
- {"version":3,"file":"IconText.js","sources":["../../../src/elements/IconText.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\nimport { Icon, IconProps } from './Icon';\nimport { isIconProps } from './iconProps';\n\n/**\n * Represents an item for the IconText component, containing icon props and optional text.\n */\ninterface IconTextItem {\n /** Props for the Icon component, or a custom node (an inline SVG, a `react-icons` component, …) rendered in place of a class-based glyph. */\n iconProps: IconProps | React.ReactNode;\n /** Optional text to display next to the icon. */\n text?: string;\n}\n\n/**\n * Props for the IconText component.\n */\ninterface IconTextProps\n extends React.HTMLAttributes<HTMLSpanElement>, BulmaClassesProps {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Text color alias: renders `has-text-<color>`, exactly like `textColor`.\n * Not a filled variant (no `.icon-text.is-<color>` CSS exists). Prefer\n * `textColor`, which takes precedence when both are set; use `bgColor` for\n * a colored surface.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Props for a single Icon component, or a custom node, for single icon mode. */\n iconProps?: IconProps | React.ReactNode; // For single icon\n /** Text for a single icon (for single icon mode). */\n children?: React.ReactNode; // Text for single icon\n /** Array of icon/text pairs (for multiple icons mode). */\n items?: IconTextItem[]; // For multiple icons\n}\n\n/**\n * The `IconText` component provides a Bulma-styled horizontal arrangement of one or more `Icon` components and optional text.\n *\n * @function\n * @param {IconTextProps} props - Props for the IconText component.\n * @returns {JSX.Element} The rendered icon text element.\n * @see {@link https://bulma.io/documentation/elements/icon/#icon-text | Bulma IconText documentation}\n */\nconst IconTextComponent: React.FC<IconTextProps> = ({\n className,\n textColor,\n color,\n bgColor,\n iconProps,\n children,\n items,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n\n const bulmaClasses = usePrefixedClassNames('icon-text');\n const iconTextClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return (\n <span className={iconTextClasses} {...rest}>\n {items ? (\n items.map((item, index) => (\n <React.Fragment key={index}>\n {item.iconProps &&\n (isIconProps(item.iconProps) ? (\n <Icon {...item.iconProps} />\n ) : (\n <Icon>{item.iconProps}</Icon>\n ))}\n {item.text && <span>{item.text}</span>}\n </React.Fragment>\n ))\n ) : (\n <>\n {iconProps &&\n (isIconProps(iconProps) ? (\n <Icon {...iconProps} />\n ) : (\n <Icon>{iconProps}</Icon>\n ))}\n {children && <span>{children}</span>}\n </>\n )}\n </span>\n );\n};\n\nexport const IconText = withSubComponents(\n IconTextComponent,\n { Icon },\n 'IconText'\n);\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;AA+C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,CAAC,IAAI,EAAA,EAAA,QAAA,EAAE,SAAS,EAAA,CAAQ,CACzB,CAAC,EACH,QAAQ,IAAIA,GAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EAAO,QAAQ,EAAA,CAAQ,CAAA,EAAA,CACnC,CACJ,EAAA,CACI;AAEX,CAAC;AAEM,MAAM,QAAQ,GAAG,iBAAiB,CACvC,iBAAiB,EACjB,EAAE,IAAI,EAAE,EACR,UAAU;;"}
1
+ {"version":3,"file":"IconText.js","sources":["../../../src/elements/IconText.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\nimport { Icon, IconProps } from './Icon';\nimport { isIconProps } from './iconProps';\n\n/**\n * Represents an item for the IconText component, containing icon props and optional text.\n */\ninterface IconTextItem {\n /** Props for the Icon component, or a custom node (an inline SVG, a `react-icons` component, …) rendered in place of a class-based glyph. */\n iconProps: IconProps | React.ReactNode;\n /** Optional text to display next to the icon. */\n text?: string;\n}\n\n/**\n * Props for the IconText component.\n */\ninterface IconTextProps\n extends React.HTMLAttributes<HTMLSpanElement>, BulmaClassesProps {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Text color alias: renders `has-text-<color>`, exactly like `textColor`.\n * Not a filled variant (no `.icon-text.is-<color>` CSS exists). Prefer\n * `textColor`, which takes precedence when both are set; use `bgColor` for\n * a colored surface.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Props for a single Icon component, or a custom node, for single icon mode. */\n iconProps?: IconProps | React.ReactNode; // For single icon\n /** Text for a single icon (for single icon mode). */\n children?: React.ReactNode; // Text for single icon\n /** Array of icon/text pairs (for multiple icons mode). */\n items?: IconTextItem[]; // For multiple icons\n}\n\n/**\n * The `IconText` component provides a Bulma-styled horizontal arrangement of one or more `Icon` components and optional text.\n *\n * @function\n * @param {IconTextProps} props - Props for the IconText component.\n * @returns {JSX.Element} The rendered icon text element.\n * @see {@link https://bulma.io/documentation/elements/icon/#icon-text | Bulma IconText documentation}\n */\nconst IconTextComponent: React.FC<IconTextProps> = ({\n className,\n textColor,\n color,\n bgColor,\n iconProps,\n children,\n items,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n\n const bulmaClasses = usePrefixedClassNames('icon-text');\n const iconTextClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return (\n <span className={iconTextClasses} {...rest}>\n {items ? (\n items.map((item, index) => (\n <React.Fragment key={index}>\n {item.iconProps &&\n (isIconProps(item.iconProps) ? (\n <Icon {...item.iconProps} />\n ) : (\n <Icon>{item.iconProps}</Icon>\n ))}\n {item.text && <span>{item.text}</span>}\n </React.Fragment>\n ))\n ) : (\n <>\n {iconProps &&\n (isIconProps(iconProps) ? (\n <Icon {...iconProps} />\n ) : (\n <Icon>{iconProps}</Icon>\n ))}\n {children && <span>{children}</span>}\n </>\n )}\n </span>\n );\n};\n\nexport const IconText = withSubComponents(\n IconTextComponent,\n { Icon },\n 'IconText'\n);\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;AA+CA;;;;;;;AAOG;AACH,MAAM,iBAAiB,GAA4B,CAAC,EAClD,SAAS,EACT,SAAS,EACT,KAAK,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;QACnD,KAAK,EAAE,SAAS,IAAI,KAAK;AACzB,QAAA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;"}
@@ -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 { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
4
5
  import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Image.js","sources":["../../../src/elements/Image.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the Image component.\n */\nexport interface ImageProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper for the container. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Text color alias: renders `has-text-<color>`, exactly like `textColor`.\n * Not a filled variant (no `.image.is-<color>` CSS exists). Prefer\n * `textColor`, which takes precedence when both are set; use `bgColor` for\n * a colored surface.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Background color helper for the container. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Fixed size or aspect ratio modifier for the image container. A ratio\n * (`16by9` and the rest) renders only its `is-<ratio>` class there. Bulma\n * stretches an `<img>` inside to fill the ratio, but any other child, such\n * as an `iframe`, fills it only with `className=\"has-ratio\"` of its own.\n */\n size?:\n | '16x16'\n | '24x24'\n | '32x32'\n | '48x48'\n | '64x64'\n | '96x96'\n | '128x128'\n | 'square'\n | '1by1'\n | '5by4'\n | '4by3'\n | '3by2'\n | '5by3'\n | '16by9'\n | '2by1'\n | '3by1'\n | '4by5'\n | '3by4'\n | '2by3'\n | '3by5'\n | '9by16'\n | '1by2'\n | '1by3';\n /** Renders the image with rounded corners. */\n isRounded?: boolean;\n /** Uses retina (2x) image source. */\n isRetina?: boolean;\n /** Image source URL. */\n src?: string;\n /** Alternate text for the image. */\n alt?: string;\n /** Arbitrary content (e.g., iframe, custom HTML) inside the image container. */\n children?: React.ReactNode;\n /** Container element tag. Defaults to `'figure'` when using aspect-ratio sizes, `'div'` otherwise. */\n as?: 'figure' | 'div' | 'p';\n}\n\n/**\n * The `Image` component wraps images, iframes, or custom content in a Bulma-styled container, supporting fixed sizes, aspect ratios, rounded corners, retina images, and all Bulma helper props for color and spacing.\n *\n * @function\n * @param {ImageProps} props - Props for the Image component.\n * @returns {JSX.Element} The rendered image element.\n * @see {@link https://bulma.io/documentation/elements/image/ | Bulma Image documentation}\n */\nexport const Image: React.FC<ImageProps> = ({\n as,\n className,\n textColor,\n color,\n bgColor,\n size,\n isRounded,\n isRetina,\n src,\n alt,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n\n // Bulma reads `.has-ratio` only on a child of the ratio container, so the\n // container carries just its `is-<ratio>` class.\n const bulmaClasses = usePrefixedClassNames('image', {\n [`is-${size}`]: size,\n });\n\n const imageClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n // Default tag logic: if \"as\" is provided, use it.\n // If not, use <figure> for aspect ratios, <div> otherwise.\n const Tag: 'figure' | 'div' | 'p' =\n as ?? (size?.includes('by') ? 'figure' : 'div');\n\n const roundedClass = usePrefixedClassNames('is-rounded');\n\n const content = children ? (\n children\n ) : (\n <img\n className={classNames({ [roundedClass]: isRounded }) || undefined}\n src={src}\n alt={alt}\n {...(isRetina && src ? { srcSet: `${src} 2x` } : {})}\n />\n );\n\n return (\n <Tag className={imageClasses} {...rest}>\n {content}\n </Tag>\n );\n};\n\nexport default Image;\n"],"names":["_jsx"],"mappings":";;;;;AAwEA;;;;;;;AAOG;AACI,MAAM,KAAK,GAAyB,CAAC,EAC1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ourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the Image component.\n */\nexport interface ImageProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper for the container. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Text color alias: renders `has-text-<color>`, exactly like `textColor`.\n * Not a filled variant (no `.image.is-<color>` CSS exists). Prefer\n * `textColor`, which takes precedence when both are set; use `bgColor` for\n * a colored surface.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Background color helper for the container. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Fixed size or aspect ratio modifier for the image container. A ratio\n * (`16by9` and the rest) renders only its `is-<ratio>` class there. Bulma\n * stretches an `<img>` inside to fill the ratio, but any other child, such\n * as an `iframe`, fills it only with `className=\"has-ratio\"` of its own.\n */\n size?:\n | '16x16'\n | '24x24'\n | '32x32'\n | '48x48'\n | '64x64'\n | '96x96'\n | '128x128'\n | 'square'\n | '1by1'\n | '5by4'\n | '4by3'\n | '3by2'\n | '5by3'\n | '16by9'\n | '2by1'\n | '3by1'\n | '4by5'\n | '3by4'\n | '2by3'\n | '3by5'\n | '9by16'\n | '1by2'\n | '1by3';\n /** Renders the image with rounded corners. */\n isRounded?: boolean;\n /** Uses retina (2x) image source. */\n isRetina?: boolean;\n /** Image source URL. */\n src?: string;\n /** Alternate text for the image. */\n alt?: string;\n /** Arbitrary content (e.g., iframe, custom HTML) inside the image container. */\n children?: React.ReactNode;\n /** Container element tag. Defaults to `'figure'` when using aspect-ratio sizes, `'div'` otherwise. */\n as?: 'figure' | 'div' | 'p';\n}\n\n/**\n * The `Image` component wraps images, iframes, or custom content in a Bulma-styled container, supporting fixed sizes, aspect ratios, rounded corners, retina images, and all Bulma helper props for color and spacing.\n *\n * @function\n * @param {ImageProps} props - Props for the Image component.\n * @returns {JSX.Element} The rendered image element.\n * @see {@link https://bulma.io/documentation/elements/image/ | Bulma Image documentation}\n */\nexport const Image: React.FC<ImageProps> = ({\n as,\n className,\n textColor,\n color,\n bgColor,\n size,\n isRounded,\n isRetina,\n src,\n alt,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n\n // Bulma reads `.has-ratio` only on a child of the ratio container, so the\n // container carries just its `is-<ratio>` class.\n const bulmaClasses = usePrefixedClassNames('image', {\n [`is-${size}`]: size,\n });\n\n const imageClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n // Default tag logic: if \"as\" is provided, use it.\n // If not, use <figure> for aspect ratios, <div> otherwise.\n const Tag: 'figure' | 'div' | 'p' =\n as ?? (size?.includes('by') ? 'figure' : 'div');\n\n const roundedClass = usePrefixedClassNames('is-rounded');\n\n const content = children ? (\n children\n ) : (\n <img\n className={classNames({ [roundedClass]: isRounded }) || undefined}\n src={src}\n alt={alt}\n {...(isRetina && src ? { srcSet: `${src} 2x` } : {})}\n />\n );\n\n return (\n <Tag className={imageClasses} {...rest}>\n {content}\n </Tag>\n );\n};\n\nexport default Image;\n"],"names":["_jsx"],"mappings":";;;;;;AAwEA;;;;;;;AAOG;AACI,MAAM,KAAK,GAAyB,CAAC,EAC1C,EAAE,EACF,SAAS,EACT,SAAS,EACT,KAAK,EACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,EACH,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;QACnD,KAAK,EAAE,SAAS,IAAI,KAAK;AACzB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;;;AAIF,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,OAAO,EAAE;AAClD,QAAA,CAAC,CAAA,GAAA,EAAM,IAAI,CAAA,CAAE,GAAG,IAAI;AACrB,KAAA,CAAC;IAEF,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;;;IAI5E,MAAM,GAAG,GACP,EAAE,KAAK,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEjD,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,YAAY,CAAC;IAExD,MAAM,OAAO,GAAG,QAAQ,IACtB,QAAQ,KAERA,GAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,UAAU,CAAC,EAAE,CAAC,YAAY,GAAG,SAAS,EAAE,CAAC,IAAI,SAAS,EACjE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EAAA,IACH,QAAQ,IAAI,GAAG,GAAG,EAAE,MAAM,EAAE,CAAA,EAAG,GAAG,CAAA,GAAA,CAAK,EAAE,GAAG,EAAE,CAAC,EAAA,CACpD,CACH;AAED,IAAA,QACEA,GAAA,CAAC,GAAG,EAAA,EAAC,SAAS,EAAE,YAAY,EAAA,GAAM,IAAI,EAAA,QAAA,EACnC,OAAO,EAAA,CACJ;AAEV;;"}
@@ -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 React, { forwardRef } from 'react';
4
5
  import { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Kbd.js","sources":["../../../src/elements/Kbd.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 { flattenChildren } from '../helpers/flattenChildren';\nimport { visuallyHidden } from '../helpers/statusRegion';\nimport { withSubComponents } from '../helpers/withSubComponents';\n\n/**\n * Props for the Kbd component. The helper props, the other attributes and\n * the `ref` land on the `<kbd>`.\n *\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the `<kbd>`.\n */\nexport interface KbdProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /**\n * The key as it's printed on the keyboard: a word (`Ctrl`, `Esc`), a\n * letter, or a symbol (`⌘`).\n */\n children?: React.ReactNode;\n /**\n * What a screen reader says in place of a symbol, in your app's language:\n * `label=\"Command\"` on `⌘`. The symbol is hidden from assistive tech with\n * `aria-hidden`, and the label is read in its place, from text that's\n * visually hidden. Use it for a glyph that isn't a word, such as `⌘`, `⌥`,\n * `⇧`, `⌃` or `⏎`, and leave it off a key written as a word. Copying the\n * key copies the label along with the glyph. Don't reach for `aria-label`\n * instead: ARIA in HTML prohibits naming a `<kbd>`, so nothing obliges a\n * screen reader to read it.\n */\n label?: string;\n /**\n * Text color helper. The key's edge and fill are mixed from its text\n * color, so they follow it.\n */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Background color helper. It replaces the key's faint fill, and the text\n * still follows the text around it, which turns light in dark mode, so pair\n * it with a `textColor` that reads on that color in both schemes, such as\n * `textColor=\"black\"` on `bgColor=\"warning\"`.\n */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * Props for Kbd.Group, keys pressed together or one after another. The\n * group renders the outer `<kbd>` of a combination, and the helper props,\n * the other attributes and the `ref` land on it.\n *\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the outer `<kbd>`.\n */\nexport interface KbdGroupProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /**\n * The keys, a `Kbd` each, in the order they're pressed. The group renders\n * the outer `<kbd>` around them, so it doesn't go inside a `Kbd` of its\n * own, and it puts the separator between them, so don't type one: a `+`\n * of your own doubles up. A `null` or `false` child, or an empty Fragment,\n * gets no separator, and the keys in a Fragment are separated like the\n * rest. A component that renders nothing still gets one, since the group\n * can't see what a child renders, so write a conditional key inline\n * (`{isMac && <Kbd label=\"Command\">⌘</Kbd>}`), not in a component of its\n * own.\n */\n children?: React.ReactNode;\n /**\n * What goes between the keys, shown and read aloud, with a space either\n * side. Use `'then'` for a sequence pressed one key after another. It's a\n * string because a screen reader has to read it.\n */\n separator?: string;\n /** Text color helper. The keys and separators inside follow it. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * Keys pressed together or one after another, in the outer `<kbd>` HTML gives a combination, with the separator between each pair as text.\n *\n * It doesn't wrap in the middle and isn't drawn as a key itself. It sets no\n * font size, so the keys in it are the size of a key on its own.\n *\n * @function\n * @param {KbdGroupProps} props - Props for Kbd.Group.\n * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the outer `<kbd>`.\n * @returns {JSX.Element} The rendered combination.\n *\n * @example\n * <Kbd.Group>\n * <Kbd>Ctrl</Kbd>\n * <Kbd>Shift</Kbd>\n * <Kbd>P</Kbd>\n * </Kbd.Group>\n *\n * @example\n * <Kbd.Group separator=\"then\">\n * <Kbd>G</Kbd>\n * <Kbd>I</Kbd>\n * </Kbd.Group>\n */\nexport const KbdGroup = forwardRef<HTMLElement, KbdGroupProps>(\n ({ className, textColor, separator = '+', children, ...props }, ref) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n ...props,\n });\n const groupClass = usePrefixedClassNames('kbd-group');\n const separatorClass = usePrefixedClassNames('kbd-separator');\n\n // Null, undefined and booleans drop out, and Fragments are opened up, so\n // an empty Fragment leaves no separator behind and the keys in one are\n // separated like the rest. The spaces are part of the text, so a screen\n // reader reads \"Ctrl plus S\" rather than one run-together word, whatever\n // the CSS does.\n const keys = flattenChildren(children);\n\n return (\n <kbd\n ref={ref}\n className={classNames(groupClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {keys.map((key, index) => (\n // Each wrapper takes its child's own React key, so a child that\n // moves keeps its node. Text has none, so it goes by its place.\n <React.Fragment\n key={React.isValidElement(key) && key.key != null ? key.key : index}\n >\n {index > 0 && (\n <span className={separatorClass}>{` ${separator} `}</span>\n )}\n {key}\n </React.Fragment>\n ))}\n </kbd>\n );\n }\n);\n\nKbdGroup.displayName = 'Kbd.Group';\n\n/**\n * The `Kbd` component renders a `<kbd>` drawn as a keycap, for a key the reader presses.\n *\n * It only shows the key: it doesn't listen for it. The key takes its colors\n * from the text it sits in, and its size in `em`, so it fits a paragraph, a\n * title or a filled button as it is, and `textSize` sizes it outright. For a\n * combination or a sequence, put the keys in a `Kbd.Group`. What tells\n * assistive tech a control has a shortcut is `aria-keyshortcuts` on that\n * control, with `Kbd` as the hint people see next to it.\n *\n * @function\n * @param {KbdProps} props - Props for the Kbd component.\n * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the `<kbd>`.\n * @returns {JSX.Element} The rendered key.\n *\n * @example\n * <Kbd>Esc</Kbd>\n *\n * @example\n * <Kbd label=\"Command\">⌘</Kbd>\n */\nconst KbdRoot = forwardRef<HTMLElement, KbdProps>(\n ({ className, textColor, bgColor, label, children, ...props }, ref) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n const kbdClass = usePrefixedClassNames('kbd');\n\n // The name is text rather than an aria-label, which ARIA in HTML\n // prohibits on kbd. Its styles are inline, so it stays hidden in a\n // modular build that leaves out Bulma's helper classes.\n return (\n <kbd\n ref={ref}\n className={classNames(kbdClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {label ? (\n <>\n <span aria-hidden=\"true\">{children}</span>\n <span style={visuallyHidden}>{label}</span>\n </>\n ) : (\n children\n )}\n </kbd>\n );\n }\n);\n\nexport const Kbd = withSubComponents(KbdRoot, { Group: KbdGroup }, 'Kbd');\n\nexport default Kbd;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;AAwFA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACI,MAAM,QAAQ,GAAG,UAAU,CAChC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AACrE,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;AACF,IAAA,MAAM,UAAU,GAAG,qBAAqB,CAAC,WAAW,CAAC;AACrD,IAAA,MAAM,cAAc,GAAG,qBAAqB,CAAC,eAAe,CAAC;;;;;;AAO7D,IAAA,MAAM,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAC;AAEtC,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,UAAU,EAAE,kBAAkB,EAAE,SAAS,CAAC,KAC5D,IAAI,EAAA,QAAA,EAEP,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,MAGnBC,KAAC,KAAK,CAAC,QAAQ,EAAA,EAAA,QAAA,EAAA,CAGZ,KAAK,GAAG,CAAC,KACRD,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,cAAc,EAAA,QAAA,EAAG,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,CAAG,EAAA,CAAQ,CAC3D,EACA,GAAG,CAAA,EAAA,EALC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,IAAI,GAAG,GAAG,CAAC,GAAG,GAAG,KAAK,CAMpD,CAClB,CAAC,EAAA,CACE;AAEV,CAAC;AAGH,QAAQ,CAAC,WAAW,GAAG,WAAW;AAElC;;;;;;;;;;;;;;;;;;;;AAoBG;AACH,MAAM,OAAO,GAAG,UAAU,CACxB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AACpE,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;AACF,IAAA,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,CAAC;;;;IAK7C,QACEA,aACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,QAAQ,EAAE,kBAAkB,EAAE,SAAS,CAAC,EAAA,GAC1D,IAAI,EAAA,QAAA,EAEP,KAAK,IACJC,4BACED,GAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAkB,MAAM,YAAE,QAAQ,EAAA,CAAQ,EAC1CA,GAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAE,cAAc,EAAA,QAAA,EAAG,KAAK,GAAQ,CAAA,EAAA,CAC1C,KAEH,QAAQ,CACT,EAAA,CACG;AAEV,CAAC,CACF;AAEM,MAAM,GAAG,GAAG,iBAAiB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK;;"}
1
+ {"version":3,"file":"Kbd.js","sources":["../../../src/elements/Kbd.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 { flattenChildren } from '../helpers/flattenChildren';\nimport { visuallyHidden } from '../helpers/statusRegion';\nimport { withSubComponents } from '../helpers/withSubComponents';\n\n/**\n * Props for the Kbd component. The helper props, the other attributes and\n * the `ref` land on the `<kbd>`.\n *\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the `<kbd>`.\n */\nexport interface KbdProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /**\n * The key as it's printed on the keyboard: a word (`Ctrl`, `Esc`), a\n * letter, or a symbol (`⌘`).\n */\n children?: React.ReactNode;\n /**\n * What a screen reader says in place of a symbol, in your app's language:\n * `label=\"Command\"` on `⌘`. The symbol is hidden from assistive tech with\n * `aria-hidden`, and the label is read in its place, from text that's\n * visually hidden. Use it for a glyph that isn't a word, such as `⌘`, `⌥`,\n * `⇧`, `⌃` or `⏎`, and leave it off a key written as a word. Copying the\n * key copies the label along with the glyph. Don't reach for `aria-label`\n * instead: ARIA in HTML prohibits naming a `<kbd>`, so nothing obliges a\n * screen reader to read it.\n */\n label?: string;\n /**\n * Text color helper. The key's edge and fill are mixed from its text\n * color, so they follow it.\n */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Background color helper. It replaces the key's faint fill, and the text\n * still follows the text around it, which turns light in dark mode, so pair\n * it with a `textColor` that reads on that color in both schemes, such as\n * `textColor=\"black\"` on `bgColor=\"warning\"`.\n */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * Props for Kbd.Group, keys pressed together or one after another. The\n * group renders the outer `<kbd>` of a combination, and the helper props,\n * the other attributes and the `ref` land on it.\n *\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the outer `<kbd>`.\n */\nexport interface KbdGroupProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'color'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /**\n * The keys, a `Kbd` each, in the order they're pressed. The group renders\n * the outer `<kbd>` around them, so it doesn't go inside a `Kbd` of its\n * own, and it puts the separator between them, so don't type one: a `+`\n * of your own doubles up. A `null` or `false` child, or an empty Fragment,\n * gets no separator, and the keys in a Fragment are separated like the\n * rest. A component that renders nothing still gets one, since the group\n * can't see what a child renders, so write a conditional key inline\n * (`{isMac && <Kbd label=\"Command\">⌘</Kbd>}`), not in a component of its\n * own.\n */\n children?: React.ReactNode;\n /**\n * What goes between the keys, shown and read aloud, with a space either\n * side. Use `'then'` for a sequence pressed one key after another. It's a\n * string because a screen reader has to read it.\n */\n separator?: string;\n /** Text color helper. The keys and separators inside follow it. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * Keys pressed together or one after another, in the outer `<kbd>` HTML gives a combination, with the separator between each pair as text.\n *\n * It doesn't wrap in the middle and isn't drawn as a key itself. It sets no\n * font size, so the keys in it are the size of a key on its own.\n *\n * @function\n * @param {KbdGroupProps} props - Props for Kbd.Group.\n * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the outer `<kbd>`.\n * @returns {JSX.Element} The rendered combination.\n *\n * @example\n * <Kbd.Group>\n * <Kbd>Ctrl</Kbd>\n * <Kbd>Shift</Kbd>\n * <Kbd>P</Kbd>\n * </Kbd.Group>\n *\n * @example\n * <Kbd.Group separator=\"then\">\n * <Kbd>G</Kbd>\n * <Kbd>I</Kbd>\n * </Kbd.Group>\n */\nexport const KbdGroup = forwardRef<HTMLElement, KbdGroupProps>(\n ({ className, textColor, separator = '+', children, ...props }, ref) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n ...props,\n });\n const groupClass = usePrefixedClassNames('kbd-group');\n const separatorClass = usePrefixedClassNames('kbd-separator');\n\n // Null, undefined and booleans drop out, and Fragments are opened up, so\n // an empty Fragment leaves no separator behind and the keys in one are\n // separated like the rest. The spaces are part of the text, so a screen\n // reader reads \"Ctrl plus S\" rather than one run-together word, whatever\n // the CSS does.\n const keys = flattenChildren(children);\n\n return (\n <kbd\n ref={ref}\n className={classNames(groupClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {keys.map((key, index) => (\n // Each wrapper takes its child's own React key, so a child that\n // moves keeps its node. Text has none, so it goes by its place.\n <React.Fragment\n key={React.isValidElement(key) && key.key != null ? key.key : index}\n >\n {index > 0 && (\n <span className={separatorClass}>{` ${separator} `}</span>\n )}\n {key}\n </React.Fragment>\n ))}\n </kbd>\n );\n }\n);\n\nKbdGroup.displayName = 'Kbd.Group';\n\n/**\n * The `Kbd` component renders a `<kbd>` drawn as a keycap, for a key the reader presses.\n *\n * It only shows the key: it doesn't listen for it. The key takes its colors\n * from the text it sits in, and its size in `em`, so it fits a paragraph, a\n * title or a filled button as it is, and `textSize` sizes it outright. For a\n * combination or a sequence, put the keys in a `Kbd.Group`. What tells\n * assistive tech a control has a shortcut is `aria-keyshortcuts` on that\n * control, with `Kbd` as the hint people see next to it.\n *\n * @function\n * @param {KbdProps} props - Props for the Kbd component.\n * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the `<kbd>`.\n * @returns {JSX.Element} The rendered key.\n *\n * @example\n * <Kbd>Esc</Kbd>\n *\n * @example\n * <Kbd label=\"Command\">⌘</Kbd>\n */\nconst KbdRoot = forwardRef<HTMLElement, KbdProps>(\n ({ className, textColor, bgColor, label, children, ...props }, ref) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n const kbdClass = usePrefixedClassNames('kbd');\n\n // The name is text rather than an aria-label, which ARIA in HTML\n // prohibits on kbd. Its styles are inline, so it stays hidden in a\n // modular build that leaves out Bulma's helper classes.\n return (\n <kbd\n ref={ref}\n className={classNames(kbdClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {label ? (\n <>\n <span aria-hidden=\"true\">{children}</span>\n <span style={visuallyHidden}>{label}</span>\n </>\n ) : (\n children\n )}\n </kbd>\n );\n }\n);\n\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AC,WAAW,GAAG,WAAW;AAElC;;;;;;;;;;;;;;;;;;;;AAoBG;AACH,MAAM,OAAO,GAAG,UAAU,CACxB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AACpE,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;AACF,IAAA,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,CAAC;;;;IAK7C,QACEA,aACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,QAAQ,EAAE,kBAAkB,EAAE,SAAS,CAAC,EAAA,GAC1D,IAAI,EAAA,QAAA,EAEP,KAAK,IACJC,4BACED,GAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAkB,MAAM,YAAE,QAAQ,EAAA,CAAQ,EAC1CA,GAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAE,cAAc,EAAA,QAAA,EAAG,KAAK,GAAQ,CAAA,EAAA,CAC1C,KAEH,QAAQ,CACT,EAAA,CACG;AAEV,CAAC,CACF;AAEM,MAAM,GAAG,GAAG,iBAAiB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK;;"}
@@ -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":"Link.js","sources":["../../../src/elements/Link.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport type { PolymorphicComponent } from '../helpers/polymorphic';\nimport { buttonType } from '../helpers/buttonType';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * The Link component's own props — everything it adds on top of the attributes\n * of whatever element `as` renders.\n */\nexport interface LinkOwnProps extends Omit<\n BulmaClassesProps,\n 'color' | 'backgroundColor'\n> {\n /**\n * Not accepted. `color` on this component would be the deprecated\n * presentational HTML attribute, and `useBulmaClasses` consumes any `color`\n * key as a Bulma helper before the target could see it — so it is declared\n * unavailable rather than silently eaten. Use `textColor` / `bgColor`.\n * @internal\n */\n color?: never;\n /**\n * Not accepted under this name. `useBulmaClasses` consumes any\n * `backgroundColor` key before `rest` is spread, so a custom `as` target\n * declaring one would never receive it. Use `bgColor`.\n * @internal\n */\n backgroundColor?: never;\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Whether the link appears active. */\n isActive?: boolean;\n /** Content to render inside the link. */\n children?: React.ReactNode;\n}\n\n/**\n * Props for the Link component. The DOM attributes and the `ref` both follow\n * `as`: with the default `'a'` the anchor attributes (`href`, `target`, `rel`)\n * are accepted, with `as=\"span\"` they are not.\n *\n * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.\n */\nexport type LinkProps<T extends React.ElementType = 'a'> = LinkOwnProps &\n Omit<React.ComponentPropsWithoutRef<T>, keyof LinkOwnProps | 'as'> & {\n /**\n * Render as another intrinsic element (`'span'`, `'button'`) or a custom component (e.g. a router `Link`) instead of `<a>`. Defaults to `'a'`.\n *\n * `'button'` renders `type=\"button\"`, so a link inside a form does not submit it. Pass\n * `type=\"submit\"` or `type=\"reset\"` and yours is used; any other value, or a spread\n * carrying `type: undefined`, renders `type=\"button\"`.\n */\n as?: T;\n };\n\n/**\n * The shape the implementation destructures. The public contract is the generic\n * `LinkProps<T>` above — the body cannot see through `T`, so it reads the widest\n * form of the props it actually touches.\n */\ntype LinkImplProps = LinkOwnProps & {\n as?: React.ElementType;\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n};\n\n/**\n * The `Link` component renders a styled anchor (`<a>`) element with Bulma helper class integration.\n *\n * @function\n * @param {LinkProps} props - Props for the Link component.\n * @param {React.Ref} ref - Forwarded ref to the element `as` renders.\n * @returns {JSX.Element} The rendered anchor, or whatever `as` names.\n * @see {@link https://bulma.io/documentation/elements/content/ | Bulma Content documentation}\n */\nexport const Link = forwardRef(function Link(\n linkProps: LinkProps,\n ref: React.Ref<HTMLElement>\n) {\n const {\n className,\n textColor,\n bgColor,\n isActive,\n as: Component = 'a',\n children,\n ...props\n } = linkProps as LinkImplProps;\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames({\n 'is-active': isActive,\n });\n const linkClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <Component\n ref={ref}\n className={linkClasses || undefined}\n {...rest}\n // A `<button>` defaults to type=\"submit\", and a link-styled button inside\n // a form must not submit it. After the spread, reading through it, so a\n // spread carrying `type: undefined` cannot erase the default. A caller's\n // `submit` or `reset` still wins; `buttonType` says more.\n {...(Component === 'button' ? { type: buttonType(rest.type) } : {})}\n >\n {children}\n </Component>\n );\n}) as PolymorphicComponent<LinkOwnProps, 'a'>;\n\nLink.displayName = 'Link';\n"],"names":["_jsx"],"mappings":";;;;;;;AA0EA;;;;;;;;AAQG;AACI,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,IAAI,CAC1C,SAAoB,EACpB,GAA2B,EAAA;IAE3B,MAAM,EACJ,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,EAAE,EAAE,SAAS,GAAG,GAAG,EACnB,QAAQ,EACR,GAAG,KAAK,EACT,GAAG,SAA0B;AAC9B;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;IAEtC,MAAM,YAAY,GAAG,qBAAqB,CAAC;AACzC,QAAA,WAAW,EAAE,QAAQ;AACtB,KAAA,CAAC;IACF,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAE3E,IAAA,QACEA,GAAA,CAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,WAAW,IAAI,SAAS,EAAA,GAC/B,IAAI,MAKH,SAAS,KAAK,QAAQ,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,YAElE,QAAQ,EAAA,CACC;AAEhB,CAAC;AAED,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
1
+ {"version":3,"file":"Link.js","sources":["../../../src/elements/Link.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport type { PolymorphicComponent } from '../helpers/polymorphic';\nimport { buttonType } from '../helpers/buttonType';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * The Link component's own props — everything it adds on top of the attributes\n * of whatever element `as` renders.\n */\nexport interface LinkOwnProps extends Omit<\n BulmaClassesProps,\n 'color' | 'backgroundColor'\n> {\n /**\n * Not accepted. `color` on this component would be the deprecated\n * presentational HTML attribute, and `useBulmaClasses` consumes any `color`\n * key as a Bulma helper before the target could see it — so it is declared\n * unavailable rather than silently eaten. Use `textColor` / `bgColor`.\n * @internal\n */\n color?: never;\n /**\n * Not accepted under this name. `useBulmaClasses` consumes any\n * `backgroundColor` key before `rest` is spread, so a custom `as` target\n * declaring one would never receive it. Use `bgColor`.\n * @internal\n */\n backgroundColor?: never;\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Whether the link appears active. */\n isActive?: boolean;\n /** Content to render inside the link. */\n children?: React.ReactNode;\n}\n\n/**\n * Props for the Link component. The DOM attributes and the `ref` both follow\n * `as`: with the default `'a'` the anchor attributes (`href`, `target`, `rel`)\n * are accepted, with `as=\"span\"` they are not.\n *\n * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.\n */\nexport type LinkProps<T extends React.ElementType = 'a'> = LinkOwnProps &\n Omit<React.ComponentPropsWithoutRef<T>, keyof LinkOwnProps | 'as'> & {\n /**\n * Render as another intrinsic element (`'span'`, `'button'`) or a custom component (e.g. a router `Link`) instead of `<a>`. Defaults to `'a'`.\n *\n * `'button'` renders `type=\"button\"`, so a link inside a form does not submit it. Pass\n * `type=\"submit\"` or `type=\"reset\"` and yours is used; any other value, or a spread\n * carrying `type: undefined`, renders `type=\"button\"`.\n */\n as?: T;\n };\n\n/**\n * The shape the implementation destructures. The public contract is the generic\n * `LinkProps<T>` above — the body cannot see through `T`, so it reads the widest\n * form of the props it actually touches.\n */\ntype LinkImplProps = LinkOwnProps & {\n as?: React.ElementType;\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n};\n\n/**\n * The `Link` component renders a styled anchor (`<a>`) element with Bulma helper class integration.\n *\n * @function\n * @param {LinkProps} props - Props for the Link component.\n * @param {React.Ref} ref - Forwarded ref to the element `as` renders.\n * @returns {JSX.Element} The rendered anchor, or whatever `as` names.\n * @see {@link https://bulma.io/documentation/elements/content/ | Bulma Content documentation}\n */\nexport const Link = forwardRef(function Link(\n linkProps: LinkProps,\n ref: React.Ref<HTMLElement>\n) {\n const {\n className,\n textColor,\n bgColor,\n isActive,\n as: Component = 'a',\n children,\n ...props\n } = linkProps as LinkImplProps;\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames({\n 'is-active': isActive,\n });\n const linkClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <Component\n ref={ref}\n className={linkClasses || undefined}\n {...rest}\n // A `<button>` defaults to type=\"submit\", and a link-styled button inside\n // a form must not submit it. After the spread, reading through it, so a\n // spread carrying `type: undefined` cannot erase the default. A caller's\n // `submit` or `reset` still wins; `buttonType` says more.\n {...(Component === 'button' ? { type: buttonType(rest.type) } : {})}\n >\n {children}\n </Component>\n );\n}) as PolymorphicComponent<LinkOwnProps, 'a'>;\n\nLink.displayName = 'Link';\n"],"names":["_jsx"],"mappings":";;;;;;;;AA0EA;;;;;;;;AAQG;AACI,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,IAAI,CAC1C,SAAoB,EACpB,GAA2B,EAAA;IAE3B,MAAM,EACJ,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,EAAE,EAAE,SAAS,GAAG,GAAG,EACnB,QAAQ,EACR,GAAG,KAAK,EACT,GAAG,SAA0B;AAC9B;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;IAEtC,MAAM,YAAY,GAAG,qBAAqB,CAAC;AACzC,QAAA,WAAW,EAAE,QAAQ;AACtB,KAAA,CAAC;IACF,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAE3E,IAAA,QACEA,GAAA,CAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,WAAW,IAAI,SAAS,EAAA,GAC/B,IAAI,MAKH,SAAS,KAAK,QAAQ,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,YAElE,QAAQ,EAAA,CACC;AAEhB,CAAC;AAED,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 } from 'react/jsx-runtime';
3
4
  import { forwardRef } from 'react';
4
5
  import { Button } from './Button.js';
@@ -1 +1 @@
1
- {"version":3,"file":"LinkButton.js","sources":["../../../src/elements/LinkButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Button, ButtonOwnProps } from './Button';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport type { PolymorphicComponent } from '../helpers/polymorphic';\n\n/**\n * The LinkButton component's own props — everything it adds on top of the\n * attributes of whatever element `as` renders.\n */\nexport interface LinkButtonOwnProps extends Omit<\n ButtonOwnProps,\n 'color' | 'isOutlined' | 'isInverted' | 'isLight'\n> {\n /** Display mode. `text` has no underline and highlights its background on hover; `ghost` uses the default text color and underlines on hover; `underline` drops the button chrome entirely (transparent background and border) and underlines on hover or focus. */\n variant?: 'text' | 'ghost' | 'underline';\n /** Text color override for the button. */\n color?:\n | 'primary'\n | 'link'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger'\n | 'white'\n | 'light'\n | 'dark'\n | 'black';\n /**\n * Not available on `LinkButton`, and declared so that a custom `as` target\n * cannot reintroduce it. `Button` consumes these three for styling variants\n * `LinkButton` does not offer, and strips them before rendering the target —\n * so without this a component requiring one would type-check and silently\n * never receive it.\n * @internal\n */\n isOutlined?: never;\n /** @internal Not available on `LinkButton` — see `isOutlined`. */\n isInverted?: never;\n /** @internal Not available on `LinkButton` — see `isOutlined`. */\n isLight?: never;\n}\n\n/**\n * Props for the LinkButton component. The DOM attributes and the `ref` both\n * follow `as`, exactly as they do on `Button`.\n *\n * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.\n */\nexport type LinkButtonProps<T extends React.ElementType = 'button'> =\n LinkButtonOwnProps &\n Omit<React.ComponentPropsWithoutRef<T>, keyof LinkButtonOwnProps | 'as'> & {\n /**\n * Render as a `<button>`, `<a>`, or a custom component (e.g. a router `Link`).\n * @defaultValue 'button'\n */\n as?: T;\n };\n\n/**\n * The `LinkButton` component renders a `<button>` that visually looks like text or a link.\n *\n * @function\n * @param {LinkButtonProps} props - Props for the LinkButton component.\n * @param {React.Ref} ref - Forwarded ref to the element `as` renders.\n * @returns {JSX.Element} The rendered link-styled button element.\n *\n * @example\n * // Text variant (default)\n * <LinkButton onClick={handleClick}>Click me</LinkButton>\n *\n * @example\n * // Underline variant with color\n * <LinkButton variant=\"underline\" color=\"primary\">Learn more</LinkButton>\n */\nexport const LinkButton = forwardRef(function LinkButton(\n { variant = 'text', color, className, ...props }: LinkButtonProps,\n ref: React.Ref<HTMLElement>\n) {\n const buttonColor = variant === 'underline' ? 'text' : variant;\n\n const prefixedClasses = usePrefixedClassNames(\n 'link-button',\n color && `link-button-${color}`,\n variant === 'underline' && 'link-button-underline'\n );\n\n return (\n <Button\n // LinkButton is polymorphic through to Button, which resolves the element\n // from `as`. TS cannot infer that through the spread below.\n ref={ref as React.Ref<HTMLButtonElement>}\n color={buttonColor}\n className={classNames(prefixedClasses, className)}\n {...props}\n />\n );\n}) as PolymorphicComponent<LinkButtonOwnProps, 'button'>;\n\nLinkButton.displayName = 'LinkButton';\n\nexport default LinkButton;\n"],"names":["_jsx"],"mappings":";;;;;;AA0DA;;;;;;;;;;;;;;;AAeG;MACU,UAAU,GAAG,UAAU,CAAC,SAAS,UAAU,CACtD,EAAE,OAAO,GAAG,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAmB,EACjE,GAA2B,EAAA;AAE3B,IAAA,MAAM,WAAW,GAAG,OAAO,KAAK,WAAW,GAAG,MAAM,GAAG,OAAO;AAE9D,IAAA,MAAM,eAAe,GAAG,qBAAqB,CAC3C,aAAa,EACb,KAAK,IAAI,CAAA,YAAA,EAAe,KAAK,CAAA,CAAE,EAC/B,OAAO,KAAK,WAAW,IAAI,uBAAuB,CACnD;IAED,QACEA,IAAC;;;;;;AAGC,QAAA,GAAG,EAAE,GAAmC,EACxC,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE,SAAS,CAAC,KAC7C,KAAK,EAAA,CACT;AAEN,CAAC;AAED,UAAU,CAAC,WAAW,GAAG,YAAY;;"}
1
+ {"version":3,"file":"LinkButton.js","sources":["../../../src/elements/LinkButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Button, ButtonOwnProps } from './Button';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport type { PolymorphicComponent } from '../helpers/polymorphic';\n\n/**\n * The LinkButton component's own props — everything it adds on top of the\n * attributes of whatever element `as` renders.\n */\nexport interface LinkButtonOwnProps extends Omit<\n ButtonOwnProps,\n 'color' | 'isOutlined' | 'isInverted' | 'isLight'\n> {\n /** Display mode. `text` has no underline and highlights its background on hover; `ghost` uses the default text color and underlines on hover; `underline` drops the button chrome entirely (transparent background and border) and underlines on hover or focus. */\n variant?: 'text' | 'ghost' | 'underline';\n /** Text color override for the button. */\n color?:\n | 'primary'\n | 'link'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger'\n | 'white'\n | 'light'\n | 'dark'\n | 'black';\n /**\n * Not available on `LinkButton`, and declared so that a custom `as` target\n * cannot reintroduce it. `Button` consumes these three for styling variants\n * `LinkButton` does not offer, and strips them before rendering the target —\n * so without this a component requiring one would type-check and silently\n * never receive it.\n * @internal\n */\n isOutlined?: never;\n /** @internal Not available on `LinkButton` — see `isOutlined`. */\n isInverted?: never;\n /** @internal Not available on `LinkButton` — see `isOutlined`. */\n isLight?: never;\n}\n\n/**\n * Props for the LinkButton component. The DOM attributes and the `ref` both\n * follow `as`, exactly as they do on `Button`.\n *\n * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.\n */\nexport type LinkButtonProps<T extends React.ElementType = 'button'> =\n LinkButtonOwnProps &\n Omit<React.ComponentPropsWithoutRef<T>, keyof LinkButtonOwnProps | 'as'> & {\n /**\n * Render as a `<button>`, `<a>`, or a custom component (e.g. a router `Link`).\n * @defaultValue 'button'\n */\n as?: T;\n };\n\n/**\n * The `LinkButton` component renders a `<button>` that visually looks like text or a link.\n *\n * @function\n * @param {LinkButtonProps} props - Props for the LinkButton component.\n * @param {React.Ref} ref - Forwarded ref to the element `as` renders.\n * @returns {JSX.Element} The rendered link-styled button element.\n *\n * @example\n * // Text variant (default)\n * <LinkButton onClick={handleClick}>Click me</LinkButton>\n *\n * @example\n * // Underline variant with color\n * <LinkButton variant=\"underline\" color=\"primary\">Learn more</LinkButton>\n */\nexport const LinkButton = forwardRef(function LinkButton(\n { variant = 'text', color, className, ...props }: LinkButtonProps,\n ref: React.Ref<HTMLElement>\n) {\n const buttonColor = variant === 'underline' ? 'text' : variant;\n\n const prefixedClasses = usePrefixedClassNames(\n 'link-button',\n color && `link-button-${color}`,\n variant === 'underline' && 'link-button-underline'\n );\n\n return (\n <Button\n // LinkButton is polymorphic through to Button, which resolves the element\n // from `as`. TS cannot infer that through the spread below.\n ref={ref as React.Ref<HTMLButtonElement>}\n color={buttonColor}\n className={classNames(prefixedClasses, className)}\n {...props}\n />\n );\n}) as PolymorphicComponent<LinkButtonOwnProps, 'button'>;\n\nLinkButton.displayName = 'LinkButton';\n\nexport default LinkButton;\n"],"names":["_jsx"],"mappings":";;;;;;;AA0DA;;;;;;;;;;;;;;;AAeG;MACU,UAAU,GAAG,UAAU,CAAC,SAAS,UAAU,CACtD,EAAE,OAAO,GAAG,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAmB,EACjE,GAA2B,EAAA;AAE3B,IAAA,MAAM,WAAW,GAAG,OAAO,KAAK,WAAW,GAAG,MAAM,GAAG,OAAO;AAE9D,IAAA,MAAM,eAAe,GAAG,qBAAqB,CAC3C,aAAa,EACb,KAAK,IAAI,CAAA,YAAA,EAAe,KAAK,CAAA,CAAE,EAC/B,OAAO,KAAK,WAAW,IAAI,uBAAuB,CACnD;IAED,QACEA,IAAC;;;;;;AAGC,QAAA,GAAG,EAAE,GAAmC,EACxC,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE,SAAS,CAAC,KAC7C,KAAK,EAAA,CACT;AAEN,CAAC;AAED,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 } from 'react/jsx-runtime';
3
4
  import { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
4
5
  import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.js","sources":["../../../src/elements/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the ListItem component.\n * @extraProp {number} [value] - Custom value for ordered list items.\n */\nexport interface ListItemProps\n extends\n React.LiHTMLAttributes<HTMLLIElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Content to render inside the list item. */\n children?: React.ReactNode;\n}\n\n/**\n * The `ListItem` component renders a styled list item (`<li>`) element with Bulma helper class integration.\n *\n * @function\n * @param {ListItemProps} props - Props for the ListItem component.\n * @returns {JSX.Element} The rendered li element.\n */\nexport const ListItem: React.FC<ListItemProps> = ({\n className,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const itemClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <li className={itemClasses || undefined} {...rest}>\n {children}\n </li>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AA0BA;;;;;;AAMG;AACI,MAAM,QAAQ,GAA4B,CAAC,EAChD,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;AAEtC,IAAA,MAAM,YAAY,GAAG,qBAAqB,EAAE;IAC5C,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAE3E,IAAA,QACEA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,WAAW,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAC9C,QAAQ,EAAA,CACN;AAET;;"}
1
+ {"version":3,"file":"ListItem.js","sources":["../../../src/elements/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the ListItem component.\n * @extraProp {number} [value] - Custom value for ordered list items.\n */\nexport interface ListItemProps\n extends\n React.LiHTMLAttributes<HTMLLIElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Content to render inside the list item. */\n children?: React.ReactNode;\n}\n\n/**\n * The `ListItem` component renders a styled list item (`<li>`) element with Bulma helper class integration.\n *\n * @function\n * @param {ListItemProps} props - Props for the ListItem component.\n * @returns {JSX.Element} The rendered li element.\n */\nexport const ListItem: React.FC<ListItemProps> = ({\n className,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const itemClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <li className={itemClasses || undefined} {...rest}>\n {children}\n </li>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AA0BA;;;;;;AAMG;AACI,MAAM,QAAQ,GAA4B,CAAC,EAChD,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;AAEtC,IAAA,MAAM,YAAY,GAAG,qBAAqB,EAAE;IAC5C,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAE3E,IAAA,QACEA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,WAAW,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAC9C,QAAQ,EAAA,CACN;AAET;;"}
@@ -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';