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

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 (94) 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/BetaBadge/BetaBadge.d.ts +6 -0
  11. package/BetaBadge/BetaBadge.js +7 -0
  12. package/BetaBadge/BetaBadge.js.map +1 -0
  13. package/Breadcrumbs/Breadcrumbs.d.ts +54 -0
  14. package/Breadcrumbs/Breadcrumbs.js +66 -0
  15. package/Breadcrumbs/Breadcrumbs.js.map +1 -0
  16. package/Breadcrumbs/Breadcrumbs.stories.d.ts +9 -0
  17. package/Breadcrumbs/Breadcrumbs.stories.js +71 -0
  18. package/Breadcrumbs/Breadcrumbs.stories.js.map +1 -0
  19. package/Breadcrumbs/index.d.ts +1 -0
  20. package/Breadcrumbs/index.js +1 -0
  21. package/Calendar/calendarClassNames.js +1 -1
  22. package/Calendar/calendarClassNames.js.map +1 -1
  23. package/CodeEditor/CodeEditorPrimitive.js +3 -1
  24. package/CodeEditor/CodeEditorPrimitive.js.map +1 -1
  25. package/DataTable/DataTable.d.ts +16 -6
  26. package/DataTable/DataTable.js +18 -7
  27. package/DataTable/DataTable.js.map +1 -1
  28. package/DataTable/components/ColumnsVisibility.d.ts +5 -4
  29. package/DataTable/components/ColumnsVisibility.js +7 -3
  30. package/DataTable/components/ColumnsVisibility.js.map +1 -1
  31. package/DatePicker/primitives/DateTimePicker.d.ts +1 -1
  32. package/DatePicker/primitives/DateTimePicker.js +15 -3
  33. package/DatePicker/primitives/DateTimePicker.js.map +1 -1
  34. package/DatePicker/primitives/components/DatePickerTrigger.js +1 -1
  35. package/DatePicker/primitives/components/DatePickerTrigger.js.map +1 -1
  36. package/DatePicker/utils/types.d.ts +2 -0
  37. package/DropdownMenu/components/DropdownMenuItem.d.ts +5 -0
  38. package/DropdownMenu/components/DropdownMenuItem.js +3 -2
  39. package/DropdownMenu/components/DropdownMenuItem.js.map +1 -1
  40. package/FilePicker/FilePicker.d.ts +12 -12
  41. package/FilePicker/primitives/FilePickerPrimitive.d.ts +12 -12
  42. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.d.ts +13 -2
  43. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js +15 -6
  44. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js.map +1 -1
  45. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.d.ts +6 -1
  46. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js +3 -2
  47. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js.map +1 -1
  48. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.d.ts +10 -1
  49. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.js +6 -2
  50. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.js.map +1 -1
  51. package/ImageEditor/AspectRatioPreview.d.ts +16 -0
  52. package/ImageEditor/AspectRatioPreview.js +26 -0
  53. package/ImageEditor/AspectRatioPreview.js.map +1 -0
  54. package/ImageEditor/CropHotspotEditor.d.ts +22 -0
  55. package/ImageEditor/CropHotspotEditor.js +402 -0
  56. package/ImageEditor/CropHotspotEditor.js.map +1 -0
  57. package/ImageEditor/ImageEditor.d.ts +18 -0
  58. package/ImageEditor/ImageEditor.js +151 -0
  59. package/ImageEditor/ImageEditor.js.map +1 -0
  60. package/ImageEditor/ImageEditor.stories.d.ts +6 -0
  61. package/ImageEditor/ImageEditor.stories.js +42 -0
  62. package/ImageEditor/ImageEditor.stories.js.map +1 -0
  63. package/ImageEditor/MetaFields.d.ts +12 -0
  64. package/ImageEditor/MetaFields.js +20 -0
  65. package/ImageEditor/MetaFields.js.map +1 -0
  66. package/ImageEditor/SectionLabel.d.ts +8 -0
  67. package/ImageEditor/SectionLabel.js +7 -0
  68. package/ImageEditor/SectionLabel.js.map +1 -0
  69. package/ImageEditor/geometry.d.ts +46 -0
  70. package/ImageEditor/geometry.js +126 -0
  71. package/ImageEditor/geometry.js.map +1 -0
  72. package/ImageEditor/index.d.ts +3 -0
  73. package/ImageEditor/index.js +3 -0
  74. package/ImageEditor/types.d.ts +52 -0
  75. package/ImageEditor/types.js +35 -0
  76. package/ImageEditor/types.js.map +1 -0
  77. package/Markdown/Markdown.d.ts +47 -0
  78. package/Markdown/Markdown.js +17 -0
  79. package/Markdown/Markdown.js.map +1 -0
  80. package/Markdown/index.d.ts +1 -0
  81. package/Markdown/index.js +1 -0
  82. package/MultiFilePicker/MultiFilePicker.d.ts +12 -12
  83. package/MultiFilePicker/primitives/MultiFilePickerPrimitive.d.ts +12 -12
  84. package/MultiSelect/primitives/MultiSelectPrimitive.js +1 -1
  85. package/MultiSelect/primitives/MultiSelectPrimitive.js.map +1 -1
  86. package/Select/primitives/components/SelectContent.js +1 -1
  87. package/Select/primitives/components/SelectContent.js.map +1 -1
  88. package/Toast/useToast.stories.js.map +1 -1
  89. package/exports/admin/ui.d.ts +1 -0
  90. package/exports/admin/ui.js +1 -0
  91. package/index.d.ts +4 -0
  92. package/index.js +4 -0
  93. package/package.json +18 -18
  94. package/theme.css +9 -0
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Generic, self-contained types for the reusable image editor dialog.
3
+ *
4
+ * These are intentionally NOT imported from `@webiny/website-builder-sdk`:
5
+ * `@webiny/admin-ui` is the low-level design-system layer and must not depend on
6
+ * higher-level SDKs. The shapes are structurally identical to the SDK's
7
+ * `WebinyImageEdit`/`WebinyImageValue`, so consumers (File Manager, Website
8
+ * Builder) can pass values across the boundary without any mapping.
9
+ */
10
+ /** Minimal information the editor needs about the source image. */
11
+ export interface ImageEditorImage {
12
+ src: string;
13
+ /** Intrinsic (original) pixel width. */
14
+ width: number;
15
+ /** Intrinsic (original) pixel height. */
16
+ height: number;
17
+ }
18
+ /** Crop stored as the fraction (0..1) cut off from each edge of the image. */
19
+ export interface ImageEditorCrop {
20
+ top: number;
21
+ left: number;
22
+ bottom: number;
23
+ right: number;
24
+ }
25
+ /** Focal region in normalized (0..1) coordinates of the original image. */
26
+ export interface ImageEditorHotspot {
27
+ x: number;
28
+ y: number;
29
+ width: number;
30
+ height: number;
31
+ }
32
+ /** The complete non-destructive edit produced by the dialog. */
33
+ export interface ImageEditorValue {
34
+ crop?: ImageEditorCrop;
35
+ hotspot?: ImageEditorHotspot;
36
+ alt?: string;
37
+ caption?: string;
38
+ }
39
+ /** A single aspect ratio used both for the crop selector and the preview strip. */
40
+ export interface ImageEditorAspectRatio {
41
+ id: string;
42
+ label: string;
43
+ /** `width / height`. */
44
+ ratio: number;
45
+ }
46
+ /**
47
+ * The single source of truth for selectable aspect ratios, shared by the crop
48
+ * shape selector and the preview-shapes dropdown so their labels stay identical.
49
+ */
50
+ export declare const DEFAULT_ASPECT_RATIOS: ImageEditorAspectRatio[];
51
+ /** Preview shapes selected by default (the originally specified square / 4:3 / 16:9). */
52
+ export declare const DEFAULT_PREVIEW_RATIO_IDS: string[];
@@ -0,0 +1,35 @@
1
+ const DEFAULT_ASPECT_RATIOS = [
2
+ {
3
+ id: "1:1",
4
+ label: "Square (1:1)",
5
+ ratio: 1
6
+ },
7
+ {
8
+ id: "4:3",
9
+ label: "Landscape (4:3)",
10
+ ratio: 4 / 3
11
+ },
12
+ {
13
+ id: "16:9",
14
+ label: "Widescreen (16:9)",
15
+ ratio: 16 / 9
16
+ },
17
+ {
18
+ id: "3:4",
19
+ label: "Portrait (3:4)",
20
+ ratio: 0.75
21
+ },
22
+ {
23
+ id: "9:16",
24
+ label: "Tall (9:16)",
25
+ ratio: 9 / 16
26
+ }
27
+ ];
28
+ const DEFAULT_PREVIEW_RATIO_IDS = [
29
+ "1:1",
30
+ "4:3",
31
+ "16:9"
32
+ ];
33
+ export { DEFAULT_ASPECT_RATIOS, DEFAULT_PREVIEW_RATIO_IDS };
34
+
35
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageEditor/types.js","sources":["../../src/ImageEditor/types.ts"],"sourcesContent":["/**\n * Generic, self-contained types for the reusable image editor dialog.\n *\n * These are intentionally NOT imported from `@webiny/website-builder-sdk`:\n * `@webiny/admin-ui` is the low-level design-system layer and must not depend on\n * higher-level SDKs. The shapes are structurally identical to the SDK's\n * `WebinyImageEdit`/`WebinyImageValue`, so consumers (File Manager, Website\n * Builder) can pass values across the boundary without any mapping.\n */\n\n/** Minimal information the editor needs about the source image. */\nexport interface ImageEditorImage {\n src: string;\n /** Intrinsic (original) pixel width. */\n width: number;\n /** Intrinsic (original) pixel height. */\n height: number;\n}\n\n/** Crop stored as the fraction (0..1) cut off from each edge of the image. */\nexport interface ImageEditorCrop {\n top: number;\n left: number;\n bottom: number;\n right: number;\n}\n\n/** Focal region in normalized (0..1) coordinates of the original image. */\nexport interface ImageEditorHotspot {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** The complete non-destructive edit produced by the dialog. */\nexport interface ImageEditorValue {\n crop?: ImageEditorCrop;\n hotspot?: ImageEditorHotspot;\n alt?: string;\n caption?: string;\n}\n\n/** A single aspect ratio used both for the crop selector and the preview strip. */\nexport interface ImageEditorAspectRatio {\n id: string;\n label: string;\n /** `width / height`. */\n ratio: number;\n}\n\n/**\n * The single source of truth for selectable aspect ratios, shared by the crop\n * shape selector and the preview-shapes dropdown so their labels stay identical.\n */\nexport const DEFAULT_ASPECT_RATIOS: ImageEditorAspectRatio[] = [\n { id: \"1:1\", label: \"Square (1:1)\", ratio: 1 },\n { id: \"4:3\", label: \"Landscape (4:3)\", ratio: 4 / 3 },\n { id: \"16:9\", label: \"Widescreen (16:9)\", ratio: 16 / 9 },\n { id: \"3:4\", label: \"Portrait (3:4)\", ratio: 3 / 4 },\n { id: \"9:16\", label: \"Tall (9:16)\", ratio: 9 / 16 }\n];\n\n/** Preview shapes selected by default (the originally specified square / 4:3 / 16:9). */\nexport const DEFAULT_PREVIEW_RATIO_IDS = [\"1:1\", \"4:3\", \"16:9\"];\n"],"names":["DEFAULT_ASPECT_RATIOS","DEFAULT_PREVIEW_RATIO_IDS"],"mappings":"AAuDO,MAAMA,wBAAkD;IAC3D;QAAE,IAAI;QAAO,OAAO;QAAgB,OAAO;IAAE;IAC7C;QAAE,IAAI;QAAO,OAAO;QAAmB,OAAO,IAAI;IAAE;IACpD;QAAE,IAAI;QAAQ,OAAO;QAAqB,OAAO,KAAK;IAAE;IACxD;QAAE,IAAI;QAAO,OAAO;QAAkB,OAAO;IAAM;IACnD;QAAE,IAAI;QAAQ,OAAO;QAAe,OAAO,IAAI;IAAG;CACrD;AAGM,MAAMC,4BAA4B;IAAC;IAAO;IAAO;CAAO"}
@@ -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";
@@ -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;
@@ -53,7 +53,7 @@ const MultiSelectContent = ({ options, value, onToggle })=>/*#__PURE__*/ react.c
53
53
  className: cn("relative z-popover shadow-lg py-sm overflow-y-auto rounded-sm border-sm border-neutral-muted bg-neutral-base text-neutral-strong", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2", "data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1"),
54
54
  style: {
55
55
  width: "var(--radix-popover-trigger-width)",
56
- maxHeight: "var(--radix-popover-content-available-height, 24rem)"
56
+ maxHeight: "min(250px, var(--radix-popover-content-available-height, 250px))"
57
57
  },
58
58
  align: "start",
59
59
  sideOffset: 4
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect/primitives/MultiSelectPrimitive.js","sources":["../../../src/MultiSelect/primitives/MultiSelectPrimitive.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { Popover } from \"radix-ui\";\nimport { ReactComponent as ChevronDown } from \"@webiny/icons/keyboard_arrow_down.svg\";\nimport { ReactComponent as Close } from \"@webiny/icons/close.svg\";\nimport { cn, makeDecoratable, type VariantProps } from \"~/utils.js\";\nimport { CheckboxPrimitiveRenderer } from \"~/Checkbox/index.js\";\nimport { Icon } from \"~/Icon/index.js\";\nimport { IconButton } from \"~/Button/index.js\";\nimport { selectTriggerVariants } from \"~/Select/primitives/components/index.js\";\n\ninterface MultiSelectOptionDto {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\ninterface MultiSelectPrimitiveProps {\n options?: MultiSelectOptionDto[];\n value?: string[];\n onChange?: (values: string[]) => void;\n onValueReset?: () => void;\n placeholder?: string;\n disabled?: boolean;\n invalid?: boolean;\n displayResetAction?: boolean;\n /**\n * When `true`, shows \"{count} items selected\" in the trigger instead of the full\n * comma-separated label list.\n */\n showSelectionCount?: boolean;\n size?: VariantProps<typeof selectTriggerVariants>[\"size\"];\n variant?: VariantProps<typeof selectTriggerVariants>[\"variant\"];\n}\n\n/**\n * MultiSelect Trigger\n */\ninterface MultiSelectTriggerProps {\n displayValue: string;\n hasValue: boolean;\n placeholder: string;\n displayResetAction: boolean;\n disabled?: boolean;\n invalid?: VariantProps<typeof selectTriggerVariants>[\"invalid\"];\n size?: VariantProps<typeof selectTriggerVariants>[\"size\"];\n variant?: VariantProps<typeof selectTriggerVariants>[\"variant\"];\n onValueReset: () => void;\n}\n\nconst MultiSelectTrigger = ({\n displayValue,\n hasValue,\n placeholder,\n displayResetAction,\n disabled,\n invalid,\n size,\n variant,\n onValueReset\n}: MultiSelectTriggerProps) => {\n const resetButton = useMemo(() => {\n if (!hasValue || !displayResetAction) {\n return undefined;\n }\n return (\n <IconButton\n onPointerDown={event => {\n event.stopPropagation();\n onValueReset();\n }}\n icon={\n <span>\n <Icon\n icon={<Close />}\n label={\"Reset\"}\n color={variant === \"ghost-negative\" ? \"neutral-negative\" : \"inherit\"}\n />\n </span>\n }\n size={\"xs\"}\n variant={variant === \"ghost-negative\" ? \"ghost-negative\" : \"secondary\"}\n disabled={disabled}\n asChild\n />\n );\n }, [hasValue, displayResetAction, onValueReset, variant, disabled]);\n\n return (\n <Popover.Trigger\n className={cn(selectTriggerVariants({ variant, size, invalid }))}\n disabled={disabled}\n >\n <div className={\"flex-1 text-left truncate\"}>\n {hasValue ? (\n displayValue\n ) : (\n <span className={\"text-neutral-disabled\"}>{placeholder}</span>\n )}\n </div>\n {resetButton}\n <span className={\"h-md w-md shrink-0 fill-neutral-xstrong\"}>\n <ChevronDown className={\"h-md w-md\"} />\n </span>\n </Popover.Trigger>\n );\n};\n\n/**\n * MultiSelect Content\n */\ninterface MultiSelectContentProps {\n options: MultiSelectOptionDto[];\n value: string[];\n onToggle: (value: string) => void;\n}\n\nconst MultiSelectContent = ({ options, value, onToggle }: MultiSelectContentProps) => {\n return (\n <Popover.Portal>\n <Popover.Content\n className={cn(\n \"relative z-popover shadow-lg py-sm overflow-y-auto rounded-sm border-sm border-neutral-muted bg-neutral-base text-neutral-strong\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2\",\n \"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1\"\n )}\n style={{\n width: \"var(--radix-popover-trigger-width)\",\n maxHeight: \"var(--radix-popover-content-available-height, 24rem)\"\n }}\n align={\"start\"}\n sideOffset={4}\n >\n {options.map(option => (\n <div\n key={option.value}\n className={cn(\n \"rounded-sm p-sm mx-sm cursor-pointer\",\n \"hover:bg-neutral-dimmed\",\n option.disabled && \"opacity-50 pointer-events-none\"\n )}\n onClick={() => onToggle(option.value)}\n >\n <div className={\"pointer-events-none\"}>\n <CheckboxPrimitiveRenderer\n id={option.value}\n label={option.label}\n value={option.value}\n checked={value.includes(option.value)}\n disabled={option.disabled ?? false}\n indeterminate={false}\n hasLabel={true}\n changeChecked={() => {}}\n />\n </div>\n </div>\n ))}\n </Popover.Content>\n </Popover.Portal>\n );\n};\n\n/**\n * MultiSelect Primitive\n */\nconst DecoratableMultiSelectPrimitive = ({\n options = [],\n value = [],\n onChange,\n onValueReset,\n placeholder = \"Select options\",\n disabled,\n invalid,\n displayResetAction = true,\n showSelectionCount,\n size,\n variant\n}: MultiSelectPrimitiveProps) => {\n const displayValue = useMemo(() => {\n if (value.length === 0) {\n return \"\";\n }\n if (showSelectionCount) {\n return `${value.length} items selected`;\n }\n const labelMap = new Map(options.map(o => [o.value, o.label]));\n return value.map(v => labelMap.get(v) ?? v).join(\", \");\n }, [value, options, showSelectionCount]);\n\n const toggle = useCallback(\n (optionValue: string) => {\n const next = value.includes(optionValue)\n ? value.filter(v => v !== optionValue)\n : [...value, optionValue];\n onChange?.(next);\n },\n [value, onChange]\n );\n\n const reset = useCallback(() => {\n onChange?.([]);\n onValueReset?.();\n }, [onChange, onValueReset]);\n\n return (\n <Popover.Root>\n <MultiSelectTrigger\n displayValue={displayValue}\n hasValue={value.length > 0}\n placeholder={placeholder}\n displayResetAction={displayResetAction}\n disabled={disabled}\n invalid={invalid}\n size={size}\n variant={variant}\n onValueReset={reset}\n />\n <MultiSelectContent options={options} value={value} onToggle={toggle} />\n </Popover.Root>\n );\n};\nconst MultiSelectPrimitive = makeDecoratable(\n \"MultiSelectPrimitive\",\n DecoratableMultiSelectPrimitive\n);\n\nexport { MultiSelectPrimitive, type MultiSelectPrimitiveProps, type MultiSelectOptionDto };\n"],"names":["MultiSelectTrigger","displayValue","hasValue","placeholder","displayResetAction","disabled","invalid","size","variant","onValueReset","resetButton","useMemo","IconButton","event","Icon","Close","Popover","cn","selectTriggerVariants","ChevronDown","MultiSelectContent","options","value","onToggle","option","CheckboxPrimitiveRenderer","DecoratableMultiSelectPrimitive","onChange","showSelectionCount","labelMap","Map","o","v","toggle","useCallback","optionValue","next","reset","MultiSelectPrimitive","makeDecoratable"],"mappings":";;;;;;;;;AAiDA,MAAMA,qBAAqB,CAAC,EACxBC,YAAY,EACZC,QAAQ,EACRC,WAAW,EACXC,kBAAkB,EAClBC,QAAQ,EACRC,OAAO,EACPC,IAAI,EACJC,OAAO,EACPC,YAAY,EACU;IACtB,MAAMC,cAAcC,QAAQ;QACxB,IAAI,CAACT,YAAY,CAACE,oBACd;QAEJ,OAAO,WAAP,GACI,oBAACQ,YAAUA;YACP,eAAeC,CAAAA;gBACXA,MAAM,eAAe;gBACrBJ;YACJ;YACA,oBACI,oBAAC,4BACG,oBAACK,MAAIA;gBACD,oBAAM,oBAACC,0BAAKA;gBACZ,OAAO;gBACP,OAAOP,AAAY,qBAAZA,UAA+B,qBAAqB;;YAIvE,MAAM;YACN,SAASA,AAAY,qBAAZA,UAA+B,mBAAmB;YAC3D,UAAUH;YACV;;IAGZ,GAAG;QAACH;QAAUE;QAAoBK;QAAcD;QAASH;KAAS;IAElE,OAAO,WAAP,GACI,oBAACW,QAAQ,OAAO;QACZ,WAAWC,GAAGC,sBAAsB;YAAEV;YAASD;YAAMD;QAAQ;QAC7D,UAAUD;qBAEV,oBAAC;QAAI,WAAW;OACXH,WACGD,eAAAA,WAAAA,GAEA,oBAAC;QAAK,WAAW;OAA0BE,eAGlDO,aAAAA,WAAAA,GACD,oBAAC;QAAK,WAAW;qBACb,oBAACS,gBAAWA;QAAC,WAAW;;AAIxC;AAWA,MAAMC,qBAAqB,CAAC,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAA2B,GACtE,WAAP,GACI,oBAACP,QAAQ,MAAM,sBACX,oBAACA,QAAQ,OAAO;QACZ,WAAWC,GACP,oIACA,gEACA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AY;QAC7BR,WAAWS;IACf,GACA;QAACd;QAAOK;KAAS;IAGrB,MAAMU,QAAQH,YAAY;QACtBP,WAAW,EAAE;QACblB;IACJ,GAAG;QAACkB;QAAUlB;KAAa;IAE3B,OAAO,WAAP,GACI,oBAACO,QAAQ,IAAI,sBACT,oBAAChB,oBAAkBA;QACf,cAAcC;QACd,UAAUqB,MAAM,MAAM,GAAG;QACzB,aAAanB;QACb,oBAAoBC;QACpB,UAAUC;QACV,SAASC;QACT,MAAMC;QACN,SAASC;QACT,cAAc6B;sBAElB,oBAACjB,oBAAkBA;QAAC,SAASC;QAAS,OAAOC;QAAO,UAAUW;;AAG1E;AACA,MAAMK,uBAAuBC,gBACzB,wBACAb"}
1
+ {"version":3,"file":"MultiSelect/primitives/MultiSelectPrimitive.js","sources":["../../../src/MultiSelect/primitives/MultiSelectPrimitive.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { Popover } from \"radix-ui\";\nimport { ReactComponent as ChevronDown } from \"@webiny/icons/keyboard_arrow_down.svg\";\nimport { ReactComponent as Close } from \"@webiny/icons/close.svg\";\nimport { cn, makeDecoratable, type VariantProps } from \"~/utils.js\";\nimport { CheckboxPrimitiveRenderer } from \"~/Checkbox/index.js\";\nimport { Icon } from \"~/Icon/index.js\";\nimport { IconButton } from \"~/Button/index.js\";\nimport { selectTriggerVariants } from \"~/Select/primitives/components/index.js\";\n\ninterface MultiSelectOptionDto {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\ninterface MultiSelectPrimitiveProps {\n options?: MultiSelectOptionDto[];\n value?: string[];\n onChange?: (values: string[]) => void;\n onValueReset?: () => void;\n placeholder?: string;\n disabled?: boolean;\n invalid?: boolean;\n displayResetAction?: boolean;\n /**\n * When `true`, shows \"{count} items selected\" in the trigger instead of the full\n * comma-separated label list.\n */\n showSelectionCount?: boolean;\n size?: VariantProps<typeof selectTriggerVariants>[\"size\"];\n variant?: VariantProps<typeof selectTriggerVariants>[\"variant\"];\n}\n\n/**\n * MultiSelect Trigger\n */\ninterface MultiSelectTriggerProps {\n displayValue: string;\n hasValue: boolean;\n placeholder: string;\n displayResetAction: boolean;\n disabled?: boolean;\n invalid?: VariantProps<typeof selectTriggerVariants>[\"invalid\"];\n size?: VariantProps<typeof selectTriggerVariants>[\"size\"];\n variant?: VariantProps<typeof selectTriggerVariants>[\"variant\"];\n onValueReset: () => void;\n}\n\nconst MultiSelectTrigger = ({\n displayValue,\n hasValue,\n placeholder,\n displayResetAction,\n disabled,\n invalid,\n size,\n variant,\n onValueReset\n}: MultiSelectTriggerProps) => {\n const resetButton = useMemo(() => {\n if (!hasValue || !displayResetAction) {\n return undefined;\n }\n return (\n <IconButton\n onPointerDown={event => {\n event.stopPropagation();\n onValueReset();\n }}\n icon={\n <span>\n <Icon\n icon={<Close />}\n label={\"Reset\"}\n color={variant === \"ghost-negative\" ? \"neutral-negative\" : \"inherit\"}\n />\n </span>\n }\n size={\"xs\"}\n variant={variant === \"ghost-negative\" ? \"ghost-negative\" : \"secondary\"}\n disabled={disabled}\n asChild\n />\n );\n }, [hasValue, displayResetAction, onValueReset, variant, disabled]);\n\n return (\n <Popover.Trigger\n className={cn(selectTriggerVariants({ variant, size, invalid }))}\n disabled={disabled}\n >\n <div className={\"flex-1 text-left truncate\"}>\n {hasValue ? (\n displayValue\n ) : (\n <span className={\"text-neutral-disabled\"}>{placeholder}</span>\n )}\n </div>\n {resetButton}\n <span className={\"h-md w-md shrink-0 fill-neutral-xstrong\"}>\n <ChevronDown className={\"h-md w-md\"} />\n </span>\n </Popover.Trigger>\n );\n};\n\n/**\n * MultiSelect Content\n */\ninterface MultiSelectContentProps {\n options: MultiSelectOptionDto[];\n value: string[];\n onToggle: (value: string) => void;\n}\n\nconst MultiSelectContent = ({ options, value, onToggle }: MultiSelectContentProps) => {\n return (\n <Popover.Portal>\n <Popover.Content\n className={cn(\n \"relative z-popover shadow-lg py-sm overflow-y-auto rounded-sm border-sm border-neutral-muted bg-neutral-base text-neutral-strong\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2\",\n \"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1\"\n )}\n style={{\n width: \"var(--radix-popover-trigger-width)\",\n maxHeight: \"min(250px, var(--radix-popover-content-available-height, 250px))\"\n }}\n align={\"start\"}\n sideOffset={4}\n >\n {options.map(option => (\n <div\n key={option.value}\n className={cn(\n \"rounded-sm p-sm mx-sm cursor-pointer\",\n \"hover:bg-neutral-dimmed\",\n option.disabled && \"opacity-50 pointer-events-none\"\n )}\n onClick={() => onToggle(option.value)}\n >\n <div className={\"pointer-events-none\"}>\n <CheckboxPrimitiveRenderer\n id={option.value}\n label={option.label}\n value={option.value}\n checked={value.includes(option.value)}\n disabled={option.disabled ?? false}\n indeterminate={false}\n hasLabel={true}\n changeChecked={() => {}}\n />\n </div>\n </div>\n ))}\n </Popover.Content>\n </Popover.Portal>\n );\n};\n\n/**\n * MultiSelect Primitive\n */\nconst DecoratableMultiSelectPrimitive = ({\n options = [],\n value = [],\n onChange,\n onValueReset,\n placeholder = \"Select options\",\n disabled,\n invalid,\n displayResetAction = true,\n showSelectionCount,\n size,\n variant\n}: MultiSelectPrimitiveProps) => {\n const displayValue = useMemo(() => {\n if (value.length === 0) {\n return \"\";\n }\n if (showSelectionCount) {\n return `${value.length} items selected`;\n }\n const labelMap = new Map(options.map(o => [o.value, o.label]));\n return value.map(v => labelMap.get(v) ?? v).join(\", \");\n }, [value, options, showSelectionCount]);\n\n const toggle = useCallback(\n (optionValue: string) => {\n const next = value.includes(optionValue)\n ? value.filter(v => v !== optionValue)\n : [...value, optionValue];\n onChange?.(next);\n },\n [value, onChange]\n );\n\n const reset = useCallback(() => {\n onChange?.([]);\n onValueReset?.();\n }, [onChange, onValueReset]);\n\n return (\n <Popover.Root>\n <MultiSelectTrigger\n displayValue={displayValue}\n hasValue={value.length > 0}\n placeholder={placeholder}\n displayResetAction={displayResetAction}\n disabled={disabled}\n invalid={invalid}\n size={size}\n variant={variant}\n onValueReset={reset}\n />\n <MultiSelectContent options={options} value={value} onToggle={toggle} />\n </Popover.Root>\n );\n};\nconst MultiSelectPrimitive = makeDecoratable(\n \"MultiSelectPrimitive\",\n DecoratableMultiSelectPrimitive\n);\n\nexport { MultiSelectPrimitive, type MultiSelectPrimitiveProps, type MultiSelectOptionDto };\n"],"names":["MultiSelectTrigger","displayValue","hasValue","placeholder","displayResetAction","disabled","invalid","size","variant","onValueReset","resetButton","useMemo","IconButton","event","Icon","Close","Popover","cn","selectTriggerVariants","ChevronDown","MultiSelectContent","options","value","onToggle","option","CheckboxPrimitiveRenderer","DecoratableMultiSelectPrimitive","onChange","showSelectionCount","labelMap","Map","o","v","toggle","useCallback","optionValue","next","reset","MultiSelectPrimitive","makeDecoratable"],"mappings":";;;;;;;;;AAiDA,MAAMA,qBAAqB,CAAC,EACxBC,YAAY,EACZC,QAAQ,EACRC,WAAW,EACXC,kBAAkB,EAClBC,QAAQ,EACRC,OAAO,EACPC,IAAI,EACJC,OAAO,EACPC,YAAY,EACU;IACtB,MAAMC,cAAcC,QAAQ;QACxB,IAAI,CAACT,YAAY,CAACE,oBACd;QAEJ,OAAO,WAAP,GACI,oBAACQ,YAAUA;YACP,eAAeC,CAAAA;gBACXA,MAAM,eAAe;gBACrBJ;YACJ;YACA,oBACI,oBAAC,4BACG,oBAACK,MAAIA;gBACD,oBAAM,oBAACC,0BAAKA;gBACZ,OAAO;gBACP,OAAOP,AAAY,qBAAZA,UAA+B,qBAAqB;;YAIvE,MAAM;YACN,SAASA,AAAY,qBAAZA,UAA+B,mBAAmB;YAC3D,UAAUH;YACV;;IAGZ,GAAG;QAACH;QAAUE;QAAoBK;QAAcD;QAASH;KAAS;IAElE,OAAO,WAAP,GACI,oBAACW,QAAQ,OAA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AAGN,MAAM,MAAM,CAAC,eAAe,CAAC;QAE3C,MAAMO,WAAW,IAAIC,IAAIT,QAAQ,GAAG,CAACU,CAAAA,IAAK;gBAACA,EAAE,KAAK;gBAAEA,EAAE,KAAK;aAAC;QAC5D,OAAOT,MAAM,GAAG,CAACU,CAAAA,IAAKH,SAAS,GAAG,CAACG,MAAMA,GAAG,IAAI,CAAC;IACrD,GAAG;QAACV;QAAOD;QAASO;KAAmB;IAEvC,MAAMK,SAASC,YACX,CAACC;QACG,MAAMC,OAAOd,MAAM,QAAQ,CAACa,eACtBb,MAAM,MAAM,CAACU,CAAAA,IAAKA,MAAMG,eACxB;eAAIb;YAAOa;SAAY;QAC7BR,WAAWS;IACf,GACA;QAACd;QAAOK;KAAS;IAGrB,MAAMU,QAAQH,YAAY;QACtBP,WAAW,EAAE;QACblB;IACJ,GAAG;QAACkB;QAAUlB;KAAa;IAE3B,OAAO,WAAP,GACI,oBAACO,QAAQ,IAAI,sBACT,oBAAChB,oBAAkBA;QACf,cAAcC;QACd,UAAUqB,MAAM,MAAM,GAAG;QACzB,aAAanB;QACb,oBAAoBC;QACpB,UAAUC;QACV,SAASC;QACT,MAAMC;QACN,SAASC;QACT,cAAc6B;sBAElB,oBAACjB,oBAAkBA;QAAC,SAASC;QAAS,OAAOC;QAAO,UAAUW;;AAG1E;AACA,MAAMK,uBAAuBC,gBACzB,wBACAb"}
@@ -5,7 +5,7 @@ import { SelectScrollDownButton } from "./SelectScrollDownButton.js";
5
5
  import * as __rspack_external_react from "react";
6
6
  const SelectContent = ({ className, children, ...props })=>/*#__PURE__*/ __rspack_external_react.createElement(Select.Portal, null, /*#__PURE__*/ __rspack_external_react.createElement(Select.Content, {
7
7
  className: cn([
8
- "relative z-popover max-h-96 min-w-56 shadow-lg py-sm overflow-hidden rounded-sm border-sm border-neutral-muted bg-neutral-base text-neutral-strong",
8
+ "relative z-popover max-h-[250px] min-w-56 shadow-lg py-sm overflow-hidden rounded-sm border-sm border-neutral-muted bg-neutral-base text-neutral-strong",
9
9
  "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
10
10
  "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1"
11
11
  ], className),
@@ -1 +1 @@
1
- {"version":3,"file":"Select/primitives/components/SelectContent.js","sources":["../../../../src/Select/primitives/components/SelectContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Select as SelectPrimitives } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\nimport { SelectScrollUpButton } from \"./SelectScrollUpButton.js\";\nimport { SelectScrollDownButton } from \"./SelectScrollDownButton.js\";\n\ntype SelectContentProps = SelectPrimitives.SelectContentProps;\n\nconst SelectContent = ({ className, children, ...props }: SelectContentProps) => (\n <SelectPrimitives.Portal>\n <SelectPrimitives.Content\n className={cn(\n [\n \"relative z-popover max-h-96 min-w-56 shadow-lg py-sm overflow-hidden rounded-sm border-sm border-neutral-muted bg-neutral-base text-neutral-strong\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\"\n ],\n className\n )}\n position={\"popper\"}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitives.Viewport\n className={cn([\n \"py-xs\",\n \"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)\"\n ])}\n >\n {children}\n </SelectPrimitives.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitives.Content>\n </SelectPrimitives.Portal>\n);\n\nexport { SelectContent, type SelectContentProps };\n"],"names":["SelectContent","className","children","props","SelectPrimitives","cn","SelectScrollUpButton","SelectScrollDownButton"],"mappings":";;;;;AAQA,MAAMA,gBAAgB,CAAC,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,OAA2B,iBACxE,sCAACC,OAAAA,MAAuB,sBACpB,sCAACA,OAAAA,OAAwB;QACrB,WAAWC,GACP;YACI;YACA;YACA;SACH,EACDJ;QAEJ,UAAU;QACT,GAAGE,KAAK;qBAET,sCAACG,sBAAoBA,OAAAA,WAAAA,GACrB,sCAACF,OAAAA,QAAyB;QACtB,WAAWC,GAAG;YACV;YACA;SACH;OAEAH,WAAAA,WAAAA,GAEL,sCAACK,wBAAsBA"}
1
+ {"version":3,"file":"Select/primitives/components/SelectContent.js","sources":["../../../../src/Select/primitives/components/SelectContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Select as SelectPrimitives } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\nimport { SelectScrollUpButton } from \"./SelectScrollUpButton.js\";\nimport { SelectScrollDownButton } from \"./SelectScrollDownButton.js\";\n\ntype SelectContentProps = SelectPrimitives.SelectContentProps;\n\nconst SelectContent = ({ className, children, ...props }: SelectContentProps) => (\n <SelectPrimitives.Portal>\n <SelectPrimitives.Content\n className={cn(\n [\n \"relative z-popover max-h-[250px] min-w-56 shadow-lg py-sm overflow-hidden rounded-sm border-sm border-neutral-muted bg-neutral-base text-neutral-strong\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\"\n ],\n className\n )}\n position={\"popper\"}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitives.Viewport\n className={cn([\n \"py-xs\",\n \"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)\"\n ])}\n >\n {children}\n </SelectPrimitives.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitives.Content>\n </SelectPrimitives.Portal>\n);\n\nexport { SelectContent, type SelectContentProps };\n"],"names":["SelectContent","className","children","props","SelectPrimitives","cn","SelectScrollUpButton","SelectScrollDownButton"],"mappings":";;;;;AAQA,MAAMA,gBAAgB,CAAC,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,OAA2B,iBACxE,sCAACC,OAAAA,MAAuB,sBACpB,sCAACA,OAAAA,OAAwB;QACrB,WAAWC,GACP;YACI;YACA;YACA;SACH,EACDJ;QAEJ,UAAU;QACT,GAAGE,KAAK;qBAET,sCAACG,sBAAoBA,OAAAA,WAAAA,GACrB,sCAACF,OAAAA,QAAyB;QACtB,WAAWC,GAAG;YACV;YACA;SACH;OAEAH,WAAAA,WAAAA,GAEL,sCAACK,wBAAsBA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Toast/useToast.stories.js","sources":["../../src/Toast/useToast.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { ReactComponent as SettingsIcon } from \"@webiny/icons/settings.svg\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Toast } from \"./Toast.js\";\nimport { useToast, type ShowToastParams } from \"./useToast.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { Icon } from \"~/Icon/index.js\";\n\nconst ToastComponent = (props: ShowToastParams) => {\n const [lastToast, setLastToast] = useState<string | number>(\"\");\n const { showToast, hideToast, hideAllToasts } = useToast();\n return (\n <>\n <Button\n text={\"Show Toast\"}\n onClick={() => {\n const toast = showToast(props);\n setLastToast(toast);\n }}\n />\n <Button text={\"Hide latest toast\"} onClick={() => hideToast(lastToast)} />\n <Button text={\"Hide all toasts\"} onClick={() => hideAllToasts()} />\n </>\n );\n};\n\nconst meta: Meta<ShowToastParams> = {\n title: \"Components/Toast\",\n component: ToastComponent,\n parameters: {\n layout: \"fullscreen\"\n },\n argTypes: {\n variant: { control: \"select\", options: [\"default\", \"subtle\"] }\n },\n decorators: [\n Story => (\n <div className=\"w-full h-64 flex justify-center items-center gap-sm\">\n <Story />\n <Toast.Provider />\n </div>\n )\n ]\n};\n\nexport default meta;\n\ntype Story = StoryObj<ShowToastParams>;\n\nexport const Default: Story = {\n args: {\n title: \"New entry created\"\n }\n};\n\nexport const SubtleVariant: Story = {\n args: {\n ...Default.args,\n variant: \"subtle\"\n }\n};\n\nexport const WithTitleComponent: Story = {\n args: {\n title: <Toast.Title text={\"New entry created\"} />\n }\n};\n\nexport const WithDescription: Story = {\n args: {\n ...Default.args,\n description: 'Entry \"Article One\" has been successfully created'\n }\n};\n\nexport const WithDescriptionComponent: Story = {\n args: {\n ...Default.args,\n description: (\n <Toast.Description text={'Entry \"Article One\" has been successfully created'} />\n )\n }\n};\n\nexport const WithActions: Story = {\n args: {\n ...Default.args,\n actions: (\n <Toast.Actions>\n <Button\n key={\"action-1\"}\n text={\"Do the action\"}\n onClick={() => console.log(\"doTheAction\")}\n />\n <Button\n key={\"action-2\"}\n text={\"Dismiss\"}\n onClick={() => console.log(\"dismiss\")}\n variant={\"secondary\"}\n />\n </Toast.Actions>\n )\n }\n};\n\nexport const WithDescriptionAndActions: Story = {\n args: {\n ...Default.args,\n description: (\n <Toast.Description text={'Entry \"Article One\" has been successfully created'} />\n ),\n actions: (\n <Toast.Actions>\n <Button\n key={\"action-1\"}\n text={\"Do the action\"}\n onClick={() => console.log(\"doTheAction\")}\n />\n <Button\n key={\"action-2\"}\n text={\"Dismiss\"}\n onClick={() => console.log(\"dismiss\")}\n variant={\"secondary\"}\n />\n </Toast.Actions>\n )\n }\n};\n\nexport const WithCustomIcon: Story = {\n args: {\n ...Default.args,\n icon: <Icon icon={<SettingsIcon />} label={\"Settings\"} />\n }\n};\n\nexport const WithInfiniteDuration: Story = {\n args: {\n ...Default.args,\n duration: Infinity\n }\n};\n\nexport const NotDismissible: Story = {\n args: {\n ...Default.args,\n dismissible: false\n }\n};\n\nexport const withCustomPosition: Story = {\n args: {\n ...Default.args,\n position: \"bottom-right\"\n }\n};\n\nexport const Documentation: Story = {\n args: {\n title: \"New entry created\",\n description: \"Entry has been successfully created\",\n variant: \"default\",\n position: \"top-right\",\n duration: 6000,\n dismissible: true,\n actions: undefined,\n icon: undefined\n },\n argTypes: {\n title: {\n description: \"Please refer to the 'With Title Component' example below for details.\"\n },\n description: {\n description:\n \"Please refer to the 'With Description' and 'With Description Component' examples below for details.\"\n },\n variant: {\n description: \"Variant of the toast.\"\n },\n actions: {\n description: \"Please refer to the 'With Actions' example below for details.\"\n },\n icon: {\n description: \"Please refer to the 'With Custom Icon' example below for details.\"\n },\n duration: {\n description:\n \"Duration in milliseconds before the toast auto-dismisses. Please refer to the 'With Infinite Duration' example below for details.\",\n control: \"number\"\n },\n dismissible: {\n description: \"Please refer to the 'Not Dismissible' example below for details.\"\n },\n position: {\n description: \"Please refer to the 'With Custom Position' example below for details.\",\n control: \"select\",\n options: [\n \"top-left\",\n \"top-right\",\n \"bottom-left\",\n \"bottom-right\",\n \"top-center\",\n \"bottom-center\"\n ]\n }\n }\n};\n"],"names":["ToastComponent","props","lastToast","setLastToast","useState","showToast","hideToast","hideAllToasts","useToast","Button","toast","meta","Story","Toast","Default","SubtleVariant","WithTitleComponent","WithDescription","WithDescriptionComponent","WithActions","console","WithDescriptionAndActions","WithCustomIcon","Icon","SettingsIcon","WithInfiniteDuration","Infinity","NotDismissible","withCustomPosition","Documentation","undefined"],"mappings":";;;;;;AAQA,MAAMA,iBAAiB,CAACC;IACpB,MAAM,CAACC,WAAWC,aAAa,GAAGC,SAA0B;IAC5D,MAAM,EAAEC,SAAS,EAAEC,SAAS,EA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aACH;QACL;IACJ;AACJ"}
1
+ {"version":3,"file":"Toast/useToast.stories.js","sources":["../../src/Toast/useToast.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { ReactComponent as SettingsIcon } from \"@webiny/icons/settings.svg\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Toast } from \"./Toast.js\";\nimport { useToast, type ShowToastParams } from \"./useToast.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { Icon } from \"~/Icon/index.js\";\n\nconst ToastComponent = (props: ShowToastParams) => {\n const [lastToast, setLastToast] = useState<string | number>(\"\");\n const { showToast, hideToast, hideAllToasts } = useToast();\n return (\n <>\n <Button\n text={\"Show Toast\"}\n onClick={() => {\n const toast = showToast(props);\n setLastToast(toast);\n }}\n />\n <Button text={\"Hide latest toast\"} onClick={() => hideToast(lastToast)} />\n <Button text={\"Hide all toasts\"} onClick={() => hideAllToasts()} />\n </>\n );\n};\n\nconst meta: Meta<ShowToastParams> = {\n title: \"Components/Toast\",\n component: ToastComponent,\n parameters: {\n layout: \"fullscreen\"\n },\n argTypes: {\n variant: { control: \"select\", options: [\"default\", \"subtle\"] }\n },\n decorators: [\n Story => (\n <div className=\"w-full h-64 flex justify-center items-center gap-sm\">\n <Story />\n <Toast.Provider />\n </div>\n )\n ]\n};\n\nexport default meta;\n\ntype Story = StoryObj<ShowToastParams>;\n\nexport const Default: Story = {\n args: {\n title: \"New entry created\"\n }\n};\n\nexport const SubtleVariant: Story = {\n args: {\n ...Default.args,\n variant: \"subtle\"\n }\n};\n\nexport const WithTitleComponent: Story = {\n args: {\n title: <Toast.Title text={\"New entry created\"} />\n }\n};\n\nexport const WithDescription: Story = {\n args: {\n ...Default.args,\n description: 'Entry \"Article One\" has been successfully created'\n }\n};\n\nexport const WithDescriptionComponent: Story = {\n args: {\n ...Default.args,\n description: (\n <Toast.Description text={'Entry \"Article One\" has been successfully created'} />\n )\n }\n};\n\nexport const WithActions: Story = {\n args: {\n ...Default.args,\n actions: (\n <Toast.Actions>\n <Button\n key={\"action-1\"}\n text={\"Do the action\"}\n onClick={() => console.log(\"doTheAction\")}\n />\n <Button\n key={\"action-2\"}\n text={\"Dismiss\"}\n onClick={() => console.log(\"dismiss\")}\n variant={\"secondary\"}\n />\n </Toast.Actions>\n )\n }\n};\n\nexport const WithDescriptionAndActions: Story = {\n args: {\n ...Default.args,\n description: (\n <Toast.Description text={'Entry \"Article One\" has been successfully created'} />\n ),\n actions: (\n <Toast.Actions>\n <Button\n key={\"action-1\"}\n text={\"Do the action\"}\n onClick={() => console.log(\"doTheAction\")}\n />\n <Button\n key={\"action-2\"}\n text={\"Dismiss\"}\n onClick={() => console.log(\"dismiss\")}\n variant={\"secondary\"}\n />\n </Toast.Actions>\n )\n }\n};\n\nexport const WithCustomIcon: Story = {\n args: {\n ...Default.args,\n icon: <Icon icon={<SettingsIcon />} label={\"Settings\"} />\n }\n};\n\nexport const WithInfiniteDuration: Story = {\n args: {\n ...Default.args,\n duration: Infinity\n }\n};\n\nexport const NotDismissible: Story = {\n args: {\n ...Default.args,\n dismissible: false\n }\n};\n\nexport const withCustomPosition: Story = {\n args: {\n ...Default.args,\n position: \"bottom-right\"\n }\n};\n\nexport const Documentation: Story = {\n args: {\n title: \"New entry created\",\n description: \"Entry has been successfully created\",\n variant: \"default\",\n position: \"top-right\",\n duration: 6000,\n dismissible: true,\n actions: undefined,\n icon: undefined\n },\n argTypes: {\n title: {\n description: \"Please refer to the 'With Title Component' example below for details.\"\n },\n description: {\n description:\n \"Please refer to the 'With Description' and 'With Description Component' examples below for details.\"\n },\n variant: {\n description: \"Variant of the toast.\"\n },\n actions: {\n description: \"Please refer to the 'With Actions' example below for details.\"\n },\n icon: {\n description: \"Please refer to the 'With Custom Icon' example below for details.\"\n },\n duration: {\n description:\n \"Duration in milliseconds before the toast auto-dismisses. Please refer to the 'With Infinite Duration' example below for details.\",\n control: \"number\"\n },\n dismissible: {\n description: \"Please refer to the 'Not Dismissible' example below for details.\"\n },\n position: {\n description: \"Please refer to the 'With Custom Position' example below for details.\",\n control: \"select\",\n options: [\n \"top-left\",\n \"top-right\",\n \"bottom-left\",\n \"bottom-right\",\n \"top-center\",\n \"bottom-center\"\n ]\n }\n }\n};\n"],"names":["ToastComponent","props","lastToast","setLastToast","useState","showToast","hideToast","hideAllToasts","useToast","Button","toast","meta","Story","Toast","Default","SubtleVariant","WithTitleComponent","WithDescription","WithDescriptionComponent","WithActions","console","WithDescriptionAndActions","WithCustomIcon","Icon","SettingsIcon","WithInfiniteDuration","Infinity","NotDismissible","withCustomPosition","Documentation","undefined"],"mappings":";;;;;;AAQA,MAAMA,iBAAiB,CAACC;IACpB,MAAM,CAACC,WAAWC,aAAa,GAAGC,SAA0B;IAC5D,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,aAAa,EAAE,GAAGC;IAChD,OAAO,WAAP,GACI,wDACI,oBAACC,QAAMA;QACH,MAAM;QACN,SAAS;YACL,MAAMC,QAAQL,UAAUJ;YACxBE,aAAaO;QACjB;sBAEJ,oBAACD,QAAMA;QAAC,MAAM;QAAqB,SAAS,IAAMH,UAAUJ;sBAC5D,oBAACO,QAAMA;QAAC,MAAM;QAAmB,SAAS,IAAMF;;AAG5D;AAEA,MAAMI,OAA8B;IAChC,OAAO;IACP,WAAWX;IACX,YAAY;QACR,QAAQ;IACZ;IACA,UAAU;QACN,SAAS;YAAE,SAAS;YAAU,SAAS;gBAAC;gBAAW;aAAS;QAAC;IACjE;IACA,YAAY;QACRY,CAAAA,QAAAA,WAAAA,GACI,oBAAC;gBAAI,WAAU;6BACX,oBAACA,OAAAA,OAAAA,WAAAA,GACD,oBAACC,MAAM,QAAQ;KAG1B;AACL;AAEA,yBAAeF;AAIR,MAAMG,UAAiB;IAC1B,MAAM;QACF,OAAO;IACX;AACJ;AAEO,MAAMC,gBAAuB;IAChC,MAAM;QACF,GAAGD,QAAQ,IAAI;QACf,SAAS;IACb;AACJ;AAEO,MAAME,qBAA4B;IACrC,MAAM;QACF,OAAO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EO,MAAMc,qBAA4B;IACrC,MAAM;QACF,GAAGd,QAAQ,IAAI;QACf,UAAU;IACd;AACJ;AAEO,MAAMe,gBAAuB;IAChC,MAAM;QACF,OAAO;QACP,aAAa;QACb,SAAS;QACT,UAAU;QACV,UAAU;QACV,aAAa;QACb,SAASC;QACT,MAAMA;IACV;IACA,UAAU;QACN,OAAO;YACH,aAAa;QACjB;QACA,aAAa;YACT,aACI;QACR;QACA,SAAS;YACL,aAAa;QACjB;QACA,SAAS;YACL,aAAa;QACjB;QACA,MAAM;YACF,aAAa;QACjB;QACA,UAAU;YACN,aACI;YACJ,SAAS;QACb;QACA,aAAa;YACT,aAAa;QACjB;QACA,UAAU;YACN,aAAa;YACb,SAAS;YACT,SAAS;gBACL;gBACA;gBACA;gBACA;gBACA;gBACA;aACH;QACL;IACJ;AACJ"}
@@ -3,6 +3,7 @@ export { Accordion } from "../../Accordion/index.js";
3
3
  export { Alert } from "../../Alert/index.js";
4
4
  export { AutoComplete } from "../../AutoComplete/index.js";
5
5
  export { Avatar } from "../../Avatar/index.js";
6
+ export { BetaBadge } from "../../BetaBadge/BetaBadge.js";
6
7
  export { Button, CopyButton, IconButton } from "../../Button/index.js";
7
8
  export { Card } from "../../Card/index.js";
8
9
  export { Checkbox } from "../../Checkbox/index.js";
@@ -3,6 +3,7 @@ export { Accordion } from "../../Accordion/index.js";
3
3
  export { Alert } from "../../Alert/index.js";
4
4
  export { AutoComplete } from "../../AutoComplete/index.js";
5
5
  export { Avatar } from "../../Avatar/index.js";
6
+ export { BetaBadge } from "../../BetaBadge/BetaBadge.js";
6
7
  export { Button, CopyButton, IconButton } from "../../Button/index.js";
7
8
  export { Card } from "../../Card/index.js";
8
9
  export { Checkbox } from "../../Checkbox/index.js";
package/index.d.ts CHANGED
@@ -2,6 +2,8 @@ export * from "./Accordion/index.js";
2
2
  export * from "./Alert/index.js";
3
3
  export * from "./AutoComplete/index.js";
4
4
  export * from "./Avatar/index.js";
5
+ export * from "./BetaBadge/BetaBadge.js";
6
+ export * from "./Breadcrumbs/index.js";
5
7
  export * from "./Button/index.js";
6
8
  export * from "./Card/index.js";
7
9
  export * from "./Checkbox/index.js";
@@ -30,6 +32,7 @@ export * from "./Heading/index.js";
30
32
  export * from "./Icon/index.js";
31
33
  export * from "./IconPicker/index.js";
32
34
  export * from "./Image/index.js";
35
+ export * from "./ImageEditor/index.js";
33
36
  export * from "./Input/index.js";
34
37
  export * from "./Label/index.js";
35
38
  export * from "./Link/index.js";
@@ -58,6 +61,7 @@ export * from "./Table/index.js";
58
61
  export * from "./Tabs/index.js";
59
62
  export * from "./Tag/index.js";
60
63
  export * from "./Tags/index.js";
64
+ export * from "./Markdown/index.js";
61
65
  export * from "./Text/index.js";
62
66
  export * from "./Textarea/index.js";
63
67
  export * from "./Toggle/index.js";
package/index.js CHANGED
@@ -2,6 +2,8 @@ export * from "./Accordion/index.js";
2
2
  export * from "./Alert/index.js";
3
3
  export * from "./AutoComplete/index.js";
4
4
  export * from "./Avatar/index.js";
5
+ export * from "./BetaBadge/BetaBadge.js";
6
+ export * from "./Breadcrumbs/index.js";
5
7
  export * from "./Button/index.js";
6
8
  export * from "./Card/index.js";
7
9
  export * from "./Checkbox/index.js";
@@ -29,6 +31,7 @@ export * from "./Heading/index.js";
29
31
  export * from "./Icon/index.js";
30
32
  export * from "./IconPicker/index.js";
31
33
  export * from "./Image/index.js";
34
+ export * from "./ImageEditor/index.js";
32
35
  export * from "./Input/index.js";
33
36
  export * from "./Label/index.js";
34
37
  export * from "./Link/index.js";
@@ -57,6 +60,7 @@ export * from "./Table/index.js";
57
60
  export * from "./Tabs/index.js";
58
61
  export * from "./Tag/index.js";
59
62
  export * from "./Tags/index.js";
63
+ export * from "./Markdown/index.js";
60
64
  export * from "./Text/index.js";
61
65
  export * from "./Textarea/index.js";
62
66
  export * from "./Toggle/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/admin-ui",
3
- "version": "6.6.0-alpha.0",
3
+ "version": "6.6.0-alpha.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -18,10 +18,10 @@
18
18
  "@minoru/react-dnd-treeview": "3.5.4",
19
19
  "@monaco-editor/react": "4.7.0",
20
20
  "@radix-ui/react-scroll-area": "1.2.18",
21
- "@tanstack/react-table": "8.21.3",
22
- "@webiny/icons": "6.6.0-alpha.0",
23
- "@webiny/react-composition": "6.6.0-alpha.0",
24
- "@webiny/utils": "6.6.0-alpha.0",
21
+ "@tanstack/react-table": "9.1.2",
22
+ "@webiny/icons": "6.6.0-alpha.2",
23
+ "@webiny/react-composition": "6.6.0-alpha.2",
24
+ "@webiny/utils": "6.6.0-alpha.2",
25
25
  "bytes": "3.1.2",
26
26
  "class-variance-authority": "0.7.1",
27
27
  "clsx": "2.1.1",
@@ -29,7 +29,7 @@
29
29
  "date-fns": "4.4.0",
30
30
  "lodash": "4.18.1",
31
31
  "minimatch": "10.2.6",
32
- "mobx": "6.16.1",
32
+ "mobx": "7.0.3",
33
33
  "monaco-editor": "0.53.0",
34
34
  "radix-ui": "1.6.7",
35
35
  "react": "18.3.1",
@@ -38,7 +38,7 @@
38
38
  "react-day-picker": "10.0.1",
39
39
  "react-dnd": "16.0.1",
40
40
  "react-virtualized": "9.22.6",
41
- "sonner": "2.0.7",
41
+ "sonner": "2.0.8",
42
42
  "tailwind-merge": "3.6.0",
43
43
  "tailwindcss": "4.3.3",
44
44
  "tw-animate-css": "1.4.0",
@@ -46,26 +46,26 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@fortawesome/free-solid-svg-icons": "7.3.1",
49
- "@rsbuild/core": "2.1.8",
49
+ "@rsbuild/core": "2.1.13",
50
50
  "@rsbuild/plugin-svgr": "2.0.5",
51
- "@storybook/addon-a11y": "10.5.5",
52
- "@storybook/addon-docs": "10.5.5",
53
- "@storybook/react": "10.5.5",
51
+ "@storybook/addon-a11y": "10.5.10",
52
+ "@storybook/addon-docs": "10.5.10",
53
+ "@storybook/react": "10.5.10",
54
54
  "@tailwindcss/postcss": "4.3.3",
55
55
  "@types/react": "18.3.31",
56
56
  "@types/react-color": "3.0.13",
57
57
  "@types/react-custom-scrollbars": "4.0.13",
58
58
  "@types/react-virtualized": "9.22.3",
59
- "@webiny/build-tools": "6.6.0-alpha.0",
60
- "@webiny/project": "6.6.0-alpha.0",
59
+ "@webiny/build-tools": "6.6.0-alpha.2",
60
+ "@webiny/project": "6.6.0-alpha.2",
61
61
  "chalk": "6.0.0",
62
- "oxfmt": "0.61.0",
62
+ "oxfmt": "0.64.0",
63
63
  "rimraf": "6.1.3",
64
- "sass": "1.102.0",
65
- "storybook": "10.5.5",
66
- "storybook-react-rsbuild": "3.3.4",
64
+ "sass": "1.103.1",
65
+ "storybook": "10.5.10",
66
+ "storybook-react-rsbuild": "3.4.2",
67
67
  "typescript": "7.0.2",
68
- "vitest": "4.1.10"
68
+ "vitest": "4.1.11"
69
69
  },
70
70
  "publishConfig": {
71
71
  "access": "public"
package/theme.css CHANGED
@@ -366,6 +366,15 @@
366
366
  @apply bg-neutral-light;
367
367
  }
368
368
 
369
+ @utility fill-checker {
370
+ background-image: repeating-conic-gradient(
371
+ var(--color-neutral-dimmed) 0% 25%,
372
+ transparent 0% 50%
373
+ );
374
+ background-size: 16px 16px;
375
+ @apply bg-white;
376
+ }
377
+
369
378
  @layer base {
370
379
  a {
371
380
  @apply text-accent-primary hover:underline focus-visible:outline-none focus-visible:ring-lg focus-visible:ring-primary-dimmed rounded-xs;