@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
package/Kbd/Kbd.js ADDED
@@ -0,0 +1,34 @@
1
+ import { cn, cva, makeDecoratable } from "../utils.js";
2
+ import * as __rspack_external_react from "react";
3
+ const kbdKeyVariants = cva([
4
+ "inline-flex h-md-plus min-w-md-plus shrink-0 items-center justify-center rounded-sm border-sm px-xs",
5
+ "font-sans text-sm font-normal text-neutral-strong"
6
+ ], {
7
+ variants: {
8
+ variant: {
9
+ outline: "border-neutral-muted bg-neutral-base",
10
+ light: "border-transparent bg-neutral-light"
11
+ }
12
+ },
13
+ defaultVariants: {
14
+ variant: "outline"
15
+ }
16
+ });
17
+ const toKeys = (keys)=>{
18
+ if (Array.isArray(keys)) return keys;
19
+ return keys.split(" ").filter(Boolean);
20
+ };
21
+ const KbdBase = ({ keys, label, variant, className, ...props })=>/*#__PURE__*/ __rspack_external_react.createElement("kbd", {
22
+ "aria-label": label,
23
+ className: cn("inline-flex shrink-0 items-center gap-xxs align-middle", className),
24
+ ...props
25
+ }, toKeys(keys).map((key, index)=>/*#__PURE__*/ __rspack_external_react.createElement("kbd", {
26
+ key: index,
27
+ className: kbdKeyVariants({
28
+ variant
29
+ })
30
+ }, key)));
31
+ const Kbd = makeDecoratable("Kbd", KbdBase);
32
+ export { Kbd };
33
+
34
+ //# sourceMappingURL=Kbd.js.map
package/Kbd/Kbd.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Kbd/Kbd.js","sources":["../../src/Kbd/Kbd.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\nconst kbdKeyVariants = cva(\n [\n \"inline-flex h-md-plus min-w-md-plus shrink-0 items-center justify-center rounded-sm border-sm px-xs\",\n \"font-sans text-sm font-normal text-neutral-strong\"\n ],\n {\n variants: {\n variant: {\n // For white and subtle surfaces: lists, footers, menus.\n outline: \"border-neutral-muted bg-neutral-base\",\n // For inside an input, where an outline would read as a second field.\n light: \"border-transparent bg-neutral-light\"\n }\n },\n defaultVariants: {\n variant: \"outline\"\n }\n }\n);\n\ninterface KbdProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, \"children\">,\n VariantProps<typeof kbdKeyVariants> {\n /**\n * The keys of one shortcut, one cap each: `[\"⌘\", \"K\"]`, or a space-separated string, `\"⌘ K\"`.\n */\n keys: string | string[];\n /** The accessible name of the whole shortcut, e.g. \"Command K\". */\n label?: string;\n}\n\nconst toKeys = (keys: string | string[]): string[] => {\n if (Array.isArray(keys)) {\n return keys;\n }\n return keys.split(\" \").filter(Boolean);\n};\n\n/** A keyboard shortcut as key caps. A hint, never a button. */\nconst KbdBase = ({ keys, label, variant, className, ...props }: KbdProps) => (\n <kbd\n aria-label={label}\n className={cn(\"inline-flex shrink-0 items-center gap-xxs align-middle\", className)}\n {...props}\n >\n {toKeys(keys).map((key, index) => (\n <kbd key={index} className={kbdKeyVariants({ variant })}>\n {key}\n </kbd>\n ))}\n </kbd>\n);\n\nconst Kbd = makeDecoratable(\"Kbd\", KbdBase);\n\nexport { Kbd, type KbdProps };\n"],"names":["kbdKeyVariants","cva","toKeys","keys","Array","Boolean","KbdBase","label","variant","className","props","cn","key","index","Kbd","makeDecoratable"],"mappings":";;AAMA,MAAMA,iBAAiBC,IACnB;IACI;IACA;CACH,EACD;IACI,UAAU;QACN,SAAS;YAEL,SAAS;YAET,OAAO;QACX;IACJ;IACA,iBAAiB;QACb,SAAS;IACb;AACJ;AAeJ,MAAMC,SAAS,CAACC;IACZ,IAAIC,MAAM,OAAO,CAACD,OACd,OAAOA;IAEX,OAAOA,KAAK,KAAK,CAAC,KAAK,MAAM,CAACE;AAClC;AAGA,MAAMC,UAAU,CAAC,EAAEH,IAAI,EAAEI,KAAK,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGC,OAAiB,iBACpE,sCAAC;QACG,cAAYH;QACZ,WAAWI,GAAG,0DAA0DF;QACvE,GAAGC,KAAK;OAERR,OAAOC,MAAM,GAAG,CAAC,CAACS,KAAKC,QAAAA,WAAAA,GACpB,sCAAC;YAAI,KAAKA;YAAO,WAAWb,eAAe;gBAAEQ;YAAQ;WAChDI;AAMjB,MAAME,MAAMC,gBAAgB,OAAOT"}
package/Kbd/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./Kbd.js";
package/Kbd/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./Kbd.js";
package/Link/Link.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { type VariantProps } from "../utils.js";
3
3
  import { LinkComponentProps } from "./LinkComponent.js";
4
- declare const linkVariants: (props?: ({
4
+ export declare const linkVariants: (props?: ({
5
5
  size?: "inherit" | "lg" | "md" | "sm" | "xl" | null | undefined;
6
6
  variant?: "primary" | "primary-negative" | "secondary" | "secondary-negative" | null | undefined;
7
7
  underline?: boolean | null | undefined;
package/Link/Link.js CHANGED
@@ -51,6 +51,6 @@ function LinkBase({ size, variant, underline, className, children, ...rest }) {
51
51
  }, children);
52
52
  }
53
53
  const Link = makeDecoratable("Link", LinkBase);
54
- export { Link };
54
+ export { Link, linkVariants };
55
55
 
56
56
  //# sourceMappingURL=Link.js.map
package/Link/Link.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Link/Link.js","sources":["../../src/Link/Link.tsx"],"sourcesContent":["import React from \"react\";\nimport { cva, type VariantProps, makeDecoratable, cn } from \"~/utils.js\";\nimport { useAdminUi } from \"~/index.js\";\nimport { LinkComponentProps } from \"./LinkComponent.js\";\n\nconst linkVariants = cva(\"font-sans rounded-xs\", {\n variants: {\n size: {\n inherit: \"[font-size:inherit]\",\n sm: \"text-sm\",\n md: \"text-md\",\n lg: \"text-lg\",\n xl: \"text-xl\"\n },\n variant: {\n primary: [\n \"text-accent-primary\",\n \"focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-primary-dimmed\"\n ],\n secondary: [\n \"text-neutral-primary\",\n \"focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-primary-dimmed\"\n ],\n \"primary-negative\": [\n \"text-accent-primary\",\n \"focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-primary-strong\"\n ],\n \"secondary-negative\": [\n \"text-neutral-light\",\n \"focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-primary-strong\"\n ]\n },\n underline: {\n true: \"underline hover:no-underline\",\n false: \"hover:underline\"\n }\n },\n defaultVariants: {\n size: \"inherit\",\n variant: \"primary\",\n underline: false\n }\n});\n\nexport type LinkProps = LinkComponentProps &\n VariantProps<typeof linkVariants> & {\n disabled?: boolean;\n };\n\nfunction LinkBase({ size, variant, underline, className, children, ...rest }: LinkProps) {\n const { linkComponent: LinkComponent } = useAdminUi();\n return (\n <LinkComponent\n {...rest}\n className={cn(linkVariants({ size, variant, underline }), className)}\n >\n {children}\n </LinkComponent>\n );\n}\n\nexport const Link = makeDecoratable(\"Link\", LinkBase);\n"],"names":["linkVariants","cva","LinkBase","size","variant","underline","className","children","rest","LinkComponent","useAdminUi","cn","Link","makeDecoratable"],"mappings":";;;AAKA,MAAMA,eAAeC,IAAI,wBAAwB;IAC7C,UAAU;QACN,MAAM;YACF,SAAS;YACT,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;QACR;QACA,SAAS;YACL,SAAS;gBACL;gBACA;aACH;YACD,WAAW;gBACP;gBACA;aACH;YACD,oBAAoB;gBAChB;gBACA;aACH;YACD,sBAAsB;gBAClB;gBACA;aACH;QACL;QACA,WAAW;YACP,MAAM;YACN,OAAO;QACX;IACJ;IACA,iBAAiB;QACb,MAAM;QACN,SAAS;QACT,WAAW;IACf;AACJ;AAOA,SAASC,SAAS,EAAEC,IAAI,EAAEC,OAAO,EAAEC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,MAAiB;IACnF,MAAM,EAAE,eAAeC,aAAa,EAAE,GAAGC;IACzC,OAAO,WAAP,GACI,oBAACD,eAAAA;QACI,GAAGD,IAAI;QACR,WAAWG,GAAGX,aAAa;YAAEG;YAAMC;YAASC;QAAU,IAAIC;OAEzDC;AAGb;AAEO,MAAMK,OAAOC,gBAAgB,QAAQX"}
1
+ {"version":3,"file":"Link/Link.js","sources":["../../src/Link/Link.tsx"],"sourcesContent":["import React from \"react\";\nimport { cva, type VariantProps, makeDecoratable, cn } from \"~/utils.js\";\nimport { useAdminUi } from \"~/index.js\";\nimport { LinkComponentProps } from \"./LinkComponent.js\";\n\nexport const linkVariants = cva(\"font-sans rounded-xs\", {\n variants: {\n size: {\n inherit: \"[font-size:inherit]\",\n sm: \"text-sm\",\n md: \"text-md\",\n lg: \"text-lg\",\n xl: \"text-xl\"\n },\n variant: {\n primary: [\n \"text-accent-primary\",\n \"focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-primary-dimmed\"\n ],\n secondary: [\n \"text-neutral-primary\",\n \"focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-primary-dimmed\"\n ],\n \"primary-negative\": [\n \"text-accent-primary\",\n \"focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-primary-strong\"\n ],\n \"secondary-negative\": [\n \"text-neutral-light\",\n \"focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-primary-strong\"\n ]\n },\n underline: {\n true: \"underline hover:no-underline\",\n false: \"hover:underline\"\n }\n },\n defaultVariants: {\n size: \"inherit\",\n variant: \"primary\",\n underline: false\n }\n});\n\nexport type LinkProps = LinkComponentProps &\n VariantProps<typeof linkVariants> & {\n disabled?: boolean;\n };\n\nfunction LinkBase({ size, variant, underline, className, children, ...rest }: LinkProps) {\n const { linkComponent: LinkComponent } = useAdminUi();\n return (\n <LinkComponent\n {...rest}\n className={cn(linkVariants({ size, variant, underline }), className)}\n >\n {children}\n </LinkComponent>\n );\n}\n\nexport const Link = makeDecoratable(\"Link\", LinkBase);\n"],"names":["linkVariants","cva","LinkBase","size","variant","underline","className","children","rest","LinkComponent","useAdminUi","cn","Link","makeDecoratable"],"mappings":";;;AAKO,MAAMA,eAAeC,IAAI,wBAAwB;IACpD,UAAU;QACN,MAAM;YACF,SAAS;YACT,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;QACR;QACA,SAAS;YACL,SAAS;gBACL;gBACA;aACH;YACD,WAAW;gBACP;gBACA;aACH;YACD,oBAAoB;gBAChB;gBACA;aACH;YACD,sBAAsB;gBAClB;gBACA;aACH;QACL;QACA,WAAW;YACP,MAAM;YACN,OAAO;QACX;IACJ;IACA,iBAAiB;QACb,MAAM;QACN,SAAS;QACT,WAAW;IACf;AACJ;AAOA,SAASC,SAAS,EAAEC,IAAI,EAAEC,OAAO,EAAEC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,MAAiB;IACnF,MAAM,EAAE,eAAeC,aAAa,EAAE,GAAGC;IACzC,OAAO,WAAP,GACI,oBAACD,eAAAA;QACI,GAAGD,IAAI;QACR,WAAWG,GAAGX,aAAa;YAAEG;YAAMC;YAASC;QAAU,IAAIC;OAEzDC;AAGb;AAEO,MAAMK,OAAOC,gBAAgB,QAAQX"}
@@ -0,0 +1,47 @@
1
+ import React from "react";
2
+ import { type TextProps } from "../Text/index.js";
3
+ /**
4
+ * Styling for compiled markdown BLOCKS.
5
+ *
6
+ * Tailwind's preflight strips list markers and paragraph margins, and the markdown compiler emits
7
+ * bare elements, so without this a list renders as unindented run-on text and a fenced code block as
8
+ * plain prose. Child selectors rather than a global stylesheet, so this reaches only markdown that
9
+ * was asked to be styled.
10
+ *
11
+ * Exported for a caller that needs the classes without this component, e.g. one already rendering
12
+ * compiled markdown inside its own element.
13
+ */
14
+ export declare const markdownBlockClasses: string;
15
+ export interface MarkdownProps extends Pick<TextProps, "size" | "className"> {
16
+ children: React.ReactNode;
17
+ }
18
+ /**
19
+ * Renders markdown that contains block content: paragraphs, lists, fenced code.
20
+ *
21
+ * `Alert`, `Label` and the form-field descriptions call `compileMarkdown` directly and need none of
22
+ * this, because they render a sentence with a bold word or a link. Reach for this component when the
23
+ * source is long-form and its structure has to survive.
24
+ *
25
+ * Renders a `div`, since `Text` is a span by default and block markdown nested in one is invalid.
26
+ */
27
+ declare const MarkdownBase: ({ children, size, className }: MarkdownProps) => React.JSX.Element;
28
+ declare const Markdown: typeof MarkdownBase & {
29
+ original: typeof MarkdownBase;
30
+ originalName: string;
31
+ displayName: string;
32
+ } & {
33
+ original: typeof MarkdownBase & {
34
+ original: typeof MarkdownBase;
35
+ originalName: string;
36
+ displayName: string;
37
+ };
38
+ originalName: string;
39
+ displayName: string;
40
+ } & {
41
+ createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof MarkdownBase & {
42
+ original: typeof MarkdownBase;
43
+ originalName: string;
44
+ displayName: string;
45
+ }>) => (props: unknown) => React.JSX.Element;
46
+ };
47
+ export { Markdown };
@@ -0,0 +1,17 @@
1
+ import react from "react";
2
+ import { cn, makeDecoratable } from "../utils.js";
3
+ import { Text } from "../Text/index.js";
4
+ import { useAdminUi } from "../AdminUiProvider/index.js";
5
+ const markdownBlockClasses = "[&_p]:mb-xs [&_p:last-child]:mb-0 [&_ul]:mb-xs [&_ul]:list-disc [&_ul]:pl-lg [&_ol]:mb-xs [&_ol]:list-decimal [&_ol]:pl-lg [&_li]:mt-xxs [&_strong]:font-semibold [&_a]:underline [&_code]:rounded [&_code]:bg-neutral-subtle [&_code]:px-xs [&_code]:font-mono [&_pre]:mb-xs [&_pre]:overflow-x-auto [&_pre]:rounded [&_pre]:bg-neutral-subtle [&_pre]:p-sm";
6
+ const MarkdownBase = ({ children, size = "sm", className })=>{
7
+ const { compileMarkdown } = useAdminUi();
8
+ return /*#__PURE__*/ react.createElement(Text, {
9
+ as: "div",
10
+ size: size,
11
+ className: cn(markdownBlockClasses, className)
12
+ }, compileMarkdown(children));
13
+ };
14
+ const Markdown = makeDecoratable("Markdown", MarkdownBase);
15
+ export { Markdown, markdownBlockClasses };
16
+
17
+ //# sourceMappingURL=Markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Markdown/Markdown.js","sources":["../../src/Markdown/Markdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\nimport { Text, type TextProps } from \"~/Text/index.js\";\nimport { useAdminUi } from \"~/AdminUiProvider/index.js\";\n\n/**\n * Styling for compiled markdown BLOCKS.\n *\n * Tailwind's preflight strips list markers and paragraph margins, and the markdown compiler emits\n * bare elements, so without this a list renders as unindented run-on text and a fenced code block as\n * plain prose. Child selectors rather than a global stylesheet, so this reaches only markdown that\n * was asked to be styled.\n *\n * Exported for a caller that needs the classes without this component, e.g. one already rendering\n * compiled markdown inside its own element.\n */\nexport const markdownBlockClasses = [\n \"[&_p]:mb-xs [&_p:last-child]:mb-0\",\n \"[&_ul]:mb-xs [&_ul]:list-disc [&_ul]:pl-lg\",\n \"[&_ol]:mb-xs [&_ol]:list-decimal [&_ol]:pl-lg\",\n \"[&_li]:mt-xxs\",\n \"[&_strong]:font-semibold\",\n \"[&_a]:underline\",\n \"[&_code]:rounded [&_code]:bg-neutral-subtle [&_code]:px-xs [&_code]:font-mono\",\n \"[&_pre]:mb-xs [&_pre]:overflow-x-auto [&_pre]:rounded [&_pre]:bg-neutral-subtle [&_pre]:p-sm\"\n].join(\" \");\n\nexport interface MarkdownProps extends Pick<TextProps, \"size\" | \"className\"> {\n children: React.ReactNode;\n}\n\n/**\n * Renders markdown that contains block content: paragraphs, lists, fenced code.\n *\n * `Alert`, `Label` and the form-field descriptions call `compileMarkdown` directly and need none of\n * this, because they render a sentence with a bold word or a link. Reach for this component when the\n * source is long-form and its structure has to survive.\n *\n * Renders a `div`, since `Text` is a span by default and block markdown nested in one is invalid.\n */\nconst MarkdownBase = ({ children, size = \"sm\", className }: MarkdownProps) => {\n const { compileMarkdown } = useAdminUi();\n\n return (\n <Text as=\"div\" size={size} className={cn(markdownBlockClasses, className)}>\n {compileMarkdown(children)}\n </Text>\n );\n};\n\nconst Markdown = makeDecoratable(\"Markdown\", MarkdownBase);\n\nexport { Markdown };\n"],"names":["markdownBlockClasses","MarkdownBase","children","size","className","compileMarkdown","useAdminUi","Text","cn","Markdown","makeDecoratable"],"mappings":";;;;AAgBO,MAAMA,uBAAuB;AAwBpC,MAAMC,eAAe,CAAC,EAAEC,QAAQ,EAAEC,OAAO,IAAI,EAAEC,SAAS,EAAiB;IACrE,MAAM,EAAEC,eAAe,EAAE,GAAGC;IAE5B,OAAO,WAAP,GACI,oBAACC,MAAIA;QAAC,IAAG;QAAM,MAAMJ;QAAM,WAAWK,GAAGR,sBAAsBI;OAC1DC,gBAAgBH;AAG7B;AAEA,MAAMO,WAAWC,gBAAgB,YAAYT"}
@@ -0,0 +1 @@
1
+ export * from "./Markdown.js";
@@ -0,0 +1 @@
1
+ export * from "./Markdown.js";
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import type { InputPrimitiveProps } from "../../Input/index.js";
3
3
  import type { MultiAutoCompleteOption } from "../domains/index.js";
4
- import type { Icon } from "../../Icon/index.js";
4
+ import type { IconElement } from "../../Icon/index.js";
5
5
  interface MultiAutoCompletePrimitiveProps {
6
6
  /**
7
7
  * Allows free input of values not present in the options.
@@ -82,10 +82,16 @@ interface MultiAutoCompletePrimitiveProps {
82
82
  * Custom renderer for the selected options.
83
83
  */
84
84
  selectedOptionRenderer?: (item: any, index: number) => React.ReactNode;
85
+ /**
86
+ * Filter the options by the typed text on the client. Defaults to `true`.
87
+ * Set to `false` when `onValueSearch` already returns the matching options,
88
+ * so options matched on data other than their label are not dropped.
89
+ */
90
+ shouldFilter?: boolean;
85
91
  /**
86
92
  * Icon to be displayed at the start of the input field.
87
93
  */
88
- startIcon?: React.ReactElement<typeof Icon> | React.ReactElement;
94
+ startIcon?: IconElement;
89
95
  /**
90
96
  * Ensures that each value is unique.
91
97
  */
@@ -35,6 +35,7 @@ const DecoratableMultiAutoCompletePrimitive = (props)=>{
35
35
  onOpenChange: ()=>setListOpenState(true)
36
36
  }, /*#__PURE__*/ react.createElement(Command, {
37
37
  label: String(props.label),
38
+ shouldFilter: props.shouldFilter,
38
39
  onKeyDown: handleKeyDown
39
40
  }, /*#__PURE__*/ react.createElement(PopoverPrimitive.Trigger, {
40
41
  asChild: true
@@ -1 +1 @@
1
- {"version":3,"file":"MultiAutoComplete/primitives/MultiAutoCompletePrimitive.js","sources":["../../../src/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.tsx"],"sourcesContent":["import type { KeyboardEvent } from \"react\";\nimport React from \"react\";\nimport { Command } from \"~/Command/index.js\";\nimport { PopoverPrimitive } from \"~/Popover/index.js\";\nimport type { InputPrimitiveProps } from \"~/Input/index.js\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport { useMultiAutoComplete } from \"./useMultiAutoComplete.js\";\nimport {\n MultiAutoCompleteInput,\n MultiAutoCompleteInputIcons,\n MultiAutoCompleteList\n} from \"./components/index.js\";\nimport type { MultiAutoCompleteOption } from \"../domains/index.js\";\nimport type { Icon } from \"~/Icon/index.js\";\n\ninterface MultiAutoCompletePrimitiveProps {\n /**\n * Allows free input of values not present in the options.\n */\n allowFreeInput?: boolean;\n /**\n * Indicates if the reset action should be displayed.\n */\n displayResetAction?: boolean;\n /**\n * Indicates if the field is disabled.\n */\n disabled?: boolean;\n /**\n * Message to display when there are no options.\n */\n emptyMessage?: React.ReactNode;\n /**\n * Indicates if the input field is invalid.\n * Refer to `InputPrimitiveProps[\"invalid\"]` for possible values.\n */\n invalid?: InputPrimitiveProps[\"invalid\"];\n /**\n * Message to display when there are no options loaded or selected.\n * Use it to invite the user to interact with the autocomplete by typing a value.\n */\n initialMessage?: React.ReactNode;\n /**\n * Reference to the input element.\n */\n inputRef?: React.Ref<HTMLInputElement>;\n /**\n * Accessible label for the command menu. Not shown visibly.\n */\n label?: React.ReactNode;\n /**\n * Indicates if the autocomplete is loading options.\n */\n loading?: boolean;\n /**\n * Message to display while loading options.\n */\n loadingMessage?: React.ReactNode;\n /**\n * Callback triggered when the open state changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Callback triggered when a value has been searched by the user.\n */\n onValueSearch?: (value: string) => void;\n /**\n * Callback triggered when the values change.\n */\n onValuesChange: (values: string[]) => void;\n /**\n * Callback triggered to reset the values.\n */\n onValuesReset?: () => void;\n /**\n * List of options for the autocomplete.\n */\n options?: MultiAutoCompleteOption[];\n /**\n * Custom renderer for the options.\n */\n optionRenderer?: (item: any, index: number) => React.ReactNode;\n /**\n * Placeholder text for the input field.\n */\n placeholder?: string;\n /**\n * Size of the input field.\n * Refer to `InputPrimitiveProps[\"size\"]` for possible values.\n */\n size?: InputPrimitiveProps[\"size\"];\n /**\n * Custom renderer for the selected options.\n */\n selectedOptionRenderer?: (item: any, index: number) => React.ReactNode;\n /**\n * Icon to be displayed at the start of the input field.\n */\n startIcon?: React.ReactElement<typeof Icon> | React.ReactElement;\n /**\n * Ensures that each value is unique.\n */\n uniqueValues?: boolean;\n /**\n * Variant of the input field.\n * Refer to `InputPrimitiveProps[\"variant\"]` for possible values.\n */\n variant?: InputPrimitiveProps[\"variant\"];\n /**\n * Optional selected items.\n */\n values?: string[];\n}\n\nconst DecoratableMultiAutoCompletePrimitive = (props: MultiAutoCompletePrimitiveProps) => {\n const {\n vm,\n setListOpenState,\n setSelectedOption,\n searchOption,\n removeSelectedOption,\n resetSelectedOptions,\n createOption\n } = useMultiAutoComplete(props);\n\n const handleKeyDown = React.useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (props.disabled) {\n return;\n }\n\n if (!vm.optionsListVm.open) {\n setListOpenState(true);\n }\n\n if (event.key.toLowerCase() === \"escape\") {\n setListOpenState(false);\n }\n },\n [props.disabled, setListOpenState, setSelectedOption, vm.optionsListVm.open]\n );\n\n const handleSelectOption = React.useCallback(\n (value: string) => {\n setSelectedOption(value);\n setListOpenState(false);\n },\n [setSelectedOption, setListOpenState]\n );\n\n const handleCreateOption = React.useCallback(\n (value: string) => {\n createOption(value);\n setListOpenState(false);\n },\n [createOption, setListOpenState]\n );\n\n return (\n <PopoverPrimitive open={vm.optionsListVm.open} onOpenChange={() => setListOpenState(true)}>\n <Command label={String(props.label)} onKeyDown={handleKeyDown}>\n <PopoverPrimitive.Trigger asChild>\n <span>\n <MultiAutoCompleteInput\n inputRef={props.inputRef}\n value={vm.inputVm.value}\n placeholder={vm.inputVm.placeholder}\n changeValue={searchOption}\n closeList={() => setListOpenState(false)}\n openList={() => setListOpenState(true)}\n variant={props.variant}\n size={props.size}\n invalid={props.invalid}\n removeSelectedOption={removeSelectedOption}\n selectedOptionRenderer={props.selectedOptionRenderer}\n selectedOptions={vm.selectedOptionsVm.options}\n disabled={props.disabled}\n startIcon={props.startIcon}\n endIcon={\n <MultiAutoCompleteInputIcons\n inputSize={props.size}\n inputVariant={props.variant}\n displayResetAction={\n !vm.selectedOptionsVm.empty && vm.inputVm.displayResetAction\n }\n disabled={props.disabled}\n loading={props.loading}\n onResetValue={resetSelectedOptions}\n onOpenChange={() => setListOpenState(!vm.optionsListVm.open)}\n />\n }\n />\n </span>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n onOpenAutoFocus={e => e.preventDefault()}\n >\n <MultiAutoCompleteList\n emptyMessage={vm.optionsListVm.emptyMessage}\n empty={vm.optionsListVm.empty}\n loading={props.loading}\n loadingMessage={vm.optionsListVm.loadingMessage}\n onOptionCreate={handleCreateOption}\n onOptionSelect={handleSelectOption}\n optionRenderer={props.optionRenderer}\n options={vm.optionsListVm.options}\n temporaryOption={vm.temporaryOptionVm.option}\n />\n </PopoverPrimitive.Content>\n </Command>\n </PopoverPrimitive>\n );\n};\n\nconst MultiAutoCompletePrimitive = makeDecoratable(\n \"MultiAutoCompletePrimitive\",\n DecoratableMultiAutoCompletePrimitive\n);\n\nexport { MultiAutoCompletePrimitive, type MultiAutoCompletePrimitiveProps };\n"],"names":["DecoratableMultiAutoCompletePrimitive","props","vm","setListOpenState","setSelectedOption","searchOption","removeSelectedOption","resetSelectedOptions","createOption","useMultiAutoComplete","handleKeyDown","React","event","handleSelectOption","value","handleCreateOption","PopoverPrimitive","Command","String","MultiAutoCompleteInput","MultiAutoCompleteInputIcons","e","MultiAutoCompleteList","MultiAutoCompletePrimitive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AM,sBAAsB;QACpD,iBAAiBC,GAAG,iBAAiB,CAAC,OAAO;QAC7C,UAAUD,MAAM,QAAQ;QACxB,WAAWA,MAAM,SAAS;QAC1B,uBACI,oBAACmB,6BAA2BA;YACxB,WAAWnB,MAAM,IAAI;YACrB,cAAcA,MAAM,OAAO;YAC3B,oBACI,CAACC,GAAG,iBAAiB,CAAC,KAAK,IAAIA,GAAG,OAAO,CAAC,kBAAkB;YAEhE,UAAUD,MAAM,QAAQ;YACxB,SAASA,MAAM,OAAO;YACtB,cAAcM;YACd,cAAc,IAAMJ,iBAAiB,CAACD,GAAG,aAAa,CAAC,IAAI;;wBAM/E,oBAACc,iBAAiB,OAAO;QACrB,OAAO;YAAE,OAAO;QAAqC;QACrD,iBAAiBK,CAAAA,IAAKA,EAAE,cAAc;qBAEtC,oBAACC,uBAAqBA;QAClB,cAAcpB,GAAG,aAAa,CAAC,YAAY;QAC3C,OAAOA,GAAG,aAAa,CAAC,KAAK;QAC7B,SAASD,MAAM,OAAO;QACtB,gBAAgBC,GAAG,aAAa,CAAC,cAAc;QAC/C,gBAAgBa;QAChB,gBAAgBF;QAChB,gBAAgBZ,MAAM,cAAc;QACpC,SAASC,GAAG,aAAa,CAAC,OAAO;QACjC,iBAAiBA,GAAG,iBAAiB,CAAC,MAAM;;AAMpE;AAEA,MAAMqB,6BAA6BC,gBAC/B,8BACAxB"}
1
+ {"version":3,"file":"MultiAutoComplete/primitives/MultiAutoCompletePrimitive.js","sources":["../../../src/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.tsx"],"sourcesContent":["import type { KeyboardEvent } from \"react\";\nimport React from \"react\";\nimport { Command } from \"~/Command/index.js\";\nimport { PopoverPrimitive } from \"~/Popover/index.js\";\nimport type { InputPrimitiveProps } from \"~/Input/index.js\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport { useMultiAutoComplete } from \"./useMultiAutoComplete.js\";\nimport {\n MultiAutoCompleteInput,\n MultiAutoCompleteInputIcons,\n MultiAutoCompleteList\n} from \"./components/index.js\";\nimport type { MultiAutoCompleteOption } from \"../domains/index.js\";\nimport type { IconElement } from \"~/Icon/index.js\";\n\ninterface MultiAutoCompletePrimitiveProps {\n /**\n * Allows free input of values not present in the options.\n */\n allowFreeInput?: boolean;\n /**\n * Indicates if the reset action should be displayed.\n */\n displayResetAction?: boolean;\n /**\n * Indicates if the field is disabled.\n */\n disabled?: boolean;\n /**\n * Message to display when there are no options.\n */\n emptyMessage?: React.ReactNode;\n /**\n * Indicates if the input field is invalid.\n * Refer to `InputPrimitiveProps[\"invalid\"]` for possible values.\n */\n invalid?: InputPrimitiveProps[\"invalid\"];\n /**\n * Message to display when there are no options loaded or selected.\n * Use it to invite the user to interact with the autocomplete by typing a value.\n */\n initialMessage?: React.ReactNode;\n /**\n * Reference to the input element.\n */\n inputRef?: React.Ref<HTMLInputElement>;\n /**\n * Accessible label for the command menu. Not shown visibly.\n */\n label?: React.ReactNode;\n /**\n * Indicates if the autocomplete is loading options.\n */\n loading?: boolean;\n /**\n * Message to display while loading options.\n */\n loadingMessage?: React.ReactNode;\n /**\n * Callback triggered when the open state changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Callback triggered when a value has been searched by the user.\n */\n onValueSearch?: (value: string) => void;\n /**\n * Callback triggered when the values change.\n */\n onValuesChange: (values: string[]) => void;\n /**\n * Callback triggered to reset the values.\n */\n onValuesReset?: () => void;\n /**\n * List of options for the autocomplete.\n */\n options?: MultiAutoCompleteOption[];\n /**\n * Custom renderer for the options.\n */\n optionRenderer?: (item: any, index: number) => React.ReactNode;\n /**\n * Placeholder text for the input field.\n */\n placeholder?: string;\n /**\n * Size of the input field.\n * Refer to `InputPrimitiveProps[\"size\"]` for possible values.\n */\n size?: InputPrimitiveProps[\"size\"];\n /**\n * Custom renderer for the selected options.\n */\n selectedOptionRenderer?: (item: any, index: number) => React.ReactNode;\n /**\n * Filter the options by the typed text on the client. Defaults to `true`.\n * Set to `false` when `onValueSearch` already returns the matching options,\n * so options matched on data other than their label are not dropped.\n */\n shouldFilter?: boolean;\n /**\n * Icon to be displayed at the start of the input field.\n */\n startIcon?: IconElement;\n /**\n * Ensures that each value is unique.\n */\n uniqueValues?: boolean;\n /**\n * Variant of the input field.\n * Refer to `InputPrimitiveProps[\"variant\"]` for possible values.\n */\n variant?: InputPrimitiveProps[\"variant\"];\n /**\n * Optional selected items.\n */\n values?: string[];\n}\n\nconst DecoratableMultiAutoCompletePrimitive = (props: MultiAutoCompletePrimitiveProps) => {\n const {\n vm,\n setListOpenState,\n setSelectedOption,\n searchOption,\n removeSelectedOption,\n resetSelectedOptions,\n createOption\n } = useMultiAutoComplete(props);\n\n const handleKeyDown = React.useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (props.disabled) {\n return;\n }\n\n if (!vm.optionsListVm.open) {\n setListOpenState(true);\n }\n\n if (event.key.toLowerCase() === \"escape\") {\n setListOpenState(false);\n }\n },\n [props.disabled, setListOpenState, setSelectedOption, vm.optionsListVm.open]\n );\n\n const handleSelectOption = React.useCallback(\n (value: string) => {\n setSelectedOption(value);\n setListOpenState(false);\n },\n [setSelectedOption, setListOpenState]\n );\n\n const handleCreateOption = React.useCallback(\n (value: string) => {\n createOption(value);\n setListOpenState(false);\n },\n [createOption, setListOpenState]\n );\n\n return (\n <PopoverPrimitive open={vm.optionsListVm.open} onOpenChange={() => setListOpenState(true)}>\n <Command\n label={String(props.label)}\n shouldFilter={props.shouldFilter}\n onKeyDown={handleKeyDown}\n >\n <PopoverPrimitive.Trigger asChild>\n <span>\n <MultiAutoCompleteInput\n inputRef={props.inputRef}\n value={vm.inputVm.value}\n placeholder={vm.inputVm.placeholder}\n changeValue={searchOption}\n closeList={() => setListOpenState(false)}\n openList={() => setListOpenState(true)}\n variant={props.variant}\n size={props.size}\n invalid={props.invalid}\n removeSelectedOption={removeSelectedOption}\n selectedOptionRenderer={props.selectedOptionRenderer}\n selectedOptions={vm.selectedOptionsVm.options}\n disabled={props.disabled}\n startIcon={props.startIcon}\n endIcon={\n <MultiAutoCompleteInputIcons\n inputSize={props.size}\n inputVariant={props.variant}\n displayResetAction={\n !vm.selectedOptionsVm.empty && vm.inputVm.displayResetAction\n }\n disabled={props.disabled}\n loading={props.loading}\n onResetValue={resetSelectedOptions}\n onOpenChange={() => setListOpenState(!vm.optionsListVm.open)}\n />\n }\n />\n </span>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n onOpenAutoFocus={e => e.preventDefault()}\n >\n <MultiAutoCompleteList\n emptyMessage={vm.optionsListVm.emptyMessage}\n empty={vm.optionsListVm.empty}\n loading={props.loading}\n loadingMessage={vm.optionsListVm.loadingMessage}\n onOptionCreate={handleCreateOption}\n onOptionSelect={handleSelectOption}\n optionRenderer={props.optionRenderer}\n options={vm.optionsListVm.options}\n temporaryOption={vm.temporaryOptionVm.option}\n />\n </PopoverPrimitive.Content>\n </Command>\n </PopoverPrimitive>\n );\n};\n\nconst MultiAutoCompletePrimitive = makeDecoratable(\n \"MultiAutoCompletePrimitive\",\n DecoratableMultiAutoCompletePrimitive\n);\n\nexport { MultiAutoCompletePrimitive, type MultiAutoCompletePrimitiveProps };\n"],"names":["DecoratableMultiAutoCompletePrimitive","props","vm","setListOpenState","setSelectedOption","searchOption","removeSelectedOption","resetSelectedOptions","createOption","useMultiAutoComplete","handleKeyDown","React","event","handleSelectOption","value","handleCreateOption","PopoverPrimitive","Command","String","MultiAutoCompleteInput","MultiAutoCompleteInputIcons","e","MultiAutoCompleteList","MultiAutoCompletePrimitive","makeDecoratable"],"mappings":";;;;;;AAwHA,MAAMA,wCAAwC,CAACC;IAC3C,MAAM,EACFC,EAAE,EACFC,gBAAgB,EAChBC,iBAAiB,EACjBC,YAAY,EACZC,oBAAoB,EACpBC,oBAAoB,EACpBC,YAAY,EACf,GAAGC,qBAAqBR;IAEzB,MAAMS,gBAAgBC,MAAAA,WAAiB,CACnC,CAACC;QACG,IAAIX,MAAM,QAAQ,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IA,GAAG,OAAO,CAAC,kBAAkB;YAEhE,UAAUD,MAAM,QAAQ;YACxB,SAASA,MAAM,OAAO;YACtB,cAAcM;YACd,cAAc,IAAMJ,iBAAiB,CAACD,GAAG,aAAa,CAAC,IAAI;;wBAM/E,oBAACc,iBAAiB,OAAO;QACrB,OAAO;YAAE,OAAO;QAAqC;QACrD,iBAAiBK,CAAAA,IAAKA,EAAE,cAAc;qBAEtC,oBAACC,uBAAqBA;QAClB,cAAcpB,GAAG,aAAa,CAAC,YAAY;QAC3C,OAAOA,GAAG,aAAa,CAAC,KAAK;QAC7B,SAASD,MAAM,OAAO;QACtB,gBAAgBC,GAAG,aAAa,CAAC,cAAc;QAC/C,gBAAgBa;QAChB,gBAAgBF;QAChB,gBAAgBZ,MAAM,cAAc;QACpC,SAASC,GAAG,aAAa,CAAC,OAAO;QACjC,iBAAiBA,GAAG,iBAAiB,CAAC,MAAM;;AAMpE;AAEA,MAAMqB,6BAA6BC,gBAC/B,8BACAxB"}
@@ -372,7 +372,7 @@ describe("MultiAutoCompletePresenter", ()=>{
372
372
  ]);
373
373
  presenter.removeSelectedOption("option-2");
374
374
  expect(onValuesChange).toHaveBeenCalledWith([
375
- "option-2"
375
+ "option-1"
376
376
  ]);
377
377
  expect(presenter.vm.optionsListVm.options).toEqual([
378
378
  {
@@ -1 +1 @@
1
- {"version":3,"file":"MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.test.js","sources":["../../../../src/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.test.ts"],"sourcesContent":["import type { IMultiAutoCompletePresenter } from \"./MultiAutoCompletePresenter.js\";\nimport { MultiAutoCompletePresenter } from \"./MultiAutoCompletePresenter.js\";\nimport { MultiAutoCompleteInputPresenter } from \"./MultiAutoCompleteInputPresenter.js\";\nimport { MultiAutoCompleteSelectedOptionPresenter } from \"./MultiAutoCompleteSelectedOptionsPresenter.js\";\nimport { MultiAutoCompleteListOptionsPresenter } from \"./MultiAutoCompleteListOptionsPresenter.js\";\nimport { beforeEach, describe, expect, it, vi } from \"vitest\";\n\ndescribe(\"MultiAutoCompletePresenter\", () => {\n let presenter: IMultiAutoCompletePresenter;\n const onValuesChange = vi.fn();\n const onOpenChange = vi.fn();\n const onValuesReset = vi.fn();\n\n beforeEach(() => {\n const inputPresenter = new MultiAutoCompleteInputPresenter();\n const selectedOptionsPresenter = new MultiAutoCompleteSelectedOptionPresenter();\n const optionsListPresenter = new MultiAutoCompleteListOptionsPresenter();\n\n presenter = new MultiAutoCompletePresenter(\n inputPresenter,\n selectedOptionsPresenter,\n optionsListPresenter\n );\n });\n\n it(\"should return the compatible `vm.inputVm` based on params\", () => {\n // `placeholder`\n {\n presenter.init({ placeholder: \"Custom placeholder\", onValuesChange });\n expect(presenter.vm.inputVm.placeholder).toEqual(\"Custom placeholder\");\n }\n\n {\n // default: no params\n presenter.init({ onValuesChange });\n expect(presenter.vm.inputVm.placeholder).toEqual(\"Start typing or select\");\n expect(presenter.vm.inputVm.displayResetAction).toEqual(true);\n }\n });\n\n it(\"should return the compatible `vm.selectedOptionsVm` based on params\", () => {\n presenter.init({\n options: [\"Option 1\", \"Option 2\", \"Option 3\"],\n values: [\"Option 1\", \"Option 2\"],\n onValuesChange\n });\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n value: \"Option 1\",\n label: \"Option 1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n value: \"Option 2\",\n label: \"Option 2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n });\n\n it(\"should return the compatible `vm.selectedOptionsVm` with no params\", () => {\n presenter.init({ options: [\"Option 1\", \"Option 2\"], onValuesChange });\n expect(presenter.vm.selectedOptionsVm.options).toEqual([]);\n });\n\n it(\"should return the compatible `vm.optionsListVm` based on params\", () => {\n // with `options` as string\n {\n presenter.init({ options: [\"Option 1\", \"Option 2\"], onValuesChange });\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n value: \"Option 1\",\n label: \"Option 1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n value: \"Option 2\",\n label: \"Option 2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.optionsListVm.empty).toEqual(false);\n }\n\n // with `options` as formatted options\n {\n presenter.init({\n onValuesChange,\n options: [\n {\n value: \"option-1\",\n label: \"Option 1\"\n },\n {\n value: \"option-2\",\n label: \"Option 2\"\n },\n {\n value: \"option-3\",\n label: \"Option 3\",\n disabled: true\n },\n {\n value: \"option-4\",\n label: \"Option 4\",\n separator: true\n },\n {\n value: \"option-5\",\n label: \"Option 5\",\n item: {\n anyKey1: \"custom-value\",\n anyKey2: 2\n }\n }\n ]\n });\n\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n value: \"option-1\",\n label: \"Option 1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n value: \"option-2\",\n label: \"Option 2\",\n disabled: false,\n selected: false, // `selected` is overwritten by the presenter\n separator: false,\n item: null\n },\n {\n value: \"option-3\",\n label: \"Option 3\",\n disabled: true,\n selected: false,\n separator: false,\n item: null\n },\n {\n value: \"option-4\",\n label: \"Option 4\",\n disabled: false,\n selected: false,\n separator: true,\n item: null\n },\n {\n value: \"option-5\",\n label: \"Option 5\",\n disabled: false,\n selected: false,\n separator: false,\n item: {\n anyKey1: \"custom-value\",\n anyKey2: 2\n }\n }\n ]);\n expect(presenter.vm.optionsListVm.empty).toEqual(false);\n }\n\n // with `options` and `value`\n {\n presenter.init({\n onValuesChange,\n options: [\"Option 1\", \"Option 2\"],\n values: [\"Option 1\"]\n });\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n value: \"Option 1\",\n label: \"Option 1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n value: \"Option 2\",\n label: \"Option 2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.optionsListVm.empty).toEqual(false);\n }\n\n {\n // default: no params\n presenter.init({ onValuesChange });\n expect(presenter.vm.optionsListVm.options).toEqual([]);\n expect(presenter.vm.optionsListVm.emptyMessage).toEqual(\n \"Start typing to find an option.\"\n );\n expect(presenter.vm.optionsListVm.loadingMessage).toEqual(\"Loading...\");\n expect(presenter.vm.optionsListVm.open).toEqual(false);\n expect(presenter.vm.optionsListVm.empty).toEqual(true);\n }\n });\n\n it(\"should change the `optionsListVm` and `selectedOptionsVm` when `setSelectedOption` is called\", () => {\n presenter.init({\n onValuesChange,\n options: [\n {\n label: \"Option 1\",\n value: \"option-1\"\n },\n {\n label: \"Option 2\",\n value: \"option-2\"\n }\n ]\n });\n\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n\n presenter.setSelectedOption(\"option-2\");\n expect(onValuesChange).toHaveBeenCalledWith([\"option-2\"]);\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n presenter.setSelectedOption(\"option-1\");\n expect(onValuesChange).toHaveBeenCalledWith([\"option-2\", \"option-1\"]);\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n });\n\n it(\"should change the `optionsListVm` and `selectedOptionsVm` when `removeSelectedOption` is called\", () => {\n presenter.init({\n onValuesChange,\n options: [\n {\n label: \"Option 1\",\n value: \"option-1\"\n },\n {\n label: \"Option 2\",\n value: \"option-2\"\n }\n ],\n values: [\"option-2\", \"option-1\"]\n });\n\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n presenter.removeSelectedOption(\"option-2\");\n expect(onValuesChange).toHaveBeenCalledWith([\"option-2\"]);\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n presenter.removeSelectedOption(\"option-1\");\n expect(onValuesChange).toHaveBeenCalledWith([]);\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([]);\n });\n\n it(\"should set the internal `inputValue` when `setInputValue` is called\", () => {\n presenter.init({ onValuesChange });\n\n presenter.searchOption(\"value\");\n expect(presenter.vm.inputVm.value).toEqual(\"value\");\n });\n\n it(\"should set the option as `selected` when the presenter is initialized with a value\", () => {\n presenter.init({\n onValuesChange,\n values: [\"option-1\"],\n options: [\n {\n label: \"Option 1\",\n value: \"option-1\"\n },\n {\n label: \"Option 2\",\n value: \"option-2\"\n }\n ]\n });\n\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n });\n\n it(\"should change the `optionListVm` and `selectedOptionsVm` when `resetSelectedOptions` is called\", () => {\n presenter.init({\n onValuesChange,\n onValuesReset,\n options: [\n {\n label: \"Option 1\",\n value: \"option-1\"\n },\n {\n label: \"Option 2\",\n value: \"option-2\"\n }\n ]\n });\n\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n\n presenter.setSelectedOption(\"option-1\");\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n presenter.resetSelectedOptions();\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.inputVm.value).toEqual(\"\");\n expect(presenter.vm.selectedOptionsVm.options).toEqual([]);\n\n expect(onValuesChange).toHaveBeenCalledWith([]);\n expect(onValuesReset).toHaveBeenCalled();\n });\n\n it(\"should change `listVm` and call `onOpenChange` when `setListOpenState` is called\", () => {\n // let's open it\n presenter.init({ onValuesChange, onOpenChange });\n presenter.setListOpenState(true);\n expect(presenter.vm.optionsListVm.open).toBe(true);\n expect(onOpenChange).toHaveBeenCalledWith(true);\n\n // let's close it\n presenter.setListOpenState(false);\n expect(presenter.vm.optionsListVm.open).toBe(false);\n expect(onOpenChange).toHaveBeenCalledWith(false);\n });\n\n it(\"should be able to create new options if `allowFreeInput` is set to true\", () => {\n // This feature is disabled by default\n presenter.init({ onValuesChange });\n presenter.searchOption(\"New Option 1\");\n presenter.createOption(\"New Option 1\");\n expect(presenter.vm.selectedOptionsVm.empty).toEqual(true);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([]);\n });\n\n it(\"should not display the reset action if `displayResetAction` is set to `false` and option is selected\", () => {\n presenter.init({\n onValuesChange,\n options: [\n {\n label: \"Option 1\",\n value: \"option-1\"\n },\n {\n label: \"Option 2\",\n value: \"option-2\"\n }\n ],\n displayResetAction: false\n });\n\n presenter.setSelectedOption(\"option-2\");\n expect(onValuesChange).toHaveBeenCalledWith([\"option-2\"]);\n // `displayResetAction` is set to `false` and option is selected\n expect(presenter.vm.inputVm.displayResetAction).toEqual(false);\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n });\n});\n"],"names":["describe","presenter","onValuesChange","vi","onOpenChange","onValuesReset","beforeEach","inputPresenter","MultiAutoCompleteInputPresenter","selectedOptionsPresenter","MultiAutoCompleteSelectedOptionPresenter","optionsListPresenter","MultiAutoCompleteListOptionsPresenter","MultiAutoCompletePresenter","it","expect"],"mappings":";;;;;AAOAA,SAAS,8BAA8B;IACnC,IAAIC;IACJ,MAAMC,iBAAiBC,GAAG,EAAE;IAC5B,MAAMC,eAAeD,GAAG,EAAE;IAC1B,MAAME,gBAAgBF,GAAG,EAAE;IAE3BG,WAAW;QACP,MAAMC,iBAAiB,IAAIC;QAC3B,MAAMC,2BAA2B,IAAIC;QACrC,MAAMC,uBAAuB,IAAIC;QAEjCX,YAAY,IAAIY,2BACZN,gBACAE,0BACAE;IAER;IAEAG,GAAG,6DAA6D;QAGxDb,UAAU,IAAI,CAAC;YAAE,aAAa;YAAsBC;QAAe;QACnEa,OAAOd,UAAU,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC;QAKjDA,UAAU,IAAI,CAAC;YAAEC;QAAe;QAChCa,OAAOd,UAAU,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC;QACjDc,OAAOd,UAAU,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC;IAEhE;IAEAa,GAAG,uEAAuE;QACtEb,UAAU,IAAI,CAAC;YACX,SAAS;gBAAC;gBAAY;gBAAY;aAAW;YAC7C,QAAQ;gBAAC;gBAAY;aAAW;YAChCC;QACJ;QACAa,OAAOd,UAAU,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC;YACnD;gBACI,OAAO;gBACP,OAAO;gBACP,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,CAAC,OAAO,EAAE,OAAO,CAAC;YACnD;gBACI,OAAO;gBACP,OAAO;gBACP,UAAU;gBACV,UAAU;gBACV,WAAW;gBACX,MAAM;YACV;SACH;IACL;AACJ"}
1
+ {"version":3,"file":"MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.test.js","sources":["../../../../src/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.test.ts"],"sourcesContent":["import type { IMultiAutoCompletePresenter } from \"./MultiAutoCompletePresenter.js\";\nimport { MultiAutoCompletePresenter } from \"./MultiAutoCompletePresenter.js\";\nimport { MultiAutoCompleteInputPresenter } from \"./MultiAutoCompleteInputPresenter.js\";\nimport { MultiAutoCompleteSelectedOptionPresenter } from \"./MultiAutoCompleteSelectedOptionsPresenter.js\";\nimport { MultiAutoCompleteListOptionsPresenter } from \"./MultiAutoCompleteListOptionsPresenter.js\";\nimport { beforeEach, describe, expect, it, vi } from \"vitest\";\n\ndescribe(\"MultiAutoCompletePresenter\", () => {\n let presenter: IMultiAutoCompletePresenter;\n const onValuesChange = vi.fn();\n const onOpenChange = vi.fn();\n const onValuesReset = vi.fn();\n\n beforeEach(() => {\n const inputPresenter = new MultiAutoCompleteInputPresenter();\n const selectedOptionsPresenter = new MultiAutoCompleteSelectedOptionPresenter();\n const optionsListPresenter = new MultiAutoCompleteListOptionsPresenter();\n\n presenter = new MultiAutoCompletePresenter(\n inputPresenter,\n selectedOptionsPresenter,\n optionsListPresenter\n );\n });\n\n it(\"should return the compatible `vm.inputVm` based on params\", () => {\n // `placeholder`\n {\n presenter.init({ placeholder: \"Custom placeholder\", onValuesChange });\n expect(presenter.vm.inputVm.placeholder).toEqual(\"Custom placeholder\");\n }\n\n {\n // default: no params\n presenter.init({ onValuesChange });\n expect(presenter.vm.inputVm.placeholder).toEqual(\"Start typing or select\");\n expect(presenter.vm.inputVm.displayResetAction).toEqual(true);\n }\n });\n\n it(\"should return the compatible `vm.selectedOptionsVm` based on params\", () => {\n presenter.init({\n options: [\"Option 1\", \"Option 2\", \"Option 3\"],\n values: [\"Option 1\", \"Option 2\"],\n onValuesChange\n });\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n value: \"Option 1\",\n label: \"Option 1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n value: \"Option 2\",\n label: \"Option 2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n });\n\n it(\"should return the compatible `vm.selectedOptionsVm` with no params\", () => {\n presenter.init({ options: [\"Option 1\", \"Option 2\"], onValuesChange });\n expect(presenter.vm.selectedOptionsVm.options).toEqual([]);\n });\n\n it(\"should return the compatible `vm.optionsListVm` based on params\", () => {\n // with `options` as string\n {\n presenter.init({ options: [\"Option 1\", \"Option 2\"], onValuesChange });\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n value: \"Option 1\",\n label: \"Option 1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n value: \"Option 2\",\n label: \"Option 2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.optionsListVm.empty).toEqual(false);\n }\n\n // with `options` as formatted options\n {\n presenter.init({\n onValuesChange,\n options: [\n {\n value: \"option-1\",\n label: \"Option 1\"\n },\n {\n value: \"option-2\",\n label: \"Option 2\"\n },\n {\n value: \"option-3\",\n label: \"Option 3\",\n disabled: true\n },\n {\n value: \"option-4\",\n label: \"Option 4\",\n separator: true\n },\n {\n value: \"option-5\",\n label: \"Option 5\",\n item: {\n anyKey1: \"custom-value\",\n anyKey2: 2\n }\n }\n ]\n });\n\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n value: \"option-1\",\n label: \"Option 1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n value: \"option-2\",\n label: \"Option 2\",\n disabled: false,\n selected: false, // `selected` is overwritten by the presenter\n separator: false,\n item: null\n },\n {\n value: \"option-3\",\n label: \"Option 3\",\n disabled: true,\n selected: false,\n separator: false,\n item: null\n },\n {\n value: \"option-4\",\n label: \"Option 4\",\n disabled: false,\n selected: false,\n separator: true,\n item: null\n },\n {\n value: \"option-5\",\n label: \"Option 5\",\n disabled: false,\n selected: false,\n separator: false,\n item: {\n anyKey1: \"custom-value\",\n anyKey2: 2\n }\n }\n ]);\n expect(presenter.vm.optionsListVm.empty).toEqual(false);\n }\n\n // with `options` and `value`\n {\n presenter.init({\n onValuesChange,\n options: [\"Option 1\", \"Option 2\"],\n values: [\"Option 1\"]\n });\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n value: \"Option 1\",\n label: \"Option 1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n value: \"Option 2\",\n label: \"Option 2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.optionsListVm.empty).toEqual(false);\n }\n\n {\n // default: no params\n presenter.init({ onValuesChange });\n expect(presenter.vm.optionsListVm.options).toEqual([]);\n expect(presenter.vm.optionsListVm.emptyMessage).toEqual(\n \"Start typing to find an option.\"\n );\n expect(presenter.vm.optionsListVm.loadingMessage).toEqual(\"Loading...\");\n expect(presenter.vm.optionsListVm.open).toEqual(false);\n expect(presenter.vm.optionsListVm.empty).toEqual(true);\n }\n });\n\n it(\"should change the `optionsListVm` and `selectedOptionsVm` when `setSelectedOption` is called\", () => {\n presenter.init({\n onValuesChange,\n options: [\n {\n label: \"Option 1\",\n value: \"option-1\"\n },\n {\n label: \"Option 2\",\n value: \"option-2\"\n }\n ]\n });\n\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n\n presenter.setSelectedOption(\"option-2\");\n expect(onValuesChange).toHaveBeenCalledWith([\"option-2\"]);\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n presenter.setSelectedOption(\"option-1\");\n expect(onValuesChange).toHaveBeenCalledWith([\"option-2\", \"option-1\"]);\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n });\n\n it(\"should change the `optionsListVm` and `selectedOptionsVm` when `removeSelectedOption` is called\", () => {\n presenter.init({\n onValuesChange,\n options: [\n {\n label: \"Option 1\",\n value: \"option-1\"\n },\n {\n label: \"Option 2\",\n value: \"option-2\"\n }\n ],\n values: [\"option-2\", \"option-1\"]\n });\n\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n presenter.removeSelectedOption(\"option-2\");\n expect(onValuesChange).toHaveBeenCalledWith([\"option-1\"]);\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n presenter.removeSelectedOption(\"option-1\");\n expect(onValuesChange).toHaveBeenCalledWith([]);\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([]);\n });\n\n it(\"should set the internal `inputValue` when `setInputValue` is called\", () => {\n presenter.init({ onValuesChange });\n\n presenter.searchOption(\"value\");\n expect(presenter.vm.inputVm.value).toEqual(\"value\");\n });\n\n it(\"should set the option as `selected` when the presenter is initialized with a value\", () => {\n presenter.init({\n onValuesChange,\n values: [\"option-1\"],\n options: [\n {\n label: \"Option 1\",\n value: \"option-1\"\n },\n {\n label: \"Option 2\",\n value: \"option-2\"\n }\n ]\n });\n\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n });\n\n it(\"should change the `optionListVm` and `selectedOptionsVm` when `resetSelectedOptions` is called\", () => {\n presenter.init({\n onValuesChange,\n onValuesReset,\n options: [\n {\n label: \"Option 1\",\n value: \"option-1\"\n },\n {\n label: \"Option 2\",\n value: \"option-2\"\n }\n ]\n });\n\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n\n presenter.setSelectedOption(\"option-1\");\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n\n presenter.resetSelectedOptions();\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.inputVm.value).toEqual(\"\");\n expect(presenter.vm.selectedOptionsVm.options).toEqual([]);\n\n expect(onValuesChange).toHaveBeenCalledWith([]);\n expect(onValuesReset).toHaveBeenCalled();\n });\n\n it(\"should change `listVm` and call `onOpenChange` when `setListOpenState` is called\", () => {\n // let's open it\n presenter.init({ onValuesChange, onOpenChange });\n presenter.setListOpenState(true);\n expect(presenter.vm.optionsListVm.open).toBe(true);\n expect(onOpenChange).toHaveBeenCalledWith(true);\n\n // let's close it\n presenter.setListOpenState(false);\n expect(presenter.vm.optionsListVm.open).toBe(false);\n expect(onOpenChange).toHaveBeenCalledWith(false);\n });\n\n it(\"should be able to create new options if `allowFreeInput` is set to true\", () => {\n // This feature is disabled by default\n presenter.init({ onValuesChange });\n presenter.searchOption(\"New Option 1\");\n presenter.createOption(\"New Option 1\");\n expect(presenter.vm.selectedOptionsVm.empty).toEqual(true);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([]);\n });\n\n it(\"should not display the reset action if `displayResetAction` is set to `false` and option is selected\", () => {\n presenter.init({\n onValuesChange,\n options: [\n {\n label: \"Option 1\",\n value: \"option-1\"\n },\n {\n label: \"Option 2\",\n value: \"option-2\"\n }\n ],\n displayResetAction: false\n });\n\n presenter.setSelectedOption(\"option-2\");\n expect(onValuesChange).toHaveBeenCalledWith([\"option-2\"]);\n // `displayResetAction` is set to `false` and option is selected\n expect(presenter.vm.inputVm.displayResetAction).toEqual(false);\n expect(presenter.vm.optionsListVm.options).toEqual([\n {\n label: \"Option 1\",\n value: \"option-1\",\n disabled: false,\n selected: false,\n separator: false,\n item: null\n },\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n expect(presenter.vm.selectedOptionsVm.options).toEqual([\n {\n label: \"Option 2\",\n value: \"option-2\",\n disabled: false,\n selected: true,\n separator: false,\n item: null\n }\n ]);\n });\n});\n"],"names":["describe","presenter","onValuesChange","vi","onOpenChange","onValuesReset","beforeEach","inputPresenter","MultiAutoCompleteInputPresenter","selectedOptionsPresenter","MultiAutoCompleteSelectedOptionPresenter","optionsListPresenter","MultiAutoCompleteListOptionsPresenter","MultiAutoCompletePresenter","it","expect"],"mappings":";;;;;AAOAA,SAAS,8BAA8B;IACnC,IAAIC;IACJ,MAAMC,iBAAiBC,GAAG,EAAE;IAC5B,MAAMC,eAAeD,GAAG,EAAE;IAC1B,MAAME,gBAAgBF,GAAG,EAAE;IAE3BG,WAAW;QACP,MAAMC,iBAAiB,IAAIC;QAC3B,MAAMC,2BAA2B,IAAIC;QACrC,MAAMC,uBAAuB,IAAIC;QAEjCX,YAAY,IAAIY,2BACZN,gBACAE,0BACAE;IAER;IAEAG,GAAG,6DAA6D;QAGxDb,UA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;YACA,SAAS;gBACL;oBACI,OAAO;oBACP,OAAO;gBACX;gBACA;oBACI,OAAO;oBACP,OAAO;gBACX;aACH;YACD,oBAAoB;QACxB;QAEAD,UAAU,iBAAiB,CAAC;QAC5Bc,OAAOb,gBAAgB,oBAAoB,CAAC;YAAC;SAAW;QAExDa,OAAOd,UAAU,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC;QACxDc,OAAOd,UAAU,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC;YAC/C;gBACI,OAAO;gBACP,OAAO;gBACP,UAAU;gBACV,UAAU;gBACV,WAAW;gBACX,MAAM;YACV;YACA;gBACI,OAAO;gBACP,OAAO;gBACP,UAAU;gBACV,UAAU;gBACV,WAAW;gBACX,MAAM;YACV;SACH;QACDc,OAAOd,UAAU,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC;YACnD;gBACI,OAAO;gBACP,OAAO;gBACP,UAAU;gBACV,UAAU;gBACV,WAAW;gBACX,MAAM;YACV;SACH;IACL;AACJ"}
@@ -40,9 +40,10 @@ const useMultiAutoComplete = (props)=>{
40
40
  const withFreeInputPresenter = new MultiAutoCompletePresenterWithFreeInput(temporaryOptionsPresenter, presenter);
41
41
  withFreeInputPresenter.init(params);
42
42
  return withFreeInputPresenter;
43
+ } else {
44
+ presenter.init(params);
45
+ return presenter;
43
46
  }
44
- presenter.init(params);
45
- return presenter;
46
47
  }, [
47
48
  props.allowFreeInput,
48
49
  props.uniqueValues
@@ -1 +1 @@
1
- {"version":3,"file":"MultiAutoComplete/primitives/useMultiAutoComplete.js","sources":["../../../src/MultiAutoComplete/primitives/useMultiAutoComplete.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { autorun } from \"mobx\";\nimport type { MultiAutoCompletePrimitiveProps } from \"./MultiAutoCompletePrimitive.js\";\nimport type { MultiAutoCompletePresenterParams } from \"./presenters/index.js\";\nimport {\n MultiAutoCompleteInputPresenter,\n MultiAutoCompleteListOptionsPresenter,\n MultiAutoCompleteListOptionsPresenterWithUniqueValues,\n MultiAutoCompletePresenter,\n MultiAutoCompletePresenterWithFreeInput,\n MultiAutoCompleteSelectedOptionPresenter\n} from \"./presenters/index.js\";\nimport { MultiAutoCompleteTemporaryOptionPresenter } from \"~/MultiAutoComplete/primitives/presenters/MultiAutoCompleteTemporaryOptionPresenter.js\";\n\nexport const useMultiAutoComplete = (props: MultiAutoCompletePrimitiveProps) => {\n const params: MultiAutoCompletePresenterParams = useMemo(\n () => ({\n displayResetAction: props.displayResetAction,\n emptyMessage: props.emptyMessage,\n loadingMessage: props.loadingMessage,\n initialMessage: props.initialMessage,\n onOpenChange: props.onOpenChange,\n onValueSearch: props.onValueSearch,\n onValuesChange: props.onValuesChange,\n onValuesReset: props.onValuesReset,\n options: props.options,\n placeholder: props.placeholder,\n values: props.values\n }),\n [\n props.displayResetAction,\n props.emptyMessage,\n props.loadingMessage,\n props.initialMessage,\n props.onOpenChange,\n props.onValueSearch,\n props.onValuesChange,\n props.onValuesReset,\n props.options,\n props.placeholder,\n props.values\n ]\n );\n\n const presenter = useMemo(() => {\n const optionsListPresenter = new MultiAutoCompleteListOptionsPresenter();\n const optionsListWithUniqueValues =\n new MultiAutoCompleteListOptionsPresenterWithUniqueValues(optionsListPresenter);\n\n const inputPresenter = new MultiAutoCompleteInputPresenter();\n const selectedOptionsPresenter = new MultiAutoCompleteSelectedOptionPresenter();\n\n let presenter = new MultiAutoCompletePresenter(\n inputPresenter,\n selectedOptionsPresenter,\n optionsListPresenter\n );\n\n if (props?.uniqueValues) {\n presenter = new MultiAutoCompletePresenter(\n inputPresenter,\n selectedOptionsPresenter,\n optionsListWithUniqueValues\n );\n }\n\n if (props?.allowFreeInput) {\n const temporaryOptionsPresenter = new MultiAutoCompleteTemporaryOptionPresenter();\n const withFreeInputPresenter = new MultiAutoCompletePresenterWithFreeInput(\n temporaryOptionsPresenter,\n presenter\n );\n withFreeInputPresenter.init(params);\n return withFreeInputPresenter;\n } else {\n presenter.init(params);\n return presenter;\n }\n }, [props.allowFreeInput, props.uniqueValues]);\n\n const [vm, setVm] = useState(presenter.vm);\n\n useEffect(() => {\n presenter.init(params);\n }, [params, presenter]);\n\n useEffect(() => {\n return autorun(() => {\n setVm(presenter.vm);\n });\n }, [presenter]);\n\n return {\n vm,\n setSelectedOption: presenter.setSelectedOption,\n removeSelectedOption: presenter.removeSelectedOption,\n searchOption: presenter.searchOption,\n resetSelectedOptions: presenter.resetSelectedOptions,\n setListOpenState: presenter.setListOpenState,\n createOption: presenter.createOption\n };\n};\n"],"names":["useMultiAutoComplete","props","params","useMemo","presenter","optionsListPresenter","MultiAutoCompleteListOptionsPresenter","optionsListWithUniqueValues","MultiAutoCompleteListOptionsPresenterWithUniqueValues","inputPresenter","MultiAutoCompleteInputPresenter","selectedOptionsPresenter","MultiAutoCompleteSelectedOptionPresenter","MultiAutoCompletePresenter","temporaryOptionsPresenter","MultiAutoCompleteTemporaryOptionPresenter","withFreeInputPresenter","MultiAutoCompletePresenterWithFreeInput","vm","setVm","useState","useEffect","autorun"],"mappings":";;;;AAcO,MAAMA,uBAAuB,CAACC;IACjC,MAAMC,SAA2CC,QAC7C,IAAO;YACH,oBAAoBF,MAAM,kBAAkB;YAC5C,cAAcA,MAAM,YAAY;YAChC,gBAAgBA,MAAM,cAAc;YACpC,gBAAgBA,MAAM,cAAc;YACpC,cAAcA,MAAM,YAAY;YAChC,eAAeA,MAAM,aAAa;YAClC,gBAAgBA,MAAM,cAAc;YACpC,eAAeA,MAAM,aAAa;YAClC,SAASA,MAAM,OAAO;YACtB,aAAaA,MAAM,WAAW;YAC9B,QAAQA,MAAM,MAAM;QACxB,IACA;QACIA,MAAM,kBAAkB;QACxBA,MAAM,YAAY;QAClBA,MAAM,cAAc;QACpBA,MAAM,cAAc;QACpBA,MAAM,YAAY;QAClBA,MAAM,aAAa;QACnBA,MAAM,cAAc;QACpBA,MAAM,aAAa;QACnBA,MAAM,OAAO;QACbA,MAAM,WAAW;QACjBA,MAAM,MAAM;KACf;IAGL,MAAMG,YAAYD,QAAQ;QACtB,MAAME,uBAAuB,IAAIC;QACjC,MAAMC,8BACF,IAAIC,sDAAsDH;QAE9D,MAAMI,iBAAiB,IAAIC;QAC3B,MAAMC,2BAA2B,IAAIC;QAErC,IAAIR,YAAY,IAAIS,2BAChBJ,gBACAE,0BACAN;QAGJ,IAAIJ,OAAO,cACPG,YAAY,IAAIS,2BACZJ,gBACAE,0BACAJ;QAIR,IAAIN,OAAO,gBAAgB;YACvB,MAAMa,4BAA4B,IAAIC;YACtC,MAAMC,yBAAyB,IAAIC,wCAC/BH,2BACAV;YAEJY,uBAAuB,IAAI,CAACd;YAC5B,OAAOc;QACX;QACIZ,UAAU,IAAI,CAACF;QACf,OAAOE;IAEf,GAAG;QAACH,MAAM,cAAc;QAAEA,MAAM,YAAY;KAAC;IAE7C,MAAM,CAACiB,IAAIC,MAAM,GAAGC,SAAShB,UAAU,EAAE;IAEzCiB,UAAU;QACNjB,UAAU,IAAI,CAACF;IACnB,GAAG;QAACA;QAAQE;KAAU;IAEtBiB,UAAU,IACCC,QAAQ;YACXH,MAAMf,UAAU,EAAE;QACtB,IACD;QAACA;KAAU;IAEd,OAAO;QACHc;QACA,mBAAmBd,UAAU,iBAAiB;QAC9C,sBAAsBA,UAAU,oBAAoB;QACpD,cAAcA,UAAU,YAAY;QACpC,sBAAsBA,UAAU,oBAAoB;QACpD,kBAAkBA,UAAU,gBAAgB;QAC5C,cAAcA,UAAU,YAAY;IACxC;AACJ"}
1
+ {"version":3,"file":"MultiAutoComplete/primitives/useMultiAutoComplete.js","sources":["../../../src/MultiAutoComplete/primitives/useMultiAutoComplete.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { autorun } from \"mobx\";\nimport type { MultiAutoCompletePrimitiveProps } from \"./MultiAutoCompletePrimitive.js\";\nimport type { MultiAutoCompletePresenterParams } from \"./presenters/index.js\";\nimport {\n MultiAutoCompleteInputPresenter,\n MultiAutoCompleteListOptionsPresenter,\n MultiAutoCompleteListOptionsPresenterWithUniqueValues,\n MultiAutoCompletePresenter,\n MultiAutoCompletePresenterWithFreeInput,\n MultiAutoCompleteSelectedOptionPresenter\n} from \"./presenters/index.js\";\nimport { MultiAutoCompleteTemporaryOptionPresenter } from \"~/MultiAutoComplete/primitives/presenters/MultiAutoCompleteTemporaryOptionPresenter.js\";\n\nexport const useMultiAutoComplete = (props: MultiAutoCompletePrimitiveProps) => {\n const params: MultiAutoCompletePresenterParams = useMemo(\n () => ({\n displayResetAction: props.displayResetAction,\n emptyMessage: props.emptyMessage,\n loadingMessage: props.loadingMessage,\n initialMessage: props.initialMessage,\n onOpenChange: props.onOpenChange,\n onValueSearch: props.onValueSearch,\n onValuesChange: props.onValuesChange,\n onValuesReset: props.onValuesReset,\n options: props.options,\n placeholder: props.placeholder,\n values: props.values\n }),\n [\n props.displayResetAction,\n props.emptyMessage,\n props.loadingMessage,\n props.initialMessage,\n props.onOpenChange,\n props.onValueSearch,\n props.onValuesChange,\n props.onValuesReset,\n props.options,\n props.placeholder,\n props.values\n ]\n );\n\n const presenter = useMemo(() => {\n const optionsListPresenter = new MultiAutoCompleteListOptionsPresenter();\n const optionsListWithUniqueValues =\n new MultiAutoCompleteListOptionsPresenterWithUniqueValues(optionsListPresenter);\n\n const inputPresenter = new MultiAutoCompleteInputPresenter();\n const selectedOptionsPresenter = new MultiAutoCompleteSelectedOptionPresenter();\n\n let presenter = new MultiAutoCompletePresenter(\n inputPresenter,\n selectedOptionsPresenter,\n optionsListPresenter\n );\n\n if (props?.uniqueValues) {\n presenter = new MultiAutoCompletePresenter(\n inputPresenter,\n selectedOptionsPresenter,\n optionsListWithUniqueValues\n );\n }\n\n if (props?.allowFreeInput) {\n const temporaryOptionsPresenter = new MultiAutoCompleteTemporaryOptionPresenter();\n const withFreeInputPresenter = new MultiAutoCompletePresenterWithFreeInput(\n temporaryOptionsPresenter,\n presenter\n );\n withFreeInputPresenter.init(params);\n return withFreeInputPresenter;\n } else {\n presenter.init(params);\n return presenter;\n }\n }, [props.allowFreeInput, props.uniqueValues]);\n\n const [vm, setVm] = useState(presenter.vm);\n\n useEffect(() => {\n presenter.init(params);\n }, [params, presenter]);\n\n useEffect(() => {\n return autorun(() => {\n setVm(presenter.vm);\n });\n }, [presenter]);\n\n return {\n vm,\n setSelectedOption: presenter.setSelectedOption,\n removeSelectedOption: presenter.removeSelectedOption,\n searchOption: presenter.searchOption,\n resetSelectedOptions: presenter.resetSelectedOptions,\n setListOpenState: presenter.setListOpenState,\n createOption: presenter.createOption\n };\n};\n"],"names":["useMultiAutoComplete","props","params","useMemo","presenter","optionsListPresenter","MultiAutoCompleteListOptionsPresenter","optionsListWithUniqueValues","MultiAutoCompleteListOptionsPresenterWithUniqueValues","inputPresenter","MultiAutoCompleteInputPresenter","selectedOptionsPresenter","MultiAutoCompleteSelectedOptionPresenter","MultiAutoCompletePresenter","temporaryOptionsPresenter","MultiAutoCompleteTemporaryOptionPresenter","withFreeInputPresenter","MultiAutoCompletePresenterWithFreeInput","vm","setVm","useState","useEffect","autorun"],"mappings":";;;;AAcO,MAAMA,uBAAuB,CAACC;IACjC,MAAMC,SAA2CC,QAC7C,IAAO;YACH,oBAAoBF,MAAM,kBAAkB;YAC5C,cAAcA,MAAM,YAAY;YAChC,gBAAgBA,MAAM,cAAc;YACpC,gBAAgBA,MAAM,cAAc;YACpC,cAAcA,MAAM,YAAY;YAChC,eAAeA,MAAM,aAAa;YAClC,gBAAgBA,MAAM,cAAc;YACpC,eAAeA,MAAM,aAAa;YAClC,SAASA,MAAM,OAAO;YACtB,aAAaA,MAAM,WAAW;YAC9B,QAAQA,MAAM,MAAM;QACxB,IACA;QACIA,MAAM,kBAAkB;QACxBA,MAAM,YAAY;QAClBA,MAAM,cAAc;QACpBA,MAAM,cAAc;QACpBA,MAAM,YAAY;QAClBA,MAAM,aAAa;QACnBA,MAAM,cAAc;QACpBA,MAAM,aAAa;QACnBA,MAAM,OAAO;QACbA,MAAM,WAAW;QACjBA,MAAM,MAAM;KACf;IAGL,MAAMG,YAAYD,QAAQ;QACtB,MAAME,uBAAuB,IAAIC;QACjC,MAAMC,8BACF,IAAIC,sDAAsDH;QAE9D,MAAMI,iBAAiB,IAAIC;QAC3B,MAAMC,2BAA2B,IAAIC;QAErC,IAAIR,YAAY,IAAIS,2BAChBJ,gBACAE,0BACAN;QAGJ,IAAIJ,OAAO,cACPG,YAAY,IAAIS,2BACZJ,gBACAE,0BACAJ;QAIR,IAAIN,OAAO,gBAAgB;YACvB,MAAMa,4BAA4B,IAAIC;YACtC,MAAMC,yBAAyB,IAAIC,wCAC/BH,2BACAV;YAEJY,uBAAuB,IAAI,CAACd;YAC5B,OAAOc;QACX,OAAO;YACHZ,UAAU,IAAI,CAACF;YACf,OAAOE;QACX;IACJ,GAAG;QAACH,MAAM,cAAc;QAAEA,MAAM,YAAY;KAAC;IAE7C,MAAM,CAACiB,IAAIC,MAAM,GAAGC,SAAShB,UAAU,EAAE;IAEzCiB,UAAU;QACNjB,UAAU,IAAI,CAACF;IACnB,GAAG;QAACA;QAAQE;KAAU;IAEtBiB,UAAU,IACCC,QAAQ;YACXH,MAAMf,UAAU,EAAE;QACtB,IACD;QAACA;KAAU;IAEd,OAAO;QACHc;QACA,mBAAmBd,UAAU,iBAAiB;QAC9C,sBAAsBA,UAAU,oBAAoB;QACpD,cAAcA,UAAU,YAAY;QACpC,sBAAsBA,UAAU,oBAAoB;QACpD,kBAAkBA,UAAU,gBAAgB;QAC5C,cAAcA,UAAU,YAAY;IACxC;AACJ"}
@@ -23,40 +23,40 @@ declare const MultiFilePicker: typeof BaseMultiFilePicker & {
23
23
  }>) => (props: unknown) => React.JSX.Element;
24
24
  } & {
25
25
  Preview: {
26
- Image: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element) & {
27
- original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element;
26
+ Image: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element) & {
27
+ original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element;
28
28
  originalName: string;
29
29
  displayName: string;
30
30
  } & {
31
- original: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element) & {
32
- original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element;
31
+ original: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element) & {
32
+ original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element;
33
33
  originalName: string;
34
34
  displayName: string;
35
35
  };
36
36
  originalName: string;
37
37
  displayName: string;
38
38
  } & {
39
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element) & {
40
- original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element;
39
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element) & {
40
+ original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/primitives/components/index.js").ImagePreviewProps) => React.JSX.Element;
41
41
  originalName: string;
42
42
  displayName: string;
43
43
  }>) => (props: unknown) => React.JSX.Element;
44
44
  };
45
- RichItem: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element) & {
46
- original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element;
45
+ RichItem: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element) & {
46
+ original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element;
47
47
  originalName: string;
48
48
  displayName: string;
49
49
  } & {
50
- original: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element) & {
51
- original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element;
50
+ original: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element) & {
51
+ original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element;
52
52
  originalName: string;
53
53
  displayName: string;
54
54
  };
55
55
  originalName: string;
56
56
  displayName: string;
57
57
  } & {
58
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element) & {
59
- original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element;
58
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element) & {
59
+ original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/primitives/components/index.js").RichItemPreviewProps) => React.JSX.Element;
60
60
  originalName: string;
61
61
  displayName: string;
62
62
  }>) => (props: unknown) => React.JSX.Element;
@@ -43,40 +43,40 @@ declare const MultiFilePickerPrimitive: typeof BaseMultiFilePickerPrimitive & {
43
43
  }>) => (props: unknown) => React.JSX.Element;
44
44
  } & {
45
45
  Preview: {
46
- Image: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element) & {
47
- original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element;
46
+ Image: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element) & {
47
+ original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element;
48
48
  originalName: string;
49
49
  displayName: string;
50
50
  } & {
51
- original: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element) & {
52
- original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element;
51
+ original: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element) & {
52
+ original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element;
53
53
  originalName: string;
54
54
  displayName: string;
55
55
  };
56
56
  originalName: string;
57
57
  displayName: string;
58
58
  } & {
59
- createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<(({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element) & {
60
- original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element;
59
+ createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<(({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element) & {
60
+ original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("~/FilePicker/index.js").ImagePreviewProps) => React.JSX.Element;
61
61
  originalName: string;
62
62
  displayName: string;
63
63
  }>) => (props: unknown) => React.JSX.Element;
64
64
  };
65
- RichItem: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element) & {
66
- original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element;
65
+ RichItem: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element) & {
66
+ original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element;
67
67
  originalName: string;
68
68
  displayName: string;
69
69
  } & {
70
- original: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element) & {
71
- original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element;
70
+ original: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element) & {
71
+ original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element;
72
72
  originalName: string;
73
73
  displayName: string;
74
74
  };
75
75
  originalName: string;
76
76
  displayName: string;
77
77
  } & {
78
- createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<(({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element) & {
79
- original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element;
78
+ createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<(({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element) & {
79
+ original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("~/FilePicker/index.js").RichItemPreviewProps) => React.JSX.Element;
80
80
  originalName: string;
81
81
  displayName: string;
82
82
  }>) => (props: unknown) => React.JSX.Element;