@iziui/react 0.0.91-rc → 0.0.93-rc
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/.types/_internal/core/options/CustomOptions.d.ts +1 -6
- package/dist/.types/_internal/core/options/createOptions/createOptions.d.ts +1 -1
- package/dist/.types/_internal/core/plugin/behavior/defineBoxShadow/defineBoxShadow.d.ts +1 -5
- package/dist/.types/_internal/core/plugin/color/defineBackground/defineBackground.d.ts +1 -5
- package/dist/.types/_internal/core/plugin/color/defineBackgroundColor/defineBackgroundColor.d.ts +1 -5
- package/dist/.types/_internal/core/plugin/color/defineBorderColor/defineBorderColor.d.ts +1 -5
- package/dist/.types/_internal/core/plugin/color/defineColor/defineColor.d.ts +1 -5
- package/dist/.types/_internal/core/plugin/definePlugin/definePlugin.d.ts +3 -2
- package/dist/.types/_internal/core/plugin/index.d.ts +0 -1
- package/dist/.types/_internal/core/plugin/plugin.d.ts +1 -2
- package/dist/.types/_internal/core/plugin/shape/defineBorderRadius/defineBorderRadius.d.ts +1 -5
- package/dist/.types/_internal/core/plugin/spacing/defineMargin/defineMargin.d.ts +1 -7
- package/dist/.types/_internal/core/plugin/spacing/definePadding/definePadding.d.ts +1 -7
- package/dist/.types/_internal/toolkit/file/file.d.ts +4 -0
- package/dist/.types/_internal/toolkit/file/index.d.ts +1 -0
- package/dist/.types/_internal/toolkit/index.d.ts +1 -0
- package/dist/.types/fields/InputFile/InputFile.d.ts +7 -1
- package/dist/.types/fields/InputFile/InputFile.d.ts.map +1 -1
- package/dist/.types/fields/InputFile/InputFile.stories.d.ts.map +1 -1
- package/dist/.types/navigation/Tabs/TabButton.d.ts +10 -0
- package/dist/.types/navigation/Tabs/TabButton.d.ts.map +1 -0
- package/dist/.types/navigation/Tabs/TabContent.d.ts +8 -0
- package/dist/.types/navigation/Tabs/TabContent.d.ts.map +1 -0
- package/dist/.types/navigation/Tabs/Tabs.d.ts +10 -0
- package/dist/.types/navigation/Tabs/Tabs.d.ts.map +1 -0
- package/dist/.types/navigation/Tabs/Tabs.spec.d.ts +2 -0
- package/dist/.types/navigation/Tabs/Tabs.spec.d.ts.map +1 -0
- package/dist/.types/navigation/Tabs/Tabs.stories.d.ts +9 -0
- package/dist/.types/navigation/Tabs/Tabs.stories.d.ts.map +1 -0
- package/dist/.types/navigation/Tabs/index.d.ts +5 -0
- package/dist/.types/navigation/Tabs/index.d.ts.map +1 -0
- package/dist/.types/navigation/Tabs/useTabs.d.ts +4 -0
- package/dist/.types/navigation/Tabs/useTabs.d.ts.map +1 -0
- package/dist/.types/navigation/index.d.ts +2 -1
- package/dist/.types/navigation/index.d.ts.map +1 -1
- package/dist/animations/Fade/index.cjs +1 -1
- package/dist/animations/Fade/index.js +1 -1
- package/dist/chunks/{Alert-mOXPwc3e.js → Alert-B-zwGEUF.js} +2 -2
- package/dist/chunks/{Alert-mOXPwc3e.js.map → Alert-B-zwGEUF.js.map} +1 -1
- package/dist/chunks/{Alert-CUgp08gU.cjs → Alert-BCDrxwmz.cjs} +2 -2
- package/dist/chunks/{Alert-CUgp08gU.cjs.map → Alert-BCDrxwmz.cjs.map} +1 -1
- package/dist/chunks/{Box-DdpIV_Bl.cjs → Box-BCKQa2JS.cjs} +2 -2
- package/dist/chunks/{Box-DdpIV_Bl.cjs.map → Box-BCKQa2JS.cjs.map} +1 -1
- package/dist/chunks/{Box-O2jw08Hf.js → Box-Cs7u6zrl.js} +2 -2
- package/dist/chunks/{Box-O2jw08Hf.js.map → Box-Cs7u6zrl.js.map} +1 -1
- package/dist/chunks/{ButtonIcon-BMOZPxpN.cjs → ButtonIcon-CJ5Iz-uJ.cjs} +2 -2
- package/dist/chunks/{ButtonIcon-BMOZPxpN.cjs.map → ButtonIcon-CJ5Iz-uJ.cjs.map} +1 -1
- package/dist/chunks/{ButtonIcon-CYO1Crb-.js → ButtonIcon-mMZe5V_1.js} +2 -2
- package/dist/chunks/{ButtonIcon-CYO1Crb-.js.map → ButtonIcon-mMZe5V_1.js.map} +1 -1
- package/dist/chunks/{Card-DtjP8NP7.cjs → Card-CcOpPKfS.cjs} +2 -2
- package/dist/chunks/{Card-DtjP8NP7.cjs.map → Card-CcOpPKfS.cjs.map} +1 -1
- package/dist/chunks/{Card-D_RFnUk2.js → Card-DDRUwdlG.js} +2 -2
- package/dist/chunks/{Card-D_RFnUk2.js.map → Card-DDRUwdlG.js.map} +1 -1
- package/dist/chunks/{CardContent-BqqU9iwO.cjs → CardContent-D2cDaP4l.cjs} +2 -2
- package/dist/chunks/{CardContent-BqqU9iwO.cjs.map → CardContent-D2cDaP4l.cjs.map} +1 -1
- package/dist/chunks/{CardContent-BsSfxSQH.js → CardContent-DYAWf3xO.js} +2 -2
- package/dist/chunks/{CardContent-BsSfxSQH.js.map → CardContent-DYAWf3xO.js.map} +1 -1
- package/dist/chunks/{DrawerContent-Dyc1evVF.cjs → DrawerContent-C6nd8E0E.cjs} +2 -2
- package/dist/chunks/{DrawerContent-Dyc1evVF.cjs.map → DrawerContent-C6nd8E0E.cjs.map} +1 -1
- package/dist/chunks/{DrawerContent-CYQSz1G-.js → DrawerContent-OuMcge27.js} +2 -2
- package/dist/chunks/{DrawerContent-CYQSz1G-.js.map → DrawerContent-OuMcge27.js.map} +1 -1
- package/dist/chunks/Fade-CWDTkVB8.js +2 -0
- package/dist/chunks/Fade-CWDTkVB8.js.map +1 -0
- package/dist/chunks/Fade-DfxUFkY4.cjs +2 -0
- package/dist/chunks/Fade-DfxUFkY4.cjs.map +1 -0
- package/dist/chunks/{Icon-imOBrsbL.js → Icon-B2zjgYkr.js} +2 -2
- package/dist/chunks/{Icon-imOBrsbL.js.map → Icon-B2zjgYkr.js.map} +1 -1
- package/dist/chunks/{Icon-CIrgQex7.cjs → Icon-CFvy-l1V.cjs} +2 -2
- package/dist/chunks/{Icon-CIrgQex7.cjs.map → Icon-CFvy-l1V.cjs.map} +1 -1
- package/dist/chunks/Loading-CD7bT3lU.js +2 -0
- package/dist/chunks/Loading-CD7bT3lU.js.map +1 -0
- package/dist/chunks/Loading-zx7Fg7_c.cjs +2 -0
- package/dist/chunks/Loading-zx7Fg7_c.cjs.map +1 -0
- package/dist/chunks/{MenuButton-D0cPZU6x.cjs → MenuButton-CsePYu0b.cjs} +2 -2
- package/dist/chunks/{MenuButton-D0cPZU6x.cjs.map → MenuButton-CsePYu0b.cjs.map} +1 -1
- package/dist/chunks/{MenuButton-CvQxSdho.js → MenuButton-nVBc0ieJ.js} +2 -2
- package/dist/chunks/{MenuButton-CvQxSdho.js.map → MenuButton-nVBc0ieJ.js.map} +1 -1
- package/dist/chunks/{Stack-Deow48Th.js → Stack-C2zMFX0w.js} +2 -2
- package/dist/chunks/{Stack-Deow48Th.js.map → Stack-C2zMFX0w.js.map} +1 -1
- package/dist/chunks/{Stack-B_lU0ez7.cjs → Stack-lvjI3kV3.cjs} +2 -2
- package/dist/chunks/{Stack-B_lU0ez7.cjs.map → Stack-lvjI3kV3.cjs.map} +1 -1
- package/dist/chunks/{TableHeader-DnifrYxO.js → TableHeader-Bra59bV0.js} +2 -2
- package/dist/chunks/{TableHeader-DnifrYxO.js.map → TableHeader-Bra59bV0.js.map} +1 -1
- package/dist/chunks/{TableHeader-SKzj2zHB.cjs → TableHeader-D_fGRq9B.cjs} +2 -2
- package/dist/chunks/{TableHeader-SKzj2zHB.cjs.map → TableHeader-D_fGRq9B.cjs.map} +1 -1
- package/dist/chunks/{Typography-DW57lh3e.cjs → Typography-B2gBDBkp.cjs} +2 -2
- package/dist/chunks/{Typography-DW57lh3e.cjs.map → Typography-B2gBDBkp.cjs.map} +1 -1
- package/dist/chunks/{Typography-BrJZyxiT.js → Typography-BkvvYn5T.js} +2 -2
- package/dist/chunks/{Typography-BrJZyxiT.js.map → Typography-BkvvYn5T.js.map} +1 -1
- package/dist/chunks/createComponent-B2C4sTOb.cjs +2 -0
- package/dist/chunks/createComponent-B2C4sTOb.cjs.map +1 -0
- package/dist/chunks/createComponent-D-IheGJm.js +2 -0
- package/dist/chunks/createComponent-D-IheGJm.js.map +1 -0
- package/dist/chunks/useMenu-C2KhwKNS.cjs +2 -0
- package/dist/chunks/{useMenu-DewYBiar.cjs.map → useMenu-C2KhwKNS.cjs.map} +1 -1
- package/dist/chunks/useMenu-DLaxCUF_.js +2 -0
- package/dist/chunks/{useMenu-DuX7EGHi.js.map → useMenu-DLaxCUF_.js.map} +1 -1
- package/dist/chunks/useTabs-DaDm5Ou4.cjs +2 -0
- package/dist/chunks/useTabs-DaDm5Ou4.cjs.map +1 -0
- package/dist/chunks/useTabs-De_vpYsm.js +2 -0
- package/dist/chunks/useTabs-De_vpYsm.js.map +1 -0
- package/dist/chunks/uuid-dGvr9vBZ.js +2 -0
- package/dist/chunks/uuid-dGvr9vBZ.js.map +1 -0
- package/dist/chunks/uuid-omnJ9TjZ.cjs +2 -0
- package/dist/chunks/uuid-omnJ9TjZ.cjs.map +1 -0
- package/dist/chunks/wait-BSgGzoPk.js +2 -0
- package/dist/chunks/wait-BSgGzoPk.js.map +1 -0
- package/dist/chunks/wait-CgS79FV1.cjs +2 -0
- package/dist/chunks/wait-CgS79FV1.cjs.map +1 -0
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.cjs.map +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Box/index.cjs +1 -1
- package/dist/components/Box/index.js +1 -1
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonIcon/index.cjs +1 -1
- package/dist/components/ButtonIcon/index.js +1 -1
- package/dist/components/Card/index.cjs +1 -1
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Checkbox/index.cjs +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/CheckboxGroup/index.cjs +1 -1
- package/dist/components/CheckboxGroup/index.js +1 -1
- package/dist/components/Chip/index.cjs +1 -1
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/ColorPicker/index.cjs +1 -1
- package/dist/components/ColorPicker/index.cjs.map +1 -1
- package/dist/components/ColorPicker/index.js +1 -1
- package/dist/components/ColorPicker/index.js.map +1 -1
- package/dist/components/Container/index.cjs +1 -1
- package/dist/components/Container/index.js +1 -1
- package/dist/components/Divider/index.cjs +1 -1
- package/dist/components/Divider/index.js +1 -1
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/Input/index.cjs +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputFile/index.cjs +1 -1
- package/dist/components/InputFile/index.cjs.map +1 -1
- package/dist/components/InputFile/index.js +1 -1
- package/dist/components/InputFile/index.js.map +1 -1
- package/dist/components/Loading/index.cjs +1 -1
- package/dist/components/Loading/index.cjs.map +1 -1
- package/dist/components/Loading/index.js +1 -1
- package/dist/components/Loading/index.js.map +1 -1
- package/dist/components/Menu/index.cjs +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.cjs.map +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Skeleton/index.cjs +1 -1
- package/dist/components/Skeleton/index.js +1 -1
- package/dist/components/Stack/index.cjs +1 -1
- package/dist/components/Stack/index.js +1 -1
- package/dist/components/Switch/index.cjs +1 -1
- package/dist/components/Switch/index.cjs.map +1 -1
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tabs/index.cjs +2 -0
- package/dist/components/Tabs/index.cjs.map +1 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +2 -0
- package/dist/components/Tabs/index.js.map +1 -0
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toast/index.js.map +1 -1
- package/dist/components/Tooltip/index.cjs +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Typography/index.cjs +1 -1
- package/dist/components/Typography/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +16 -10
- package/package.json +1 -1
- package/dist/.types/_internal/core/plugin/breakpoint/defineBreakpoint/defineBreakpoint.d.ts +0 -2
- package/dist/.types/_internal/core/plugin/breakpoint/defineBreakpoint/index.d.ts +0 -1
- package/dist/.types/_internal/core/plugin/breakpoint/index.d.ts +0 -1
- package/dist/chunks/Fade-CM-5xRVt.cjs +0 -2
- package/dist/chunks/Fade-CM-5xRVt.cjs.map +0 -1
- package/dist/chunks/Fade-spxq-W-Q.js +0 -2
- package/dist/chunks/Fade-spxq-W-Q.js.map +0 -1
- package/dist/chunks/createComponent-CovqNaAJ.js +0 -8
- package/dist/chunks/createComponent-CovqNaAJ.js.map +0 -1
- package/dist/chunks/createComponent-Dkt68kvT.cjs +0 -8
- package/dist/chunks/createComponent-Dkt68kvT.cjs.map +0 -1
- package/dist/chunks/useMenu-DewYBiar.cjs +0 -2
- package/dist/chunks/useMenu-DuX7EGHi.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as w,useEffect as _}from"react";import{jsxs as f,jsx as s}from"react/jsx-runtime";import{p as n}from"./index-CZ41y9Hn.js";import{j as o}from"./joinClass-anSpaauN.js";import{S as v}from"./Stack-
|
|
2
|
-
//# sourceMappingURL=DrawerContent-
|
|
1
|
+
import{useState as w,useEffect as _}from"react";import{jsxs as f,jsx as s}from"react/jsx-runtime";import{p as n}from"./index-CZ41y9Hn.js";import{j as o}from"./joinClass-anSpaauN.js";import{S as v}from"./Stack-C2zMFX0w.js";import{c as m}from"./createComponent-D-IheGJm.js";import{B as g}from"./ButtonIcon-mMZe5V_1.js";import{I}from"./Icon-B2zjgYkr.js";function M(t=!1){const[e,r]=w(!1);return _(()=>{r(t)},[t]),[e,()=>{r(i=>!i)}]}function p({open:t,header:e,body:r,footer:c,direction:i="right",onClose:D,...u}){const[d,l]=w({visible:!1,animation:"hide"}),h=300,N=o(`${n}-drawer`,u.className),$=o(`${n}-drawer__content`,`${n}-drawer__content--${i}`,`${n}-drawer__content--${i}--${d.animation}`),b=o(`${n}-drawer__overlay`,`${n}-drawer__overlay--${d.animation}`);_(()=>{let a;if(t){a=y();return}return a=C(),()=>{clearTimeout(a)}},[t]);const y=()=>(l(a=>({...a,visible:!0})),setTimeout(()=>{l(a=>({...a,animation:"show"})),document.body.style.overflow="hidden"},100)),C=()=>(l(a=>({...a,animation:"hide"})),setTimeout(()=>{l(a=>({...a,visible:!1})),document.body.style.overflow=""},h));return d.visible&&f("div",{...u,className:N,children:[f(v,{className:$,children:[e,r,c]}),s("div",{"data-testid":"drawer-overlay",className:b,onClick:D})]})}const R=m(p);function j({children:t,...e}){const r=o(`${n}-drawer__footer`,e.className);return s("div",{...e,className:r,children:t})}const U=m(j);function x({children:t,onClose:e,...r}){const c=o(`${n}-drawer__header`,r.className);return f(v,{flexDirection:"row",alignItems:"center",justifyContent:"space-between",...r,className:c,children:[t,e&&s(g,{onClick:e,color:"grey","aria-label":"Fechar","data-testid":"drawer-close-button",children:s(I,{name:"times"})})]})}const q=m(x);function T({children:t,...e}){const r=o(`${n}-drawer__content__container`,e.className);return s("div",{...e,className:r,children:t})}const z=m(T);export{R as D,z as a,U as b,q as c,M as u};
|
|
2
|
+
//# sourceMappingURL=DrawerContent-OuMcge27.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContent-
|
|
1
|
+
{"version":3,"file":"DrawerContent-OuMcge27.js","sources":["../../src/navigation/Drawer/useDrawer.ts","../../src/navigation/Drawer/Drawer.tsx","../../src/navigation/Drawer/DrawerFooter.tsx","../../src/navigation/Drawer/DrawerHeader.tsx","../../src/navigation/Drawer/DrawerContent.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\ntype UseDrawer = [boolean, () => void]\n\nexport default function useDrawer(open = false): UseDrawer {\n const [_open, setOpen] = useState(false);\n\n useEffect(() => { setOpen(open); }, [open]);\n\n const toogleDrawer = () => { setOpen(prev => !prev); };\n\n return [_open, toogleDrawer];\n}","import { useEffect, useState, type HTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport Stack from '@/layout/Stack';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Drawer.scss';\n\ntype Direction = 'right' | 'left' | 'bottom';\ntype AnimationClass = 'show' | 'hide';\ntype Config = { animation: AnimationClass; visible: boolean };\n\nexport interface DrawerProps extends HTMLAttributes<HTMLDivElement> {\n open: boolean;\n direction?: Direction;\n body: React.JSX.Element;\n header?: React.JSX.Element;\n footer?: React.JSX.Element;\n onClose: () => void;\n};\n\nfunction Drawer({\n open,\n header,\n body,\n footer,\n direction = 'right',\n onClose,\n ...props\n}: DrawerProps) {\n const [config, setConfig] = useState<Config>({ visible: false, animation: 'hide' });\n\n const ANIMATION_DURATION = 300;\n\n const cls = joinClass(\n `${prefix}-drawer`,\n props.className\n );\n\n const contentCls = joinClass(\n `${prefix}-drawer__content`,\n `${prefix}-drawer__content--${direction}`,\n `${prefix}-drawer__content--${direction}--${config.animation}`,\n );\n\n const overlayCls = joinClass(\n `${prefix}-drawer__overlay`,\n `${prefix}-drawer__overlay--${config.animation}`,\n );\n\n useEffect(() => {\n let timer: NodeJS.Timeout;\n\n if (open) {\n timer = handleOpen();\n return;\n }\n\n timer = handleClose();\n\n return () => {\n clearTimeout(timer);\n };\n }, [open]);\n\n const handleOpen = () => {\n setConfig(prev => ({ ...prev, visible: true }));\n\n return setTimeout(() => {\n setConfig(prev => ({ ...prev, animation: 'show' }));\n document.body.style.overflow = 'hidden';\n }, 100);\n };\n\n const handleClose = () => {\n setConfig(prev => ({ ...prev, animation: 'hide' }));\n\n return setTimeout(() => {\n setConfig(prev => ({ ...prev, visible: false }));\n document.body.style.overflow = '';\n }, ANIMATION_DURATION);\n };\n\n return (\n config.visible && (\n <div {...props} className={cls}>\n <Stack className={contentCls}>\n {header}\n {body}\n {footer}\n </Stack>\n <div\n data-testid=\"drawer-overlay\"\n className={overlayCls}\n onClick={onClose}\n />\n </div>\n )\n );\n}\n\nexport default createComponent(Drawer);\n","import { HtmlHTMLAttributes, PropsWithChildren } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '../../core/createComponent';\n\ntype DrawerFooterProps = PropsWithChildren<HtmlHTMLAttributes<HTMLDivElement>>\n\nfunction DrawerFooter({ children, ...props }: DrawerFooterProps) {\n const cls = joinClass(\n `${prefix}-drawer__footer`,\n props.className\n );\n\n return (\n <div {...props} className={cls}>\n {children}\n </div>\n );\n}\n\nexport default createComponent(DrawerFooter);\n","import { HtmlHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport Stack from '@/layout/Stack';\nimport ButtonIcon from '@/actions/ButtonIcon';\nimport Icon from '@/display/Icon';\n\nimport createComponent from '../../core/createComponent';\n\ninterface DrawerHeaderProps extends HtmlHTMLAttributes<HTMLDivElement> {\n onClose: () => void;\n}\n\nfunction DrawerHeader({ children, onClose, ...props }: DrawerHeaderProps) {\n const cls = joinClass(\n `${prefix}-drawer__header`,\n props.className\n );\n\n return (\n <Stack\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n {...props}\n className={cls}\n >\n {children}\n {\n onClose && (\n <ButtonIcon\n onClick={onClose}\n color=\"grey\"\n aria-label=\"Fechar\"\n data-testid=\"drawer-close-button\"\n >\n <Icon name=\"times\" />\n </ButtonIcon>\n )\n }\n </Stack>\n );\n}\n\nexport default createComponent(DrawerHeader);","import { HtmlHTMLAttributes, PropsWithChildren } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '../../core/createComponent';\n\ntype DrawerContentProps = PropsWithChildren<HtmlHTMLAttributes<HTMLDivElement>>\n\nfunction DrawerContent({ children, ...props }: DrawerContentProps) {\n const cls = joinClass(\n `${prefix}-drawer__content__container`,\n props.className\n );\n\n return (\n <div {...props} className={cls}>\n {children}\n </div>\n );\n}\n\nexport default createComponent(DrawerContent);"],"names":["useDrawer","open","_open","setOpen","useState","useEffect","prev","Drawer","header","body","footer","direction","onClose","props","config","setConfig","ANIMATION_DURATION","cls","joinClass","prefix","contentCls","overlayCls","timer","handleOpen","handleClose","jsxs","Stack","jsx","Drawer_default","createComponent","DrawerFooter","children","DrawerFooter_default","DrawerHeader","ButtonIcon","Icon","DrawerHeader_default","DrawerContent","DrawerContent_default"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{useState as c,useEffect as p}from"react";import{w as r}from"./wait-BSgGzoPk.js";function h({children:n,enter:t,delay:s=10,timeout:i=.5,...e}){const[f,o]=c(!1),[l,a]=c({opacity:0});p(()=>{setTimeout(()=>{if(t){u();return}y()},s)},[t]);const u=()=>{o(!0),r(()=>{a({opacity:1})},s)},y=async()=>{a({opacity:0}),await r(()=>{o(!1)},i*1e3)};return f&&m("div",{...e,style:{...l,width:"100%",transition:`all ${i}s cubic-bezier(0.25, 0.1, 0.25, 1)`,...e.style},children:n})}export{h as F};
|
|
2
|
+
//# sourceMappingURL=Fade-CWDTkVB8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fade-CWDTkVB8.js","sources":["../../src/animations/Fade/Fade.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { wait } from '@iziui/toolkit/promise';\n\ntype Style = React.HTMLAttributes<HTMLDivElement>['style'];\n\nexport interface FadeProps extends React.HTMLAttributes<HTMLDivElement> {\n enter: boolean;\n delay?: number;\n timeout?: number;\n}\n\nexport default function Fade({ children, enter, delay = 10, timeout = .5, ...props }: Readonly<FadeProps>) {\n const [isVisible, setIsVisible] = useState(false);\n const [style, setStyle] = useState<Style>({ opacity: 0 });\n\n useEffect(() => {\n setTimeout(() => {\n if (enter) {\n show();\n return;\n }\n\n hide();\n }, delay);\n }, [enter]);\n\n const show = () => {\n setIsVisible(true);\n\n wait(() => {\n setStyle({ opacity: 1, });\n }, delay);\n };\n\n const hide = async () => {\n setStyle({ opacity: 0 });\n\n await wait(() => {\n setIsVisible(false);\n }, timeout * 1000);\n };\n\n return (\n isVisible && (\n <div\n {...props}\n style={{\n ...style,\n width: '100%',\n transition: `all ${timeout}s cubic-bezier(0.25, 0.1, 0.25, 1)`,\n ...props.style\n }}\n >\n {children}\n </div>\n )\n );\n}\n"],"names":["Fade","children","enter","delay","timeout","props","isVisible","setIsVisible","useState","style","setStyle","useEffect","show","hide","wait","jsx"],"mappings":"+HAYA,SAAwBA,EAAK,CAAE,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAQ,GAAI,QAAAC,EAAU,GAAI,GAAGC,GAA8B,CACzG,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAS,EAAK,EAC1C,CAACC,EAAOC,CAAQ,EAAIF,EAAgB,CAAE,QAAS,EAAG,EAExDG,EAAU,IAAM,CACd,WAAW,IAAM,CACf,GAAIT,EAAO,CACTU,EAAA,EACA,MACF,CAEAC,EAAA,CACF,EAAGV,CAAK,CACV,EAAG,CAACD,CAAK,CAAC,EAEV,MAAMU,EAAO,IAAM,CACjBL,EAAa,EAAI,EAEjBO,EAAK,IAAM,CACTJ,EAAS,CAAE,QAAS,EAAI,CAC1B,EAAGP,CAAK,CACV,EAEMU,EAAO,SAAY,CACvBH,EAAS,CAAE,QAAS,EAAG,EAEvB,MAAMI,EAAK,IAAM,CACfP,EAAa,EAAK,CACpB,EAAGH,EAAU,GAAI,CACnB,EAEA,OACEE,GACES,EAAC,MAAA,CACE,GAAGV,EACJ,MAAO,CACL,GAAGI,EACH,MAAO,OACP,WAAY,OAAOL,CAAO,qCAC1B,GAAGC,EAAM,KAAA,EAGV,SAAAJ,CAAA,CAAA,CAIT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const w=require("react/jsx-runtime"),t=require("react"),r=require("./wait-CgS79FV1.cjs");function b({children:u,enter:e,delay:s=10,timeout:i=.5,...a}){const[o,c]=t.useState(!1),[l,n]=t.useState({opacity:0});t.useEffect(()=>{setTimeout(()=>{if(e){y();return}f()},s)},[e]);const y=()=>{c(!0),r.wait(()=>{n({opacity:1})},s)},f=async()=>{n({opacity:0}),await r.wait(()=>{c(!1)},i*1e3)};return o&&w.jsx("div",{...a,style:{...l,width:"100%",transition:`all ${i}s cubic-bezier(0.25, 0.1, 0.25, 1)`,...a.style},children:u})}exports.Fade=b;
|
|
2
|
+
//# sourceMappingURL=Fade-DfxUFkY4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fade-DfxUFkY4.cjs","sources":["../../src/animations/Fade/Fade.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { wait } from '@iziui/toolkit/promise';\n\ntype Style = React.HTMLAttributes<HTMLDivElement>['style'];\n\nexport interface FadeProps extends React.HTMLAttributes<HTMLDivElement> {\n enter: boolean;\n delay?: number;\n timeout?: number;\n}\n\nexport default function Fade({ children, enter, delay = 10, timeout = .5, ...props }: Readonly<FadeProps>) {\n const [isVisible, setIsVisible] = useState(false);\n const [style, setStyle] = useState<Style>({ opacity: 0 });\n\n useEffect(() => {\n setTimeout(() => {\n if (enter) {\n show();\n return;\n }\n\n hide();\n }, delay);\n }, [enter]);\n\n const show = () => {\n setIsVisible(true);\n\n wait(() => {\n setStyle({ opacity: 1, });\n }, delay);\n };\n\n const hide = async () => {\n setStyle({ opacity: 0 });\n\n await wait(() => {\n setIsVisible(false);\n }, timeout * 1000);\n };\n\n return (\n isVisible && (\n <div\n {...props}\n style={{\n ...style,\n width: '100%',\n transition: `all ${timeout}s cubic-bezier(0.25, 0.1, 0.25, 1)`,\n ...props.style\n }}\n >\n {children}\n </div>\n )\n );\n}\n"],"names":["Fade","children","enter","delay","timeout","props","isVisible","setIsVisible","useState","style","setStyle","useEffect","show","hide","wait","jsx"],"mappings":"sGAYA,SAAwBA,EAAK,CAAE,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAQ,GAAI,QAAAC,EAAU,GAAI,GAAGC,GAA8B,CACzG,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAAA,SAAS,EAAK,EAC1C,CAACC,EAAOC,CAAQ,EAAIF,EAAAA,SAAgB,CAAE,QAAS,EAAG,EAExDG,EAAAA,UAAU,IAAM,CACd,WAAW,IAAM,CACf,GAAIT,EAAO,CACTU,EAAA,EACA,MACF,CAEAC,EAAA,CACF,EAAGV,CAAK,CACV,EAAG,CAACD,CAAK,CAAC,EAEV,MAAMU,EAAO,IAAM,CACjBL,EAAa,EAAI,EAEjBO,EAAAA,KAAK,IAAM,CACTJ,EAAS,CAAE,QAAS,EAAI,CAC1B,EAAGP,CAAK,CACV,EAEMU,EAAO,SAAY,CACvBH,EAAS,CAAE,QAAS,EAAG,EAEvB,MAAMI,EAAAA,KAAK,IAAM,CACfP,EAAa,EAAK,CACpB,EAAGH,EAAU,GAAI,CACnB,EAEA,OACEE,GACES,EAAAA,IAAC,MAAA,CACE,GAAGV,EACJ,MAAO,CACL,GAAGI,EACH,MAAO,OACP,WAAY,OAAOL,CAAO,qCAC1B,GAAGC,EAAM,KAAA,EAGV,SAAAJ,CAAA,CAAA,CAIT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{p as t}from"./index-CZ41y9Hn.js";import{j as m}from"./joinClass-anSpaauN.js";import{c as a}from"./createComponent-
|
|
2
|
-
//# sourceMappingURL=Icon-
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{p as t}from"./index-CZ41y9Hn.js";import{j as m}from"./joinClass-anSpaauN.js";import{c as a}from"./createComponent-D-IheGJm.js";function r({name:i,color:s,size:n=24,...o}){const c=m(`${t}-icon`,s&&`${t}-icon--${s}`,"uil",`uil-${i}`,o.className);return e("i",{...o,className:c,style:{fontSize:n,...o.style}})}const u=a(r);export{u as I};
|
|
2
|
+
//# sourceMappingURL=Icon-B2zjgYkr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon-
|
|
1
|
+
{"version":3,"file":"Icon-B2zjgYkr.js","sources":["../../src/display/Icon/Icon.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\nimport type { Colors } from '@iziui/core/theme';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Icon.scss';\n\nexport interface IconProps extends HTMLAttributes<HTMLElement> {\n name: string;\n size?: number;\n color?: Colors;\n}\n\nfunction Icon({ name, color, size = 24, ...props }: IconProps) {\n const clss = joinClass(\n `${prefix}-icon`,\n color && `${prefix}-icon--${color}`,\n 'uil',\n `uil-${name}`,\n props.className\n );\n\n return (\n <i {...props} className={clss} style={{ fontSize: size, ...props.style }}></i>\n );\n}\n\nexport default createComponent(Icon);"],"names":["Icon","name","color","size","props","clss","joinClass","prefix","jsx","Icon$1","createComponent"],"mappings":"8KAiBA,SAASA,EAAK,CAAE,KAAAC,EAAM,MAAAC,EAAO,KAAAC,EAAO,GAAI,GAAGC,GAAoB,CAC7D,MAAMC,EAAOC,EACX,GAAGC,CAAM,QACTL,GAAS,GAAGK,CAAM,UAAUL,CAAK,GACjC,MACA,OAAOD,CAAI,GACXG,EAAM,SAAA,EAGR,OACEI,EAAC,IAAA,CAAG,GAAGJ,EAAO,UAAWC,EAAM,MAAO,CAAE,SAAUF,EAAM,GAAGC,EAAM,MAAM,CAAG,CAE9E,CAEA,MAAAK,EAAeC,EAAgBV,CAAI"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),s=require("./index-DYxwT4uW.cjs"),r=require("./joinClass-Jk3EszKD.cjs"),u=require("./createComponent-
|
|
2
|
-
//# sourceMappingURL=Icon-
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),s=require("./index-DYxwT4uW.cjs"),r=require("./joinClass-Jk3EszKD.cjs"),u=require("./createComponent-B2C4sTOb.cjs");function a({name:i,color:n,size:t=24,...e}){const c=r.joinClass(`${s.prefix}-icon`,n&&`${s.prefix}-icon--${n}`,"uil",`uil-${i}`,e.className);return o.jsx("i",{...e,className:c,style:{fontSize:t,...e.style}})}const l=u.createComponent(a);exports.Icon=l;
|
|
2
|
+
//# sourceMappingURL=Icon-CFvy-l1V.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon-
|
|
1
|
+
{"version":3,"file":"Icon-CFvy-l1V.cjs","sources":["../../src/display/Icon/Icon.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\nimport type { Colors } from '@iziui/core/theme';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Icon.scss';\n\nexport interface IconProps extends HTMLAttributes<HTMLElement> {\n name: string;\n size?: number;\n color?: Colors;\n}\n\nfunction Icon({ name, color, size = 24, ...props }: IconProps) {\n const clss = joinClass(\n `${prefix}-icon`,\n color && `${prefix}-icon--${color}`,\n 'uil',\n `uil-${name}`,\n props.className\n );\n\n return (\n <i {...props} className={clss} style={{ fontSize: size, ...props.style }}></i>\n );\n}\n\nexport default createComponent(Icon);"],"names":["Icon","name","color","size","props","clss","joinClass","prefix","jsx","createComponent"],"mappings":"sKAiBA,SAASA,EAAK,CAAE,KAAAC,EAAM,MAAAC,EAAO,KAAAC,EAAO,GAAI,GAAGC,GAAoB,CAC7D,MAAMC,EAAOC,EAAAA,UACX,GAAGC,EAAAA,MAAM,QACTL,GAAS,GAAGK,EAAAA,MAAM,UAAUL,CAAK,GACjC,MACA,OAAOD,CAAI,GACXG,EAAM,SAAA,EAGR,OACEI,EAAAA,IAAC,IAAA,CAAG,GAAGJ,EAAO,UAAWC,EAAM,MAAO,CAAE,SAAUF,EAAM,GAAGC,EAAM,MAAM,CAAG,CAE9E,CAEA,MAAAJ,EAAeS,EAAAA,gBAAgBT,CAAI"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{p as r}from"./index-CZ41y9Hn.js";import{c as m}from"./convertPathToColor-DtOjH4ZP.js";import{j as n}from"./joinClass-anSpaauN.js";import{c as l}from"./createComponent-D-IheGJm.js";import{u as d}from"./useTheme-BYuNiCiH.js";function f({color:t="primary",size:a="1.5rem",...o}){const{theme:{palette:i}}=d(),s=m(`${t}.main`,i),c=n(`${r}-loading`,o.className);return e("span",{...o,className:c,style:{...o,color:s,width:a,height:a},children:e("svg",{className:`${r}-loading__svg`,viewBox:"22 22 44 44",children:e("circle",{className:`${r}-loading__circle`,cx:"44",cy:"44",r:"20.2",fill:"none",strokeWidth:"3.6"})})})}const v=l(f);export{v as L};
|
|
2
|
+
//# sourceMappingURL=Loading-CD7bT3lU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loading-CD7bT3lU.js","sources":["../../src/feedback/Loading/Loading.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { Colors } from '@iziui/core/theme';\nimport { convertPathToColor, joinClass } from '@iziui/core/utils';\n\nimport createComponent from '../../core/createComponent';\nimport { useTheme } from '../../theme';\n\nimport '@iziui/styles/components/Loading.scss';\n\nexport interface LoadingProps extends HTMLAttributes<HTMLSpanElement> {\n color?: Colors;\n size?: number | string;\n}\nfunction Loading({ color = 'primary', size = '1.5rem', ...props }: LoadingProps) {\n const { theme: { palette } } = useTheme();\n\n const c = convertPathToColor(`${color}.main`, palette);\n\n const className = joinClass(`${prefix}-loading`, props.className);\n\n return (\n <span {...props} className={className} style={{ ...props, color: c, width: size, height: size }}>\n <svg className={`${prefix}-loading__svg`} viewBox=\"22 22 44 44\">\n <circle className={`${prefix}-loading__circle`} cx=\"44\" cy=\"44\" r=\"20.2\" fill=\"none\" strokeWidth=\"3.6\" />\n </svg>\n </span>\n );\n}\n\nexport default createComponent(Loading);"],"names":["Loading","color","size","props","palette","useTheme","c","convertPathToColor","className","joinClass","prefix","jsx","Loading$1","createComponent"],"mappings":"8QAgBA,SAASA,EAAQ,CAAE,MAAAC,EAAQ,UAAW,KAAAC,EAAO,SAAU,GAAGC,GAAuB,CAC/E,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAA,EAEzBC,EAAIC,EAAmB,GAAGN,CAAK,QAASG,CAAO,EAE/CI,EAAYC,EAAU,GAAGC,CAAM,WAAYP,EAAM,SAAS,EAEhE,SACG,OAAA,CAAM,GAAGA,EAAO,UAAAK,EAAsB,MAAO,CAAE,GAAGL,EAAO,MAAOG,EAAG,MAAOJ,EAAM,OAAQA,GACvF,SAAAS,EAAC,OAAI,UAAW,GAAGD,CAAM,gBAAiB,QAAQ,cAChD,SAAAC,EAAC,UAAO,UAAW,GAAGD,CAAM,mBAAoB,GAAG,KAAK,GAAG,KAAK,EAAE,OAAO,KAAK,OAAO,YAAY,KAAA,CAAM,EACzG,EACF,CAEJ,CAEA,MAAAE,EAAeC,EAAgBb,CAAO"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),o=require("./index-DYxwT4uW.cjs"),a=require("./convertPathToColor-D8eBpd_D.cjs"),l=require("./joinClass-Jk3EszKD.cjs"),m=require("./createComponent-B2C4sTOb.cjs"),u=require("./useTheme-DsrjDJKC.cjs");function d({color:s="primary",size:r="1.5rem",...e}){const{theme:{palette:i}}=u.useTheme(),t=a.convertPathToColor(`${s}.main`,i),c=l.joinClass(`${o.prefix}-loading`,e.className);return n.jsx("span",{...e,className:c,style:{...e,color:t,width:r,height:r},children:n.jsx("svg",{className:`${o.prefix}-loading__svg`,viewBox:"22 22 44 44",children:n.jsx("circle",{className:`${o.prefix}-loading__circle`,cx:"44",cy:"44",r:"20.2",fill:"none",strokeWidth:"3.6"})})})}const h=m.createComponent(d);exports.Loading=h;
|
|
2
|
+
//# sourceMappingURL=Loading-zx7Fg7_c.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loading-zx7Fg7_c.cjs","sources":["../../src/feedback/Loading/Loading.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { Colors } from '@iziui/core/theme';\nimport { convertPathToColor, joinClass } from '@iziui/core/utils';\n\nimport createComponent from '../../core/createComponent';\nimport { useTheme } from '../../theme';\n\nimport '@iziui/styles/components/Loading.scss';\n\nexport interface LoadingProps extends HTMLAttributes<HTMLSpanElement> {\n color?: Colors;\n size?: number | string;\n}\nfunction Loading({ color = 'primary', size = '1.5rem', ...props }: LoadingProps) {\n const { theme: { palette } } = useTheme();\n\n const c = convertPathToColor(`${color}.main`, palette);\n\n const className = joinClass(`${prefix}-loading`, props.className);\n\n return (\n <span {...props} className={className} style={{ ...props, color: c, width: size, height: size }}>\n <svg className={`${prefix}-loading__svg`} viewBox=\"22 22 44 44\">\n <circle className={`${prefix}-loading__circle`} cx=\"44\" cy=\"44\" r=\"20.2\" fill=\"none\" strokeWidth=\"3.6\" />\n </svg>\n </span>\n );\n}\n\nexport default createComponent(Loading);"],"names":["Loading","color","size","props","palette","useTheme","c","convertPathToColor","className","joinClass","prefix","jsx","createComponent"],"mappings":"0PAgBA,SAASA,EAAQ,CAAE,MAAAC,EAAQ,UAAW,KAAAC,EAAO,SAAU,GAAGC,GAAuB,CAC/E,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAAA,SAAA,EAEzBC,EAAIC,EAAAA,mBAAmB,GAAGN,CAAK,QAASG,CAAO,EAE/CI,EAAYC,EAAAA,UAAU,GAAGC,EAAAA,MAAM,WAAYP,EAAM,SAAS,EAEhE,aACG,OAAA,CAAM,GAAGA,EAAO,UAAAK,EAAsB,MAAO,CAAE,GAAGL,EAAO,MAAOG,EAAG,MAAOJ,EAAM,OAAQA,GACvF,SAAAS,EAAAA,IAAC,OAAI,UAAW,GAAGD,EAAAA,MAAM,gBAAiB,QAAQ,cAChD,SAAAC,EAAAA,IAAC,UAAO,UAAW,GAAGD,EAAAA,MAAM,mBAAoB,GAAG,KAAK,GAAG,KAAK,EAAE,OAAO,KAAK,OAAO,YAAY,KAAA,CAAM,EACzG,EACF,CAEJ,CAEA,MAAAV,EAAeY,EAAAA,gBAAgBZ,CAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),c=require("react"),s=require("./index-DYxwT4uW.cjs"),a=require("./joinClass-Jk3EszKD.cjs"),l=require("./Ripple-Dy4i91j1.cjs"),m=require("./createComponent-
|
|
2
|
-
//# sourceMappingURL=MenuButton-
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),c=require("react"),s=require("./index-DYxwT4uW.cjs"),a=require("./joinClass-Jk3EszKD.cjs"),l=require("./Ripple-Dy4i91j1.cjs"),m=require("./createComponent-B2C4sTOb.cjs");function p({label:u,icon:e,color:n="grey",...t}){const i=a.joinClass(`${s.prefix}-menu__item`,n&&`${s.prefix}-menu__item--${n}`,t.className),o=()=>e&&c.cloneElement(e,{size:18,style:{marginRight:8}});return r.jsxs("button",{...t,className:i,children:[o(),u,r.jsx(l.Ripple,{})]})}const q=m.createComponent(p);exports.MenuButton_default=q;
|
|
2
|
+
//# sourceMappingURL=MenuButton-CsePYu0b.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton-
|
|
1
|
+
{"version":3,"file":"MenuButton-CsePYu0b.cjs","sources":["../../src/navigation/Menu/MenuButton.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, cloneElement } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport type { Colors } from '@iziui/core/theme';\n\nimport type { IconProps } from '@/display/Icon';\nimport Ripple from '@/actions/Ripple';\n\nimport createComponent from '../../core/createComponent';\n\nexport interface MenuButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n label: string;\n color?: Colors;\n icon?: React.JSX.Element;\n}\n\nfunction MenuButton({ label, icon, color = 'grey', ...props }: MenuButtonProps) {\n const className = joinClass(\n `${prefix}-menu__item`,\n color && `${prefix}-menu__item--${color}`,\n props.className\n );\n\n const renderIcon = () => {\n return icon && cloneElement<IconProps>(icon, {\n size: 18,\n style: { marginRight: 8 }\n });\n };\n\n return (\n <button {...props} className={className}>\n {renderIcon()}\n {label}\n <Ripple />\n </button>\n );\n}\n\nexport default createComponent(MenuButton);"],"names":["MenuButton","label","icon","color","props","className","joinClass","prefix","renderIcon","cloneElement","jsxs","Ripple","MenuButton_default","createComponent"],"mappings":"4NAkBA,SAASA,EAAW,CAAE,MAAAC,EAAO,KAAAC,EAAM,MAAAC,EAAQ,OAAQ,GAAGC,GAA0B,CAC9E,MAAMC,EAAYC,EAAAA,UAChB,GAAGC,EAAAA,MAAM,cACTJ,GAAS,GAAGI,EAAAA,MAAM,gBAAgBJ,CAAK,GACvCC,EAAM,SAAA,EAGFI,EAAa,IACVN,GAAQO,EAAAA,aAAwBP,EAAM,CAC3C,KAAM,GACN,MAAO,CAAE,YAAa,CAAA,CAAE,CACzB,EAGH,OACEQ,EAAAA,KAAC,SAAA,CAAQ,GAAGN,EAAO,UAAAC,EAChB,SAAA,CAAAG,EAAA,EACAP,QACAU,EAAAA,OAAA,CAAA,CAAO,CAAA,EACV,CAEJ,CAEA,MAAAC,EAAeC,EAAAA,gBAAgBb,CAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as s,jsx as i}from"react/jsx-runtime";import{cloneElement as a}from"react";import{p as r}from"./index-CZ41y9Hn.js";import{j as u}from"./joinClass-anSpaauN.js";import{R as c}from"./Ripple-Bq9bxg4k.js";import{c as p}from"./createComponent-
|
|
2
|
-
//# sourceMappingURL=MenuButton-
|
|
1
|
+
import{jsxs as s,jsx as i}from"react/jsx-runtime";import{cloneElement as a}from"react";import{p as r}from"./index-CZ41y9Hn.js";import{j as u}from"./joinClass-anSpaauN.js";import{R as c}from"./Ripple-Bq9bxg4k.js";import{c as p}from"./createComponent-D-IheGJm.js";function f({label:o,icon:e,color:t="grey",...n}){const m=u(`${r}-menu__item`,t&&`${r}-menu__item--${t}`,n.className);return s("button",{...n,className:m,children:[e&&a(e,{size:18,style:{marginRight:8}}),o,i(c,{})]})}const R=p(f);export{R as M};
|
|
2
|
+
//# sourceMappingURL=MenuButton-nVBc0ieJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton-
|
|
1
|
+
{"version":3,"file":"MenuButton-nVBc0ieJ.js","sources":["../../src/navigation/Menu/MenuButton.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, cloneElement } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport type { Colors } from '@iziui/core/theme';\n\nimport type { IconProps } from '@/display/Icon';\nimport Ripple from '@/actions/Ripple';\n\nimport createComponent from '../../core/createComponent';\n\nexport interface MenuButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n label: string;\n color?: Colors;\n icon?: React.JSX.Element;\n}\n\nfunction MenuButton({ label, icon, color = 'grey', ...props }: MenuButtonProps) {\n const className = joinClass(\n `${prefix}-menu__item`,\n color && `${prefix}-menu__item--${color}`,\n props.className\n );\n\n const renderIcon = () => {\n return icon && cloneElement<IconProps>(icon, {\n size: 18,\n style: { marginRight: 8 }\n });\n };\n\n return (\n <button {...props} className={className}>\n {renderIcon()}\n {label}\n <Ripple />\n </button>\n );\n}\n\nexport default createComponent(MenuButton);"],"names":["MenuButton","label","icon","color","props","className","joinClass","prefix","jsxs","cloneElement","Ripple","MenuButton_default","createComponent"],"mappings":"sQAkBA,SAASA,EAAW,CAAE,MAAAC,EAAO,KAAAC,EAAM,MAAAC,EAAQ,OAAQ,GAAGC,GAA0B,CAC9E,MAAMC,EAAYC,EAChB,GAAGC,CAAM,cACTJ,GAAS,GAAGI,CAAM,gBAAgBJ,CAAK,GACvCC,EAAM,SAAA,EAUR,OACEI,EAAC,SAAA,CAAQ,GAAGJ,EAAO,UAAAC,EAChB,SAAA,CARIH,GAAQO,EAAwBP,EAAM,CAC3C,KAAM,GACN,MAAO,CAAE,YAAa,CAAA,CAAE,CACzB,EAMED,IACAS,EAAA,CAAA,CAAO,CAAA,EACV,CAEJ,CAEA,MAAAC,EAAeC,EAAgBZ,CAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as l}from"react/jsx-runtime";import{forwardRef as p}from"react";import{p as k}from"./index-CZ41y9Hn.js";import{j as u}from"./joinClass-anSpaauN.js";import{c as x}from"./createComponent-
|
|
2
|
-
//# sourceMappingURL=Stack-
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{forwardRef as p}from"react";import{p as k}from"./index-CZ41y9Hn.js";import{j as u}from"./joinClass-anSpaauN.js";import{c as x}from"./createComponent-D-IheGJm.js";const C=p(function({children:s,tag:a="div",gap:o=16,alignSelf:r,flexWrap:m="nowrap",alignItems:c="flex-start",flexDirection:e="column",justifyContent:n="flex-start",...t},f){const i=u(`${k}-stack`,t.className);return l(a,{...t,ref:f,className:i,style:{gap:o,flexWrap:m,alignItems:c,alignSelf:r,flexDirection:e,justifyContent:n,...t.style},children:s})}),T=x(C);export{T as S};
|
|
2
|
+
//# sourceMappingURL=Stack-C2zMFX0w.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack-
|
|
1
|
+
{"version":3,"file":"Stack-C2zMFX0w.js","sources":["../../src/layout/Stack/Stack.tsx"],"sourcesContent":["import type { HTMLAttributes, CSSProperties } from 'react';\nimport { forwardRef } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Stack.scss';\n\nexport interface StackProps extends HTMLAttributes<HTMLElement> {\n tag?: React.ElementType;\n gap?: number;\n flexDirection?: CSSProperties['flexDirection'];\n justifyContent?: CSSProperties['justifyContent'];\n alignItems?: CSSProperties['alignItems'];\n alignSelf?: CSSProperties['alignSelf'];\n flexWrap?: CSSProperties['flexWrap'];\n}\n\nconst Stack = forwardRef<HTMLElement, StackProps>(\n function Stack(\n {\n children,\n tag = 'div',\n gap = 16,\n alignSelf,\n flexWrap = 'nowrap',\n alignItems = 'flex-start',\n flexDirection = 'column',\n justifyContent = 'flex-start',\n ...props\n },\n ref\n ) {\n const stackClasses = joinClass(\n `${prefix}-stack`,\n props.className\n );\n\n const CustomTag = tag;\n\n return (\n <CustomTag\n {...props}\n ref={ref}\n className={stackClasses}\n style={{\n gap,\n flexWrap,\n alignItems,\n alignSelf,\n flexDirection,\n justifyContent,\n ...props.style,\n }}\n >\n {children}\n </CustomTag>\n );\n }\n);\n\nexport default createComponent(Stack);\n"],"names":["Stack","forwardRef","children","tag","gap","alignSelf","flexWrap","alignItems","flexDirection","justifyContent","props","ref","stackClasses","joinClass","prefix","jsx","Stack$1","createComponent"],"mappings":"iNAqBA,MAAMA,EAAQC,EACZ,SACE,CACE,SAAAC,EACA,IAAAC,EAAM,MACN,IAAAC,EAAM,GACN,UAAAC,EACA,SAAAC,EAAW,SACX,WAAAC,EAAa,aACb,cAAAC,EAAgB,SAChB,eAAAC,EAAiB,aACjB,GAAGC,CAAA,EAELC,EACA,CACA,MAAMC,EAAeC,EACnB,GAAGC,CAAM,SACTJ,EAAM,SAAA,EAKR,OACEK,EAHgBZ,EAGf,CACE,GAAGO,EACJ,IAAAC,EACA,UAAWC,EACX,MAAO,CACL,IAAAR,EACA,SAAAE,EACA,WAAAC,EACA,UAAAF,EACA,cAAAG,EACA,eAAAC,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAR,CAAA,CAAA,CAGP,CACF,EAEAc,EAAeC,EAAgBjB,CAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const f=require("react/jsx-runtime"),k=require("react"),x=require("./index-DYxwT4uW.cjs"),C=require("./joinClass-Jk3EszKD.cjs"),q=require("./createComponent-
|
|
2
|
-
//# sourceMappingURL=Stack-
|
|
1
|
+
"use strict";const f=require("react/jsx-runtime"),k=require("react"),x=require("./index-DYxwT4uW.cjs"),C=require("./joinClass-Jk3EszKD.cjs"),q=require("./createComponent-B2C4sTOb.cjs"),j=k.forwardRef(function({children:e,tag:s="div",gap:c=16,alignSelf:n,flexWrap:a="nowrap",alignItems:r="flex-start",flexDirection:o="column",justifyContent:i="flex-start",...t},u){const l=C.joinClass(`${x.prefix}-stack`,t.className),m=s;return f.jsx(m,{...t,ref:u,className:l,style:{gap:c,flexWrap:a,alignItems:r,alignSelf:n,flexDirection:o,justifyContent:i,...t.style},children:e})}),S=q.createComponent(j);exports.Stack=S;
|
|
2
|
+
//# sourceMappingURL=Stack-lvjI3kV3.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack-
|
|
1
|
+
{"version":3,"file":"Stack-lvjI3kV3.cjs","sources":["../../src/layout/Stack/Stack.tsx"],"sourcesContent":["import type { HTMLAttributes, CSSProperties } from 'react';\nimport { forwardRef } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Stack.scss';\n\nexport interface StackProps extends HTMLAttributes<HTMLElement> {\n tag?: React.ElementType;\n gap?: number;\n flexDirection?: CSSProperties['flexDirection'];\n justifyContent?: CSSProperties['justifyContent'];\n alignItems?: CSSProperties['alignItems'];\n alignSelf?: CSSProperties['alignSelf'];\n flexWrap?: CSSProperties['flexWrap'];\n}\n\nconst Stack = forwardRef<HTMLElement, StackProps>(\n function Stack(\n {\n children,\n tag = 'div',\n gap = 16,\n alignSelf,\n flexWrap = 'nowrap',\n alignItems = 'flex-start',\n flexDirection = 'column',\n justifyContent = 'flex-start',\n ...props\n },\n ref\n ) {\n const stackClasses = joinClass(\n `${prefix}-stack`,\n props.className\n );\n\n const CustomTag = tag;\n\n return (\n <CustomTag\n {...props}\n ref={ref}\n className={stackClasses}\n style={{\n gap,\n flexWrap,\n alignItems,\n alignSelf,\n flexDirection,\n justifyContent,\n ...props.style,\n }}\n >\n {children}\n </CustomTag>\n );\n }\n);\n\nexport default createComponent(Stack);\n"],"names":["Stack","forwardRef","children","tag","gap","alignSelf","flexWrap","alignItems","flexDirection","justifyContent","props","ref","stackClasses","joinClass","prefix","CustomTag","jsx","createComponent"],"mappings":"yLAqBMA,EAAQC,EAAAA,WACZ,SACE,CACE,SAAAC,EACA,IAAAC,EAAM,MACN,IAAAC,EAAM,GACN,UAAAC,EACA,SAAAC,EAAW,SACX,WAAAC,EAAa,aACb,cAAAC,EAAgB,SAChB,eAAAC,EAAiB,aACjB,GAAGC,CAAA,EAELC,EACA,CACA,MAAMC,EAAeC,EAAAA,UACnB,GAAGC,EAAAA,MAAM,SACTJ,EAAM,SAAA,EAGFK,EAAYZ,EAElB,OACEa,EAAAA,IAACD,EAAA,CACE,GAAGL,EACJ,IAAAC,EACA,UAAWC,EACX,MAAO,CACL,IAAAR,EACA,SAAAE,EACA,WAAAC,EACA,UAAAF,EACA,cAAAG,EACA,eAAAC,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAR,CAAA,CAAA,CAGP,CACF,EAEAF,EAAeiB,EAAAA,gBAAgBjB,CAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as l}from"react/jsx-runtime";import{p as s}from"./index-CZ41y9Hn.js";import{j as o}from"./joinClass-anSpaauN.js";import{c as r}from"./createComponent-
|
|
2
|
-
//# sourceMappingURL=TableHeader-
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{p as s}from"./index-CZ41y9Hn.js";import{j as o}from"./joinClass-anSpaauN.js";import{c as r}from"./createComponent-D-IheGJm.js";import{C as n}from"./Card-DDRUwdlG.js";function m({children:a,...e}){const t=o(`${s}-table`,e.className);return l(n,{fullWidth:!0,style:{overflow:"auto"},children:l("table",{className:t,...e,children:a})})}const p=r(m);function b({children:a,...e}){const t=o(`${s}-table__body`,e.className);return l("tbody",{className:t,...e,children:a})}b.displayName="TableBody";function d({align:a="left",children:e,...t}){const c=o(`${s}-table__cell`,`${s}-table__cell--${a}`);return l("td",{className:c,...t,children:e})}const y=r(d);function i({children:a}){const e=o(`${s}-table__header`);return l("thead",{className:e,children:l("tr",{children:a})})}i.displayName="TableHeader";export{p as T,b as a,y as b,i as c};
|
|
2
|
+
//# sourceMappingURL=TableHeader-Bra59bV0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeader-
|
|
1
|
+
{"version":3,"file":"TableHeader-Bra59bV0.js","sources":["../../src/display/Table/Table.tsx","../../src/display/Table/TableBody.tsx","../../src/display/Table/TableCell.tsx","../../src/display/Table/TableHeader.tsx"],"sourcesContent":["import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '@/core/createComponent';\n\nimport { Card } from '../Card';\n\nimport '@iziui/styles/components/Table.scss';\n\nexport type TableProps = TableHTMLAttributes<HTMLTableElement>;\n\nfunction Table({ children, ...props }: TableProps) {\n const cls = joinClass(\n `${prefix}-table`,\n props.className\n );\n\n return (\n <Card fullWidth style={{ overflow: 'auto' }}>\n <table className={cls} {...props}>\n {children}\n </table>\n </Card>\n );\n}\n\nexport default createComponent(Table);\n","import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\ninterface TableBodyProps extends TableHTMLAttributes<HTMLTableSectionElement> {\n children: React.ReactNode;\n}\n\nfunction TableBody({ children, ...props }: TableBodyProps) {\n\n const cls = joinClass(\n `${prefix}-table__body`,\n props.className\n );\n\n return (\n <tbody className={cls} {...props}>\n {children}\n </tbody>\n );\n}\n\nTableBody.displayName = 'TableBody';\n\nexport default TableBody;","import { TdHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '../../core/createComponent';\n\ninterface TableCellProps extends TdHTMLAttributes<HTMLTableDataCellElement> {\n align?: 'left' | 'center' | 'right';\n children: React.JSX.Element | string | number | null;\n}\nfunction TableCell({ align = 'left', children, ...props }: TableCellProps) {\n const className = joinClass(\n `${prefix}-table__cell`,\n `${prefix}-table__cell--${align}`,\n );\n\n return (\n <td className={className} {...props}>\n {children}\n </td>\n );\n}\n\nexport default createComponent(TableCell);","import type { PropsWithChildren } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nfunction TableHeader({ children }: PropsWithChildren) {\n const className = joinClass(\n `${prefix}-table__header`,\n );\n\n return (\n <thead className={className}>\n <tr>\n {children}\n </tr>\n </thead>\n );\n}\n\nTableHeader.displayName = 'TableHeader';\n\nexport default TableHeader;"],"names":["Table","children","props","cls","joinClass","prefix","Card","jsx","Table_default","createComponent","TableBody","TableCell","align","className","TableCell_default","TableHeader"],"mappings":"qNAcA,SAASA,EAAM,CAAE,SAAAC,EAAU,GAAGC,GAAqB,CACjD,MAAMC,EAAMC,EACV,GAAGC,CAAM,SACTH,EAAM,SAAA,EAGR,SACGI,EAAA,CAAK,UAAS,GAAC,MAAO,CAAE,SAAU,MAAA,EACjC,SAAAC,EAAC,SAAM,UAAWJ,EAAM,GAAGD,EACxB,SAAAD,EACH,EACF,CAEJ,CAEA,MAAAO,EAAeC,EAAgBT,CAAK,ECnBpC,SAASU,EAAU,CAAE,SAAAT,EAAU,GAAGC,GAAyB,CAEzD,MAAMC,EAAMC,EACV,GAAGC,CAAM,eACTH,EAAM,SAAA,EAGR,SACG,QAAA,CAAM,UAAWC,EAAM,GAAGD,EACxB,SAAAD,EACH,CAEJ,CAEAS,EAAU,YAAc,YCZxB,SAASC,EAAU,CAAE,MAAAC,EAAQ,OAAQ,SAAAX,EAAU,GAAGC,GAAyB,CACzE,MAAMW,EAAYT,EAChB,GAAGC,CAAM,eACT,GAAGA,CAAM,iBAAiBO,CAAK,EAAA,EAGjC,OACEL,EAAC,KAAA,CAAG,UAAAM,EAAuB,GAAGX,EAC3B,SAAAD,EACH,CAEJ,CAEA,MAAAa,EAAeL,EAAgBE,CAAS,ECnBxC,SAASI,EAAY,CAAE,SAAAd,GAA+B,CACpD,MAAMY,EAAYT,EAChB,GAAGC,CAAM,gBAAA,EAGX,SACG,QAAA,CAAM,UAAAQ,EACL,SAAAN,EAAC,KAAA,CACE,SAAAN,EACH,EACF,CAEJ,CAEAc,EAAY,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const l=require("react/jsx-runtime"),s=require("./index-DYxwT4uW.cjs"),n=require("./joinClass-Jk3EszKD.cjs"),r=require("./createComponent-
|
|
2
|
-
//# sourceMappingURL=TableHeader-
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),s=require("./index-DYxwT4uW.cjs"),n=require("./joinClass-Jk3EszKD.cjs"),r=require("./createComponent-B2C4sTOb.cjs"),d=require("./Card-CcOpPKfS.cjs");function u({children:a,...e}){const t=n.joinClass(`${s.prefix}-table`,e.className);return l.jsx(d.Card,{fullWidth:!0,style:{overflow:"auto"},children:l.jsx("table",{className:t,...e,children:a})})}const b=r.createComponent(u);function o({children:a,...e}){const t=n.joinClass(`${s.prefix}-table__body`,e.className);return l.jsx("tbody",{className:t,...e,children:a})}o.displayName="TableBody";function f({align:a="left",children:e,...t}){const i=n.joinClass(`${s.prefix}-table__cell`,`${s.prefix}-table__cell--${a}`);return l.jsx("td",{className:i,...t,children:e})}const x=r.createComponent(f);function c({children:a}){const e=n.joinClass(`${s.prefix}-table__header`);return l.jsx("thead",{className:e,children:l.jsx("tr",{children:a})})}c.displayName="TableHeader";exports.TableBody=o;exports.TableCell_default=x;exports.TableHeader=c;exports.Table_default=b;
|
|
2
|
+
//# sourceMappingURL=TableHeader-D_fGRq9B.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeader-
|
|
1
|
+
{"version":3,"file":"TableHeader-D_fGRq9B.cjs","sources":["../../src/display/Table/Table.tsx","../../src/display/Table/TableBody.tsx","../../src/display/Table/TableCell.tsx","../../src/display/Table/TableHeader.tsx"],"sourcesContent":["import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '@/core/createComponent';\n\nimport { Card } from '../Card';\n\nimport '@iziui/styles/components/Table.scss';\n\nexport type TableProps = TableHTMLAttributes<HTMLTableElement>;\n\nfunction Table({ children, ...props }: TableProps) {\n const cls = joinClass(\n `${prefix}-table`,\n props.className\n );\n\n return (\n <Card fullWidth style={{ overflow: 'auto' }}>\n <table className={cls} {...props}>\n {children}\n </table>\n </Card>\n );\n}\n\nexport default createComponent(Table);\n","import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\ninterface TableBodyProps extends TableHTMLAttributes<HTMLTableSectionElement> {\n children: React.ReactNode;\n}\n\nfunction TableBody({ children, ...props }: TableBodyProps) {\n\n const cls = joinClass(\n `${prefix}-table__body`,\n props.className\n );\n\n return (\n <tbody className={cls} {...props}>\n {children}\n </tbody>\n );\n}\n\nTableBody.displayName = 'TableBody';\n\nexport default TableBody;","import { TdHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '../../core/createComponent';\n\ninterface TableCellProps extends TdHTMLAttributes<HTMLTableDataCellElement> {\n align?: 'left' | 'center' | 'right';\n children: React.JSX.Element | string | number | null;\n}\nfunction TableCell({ align = 'left', children, ...props }: TableCellProps) {\n const className = joinClass(\n `${prefix}-table__cell`,\n `${prefix}-table__cell--${align}`,\n );\n\n return (\n <td className={className} {...props}>\n {children}\n </td>\n );\n}\n\nexport default createComponent(TableCell);","import type { PropsWithChildren } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nfunction TableHeader({ children }: PropsWithChildren) {\n const className = joinClass(\n `${prefix}-table__header`,\n );\n\n return (\n <thead className={className}>\n <tr>\n {children}\n </tr>\n </thead>\n );\n}\n\nTableHeader.displayName = 'TableHeader';\n\nexport default TableHeader;"],"names":["Table","children","props","cls","joinClass","prefix","Card","jsx","Table_default","createComponent","TableBody","TableCell","align","className","TableCell_default","TableHeader"],"mappings":"uMAcA,SAASA,EAAM,CAAE,SAAAC,EAAU,GAAGC,GAAqB,CACjD,MAAMC,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,SACTH,EAAM,SAAA,EAGR,aACGI,EAAAA,KAAA,CAAK,UAAS,GAAC,MAAO,CAAE,SAAU,MAAA,EACjC,SAAAC,MAAC,SAAM,UAAWJ,EAAM,GAAGD,EACxB,SAAAD,EACH,EACF,CAEJ,CAEA,MAAAO,EAAeC,EAAAA,gBAAgBT,CAAK,ECnBpC,SAASU,EAAU,CAAE,SAAAT,EAAU,GAAGC,GAAyB,CAEzD,MAAMC,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,eACTH,EAAM,SAAA,EAGR,aACG,QAAA,CAAM,UAAWC,EAAM,GAAGD,EACxB,SAAAD,EACH,CAEJ,CAEAS,EAAU,YAAc,YCZxB,SAASC,EAAU,CAAE,MAAAC,EAAQ,OAAQ,SAAAX,EAAU,GAAGC,GAAyB,CACzE,MAAMW,EAAYT,EAAAA,UAChB,GAAGC,EAAAA,MAAM,eACT,GAAGA,EAAAA,MAAM,iBAAiBO,CAAK,EAAA,EAGjC,OACEL,EAAAA,IAAC,KAAA,CAAG,UAAAM,EAAuB,GAAGX,EAC3B,SAAAD,EACH,CAEJ,CAEA,MAAAa,EAAeL,EAAAA,gBAAgBE,CAAS,ECnBxC,SAASI,EAAY,CAAE,SAAAd,GAA+B,CACpD,MAAMY,EAAYT,EAAAA,UAChB,GAAGC,EAAAA,MAAM,gBAAA,EAGX,aACG,QAAA,CAAM,UAAAQ,EACL,SAAAN,EAAAA,IAAC,KAAA,CACE,SAAAN,EACH,EACF,CAEJ,CAEAc,EAAY,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const p=require("react/jsx-runtime"),t=require("./index-DYxwT4uW.cjs"),u=require("./joinClass-Jk3EszKD.cjs"),l=require("./convertPathToColor-D8eBpd_D.cjs"),m=require("./useTheme-DsrjDJKC.cjs"),b=require("./createComponent-
|
|
2
|
-
//# sourceMappingURL=Typography-
|
|
1
|
+
"use strict";const p=require("react/jsx-runtime"),t=require("./index-DYxwT4uW.cjs"),u=require("./joinClass-Jk3EszKD.cjs"),l=require("./convertPathToColor-D8eBpd_D.cjs"),m=require("./useTheme-DsrjDJKC.cjs"),b=require("./createComponent-B2C4sTOb.cjs"),T=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2"],g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function x({children:h,variant:o="body1",color:n="text.primary",weight:s,textAlign:c,...e}){const{theme:{palette:a}}=m.useTheme(),i=g[o],y=u.joinClass(`${t.prefix}-typography`,`${t.prefix}-typography--${o}`,s&&`${t.prefix}-typography--weight-${s}`,e.className),r=l.convertPathToColor(n,a);return p.jsx(i,{...e,className:y,style:{...r?{color:r}:{},textAlign:c,...e.style},children:h})}const C=b.createComponent(x);exports.Typography=C;exports.variants=T;
|
|
2
|
+
//# sourceMappingURL=Typography-B2gBDBkp.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography-
|
|
1
|
+
{"version":3,"file":"Typography-B2gBDBkp.cjs","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import { type PropsWithChildren, type HTMLAttributes, type CSSProperties } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { MappedColors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { convertPathToColor } from '@iziui/core/utils/convertPathToColor';\n\nimport { useTheme } from '@/theme';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Typography.scss';\n\nexport const variants = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n] as const;\n\nexport type Variant = typeof variants[number];\n\nconst MAP: { [x: string]: React.ElementType } = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n};\n\nexport interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\n\nfunction Typography({\n children,\n variant = 'body1',\n color: _color = 'text.primary',\n weight,\n textAlign,\n ...props\n}: TypographyProps) {\n const { theme: { palette } } = useTheme();\n\n const CustomTag = MAP[variant];\n\n const cls = joinClass(\n `${prefix}-typography`,\n `${prefix}-typography--${variant}`,\n weight && `${prefix}-typography--weight-${weight}`,\n props.className\n );\n\n const color = convertPathToColor(_color, palette);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n ...(color ? { color } : {}),\n textAlign,\n ...props.style\n }}\n >\n {children}\n </CustomTag>\n );\n}\n\nexport default createComponent(Typography);"],"names":["variants","MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","convertPathToColor","jsx","createComponent"],"mappings":"0PAaaA,EAAW,CACtB,KACA,KACA,KACA,KACA,KACA,KACA,YACA,YACA,QACA,OACF,EAIMC,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EASA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EAAS,eAChB,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAAA,SAAA,EAEzBC,EAAYV,EAAIG,CAAO,EAEvBQ,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,cACT,GAAGA,EAAAA,MAAM,gBAAgBV,CAAO,GAChCE,GAAU,GAAGQ,EAAAA,MAAM,uBAAuBR,CAAM,GAChDE,EAAM,SAAA,EAGFO,EAAQC,EAAAA,mBAAmBX,EAAQI,CAAO,EAEhD,OACEQ,EAAAA,IAACN,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,GAAIG,EAAQ,CAAE,MAAAA,CAAA,EAAU,CAAA,EACxB,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAD,EAAegB,EAAAA,gBAAgBhB,CAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{p as t}from"./index-CZ41y9Hn.js";import{j as l}from"./joinClass-anSpaauN.js";import{c as n}from"./convertPathToColor-DtOjH4ZP.js";import{u as b}from"./useTheme-BYuNiCiH.js";import{c as u}from"./createComponent-
|
|
2
|
-
//# sourceMappingURL=Typography-
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{p as t}from"./index-CZ41y9Hn.js";import{j as l}from"./joinClass-anSpaauN.js";import{c as n}from"./convertPathToColor-DtOjH4ZP.js";import{u as b}from"./useTheme-BYuNiCiH.js";import{c as u}from"./createComponent-D-IheGJm.js";const v=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2"],f={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function g({children:e,variant:s="body1",color:a="text.primary",weight:h,textAlign:p,...o}){const{theme:{palette:m}}=b(),y=f[s],c=l(`${t}-typography`,`${t}-typography--${s}`,h&&`${t}-typography--weight-${h}`,o.className),r=n(a,m);return i(y,{...o,className:c,style:{...r?{color:r}:{},textAlign:p,...o.style},children:e})}const N=u(g);export{N as T,v};
|
|
2
|
+
//# sourceMappingURL=Typography-BkvvYn5T.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography-
|
|
1
|
+
{"version":3,"file":"Typography-BkvvYn5T.js","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import { type PropsWithChildren, type HTMLAttributes, type CSSProperties } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { MappedColors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { convertPathToColor } from '@iziui/core/utils/convertPathToColor';\n\nimport { useTheme } from '@/theme';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Typography.scss';\n\nexport const variants = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n] as const;\n\nexport type Variant = typeof variants[number];\n\nconst MAP: { [x: string]: React.ElementType } = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n};\n\nexport interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\n\nfunction Typography({\n children,\n variant = 'body1',\n color: _color = 'text.primary',\n weight,\n textAlign,\n ...props\n}: TypographyProps) {\n const { theme: { palette } } = useTheme();\n\n const CustomTag = MAP[variant];\n\n const cls = joinClass(\n `${prefix}-typography`,\n `${prefix}-typography--${variant}`,\n weight && `${prefix}-typography--weight-${weight}`,\n props.className\n );\n\n const color = convertPathToColor(_color, palette);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n ...(color ? { color } : {}),\n textAlign,\n ...props.style\n }}\n >\n {children}\n </CustomTag>\n );\n}\n\nexport default createComponent(Typography);"],"names":["variants","MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","convertPathToColor","jsx","Typography$1","createComponent"],"mappings":"8QAaO,MAAMA,EAAW,CACtB,KACA,KACA,KACA,KACA,KACA,KACA,YACA,YACA,QACA,OACF,EAIMC,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EASA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EAAS,eAChB,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAA,EAEzBC,EAAYV,EAAIG,CAAO,EAEvBQ,EAAMC,EACV,GAAGC,CAAM,cACT,GAAGA,CAAM,gBAAgBV,CAAO,GAChCE,GAAU,GAAGQ,CAAM,uBAAuBR,CAAM,GAChDE,EAAM,SAAA,EAGFO,EAAQC,EAAmBX,EAAQI,CAAO,EAEhD,OACEQ,EAACN,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,GAAIG,EAAQ,CAAE,MAAAA,CAAA,EAAU,CAAA,EACxB,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAe,EAAeC,EAAgBjB,CAAU"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const P=require("react/jsx-runtime"),x=require("./index-DYxwT4uW.cjs"),M=require("./useTheme-DsrjDJKC.cjs");function S({sx:t,theme:n},...e){return e.reduce((s,i)=>(s={...s,...i(n,t)},s),{})}const B=(t,{color:n})=>{const{palette:e}=t;return n?{color:n(e)}:{}},y=(t,{background:n})=>{const{palette:e}=t;return n?{background:n(e)}:{}},j=(t,{borderColor:n})=>{const{palette:e}=t;return n?{borderColor:n(e)}:{}},w=(t,{backgroundColor:n})=>{const{palette:e}=t;return n?{backgroundColor:n(e)}:{}},C=(t,{borderRadius:n})=>{const{shape:e}=t;return n?{borderRadius:`${e.radius*n}px`}:{}},R=(t,{m:n,mb:e,ml:s,mr:i,mt:c,mx:u,my:d})=>{const{spacing:l}=t,o=a=>a||a===0?`${String(a*l)}px`:"",r=o(n),f=o(c),p=o(e),g=o(d),h=o(u),m=o(s),b=o(i);return{margin:r,marginTop:f||g||r,marginBottom:p||g||r,marginLeft:m||h||r,marginRight:b||h||r}},T=(t,{p:n,pb:e,pl:s,pr:i,pt:c,px:u,py:d})=>{const{spacing:l}=t,o=a=>a||a===0?`${String(a*l)}px`:"",r=o(n),f=o(c),p=o(e),g=o(d),h=o(u),m=o(s),b=o(i);return{padding:r,paddingTop:f||g||r,paddingBottom:p||g||r,paddingLeft:m||h||r,paddingRight:b||h||r}},_=(t,{boxShadow:n})=>n?{boxShadow:{sm:x.boxShadowSmall,md:x.boxShadowRegular,lg:x.boxShadowLarge}[n]}:{},z=Object.freeze(Object.defineProperty({__proto__:null,defineBackground:y,defineBackgroundColor:w,defineBorderColor:j,defineBorderRadius:C,defineBoxShadow:_,defineColor:B,defineMargin:R,definePadding:T},Symbol.toStringTag,{value:"Module"}));function O(t){return Object.values(t).map(n=>n)}function k(t){return t.displayName=t.name,({sx:e,fullWidth:s,...i})=>{const{theme:c}=M.useTheme(),{defineBreakpoint:u,...d}=z;e&&console.log(u(c,e));const l=e&&S({theme:c,sx:e},...O(d));return P.jsx(t,{...i,style:{boxSizing:"border-box",...i.style,...l,...s?{width:"100%"}:{}}})}}exports.createComponent=k;
|
|
2
|
+
//# sourceMappingURL=createComponent-B2C4sTOb.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createComponent-B2C4sTOb.cjs","sources":["../../../../core/src/options/createOptions/createOptions.ts","../../../../core/src/plugin/color/defineColor/defineColor.ts","../../../../core/src/plugin/color/defineBackground/defineBackground.ts","../../../../core/src/plugin/color/defineBorderColor/defineBorderColor.ts","../../../../core/src/plugin/color/defineBackgroundColor/defineBackgroundColor.ts","../../../../core/src/plugin/shape/defineBorderRadius/defineBorderRadius.ts","../../../../core/src/plugin/spacing/defineMargin/defineMargin.ts","../../../../core/src/plugin/spacing/definePadding/definePadding.ts","../../../../core/src/plugin/behavior/defineBoxShadow/defineBoxShadow.ts","../../src/core/createComponent.tsx"],"sourcesContent":["import type { Properties } from 'csstype';\n\nimport type { Plugin } from '../../plugin';\nimport type { ThemeBuilded } from '../../theme';\nimport type { CustomOptions } from '../CustomOptions';\n\ntype Data = {\n sx: CustomOptions;\n theme: ThemeBuilded;\n}\n\nexport default function createOptions({ sx, theme }: Data, ...plugins: Plugin[]): Properties {\n return plugins.reduce<Properties>((acc, plugin) => {\n acc = { ...acc, ...plugin(theme, sx) };\n\n return acc;\n }, {});\n}","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { color }) => {\n const { palette } = theme;\n\n if (!color) { return {}; }\n\n return {\n color: color(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { background }) => {\n const { palette } = theme;\n\n if (!background) { return {}; }\n\n return {\n background: background(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { borderColor }) => {\n const { palette } = theme;\n\n if (!borderColor) { return {}; }\n\n return {\n borderColor: borderColor(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { backgroundColor }) => {\n const { palette } = theme;\n\n if (!backgroundColor) { return {}; }\n\n return {\n backgroundColor: backgroundColor(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { borderRadius }) => {\n const { shape } = theme;\n\n if (!borderRadius) { return {}; }\n\n return {\n borderRadius: `${shape.radius * borderRadius}px`\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { m, mb, ml, mr, mt, mx, my }) => {\n const { spacing } = theme;\n\n const calculateMargin = (mg?: number) => {\n return !!mg || mg === 0 ? `${String(mg * spacing)}px` : '';\n };\n\n const hasM = calculateMargin(m);\n\n const hasMt = calculateMargin(mt);\n const hasMb = calculateMargin(mb);\n\n const hasMy = calculateMargin(my);\n const hasMx = calculateMargin(mx);\n\n const hasMl = calculateMargin(ml);\n const hasMr = calculateMargin(mr);\n\n return {\n margin: hasM,\n marginTop: hasMt || hasMy || hasM,\n marginBottom: hasMb || hasMy || hasM,\n marginLeft: hasMl || hasMx || hasM,\n marginRight: hasMr || hasMx || hasM,\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { p, pb, pl, pr, pt, px, py }) => {\n const { spacing } = theme;\n\n const calculatePadding = (pd?: number) => {\n return !!pd || pd === 0 ? `${String(pd * spacing)}px` : '';\n };\n\n const hasP = calculatePadding(p);\n\n const hasPt = calculatePadding(pt);\n const hasPb = calculatePadding(pb);\n\n const hasPy = calculatePadding(py);\n const hasPx = calculatePadding(px);\n\n const hasPl = calculatePadding(pl);\n const hasPr = calculatePadding(pr);\n\n return {\n padding: hasP,\n paddingTop: hasPt || hasPy || hasP,\n paddingBottom: hasPb || hasPy || hasP,\n paddingLeft: hasPl || hasPx || hasP,\n paddingRight: hasPr || hasPx || hasP,\n };\n});","import { boxShadowSmall, boxShadowRegular, boxShadowLarge } from '@iziui/tokens/web/js';\n\nimport definePlugin from '../../definePlugin';\nimport type { CustomOptions } from '../../../options/CustomOptions';\n\ntype ExtractSize = NonNullable<CustomOptions['boxShadow']>;\n\nexport default definePlugin((_, { boxShadow }) => {\n\n if (!boxShadow) { return {}; }\n\n const sizes: { [s in ExtractSize]: string } = {\n sm: boxShadowSmall,\n md: boxShadowRegular,\n lg: boxShadowLarge,\n };\n\n return {\n boxShadow: sizes[boxShadow]\n };\n});","import type { ComponentType, FC } from 'react';\n\nimport type { Sx } from '@iziui/core/system';\nimport type { Plugin } from '@iziui/core/plugin';\nimport createOptions from '@iziui/core/options';\nimport * as plugins from '@iziui/core/plugin';\n\nimport { useTheme } from '@/theme';\n\nfunction extract(module: { [key: string]: Plugin }) {\n return Object.values(module).map((fn) => fn);\n}\n\nexport default function createComponent<P>(WrappedComponent: ComponentType<P>) {\n WrappedComponent.displayName = WrappedComponent.name;\n\n const EnhancedComponent: FC<Sx<P>> = ({ sx, fullWidth, ...props }) => {\n const { theme } = useTheme();\n\n const { defineBreakpoint, ...restPlugins } = plugins;\n\n if (sx) {\n console.log(defineBreakpoint(theme, sx));\n }\n\n const options = sx && createOptions({ theme, sx },\n ...extract(restPlugins),\n );\n\n return (\n <WrappedComponent\n {...(props as P)}\n style={{\n boxSizing: 'border-box',\n ...props['style'],\n ...options,\n ...(fullWidth ? { width: '100%' } : {}),\n }}\n />\n );\n };\n\n return EnhancedComponent;\n}"],"names":["createOptions","sx","theme","plugins","acc","plugin","defineColor","color","palette","defineBackground","background","defineBorderColor","borderColor","defineBackgroundColor","backgroundColor","defineBorderRadius","borderRadius","shape","defineMargin","m","mb","ml","mr","mt","mx","my","spacing","calculateMargin","mg","hasM","hasMt","hasMb","hasMy","hasMx","hasMl","hasMr","definePadding","p","pb","pl","pr","pt","px","py","calculatePadding","pd","hasP","hasPt","hasPb","hasPy","hasPx","hasPl","hasPr","defineBoxShadow","_","boxShadow","boxShadowSmall","boxShadowRegular","boxShadowLarge","extract","module","fn","createComponent","WrappedComponent","fullWidth","props","useTheme","defineBreakpoint","restPlugins","options","jsx"],"mappings":"yHAWA,SAAwBA,EAAc,CAAE,GAAAC,EAAI,MAAAC,CAAA,KAAkBC,EAA+B,CAC3F,OAAOA,EAAQ,OAAmB,CAACC,EAAKC,KACtCD,EAAM,CAAE,GAAGA,EAAK,GAAGC,EAAOH,EAAOD,CAAE,CAAA,EAE5BG,GACN,CAAA,CAAE,CACP,CCfA,MAAAE,EAA4B,CAACJ,EAAO,CAAE,MAAAK,KAAY,CAChD,KAAM,CAAE,QAAAC,GAAYN,EAEpB,OAAKK,EAEE,CACL,MAAOA,EAAMC,CAAO,CAAA,EAHD,CAAA,CAKvB,ECRAC,EAA4B,CAACP,EAAO,CAAE,WAAAQ,KAAiB,CACrD,KAAM,CAAE,QAAAF,GAAYN,EAEpB,OAAKQ,EAEE,CACL,WAAYA,EAAWF,CAAO,CAAA,EAHN,CAAA,CAK5B,ECRAG,EAA4B,CAACT,EAAO,CAAE,YAAAU,KAAkB,CACtD,KAAM,CAAE,QAAAJ,GAAYN,EAEpB,OAAKU,EAEE,CACL,YAAaA,EAAYJ,CAAO,CAAA,EAHP,CAAA,CAK7B,ECRAK,EAA4B,CAACX,EAAO,CAAE,gBAAAY,KAAsB,CAC1D,KAAM,CAAE,QAAAN,GAAYN,EAEpB,OAAKY,EAEE,CACL,gBAAiBA,EAAgBN,CAAO,CAAA,EAHX,CAAA,CAKjC,ECRAO,EAA4B,CAACb,EAAO,CAAE,aAAAc,KAAmB,CACvD,KAAM,CAAE,MAAAC,GAAUf,EAElB,OAAKc,EAEE,CACL,aAAc,GAAGC,EAAM,OAASD,CAAY,IAAA,EAHlB,CAAA,CAK9B,ECRAE,EAA4B,CAAChB,EAAO,CAAE,EAAAiB,EAAG,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,GAAAC,KAAS,CACpE,KAAM,CAAE,QAAAC,GAAYxB,EAEdyB,EAAmBC,GACdA,GAAMA,IAAO,EAAI,GAAG,OAAOA,EAAKF,CAAO,CAAC,KAAO,GAGpDG,EAAOF,EAAgBR,CAAC,EAExBW,EAAQH,EAAgBJ,CAAE,EAC1BQ,EAAQJ,EAAgBP,CAAE,EAE1BY,EAAQL,EAAgBF,CAAE,EAC1BQ,EAAQN,EAAgBH,CAAE,EAE1BU,EAAQP,EAAgBN,CAAE,EAC1Bc,EAAQR,EAAgBL,CAAE,EAEhC,MAAO,CACL,OAAQO,EACR,UAAWC,GAASE,GAASH,EAC7B,aAAcE,GAASC,GAASH,EAChC,WAAYK,GAASD,GAASJ,EAC9B,YAAaM,GAASF,GAASJ,CAAA,CAEnC,ECzBAO,EAA4B,CAAClC,EAAO,CAAE,EAAAmC,EAAG,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,GAAAC,KAAS,CACpE,KAAM,CAAE,QAAAjB,GAAYxB,EAEd0C,EAAoBC,GACfA,GAAMA,IAAO,EAAI,GAAG,OAAOA,EAAKnB,CAAO,CAAC,KAAO,GAGpDoB,EAAOF,EAAiBP,CAAC,EAEzBU,EAAQH,EAAiBH,CAAE,EAC3BO,EAAQJ,EAAiBN,CAAE,EAE3BW,EAAQL,EAAiBD,CAAE,EAC3BO,EAAQN,EAAiBF,CAAE,EAE3BS,EAAQP,EAAiBL,CAAE,EAC3Ba,EAAQR,EAAiBJ,CAAE,EAEjC,MAAO,CACL,QAASM,EACT,WAAYC,GAASE,GAASH,EAC9B,cAAeE,GAASC,GAASH,EACjC,YAAaK,GAASD,GAASJ,EAC/B,aAAcM,GAASF,GAASJ,CAAA,CAEpC,ECpBAO,EAA4B,CAACC,EAAG,CAAE,UAAAC,KAE3BA,EAQE,CACL,UAP4C,CAC5C,GAAIC,EAAAA,eACJ,GAAIC,EAAAA,iBACJ,GAAIC,EAAAA,cAAA,EAIaH,CAAS,CAAA,EATH,CAAA,kPCA3B,SAASI,EAAQC,EAAmC,CAClD,OAAO,OAAO,OAAOA,CAAM,EAAE,IAAKC,GAAOA,CAAE,CAC7C,CAEA,SAAwBC,EAAmBC,EAAoC,CAC7E,OAAAA,EAAiB,YAAcA,EAAiB,KAEX,CAAC,CAAE,GAAA9D,EAAI,UAAA+D,EAAW,GAAGC,KAAY,CACpE,KAAM,CAAE,MAAA/D,CAAA,EAAUgE,WAAA,EAEZ,CAAE,iBAAAC,EAAkB,GAAGC,CAAA,EAAgBjE,EAEzCF,GACF,QAAQ,IAAIkE,EAAiBjE,EAAOD,CAAE,CAAC,EAGzC,MAAMoE,EAAUpE,GAAMD,EAAc,CAAE,MAAAE,EAAO,GAAAD,CAAA,EAC3C,GAAG0D,EAAQS,CAAW,CAAA,EAGxB,OACEE,EAAAA,IAACP,EAAA,CACE,GAAIE,EACL,MAAO,CACL,UAAW,aACX,GAAGA,EAAM,MACT,GAAGI,EACH,GAAIL,EAAY,CAAE,MAAO,QAAW,CAAA,CAAC,CACvC,CAAA,CAGN,CAGF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as P}from"react/jsx-runtime";import{b as x,c as M,d as S}from"./index-CZ41y9Hn.js";import{u as B}from"./useTheme-BYuNiCiH.js";function y({sx:t,theme:n},...e){return e.reduce((s,a)=>(s={...s,...a(n,t)},s),{})}const w=(t,{color:n})=>{const{palette:e}=t;return n?{color:n(e)}:{}},_=(t,{background:n})=>{const{palette:e}=t;return n?{background:n(e)}:{}},j=(t,{borderColor:n})=>{const{palette:e}=t;return n?{borderColor:n(e)}:{}},z=(t,{backgroundColor:n})=>{const{palette:e}=t;return n?{backgroundColor:n(e)}:{}},C=(t,{borderRadius:n})=>{const{shape:e}=t;return n?{borderRadius:`${e.radius*n}px`}:{}},O=(t,{m:n,mb:e,ml:s,mr:a,mt:c,mx:u,my:d})=>{const{spacing:l}=t,o=i=>i||i===0?`${String(i*l)}px`:"",r=o(n),h=o(c),p=o(e),g=o(d),f=o(u),m=o(s),b=o(a);return{margin:r,marginTop:h||g||r,marginBottom:p||g||r,marginLeft:m||f||r,marginRight:b||f||r}},R=(t,{p:n,pb:e,pl:s,pr:a,pt:c,px:u,py:d})=>{const{spacing:l}=t,o=i=>i||i===0?`${String(i*l)}px`:"",r=o(n),h=o(c),p=o(e),g=o(d),f=o(u),m=o(s),b=o(a);return{padding:r,paddingTop:h||g||r,paddingBottom:p||g||r,paddingLeft:m||f||r,paddingRight:b||f||r}},T=(t,{boxShadow:n})=>n?{boxShadow:{sm:S,md:M,lg:x}[n]}:{},k=Object.freeze(Object.defineProperty({__proto__:null,defineBackground:_,defineBackgroundColor:z,defineBorderColor:j,defineBorderRadius:C,defineBoxShadow:T,defineColor:w,defineMargin:O,definePadding:R},Symbol.toStringTag,{value:"Module"}));function L(t){return Object.values(t).map(n=>n)}function N(t){return t.displayName=t.name,({sx:e,fullWidth:s,...a})=>{const{theme:c}=B(),{defineBreakpoint:u,...d}=k;e&&console.log(u(c,e));const l=e&&y({theme:c,sx:e},...L(d));return P(t,{...a,style:{boxSizing:"border-box",...a.style,...l,...s?{width:"100%"}:{}}})}}export{N as c};
|
|
2
|
+
//# sourceMappingURL=createComponent-D-IheGJm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createComponent-D-IheGJm.js","sources":["../../../../core/src/options/createOptions/createOptions.ts","../../../../core/src/plugin/color/defineColor/defineColor.ts","../../../../core/src/plugin/color/defineBackground/defineBackground.ts","../../../../core/src/plugin/color/defineBorderColor/defineBorderColor.ts","../../../../core/src/plugin/color/defineBackgroundColor/defineBackgroundColor.ts","../../../../core/src/plugin/shape/defineBorderRadius/defineBorderRadius.ts","../../../../core/src/plugin/spacing/defineMargin/defineMargin.ts","../../../../core/src/plugin/spacing/definePadding/definePadding.ts","../../../../core/src/plugin/behavior/defineBoxShadow/defineBoxShadow.ts","../../src/core/createComponent.tsx"],"sourcesContent":["import type { Properties } from 'csstype';\n\nimport type { Plugin } from '../../plugin';\nimport type { ThemeBuilded } from '../../theme';\nimport type { CustomOptions } from '../CustomOptions';\n\ntype Data = {\n sx: CustomOptions;\n theme: ThemeBuilded;\n}\n\nexport default function createOptions({ sx, theme }: Data, ...plugins: Plugin[]): Properties {\n return plugins.reduce<Properties>((acc, plugin) => {\n acc = { ...acc, ...plugin(theme, sx) };\n\n return acc;\n }, {});\n}","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { color }) => {\n const { palette } = theme;\n\n if (!color) { return {}; }\n\n return {\n color: color(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { background }) => {\n const { palette } = theme;\n\n if (!background) { return {}; }\n\n return {\n background: background(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { borderColor }) => {\n const { palette } = theme;\n\n if (!borderColor) { return {}; }\n\n return {\n borderColor: borderColor(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { backgroundColor }) => {\n const { palette } = theme;\n\n if (!backgroundColor) { return {}; }\n\n return {\n backgroundColor: backgroundColor(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { borderRadius }) => {\n const { shape } = theme;\n\n if (!borderRadius) { return {}; }\n\n return {\n borderRadius: `${shape.radius * borderRadius}px`\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { m, mb, ml, mr, mt, mx, my }) => {\n const { spacing } = theme;\n\n const calculateMargin = (mg?: number) => {\n return !!mg || mg === 0 ? `${String(mg * spacing)}px` : '';\n };\n\n const hasM = calculateMargin(m);\n\n const hasMt = calculateMargin(mt);\n const hasMb = calculateMargin(mb);\n\n const hasMy = calculateMargin(my);\n const hasMx = calculateMargin(mx);\n\n const hasMl = calculateMargin(ml);\n const hasMr = calculateMargin(mr);\n\n return {\n margin: hasM,\n marginTop: hasMt || hasMy || hasM,\n marginBottom: hasMb || hasMy || hasM,\n marginLeft: hasMl || hasMx || hasM,\n marginRight: hasMr || hasMx || hasM,\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { p, pb, pl, pr, pt, px, py }) => {\n const { spacing } = theme;\n\n const calculatePadding = (pd?: number) => {\n return !!pd || pd === 0 ? `${String(pd * spacing)}px` : '';\n };\n\n const hasP = calculatePadding(p);\n\n const hasPt = calculatePadding(pt);\n const hasPb = calculatePadding(pb);\n\n const hasPy = calculatePadding(py);\n const hasPx = calculatePadding(px);\n\n const hasPl = calculatePadding(pl);\n const hasPr = calculatePadding(pr);\n\n return {\n padding: hasP,\n paddingTop: hasPt || hasPy || hasP,\n paddingBottom: hasPb || hasPy || hasP,\n paddingLeft: hasPl || hasPx || hasP,\n paddingRight: hasPr || hasPx || hasP,\n };\n});","import { boxShadowSmall, boxShadowRegular, boxShadowLarge } from '@iziui/tokens/web/js';\n\nimport definePlugin from '../../definePlugin';\nimport type { CustomOptions } from '../../../options/CustomOptions';\n\ntype ExtractSize = NonNullable<CustomOptions['boxShadow']>;\n\nexport default definePlugin((_, { boxShadow }) => {\n\n if (!boxShadow) { return {}; }\n\n const sizes: { [s in ExtractSize]: string } = {\n sm: boxShadowSmall,\n md: boxShadowRegular,\n lg: boxShadowLarge,\n };\n\n return {\n boxShadow: sizes[boxShadow]\n };\n});","import type { ComponentType, FC } from 'react';\n\nimport type { Sx } from '@iziui/core/system';\nimport type { Plugin } from '@iziui/core/plugin';\nimport createOptions from '@iziui/core/options';\nimport * as plugins from '@iziui/core/plugin';\n\nimport { useTheme } from '@/theme';\n\nfunction extract(module: { [key: string]: Plugin }) {\n return Object.values(module).map((fn) => fn);\n}\n\nexport default function createComponent<P>(WrappedComponent: ComponentType<P>) {\n WrappedComponent.displayName = WrappedComponent.name;\n\n const EnhancedComponent: FC<Sx<P>> = ({ sx, fullWidth, ...props }) => {\n const { theme } = useTheme();\n\n const { defineBreakpoint, ...restPlugins } = plugins;\n\n if (sx) {\n console.log(defineBreakpoint(theme, sx));\n }\n\n const options = sx && createOptions({ theme, sx },\n ...extract(restPlugins),\n );\n\n return (\n <WrappedComponent\n {...(props as P)}\n style={{\n boxSizing: 'border-box',\n ...props['style'],\n ...options,\n ...(fullWidth ? { width: '100%' } : {}),\n }}\n />\n );\n };\n\n return EnhancedComponent;\n}"],"names":["createOptions","sx","theme","plugins","acc","plugin","defineColor","color","palette","defineBackground","background","defineBorderColor","borderColor","defineBackgroundColor","backgroundColor","defineBorderRadius","borderRadius","shape","defineMargin","m","mb","ml","mr","mt","mx","my","spacing","calculateMargin","mg","hasM","hasMt","hasMb","hasMy","hasMx","hasMl","hasMr","definePadding","p","pb","pl","pr","pt","px","py","calculatePadding","pd","hasP","hasPt","hasPb","hasPy","hasPx","hasPl","hasPr","defineBoxShadow","_","boxShadow","boxShadowSmall","boxShadowRegular","boxShadowLarge","extract","module","fn","createComponent","WrappedComponent","fullWidth","props","useTheme","defineBreakpoint","restPlugins","options","jsx"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),n=require("react"),l=require("./index-DYxwT4uW.cjs"),z=require("./joinClass-Jk3EszKD.cjs"),D=require("./uuid-omnJ9TjZ.cjs"),E=require("./useListenerResized-AwpsZLcP.cjs"),L=require("./Card-CcOpPKfS.cjs"),S=require("./CardContent-D2cDaP4l.cjs"),B=require("./createComponent-B2C4sTOb.cjs");class P{delay(t,s=500){if(!s){t();return}clearTimeout(this.timeout),this.timeout=setTimeout(()=>{t()},s)}}const W=new P,F=n.forwardRef(function({open:t,width:s,children:f,anchorEl:o,direction:d="left",maxHeight:i,autoClose:_,onClose:$,...m},j){const[g,M]=n.useState(),[h,a]=n.useState({state:"invisible",animation:"close",width:"auto"}),N=16,y=150,k=n.Children.toArray(f),T=n.useMemo(()=>D.uuid(),[]),v=z.joinClass(`${l.prefix}-menu`,`${l.prefix}-menu--${h?.animation}`,m.className);E.useListenerResized(()=>b(),[o]),n.useEffect(()=>{b()},[o]),n.useEffect(()=>{t?w():C()},[t]);const b=()=>{o&&setTimeout(()=>{let e={};const{offsetWidth:r,offsetHeight:p,offsetLeft:q,offsetTop:I}=o;a(O=>({...O,width:r}));const x=I+p+N/2,R=document.getElementById(T);d==="center"&&(e={top:x,right:r}),d==="left"&&(e={top:x,left:q}),d==="right"&&(e={top:x,left:q-(R.offsetWidth-r)}),M(e)},0)},w=()=>{a(e=>({...e,state:"visible"})),setTimeout(()=>{a(e=>({...e,animation:"open"}))},10)},C=()=>{a(e=>({...e,animation:"close"})),setTimeout(()=>{a(e=>({...e,state:"invisible"})),$()},y)},A=()=>k.map((e,r)=>n.cloneElement(e,{tabIndex:r+1,key:`button-${r}`,onClick:p=>{W.delay(()=>{_&&C(),e.props.onClick&&e.props.onClick(p)},0)}}));return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:T,ref:j,...m,style:{width:s||h.width,top:g?.top,left:g?.left,display:h?.state==="visible"?"block":"none",transition:`all ${y}ms ease-in`,zIndex:50,...m.style},className:v,children:t&&c.jsx(L.Card,{className:`${l.prefix}-menu__card`,children:c.jsx(S.CardContent,{className:`${l.prefix}-menu__card__content`,sx:{py:1},style:{display:"flex",flexDirection:"column",maxHeight:i},children:A()})})}),t&&c.jsx("div",{className:`${l.prefix}-menu__overlay`,onClick:C})]})}),G=B.createComponent(F);function H(){const[u,t]=n.useState(null),s=!!u,f=i=>{t(i?i.currentTarget:null)},o=()=>{t(null)};return[s,u,i=>{if(s){o();return}f(i)}]}exports.Menu=G;exports.useMenu=H;
|
|
2
|
+
//# sourceMappingURL=useMenu-C2KhwKNS.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMenu-
|
|
1
|
+
{"version":3,"file":"useMenu-C2KhwKNS.cjs","sources":["../../../../toolkit/src/debounce/debounce.ts","../../src/navigation/Menu/Menu.tsx","../../src/navigation/Menu/useMenu.ts"],"sourcesContent":["class Debounce {\n private timeout: NodeJS.Timeout | undefined;\n public delay(func: (a?: any) => void, milliseconds = 500) {\n if (!milliseconds) {\n func();\n return;\n }\n\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => { func(); }, milliseconds);\n }\n}\n\nexport const debounce = new Debounce();\n","import {\n useMemo,\n useState,\n useEffect,\n Children,\n forwardRef,\n type ReactElement,\n type CSSProperties,\n type HTMLAttributes,\n cloneElement\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport { uuid } from '@iziui/toolkit/uuid';\nimport { debounce } from '@iziui/toolkit/debounce';\n\nimport useListenerResized from '@/hooks/useListenerResized';\nimport { Card, CardContent } from '@/display/Card';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Menu.scss';\n\ntype Direction = 'left' | 'right' | 'center';\ntype AnimationClass = 'open' | 'close';\ntype State = 'visible' | 'invisible';\ntype Coordinates = { top?: number; right?: number; bottom?: number; left?: number; };\ntype Config = { animation: AnimationClass, state: State; width: CSSProperties['width'] };\n\nexport interface MenuProps extends HTMLAttributes<HTMLDivElement> {\n open: boolean;\n autoClose?: boolean;\n maxHeight?: CSSProperties['maxHeight'];\n direction?: Direction;\n anchorEl: HTMLElement | null;\n width?: CSSProperties['width'];\n children: React.JSX.Element | React.JSX.Element[];\n onClose: (e?: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst Menu = forwardRef<HTMLDivElement, MenuProps>(function Menu({\n open,\n width,\n children,\n anchorEl,\n direction = 'left',\n maxHeight,\n autoClose,\n onClose,\n ...props\n}: MenuProps, ref) {\n const [coordinate, setCoordinate] = useState<Coordinates>();\n const [config, setConfig] = useState<Config>({ state: 'invisible', animation: 'close', width: 'auto' });\n\n const GAP = 16;\n const ANIMATION_DURATION = 150;\n\n const arrayChildren = Children.toArray(children) as ReactElement<any>[];\n\n const id = useMemo(() => uuid(), []);\n\n const classes = joinClass(\n `${prefix}-menu`,\n `${prefix}-menu--${config?.animation}`,\n props.className\n );\n\n useListenerResized(() => changePosition(), [anchorEl]);\n\n useEffect(() => { changePosition(); }, [anchorEl]);\n\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n useEffect(() => { open ? handleOpen() : handleClose(); }, [open]);\n\n const changePosition = () => {\n if (!anchorEl) { return; }\n\n setTimeout(() => {\n let coordinates: Coordinates = {};\n\n const { offsetWidth, offsetHeight, offsetLeft, offsetTop } = anchorEl;\n\n setConfig(prev => ({ ...prev, width: offsetWidth }));\n\n const top = offsetTop + offsetHeight + (GAP / 2);\n\n const el = document.getElementById(id) as HTMLElement;\n\n if (direction === 'center') { coordinates = { top, right: offsetWidth }; }\n\n if (direction === 'left') { coordinates = { top, left: offsetLeft }; }\n\n if (direction === 'right') { coordinates = { top, left: offsetLeft - (el.offsetWidth - offsetWidth) }; }\n\n setCoordinate(coordinates);\n }, 0);\n };\n\n const handleOpen = () => {\n setConfig(prev => ({ ...prev, state: 'visible' }));\n\n setTimeout(() => { setConfig(prev => ({ ...prev, animation: 'open' })); }, 10);\n };\n\n const handleClose = () => {\n setConfig(prev => ({ ...prev, animation: 'close' }));\n\n setTimeout(() => {\n setConfig(prev => ({ ...prev, state: 'invisible' }));\n onClose();\n }, ANIMATION_DURATION);\n };\n\n const renderChildren = () => {\n return arrayChildren.map((child, index) => {\n return cloneElement(child, {\n 'tabIndex': index + 1,\n key: `button-${index}`,\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => {\n debounce.delay(() => {\n\n if (autoClose) { handleClose(); }\n\n if (child.props.onClick) { child.props.onClick(e); }\n }, 0);\n },\n });\n });\n };\n\n return (\n <>\n <div\n id={id}\n ref={ref}\n {...props}\n style={{\n width: width || config.width,\n top: coordinate?.top,\n left: coordinate?.left,\n display: config?.state === 'visible' ? 'block' : 'none',\n transition: `all ${ANIMATION_DURATION}ms ease-in`,\n zIndex: 50,\n ...props.style\n }}\n className={classes}\n >\n {\n open && (\n <Card className={`${prefix}-menu__card`}>\n <CardContent\n className={`${prefix}-menu__card__content`}\n sx={{ py: 1 }}\n style={{ display: 'flex', flexDirection: 'column', maxHeight }}\n >\n {renderChildren()}\n </CardContent>\n </Card>\n )\n }\n </div>\n {open && <div className={`${prefix}-menu__overlay`} onClick={handleClose} />}\n </>\n );\n});\n\nexport default createComponent(Menu);\n","import { useState } from 'react';\n\ntype UseMenu = [\n boolean,\n HTMLElement | null,\n (event?: React.MouseEvent<HTMLButtonElement>) => void,\n];\n\nexport default function useMenu(): UseMenu {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const open = Boolean(anchorEl);\n\n const handleOpen = (event?: React.MouseEvent<HTMLElement, MouseEvent>) => {\n setAnchorEl(event ? event.currentTarget : null);\n };\n\n const handleClose = () => { setAnchorEl(null); };\n\n const handleToggle = (event?: React.MouseEvent<HTMLElement, MouseEvent>) => {\n if (open) {\n handleClose();\n return;\n }\n\n handleOpen(event);\n };\n\n return [open, anchorEl, handleToggle];\n}\n"],"names":["Debounce","func","milliseconds","debounce","Menu","forwardRef","open","width","children","anchorEl","direction","maxHeight","autoClose","onClose","props","ref","coordinate","setCoordinate","useState","config","setConfig","GAP","ANIMATION_DURATION","arrayChildren","Children","id","useMemo","uuid","classes","joinClass","prefix","useListenerResized","changePosition","useEffect","handleOpen","handleClose","coordinates","offsetWidth","offsetHeight","offsetLeft","offsetTop","prev","top","el","renderChildren","child","index","cloneElement","e","jsxs","Fragment","jsx","Card","CardContent","createComponent","useMenu","setAnchorEl","event"],"mappings":"kVAAA,MAAMA,CAAS,CAEN,MAAMC,EAAyBC,EAAe,IAAK,CACxD,GAAI,CAACA,EAAc,CACjBD,EAAA,EACA,MACF,CAEA,aAAa,KAAK,OAAO,EACzB,KAAK,QAAU,WAAW,IAAM,CAAEA,EAAA,CAAQ,EAAGC,CAAY,CAC3D,CACF,CAEO,MAAMC,EAAW,IAAIH,EC8BtBI,EAAOC,EAAAA,WAAsC,SAAc,CAC/D,KAAAC,EACA,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,OACZ,UAAAC,EACA,UAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAcC,EAAK,CACjB,KAAM,CAACC,EAAYC,CAAa,EAAIC,WAAA,EAC9B,CAACC,EAAQC,CAAS,EAAIF,EAAAA,SAAiB,CAAE,MAAO,YAAa,UAAW,QAAS,MAAO,MAAA,CAAQ,EAEhGG,EAAM,GACNC,EAAqB,IAErBC,EAAgBC,EAAAA,SAAS,QAAQhB,CAAQ,EAEzCiB,EAAKC,EAAAA,QAAQ,IAAMC,EAAAA,KAAA,EAAQ,CAAA,CAAE,EAE7BC,EAAUC,EAAAA,UACd,GAAGC,EAAAA,MAAM,QACT,GAAGA,EAAAA,MAAM,UAAUX,GAAQ,SAAS,GACpCL,EAAM,SAAA,EAGRiB,EAAAA,mBAAmB,IAAMC,IAAkB,CAACvB,CAAQ,CAAC,EAErDwB,EAAAA,UAAU,IAAM,CAAED,EAAA,CAAkB,EAAG,CAACvB,CAAQ,CAAC,EAGjDwB,EAAAA,UAAU,IAAM,CAAE3B,EAAO4B,EAAA,EAAeC,EAAA,CAAe,EAAG,CAAC7B,CAAI,CAAC,EAEhE,MAAM0B,EAAiB,IAAM,CACtBvB,GAEL,WAAW,IAAM,CACf,IAAI2B,EAA2B,CAAA,EAE/B,KAAM,CAAE,YAAAC,EAAa,aAAAC,EAAc,WAAAC,EAAY,UAAAC,GAAc/B,EAE7DW,MAAmB,CAAE,GAAGqB,EAAM,MAAOJ,GAAc,EAEnD,MAAMK,EAAMF,EAAYF,EAAgBjB,EAAM,EAExCsB,EAAK,SAAS,eAAelB,CAAE,EAEjCf,IAAc,WAAY0B,EAAc,CAAE,IAAAM,EAAK,MAAOL,CAAA,GAEtD3B,IAAc,SAAU0B,EAAc,CAAE,IAAAM,EAAK,KAAMH,CAAA,GAEnD7B,IAAc,UAAW0B,EAAc,CAAE,IAAAM,EAAK,KAAMH,GAAcI,EAAG,YAAcN,EAAA,GAEvFpB,EAAcmB,CAAW,CAC3B,EAAG,CAAC,CACN,EAEMF,EAAa,IAAM,CACvBd,MAAmB,CAAE,GAAGqB,EAAM,MAAO,WAAY,EAEjD,WAAW,IAAM,CAAErB,MAAmB,CAAE,GAAGqB,EAAM,UAAW,QAAS,CAAG,EAAG,EAAE,CAC/E,EAEMN,EAAc,IAAM,CACxBf,MAAmB,CAAE,GAAGqB,EAAM,UAAW,SAAU,EAEnD,WAAW,IAAM,CACfrB,MAAmB,CAAE,GAAGqB,EAAM,MAAO,aAAc,EACnD5B,EAAA,CACF,EAAGS,CAAkB,CACvB,EAEMsB,EAAiB,IACdrB,EAAc,IAAI,CAACsB,EAAOC,IACxBC,EAAAA,aAAaF,EAAO,CACzB,SAAYC,EAAQ,EACpB,IAAK,UAAUA,CAAK,GACpB,QAAUE,GAA2C,CACnD7C,EAAS,MAAM,IAAM,CAEfS,GAAauB,EAAA,EAEbU,EAAM,MAAM,SAAWA,EAAM,MAAM,QAAQG,CAAC,CAClD,EAAG,CAAC,CACN,CAAA,CACD,CACF,EAGH,OACEC,EAAAA,KAAAC,WAAA,CACE,SAAA,CAAAC,EAAAA,IAAC,MAAA,CACC,GAAA1B,EACA,IAAAV,EACC,GAAGD,EACJ,MAAO,CACL,MAAOP,GAASY,EAAO,MACvB,IAAKH,GAAY,IACjB,KAAMA,GAAY,KAClB,QAASG,GAAQ,QAAU,UAAY,QAAU,OACjD,WAAY,OAAOG,CAAkB,aACrC,OAAQ,GACR,GAAGR,EAAM,KAAA,EAEX,UAAWc,EAGT,YACEuB,MAACC,EAAAA,KAAA,CAAK,UAAW,GAAGtB,QAAM,cACxB,SAAAqB,EAAAA,IAACE,EAAAA,YAAA,CACC,UAAW,GAAGvB,EAAAA,MAAM,uBACpB,GAAI,CAAE,GAAI,CAAA,EACV,MAAO,CAAE,QAAS,OAAQ,cAAe,SAAU,UAAAnB,CAAA,EAElD,SAAAiC,EAAA,CAAe,CAAA,CAClB,CACF,CAAA,CAAA,EAILtC,SAAS,MAAA,CAAI,UAAW,GAAGwB,EAAAA,MAAM,iBAAkB,QAASK,CAAA,CAAa,CAAA,EAC5E,CAEJ,CAAC,EAED/B,EAAekD,EAAAA,gBAAgBlD,CAAI,ECjKnC,SAAwBmD,GAAmB,CACzC,KAAM,CAAC9C,EAAU+C,CAAW,EAAItC,EAAAA,SAA6B,IAAI,EAE3DZ,EAAO,EAAQG,EAEfyB,EAAcuB,GAAsD,CACxED,EAAYC,EAAQA,EAAM,cAAgB,IAAI,CAChD,EAEMtB,EAAc,IAAM,CAAEqB,EAAY,IAAI,CAAG,EAW/C,MAAO,CAAClD,EAAMG,EATQgD,GAAsD,CAC1E,GAAInD,EAAM,CACR6B,EAAA,EACA,MACF,CAEAD,EAAWuB,CAAK,CAClB,CAEoC,CACtC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as B,Fragment as E,jsx as m}from"react/jsx-runtime";import{forwardRef as L,useState as g,Children as P,useMemo as W,useEffect as x,cloneElement as F}from"react";import{p as r}from"./index-CZ41y9Hn.js";import{j as G}from"./joinClass-anSpaauN.js";import{u as H}from"./uuid-dGvr9vBZ.js";import{u as S}from"./useListenerResized-Bnqxrt7k.js";import{C as U}from"./Card-DDRUwdlG.js";import{C as q}from"./CardContent-DYAWf3xO.js";import{c as J}from"./createComponent-D-IheGJm.js";class K{delay(t,n=500){if(!n){t();return}clearTimeout(this.timeout),this.timeout=setTimeout(()=>{t()},n)}}const Q=new K,V=L(function({open:t,width:n,children:f,anchorEl:o,direction:c="left",maxHeight:s,autoClose:N,onClose:M,...u},k){const[y,v]=g(),[d,a]=g({state:"invisible",animation:"close",width:"auto"}),w=16,T=150,A=P.toArray(f),b=W(()=>H(),[]),I=G(`${r}-menu`,`${r}-menu--${d?.animation}`,u.className);S(()=>_(),[o]),x(()=>{_()},[o]),x(()=>{t?j():h()},[t]);const _=()=>{o&&setTimeout(()=>{let e={};const{offsetWidth:i,offsetHeight:p,offsetLeft:$,offsetTop:D}=o;a(z=>({...z,width:i}));const C=D+p+w/2,R=document.getElementById(b);c==="center"&&(e={top:C,right:i}),c==="left"&&(e={top:C,left:$}),c==="right"&&(e={top:C,left:$-(R.offsetWidth-i)}),v(e)},0)},j=()=>{a(e=>({...e,state:"visible"})),setTimeout(()=>{a(e=>({...e,animation:"open"}))},10)},h=()=>{a(e=>({...e,animation:"close"})),setTimeout(()=>{a(e=>({...e,state:"invisible"})),M()},T)},O=()=>A.map((e,i)=>F(e,{tabIndex:i+1,key:`button-${i}`,onClick:p=>{Q.delay(()=>{N&&h(),e.props.onClick&&e.props.onClick(p)},0)}}));return B(E,{children:[m("div",{id:b,ref:k,...u,style:{width:n||d.width,top:y?.top,left:y?.left,display:d?.state==="visible"?"block":"none",transition:`all ${T}ms ease-in`,zIndex:50,...u.style},className:I,children:t&&m(U,{className:`${r}-menu__card`,children:m(q,{className:`${r}-menu__card__content`,sx:{py:1},style:{display:"flex",flexDirection:"column",maxHeight:s},children:O()})})}),t&&m("div",{className:`${r}-menu__overlay`,onClick:h})]})}),ae=J(V);function re(){const[l,t]=g(null),n=!!l,f=s=>{t(s?s.currentTarget:null)},o=()=>{t(null)};return[n,l,s=>{if(n){o();return}f(s)}]}export{ae as M,re as u};
|
|
2
|
+
//# sourceMappingURL=useMenu-DLaxCUF_.js.map
|