@webiny/admin-ui 6.2.0-beta.0 → 6.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/Accordion/Accordion.d.ts +1 -1
  2. package/Accordion/Accordion.mdx +437 -463
  3. package/Accordion/components/AccordionContent.js.map +1 -1
  4. package/Alert/Alert.d.ts +1 -1
  5. package/Alert/Alert.js.map +1 -1
  6. package/Alert/Alert.mdx +80 -83
  7. package/AutoComplete/AutoComplete.mdx +63 -55
  8. package/Avatar/Avatar.d.ts +1 -1
  9. package/Avatar/Avatar.js.map +1 -1
  10. package/Avatar/Avatar.mdx +52 -43
  11. package/Button/Button.d.ts +1 -1
  12. package/Button/Button.js.map +1 -1
  13. package/Button/Button.mdx +50 -42
  14. package/Button/IconButton.d.ts +1 -1
  15. package/Button/IconButton.js.map +1 -1
  16. package/Card/components/CardContent.d.ts +1 -1
  17. package/Card/components/CardTitle.d.ts +1 -1
  18. package/Checkbox/Checkbox.mdx +51 -49
  19. package/Checkbox/primitives/CheckboxPrimitive.d.ts +1 -1
  20. package/CheckboxGroup/CheckboxGroup.mdx +51 -53
  21. package/CodeEditor/CodeEditor.mdx +44 -43
  22. package/ColorPicker/ColorPicker.mdx +41 -40
  23. package/Command/components/Item.d.ts +1 -1
  24. package/Command/components/Item.js.map +1 -1
  25. package/DataTable/DataTable.mdx +537 -542
  26. package/DataTable/components/ColumnSorter.d.ts +1 -1
  27. package/DataTable/components/ColumnSorter.js.map +1 -1
  28. package/Dialog/Dialog.js.map +1 -1
  29. package/Dialog/components/DialogContent.d.ts +1 -1
  30. package/Dialog/components/DialogContent.js +1 -1
  31. package/Dialog/components/DialogContent.js.map +1 -1
  32. package/Dialog/components/DialogFooter.d.ts +1 -1
  33. package/Dialog/components/DialogFooter.js.map +1 -1
  34. package/Dialog/components/DialogTitle.d.ts +1 -1
  35. package/Drawer/Drawer.js.map +1 -1
  36. package/Drawer/Drawer.mdx +73 -64
  37. package/Drawer/components/DrawerContent.d.ts +1 -1
  38. package/Drawer/components/DrawerContent.js.map +1 -1
  39. package/DropdownMenu/DropdownMenu.js.map +1 -1
  40. package/DropdownMenu/DropdownMenu.mdx +155 -256
  41. package/DropdownMenu/components/DropdownMenuCheckboxItem.js.map +1 -1
  42. package/DropdownMenu/components/DropdownMenuLabel.js.map +1 -1
  43. package/FilePicker/FilePicker.mdx +69 -69
  44. package/FilePicker/primitives/FilePickerPrimitive.d.ts +19 -19
  45. package/FilePicker/primitives/FilePickerPrimitive.js.map +1 -1
  46. package/FilePicker/primitives/components/Trigger.d.ts +1 -1
  47. package/FilePicker/primitives/components/previews/TextOnlyPreview/TextOnlyPreview.d.ts +1 -1
  48. package/FilePicker/primitives/components/previews/variants.d.ts +1 -1
  49. package/FilePicker/primitives/components/types.js.map +1 -1
  50. package/FormComponent/Description.d.ts +1 -1
  51. package/FormComponent/ErrorMessage.d.ts +1 -1
  52. package/FormComponent/Note.d.ts +1 -1
  53. package/Grid/Grid.d.ts +2 -2
  54. package/Grid/Grid.js.map +1 -1
  55. package/Grid/Grid.mdx +111 -121
  56. package/HeaderBar/HeaderBar.mdx +98 -99
  57. package/Heading/Heading.d.ts +1 -1
  58. package/Heading/Heading.js.map +1 -1
  59. package/Heading/Heading.mdx +63 -58
  60. package/Icon/Icon.d.ts +1 -1
  61. package/Icon/Icon.js.map +1 -1
  62. package/Icon/Icon.mdx +79 -147
  63. package/IconPicker/IconPicker.mdx +66 -64
  64. package/IconPicker/primitives/IconPickerPrimitive.d.ts +1 -1
  65. package/IconPicker/primitives/components/IconPickerTrigger.d.ts +1 -1
  66. package/Image/Image.js.map +1 -1
  67. package/Input/Input.mdx +67 -56
  68. package/Input/InputPrimitive.d.ts +1 -1
  69. package/Label/Label.d.ts +1 -1
  70. package/Label/Label.js.map +1 -1
  71. package/Label/Label.mdx +42 -42
  72. package/Label/components/LabelDescription.d.ts +1 -1
  73. package/Label/components/LabelRequired.d.ts +1 -1
  74. package/Label/components/LabelValue.d.ts +1 -1
  75. package/Link/Link.d.ts +1 -1
  76. package/Link/Link.mdx +129 -116
  77. package/List/List.d.ts +1 -1
  78. package/List/List.js.map +1 -1
  79. package/List/List.mdx +317 -329
  80. package/List/components/ListItem.d.ts +1 -1
  81. package/List/components/ListItem.js.map +1 -1
  82. package/Loader/Loader.d.ts +2 -2
  83. package/Loader/Loader.js.map +1 -1
  84. package/Loader/Loader.mdx +96 -91
  85. package/MultiAutoComplete/MultiAutoComplete.mdx +52 -51
  86. package/MultiAutoComplete/primitives/components/MultiAutoCompleteInput.d.ts +1 -1
  87. package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenter.js.map +1 -1
  88. package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenterWithUniqueValues.js.map +1 -1
  89. package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteSelectedOptionsPresenter.js.map +1 -1
  90. package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteTemporaryOptionPresenter.js.map +1 -1
  91. package/MultiFilePicker/MultiFilePicker.mdx +84 -80
  92. package/MultiFilePicker/primitives/MultiFilePickerPrimitive.js.map +1 -1
  93. package/Popover/Popover.mdx +112 -118
  94. package/Popover/primitives/components/PopoverArrow.d.ts +1 -1
  95. package/Popover/primitives/components/PopoverContent.d.ts +1 -1
  96. package/RadioGroup/RadioGroup.mdx +62 -59
  97. package/RadioGroup/primitives/RadioGroupPrimitive.js.map +1 -1
  98. package/RangeSlider/RangeSlider.mdx +48 -47
  99. package/RangeSlider/primitives/RangeSliderPrimitive.js.map +1 -1
  100. package/RangeSlider/primitives/components/RangeSliderValue.d.ts +1 -1
  101. package/RangeSlider/primitives/components/RangeSliderValue.js.map +1 -1
  102. package/ScrollArea/ScrollArea.js.map +1 -1
  103. package/SegmentedControl/SegmentedControl.mdx +59 -59
  104. package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +1 -1
  105. package/SegmentedControl/primitives/SegmentedControlPrimitive.js.map +1 -1
  106. package/Select/Select.mdx +52 -43
  107. package/Select/primitives/components/SelectTrigger.d.ts +1 -1
  108. package/Select/primitives/components/SelectTrigger.js.map +1 -1
  109. package/Select/primitives/presenters/SelectPresenter.d.ts +1 -1
  110. package/Separator/Separator.d.ts +1 -1
  111. package/Separator/Separator.mdx +139 -150
  112. package/Sidebar/Sidebar.js.map +1 -1
  113. package/Sidebar/Sidebar.mdx +66 -88
  114. package/Sidebar/components/items/SidebarMenuSubItemIndentation.d.ts +1 -1
  115. package/Sidebar/components/items/SidebarMenuSubItemIndentation.js.map +1 -1
  116. package/Skeleton/Skeleton.d.ts +1 -1
  117. package/Skeleton/Skeleton.js.map +1 -1
  118. package/Skeleton/Skeleton.mdx +37 -37
  119. package/Slider/Slider.mdx +48 -47
  120. package/Slider/primitives/SliderPrimitive.js.map +1 -1
  121. package/Slider/primitives/components/SliderSideValue.d.ts +1 -1
  122. package/Slider/primitives/components/SliderSideValue.js.map +1 -1
  123. package/Slider/primitives/components/SliderTooltip.d.ts +1 -1
  124. package/SteppedProgress/components/SteppedProgressIcon.d.ts +1 -1
  125. package/SteppedProgress/components/SteppedProgressIcon.js.map +1 -1
  126. package/SteppedProgress/components/SteppedProgressIndicator.d.ts +1 -1
  127. package/SteppedProgress/components/SteppedProgressIndicator.js.map +1 -1
  128. package/Switch/Switch.mdx +44 -42
  129. package/Switch/primitives/SwitchPrimitive.d.ts +1 -1
  130. package/Table/Table.d.ts +1 -1
  131. package/Table/Table.js.map +1 -1
  132. package/Table/components/Direction.d.ts +1 -1
  133. package/Table/components/Direction.js.map +1 -1
  134. package/Table/components/Header.d.ts +1 -1
  135. package/Table/components/Header.js.map +1 -1
  136. package/Table/components/Resizer.d.ts +1 -1
  137. package/Table/components/Resizer.js.map +1 -1
  138. package/Table/components/Row.d.ts +1 -1
  139. package/Table/components/Row.js.map +1 -1
  140. package/Tabs/Tabs.mdx +297 -292
  141. package/Tabs/components/Content.d.ts +1 -1
  142. package/Tabs/components/List.d.ts +1 -1
  143. package/Tabs/components/Trigger.d.ts +1 -1
  144. package/Tag/Tag.d.ts +1 -1
  145. package/Tag/Tag.js.map +1 -1
  146. package/Tag/Tag.mdx +68 -64
  147. package/Tags/primitives/TagsPrimitive.js.map +1 -1
  148. package/Text/Text.d.ts +1 -1
  149. package/Text/Text.mdx +54 -48
  150. package/Textarea/Textarea.mdx +49 -39
  151. package/Textarea/TextareaPrimitive.d.ts +1 -1
  152. package/Textarea/TextareaPrimitive.js.map +1 -1
  153. package/Toast/Toast.mdx +63 -53
  154. package/Toast/components/ToastRoot.d.ts +1 -1
  155. package/Tooltip/Tooltip.mdx +197 -198
  156. package/Tooltip/components/TooltipArrow.d.ts +1 -1
  157. package/Tooltip/components/TooltipContent.d.ts +1 -1
  158. package/Tree/components/Item.d.ts +1 -1
  159. package/Tree/useTree.d.ts +1 -1
  160. package/Widget/components/WidgetContent.d.ts +1 -1
  161. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"names":["makeAutoObservable","CommandOptionFormatter","ListCache","MultiAutoCompleteSelectedOptionPresenter","options","constructor","init","params","length","option","getItem","o","value","addItems","clear","vm","getItems","map","format","empty","hasItems","addOption","removeOption","removeItems","resetOptions"],"sources":["MultiAutoCompleteSelectedOptionsPresenter.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport type { CommandOptionFormatted } from \"~/Command/domain/CommandOptionFormatted.js\";\nimport { CommandOptionFormatter } from \"~/Command/domain/CommandOptionFormatter.js\";\nimport type { CommandOption } from \"~/Command/domain/CommandOption.js\";\nimport { ListCache } from \"../../domains/index.js\";\n\ninterface MultiAutoCompleteSelectedOptionsParams {\n options?: CommandOption[];\n}\n\ninterface IMultiAutoCompleteSelectedOptionsPresenter {\n vm: {\n options: CommandOptionFormatted[];\n empty: boolean;\n };\n init: (params: MultiAutoCompleteSelectedOptionsParams) => void;\n addOption: (option: CommandOption) => void;\n removeOption: (value: string) => void;\n resetOptions: () => void;\n}\n\nclass MultiAutoCompleteSelectedOptionPresenter\n implements IMultiAutoCompleteSelectedOptionsPresenter\n{\n private options = new ListCache<CommandOption>();\n\n constructor() {\n makeAutoObservable(this);\n }\n\n init(params: MultiAutoCompleteSelectedOptionsParams) {\n if (params.options?.length) {\n for (const option of params.options) {\n if (!this.options.getItem(o => o.value === option.value)) {\n this.options.addItems([option]);\n }\n }\n } else {\n // If no options are provided, clear the existing options\n this.options.clear();\n }\n }\n\n get vm() {\n return {\n options: this.options.getItems().map(option => CommandOptionFormatter.format(option)),\n empty: !this.options.hasItems()\n };\n }\n\n public addOption = (option: CommandOption) => {\n this.options.addItems([option]);\n };\n\n public removeOption = (value: string) => {\n this.options.removeItems(option => option.value === value);\n };\n\n public resetOptions = () => {\n this.options.clear();\n };\n}\n\nexport {\n MultiAutoCompleteSelectedOptionPresenter,\n type IMultiAutoCompleteSelectedOptionsPresenter,\n type MultiAutoCompleteSelectedOptionsParams\n};\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AAEzC,SAASC,sBAAsB;AAE/B,SAASC,SAAS;AAiBlB,MAAMC,wCAAwC,CAE9C;EACYC,OAAO,GAAG,IAAIF,SAAS,CAAgB,CAAC;EAEhDG,WAAWA,CAAA,EAAG;IACVL,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAM,IAAIA,CAACC,MAA8C,EAAE;IACjD,IAAIA,MAAM,CAACH,OAAO,EAAEI,MAAM,EAAE;MACxB,KAAK,MAAMC,MAAM,IAAIF,MAAM,CAACH,OAAO,EAAE;QACjC,IAAI,CAAC,IAAI,CAACA,OAAO,CAACM,OAAO,CAACC,CAAC,IAAIA,CAAC,CAACC,KAAK,KAAKH,MAAM,CAACG,KAAK,CAAC,EAAE;UACtD,IAAI,CAACR,OAAO,CAACS,QAAQ,CAAC,CAACJ,MAAM,CAAC,CAAC;QACnC;MACJ;IACJ,CAAC,MAAM;MACH;MACA,IAAI,CAACL,OAAO,CAACU,KAAK,CAAC,CAAC;IACxB;EACJ;EAEA,IAAIC,EAAEA,CAAA,EAAG;IACL,OAAO;MACHX,OAAO,EAAE,IAAI,CAACA,OAAO,CAACY,QAAQ,CAAC,CAAC,CAACC,GAAG,CAACR,MAAM,IAAIR,sBAAsB,CAACiB,MAAM,CAACT,MAAM,CAAC,CAAC;MACrFU,KAAK,EAAE,CAAC,IAAI,CAACf,OAAO,CAACgB,QAAQ,CAAC;IAClC,CAAC;EACL;EAEOC,SAAS,GAAIZ,MAAqB,IAAK;IAC1C,IAAI,CAACL,OAAO,CAACS,QAAQ,CAAC,CAACJ,MAAM,CAAC,CAAC;EACnC,CAAC;EAEMa,YAAY,GAAIV,KAAa,IAAK;IACrC,IAAI,CAACR,OAAO,CAACmB,WAAW,CAACd,MAAM,IAAIA,MAAM,CAACG,KAAK,KAAKA,KAAK,CAAC;EAC9D,CAAC;EAEMY,YAAY,GAAGA,CAAA,KAAM;IACxB,IAAI,CAACpB,OAAO,CAACU,KAAK,CAAC,CAAC;EACxB,CAAC;AACL;AAEA,SACIX,wCAAwC","ignoreList":[]}
1
+ {"version":3,"names":["makeAutoObservable","CommandOptionFormatter","ListCache","MultiAutoCompleteSelectedOptionPresenter","options","constructor","init","params","length","option","getItem","o","value","addItems","clear","vm","getItems","map","format","empty","hasItems","addOption","removeOption","removeItems","resetOptions"],"sources":["MultiAutoCompleteSelectedOptionsPresenter.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport type { CommandOptionFormatted } from \"~/Command/domain/CommandOptionFormatted.js\";\nimport { CommandOptionFormatter } from \"~/Command/domain/CommandOptionFormatter.js\";\nimport type { CommandOption } from \"~/Command/domain/CommandOption.js\";\nimport { ListCache } from \"../../domains/index.js\";\n\ninterface MultiAutoCompleteSelectedOptionsParams {\n options?: CommandOption[];\n}\n\ninterface IMultiAutoCompleteSelectedOptionsPresenter {\n vm: {\n options: CommandOptionFormatted[];\n empty: boolean;\n };\n init: (params: MultiAutoCompleteSelectedOptionsParams) => void;\n addOption: (option: CommandOption) => void;\n removeOption: (value: string) => void;\n resetOptions: () => void;\n}\n\nclass MultiAutoCompleteSelectedOptionPresenter implements IMultiAutoCompleteSelectedOptionsPresenter {\n private options = new ListCache<CommandOption>();\n\n constructor() {\n makeAutoObservable(this);\n }\n\n init(params: MultiAutoCompleteSelectedOptionsParams) {\n if (params.options?.length) {\n for (const option of params.options) {\n if (!this.options.getItem(o => o.value === option.value)) {\n this.options.addItems([option]);\n }\n }\n } else {\n // If no options are provided, clear the existing options\n this.options.clear();\n }\n }\n\n get vm() {\n return {\n options: this.options.getItems().map(option => CommandOptionFormatter.format(option)),\n empty: !this.options.hasItems()\n };\n }\n\n public addOption = (option: CommandOption) => {\n this.options.addItems([option]);\n };\n\n public removeOption = (value: string) => {\n this.options.removeItems(option => option.value === value);\n };\n\n public resetOptions = () => {\n this.options.clear();\n };\n}\n\nexport {\n MultiAutoCompleteSelectedOptionPresenter,\n type IMultiAutoCompleteSelectedOptionsPresenter,\n type MultiAutoCompleteSelectedOptionsParams\n};\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AAEzC,SAASC,sBAAsB;AAE/B,SAASC,SAAS;AAiBlB,MAAMC,wCAAwC,CAAuD;EACzFC,OAAO,GAAG,IAAIF,SAAS,CAAgB,CAAC;EAEhDG,WAAWA,CAAA,EAAG;IACVL,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAM,IAAIA,CAACC,MAA8C,EAAE;IACjD,IAAIA,MAAM,CAACH,OAAO,EAAEI,MAAM,EAAE;MACxB,KAAK,MAAMC,MAAM,IAAIF,MAAM,CAACH,OAAO,EAAE;QACjC,IAAI,CAAC,IAAI,CAACA,OAAO,CAACM,OAAO,CAACC,CAAC,IAAIA,CAAC,CAACC,KAAK,KAAKH,MAAM,CAACG,KAAK,CAAC,EAAE;UACtD,IAAI,CAACR,OAAO,CAACS,QAAQ,CAAC,CAACJ,MAAM,CAAC,CAAC;QACnC;MACJ;IACJ,CAAC,MAAM;MACH;MACA,IAAI,CAACL,OAAO,CAACU,KAAK,CAAC,CAAC;IACxB;EACJ;EAEA,IAAIC,EAAEA,CAAA,EAAG;IACL,OAAO;MACHX,OAAO,EAAE,IAAI,CAACA,OAAO,CAACY,QAAQ,CAAC,CAAC,CAACC,GAAG,CAACR,MAAM,IAAIR,sBAAsB,CAACiB,MAAM,CAACT,MAAM,CAAC,CAAC;MACrFU,KAAK,EAAE,CAAC,IAAI,CAACf,OAAO,CAACgB,QAAQ,CAAC;IAClC,CAAC;EACL;EAEOC,SAAS,GAAIZ,MAAqB,IAAK;IAC1C,IAAI,CAACL,OAAO,CAACS,QAAQ,CAAC,CAACJ,MAAM,CAAC,CAAC;EACnC,CAAC;EAEMa,YAAY,GAAIV,KAAa,IAAK;IACrC,IAAI,CAACR,OAAO,CAACmB,WAAW,CAACd,MAAM,IAAIA,MAAM,CAACG,KAAK,KAAKA,KAAK,CAAC;EAC9D,CAAC;EAEMY,YAAY,GAAGA,CAAA,KAAM;IACxB,IAAI,CAACpB,OAAO,CAACU,KAAK,CAAC,CAAC;EACxB,CAAC;AACL;AAEA,SACIX,wCAAwC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["makeAutoObservable","CommandOption","CommandOptionFormatter","MultiAutoCompleteTemporaryOptionPresenter","option","undefined","constructor","init","vm","format","setOption","value","createFromString","resetOption"],"sources":["MultiAutoCompleteTemporaryOptionPresenter.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport { CommandOption } from \"~/Command/domain/CommandOption.js\";\nimport type { CommandOptionFormatted } from \"~/Command/domain/CommandOptionFormatted.js\";\nimport { CommandOptionFormatter } from \"~/Command/domain/CommandOptionFormatter.js\";\n\nexport interface IMultiAutoCompleteTemporaryOptionPresenter {\n vm: {\n option?: CommandOptionFormatted;\n };\n init: () => void;\n setOption: (value: string) => void;\n resetOption: () => void;\n}\n\nexport class MultiAutoCompleteTemporaryOptionPresenter\n implements IMultiAutoCompleteTemporaryOptionPresenter\n{\n private option?: CommandOption = undefined;\n\n constructor() {\n makeAutoObservable(this);\n }\n\n init() {\n return;\n }\n\n get vm() {\n return {\n option: this.option ? CommandOptionFormatter.format(this.option) : undefined\n };\n }\n\n public setOption = (value: string) => {\n this.option = CommandOption.createFromString(value);\n };\n\n public resetOption = () => {\n this.option = undefined;\n };\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AACzC,SAASC,aAAa;AAEtB,SAASC,sBAAsB;AAW/B,OAAO,MAAMC,yCAAyC,CAEtD;EACYC,MAAM,GAAmBC,SAAS;EAE1CC,WAAWA,CAAA,EAAG;IACVN,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAO,IAAIA,CAAA,EAAG;IACH;EACJ;EAEA,IAAIC,EAAEA,CAAA,EAAG;IACL,OAAO;MACHJ,MAAM,EAAE,IAAI,CAACA,MAAM,GAAGF,sBAAsB,CAACO,MAAM,CAAC,IAAI,CAACL,MAAM,CAAC,GAAGC;IACvE,CAAC;EACL;EAEOK,SAAS,GAAIC,KAAa,IAAK;IAClC,IAAI,CAACP,MAAM,GAAGH,aAAa,CAACW,gBAAgB,CAACD,KAAK,CAAC;EACvD,CAAC;EAEME,WAAW,GAAGA,CAAA,KAAM;IACvB,IAAI,CAACT,MAAM,GAAGC,SAAS;EAC3B,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"names":["makeAutoObservable","CommandOption","CommandOptionFormatter","MultiAutoCompleteTemporaryOptionPresenter","option","undefined","constructor","init","vm","format","setOption","value","createFromString","resetOption"],"sources":["MultiAutoCompleteTemporaryOptionPresenter.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport { CommandOption } from \"~/Command/domain/CommandOption.js\";\nimport type { CommandOptionFormatted } from \"~/Command/domain/CommandOptionFormatted.js\";\nimport { CommandOptionFormatter } from \"~/Command/domain/CommandOptionFormatter.js\";\n\nexport interface IMultiAutoCompleteTemporaryOptionPresenter {\n vm: {\n option?: CommandOptionFormatted;\n };\n init: () => void;\n setOption: (value: string) => void;\n resetOption: () => void;\n}\n\nexport class MultiAutoCompleteTemporaryOptionPresenter implements IMultiAutoCompleteTemporaryOptionPresenter {\n private option?: CommandOption = undefined;\n\n constructor() {\n makeAutoObservable(this);\n }\n\n init() {\n return;\n }\n\n get vm() {\n return {\n option: this.option ? CommandOptionFormatter.format(this.option) : undefined\n };\n }\n\n public setOption = (value: string) => {\n this.option = CommandOption.createFromString(value);\n };\n\n public resetOption = () => {\n this.option = undefined;\n };\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AACzC,SAASC,aAAa;AAEtB,SAASC,sBAAsB;AAW/B,OAAO,MAAMC,yCAAyC,CAAuD;EACjGC,MAAM,GAAmBC,SAAS;EAE1CC,WAAWA,CAAA,EAAG;IACVN,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAO,IAAIA,CAAA,EAAG;IACH;EACJ;EAEA,IAAIC,EAAEA,CAAA,EAAG;IACL,OAAO;MACHJ,MAAM,EAAE,IAAI,CAACA,MAAM,GAAGF,sBAAsB,CAACO,MAAM,CAAC,IAAI,CAACL,MAAM,CAAC,GAAGC;IACvE,CAAC;EACL;EAEOK,SAAS,GAAIC,KAAa,IAAK;IAClC,IAAI,CAACP,MAAM,GAAGH,aAAa,CAACW,gBAAgB,CAACD,KAAK,CAAC;EACvD,CAAC;EAEME,WAAW,GAAGA,CAAA,KAAM;IACvB,IAAI,CAACT,MAAM,GAAGC,SAAS;EAC3B,CAAC;AACL","ignoreList":[]}
@@ -1,6 +1,6 @@
1
- import { Canvas, Meta, Controls } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Meta, Controls } from "@storybook/addon-docs/blocks";
2
2
 
3
- import * as MultiFilePickerStories from './MultiFilePicker.stories';
3
+ import * as MultiFilePickerStories from "./MultiFilePicker.stories";
4
4
 
5
5
  <Meta of={MultiFilePickerStories} />
6
6
 
@@ -13,8 +13,8 @@ The Multi File Picker component allows users to select, preview, and manage mult
13
13
  The MultiFilePicker component is typically used with [Webiny's File Manager](https://www.webiny.com/enterprise-serverless-cms/file-manager) to provide a complete file selection experience.
14
14
 
15
15
  > ⚠️ **Note**: The MultiFilePicker component is designed to work seamlessly with [Webiny's File Manager](https://www.webiny.com/enterprise-serverless-cms/file-manager).
16
- In the Storybook example below, we've used random images from Picsum for demonstration purposes.
17
- However, if you use this example code in a real Webiny project, the MultiFilePicker will integrate with the actual File Manager as expected.
16
+ > In the Storybook example below, we've used random images from Picsum for demonstration purposes.
17
+ > However, if you use this example code in a real Webiny project, the MultiFilePicker will integrate with the actual File Manager as expected.
18
18
 
19
19
  <Canvas of={MultiFilePickerStories.Documentation} source={ { code: `
20
20
  import React, { useState } from "react";
@@ -23,8 +23,8 @@ import { FileManager } from "@webiny/app-admin/components";
23
23
  import type { FileManagerFileItem } from "@webiny/app-admin/base/ui/FileManager";
24
24
 
25
25
  const MultiFilePickerExample = () => {
26
- const [selectedFiles, setSelectedFiles] = useState<FileItemDto[]>([]);
27
- const [validation, setValidation] = useState({ isValid: true, message: "" });
26
+ const [selectedFiles, setSelectedFiles] = useState<FileItemDto[]>([]);
27
+ const [validation, setValidation] = useState({ isValid: true, message: "" });
28
28
 
29
29
  const formatFile = (file: FileManagerFileItem): FileItemDto => {
30
30
  const metaItems = file.meta || [];
@@ -90,22 +90,23 @@ const MultiFilePickerExample = () => {
90
90
  />
91
91
  </div>
92
92
  );
93
+
93
94
  };
94
95
 
95
96
  export default MultiFilePickerExample;
96
97
 
97
98
  ` } }
98
- additionalActions={[
99
- {
100
- title: 'Open in GitHub',
101
- onClick: () => {
102
- window.open(
103
- 'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/MultiFilePicker/MultiFilePicker.tsx',
104
- '_blank'
105
- );
106
- },
107
- }
108
- ]}
99
+ additionalActions={[
100
+ {
101
+ title: 'Open in GitHub',
102
+ onClick: () => {
103
+ window.open(
104
+ 'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/MultiFilePicker/MultiFilePicker.tsx',
105
+ '_blank'
106
+ );
107
+ },
108
+ }
109
+ ]}
109
110
  />
110
111
 
111
112
  <Controls of={MultiFilePickerStories.Documentation} />
@@ -117,73 +118,76 @@ import { FileManager } from "@webiny/app-admin/components";
117
118
  import type { FileManagerFileItem } from "@webiny/app-admin/base/ui/FileManager";
118
119
 
119
120
  const MultiFilePickerExample = () => {
120
- const [selectedFiles, setSelectedFiles] = useState<FileItemDto[]>([]);
121
- const [validation, setValidation] = useState({ isValid: true, message: "" });
121
+ const [selectedFiles, setSelectedFiles] = useState<FileItemDto[]>([]);
122
+ const [validation, setValidation] = useState({ isValid: true, message: "" });
122
123
 
123
- const formatFile = (file: FileManagerFileItem): FileItemDto => {
124
- const metaItems = file.meta || [];
124
+ const formatFile = (file: FileManagerFileItem): FileItemDto => {
125
+ const metaItems = file.meta || [];
125
126
 
126
- const getValue = (key: string) =>
127
- metaItems.find((item: { key: string }) => item.key === key)?.value;
127
+ const getValue = (key: string) =>
128
+ metaItems.find((item: { key: string }) => item.key === key)?.value;
128
129
 
129
- return {
130
- id: file.id,
131
- name: getValue("name") || "",
132
- size: getValue("size") || 0,
133
- mimeType: getValue("type") || "",
134
- url: file.src || ""
135
- };
130
+ return {
131
+ id: file.id,
132
+ name: getValue("name") || "",
133
+ size: getValue("size") || 0,
134
+ mimeType: getValue("type") || "",
135
+ url: file.src || ""
136
136
  };
137
-
138
- return (
139
- <div>
140
- <FileManager
141
- accept={["image/*", "application/pdf"]}
142
- multiple={true}
143
- render={({ showFileManager }) => (
144
- <MultiFilePicker
145
- label="Upload Images"
146
- description="Select files to upload (JPG, PNG, PDF)"
147
- note="Note: Maximum file size is 5MB per file"
148
- type="area"
149
- required={true}
150
- values={selectedFiles}
151
- validation={validation}
152
- onSelectItem={() => {
153
- showFileManager(files => {
154
- if (files && Array.isArray(files) && files.length > 0) {
155
- const formatted = files.map(formatFile);
156
- setSelectedFiles(prev => [...prev, ...formatted]);
157
- setValidation({ isValid: true, message: "" });
158
- }
159
- });
160
- }}
161
- onReplaceItem={(_, index) => {
162
- // For replacing, we'll use the first file from the selection
163
- showFileManager(files => {
164
- if (files && Array.isArray(files) && files.length > 0) {
165
- const updated = [...selectedFiles];
166
- updated[index] = formatFile(files[0]);
167
- setSelectedFiles(updated);
168
- }
169
- });
170
- }}
171
- onRemoveItem={(_, index) => {
172
- const updated = [...selectedFiles];
173
- updated.splice(index, 1);
174
- if (updated.length === 0) {
175
- setValidation({ isValid: false, message: "Please select at least one file" });
176
- }
177
- setSelectedFiles(updated);
178
- }}
179
- onEditItem={(file, index) => {
180
- alert(`Editing: ${file?.name} at index ${index}`);
181
- }}
182
- />
183
- )}
184
- />
185
- </div>
186
- );
137
+ };
138
+
139
+ return (
140
+ <div>
141
+ <FileManager
142
+ accept={["image/*", "application/pdf"]}
143
+ multiple={true}
144
+ render={({ showFileManager }) => (
145
+ <MultiFilePicker
146
+ label="Upload Images"
147
+ description="Select files to upload (JPG, PNG, PDF)"
148
+ note="Note: Maximum file size is 5MB per file"
149
+ type="area"
150
+ required={true}
151
+ values={selectedFiles}
152
+ validation={validation}
153
+ onSelectItem={() => {
154
+ showFileManager(files => {
155
+ if (files && Array.isArray(files) && files.length > 0) {
156
+ const formatted = files.map(formatFile);
157
+ setSelectedFiles(prev => [...prev, ...formatted]);
158
+ setValidation({ isValid: true, message: "" });
159
+ }
160
+ });
161
+ }}
162
+ onReplaceItem={(_, index) => {
163
+ // For replacing, we'll use the first file from the selection
164
+ showFileManager(files => {
165
+ if (files && Array.isArray(files) && files.length > 0) {
166
+ const updated = [...selectedFiles];
167
+ updated[index] = formatFile(files[0]);
168
+ setSelectedFiles(updated);
169
+ }
170
+ });
171
+ }}
172
+ onRemoveItem={(_, index) => {
173
+ const updated = [...selectedFiles];
174
+ updated.splice(index, 1);
175
+ if (updated.length === 0) {
176
+ setValidation({
177
+ isValid: false,
178
+ message: "Please select at least one file"
179
+ });
180
+ }
181
+ setSelectedFiles(updated);
182
+ }}
183
+ onEditItem={(file, index) => {
184
+ alert(`Editing: ${file?.name} at index ${index}`);
185
+ }}
186
+ />
187
+ )}
188
+ />
189
+ </div>
190
+ );
187
191
  };
188
192
 
189
193
  export default MultiFilePickerExample;
@@ -1 +1 @@
1
- {"version":3,"names":["React","FilePickerDescription","FilePickerLabel","filePickerVariants","FilePreview","ImagePreview","RichItemPreview","TextOnlyPreview","Trigger","cn","makeDecoratable","withStaticProps","Button","inputVariants","useMultiFilePicker","BaseMultiFilePickerPrimitive","className","buttonPlaceholder","containerStyle","description","disabled","invalid","label","onEditItem","onRemoveItem","onReplaceItem","onSelectItem","placeholder","renderFilePreview","renderTrigger","type","values","variant","vm","createElement","style","text","onClick","size","hasFiles","files","map","file","i","key","undefined","value","DecoratableMultiFilePickerPrimitive","MultiFilePickerPrimitive","Preview","Image","RichItem","TextOnly"],"sources":["MultiFilePickerPrimitive.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n type FileItemDto,\n type FileItemFormatted,\n FilePickerDescription,\n FilePickerLabel,\n type FilePickerPrimitiveProps,\n filePickerVariants,\n FilePreview,\n ImagePreview,\n RichItemPreview,\n TextOnlyPreview,\n Trigger\n} from \"~/FilePicker/index.js\";\nimport { cn, makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { inputVariants } from \"~/Input/index.js\";\nimport { useMultiFilePicker } from \"~/MultiFilePicker/primitives/useMultiFilePicker.js\";\n\ninterface MultiFilePickerPrimitiveProps\n extends Omit<FilePickerPrimitiveProps, \"value\" | \"onEditItem\" | \"onRemoveItem\"> {\n /**\n * The list of file items or file paths.\n */\n values?: FileItemDto[] | string[] | null;\n /**\n * Placeholder text for the button that allows users to select a file.\n */\n buttonPlaceholder?: string;\n /**\n * Callback function to replace an item.\n */\n onReplaceItem: (item: FileItemFormatted | null, index: number) => void;\n /**\n * Optional callback function to edit an item.\n */\n onEditItem?: (item: FileItemFormatted | null, index: number) => void;\n /**\n * Optional callback function to remove an item.\n */\n onRemoveItem?: (item: FileItemFormatted | null, index: number) => void;\n}\n\nconst BaseMultiFilePickerPrimitive = ({\n className,\n buttonPlaceholder,\n containerStyle,\n description,\n disabled,\n invalid,\n label,\n onEditItem,\n onRemoveItem,\n onReplaceItem,\n onSelectItem,\n placeholder,\n renderFilePreview,\n renderTrigger,\n type = \"area\",\n values = [],\n variant\n}: MultiFilePickerPrimitiveProps) => {\n const { vm } = useMultiFilePicker({ values });\n\n return (\n <div\n data-disabled={disabled}\n className={cn(\n inputVariants({ variant, invalid }),\n filePickerVariants({ type, variant }),\n \"max-h-[280px]\",\n className\n )}\n style={containerStyle}\n >\n {type === \"area\" && (label || description) && (\n <div className={\"w-full flex justify-between\"}>\n <div className={\"w-full\"}>\n {label && (\n <div className={\"mb-xs\"}>\n {typeof label === \"string\" ? (\n <FilePickerLabel\n label={label}\n className={\"m-0\"}\n disabled={disabled}\n />\n ) : (\n label\n )}\n </div>\n )}\n {description && (\n <FilePickerDescription\n description={description}\n disabled={disabled}\n className={\"m-0\"}\n />\n )}\n </div>\n <Button\n text={buttonPlaceholder ?? \"Select a file\"}\n variant={\"ghost\"}\n onClick={onSelectItem}\n size={\"sm\"}\n disabled={disabled}\n />\n </div>\n )}\n {vm.hasFiles ? (\n <div className=\"w-full overflow-y-scroll flex flex-col gap-xs\">\n {vm.files.map((file, i) => (\n <FilePreview\n key={`file-preview-${i}`}\n disabled={disabled}\n onEditItem={onEditItem ? () => onEditItem(file, i) : undefined}\n onRemoveItem={onRemoveItem ? () => onRemoveItem(file, i) : undefined}\n onReplaceItem={onReplaceItem ? () => onReplaceItem(file, i) : undefined}\n renderFilePreview={renderFilePreview}\n type={type}\n value={file}\n />\n ))}\n </div>\n ) : (\n <Trigger\n disabled={disabled}\n onSelectItem={onSelectItem}\n renderTrigger={renderTrigger}\n text={placeholder}\n type={type}\n variant={variant}\n />\n )}\n </div>\n );\n};\n\nconst DecoratableMultiFilePickerPrimitive = makeDecoratable(\n \"MultiFilePickerPrimitive\",\n BaseMultiFilePickerPrimitive\n);\n\nconst MultiFilePickerPrimitive = withStaticProps(DecoratableMultiFilePickerPrimitive, {\n Preview: {\n Image: ImagePreview,\n RichItem: RichItemPreview,\n TextOnly: TextOnlyPreview\n }\n});\n\nexport {\n MultiFilePickerPrimitive,\n type FileItemFormatted,\n type FileItemDto,\n type MultiFilePickerPrimitiveProps\n};\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"names":["React","FilePickerDescription","FilePickerLabel","filePickerVariants","FilePreview","ImagePreview","RichItemPreview","TextOnlyPreview","Trigger","cn","makeDecoratable","withStaticProps","Button","inputVariants","useMultiFilePicker","BaseMultiFilePickerPrimitive","className","buttonPlaceholder","containerStyle","description","disabled","invalid","label","onEditItem","onRemoveItem","onReplaceItem","onSelectItem","placeholder","renderFilePreview","renderTrigger","type","values","variant","vm","createElement","style","text","onClick","size","hasFiles","files","map","file","i","key","undefined","value","DecoratableMultiFilePickerPrimitive","MultiFilePickerPrimitive","Preview","Image","RichItem","TextOnly"],"sources":["MultiFilePickerPrimitive.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n type FileItemDto,\n type FileItemFormatted,\n FilePickerDescription,\n FilePickerLabel,\n type FilePickerPrimitiveProps,\n filePickerVariants,\n FilePreview,\n ImagePreview,\n RichItemPreview,\n TextOnlyPreview,\n Trigger\n} from \"~/FilePicker/index.js\";\nimport { cn, makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { inputVariants } from \"~/Input/index.js\";\nimport { useMultiFilePicker } from \"~/MultiFilePicker/primitives/useMultiFilePicker.js\";\n\ninterface MultiFilePickerPrimitiveProps extends Omit<\n FilePickerPrimitiveProps,\n \"value\" | \"onEditItem\" | \"onRemoveItem\"\n> {\n /**\n * The list of file items or file paths.\n */\n values?: FileItemDto[] | string[] | null;\n /**\n * Placeholder text for the button that allows users to select a file.\n */\n buttonPlaceholder?: string;\n /**\n * Callback function to replace an item.\n */\n onReplaceItem: (item: FileItemFormatted | null, index: number) => void;\n /**\n * Optional callback function to edit an item.\n */\n onEditItem?: (item: FileItemFormatted | null, index: number) => void;\n /**\n * Optional callback function to remove an item.\n */\n onRemoveItem?: (item: FileItemFormatted | null, index: number) => void;\n}\n\nconst BaseMultiFilePickerPrimitive = ({\n className,\n buttonPlaceholder,\n containerStyle,\n description,\n disabled,\n invalid,\n label,\n onEditItem,\n onRemoveItem,\n onReplaceItem,\n onSelectItem,\n placeholder,\n renderFilePreview,\n renderTrigger,\n type = \"area\",\n values = [],\n variant\n}: MultiFilePickerPrimitiveProps) => {\n const { vm } = useMultiFilePicker({ values });\n\n return (\n <div\n data-disabled={disabled}\n className={cn(\n inputVariants({ variant, invalid }),\n filePickerVariants({ type, variant }),\n \"max-h-[280px]\",\n className\n )}\n style={containerStyle}\n >\n {type === \"area\" && (label || description) && (\n <div className={\"w-full flex justify-between\"}>\n <div className={\"w-full\"}>\n {label && (\n <div className={\"mb-xs\"}>\n {typeof label === \"string\" ? (\n <FilePickerLabel\n label={label}\n className={\"m-0\"}\n disabled={disabled}\n />\n ) : (\n label\n )}\n </div>\n )}\n {description && (\n <FilePickerDescription\n description={description}\n disabled={disabled}\n className={\"m-0\"}\n />\n )}\n </div>\n <Button\n text={buttonPlaceholder ?? \"Select a file\"}\n variant={\"ghost\"}\n onClick={onSelectItem}\n size={\"sm\"}\n disabled={disabled}\n />\n </div>\n )}\n {vm.hasFiles ? (\n <div className=\"w-full overflow-y-scroll flex flex-col gap-xs\">\n {vm.files.map((file, i) => (\n <FilePreview\n key={`file-preview-${i}`}\n disabled={disabled}\n onEditItem={onEditItem ? () => onEditItem(file, i) : undefined}\n onRemoveItem={onRemoveItem ? () => onRemoveItem(file, i) : undefined}\n onReplaceItem={onReplaceItem ? () => onReplaceItem(file, i) : undefined}\n renderFilePreview={renderFilePreview}\n type={type}\n value={file}\n />\n ))}\n </div>\n ) : (\n <Trigger\n disabled={disabled}\n onSelectItem={onSelectItem}\n renderTrigger={renderTrigger}\n text={placeholder}\n type={type}\n variant={variant}\n />\n )}\n </div>\n );\n};\n\nconst DecoratableMultiFilePickerPrimitive = makeDecoratable(\n \"MultiFilePickerPrimitive\",\n BaseMultiFilePickerPrimitive\n);\n\nconst MultiFilePickerPrimitive = withStaticProps(DecoratableMultiFilePickerPrimitive, {\n Preview: {\n Image: ImagePreview,\n RichItem: RichItemPreview,\n TextOnly: TextOnlyPreview\n }\n});\n\nexport {\n MultiFilePickerPrimitive,\n type FileItemFormatted,\n type FileItemDto,\n type MultiFilePickerPrimitiveProps\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAGIC,qBAAqB,EACrBC,eAAe,EAEfC,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZC,eAAe,EACfC,eAAe,EACfC,OAAO;AAEX,SAASC,EAAE,EAAEC,eAAe,EAAEC,eAAe;AAC7C,SAASC,MAAM;AACf,SAASC,aAAa;AACtB,SAASC,kBAAkB;AA4B3B,MAAMC,4BAA4B,GAAGA,CAAC;EAClCC,SAAS;EACTC,iBAAiB;EACjBC,cAAc;EACdC,WAAW;EACXC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,UAAU;EACVC,YAAY;EACZC,aAAa;EACbC,YAAY;EACZC,WAAW;EACXC,iBAAiB;EACjBC,aAAa;EACbC,IAAI,GAAG,MAAM;EACbC,MAAM,GAAG,EAAE;EACXC;AAC2B,CAAC,KAAK;EACjC,MAAM;IAAEC;EAAG,CAAC,GAAGnB,kBAAkB,CAAC;IAAEiB;EAAO,CAAC,CAAC;EAE7C,oBACI/B,KAAA,CAAAkC,aAAA;IACI,iBAAed,QAAS;IACxBJ,SAAS,EAAEP,EAAE,CACTI,aAAa,CAAC;MAAEmB,OAAO;MAAEX;IAAQ,CAAC,CAAC,EACnClB,kBAAkB,CAAC;MAAE2B,IAAI;MAAEE;IAAQ,CAAC,CAAC,EACrC,eAAe,EACfhB,SACJ,CAAE;IACFmB,KAAK,EAAEjB;EAAe,GAErBY,IAAI,KAAK,MAAM,KAAKR,KAAK,IAAIH,WAAW,CAAC,iBACtCnB,KAAA,CAAAkC,aAAA;IAAKlB,SAAS,EAAE;EAA8B,gBAC1ChB,KAAA,CAAAkC,aAAA;IAAKlB,SAAS,EAAE;EAAS,GACpBM,KAAK,iBACFtB,KAAA,CAAAkC,aAAA;IAAKlB,SAAS,EAAE;EAAQ,GACnB,OAAOM,KAAK,KAAK,QAAQ,gBACtBtB,KAAA,CAAAkC,aAAA,CAAChC,eAAe;IACZoB,KAAK,EAAEA,KAAM;IACbN,SAAS,EAAE,KAAM;IACjBI,QAAQ,EAAEA;EAAS,CACtB,CAAC,GAEFE,KAEH,CACR,EACAH,WAAW,iBACRnB,KAAA,CAAAkC,aAAA,CAACjC,qBAAqB;IAClBkB,WAAW,EAAEA,WAAY;IACzBC,QAAQ,EAAEA,QAAS;IACnBJ,SAAS,EAAE;EAAM,CACpB,CAEJ,CAAC,eACNhB,KAAA,CAAAkC,aAAA,CAACtB,MAAM;IACHwB,IAAI,EAAEnB,iBAAiB,IAAI,eAAgB;IAC3Ce,OAAO,EAAE,OAAQ;IACjBK,OAAO,EAAEX,YAAa;IACtBY,IAAI,EAAE,IAAK;IACXlB,QAAQ,EAAEA;EAAS,CACtB,CACA,CACR,EACAa,EAAE,CAACM,QAAQ,gBACRvC,KAAA,CAAAkC,aAAA;IAAKlB,SAAS,EAAC;EAA+C,GACzDiB,EAAE,CAACO,KAAK,CAACC,GAAG,CAAC,CAACC,IAAI,EAAEC,CAAC,kBAClB3C,KAAA,CAAAkC,aAAA,CAAC9B,WAAW;IACRwC,GAAG,EAAE,gBAAgBD,CAAC,EAAG;IACzBvB,QAAQ,EAAEA,QAAS;IACnBG,UAAU,EAAEA,UAAU,GAAG,MAAMA,UAAU,CAACmB,IAAI,EAAEC,CAAC,CAAC,GAAGE,SAAU;IAC/DrB,YAAY,EAAEA,YAAY,GAAG,MAAMA,YAAY,CAACkB,IAAI,EAAEC,CAAC,CAAC,GAAGE,SAAU;IACrEpB,aAAa,EAAEA,aAAa,GAAG,MAAMA,aAAa,CAACiB,IAAI,EAAEC,CAAC,CAAC,GAAGE,SAAU;IACxEjB,iBAAiB,EAAEA,iBAAkB;IACrCE,IAAI,EAAEA,IAAK;IACXgB,KAAK,EAAEJ;EAAK,CACf,CACJ,CACA,CAAC,gBAEN1C,KAAA,CAAAkC,aAAA,CAAC1B,OAAO;IACJY,QAAQ,EAAEA,QAAS;IACnBM,YAAY,EAAEA,YAAa;IAC3BG,aAAa,EAAEA,aAAc;IAC7BO,IAAI,EAAET,WAAY;IAClBG,IAAI,EAAEA,IAAK;IACXE,OAAO,EAAEA;EAAQ,CACpB,CAEJ,CAAC;AAEd,CAAC;AAED,MAAMe,mCAAmC,GAAGrC,eAAe,CACvD,0BAA0B,EAC1BK,4BACJ,CAAC;AAED,MAAMiC,wBAAwB,GAAGrC,eAAe,CAACoC,mCAAmC,EAAE;EAClFE,OAAO,EAAE;IACLC,KAAK,EAAE7C,YAAY;IACnB8C,QAAQ,EAAE7C,eAAe;IACzB8C,QAAQ,EAAE7C;EACd;AACJ,CAAC,CAAC;AAEF,SACIyC,wBAAwB","ignoreList":[]}
@@ -1,6 +1,6 @@
1
- import { Canvas, Meta, Controls } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Meta, Controls } from "@storybook/addon-docs/blocks";
2
2
 
3
- import * as PopoverStories from './Popover.stories';
3
+ import * as PopoverStories from "./Popover.stories";
4
4
 
5
5
  <Meta of={PopoverStories} />
6
6
 
@@ -15,41 +15,40 @@ import React from "react";
15
15
  import { Popover } from "@webiny/admin-ui";
16
16
 
17
17
  const PopoverExample = () => {
18
- return (
19
- <div className="bg-[#f4f4f4] flex items-center justify-center w-full h-[300px]">
20
- <Popover
21
- trigger={<p>Popover trigger</p>}
22
- content={
23
- <div className={"w-[260px]"}>
24
- <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi
25
- lectus leo, dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor
26
- tempus.
27
- </div>
28
- }
29
- align="center"
30
- side="bottom"
31
- variant="subtle"
32
- arrow={false}
33
- close={false}
34
- />
35
- </div>
36
- );
37
- };
18
+ return (
19
+
20
+ <div className="bg-[#f4f4f4] flex items-center justify-center w-full h-[300px]">
21
+ <Popover
22
+ trigger={<p>Popover trigger</p>}
23
+ content={
24
+ <div className={"w-[260px]"}>
25
+ <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi lectus leo,
26
+ dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor tempus.
27
+ </div>
28
+ }
29
+ align="center"
30
+ side="bottom"
31
+ variant="subtle"
32
+ arrow={false}
33
+ close={false}
34
+ />
35
+ </div>
36
+ ); };
38
37
 
39
38
  export default PopoverExample;
40
39
 
41
40
  ` } }
42
- additionalActions={[
43
- {
44
- title: 'Open in GitHub',
45
- onClick: () => {
46
- window.open(
47
- 'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/Popover/Popover.tsx',
48
- '_blank'
49
- );
50
- },
51
- }
52
- ]}
41
+ additionalActions={[
42
+ {
43
+ title: 'Open in GitHub',
44
+ onClick: () => {
45
+ window.open(
46
+ 'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/Popover/Popover.tsx',
47
+ '_blank'
48
+ );
49
+ },
50
+ }
51
+ ]}
53
52
  />
54
53
 
55
54
  <Controls of={PopoverStories.Documentation} />
@@ -59,25 +58,24 @@ import React from "react";
59
58
  import { Popover } from "@webiny/admin-ui";
60
59
 
61
60
  const PopoverExample = () => {
62
- return (
63
- <div className="bg-[#f4f4f4] flex items-center justify-center w-full h-[300px]">
64
- <Popover
65
- trigger={<p>Popover trigger</p>}
66
- content={
67
- <div className={"w-[260px]"}>
68
- <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi
69
- lectus leo, dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor
70
- tempus.
71
- </div>
72
- }
73
- align="center"
74
- side="bottom"
75
- variant="subtle"
76
- arrow={false}
77
- close={false}
78
- />
79
- </div>
80
- );
61
+ return (
62
+ <div className="bg-[#f4f4f4] flex items-center justify-center w-full h-[300px]">
63
+ <Popover
64
+ trigger={<p>Popover trigger</p>}
65
+ content={
66
+ <div className={"w-[260px]"}>
67
+ <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi lectus
68
+ leo, dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor tempus.
69
+ </div>
70
+ }
71
+ align="center"
72
+ side="bottom"
73
+ variant="subtle"
74
+ arrow={false}
75
+ close={false}
76
+ />
77
+ </div>
78
+ );
81
79
  };
82
80
 
83
81
  export default PopoverExample;
@@ -94,22 +92,21 @@ import React from "react";
94
92
  import { Popover } from "@webiny/admin-ui";
95
93
 
96
94
  const AccentVariantExample = () => {
97
- return (
98
- <div className="bg-[#f4f4f4] flex items-center justify-center w-full h-[300px]">
99
- <Popover
100
- trigger={<p>Popover trigger</p>}
101
- content={
102
- <div className={"w-[260px]"}>
103
- <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi
104
- lectus leo, dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor
105
- tempus.
106
- </div>
107
- }
108
- variant="accent"
109
- />
110
- </div>
111
- );
112
- };
95
+ return (
96
+
97
+ <div className="bg-[#f4f4f4] flex items-center justify-center w-full h-[300px]">
98
+ <Popover
99
+ trigger={<p>Popover trigger</p>}
100
+ content={
101
+ <div className={"w-[260px]"}>
102
+ <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi lectus leo,
103
+ dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor tempus.
104
+ </div>
105
+ }
106
+ variant="accent"
107
+ />
108
+ </div>
109
+ ); };
113
110
 
114
111
  export default AccentVariantExample;
115
112
  ` } } />
@@ -123,23 +120,22 @@ import React from "react";
123
120
  import { Popover } from "@webiny/admin-ui";
124
121
 
125
122
  const WithArrowAccentExample = () => {
126
- return (
127
- <div className="bg-[#f4f4f4] flex items-center justify-center w-full h-[300px]">
128
- <Popover
129
- trigger={<p>Popover trigger</p>}
130
- content={
131
- <div className={"w-[260px]"}>
132
- <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi
133
- lectus leo, dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor
134
- tempus.
135
- </div>
136
- }
137
- variant="accent"
138
- arrow={true}
139
- />
140
- </div>
141
- );
142
- };
123
+ return (
124
+
125
+ <div className="bg-[#f4f4f4] flex items-center justify-center w-full h-[300px]">
126
+ <Popover
127
+ trigger={<p>Popover trigger</p>}
128
+ content={
129
+ <div className={"w-[260px]"}>
130
+ <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi lectus leo,
131
+ dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor tempus.
132
+ </div>
133
+ }
134
+ variant="accent"
135
+ arrow={true}
136
+ />
137
+ </div>
138
+ ); };
143
139
 
144
140
  export default WithArrowAccentExample;
145
141
  ` } } />
@@ -153,22 +149,21 @@ import React from "react";
153
149
  import { Popover } from "@webiny/admin-ui";
154
150
 
155
151
  const SubtleVariantExample = () => {
156
- return (
157
- <div className="flex items-center justify-center bg-neutral-dark text-neutral-light w-full h-[300px]">
158
- <Popover
159
- trigger={<p>Popover trigger</p>}
160
- content={
161
- <div className={"w-[260px]"}>
162
- <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi
163
- lectus leo, dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor
164
- tempus.
165
- </div>
166
- }
167
- variant="subtle"
168
- />
169
- </div>
170
- );
171
- };
152
+ return (
153
+
154
+ <div className="flex items-center justify-center bg-neutral-dark text-neutral-light w-full h-[300px]">
155
+ <Popover
156
+ trigger={<p>Popover trigger</p>}
157
+ content={
158
+ <div className={"w-[260px]"}>
159
+ <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi lectus leo,
160
+ dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor tempus.
161
+ </div>
162
+ }
163
+ variant="subtle"
164
+ />
165
+ </div>
166
+ ); };
172
167
 
173
168
  export default SubtleVariantExample;
174
169
  ` } } />
@@ -182,23 +177,22 @@ import React from "react";
182
177
  import { Popover } from "@webiny/admin-ui";
183
178
 
184
179
  const WithArrowSubtleExample = () => {
185
- return (
186
- <div className="flex items-center justify-center bg-neutral-dark text-neutral-light w-full h-[300px]">
187
- <Popover
188
- trigger={<p>Popover trigger</p>}
189
- content={
190
- <div className={"w-[260px]"}>
191
- <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi
192
- lectus leo, dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor
193
- tempus.
194
- </div>
195
- }
196
- variant="subtle"
197
- arrow={true}
198
- />
199
- </div>
200
- );
201
- };
180
+ return (
181
+
182
+ <div className="flex items-center justify-center bg-neutral-dark text-neutral-light w-full h-[300px]">
183
+ <Popover
184
+ trigger={<p>Popover trigger</p>}
185
+ content={
186
+ <div className={"w-[260px]"}>
187
+ <strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing elit. Morbi lectus leo,
188
+ dapibus vitae mollis dictum, vulputate eget lorem. Aliquam rutrum auctor tempus.
189
+ </div>
190
+ }
191
+ variant="subtle"
192
+ arrow={true}
193
+ />
194
+ </div>
195
+ ); };
202
196
 
203
197
  export default WithArrowSubtleExample;
204
198
  ` } } />
@@ -3,7 +3,7 @@ import { Popover as PopoverPrimitive } from "radix-ui";
3
3
  import { type VariantProps } from "../../../utils.js";
4
4
  declare const popoverArrowVariants: (props?: ({
5
5
  variant?: "accent" | "subtle" | null | undefined;
6
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  type PopoverArrowProps = PopoverPrimitive.PopoverArrowProps & VariantProps<typeof popoverArrowVariants>;
8
8
  declare const PopoverArrow: ({ variant, className, ...props }: PopoverArrowProps) => React.JSX.Element;
9
9
  export { PopoverArrow, type PopoverArrowProps };
@@ -4,7 +4,7 @@ import { type VariantProps } from "../../../utils.js";
4
4
  declare const popoverContentVariants: (props?: ({
5
5
  variant?: "accent" | "subtle" | null | undefined;
6
6
  arrow?: boolean | null | undefined;
7
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  type PopoverContentProps = PopoverPrimitive.PopoverContentProps & VariantProps<typeof popoverContentVariants>;
9
9
  declare const PopoverContent: ({ className, variant, arrow, align, sideOffset, collisionPadding, ...props }: PopoverContentProps) => React.JSX.Element;
10
10
  export { PopoverContent, type PopoverContentProps };