@yamada-ui/modal 1.4.4-next-20241111190044 → 1.4.5-dev-20241113103942
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-JZEVC6JC.mjs → chunk-4SA2BXAV.mjs} +4 -3
- package/dist/chunk-4SA2BXAV.mjs.map +1 -0
- package/dist/{chunk-26L5MSTF.mjs → chunk-KRAXUNBU.mjs} +7 -4
- package/dist/chunk-KRAXUNBU.mjs.map +1 -0
- package/dist/{chunk-6VCJW6AO.mjs → chunk-W4G2GVI7.mjs} +2 -2
- package/dist/{chunk-AQ6NOJ35.mjs → chunk-WKDYYNHI.mjs} +7 -4
- package/dist/chunk-WKDYYNHI.mjs.map +1 -0
- package/dist/dialog.js +8 -4
- package/dist/dialog.js.map +1 -1
- package/dist/dialog.mjs +3 -3
- package/dist/drawer-content.d.mts +1 -1
- package/dist/drawer-content.d.ts +1 -1
- package/dist/drawer-content.js +3 -2
- package/dist/drawer-content.js.map +1 -1
- package/dist/drawer-content.mjs +1 -1
- package/dist/drawer.d.mts +6 -0
- package/dist/drawer.d.ts +6 -0
- package/dist/drawer.js +12 -5
- package/dist/drawer.js.map +1 -1
- package/dist/drawer.mjs +3 -3
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/modal.d.mts +10 -4
- package/dist/modal.d.ts +10 -4
- package/dist/modal.js +8 -4
- package/dist/modal.js.map +1 -1
- package/dist/modal.mjs +2 -2
- package/package.json +7 -7
- package/dist/chunk-26L5MSTF.mjs.map +0 -1
- package/dist/chunk-AQ6NOJ35.mjs.map +0 -1
- package/dist/chunk-JZEVC6JC.mjs.map +0 -1
- /package/dist/{chunk-6VCJW6AO.mjs.map → chunk-W4G2GVI7.mjs.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/drawer-content.tsx","../src/drawer-close-button.tsx","../src/modal-close-button.tsx","../src/modal-context.ts","../src/drawer-drag-bar.tsx"],"sourcesContent":["import type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport type { MotionPanInfo } from \"@yamada-ui/motion\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type { DrawerProps } from \"./drawer\"\nimport { ui } from \"@yamada-ui/core\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { Slide } from \"@yamada-ui/transitions\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { cx, findChildren, getValidChildren, isArray } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport { DrawerCloseButton } from \"./drawer-close-button\"\nimport { DrawerDragBar } from \"./drawer-drag-bar\"\nimport { useDrawer, useModal } from \"./modal-context\"\n\nexport interface DrawerContentProps\n extends Merge<\n Omit<DrawerProps, \"isOpen\" | \"placement\" | keyof ThemeProps>,\n Required<\n Pick<\n DrawerProps,\n | \"dragConstraints\"\n | \"dragElastic\"\n | \"dragOffset\"\n | \"dragVelocity\"\n | \"placement\"\n | \"placement\"\n >\n >\n > {}\n\nexport const DrawerContent = motionForwardRef<DrawerContentProps, \"div\">(\n (\n {\n className,\n children,\n closeOnDrag,\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n placement: _placement,\n withCloseButton,\n withDragBar,\n blankForDragProps,\n ...rest\n },\n ref,\n ) => {\n const { describedbyId, duration, isOpen, labelledbyId, onClose } =\n useModal()\n const styles = useDrawer()\n const placement = useValue(_placement)\n\n const validChildren = getValidChildren(children)\n\n const [customDrawerCloseButton, ...cloneChildren] = findChildren(\n validChildren,\n DrawerCloseButton,\n )\n\n const blankForDragBg = useMemo(() => {\n const propBg =\n rest.backgroundColor ?? rest.bgColor ?? rest.background ?? rest.bg\n const styleBg =\n styles.container?.backgroundColor ??\n styles.container?.bgColor ??\n styles.container?.background ??\n styles.container?.bg\n const computedBg = propBg ?? styleBg\n\n return isArray(computedBg) ? computedBg : [computedBg]\n }, [rest, styles])\n\n const blankForDrag = useMemo<CSSUIObject>(() => {\n let position: CSSUIObject = {}\n\n switch (placement) {\n case \"top\":\n position = { left: 0, right: 0, top: \"calc(-100dvh + 1px)\" }\n break\n\n case \"bottom\":\n position = { bottom: \"calc(-100dvh + 1px)\", left: 0, right: 0 }\n break\n\n case \"left\":\n position = { bottom: 0, left: \"calc(-100% + 1px)\", top: 0 }\n break\n\n case \"right\":\n position = { bottom: 0, right: \"calc(-100% + 1px)\", top: 0 }\n break\n }\n\n const [lightBg, darkBg] = blankForDragBg\n\n return {\n _after: {\n bg: lightBg,\n content: '\"\"',\n display: \"block\",\n h: \"100dvh\",\n position: \"absolute\",\n w: \"100%\",\n ...position,\n ...blankForDragProps,\n },\n _dark: {\n _after: {\n bg: darkBg,\n },\n },\n }\n }, [placement, blankForDragBg, blankForDragProps])\n\n const css = useMemo<CSSUIObject>(\n () => ({\n display: \"flex\",\n flexDirection:\n placement === \"top\" || placement === \"bottom\" ? \"column\" : \"row\",\n outline: 0,\n ...(closeOnDrag ? blankForDrag : {}),\n ...styles.container,\n }),\n [blankForDrag, closeOnDrag, placement, styles],\n )\n\n const getDragDirectionRestriction = useCallback(\n (value: number) => {\n switch (placement) {\n case \"top\":\n return { bottom: value }\n case \"bottom\":\n return { top: value }\n case \"left\":\n return { right: value }\n case \"right\":\n return { left: value }\n }\n },\n [placement],\n )\n\n const getDragDirection = useCallback(() => {\n switch (placement) {\n case \"top\":\n case \"bottom\":\n return \"y\"\n case \"left\":\n case \"right\":\n return \"x\"\n }\n }, [placement])\n\n const isCloseByDragInfo = useCallback(\n (info: MotionPanInfo) => {\n switch (placement) {\n case \"top\":\n return (\n info.velocity.y <= dragVelocity * -1 ||\n info.offset.y <= dragOffset * -1\n )\n case \"bottom\":\n return (\n info.velocity.y >= dragVelocity || info.offset.y >= dragOffset\n )\n case \"left\":\n return (\n info.velocity.x <= dragVelocity * -1 ||\n info.offset.x <= dragOffset * -1\n )\n case \"right\":\n return (\n info.velocity.x >= dragVelocity || info.offset.x >= dragOffset\n )\n }\n },\n [placement, dragVelocity, dragOffset],\n )\n\n return (\n <Slide\n ref={ref}\n className={cx(\"ui-drawer\", className)}\n aria-describedby={describedbyId}\n aria-labelledby={labelledbyId}\n aria-modal=\"true\"\n drag={closeOnDrag ? getDragDirection() : false}\n dragConstraints={getDragDirectionRestriction(dragConstraints)}\n dragElastic={getDragDirectionRestriction(dragElastic)}\n dragMomentum={false}\n dragSnapToOrigin\n duration={duration}\n isOpen={isOpen}\n placement={placement}\n role=\"dialog\"\n tabIndex={-1}\n onDragEnd={(_, info) => {\n if (isCloseByDragInfo(info)) onClose?.()\n }}\n __css={css}\n {...rest}\n >\n {customDrawerCloseButton ??\n (withCloseButton && onClose ? <DrawerCloseButton /> : null)}\n\n {withDragBar &&\n closeOnDrag &&\n (placement === \"bottom\" || placement === \"right\") ? (\n <DrawerDragBar />\n ) : null}\n\n <ui.div\n className=\"ui-drawer__inner\"\n __css={{\n display: \"flex\",\n flexDirection: \"column\",\n w: \"100%\",\n ...styles.inner,\n }}\n >\n {cloneChildren}\n </ui.div>\n\n {withDragBar &&\n closeOnDrag &&\n (placement === \"top\" || placement === \"left\") ? (\n <DrawerDragBar />\n ) : null}\n </Slide>\n )\n },\n)\n\nDrawerContent.displayName = \"DrawerContent\"\nDrawerContent.__ui__ = \"DrawerContent\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalCloseButtonProps } from \"./modal-close-button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { ModalCloseButton } from \"./modal-close-button\"\nimport { useDrawer } from \"./modal-context\"\n\nexport interface DrawerCloseButtonProps extends ModalCloseButtonProps {}\n\nexport const DrawerCloseButton = forwardRef<DrawerCloseButtonProps, \"button\">(\n ({ className, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.closeButton }\n\n return (\n <ModalCloseButton\n ref={ref}\n className={cx(\"ui-drawer__close-button\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerCloseButton.displayName = \"DrawerCloseButton\"\nDrawerCloseButton.__ui__ = \"DrawerCloseButton\"\n","import type { CloseButtonProps } from \"@yamada-ui/close-button\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport { CloseButton } from \"@yamada-ui/close-button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalCloseButtonProps extends CloseButtonProps {}\n\nexport const ModalCloseButton = forwardRef<ModalCloseButtonProps, \"button\">(\n ({ onClick, __css, ...rest }, ref) => {\n const { styles, onClose } = useModal()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n ...(__css ? __css : styles.closeButton),\n }\n\n return (\n <CloseButton\n ref={ref}\n className={cx(\"ui-modal__close-button\")}\n aria-label=\"Close modal\"\n onClick={handlerAll(onClick, (ev) => {\n ev.stopPropagation()\n onClose?.()\n })}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nModalCloseButton.displayName = \"ModalCloseButton\"\nModalCloseButton.__ui__ = \"ModalCloseButton\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n describedbyId: string\n labelledbyId: string\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDrawer } from \"./modal-context\"\n\nexport interface DrawerDragBarProps extends HTMLUIProps {}\n\nexport const DrawerDragBar = forwardRef<DrawerDragBarProps, \"div\">(\n ({ className, __css, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.dragBar }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-drawer__drag-bar\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerDragBar.displayName = \"DrawerDragBar\"\nDrawerDragBar.__ui__ = \"DrawerDragBar\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,IAAAA,eAAmB;AACnB,oBAAiC;AACjC,yBAAsB;AACtB,uBAAyB;AACzB,IAAAC,gBAA4D;AAC5D,mBAAqC;;;ACPrC,IAAAC,eAA2B;AAC3B,IAAAC,gBAAmB;;;ACDnB,0BAA4B;AAC5B,kBAA2B;AAC3B,IAAAC,gBAA+B;;;ACF/B,mBAA8B;AAQvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;ADZK;AAVC,IAAM,uBAAmB;AAAA,EAC9B,CAAC,EAAE,SAAS,OAAO,GAAG,KAAK,GAAG,QAAQ;AACpC,UAAM,EAAE,QAAQ,QAAQ,IAAI,SAAS;AAErC,UAAM,MAAmB;AAAA,MACvB,UAAU;AAAA,MACV,GAAI,QAAQ,QAAQ,OAAO;A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,KAAK;AACH,mBACE,KAAK,SAAS,KAAK,eAAe,MAClC,KAAK,OAAO,KAAK,aAAa;AAAA,UAElC,KAAK;AACH,mBACE,KAAK,SAAS,KAAK,gBAAgB,KAAK,OAAO,KAAK;AAAA,QAE1D;AAAA,MACF;AAAA,MACA,CAAC,WAAW,cAAc,UAAU;AAAA,IACtC;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,aAAa,SAAS;AAAA,QACpC,oBAAkB;AAAA,QAClB,mBAAiB;AAAA,QACjB,cAAW;AAAA,QACX,MAAM,cAAc,iBAAiB,IAAI;AAAA,QACzC,iBAAiB,4BAA4B,eAAe;AAAA,QAC5D,aAAa,4BAA4B,WAAW;AAAA,QACpD,cAAc;AAAA,QACd,kBAAgB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA,MAAK;AAAA,QACL,UAAU;AAAA,QACV,WAAW,CAAC,GAAG,SAAS;AACtB,cAAI,kBAAkB,IAAI,EAAG;AAAA,QAC/B;AAAA,QACA,OAAO;AAAA,QACN,GAAG;AAAA,QAEH;AAAA,sEACE,mBAAmB,UAAU,6CAAC,qBAAkB,IAAK;AAAA,UAEvD,eACD,gBACC,cAAc,YAAY,cAAc,WACvC,6CAAC,iBAAc,IACb;AAAA,UAEJ;AAAA,YAAC,gBAAG;AAAA,YAAH;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,SAAS;AAAA,gBACT,eAAe;AAAA,gBACf,GAAG;AAAA,gBACH,GAAG,OAAO;AAAA,cACZ;AAAA,cAEC;AAAA;AAAA,UACH;AAAA,UAEC,eACD,gBACC,cAAc,SAAS,cAAc,UACpC,6CAAC,iBAAc,IACb;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,cAAc,cAAc;AAC5B,cAAc,SAAS;","names":["import_core","import_utils","import_core","import_utils","import_utils","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_jsx_runtime"]}
|
1
|
+
{"version":3,"sources":["../src/drawer-content.tsx","../src/drawer-close-button.tsx","../src/modal-close-button.tsx","../src/modal-context.ts","../src/drawer-drag-bar.tsx"],"sourcesContent":["import type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport type { MotionPanInfo } from \"@yamada-ui/motion\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type { DrawerProps } from \"./drawer\"\nimport { ui } from \"@yamada-ui/core\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { Slide } from \"@yamada-ui/transitions\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { cx, findChildren, getValidChildren, isArray } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport { DrawerCloseButton } from \"./drawer-close-button\"\nimport { DrawerDragBar } from \"./drawer-drag-bar\"\nimport { useDrawer, useModal } from \"./modal-context\"\n\nexport interface DrawerContentProps\n extends Merge<\n Omit<DrawerProps, \"isOpen\" | \"open\" | \"placement\" | keyof ThemeProps>,\n Required<\n Pick<\n DrawerProps,\n | \"dragConstraints\"\n | \"dragElastic\"\n | \"dragOffset\"\n | \"dragVelocity\"\n | \"placement\"\n | \"placement\"\n >\n >\n > {}\n\nexport const DrawerContent = motionForwardRef<DrawerContentProps, \"div\">(\n (\n {\n className,\n children,\n closeOnDrag,\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n placement: _placement,\n withCloseButton,\n withDragBar,\n blankForDragProps,\n ...rest\n },\n ref,\n ) => {\n let { describedbyId, duration, isOpen, labelledbyId, open, onClose } =\n useModal()\n\n open ??= isOpen\n\n const styles = useDrawer()\n const placement = useValue(_placement)\n\n const validChildren = getValidChildren(children)\n\n const [customDrawerCloseButton, ...cloneChildren] = findChildren(\n validChildren,\n DrawerCloseButton,\n )\n\n const blankForDragBg = useMemo(() => {\n const propBg =\n rest.backgroundColor ?? rest.bgColor ?? rest.background ?? rest.bg\n const styleBg =\n styles.container?.backgroundColor ??\n styles.container?.bgColor ??\n styles.container?.background ??\n styles.container?.bg\n const computedBg = propBg ?? styleBg\n\n return isArray(computedBg) ? computedBg : [computedBg]\n }, [rest, styles])\n\n const blankForDrag = useMemo<CSSUIObject>(() => {\n let position: CSSUIObject = {}\n\n switch (placement) {\n case \"top\":\n position = { left: 0, right: 0, top: \"calc(-100dvh + 1px)\" }\n break\n\n case \"bottom\":\n position = { bottom: \"calc(-100dvh + 1px)\", left: 0, right: 0 }\n break\n\n case \"left\":\n position = { bottom: 0, left: \"calc(-100% + 1px)\", top: 0 }\n break\n\n case \"right\":\n position = { bottom: 0, right: \"calc(-100% + 1px)\", top: 0 }\n break\n }\n\n const [lightBg, darkBg] = blankForDragBg\n\n return {\n _after: {\n bg: lightBg,\n content: '\"\"',\n display: \"block\",\n h: \"100dvh\",\n position: \"absolute\",\n w: \"100%\",\n ...position,\n ...blankForDragProps,\n },\n _dark: {\n _after: {\n bg: darkBg,\n },\n },\n }\n }, [placement, blankForDragBg, blankForDragProps])\n\n const css = useMemo<CSSUIObject>(\n () => ({\n display: \"flex\",\n flexDirection:\n placement === \"top\" || placement === \"bottom\" ? \"column\" : \"row\",\n outline: 0,\n ...(closeOnDrag ? blankForDrag : {}),\n ...styles.container,\n }),\n [blankForDrag, closeOnDrag, placement, styles],\n )\n\n const getDragDirectionRestriction = useCallback(\n (value: number) => {\n switch (placement) {\n case \"top\":\n return { bottom: value }\n case \"bottom\":\n return { top: value }\n case \"left\":\n return { right: value }\n case \"right\":\n return { left: value }\n }\n },\n [placement],\n )\n\n const getDragDirection = useCallback(() => {\n switch (placement) {\n case \"top\":\n case \"bottom\":\n return \"y\"\n case \"left\":\n case \"right\":\n return \"x\"\n }\n }, [placement])\n\n const isCloseByDragInfo = useCallback(\n (info: MotionPanInfo) => {\n switch (placement) {\n case \"top\":\n return (\n info.velocity.y <= dragVelocity * -1 ||\n info.offset.y <= dragOffset * -1\n )\n case \"bottom\":\n return (\n info.velocity.y >= dragVelocity || info.offset.y >= dragOffset\n )\n case \"left\":\n return (\n info.velocity.x <= dragVelocity * -1 ||\n info.offset.x <= dragOffset * -1\n )\n case \"right\":\n return (\n info.velocity.x >= dragVelocity || info.offset.x >= dragOffset\n )\n }\n },\n [placement, dragVelocity, dragOffset],\n )\n\n return (\n <Slide\n ref={ref}\n className={cx(\"ui-drawer\", className)}\n aria-describedby={describedbyId}\n aria-labelledby={labelledbyId}\n aria-modal=\"true\"\n drag={closeOnDrag ? getDragDirection() : false}\n dragConstraints={getDragDirectionRestriction(dragConstraints)}\n dragElastic={getDragDirectionRestriction(dragElastic)}\n dragMomentum={false}\n dragSnapToOrigin\n duration={duration}\n isOpen={open}\n placement={placement}\n role=\"dialog\"\n tabIndex={-1}\n onDragEnd={(_, info) => {\n if (isCloseByDragInfo(info)) onClose?.()\n }}\n __css={css}\n {...rest}\n >\n {customDrawerCloseButton ??\n (withCloseButton && onClose ? <DrawerCloseButton /> : null)}\n\n {withDragBar &&\n closeOnDrag &&\n (placement === \"bottom\" || placement === \"right\") ? (\n <DrawerDragBar />\n ) : null}\n\n <ui.div\n className=\"ui-drawer__inner\"\n __css={{\n display: \"flex\",\n flexDirection: \"column\",\n w: \"100%\",\n ...styles.inner,\n }}\n >\n {cloneChildren}\n </ui.div>\n\n {withDragBar &&\n closeOnDrag &&\n (placement === \"top\" || placement === \"left\") ? (\n <DrawerDragBar />\n ) : null}\n </Slide>\n )\n },\n)\n\nDrawerContent.displayName = \"DrawerContent\"\nDrawerContent.__ui__ = \"DrawerContent\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalCloseButtonProps } from \"./modal-close-button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { ModalCloseButton } from \"./modal-close-button\"\nimport { useDrawer } from \"./modal-context\"\n\nexport interface DrawerCloseButtonProps extends ModalCloseButtonProps {}\n\nexport const DrawerCloseButton = forwardRef<DrawerCloseButtonProps, \"button\">(\n ({ className, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.closeButton }\n\n return (\n <ModalCloseButton\n ref={ref}\n className={cx(\"ui-drawer__close-button\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerCloseButton.displayName = \"DrawerCloseButton\"\nDrawerCloseButton.__ui__ = \"DrawerCloseButton\"\n","import type { CloseButtonProps } from \"@yamada-ui/close-button\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport { CloseButton } from \"@yamada-ui/close-button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalCloseButtonProps extends CloseButtonProps {}\n\nexport const ModalCloseButton = forwardRef<ModalCloseButtonProps, \"button\">(\n ({ onClick, __css, ...rest }, ref) => {\n const { styles, onClose } = useModal()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n ...(__css ? __css : styles.closeButton),\n }\n\n return (\n <CloseButton\n ref={ref}\n className={cx(\"ui-modal__close-button\")}\n aria-label=\"Close modal\"\n onClick={handlerAll(onClick, (ev) => {\n ev.stopPropagation()\n onClose?.()\n })}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nModalCloseButton.displayName = \"ModalCloseButton\"\nModalCloseButton.__ui__ = \"ModalCloseButton\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n describedbyId: string\n labelledbyId: string\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDrawer } from \"./modal-context\"\n\nexport interface DrawerDragBarProps extends HTMLUIProps {}\n\nexport const DrawerDragBar = forwardRef<DrawerDragBarProps, \"div\">(\n ({ className, __css, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.dragBar }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-drawer__drag-bar\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerDragBar.displayName = \"DrawerDragBar\"\nDrawerDragBar.__ui__ = \"DrawerDragBar\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,IAAAA,eAAmB;AACnB,oBAAiC;AACjC,yBAAsB;AACtB,uBAAyB;AACzB,IAAAC,gBAA4D;AAC5D,mBAAqC;;;ACPrC,IAAAC,eAA2B;AAC3B,IAAAC,gBAAmB;;;ACDnB,0BAA4B;AAC5B,kBAA2B;AAC3B,IAAAC,gBAA+B;;;ACF/B,mBAA8B;AAQvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;ADZK;AAVC,IAAM,uBAAmB;AAAA,EAC9B,CAAC,E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pC,6CAAC,iBAAc,IACb;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,cAAc,cAAc;AAC5B,cAAc,SAAS;","names":["import_core","import_utils","import_core","import_utils","import_utils","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_jsx_runtime"]}
|
package/dist/drawer-content.mjs
CHANGED
package/dist/drawer.d.mts
CHANGED
@@ -41,6 +41,12 @@ interface DrawerOptions {
|
|
41
41
|
/**
|
42
42
|
* If `true` and drawer's placement is `top` or `bottom`, the drawer will occupy the viewport height (100dvh).
|
43
43
|
*/
|
44
|
+
fullHeight?: boolean;
|
45
|
+
/**
|
46
|
+
* If `true` and drawer's placement is `top` or `bottom`, the drawer will occupy the viewport height (100dvh).
|
47
|
+
*
|
48
|
+
* @deprecated Use `fullHeight` instead.
|
49
|
+
*/
|
44
50
|
isFullHeight?: boolean;
|
45
51
|
/**
|
46
52
|
* The placement of the drawer.
|
package/dist/drawer.d.ts
CHANGED
@@ -41,6 +41,12 @@ interface DrawerOptions {
|
|
41
41
|
/**
|
42
42
|
* If `true` and drawer's placement is `top` or `bottom`, the drawer will occupy the viewport height (100dvh).
|
43
43
|
*/
|
44
|
+
fullHeight?: boolean;
|
45
|
+
/**
|
46
|
+
* If `true` and drawer's placement is `top` or `bottom`, the drawer will occupy the viewport height (100dvh).
|
47
|
+
*
|
48
|
+
* @deprecated Use `fullHeight` instead.
|
49
|
+
*/
|
44
50
|
isFullHeight?: boolean;
|
45
51
|
/**
|
46
52
|
* The placement of the drawer.
|
package/dist/drawer.js
CHANGED
@@ -147,7 +147,8 @@ var DrawerContent = (0, import_motion.motionForwardRef)(
|
|
147
147
|
blankForDragProps,
|
148
148
|
...rest
|
149
149
|
}, ref) => {
|
150
|
-
|
150
|
+
let { describedbyId, duration, isOpen, labelledbyId, open, onClose } = useModal();
|
151
|
+
open != null ? open : open = isOpen;
|
151
152
|
const styles = useDrawer();
|
152
153
|
const placement = (0, import_use_value.useValue)(_placement);
|
153
154
|
const validChildren = (0, import_utils5.getValidChildren)(children);
|
@@ -261,7 +262,7 @@ var DrawerContent = (0, import_motion.motionForwardRef)(
|
|
261
262
|
dragMomentum: false,
|
262
263
|
dragSnapToOrigin: true,
|
263
264
|
duration,
|
264
|
-
isOpen,
|
265
|
+
isOpen: open,
|
265
266
|
placement,
|
266
267
|
role: "dialog",
|
267
268
|
tabIndex: -1,
|
@@ -515,7 +516,7 @@ var Modal = (0, import_motion6.motionForwardRef)(
|
|
515
516
|
size,
|
516
517
|
...props
|
517
518
|
});
|
518
|
-
|
519
|
+
let {
|
519
520
|
className,
|
520
521
|
allowPinchZoom = false,
|
521
522
|
animation = "scale",
|
@@ -529,6 +530,7 @@ var Modal = (0, import_motion6.motionForwardRef)(
|
|
529
530
|
initialFocusRef,
|
530
531
|
isOpen,
|
531
532
|
lockFocusAcrossFrames = true,
|
533
|
+
open,
|
532
534
|
outside = "fallback(4, 1rem)",
|
533
535
|
placement: _placement = "center",
|
534
536
|
restoreFocus,
|
@@ -543,6 +545,7 @@ var Modal = (0, import_motion6.motionForwardRef)(
|
|
543
545
|
onOverlayClick,
|
544
546
|
...rest
|
545
547
|
} = (0, import_core6.omitThemeProps)(mergedProps);
|
548
|
+
open != null ? open : open = isOpen;
|
546
549
|
const labelledbyId = (0, import_react2.useId)();
|
547
550
|
const describedbyId = (0, import_react2.useId)();
|
548
551
|
const onKeyDown = (0, import_react2.useCallback)(
|
@@ -587,13 +590,14 @@ var Modal = (0, import_motion6.motionForwardRef)(
|
|
587
590
|
duration,
|
588
591
|
isOpen,
|
589
592
|
labelledbyId,
|
593
|
+
open,
|
590
594
|
scrollBehavior,
|
591
595
|
styles,
|
592
596
|
withCloseButton,
|
593
597
|
onClose,
|
594
598
|
onOverlayClick
|
595
599
|
},
|
596
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_motion6.AnimatePresence, { onExitComplete: onCloseComplete, children:
|
600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_motion6.AnimatePresence, { onExitComplete: onCloseComplete, children: open ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_portal.Portal, { ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
597
601
|
import_focus_lock.FocusLock,
|
598
602
|
{
|
599
603
|
autoFocus,
|
@@ -639,7 +643,7 @@ var Drawer = (0, import_motion7.motionForwardRef)(
|
|
639
643
|
placement,
|
640
644
|
...props
|
641
645
|
});
|
642
|
-
|
646
|
+
let {
|
643
647
|
allowPinchZoom,
|
644
648
|
autoFocus,
|
645
649
|
blockScrollOnMount,
|
@@ -655,6 +659,7 @@ var Drawer = (0, import_motion7.motionForwardRef)(
|
|
655
659
|
initialFocusRef,
|
656
660
|
isOpen,
|
657
661
|
lockFocusAcrossFrames,
|
662
|
+
open,
|
658
663
|
restoreFocus,
|
659
664
|
withCloseButton = !closeOnDrag,
|
660
665
|
withDragBar = true,
|
@@ -668,6 +673,7 @@ var Drawer = (0, import_motion7.motionForwardRef)(
|
|
668
673
|
onOverlayClick,
|
669
674
|
...rest
|
670
675
|
} = (0, import_core7.omitThemeProps)(mergedProps, ["isFullHeight"]);
|
676
|
+
open != null ? open : open = isOpen;
|
671
677
|
const validChildren = (0, import_utils12.getValidChildren)(children);
|
672
678
|
const [customDrawerOverlay, ...cloneChildren] = (0, import_utils12.findChildren)(
|
673
679
|
validChildren,
|
@@ -688,6 +694,7 @@ var Drawer = (0, import_motion7.motionForwardRef)(
|
|
688
694
|
initialFocusRef,
|
689
695
|
isOpen,
|
690
696
|
lockFocusAcrossFrames,
|
697
|
+
open,
|
691
698
|
restoreFocus,
|
692
699
|
withCloseButton: false,
|
693
700
|
withOverlay: false,
|
package/dist/drawer.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/drawer.tsx","../src/drawer-content.tsx","../src/drawer-close-button.tsx","../src/modal-close-button.tsx","../src/modal-context.ts","../src/drawer-drag-bar.tsx","../src/drawer-overlay.tsx","../src/modal-overlay.tsx","../src/modal.tsx","../src/dialog-overlay.tsx","../src/modal-content.tsx","../src/dialog-close-button.tsx"],"sourcesContent":["import type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport type { SlideProps } from \"@yamada-ui/transitions\"\nimport type { ModalProps } from \"./modal\"\nimport { omitThemeProps, useComponentMultiStyle } from \"@yamada-ui/core\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { findChildren, getValidChildren } from \"@yamada-ui/utils\"\nimport { DrawerContent } from \"./drawer-content\"\nimport { DrawerOverlay } from \"./drawer-overlay\"\nimport { Modal } from \"./modal\"\nimport { DrawerProvider } from \"./modal-context\"\n\ninterface DrawerOptions {\n /**\n * If `true`, then the drawer will close on drag.\n *\n * @default false\n */\n closeOnDrag?: boolean\n /**\n * Applies constraints on the permitted draggable area.\n *\n * @default 0\n */\n dragConstraints?: number\n /**\n * The degree of movement allowed outside constraints. 0 = no movement, 1 = full movement.\n *\n * @default 0.1\n */\n dragElastic?: number\n /**\n * Offset from being dragged to closing.\n *\n * @default 80\n */\n dragOffset?: number\n /**\n * Velocity of the drag that triggers close.\n *\n * @default 100\n */\n dragVelocity?: number\n /**\n * If `true` and drawer's placement is `top` or `bottom`, the drawer will occupy the viewport height (100dvh).\n */\n isFullHeight?: boolean\n /**\n * The placement of the drawer.\n *\n * @default 'right'\n */\n placement?: SlideProps[\"placement\"]\n /**\n * If `true`, display the drag bar when `closeOnDrag` is `true`.\n *\n * @default true\n */\n withDragBar?: boolean\n /**\n * Props for the blank area when `closeOnDrag` is `true`.\n */\n blankForDragProps?: CSSUIObject\n}\n\nexport interface DrawerProps\n extends Omit<\n ModalProps,\n | \"animation\"\n | \"dragConstraints\"\n | \"dragElastic\"\n | \"outside\"\n | \"placement\"\n | \"scrollBehavior\"\n | keyof ThemeProps\n >,\n ThemeProps<\"Drawer\">,\n DrawerOptions {}\n\n/**\n * `Drawer` is a component for a panel that appears from the edge of the screen.\n *\n * @see Docs https://yamada-ui.com/components/overlay/drawer\n */\nexport const Drawer = motionForwardRef<DrawerProps, \"div\">(\n ({ size, closeOnDrag = false, placement = \"right\", ...props }, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Drawer\", {\n size,\n closeOnDrag,\n placement,\n ...props,\n })\n const {\n allowPinchZoom,\n autoFocus,\n blockScrollOnMount,\n children,\n closeOnEsc,\n closeOnOverlay,\n dragConstraints = 0,\n dragElastic = 0.1,\n dragOffset = 80,\n dragVelocity = 100,\n duration = { enter: 0.4, exit: 0.3 },\n finalFocusRef,\n initialFocusRef,\n isOpen,\n lockFocusAcrossFrames,\n restoreFocus,\n withCloseButton = !closeOnDrag,\n withDragBar = true,\n withOverlay = true,\n blankForDragProps,\n containerProps,\n portalProps,\n onClose,\n onCloseComplete,\n onEsc,\n onOverlayClick,\n ...rest\n } = omitThemeProps(mergedProps, [\"isFullHeight\"])\n\n const validChildren = getValidChildren(children)\n\n const [customDrawerOverlay, ...cloneChildren] = findChildren(\n validChildren,\n DrawerOverlay,\n )\n\n return (\n <DrawerProvider value={styles}>\n <Modal\n ref={ref}\n {...{\n allowPinchZoom,\n autoFocus,\n blockScrollOnMount,\n closeOnEsc,\n closeOnOverlay,\n duration,\n finalFocusRef,\n initialFocusRef,\n isOpen,\n lockFocusAcrossFrames,\n restoreFocus,\n withCloseButton: false,\n withOverlay: false,\n containerProps,\n portalProps,\n onClose,\n onCloseComplete,\n onEsc,\n onOverlayClick,\n }}\n >\n {customDrawerOverlay ?? (withOverlay ? <DrawerOverlay /> : null)}\n\n <DrawerContent\n {...{\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n withCloseButton,\n withDragBar,\n blankForDragProps,\n ...rest,\n closeOnDrag,\n placement,\n }}\n >\n {cloneChildren}\n </DrawerContent>\n </Modal>\n </DrawerProvider>\n )\n },\n)\n\nDrawer.displayName = \"Drawer\"\nDrawer.__ui__ = \"Drawer\"\n","import type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport type { MotionPanInfo } from \"@yamada-ui/motion\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type { DrawerProps } from \"./drawer\"\nimport { ui } from \"@yamada-ui/core\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { Slide } from \"@yamada-ui/transitions\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { cx, findChildren, getValidChildren, isArray } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport { DrawerCloseButton } from \"./drawer-close-button\"\nimport { DrawerDragBar } from \"./drawer-drag-bar\"\nimport { useDrawer, useModal } from \"./modal-context\"\n\nexport interface DrawerContentProps\n extends Merge<\n Omit<DrawerProps, \"isOpen\" | \"placement\" | keyof ThemeProps>,\n Required<\n Pick<\n DrawerProps,\n | \"dragConstraints\"\n | \"dragElastic\"\n | \"dragOffset\"\n | \"dragVelocity\"\n | \"placement\"\n | \"placement\"\n >\n >\n > {}\n\nexport const DrawerContent = motionForwardRef<DrawerContentProps, \"div\">(\n (\n {\n className,\n children,\n closeOnDrag,\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n placement: _placement,\n withCloseButton,\n withDragBar,\n blankForDragProps,\n ...rest\n },\n ref,\n ) => {\n const { describedbyId, duration, isOpen, labelledbyId, onClose } =\n useModal()\n const styles = useDrawer()\n const placement = useValue(_placement)\n\n const validChildren = getValidChildren(children)\n\n const [customDrawerCloseButton, ...cloneChildren] = findChildren(\n validChildren,\n DrawerCloseButton,\n )\n\n const blankForDragBg = useMemo(() => {\n const propBg =\n rest.backgroundColor ?? rest.bgColor ?? rest.background ?? rest.bg\n const styleBg =\n styles.container?.backgroundColor ??\n styles.container?.bgColor ??\n styles.container?.background ??\n styles.container?.bg\n const computedBg = propBg ?? styleBg\n\n return isArray(computedBg) ? computedBg : [computedBg]\n }, [rest, styles])\n\n const blankForDrag = useMemo<CSSUIObject>(() => {\n let position: CSSUIObject = {}\n\n switch (placement) {\n case \"top\":\n position = { left: 0, right: 0, top: \"calc(-100dvh + 1px)\" }\n break\n\n case \"bottom\":\n position = { bottom: \"calc(-100dvh + 1px)\", left: 0, right: 0 }\n break\n\n case \"left\":\n position = { bottom: 0, left: \"calc(-100% + 1px)\", top: 0 }\n break\n\n case \"right\":\n position = { bottom: 0, right: \"calc(-100% + 1px)\", top: 0 }\n break\n }\n\n const [lightBg, darkBg] = blankForDragBg\n\n return {\n _after: {\n bg: lightBg,\n content: '\"\"',\n display: \"block\",\n h: \"100dvh\",\n position: \"absolute\",\n w: \"100%\",\n ...position,\n ...blankForDragProps,\n },\n _dark: {\n _after: {\n bg: darkBg,\n },\n },\n }\n }, [placement, blankForDragBg, blankForDragProps])\n\n const css = useMemo<CSSUIObject>(\n () => ({\n display: \"flex\",\n flexDirection:\n placement === \"top\" || placement === \"bottom\" ? \"column\" : \"row\",\n outline: 0,\n ...(closeOnDrag ? blankForDrag : {}),\n ...styles.container,\n }),\n [blankForDrag, closeOnDrag, placement, styles],\n )\n\n const getDragDirectionRestriction = useCallback(\n (value: number) => {\n switch (placement) {\n case \"top\":\n return { bottom: value }\n case \"bottom\":\n return { top: value }\n case \"left\":\n return { right: value }\n case \"right\":\n return { left: value }\n }\n },\n [placement],\n )\n\n const getDragDirection = useCallback(() => {\n switch (placement) {\n case \"top\":\n case \"bottom\":\n return \"y\"\n case \"left\":\n case \"right\":\n return \"x\"\n }\n }, [placement])\n\n const isCloseByDragInfo = useCallback(\n (info: MotionPanInfo) => {\n switch (placement) {\n case \"top\":\n return (\n info.velocity.y <= dragVelocity * -1 ||\n info.offset.y <= dragOffset * -1\n )\n case \"bottom\":\n return (\n info.velocity.y >= dragVelocity || info.offset.y >= dragOffset\n )\n case \"left\":\n return (\n info.velocity.x <= dragVelocity * -1 ||\n info.offset.x <= dragOffset * -1\n )\n case \"right\":\n return (\n info.velocity.x >= dragVelocity || info.offset.x >= dragOffset\n )\n }\n },\n [placement, dragVelocity, dragOffset],\n )\n\n return (\n <Slide\n ref={ref}\n className={cx(\"ui-drawer\", className)}\n aria-describedby={describedbyId}\n aria-labelledby={labelledbyId}\n aria-modal=\"true\"\n drag={closeOnDrag ? getDragDirection() : false}\n dragConstraints={getDragDirectionRestriction(dragConstraints)}\n dragElastic={getDragDirectionRestriction(dragElastic)}\n dragMomentum={false}\n dragSnapToOrigin\n duration={duration}\n isOpen={isOpen}\n placement={placement}\n role=\"dialog\"\n tabIndex={-1}\n onDragEnd={(_, info) => {\n if (isCloseByDragInfo(info)) onClose?.()\n }}\n __css={css}\n {...rest}\n >\n {customDrawerCloseButton ??\n (withCloseButton && onClose ? <DrawerCloseButton /> : null)}\n\n {withDragBar &&\n closeOnDrag &&\n (placement === \"bottom\" || placement === \"right\") ? (\n <DrawerDragBar />\n ) : null}\n\n <ui.div\n className=\"ui-drawer__inner\"\n __css={{\n display: \"flex\",\n flexDirection: \"column\",\n w: \"100%\",\n ...styles.inner,\n }}\n >\n {cloneChildren}\n </ui.div>\n\n {withDragBar &&\n closeOnDrag &&\n (placement === \"top\" || placement === \"left\") ? (\n <DrawerDragBar />\n ) : null}\n </Slide>\n )\n },\n)\n\nDrawerContent.displayName = \"DrawerContent\"\nDrawerContent.__ui__ = \"DrawerContent\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalCloseButtonProps } from \"./modal-close-button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { ModalCloseButton } from \"./modal-close-button\"\nimport { useDrawer } from \"./modal-context\"\n\nexport interface DrawerCloseButtonProps extends ModalCloseButtonProps {}\n\nexport const DrawerCloseButton = forwardRef<DrawerCloseButtonProps, \"button\">(\n ({ className, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.closeButton }\n\n return (\n <ModalCloseButton\n ref={ref}\n className={cx(\"ui-drawer__close-button\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerCloseButton.displayName = \"DrawerCloseButton\"\nDrawerCloseButton.__ui__ = \"DrawerCloseButton\"\n","import type { CloseButtonProps } from \"@yamada-ui/close-button\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport { CloseButton } from \"@yamada-ui/close-button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalCloseButtonProps extends CloseButtonProps {}\n\nexport const ModalCloseButton = forwardRef<ModalCloseButtonProps, \"button\">(\n ({ onClick, __css, ...rest }, ref) => {\n const { styles, onClose } = useModal()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n ...(__css ? __css : styles.closeButton),\n }\n\n return (\n <CloseButton\n ref={ref}\n className={cx(\"ui-modal__close-button\")}\n aria-label=\"Close modal\"\n onClick={handlerAll(onClick, (ev) => {\n ev.stopPropagation()\n onClose?.()\n })}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nModalCloseButton.displayName = \"ModalCloseButton\"\nModalCloseButton.__ui__ = \"ModalCloseButton\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n describedbyId: string\n labelledbyId: string\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDrawer } from \"./modal-context\"\n\nexport interface DrawerDragBarProps extends HTMLUIProps {}\n\nexport const DrawerDragBar = forwardRef<DrawerDragBarProps, \"div\">(\n ({ className, __css, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.dragBar }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-drawer__drag-bar\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerDragBar.displayName = \"DrawerDragBar\"\nDrawerDragBar.__ui__ = \"DrawerDragBar\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOverlayProps } from \"./modal-overlay\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDrawer } from \"./modal-context\"\nimport { ModalOverlay } from \"./modal-overlay\"\n\nexport interface DrawerOverlayProps extends ModalOverlayProps {}\n\nexport const DrawerOverlay = motionForwardRef<DrawerOverlayProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.overlay }\n\n return (\n <ModalOverlay\n ref={ref}\n className={cx(\"ui-drawer__overlay\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerOverlay.displayName = \"DrawerOverlay\"\nDrawerOverlay.__ui__ = \"DrawerOverlay\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport { motion, motionForwardRef } from \"@yamada-ui/motion\"\nimport { fadeProps } from \"@yamada-ui/transitions\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalOverlayProps extends MotionProps {}\n\nexport const ModalOverlay = motionForwardRef<ModalOverlayProps, \"div\">(\n ({ className, onClick, __css, ...rest }, ref) => {\n const {\n animation,\n closeOnOverlay,\n duration,\n styles,\n onClose,\n onOverlayClick,\n } = useModal()\n\n const css: CSSUIObject = {\n h: \"100dvh\",\n left: 0,\n position: \"fixed\",\n top: 0,\n w: \"100vw\",\n ...(__css ? __css : styles.overlay),\n }\n\n const props = animation !== \"none\" ? fadeProps : {}\n\n return (\n <motion.div\n ref={ref}\n className={cx(\"ui-modal__overlay\", className)}\n aria-hidden\n custom={{ duration }}\n onClick={handlerAll(onClick, onOverlayClick, (ev) => {\n ev.stopPropagation()\n if (closeOnOverlay) onClose?.()\n })}\n __css={css}\n {...props}\n {...rest}\n />\n )\n },\n)\n\nModalOverlay.displayName = \"ModalOverlay\"\nModalOverlay.__ui__ = \"ModalOverlay\"\n","import type {\n CSSUIObject,\n CSSUIProps,\n HTMLUIProps,\n ThemeProps,\n Token,\n} from \"@yamada-ui/core\"\nimport type { FocusLockProps } from \"@yamada-ui/focus-lock\"\nimport type { MotionTransitionProps } from \"@yamada-ui/motion\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport type { KeyboardEvent } from \"react\"\nimport type { ModalContentProps } from \"./modal-content\"\nimport { omitThemeProps, ui, useComponentMultiStyle } from \"@yamada-ui/core\"\nimport { FocusLock } from \"@yamada-ui/focus-lock\"\nimport { AnimatePresence, motionForwardRef } from \"@yamada-ui/motion\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { findChild, findChildren, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement, useCallback, useId } from \"react\"\nimport { RemoveScroll } from \"react-remove-scroll\"\nimport { DialogOverlay } from \"./dialog-overlay\"\nimport { DrawerContent } from \"./drawer-content\"\nimport { DrawerOverlay } from \"./drawer-overlay\"\nimport { ModalContent } from \"./modal-content\"\nimport { ModalProvider } from \"./modal-context\"\nimport { ModalOverlay } from \"./modal-overlay\"\n\nexport interface ModalOptions\n extends Pick<\n FocusLockProps,\n | \"autoFocus\"\n | \"finalFocusRef\"\n | \"initialFocusRef\"\n | \"lockFocusAcrossFrames\"\n | \"restoreFocus\"\n > {\n /**\n * If `true`, the open will be opened.\n */\n isOpen: boolean\n /**\n * Handle zoom or pinch gestures on iOS devices when scroll locking is enabled.\n *\n * @default false.\n */\n allowPinchZoom?: boolean\n /**\n * The animation of the tooltip.\n *\n * @default 'scale'\n */\n animation?: \"bottom\" | \"left\" | \"none\" | \"right\" | \"scale\" | \"top\"\n /**\n * If `true`, scrolling will be disabled on the `body` when the modal opens.\n *\n * @default true\n */\n blockScrollOnMount?: boolean\n /**\n * If `true`, the modal will close when the `Esc` key is pressed.\n *\n * @default true\n */\n closeOnEsc?: boolean\n /**\n * If `true`, the modal will close when the overlay is clicked.\n *\n * @default true\n */\n closeOnOverlay?: boolean\n /**\n * The animation duration.\n */\n duration?: MotionTransitionProps[\"duration\"]\n /**\n * The CSS `padding` property.\n */\n outside?: CSSUIProps[\"p\"]\n /**\n * The placement of the modal.\n *\n * @default 'center'\n */\n placement?: Token<\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"center\"\n | \"left\"\n | \"right\"\n | \"top\"\n | \"top-left\"\n | \"top-right\"\n >\n /**\n * Where scroll behavior should originate.\n *\n * - `inside`: scroll only occurs within the `ModalBody`.\n * - `outside`: the entire `ModalContent` will scroll within the viewport.\n *\n * @default 'inside'\n */\n scrollBehavior?: \"inside\" | \"outside\"\n /**\n * If `true`, display the modal close button.\n *\n * @default true\n */\n withCloseButton?: boolean\n /**\n * If `true`, display the modal overlay.\n *\n * @default true\n */\n withOverlay?: boolean\n /**\n * Props for modal container element.\n */\n containerProps?: HTMLUIProps\n /**\n * Props to be forwarded to the portal component.\n */\n portalProps?: Omit<PortalProps, \"children\">\n /**\n * Callback invoked to close the modal.\n */\n onClose?: () => void\n /**\n * Callback function to run side effects after the modal has closed.\n */\n onCloseComplete?: () => void\n /**\n * Callback fired when the escape key is pressed and focus is within modal.\n */\n onEsc?(): void\n /**\n * Callback fired when the overlay is clicked.\n */\n onOverlayClick?: () => void\n}\n\nexport interface ModalProps\n extends ModalContentProps,\n ThemeProps<\"Modal\">,\n ModalOptions {}\n\n/**\n * `Modal` is a component that is displayed over the main content to focus the user's attention solely on the information.\n *\n * @see Docs https://yamada-ui.com/components/overlay/modal\n */\nexport const Modal = motionForwardRef<ModalProps, \"section\">(\n ({ size, ...props }, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Modal\", {\n size,\n ...props,\n })\n const {\n className,\n allowPinchZoom = false,\n animation = \"scale\",\n autoFocus,\n blockScrollOnMount = true,\n children,\n closeOnEsc = true,\n closeOnOverlay = true,\n duration,\n finalFocusRef,\n initialFocusRef,\n isOpen,\n lockFocusAcrossFrames = true,\n outside = \"fallback(4, 1rem)\",\n placement: _placement = \"center\",\n restoreFocus,\n scrollBehavior = \"inside\",\n withCloseButton = true,\n withOverlay = true,\n containerProps,\n portalProps,\n onClose,\n onCloseComplete,\n onEsc,\n onOverlayClick,\n ...rest\n } = omitThemeProps(mergedProps)\n const labelledbyId = useId()\n const describedbyId = useId()\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent) => {\n if (ev.key !== \"Escape\") return\n\n ev.stopPropagation()\n\n if (closeOnEsc) onClose?.()\n\n onEsc?.()\n },\n [closeOnEsc, onClose, onEsc],\n )\n\n const validChildren = getValidChildren(children)\n\n const [customModalOverlay, ...cloneChildren] = findChildren(\n validChildren,\n ModalOverlay,\n DialogOverlay,\n DrawerOverlay,\n )\n\n let drawerContent = findChild(validChildren, DrawerContent)\n\n if (drawerContent)\n drawerContent = cloneElement(drawerContent, { onKeyDown })\n\n const placement = useValue(_placement)\n\n const css: CSSUIObject = {\n alignItems: placement.includes(\"top\")\n ? \"flex-start\"\n : placement.includes(\"bottom\")\n ? \"flex-end\"\n : \"center\",\n display: \"flex\",\n h: \"100dvh\",\n justifyContent: placement.includes(\"left\")\n ? \"flex-start\"\n : placement.includes(\"right\")\n ? \"flex-end\"\n : \"center\",\n left: 0,\n p: size !== \"full\" ? outside : undefined,\n position: \"fixed\",\n top: 0,\n w: \"100vw\",\n zIndex: \"fallback(jeice, 110)\",\n }\n\n return (\n <ModalProvider\n value={{\n animation,\n closeOnOverlay,\n describedbyId,\n duration,\n isOpen,\n labelledbyId,\n scrollBehavior,\n styles,\n withCloseButton,\n onClose,\n onOverlayClick,\n }}\n >\n <AnimatePresence onExitComplete={onCloseComplete}>\n {isOpen ? (\n <Portal {...portalProps}>\n <FocusLock\n autoFocus={autoFocus}\n finalFocusRef={finalFocusRef}\n initialFocusRef={initialFocusRef}\n lockFocusAcrossFrames={lockFocusAcrossFrames}\n restoreFocus={restoreFocus}\n >\n <RemoveScroll\n allowPinchZoom={allowPinchZoom}\n enabled={blockScrollOnMount}\n forwardProps\n >\n <ui.div __css={css} {...containerProps}>\n {customModalOverlay ??\n (withOverlay && size !== \"full\" ? (\n <ModalOverlay />\n ) : null)}\n\n {drawerContent ?? (\n <ModalContent\n ref={ref}\n className={className}\n onKeyDown={onKeyDown}\n {...rest}\n >\n {cloneChildren}\n </ModalContent>\n )}\n </ui.div>\n </RemoveScroll>\n </FocusLock>\n </Portal>\n ) : null}\n </AnimatePresence>\n </ModalProvider>\n )\n },\n)\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOverlayProps } from \"./modal-overlay\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDialog } from \"./modal-context\"\nimport { ModalOverlay } from \"./modal-overlay\"\n\nexport interface DialogOverlayProps extends ModalOverlayProps {}\n\nexport const DialogOverlay = motionForwardRef<DialogOverlayProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.overlay }\n\n return (\n <ModalOverlay\n ref={ref}\n className={cx(\"ui-dialog__overlay\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDialogOverlay.displayName = \"DialogOverlay\"\nDialogOverlay.__ui__ = \"DialogOverlay\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { MotionProps, MotionTransitionProps } from \"@yamada-ui/motion\"\nimport type { PropsWithChildren } from \"react\"\nimport type { ModalProps } from \"./modal\"\nimport { motion, motionForwardRef } from \"@yamada-ui/motion\"\nimport { scaleFadeProps, slideFadeProps } from \"@yamada-ui/transitions\"\nimport { cx, findChildren, getValidChildren } from \"@yamada-ui/utils\"\nimport { DialogCloseButton } from \"./dialog-close-button\"\nimport { ModalCloseButton } from \"./modal-close-button\"\nimport { useModal } from \"./modal-context\"\n\nconst getModalContentProps = (\n animation: ModalProps[\"animation\"] = \"scale\",\n duration?: MotionTransitionProps[\"duration\"],\n) => {\n switch (animation) {\n case \"scale\":\n return {\n ...scaleFadeProps,\n custom: { duration, reverse: true, scale: 0.95 },\n }\n case \"top\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetY: -16, reverse: true },\n }\n case \"right\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetX: 16, reverse: true },\n }\n case \"left\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetX: -16, reverse: true },\n }\n case \"bottom\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetY: 16, reverse: true },\n }\n }\n}\n\nexport interface ModalContentProps\n extends Omit<\n MotionProps<\"section\">,\n \"animation\" | \"children\" | \"scrollBehavior\" | \"transition\"\n >,\n PropsWithChildren {}\n\nexport const ModalContent = motionForwardRef<ModalContentProps, \"section\">(\n ({ className, children, __css, ...rest }, ref) => {\n const {\n animation,\n describedbyId,\n duration,\n labelledbyId,\n scrollBehavior,\n styles,\n withCloseButton,\n onClose,\n } = useModal()\n\n const validChildren = getValidChildren(children)\n\n const [customModalCloseButton, ...cloneChildren] = findChildren(\n validChildren,\n ModalCloseButton,\n DialogCloseButton,\n )\n\n const props =\n animation !== \"none\" ? getModalContentProps(animation, duration) : {}\n\n const css: CSSUIObject = {\n display: \"flex\",\n flexDirection: \"column\",\n maxH: \"100%\",\n outline: 0,\n overflow: scrollBehavior === \"inside\" ? \"hidden\" : \"auto\",\n position: \"relative\",\n ...(__css ? __css : styles.container),\n }\n\n return (\n <motion.section\n ref={ref}\n className={cx(\"ui-modal\", className)}\n aria-describedby={describedbyId}\n aria-labelledby={labelledbyId}\n aria-modal=\"true\"\n role=\"dialog\"\n tabIndex={-1}\n __css={css}\n {...props}\n {...rest}\n >\n {customModalCloseButton ??\n (withCloseButton && onClose ? <ModalCloseButton /> : null)}\n\n {cloneChildren}\n </motion.section>\n )\n },\n)\n\nModalContent.displayName = \"ModalContent\"\nModalContent.__ui__ = \"ModalContent\"\n","import type { CloseButtonProps } from \"@yamada-ui/close-button\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { ModalCloseButton } from \"./modal-close-button\"\nimport { useDialog } from \"./modal-context\"\n\nexport interface DialogCloseButtonProps extends CloseButtonProps {}\n\nexport const DialogCloseButton = forwardRef<DialogCloseButtonProps, \"button\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.closeButton }\n\n return (\n <ModalCloseButton\n ref={ref}\n className={cx(\"ui-dialog__close-button\", className)}\n aria-label=\"Close dialog\"\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDialogCloseButton.displayName = \"DialogCloseButton\"\nDialogCloseButton.__ui__ = \"DialogCloseButton\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,IAAAA,eAAuD;AACvD,IAAAC,iBAAiC;AACjC,IAAAC,iBAA+C;;;ACD/C,IAAAC,eAAmB;AACnB,oBAAiC;AACjC,yBAAsB;AACtB,uBAAyB;AACzB,IAAAC,gBAA4D;AAC5D,mBAAqC;;;ACPrC,IAAAC,eAA2B;AAC3B,IAAAC,gBAAmB;;;ACDnB,0BAA4B;AAC5B,kBAA2B;AAC3B,IAAAC,gBAA+B;;;ACF/B,mBAA8B;AAQvB,I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WACE,8CAAC,kBAAe,OAAO,QACrB;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACC,GAAG;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,iBAAiB;AAAA,UACjB,aAAa;AAAA,UACb;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QAEC;AAAA,8DAAwB,cAAc,8CAAC,iBAAc,IAAK;AAAA,UAE3D;AAAA,YAAC;AAAA;AAAA,cACE,GAAG;AAAA,gBACF;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,GAAG;AAAA,gBACH;AAAA,gBACA;AAAA,cACF;AAAA,cAEC;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;AACrB,OAAO,SAAS;","names":["import_core","import_motion","import_utils","import_core","import_utils","import_core","import_utils","import_utils","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_jsx_runtime","import_motion","import_utils","import_motion","import_transitions","import_utils","import_jsx_runtime","import_jsx_runtime","import_core","import_motion","import_use_value","import_utils","import_react","import_motion","import_utils","import_jsx_runtime","import_motion","import_transitions","import_utils","import_core","import_utils","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
1
|
+
{"version":3,"sources":["../src/drawer.tsx","../src/drawer-content.tsx","../src/drawer-close-button.tsx","../src/modal-close-button.tsx","../src/modal-context.ts","../src/drawer-drag-bar.tsx","../src/drawer-overlay.tsx","../src/modal-overlay.tsx","../src/modal.tsx","../src/dialog-overlay.tsx","../src/modal-content.tsx","../src/dialog-close-button.tsx"],"sourcesContent":["import type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport type { SlideProps } from \"@yamada-ui/transitions\"\nimport type { ModalProps } from \"./modal\"\nimport { omitThemeProps, useComponentMultiStyle } from \"@yamada-ui/core\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { findChildren, getValidChildren } from \"@yamada-ui/utils\"\nimport { DrawerContent } from \"./drawer-content\"\nimport { DrawerOverlay } from \"./drawer-overlay\"\nimport { Modal } from \"./modal\"\nimport { DrawerProvider } from \"./modal-context\"\n\ninterface DrawerOptions {\n /**\n * If `true`, then the drawer will close on drag.\n *\n * @default false\n */\n closeOnDrag?: boolean\n /**\n * Applies constraints on the permitted draggable area.\n *\n * @default 0\n */\n dragConstraints?: number\n /**\n * The degree of movement allowed outside constraints. 0 = no movement, 1 = full movement.\n *\n * @default 0.1\n */\n dragElastic?: number\n /**\n * Offset from being dragged to closing.\n *\n * @default 80\n */\n dragOffset?: number\n /**\n * Velocity of the drag that triggers close.\n *\n * @default 100\n */\n dragVelocity?: number\n /**\n * If `true` and drawer's placement is `top` or `bottom`, the drawer will occupy the viewport height (100dvh).\n */\n fullHeight?: boolean\n /**\n * If `true` and drawer's placement is `top` or `bottom`, the drawer will occupy the viewport height (100dvh).\n *\n * @deprecated Use `fullHeight` instead.\n */\n isFullHeight?: boolean\n /**\n * The placement of the drawer.\n *\n * @default 'right'\n */\n placement?: SlideProps[\"placement\"]\n /**\n * If `true`, display the drag bar when `closeOnDrag` is `true`.\n *\n * @default true\n */\n withDragBar?: boolean\n /**\n * Props for the blank area when `closeOnDrag` is `true`.\n */\n blankForDragProps?: CSSUIObject\n}\n\nexport interface DrawerProps\n extends Omit<\n ModalProps,\n | \"animation\"\n | \"dragConstraints\"\n | \"dragElastic\"\n | \"outside\"\n | \"placement\"\n | \"scrollBehavior\"\n | keyof ThemeProps\n >,\n ThemeProps<\"Drawer\">,\n DrawerOptions {}\n\n/**\n * `Drawer` is a component for a panel that appears from the edge of the screen.\n *\n * @see Docs https://yamada-ui.com/components/overlay/drawer\n */\nexport const Drawer = motionForwardRef<DrawerProps, \"div\">(\n ({ size, closeOnDrag = false, placement = \"right\", ...props }, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Drawer\", {\n size,\n closeOnDrag,\n placement,\n ...props,\n })\n let {\n allowPinchZoom,\n autoFocus,\n blockScrollOnMount,\n children,\n closeOnEsc,\n closeOnOverlay,\n dragConstraints = 0,\n dragElastic = 0.1,\n dragOffset = 80,\n dragVelocity = 100,\n duration = { enter: 0.4, exit: 0.3 },\n finalFocusRef,\n initialFocusRef,\n isOpen,\n lockFocusAcrossFrames,\n open,\n restoreFocus,\n withCloseButton = !closeOnDrag,\n withDragBar = true,\n withOverlay = true,\n blankForDragProps,\n containerProps,\n portalProps,\n onClose,\n onCloseComplete,\n onEsc,\n onOverlayClick,\n ...rest\n } = omitThemeProps(mergedProps, [\"isFullHeight\"])\n\n open ??= isOpen\n\n const validChildren = getValidChildren(children)\n\n const [customDrawerOverlay, ...cloneChildren] = findChildren(\n validChildren,\n DrawerOverlay,\n )\n\n return (\n <DrawerProvider value={styles}>\n <Modal\n ref={ref}\n {...{\n allowPinchZoom,\n autoFocus,\n blockScrollOnMount,\n closeOnEsc,\n closeOnOverlay,\n duration,\n finalFocusRef,\n initialFocusRef,\n isOpen,\n lockFocusAcrossFrames,\n open,\n restoreFocus,\n withCloseButton: false,\n withOverlay: false,\n containerProps,\n portalProps,\n onClose,\n onCloseComplete,\n onEsc,\n onOverlayClick,\n }}\n >\n {customDrawerOverlay ?? (withOverlay ? <DrawerOverlay /> : null)}\n\n <DrawerContent\n {...{\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n withCloseButton,\n withDragBar,\n blankForDragProps,\n ...rest,\n closeOnDrag,\n placement,\n }}\n >\n {cloneChildren}\n </DrawerContent>\n </Modal>\n </DrawerProvider>\n )\n },\n)\n\nDrawer.displayName = \"Drawer\"\nDrawer.__ui__ = \"Drawer\"\n","import type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport type { MotionPanInfo } from \"@yamada-ui/motion\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type { DrawerProps } from \"./drawer\"\nimport { ui } from \"@yamada-ui/core\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { Slide } from \"@yamada-ui/transitions\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { cx, findChildren, getValidChildren, isArray } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport { DrawerCloseButton } from \"./drawer-close-button\"\nimport { DrawerDragBar } from \"./drawer-drag-bar\"\nimport { useDrawer, useModal } from \"./modal-context\"\n\nexport interface DrawerContentProps\n extends Merge<\n Omit<DrawerProps, \"isOpen\" | \"open\" | \"placement\" | keyof ThemeProps>,\n Required<\n Pick<\n DrawerProps,\n | \"dragConstraints\"\n | \"dragElastic\"\n | \"dragOffset\"\n | \"dragVelocity\"\n | \"placement\"\n | \"placement\"\n >\n >\n > {}\n\nexport const DrawerContent = motionForwardRef<DrawerContentProps, \"div\">(\n (\n {\n className,\n children,\n closeOnDrag,\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n placement: _placement,\n withCloseButton,\n withDragBar,\n blankForDragProps,\n ...rest\n },\n ref,\n ) => {\n let { describedbyId, duration, isOpen, labelledbyId, open, onClose } =\n useModal()\n\n open ??= isOpen\n\n const styles = useDrawer()\n const placement = useValue(_placement)\n\n const validChildren = getValidChildren(children)\n\n const [customDrawerCloseButton, ...cloneChildren] = findChildren(\n validChildren,\n DrawerCloseButton,\n )\n\n const blankForDragBg = useMemo(() => {\n const propBg =\n rest.backgroundColor ?? rest.bgColor ?? rest.background ?? rest.bg\n const styleBg =\n styles.container?.backgroundColor ??\n styles.container?.bgColor ??\n styles.container?.background ??\n styles.container?.bg\n const computedBg = propBg ?? styleBg\n\n return isArray(computedBg) ? computedBg : [computedBg]\n }, [rest, styles])\n\n const blankForDrag = useMemo<CSSUIObject>(() => {\n let position: CSSUIObject = {}\n\n switch (placement) {\n case \"top\":\n position = { left: 0, right: 0, top: \"calc(-100dvh + 1px)\" }\n break\n\n case \"bottom\":\n position = { bottom: \"calc(-100dvh + 1px)\", left: 0, right: 0 }\n break\n\n case \"left\":\n position = { bottom: 0, left: \"calc(-100% + 1px)\", top: 0 }\n break\n\n case \"right\":\n position = { bottom: 0, right: \"calc(-100% + 1px)\", top: 0 }\n break\n }\n\n const [lightBg, darkBg] = blankForDragBg\n\n return {\n _after: {\n bg: lightBg,\n content: '\"\"',\n display: \"block\",\n h: \"100dvh\",\n position: \"absolute\",\n w: \"100%\",\n ...position,\n ...blankForDragProps,\n },\n _dark: {\n _after: {\n bg: darkBg,\n },\n },\n }\n }, [placement, blankForDragBg, blankForDragProps])\n\n const css = useMemo<CSSUIObject>(\n () => ({\n display: \"flex\",\n flexDirection:\n placement === \"top\" || placement === \"bottom\" ? \"column\" : \"row\",\n outline: 0,\n ...(closeOnDrag ? blankForDrag : {}),\n ...styles.container,\n }),\n [blankForDrag, closeOnDrag, placement, styles],\n )\n\n const getDragDirectionRestriction = useCallback(\n (value: number) => {\n switch (placement) {\n case \"top\":\n return { bottom: value }\n case \"bottom\":\n return { top: value }\n case \"left\":\n return { right: value }\n case \"right\":\n return { left: value }\n }\n },\n [placement],\n )\n\n const getDragDirection = useCallback(() => {\n switch (placement) {\n case \"top\":\n case \"bottom\":\n return \"y\"\n case \"left\":\n case \"right\":\n return \"x\"\n }\n }, [placement])\n\n const isCloseByDragInfo = useCallback(\n (info: MotionPanInfo) => {\n switch (placement) {\n case \"top\":\n return (\n info.velocity.y <= dragVelocity * -1 ||\n info.offset.y <= dragOffset * -1\n )\n case \"bottom\":\n return (\n info.velocity.y >= dragVelocity || info.offset.y >= dragOffset\n )\n case \"left\":\n return (\n info.velocity.x <= dragVelocity * -1 ||\n info.offset.x <= dragOffset * -1\n )\n case \"right\":\n return (\n info.velocity.x >= dragVelocity || info.offset.x >= dragOffset\n )\n }\n },\n [placement, dragVelocity, dragOffset],\n )\n\n return (\n <Slide\n ref={ref}\n className={cx(\"ui-drawer\", className)}\n aria-describedby={describedbyId}\n aria-labelledby={labelledbyId}\n aria-modal=\"true\"\n drag={closeOnDrag ? getDragDirection() : false}\n dragConstraints={getDragDirectionRestriction(dragConstraints)}\n dragElastic={getDragDirectionRestriction(dragElastic)}\n dragMomentum={false}\n dragSnapToOrigin\n duration={duration}\n isOpen={open}\n placement={placement}\n role=\"dialog\"\n tabIndex={-1}\n onDragEnd={(_, info) => {\n if (isCloseByDragInfo(info)) onClose?.()\n }}\n __css={css}\n {...rest}\n >\n {customDrawerCloseButton ??\n (withCloseButton && onClose ? <DrawerCloseButton /> : null)}\n\n {withDragBar &&\n closeOnDrag &&\n (placement === \"bottom\" || placement === \"right\") ? (\n <DrawerDragBar />\n ) : null}\n\n <ui.div\n className=\"ui-drawer__inner\"\n __css={{\n display: \"flex\",\n flexDirection: \"column\",\n w: \"100%\",\n ...styles.inner,\n }}\n >\n {cloneChildren}\n </ui.div>\n\n {withDragBar &&\n closeOnDrag &&\n (placement === \"top\" || placement === \"left\") ? (\n <DrawerDragBar />\n ) : null}\n </Slide>\n )\n },\n)\n\nDrawerContent.displayName = \"DrawerContent\"\nDrawerContent.__ui__ = \"DrawerContent\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalCloseButtonProps } from \"./modal-close-button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { ModalCloseButton } from \"./modal-close-button\"\nimport { useDrawer } from \"./modal-context\"\n\nexport interface DrawerCloseButtonProps extends ModalCloseButtonProps {}\n\nexport const DrawerCloseButton = forwardRef<DrawerCloseButtonProps, \"button\">(\n ({ className, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.closeButton }\n\n return (\n <ModalCloseButton\n ref={ref}\n className={cx(\"ui-drawer__close-button\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerCloseButton.displayName = \"DrawerCloseButton\"\nDrawerCloseButton.__ui__ = \"DrawerCloseButton\"\n","import type { CloseButtonProps } from \"@yamada-ui/close-button\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport { CloseButton } from \"@yamada-ui/close-button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalCloseButtonProps extends CloseButtonProps {}\n\nexport const ModalCloseButton = forwardRef<ModalCloseButtonProps, \"button\">(\n ({ onClick, __css, ...rest }, ref) => {\n const { styles, onClose } = useModal()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n ...(__css ? __css : styles.closeButton),\n }\n\n return (\n <CloseButton\n ref={ref}\n className={cx(\"ui-modal__close-button\")}\n aria-label=\"Close modal\"\n onClick={handlerAll(onClick, (ev) => {\n ev.stopPropagation()\n onClose?.()\n })}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nModalCloseButton.displayName = \"ModalCloseButton\"\nModalCloseButton.__ui__ = \"ModalCloseButton\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n describedbyId: string\n labelledbyId: string\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDrawer } from \"./modal-context\"\n\nexport interface DrawerDragBarProps extends HTMLUIProps {}\n\nexport const DrawerDragBar = forwardRef<DrawerDragBarProps, \"div\">(\n ({ className, __css, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.dragBar }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-drawer__drag-bar\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerDragBar.displayName = \"DrawerDragBar\"\nDrawerDragBar.__ui__ = \"DrawerDragBar\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOverlayProps } from \"./modal-overlay\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDrawer } from \"./modal-context\"\nimport { ModalOverlay } from \"./modal-overlay\"\n\nexport interface DrawerOverlayProps extends ModalOverlayProps {}\n\nexport const DrawerOverlay = motionForwardRef<DrawerOverlayProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.overlay }\n\n return (\n <ModalOverlay\n ref={ref}\n className={cx(\"ui-drawer__overlay\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerOverlay.displayName = \"DrawerOverlay\"\nDrawerOverlay.__ui__ = \"DrawerOverlay\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport { motion, motionForwardRef } from \"@yamada-ui/motion\"\nimport { fadeProps } from \"@yamada-ui/transitions\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalOverlayProps extends MotionProps {}\n\nexport const ModalOverlay = motionForwardRef<ModalOverlayProps, \"div\">(\n ({ className, onClick, __css, ...rest }, ref) => {\n const {\n animation,\n closeOnOverlay,\n duration,\n styles,\n onClose,\n onOverlayClick,\n } = useModal()\n\n const css: CSSUIObject = {\n h: \"100dvh\",\n left: 0,\n position: \"fixed\",\n top: 0,\n w: \"100vw\",\n ...(__css ? __css : styles.overlay),\n }\n\n const props = animation !== \"none\" ? fadeProps : {}\n\n return (\n <motion.div\n ref={ref}\n className={cx(\"ui-modal__overlay\", className)}\n aria-hidden\n custom={{ duration }}\n onClick={handlerAll(onClick, onOverlayClick, (ev) => {\n ev.stopPropagation()\n if (closeOnOverlay) onClose?.()\n })}\n __css={css}\n {...props}\n {...rest}\n />\n )\n },\n)\n\nModalOverlay.displayName = \"ModalOverlay\"\nModalOverlay.__ui__ = \"ModalOverlay\"\n","import type {\n CSSUIObject,\n CSSUIProps,\n HTMLUIProps,\n ThemeProps,\n Token,\n} from \"@yamada-ui/core\"\nimport type { FocusLockProps } from \"@yamada-ui/focus-lock\"\nimport type { MotionTransitionProps } from \"@yamada-ui/motion\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport type { KeyboardEvent } from \"react\"\nimport type { ModalContentProps } from \"./modal-content\"\nimport { omitThemeProps, ui, useComponentMultiStyle } from \"@yamada-ui/core\"\nimport { FocusLock } from \"@yamada-ui/focus-lock\"\nimport { AnimatePresence, motionForwardRef } from \"@yamada-ui/motion\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { findChild, findChildren, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement, useCallback, useId } from \"react\"\nimport { RemoveScroll } from \"react-remove-scroll\"\nimport { DialogOverlay } from \"./dialog-overlay\"\nimport { DrawerContent } from \"./drawer-content\"\nimport { DrawerOverlay } from \"./drawer-overlay\"\nimport { ModalContent } from \"./modal-content\"\nimport { ModalProvider } from \"./modal-context\"\nimport { ModalOverlay } from \"./modal-overlay\"\n\nexport interface ModalOptions\n extends Pick<\n FocusLockProps,\n | \"autoFocus\"\n | \"finalFocusRef\"\n | \"initialFocusRef\"\n | \"lockFocusAcrossFrames\"\n | \"restoreFocus\"\n > {\n /**\n * Handle zoom or pinch gestures on iOS devices when scroll locking is enabled.\n *\n * @default false.\n */\n allowPinchZoom?: boolean\n /**\n * The animation of the tooltip.\n *\n * @default 'scale'\n */\n animation?: \"bottom\" | \"left\" | \"none\" | \"right\" | \"scale\" | \"top\"\n /**\n * If `true`, scrolling will be disabled on the `body` when the modal opens.\n *\n * @default true\n */\n blockScrollOnMount?: boolean\n /**\n * If `true`, the modal will close when the `Esc` key is pressed.\n *\n * @default true\n */\n closeOnEsc?: boolean\n /**\n * If `true`, the modal will close when the overlay is clicked.\n *\n * @default true\n */\n closeOnOverlay?: boolean\n /**\n * The animation duration.\n */\n duration?: MotionTransitionProps[\"duration\"]\n /**\n * If `true`, the open will be opened.\n *\n * @deprecated Use `open` instead.\n */\n isOpen?: boolean\n /**\n * If `true`, the open will be opened.\n */\n open?: boolean\n /**\n * The CSS `padding` property.\n */\n outside?: CSSUIProps[\"p\"]\n /**\n * The placement of the modal.\n *\n * @default 'center'\n */\n placement?: Token<\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"center\"\n | \"left\"\n | \"right\"\n | \"top\"\n | \"top-left\"\n | \"top-right\"\n >\n /**\n * Where scroll behavior should originate.\n *\n * - `inside`: scroll only occurs within the `ModalBody`.\n * - `outside`: the entire `ModalContent` will scroll within the viewport.\n *\n * @default 'inside'\n */\n scrollBehavior?: \"inside\" | \"outside\"\n /**\n * If `true`, display the modal close button.\n *\n * @default true\n */\n withCloseButton?: boolean\n /**\n * If `true`, display the modal overlay.\n *\n * @default true\n */\n withOverlay?: boolean\n /**\n * Props for modal container element.\n */\n containerProps?: HTMLUIProps\n /**\n * Props to be forwarded to the portal component.\n */\n portalProps?: Omit<PortalProps, \"children\">\n /**\n * Callback invoked to close the modal.\n */\n onClose?: () => void\n /**\n * Callback function to run side effects after the modal has closed.\n */\n onCloseComplete?: () => void\n /**\n * Callback fired when the escape key is pressed and focus is within modal.\n */\n onEsc?(): void\n /**\n * Callback fired when the overlay is clicked.\n */\n onOverlayClick?: () => void\n}\n\nexport interface ModalProps\n extends ModalContentProps,\n ThemeProps<\"Modal\">,\n ModalOptions {}\n\n/**\n * `Modal` is a component that is displayed over the main content to focus the user's attention solely on the information.\n *\n * @see Docs https://yamada-ui.com/components/overlay/modal\n */\nexport const Modal = motionForwardRef<ModalProps, \"section\">(\n ({ size, ...props }, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Modal\", {\n size,\n ...props,\n })\n let {\n className,\n allowPinchZoom = false,\n animation = \"scale\",\n autoFocus,\n blockScrollOnMount = true,\n children,\n closeOnEsc = true,\n closeOnOverlay = true,\n duration,\n finalFocusRef,\n initialFocusRef,\n isOpen,\n lockFocusAcrossFrames = true,\n open,\n outside = \"fallback(4, 1rem)\",\n placement: _placement = \"center\",\n restoreFocus,\n scrollBehavior = \"inside\",\n withCloseButton = true,\n withOverlay = true,\n containerProps,\n portalProps,\n onClose,\n onCloseComplete,\n onEsc,\n onOverlayClick,\n ...rest\n } = omitThemeProps(mergedProps)\n\n open ??= isOpen\n\n const labelledbyId = useId()\n const describedbyId = useId()\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent) => {\n if (ev.key !== \"Escape\") return\n\n ev.stopPropagation()\n\n if (closeOnEsc) onClose?.()\n\n onEsc?.()\n },\n [closeOnEsc, onClose, onEsc],\n )\n\n const validChildren = getValidChildren(children)\n\n const [customModalOverlay, ...cloneChildren] = findChildren(\n validChildren,\n ModalOverlay,\n DialogOverlay,\n DrawerOverlay,\n )\n\n let drawerContent = findChild(validChildren, DrawerContent)\n\n if (drawerContent)\n drawerContent = cloneElement(drawerContent, { onKeyDown })\n\n const placement = useValue(_placement)\n\n const css: CSSUIObject = {\n alignItems: placement.includes(\"top\")\n ? \"flex-start\"\n : placement.includes(\"bottom\")\n ? \"flex-end\"\n : \"center\",\n display: \"flex\",\n h: \"100dvh\",\n justifyContent: placement.includes(\"left\")\n ? \"flex-start\"\n : placement.includes(\"right\")\n ? \"flex-end\"\n : \"center\",\n left: 0,\n p: size !== \"full\" ? outside : undefined,\n position: \"fixed\",\n top: 0,\n w: \"100vw\",\n zIndex: \"fallback(jeice, 110)\",\n }\n\n return (\n <ModalProvider\n value={{\n animation,\n closeOnOverlay,\n describedbyId,\n duration,\n isOpen,\n labelledbyId,\n open,\n scrollBehavior,\n styles,\n withCloseButton,\n onClose,\n onOverlayClick,\n }}\n >\n <AnimatePresence onExitComplete={onCloseComplete}>\n {open ? (\n <Portal {...portalProps}>\n <FocusLock\n autoFocus={autoFocus}\n finalFocusRef={finalFocusRef}\n initialFocusRef={initialFocusRef}\n lockFocusAcrossFrames={lockFocusAcrossFrames}\n restoreFocus={restoreFocus}\n >\n <RemoveScroll\n allowPinchZoom={allowPinchZoom}\n enabled={blockScrollOnMount}\n forwardProps\n >\n <ui.div __css={css} {...containerProps}>\n {customModalOverlay ??\n (withOverlay && size !== \"full\" ? (\n <ModalOverlay />\n ) : null)}\n\n {drawerContent ?? (\n <ModalContent\n ref={ref}\n className={className}\n onKeyDown={onKeyDown}\n {...rest}\n >\n {cloneChildren}\n </ModalContent>\n )}\n </ui.div>\n </RemoveScroll>\n </FocusLock>\n </Portal>\n ) : null}\n </AnimatePresence>\n </ModalProvider>\n )\n },\n)\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOverlayProps } from \"./modal-overlay\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDialog } from \"./modal-context\"\nimport { ModalOverlay } from \"./modal-overlay\"\n\nexport interface DialogOverlayProps extends ModalOverlayProps {}\n\nexport const DialogOverlay = motionForwardRef<DialogOverlayProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.overlay }\n\n return (\n <ModalOverlay\n ref={ref}\n className={cx(\"ui-dialog__overlay\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDialogOverlay.displayName = \"DialogOverlay\"\nDialogOverlay.__ui__ = \"DialogOverlay\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { MotionProps, MotionTransitionProps } from \"@yamada-ui/motion\"\nimport type { PropsWithChildren } from \"react\"\nimport type { ModalProps } from \"./modal\"\nimport { motion, motionForwardRef } from \"@yamada-ui/motion\"\nimport { scaleFadeProps, slideFadeProps } from \"@yamada-ui/transitions\"\nimport { cx, findChildren, getValidChildren } from \"@yamada-ui/utils\"\nimport { DialogCloseButton } from \"./dialog-close-button\"\nimport { ModalCloseButton } from \"./modal-close-button\"\nimport { useModal } from \"./modal-context\"\n\nconst getModalContentProps = (\n animation: ModalProps[\"animation\"] = \"scale\",\n duration?: MotionTransitionProps[\"duration\"],\n) => {\n switch (animation) {\n case \"scale\":\n return {\n ...scaleFadeProps,\n custom: { duration, reverse: true, scale: 0.95 },\n }\n case \"top\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetY: -16, reverse: true },\n }\n case \"right\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetX: 16, reverse: true },\n }\n case \"left\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetX: -16, reverse: true },\n }\n case \"bottom\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetY: 16, reverse: true },\n }\n }\n}\n\nexport interface ModalContentProps\n extends Omit<\n MotionProps<\"section\">,\n \"animation\" | \"children\" | \"scrollBehavior\" | \"transition\"\n >,\n PropsWithChildren {}\n\nexport const ModalContent = motionForwardRef<ModalContentProps, \"section\">(\n ({ className, children, __css, ...rest }, ref) => {\n const {\n animation,\n describedbyId,\n duration,\n labelledbyId,\n scrollBehavior,\n styles,\n withCloseButton,\n onClose,\n } = useModal()\n\n const validChildren = getValidChildren(children)\n\n const [customModalCloseButton, ...cloneChildren] = findChildren(\n validChildren,\n ModalCloseButton,\n DialogCloseButton,\n )\n\n const props =\n animation !== \"none\" ? getModalContentProps(animation, duration) : {}\n\n const css: CSSUIObject = {\n display: \"flex\",\n flexDirection: \"column\",\n maxH: \"100%\",\n outline: 0,\n overflow: scrollBehavior === \"inside\" ? \"hidden\" : \"auto\",\n position: \"relative\",\n ...(__css ? __css : styles.container),\n }\n\n return (\n <motion.section\n ref={ref}\n className={cx(\"ui-modal\", className)}\n aria-describedby={describedbyId}\n aria-labelledby={labelledbyId}\n aria-modal=\"true\"\n role=\"dialog\"\n tabIndex={-1}\n __css={css}\n {...props}\n {...rest}\n >\n {customModalCloseButton ??\n (withCloseButton && onClose ? <ModalCloseButton /> : null)}\n\n {cloneChildren}\n </motion.section>\n )\n },\n)\n\nModalContent.displayName = \"ModalContent\"\nModalContent.__ui__ = \"ModalContent\"\n","import type { CloseButtonProps } from \"@yamada-ui/close-button\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { ModalCloseButton } from \"./modal-close-button\"\nimport { useDialog } from \"./modal-context\"\n\nexport interface DialogCloseButtonProps extends CloseButtonProps {}\n\nexport const DialogCloseButton = forwardRef<DialogCloseButtonProps, \"button\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.closeButton }\n\n return (\n <ModalCloseButton\n ref={ref}\n className={cx(\"ui-dialog__close-button\", className)}\n aria-label=\"Close dialog\"\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDialogCloseButton.displayName = \"DialogCloseButton\"\nDialogCloseButton.__ui__ = \"DialogCloseButton\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,IAAAA,eAAuD;AACvD,IAAAC,iBAAiC;AACjC,IAAAC,iBAA+C;;;ACD/C,IAAAC,eAAmB;AACnB,oBAAiC;AACjC,yBAAsB;AACtB,uBAAyB;AACzB,IAAAC,gBAA4D;AAC5D,mBAAqC;;;ACPrC,IAAAC,eAA2B;AAC3B,IAAAC,gBAAmB;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e,aAAa,CAAC,cAAc,CAAC;AAEhD,iCAAS;AAET,UAAM,oBAAgB,iCAAiB,QAAQ;AAE/C,UAAM,CAAC,qBAAqB,GAAG,aAAa,QAAI;AAAA,MAC9C;AAAA,MACA;AAAA,IACF;AAEA,WACE,8CAAC,kBAAe,OAAO,QACrB;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACC,GAAG;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,iBAAiB;AAAA,UACjB,aAAa;AAAA,UACb;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QAEC;AAAA,8DAAwB,cAAc,8CAAC,iBAAc,IAAK;AAAA,UAE3D;AAAA,YAAC;AAAA;AAAA,cACE,GAAG;AAAA,gBACF;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,GAAG;AAAA,gBACH;AAAA,gBACA;AAAA,cACF;AAAA,cAEC;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;AACrB,OAAO,SAAS;","names":["import_core","import_motion","import_utils","import_core","import_utils","import_core","import_utils","import_utils","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_jsx_runtime","import_motion","import_utils","import_motion","import_transitions","import_utils","import_jsx_runtime","import_jsx_runtime","import_core","import_motion","import_use_value","import_utils","import_react","import_motion","import_utils","import_jsx_runtime","import_motion","import_transitions","import_utils","import_core","import_utils","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
package/dist/drawer.mjs
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
Drawer
|
4
|
-
} from "./chunk-
|
5
|
-
import "./chunk-
|
4
|
+
} from "./chunk-KRAXUNBU.mjs";
|
5
|
+
import "./chunk-WKDYYNHI.mjs";
|
6
6
|
import "./chunk-SCU75AQJ.mjs";
|
7
|
-
import "./chunk-
|
7
|
+
import "./chunk-4SA2BXAV.mjs";
|
8
8
|
import "./chunk-E4FDNJ4R.mjs";
|
9
9
|
import "./chunk-4L4JX6MZ.mjs";
|
10
10
|
import "./chunk-U2DBPI7Y.mjs";
|
package/dist/index.js
CHANGED
@@ -425,7 +425,8 @@ var DrawerContent = (0, import_motion3.motionForwardRef)(
|
|
425
425
|
blankForDragProps,
|
426
426
|
...rest
|
427
427
|
}, ref) => {
|
428
|
-
|
428
|
+
let { describedbyId, duration, isOpen, labelledbyId, open, onClose } = useModal();
|
429
|
+
open != null ? open : open = isOpen;
|
429
430
|
const styles = useDrawer();
|
430
431
|
const placement = (0, import_use_value.useValue)(_placement);
|
431
432
|
const validChildren = (0, import_utils14.getValidChildren)(children);
|
@@ -539,7 +540,7 @@ var DrawerContent = (0, import_motion3.motionForwardRef)(
|
|
539
540
|
dragMomentum: false,
|
540
541
|
dragSnapToOrigin: true,
|
541
542
|
duration,
|
542
|
-
isOpen,
|
543
|
+
isOpen: open,
|
543
544
|
placement,
|
544
545
|
role: "dialog",
|
545
546
|
tabIndex: -1,
|
@@ -689,7 +690,7 @@ var Modal = (0, import_motion6.motionForwardRef)(
|
|
689
690
|
size,
|
690
691
|
...props
|
691
692
|
});
|
692
|
-
|
693
|
+
let {
|
693
694
|
className,
|
694
695
|
allowPinchZoom = false,
|
695
696
|
animation = "scale",
|
@@ -703,6 +704,7 @@ var Modal = (0, import_motion6.motionForwardRef)(
|
|
703
704
|
initialFocusRef,
|
704
705
|
isOpen,
|
705
706
|
lockFocusAcrossFrames = true,
|
707
|
+
open,
|
706
708
|
outside = "fallback(4, 1rem)",
|
707
709
|
placement: _placement = "center",
|
708
710
|
restoreFocus,
|
@@ -717,6 +719,7 @@ var Modal = (0, import_motion6.motionForwardRef)(
|
|
717
719
|
onOverlayClick,
|
718
720
|
...rest
|
719
721
|
} = (0, import_core12.omitThemeProps)(mergedProps);
|
722
|
+
open != null ? open : open = isOpen;
|
720
723
|
const labelledbyId = (0, import_react2.useId)();
|
721
724
|
const describedbyId = (0, import_react2.useId)();
|
722
725
|
const onKeyDown = (0, import_react2.useCallback)(
|
@@ -761,13 +764,14 @@ var Modal = (0, import_motion6.motionForwardRef)(
|
|
761
764
|
duration,
|
762
765
|
isOpen,
|
763
766
|
labelledbyId,
|
767
|
+
open,
|
764
768
|
scrollBehavior,
|
765
769
|
styles,
|
766
770
|
withCloseButton,
|
767
771
|
onClose,
|
768
772
|
onOverlayClick
|
769
773
|
},
|
770
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_motion6.AnimatePresence, { onExitComplete: onCloseComplete, children:
|
774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_motion6.AnimatePresence, { onExitComplete: onCloseComplete, children: open ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_portal.Portal, { ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
771
775
|
import_focus_lock.FocusLock,
|
772
776
|
{
|
773
777
|
autoFocus,
|
@@ -918,7 +922,7 @@ var Drawer = (0, import_motion8.motionForwardRef)(
|
|
918
922
|
placement,
|
919
923
|
...props
|
920
924
|
});
|
921
|
-
|
925
|
+
let {
|
922
926
|
allowPinchZoom,
|
923
927
|
autoFocus,
|
924
928
|
blockScrollOnMount,
|
@@ -934,6 +938,7 @@ var Drawer = (0, import_motion8.motionForwardRef)(
|
|
934
938
|
initialFocusRef,
|
935
939
|
isOpen,
|
936
940
|
lockFocusAcrossFrames,
|
941
|
+
open,
|
937
942
|
restoreFocus,
|
938
943
|
withCloseButton = !closeOnDrag,
|
939
944
|
withDragBar = true,
|
@@ -947,6 +952,7 @@ var Drawer = (0, import_motion8.motionForwardRef)(
|
|
947
952
|
onOverlayClick,
|
948
953
|
...rest
|
949
954
|
} = (0, import_core14.omitThemeProps)(mergedProps, ["isFullHeight"]);
|
955
|
+
open != null ? open : open = isOpen;
|
950
956
|
const validChildren = (0, import_utils19.getValidChildren)(children);
|
951
957
|
const [customDrawerOverlay, ...cloneChildren] = (0, import_utils19.findChildren)(
|
952
958
|
validChildren,
|
@@ -967,6 +973,7 @@ var Drawer = (0, import_motion8.motionForwardRef)(
|
|
967
973
|
initialFocusRef,
|
968
974
|
isOpen,
|
969
975
|
lockFocusAcrossFrames,
|
976
|
+
open,
|
970
977
|
restoreFocus,
|
971
978
|
withCloseButton: false,
|
972
979
|
withOverlay: false,
|