@webiny/admin-ui 6.6.0-alpha.0 → 6.6.0-alpha.10

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 (397) hide show
  1. package/Accordion/components/AccordionContent.js +4 -1
  2. package/Accordion/components/AccordionContent.js.map +1 -1
  3. package/Accordion/components/AccordionItem.d.ts +1 -0
  4. package/Accordion/components/AccordionItem.js.map +1 -1
  5. package/Accordion/components/AccordionItemDragHandle.d.ts +2 -1
  6. package/Accordion/components/AccordionItemDragHandle.js +2 -1
  7. package/Accordion/components/AccordionItemDragHandle.js.map +1 -1
  8. package/Accordion/components/AccordionTrigger.js +4 -2
  9. package/Accordion/components/AccordionTrigger.js.map +1 -1
  10. package/Alert/Alert.d.ts +1 -20
  11. package/Alert/Alert.js.map +1 -1
  12. package/AutoComplete/primitives/AutoCompletePrimitive.d.ts +8 -2
  13. package/AutoComplete/primitives/AutoCompletePrimitive.js +1 -0
  14. package/AutoComplete/primitives/AutoCompletePrimitive.js.map +1 -1
  15. package/BetaBadge/BetaBadge.d.ts +6 -0
  16. package/BetaBadge/BetaBadge.js +7 -0
  17. package/BetaBadge/BetaBadge.js.map +1 -0
  18. package/Breadcrumbs/Breadcrumbs.d.ts +54 -0
  19. package/Breadcrumbs/Breadcrumbs.js +66 -0
  20. package/Breadcrumbs/Breadcrumbs.js.map +1 -0
  21. package/Breadcrumbs/Breadcrumbs.stories.d.ts +9 -0
  22. package/Breadcrumbs/Breadcrumbs.stories.js +71 -0
  23. package/Breadcrumbs/Breadcrumbs.stories.js.map +1 -0
  24. package/Breadcrumbs/index.d.ts +1 -0
  25. package/Breadcrumbs/index.js +1 -0
  26. package/Button/Button.d.ts +1 -1
  27. package/Button/Button.js +14 -0
  28. package/Button/Button.js.map +1 -1
  29. package/Button/Button.mdx +13 -0
  30. package/Button/Button.stories.d.ts +1 -0
  31. package/Button/Button.stories.js +10 -2
  32. package/Button/Button.stories.js.map +1 -1
  33. package/Button/Button.test.d.ts +1 -0
  34. package/Button/Button.test.js +28 -0
  35. package/Button/Button.test.js.map +1 -0
  36. package/Calendar/calendarClassNames.js +1 -1
  37. package/Calendar/calendarClassNames.js.map +1 -1
  38. package/Checkbox/primitives/presenters/CheckboxPresenter.js +5 -2
  39. package/Checkbox/primitives/presenters/CheckboxPresenter.js.map +1 -1
  40. package/Checkbox/primitives/presenters/CheckboxPresenter.jsxLabel.test.d.ts +1 -0
  41. package/Checkbox/primitives/presenters/CheckboxPresenter.jsxLabel.test.js +61 -0
  42. package/Checkbox/primitives/presenters/CheckboxPresenter.jsxLabel.test.js.map +1 -0
  43. package/CheckboxGroup/CheckboxGroup.js +4 -1
  44. package/CheckboxGroup/CheckboxGroup.js.map +1 -1
  45. package/CheckboxGroup/primitives/CheckboxGroupPrimitive.d.ts +6 -1
  46. package/CheckboxGroup/primitives/CheckboxGroupPrimitive.js +5 -2
  47. package/CheckboxGroup/primitives/CheckboxGroupPrimitive.js.map +1 -1
  48. package/CheckboxGroup/primitives/presenters/CheckboxGroupPresenter.js +5 -2
  49. package/CheckboxGroup/primitives/presenters/CheckboxGroupPresenter.js.map +1 -1
  50. package/CheckboxGroup/primitives/presenters/CheckboxGroupPresenter.jsxLabel.test.d.ts +1 -0
  51. package/CheckboxGroup/primitives/presenters/CheckboxGroupPresenter.jsxLabel.test.js +108 -0
  52. package/CheckboxGroup/primitives/presenters/CheckboxGroupPresenter.jsxLabel.test.js.map +1 -0
  53. package/Code/Code.d.ts +29 -0
  54. package/Code/Code.js +23 -0
  55. package/Code/Code.js.map +1 -0
  56. package/Code/index.d.ts +1 -0
  57. package/Code/index.js +1 -0
  58. package/CodeEditor/CodeEditor.js +6 -0
  59. package/CodeEditor/CodeEditor.js.map +1 -1
  60. package/CodeEditor/CodeEditorPrimitive.js +3 -1
  61. package/CodeEditor/CodeEditorPrimitive.js.map +1 -1
  62. package/ColorPicker/ColorPicker.js +4 -1
  63. package/ColorPicker/ColorPicker.js.map +1 -1
  64. package/ColorPicker/primitives/ColorPickerPrimitive.d.ts +1 -1
  65. package/ColorPicker/primitives/ColorPickerPrimitive.js +3 -1
  66. package/ColorPicker/primitives/ColorPickerPrimitive.js.map +1 -1
  67. package/Command/components/List.d.ts +1 -1
  68. package/Command/components/List.js +9 -5
  69. package/Command/components/List.js.map +1 -1
  70. package/DataTable/DataTable.d.ts +42 -7
  71. package/DataTable/DataTable.js +122 -26
  72. package/DataTable/DataTable.js.map +1 -1
  73. package/DataTable/DataTable.mdx +64 -0
  74. package/DataTable/DataTable.stories.d.ts +4 -0
  75. package/DataTable/DataTable.stories.js +40 -1
  76. package/DataTable/DataTable.stories.js.map +1 -1
  77. package/DataTable/DataTable.subRows.test.d.ts +1 -0
  78. package/DataTable/DataTable.subRows.test.js +216 -0
  79. package/DataTable/DataTable.subRows.test.js.map +1 -0
  80. package/DataTable/components/ColumnsVisibility.d.ts +5 -4
  81. package/DataTable/components/ColumnsVisibility.js +7 -3
  82. package/DataTable/components/ColumnsVisibility.js.map +1 -1
  83. package/DatePicker/DatePicker.d.ts +5 -2
  84. package/DatePicker/DatePicker.js +14 -3
  85. package/DatePicker/DatePicker.js.map +1 -1
  86. package/DatePicker/DatePicker.stories.d.ts +10 -0
  87. package/DatePicker/DatePicker.stories.js +44 -1
  88. package/DatePicker/DatePicker.stories.js.map +1 -1
  89. package/DatePicker/primitives/BirthdayPicker.d.ts +13 -0
  90. package/DatePicker/primitives/BirthdayPicker.js +355 -0
  91. package/DatePicker/primitives/BirthdayPicker.js.map +1 -0
  92. package/DatePicker/primitives/BirthdayPickerCell.d.ts +14 -0
  93. package/DatePicker/primitives/BirthdayPickerCell.js +19 -0
  94. package/DatePicker/primitives/BirthdayPickerCell.js.map +1 -0
  95. package/DatePicker/primitives/BirthdayPickerSegments.d.ts +9 -0
  96. package/DatePicker/primitives/BirthdayPickerSegments.js +43 -0
  97. package/DatePicker/primitives/BirthdayPickerSegments.js.map +1 -0
  98. package/DatePicker/primitives/DateOnlyPicker.d.ts +1 -1
  99. package/DatePicker/primitives/DateOnlyPicker.js +13 -4
  100. package/DatePicker/primitives/DateOnlyPicker.js.map +1 -1
  101. package/DatePicker/primitives/DatePickerPrimitive.js +3 -0
  102. package/DatePicker/primitives/DatePickerPrimitive.js.map +1 -1
  103. package/DatePicker/primitives/DateRangePicker.d.ts +1 -1
  104. package/DatePicker/primitives/DateRangePicker.js +5 -4
  105. package/DatePicker/primitives/DateRangePicker.js.map +1 -1
  106. package/DatePicker/primitives/DateTimePicker.d.ts +1 -1
  107. package/DatePicker/primitives/DateTimePicker.js +27 -18
  108. package/DatePicker/primitives/DateTimePicker.js.map +1 -1
  109. package/DatePicker/primitives/MonthPicker.d.ts +1 -1
  110. package/DatePicker/primitives/MonthPicker.js +2 -1
  111. package/DatePicker/primitives/MonthPicker.js.map +1 -1
  112. package/DatePicker/primitives/MultipleDatesPicker.d.ts +1 -1
  113. package/DatePicker/primitives/MultipleDatesPicker.js +5 -4
  114. package/DatePicker/primitives/MultipleDatesPicker.js.map +1 -1
  115. package/DatePicker/primitives/MultipleMonthsPicker.d.ts +1 -1
  116. package/DatePicker/primitives/MultipleMonthsPicker.js +2 -1
  117. package/DatePicker/primitives/MultipleMonthsPicker.js.map +1 -1
  118. package/DatePicker/primitives/MultipleYearsPicker.d.ts +1 -1
  119. package/DatePicker/primitives/MultipleYearsPicker.js +2 -1
  120. package/DatePicker/primitives/MultipleYearsPicker.js.map +1 -1
  121. package/DatePicker/primitives/TimeOnlyPicker.d.ts +1 -1
  122. package/DatePicker/primitives/TimeOnlyPicker.js +2 -1
  123. package/DatePicker/primitives/TimeOnlyPicker.js.map +1 -1
  124. package/DatePicker/primitives/WeekPicker.d.ts +1 -1
  125. package/DatePicker/primitives/WeekPicker.js +2 -1
  126. package/DatePicker/primitives/WeekPicker.js.map +1 -1
  127. package/DatePicker/primitives/YearPicker.d.ts +1 -1
  128. package/DatePicker/primitives/YearPicker.js +2 -1
  129. package/DatePicker/primitives/YearPicker.js.map +1 -1
  130. package/DatePicker/primitives/components/DatePickerTrigger.js +1 -1
  131. package/DatePicker/primitives/components/DatePickerTrigger.js.map +1 -1
  132. package/DatePicker/primitives/components/TimePicker.d.ts +2 -1
  133. package/DatePicker/primitives/components/TimePicker.js +2 -1
  134. package/DatePicker/primitives/components/TimePicker.js.map +1 -1
  135. package/DatePicker/utils/birthdayHelpers.d.ts +77 -0
  136. package/DatePicker/utils/birthdayHelpers.js +145 -0
  137. package/DatePicker/utils/birthdayHelpers.js.map +1 -0
  138. package/DatePicker/utils/birthdayHelpers.test.d.ts +1 -0
  139. package/DatePicker/utils/birthdayHelpers.test.js +394 -0
  140. package/DatePicker/utils/birthdayHelpers.test.js.map +1 -0
  141. package/DatePicker/utils/dateHelpers.d.ts +6 -1
  142. package/DatePicker/utils/dateHelpers.js +13 -5
  143. package/DatePicker/utils/dateHelpers.js.map +1 -1
  144. package/DatePicker/utils/dateHelpers.test.d.ts +1 -0
  145. package/DatePicker/utils/dateHelpers.test.js +119 -0
  146. package/DatePicker/utils/dateHelpers.test.js.map +1 -0
  147. package/DatePicker/utils/index.d.ts +1 -0
  148. package/DatePicker/utils/index.js +1 -0
  149. package/DatePicker/utils/timezoneHelpers.d.ts +3 -0
  150. package/DatePicker/utils/timezoneHelpers.js +32 -0
  151. package/DatePicker/utils/timezoneHelpers.js.map +1 -0
  152. package/DatePicker/utils/types.d.ts +17 -2
  153. package/DelayedOnChange/DelayedOnChange.d.ts +9 -2
  154. package/DelayedOnChange/DelayedOnChange.js.map +1 -1
  155. package/Dialog/Dialog.d.ts +8 -7
  156. package/Dialog/Dialog.js.map +1 -1
  157. package/Drawer/Drawer.d.ts +10 -6
  158. package/Drawer/Drawer.js +2 -1
  159. package/Drawer/Drawer.js.map +1 -1
  160. package/Drawer/Drawer.stories.d.ts +1 -0
  161. package/Drawer/Drawer.stories.js +20 -2
  162. package/Drawer/Drawer.stories.js.map +1 -1
  163. package/Drawer/components/DrawerHeader.d.ts +2 -2
  164. package/Drawer/components/DrawerHeader.js +11 -8
  165. package/Drawer/components/DrawerHeader.js.map +1 -1
  166. package/Drawer/components/Icon.d.ts +1 -1
  167. package/Drawer/components/Icon.js +3 -4
  168. package/Drawer/components/Icon.js.map +1 -1
  169. package/DropdownMenu/components/DropdownMenuItem.d.ts +5 -0
  170. package/DropdownMenu/components/DropdownMenuItem.js +3 -2
  171. package/DropdownMenu/components/DropdownMenuItem.js.map +1 -1
  172. package/EmptyState/EmptyState.d.ts +2 -1
  173. package/EmptyState/EmptyState.js +8 -2
  174. package/EmptyState/EmptyState.js.map +1 -1
  175. package/FilePicker/FilePicker.d.ts +12 -12
  176. package/FilePicker/FilePicker.js +6 -1
  177. package/FilePicker/FilePicker.js.map +1 -1
  178. package/FilePicker/FilePicker.stories.d.ts +6 -0
  179. package/FilePicker/FilePicker.stories.js +24 -1
  180. package/FilePicker/FilePicker.stories.js.map +1 -1
  181. package/FilePicker/primitives/FilePickerPrimitive.d.ts +13 -13
  182. package/FilePicker/primitives/FilePickerPrimitive.js +3 -1
  183. package/FilePicker/primitives/FilePickerPrimitive.js.map +1 -1
  184. package/FilePicker/primitives/components/Label.d.ts +3 -1
  185. package/FilePicker/primitives/components/Label.js +2 -1
  186. package/FilePicker/primitives/components/Label.js.map +1 -1
  187. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.d.ts +13 -2
  188. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js +15 -6
  189. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js.map +1 -1
  190. package/FilePicker/primitives/components/previews/ItemActions.js +1 -1
  191. package/FilePicker/primitives/components/previews/ItemActions.js.map +1 -1
  192. package/FilePicker/primitives/components/previews/ItemDescription.js +1 -1
  193. package/FilePicker/primitives/components/previews/ItemDescription.js.map +1 -1
  194. package/FilePicker/primitives/components/previews/RichItemPreview/FileType.d.ts +5 -0
  195. package/FilePicker/primitives/components/previews/RichItemPreview/FileType.js +45 -0
  196. package/FilePicker/primitives/components/previews/RichItemPreview/FileType.js.map +1 -0
  197. package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.d.ts +5 -0
  198. package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.js +14 -0
  199. package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.js.map +1 -0
  200. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.d.ts +6 -1
  201. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js +54 -12
  202. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js.map +1 -1
  203. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.d.ts +11 -1
  204. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.js +8 -61
  205. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.js.map +1 -1
  206. package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.d.ts +11 -0
  207. package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.js +24 -0
  208. package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.js.map +1 -0
  209. package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.d.ts +10 -0
  210. package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.js +46 -0
  211. package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.js.map +1 -0
  212. package/FilePicker/primitives/components/previews/TruncatedFileName.d.ts +7 -0
  213. package/FilePicker/primitives/components/previews/TruncatedFileName.js +20 -0
  214. package/FilePicker/primitives/components/previews/TruncatedFileName.js.map +1 -0
  215. package/FilePicker/primitives/components/previews/fileName.d.ts +4 -0
  216. package/FilePicker/primitives/components/previews/fileName.js +26 -0
  217. package/FilePicker/primitives/components/previews/fileName.js.map +1 -0
  218. package/FilePicker/primitives/components/previews/index.d.ts +1 -0
  219. package/FilePicker/primitives/components/previews/index.js +1 -0
  220. package/FormComponent/Label.d.ts +6 -1
  221. package/FormComponent/Label.js +5 -2
  222. package/FormComponent/Label.js.map +1 -1
  223. package/FormComponent/labels.test.d.ts +1 -0
  224. package/FormComponent/labels.test.js +276 -0
  225. package/FormComponent/labels.test.js.map +1 -0
  226. package/Icon/Icon.d.ts +6 -1
  227. package/Icon/Icon.js.map +1 -1
  228. package/IconPicker/IconPicker.js +6 -1
  229. package/IconPicker/IconPicker.js.map +1 -1
  230. package/IconPicker/domains/IconPickerIcon.js +1 -1
  231. package/IconPicker/domains/IconPickerIcon.js.map +1 -1
  232. package/IconPicker/primitives/IconPickerPrimitive.d.ts +2 -0
  233. package/IconPicker/primitives/IconPickerPrimitive.js +2 -2
  234. package/IconPicker/primitives/IconPickerPrimitive.js.map +1 -1
  235. package/IconPicker/primitives/components/IconPickerGrid.js.map +1 -1
  236. package/ImageEditor/AspectRatioPreview.d.ts +16 -0
  237. package/ImageEditor/AspectRatioPreview.js +26 -0
  238. package/ImageEditor/AspectRatioPreview.js.map +1 -0
  239. package/ImageEditor/CropHotspotEditor.d.ts +22 -0
  240. package/ImageEditor/CropHotspotEditor.js +402 -0
  241. package/ImageEditor/CropHotspotEditor.js.map +1 -0
  242. package/ImageEditor/ImageEditor.d.ts +18 -0
  243. package/ImageEditor/ImageEditor.js +151 -0
  244. package/ImageEditor/ImageEditor.js.map +1 -0
  245. package/ImageEditor/ImageEditor.stories.d.ts +6 -0
  246. package/ImageEditor/ImageEditor.stories.js +42 -0
  247. package/ImageEditor/ImageEditor.stories.js.map +1 -0
  248. package/ImageEditor/MetaFields.d.ts +12 -0
  249. package/ImageEditor/MetaFields.js +20 -0
  250. package/ImageEditor/MetaFields.js.map +1 -0
  251. package/ImageEditor/SectionLabel.d.ts +8 -0
  252. package/ImageEditor/SectionLabel.js +7 -0
  253. package/ImageEditor/SectionLabel.js.map +1 -0
  254. package/ImageEditor/geometry.d.ts +46 -0
  255. package/ImageEditor/geometry.js +126 -0
  256. package/ImageEditor/geometry.js.map +1 -0
  257. package/ImageEditor/index.d.ts +3 -0
  258. package/ImageEditor/index.js +3 -0
  259. package/ImageEditor/types.d.ts +52 -0
  260. package/ImageEditor/types.js +35 -0
  261. package/ImageEditor/types.js.map +1 -0
  262. package/Input/InputPrimitive.d.ts +4 -4
  263. package/Input/InputPrimitive.js +0 -1
  264. package/Input/InputPrimitive.js.map +1 -1
  265. package/Kbd/Kbd.d.ts +35 -0
  266. package/Kbd/Kbd.js +34 -0
  267. package/Kbd/Kbd.js.map +1 -0
  268. package/Kbd/index.d.ts +1 -0
  269. package/Kbd/index.js +1 -0
  270. package/Link/Link.d.ts +1 -1
  271. package/Link/Link.js +1 -1
  272. package/Link/Link.js.map +1 -1
  273. package/Markdown/Markdown.d.ts +47 -0
  274. package/Markdown/Markdown.js +17 -0
  275. package/Markdown/Markdown.js.map +1 -0
  276. package/Markdown/index.d.ts +1 -0
  277. package/Markdown/index.js +1 -0
  278. package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.d.ts +8 -2
  279. package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.js +1 -0
  280. package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.js.map +1 -1
  281. package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.test.js +1 -1
  282. package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.test.js.map +1 -1
  283. package/MultiAutoComplete/primitives/useMultiAutoComplete.js +3 -2
  284. package/MultiAutoComplete/primitives/useMultiAutoComplete.js.map +1 -1
  285. package/MultiFilePicker/MultiFilePicker.d.ts +12 -12
  286. package/MultiFilePicker/primitives/MultiFilePickerPrimitive.d.ts +12 -12
  287. package/MultiSelect/MultiSelect.js +6 -1
  288. package/MultiSelect/MultiSelect.js.map +1 -1
  289. package/MultiSelect/primitives/MultiSelectPrimitive.d.ts +3 -1
  290. package/MultiSelect/primitives/MultiSelectPrimitive.js +16 -7
  291. package/MultiSelect/primitives/MultiSelectPrimitive.js.map +1 -1
  292. package/Popover/Popover.stories.d.ts +7 -0
  293. package/Popover/Popover.stories.js +24 -1
  294. package/Popover/Popover.stories.js.map +1 -1
  295. package/Popover/primitives/components/PopoverContent.js +6 -1
  296. package/Popover/primitives/components/PopoverContent.js.map +1 -1
  297. package/RadioGroup/RadioGroup.js +4 -1
  298. package/RadioGroup/RadioGroup.js.map +1 -1
  299. package/RadioGroup/primitives/RadioGroupPrimitive.d.ts +1 -1
  300. package/RadioGroup/primitives/RadioGroupPrimitive.js +4 -2
  301. package/RadioGroup/primitives/RadioGroupPrimitive.js.map +1 -1
  302. package/RadioGroup/primitives/presenters/RadioGroupPresenter.js +4 -2
  303. package/RadioGroup/primitives/presenters/RadioGroupPresenter.js.map +1 -1
  304. package/RadioGroup/primitives/presenters/RadioGroupPresenter.jsxLabel.test.d.ts +1 -0
  305. package/RadioGroup/primitives/presenters/RadioGroupPresenter.jsxLabel.test.js +88 -0
  306. package/RadioGroup/primitives/presenters/RadioGroupPresenter.jsxLabel.test.js.map +1 -0
  307. package/RangeSlider/RangeSlider.js +4 -1
  308. package/RangeSlider/RangeSlider.js.map +1 -1
  309. package/RangeSlider/primitives/RangeSliderPrimitive.d.ts +1 -1
  310. package/RangeSlider/primitives/RangeSliderPrimitive.js +3 -1
  311. package/RangeSlider/primitives/RangeSliderPrimitive.js.map +1 -1
  312. package/ScrollArea/ScrollArea.d.ts +16 -2
  313. package/ScrollArea/ScrollArea.js +19 -5
  314. package/ScrollArea/ScrollArea.js.map +1 -1
  315. package/SegmentedControl/SegmentedControl.js +4 -1
  316. package/SegmentedControl/SegmentedControl.js.map +1 -1
  317. package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +5 -1
  318. package/SegmentedControl/primitives/SegmentedControlPrimitive.js +2 -1
  319. package/SegmentedControl/primitives/SegmentedControlPrimitive.js.map +1 -1
  320. package/Select/Select.js +6 -1
  321. package/Select/Select.js.map +1 -1
  322. package/Select/primitives/SelectPrimitive.d.ts +4 -0
  323. package/Select/primitives/SelectPrimitive.js +4 -2
  324. package/Select/primitives/SelectPrimitive.js.map +1 -1
  325. package/Select/primitives/components/SelectContent.js +4 -6
  326. package/Select/primitives/components/SelectContent.js.map +1 -1
  327. package/SidePanel/SidePanel.d.ts +46 -0
  328. package/SidePanel/SidePanel.js +47 -0
  329. package/SidePanel/SidePanel.js.map +1 -0
  330. package/SidePanel/SidePanelBody.d.ts +37 -0
  331. package/SidePanel/SidePanelBody.js +14 -0
  332. package/SidePanel/SidePanelBody.js.map +1 -0
  333. package/SidePanel/SidePanelFooter.d.ts +27 -0
  334. package/SidePanel/SidePanelFooter.js +10 -0
  335. package/SidePanel/SidePanelFooter.js.map +1 -0
  336. package/SidePanel/index.d.ts +3 -0
  337. package/SidePanel/index.js +3 -0
  338. package/Sidebar/Sidebar.groups.test.d.ts +1 -0
  339. package/Sidebar/Sidebar.groups.test.js +113 -0
  340. package/Sidebar/Sidebar.groups.test.js.map +1 -0
  341. package/Sidebar/components/SidebarContent.js +1 -1
  342. package/Sidebar/components/SidebarContent.js.map +1 -1
  343. package/Sidebar/components/SidebarRoot.js +1 -1
  344. package/Sidebar/components/SidebarRoot.js.map +1 -1
  345. package/Sidebar/components/items/SidebarMenuRootButton.js +1 -0
  346. package/Sidebar/components/items/SidebarMenuRootButton.js.map +1 -1
  347. package/Sidebar/components/items/SidebarMenuSubButton.js +8 -5
  348. package/Sidebar/components/items/SidebarMenuSubButton.js.map +1 -1
  349. package/Sidebar/components/items/SidebarMenuSubItem.js +3 -3
  350. package/Sidebar/components/items/SidebarMenuSubItem.js.map +1 -1
  351. package/Slider/Slider.js +10 -2
  352. package/Slider/Slider.js.map +1 -1
  353. package/Slider/primitives/SliderPrimitive.d.ts +1 -1
  354. package/Slider/primitives/SliderPrimitive.js +2 -1
  355. package/Slider/primitives/SliderPrimitive.js.map +1 -1
  356. package/Slider/primitives/components/SliderThumb.d.ts +5 -2
  357. package/Slider/primitives/components/SliderThumb.js +2 -1
  358. package/Slider/primitives/components/SliderThumb.js.map +1 -1
  359. package/Switch/Switch.d.ts +4 -4
  360. package/Switch/Switch.js +21 -7
  361. package/Switch/Switch.js.map +1 -1
  362. package/Switch/domains/SwitchItemDto.d.ts +1 -1
  363. package/Switch/primitives/SwitchPrimitive.js +4 -3
  364. package/Switch/primitives/SwitchPrimitive.js.map +1 -1
  365. package/Tabs/Tabs.d.ts +7 -2
  366. package/Tabs/Tabs.js +29 -11
  367. package/Tabs/Tabs.js.map +1 -1
  368. package/Tabs/Tabs.mdx +27 -0
  369. package/Tabs/Tabs.stories.d.ts +1 -0
  370. package/Tabs/Tabs.stories.js +19 -1
  371. package/Tabs/Tabs.stories.js.map +1 -1
  372. package/Tag/Tag.d.ts +1 -1
  373. package/Tag/Tag.js +5 -0
  374. package/Tag/Tag.js.map +1 -1
  375. package/Tag/TagIcon.js +7 -1
  376. package/Tag/TagIcon.js.map +1 -1
  377. package/Tags/primitives/TagsPrimitive.d.ts +2 -2
  378. package/Tags/primitives/TagsPrimitive.js.map +1 -1
  379. package/Toast/useToast.stories.js.map +1 -1
  380. package/ToggleGroup/ToggleGroup.js +4 -1
  381. package/ToggleGroup/ToggleGroup.js.map +1 -1
  382. package/ToggleGroup/primitives/ToggleGroupPrimitive.d.ts +2 -0
  383. package/ToggleGroup/primitives/ToggleGroupPrimitive.js +3 -2
  384. package/ToggleGroup/primitives/ToggleGroupPrimitive.js.map +1 -1
  385. package/Tree/useTree.js +6 -2
  386. package/Tree/useTree.js.map +1 -1
  387. package/exports/admin/ui.d.ts +2 -0
  388. package/exports/admin/ui.js +2 -0
  389. package/hooks/index.d.ts +1 -0
  390. package/hooks/index.js +1 -0
  391. package/hooks/useEscapeScrollLock.d.ts +13 -0
  392. package/hooks/useEscapeScrollLock.js +21 -0
  393. package/hooks/useEscapeScrollLock.js.map +1 -0
  394. package/index.d.ts +7 -0
  395. package/index.js +7 -0
  396. package/package.json +31 -29
  397. package/theme.css +43 -0
@@ -0,0 +1,108 @@
1
+ import react from "react";
2
+ import { describe, expect, it, vi } from "vitest";
3
+ import { CheckboxGroupPresenter } from "./CheckboxGroupPresenter.js";
4
+ const createCyclicLabel = ()=>{
5
+ const fiber = {
6
+ tag: 0
7
+ };
8
+ fiber.return = fiber;
9
+ fiber.child = fiber;
10
+ const element = react.createElement("span", null, "Card");
11
+ return {
12
+ ...element,
13
+ _owner: fiber
14
+ };
15
+ };
16
+ describe("CheckboxGroupPresenter with a React node label", ()=>{
17
+ it("keeps the label by reference and does not overflow the stack", ()=>{
18
+ const label = createCyclicLabel();
19
+ const presenter = new CheckboxGroupPresenter();
20
+ const init = ()=>{
21
+ presenter.init({
22
+ items: [
23
+ {
24
+ value: "a",
25
+ label
26
+ },
27
+ {
28
+ value: "b",
29
+ label: "Plain"
30
+ }
31
+ ],
32
+ values: [
33
+ "a"
34
+ ],
35
+ onCheckedChange: vi.fn()
36
+ });
37
+ };
38
+ const ticked = ()=>presenter.vm.items.map((item)=>item.checked);
39
+ expect(init).not.toThrow();
40
+ expect(ticked()).toEqual([
41
+ true,
42
+ false
43
+ ]);
44
+ expect(presenter.vm.items[0].label).toBe(label);
45
+ });
46
+ it("toggles a value on and reports the next values", ()=>{
47
+ const onCheckedChange = vi.fn();
48
+ const presenter = new CheckboxGroupPresenter();
49
+ presenter.init({
50
+ items: [
51
+ {
52
+ value: "a",
53
+ label: createCyclicLabel()
54
+ },
55
+ {
56
+ value: "b",
57
+ label: createCyclicLabel()
58
+ }
59
+ ],
60
+ values: [
61
+ "a"
62
+ ],
63
+ onCheckedChange
64
+ });
65
+ presenter.changeChecked("b");
66
+ const ticked = presenter.vm.items.map((item)=>item.checked);
67
+ expect(onCheckedChange).toHaveBeenCalledWith([
68
+ "a",
69
+ "b"
70
+ ]);
71
+ expect(ticked).toEqual([
72
+ true,
73
+ true
74
+ ]);
75
+ });
76
+ it("toggles a value off and reports the remaining values", ()=>{
77
+ const onCheckedChange = vi.fn();
78
+ const presenter = new CheckboxGroupPresenter();
79
+ presenter.init({
80
+ items: [
81
+ {
82
+ value: "a",
83
+ label: createCyclicLabel()
84
+ },
85
+ {
86
+ value: "b",
87
+ label: createCyclicLabel()
88
+ }
89
+ ],
90
+ values: [
91
+ "a",
92
+ "b"
93
+ ],
94
+ onCheckedChange
95
+ });
96
+ presenter.changeChecked("a");
97
+ const ticked = presenter.vm.items.map((item)=>item.checked);
98
+ expect(onCheckedChange).toHaveBeenCalledWith([
99
+ "b"
100
+ ]);
101
+ expect(ticked).toEqual([
102
+ false,
103
+ true
104
+ ]);
105
+ });
106
+ });
107
+
108
+ //# sourceMappingURL=CheckboxGroupPresenter.jsxLabel.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxGroup/primitives/presenters/CheckboxGroupPresenter.jsxLabel.test.js","sources":["../../../../src/CheckboxGroup/primitives/presenters/CheckboxGroupPresenter.jsxLabel.test.ts"],"sourcesContent":["import React from \"react\";\nimport { describe } from \"vitest\";\nimport { expect } from \"vitest\";\nimport { it } from \"vitest\";\nimport { vi } from \"vitest\";\nimport { CheckboxGroupPresenter } from \"./CheckboxGroupPresenter.js\";\n\n/*\n * A React element created during a render points at its owner fiber, and a fiber points back at\n * its parent and children. A deep observable walks that whole cycle and overflows the stack.\n */\nconst createCyclicLabel = () => {\n const fiber: Record<string, unknown> = { tag: 0 };\n fiber.return = fiber;\n fiber.child = fiber;\n const element = React.createElement(\"span\", null, \"Card\");\n return { ...element, _owner: fiber };\n};\n\ndescribe(\"CheckboxGroupPresenter with a React node label\", () => {\n it(\"keeps the label by reference and does not overflow the stack\", () => {\n const label = createCyclicLabel();\n const presenter = new CheckboxGroupPresenter();\n\n const init = () => {\n presenter.init({\n items: [\n { value: \"a\", label },\n { value: \"b\", label: \"Plain\" }\n ],\n values: [\"a\"],\n onCheckedChange: vi.fn()\n });\n };\n\n const ticked = () => presenter.vm.items.map(item => item.checked);\n\n expect(init).not.toThrow();\n expect(ticked()).toEqual([true, false]);\n expect(presenter.vm.items[0].label).toBe(label);\n });\n\n it(\"toggles a value on and reports the next values\", () => {\n const onCheckedChange = vi.fn();\n const presenter = new CheckboxGroupPresenter();\n presenter.init({\n items: [\n { value: \"a\", label: createCyclicLabel() },\n { value: \"b\", label: createCyclicLabel() }\n ],\n values: [\"a\"],\n onCheckedChange\n });\n\n presenter.changeChecked(\"b\");\n\n const ticked = presenter.vm.items.map(item => item.checked);\n expect(onCheckedChange).toHaveBeenCalledWith([\"a\", \"b\"]);\n expect(ticked).toEqual([true, true]);\n });\n\n it(\"toggles a value off and reports the remaining values\", () => {\n const onCheckedChange = vi.fn();\n const presenter = new CheckboxGroupPresenter();\n presenter.init({\n items: [\n { value: \"a\", label: createCyclicLabel() },\n { value: \"b\", label: createCyclicLabel() }\n ],\n values: [\"a\", \"b\"],\n onCheckedChange\n });\n\n presenter.changeChecked(\"a\");\n\n const ticked = presenter.vm.items.map(item => item.checked);\n expect(onCheckedChange).toHaveBeenCalledWith([\"b\"]);\n expect(ticked).toEqual([false, true]);\n });\n});\n"],"names":["createCyclicLabel","fiber","element","React","describe","it","label","presenter","CheckboxGroupPresenter","init","vi","ticked","item","expect","onCheckedChange"],"mappings":";;;AAWA,MAAMA,oBAAoB;IACtB,MAAMC,QAAiC;QAAE,KAAK;IAAE;IAChDA,MAAM,MAAM,GAAGA;IACfA,MAAM,KAAK,GAAGA;IACd,MAAMC,UAAUC,MAAAA,aAAmB,CAAC,QAAQ,MAAM;IAClD,OAAO;QAAE,GAAGD,OAAO;QAAE,QAAQD;IAAM;AACvC;AAEAG,SAAS,kDAAkD;IACvDC,GAAG,gEAAgE;QAC/D,MAAMC,QAAQN;QACd,MAAMO,YAAY,IAAIC;QAEtB,MAAMC,OAAO;YACTF,UAAU,IAAI,CAAC;gBACX,OAAO;oBACH;wBAAE,OAAO;wBAAKD;oBAAM;oBACpB;wBAAE,OAAO;wBAAK,OAAO;oBAAQ;iBAChC;gBACD,QAAQ;oBAAC;iBAAI;gBACb,iBAAiBI,GAAG,EAAE;YAC1B;QACJ;QAEA,MAAMC,SAAS,IAAMJ,UAAU,EAAE,CAAC,KAAK,CAAC,GAAG,CAACK,CAAAA,OAAQA,KAAK,OAAO;QAEhEC,OAAOJ,MAAM,GAAG,CAAC,OAAO;QACxBI,OAAOF,UAAU,OAAO,CAAC;YAAC;YAAM;SAAM;QACtCE,OAAON,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAACD;IAC7C;IAEAD,GAAG,kDAAkD;QACjD,MAAMS,kBAAkBJ,GAAG,EAAE;QAC7B,MAAMH,YAAY,IAAIC;QACtBD,UAAU,IAAI,CAAC;YACX,OAAO;gBACH;oBAAE,OAAO;oBAAK,OAAOP;gBAAoB;gBACzC;oBAAE,OAAO;oBAAK,OAAOA;gBAAoB;aAC5C;YACD,QAAQ;gBAAC;aAAI;YACbc;QACJ;QAEAP,UAAU,aAAa,CAAC;QAExB,MAAMI,SAASJ,UAAU,EAAE,CAAC,KAAK,CAAC,GAAG,CAACK,CAAAA,OAAQA,KAAK,OAAO;QAC1DC,OAAOC,iBAAiB,oBAAoB,CAAC;YAAC;YAAK;SAAI;QACvDD,OAAOF,QAAQ,OAAO,CAAC;YAAC;YAAM;SAAK;IACvC;IAEAN,GAAG,wDAAwD;QACvD,MAAMS,kBAAkBJ,GAAG,EAAE;QAC7B,MAAMH,YAAY,IAAIC;QACtBD,UAAU,IAAI,CAAC;YACX,OAAO;gBACH;oBAAE,OAAO;oBAAK,OAAOP;gBAAoB;gBACzC;oBAAE,OAAO;oBAAK,OAAOA;gBAAoB;aAC5C;YACD,QAAQ;gBAAC;gBAAK;aAAI;YAClBc;QACJ;QAEAP,UAAU,aAAa,CAAC;QAExB,MAAMI,SAASJ,UAAU,EAAE,CAAC,KAAK,CAAC,GAAG,CAACK,CAAAA,OAAQA,KAAK,OAAO;QAC1DC,OAAOC,iBAAiB,oBAAoB,CAAC;YAAC;SAAI;QAClDD,OAAOF,QAAQ,OAAO,CAAC;YAAC;YAAO;SAAK;IACxC;AACJ"}
package/Code/Code.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import type { VariantProps } from "../utils.js";
3
+ declare const codeVariants: (props?: ({
4
+ size?: "md" | "sm" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ interface CodeProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof codeVariants> {
7
+ }
8
+ /** A short piece of code in running text: an API name, a field ID, a GraphQL type or a JSON key. */
9
+ declare const CodeBase: ({ size, className, ...props }: CodeProps) => React.JSX.Element;
10
+ declare const Code: typeof CodeBase & {
11
+ original: typeof CodeBase;
12
+ originalName: string;
13
+ displayName: string;
14
+ } & {
15
+ original: typeof CodeBase & {
16
+ original: typeof CodeBase;
17
+ originalName: string;
18
+ displayName: string;
19
+ };
20
+ originalName: string;
21
+ displayName: string;
22
+ } & {
23
+ createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof CodeBase & {
24
+ original: typeof CodeBase;
25
+ originalName: string;
26
+ displayName: string;
27
+ }>) => (props: unknown) => React.JSX.Element;
28
+ };
29
+ export { Code, type CodeProps };
package/Code/Code.js ADDED
@@ -0,0 +1,23 @@
1
+ import { cn, cva, makeDecoratable } from "../utils.js";
2
+ import * as __rspack_external_react from "react";
3
+ const codeVariants = cva("rounded-sm bg-neutral-light px-xs py-px font-mono font-normal text-neutral-primary", {
4
+ variants: {
5
+ size: {
6
+ md: "text-[13px] leading-5",
7
+ sm: "text-sm"
8
+ }
9
+ },
10
+ defaultVariants: {
11
+ size: "md"
12
+ }
13
+ });
14
+ const CodeBase = ({ size, className, ...props })=>/*#__PURE__*/ __rspack_external_react.createElement("code", {
15
+ className: cn(codeVariants({
16
+ size
17
+ }), className),
18
+ ...props
19
+ });
20
+ const Code = makeDecoratable("Code", CodeBase);
21
+ export { Code };
22
+
23
+ //# sourceMappingURL=Code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Code/Code.js","sources":["../../src/Code/Code.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"~/utils.js\";\nimport { cva } from \"~/utils.js\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport type { VariantProps } from \"~/utils.js\";\n\n/*\n * The mono face runs 1px smaller than the Inter text around it, so the two read at the same size:\n * 13px inside `text-md`, 12px inside `text-sm`.\n */\nconst codeVariants = cva(\n \"rounded-sm bg-neutral-light px-xs py-px font-mono font-normal text-neutral-primary\",\n {\n variants: {\n size: {\n md: \"text-[13px] leading-5\",\n sm: \"text-sm\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\ninterface CodeProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof codeVariants> {}\n\n/** A short piece of code in running text: an API name, a field ID, a GraphQL type or a JSON key. */\nconst CodeBase = ({ size, className, ...props }: CodeProps) => (\n <code className={cn(codeVariants({ size }), className)} {...props} />\n);\n\nconst Code = makeDecoratable(\"Code\", CodeBase);\n\nexport { Code, type CodeProps };\n"],"names":["codeVariants","cva","CodeBase","size","className","props","cn","Code","makeDecoratable"],"mappings":";;AAUA,MAAMA,eAAeC,IACjB,sFACA;IACI,UAAU;QACN,MAAM;YACF,IAAI;YACJ,IAAI;QACR;IACJ;IACA,iBAAiB;QACb,MAAM;IACV;AACJ;AAMJ,MAAMC,WAAW,CAAC,EAAEC,IAAI,EAAEC,SAAS,EAAE,GAAGC,OAAkB,iBACtD,sCAAC;QAAK,WAAWC,GAAGN,aAAa;YAAEG;QAAK,IAAIC;QAAa,GAAGC,KAAK;;AAGrE,MAAME,OAAOC,gBAAgB,QAAQN"}
@@ -0,0 +1 @@
1
+ export * from "./Code.js";
package/Code/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./Code.js";
@@ -20,6 +20,12 @@ const DecoratableCodeEditor = ({ label, description, note, hint, required, disab
20
20
  disabled: disabled
21
21
  }), /*#__PURE__*/ react.createElement(CodeEditorPrimitive, {
22
22
  ...props,
23
+ options: {
24
+ ..."string" == typeof label ? {
25
+ ariaLabel: label
26
+ } : {},
27
+ ...props.options
28
+ },
23
29
  disabled: disabled
24
30
  }), /*#__PURE__*/ react.createElement(FormComponentErrorMessage, {
25
31
  text: validationMessage,
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor/CodeEditor.js","sources":["../../src/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport type { CodeEditorPrimitiveProps } from \"./CodeEditorPrimitive.js\";\nimport { CodeEditorPrimitive } from \"./CodeEditorPrimitive.js\";\nimport type { FormComponentProps } from \"~/FormComponent/index.js\";\nimport {\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel,\n FormComponentNote\n} from \"~/FormComponent/index.js\";\n\ntype CodeEditorProps = CodeEditorPrimitiveProps & FormComponentProps;\n\nconst DecoratableCodeEditor = ({\n label,\n description,\n note,\n hint,\n required,\n disabled = false,\n validation,\n ...props\n}: CodeEditorProps) => {\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n const invalid = useMemo(() => validationIsValid === false, [validationIsValid]);\n\n return (\n <div className={\"w-full\"}>\n <FormComponentLabel\n text={label}\n hint={hint}\n required={required}\n disabled={disabled}\n invalid={invalid}\n />\n <FormComponentDescription text={description} disabled={disabled} />\n <CodeEditorPrimitive {...props} disabled={disabled} />\n <FormComponentErrorMessage\n text={validationMessage}\n invalid={invalid}\n disabled={disabled}\n />\n <FormComponentNote text={note} disabled={disabled} />\n </div>\n );\n};\nconst CodeEditor = makeDecoratable(\"CodeEditor\", DecoratableCodeEditor);\n\nexport { CodeEditor, type CodeEditorProps };\n"],"names":["DecoratableCodeEditor","label","description","note","hint","required","disabled","validation","props","validationIsValid","validationMessage","invalid","useMemo","FormComponentLabel","FormComponentDescription","CodeEditorPrimitive","FormComponentErrorMessage","FormComponentNote","CodeEditor","makeDecoratable"],"mappings":";;;;AAcA,MAAMA,wBAAwB,CAAC,EAC3BC,KAAK,EACLC,WAAW,EACXC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,WAAW,KAAK,EAChBC,UAAU,EACV,GAAGC,OACW;IACd,MAAM,EAAE,SAASC,iBAAiB,EAAE,SAASC,iBAAiB,EAAE,GAAGH,cAAc,CAAC;IAClF,MAAMI,UAAUC,QAAQ,IAAMH,AAAsB,UAAtBA,mBAA6B;QAACA;KAAkB;IAE9E,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACI,oBAAkBA;QACf,MAAMZ;QACN,MAAMG;QACN,UAAUC;QACV,UAAUC;QACV,SAASK;sBAEb,oBAACG,0BAAwBA;QAAC,MAAMZ;QAAa,UAAUI;sBACvD,oBAACS,qBAAmBA;QAAE,GAAGP,KAAK;QAAE,UAAUF;sBAC1C,oBAACU,2BAAyBA;QACtB,MAAMN;QACN,SAASC;QACT,UAAUL;sBAEd,oBAACW,mBAAiBA;QAAC,MAAMd;QAAM,UAAUG;;AAGrD;AACA,MAAMY,aAAaC,gBAAgB,cAAcnB"}
1
+ {"version":3,"file":"CodeEditor/CodeEditor.js","sources":["../../src/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport type { CodeEditorPrimitiveProps } from \"./CodeEditorPrimitive.js\";\nimport { CodeEditorPrimitive } from \"./CodeEditorPrimitive.js\";\nimport type { FormComponentProps } from \"~/FormComponent/index.js\";\nimport {\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel,\n FormComponentNote\n} from \"~/FormComponent/index.js\";\n\ntype CodeEditorProps = CodeEditorPrimitiveProps & FormComponentProps;\n\nconst DecoratableCodeEditor = ({\n label,\n description,\n note,\n hint,\n required,\n disabled = false,\n validation,\n ...props\n}: CodeEditorProps) => {\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n const invalid = useMemo(() => validationIsValid === false, [validationIsValid]);\n\n return (\n <div className={\"w-full\"}>\n <FormComponentLabel\n text={label}\n hint={hint}\n required={required}\n disabled={disabled}\n invalid={invalid}\n />\n <FormComponentDescription text={description} disabled={disabled} />\n <CodeEditorPrimitive\n {...props}\n /* Monaco names its own textarea (`ariaLabel`); it can't point at the label element. */\n options={{\n ...(typeof label === \"string\" ? { ariaLabel: label } : {}),\n ...props.options\n }}\n disabled={disabled}\n />\n <FormComponentErrorMessage\n text={validationMessage}\n invalid={invalid}\n disabled={disabled}\n />\n <FormComponentNote text={note} disabled={disabled} />\n </div>\n );\n};\nconst CodeEditor = makeDecoratable(\"CodeEditor\", DecoratableCodeEditor);\n\nexport { CodeEditor, type CodeEditorProps };\n"],"names":["DecoratableCodeEditor","label","description","note","hint","required","disabled","validation","props","validationIsValid","validationMessage","invalid","useMemo","FormComponentLabel","FormComponentDescription","CodeEditorPrimitive","FormComponentErrorMessage","FormComponentNote","CodeEditor","makeDecoratable"],"mappings":";;;;AAcA,MAAMA,wBAAwB,CAAC,EAC3BC,KAAK,EACLC,WAAW,EACXC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,WAAW,KAAK,EAChBC,UAAU,EACV,GAAGC,OACW;IACd,MAAM,EAAE,SAASC,iBAAiB,EAAE,SAASC,iBAAiB,EAAE,GAAGH,cAAc,CAAC;IAClF,MAAMI,UAAUC,QAAQ,IAAMH,AAAsB,UAAtBA,mBAA6B;QAACA;KAAkB;IAE9E,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACI,oBAAkBA;QACf,MAAMZ;QACN,MAAMG;QACN,UAAUC;QACV,UAAUC;QACV,SAASK;sBAEb,oBAACG,0BAAwBA;QAAC,MAAMZ;QAAa,UAAUI;sBACvD,oBAACS,qBAAmBA;QACf,GAAGP,KAAK;QAET,SAAS;YACL,GAAI,AAAiB,YAAjB,OAAOP,QAAqB;gBAAE,WAAWA;YAAM,IAAI,CAAC,CAAC;YACzD,GAAGO,MAAM,OAAO;QACpB;QACA,UAAUF;sBAEd,oBAACU,2BAAyBA;QACtB,MAAMN;QACN,SAASC;QACT,UAAUL;sBAEd,oBAACW,mBAAiBA;QAAC,MAAMd;QAAM,UAAUG;;AAGrD;AACA,MAAMY,aAAaC,gBAAgB,cAAcnB"}
@@ -6,7 +6,9 @@ const monacoOptions = {
6
6
  readOnly: true,
7
7
  minimap: {
8
8
  enabled: false
9
- }
9
+ },
10
+ scrollBeyondLastLine: false,
11
+ wordWrap: "on"
10
12
  };
11
13
  const DecoratableCodeEditorPrimitive = ({ value, disabled, options: optionsInput, ...rest })=>{
12
14
  const options = useMemo(()=>({
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor/CodeEditorPrimitive.js","sources":["../../src/CodeEditor/CodeEditorPrimitive.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport type { EditorProps } from \"@monaco-editor/react\";\nimport MonacoEditor from \"@monaco-editor/react\";\nimport type { editor } from \"monaco-editor\";\nimport { makeDecoratable } from \"~/utils.js\";\n\ninterface CodeEditorPrimitiveProps extends Partial<EditorProps> {\n disabled?: boolean;\n}\n\nconst monacoOptions: editor.IEditorConstructionOptions = {\n domReadOnly: true,\n readOnly: true,\n minimap: {\n enabled: false\n }\n};\n\nconst DecoratableCodeEditorPrimitive = ({\n value,\n disabled,\n options: optionsInput,\n ...rest\n}: CodeEditorPrimitiveProps) => {\n const options = useMemo((): editor.IDiffEditorConstructionOptions => {\n return {\n ...monacoOptions,\n ...optionsInput,\n domReadOnly: disabled === undefined ? monacoOptions.domReadOnly : disabled,\n readOnly: disabled === undefined ? monacoOptions.readOnly : disabled\n };\n }, [disabled]);\n return (\n <MonacoEditor\n height={\"calc(100vh - 400px)\"}\n {...rest}\n language={rest.language ?? \"json\"}\n defaultValue={value}\n options={options}\n />\n );\n};\n\nconst CodeEditorPrimitive = makeDecoratable(\"CodeEditorPrimitive\", DecoratableCodeEditorPrimitive);\n\nexport { CodeEditorPrimitive, type CodeEditorPrimitiveProps };\n"],"names":["monacoOptions","DecoratableCodeEditorPrimitive","value","disabled","optionsInput","rest","options","useMemo","undefined","MonacoEditor","CodeEditorPrimitive","makeDecoratable"],"mappings":";;;AAUA,MAAMA,gBAAmD;IACrD,aAAa;IACb,UAAU;IACV,SAAS;QACL,SAAS;IACb;AACJ;AAEA,MAAMC,iCAAiC,CAAC,EACpCC,KAAK,EACLC,QAAQ,EACR,SAASC,YAAY,EACrB,GAAGC,MACoB;IACvB,MAAMC,UAAUC,QAAQ,IACb;YACH,GAAGP,aAAa;YAChB,GAAGI,YAAY;YACf,aAAaD,AAAaK,WAAbL,WAAyBH,cAAc,WAAW,GAAGG;YAClE,UAAUA,AAAaK,WAAbL,WAAyBH,cAAc,QAAQ,GAAGG;QAChE,IACD;QAACA;KAAS;IACb,OAAO,WAAP,GACI,oBAACM,sBAAYA;QACT,QAAQ;QACP,GAAGJ,IAAI;QACR,UAAUA,KAAK,QAAQ,IAAI;QAC3B,cAAcH;QACd,SAASI;;AAGrB;AAEA,MAAMI,sBAAsBC,gBAAgB,uBAAuBV"}
1
+ {"version":3,"file":"CodeEditor/CodeEditorPrimitive.js","sources":["../../src/CodeEditor/CodeEditorPrimitive.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport type { EditorProps } from \"@monaco-editor/react\";\nimport MonacoEditor from \"@monaco-editor/react\";\nimport type { editor } from \"monaco-editor\";\nimport { makeDecoratable } from \"~/utils.js\";\n\ninterface CodeEditorPrimitiveProps extends Partial<EditorProps> {\n disabled?: boolean;\n}\n\nconst monacoOptions: editor.IEditorConstructionOptions = {\n domReadOnly: true,\n readOnly: true,\n minimap: {\n enabled: false\n },\n scrollBeyondLastLine: false,\n wordWrap: \"on\"\n};\n\nconst DecoratableCodeEditorPrimitive = ({\n value,\n disabled,\n options: optionsInput,\n ...rest\n}: CodeEditorPrimitiveProps) => {\n const options = useMemo((): editor.IDiffEditorConstructionOptions => {\n return {\n ...monacoOptions,\n ...optionsInput,\n domReadOnly: disabled === undefined ? monacoOptions.domReadOnly : disabled,\n readOnly: disabled === undefined ? monacoOptions.readOnly : disabled\n };\n }, [disabled]);\n return (\n <MonacoEditor\n height={\"calc(100vh - 400px)\"}\n {...rest}\n language={rest.language ?? \"json\"}\n defaultValue={value}\n options={options}\n />\n );\n};\n\nconst CodeEditorPrimitive = makeDecoratable(\"CodeEditorPrimitive\", DecoratableCodeEditorPrimitive);\n\nexport { CodeEditorPrimitive, type CodeEditorPrimitiveProps };\n"],"names":["monacoOptions","DecoratableCodeEditorPrimitive","value","disabled","optionsInput","rest","options","useMemo","undefined","MonacoEditor","CodeEditorPrimitive","makeDecoratable"],"mappings":";;;AAUA,MAAMA,gBAAmD;IACrD,aAAa;IACb,UAAU;IACV,SAAS;QACL,SAAS;IACb;IACA,sBAAsB;IACtB,UAAU;AACd;AAEA,MAAMC,iCAAiC,CAAC,EACpCC,KAAK,EACLC,QAAQ,EACR,SAASC,YAAY,EACrB,GAAGC,MACoB;IACvB,MAAMC,UAAUC,QAAQ,IACb;YACH,GAAGP,aAAa;YAChB,GAAGI,YAAY;YACf,aAAaD,AAAaK,WAAbL,WAAyBH,cAAc,WAAW,GAAGG;YAClE,UAAUA,AAAaK,WAAbL,WAAyBH,cAAc,QAAQ,GAAGG;QAChE,IACD;QAACA;KAAS;IACb,OAAO,WAAP,GACI,oBAACM,sBAAYA;QACT,QAAQ;QACP,GAAGJ,IAAI;QACR,UAAUA,KAAK,QAAQ,IAAI;QAC3B,cAAcH;QACd,SAASI;;AAGrB;AAEA,MAAMI,sBAAsBC,gBAAgB,uBAAuBV"}
@@ -1,5 +1,5 @@
1
1
  import react, { useMemo } from "react";
2
- import { makeDecoratable } from "../utils.js";
2
+ import { generateId, makeDecoratable } from "../utils.js";
3
3
  import { ColorPickerPrimitive } from "./primitives/index.js";
4
4
  import { FormComponentDescription, FormComponentErrorMessage, FormComponentLabel, FormComponentNote } from "../FormComponent/index.js";
5
5
  const DecoratableIconPicker = ({ label, description, note, hint, required, disabled, validation, ...props })=>{
@@ -7,9 +7,11 @@ const DecoratableIconPicker = ({ label, description, note, hint, required, disab
7
7
  const invalid = useMemo(()=>false === validationIsValid, [
8
8
  validationIsValid
9
9
  ]);
10
+ const labelId = useMemo(()=>`${generateId()}-label`, []);
10
11
  return /*#__PURE__*/ react.createElement("div", {
11
12
  className: "w-full"
12
13
  }, /*#__PURE__*/ react.createElement(FormComponentLabel, {
14
+ labelId: labelId,
13
15
  text: label,
14
16
  hint: hint,
15
17
  required: required,
@@ -19,6 +21,7 @@ const DecoratableIconPicker = ({ label, description, note, hint, required, disab
19
21
  text: description,
20
22
  disabled: disabled
21
23
  }), /*#__PURE__*/ react.createElement(ColorPickerPrimitive, {
24
+ "aria-labelledby": labelId,
22
25
  ...props,
23
26
  disabled: disabled,
24
27
  invalid: invalid
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker/ColorPicker.js","sources":["../../src/ColorPicker/ColorPicker.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport type { ColorPickerPrimitiveProps } from \"./primitives/index.js\";\nimport { ColorPickerPrimitive } from \"./primitives/index.js\";\nimport type { FormComponentProps } from \"~/FormComponent/index.js\";\nimport {\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel,\n FormComponentNote\n} from \"~/FormComponent/index.js\";\n\ntype ColorPickerProps = ColorPickerPrimitiveProps & FormComponentProps;\n\nconst DecoratableIconPicker = ({\n label,\n description,\n note,\n hint,\n required,\n disabled,\n validation,\n ...props\n}: ColorPickerProps) => {\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n const invalid = useMemo(() => validationIsValid === false, [validationIsValid]);\n\n return (\n <div className={\"w-full\"}>\n <FormComponentLabel\n text={label}\n hint={hint}\n required={required}\n disabled={disabled}\n invalid={invalid}\n />\n <FormComponentDescription text={description} disabled={disabled} />\n <ColorPickerPrimitive {...props} disabled={disabled} invalid={invalid} />\n <FormComponentErrorMessage\n text={validationMessage}\n invalid={invalid}\n disabled={disabled}\n />\n <FormComponentNote text={note} disabled={disabled} />\n </div>\n );\n};\nconst ColorPicker = makeDecoratable(\"ColorPicker\", DecoratableIconPicker);\n\nexport { ColorPicker, type ColorPickerProps };\n"],"names":["DecoratableIconPicker","label","description","note","hint","required","disabled","validation","props","validationIsValid","validationMessage","invalid","useMemo","FormComponentLabel","FormComponentDescription","ColorPickerPrimitive","FormComponentErrorMessage","FormComponentNote","ColorPicker","makeDecoratable"],"mappings":";;;;AAcA,MAAMA,wBAAwB,CAAC,EAC3BC,KAAK,EACLC,WAAW,EACXC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACV,GAAGC,OACY;IACf,MAAM,EAAE,SAASC,iBAAiB,EAAE,SAASC,iBAAiB,EAAE,GAAGH,cAAc,CAAC;IAClF,MAAMI,UAAUC,QAAQ,IAAMH,AAAsB,UAAtBA,mBAA6B;QAACA;KAAkB;IAE9E,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACI,oBAAkBA;QACf,MAAMZ;QACN,MAAMG;QACN,UAAUC;QACV,UAAUC;QACV,SAASK;sBAEb,oBAACG,0BAAwBA;QAAC,MAAMZ;QAAa,UAAUI;sBACvD,oBAACS,sBAAoBA;QAAE,GAAGP,KAAK;QAAE,UAAUF;QAAU,SAASK;sBAC9D,oBAACK,2BAAyBA;QACtB,MAAMN;QACN,SAASC;QACT,UAAUL;sBAEd,oBAACW,mBAAiBA;QAAC,MAAMd;QAAM,UAAUG;;AAGrD;AACA,MAAMY,cAAcC,gBAAgB,eAAenB"}
1
+ {"version":3,"file":"ColorPicker/ColorPicker.js","sources":["../../src/ColorPicker/ColorPicker.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { makeDecoratable, generateId } from \"~/utils.js\";\nimport type { ColorPickerPrimitiveProps } from \"./primitives/index.js\";\nimport { ColorPickerPrimitive } from \"./primitives/index.js\";\nimport type { FormComponentProps } from \"~/FormComponent/index.js\";\nimport {\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel,\n FormComponentNote\n} from \"~/FormComponent/index.js\";\n\ntype ColorPickerProps = ColorPickerPrimitiveProps & FormComponentProps;\n\nconst DecoratableIconPicker = ({\n label,\n description,\n note,\n hint,\n required,\n disabled,\n validation,\n ...props\n}: ColorPickerProps) => {\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n const invalid = useMemo(() => validationIsValid === false, [validationIsValid]);\n /* The control can't be a `<label for>` target, so it names itself after the label. */\n const labelId = useMemo(() => `${generateId()}-label`, []);\n\n return (\n <div className={\"w-full\"}>\n <FormComponentLabel\n labelId={labelId}\n text={label}\n hint={hint}\n required={required}\n disabled={disabled}\n invalid={invalid}\n />\n <FormComponentDescription text={description} disabled={disabled} />\n <ColorPickerPrimitive\n aria-labelledby={labelId}\n {...props}\n disabled={disabled}\n invalid={invalid}\n />\n <FormComponentErrorMessage\n text={validationMessage}\n invalid={invalid}\n disabled={disabled}\n />\n <FormComponentNote text={note} disabled={disabled} />\n </div>\n );\n};\nconst ColorPicker = makeDecoratable(\"ColorPicker\", DecoratableIconPicker);\n\nexport { ColorPicker, type ColorPickerProps };\n"],"names":["DecoratableIconPicker","label","description","note","hint","required","disabled","validation","props","validationIsValid","validationMessage","invalid","useMemo","labelId","generateId","FormComponentLabel","FormComponentDescription","ColorPickerPrimitive","FormComponentErrorMessage","FormComponentNote","ColorPicker","makeDecoratable"],"mappings":";;;;AAcA,MAAMA,wBAAwB,CAAC,EAC3BC,KAAK,EACLC,WAAW,EACXC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACV,GAAGC,OACY;IACf,MAAM,EAAE,SAASC,iBAAiB,EAAE,SAASC,iBAAiB,EAAE,GAAGH,cAAc,CAAC;IAClF,MAAMI,UAAUC,QAAQ,IAAMH,AAAsB,UAAtBA,mBAA6B;QAACA;KAAkB;IAE9E,MAAMI,UAAUD,QAAQ,IAAM,GAAGE,aAAa,MAAM,CAAC,EAAE,EAAE;IAEzD,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACC,oBAAkBA;QACf,SAASF;QACT,MAAMZ;QACN,MAAMG;QACN,UAAUC;QACV,UAAUC;QACV,SAASK;sBAEb,oBAACK,0BAAwBA;QAAC,MAAMd;QAAa,UAAUI;sBACvD,oBAACW,sBAAoBA;QACjB,mBAAiBJ;QAChB,GAAGL,KAAK;QACT,UAAUF;QACV,SAASK;sBAEb,oBAACO,2BAAyBA;QACtB,MAAMR;QACN,SAASC;QACT,UAAUL;sBAEd,oBAACa,mBAAiBA;QAAC,MAAMhB;QAAM,UAAUG;;AAGrD;AACA,MAAMc,cAAcC,gBAAgB,eAAerB"}
@@ -43,7 +43,7 @@ interface ColorPickerPrimitiveProps extends Omit<React.HTMLAttributes<HTMLDivEle
43
43
  */
44
44
  invalid?: InputPrimitiveProps["invalid"];
45
45
  }
46
- declare const DecoratableColorPickerPrimitive: ({ align, disabled, invalid, size, variant, value, onOpenChange, onChange, onChangeComplete, ...props }: ColorPickerPrimitiveProps) => React.JSX.Element;
46
+ declare const DecoratableColorPickerPrimitive: ({ "aria-labelledby": labelledBy, align, disabled, invalid, size, variant, value, onOpenChange, onChange, onChangeComplete, ...props }: ColorPickerPrimitiveProps) => React.JSX.Element;
47
47
  declare const ColorPickerPrimitive: typeof DecoratableColorPickerPrimitive & {
48
48
  original: typeof DecoratableColorPickerPrimitive;
49
49
  originalName: string;
@@ -28,7 +28,7 @@ const colorPickerVariants = cva("cursor-pointer", {
28
28
  size: "lg"
29
29
  }
30
30
  });
31
- const DecoratableColorPickerPrimitive = ({ align, disabled, invalid, size, variant, value, onOpenChange, onChange, onChangeComplete, ...props })=>{
31
+ const DecoratableColorPickerPrimitive = ({ "aria-labelledby": labelledBy, align, disabled, invalid, size, variant, value, onOpenChange, onChange, onChangeComplete, ...props })=>{
32
32
  const { vm, setColor, commitColor, setOpen } = useColorPicker({
33
33
  value,
34
34
  onOpenChange,
@@ -41,6 +41,8 @@ const DecoratableColorPickerPrimitive = ({ align, disabled, invalid, size, varia
41
41
  }, /*#__PURE__*/ react.createElement(PopoverPrimitive.Trigger, {
42
42
  asChild: true
43
43
  }, /*#__PURE__*/ react.createElement("div", {
44
+ role: "button",
45
+ "aria-labelledby": labelledBy,
44
46
  "data-disabled": disabled,
45
47
  className: cn(inputVariants({
46
48
  size,
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker/primitives/ColorPickerPrimitive.js","sources":["../../../src/ColorPicker/primitives/ColorPickerPrimitive.tsx"],"sourcesContent":["import React from \"react\";\nimport { SketchPicker } from \"react-color\";\nimport { useColorPicker } from \"./useColorPicker.js\";\nimport { type InputPrimitiveProps, inputVariants } from \"~/Input/index.js\";\nimport { PopoverPrimitive, type PopoverPrimitiveContentProps } from \"~/Popover/index.js\";\nimport { cn, cva, makeDecoratable } from \"~/utils.js\";\n\nconst colorPickerVariants = cva(\"cursor-pointer\", {\n variants: {\n size: {\n md: [\"size-8\", \"p-[calc(var(--padding-xs-plus)-(var(--border-width-sm)))] \"],\n lg: [\"size-10\", \"p-[calc(var(--padding-sm-plus)-(var(--border-width-sm)))]\"],\n xl: [\"size-14\", \"p-[calc(var(--padding-md)-(var(--border-width-sm)))]\"]\n },\n disabled: {\n true: \"pointer-events-none\"\n }\n },\n defaultVariants: {\n size: \"lg\"\n }\n});\n\ninterface ColorPickerPrimitiveProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /**\n * Callback triggered when the open state changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Callback triggered when the value changes.\n */\n onChange?: (value: string) => void;\n /**\n * Callback triggered when the color selection is complete.\n * This is called after the user has finished selecting a color.\n */\n onChangeComplete?: (value: string) => void;\n /**\n * Optional selected value.\n */\n value?: string;\n /**\n * If true, the color picker will be disabled.\n */\n disabled?: boolean;\n /**\n * Popover alignment.\n */\n align?: PopoverPrimitiveContentProps[\"align\"];\n /**\n * Size of the input field.\n * Refer to `InputPrimitiveProps[\"size\"]` for possible values.\n */\n size?: InputPrimitiveProps[\"size\"];\n /**\n * Variant of the input field.\n * Refer to `InputPrimitiveProps[\"variant\"]` for possible values.\n */\n variant?: InputPrimitiveProps[\"variant\"];\n /**\n * Indicates if the input field is invalid.\n * Refer to `InputPrimitiveProps[\"invalid\"]` for possible values.\n */\n invalid?: InputPrimitiveProps[\"invalid\"];\n}\n\nconst DecoratableColorPickerPrimitive = ({\n align,\n disabled,\n invalid,\n size,\n variant,\n value,\n onOpenChange,\n onChange,\n onChangeComplete,\n ...props\n}: ColorPickerPrimitiveProps) => {\n const { vm, setColor, commitColor, setOpen } = useColorPicker({\n value,\n onOpenChange,\n onChange,\n onChangeComplete\n });\n\n return (\n <div {...props}>\n <PopoverPrimitive open={vm.open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>\n <div\n data-disabled={disabled}\n className={cn(\n inputVariants({\n size,\n variant,\n invalid\n }),\n colorPickerVariants({ size, disabled })\n )}\n >\n <div\n className={\"rounded-xs size-full\"}\n style={{ backgroundColor: vm.value }}\n />\n </div>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content align={align} onEscapeKeyDown={() => setOpen(false)}>\n <SketchPicker\n color={vm.value}\n onChange={setColor}\n onChangeComplete={commitColor}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive>\n </div>\n );\n};\n\nconst ColorPickerPrimitive = makeDecoratable(\n \"ColorPickerPrimitive\",\n DecoratableColorPickerPrimitive\n);\n\nexport { ColorPickerPrimitive, type ColorPickerPrimitiveProps };\n"],"names":["colorPickerVariants","cva","DecoratableColorPickerPrimitive","align","disabled","invalid","size","variant","value","onOpenChange","onChange","onChangeComplete","props","vm","setColor","commitColor","setOpen","useColorPicker","PopoverPrimitive","cn","inputVariants","SketchPicker","ColorPickerPrimitive","makeDecoratable"],"mappings":";;;;;;AAOA,MAAMA,sBAAsBC,IAAI,kBAAkB;IAC9C,UAAU;QACN,MAAM;YACF,IAAI;gBAAC;gBAAU;aAA6D;YAC5E,IAAI;gBAAC;gBAAW;aAA4D;YAC5E,IAAI;gBAAC;gBAAW;aAAuD;QAC3E;QACA,UAAU;YACN,MAAM;QACV;IACJ;IACA,iBAAiB;QACb,MAAM;IACV;AACJ;AA6CA,MAAMC,kCAAkC,CAAC,EACrCC,KAAK,EACLC,QAAQ,EACRC,OAAO,EACPC,IAAI,EACJC,OAAO,EACPC,KAAK,EACLC,YAAY,EACZC,QAAQ,EACRC,gBAAgB,EAChB,GAAGC,OACqB;IACxB,MAAM,EAAEC,EAAE,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,EAAE,GAAGC,eAAe;QAC1DT;QACAC;QACAC;QACAC;IACJ;IAEA,OAAO,WAAP,GACI,oBAAC,OAAQC,OAAAA,WAAAA,GACL,oBAACM,kBAAgBA;QAAC,MAAML,GAAG,IAAI;QAAE,cAAcG;qBAC3C,oBAACE,iBAAiB,OAAO;QAAC;qBACtB,oBAAC;QACG,iBAAed;QACf,WAAWe,GACPC,cAAc;YACVd;YACAC;YACAF;QACJ,IACAL,oBAAoB;YAAEM;YAAMF;QAAS;qBAGzC,oBAAC;QACG,WAAW;QACX,OAAO;YAAE,iBAAiBS,GAAG,KAAK;QAAC;wBAI/C,oBAACK,iBAAiB,OAAO;QAAC,OAAOf;QAAO,iBAAiB,IAAMa,QAAQ;qBACnE,oBAACK,cAAYA;QACT,OAAOR,GAAG,KAAK;QACf,UAAUC;QACV,kBAAkBC;;AAM1C;AAEA,MAAMO,uBAAuBC,gBACzB,wBACArB"}
1
+ {"version":3,"file":"ColorPicker/primitives/ColorPickerPrimitive.js","sources":["../../../src/ColorPicker/primitives/ColorPickerPrimitive.tsx"],"sourcesContent":["import React from \"react\";\nimport { SketchPicker } from \"react-color\";\nimport { useColorPicker } from \"./useColorPicker.js\";\nimport { type InputPrimitiveProps, inputVariants } from \"~/Input/index.js\";\nimport { PopoverPrimitive, type PopoverPrimitiveContentProps } from \"~/Popover/index.js\";\nimport { cn, cva, makeDecoratable } from \"~/utils.js\";\n\nconst colorPickerVariants = cva(\"cursor-pointer\", {\n variants: {\n size: {\n md: [\"size-8\", \"p-[calc(var(--padding-xs-plus)-(var(--border-width-sm)))] \"],\n lg: [\"size-10\", \"p-[calc(var(--padding-sm-plus)-(var(--border-width-sm)))]\"],\n xl: [\"size-14\", \"p-[calc(var(--padding-md)-(var(--border-width-sm)))]\"]\n },\n disabled: {\n true: \"pointer-events-none\"\n }\n },\n defaultVariants: {\n size: \"lg\"\n }\n});\n\ninterface ColorPickerPrimitiveProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /**\n * Callback triggered when the open state changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Callback triggered when the value changes.\n */\n onChange?: (value: string) => void;\n /**\n * Callback triggered when the color selection is complete.\n * This is called after the user has finished selecting a color.\n */\n onChangeComplete?: (value: string) => void;\n /**\n * Optional selected value.\n */\n value?: string;\n /**\n * If true, the color picker will be disabled.\n */\n disabled?: boolean;\n /**\n * Popover alignment.\n */\n align?: PopoverPrimitiveContentProps[\"align\"];\n /**\n * Size of the input field.\n * Refer to `InputPrimitiveProps[\"size\"]` for possible values.\n */\n size?: InputPrimitiveProps[\"size\"];\n /**\n * Variant of the input field.\n * Refer to `InputPrimitiveProps[\"variant\"]` for possible values.\n */\n variant?: InputPrimitiveProps[\"variant\"];\n /**\n * Indicates if the input field is invalid.\n * Refer to `InputPrimitiveProps[\"invalid\"]` for possible values.\n */\n invalid?: InputPrimitiveProps[\"invalid\"];\n}\n\nconst DecoratableColorPickerPrimitive = ({\n \"aria-labelledby\": labelledBy,\n align,\n disabled,\n invalid,\n size,\n variant,\n value,\n onOpenChange,\n onChange,\n onChangeComplete,\n ...props\n}: ColorPickerPrimitiveProps) => {\n const { vm, setColor, commitColor, setOpen } = useColorPicker({\n value,\n onOpenChange,\n onChange,\n onChangeComplete\n });\n\n return (\n <div {...props}>\n <PopoverPrimitive open={vm.open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>\n {/* Named by the field's label — the swatch is the control, not the wrapper. */}\n <div\n role={\"button\"}\n aria-labelledby={labelledBy}\n data-disabled={disabled}\n className={cn(\n inputVariants({\n size,\n variant,\n invalid\n }),\n colorPickerVariants({ size, disabled })\n )}\n >\n <div\n className={\"rounded-xs size-full\"}\n style={{ backgroundColor: vm.value }}\n />\n </div>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content align={align} onEscapeKeyDown={() => setOpen(false)}>\n <SketchPicker\n color={vm.value}\n onChange={setColor}\n onChangeComplete={commitColor}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive>\n </div>\n );\n};\n\nconst ColorPickerPrimitive = makeDecoratable(\n \"ColorPickerPrimitive\",\n DecoratableColorPickerPrimitive\n);\n\nexport { ColorPickerPrimitive, type ColorPickerPrimitiveProps };\n"],"names":["colorPickerVariants","cva","DecoratableColorPickerPrimitive","labelledBy","align","disabled","invalid","size","variant","value","onOpenChange","onChange","onChangeComplete","props","vm","setColor","commitColor","setOpen","useColorPicker","PopoverPrimitive","cn","inputVariants","SketchPicker","ColorPickerPrimitive","makeDecoratable"],"mappings":";;;;;;AAOA,MAAMA,sBAAsBC,IAAI,kBAAkB;IAC9C,UAAU;QACN,MAAM;YACF,IAAI;gBAAC;gBAAU;aAA6D;YAC5E,IAAI;gBAAC;gBAAW;aAA4D;YAC5E,IAAI;gBAAC;gBAAW;aAAuD;QAC3E;QACA,UAAU;YACN,MAAM;QACV;IACJ;IACA,iBAAiB;QACb,MAAM;IACV;AACJ;AA6CA,MAAMC,kCAAkC,CAAC,EACrC,mBAAmBC,UAAU,EAC7BC,KAAK,EACLC,QAAQ,EACRC,OAAO,EACPC,IAAI,EACJC,OAAO,EACPC,KAAK,EACLC,YAAY,EACZC,QAAQ,EACRC,gBAAgB,EAChB,GAAGC,OACqB;IACxB,MAAM,EAAEC,EAAE,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,EAAE,GAAGC,eAAe;QAC1DT;QACAC;QACAC;QACAC;IACJ;IAEA,OAAO,WAAP,GACI,oBAAC,OAAQC,OAAAA,WAAAA,GACL,oBAACM,kBAAgBA;QAAC,MAAML,GAAG,IAAI;QAAE,cAAcG;qBAC3C,oBAACE,iBAAiB,OAAO;QAAC;qBAEtB,oBAAC;QACG,MAAM;QACN,mBAAiBhB;QACjB,iBAAeE;QACf,WAAWe,GACPC,cAAc;YACVd;YACAC;YACAF;QACJ,IACAN,oBAAoB;YAAEO;YAAMF;QAAS;qBAGzC,oBAAC;QACG,WAAW;QACX,OAAO;YAAE,iBAAiBS,GAAG,KAAK;QAAC;wBAI/C,oBAACK,iBAAiB,OAAO;QAAC,OAAOf;QAAO,iBAAiB,IAAMa,QAAQ;qBACnE,oBAACK,cAAYA;QACT,OAAOR,GAAG,KAAK;QACf,UAAUC;QACV,kBAAkBC;;AAM1C;AAEA,MAAMO,uBAAuBC,gBACzB,wBACAtB"}
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
2
  import { Command as CommandPrimitive } from "cmdk";
3
3
  type ListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>;
4
- declare const List: ({ className, ...props }: ListProps) => React.JSX.Element;
4
+ declare const List: ({ className, style, onScroll, ...props }: ListProps) => React.JSX.Element;
5
5
  export { List, type ListProps };
@@ -1,12 +1,16 @@
1
1
  import { Command } from "cmdk";
2
2
  import { cn } from "../../utils.js";
3
+ import { ScrollArea } from "../../ScrollArea/index.js";
3
4
  import * as __rspack_external_react from "react";
4
- const List = ({ className, ...props })=>/*#__PURE__*/ __rspack_external_react.createElement(Command.List, {
5
- className: cn([
6
- "block max-h-96 w-full py-sm overflow-y-auto overflow-x-hidden bg-neutral-base text-neutral-strong"
7
- ], className),
5
+ const List = ({ className, style, onScroll, ...props })=>/*#__PURE__*/ __rspack_external_react.createElement(ScrollArea, {
6
+ className: cn("w-full bg-neutral-base", className),
7
+ style: style,
8
+ viewportClassName: "max-h-96 overflow-x-hidden",
9
+ onViewportScroll: onScroll
10
+ }, /*#__PURE__*/ __rspack_external_react.createElement(Command.List, {
11
+ className: "block w-full py-sm text-neutral-strong",
8
12
  ...props
9
- });
13
+ }));
10
14
  export { List };
11
15
 
12
16
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Command/components/List.js","sources":["../../../src/Command/components/List.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { cn } from \"~/utils.js\";\n\ntype ListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>;\n\nconst List = ({ className, ...props }: ListProps) => {\n return (\n <CommandPrimitive.List\n className={cn(\n [\n \"block max-h-96 w-full py-sm overflow-y-auto overflow-x-hidden bg-neutral-base text-neutral-strong\"\n ],\n className\n )}\n {...props}\n />\n );\n};\n\nexport { List, type ListProps };\n"],"names":["List","className","props","CommandPrimitive","cn"],"mappings":";;;AAMA,MAAMA,OAAO,CAAC,EAAEC,SAAS,EAAE,GAAGC,OAAkB,GACrC,WAAP,GACI,sCAACC,QAAAA,IAAqB;QAClB,WAAWC,GACP;YACI;SACH,EACDH;QAEH,GAAGC,KAAK"}
1
+ {"version":3,"file":"Command/components/List.js","sources":["../../../src/Command/components/List.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { cn } from \"~/utils.js\";\nimport { ScrollArea } from \"~/ScrollArea/index.js\";\n\ntype ListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>;\n\nconst List = ({ className, style, onScroll, ...props }: ListProps) => {\n /*\n * The list scrolls inside a `ScrollArea`, whose scrollbar is an element rather than the\n * operating system's own, so it can keep focus on the input while it is dragged. Layout and\n * scroll props go to the scroll area, since that is the element that scrolls now.\n */\n return (\n <ScrollArea\n className={cn(\"w-full bg-neutral-base\", className)}\n style={style}\n viewportClassName={\"max-h-96 overflow-x-hidden\"}\n onViewportScroll={onScroll}\n >\n <CommandPrimitive.List\n className={\"block w-full py-sm text-neutral-strong\"}\n {...props}\n />\n </ScrollArea>\n );\n};\n\nexport { List, type ListProps };\n"],"names":["List","className","style","onScroll","props","ScrollArea","cn","CommandPrimitive"],"mappings":";;;;AAOA,MAAMA,OAAO,CAAC,EAAEC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGC,OAAkB,GAMtD,WAAP,GACI,sCAACC,YAAUA;QACP,WAAWC,GAAG,0BAA0BL;QACxC,OAAOC;QACP,mBAAmB;QACnB,kBAAkBC;qBAElB,sCAACI,QAAAA,IAAqB;QAClB,WAAW;QACV,GAAGH,KAAK"}
@@ -1,5 +1,17 @@
1
1
  import React from "react";
2
- import type { ColumnSort, OnChangeFn, Row, SortingState, VisibilityState } from "@tanstack/react-table";
2
+ import type { ColumnSort, ColumnVisibilityState, ExpandedState, OnChangeFn, Row, RowData, SortingState } from "@tanstack/react-table";
3
+ declare const features: {
4
+ columnResizingFeature: import("@tanstack/table-core").TableFeature;
5
+ columnSizingFeature: import("@tanstack/table-core").TableFeature;
6
+ columnVisibilityFeature: import("@tanstack/table-core").TableFeature;
7
+ rowExpandingFeature: import("@tanstack/table-core").TableFeature;
8
+ rowSelectionFeature: import("@tanstack/table-core").TableFeature;
9
+ rowSortingFeature: import("@tanstack/table-core").TableFeature;
10
+ expandedRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
11
+ sortedRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
12
+ coreRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
13
+ };
14
+ type Features = typeof features;
3
15
  interface DataTableColumn<T> {
4
16
  header?: string | number | React.JSX.Element;
5
17
  cell?: (row: T) => string | number | React.JSX.Element | null;
@@ -18,13 +30,18 @@ type DataTableDefaultData = {
18
30
  id: string;
19
31
  $selectable?: boolean;
20
32
  };
21
- type DataTableRow<T> = Row<DataTableDefaultData & T>;
33
+ type DataTableRow<T extends RowData> = Row<Features, DataTableDefaultData & T>;
22
34
  type DataTableSorting = SortingState;
23
35
  type DataTableColumnSort = ColumnSort;
24
36
  type OnDataTableSortingChange = OnChangeFn<DataTableSorting>;
25
- type DataTableColumnVisibility = VisibilityState;
37
+ type DataTableColumnVisibility = ColumnVisibilityState;
26
38
  type OnDataTableColumnVisibilityChange = OnChangeFn<DataTableColumnVisibility>;
27
- interface DataTableProps<TEntry> {
39
+ /**
40
+ * Which rows show their sub-rows: `true` for every row, or a map of row ids (the `id` of each entry).
41
+ */
42
+ type DataTableExpanded = ExpandedState;
43
+ type OnDataTableExpandedChange = OnChangeFn<DataTableExpanded>;
44
+ interface DataTableProps<TEntry extends RowData> {
28
45
  /**
29
46
  * Show or hide borders.
30
47
  */
@@ -49,10 +66,28 @@ interface DataTableProps<TEntry> {
49
66
  * Data to display into DataTable body.
50
67
  */
51
68
  data: TEntry[];
69
+ /**
70
+ * Returns the sub-rows listed under a row, e.g. the versions of an entry. A row with sub-rows
71
+ * gets a toggle in its first column that shows and hides them. Each entry, sub-rows included,
72
+ * must have a unique `id`.
73
+ */
74
+ getSubRows?: (row: TEntry) => TEntry[] | undefined;
75
+ /**
76
+ * Which rows show their sub-rows. Leave it out to let the DataTable keep track of it.
77
+ */
78
+ expanded?: DataTableExpanded;
79
+ /**
80
+ * Callback that receives the expanded state when a row's toggle is clicked.
81
+ */
82
+ onExpandedChange?: OnDataTableExpandedChange;
83
+ /**
84
+ * Which rows show their sub-rows at first, when `expanded` isn't passed. Defaults to none.
85
+ */
86
+ initialExpanded?: DataTableExpanded;
52
87
  /**
53
88
  * Callback that is called to determine if the row is selectable.
54
89
  */
55
- isRowSelectable?: (row: Row<TEntry>) => boolean;
90
+ isRowSelectable?: (row: Row<Features, TEntry>) => boolean;
56
91
  /**
57
92
  * Render the skeleton state while data are loading.
58
93
  */
@@ -86,7 +121,7 @@ interface DataTableProps<TEntry> {
86
121
  */
87
122
  stickyHeader?: boolean;
88
123
  }
89
- declare const DecoratableDataTable: <T extends Record<string, any> & DataTableDefaultData>({ bordered, canSelectAllRows, columnVisibility, columns: initialColumns, data: initialData, initialSorting, isRowSelectable, loading, onColumnVisibilityChange, onSelectRow, onSortingChange, onToggleRow, selectedRows, sorting, stickyHeader }: DataTableProps<T>) => React.JSX.Element;
124
+ declare const DecoratableDataTable: <T extends Record<string, any> & DataTableDefaultData>({ bordered, canSelectAllRows, columnVisibility, columns: initialColumns, data: initialData, expanded, getSubRows: initialGetSubRows, initialExpanded, initialSorting, isRowSelectable, loading, onColumnVisibilityChange, onExpandedChange, onSelectRow, onSortingChange, onToggleRow, selectedRows, sorting, stickyHeader }: DataTableProps<T>) => React.JSX.Element;
90
125
  declare const DataTable: typeof DecoratableDataTable & {
91
126
  original: typeof DecoratableDataTable;
92
127
  originalName: string;
@@ -106,4 +141,4 @@ declare const DataTable: typeof DecoratableDataTable & {
106
141
  displayName: string;
107
142
  }>) => (props: unknown) => React.JSX.Element;
108
143
  };
109
- export { DataTable, type DataTableProps, type DataTableColumn, type DataTableColumns, type DataTableDefaultData, type DataTableRow, type DataTableSorting, type DataTableColumnSort, type OnDataTableSortingChange, type DataTableColumnVisibility, type OnDataTableColumnVisibilityChange };
144
+ export { DataTable, type Features, type DataTableProps, type DataTableColumn, type DataTableColumns, type DataTableDefaultData, type DataTableRow, type DataTableSorting, type DataTableColumnSort, type OnDataTableSortingChange, type DataTableColumnVisibility, type OnDataTableColumnVisibilityChange, type DataTableExpanded, type OnDataTableExpandedChange };