@webiny/admin-ui 6.2.0-beta.0 → 6.3.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.d.ts +1 -1
- package/Accordion/Accordion.mdx +437 -463
- package/Accordion/components/AccordionContent.js.map +1 -1
- package/Alert/Alert.d.ts +1 -1
- package/Alert/Alert.js.map +1 -1
- package/Alert/Alert.mdx +80 -83
- package/AutoComplete/AutoComplete.mdx +63 -55
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/Avatar.js.map +1 -1
- package/Avatar/Avatar.mdx +52 -43
- package/Button/Button.d.ts +1 -1
- package/Button/Button.js.map +1 -1
- package/Button/Button.mdx +50 -42
- package/Button/IconButton.d.ts +1 -1
- package/Button/IconButton.js.map +1 -1
- package/Card/components/CardContent.d.ts +1 -1
- package/Card/components/CardTitle.d.ts +1 -1
- package/Checkbox/Checkbox.mdx +51 -49
- package/Checkbox/primitives/CheckboxPrimitive.d.ts +1 -1
- package/CheckboxGroup/CheckboxGroup.mdx +51 -53
- package/CodeEditor/CodeEditor.mdx +44 -43
- package/ColorPicker/ColorPicker.mdx +41 -40
- package/Command/components/Item.d.ts +1 -1
- package/Command/components/Item.js.map +1 -1
- package/DataTable/DataTable.mdx +537 -542
- package/DataTable/components/ColumnSorter.d.ts +1 -1
- package/DataTable/components/ColumnSorter.js.map +1 -1
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/components/DialogContent.d.ts +1 -1
- package/Dialog/components/DialogContent.js +1 -1
- package/Dialog/components/DialogContent.js.map +1 -1
- package/Dialog/components/DialogFooter.d.ts +1 -1
- package/Dialog/components/DialogFooter.js.map +1 -1
- package/Dialog/components/DialogTitle.d.ts +1 -1
- package/Drawer/Drawer.js.map +1 -1
- package/Drawer/Drawer.mdx +73 -64
- package/Drawer/components/DrawerContent.d.ts +1 -1
- package/Drawer/components/DrawerContent.js.map +1 -1
- package/DropdownMenu/DropdownMenu.js.map +1 -1
- package/DropdownMenu/DropdownMenu.mdx +155 -256
- package/DropdownMenu/components/DropdownMenuCheckboxItem.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuLabel.js.map +1 -1
- package/FilePicker/FilePicker.mdx +69 -69
- package/FilePicker/primitives/FilePickerPrimitive.d.ts +19 -19
- package/FilePicker/primitives/FilePickerPrimitive.js.map +1 -1
- package/FilePicker/primitives/components/Trigger.d.ts +1 -1
- package/FilePicker/primitives/components/previews/TextOnlyPreview/TextOnlyPreview.d.ts +1 -1
- package/FilePicker/primitives/components/previews/variants.d.ts +1 -1
- package/FilePicker/primitives/components/types.js.map +1 -1
- package/FormComponent/Description.d.ts +1 -1
- package/FormComponent/ErrorMessage.d.ts +1 -1
- package/FormComponent/Note.d.ts +1 -1
- package/Grid/Grid.d.ts +2 -2
- package/Grid/Grid.js.map +1 -1
- package/Grid/Grid.mdx +111 -121
- package/HeaderBar/HeaderBar.mdx +98 -99
- package/Heading/Heading.d.ts +1 -1
- package/Heading/Heading.js.map +1 -1
- package/Heading/Heading.mdx +63 -58
- package/Icon/Icon.d.ts +1 -1
- package/Icon/Icon.js.map +1 -1
- package/Icon/Icon.mdx +79 -147
- package/IconPicker/IconPicker.mdx +66 -64
- package/IconPicker/primitives/IconPickerPrimitive.d.ts +1 -1
- package/IconPicker/primitives/components/IconPickerTrigger.d.ts +1 -1
- package/Image/Image.js.map +1 -1
- package/Input/Input.mdx +67 -56
- package/Input/InputPrimitive.d.ts +1 -1
- package/Label/Label.d.ts +1 -1
- package/Label/Label.js.map +1 -1
- package/Label/Label.mdx +42 -42
- package/Label/components/LabelDescription.d.ts +1 -1
- package/Label/components/LabelRequired.d.ts +1 -1
- package/Label/components/LabelValue.d.ts +1 -1
- package/Link/Link.d.ts +1 -1
- package/Link/Link.mdx +129 -116
- package/List/List.d.ts +1 -1
- package/List/List.js.map +1 -1
- package/List/List.mdx +317 -329
- package/List/components/ListItem.d.ts +1 -1
- package/List/components/ListItem.js.map +1 -1
- package/Loader/Loader.d.ts +2 -2
- package/Loader/Loader.js.map +1 -1
- package/Loader/Loader.mdx +96 -91
- package/MultiAutoComplete/MultiAutoComplete.mdx +52 -51
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteInput.d.ts +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenter.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenterWithUniqueValues.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteSelectedOptionsPresenter.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteTemporaryOptionPresenter.js.map +1 -1
- package/MultiFilePicker/MultiFilePicker.mdx +84 -80
- package/MultiFilePicker/primitives/MultiFilePickerPrimitive.js.map +1 -1
- package/Popover/Popover.mdx +112 -118
- package/Popover/primitives/components/PopoverArrow.d.ts +1 -1
- package/Popover/primitives/components/PopoverContent.d.ts +1 -1
- package/RadioGroup/RadioGroup.mdx +62 -59
- package/RadioGroup/primitives/RadioGroupPrimitive.js.map +1 -1
- package/RangeSlider/RangeSlider.mdx +48 -47
- package/RangeSlider/primitives/RangeSliderPrimitive.js.map +1 -1
- package/RangeSlider/primitives/components/RangeSliderValue.d.ts +1 -1
- package/RangeSlider/primitives/components/RangeSliderValue.js.map +1 -1
- package/ScrollArea/ScrollArea.js.map +1 -1
- package/SegmentedControl/SegmentedControl.mdx +59 -59
- package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +1 -1
- package/SegmentedControl/primitives/SegmentedControlPrimitive.js.map +1 -1
- package/Select/Select.mdx +52 -43
- package/Select/primitives/components/SelectTrigger.d.ts +1 -1
- package/Select/primitives/components/SelectTrigger.js.map +1 -1
- package/Select/primitives/presenters/SelectPresenter.d.ts +1 -1
- package/Separator/Separator.d.ts +1 -1
- package/Separator/Separator.mdx +139 -150
- package/Sidebar/Sidebar.js.map +1 -1
- package/Sidebar/Sidebar.mdx +66 -88
- package/Sidebar/components/items/SidebarMenuSubItemIndentation.d.ts +1 -1
- package/Sidebar/components/items/SidebarMenuSubItemIndentation.js.map +1 -1
- package/Skeleton/Skeleton.d.ts +1 -1
- package/Skeleton/Skeleton.js.map +1 -1
- package/Skeleton/Skeleton.mdx +37 -37
- package/Slider/Slider.mdx +48 -47
- package/Slider/primitives/SliderPrimitive.js.map +1 -1
- package/Slider/primitives/components/SliderSideValue.d.ts +1 -1
- package/Slider/primitives/components/SliderSideValue.js.map +1 -1
- package/Slider/primitives/components/SliderTooltip.d.ts +1 -1
- package/SteppedProgress/components/SteppedProgressIcon.d.ts +1 -1
- package/SteppedProgress/components/SteppedProgressIcon.js.map +1 -1
- package/SteppedProgress/components/SteppedProgressIndicator.d.ts +1 -1
- package/SteppedProgress/components/SteppedProgressIndicator.js.map +1 -1
- package/Switch/Switch.mdx +44 -42
- package/Switch/primitives/SwitchPrimitive.d.ts +1 -1
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js.map +1 -1
- package/Table/components/Direction.d.ts +1 -1
- package/Table/components/Direction.js.map +1 -1
- package/Table/components/Header.d.ts +1 -1
- package/Table/components/Header.js.map +1 -1
- package/Table/components/Resizer.d.ts +1 -1
- package/Table/components/Resizer.js.map +1 -1
- package/Table/components/Row.d.ts +1 -1
- package/Table/components/Row.js.map +1 -1
- package/Tabs/Tabs.mdx +297 -292
- package/Tabs/components/Content.d.ts +1 -1
- package/Tabs/components/List.d.ts +1 -1
- package/Tabs/components/Trigger.d.ts +1 -1
- package/Tag/Tag.d.ts +1 -1
- package/Tag/Tag.js.map +1 -1
- package/Tag/Tag.mdx +68 -64
- package/Tags/primitives/TagsPrimitive.js.map +1 -1
- package/Text/Text.d.ts +1 -1
- package/Text/Text.mdx +54 -48
- package/Textarea/Textarea.mdx +49 -39
- package/Textarea/TextareaPrimitive.d.ts +1 -1
- package/Textarea/TextareaPrimitive.js.map +1 -1
- package/Toast/Toast.mdx +63 -53
- package/Toast/components/ToastRoot.d.ts +1 -1
- package/Tooltip/Tooltip.mdx +197 -198
- package/Tooltip/components/TooltipArrow.d.ts +1 -1
- package/Tooltip/components/TooltipContent.d.ts +1 -1
- package/Tree/components/Item.d.ts +1 -1
- package/Tree/useTree.d.ts +1 -1
- package/Widget/components/WidgetContent.d.ts +1 -1
- package/package.json +15 -15
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { type VariantProps } from "../../utils.js";
|
|
3
3
|
declare const columnSorterVariants: (props?: ({
|
|
4
4
|
sortable?: boolean | null | undefined;
|
|
5
|
-
} & import("class-variance-authority/
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
interface ColumnSorterProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof columnSorterVariants> {
|
|
7
7
|
}
|
|
8
8
|
declare const ColumnSorter: ({ className, children, sortable, ...props }: ColumnSorterProps) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","cn","cva","columnSorterVariants","variants","sortable","true","ColumnSorter","className","children","props","createElement","Object","assign"],"sources":["ColumnSorter.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nconst columnSorterVariants = cva(\"flex items-center gap-xxs cursor-auto\", {\n variants: {\n sortable: {\n true: \"cursor-pointer\"\n }\n }\n});\n\ninterface ColumnSorterProps\n extends React.HTMLAttributes<HTMLDivElement
|
|
1
|
+
{"version":3,"names":["React","cn","cva","columnSorterVariants","variants","sortable","true","ColumnSorter","className","children","props","createElement","Object","assign"],"sources":["ColumnSorter.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nconst columnSorterVariants = cva(\"flex items-center gap-xxs cursor-auto\", {\n variants: {\n sortable: {\n true: \"cursor-pointer\"\n }\n }\n});\n\ninterface ColumnSorterProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof columnSorterVariants> {}\n\nconst ColumnSorter = ({ className, children, sortable, ...props }: ColumnSorterProps) => {\n return (\n <div {...props} className={cn(columnSorterVariants({ sortable }), className)}>\n {children}\n </div>\n );\n};\n\nexport { ColumnSorter };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,EAAE,EAAEC,GAAG;AAEhB,MAAMC,oBAAoB,GAAGD,GAAG,CAAC,uCAAuC,EAAE;EACtEE,QAAQ,EAAE;IACNC,QAAQ,EAAE;MACNC,IAAI,EAAE;IACV;EACJ;AACJ,CAAC,CAAC;AAKF,MAAMC,YAAY,GAAGA,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAEJ,QAAQ;EAAE,GAAGK;AAAyB,CAAC,KAAK;EACrF,oBACIV,KAAA,CAAAW,aAAA,QAAAC,MAAA,CAAAC,MAAA,KAASH,KAAK;IAAEF,SAAS,EAAEP,EAAE,CAACE,oBAAoB,CAAC;MAAEE;IAAS,CAAC,CAAC,EAAEG,SAAS;EAAE,IACxEC,QACA,CAAC;AAEd,CAAC;AAED,SAASF,YAAY","ignoreList":[]}
|
package/Dialog/Dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","makeDecoratable","withStaticProps","DialogContent","DialogHeader","DialogBody","DialogFooter","DialogOverlay","DialogPortal","DialogRoot","DialogTrigger","Icon","ConfirmAction","CancelAction","CloseDialogIconButton","DialogClose","DialogBase","props","rootProps","triggerProps","contentProps","headerProps","bodyProps","footerProps","closeButtonProps","useMemo","defaultOpen","open","onOpenChange","originalOnOpenChange","onClose","onOpen","modal","dir","size","trigger","title","icon","description","children","bodyPadding","actions","info","showCloseButton","rest","createElement","show","Object","assign","asChild","className","displayName","DecoratableDialog","Dialog","Close"],"sources":["Dialog.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { DialogContent } from \"./components/DialogContent.js\";\nimport { DialogHeader } from \"~/Dialog/components/DialogHeader.js\";\nimport { DialogBody } from \"~/Dialog/components/DialogBody.js\";\nimport { DialogFooter } from \"~/Dialog/components/DialogFooter.js\";\nimport { DialogOverlay } from \"~/Dialog/components/DialogOverlay.js\";\nimport { DialogPortal } from \"./components/DialogPortal.js\";\nimport { DialogRoot } from \"./components/DialogRoot.js\";\nimport { DialogTrigger } from \"./components/DialogTrigger.js\";\nimport { Icon } from \"./components/Icon.js\";\nimport { ConfirmAction } from \"./components/ConfirmAction.js\";\nimport { CancelAction } from \"./components/CancelAction.js\";\nimport { CloseDialogIconButton } from \"~/Dialog/components/CloseDialogIconButton.js\";\nimport { DialogClose } from \"~/Dialog/components/DialogClose.js\";\n\ninterface DialogProps\n extends
|
|
1
|
+
{"version":3,"names":["React","makeDecoratable","withStaticProps","DialogContent","DialogHeader","DialogBody","DialogFooter","DialogOverlay","DialogPortal","DialogRoot","DialogTrigger","Icon","ConfirmAction","CancelAction","CloseDialogIconButton","DialogClose","DialogBase","props","rootProps","triggerProps","contentProps","headerProps","bodyProps","footerProps","closeButtonProps","useMemo","defaultOpen","open","onOpenChange","originalOnOpenChange","onClose","onOpen","modal","dir","size","trigger","title","icon","description","children","bodyPadding","actions","info","showCloseButton","rest","createElement","show","Object","assign","asChild","className","displayName","DecoratableDialog","Dialog","Close"],"sources":["Dialog.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { DialogContent } from \"./components/DialogContent.js\";\nimport { DialogHeader } from \"~/Dialog/components/DialogHeader.js\";\nimport { DialogBody } from \"~/Dialog/components/DialogBody.js\";\nimport { DialogFooter } from \"~/Dialog/components/DialogFooter.js\";\nimport { DialogOverlay } from \"~/Dialog/components/DialogOverlay.js\";\nimport { DialogPortal } from \"./components/DialogPortal.js\";\nimport { DialogRoot } from \"./components/DialogRoot.js\";\nimport { DialogTrigger } from \"./components/DialogTrigger.js\";\nimport { Icon } from \"./components/Icon.js\";\nimport { ConfirmAction } from \"./components/ConfirmAction.js\";\nimport { CancelAction } from \"./components/CancelAction.js\";\nimport { CloseDialogIconButton } from \"~/Dialog/components/CloseDialogIconButton.js\";\nimport { DialogClose } from \"~/Dialog/components/DialogClose.js\";\n\ninterface DialogProps\n extends\n React.ComponentPropsWithoutRef<typeof DialogRoot>,\n Omit<React.ComponentPropsWithoutRef<typeof DialogContent>, \"title\"> {\n trigger?: React.ReactNode;\n title?: React.ReactNode;\n icon?: React.ReactElement;\n showCloseButton?: boolean;\n dismissible?: boolean;\n bodyPadding?: boolean;\n description?: React.ReactNode;\n children: React.ReactNode;\n actions?: React.ReactNode;\n info?: React.ReactNode;\n onClose?: () => void;\n onOpen?: () => void;\n}\n\nconst DialogBase = (props: DialogProps) => {\n const {\n rootProps,\n triggerProps,\n contentProps,\n headerProps,\n bodyProps,\n footerProps,\n closeButtonProps\n } = React.useMemo(() => {\n const {\n // Root props.\n defaultOpen,\n open,\n onOpenChange: originalOnOpenChange,\n onClose,\n onOpen,\n modal,\n dir,\n\n // Shared props.\n size,\n\n // Trigger props.\n trigger,\n\n // Header props.\n title,\n icon,\n description,\n\n // Body props.\n children,\n bodyPadding,\n\n // Footer props.\n actions,\n info,\n\n // Close button props.\n showCloseButton = true,\n\n // Content props.\n ...rest\n } = props;\n\n // Handles dialog open state changes, calling original and onClose / onOpen callbacks as needed\n const onOpenChange = (open: boolean) => {\n originalOnOpenChange && originalOnOpenChange(open);\n\n if (onClose && !open) {\n onClose();\n }\n\n if (onOpen && open) {\n onOpen();\n }\n };\n\n return {\n rootProps: {\n defaultOpen,\n open,\n onOpenChange,\n modal,\n dir,\n size\n },\n triggerProps: {\n // Temporary fix. We need this because `ref` doesn't get passed to components\n // that are decorated with `makeDecoratable`. This will be fixed in the future.\n children: <div>{trigger}</div>\n },\n headerProps: { title, icon, description, size },\n bodyProps: { children, bodyPadding, size },\n footerProps: { info, actions, size },\n closeButtonProps: { show: showCloseButton, size },\n contentProps: { ...rest, size }\n };\n }, [props]);\n\n return (\n <DialogRoot {...rootProps}>\n {triggerProps.children && <DialogTrigger {...triggerProps} asChild />}\n <DialogPortal>\n <div data-role=\"dialog\" className={\"z-overlay absolute\"}>\n <DialogOverlay />\n <DialogContent {...contentProps}>\n <DialogHeader {...headerProps} />\n <DialogBody {...bodyProps} />\n <DialogFooter {...footerProps} />\n {closeButtonProps.show && (\n <CloseDialogIconButton size={closeButtonProps.size} />\n )}\n </DialogContent>\n </div>\n </DialogPortal>\n </DialogRoot>\n );\n};\n\nDialogBase.displayName = \"Dialog\";\n\nconst DecoratableDialog = makeDecoratable(\"Dialog\", DialogBase);\n\nconst Dialog = withStaticProps(DecoratableDialog, {\n ConfirmAction,\n CancelAction,\n Icon,\n Close: DialogClose\n});\n\nexport { Dialog, type DialogProps };\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@ import { Dialog as DialogPrimitive } from "radix-ui";
|
|
|
3
3
|
import { type VariantProps } from "../../utils.js";
|
|
4
4
|
declare const dialogContentVariants: (props?: ({
|
|
5
5
|
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
6
|
-
} & import("class-variance-authority/
|
|
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;
|
|
9
9
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
3
3
|
import { cn, cva } from "../../utils.js";
|
|
4
|
-
const dialogContentVariants = cva(["fixed left-[50%] top-[50%] border-none bg-neutral-base shadow-lg focus-visible:outline-none rounded-xl text-md text-neutral-strong max-h-screen", "translate-x-[-50%] translate-y-[-50%] duration-200 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", "focus:outline-none focus-visible:outline-none", "max-w-[calc(100vw-var(--spacing-lg))] max-h-[calc(100vh-var(--spacing-lg))] z-dialog"], {
|
|
4
|
+
const dialogContentVariants = cva(["fixed left-[50%] top-[50%] border-none bg-neutral-base shadow-lg focus-visible:outline-none rounded-xl text-md text-neutral-strong max-h-screen", "translate-x-[-50%] translate-y-[-50%] duration-200 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", "focus:outline-none focus-visible:outline-none", "max-w-[calc(100vw-var(--spacing-lg))] max-h-[calc(100vh-var(--spacing-lg))] z-dialog", "overflow-hidden"], {
|
|
5
5
|
variants: {
|
|
6
6
|
size: {
|
|
7
7
|
sm: "w-[384px]",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Dialog","DialogPrimitive","cn","cva","dialogContentVariants","variants","size","sm","md","lg","xl","full","defaultVariants","DialogContent","forwardRef","className","dismissible","children","props","ref","dismissibleProps","useMemo","onInteractOutside","event","preventDefault","onEscapeKeyDown","createElement","Content","Object","assign","undefined","displayName"],"sources":["DialogContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nconst dialogContentVariants = cva(\n [\n \"fixed left-[50%] top-[50%] border-none bg-neutral-base shadow-lg focus-visible:outline-none rounded-xl text-md text-neutral-strong max-h-screen\",\n \"translate-x-[-50%] translate-y-[-50%] duration-200 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\",\n \"focus:outline-none focus-visible:outline-none\",\n \"max-w-[calc(100vw-var(--spacing-lg))] max-h-[calc(100vh-var(--spacing-lg))] z-dialog\"\n ],\n {\n variants: {\n size: {\n sm: \"w-[384px]\",\n md: \"w-[520px]\",\n lg: \"w-[640px]\",\n xl: \"w-[800px]\",\n full: \"w-screen h-screen\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\nexport interface DialogContentProps\n extends
|
|
1
|
+
{"version":3,"names":["React","Dialog","DialogPrimitive","cn","cva","dialogContentVariants","variants","size","sm","md","lg","xl","full","defaultVariants","DialogContent","forwardRef","className","dismissible","children","props","ref","dismissibleProps","useMemo","onInteractOutside","event","preventDefault","onEscapeKeyDown","createElement","Content","Object","assign","undefined","displayName"],"sources":["DialogContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nconst dialogContentVariants = cva(\n [\n \"fixed left-[50%] top-[50%] border-none bg-neutral-base shadow-lg focus-visible:outline-none rounded-xl text-md text-neutral-strong max-h-screen\",\n \"translate-x-[-50%] translate-y-[-50%] duration-200 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\",\n \"focus:outline-none focus-visible:outline-none\",\n \"max-w-[calc(100vw-var(--spacing-lg))] max-h-[calc(100vh-var(--spacing-lg))] z-dialog\",\n \"overflow-hidden\"\n ],\n {\n variants: {\n size: {\n sm: \"w-[384px]\",\n md: \"w-[520px]\",\n lg: \"w-[640px]\",\n xl: \"w-[800px]\",\n full: \"w-screen h-screen\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\nexport interface DialogContentProps\n extends\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContentVariants> {\n dismissible?: boolean;\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(({ className, dismissible, size, children, ...props }, ref) => {\n const dismissibleProps = React.useMemo<\n Pick<DialogPrimitive.DialogContentProps, \"onInteractOutside\" | \"onEscapeKeyDown\">\n >(() => {\n if (dismissible === false) {\n return {\n onInteractOutside: event => event.preventDefault(),\n onEscapeKeyDown: event => event.preventDefault()\n };\n }\n\n return {};\n }, [dismissible]);\n\n return (\n <DialogPrimitive.Content\n {...dismissibleProps}\n {...props}\n ref={ref}\n className={cn(dialogContentVariants({ size }), className)}\n // TODO: An optional accessible description to be announced when the dialog is opened. At the moment we skip this.\n aria-describedby={undefined}\n >\n <div\n className={cn([\n [\"flex flex-col justify-between\", \"w-full max-w-full\", \"h-full\", \"relative\"]\n ])}\n >\n {children}\n </div>\n </DialogPrimitive.Content>\n );\n});\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nexport { DialogContent };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,MAAM,IAAIC,eAAe,QAAQ,UAAU;AACpD,SAASC,EAAE,EAAEC,GAAG;AAEhB,MAAMC,qBAAqB,GAAGD,GAAG,CAC7B,CACI,iJAAiJ,EACjJ,yOAAyO,EACzO,+CAA+C,EAC/C,sFAAsF,EACtF,iBAAiB,CACpB,EACD;EACIE,QAAQ,EAAE;IACNC,IAAI,EAAE;MACFC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACfC,IAAI,EAAE;IACV;EACJ,CAAC;EACDC,eAAe,EAAE;IACbN,IAAI,EAAE;EACV;AACJ,CACJ,CAAC;AASD,MAAMO,aAAa,gBAAGd,KAAK,CAACe,UAAU,CAGpC,CAAC;EAAEC,SAAS;EAAEC,WAAW;EAAEV,IAAI;EAAEW,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC7D,MAAMC,gBAAgB,GAAGrB,KAAK,CAACsB,OAAO,CAEpC,MAAM;IACJ,IAAIL,WAAW,KAAK,KAAK,EAAE;MACvB,OAAO;QACHM,iBAAiB,EAAEC,KAAK,IAAIA,KAAK,CAACC,cAAc,CAAC,CAAC;QAClDC,eAAe,EAAEF,KAAK,IAAIA,KAAK,CAACC,cAAc,CAAC;MACnD,CAAC;IACL;IAEA,OAAO,CAAC,CAAC;EACb,CAAC,EAAE,CAACR,WAAW,CAAC,CAAC;EAEjB,oBACIjB,KAAA,CAAA2B,aAAA,CAACzB,eAAe,CAAC0B,OAAO,EAAAC,MAAA,CAAAC,MAAA,KAChBT,gBAAgB,EAChBF,KAAK;IACTC,GAAG,EAAEA,GAAI;IACTJ,SAAS,EAAEb,EAAE,CAACE,qBAAqB,CAAC;MAAEE;IAAK,CAAC,CAAC,EAAES,SAAS;IACxD;IAAA;IACA,oBAAkBe;EAAU,iBAE5B/B,KAAA,CAAA2B,aAAA;IACIX,SAAS,EAAEb,EAAE,CAAC,CACV,CAAC,+BAA+B,EAAE,mBAAmB,EAAE,QAAQ,EAAE,UAAU,CAAC,CAC/E;EAAE,GAEFe,QACA,CACgB,CAAC;AAElC,CAAC,CAAC;AAEFJ,aAAa,CAACkB,WAAW,GAAG9B,eAAe,CAAC0B,OAAO,CAACI,WAAW;AAE/D,SAASlB,aAAa","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { type VariantProps } from "../../utils.js";
|
|
3
3
|
declare const dialogFooterVariants: (props?: ({
|
|
4
4
|
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
5
|
-
} & import("class-variance-authority/
|
|
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;
|
|
8
8
|
info?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","cn","cva","dialogFooterVariants","variants","size","sm","md","lg","xl","full","defaultVariants","DialogFooter","actions","info","className","props","createElement","Object","assign"],"sources":["DialogFooter.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nconst dialogFooterVariants = cva(\"flex justify-between\", {\n variants: {\n size: {\n sm: \"p-md-extra\",\n md: \"p-md-extra\",\n lg: \"p-lg\",\n xl: \"p-lg\",\n full: \"p-lg\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n});\n\nexport interface DialogFooterProps\n extends React.HTMLAttributes<HTMLDivElement
|
|
1
|
+
{"version":3,"names":["React","cn","cva","dialogFooterVariants","variants","size","sm","md","lg","xl","full","defaultVariants","DialogFooter","actions","info","className","props","createElement","Object","assign"],"sources":["DialogFooter.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nconst dialogFooterVariants = cva(\"flex justify-between\", {\n variants: {\n size: {\n sm: \"p-md-extra\",\n md: \"p-md-extra\",\n lg: \"p-lg\",\n xl: \"p-lg\",\n full: \"p-lg\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n});\n\nexport interface DialogFooterProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof dialogFooterVariants> {\n actions?: React.ReactNode;\n info?: React.ReactNode;\n}\n\nexport const DialogFooter = ({ actions, info, className, size, ...props }: DialogFooterProps) => {\n if (!actions && !info) {\n return null;\n }\n\n return (\n <div {...props} className={cn(dialogFooterVariants({ size }), className)}>\n {info && (\n <div className={\"text-sm flex items-center\"}>\n <div>{info}</div>\n </div>\n )}\n {actions && <div className={\"flex gap-x-sm ml-auto\"}>{actions}</div>}\n </div>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,EAAE,EAAEC,GAAG;AAEhB,MAAMC,oBAAoB,GAAGD,GAAG,CAAC,sBAAsB,EAAE;EACrDE,QAAQ,EAAE;IACNC,IAAI,EAAE;MACFC,EAAE,EAAE,YAAY;MAChBC,EAAE,EAAE,YAAY;MAChBC,EAAE,EAAE,MAAM;MACVC,EAAE,EAAE,MAAM;MACVC,IAAI,EAAE;IACV;EACJ,CAAC;EACDC,eAAe,EAAE;IACbN,IAAI,EAAE;EACV;AACJ,CAAC,CAAC;AAQF,OAAO,MAAMO,YAAY,GAAGA,CAAC;EAAEC,OAAO;EAAEC,IAAI;EAAEC,SAAS;EAAEV,IAAI;EAAE,GAAGW;AAAyB,CAAC,KAAK;EAC7F,IAAI,CAACH,OAAO,IAAI,CAACC,IAAI,EAAE;IACnB,OAAO,IAAI;EACf;EAEA,oBACId,KAAA,CAAAiB,aAAA,QAAAC,MAAA,CAAAC,MAAA,KAASH,KAAK;IAAED,SAAS,EAAEd,EAAE,CAACE,oBAAoB,CAAC;MAAEE;IAAK,CAAC,CAAC,EAAEU,SAAS;EAAE,IACpED,IAAI,iBACDd,KAAA,CAAAiB,aAAA;IAAKF,SAAS,EAAE;EAA4B,gBACxCf,KAAA,CAAAiB,aAAA,cAAMH,IAAU,CACf,CACR,EACAD,OAAO,iBAAIb,KAAA,CAAAiB,aAAA;IAAKF,SAAS,EAAE;EAAwB,GAAEF,OAAa,CAClE,CAAC;AAEd,CAAC","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@ import { Dialog as DialogPrimitive } from "radix-ui";
|
|
|
3
3
|
import { type VariantProps } from "../../utils.js";
|
|
4
4
|
declare const dialogTitleVariants: (props?: ({
|
|
5
5
|
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
6
|
-
} & import("class-variance-authority/
|
|
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;
|
|
9
9
|
export {};
|
package/Drawer/Drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","makeDecoratable","withStaticProps","DrawerContent","DrawerFooter","DrawerHeader","DrawerOverlay","DrawerPortal","DrawerRoot","DrawerTrigger","DrawerBody","Icon","ConfirmButton","CancelButton","DrawerBase","props","rootProps","triggerProps","contentProps","headerProps","bodyProps","footerProps","useMemo","defaultOpen","open","onOpenChange","originalOnOpenChange","onClose","onOpen","modal","dir","trigger","title","icon","description","showCloseButton","headerSeparator","children","bodyPadding","actions","info","footerSeparator","rest","createElement","separator","Object","assign","asChild","className","displayName","DecoratableDrawer","Drawer"],"sources":["Drawer.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { DrawerContent } from \"./components/DrawerContent.js\";\nimport { DrawerFooter } from \"./components/DrawerFooter.js\";\nimport { DrawerHeader } from \"./components/DrawerHeader.js\";\nimport { DrawerOverlay } from \"./components/DrawerOverlay.js\";\nimport { DrawerPortal } from \"./components/DrawerPortal.js\";\nimport { DrawerRoot } from \"./components/DrawerRoot.js\";\nimport { DrawerTrigger } from \"./components/DrawerTrigger.js\";\nimport { DrawerBody } from \"~/Drawer/components/DrawerBody.js\";\nimport { Icon } from \"./components/Icon.js\";\nimport { ConfirmButton } from \"./components/ConfirmButton.js\";\nimport { CancelButton } from \"./components/CancelButton.js\";\n\ninterface DrawerProps\n extends
|
|
1
|
+
{"version":3,"names":["React","makeDecoratable","withStaticProps","DrawerContent","DrawerFooter","DrawerHeader","DrawerOverlay","DrawerPortal","DrawerRoot","DrawerTrigger","DrawerBody","Icon","ConfirmButton","CancelButton","DrawerBase","props","rootProps","triggerProps","contentProps","headerProps","bodyProps","footerProps","useMemo","defaultOpen","open","onOpenChange","originalOnOpenChange","onClose","onOpen","modal","dir","trigger","title","icon","description","showCloseButton","headerSeparator","children","bodyPadding","actions","info","footerSeparator","rest","createElement","separator","Object","assign","asChild","className","displayName","DecoratableDrawer","Drawer"],"sources":["Drawer.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { DrawerContent } from \"./components/DrawerContent.js\";\nimport { DrawerFooter } from \"./components/DrawerFooter.js\";\nimport { DrawerHeader } from \"./components/DrawerHeader.js\";\nimport { DrawerOverlay } from \"./components/DrawerOverlay.js\";\nimport { DrawerPortal } from \"./components/DrawerPortal.js\";\nimport { DrawerRoot } from \"./components/DrawerRoot.js\";\nimport { DrawerTrigger } from \"./components/DrawerTrigger.js\";\nimport { DrawerBody } from \"~/Drawer/components/DrawerBody.js\";\nimport { Icon } from \"./components/Icon.js\";\nimport { ConfirmButton } from \"./components/ConfirmButton.js\";\nimport { CancelButton } from \"./components/CancelButton.js\";\n\ninterface DrawerProps\n extends\n React.ComponentPropsWithoutRef<typeof DrawerRoot>,\n Omit<React.ComponentPropsWithoutRef<typeof DrawerContent>, \"title\"> {\n trigger?: React.ReactNode;\n title?: React.ReactNode;\n icon?: React.ReactElement;\n modal?: boolean;\n showCloseButton?: boolean;\n bodyPadding?: boolean;\n headerSeparator?: boolean;\n footerSeparator?: boolean;\n description?: React.ReactNode;\n children: React.ReactNode;\n actions?: React.ReactNode;\n info?: React.ReactNode;\n width?: React.CSSProperties[\"width\"];\n onClose?: () => void;\n onOpen?: () => void;\n}\n\nconst DrawerBase = (props: DrawerProps) => {\n const { rootProps, triggerProps, contentProps, headerProps, bodyProps, footerProps } =\n React.useMemo(() => {\n const {\n // Root props.\n defaultOpen,\n open,\n onOpenChange: originalOnOpenChange,\n onClose,\n onOpen,\n\n // We want the drawer to always allow interaction with the outside elements.\n modal = false,\n dir,\n\n // Trigger props.\n trigger,\n\n // Header props.\n title,\n icon,\n description,\n showCloseButton,\n headerSeparator,\n\n // Body props.\n children,\n bodyPadding,\n\n // Footer props.\n actions,\n info,\n footerSeparator,\n\n // Content props.\n ...rest\n } = props;\n\n // Handles dialog open state changes, calling original and onClose / onOpen callbacks as needed\n const onOpenChange = (open: boolean) => {\n originalOnOpenChange && originalOnOpenChange(open);\n\n if (onClose && !open) {\n onClose();\n }\n\n if (onOpen && open) {\n onOpen();\n }\n };\n\n return {\n rootProps: {\n defaultOpen,\n open,\n onOpenChange,\n modal,\n dir\n },\n triggerProps: {\n // Temporary fix. We need this because `ref` doesn't get passed to components\n // that are decorated with `makeDecoratable`. This will be fixed in the future.\n children: <div>{trigger}</div>\n },\n headerProps: {\n title,\n icon,\n description,\n showCloseButton,\n separator: headerSeparator\n },\n bodyProps: { children, bodyPadding },\n footerProps: { info, actions, separator: footerSeparator },\n contentProps: rest\n };\n }, [props]);\n\n return (\n <DrawerRoot {...rootProps}>\n {triggerProps.children && <DrawerTrigger {...triggerProps} asChild />}\n <DrawerPortal>\n <div data-role=\"drawer\" className={\"absolute z-overlay\"}>\n {rootProps.modal && <DrawerOverlay />}\n <DrawerContent {...contentProps} modal={rootProps.modal}>\n <DrawerHeader {...headerProps} />\n <DrawerBody {...bodyProps} />\n <DrawerFooter {...footerProps} />\n </DrawerContent>\n </div>\n </DrawerPortal>\n </DrawerRoot>\n );\n};\n\nDrawerBase.displayName = \"Drawer\";\n\nconst DecoratableDrawer = makeDecoratable(\"Drawer\", DrawerBase);\n\nconst Drawer = withStaticProps(DecoratableDrawer, {\n ConfirmButton,\n CancelButton,\n Icon\n});\n\nexport { Drawer, type DrawerProps };\n"],"mappings":"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","ignoreList":[]}
|
package/Drawer/Drawer.mdx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Meta, Controls } from
|
|
1
|
+
import { Canvas, Meta, Controls } from "@storybook/addon-docs/blocks";
|
|
2
2
|
|
|
3
|
-
import * as DrawerStories from
|
|
3
|
+
import * as DrawerStories from "./Drawer.stories";
|
|
4
4
|
|
|
5
5
|
<Meta of={DrawerStories} />
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ import React, { useState } from "react";
|
|
|
15
15
|
import { Drawer, Button } from "@webiny/admin-ui";
|
|
16
16
|
|
|
17
17
|
const DrawerExample = () => {
|
|
18
|
-
|
|
18
|
+
const [open, setOpen] = useState(false);
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<>
|
|
@@ -54,70 +54,71 @@ const DrawerExample = () => {
|
|
|
54
54
|
</Drawer>
|
|
55
55
|
</>
|
|
56
56
|
);
|
|
57
|
+
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
export default DrawerExample;
|
|
60
61
|
|
|
61
62
|
` } }
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
additionalActions={[
|
|
64
|
+
{
|
|
65
|
+
title: 'Open in GitHub',
|
|
66
|
+
onClick: () => {
|
|
67
|
+
window.open(
|
|
68
|
+
'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/Drawer/Drawer.tsx',
|
|
69
|
+
'_blank'
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
]}
|
|
73
74
|
/>
|
|
74
75
|
|
|
75
|
-
<Controls of={DrawerStories.Documentation} exclude={["onOpenChange", "trigger"]}/>
|
|
76
|
+
<Controls of={DrawerStories.Documentation} exclude={["onOpenChange", "trigger"]} />
|
|
76
77
|
|
|
77
78
|
```tsx
|
|
78
79
|
import React, { useState } from "react";
|
|
79
80
|
import { Drawer, Button } from "@webiny/admin-ui";
|
|
80
81
|
|
|
81
82
|
const DrawerExample = () => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
83
|
+
const [open, setOpen] = useState(false);
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<>
|
|
87
|
+
<Button variant="primary" text="Open Drawer" onClick={() => setOpen(true)} />
|
|
88
|
+
|
|
89
|
+
<Drawer
|
|
90
|
+
open={open}
|
|
91
|
+
onOpenChange={open => setOpen(open)}
|
|
92
|
+
title="Drawer Title"
|
|
93
|
+
description="A short drawer description."
|
|
94
|
+
info={
|
|
95
|
+
<>
|
|
96
|
+
Learn more about this <a href={"#"}>here</a>.
|
|
97
|
+
</>
|
|
98
|
+
}
|
|
99
|
+
side="right"
|
|
100
|
+
showCloseButton={true}
|
|
101
|
+
bodyPadding={true}
|
|
102
|
+
headerSeparator={true}
|
|
103
|
+
footerSeparator={true}
|
|
104
|
+
actions={
|
|
105
|
+
<>
|
|
106
|
+
<Drawer.CancelButton />
|
|
107
|
+
<Drawer.ConfirmButton />
|
|
108
|
+
</>
|
|
109
|
+
}
|
|
110
|
+
>
|
|
111
|
+
<p className={"mb-md, mt-md"}>
|
|
112
|
+
This is the drawer content area. You can place any content here including forms, text,
|
|
113
|
+
images, or other components.
|
|
114
|
+
</p>
|
|
115
|
+
<p className={"mb-md"}>
|
|
116
|
+
Drawers are useful for displaying additional information or actions without navigating
|
|
117
|
+
away from the current page.
|
|
118
|
+
</p>
|
|
119
|
+
</Drawer>
|
|
120
|
+
</>
|
|
121
|
+
);
|
|
121
122
|
};
|
|
122
123
|
|
|
123
124
|
export default DrawerExample;
|
|
@@ -134,7 +135,7 @@ import React, { useState } from "react";
|
|
|
134
135
|
import { Drawer, Button } from "@webiny/admin-ui";
|
|
135
136
|
|
|
136
137
|
const ControlledVisibilityExample = () => {
|
|
137
|
-
|
|
138
|
+
const [open, setOpen] = useState(false);
|
|
138
139
|
|
|
139
140
|
return (
|
|
140
141
|
<>
|
|
@@ -172,6 +173,7 @@ const ControlledVisibilityExample = () => {
|
|
|
172
173
|
</Drawer>
|
|
173
174
|
</>
|
|
174
175
|
);
|
|
176
|
+
|
|
175
177
|
};
|
|
176
178
|
|
|
177
179
|
export default ControlledVisibilityExample;
|
|
@@ -184,7 +186,7 @@ import React, { useState } from "react";
|
|
|
184
186
|
import { Drawer, Button, DropdownMenu } from "@webiny/admin-ui";
|
|
185
187
|
|
|
186
188
|
const WithDropdownMenuExample = () => {
|
|
187
|
-
|
|
189
|
+
const [open, setOpen] = useState(false);
|
|
188
190
|
|
|
189
191
|
return (
|
|
190
192
|
<>
|
|
@@ -214,6 +216,7 @@ const WithDropdownMenuExample = () => {
|
|
|
214
216
|
</Drawer>
|
|
215
217
|
</>
|
|
216
218
|
);
|
|
219
|
+
|
|
217
220
|
};
|
|
218
221
|
|
|
219
222
|
export default WithDropdownMenuExample;
|
|
@@ -226,7 +229,7 @@ import React, { useState } from "react";
|
|
|
226
229
|
import { Drawer, Button } from "@webiny/admin-ui";
|
|
227
230
|
|
|
228
231
|
const WithoutCloseButtonExample = () => {
|
|
229
|
-
|
|
232
|
+
const [open, setOpen] = useState(false);
|
|
230
233
|
|
|
231
234
|
return (
|
|
232
235
|
<>
|
|
@@ -259,6 +262,7 @@ const WithoutCloseButtonExample = () => {
|
|
|
259
262
|
</Drawer>
|
|
260
263
|
</>
|
|
261
264
|
);
|
|
265
|
+
|
|
262
266
|
};
|
|
263
267
|
|
|
264
268
|
export default WithoutCloseButtonExample;
|
|
@@ -271,7 +275,7 @@ import React, { useState } from "react";
|
|
|
271
275
|
import { Drawer, Button } from "@webiny/admin-ui";
|
|
272
276
|
|
|
273
277
|
const CustomWidthExample = () => {
|
|
274
|
-
|
|
278
|
+
const [open, setOpen] = useState(false);
|
|
275
279
|
|
|
276
280
|
return (
|
|
277
281
|
<>
|
|
@@ -304,6 +308,7 @@ const CustomWidthExample = () => {
|
|
|
304
308
|
</Drawer>
|
|
305
309
|
</>
|
|
306
310
|
);
|
|
311
|
+
|
|
307
312
|
};
|
|
308
313
|
|
|
309
314
|
export default CustomWidthExample;
|
|
@@ -316,7 +321,7 @@ import React, { useState } from "react";
|
|
|
316
321
|
import { Drawer, Button, Tabs } from "@webiny/admin-ui";
|
|
317
322
|
|
|
318
323
|
const WithTabsExample = () => {
|
|
319
|
-
|
|
324
|
+
const [open, setOpen] = useState(false);
|
|
320
325
|
|
|
321
326
|
return (
|
|
322
327
|
<>
|
|
@@ -372,6 +377,7 @@ const WithTabsExample = () => {
|
|
|
372
377
|
</Drawer>
|
|
373
378
|
</>
|
|
374
379
|
);
|
|
380
|
+
|
|
375
381
|
};
|
|
376
382
|
|
|
377
383
|
export default WithTabsExample;
|
|
@@ -385,7 +391,7 @@ import { Drawer, Button } from "@webiny/admin-ui";
|
|
|
385
391
|
import { ReactComponent as DoorbellIcon } from "@webiny/icons/ring_volume.svg";
|
|
386
392
|
|
|
387
393
|
const WithIconExample = () => {
|
|
388
|
-
|
|
394
|
+
const [open, setOpen] = useState(false);
|
|
389
395
|
|
|
390
396
|
return (
|
|
391
397
|
<>
|
|
@@ -412,6 +418,7 @@ const WithIconExample = () => {
|
|
|
412
418
|
</Drawer>
|
|
413
419
|
</>
|
|
414
420
|
);
|
|
421
|
+
|
|
415
422
|
};
|
|
416
423
|
|
|
417
424
|
export default WithIconExample;
|
|
@@ -424,7 +431,7 @@ import React, { useState } from "react";
|
|
|
424
431
|
import { Drawer, Button } from "@webiny/admin-ui";
|
|
425
432
|
|
|
426
433
|
const AsModalExample = () => {
|
|
427
|
-
|
|
434
|
+
const [open, setOpen] = useState(false);
|
|
428
435
|
|
|
429
436
|
return (
|
|
430
437
|
<>
|
|
@@ -452,6 +459,7 @@ const AsModalExample = () => {
|
|
|
452
459
|
</Drawer>
|
|
453
460
|
</>
|
|
454
461
|
);
|
|
462
|
+
|
|
455
463
|
};
|
|
456
464
|
|
|
457
465
|
export default AsModalExample;
|
|
@@ -460,13 +468,14 @@ export default AsModalExample;
|
|
|
460
468
|
## Anatomy
|
|
461
469
|
|
|
462
470
|
### Construction
|
|
463
|
-
|
|
471
|
+
|
|
472
|
+
<img src="/images/storybook/drawer/anatomy.png" alt="Anatomy" />
|
|
464
473
|
|
|
465
474
|
### Header
|
|
466
475
|
|
|
467
476
|
Header needs to support multiple formation options that can be independently enabled or disabled.
|
|
468
477
|
|
|
469
|
-
<img src="/images/storybook/drawer/header.png" alt="Header"/>
|
|
478
|
+
<img src="/images/storybook/drawer/header.png" alt="Header" />
|
|
470
479
|
|
|
471
480
|
## Usage
|
|
472
481
|
|
|
@@ -474,4 +483,4 @@ Header needs to support multiple formation options that can be independently ena
|
|
|
474
483
|
|
|
475
484
|
Drawers should slide in from either the left or right side, depending on the context. The drawer should overlay the content, and clicking outside of it should close it. There also needs to be an option to use an overlay behind the drawer.
|
|
476
485
|
|
|
477
|
-
<img src="/images/storybook/drawer/positioning.png" alt="Positioning"/>
|
|
486
|
+
<img src="/images/storybook/drawer/positioning.png" alt="Positioning" />
|
|
@@ -8,6 +8,6 @@ export interface DrawerContentProps extends React.ComponentPropsWithoutRef<typeo
|
|
|
8
8
|
declare const drawerVariants: (props?: ({
|
|
9
9
|
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
10
10
|
side?: "left" | "right" | null | undefined;
|
|
11
|
-
} & import("class-variance-authority/
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
declare const DrawerContent: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
export { DrawerContent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Dialog","DrawerPrimitive","cn","cva","drawerVariants","variants","size","sm","md","lg","xl","side","left","right","defaultVariants","DrawerContent","forwardRef","modal","width","className","style","children","props","ref","modalProps","useMemo","onInteractOutside","event","preventDefault","createElement","Content","Object","assign","undefined","displayName"],"sources":["DrawerContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DrawerPrimitive } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nexport interface DrawerContentProps\n extends
|
|
1
|
+
{"version":3,"names":["React","Dialog","DrawerPrimitive","cn","cva","drawerVariants","variants","size","sm","md","lg","xl","side","left","right","defaultVariants","DrawerContent","forwardRef","modal","width","className","style","children","props","ref","modalProps","useMemo","onInteractOutside","event","preventDefault","createElement","Content","Object","assign","undefined","displayName"],"sources":["DrawerContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DrawerPrimitive } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nexport interface DrawerContentProps\n extends\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>,\n VariantProps<typeof drawerVariants> {\n width?: React.CSSProperties[\"width\"];\n modal?: boolean;\n}\n\nconst drawerVariants = cva(\n [\n \"fixed gap-4 bg-neutral-base text-md text-neutral-strong focus-visible:outline-none shadow-lg\",\n \"transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n \"max-w-full h-full z-drawer\"\n ],\n {\n variants: {\n size: {\n sm: \"w-[384px]\",\n md: \"w-[520px]\",\n lg: \"w-[640px]\",\n xl: \"w-[1024px]\"\n },\n side: {\n left: [\n \"inset-y-0 left-0\",\n \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left\"\n ],\n right: [\n \"inset-y-0 right-0\",\n \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right\"\n ]\n }\n },\n defaultVariants: {\n size: \"md\",\n side: \"right\"\n }\n }\n);\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ side, size, modal, width, className, style = {}, children, ...props }, ref) => {\n // When modal is set to false, we want to prevent the user from closing the drawer by clicking outside of it.\n // Only by clicking on \"X\" icon or by pressing the escape key should the drawer be closed.\n const modalProps = React.useMemo<\n Pick<DrawerPrimitive.DialogContentProps, \"onInteractOutside\">\n >(() => {\n if (modal === false) {\n return {\n onInteractOutside: event => event.preventDefault()\n };\n }\n\n return {};\n }, [modal]);\n\n return (\n <DrawerPrimitive.Content\n {...modalProps}\n {...props}\n ref={ref}\n className={cn(drawerVariants({ side, size }), className)}\n style={{ width, ...style }}\n // TODO: An optional accessible description to be announced when the dialog is opened. At the moment we skip this.\n aria-describedby={undefined}\n >\n <div className={\"flex flex-col justify-between h-full\"}>{children}</div>\n </DrawerPrimitive.Content>\n );\n});\n\nDrawerContent.displayName = DrawerPrimitive.Content.displayName;\n\nexport { DrawerContent };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,MAAM,IAAIC,eAAe,QAAQ,UAAU;AACpD,SAASC,EAAE,EAAEC,GAAG;AAUhB,MAAMC,cAAc,GAAGD,GAAG,CACtB,CACI,8FAA8F,EAC9F,qJAAqJ,EACrJ,4BAA4B,CAC/B,EACD;EACIE,QAAQ,EAAE;IACNC,IAAI,EAAE;MACFC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE;IACR,CAAC;IACDC,IAAI,EAAE;MACFC,IAAI,EAAE,CACF,kBAAkB,EAClB,4EAA4E,CAC/E;MACDC,KAAK,EAAE,CACH,mBAAmB,EACnB,8EAA8E;IAEtF;EACJ,CAAC;EACDC,eAAe,EAAE;IACbR,IAAI,EAAE,IAAI;IACVK,IAAI,EAAE;EACV;AACJ,CACJ,CAAC;AAED,MAAMI,aAAa,gBAAGhB,KAAK,CAACiB,UAAU,CAGpC,CAAC;EAAEL,IAAI;EAAEL,IAAI;EAAEW,KAAK;EAAEC,KAAK;EAAEC,SAAS;EAAEC,KAAK,GAAG,CAAC,CAAC;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAChF;EACA;EACA,MAAMC,UAAU,GAAGzB,KAAK,CAAC0B,OAAO,CAE9B,MAAM;IACJ,IAAIR,KAAK,KAAK,KAAK,EAAE;MACjB,OAAO;QACHS,iBAAiB,EAAEC,KAAK,IAAIA,KAAK,CAACC,cAAc,CAAC;MACrD,CAAC;IACL;IAEA,OAAO,CAAC,CAAC;EACb,CAAC,EAAE,CAACX,KAAK,CAAC,CAAC;EAEX,oBACIlB,KAAA,CAAA8B,aAAA,CAAC5B,eAAe,CAAC6B,OAAO,EAAAC,MAAA,CAAAC,MAAA,KAChBR,UAAU,EACVF,KAAK;IACTC,GAAG,EAAEA,GAAI;IACTJ,SAAS,EAAEjB,EAAE,CAACE,cAAc,CAAC;MAAEO,IAAI;MAAEL;IAAK,CAAC,CAAC,EAAEa,SAAS,CAAE;IACzDC,KAAK,EAAE;MAAEF,KAAK;MAAE,GAAGE;IAAM;IACzB;IAAA;IACA,oBAAkBa;EAAU,iBAE5BlC,KAAA,CAAA8B,aAAA;IAAKV,SAAS,EAAE;EAAuC,GAAEE,QAAc,CAClD,CAAC;AAElC,CAAC,CAAC;AAEFN,aAAa,CAACmB,WAAW,GAAGjC,eAAe,CAAC6B,OAAO,CAACI,WAAW;AAE/D,SAASnB,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","makeDecoratable","withStaticProps","DropdownMenuRoot","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuSeparator","DropdownMenuItem","DropdownMenuLink","DropdownMenuCheckboxItem","DropdownMenuLabel","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuBase","forwardRef","props","ref","rootProps","triggerProps","contentProps","useMemo","defaultOpen","open","onOpenChange","dir","trigger","rest","children","createElement","className","Object","assign","asChild","displayName","DecoratableDropdownMenu","DropdownMenu","Separator","Label","Group","Item","Link","CheckboxItem"],"sources":["DropdownMenu.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { DropdownMenuRoot } from \"./components/DropdownMenuRoot.js\";\nimport { DropdownMenuTrigger } from \"./components/DropdownMenuTrigger.js\";\nimport { DropdownMenuContent } from \"./components/DropdownMenuContent.js\";\nimport { DropdownMenuSeparator } from \"./components/DropdownMenuSeparator.js\";\nimport { DropdownMenuItem, type DropdownMenuItemProps } from \"./components/DropdownMenuItem.js\";\nimport { DropdownMenuLink, type DropdownMenuLinkProps } from \"./components/DropdownMenuLink.js\";\nimport { DropdownMenuCheckboxItem } from \"./components/DropdownMenuCheckboxItem.js\";\nimport { DropdownMenuLabel } from \"./components/DropdownMenuLabel.js\";\nimport { DropdownMenuGroup } from \"./components/DropdownMenuGroup.js\";\nimport { DropdownMenuPortal } from \"./components/DropdownMenuPortal.js\";\n\ninterface DropdownMenuProps\n extends
|
|
1
|
+
{"version":3,"names":["React","makeDecoratable","withStaticProps","DropdownMenuRoot","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuSeparator","DropdownMenuItem","DropdownMenuLink","DropdownMenuCheckboxItem","DropdownMenuLabel","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuBase","forwardRef","props","ref","rootProps","triggerProps","contentProps","useMemo","defaultOpen","open","onOpenChange","dir","trigger","rest","children","createElement","className","Object","assign","asChild","displayName","DecoratableDropdownMenu","DropdownMenu","Separator","Label","Group","Item","Link","CheckboxItem"],"sources":["DropdownMenu.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { DropdownMenuRoot } from \"./components/DropdownMenuRoot.js\";\nimport { DropdownMenuTrigger } from \"./components/DropdownMenuTrigger.js\";\nimport { DropdownMenuContent } from \"./components/DropdownMenuContent.js\";\nimport { DropdownMenuSeparator } from \"./components/DropdownMenuSeparator.js\";\nimport { DropdownMenuItem, type DropdownMenuItemProps } from \"./components/DropdownMenuItem.js\";\nimport { DropdownMenuLink, type DropdownMenuLinkProps } from \"./components/DropdownMenuLink.js\";\nimport { DropdownMenuCheckboxItem } from \"./components/DropdownMenuCheckboxItem.js\";\nimport { DropdownMenuLabel } from \"./components/DropdownMenuLabel.js\";\nimport { DropdownMenuGroup } from \"./components/DropdownMenuGroup.js\";\nimport { DropdownMenuPortal } from \"./components/DropdownMenuPortal.js\";\n\ninterface DropdownMenuProps\n extends\n React.ComponentPropsWithoutRef<typeof DropdownMenuRoot>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuContent> {\n trigger?: React.ReactNode;\n children: React.ReactNode;\n}\n\nconst DropdownMenuBase = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuRoot>,\n DropdownMenuProps\n>((props, ref) => {\n const { rootProps, triggerProps, contentProps } = React.useMemo(() => {\n const {\n // Root props.\n defaultOpen,\n open,\n onOpenChange,\n\n dir,\n\n // Trigger props.\n trigger,\n\n // Content props.\n ...rest\n } = props;\n\n return {\n rootProps: {\n defaultOpen,\n open,\n onOpenChange,\n dir\n },\n triggerProps: {\n // Temporary fix. We need this because `ref` doesn't get passed to components\n // that are decorated with `makeDecoratable`. This will be fixed in the future.\n children: <div className={\"inline-block leading-none\"}>{trigger}</div>\n },\n contentProps: rest\n };\n }, [props]);\n\n return (\n <DropdownMenuRoot {...rootProps}>\n {triggerProps.children && <DropdownMenuTrigger {...triggerProps} asChild />}\n <DropdownMenuPortal>\n <DropdownMenuContent {...contentProps} ref={ref} />\n </DropdownMenuPortal>\n </DropdownMenuRoot>\n );\n});\n\nDropdownMenuBase.displayName = \"DropdownMenu\";\n\nconst DecoratableDropdownMenu = makeDecoratable(\"DropdownMenu\", DropdownMenuBase);\n\nconst DropdownMenu = withStaticProps(DecoratableDropdownMenu, {\n Separator: DropdownMenuSeparator,\n Label: DropdownMenuLabel,\n Group: DropdownMenuGroup,\n Item: DropdownMenuItem,\n Link: DropdownMenuLink,\n CheckboxItem: DropdownMenuCheckboxItem\n});\n\nexport { DropdownMenu, type DropdownMenuItemProps, type DropdownMenuLinkProps };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,eAAe,EAAEC,eAAe;AACzC,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,mBAAmB;AAC5B,SAASC,qBAAqB;AAC9B,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;AACzB,SAASC,wBAAwB;AACjC,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;AAU3B,MAAMC,gBAAgB,gBAAGb,KAAK,CAACc,UAAU,CAGvC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACd,MAAM;IAAEC,SAAS;IAAEC,YAAY;IAAEC;EAAa,CAAC,GAAGnB,KAAK,CAACoB,OAAO,CAAC,MAAM;IAClE,MAAM;MACF;MACAC,WAAW;MACXC,IAAI;MACJC,YAAY;MAEZC,GAAG;MAEH;MACAC,OAAO;MAEP;MACA,GAAGC;IACP,CAAC,GAAGX,KAAK;IAET,OAAO;MACHE,SAAS,EAAE;QACPI,WAAW;QACXC,IAAI;QACJC,YAAY;QACZC;MACJ,CAAC;MACDN,YAAY,EAAE;QACV;QACA;QACAS,QAAQ,eAAE3B,KAAA,CAAA4B,aAAA;UAAKC,SAAS,EAAE;QAA4B,GAAEJ,OAAa;MACzE,CAAC;MACDN,YAAY,EAAEO;IAClB,CAAC;EACL,CAAC,EAAE,CAACX,KAAK,CAAC,CAAC;EAEX,oBACIf,KAAA,CAAA4B,aAAA,CAACzB,gBAAgB,EAAKc,SAAS,EAC1BC,YAAY,CAACS,QAAQ,iBAAI3B,KAAA,CAAA4B,aAAA,CAACxB,mBAAmB,EAAA0B,MAAA,CAAAC,MAAA,KAAKb,YAAY;IAAEc,OAAO;EAAA,EAAE,CAAC,eAC3EhC,KAAA,CAAA4B,aAAA,CAAChB,kBAAkB,qBACfZ,KAAA,CAAA4B,aAAA,CAACvB,mBAAmB,EAAAyB,MAAA,CAAAC,MAAA,KAAKZ,YAAY;IAAEH,GAAG,EAAEA;EAAI,EAAE,CAClC,CACN,CAAC;AAE3B,CAAC,CAAC;AAEFH,gBAAgB,CAACoB,WAAW,GAAG,cAAc;AAE7C,MAAMC,uBAAuB,GAAGjC,eAAe,CAAC,cAAc,EAAEY,gBAAgB,CAAC;AAEjF,MAAMsB,YAAY,GAAGjC,eAAe,CAACgC,uBAAuB,EAAE;EAC1DE,SAAS,EAAE9B,qBAAqB;EAChC+B,KAAK,EAAE3B,iBAAiB;EACxB4B,KAAK,EAAE3B,iBAAiB;EACxB4B,IAAI,EAAEhC,gBAAgB;EACtBiC,IAAI,EAAEhC,gBAAgB;EACtBiC,YAAY,EAAEhC;AAClB,CAAC,CAAC;AAEF,SAAS0B,YAAY","ignoreList":[]}
|