lizaui 3.0.50 → 3.0.51
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/button/index.es.js +1 -1
- package/dist/calendar/index.es.js +1 -1
- package/dist/chunks/{button-C2uFi79u.js → button-CT1gzAt1.js} +6 -6
- package/dist/chunks/{button-C2uFi79u.js.map → button-CT1gzAt1.js.map} +1 -1
- package/dist/chunks/{index-BNwIrwDo.js → index-16iPHlf0.js} +4 -4
- package/dist/chunks/{index-BNwIrwDo.js.map → index-16iPHlf0.js.map} +1 -1
- package/dist/chunks/{index-CfJPYoVK.js → index-fRQUvivo.js} +3 -3
- package/dist/chunks/index-fRQUvivo.js.map +1 -0
- package/dist/chunks/{proxy-DLzUd3NL.js → proxy-gd0H-9gQ.js} +47 -47
- package/dist/chunks/{proxy-DLzUd3NL.js.map → proxy-gd0H-9gQ.js.map} +1 -1
- package/dist/chunks/{ripple-Bf1OyqK2.js → ripple-DV2Gx-M9.js} +115 -115
- package/dist/chunks/{ripple-Bf1OyqK2.js.map → ripple-DV2Gx-M9.js.map} +1 -1
- package/dist/components/ripple/index.d.ts +3 -1
- package/dist/components/ripple/index.d.ts.map +1 -1
- package/dist/modal/index.cjs.js +1 -1
- package/dist/modal/index.cjs.js.map +1 -1
- package/dist/modal/index.es.js +8 -8
- package/dist/modal/index.es.js.map +1 -1
- package/dist/pagination/index.es.js +2 -2
- package/dist/ripple/index.cjs.js +1 -1
- package/dist/ripple/index.es.js +3 -2
- package/dist/ui/index.es.js +3 -3
- package/package.json +1 -1
- package/dist/chunks/index-CfJPYoVK.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ripple/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ripple/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,cAAc,cAAc,CAAC;AAE7B,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/modal/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/jsx-runtime-DFswc9zO.js"),v=require("react-dom"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/jsx-runtime-DFswc9zO.js"),v=require("react-dom"),m=require("react"),n=require("../chunks/utils-B759n5Vp.js"),E=require("../chunks/button-BnNW_eev.js"),i=require("../chunks/ripple-CPzedX6a.js"),d={ease:[.36,.66,.4,1]},f={scaleInOut:{enter:{transform:"scale(1)",opacity:1,transition:{duration:.4,ease:d.ease}},exit:{transform:"scale(1.03)",opacity:0,transition:{duration:.3,ease:d.ease}}},fade:{enter:{opacity:1,transition:{duration:.4,ease:d.ease}},exit:{opacity:0,transition:{duration:.3,ease:d.ease}}}},w=({modalId:o,isShow:t,isVisible:a,children:s,style:r,classNameOverlay:u="",styleContainer:c,closeModalClickOut:y,classNameDialog:g="modal-custom-dialog",classNameContent:h="modal-custom-content",backdrop:b="opaque"})=>{const R=m.useRef(null);if(m.useEffect(()=>(typeof window<"u"&&a&&document.body.classList.add("modal-open"),()=>{typeof window<"u"&&document.body.classList.remove("modal-open")}),[a]),typeof window>"u")return null;const p=document.getElementById("modal-root");if(!p)return null;let l="";switch(b){case"transparent":l="bg-transparent";break;case"opaque":l="bg-black/50";break;case"blur":l="backdrop-blur-md backdrop-saturate-150 bg-overlay/30";break}return v.createPortal(e.jsxRuntimeExports.jsx(i.AnimatePresence,{children:t&&e.jsxRuntimeExports.jsx(i.LazyMotion,{features:()=>Promise.resolve().then(()=>require("../chunks/index-_vOj2iyM.js")).then(x=>x.domAnimation),children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(i.m.div,{initial:"exit",animate:"enter",exit:"exit",variants:f.fade,className:n.cn("fixed inset-0 z-50",l,u),onClick:y,"aria-hidden":!t,role:"dialog","aria-modal":"true",tabIndex:-1,id:o},"modal-overlay"),e.jsxRuntimeExports.jsx(i.m.div,{initial:"exit",animate:"enter",exit:"exit",variants:f.scaleInOut,ref:R,onClick:x=>x.stopPropagation(),className:n.cn("fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] z-50 grid w-full max-w-[calc(100%-2rem)] sm:max-w-lg gap-4 rounded-lg p-6 shadow-lg bg-content1",g),style:r,children:e.jsxRuntimeExports.jsx("div",{className:n.cn("modal-custom-content w-full flex flex-col gap-2",h),style:c,children:s})},"modal-content")]})})}),p)},j=m.forwardRef(({children:o,className:t="",styled:a,height:s},r)=>e.jsxRuntimeExports.jsx("div",{className:n.cn("modal-custom-body flex-1",t),ref:r,style:{...a,height:s?`${s}px`:"auto"},children:o}));j.displayName="ModalBodyPortalComponent";const N=({title:o,showCloseButton:t=!0,disabled:a=!1,onClick:s,className:r,styled:u,children:c})=>e.jsxRuntimeExports.jsxs("div",{className:n.cn("modal-custom-header w-full flex flex-col gap-2 text-center sm:text-left",r),style:u,children:[c||e.jsxRuntimeExports.jsx("h4",{className:"modal-custom-title text-lg leading-none font-semibold",children:o}),t&&e.jsxRuntimeExports.jsx("div",{className:"absolute top-3 right-4 disabled:pointer-events-none",children:e.jsxRuntimeExports.jsxs(E.Button,{isIconOnly:!0,variant:"light",radius:"full","aria-label":"Close",onClick:s,disabled:a,className:"p-0 w-[36px] h-[36px] min-w-auto bg-default-100 hover:bg-default-200 text-default-500 hover:text-default-600 dark:bg-default-100 dark:hover:bg-default-200 dark:text-default-500 dark:hover:text-default-600 disabled:opacity-50 disabled:pointer-events-none",children:[e.jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",fill:"currentColor",role:"img","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("path",{fill:"none",d:"M0 0h21v21H0z"}),e.jsxRuntimeExports.jsx("path",{d:"m12.12 10 4.07-4.06a1.5 1.5 0 1 0-2.11-2.12L10 7.88 5.94 3.81a1.5 1.5 0 1 0-2.12 2.12L7.88 10l-4.07 4.06a1.5 1.5 0 0 0 0 2.12 1.51 1.51 0 0 0 2.13 0L10 12.12l4.06 4.07a1.45 1.45 0 0 0 1.06.44 1.5 1.5 0 0 0 1.06-2.56Z"})]}),e.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})})]}),M=({children:o,className:t,styled:a})=>e.jsxRuntimeExports.jsx("div",{className:n.cn("modal-custom-footer flex flex-col-reverse gap-2 sm:flex-row sm:justify-end mt-auto",t),style:a,children:o});exports.Modal=w;exports.ModalBody=j;exports.ModalFooter=M;exports.ModalHeader=N;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../src/components/transition/transition-utils.ts","../../src/components/modal/modal.tsx"],"sourcesContent":["import type { Target, TargetAndTransition, Transition } from \"framer-motion\";\n\ntype WithMotionState<P> = Partial<Record<\"enter\" | \"exit\", P>>;\n\nexport type TransitionConfig = WithMotionState<Transition>;\n\nexport type TransitionEndConfig = WithMotionState<Target>;\n\nexport type TransitionProperties = {\n\t/**\n\t * Custom `transition` definition for `enter` and `exit`\n\t */\n\ttransition?: TransitionConfig;\n\t/**\n\t * Custom `transitionEnd` definition for `enter` and `exit`\n\t */\n\ttransitionEnd?: TransitionEndConfig;\n};\n\ntype TargetResolver<P = {}> = (props: P & TransitionProperties) => TargetAndTransition;\n\ntype Variant<P = {}> = TargetAndTransition | TargetResolver<P>;\n\nexport type Variants<P = {}> = Record<\n\tstring,\n\t{\n\t\tenter: Variant<P>;\n\t\texit: Variant<P>;\n\t\tinitial?: Variant<P>;\n\t}\n>;\n\nexport const TRANSITION_EASINGS = {\n\tease: [0.36, 0.66, 0.4, 1],\n\teaseIn: [0.4, 0, 1, 1],\n\teaseOut: [0, 0, 0.2, 1],\n\teaseInOut: [0.4, 0, 0.2, 1],\n\tspring: [0.155, 1.105, 0.295, 1.12],\n\tspringOut: [0.57, -0.15, 0.62, 0.07],\n\tsoftSpring: [0.16, 1.11, 0.3, 1.02],\n} as const;\n\nexport const TRANSITION_DEFAULTS = {\n\tenter: {\n\t\tduration: 0.2,\n\t\tease: TRANSITION_EASINGS.easeOut,\n\t},\n\texit: {\n\t\tduration: 0.1,\n\t\tease: TRANSITION_EASINGS.easeIn,\n\t},\n} as const;\n\nexport const TRANSITION_VARIANTS: Variants = {\n\tscaleSpring: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\ttype: \"spring\",\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.2,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(0.85)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\ttype: \"easeOut\" as any,\n\t\t\t\tduration: 0.15,\n\t\t\t},\n\t\t},\n\t},\n\tscaleSpringOpacity: {\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\ttransform: \"scale(0.8)\",\n\t\t},\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\ttransform: \"scale(1)\",\n\t\t\ttransition: {\n\t\t\t\ttype: \"spring\",\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.3,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\ttransform: \"scale(0.96)\",\n\t\t\ttransition: {\n\t\t\t\ttype: \"easeOut\" as any,\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.15,\n\t\t\t},\n\t\t},\n\t},\n\tscale: {\n\t\tenter: { scale: 1 },\n\t\texit: { scale: 0.95 },\n\t},\n\tscaleFadeIn: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.25,\n\t\t\t\tease: TRANSITION_EASINGS.easeIn,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(0.95)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.2,\n\t\t\t\tease: TRANSITION_EASINGS.easeOut,\n\t\t\t},\n\t\t},\n\t},\n\tscaleInOut: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.4,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(1.03)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.3,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t},\n\tfade: {\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.4,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.3,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t},\n\tcollapse: {\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\theight: \"auto\",\n\t\t\ttransition: {\n\t\t\t\theight: {\n\t\t\t\t\ttype: \"spring\",\n\t\t\t\t\tbounce: 0,\n\t\t\t\t\tduration: 0.3,\n\t\t\t\t},\n\t\t\t\topacity: {\n\t\t\t\t\tease: \"ease\" as any,\n\t\t\t\t\tduration: 0.4,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\theight: 0,\n\t\t\ttransition: {\n\t\t\t\tease: \"ease\" as any,\n\t\t\t\tduration: 0.3,\n\t\t\t},\n\t\t},\n\t},\n};\n","\"use client\";\n\nimport ReactDOM from \"react-dom\";\nimport { forwardRef, type Ref, useEffect, useRef } from \"react\";\nimport type { ModalBodyType, ModalFooterType, ModalHeaderType, ModalType } from \"./modal.type\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"../button\";\nimport { AnimatePresence } from \"framer-motion\";\nimport { LazyMotion, m } from \"framer-motion\";\nimport { TRANSITION_VARIANTS } from \"../transition/transition-utils\";\n\nexport const Modal = ({\n\tmodalId,\n\tisShow,\n\tisVisible,\n\tchildren,\n\tstyle,\n\tclassNameOverlay = \"\",\n\tstyleContainer,\n\tcloseModalClickOut,\n\tclassNameDialog = \"modal-custom-dialog\",\n\tclassNameContent = \"modal-custom-content\",\n\tbackdrop = \"opaque\",\n}: ModalType) => {\n\tconst modalBodyRef = useRef<HTMLDivElement>(null);\n\tuseEffect(() => {\n\t\tif (typeof window !== \"undefined\" && isVisible) {\n\t\t\tdocument.body.classList.add(\"modal-open\");\n\t\t}\n\t\treturn () => {\n\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\tdocument.body.classList.remove(\"modal-open\");\n\t\t\t}\n\t\t};\n\t}, [isVisible]);\n\n\tif (typeof window === \"undefined\") return null;\n\n\tconst modalRoot = document.getElementById(\"modal-root\");\n\tif (!modalRoot) return null;\n\n\tlet overlayClass = \"\";\n\n\tswitch (backdrop) {\n\t\tcase \"transparent\":\n\t\t\toverlayClass = \"bg-transparent\";\n\t\t\tbreak;\n\t\tcase \"opaque\":\n\t\t\toverlayClass = \"bg-black/50\";\n\t\t\tbreak;\n\t\tcase \"blur\":\n\t\t\toverlayClass = \"backdrop-blur-md backdrop-saturate-150 bg-overlay/30\";\n\t\t\tbreak;\n\t}\n\n\treturn ReactDOM.createPortal(\n\t\t<AnimatePresence>\n\t\t\t{isShow && (\n\t\t\t\t<LazyMotion features={() => import(\"framer-motion\").then((res) => res.domAnimation)}>\n\t\t\t\t\t<>\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tkey=\"modal-overlay\"\n\t\t\t\t\t\t\tinitial=\"exit\"\n\t\t\t\t\t\t\tanimate=\"enter\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tvariants={TRANSITION_VARIANTS.fade}\n\t\t\t\t\t\t\tclassName={cn(\"fixed inset-0 z-50\", overlayClass, classNameOverlay)}\n\t\t\t\t\t\t\tonClick={closeModalClickOut}\n\t\t\t\t\t\t\taria-hidden={!isShow}\n\t\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\tid={modalId}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tkey=\"modal-content\"\n\t\t\t\t\t\t\tinitial=\"exit\"\n\t\t\t\t\t\t\tanimate=\"enter\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tvariants={TRANSITION_VARIANTS.scaleInOut}\n\t\t\t\t\t\t\tref={modalBodyRef}\n\t\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\"fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] z-50 grid w-full max-w-[calc(100%-2rem)] sm:max-w-lg gap-4 rounded-lg p-6 shadow-lg bg-content1\",\n\t\t\t\t\t\t\t\tclassNameDialog,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tstyle={style}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className={cn(\"modal-custom-content w-full flex flex-col gap-2\", classNameContent)} style={styleContainer}>\n\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</m.div>\n\t\t\t\t\t</>\n\t\t\t\t</LazyMotion>\n\t\t\t)}\n\t\t</AnimatePresence>,\n\t\tmodalRoot,\n\t);\n};\n\nexport const ModalBody = forwardRef(({ children, className = \"\", styled, height }: ModalBodyType, ref: Ref<HTMLDivElement>) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-body flex-1\", className)} ref={ref} style={{ ...styled, height: height ? `${height}px` : \"auto\" }}>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\nModalBody.displayName = \"ModalBodyPortalComponent\";\n\nexport const ModalHeader = ({ title, showCloseButton = true, disabled = false, onClick, className, styled, children }: ModalHeaderType) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-header w-full flex flex-col gap-2 text-center sm:text-left\", className)} style={styled}>\n\t\t\t{children || <h4 className=\"modal-custom-title line-clamp-1 font-medium text-black\">{title}</h4>}\n\t\t\t{showCloseButton && (\n\t\t\t\t<div className=\"absolute top-3 right-4 disabled:pointer-events-none\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tisIconOnly\n\t\t\t\t\t\tvariant=\"light\"\n\t\t\t\t\t\tradius=\"full\"\n\t\t\t\t\t\taria-label=\"Close\"\n\t\t\t\t\t\tonClick={onClick}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tclassName=\"p-0 w-[36px] h-[36px] min-w-auto bg-default-100 hover:bg-default-200 text-default-500 hover:text-default-600 dark:bg-default-100 dark:hover:bg-default-200 dark:text-default-500 dark:hover:text-default-600 disabled:opacity-50 disabled:pointer-events-none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg width=\"20\" height=\"20\" fill=\"currentColor\" role=\"img\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<path fill=\"none\" d=\"M0 0h21v21H0z\"></path>\n\t\t\t\t\t\t\t<path d=\"m12.12 10 4.07-4.06a1.5 1.5 0 1 0-2.11-2.12L10 7.88 5.94 3.81a1.5 1.5 0 1 0-2.12 2.12L7.88 10l-4.07 4.06a1.5 1.5 0 0 0 0 2.12 1.51 1.51 0 0 0 2.13 0L10 12.12l4.06 4.07a1.45 1.45 0 0 0 1.06.44 1.5 1.5 0 0 0 1.06-2.56Z\"></path>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t<span className=\"sr-only\">Close</span>\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport const ModalFooter = ({ children, className, styled }: ModalFooterType) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-footer flex flex-col-reverse gap-2 sm:flex-row sm:justify-end mt-auto\", className)} style={styled}>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"],"names":["TRANSITION_EASINGS","TRANSITION_VARIANTS","Modal","modalId","isShow","isVisible","children","style","classNameOverlay","styleContainer","closeModalClickOut","classNameDialog","classNameContent","backdrop","modalBodyRef","useRef","useEffect","modalRoot","overlayClass","ReactDOM","AnimatePresence","jsx","LazyMotion","res","jsxs","Fragment","m","cn","e","ModalBody","forwardRef","className","styled","height","ref","ModalHeader","title","showCloseButton","disabled","onClick","Button","ModalFooter"],"mappings":"4SAgCaA,EAAqB,CACjC,KAAM,CAAC,IAAM,IAAM,GAAK,CAAC,CAO1B,EAaaC,EAAgC,CAkE5C,WAAY,CACX,MAAO,CACN,UAAW,WACX,QAAS,EACT,WAAY,CACX,SAAU,GACV,KAAMD,EAAmB,IAAA,CAE3B,EACA,KAAM,CACL,UAAW,cACX,QAAS,EACT,WAAY,CACX,SAAU,GACV,KAAMA,EAAmB,IAAA,CAC1B,CAEF,EACA,KAAM,CACL,MAAO,CACN,QAAS,EACT,WAAY,CACX,SAAU,GACV,KAAMA,EAAmB,IAAA,CAE3B,EACA,KAAM,CACL,QAAS,EACT,WAAY,CACX,SAAU,GACV,KAAMA,EAAmB,IAAA,CAC1B,CACD,CA2BF,ECvKaE,EAAQ,CAAC,CACrB,QAAAC,EACA,OAAAC,EACA,UAAAC,EACA,SAAAC,EACA,MAAAC,EACA,iBAAAC,EAAmB,GACnB,eAAAC,EACA,mBAAAC,EACA,gBAAAC,EAAkB,sBAClB,iBAAAC,EAAmB,uBACnB,SAAAC,EAAW,QACZ,IAAiB,CACV,MAAAC,EAAeC,SAAuB,IAAI,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U,UAAAyB,EAAW,OAAAC,KAEjDX,wBAAC,OAAI,UAAWM,EAAA,GAAG,qFAAsFI,CAAS,EAAG,MAAOC,EAC1H,SAAA1B,CACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../src/components/transition/transition-utils.ts","../../src/components/modal/modal.tsx"],"sourcesContent":["import type { Target, TargetAndTransition, Transition } from \"framer-motion\";\n\ntype WithMotionState<P> = Partial<Record<\"enter\" | \"exit\", P>>;\n\nexport type TransitionConfig = WithMotionState<Transition>;\n\nexport type TransitionEndConfig = WithMotionState<Target>;\n\nexport type TransitionProperties = {\n\t/**\n\t * Custom `transition` definition for `enter` and `exit`\n\t */\n\ttransition?: TransitionConfig;\n\t/**\n\t * Custom `transitionEnd` definition for `enter` and `exit`\n\t */\n\ttransitionEnd?: TransitionEndConfig;\n};\n\ntype TargetResolver<P = {}> = (props: P & TransitionProperties) => TargetAndTransition;\n\ntype Variant<P = {}> = TargetAndTransition | TargetResolver<P>;\n\nexport type Variants<P = {}> = Record<\n\tstring,\n\t{\n\t\tenter: Variant<P>;\n\t\texit: Variant<P>;\n\t\tinitial?: Variant<P>;\n\t}\n>;\n\nexport const TRANSITION_EASINGS = {\n\tease: [0.36, 0.66, 0.4, 1],\n\teaseIn: [0.4, 0, 1, 1],\n\teaseOut: [0, 0, 0.2, 1],\n\teaseInOut: [0.4, 0, 0.2, 1],\n\tspring: [0.155, 1.105, 0.295, 1.12],\n\tspringOut: [0.57, -0.15, 0.62, 0.07],\n\tsoftSpring: [0.16, 1.11, 0.3, 1.02],\n} as const;\n\nexport const TRANSITION_DEFAULTS = {\n\tenter: {\n\t\tduration: 0.2,\n\t\tease: TRANSITION_EASINGS.easeOut,\n\t},\n\texit: {\n\t\tduration: 0.1,\n\t\tease: TRANSITION_EASINGS.easeIn,\n\t},\n} as const;\n\nexport const TRANSITION_VARIANTS: Variants = {\n\tscaleSpring: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\ttype: \"spring\",\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.2,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(0.85)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\ttype: \"easeOut\" as any,\n\t\t\t\tduration: 0.15,\n\t\t\t},\n\t\t},\n\t},\n\tscaleSpringOpacity: {\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\ttransform: \"scale(0.8)\",\n\t\t},\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\ttransform: \"scale(1)\",\n\t\t\ttransition: {\n\t\t\t\ttype: \"spring\",\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.3,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\ttransform: \"scale(0.96)\",\n\t\t\ttransition: {\n\t\t\t\ttype: \"easeOut\" as any,\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.15,\n\t\t\t},\n\t\t},\n\t},\n\tscale: {\n\t\tenter: { scale: 1 },\n\t\texit: { scale: 0.95 },\n\t},\n\tscaleFadeIn: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.25,\n\t\t\t\tease: TRANSITION_EASINGS.easeIn,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(0.95)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.2,\n\t\t\t\tease: TRANSITION_EASINGS.easeOut,\n\t\t\t},\n\t\t},\n\t},\n\tscaleInOut: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.4,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(1.03)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.3,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t},\n\tfade: {\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.4,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.3,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t},\n\tcollapse: {\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\theight: \"auto\",\n\t\t\ttransition: {\n\t\t\t\theight: {\n\t\t\t\t\ttype: \"spring\",\n\t\t\t\t\tbounce: 0,\n\t\t\t\t\tduration: 0.3,\n\t\t\t\t},\n\t\t\t\topacity: {\n\t\t\t\t\tease: \"ease\" as any,\n\t\t\t\t\tduration: 0.4,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\theight: 0,\n\t\t\ttransition: {\n\t\t\t\tease: \"ease\" as any,\n\t\t\t\tduration: 0.3,\n\t\t\t},\n\t\t},\n\t},\n};\n","\"use client\";\n\nimport ReactDOM from \"react-dom\";\nimport { forwardRef, type Ref, useEffect, useRef } from \"react\";\nimport type { ModalBodyType, ModalFooterType, ModalHeaderType, ModalType } from \"./modal.type\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"../button\";\nimport { AnimatePresence } from \"framer-motion\";\nimport { LazyMotion, m } from \"framer-motion\";\nimport { TRANSITION_VARIANTS } from \"../transition/transition-utils\";\n\nexport const Modal = ({\n\tmodalId,\n\tisShow,\n\tisVisible,\n\tchildren,\n\tstyle,\n\tclassNameOverlay = \"\",\n\tstyleContainer,\n\tcloseModalClickOut,\n\tclassNameDialog = \"modal-custom-dialog\",\n\tclassNameContent = \"modal-custom-content\",\n\tbackdrop = \"opaque\",\n}: ModalType) => {\n\tconst modalBodyRef = useRef<HTMLDivElement>(null);\n\tuseEffect(() => {\n\t\tif (typeof window !== \"undefined\" && isVisible) {\n\t\t\tdocument.body.classList.add(\"modal-open\");\n\t\t}\n\t\treturn () => {\n\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\tdocument.body.classList.remove(\"modal-open\");\n\t\t\t}\n\t\t};\n\t}, [isVisible]);\n\n\tif (typeof window === \"undefined\") return null;\n\n\tconst modalRoot = document.getElementById(\"modal-root\");\n\tif (!modalRoot) return null;\n\n\tlet overlayClass = \"\";\n\n\tswitch (backdrop) {\n\t\tcase \"transparent\":\n\t\t\toverlayClass = \"bg-transparent\";\n\t\t\tbreak;\n\t\tcase \"opaque\":\n\t\t\toverlayClass = \"bg-black/50\";\n\t\t\tbreak;\n\t\tcase \"blur\":\n\t\t\toverlayClass = \"backdrop-blur-md backdrop-saturate-150 bg-overlay/30\";\n\t\t\tbreak;\n\t}\n\n\treturn ReactDOM.createPortal(\n\t\t<AnimatePresence>\n\t\t\t{isShow && (\n\t\t\t\t<LazyMotion features={() => import(\"framer-motion\").then((res) => res.domAnimation)}>\n\t\t\t\t\t<>\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tkey=\"modal-overlay\"\n\t\t\t\t\t\t\tinitial=\"exit\"\n\t\t\t\t\t\t\tanimate=\"enter\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tvariants={TRANSITION_VARIANTS.fade}\n\t\t\t\t\t\t\tclassName={cn(\"fixed inset-0 z-50\", overlayClass, classNameOverlay)}\n\t\t\t\t\t\t\tonClick={closeModalClickOut}\n\t\t\t\t\t\t\taria-hidden={!isShow}\n\t\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\tid={modalId}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tkey=\"modal-content\"\n\t\t\t\t\t\t\tinitial=\"exit\"\n\t\t\t\t\t\t\tanimate=\"enter\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tvariants={TRANSITION_VARIANTS.scaleInOut}\n\t\t\t\t\t\t\tref={modalBodyRef}\n\t\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\"fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] z-50 grid w-full max-w-[calc(100%-2rem)] sm:max-w-lg gap-4 rounded-lg p-6 shadow-lg bg-content1\",\n\t\t\t\t\t\t\t\tclassNameDialog,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tstyle={style}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className={cn(\"modal-custom-content w-full flex flex-col gap-2\", classNameContent)} style={styleContainer}>\n\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</m.div>\n\t\t\t\t\t</>\n\t\t\t\t</LazyMotion>\n\t\t\t)}\n\t\t</AnimatePresence>,\n\t\tmodalRoot,\n\t);\n};\n\nexport const ModalBody = forwardRef(({ children, className = \"\", styled, height }: ModalBodyType, ref: Ref<HTMLDivElement>) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-body flex-1\", className)} ref={ref} style={{ ...styled, height: height ? `${height}px` : \"auto\" }}>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\nModalBody.displayName = \"ModalBodyPortalComponent\";\n\nexport const ModalHeader = ({ title, showCloseButton = true, disabled = false, onClick, className, styled, children }: ModalHeaderType) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-header w-full flex flex-col gap-2 text-center sm:text-left\", className)} style={styled}>\n\t\t\t{children || <h4 className=\"modal-custom-title text-lg leading-none font-semibold\">{title}</h4>}\n\t\t\t{showCloseButton && (\n\t\t\t\t<div className=\"absolute top-3 right-4 disabled:pointer-events-none\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tisIconOnly\n\t\t\t\t\t\tvariant=\"light\"\n\t\t\t\t\t\tradius=\"full\"\n\t\t\t\t\t\taria-label=\"Close\"\n\t\t\t\t\t\tonClick={onClick}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tclassName=\"p-0 w-[36px] h-[36px] min-w-auto bg-default-100 hover:bg-default-200 text-default-500 hover:text-default-600 dark:bg-default-100 dark:hover:bg-default-200 dark:text-default-500 dark:hover:text-default-600 disabled:opacity-50 disabled:pointer-events-none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg width=\"20\" height=\"20\" fill=\"currentColor\" role=\"img\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<path fill=\"none\" d=\"M0 0h21v21H0z\"></path>\n\t\t\t\t\t\t\t<path d=\"m12.12 10 4.07-4.06a1.5 1.5 0 1 0-2.11-2.12L10 7.88 5.94 3.81a1.5 1.5 0 1 0-2.12 2.12L7.88 10l-4.07 4.06a1.5 1.5 0 0 0 0 2.12 1.51 1.51 0 0 0 2.13 0L10 12.12l4.06 4.07a1.45 1.45 0 0 0 1.06.44 1.5 1.5 0 0 0 1.06-2.56Z\"></path>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t<span className=\"sr-only\">Close</span>\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport const ModalFooter = ({ children, className, styled }: ModalFooterType) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-footer flex flex-col-reverse gap-2 sm:flex-row sm:justify-end mt-auto\", className)} style={styled}>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"],"names":["TRANSITION_EASINGS","TRANSITION_VARIANTS","Modal","modalId","isShow","isVisible","children","style","classNameOverlay","styleContainer","closeModalClickOut","classNameDialog","classNameContent","backdrop","modalBodyRef","useRef","useEffect","modalRoot","overlayClass","ReactDOM","AnimatePresence","jsx","LazyMotion","res","jsxs","Fragment","m","cn","e","ModalBody","forwardRef","className","styled","height","ref","ModalHeader","title","showCloseButton","disabled","onClick","Button","ModalFooter"],"mappings":"4SAgCaA,EAAqB,CACjC,KAAM,CAAC,IAAM,IAAM,GAAK,CAAC,CAO1B,EAaaC,EAAgC,CAkE5C,WAAY,CACX,MAAO,CACN,UAAW,WACX,QAAS,EACT,WAAY,CACX,SAAU,GACV,KAAMD,EAAmB,IAAA,CAE3B,EACA,KAAM,CACL,UAAW,cACX,QAAS,EACT,WAAY,CACX,SAAU,GACV,KAAMA,EAAmB,IAAA,CAC1B,CAEF,EACA,KAAM,CACL,MAAO,CACN,QAAS,EACT,WAAY,CACX,SAAU,GACV,KAAMA,EAAmB,IAAA,CAE3B,EACA,KAAM,CACL,QAAS,EACT,WAAY,CACX,SAAU,GACV,KAAMA,EAAmB,IAAA,CAC1B,CACD,CA2BF,ECvKaE,EAAQ,CAAC,CACrB,QAAAC,EACA,OAAAC,EACA,UAAAC,EACA,SAAAC,EACA,MAAAC,EACA,iBAAAC,EAAmB,GACnB,eAAAC,EACA,mBAAAC,EACA,gBAAAC,EAAkB,sBAClB,iBAAAC,EAAmB,uBACnB,SAAAC,EAAW,QACZ,IAAiB,CACV,MAAAC,EAAeC,SAAuB,IAAI,EAY5C,GAXJC,EAAAA,UAAU,KACL,OAAO,OAAW,KAAeX,GAC3B,SAAA,KAAK,UAAU,IAAI,YAAY,EAElC,IAAM,CACR,OAAO,OAAW,KACZ,SAAA,KAAK,UAAU,OAAO,YAAY,CAE7C,GACE,CAACA,CAAS,CAAC,EAEV,OAAO,OAAW,IAAoB,OAAA,KAEpC,MAAAY,EAAY,SAAS,eAAe,YAAY,EAClD,GAAA,CAACA,EAAkB,OAAA,KAEvB,IAAIC,EAAe,GAEnB,OAAQL,EAAU,CACjB,IAAK,cACWK,EAAA,iBACf,MACD,IAAK,SACWA,EAAA,cACf,MACD,IAAK,OACWA,EAAA,uDACf,KAAA,CAGF,OAAOC,EAAS,qCACdC,EA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UAAAR,EAAW,OAAAC,EAAQ,SAAA1B,CAAA,IAEzGkB,yBAAC,OAAI,UAAWG,EAAA,GAAG,0EAA2EI,CAAS,EAAG,MAAOC,EAC/G,SAAA,CAAA1B,GAAae,EAAA,kBAAA,IAAA,KAAA,CAAG,UAAU,wDAAyD,SAAMe,EAAA,EACzFC,GACAhB,EAAA,kBAAA,IAAC,MAAI,CAAA,UAAU,sDACd,SAAAG,EAAA,kBAAA,KAACgB,EAAA,OAAA,CACA,WAAU,GACV,QAAQ,QACR,OAAO,OACP,aAAW,QACX,QAAAD,EACA,SAAAD,EACA,UAAU,gQAEV,SAAA,CAACd,EAAAA,kBAAAA,KAAA,MAAA,CAAI,MAAM,KAAK,OAAO,KAAK,KAAK,eAAe,KAAK,MAAM,cAAY,OACtE,SAAA,CAAAH,EAAA,kBAAA,IAAC,OAAK,CAAA,KAAK,OAAO,EAAE,gBAAgB,EACpCA,EAAAA,kBAAAA,IAAC,OAAK,CAAA,EAAE,0NAA2N,CAAA,CAAA,EACpO,EACCA,EAAA,kBAAA,IAAA,OAAA,CAAK,UAAU,UAAU,SAAK,OAAA,CAAA,CAAA,CAAA,CAAA,CAEjC,CAAA,CAAA,EAEF,EAIWoB,EAAc,CAAC,CAAE,SAAAnC,EAAU,UAAAyB,EAAW,OAAAC,KAEjDX,wBAAC,OAAI,UAAWM,EAAA,GAAG,qFAAsFI,CAAS,EAAG,MAAOC,EAC1H,SAAA1B,CACF,CAAA"}
|
package/dist/modal/index.es.js
CHANGED
|
@@ -2,8 +2,8 @@ import { j as e } from "../chunks/jsx-runtime-BYq8_R6m.js";
|
|
|
2
2
|
import v from "react-dom";
|
|
3
3
|
import { forwardRef as j, useRef as w, useEffect as N } from "react";
|
|
4
4
|
import { c as s } from "../chunks/utils-DF-FHKXF.js";
|
|
5
|
-
import { B as k } from "../chunks/button-
|
|
6
|
-
import { A as I, L as R, m as f } from "../chunks/ripple-
|
|
5
|
+
import { B as k } from "../chunks/button-CT1gzAt1.js";
|
|
6
|
+
import { A as I, L as R, m as f } from "../chunks/ripple-DV2Gx-M9.js";
|
|
7
7
|
const d = {
|
|
8
8
|
ease: [0.36, 0.66, 0.4, 1]
|
|
9
9
|
}, x = {
|
|
@@ -51,8 +51,8 @@ const d = {
|
|
|
51
51
|
styleContainer: c,
|
|
52
52
|
closeModalClickOut: p,
|
|
53
53
|
classNameDialog: h = "modal-custom-dialog",
|
|
54
|
-
classNameContent:
|
|
55
|
-
backdrop:
|
|
54
|
+
classNameContent: g = "modal-custom-content",
|
|
55
|
+
backdrop: y = "opaque"
|
|
56
56
|
}) => {
|
|
57
57
|
const b = w(null);
|
|
58
58
|
if (N(() => (typeof window < "u" && t && document.body.classList.add("modal-open"), () => {
|
|
@@ -61,7 +61,7 @@ const d = {
|
|
|
61
61
|
const u = document.getElementById("modal-root");
|
|
62
62
|
if (!u) return null;
|
|
63
63
|
let r = "";
|
|
64
|
-
switch (
|
|
64
|
+
switch (y) {
|
|
65
65
|
case "transparent":
|
|
66
66
|
r = "bg-transparent";
|
|
67
67
|
break;
|
|
@@ -73,7 +73,7 @@ const d = {
|
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
75
|
return v.createPortal(
|
|
76
|
-
/* @__PURE__ */ e.jsx(I, { children: a && /* @__PURE__ */ e.jsx(R, { features: () => import("../chunks/index-
|
|
76
|
+
/* @__PURE__ */ e.jsx(I, { children: a && /* @__PURE__ */ e.jsx(R, { features: () => import("../chunks/index-fRQUvivo.js").then((m) => m.domAnimation), children: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
77
77
|
/* @__PURE__ */ e.jsx(
|
|
78
78
|
f.div,
|
|
79
79
|
{
|
|
@@ -105,7 +105,7 @@ const d = {
|
|
|
105
105
|
h
|
|
106
106
|
),
|
|
107
107
|
style: n,
|
|
108
|
-
children: /* @__PURE__ */ e.jsx("div", { className: s("modal-custom-content w-full flex flex-col gap-2",
|
|
108
|
+
children: /* @__PURE__ */ e.jsx("div", { className: s("modal-custom-content w-full flex flex-col gap-2", g), style: c, children: l })
|
|
109
109
|
},
|
|
110
110
|
"modal-content"
|
|
111
111
|
)
|
|
@@ -115,7 +115,7 @@ const d = {
|
|
|
115
115
|
}, A = j(({ children: o, className: a = "", styled: t, height: l }, n) => /* @__PURE__ */ e.jsx("div", { className: s("modal-custom-body flex-1", a), ref: n, style: { ...t, height: l ? `${l}px` : "auto" }, children: o }));
|
|
116
116
|
A.displayName = "ModalBodyPortalComponent";
|
|
117
117
|
const E = ({ title: o, showCloseButton: a = !0, disabled: t = !1, onClick: l, className: n, styled: i, children: c }) => /* @__PURE__ */ e.jsxs("div", { className: s("modal-custom-header w-full flex flex-col gap-2 text-center sm:text-left", n), style: i, children: [
|
|
118
|
-
c || /* @__PURE__ */ e.jsx("h4", { className: "modal-custom-title
|
|
118
|
+
c || /* @__PURE__ */ e.jsx("h4", { className: "modal-custom-title text-lg leading-none font-semibold", children: o }),
|
|
119
119
|
a && /* @__PURE__ */ e.jsx("div", { className: "absolute top-3 right-4 disabled:pointer-events-none", children: /* @__PURE__ */ e.jsxs(
|
|
120
120
|
k,
|
|
121
121
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../src/components/transition/transition-utils.ts","../../src/components/modal/modal.tsx"],"sourcesContent":["import type { Target, TargetAndTransition, Transition } from \"framer-motion\";\n\ntype WithMotionState<P> = Partial<Record<\"enter\" | \"exit\", P>>;\n\nexport type TransitionConfig = WithMotionState<Transition>;\n\nexport type TransitionEndConfig = WithMotionState<Target>;\n\nexport type TransitionProperties = {\n\t/**\n\t * Custom `transition` definition for `enter` and `exit`\n\t */\n\ttransition?: TransitionConfig;\n\t/**\n\t * Custom `transitionEnd` definition for `enter` and `exit`\n\t */\n\ttransitionEnd?: TransitionEndConfig;\n};\n\ntype TargetResolver<P = {}> = (props: P & TransitionProperties) => TargetAndTransition;\n\ntype Variant<P = {}> = TargetAndTransition | TargetResolver<P>;\n\nexport type Variants<P = {}> = Record<\n\tstring,\n\t{\n\t\tenter: Variant<P>;\n\t\texit: Variant<P>;\n\t\tinitial?: Variant<P>;\n\t}\n>;\n\nexport const TRANSITION_EASINGS = {\n\tease: [0.36, 0.66, 0.4, 1],\n\teaseIn: [0.4, 0, 1, 1],\n\teaseOut: [0, 0, 0.2, 1],\n\teaseInOut: [0.4, 0, 0.2, 1],\n\tspring: [0.155, 1.105, 0.295, 1.12],\n\tspringOut: [0.57, -0.15, 0.62, 0.07],\n\tsoftSpring: [0.16, 1.11, 0.3, 1.02],\n} as const;\n\nexport const TRANSITION_DEFAULTS = {\n\tenter: {\n\t\tduration: 0.2,\n\t\tease: TRANSITION_EASINGS.easeOut,\n\t},\n\texit: {\n\t\tduration: 0.1,\n\t\tease: TRANSITION_EASINGS.easeIn,\n\t},\n} as const;\n\nexport const TRANSITION_VARIANTS: Variants = {\n\tscaleSpring: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\ttype: \"spring\",\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.2,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(0.85)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\ttype: \"easeOut\" as any,\n\t\t\t\tduration: 0.15,\n\t\t\t},\n\t\t},\n\t},\n\tscaleSpringOpacity: {\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\ttransform: \"scale(0.8)\",\n\t\t},\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\ttransform: \"scale(1)\",\n\t\t\ttransition: {\n\t\t\t\ttype: \"spring\",\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.3,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\ttransform: \"scale(0.96)\",\n\t\t\ttransition: {\n\t\t\t\ttype: \"easeOut\" as any,\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.15,\n\t\t\t},\n\t\t},\n\t},\n\tscale: {\n\t\tenter: { scale: 1 },\n\t\texit: { scale: 0.95 },\n\t},\n\tscaleFadeIn: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.25,\n\t\t\t\tease: TRANSITION_EASINGS.easeIn,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(0.95)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.2,\n\t\t\t\tease: TRANSITION_EASINGS.easeOut,\n\t\t\t},\n\t\t},\n\t},\n\tscaleInOut: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.4,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(1.03)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.3,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t},\n\tfade: {\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.4,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.3,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t},\n\tcollapse: {\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\theight: \"auto\",\n\t\t\ttransition: {\n\t\t\t\theight: {\n\t\t\t\t\ttype: \"spring\",\n\t\t\t\t\tbounce: 0,\n\t\t\t\t\tduration: 0.3,\n\t\t\t\t},\n\t\t\t\topacity: {\n\t\t\t\t\tease: \"ease\" as any,\n\t\t\t\t\tduration: 0.4,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\theight: 0,\n\t\t\ttransition: {\n\t\t\t\tease: \"ease\" as any,\n\t\t\t\tduration: 0.3,\n\t\t\t},\n\t\t},\n\t},\n};\n","\"use client\";\n\nimport ReactDOM from \"react-dom\";\nimport { forwardRef, type Ref, useEffect, useRef } from \"react\";\nimport type { ModalBodyType, ModalFooterType, ModalHeaderType, ModalType } from \"./modal.type\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"../button\";\nimport { AnimatePresence } from \"framer-motion\";\nimport { LazyMotion, m } from \"framer-motion\";\nimport { TRANSITION_VARIANTS } from \"../transition/transition-utils\";\n\nexport const Modal = ({\n\tmodalId,\n\tisShow,\n\tisVisible,\n\tchildren,\n\tstyle,\n\tclassNameOverlay = \"\",\n\tstyleContainer,\n\tcloseModalClickOut,\n\tclassNameDialog = \"modal-custom-dialog\",\n\tclassNameContent = \"modal-custom-content\",\n\tbackdrop = \"opaque\",\n}: ModalType) => {\n\tconst modalBodyRef = useRef<HTMLDivElement>(null);\n\tuseEffect(() => {\n\t\tif (typeof window !== \"undefined\" && isVisible) {\n\t\t\tdocument.body.classList.add(\"modal-open\");\n\t\t}\n\t\treturn () => {\n\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\tdocument.body.classList.remove(\"modal-open\");\n\t\t\t}\n\t\t};\n\t}, [isVisible]);\n\n\tif (typeof window === \"undefined\") return null;\n\n\tconst modalRoot = document.getElementById(\"modal-root\");\n\tif (!modalRoot) return null;\n\n\tlet overlayClass = \"\";\n\n\tswitch (backdrop) {\n\t\tcase \"transparent\":\n\t\t\toverlayClass = \"bg-transparent\";\n\t\t\tbreak;\n\t\tcase \"opaque\":\n\t\t\toverlayClass = \"bg-black/50\";\n\t\t\tbreak;\n\t\tcase \"blur\":\n\t\t\toverlayClass = \"backdrop-blur-md backdrop-saturate-150 bg-overlay/30\";\n\t\t\tbreak;\n\t}\n\n\treturn ReactDOM.createPortal(\n\t\t<AnimatePresence>\n\t\t\t{isShow && (\n\t\t\t\t<LazyMotion features={() => import(\"framer-motion\").then((res) => res.domAnimation)}>\n\t\t\t\t\t<>\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tkey=\"modal-overlay\"\n\t\t\t\t\t\t\tinitial=\"exit\"\n\t\t\t\t\t\t\tanimate=\"enter\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tvariants={TRANSITION_VARIANTS.fade}\n\t\t\t\t\t\t\tclassName={cn(\"fixed inset-0 z-50\", overlayClass, classNameOverlay)}\n\t\t\t\t\t\t\tonClick={closeModalClickOut}\n\t\t\t\t\t\t\taria-hidden={!isShow}\n\t\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\tid={modalId}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tkey=\"modal-content\"\n\t\t\t\t\t\t\tinitial=\"exit\"\n\t\t\t\t\t\t\tanimate=\"enter\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tvariants={TRANSITION_VARIANTS.scaleInOut}\n\t\t\t\t\t\t\tref={modalBodyRef}\n\t\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\"fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] z-50 grid w-full max-w-[calc(100%-2rem)] sm:max-w-lg gap-4 rounded-lg p-6 shadow-lg bg-content1\",\n\t\t\t\t\t\t\t\tclassNameDialog,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tstyle={style}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className={cn(\"modal-custom-content w-full flex flex-col gap-2\", classNameContent)} style={styleContainer}>\n\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</m.div>\n\t\t\t\t\t</>\n\t\t\t\t</LazyMotion>\n\t\t\t)}\n\t\t</AnimatePresence>,\n\t\tmodalRoot,\n\t);\n};\n\nexport const ModalBody = forwardRef(({ children, className = \"\", styled, height }: ModalBodyType, ref: Ref<HTMLDivElement>) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-body flex-1\", className)} ref={ref} style={{ ...styled, height: height ? `${height}px` : \"auto\" }}>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\nModalBody.displayName = \"ModalBodyPortalComponent\";\n\nexport const ModalHeader = ({ title, showCloseButton = true, disabled = false, onClick, className, styled, children }: ModalHeaderType) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-header w-full flex flex-col gap-2 text-center sm:text-left\", className)} style={styled}>\n\t\t\t{children || <h4 className=\"modal-custom-title line-clamp-1 font-medium text-black\">{title}</h4>}\n\t\t\t{showCloseButton && (\n\t\t\t\t<div className=\"absolute top-3 right-4 disabled:pointer-events-none\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tisIconOnly\n\t\t\t\t\t\tvariant=\"light\"\n\t\t\t\t\t\tradius=\"full\"\n\t\t\t\t\t\taria-label=\"Close\"\n\t\t\t\t\t\tonClick={onClick}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tclassName=\"p-0 w-[36px] h-[36px] min-w-auto bg-default-100 hover:bg-default-200 text-default-500 hover:text-default-600 dark:bg-default-100 dark:hover:bg-default-200 dark:text-default-500 dark:hover:text-default-600 disabled:opacity-50 disabled:pointer-events-none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg width=\"20\" height=\"20\" fill=\"currentColor\" role=\"img\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<path fill=\"none\" d=\"M0 0h21v21H0z\"></path>\n\t\t\t\t\t\t\t<path d=\"m12.12 10 4.07-4.06a1.5 1.5 0 1 0-2.11-2.12L10 7.88 5.94 3.81a1.5 1.5 0 1 0-2.12 2.12L7.88 10l-4.07 4.06a1.5 1.5 0 0 0 0 2.12 1.51 1.51 0 0 0 2.13 0L10 12.12l4.06 4.07a1.45 1.45 0 0 0 1.06.44 1.5 1.5 0 0 0 1.06-2.56Z\"></path>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t<span className=\"sr-only\">Close</span>\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport const ModalFooter = ({ children, className, styled }: ModalFooterType) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-footer flex flex-col-reverse gap-2 sm:flex-row sm:justify-end mt-auto\", className)} style={styled}>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"],"names":["TRANSITION_EASINGS","TRANSITION_VARIANTS","Modal","modalId","isShow","isVisible","children","style","classNameOverlay","styleContainer","closeModalClickOut","classNameDialog","classNameContent","backdrop","modalBodyRef","useRef","useEffect","modalRoot","overlayClass","ReactDOM","AnimatePresence","jsx","LazyMotion","res","jsxs","Fragment","m","cn","e","ModalBody","forwardRef","className","styled","height","ref","ModalHeader","title","showCloseButton","disabled","onClick","Button","ModalFooter"],"mappings":";;;;;;AAgCO,MAAMA,IAAqB;AAAA,EACjC,MAAM,CAAC,MAAM,MAAM,KAAK,CAAC;AAO1B,GAaaC,IAAgC;AAAA,EAkE5C,YAAY;AAAA,IACX,OAAO;AAAA,MACN,WAAW;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,QACX,UAAU;AAAA,QACV,MAAMD,EAAmB;AAAA,MAAA;AAAA,IAE3B;AAAA,IACA,MAAM;AAAA,MACL,WAAW;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,QACX,UAAU;AAAA,QACV,MAAMA,EAAmB;AAAA,MAAA;AAAA,IAC1B;AAAA,EAEF;AAAA,EACA,MAAM;AAAA,IACL,OAAO;AAAA,MACN,SAAS;AAAA,MACT,YAAY;AAAA,QACX,UAAU;AAAA,QACV,MAAMA,EAAmB;AAAA,MAAA;AAAA,IAE3B;AAAA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AAAA,EAAA,IAAA,MAAA,EAAG,WAAU,0DAA0D,UAAMe,GAAA;AAAA,EAC1FC,KACAhB,gBAAAA,EAAA,IAAC,OAAI,EAAA,WAAU,uDACd,UAAAG,gBAAAA,EAAA;AAAA,IAACgB;AAAA,IAAA;AAAA,MACA,YAAU;AAAA,MACV,SAAQ;AAAA,MACR,QAAO;AAAA,MACP,cAAW;AAAA,MACX,SAAAD;AAAA,MACA,UAAAD;AAAA,MACA,WAAU;AAAA,MAEV,UAAA;AAAA,QAACd,gBAAAA,EAAAA,KAAA,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,MAAK,gBAAe,MAAK,OAAM,eAAY,QACtE,UAAA;AAAA,UAAAH,gBAAAA,EAAA,IAAC,QAAK,EAAA,MAAK,QAAO,GAAE,iBAAgB;AAAA,UACpCA,gBAAAA,EAAAA,IAAC,QAAK,EAAA,GAAE,2NAA2N,CAAA;AAAA,QAAA,GACpO;AAAA,QACCA,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,WAAU,UAAK,QAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,EAEjC,CAAA;AAAA,GAEF,GAIWoB,IAAc,CAAC,EAAE,UAAAnC,GAAU,WAAAyB,GAAW,QAAAC,QAEjDX,gBAAAA,MAAC,SAAI,WAAWM,EAAG,sFAAsFI,CAAS,GAAG,OAAOC,GAC1H,UAAA1B,EACF,CAAA;"}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../src/components/transition/transition-utils.ts","../../src/components/modal/modal.tsx"],"sourcesContent":["import type { Target, TargetAndTransition, Transition } from \"framer-motion\";\n\ntype WithMotionState<P> = Partial<Record<\"enter\" | \"exit\", P>>;\n\nexport type TransitionConfig = WithMotionState<Transition>;\n\nexport type TransitionEndConfig = WithMotionState<Target>;\n\nexport type TransitionProperties = {\n\t/**\n\t * Custom `transition` definition for `enter` and `exit`\n\t */\n\ttransition?: TransitionConfig;\n\t/**\n\t * Custom `transitionEnd` definition for `enter` and `exit`\n\t */\n\ttransitionEnd?: TransitionEndConfig;\n};\n\ntype TargetResolver<P = {}> = (props: P & TransitionProperties) => TargetAndTransition;\n\ntype Variant<P = {}> = TargetAndTransition | TargetResolver<P>;\n\nexport type Variants<P = {}> = Record<\n\tstring,\n\t{\n\t\tenter: Variant<P>;\n\t\texit: Variant<P>;\n\t\tinitial?: Variant<P>;\n\t}\n>;\n\nexport const TRANSITION_EASINGS = {\n\tease: [0.36, 0.66, 0.4, 1],\n\teaseIn: [0.4, 0, 1, 1],\n\teaseOut: [0, 0, 0.2, 1],\n\teaseInOut: [0.4, 0, 0.2, 1],\n\tspring: [0.155, 1.105, 0.295, 1.12],\n\tspringOut: [0.57, -0.15, 0.62, 0.07],\n\tsoftSpring: [0.16, 1.11, 0.3, 1.02],\n} as const;\n\nexport const TRANSITION_DEFAULTS = {\n\tenter: {\n\t\tduration: 0.2,\n\t\tease: TRANSITION_EASINGS.easeOut,\n\t},\n\texit: {\n\t\tduration: 0.1,\n\t\tease: TRANSITION_EASINGS.easeIn,\n\t},\n} as const;\n\nexport const TRANSITION_VARIANTS: Variants = {\n\tscaleSpring: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\ttype: \"spring\",\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.2,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(0.85)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\ttype: \"easeOut\" as any,\n\t\t\t\tduration: 0.15,\n\t\t\t},\n\t\t},\n\t},\n\tscaleSpringOpacity: {\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\ttransform: \"scale(0.8)\",\n\t\t},\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\ttransform: \"scale(1)\",\n\t\t\ttransition: {\n\t\t\t\ttype: \"spring\",\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.3,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\ttransform: \"scale(0.96)\",\n\t\t\ttransition: {\n\t\t\t\ttype: \"easeOut\" as any,\n\t\t\t\tbounce: 0,\n\t\t\t\tduration: 0.15,\n\t\t\t},\n\t\t},\n\t},\n\tscale: {\n\t\tenter: { scale: 1 },\n\t\texit: { scale: 0.95 },\n\t},\n\tscaleFadeIn: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.25,\n\t\t\t\tease: TRANSITION_EASINGS.easeIn,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(0.95)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.2,\n\t\t\t\tease: TRANSITION_EASINGS.easeOut,\n\t\t\t},\n\t\t},\n\t},\n\tscaleInOut: {\n\t\tenter: {\n\t\t\ttransform: \"scale(1)\",\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.4,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\ttransform: \"scale(1.03)\",\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.3,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t},\n\tfade: {\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.4,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.3,\n\t\t\t\tease: TRANSITION_EASINGS.ease,\n\t\t\t},\n\t\t},\n\t},\n\tcollapse: {\n\t\tenter: {\n\t\t\topacity: 1,\n\t\t\theight: \"auto\",\n\t\t\ttransition: {\n\t\t\t\theight: {\n\t\t\t\t\ttype: \"spring\",\n\t\t\t\t\tbounce: 0,\n\t\t\t\t\tduration: 0.3,\n\t\t\t\t},\n\t\t\t\topacity: {\n\t\t\t\t\tease: \"ease\" as any,\n\t\t\t\t\tduration: 0.4,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\theight: 0,\n\t\t\ttransition: {\n\t\t\t\tease: \"ease\" as any,\n\t\t\t\tduration: 0.3,\n\t\t\t},\n\t\t},\n\t},\n};\n","\"use client\";\n\nimport ReactDOM from \"react-dom\";\nimport { forwardRef, type Ref, useEffect, useRef } from \"react\";\nimport type { ModalBodyType, ModalFooterType, ModalHeaderType, ModalType } from \"./modal.type\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"../button\";\nimport { AnimatePresence } from \"framer-motion\";\nimport { LazyMotion, m } from \"framer-motion\";\nimport { TRANSITION_VARIANTS } from \"../transition/transition-utils\";\n\nexport const Modal = ({\n\tmodalId,\n\tisShow,\n\tisVisible,\n\tchildren,\n\tstyle,\n\tclassNameOverlay = \"\",\n\tstyleContainer,\n\tcloseModalClickOut,\n\tclassNameDialog = \"modal-custom-dialog\",\n\tclassNameContent = \"modal-custom-content\",\n\tbackdrop = \"opaque\",\n}: ModalType) => {\n\tconst modalBodyRef = useRef<HTMLDivElement>(null);\n\tuseEffect(() => {\n\t\tif (typeof window !== \"undefined\" && isVisible) {\n\t\t\tdocument.body.classList.add(\"modal-open\");\n\t\t}\n\t\treturn () => {\n\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\tdocument.body.classList.remove(\"modal-open\");\n\t\t\t}\n\t\t};\n\t}, [isVisible]);\n\n\tif (typeof window === \"undefined\") return null;\n\n\tconst modalRoot = document.getElementById(\"modal-root\");\n\tif (!modalRoot) return null;\n\n\tlet overlayClass = \"\";\n\n\tswitch (backdrop) {\n\t\tcase \"transparent\":\n\t\t\toverlayClass = \"bg-transparent\";\n\t\t\tbreak;\n\t\tcase \"opaque\":\n\t\t\toverlayClass = \"bg-black/50\";\n\t\t\tbreak;\n\t\tcase \"blur\":\n\t\t\toverlayClass = \"backdrop-blur-md backdrop-saturate-150 bg-overlay/30\";\n\t\t\tbreak;\n\t}\n\n\treturn ReactDOM.createPortal(\n\t\t<AnimatePresence>\n\t\t\t{isShow && (\n\t\t\t\t<LazyMotion features={() => import(\"framer-motion\").then((res) => res.domAnimation)}>\n\t\t\t\t\t<>\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tkey=\"modal-overlay\"\n\t\t\t\t\t\t\tinitial=\"exit\"\n\t\t\t\t\t\t\tanimate=\"enter\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tvariants={TRANSITION_VARIANTS.fade}\n\t\t\t\t\t\t\tclassName={cn(\"fixed inset-0 z-50\", overlayClass, classNameOverlay)}\n\t\t\t\t\t\t\tonClick={closeModalClickOut}\n\t\t\t\t\t\t\taria-hidden={!isShow}\n\t\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\tid={modalId}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tkey=\"modal-content\"\n\t\t\t\t\t\t\tinitial=\"exit\"\n\t\t\t\t\t\t\tanimate=\"enter\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tvariants={TRANSITION_VARIANTS.scaleInOut}\n\t\t\t\t\t\t\tref={modalBodyRef}\n\t\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\"fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] z-50 grid w-full max-w-[calc(100%-2rem)] sm:max-w-lg gap-4 rounded-lg p-6 shadow-lg bg-content1\",\n\t\t\t\t\t\t\t\tclassNameDialog,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tstyle={style}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className={cn(\"modal-custom-content w-full flex flex-col gap-2\", classNameContent)} style={styleContainer}>\n\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</m.div>\n\t\t\t\t\t</>\n\t\t\t\t</LazyMotion>\n\t\t\t)}\n\t\t</AnimatePresence>,\n\t\tmodalRoot,\n\t);\n};\n\nexport const ModalBody = forwardRef(({ children, className = \"\", styled, height }: ModalBodyType, ref: Ref<HTMLDivElement>) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-body flex-1\", className)} ref={ref} style={{ ...styled, height: height ? `${height}px` : \"auto\" }}>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\nModalBody.displayName = \"ModalBodyPortalComponent\";\n\nexport const ModalHeader = ({ title, showCloseButton = true, disabled = false, onClick, className, styled, children }: ModalHeaderType) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-header w-full flex flex-col gap-2 text-center sm:text-left\", className)} style={styled}>\n\t\t\t{children || <h4 className=\"modal-custom-title text-lg leading-none font-semibold\">{title}</h4>}\n\t\t\t{showCloseButton && (\n\t\t\t\t<div className=\"absolute top-3 right-4 disabled:pointer-events-none\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tisIconOnly\n\t\t\t\t\t\tvariant=\"light\"\n\t\t\t\t\t\tradius=\"full\"\n\t\t\t\t\t\taria-label=\"Close\"\n\t\t\t\t\t\tonClick={onClick}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tclassName=\"p-0 w-[36px] h-[36px] min-w-auto bg-default-100 hover:bg-default-200 text-default-500 hover:text-default-600 dark:bg-default-100 dark:hover:bg-default-200 dark:text-default-500 dark:hover:text-default-600 disabled:opacity-50 disabled:pointer-events-none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg width=\"20\" height=\"20\" fill=\"currentColor\" role=\"img\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<path fill=\"none\" d=\"M0 0h21v21H0z\"></path>\n\t\t\t\t\t\t\t<path d=\"m12.12 10 4.07-4.06a1.5 1.5 0 1 0-2.11-2.12L10 7.88 5.94 3.81a1.5 1.5 0 1 0-2.12 2.12L7.88 10l-4.07 4.06a1.5 1.5 0 0 0 0 2.12 1.51 1.51 0 0 0 2.13 0L10 12.12l4.06 4.07a1.45 1.45 0 0 0 1.06.44 1.5 1.5 0 0 0 1.06-2.56Z\"></path>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t<span className=\"sr-only\">Close</span>\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport const ModalFooter = ({ children, className, styled }: ModalFooterType) => {\n\treturn (\n\t\t<div className={cn(\"modal-custom-footer flex flex-col-reverse gap-2 sm:flex-row sm:justify-end mt-auto\", className)} style={styled}>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"],"names":["TRANSITION_EASINGS","TRANSITION_VARIANTS","Modal","modalId","isShow","isVisible","children","style","classNameOverlay","styleContainer","closeModalClickOut","classNameDialog","classNameContent","backdrop","modalBodyRef","useRef","useEffect","modalRoot","overlayClass","ReactDOM","AnimatePresence","jsx","LazyMotion","res","jsxs","Fragment","m","cn","e","ModalBody","forwardRef","className","styled","height","ref","ModalHeader","title","showCloseButton","disabled","onClick","Button","ModalFooter"],"mappings":";;;;;;AAgCO,MAAMA,IAAqB;AAAA,EACjC,MAAM,CAAC,MAAM,MAAM,KAAK,CAAC;AAO1B,GAaaC,IAAgC;AAAA,EAkE5C,YAAY;AAAA,IACX,OAAO;AAAA,MACN,WAAW;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,QACX,UAAU;AAAA,QACV,MAAMD,EAAmB;AAAA,MAAA;AAAA,IAE3B;AAAA,IACA,MAAM;AAAA,MACL,WAAW;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,QACX,UAAU;AAAA,QACV,MAAMA,EAAmB;AAAA,MAAA;AAAA,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C,GAAS,WAAAR,GAAW,QAAAC,GAAQ,UAAA1B,EAAA,MAEzGkB,gBAAAA,OAAC,SAAI,WAAWG,EAAG,2EAA2EI,CAAS,GAAG,OAAOC,GAC/G,UAAA;AAAA,EAAA1B,KAAae,gBAAAA,EAAA,IAAA,MAAA,EAAG,WAAU,yDAAyD,UAAMe,GAAA;AAAA,EACzFC,KACAhB,gBAAAA,EAAA,IAAC,OAAI,EAAA,WAAU,uDACd,UAAAG,gBAAAA,EAAA;AAAA,IAACgB;AAAA,IAAA;AAAA,MACA,YAAU;AAAA,MACV,SAAQ;AAAA,MACR,QAAO;AAAA,MACP,cAAW;AAAA,MACX,SAAAD;AAAA,MACA,UAAAD;AAAA,MACA,WAAU;AAAA,MAEV,UAAA;AAAA,QAACd,gBAAAA,EAAAA,KAAA,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,MAAK,gBAAe,MAAK,OAAM,eAAY,QACtE,UAAA;AAAA,UAAAH,gBAAAA,EAAA,IAAC,QAAK,EAAA,MAAK,QAAO,GAAE,iBAAgB;AAAA,UACpCA,gBAAAA,EAAAA,IAAC,QAAK,EAAA,GAAE,2NAA2N,CAAA;AAAA,QAAA,GACpO;AAAA,QACCA,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,WAAU,UAAK,QAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,EAEjC,CAAA;AAAA,GAEF,GAIWoB,IAAc,CAAC,EAAE,UAAAnC,GAAU,WAAAyB,GAAW,QAAAC,QAEjDX,gBAAAA,MAAC,SAAI,WAAWM,EAAG,sFAAsFI,CAAS,GAAG,OAAOC,GAC1H,UAAA1B,EACF,CAAA;"}
|
|
@@ -3,8 +3,8 @@ import { t as x } from "../chunks/bundle-mjs-kGHm2Pod.js";
|
|
|
3
3
|
import { I as j } from "../chunks/index-DK44x_HP.js";
|
|
4
4
|
import { useState as b, useCallback as k } from "react";
|
|
5
5
|
import { c as m } from "../chunks/clsx-OuTLNxxd.js";
|
|
6
|
-
import { S as v, a as I, b as C, c as L, d as R, e as A, f as F } from "../chunks/index-
|
|
7
|
-
import "../chunks/button-
|
|
6
|
+
import { S as v, a as I, b as C, c as L, d as R, e as A, f as F } from "../chunks/index-16iPHlf0.js";
|
|
7
|
+
import "../chunks/button-CT1gzAt1.js";
|
|
8
8
|
const p = ({ className: l, color: e = "primary", active: r, children: d, text: t, onClick: c }) => {
|
|
9
9
|
const f = m(
|
|
10
10
|
{
|
package/dist/ripple/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/ripple-CPzedX6a.js");exports.useRipple=e.useRipple;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/ripple-CPzedX6a.js");exports.Ripple=e.Ripple;exports.useRipple=e.useRipple;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/ripple/index.es.js
CHANGED
package/dist/ui/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as A, g as q, h as Ae, u as K, i as w, j as pe, k as Z, l as V, m as Pe, R as et, n as H, o as Kt, A as tt, p as Fr, q as Et, r as Gr, s as zr, F as Kr, D as rt, C as Vt, t as Ht, v as ke, w as Vr, x as Gs, y as zs, z as Ks, B as ue, E as Hr, G as Ut, H as Bt, O as Wt, I as Yt, J as Vs, K as Hs, L as Us, M as Bs, N as Ws, Q as Ur, T as Ys, U as Br, V as Xs, W as qs, X as Zs, Y as Js, Z as Wr, _ as ot, $ as Yr, a0 as Xr, a1 as qr, a2 as Qs } from "../chunks/index-
|
|
2
|
-
import { a3 as Sv, a6 as Rv, a7 as yv, a8 as _v, a9 as Mv, aa as Ev, a4 as Nv, S as Av, c as Pv, d as jv, f as Iv, e as Tv, ab as Dv, ac as Ov, ad as kv, a as $v, b as Lv, a5 as Fv } from "../chunks/index-
|
|
1
|
+
import { P as A, g as q, h as Ae, u as K, i as w, j as pe, k as Z, l as V, m as Pe, R as et, n as H, o as Kt, A as tt, p as Fr, q as Et, r as Gr, s as zr, F as Kr, D as rt, C as Vt, t as Ht, v as ke, w as Vr, x as Gs, y as zs, z as Ks, B as ue, E as Hr, G as Ut, H as Bt, O as Wt, I as Yt, J as Vs, K as Hs, L as Us, M as Bs, N as Ws, Q as Ur, T as Ys, U as Br, V as Xs, W as qs, X as Zs, Y as Js, Z as Wr, _ as ot, $ as Yr, a0 as Xr, a1 as qr, a2 as Qs } from "../chunks/index-16iPHlf0.js";
|
|
2
|
+
import { a3 as Sv, a6 as Rv, a7 as yv, a8 as _v, a9 as Mv, aa as Ev, a4 as Nv, S as Av, c as Pv, d as jv, f as Iv, e as Tv, ab as Dv, ac as Ov, ad as kv, a as $v, b as Lv, a5 as Fv } from "../chunks/index-16iPHlf0.js";
|
|
3
3
|
import { j as a } from "../chunks/jsx-runtime-BYq8_R6m.js";
|
|
4
4
|
import * as i from "react";
|
|
5
5
|
import X from "react";
|
|
@@ -7,7 +7,7 @@ import { c as C } from "../chunks/utils-DF-FHKXF.js";
|
|
|
7
7
|
import { L as zv } from "../chunks/label-error-DwHE_f3w.js";
|
|
8
8
|
import { u as F, c as de, a as Zr, b as ei } from "../chunks/index-ctnzfHek.js";
|
|
9
9
|
import ti from "react-dom";
|
|
10
|
-
import { B as Nt, b as Jr } from "../chunks/button-
|
|
10
|
+
import { B as Nt, b as Jr } from "../chunks/button-CT1gzAt1.js";
|
|
11
11
|
var ri = "Label", Qr = i.forwardRef((e, t) => /* @__PURE__ */ a.jsx(
|
|
12
12
|
A.label,
|
|
13
13
|
{
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-CfJPYoVK.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|