@raystack/apsara 0.53.0 → 0.53.1
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/dist/components/dialog/dialog.cjs +23 -14
- package/dist/components/dialog/dialog.cjs.map +1 -1
- package/dist/components/dialog/dialog.d.ts +1 -0
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +12 -3
- package/dist/components/dialog/dialog.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,34 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3.2_react@19.1.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
|
|
5
|
-
var index
|
|
5
|
+
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var flex = require('../flex/flex.cjs');
|
|
8
8
|
var dialog_module = require('./dialog.module.css.cjs');
|
|
9
|
-
var index = require('../../node_modules/.pnpm/@radix-ui_react-dialog@1.1.14_@types_react-dom@19.1.7_@types_react@19.1.9__@types_react@19.1._i7gyttlqowrnok6rwi63tbbmni/node_modules/@radix-ui/react-dialog/dist/index.cjs');
|
|
9
|
+
var index$1 = require('../../node_modules/.pnpm/@radix-ui_react-dialog@1.1.14_@types_react-dom@19.1.7_@types_react@19.1.9__@types_react@19.1._i7gyttlqowrnok6rwi63tbbmni/node_modules/@radix-ui/react-dialog/dist/index.cjs');
|
|
10
10
|
|
|
11
|
-
const dialogContent = index
|
|
12
|
-
const DialogContent = React.forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const dialogContent = index.cva(dialog_module.default.dialogContent);
|
|
12
|
+
const DialogContent = React.forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width, scrollableOverlay = false, ...props }, ref) => {
|
|
13
|
+
const overlayProps = {
|
|
14
|
+
className: index.cx(dialog_module.default.dialogOverlay, overlayClassName, overlayBlur && dialog_module.default.overlayBlur),
|
|
15
|
+
style: overlayStyle,
|
|
16
|
+
'aria-hidden': 'true',
|
|
17
|
+
role: 'presentation'
|
|
18
|
+
};
|
|
19
|
+
const content = (jsxRuntime.jsx(index$1.Content, { ref: ref, className: dialogContent({ className }), style: { width, ...props.style }, "aria-label": ariaLabel, "aria-describedby": ariaDescription ? 'dialog-description' : undefined, ...props, children: children }));
|
|
20
|
+
return (jsxRuntime.jsx(index$1.Portal, { children: scrollableOverlay ? (jsxRuntime.jsx(index$1.Overlay, { ...overlayProps, children: content })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(index$1.Overlay, { ...overlayProps }), content] })) }));
|
|
21
|
+
});
|
|
22
|
+
DialogContent.displayName = index$1.Content.displayName;
|
|
23
|
+
const DialogHeader = ({ children, className }) => (jsxRuntime.jsx(flex.Flex, { justify: 'between', align: 'center', className: index.cx(dialog_module.default.header, className), children: children }));
|
|
24
|
+
const DialogFooter = ({ children, className }) => (jsxRuntime.jsx(flex.Flex, { gap: 5, justify: 'end', className: index.cx(dialog_module.default.footer, className), children: children }));
|
|
25
|
+
const DialogBody = ({ children, className }) => (jsxRuntime.jsx(flex.Flex, { direction: 'column', gap: 3, className: index.cx(dialog_module.default.body, className), children: children }));
|
|
17
26
|
function CloseButton({ className, ...props }) {
|
|
18
|
-
return (jsxRuntime.jsx(index.Close, { className: index
|
|
27
|
+
return (jsxRuntime.jsx(index$1.Close, { className: index.cx(dialog_module.default.close, className), "aria-label": 'Close dialog', ...props, children: jsxRuntime.jsx(reactIcons_esm.Cross1Icon, {}) }));
|
|
19
28
|
}
|
|
20
29
|
function DialogTitle({ children, className, ...props }) {
|
|
21
|
-
return (jsxRuntime.jsx(index.Title, { ...props, role: 'heading', "aria-level": 1, className: index
|
|
30
|
+
return (jsxRuntime.jsx(index$1.Title, { ...props, role: 'heading', "aria-level": 1, className: index.cx(dialog_module.default.title, className), children: children }));
|
|
22
31
|
}
|
|
23
32
|
function DialogDescription({ children, className, ...props }) {
|
|
24
|
-
return (jsxRuntime.jsx(index.Description, { ...props, className: index
|
|
33
|
+
return (jsxRuntime.jsx(index$1.Description, { ...props, className: index.cx(dialog_module.default.description, className), id: 'dialog-description', role: 'document', children: children }));
|
|
25
34
|
}
|
|
26
|
-
const Dialog = Object.assign(index.Root, {
|
|
27
|
-
Trigger: index.Trigger,
|
|
35
|
+
const Dialog = Object.assign(index$1.Root, {
|
|
36
|
+
Trigger: index$1.Trigger,
|
|
28
37
|
Content: DialogContent,
|
|
29
38
|
Header: DialogHeader,
|
|
30
39
|
Footer: DialogFooter,
|
|
31
40
|
Body: DialogBody,
|
|
32
|
-
Close: index.Close,
|
|
41
|
+
Close: index$1.Close,
|
|
33
42
|
CloseButton: CloseButton,
|
|
34
43
|
Title: DialogTitle,
|
|
35
44
|
Description: DialogDescription
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.cjs","sources":["../../../components/dialog/dialog.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport { VariantProps, cva, cx } from 'class-variance-authority';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef\n} from 'react';\nimport { Flex } from '../flex';\nimport styles from './dialog.module.css';\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n}\n\nconst DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n ariaLabel,\n ariaDescription,\n overlayBlur = false,\n overlayClassName,\n overlayStyle,\n width,\n ...props\n },\n ref\n ) =>
|
|
1
|
+
{"version":3,"file":"dialog.cjs","sources":["../../../components/dialog/dialog.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport { VariantProps, cva, cx } from 'class-variance-authority';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef\n} from 'react';\nimport { Flex } from '../flex';\nimport styles from './dialog.module.css';\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n scrollableOverlay?: boolean;\n}\n\nconst DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n ariaLabel,\n ariaDescription,\n overlayBlur = false,\n overlayClassName,\n overlayStyle,\n width,\n scrollableOverlay = false,\n ...props\n },\n ref\n ) => {\n const overlayProps: DialogPrimitive.DialogOverlayProps = {\n className: cx(\n styles.dialogOverlay,\n overlayClassName,\n overlayBlur && styles.overlayBlur\n ),\n style: overlayStyle,\n 'aria-hidden': 'true',\n role: 'presentation'\n };\n\n const content = (\n <DialogPrimitive.Content\n ref={ref}\n className={dialogContent({ className })}\n style={{ width, ...props.style }}\n aria-label={ariaLabel}\n aria-describedby={ariaDescription ? 'dialog-description' : undefined}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n );\n return (\n <DialogPrimitive.Portal>\n {scrollableOverlay ? (\n <DialogPrimitive.Overlay {...overlayProps}>\n {content}\n </DialogPrimitive.Overlay>\n ) : (\n <>\n <DialogPrimitive.Overlay {...overlayProps} />\n {content}\n </>\n )}\n </DialogPrimitive.Portal>\n );\n }\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex\n justify='between'\n align='center'\n className={cx(styles.header, className)}\n >\n {children}\n </Flex>\n);\n\nconst DialogFooter = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex gap={5} justify='end' className={cx(styles.footer, className)}>\n {children}\n </Flex>\n);\n\nconst DialogBody = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex direction='column' gap={3} className={cx(styles.body, className)}>\n {children}\n </Flex>\n);\n\ntype CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;\nexport function CloseButton({ className, ...props }: CloseButtonProps) {\n return (\n <DialogPrimitive.Close\n className={cx(styles.close, className)}\n aria-label='Close dialog'\n {...props}\n >\n <Cross1Icon />\n </DialogPrimitive.Close>\n );\n}\n\ninterface DialogTitleProps\n extends ComponentProps<typeof DialogPrimitive.Title> {\n children: React.ReactNode;\n}\n\nfunction DialogTitle({ children, className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n {...props}\n role='heading'\n aria-level={1}\n className={cx(styles.title, className)}\n >\n {children}\n </DialogPrimitive.Title>\n );\n}\n\ninterface DialogDescriptionProps\n extends ComponentProps<typeof DialogPrimitive.Description> {\n children: React.ReactNode;\n className?: string;\n}\n\nfunction DialogDescription({\n children,\n className,\n ...props\n}: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n {...props}\n className={cx(styles.description, className)}\n id='dialog-description'\n role='document'\n >\n {children}\n </DialogPrimitive.Description>\n );\n}\n\nexport const Dialog = Object.assign(DialogPrimitive.Root, {\n Trigger: DialogPrimitive.Trigger,\n Content: DialogContent,\n Header: DialogHeader,\n Footer: DialogFooter,\n Body: DialogBody,\n Close: DialogPrimitive.Close,\n CloseButton: CloseButton,\n Title: DialogTitle,\n Description: DialogDescription\n});\n"],"names":["cva","styles","forwardRef","cx","_jsx","DialogPrimitive.Content","DialogPrimitive.Portal","DialogPrimitive.Overlay","_jsxs","_Fragment","Flex","DialogPrimitive.Close","Cross1Icon","DialogPrimitive.Title","DialogPrimitive.Description","DialogPrimitive.Root","DialogPrimitive.Trigger"],"mappings":";;;;;;;;;;AAYA,MAAM,aAAa,GAAGA,SAAG,CAACC,qBAAM,CAAC,aAAa,CAAC,CAAC;AAchD,MAAM,aAAa,GAAGC,gBAAU,CAI9B,CACE,EACE,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,WAAW,GAAG,KAAK,EACnB,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,iBAAiB,GAAG,KAAK,EACzB,GAAG,KAAK,EACT,EACD,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAuC;AACvD,QAAA,SAAS,EAAEC,QAAE,CACXF,qBAAM,CAAC,aAAa,EACpB,gBAAgB,EAChB,WAAW,IAAIA,qBAAM,CAAC,WAAW,CAClC;AACD,QAAA,KAAK,EAAE,YAAY;AACnB,QAAA,aAAa,EAAE,MAAM;AACrB,QAAA,IAAI,EAAE,cAAc;KACrB,CAAC;IAEF,MAAM,OAAO,IACXG,cAAA,CAACC,eAAuB,EACtB,EAAA,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC,EACvC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,EACpB,YAAA,EAAA,SAAS,EACH,kBAAA,EAAA,eAAe,GAAG,oBAAoB,GAAG,SAAS,EAAA,GAChE,KAAK,EAER,QAAA,EAAA,QAAQ,EACe,CAAA,CAC3B,CAAC;AACF,IAAA,QACED,cAAC,CAAAE,cAAsB,cACpB,iBAAiB,IAChBF,cAAC,CAAAG,eAAuB,EAAA,EAAA,GAAK,YAAY,EACtC,QAAA,E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yBAAU,EAAA,EAAA,CAAG,EACQ,CAAA,EACxB;AACJ,CAAC;AAOD,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB,EAAA;AACtE,IAAA,QACER,cAAA,CAACS,aAAqB,EAAA,EAAA,GAChB,KAAK,EACT,IAAI,EAAC,SAAS,EAAA,YAAA,EACF,CAAC,EACb,SAAS,EAAEV,QAAE,CAACF,qBAAM,CAAC,KAAK,EAAE,SAAS,CAAC,EAErC,QAAA,EAAA,QAAQ,EACa,CAAA,EACxB;AACJ,CAAC;AAQD,SAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACe,EAAA;AACvB,IAAA,QACEG,cAAA,CAACU,mBAA2B,EAAA,EAAA,GACtB,KAAK,EACT,SAAS,EAAEX,QAAE,CAACF,qBAAM,CAAC,WAAW,EAAE,SAAS,CAAC,EAC5C,EAAE,EAAC,oBAAoB,EACvB,IAAI,EAAC,UAAU,EAAA,QAAA,EAEd,QAAQ,EAAA,CACmB,EAC9B;AACJ,CAAC;AAEY,MAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAACc,YAAoB,EAAE;IACxD,OAAO,EAAEC,eAAuB;AAChC,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,IAAI,EAAE,UAAU;IAChB,KAAK,EAAEL,aAAqB;AAC5B,IAAA,WAAW,EAAE,WAAW;AACxB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,WAAW,EAAE,iBAAiB;AAC/B,CAAA;;;;;"}
|
|
@@ -9,6 +9,7 @@ export interface DialogContentProps extends ComponentPropsWithoutRef<typeof Dial
|
|
|
9
9
|
overlayClassName?: string;
|
|
10
10
|
overlayStyle?: React.CSSProperties;
|
|
11
11
|
width?: string | number;
|
|
12
|
+
scrollableOverlay?: boolean;
|
|
12
13
|
}
|
|
13
14
|
type CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;
|
|
14
15
|
export declare function CloseButton({ className, ...props }: CloseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../components/dialog/dialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAW,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EACL,cAAc,EACd,wBAAwB,EAGzB,MAAM,OAAO,CAAC;AAIf,QAAA,MAAM,aAAa,oFAA4B,CAAC;AAEhD,MAAM,WAAW,kBACf,SAAQ,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAC9D,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../components/dialog/dialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAW,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EACL,cAAc,EACd,wBAAwB,EAGzB,MAAM,OAAO,CAAC;AAIf,QAAA,MAAM,aAAa,oFAA4B,CAAC;AAEhD,MAAM,WAAW,kBACf,SAAQ,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAC9D,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAuGD,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AACrE,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAUpE;AAED,UAAU,gBACR,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC;IACpD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAWvE;AAED,UAAU,sBACR,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC;IAC1D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAWxB;AAED,eAAO,MAAM,MAAM;;;;kBA1FP,MAAM,SAAS;;;;kBAgBf,MAAM,SAAS;;;;kBAYf,MAAM,SAAS;;;;;;;CAwEzB,CAAC"}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Cross1Icon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.2_react@19.1.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
|
|
3
3
|
import { cx, cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { Flex } from '../flex/flex.js';
|
|
6
6
|
import styles from './dialog.module.css.js';
|
|
7
|
-
import { Portal, Overlay,
|
|
7
|
+
import { Content, Portal, Overlay, Root, Trigger, Close, Title, Description } from '../../node_modules/.pnpm/@radix-ui_react-dialog@1.1.14_@types_react-dom@19.1.7_@types_react@19.1.9__@types_react@19.1._i7gyttlqowrnok6rwi63tbbmni/node_modules/@radix-ui/react-dialog/dist/index.js';
|
|
8
8
|
|
|
9
9
|
const dialogContent = cva(styles.dialogContent);
|
|
10
|
-
const DialogContent = forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width,
|
|
10
|
+
const DialogContent = forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width, scrollableOverlay = false, ...props }, ref) => {
|
|
11
|
+
const overlayProps = {
|
|
12
|
+
className: cx(styles.dialogOverlay, overlayClassName, overlayBlur && styles.overlayBlur),
|
|
13
|
+
style: overlayStyle,
|
|
14
|
+
'aria-hidden': 'true',
|
|
15
|
+
role: 'presentation'
|
|
16
|
+
};
|
|
17
|
+
const content = (jsx(Content, { ref: ref, className: dialogContent({ className }), style: { width, ...props.style }, "aria-label": ariaLabel, "aria-describedby": ariaDescription ? 'dialog-description' : undefined, ...props, children: children }));
|
|
18
|
+
return (jsx(Portal, { children: scrollableOverlay ? (jsx(Overlay, { ...overlayProps, children: content })) : (jsxs(Fragment, { children: [jsx(Overlay, { ...overlayProps }), content] })) }));
|
|
19
|
+
});
|
|
11
20
|
DialogContent.displayName = Content.displayName;
|
|
12
21
|
const DialogHeader = ({ children, className }) => (jsx(Flex, { justify: 'between', align: 'center', className: cx(styles.header, className), children: children }));
|
|
13
22
|
const DialogFooter = ({ children, className }) => (jsx(Flex, { gap: 5, justify: 'end', className: cx(styles.footer, className), children: children }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["../../../components/dialog/dialog.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport { VariantProps, cva, cx } from 'class-variance-authority';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef\n} from 'react';\nimport { Flex } from '../flex';\nimport styles from './dialog.module.css';\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n}\n\nconst DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n ariaLabel,\n ariaDescription,\n overlayBlur = false,\n overlayClassName,\n overlayStyle,\n width,\n ...props\n },\n ref\n ) =>
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../../components/dialog/dialog.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport { VariantProps, cva, cx } from 'class-variance-authority';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef\n} from 'react';\nimport { Flex } from '../flex';\nimport styles from './dialog.module.css';\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n scrollableOverlay?: boolean;\n}\n\nconst DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n ariaLabel,\n ariaDescription,\n overlayBlur = false,\n overlayClassName,\n overlayStyle,\n width,\n scrollableOverlay = false,\n ...props\n },\n ref\n ) => {\n const overlayProps: DialogPrimitive.DialogOverlayProps = {\n className: cx(\n styles.dialogOverlay,\n overlayClassName,\n overlayBlur && styles.overlayBlur\n ),\n style: overlayStyle,\n 'aria-hidden': 'true',\n role: 'presentation'\n };\n\n const content = (\n <DialogPrimitive.Content\n ref={ref}\n className={dialogContent({ className })}\n style={{ width, ...props.style }}\n aria-label={ariaLabel}\n aria-describedby={ariaDescription ? 'dialog-description' : undefined}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n );\n return (\n <DialogPrimitive.Portal>\n {scrollableOverlay ? (\n <DialogPrimitive.Overlay {...overlayProps}>\n {content}\n </DialogPrimitive.Overlay>\n ) : (\n <>\n <DialogPrimitive.Overlay {...overlayProps} />\n {content}\n </>\n )}\n </DialogPrimitive.Portal>\n );\n }\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex\n justify='between'\n align='center'\n className={cx(styles.header, className)}\n >\n {children}\n </Flex>\n);\n\nconst DialogFooter = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex gap={5} justify='end' className={cx(styles.footer, className)}>\n {children}\n </Flex>\n);\n\nconst DialogBody = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex direction='column' gap={3} className={cx(styles.body, className)}>\n {children}\n </Flex>\n);\n\ntype CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;\nexport function CloseButton({ className, ...props }: CloseButtonProps) {\n return (\n <DialogPrimitive.Close\n className={cx(styles.close, className)}\n aria-label='Close dialog'\n {...props}\n >\n <Cross1Icon />\n </DialogPrimitive.Close>\n );\n}\n\ninterface DialogTitleProps\n extends ComponentProps<typeof DialogPrimitive.Title> {\n children: React.ReactNode;\n}\n\nfunction DialogTitle({ children, className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n {...props}\n role='heading'\n aria-level={1}\n className={cx(styles.title, className)}\n >\n {children}\n </DialogPrimitive.Title>\n );\n}\n\ninterface DialogDescriptionProps\n extends ComponentProps<typeof DialogPrimitive.Description> {\n children: React.ReactNode;\n className?: string;\n}\n\nfunction DialogDescription({\n children,\n className,\n ...props\n}: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n {...props}\n className={cx(styles.description, className)}\n id='dialog-description'\n role='document'\n >\n {children}\n </DialogPrimitive.Description>\n );\n}\n\nexport const Dialog = Object.assign(DialogPrimitive.Root, {\n Trigger: DialogPrimitive.Trigger,\n Content: DialogContent,\n Header: DialogHeader,\n Footer: DialogFooter,\n Body: DialogBody,\n Close: DialogPrimitive.Close,\n CloseButton: CloseButton,\n Title: DialogTitle,\n Description: DialogDescription\n});\n"],"names":["_jsx","DialogPrimitive.Content","DialogPrimitive.Portal","DialogPrimitive.Overlay","_jsxs","_Fragment","DialogPrimitive.Close","DialogPrimitive.Title","DialogPrimitive.Description","DialogPrimitive.Root","DialogPrimitive.Trigger"],"mappings":";;;;;;;;AAYA,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AAchD,MAAM,aAAa,GAAG,UAAU,CAI9B,CACE,EACE,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,WAAW,GAAG,KAAK,EACnB,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,iBAAiB,GAAG,KAAK,EACzB,GAAG,KAAK,EACT,EACD,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAuC;AACvD,QAAA,SAAS,EAAE,EAAE,CACX,MAAM,CAAC,aAAa,EACpB,gBAAgB,EAChB,WAAW,IAAI,MAAM,CAAC,WAAW,CAClC;AACD,QAAA,KAAK,EAAE,YAAY;AACnB,QAAA,aAAa,EAAE,MAAM;AACrB,QAAA,IAA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