@gridui/modal 1.1.7 → 2.0.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/README.md +9 -4
- package/dist/index.js +2 -1
- package/dist/index.js.map +2 -2
- package/dist/styles.css +5 -0
- package/docs/catalog.json +18 -3
- package/docs/reference/README.md +15 -0
- package/docs/reference/modal-action.md +99 -0
- package/docs/reference/modal-actions.md +57 -0
- package/docs/reference/modal-body.md +63 -0
- package/docs/reference/modal-close.md +61 -0
- package/docs/reference/modal-description.md +61 -0
- package/docs/reference/modal-footer-note.md +55 -0
- package/docs/reference/modal-footer.md +63 -0
- package/docs/reference/modal-header.md +67 -0
- package/docs/reference/modal-panel.md +119 -0
- package/docs/reference/modal-title.md +61 -0
- package/docs/reference/modal-trigger.md +61 -0
- package/docs/reference/modal.md +49 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -12,8 +12,11 @@ See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/
|
|
|
12
12
|
The centered modal shares Radix Dialog's focus and dismissal behavior with
|
|
13
13
|
Drawer. Its header owns a title cell and a full-height close cell; its footer
|
|
14
14
|
owns an optional note and edge-aligned action cells. Header and footer accept
|
|
15
|
-
independent responsive `paddingBlock` values. The body owns content scrolling
|
|
16
|
-
|
|
15
|
+
independent responsive `paddingBlock` values. The body owns content scrolling
|
|
16
|
+
and defaults to `tabIndex={0}` so text-only content can be scrolled with the
|
|
17
|
+
keyboard inside the focus scope. Supply a name when using a region role; native
|
|
18
|
+
`tabIndex` overrides remain available. Small viewports stack footer actions below
|
|
19
|
+
the note. See the
|
|
17
20
|
[composition example and API](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md).
|
|
18
21
|
|
|
19
22
|
Modal headers allow visible overflow so the full-cell close button's external
|
|
@@ -46,7 +49,7 @@ close cell. Include `ModalTitle` and optional `ModalDescription`; set
|
|
|
46
49
|
`aria-describedby={undefined}` on the panel when omitting a description.
|
|
47
50
|
Header and footer independently accept `paddingBlock`, defaulting to 24.
|
|
48
51
|
Values use the spacing scale (0, 4, 8, 16, 24, 32, 48, 64), or
|
|
49
|
-
`{ base: 16,
|
|
52
|
+
`{ base: 16, sm: 24, lg: 32 }` at the shared 40rem, 48rem, and 64rem breakpoints.
|
|
50
53
|
Spacing is internal padding, with a minimum 2.75rem action target.
|
|
51
54
|
|
|
52
55
|
`ModalFooterNote` is optional. `ModalActions` contains `ModalAction` buttons
|
|
@@ -59,7 +62,7 @@ consumers decide when an asynchronous primary action has succeeded.
|
|
|
59
62
|
<Modal>
|
|
60
63
|
<ModalTrigger asChild><Button>Display settings</Button></ModalTrigger>
|
|
61
64
|
<ModalPanel>
|
|
62
|
-
<ModalHeader closeLabel="Close" paddingBlock={{ base: 16,
|
|
65
|
+
<ModalHeader closeLabel="Close" paddingBlock={{ base: 16, sm: 24 }}>
|
|
63
66
|
<ModalTitle>Display settings</ModalTitle>
|
|
64
67
|
<ModalDescription>Adjust the current view.</ModalDescription>
|
|
65
68
|
</ModalHeader>
|
|
@@ -78,3 +81,5 @@ consumers decide when an asynchronous primary action has succeeded.
|
|
|
78
81
|
|
|
79
82
|
|
|
80
83
|
Surface motion uses `@gridui/overlay`; load `@gridui/overlay/styles.css` after Theme and before this family.
|
|
84
|
+
|
|
85
|
+
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ import { useInteractionOutline, useScrollbars } from "@gridui/overlay";
|
|
|
54
54
|
import { cn as cn3 } from "@gridui/style-utils";
|
|
55
55
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
56
56
|
var ModalBody = (props) => {
|
|
57
|
-
const { ref: forwardedRef, className, ...restProps } = props;
|
|
57
|
+
const { ref: forwardedRef, className, tabIndex = 0, ...restProps } = props;
|
|
58
58
|
const scrollbarRef = useScrollbars({ ref: forwardedRef });
|
|
59
59
|
const ref = useInteractionOutline({ ref: scrollbarRef });
|
|
60
60
|
return /* @__PURE__ */ jsx4(
|
|
@@ -62,6 +62,7 @@ var ModalBody = (props) => {
|
|
|
62
62
|
{
|
|
63
63
|
...restProps,
|
|
64
64
|
ref,
|
|
65
|
+
tabIndex,
|
|
65
66
|
className: cn3("gridui-u-modal--min-h-0 gridui-u-modal--min-w-0 gridui-u-modal--overflow-auto gridui-u-modal--overscroll-contain gridui-u-modal--p-gridui-24 gridui-u-modal--wrap-anywhere", className)
|
|
66
67
|
}
|
|
67
68
|
);
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/modal/modal.tsx", "../src/modal-action/modal-action.tsx", "../src/modal-actions/modal-actions.tsx", "../src/modal-body/modal-body.tsx", "../src/modal-close/modal-close.tsx", "../src/modal-description/modal-description.tsx", "../src/modal-footer/modal-footer.tsx", "../src/modal-footer-note/modal-footer-note.tsx", "../src/modal-header/modal-header.tsx", "../src/modal-panel/modal-panel.tsx", "../src/modal-title/modal-title.tsx", "../src/modal-trigger/modal-trigger.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Modal\n * @namespace Modal\n * @description Modal\n */\n\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport { type Space } from \"@gridui/style-utils/responsive\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalSpace = Space;\n\nexport type ModalProps = ComponentPropsWithRef<typeof Dialog.Root>;\n\nexport const Modal: FC<ModalProps> = (props: ModalProps) => {\n const state = useOverlayState(props);\n return (<OverlayOpen.Provider\n value={state.open}\n >\n <Dialog.Root\n {...props}\n {...state}\n />\n </OverlayOpen.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalAction\n * @description Modal Action\n */\n\nimport { Button, type ButtonProps } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type ModalActionProps = ButtonProps;\n\nexport const ModalAction: FC<ModalActionProps> = (props: ModalActionProps) => {\n const { className, ...restProps } = props;\n return (<Button\n {...restProps}\n className={cn(\"gridui-modal-action gridui-u-modal--flex-1 gridui-u-modal--w-auto gridui-u-modal--rounded-none gridui-u-modal--border-border gridui-u-modal--px-gridui-24 gridui-u-modal--py-(--gridui-modal-padding) gridui-u-modal--min-h-11\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalActions\n * @description Modal Actions\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalActionsProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalActions: FC<ModalActionsProps> = (props: ModalActionsProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"gridui-modal-actions gridui-u-modal--flex gridui-u-modal--min-w-0\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalBody\n * @description Modal Body\n */\n\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalBodyProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalBody: FC<ModalBodyProps> = (props: ModalBodyProps) => {\n const { ref: forwardedRef, className, ...restProps } = props;\n const scrollbarRef = useScrollbars({ ref: forwardedRef });\n const ref = useInteractionOutline({ ref: scrollbarRef });\n return (<div\n {...restProps}\n ref={ref}\n className={cn(\"gridui-u-modal--min-h-0 gridui-u-modal--min-w-0 gridui-u-modal--overflow-auto gridui-u-modal--overscroll-contain gridui-u-modal--p-gridui-24 gridui-u-modal--wrap-anywhere\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalClose\n * @description Modal Close\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalCloseProps = ComponentPropsWithRef<typeof Dialog.Close>;\n\nexport const ModalClose: FC<ModalCloseProps> = (props: ModalCloseProps) => {\n return (<Dialog.Close\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalDescription\n * @description Modal Description\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalDescriptionProps = ComponentPropsWithRef<typeof Dialog.Description>;\n\nexport const ModalDescription: FC<ModalDescriptionProps> = (props: ModalDescriptionProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Dialog.Description\n {...restProps}\n className={cn(\"gridui-u-modal--mt-gridui-8 gridui-u-modal--mb-0 gridui-u-modal--type-supporting gridui-u-modal--text-muted\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalFooter\n * @description Modal Footer\n */\n\nimport type { ModalSectionProps } from \"../shared/types\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { spacingVariables } from \"@gridui/style-utils/responsive\";\nimport type { FC } from \"react\";\n\nexport type ModalFooterProps = ModalSectionProps;\n\nexport const ModalFooter: FC<ModalFooterProps> = (props: ModalFooterProps) => {\n const {\n ref: forwardedRef,\n paddingBlock = 24,\n style,\n className,\n ...restProps\n } = props;\n const outlineRef = useInteractionOutline({ ref: forwardedRef });\n const ref = useScrollbars({ ref: outlineRef });\n return (<div\n {...restProps}\n ref={ref}\n style={{\n ...spacingVariables(\"modal-space\", paddingBlock),\n ...style,\n }}\n className={cn(\"gridui-modal-section gridui-modal-footer gridui-u-modal--max-h-[40dvh] gridui-u-modal--overflow-y-auto gridui-u-modal--shrink-0\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalFooterNote\n * @description Modal Footer Note\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalFooterNoteProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalFooterNote: FC<ModalFooterNoteProps> = (props: ModalFooterNoteProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"gridui-u-modal--min-w-0 gridui-u-modal--px-gridui-24 gridui-u-modal--py-(--gridui-modal-padding) gridui-u-modal--type-supporting gridui-u-modal--text-muted gridui-u-modal--wrap-anywhere\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalHeader\n * @description Modal Header\n */\n\nimport type { ModalSectionProps } from \"../shared/types\";\nimport { Button } from \"@gridui/button\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { spacingVariables } from \"@gridui/style-utils/responsive\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type ModalHeaderProps = ModalSectionProps & {\n readonly closeLabel: string;\n};\n\nexport const ModalHeader: FC<ModalHeaderProps> = (props: ModalHeaderProps) => {\n const {\n closeLabel,\n children,\n paddingBlock = 24,\n style,\n className,\n ...restProps\n } = props;\n const scrollbarRef = useScrollbars<HTMLDivElement>();\n const scrollRef = useInteractionOutline({ ref: scrollbarRef });\n return (<div\n {...restProps}\n style={{\n ...spacingVariables(\"modal-space\", paddingBlock),\n ...style,\n }}\n className={cn(\"gridui-modal-section gridui-modal-header gridui-u-modal--relative gridui-u-modal--z-(--gridui-z-content) gridui-u-modal--overflow-visible gridui-u-modal--shrink-0 gridui-u-modal--grid gridui-u-modal--grid-cols-[minmax(0,1fr)_auto]\", className)}\n >\n <div\n ref={scrollRef}\n className=\"gridui-u-modal--max-h-[40dvh] gridui-u-modal--min-w-0 gridui-u-modal--overflow-y-auto gridui-u-modal--px-gridui-24 gridui-u-modal--py-(--gridui-modal-padding) gridui-u-modal--wrap-anywhere\"\n >\n {children}\n </div>\n <Dialog.Close\n asChild\n >\n <Button\n aria-label={closeLabel}\n variant=\"quiet\"\n className=\"gridui-modal-close gridui-u-modal--self-stretch gridui-u-modal--w-gridui-64 gridui-u-modal--min-h-11 gridui-u-modal--rounded-none gridui-u-modal--border-border gridui-u-modal--p-0\"\n >\n <X\n aria-hidden=\"true\"\n />\n </Button>\n </Dialog.Close>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalPanel\n * @description Modal Panel\n */\n\nimport { interactionLayerProps, overlayBackdropStyles, overlaySurfaceStyles, RetainedLayer } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalPanelProps = ComponentPropsWithRef<typeof Dialog.Content>;\n\nexport const ModalPanel: FC<ModalPanelProps> = (props: ModalPanelProps) => {\n const {\n className,\n forceMount,\n ...restProps\n } = props;\n const content = (<Dialog.Content\n {...interactionLayerProps}\n {...restProps}\n forceMount={forceMount}\n className={cn(overlaySurfaceStyles({ kind: \"dialog\" }), \"gridui-modal-panel gridui-u-modal--fixed gridui-u-modal--z-(--gridui-z-dialog) gridui-u-modal--left-1/2 gridui-u-modal--top-1/2 gridui-u-modal---translate-x-1/2 gridui-u-modal---translate-y-1/2 gridui-u-modal--flex gridui-u-modal--flex-col gridui-u-modal--w-[min(calc(100%-32px),var(--gridui-modal-width,37rem))] gridui-u-modal--max-h-[calc(100dvh-32px)] gridui-u-modal--min-w-0 gridui-u-modal--type-body\", className)}\n />);\n return (<>\n <Dialog.Portal>\n <Dialog.Overlay\n className={cn(overlayBackdropStyles(), \"gridui-modal-overlay gridui-u-modal--fixed gridui-u-modal--inset-0 gridui-u-modal--z-(--gridui-z-dialog-backdrop) gridui-u-modal--bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]\")}\n />\n </Dialog.Portal>\n <Dialog.Portal\n forceMount={forceMount}\n >\n {forceMount ? (<RetainedLayer>\n {content}\n </RetainedLayer>) : content}\n </Dialog.Portal>\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalTitle\n * @description Modal Title\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalTitleProps = ComponentPropsWithRef<typeof Dialog.Title>;\n\nexport const ModalTitle: FC<ModalTitleProps> = (props: ModalTitleProps) => {\n const { className, ...restProps } = props;\n return (<Dialog.Title\n {...restProps}\n className={cn(\"gridui-u-modal--m-0 gridui-u-modal--type-heading\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalTrigger\n * @description Modal Trigger\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalTriggerProps = ComponentPropsWithRef<typeof Dialog.Trigger>;\n\nexport const ModalTrigger: FC<ModalTriggerProps> = (props: ModalTriggerProps) => {\n return (<Dialog.Trigger\n {...props}\n />);\n};\n"],
|
|
5
|
-
"mappings": ";AAOA,SAAS,aAAa,uBAAuB;AAC7C,OAA2B;AAC3B,YAAY,YAAY;AAYhB;AALD,IAAM,QAAwB,CAAC,UAAsB;AACxD,QAAM,QAAQ,gBAAgB,KAAK;AACnC,SAAQ;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACL,OAAO,MAAM;AAAA,MAEb;AAAA,QAAQ;AAAA,QAAP;AAAA,UACI,GAAG;AAAA,UACH,GAAG;AAAA;AAAA,MACR;AAAA;AAAA,EACJ;AACJ;;;ACnBA,SAAS,cAAgC;AACzC,SAAS,UAAU;AAOP,gBAAAA,YAAA;AAFL,IAAM,cAAoC,CAAC,UAA4B;AAC1E,QAAM,EAAE,WAAW,GAAG,UAAU,IAAI;AACpC,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAW,GAAG,kOAAkO,SAAS;AAAA;AAAA,EAC7P;AACJ;;;ACZA,SAAS,MAAAC,WAAU;AAOP,gBAAAC,YAAA;AAFL,IAAM,eAAsC,CAAC,UAA6B;AAC7E,QAAM,EAAE,WAAW,GAAG,UAAU,IAAI;AACpC,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWD,IAAG,qEAAqE,SAAS;AAAA;AAAA,EAChG;AACJ;;;ACXA,SAAS,uBAAuB,qBAAqB;AACrD,SAAS,MAAAE,WAAU;AASP,gBAAAC,YAAA;AAJL,IAAM,YAAgC,CAAC,UAA0B;AACpE,QAAM,EAAE,KAAK,cAAc,WAAW,GAAG,UAAU,IAAI;
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Modal\n * @namespace Modal\n * @description Modal\n */\n\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport { type Space } from \"@gridui/style-utils/responsive\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalSpace = Space;\n\nexport type ModalProps = ComponentPropsWithRef<typeof Dialog.Root>;\n\nexport const Modal: FC<ModalProps> = (props: ModalProps) => {\n const state = useOverlayState(props);\n return (<OverlayOpen.Provider\n value={state.open}\n >\n <Dialog.Root\n {...props}\n {...state}\n />\n </OverlayOpen.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalAction\n * @description Modal Action\n */\n\nimport { Button, type ButtonProps } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type ModalActionProps = ButtonProps;\n\nexport const ModalAction: FC<ModalActionProps> = (props: ModalActionProps) => {\n const { className, ...restProps } = props;\n return (<Button\n {...restProps}\n className={cn(\"gridui-modal-action gridui-u-modal--flex-1 gridui-u-modal--w-auto gridui-u-modal--rounded-none gridui-u-modal--border-border gridui-u-modal--px-gridui-24 gridui-u-modal--py-(--gridui-modal-padding) gridui-u-modal--min-h-11\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalActions\n * @description Modal Actions\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalActionsProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalActions: FC<ModalActionsProps> = (props: ModalActionsProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"gridui-modal-actions gridui-u-modal--flex gridui-u-modal--min-w-0\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalBody\n * @description Modal Body\n */\n\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalBodyProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalBody: FC<ModalBodyProps> = (props: ModalBodyProps) => {\n const { ref: forwardedRef, className, tabIndex = 0, ...restProps } = props;\n const scrollbarRef = useScrollbars({ ref: forwardedRef });\n const ref = useInteractionOutline({ ref: scrollbarRef });\n return (<div\n {...restProps}\n ref={ref}\n tabIndex={tabIndex}\n className={cn(\"gridui-u-modal--min-h-0 gridui-u-modal--min-w-0 gridui-u-modal--overflow-auto gridui-u-modal--overscroll-contain gridui-u-modal--p-gridui-24 gridui-u-modal--wrap-anywhere\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalClose\n * @description Modal Close\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalCloseProps = ComponentPropsWithRef<typeof Dialog.Close>;\n\nexport const ModalClose: FC<ModalCloseProps> = (props: ModalCloseProps) => {\n return (<Dialog.Close\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalDescription\n * @description Modal Description\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalDescriptionProps = ComponentPropsWithRef<typeof Dialog.Description>;\n\nexport const ModalDescription: FC<ModalDescriptionProps> = (props: ModalDescriptionProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Dialog.Description\n {...restProps}\n className={cn(\"gridui-u-modal--mt-gridui-8 gridui-u-modal--mb-0 gridui-u-modal--type-supporting gridui-u-modal--text-muted\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalFooter\n * @description Modal Footer\n */\n\nimport type { ModalSectionProps } from \"../shared/types\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { spacingVariables } from \"@gridui/style-utils/responsive\";\nimport type { FC } from \"react\";\n\nexport type ModalFooterProps = ModalSectionProps;\n\nexport const ModalFooter: FC<ModalFooterProps> = (props: ModalFooterProps) => {\n const {\n ref: forwardedRef,\n paddingBlock = 24,\n style,\n className,\n ...restProps\n } = props;\n const outlineRef = useInteractionOutline({ ref: forwardedRef });\n const ref = useScrollbars({ ref: outlineRef });\n return (<div\n {...restProps}\n ref={ref}\n style={{\n ...spacingVariables(\"modal-space\", paddingBlock),\n ...style,\n }}\n className={cn(\"gridui-modal-section gridui-modal-footer gridui-u-modal--max-h-[40dvh] gridui-u-modal--overflow-y-auto gridui-u-modal--shrink-0\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalFooterNote\n * @description Modal Footer Note\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalFooterNoteProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalFooterNote: FC<ModalFooterNoteProps> = (props: ModalFooterNoteProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"gridui-u-modal--min-w-0 gridui-u-modal--px-gridui-24 gridui-u-modal--py-(--gridui-modal-padding) gridui-u-modal--type-supporting gridui-u-modal--text-muted gridui-u-modal--wrap-anywhere\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalHeader\n * @description Modal Header\n */\n\nimport type { ModalSectionProps } from \"../shared/types\";\nimport { Button } from \"@gridui/button\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { spacingVariables } from \"@gridui/style-utils/responsive\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type ModalHeaderProps = ModalSectionProps & {\n readonly closeLabel: string;\n};\n\nexport const ModalHeader: FC<ModalHeaderProps> = (props: ModalHeaderProps) => {\n const {\n closeLabel,\n children,\n paddingBlock = 24,\n style,\n className,\n ...restProps\n } = props;\n const scrollbarRef = useScrollbars<HTMLDivElement>();\n const scrollRef = useInteractionOutline({ ref: scrollbarRef });\n return (<div\n {...restProps}\n style={{\n ...spacingVariables(\"modal-space\", paddingBlock),\n ...style,\n }}\n className={cn(\"gridui-modal-section gridui-modal-header gridui-u-modal--relative gridui-u-modal--z-(--gridui-z-content) gridui-u-modal--overflow-visible gridui-u-modal--shrink-0 gridui-u-modal--grid gridui-u-modal--grid-cols-[minmax(0,1fr)_auto]\", className)}\n >\n <div\n ref={scrollRef}\n className=\"gridui-u-modal--max-h-[40dvh] gridui-u-modal--min-w-0 gridui-u-modal--overflow-y-auto gridui-u-modal--px-gridui-24 gridui-u-modal--py-(--gridui-modal-padding) gridui-u-modal--wrap-anywhere\"\n >\n {children}\n </div>\n <Dialog.Close\n asChild\n >\n <Button\n aria-label={closeLabel}\n variant=\"quiet\"\n className=\"gridui-modal-close gridui-u-modal--self-stretch gridui-u-modal--w-gridui-64 gridui-u-modal--min-h-11 gridui-u-modal--rounded-none gridui-u-modal--border-border gridui-u-modal--p-0\"\n >\n <X\n aria-hidden=\"true\"\n />\n </Button>\n </Dialog.Close>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalPanel\n * @description Modal Panel\n */\n\nimport { interactionLayerProps, overlayBackdropStyles, overlaySurfaceStyles, RetainedLayer } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalPanelProps = ComponentPropsWithRef<typeof Dialog.Content>;\n\nexport const ModalPanel: FC<ModalPanelProps> = (props: ModalPanelProps) => {\n const {\n className,\n forceMount,\n ...restProps\n } = props;\n const content = (<Dialog.Content\n {...interactionLayerProps}\n {...restProps}\n forceMount={forceMount}\n className={cn(overlaySurfaceStyles({ kind: \"dialog\" }), \"gridui-modal-panel gridui-u-modal--fixed gridui-u-modal--z-(--gridui-z-dialog) gridui-u-modal--left-1/2 gridui-u-modal--top-1/2 gridui-u-modal---translate-x-1/2 gridui-u-modal---translate-y-1/2 gridui-u-modal--flex gridui-u-modal--flex-col gridui-u-modal--w-[min(calc(100%-32px),var(--gridui-modal-width,37rem))] gridui-u-modal--max-h-[calc(100dvh-32px)] gridui-u-modal--min-w-0 gridui-u-modal--type-body\", className)}\n />);\n return (<>\n <Dialog.Portal>\n <Dialog.Overlay\n className={cn(overlayBackdropStyles(), \"gridui-modal-overlay gridui-u-modal--fixed gridui-u-modal--inset-0 gridui-u-modal--z-(--gridui-z-dialog-backdrop) gridui-u-modal--bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]\")}\n />\n </Dialog.Portal>\n <Dialog.Portal\n forceMount={forceMount}\n >\n {forceMount ? (<RetainedLayer>\n {content}\n </RetainedLayer>) : content}\n </Dialog.Portal>\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalTitle\n * @description Modal Title\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalTitleProps = ComponentPropsWithRef<typeof Dialog.Title>;\n\nexport const ModalTitle: FC<ModalTitleProps> = (props: ModalTitleProps) => {\n const { className, ...restProps } = props;\n return (<Dialog.Title\n {...restProps}\n className={cn(\"gridui-u-modal--m-0 gridui-u-modal--type-heading\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalTrigger\n * @description Modal Trigger\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalTriggerProps = ComponentPropsWithRef<typeof Dialog.Trigger>;\n\nexport const ModalTrigger: FC<ModalTriggerProps> = (props: ModalTriggerProps) => {\n return (<Dialog.Trigger\n {...props}\n />);\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["jsx", "cn", "jsx", "cn", "jsx", "Dialog", "jsx", "cn", "Dialog", "jsx", "useInteractionOutline", "useScrollbars", "cn", "jsx", "cn", "jsx", "Button", "useInteractionOutline", "useScrollbars", "cn", "spacingVariables", "Dialog", "jsx", "cn", "Dialog", "jsx", "jsxs", "cn", "Dialog", "jsx", "Dialog", "jsx"]
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -151,6 +151,11 @@
|
|
|
151
151
|
--gridui-modal-padding: var(--gridui-modal-space);
|
|
152
152
|
}
|
|
153
153
|
@media (min-width: 40rem) {
|
|
154
|
+
.gridui-modal-section {
|
|
155
|
+
--gridui-modal-padding: var(--gridui-modal-space-sm);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
@media (min-width: 48rem) {
|
|
154
159
|
.gridui-modal-section {
|
|
155
160
|
--gridui-modal-padding: var(--gridui-modal-space-md);
|
|
156
161
|
}
|
package/docs/catalog.json
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/modal",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"category": "core",
|
|
6
6
|
"description": "GridUI React modal",
|
|
7
|
-
"usage": "The centered modal shares Radix Dialog's focus and dismissal behavior with Drawer. Its header owns a title cell and a full-height close cell; its footer owns an optional note and edge-aligned action cells. Header and footer accept independent responsive `paddingBlock` values. The body owns content scrolling;
|
|
7
|
+
"usage": "The centered modal shares Radix Dialog's focus and dismissal behavior with Drawer. Its header owns a title cell and a full-height close cell; its footer owns an optional note and edge-aligned action cells. Header and footer accept independent responsive `paddingBlock` values. The body owns content scrolling and defaults to `tabIndex={0}` so text-only content can be scrolled with the keyboard inside the focus scope. Supply a name when using a region role; native `tabIndex` overrides remain available. Small viewports stack footer actions below the note. See the composition example and API.",
|
|
8
8
|
"documentation": [
|
|
9
|
-
"README.md"
|
|
9
|
+
"README.md",
|
|
10
|
+
"docs/reference/README.md",
|
|
11
|
+
"docs/reference/modal-action.md",
|
|
12
|
+
"docs/reference/modal-actions.md",
|
|
13
|
+
"docs/reference/modal-body.md",
|
|
14
|
+
"docs/reference/modal-close.md",
|
|
15
|
+
"docs/reference/modal-description.md",
|
|
16
|
+
"docs/reference/modal-footer-note.md",
|
|
17
|
+
"docs/reference/modal-footer.md",
|
|
18
|
+
"docs/reference/modal-header.md",
|
|
19
|
+
"docs/reference/modal-panel.md",
|
|
20
|
+
"docs/reference/modal-title.md",
|
|
21
|
+
"docs/reference/modal-trigger.md",
|
|
22
|
+
"docs/reference/modal.md"
|
|
10
23
|
],
|
|
11
24
|
"exports": [
|
|
12
25
|
{
|
|
@@ -152,6 +165,8 @@
|
|
|
152
165
|
"@gridui/modal/styles.css"
|
|
153
166
|
],
|
|
154
167
|
"examples": [
|
|
168
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/composition.mdx",
|
|
169
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/forms-retention.mdx",
|
|
155
170
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx"
|
|
156
171
|
]
|
|
157
172
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Generated by pnpm docs:storybook. -->
|
|
2
|
+
# Component reference
|
|
3
|
+
|
|
4
|
+
- [Modal](modal.md)
|
|
5
|
+
- [ModalAction](modal-action.md)
|
|
6
|
+
- [ModalActions](modal-actions.md)
|
|
7
|
+
- [ModalBody](modal-body.md)
|
|
8
|
+
- [ModalClose](modal-close.md)
|
|
9
|
+
- [ModalDescription](modal-description.md)
|
|
10
|
+
- [ModalFooter](modal-footer.md)
|
|
11
|
+
- [ModalFooterNote](modal-footer-note.md)
|
|
12
|
+
- [ModalHeader](modal-header.md)
|
|
13
|
+
- [ModalPanel](modal-panel.md)
|
|
14
|
+
- [ModalTitle](modal-title.md)
|
|
15
|
+
- [ModalTrigger](modal-trigger.md)
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalAction
|
|
3
|
+
|
|
4
|
+
Compose ModalAction with Modal inside the same @gridui/modal component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalAction } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLButtonElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLButtonElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### size
|
|
59
|
+
|
|
60
|
+
``"small" | "standard" | "large" | "extra-large" | null | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
Component size preset.
|
|
63
|
+
|
|
64
|
+
### iconMotion
|
|
65
|
+
|
|
66
|
+
``"none" | "outward" | null | undefined`` · Optional
|
|
67
|
+
|
|
68
|
+
### variant
|
|
69
|
+
|
|
70
|
+
``"text" | "primary" | "secondary" | "quiet" | "highlight" | "underlined" | null | undefined`` · Optional
|
|
71
|
+
|
|
72
|
+
Visual variant.
|
|
73
|
+
|
|
74
|
+
### layout
|
|
75
|
+
|
|
76
|
+
``"cell" | "standard" | "icon" | "entry" | "rail" | "divided" | null | undefined`` · Optional
|
|
77
|
+
|
|
78
|
+
Layout within the containing region.
|
|
79
|
+
|
|
80
|
+
### startIcon
|
|
81
|
+
|
|
82
|
+
``ReactNode`` · Optional
|
|
83
|
+
|
|
84
|
+
### startIconLayout
|
|
85
|
+
|
|
86
|
+
``"divided" | "inline" | undefined`` · Optional
|
|
87
|
+
|
|
88
|
+
### startIconSize
|
|
89
|
+
|
|
90
|
+
``"standard" | "large" | "extra-large" | undefined`` · Optional
|
|
91
|
+
|
|
92
|
+
### endIcon
|
|
93
|
+
|
|
94
|
+
``ReactNode`` · Optional
|
|
95
|
+
|
|
96
|
+
### loading
|
|
97
|
+
|
|
98
|
+
``boolean | undefined`` · Optional
|
|
99
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalActions
|
|
3
|
+
|
|
4
|
+
Compose ModalActions with Modal inside the same @gridui/modal component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalActions } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalBody
|
|
3
|
+
|
|
4
|
+
Compose ModalBody with Modal inside the same @gridui/modal component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalBody } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### tabIndex
|
|
23
|
+
|
|
24
|
+
``number | undefined`` · Optional
|
|
25
|
+
|
|
26
|
+
Default: ``0``
|
|
27
|
+
|
|
28
|
+
### children
|
|
29
|
+
|
|
30
|
+
``ReactNode`` · Optional
|
|
31
|
+
|
|
32
|
+
Content rendered inside the component.
|
|
33
|
+
|
|
34
|
+
### onFocus
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onBlur
|
|
41
|
+
|
|
42
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onChange
|
|
47
|
+
|
|
48
|
+
``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onSubmit
|
|
53
|
+
|
|
54
|
+
``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### onClick
|
|
59
|
+
|
|
60
|
+
``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
|
|
61
|
+
|
|
62
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
63
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalClose
|
|
3
|
+
|
|
4
|
+
Compose ModalClose with Modal inside the same @gridui/modal component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalClose } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLButtonElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLButtonElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### asChild
|
|
59
|
+
|
|
60
|
+
``boolean | undefined`` · Optional
|
|
61
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalDescription
|
|
3
|
+
|
|
4
|
+
Compose ModalDescription with Modal inside the same @gridui/modal component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalDescription } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLParagraphElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLParagraphElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLParagraphElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLParagraphElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLParagraphElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### asChild
|
|
59
|
+
|
|
60
|
+
``boolean | undefined`` · Optional
|
|
61
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalFooterNote
|
|
3
|
+
|
|
4
|
+
Public ModalFooterNote component from @gridui/modal. See the package guide for its composition contract.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalFooterNote } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
## API
|
|
17
|
+
|
|
18
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
19
|
+
|
|
20
|
+
### children
|
|
21
|
+
|
|
22
|
+
``ReactNode`` · Optional
|
|
23
|
+
|
|
24
|
+
Content rendered inside the component.
|
|
25
|
+
|
|
26
|
+
### onFocus
|
|
27
|
+
|
|
28
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
29
|
+
|
|
30
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
31
|
+
|
|
32
|
+
### onBlur
|
|
33
|
+
|
|
34
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
35
|
+
|
|
36
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
37
|
+
|
|
38
|
+
### onChange
|
|
39
|
+
|
|
40
|
+
``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
|
|
41
|
+
|
|
42
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
43
|
+
|
|
44
|
+
### onSubmit
|
|
45
|
+
|
|
46
|
+
``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
|
|
47
|
+
|
|
48
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
49
|
+
|
|
50
|
+
### onClick
|
|
51
|
+
|
|
52
|
+
``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
|
|
53
|
+
|
|
54
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
55
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalFooter
|
|
3
|
+
|
|
4
|
+
Compose ModalFooter with Modal inside the same @gridui/modal component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalFooter } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### paddingBlock
|
|
59
|
+
|
|
60
|
+
``ModalSpacing | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
Default: ``24``
|
|
63
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalHeader
|
|
3
|
+
|
|
4
|
+
Compose ModalHeader with Modal inside the same @gridui/modal component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalHeader } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### paddingBlock
|
|
59
|
+
|
|
60
|
+
``ModalSpacing | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
Default: ``24``
|
|
63
|
+
|
|
64
|
+
### closeLabel
|
|
65
|
+
|
|
66
|
+
``string`` · Required
|
|
67
|
+
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalPanel
|
|
3
|
+
|
|
4
|
+
Compose ModalPanel with Modal inside the same @gridui/modal component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalPanel } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### forceMount
|
|
23
|
+
|
|
24
|
+
``true | undefined`` · Optional
|
|
25
|
+
|
|
26
|
+
Used to force mounting when more control is needed. Useful when
|
|
27
|
+
controlling animation with React animation libraries.
|
|
28
|
+
|
|
29
|
+
### children
|
|
30
|
+
|
|
31
|
+
``ReactNode`` · Optional
|
|
32
|
+
|
|
33
|
+
Content rendered inside the component.
|
|
34
|
+
|
|
35
|
+
### onFocus
|
|
36
|
+
|
|
37
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
38
|
+
|
|
39
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
40
|
+
|
|
41
|
+
### onBlur
|
|
42
|
+
|
|
43
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
44
|
+
|
|
45
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
46
|
+
|
|
47
|
+
### onChange
|
|
48
|
+
|
|
49
|
+
``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
|
|
50
|
+
|
|
51
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
52
|
+
|
|
53
|
+
### onSubmit
|
|
54
|
+
|
|
55
|
+
``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
|
|
56
|
+
|
|
57
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
58
|
+
|
|
59
|
+
### onClick
|
|
60
|
+
|
|
61
|
+
``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
|
|
62
|
+
|
|
63
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
64
|
+
|
|
65
|
+
### asChild
|
|
66
|
+
|
|
67
|
+
``boolean | undefined`` · Optional
|
|
68
|
+
|
|
69
|
+
### deferPointerDownOutside
|
|
70
|
+
|
|
71
|
+
``boolean | undefined`` · Optional
|
|
72
|
+
|
|
73
|
+
When `true`, a `'pointerdown'` event outside of the layered element will
|
|
74
|
+
wait for the interaction's click event before dispatching, allowing
|
|
75
|
+
third-party code to stop propagation of later events and cancel dismissal.
|
|
76
|
+
|
|
77
|
+
### onEscapeKeyDown
|
|
78
|
+
|
|
79
|
+
``(event: KeyboardEvent): void`` · Optional
|
|
80
|
+
|
|
81
|
+
Event handler called when the escape key is down.
|
|
82
|
+
Can be prevented.
|
|
83
|
+
|
|
84
|
+
### onPointerDownOutside
|
|
85
|
+
|
|
86
|
+
``(event: CustomEvent<{ originalEvent: PointerEvent; }>): void`` · Optional
|
|
87
|
+
|
|
88
|
+
Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.
|
|
89
|
+
Can be prevented.
|
|
90
|
+
|
|
91
|
+
### onFocusOutside
|
|
92
|
+
|
|
93
|
+
``(event: CustomEvent<{ originalEvent: FocusEvent; }>): void`` · Optional
|
|
94
|
+
|
|
95
|
+
Event handler called when the focus moves outside of the `DismissableLayer`.
|
|
96
|
+
Can be prevented.
|
|
97
|
+
|
|
98
|
+
### onInteractOutside
|
|
99
|
+
|
|
100
|
+
``(event: CustomEvent<{ originalEvent: PointerEvent; }> | CustomEvent<{ originalEvent: FocusEvent; }>): void`` · Optional
|
|
101
|
+
|
|
102
|
+
Event handler called when an interaction happens outside the `DismissableLayer`.
|
|
103
|
+
Specifically, when a `pointerdown` event happens outside or focus moves outside of it.
|
|
104
|
+
Can be prevented.
|
|
105
|
+
|
|
106
|
+
### onOpenAutoFocus
|
|
107
|
+
|
|
108
|
+
``(event: Event): void`` · Optional
|
|
109
|
+
|
|
110
|
+
Event handler called when auto-focusing on open.
|
|
111
|
+
Can be prevented.
|
|
112
|
+
|
|
113
|
+
### onCloseAutoFocus
|
|
114
|
+
|
|
115
|
+
``(event: Event): void`` · Optional
|
|
116
|
+
|
|
117
|
+
Event handler called when auto-focusing on close.
|
|
118
|
+
Can be prevented.
|
|
119
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalTitle
|
|
3
|
+
|
|
4
|
+
Compose ModalTitle with Modal inside the same @gridui/modal component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalTitle } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLHeadingElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLHeadingElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLHeadingElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLHeadingElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLHeadingElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### asChild
|
|
59
|
+
|
|
60
|
+
``boolean | undefined`` · Optional
|
|
61
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ModalTrigger
|
|
3
|
+
|
|
4
|
+
Compose ModalTrigger with Modal inside the same @gridui/modal component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ModalTrigger } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLButtonElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLButtonElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### asChild
|
|
59
|
+
|
|
60
|
+
``boolean | undefined`` · Optional
|
|
61
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# Modal
|
|
3
|
+
|
|
4
|
+
Presents a focused task in a dialog above the current page. Use AlertDialog when the task is specifically a consequential confirmation.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/modal`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { Modal } from "@gridui/modal";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/modal/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/modal/stories/modal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### open
|
|
29
|
+
|
|
30
|
+
``boolean | undefined`` · Optional
|
|
31
|
+
|
|
32
|
+
Controlled visibility. Pair with onOpenChange.
|
|
33
|
+
|
|
34
|
+
### defaultOpen
|
|
35
|
+
|
|
36
|
+
``boolean | undefined`` · Optional
|
|
37
|
+
|
|
38
|
+
Initial uncontrolled visibility. Reset the story after changing it.
|
|
39
|
+
|
|
40
|
+
### onOpenChange
|
|
41
|
+
|
|
42
|
+
``(open: boolean): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### modal
|
|
47
|
+
|
|
48
|
+
``boolean | undefined`` · Optional
|
|
49
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/modal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "GridUI React modal",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"react-dom": "^19.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@gridui/button": "^4.
|
|
30
|
+
"@gridui/button": "^4.1.0",
|
|
31
31
|
"@gridui/overlay": "^2.0.0",
|
|
32
|
-
"@gridui/style-utils": "^
|
|
32
|
+
"@gridui/style-utils": "^4.0.0",
|
|
33
33
|
"@gridui/theme": "^2.5.3",
|
|
34
34
|
"@radix-ui/react-dialog": "1.3.1",
|
|
35
35
|
"lucide-react": "1.70.0"
|