@webiny/admin-ui 6.4.5-beta.0 → 6.6.0-alpha.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.
- package/Accordion/Accordion.d.ts +7 -6
- package/Accordion/components/AccordionItem.d.ts +7 -6
- package/Accordion/components/AccordionItemAction.d.ts +7 -6
- package/Accordion/components/AccordionItemIcon.d.ts +7 -6
- package/Accordion/components/AccordionItemSeparator.d.ts +7 -6
- package/Alert/Alert.d.ts +21 -19
- package/AutoComplete/AutoComplete.d.ts +7 -6
- package/AutoComplete/primitives/AutoCompletePrimitive.d.ts +7 -6
- package/Avatar/Avatar.d.ts +9 -8
- package/Avatar/components/AvatarFallback.d.ts +7 -6
- package/Avatar/components/AvatarImage.d.ts +7 -6
- package/Button/Button.d.ts +10 -9
- package/Button/CopyButton.d.ts +7 -6
- package/Button/IconButton.d.ts +10 -9
- package/Calendar/Calendar.d.ts +7 -6
- package/Card/Card.d.ts +8 -22
- package/Card/components/CancelAction.d.ts +8 -6
- package/Card/components/CardContent.d.ts +6 -6
- package/Card/components/CardTitle.d.ts +2 -2
- package/Card/components/ConfirmAction.d.ts +8 -6
- package/Card/components/Icon.d.ts +7 -6
- package/Checkbox/Checkbox.d.ts +7 -6
- package/Checkbox/primitives/CheckboxPrimitive.d.ts +17 -12
- package/CheckboxGroup/CheckboxGroup.d.ts +7 -6
- package/CheckboxGroup/primitives/CheckboxGroupPrimitive.d.ts +20 -12
- package/CodeEditor/CodeEditor.d.ts +7 -6
- package/CodeEditor/CodeEditorPrimitive.d.ts +7 -6
- package/ColorPicker/ColorPicker.d.ts +7 -6
- package/ColorPicker/primitives/ColorPickerPrimitive.d.ts +7 -6
- package/Command/Command.d.ts +10 -8
- package/DataList/DataListModal.d.ts +6 -3
- package/DataTable/DataTable.d.ts +7 -6
- package/DatePicker/DatePicker.d.ts +7 -6
- package/DatePicker/primitives/DatePickerPrimitive.d.ts +7 -6
- package/Dialog/Dialog.d.ts +8 -22
- package/Dialog/components/CancelAction.d.ts +8 -6
- package/Dialog/components/ConfirmAction.d.ts +8 -6
- package/Dialog/components/DialogContent.d.ts +1 -1
- package/Dialog/components/DialogFooter.d.ts +1 -1
- package/Dialog/components/DialogTitle.d.ts +1 -1
- package/Dialog/components/Icon.d.ts +7 -6
- package/Drawer/Drawer.d.ts +8 -22
- package/Drawer/Drawer.stories.js +1 -0
- package/Drawer/Drawer.stories.js.map +1 -1
- package/Drawer/components/CancelButton.d.ts +8 -6
- package/Drawer/components/ConfirmButton.d.ts +8 -6
- package/Drawer/components/DrawerContent.d.ts +1 -1
- package/Drawer/components/Icon.d.ts +7 -6
- package/DropdownMenu/components/DropdownMenuItem.d.ts +3 -2
- package/DropdownMenu/components/DropdownMenuItem.js +9 -2
- package/DropdownMenu/components/DropdownMenuItem.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuLink.d.ts +9 -8
- package/DropdownMenu/components/DropdownMenuSeparator.d.ts +7 -6
- package/EditableTitle/EditableTitle.d.ts +7 -6
- package/EmptyState/EmptyState.d.ts +43 -0
- package/EmptyState/EmptyState.js +93 -0
- package/EmptyState/EmptyState.js.map +1 -0
- package/EmptyState/EmptyState.stories.d.ts +13 -0
- package/EmptyState/EmptyState.stories.js +136 -0
- package/EmptyState/EmptyState.stories.js.map +1 -0
- package/EmptyState/illustrations/ContentIllustration.d.ts +2 -0
- package/EmptyState/illustrations/ContentIllustration.js +100 -0
- package/EmptyState/illustrations/ContentIllustration.js.map +1 -0
- package/EmptyState/illustrations/LayoutIllustration.d.ts +2 -0
- package/EmptyState/illustrations/LayoutIllustration.js +93 -0
- package/EmptyState/illustrations/LayoutIllustration.js.map +1 -0
- package/EmptyState/illustrations/ListingIllustration.d.ts +2 -0
- package/EmptyState/illustrations/ListingIllustration.js +92 -0
- package/EmptyState/illustrations/ListingIllustration.js.map +1 -0
- package/EmptyState/illustrations/SelectIllustration.d.ts +2 -0
- package/EmptyState/illustrations/SelectIllustration.js +100 -0
- package/EmptyState/illustrations/SelectIllustration.js.map +1 -0
- package/EmptyState/illustrations/TableIllustration.d.ts +2 -0
- package/EmptyState/illustrations/TableIllustration.js +233 -0
- package/EmptyState/illustrations/TableIllustration.js.map +1 -0
- package/EmptyState/illustrations/UploadIllustration.d.ts +2 -0
- package/EmptyState/illustrations/UploadIllustration.js +77 -0
- package/EmptyState/illustrations/UploadIllustration.js.map +1 -0
- package/EmptyState/illustrations/index.d.ts +6 -0
- package/EmptyState/illustrations/index.js +6 -0
- package/EmptyState/index.d.ts +1 -0
- package/EmptyState/index.js +1 -0
- package/FilePicker/FilePicker.d.ts +7 -6
- package/FilePicker/primitives/FilePickerPrimitive.d.ts +8 -7
- package/FilePicker/primitives/components/Trigger.d.ts +1 -1
- package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.d.ts +7 -6
- package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.d.ts +7 -6
- package/FilePicker/primitives/components/previews/TextOnlyPreview/TextOnlyPreview.d.ts +7 -6
- package/FilePicker/primitives/components/previews/variants.d.ts +1 -1
- package/FillViewport/FillViewport.d.ts +21 -18
- package/FormComponent/Description.d.ts +7 -6
- package/FormComponent/ErrorMessage.d.ts +7 -6
- package/FormComponent/Label.d.ts +7 -6
- package/FormComponent/Note.d.ts +7 -6
- package/Grid/Grid.d.ts +24 -22
- package/HeaderBar/HeaderBar.d.ts +7 -6
- package/Heading/Heading.d.ts +8 -7
- package/Icon/Icon.d.ts +9 -8
- package/IconPicker/IconPicker.d.ts +7 -6
- package/IconPicker/primitives/IconPickerPrimitive.d.ts +1 -1
- package/IconPicker/primitives/components/IconPickerTrigger.d.ts +1 -1
- package/Input/Input.d.ts +7 -6
- package/Input/InputPrimitive.d.ts +9 -8
- package/Label/Label.d.ts +8 -7
- package/Label/components/LabelValue.d.ts +1 -1
- package/Link/Link.d.ts +2 -2
- package/List/List.d.ts +8 -7
- package/List/components/ListItem.d.ts +7 -6
- package/List/components/ListItemAction.d.ts +7 -6
- package/List/components/ListItemHandle.d.ts +7 -6
- package/List/components/ListItemIcon.d.ts +7 -6
- package/List/components/ListItemSeparator.d.ts +7 -6
- package/Loader/Loader.d.ts +9 -8
- package/Loader/OverlayLoader.d.ts +7 -6
- package/MultiAutoComplete/MultiAutoComplete.d.ts +7 -6
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.d.ts +7 -6
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenterWithFreeInput.d.ts +3 -3
- package/MultiAutoComplete/primitives/useMultiAutoComplete.d.ts +3 -3
- package/MultiFilePicker/MultiFilePicker.d.ts +7 -6
- package/MultiFilePicker/primitives/MultiFilePickerPrimitive.d.ts +7 -6
- package/MultiSelect/MultiSelect.d.ts +7 -6
- package/MultiSelect/primitives/MultiSelectPrimitive.d.ts +10 -6
- package/Popover/Popover.d.ts +7 -6
- package/Popover/primitives/PopoverPrimitive.d.ts +7 -7
- package/ProgressBar/ProgressBar.d.ts +7 -6
- package/RadioGroup/RadioGroup.d.ts +7 -6
- package/RadioGroup/primitives/Radio.d.ts +7 -6
- package/RadioGroup/primitives/RadioGroupPrimitive.d.ts +5 -1
- package/RangeSlider/RangeSlider.d.ts +7 -6
- package/SegmentedControl/SegmentedControl.d.ts +8 -7
- package/SegmentedControl/SegmentedControlTabs.d.ts +5 -2
- package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +1 -1
- package/Select/Select.d.ts +7 -6
- package/Select/primitives/components/SelectTrigger.d.ts +2 -2
- package/Separator/Separator.d.ts +9 -8
- package/Sidebar/Sidebar.d.ts +7 -6
- package/Sidebar/components/SidebarIcon.d.ts +7 -6
- package/Sidebar/components/SidebarProvider.d.ts +4 -4
- package/Sidebar/components/items/SidebarMenuGroup.d.ts +9 -8
- package/Sidebar/components/items/SidebarMenuItem.d.ts +11 -10
- package/Sidebar/components/items/SidebarMenuItemIcon.d.ts +7 -6
- package/Sidebar/components/items/SidebarMenuLink.d.ts +11 -10
- package/Sidebar/components/items/SidebarMenuProvider.d.ts +4 -4
- package/Sidebar/components/items/SidebarMenuRootItem.d.ts +9 -7
- package/Skeleton/Skeleton.d.ts +9 -7
- package/Skeleton/Skeleton.js +10 -4
- package/Skeleton/Skeleton.js.map +1 -1
- package/Skeleton/Skeleton.stories.d.ts +2 -0
- package/Skeleton/Skeleton.stories.js +28 -2
- package/Skeleton/Skeleton.stories.js.map +1 -1
- package/Slider/Slider.d.ts +7 -6
- package/SteppedProgress/SteppedProgress.d.ts +7 -6
- package/SteppedProgress/SteppedProgressItem.d.ts +7 -6
- package/Switch/Switch.d.ts +7 -6
- package/Switch/primitives/SwitchPrimitive.d.ts +10 -6
- package/Table/Table.d.ts +12 -10
- package/Table/components/Direction.d.ts +1 -1
- package/Tabs/Tabs.d.ts +8 -6
- package/Tabs/Tabs.js +5 -2
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/components/Content.d.ts +1 -1
- package/Tabs/components/List.d.ts +2 -2
- package/Tabs/components/Tab.d.ts +7 -6
- package/Tabs/components/Trigger.d.ts +3 -2
- package/Tabs/components/Trigger.js +8 -3
- package/Tabs/components/Trigger.js.map +1 -1
- package/Tag/Tag.d.ts +8 -7
- package/Tags/Tags.d.ts +7 -6
- package/Tags/primitives/TagsPrimitive.d.ts +7 -6
- package/Text/Text.d.ts +8 -7
- package/Textarea/Textarea.d.ts +7 -6
- package/Textarea/TextareaPrimitive.d.ts +9 -8
- package/Toast/Toast.d.ts +7 -6
- package/Toast/components/ToastActions.d.ts +7 -6
- package/Toast/components/ToastDescription.d.ts +7 -6
- package/Toast/components/ToastTitle.d.ts +7 -6
- package/Toggle/Toggle.d.ts +7 -6
- package/Toggle/primitives/TogglePrimitive.d.ts +13 -9
- package/ToggleGroup/ToggleGroup.d.ts +7 -6
- package/ToggleGroup/primitives/ToggleGroupPrimitive.d.ts +13 -9
- package/Tooltip/Tooltip.d.ts +7 -6
- package/Tree/Tree.d.ts +7 -6
- package/Tree/components/Item.d.ts +7 -6
- package/Tree/components/ItemCollapseTrigger.d.ts +7 -6
- package/Tree/components/ItemContent.d.ts +8 -6
- package/Tree/components/ItemDragHandle.d.ts +7 -6
- package/Tree/components/ItemIcon.d.ts +7 -6
- package/Tree/components/ItemPlaceholder.d.ts +7 -6
- package/Tree/components/ItemSubIndentation.d.ts +7 -6
- package/Widget/Widget.d.ts +8 -22
- package/Widget/components/Icon.d.ts +7 -6
- package/Widget/components/WidgetAction.d.ts +8 -6
- package/Widget/components/WidgetContent.d.ts +5 -5
- package/exports/admin/ui.d.ts +1 -0
- package/exports/admin/ui.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +24 -24
- package/theme.css +13 -1
- package/utils.js +52 -34
- package/utils.js.map +1 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ButtonProps } from "../../Button/index.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
declare const CancelActionBase: (props: ButtonProps) => React.JSX.Element;
|
|
4
|
+
export declare const CancelAction: typeof CancelActionBase & {
|
|
5
|
+
original: typeof CancelActionBase;
|
|
5
6
|
originalName: string;
|
|
6
7
|
displayName: string;
|
|
7
8
|
} & {
|
|
8
|
-
original:
|
|
9
|
-
original:
|
|
9
|
+
original: typeof CancelActionBase & {
|
|
10
|
+
original: typeof CancelActionBase;
|
|
10
11
|
originalName: string;
|
|
11
12
|
displayName: string;
|
|
12
13
|
};
|
|
13
14
|
originalName: string;
|
|
14
15
|
displayName: string;
|
|
15
16
|
} & {
|
|
16
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
17
|
-
original:
|
|
17
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof CancelActionBase & {
|
|
18
|
+
original: typeof CancelActionBase;
|
|
18
19
|
originalName: string;
|
|
19
20
|
displayName: string;
|
|
20
21
|
}>) => (props: unknown) => React.JSX.Element;
|
|
21
22
|
};
|
|
23
|
+
export {};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ButtonProps } from "../../Button/index.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
declare const ConfirmActionBase: (props: ButtonProps) => React.JSX.Element;
|
|
4
|
+
export declare const ConfirmAction: typeof ConfirmActionBase & {
|
|
5
|
+
original: typeof ConfirmActionBase;
|
|
5
6
|
originalName: string;
|
|
6
7
|
displayName: string;
|
|
7
8
|
} & {
|
|
8
|
-
original:
|
|
9
|
-
original:
|
|
9
|
+
original: typeof ConfirmActionBase & {
|
|
10
|
+
original: typeof ConfirmActionBase;
|
|
10
11
|
originalName: string;
|
|
11
12
|
displayName: string;
|
|
12
13
|
};
|
|
13
14
|
originalName: string;
|
|
14
15
|
displayName: string;
|
|
15
16
|
} & {
|
|
16
|
-
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<
|
|
17
|
-
original:
|
|
17
|
+
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof ConfirmActionBase & {
|
|
18
|
+
original: typeof ConfirmActionBase;
|
|
18
19
|
originalName: string;
|
|
19
20
|
displayName: string;
|
|
20
21
|
}>) => (props: unknown) => React.JSX.Element;
|
|
21
22
|
};
|
|
23
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
3
3
|
import { type VariantProps } from "../../utils.js";
|
|
4
4
|
declare const dialogContentVariants: (props?: ({
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "full" | "lg" | "md" | "sm" | "xl" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof dialogContentVariants> {
|
|
8
8
|
dismissible?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "../../utils.js";
|
|
3
3
|
declare const dialogFooterVariants: (props?: ({
|
|
4
|
-
size?: "
|
|
4
|
+
size?: "full" | "lg" | "md" | "sm" | "xl" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export interface DialogFooterProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof dialogFooterVariants> {
|
|
7
7
|
actions?: React.ReactNode;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
3
3
|
import { type VariantProps } from "../../utils.js";
|
|
4
4
|
declare const dialogTitleVariants: (props?: ({
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "full" | "lg" | "md" | "sm" | "xl" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title> & VariantProps<typeof dialogTitleVariants>;
|
|
8
8
|
export declare const DialogTitle: ({ className, size, ...props }: DialogTitleProps) => React.JSX.Element;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { IconProps as IconComponentProps } from "../../Icon/index.js";
|
|
3
3
|
type IconProps = IconComponentProps;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
declare const IconBase: (props: IconProps) => React.JSX.Element;
|
|
5
|
+
export declare const Icon: typeof IconBase & {
|
|
6
|
+
original: typeof IconBase;
|
|
6
7
|
originalName: string;
|
|
7
8
|
displayName: string;
|
|
8
9
|
} & {
|
|
9
|
-
original:
|
|
10
|
-
original:
|
|
10
|
+
original: typeof IconBase & {
|
|
11
|
+
original: typeof IconBase;
|
|
11
12
|
originalName: string;
|
|
12
13
|
displayName: string;
|
|
13
14
|
};
|
|
14
15
|
originalName: string;
|
|
15
16
|
displayName: string;
|
|
16
17
|
} & {
|
|
17
|
-
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<
|
|
18
|
-
original:
|
|
18
|
+
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof IconBase & {
|
|
19
|
+
original: typeof IconBase;
|
|
19
20
|
originalName: string;
|
|
20
21
|
displayName: string;
|
|
21
22
|
}>) => (props: unknown) => React.JSX.Element;
|
package/Drawer/Drawer.d.ts
CHANGED
|
@@ -18,39 +18,25 @@ interface DrawerProps extends React.ComponentPropsWithoutRef<typeof DrawerRoot>,
|
|
|
18
18
|
onClose?: () => void;
|
|
19
19
|
onOpen?: () => void;
|
|
20
20
|
}
|
|
21
|
-
declare const
|
|
21
|
+
declare const DrawerBase: {
|
|
22
22
|
(props: DrawerProps): React.JSX.Element;
|
|
23
23
|
displayName: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
displayName: string;
|
|
28
|
-
};
|
|
24
|
+
};
|
|
25
|
+
declare const Drawer: typeof DrawerBase & {
|
|
26
|
+
original: typeof DrawerBase;
|
|
29
27
|
originalName: string;
|
|
30
28
|
displayName: string;
|
|
31
29
|
} & {
|
|
32
|
-
original: {
|
|
33
|
-
|
|
34
|
-
displayName: string;
|
|
35
|
-
} & {
|
|
36
|
-
original: {
|
|
37
|
-
(props: DrawerProps): React.JSX.Element;
|
|
38
|
-
displayName: string;
|
|
39
|
-
};
|
|
30
|
+
original: typeof DrawerBase & {
|
|
31
|
+
original: typeof DrawerBase;
|
|
40
32
|
originalName: string;
|
|
41
33
|
displayName: string;
|
|
42
34
|
};
|
|
43
35
|
originalName: string;
|
|
44
36
|
displayName: string;
|
|
45
37
|
} & {
|
|
46
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<{
|
|
47
|
-
|
|
48
|
-
displayName: string;
|
|
49
|
-
} & {
|
|
50
|
-
original: {
|
|
51
|
-
(props: DrawerProps): React.JSX.Element;
|
|
52
|
-
displayName: string;
|
|
53
|
-
};
|
|
38
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DrawerBase & {
|
|
39
|
+
original: typeof DrawerBase;
|
|
54
40
|
originalName: string;
|
|
55
41
|
displayName: string;
|
|
56
42
|
}>) => (props: unknown) => React.JSX.Element;
|
package/Drawer/Drawer.stories.js
CHANGED
|
@@ -140,6 +140,7 @@ const WithTabs = {
|
|
|
140
140
|
bodyPadding: false,
|
|
141
141
|
headerSeparator: false,
|
|
142
142
|
children: /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Tabs, {
|
|
143
|
+
separator: true,
|
|
143
144
|
spacing: "lg",
|
|
144
145
|
tabs: [
|
|
145
146
|
/*#__PURE__*/ react.createElement(Tabs.Tab, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer/Drawer.stories.js","sources":["../../src/Drawer/Drawer.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Drawer } from \"./Drawer.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { DropdownMenu } from \"~/DropdownMenu/index.js\";\nimport { Tabs } from \"~/Tabs/index.js\";\nimport { ReactComponent as DoorbellIcon } from \"@webiny/icons/ring_volume.svg\";\n\nconst meta: Meta<typeof Drawer> = {\n title: \"Components/Drawer\",\n component: Drawer,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Drawer>;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n title: \"Drawer Title\",\n description: \"A short dialog description.\",\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md\"}>\n The amazing, splendid, and most useful umbrella, resistant to rain and friendly\n to winds, is something that deserves all admiration. Crafted with perfect\n textures, it bravely withstands storms and gently shades the rays of the sun. A\n remarkable innovation, with an ergonomically designed grip most suited to the\n hand, it remains stable even in the fiercest weather.\n </p>\n <p className={\"mb-md\"}>\n Its fabric, woven from the highest quality materials, ensures that you stay dry,\n no matter the intensity of the rain. With a frame engineered for strength yet\n lightweight enough to carry with ease, this umbrella is a marvel of modern\n design. Not just a shield against the elements, but a companion in your everyday\n journey, it provides peace of mind, knowing you’re prepared for whatever the\n skies may bring.\n </p>\n <p className={\"mb-md\"}>\n The sleek, stylish design complements any outfit, making it not only a practical\n accessory but also a fashion statement. With its smooth opening mechanism, you\n can effortlessly transition from a sunny day to a rainy one without missing a\n beat. Whether you are navigating through a busy city street or enjoying a quiet\n stroll in the park, this umbrella offers unmatched comfort and protection.\n </p>\n <p className={\"mb-md\"}>\n Indeed, it is not just an umbrella — it is an experience. One that elevates your\n daily routine, making every step in both sun and storm feel just a little bit\n brighter.\n </p>\n </>\n ),\n onOpenChange: opened => {\n console.log(`Drawer is ${opened ? \"opened\" : \"closed\"}.`);\n },\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true\n },\n argTypes: {}\n};\n\nexport const SizeSmall: Story = {\n args: {\n ...Default.args,\n size: \"sm\"\n }\n};\n\nexport const SizeMedium: Story = {\n args: {\n ...Default.args,\n size: \"md\"\n }\n};\n\nexport const SizeLarge: Story = {\n args: {\n ...Default.args,\n size: \"lg\"\n }\n};\n\nexport const SizeExtraLarge: Story = {\n args: {\n ...Default.args,\n size: \"xl\"\n }\n};\n\nexport const ControlledVisibility: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text={\"Open\"} onClick={() => setOpen(true)} />\n <Drawer\n {...props}\n open={open}\n onOpenChange={open => {\n if (!open) {\n setOpen(false);\n }\n }}\n />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer's visibility is controlled by the open state.</>\n }\n};\n\nexport const WithOpenCloseEventHandler: Story = {\n args: {\n ...Default.args,\n onClose: () => {\n console.log(\"onClose triggered\");\n },\n onOpen: () => {\n console.log(\"onOpen triggered\");\n }\n }\n};\n\nexport const WithDropdownMenu: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item\n text={\"Open Drawer\"}\n content={\"Open Drawer\"}\n onClick={() => setOpen(true)}\n />\n </DropdownMenu>\n\n <Drawer {...props} open={open} onOpenChange={() => setOpen(false)} />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const WithoutCloseButton: Story = {\n args: {\n ...Default.args,\n showCloseButton: false,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const CustomWidth: Story = {\n args: {\n ...Default.args,\n width: 1000,\n children: <>This drawer has a custom width of 1000px, making it wider than the default.</>\n }\n};\n\nexport const WithTabs: Story = {\n args: {\n ...Default.args,\n bodyPadding: false,\n headerSeparator: false,\n children: (\n <>\n <Tabs\n spacing={\"lg\"}\n tabs={[\n <Tabs.Tab\n key=\"account\"\n value=\"account\"\n trigger={\"Account\"}\n content={\"Make changes to your account here.\"}\n />,\n <Tabs.Tab\n key=\"company\"\n value=\"company\"\n trigger={\"Company\"}\n content={\"Make changes to your company info here.\"}\n />,\n <Tabs.Tab\n key=\"security\"\n value=\"security\"\n trigger={\"Security\"}\n content={\"Make changes to your security settings here.\"}\n />,\n <Tabs.Tab\n key=\"development\"\n value=\"development\"\n trigger={\"Development\"}\n content={\"Make changes to your development settings here.\"}\n />\n ]}\n />\n </>\n )\n }\n};\n\nexport const DropdownMenuInDrawer: Story = {\n args: {\n ...Default.args,\n children: (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item content={\"Billing\"} />\n <DropdownMenu.Item content={\"Settings\"} />\n <DropdownMenu.Item content={\"Keyboard shortcuts\"} />\n </DropdownMenu>\n </>\n )\n }\n};\n\nexport const WithIcon: Story = {\n args: {\n ...Default.args,\n icon: <Drawer.Icon icon={<DoorbellIcon />} label={\"Icon label...\"} />,\n children: <>The icon helps to visually identify the purpose of this drawer.</>\n }\n};\n\nexport const AsModal: Story = {\n args: {\n ...Default.args,\n modal: true,\n children: (\n <>\n This drawer has modal=true, which means it will show an overlay behind it and\n prevent interaction with the content underneath.\n </>\n )\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text=\"Open Drawer\" onClick={() => setOpen(true)} />\n\n <Drawer {...args} open={open} onOpenChange={open => setOpen(open)} />\n </>\n );\n },\n args: {\n title: \"Drawer Title\",\n description: \"A short drawer description.\",\n showCloseButton: true,\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true,\n side: \"right\",\n modal: false,\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md, mt-md\"}>\n This is the drawer content area. You can place any content here including forms,\n text, images, or other components.\n </p>\n <p className={\"mb-md\"}>\n Drawers are useful for displaying additional information or actions without\n navigating away from the current page.\n </p>\n </>\n ),\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n width: undefined\n },\n argTypes: {\n title: {\n description: \"Title displayed in the header\",\n control: \"text\"\n },\n description: {\n description: \"Description displayed below the title\",\n control: \"text\"\n },\n side: {\n description: \"Side from which the drawer appears\",\n control: \"select\",\n options: [\"left\", \"right\"],\n defaultValue: \"right\"\n },\n size: {\n description: \"Controls the size of the drawer\",\n control: \"select\",\n options: [\"sm\", \"md\", \"lg\", \"xl\"],\n defaultValue: \"md\"\n },\n showCloseButton: {\n description: \"Show close button in the top-right corner\",\n control: \"boolean\",\n defaultValue: true\n },\n modal: {\n description: \"Whether the drawer should behave as a modal\",\n control: \"boolean\",\n defaultValue: false\n },\n bodyPadding: {\n description: \"Add padding to the drawer body\",\n control: \"boolean\",\n defaultValue: true\n },\n headerSeparator: {\n description: \"Show separator below the header\",\n control: \"boolean\",\n defaultValue: true\n },\n footerSeparator: {\n description: \"Show separator above the footer\",\n control: \"boolean\",\n defaultValue: true\n },\n width: {\n description:\n 'Width defines the horizontal size of the Drawer and accepts any valid CSS width value. You can pass a number (interpreted as pixels) or a string like \"80%\", \"50vw\", \"auto\", etc., following React.CSSProperties[\"width\"] types.'\n },\n info: {\n description:\n \"Additional info displayed below the description, please refer to the example below for details.\"\n },\n children: {\n description:\n \"Content of the Drawer, please refer to the 'With Dropdown Menu' and ''With Tabs' example below for details.\"\n },\n actions: {\n description:\n \"Actions displayed in the footer, please refer to the code example for details.\"\n }\n }\n};\n"],"names":["meta","Drawer","Default","Button","opened","console","SizeSmall","SizeMedium","SizeLarge","SizeExtraLarge","ControlledVisibility","props","open","setOpen","React","WithOpenCloseEventHandler","WithDropdownMenu","DropdownMenu","WithoutCloseButton","CustomWidth","WithTabs","Tabs","DropdownMenuInDrawer","WithIcon","DoorbellIcon","AsModal","Documentation","args","undefined"],"mappings":";;;;;;AAQA,MAAMA,OAA4B;IAC9B,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,uBAAeD;AAIR,MAAME,UAAiB;IAC1B,MAAM;QACF,SAAS,WAAT,GAAS,oBAACC,QAAMA;YAAC,SAAQ;YAAU,MAAM;;QACzC,OAAO;QACP,aAAa;QACb,MAAM,WAAN,GACI,0CAAE,wCACwB,oBAAC;YAAE,MAAM;WAAK,SAAQ;QAGpD,UAAU,WAAV,GACI,wDACI,oBAAC;YAAE,WAAW;WAAS,gYAOvB,oBAAC;YAAE,WAAW;WAAS,2aAQvB,oBAAC;YAAE,WAAW;WAAS,2ZAOvB,oBAAC;YAAE,WAAW;WAAS;QAO/B,cAAcC,CAAAA;YACVC,QAAQ,GAAG,CAAC,CAAC,UAAU,EAAED,SAAS,WAAW,SAAS,CAAC,CAAC;QAC5D;QACA,SAAS,WAAT,GACI,wDACI,oBAACH,OAAO,YAAY,uBACpB,oBAACA,OAAO,aAAa;QAG7B,aAAa;QACb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YACH,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,OAAO;YACH,aACI;QACR;QACA,MAAM;YACF,aACI;QACR;QACA,UAAU;YACN,aACI;QACR;QACA,SAAS;YACL,aACI;QACR;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"Drawer/Drawer.stories.js","sources":["../../src/Drawer/Drawer.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Drawer } from \"./Drawer.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { DropdownMenu } from \"~/DropdownMenu/index.js\";\nimport { Tabs } from \"~/Tabs/index.js\";\nimport { ReactComponent as DoorbellIcon } from \"@webiny/icons/ring_volume.svg\";\n\nconst meta: Meta<typeof Drawer> = {\n title: \"Components/Drawer\",\n component: Drawer,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Drawer>;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n title: \"Drawer Title\",\n description: \"A short dialog description.\",\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md\"}>\n The amazing, splendid, and most useful umbrella, resistant to rain and friendly\n to winds, is something that deserves all admiration. Crafted with perfect\n textures, it bravely withstands storms and gently shades the rays of the sun. A\n remarkable innovation, with an ergonomically designed grip most suited to the\n hand, it remains stable even in the fiercest weather.\n </p>\n <p className={\"mb-md\"}>\n Its fabric, woven from the highest quality materials, ensures that you stay dry,\n no matter the intensity of the rain. With a frame engineered for strength yet\n lightweight enough to carry with ease, this umbrella is a marvel of modern\n design. Not just a shield against the elements, but a companion in your everyday\n journey, it provides peace of mind, knowing you’re prepared for whatever the\n skies may bring.\n </p>\n <p className={\"mb-md\"}>\n The sleek, stylish design complements any outfit, making it not only a practical\n accessory but also a fashion statement. With its smooth opening mechanism, you\n can effortlessly transition from a sunny day to a rainy one without missing a\n beat. Whether you are navigating through a busy city street or enjoying a quiet\n stroll in the park, this umbrella offers unmatched comfort and protection.\n </p>\n <p className={\"mb-md\"}>\n Indeed, it is not just an umbrella — it is an experience. One that elevates your\n daily routine, making every step in both sun and storm feel just a little bit\n brighter.\n </p>\n </>\n ),\n onOpenChange: opened => {\n console.log(`Drawer is ${opened ? \"opened\" : \"closed\"}.`);\n },\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true\n },\n argTypes: {}\n};\n\nexport const SizeSmall: Story = {\n args: {\n ...Default.args,\n size: \"sm\"\n }\n};\n\nexport const SizeMedium: Story = {\n args: {\n ...Default.args,\n size: \"md\"\n }\n};\n\nexport const SizeLarge: Story = {\n args: {\n ...Default.args,\n size: \"lg\"\n }\n};\n\nexport const SizeExtraLarge: Story = {\n args: {\n ...Default.args,\n size: \"xl\"\n }\n};\n\nexport const ControlledVisibility: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text={\"Open\"} onClick={() => setOpen(true)} />\n <Drawer\n {...props}\n open={open}\n onOpenChange={open => {\n if (!open) {\n setOpen(false);\n }\n }}\n />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer's visibility is controlled by the open state.</>\n }\n};\n\nexport const WithOpenCloseEventHandler: Story = {\n args: {\n ...Default.args,\n onClose: () => {\n console.log(\"onClose triggered\");\n },\n onOpen: () => {\n console.log(\"onOpen triggered\");\n }\n }\n};\n\nexport const WithDropdownMenu: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item\n text={\"Open Drawer\"}\n content={\"Open Drawer\"}\n onClick={() => setOpen(true)}\n />\n </DropdownMenu>\n\n <Drawer {...props} open={open} onOpenChange={() => setOpen(false)} />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const WithoutCloseButton: Story = {\n args: {\n ...Default.args,\n showCloseButton: false,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const CustomWidth: Story = {\n args: {\n ...Default.args,\n width: 1000,\n children: <>This drawer has a custom width of 1000px, making it wider than the default.</>\n }\n};\n\nexport const WithTabs: Story = {\n args: {\n ...Default.args,\n bodyPadding: false,\n headerSeparator: false,\n children: (\n <>\n <Tabs\n separator={true}\n spacing={\"lg\"}\n tabs={[\n <Tabs.Tab\n key=\"account\"\n value=\"account\"\n trigger={\"Account\"}\n content={\"Make changes to your account here.\"}\n />,\n <Tabs.Tab\n key=\"company\"\n value=\"company\"\n trigger={\"Company\"}\n content={\"Make changes to your company info here.\"}\n />,\n <Tabs.Tab\n key=\"security\"\n value=\"security\"\n trigger={\"Security\"}\n content={\"Make changes to your security settings here.\"}\n />,\n <Tabs.Tab\n key=\"development\"\n value=\"development\"\n trigger={\"Development\"}\n content={\"Make changes to your development settings here.\"}\n />\n ]}\n />\n </>\n )\n }\n};\n\nexport const DropdownMenuInDrawer: Story = {\n args: {\n ...Default.args,\n children: (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item content={\"Billing\"} />\n <DropdownMenu.Item content={\"Settings\"} />\n <DropdownMenu.Item content={\"Keyboard shortcuts\"} />\n </DropdownMenu>\n </>\n )\n }\n};\n\nexport const WithIcon: Story = {\n args: {\n ...Default.args,\n icon: <Drawer.Icon icon={<DoorbellIcon />} label={\"Icon label...\"} />,\n children: <>The icon helps to visually identify the purpose of this drawer.</>\n }\n};\n\nexport const AsModal: Story = {\n args: {\n ...Default.args,\n modal: true,\n children: (\n <>\n This drawer has modal=true, which means it will show an overlay behind it and\n prevent interaction with the content underneath.\n </>\n )\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text=\"Open Drawer\" onClick={() => setOpen(true)} />\n\n <Drawer {...args} open={open} onOpenChange={open => setOpen(open)} />\n </>\n );\n },\n args: {\n title: \"Drawer Title\",\n description: \"A short drawer description.\",\n showCloseButton: true,\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true,\n side: \"right\",\n modal: false,\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md, mt-md\"}>\n This is the drawer content area. You can place any content here including forms,\n text, images, or other components.\n </p>\n <p className={\"mb-md\"}>\n Drawers are useful for displaying additional information or actions without\n navigating away from the current page.\n </p>\n </>\n ),\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n width: undefined\n },\n argTypes: {\n title: {\n description: \"Title displayed in the header\",\n control: \"text\"\n },\n description: {\n description: \"Description displayed below the title\",\n control: \"text\"\n },\n side: {\n description: \"Side from which the drawer appears\",\n control: \"select\",\n options: [\"left\", \"right\"],\n defaultValue: \"right\"\n },\n size: {\n description: \"Controls the size of the drawer\",\n control: \"select\",\n options: [\"sm\", \"md\", \"lg\", \"xl\"],\n defaultValue: \"md\"\n },\n showCloseButton: {\n description: \"Show close button in the top-right corner\",\n control: \"boolean\",\n defaultValue: true\n },\n modal: {\n description: \"Whether the drawer should behave as a modal\",\n control: \"boolean\",\n defaultValue: false\n },\n bodyPadding: {\n description: \"Add padding to the drawer body\",\n control: \"boolean\",\n defaultValue: true\n },\n headerSeparator: {\n description: \"Show separator below the header\",\n control: \"boolean\",\n defaultValue: true\n },\n footerSeparator: {\n description: \"Show separator above the footer\",\n control: \"boolean\",\n defaultValue: true\n },\n width: {\n description:\n 'Width defines the horizontal size of the Drawer and accepts any valid CSS width value. You can pass a number (interpreted as pixels) or a string like \"80%\", \"50vw\", \"auto\", etc., following React.CSSProperties[\"width\"] types.'\n },\n info: {\n description:\n \"Additional info displayed below the description, please refer to the example below for details.\"\n },\n children: {\n description:\n \"Content of the Drawer, please refer to the 'With Dropdown Menu' and ''With Tabs' example below for details.\"\n },\n actions: {\n description:\n \"Actions displayed in the footer, please refer to the code example for details.\"\n }\n }\n};\n"],"names":["meta","Drawer","Default","Button","opened","console","SizeSmall","SizeMedium","SizeLarge","SizeExtraLarge","ControlledVisibility","props","open","setOpen","React","WithOpenCloseEventHandler","WithDropdownMenu","DropdownMenu","WithoutCloseButton","CustomWidth","WithTabs","Tabs","DropdownMenuInDrawer","WithIcon","DoorbellIcon","AsModal","Documentation","args","undefined"],"mappings":";;;;;;AAQA,MAAMA,OAA4B;IAC9B,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,uBAAeD;AAIR,MAAME,UAAiB;IAC1B,MAAM;QACF,SAAS,WAAT,GAAS,oBAACC,QAAMA;YAAC,SAAQ;YAAU,MAAM;;QACzC,OAAO;QACP,aAAa;QACb,MAAM,WAAN,GACI,0CAAE,wCACwB,oBAAC;YAAE,MAAM;WAAK,SAAQ;QAGpD,UAAU,WAAV,GACI,wDACI,oBAAC;YAAE,WAAW;WAAS,gYAOvB,oBAAC;YAAE,WAAW;WAAS,2aAQvB,oBAAC;YAAE,WAAW;WAAS,2ZAOvB,oBAAC;YAAE,WAAW;WAAS;QAO/B,cAAcC,CAAAA;YACVC,QAAQ,GAAG,CAAC,CAAC,UAAU,EAAED,SAAS,WAAW,SAAS,CAAC,CAAC;QAC5D;QACA,SAAS,WAAT,GACI,wDACI,oBAACH,OAAO,YAAY,uBACpB,oBAACA,OAAO,aAAa;QAG7B,aAAa;QACb,iBAAiB;QACjB,iBAAiB;IACrB;IACA,UAAU,CAAC;AACf;AAEO,MAAMK,YAAmB;IAC5B,MAAM;QACF,GAAGJ,QAAQ,IAAI;QACf,MAAM;IACV;AACJ;AA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T,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,OAAO;YACH,aACI;QACR;QACA,MAAM;YACF,aACI;QACR;QACA,UAAU;YACN,aACI;QACR;QACA,SAAS;YACL,aACI;QACR;IACJ;AACJ"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ButtonProps } from "../../Button/index.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
declare const CancelButtonBase: (props: ButtonProps) => React.JSX.Element;
|
|
4
|
+
export declare const CancelButton: typeof CancelButtonBase & {
|
|
5
|
+
original: typeof CancelButtonBase;
|
|
5
6
|
originalName: string;
|
|
6
7
|
displayName: string;
|
|
7
8
|
} & {
|
|
8
|
-
original:
|
|
9
|
-
original:
|
|
9
|
+
original: typeof CancelButtonBase & {
|
|
10
|
+
original: typeof CancelButtonBase;
|
|
10
11
|
originalName: string;
|
|
11
12
|
displayName: string;
|
|
12
13
|
};
|
|
13
14
|
originalName: string;
|
|
14
15
|
displayName: string;
|
|
15
16
|
} & {
|
|
16
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
17
|
-
original:
|
|
17
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof CancelButtonBase & {
|
|
18
|
+
original: typeof CancelButtonBase;
|
|
18
19
|
originalName: string;
|
|
19
20
|
displayName: string;
|
|
20
21
|
}>) => (props: unknown) => React.JSX.Element;
|
|
21
22
|
};
|
|
23
|
+
export {};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ButtonProps } from "../../Button/index.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
declare const ConfirmButtonBase: (props: ButtonProps) => React.JSX.Element;
|
|
4
|
+
export declare const ConfirmButton: typeof ConfirmButtonBase & {
|
|
5
|
+
original: typeof ConfirmButtonBase;
|
|
5
6
|
originalName: string;
|
|
6
7
|
displayName: string;
|
|
7
8
|
} & {
|
|
8
|
-
original:
|
|
9
|
-
original:
|
|
9
|
+
original: typeof ConfirmButtonBase & {
|
|
10
|
+
original: typeof ConfirmButtonBase;
|
|
10
11
|
originalName: string;
|
|
11
12
|
displayName: string;
|
|
12
13
|
};
|
|
13
14
|
originalName: string;
|
|
14
15
|
displayName: string;
|
|
15
16
|
} & {
|
|
16
|
-
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<
|
|
17
|
-
original:
|
|
17
|
+
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof ConfirmButtonBase & {
|
|
18
|
+
original: typeof ConfirmButtonBase;
|
|
18
19
|
originalName: string;
|
|
19
20
|
displayName: string;
|
|
20
21
|
}>) => (props: unknown) => React.JSX.Element;
|
|
21
22
|
};
|
|
23
|
+
export {};
|
|
@@ -6,7 +6,7 @@ export interface DrawerContentProps extends React.ComponentPropsWithoutRef<typeo
|
|
|
6
6
|
modal?: boolean;
|
|
7
7
|
}
|
|
8
8
|
declare const drawerVariants: (props?: ({
|
|
9
|
-
size?: "
|
|
9
|
+
size?: "lg" | "md" | "sm" | "xl" | null | undefined;
|
|
10
10
|
side?: "left" | "right" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
declare const DrawerContent: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { IconProps as IconComponentProps } from "../../Icon/index.js";
|
|
3
3
|
type IconProps = IconComponentProps;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
declare const IconBase: ({ className, ...props }: IconProps) => React.JSX.Element;
|
|
5
|
+
export declare const Icon: typeof IconBase & {
|
|
6
|
+
original: typeof IconBase;
|
|
6
7
|
originalName: string;
|
|
7
8
|
displayName: string;
|
|
8
9
|
} & {
|
|
9
|
-
original:
|
|
10
|
-
original:
|
|
10
|
+
original: typeof IconBase & {
|
|
11
|
+
original: typeof IconBase;
|
|
11
12
|
originalName: string;
|
|
12
13
|
displayName: string;
|
|
13
14
|
};
|
|
14
15
|
originalName: string;
|
|
15
16
|
displayName: string;
|
|
16
17
|
} & {
|
|
17
|
-
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<
|
|
18
|
-
original:
|
|
18
|
+
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof IconBase & {
|
|
19
|
+
original: typeof IconBase;
|
|
19
20
|
originalName: string;
|
|
20
21
|
displayName: string;
|
|
21
22
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { type DropdownMenuItemIconProps } from "./DropdownMenuItemIcon.js";
|
|
2
|
+
import { DropdownMenuItemIcon, type DropdownMenuItemIconProps } from "./DropdownMenuItemIcon.js";
|
|
3
3
|
import { LinkComponentProps } from "../../index.js";
|
|
4
4
|
interface DropdownMenuItemBaseProps {
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
6
|
readOnly?: boolean;
|
|
7
|
+
variant?: "destructive";
|
|
7
8
|
text?: React.ReactNode;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
onClick?: React.MouseEventHandler;
|
|
@@ -32,6 +33,6 @@ declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItem
|
|
|
32
33
|
displayName: string;
|
|
33
34
|
}>) => (props: unknown) => React.JSX.Element;
|
|
34
35
|
} & {
|
|
35
|
-
Icon:
|
|
36
|
+
Icon: typeof DropdownMenuItemIcon;
|
|
36
37
|
};
|
|
37
38
|
export { DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemButtonProps, type DropdownMenuItemLinkProps, type DropdownMenuItemIconProps };
|
|
@@ -16,6 +16,12 @@ const variants = cva([
|
|
|
16
16
|
"[&_a]:no-underline! [&_a]:text-neutral-primary!"
|
|
17
17
|
], {
|
|
18
18
|
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
destructive: [
|
|
21
|
+
"text-destructive-primary!",
|
|
22
|
+
"[&_svg]:fill-destructive"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
19
25
|
readOnly: {
|
|
20
26
|
true: "pointer-events-none"
|
|
21
27
|
}
|
|
@@ -24,7 +30,7 @@ const variants = cva([
|
|
|
24
30
|
readOnly: false
|
|
25
31
|
}
|
|
26
32
|
});
|
|
27
|
-
const DropdownMenuItemBase = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, icon, text, readOnly, disabled, onClick, children, ...linkProps }, ref)=>{
|
|
33
|
+
const DropdownMenuItemBase = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, icon, text, readOnly, variant, disabled, onClick, children, ...linkProps }, ref)=>{
|
|
28
34
|
const { linkComponent: LinkComponent } = useAdminUi();
|
|
29
35
|
if (children) return /*#__PURE__*/ __rspack_external_react.createElement(DropdownMenuSubRoot, null, /*#__PURE__*/ __rspack_external_react.createElement(DropdownMenuSubTrigger, null, icon, /*#__PURE__*/ __rspack_external_react.createElement("span", null, text)), /*#__PURE__*/ __rspack_external_react.createElement(DropdownMenuPortal, null, /*#__PURE__*/ __rspack_external_react.createElement(DropdownMenuSubContent, null, children)));
|
|
30
36
|
const sharedProps = {
|
|
@@ -43,7 +49,8 @@ const DropdownMenuItemBase = /*#__PURE__*/ __rspack_external_react.forwardRef(({
|
|
|
43
49
|
disabled: disabled,
|
|
44
50
|
ref: ref,
|
|
45
51
|
className: cn(variants({
|
|
46
|
-
readOnly
|
|
52
|
+
readOnly,
|
|
53
|
+
variant
|
|
47
54
|
}), className)
|
|
48
55
|
}, content);
|
|
49
56
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/components/DropdownMenuItem.js","sources":["../../../src/DropdownMenu/components/DropdownMenuItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, cva, makeDecoratable } from \"~/utils.js\";\nimport { DropdownMenuSubRoot } from \"./DropdownMenuSubRoot.js\";\nimport { DropdownMenuSubTrigger } from \"./DropdownMenuSubTrigger.js\";\nimport { DropdownMenuPortal } from \"./DropdownMenuPortal.js\";\nimport { DropdownMenuSubContent } from \"./DropdownMenuSubContent.js\";\nimport { DropdownMenuItemIcon, type DropdownMenuItemIconProps } from \"./DropdownMenuItemIcon.js\";\nimport { LinkComponentProps, useAdminUi } from \"~/index.js\";\n\ninterface DropdownMenuItemBaseProps {\n icon?: React.ReactNode;\n readOnly?: boolean;\n text?: React.ReactNode;\n disabled?: boolean;\n onClick?: React.MouseEventHandler;\n}\n\ntype DropdownMenuItemButtonProps = (DropdownMenuItemBaseProps &\n React.HTMLAttributes<HTMLDivElement>) & { to?: never };\ntype DropdownMenuItemLinkProps = DropdownMenuItemBaseProps & LinkComponentProps;\n\ntype DropdownMenuItemProps = DropdownMenuItemButtonProps | DropdownMenuItemLinkProps;\n\nconst variants = cva(\n [\n \"group relative cursor-default select-none items-center rounded-sm\",\n \"text-md text-neutral-primary no-underline!\",\n \"px-xs-plus outline-none transition-colors\",\n \"[&_svg]:fill-neutral-xstrong [&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0\",\n \"data-disabled:pointer-events-none data-disabled:text-neutral-disabled\",\n \"[&_a]:no-underline! [&_a]:text-neutral-primary!\"\n ],\n {\n variants: {\n readOnly: {\n true: \"pointer-events-none\"\n }\n },\n defaultVariants: {\n readOnly: false\n }\n }\n);\n\nconst DropdownMenuItemBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(({ className, icon, text, readOnly, disabled, onClick, children, ...linkProps }
|
|
1
|
+
{"version":3,"file":"DropdownMenu/components/DropdownMenuItem.js","sources":["../../../src/DropdownMenu/components/DropdownMenuItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, cva, makeDecoratable } from \"~/utils.js\";\nimport { DropdownMenuSubRoot } from \"./DropdownMenuSubRoot.js\";\nimport { DropdownMenuSubTrigger } from \"./DropdownMenuSubTrigger.js\";\nimport { DropdownMenuPortal } from \"./DropdownMenuPortal.js\";\nimport { DropdownMenuSubContent } from \"./DropdownMenuSubContent.js\";\nimport { DropdownMenuItemIcon, type DropdownMenuItemIconProps } from \"./DropdownMenuItemIcon.js\";\nimport { LinkComponentProps, useAdminUi } from \"~/index.js\";\n\ninterface DropdownMenuItemBaseProps {\n icon?: React.ReactNode;\n readOnly?: boolean;\n variant?: \"destructive\";\n text?: React.ReactNode;\n disabled?: boolean;\n onClick?: React.MouseEventHandler;\n}\n\ntype DropdownMenuItemButtonProps = (DropdownMenuItemBaseProps &\n React.HTMLAttributes<HTMLDivElement>) & { to?: never };\ntype DropdownMenuItemLinkProps = DropdownMenuItemBaseProps & LinkComponentProps;\n\ntype DropdownMenuItemProps = DropdownMenuItemButtonProps | DropdownMenuItemLinkProps;\n\nconst variants = cva(\n [\n \"group relative cursor-default select-none items-center rounded-sm\",\n \"text-md text-neutral-primary no-underline!\",\n \"px-xs-plus outline-none transition-colors\",\n \"[&_svg]:fill-neutral-xstrong [&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0\",\n \"data-disabled:pointer-events-none data-disabled:text-neutral-disabled\",\n \"[&_a]:no-underline! [&_a]:text-neutral-primary!\"\n ],\n {\n variants: {\n variant: {\n destructive: [\"text-destructive-primary!\", \"[&_svg]:fill-destructive\"]\n },\n readOnly: {\n true: \"pointer-events-none\"\n }\n },\n defaultVariants: {\n readOnly: false\n }\n }\n);\n\nconst DropdownMenuItemBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(\n (\n { className, icon, text, readOnly, variant, disabled, onClick, children, ...linkProps },\n ref\n ) => {\n const { linkComponent: LinkComponent } = useAdminUi();\n\n if (children) {\n return (\n <DropdownMenuSubRoot>\n <DropdownMenuSubTrigger>\n {icon}\n <span>{text}</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuPortal>\n <DropdownMenuSubContent>{children}</DropdownMenuSubContent>\n </DropdownMenuPortal>\n </DropdownMenuSubRoot>\n );\n }\n const sharedProps = {\n className: cn(\n \"flex px-sm py-xs-plus gap-sm-extra items-center text-md rounded-sm transition-colors group-focus:bg-neutral-dimmed\",\n {\n \"[&_svg]:fill-neutral-disabled!\": disabled\n }\n )\n };\n\n const content = linkProps.to ? (\n <LinkComponent {...sharedProps} {...linkProps}>\n {icon}\n <span>{text}</span>\n </LinkComponent>\n ) : (\n <div {...sharedProps} onClick={onClick}>\n {icon}\n <span>{text}</span>\n </div>\n );\n\n return (\n <DropdownMenuPrimitive.Item\n disabled={disabled}\n ref={ref}\n className={cn(variants({ readOnly, variant }), className)}\n >\n {content}\n </DropdownMenuPrimitive.Item>\n );\n }\n);\n\nDropdownMenuItemBase.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DecoratableDropdownMenuItem = makeDecoratable(\"DropdownMenuItem\", DropdownMenuItemBase);\n\nconst DropdownMenuItem = Object.assign(DecoratableDropdownMenuItem, {\n Icon: DropdownMenuItemIcon\n});\n\nexport {\n DropdownMenuItem,\n type DropdownMenuItemProps,\n type DropdownMenuItemButtonProps,\n type DropdownMenuItemLinkProps,\n type DropdownMenuItemIconProps\n};\n"],"names":["variants","cva","DropdownMenuItemBase","React","className","icon","text","readOnly","variant","disabled","onClick","children","linkProps","ref","LinkComponent","useAdminUi","DropdownMenuSubRoot","DropdownMenuSubTrigger","DropdownMenuPortal","DropdownMenuSubContent","sharedProps","cn","content","DropdownMenuPrimitive","DecoratableDropdownMenuItem","makeDecoratable","DropdownMenuItem","Object","DropdownMenuItemIcon"],"mappings":";;;;;;;;;AAyBA,MAAMA,WAAWC,IACb;IACI;IACA;IACA;IACA;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,SAAS;YACL,aAAa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React from "react";
|
|
2
2
|
import { type DropdownMenuItemLinkProps } from "./DropdownMenuItem.js";
|
|
3
|
-
import { type DropdownMenuItemIconProps } from "./DropdownMenuItemIcon.js";
|
|
3
|
+
import { DropdownMenuItemIcon, type DropdownMenuItemIconProps } from "./DropdownMenuItemIcon.js";
|
|
4
4
|
export type DropdownMenuLinkProps = DropdownMenuItemLinkProps;
|
|
5
|
-
declare const
|
|
6
|
-
|
|
5
|
+
declare const DropdownMenuLinkBase: (props: DropdownMenuLinkProps) => React.JSX.Element;
|
|
6
|
+
declare const DropdownMenuLink: typeof DropdownMenuLinkBase & {
|
|
7
|
+
original: typeof DropdownMenuLinkBase;
|
|
7
8
|
originalName: string;
|
|
8
9
|
displayName: string;
|
|
9
10
|
} & {
|
|
10
|
-
original:
|
|
11
|
-
original:
|
|
11
|
+
original: typeof DropdownMenuLinkBase & {
|
|
12
|
+
original: typeof DropdownMenuLinkBase;
|
|
12
13
|
originalName: string;
|
|
13
14
|
displayName: string;
|
|
14
15
|
};
|
|
15
16
|
originalName: string;
|
|
16
17
|
displayName: string;
|
|
17
18
|
} & {
|
|
18
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
19
|
-
original:
|
|
19
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DropdownMenuLinkBase & {
|
|
20
|
+
original: typeof DropdownMenuLinkBase;
|
|
20
21
|
originalName: string;
|
|
21
22
|
displayName: string;
|
|
22
23
|
}>) => (props: unknown) => React.JSX.Element;
|
|
23
24
|
} & {
|
|
24
|
-
Icon:
|
|
25
|
+
Icon: typeof DropdownMenuItemIcon;
|
|
25
26
|
};
|
|
26
27
|
export { DropdownMenuLink, type DropdownMenuItemLinkProps, type DropdownMenuItemIconProps };
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type SeparatorProps } from "../../Separator/index.js";
|
|
3
3
|
type DropdownMenuSeparatorProps = SeparatorProps;
|
|
4
|
-
declare const
|
|
5
|
-
|
|
4
|
+
declare const DropdownMenuSeparatorBase: (props: DropdownMenuSeparatorProps) => React.JSX.Element;
|
|
5
|
+
declare const DropdownMenuSeparator: typeof DropdownMenuSeparatorBase & {
|
|
6
|
+
original: typeof DropdownMenuSeparatorBase;
|
|
6
7
|
originalName: string;
|
|
7
8
|
displayName: string;
|
|
8
9
|
} & {
|
|
9
|
-
original:
|
|
10
|
-
original:
|
|
10
|
+
original: typeof DropdownMenuSeparatorBase & {
|
|
11
|
+
original: typeof DropdownMenuSeparatorBase;
|
|
11
12
|
originalName: string;
|
|
12
13
|
displayName: string;
|
|
13
14
|
};
|
|
14
15
|
originalName: string;
|
|
15
16
|
displayName: string;
|
|
16
17
|
} & {
|
|
17
|
-
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<
|
|
18
|
-
original:
|
|
18
|
+
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof DropdownMenuSeparatorBase & {
|
|
19
|
+
original: typeof DropdownMenuSeparatorBase;
|
|
19
20
|
originalName: string;
|
|
20
21
|
displayName: string;
|
|
21
22
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -44,21 +44,22 @@ interface EditableTitleProps {
|
|
|
44
44
|
className?: string;
|
|
45
45
|
"data-testid"?: string;
|
|
46
46
|
}
|
|
47
|
-
declare const
|
|
48
|
-
|
|
47
|
+
declare const DecoratableEditableTitle: ({ value, onCommit, readOnly, placeholder, autoFocus, autoSelect, startContent, tooltip, isEditing: controlledEditing, onEditingChange, className, "data-testid": dataTestId }: EditableTitleProps) => React.JSX.Element;
|
|
48
|
+
declare const EditableTitle: typeof DecoratableEditableTitle & {
|
|
49
|
+
original: typeof DecoratableEditableTitle;
|
|
49
50
|
originalName: string;
|
|
50
51
|
displayName: string;
|
|
51
52
|
} & {
|
|
52
|
-
original:
|
|
53
|
-
original:
|
|
53
|
+
original: typeof DecoratableEditableTitle & {
|
|
54
|
+
original: typeof DecoratableEditableTitle;
|
|
54
55
|
originalName: string;
|
|
55
56
|
displayName: string;
|
|
56
57
|
};
|
|
57
58
|
originalName: string;
|
|
58
59
|
displayName: string;
|
|
59
60
|
} & {
|
|
60
|
-
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<
|
|
61
|
-
original:
|
|
61
|
+
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof DecoratableEditableTitle & {
|
|
62
|
+
original: typeof DecoratableEditableTitle;
|
|
62
63
|
originalName: string;
|
|
63
64
|
displayName: string;
|
|
64
65
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type VariantProps } from "../utils.js";
|
|
3
|
+
import { ContentIllustration, LayoutIllustration, ListingIllustration, SelectIllustration, TableIllustration, UploadIllustration } from "./illustrations/index.js";
|
|
4
|
+
declare const ILLUSTRATIONS: {
|
|
5
|
+
content: typeof ContentIllustration;
|
|
6
|
+
table: typeof TableIllustration;
|
|
7
|
+
listing: typeof ListingIllustration;
|
|
8
|
+
layout: typeof LayoutIllustration;
|
|
9
|
+
upload: typeof UploadIllustration;
|
|
10
|
+
select: typeof SelectIllustration;
|
|
11
|
+
};
|
|
12
|
+
type EmptyStateType = keyof typeof ILLUSTRATIONS;
|
|
13
|
+
declare const emptyStateVariants: (props?: ({
|
|
14
|
+
size?: "lg" | "md" | "sm" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof emptyStateVariants> {
|
|
17
|
+
type?: EmptyStateType;
|
|
18
|
+
title?: React.ReactNode;
|
|
19
|
+
description?: React.ReactNode;
|
|
20
|
+
illustration?: boolean;
|
|
21
|
+
actions?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare const DecoratableEmptyState: ({ size, type, title, description, illustration, actions, className, ...props }: EmptyStateProps) => React.JSX.Element;
|
|
24
|
+
declare const EmptyState: typeof DecoratableEmptyState & {
|
|
25
|
+
original: typeof DecoratableEmptyState;
|
|
26
|
+
originalName: string;
|
|
27
|
+
displayName: string;
|
|
28
|
+
} & {
|
|
29
|
+
original: typeof DecoratableEmptyState & {
|
|
30
|
+
original: typeof DecoratableEmptyState;
|
|
31
|
+
originalName: string;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
originalName: string;
|
|
35
|
+
displayName: string;
|
|
36
|
+
} & {
|
|
37
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableEmptyState & {
|
|
38
|
+
original: typeof DecoratableEmptyState;
|
|
39
|
+
originalName: string;
|
|
40
|
+
displayName: string;
|
|
41
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
42
|
+
};
|
|
43
|
+
export { EmptyState, type EmptyStateProps, type EmptyStateType };
|