@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{jsx as o}from"react/jsx-runtime";import{p as t}from"../../chunks/index-CZ41y9Hn.js";import{j as m}from"../../chunks/joinClass-anSpaauN.js";import{c as s}from"../../chunks/createComponent-
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{p as t}from"../../chunks/index-CZ41y9Hn.js";import{j as m}from"../../chunks/joinClass-anSpaauN.js";import{c as s}from"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"react";import"../../chunks/generateSupportColors-BN5t8dA-.js";function e({...r}){const i=m(`${t}-divider`,r.className);return o("div",{...r,className:i})}const u=s(e);export{u as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/DrawerContent-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/DrawerContent-C6nd8E0E.cjs");require("react");require("react/jsx-runtime");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/Stack-lvjI3kV3.cjs");require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/ButtonIcon-CJ5Iz-uJ.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");require("../../chunks/Icon-CFvy-l1V.cjs");exports.Drawer=e.Drawer_default;exports.DrawerContent=e.DrawerContent_default;exports.DrawerFooter=e.DrawerFooter_default;exports.DrawerHeader=e.DrawerHeader_default;exports.useDrawer=e.useDrawer;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D as b,a as c,b as d,c as f,u as x}from"../../chunks/DrawerContent-
|
|
1
|
+
import{D as b,a as c,b as d,c as f,u as x}from"../../chunks/DrawerContent-OuMcge27.js";import"react";import"react/jsx-runtime";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/Stack-C2zMFX0w.js";import"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/ButtonIcon-mMZe5V_1.js";import"../../chunks/Ripple-Bq9bxg4k.js";import"../../chunks/Icon-B2zjgYkr.js";export{b as Drawer,c as DrawerContent,d as DrawerFooter,f as DrawerHeader,x as useDrawer};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../chunks/Icon-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../chunks/Icon-CFvy-l1V.cjs");require("react/jsx-runtime");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("react");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");exports.default=e.Icon;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as d}from"../../chunks/Icon-
|
|
1
|
+
import{I as d}from"../../chunks/Icon-B2zjgYkr.js";import"react/jsx-runtime";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"react";import"../../chunks/generateSupportColors-BN5t8dA-.js";export{d as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("react"),e=require("../../chunks/index-DYxwT4uW.cjs"),i=require("../../chunks/joinClass-Jk3EszKD.cjs"),q=require("../../chunks/createComponent-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("react"),e=require("../../chunks/index-DYxwT4uW.cjs"),i=require("../../chunks/joinClass-Jk3EszKD.cjs"),q=require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");function N({error:r,label:p,helperText:o,endIcon:a,startIcon:u,type:f="text",disabled:n,width:C="100%",...l}){const j=i.joinClass(`${e.prefix}-input-container`),m=i.joinClass(`${e.prefix}-input-label`,r&&`${e.prefix}-input-label--error`),_=i.joinClass(`${e.prefix}-input-container`,`${e.prefix}-input`,n&&`${e.prefix}-input--disabled`,r&&`${e.prefix}-input--error`,l.className),$=i.joinClass(`${e.prefix}-input__helper-text`,o&&`${e.prefix}-input__helper-text--visible`,r&&`${e.prefix}-input__helper-text--error`),c=(s,d)=>h.cloneElement(s,{disabled:n,size:s.props.size||30,type:"button",color:"grey",style:{...s.props.style},className:i.joinClass(s.props.className,`${e.prefix}-input__icon`,`${e.prefix}-input__icon--margin-${d}`),onClick:x=>{x.stopPropagation(),s.props.onClick&&s.props.onClick(x)}});return t.jsxs("div",{className:j,style:{width:C},children:[p&&t.jsxs("label",{className:m,children:[p," ",l.required&&"*"]}),t.jsxs("div",{className:_,children:[u&&c(u,"right"),t.jsx("input",{...l,type:f,disabled:n}),a&&c(a,"left")]}),t.jsx("p",{className:$,children:o})]})}const b=q.createComponent(N);exports.default=b;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as p,jsx as $}from"react/jsx-runtime";import{cloneElement as y}from"react";import{p as t}from"../../chunks/index-CZ41y9Hn.js";import{j as s}from"../../chunks/joinClass-anSpaauN.js";import{c as b}from"../../chunks/createComponent-
|
|
1
|
+
import{jsxs as p,jsx as $}from"react/jsx-runtime";import{cloneElement as y}from"react";import{p as t}from"../../chunks/index-CZ41y9Hn.js";import{j as s}from"../../chunks/joinClass-anSpaauN.js";import{c as b}from"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";function g({error:r,label:l,helperText:o,endIcon:a,startIcon:c,type:f="text",disabled:n,width:_="100%",...i}){const h=s(`${t}-input-container`),x=s(`${t}-input-label`,r&&`${t}-input-label--error`),C=s(`${t}-input-container`,`${t}-input`,n&&`${t}-input--disabled`,r&&`${t}-input--error`,i.className),d=s(`${t}-input__helper-text`,o&&`${t}-input__helper-text--visible`,r&&`${t}-input__helper-text--error`),m=(e,N)=>y(e,{disabled:n,size:e.props.size||30,type:"button",color:"grey",style:{...e.props.style},className:s(e.props.className,`${t}-input__icon`,`${t}-input__icon--margin-${N}`),onClick:u=>{u.stopPropagation(),e.props.onClick&&e.props.onClick(u)}});return p("div",{className:h,style:{width:_},children:[l&&p("label",{className:x,children:[l," ",i.required&&"*"]}),p("div",{className:C,children:[c&&m(c,"right"),$("input",{...i,type:f,disabled:n}),a&&m(a,"left")]}),$("p",{className:d,children:o})]})}const P=b(g);export{P as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),g=require("react"),c=require("../../chunks/index-DYxwT4uW.cjs"),T=require("../../chunks/joinClass-Jk3EszKD.cjs"),b=require("../../chunks/wait-CgS79FV1.cjs"),l=require("../../chunks/Stack-lvjI3kV3.cjs"),h=require("../../chunks/Zoom-BOnqwiDY.cjs"),p=require("../../chunks/Icon-CFvy-l1V.cjs"),j=require("../../chunks/Slide-D4aLHjYS.cjs"),z=require("../../chunks/Loading-zx7Fg7_c.cjs"),s=require("../../chunks/Typography-B2gBDBkp.cjs"),L=require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/convertPathToColor-D8eBpd_D.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");function $({files:a,error:r,success:u,helperText:y,placeholder:S,renderFiles:m,onChange:f,...i}){const d=g.useRef(null),[n,o]=g.useState("empty"),q=g.useMemo(()=>!i.multiple&&a.length>0,[a,i.multiple]),v=T.joinClass(`${c.prefix}-input-file`,r&&`${c.prefix}-input-file--error`,u&&n!=="loading"&&`${c.prefix}-input-file--success`,n==="dragging"&&!q&&`${c.prefix}-input-file--dragging`,i.className),x=t=>{if(!t.length){o("empty");return}o("loading"),b.wait(()=>{f&&f(i.multiple?[...a,...t]:t),o("empty")},1500)},D=t=>{const A=t.target.files?Array.from(t.target.files):[];d.current&&(d.current.value=""),x(A)},I=t=>{t.preventDefault(),o("dragging")},C=t=>{t.preventDefault(),o("empty")},k=t=>{t.preventDefault(),x(Array.from(t.dataTransfer.files))};return e.jsxs(l.Stack,{children:[e.jsxs("div",{className:v,onDrop:k,onDragOver:I,onDragLeave:C,children:[e.jsx("input",{...i,ref:d,type:"file",onChange:D}),e.jsxs(l.Stack,{justifyContent:"center",alignItems:"center",children:[n==="loading"&&!r&&e.jsxs(j.Slide,{enter:!0,direction:"top",style:{textAlign:"center"},children:[e.jsx(z.Loading,{style:{fontSize:42}}),e.jsx(s.Typography,{variant:"body2",color:"primary.main",children:"Carregando..."})]}),n!=="loading"&&!u&&!r&&e.jsxs(j.Slide,{enter:!0,direction:"top",style:{textAlign:"center"},children:[e.jsx(p.Icon,{name:"cloud-upload",color:n==="empty"?"grey":"primary",style:{fontSize:42}}),e.jsx(s.Typography,{color:n==="empty"?"text.secondary":"primary.main",variant:"body2",children:S})]}),n!=="loading"&&u&&!r&&e.jsx(h.Zoom,{enter:!0,style:{textAlign:"center"},children:e.jsxs(l.Stack,{gap:0,alignItems:"center",children:[e.jsx(p.Icon,{color:"success",name:"check-circle",style:{fontSize:42}}),e.jsx(s.Typography,{color:"success.main",children:y})]})}),r&&e.jsx(h.Zoom,{enter:!0,style:{textAlign:"center"},children:e.jsxs(l.Stack,{gap:0,alignItems:"center",children:[e.jsx(p.Icon,{color:"error",name:"exclamation-octagon",style:{fontSize:42}}),e.jsx(s.Typography,{color:"error.main",children:y})]})})]})]}),m&&m(a)]})}const M=L.createComponent($);exports.default=M;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/fields/InputFile/InputFile.tsx"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/fields/InputFile/InputFile.tsx"],"sourcesContent":["import {\n useRef,\n useMemo,\n useState,\n type DragEvent,\n type ChangeEvent,\n type InputHTMLAttributes\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport { wait } from '@iziui/toolkit/promise';\n\nimport Stack from '@/layout/Stack';\nimport Zoom from '@/animations/Zoom';\nimport Icon from '@/display/Icon/Icon';\nimport Slide from '@/animations/Slide';\nimport Loading from '@/feedback/Loading';\nimport Typography from '@/display/Typography';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/InputFile.scss';\n\ntype State = 'empty' | 'dragging' | 'loading';\n\nexport interface InputFileProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange'> {\n files: File[];\n error?: boolean;\n success?: boolean;\n helperText?: string;\n onChange?: (files: File[]) => void;\n renderFiles?: (files: File[]) => React.JSX.Element;\n}\n\nfunction InputFile({\n files,\n error,\n success,\n helperText,\n placeholder,\n renderFiles,\n onChange,\n ...props\n}: InputFileProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [state, setState] = useState<State>('empty');\n\n const isFilled = useMemo(\n () => !props.multiple && files.length > 0,\n [files, props.multiple]\n );\n\n const classes = joinClass(\n `${prefix}-input-file`,\n error && `${prefix}-input-file--error`,\n success && state !== 'loading' && `${prefix}-input-file--success`,\n state === 'dragging' && !isFilled && `${prefix}-input-file--dragging`,\n props.className\n );\n\n const processFiles = (newFiles: File[]) => {\n if (!newFiles.length) {\n setState('empty');\n return;\n }\n\n setState('loading');\n\n wait(() => {\n if (onChange) {\n onChange(props.multiple ? [...files, ...newFiles] : newFiles);\n }\n setState('empty');\n }, 1500);\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newFiles = e.target.files ? Array.from(e.target.files) : [];\n\n if (inputRef.current) { inputRef.current.value = ''; }\n\n processFiles(newFiles);\n };\n\n const handleDragOver = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n setState('dragging');\n };\n\n const handleDragLeave = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n setState('empty');\n };\n\n const handleDrop = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n processFiles(Array.from(e.dataTransfer.files));\n };\n\n return (\n <Stack>\n <div\n className={classes}\n onDrop={handleDrop}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n >\n <input\n {...props}\n ref={inputRef}\n type=\"file\"\n onChange={handleChange}\n />\n <Stack justifyContent=\"center\" alignItems=\"center\">\n {\n state === 'loading' && !error && (\n <Slide enter direction=\"top\" style={{ textAlign: 'center' }}>\n <Loading style={{ fontSize: 42 }} />\n <Typography variant=\"body2\" color=\"primary.main\">\n Carregando...\n </Typography>\n </Slide>\n )\n }\n {\n state !== 'loading' && !success && !error && (\n <Slide enter direction=\"top\" style={{ textAlign: 'center' }}>\n <Icon\n name=\"cloud-upload\"\n color={state === 'empty' ? 'grey' : 'primary'}\n style={{ fontSize: 42 }}\n />\n <Typography\n color={state === 'empty' ? 'text.secondary' : 'primary.main'}\n variant=\"body2\"\n >\n {placeholder}\n </Typography>\n </Slide>\n )\n }\n {\n state !== 'loading' && success && !error && (\n <Zoom enter style={{ textAlign: 'center' }}>\n <Stack gap={0} alignItems=\"center\">\n <Icon\n color=\"success\"\n name=\"check-circle\"\n style={{ fontSize: 42 }}\n />\n <Typography color=\"success.main\">{helperText}</Typography>\n </Stack>\n </Zoom>\n )\n }\n {\n error && (\n <Zoom enter style={{ textAlign: 'center' }}>\n <Stack gap={0} alignItems=\"center\">\n <Icon\n color=\"error\"\n name=\"exclamation-octagon\"\n style={{ fontSize: 42 }}\n />\n <Typography color=\"error.main\">{helperText}</Typography>\n </Stack>\n </Zoom>\n )\n }\n </Stack>\n </div>\n {renderFiles && renderFiles(files)}\n </Stack>\n );\n}\n\nexport default createComponent(InputFile);\n"],"names":["InputFile","files","error","success","helperText","placeholder","renderFiles","onChange","props","inputRef","useRef","state","setState","useState","isFilled","useMemo","classes","joinClass","prefix","processFiles","newFiles","wait","handleChange","e","handleDragOver","handleDragLeave","handleDrop","Stack","jsxs","jsx","Slide","Loading","Typography","Icon","Zoom","InputFile_default","createComponent"],"mappings":"yxBAoCA,SAASA,EAAU,CACjB,MAAAC,EACA,MAAAC,EACA,QAAAC,EACA,WAAAC,EACA,YAAAC,EACA,YAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAmB,CACjB,MAAMC,EAAWC,EAAAA,OAAyB,IAAI,EACxC,CAACC,EAAOC,CAAQ,EAAIC,EAAAA,SAAgB,OAAO,EAE3CC,EAAWC,EAAAA,QACf,IAAM,CAACP,EAAM,UAAYP,EAAM,OAAS,EACxC,CAACA,EAAOO,EAAM,QAAQ,CAAA,EAGlBQ,EAAUC,EAAAA,UACd,GAAGC,EAAAA,MAAM,cACThB,GAAS,GAAGgB,EAAAA,MAAM,qBAClBf,GAAWQ,IAAU,WAAa,GAAGO,EAAAA,MAAM,uBAC3CP,IAAU,YAAc,CAACG,GAAY,GAAGI,EAAAA,MAAM,wBAC9CV,EAAM,SAAA,EAGFW,EAAgBC,GAAqB,CACzC,GAAI,CAACA,EAAS,OAAQ,CACpBR,EAAS,OAAO,EAChB,MACF,CAEAA,EAAS,SAAS,EAElBS,EAAAA,KAAK,IAAM,CACLd,GACFA,EAASC,EAAM,SAAW,CAAC,GAAGP,EAAO,GAAGmB,CAAQ,EAAIA,CAAQ,EAE9DR,EAAS,OAAO,CAClB,EAAG,IAAI,CACT,EAEMU,EAAgBC,GAAqC,CACzD,MAAMH,EAAWG,EAAE,OAAO,MAAQ,MAAM,KAAKA,EAAE,OAAO,KAAK,EAAI,CAAA,EAE3Dd,EAAS,UAAWA,EAAS,QAAQ,MAAQ,IAEjDU,EAAaC,CAAQ,CACvB,EAEMI,EAAkBD,GAAiC,CACvDA,EAAE,eAAA,EACFX,EAAS,UAAU,CACrB,EAEMa,EAAmBF,GAAiC,CACxDA,EAAE,eAAA,EACFX,EAAS,OAAO,CAClB,EAEMc,EAAcH,GAAiC,CACnDA,EAAE,eAAA,EACFJ,EAAa,MAAM,KAAKI,EAAE,aAAa,KAAK,CAAC,CAC/C,EAEA,cACGI,QAAA,CACC,SAAA,CAAAC,EAAAA,KAAC,MAAA,CACC,UAAWZ,EACX,OAAQU,EACR,WAAYF,EACZ,YAAaC,EAEb,SAAA,CAAAI,EAAAA,IAAC,QAAA,CACE,GAAGrB,EACJ,IAAKC,EACL,KAAK,OACL,SAAUa,CAAA,CAAA,EAEZM,EAAAA,KAACD,EAAAA,MAAA,CAAM,eAAe,SAAS,WAAW,SAEtC,SAAA,CAAAhB,IAAU,WAAa,CAACT,GACtB0B,EAAAA,KAACE,EAAAA,MAAA,CAAM,MAAK,GAAC,UAAU,MAAM,MAAO,CAAE,UAAW,UAC/C,SAAA,CAAAD,EAAAA,IAACE,EAAAA,QAAA,CAAQ,MAAO,CAAE,SAAU,IAAM,QACjCC,EAAAA,WAAA,CAAW,QAAQ,QAAQ,MAAM,eAAe,SAAA,eAAA,CAEjD,CAAA,EACF,EAIFrB,IAAU,WAAa,CAACR,GAAW,CAACD,GAClC0B,EAAAA,KAACE,EAAAA,MAAA,CAAM,MAAK,GAAC,UAAU,MAAM,MAAO,CAAE,UAAW,UAC/C,SAAA,CAAAD,EAAAA,IAACI,EAAAA,KAAA,CACC,KAAK,eACL,MAAOtB,IAAU,QAAU,OAAS,UACpC,MAAO,CAAE,SAAU,EAAA,CAAG,CAAA,EAExBkB,EAAAA,IAACG,EAAAA,WAAA,CACC,MAAOrB,IAAU,QAAU,iBAAmB,eAC9C,QAAQ,QAEP,SAAAN,CAAA,CAAA,CACH,EACF,EAIFM,IAAU,WAAaR,GAAW,CAACD,GACjC2B,MAACK,EAAAA,MAAK,MAAK,GAAC,MAAO,CAAE,UAAW,UAC9B,SAAAN,EAAAA,KAACD,EAAAA,OAAM,IAAK,EAAG,WAAW,SACxB,SAAA,CAAAE,EAAAA,IAACI,EAAAA,KAAA,CACC,MAAM,UACN,KAAK,eACL,MAAO,CAAE,SAAU,EAAA,CAAG,CAAA,EAExBJ,EAAAA,IAACG,EAAAA,WAAA,CAAW,MAAM,eAAgB,SAAA5B,CAAA,CAAW,CAAA,CAAA,CAC/C,CAAA,CACF,EAIFF,GACE2B,EAAAA,IAACK,OAAA,CAAK,MAAK,GAAC,MAAO,CAAE,UAAW,QAAA,EAC9B,SAAAN,EAAAA,KAACD,EAAAA,MAAA,CAAM,IAAK,EAAG,WAAW,SACxB,SAAA,CAAAE,EAAAA,IAACI,EAAAA,KAAA,CACC,MAAM,QACN,KAAK,sBACL,MAAO,CAAE,SAAU,EAAA,CAAG,CAAA,EAExBJ,EAAAA,IAACG,EAAAA,WAAA,CAAW,MAAM,aAAc,SAAA5B,CAAA,CAAW,CAAA,CAAA,CAC7C,CAAA,CACF,CAAA,CAAA,CAGN,CAAA,CAAA,CAAA,EAEDE,GAAeA,EAAYL,CAAK,CAAA,EACnC,CAEJ,CAEA,MAAAkC,EAAeC,EAAAA,gBAAgBpC,CAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsxs as n,jsx as t}from"react/jsx-runtime";import{useRef as C,useState as j,useMemo as L}from"react";import{p as c}from"../../chunks/index-CZ41y9Hn.js";import{j as z}from"../../chunks/joinClass-anSpaauN.js";import{w as $}from"../../chunks/wait-BSgGzoPk.js";import{S as m}from"../../chunks/Stack-C2zMFX0w.js";import{Z as v}from"../../chunks/Zoom-DqgU4Wfv.js";import{I as g}from"../../chunks/Icon-B2zjgYkr.js";import{S as D}from"../../chunks/Slide-BxEwoZ70.js";import{L as O}from"../../chunks/Loading-CD7bT3lU.js";import{T as s}from"../../chunks/Typography-BkvvYn5T.js";import{c as b}from"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/convertPathToColor-DtOjH4ZP.js";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";function k({files:l,error:a,success:p,helperText:f,placeholder:S,renderFiles:u,onChange:y,...i}){const d=C(null),[r,o]=j("empty"),x=L(()=>!i.multiple&&l.length>0,[l,i.multiple]),I=z(`${c}-input-file`,a&&`${c}-input-file--error`,p&&r!=="loading"&&`${c}-input-file--success`,r==="dragging"&&!x&&`${c}-input-file--dragging`,i.className),h=e=>{if(!e.length){o("empty");return}o("loading"),$(()=>{y&&y(i.multiple?[...l,...e]:e),o("empty")},1500)};return n(m,{children:[n("div",{className:I,onDrop:e=>{e.preventDefault(),h(Array.from(e.dataTransfer.files))},onDragOver:e=>{e.preventDefault(),o("dragging")},onDragLeave:e=>{e.preventDefault(),o("empty")},children:[t("input",{...i,ref:d,type:"file",onChange:e=>{const A=e.target.files?Array.from(e.target.files):[];d.current&&(d.current.value=""),h(A)}}),n(m,{justifyContent:"center",alignItems:"center",children:[r==="loading"&&!a&&n(D,{enter:!0,direction:"top",style:{textAlign:"center"},children:[t(O,{style:{fontSize:42}}),t(s,{variant:"body2",color:"primary.main",children:"Carregando..."})]}),r!=="loading"&&!p&&!a&&n(D,{enter:!0,direction:"top",style:{textAlign:"center"},children:[t(g,{name:"cloud-upload",color:r==="empty"?"grey":"primary",style:{fontSize:42}}),t(s,{color:r==="empty"?"text.secondary":"primary.main",variant:"body2",children:S})]}),r!=="loading"&&p&&!a&&t(v,{enter:!0,style:{textAlign:"center"},children:n(m,{gap:0,alignItems:"center",children:[t(g,{color:"success",name:"check-circle",style:{fontSize:42}}),t(s,{color:"success.main",children:f})]})}),a&&t(v,{enter:!0,style:{textAlign:"center"},children:n(m,{gap:0,alignItems:"center",children:[t(g,{color:"error",name:"exclamation-octagon",style:{fontSize:42}}),t(s,{color:"error.main",children:f})]})})]})]}),u&&u(l)]})}const W=b(k);export{W as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/fields/InputFile/InputFile.tsx"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/fields/InputFile/InputFile.tsx"],"sourcesContent":["import {\n useRef,\n useMemo,\n useState,\n type DragEvent,\n type ChangeEvent,\n type InputHTMLAttributes\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport { wait } from '@iziui/toolkit/promise';\n\nimport Stack from '@/layout/Stack';\nimport Zoom from '@/animations/Zoom';\nimport Icon from '@/display/Icon/Icon';\nimport Slide from '@/animations/Slide';\nimport Loading from '@/feedback/Loading';\nimport Typography from '@/display/Typography';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/InputFile.scss';\n\ntype State = 'empty' | 'dragging' | 'loading';\n\nexport interface InputFileProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange'> {\n files: File[];\n error?: boolean;\n success?: boolean;\n helperText?: string;\n onChange?: (files: File[]) => void;\n renderFiles?: (files: File[]) => React.JSX.Element;\n}\n\nfunction InputFile({\n files,\n error,\n success,\n helperText,\n placeholder,\n renderFiles,\n onChange,\n ...props\n}: InputFileProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [state, setState] = useState<State>('empty');\n\n const isFilled = useMemo(\n () => !props.multiple && files.length > 0,\n [files, props.multiple]\n );\n\n const classes = joinClass(\n `${prefix}-input-file`,\n error && `${prefix}-input-file--error`,\n success && state !== 'loading' && `${prefix}-input-file--success`,\n state === 'dragging' && !isFilled && `${prefix}-input-file--dragging`,\n props.className\n );\n\n const processFiles = (newFiles: File[]) => {\n if (!newFiles.length) {\n setState('empty');\n return;\n }\n\n setState('loading');\n\n wait(() => {\n if (onChange) {\n onChange(props.multiple ? [...files, ...newFiles] : newFiles);\n }\n setState('empty');\n }, 1500);\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newFiles = e.target.files ? Array.from(e.target.files) : [];\n\n if (inputRef.current) { inputRef.current.value = ''; }\n\n processFiles(newFiles);\n };\n\n const handleDragOver = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n setState('dragging');\n };\n\n const handleDragLeave = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n setState('empty');\n };\n\n const handleDrop = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n processFiles(Array.from(e.dataTransfer.files));\n };\n\n return (\n <Stack>\n <div\n className={classes}\n onDrop={handleDrop}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n >\n <input\n {...props}\n ref={inputRef}\n type=\"file\"\n onChange={handleChange}\n />\n <Stack justifyContent=\"center\" alignItems=\"center\">\n {\n state === 'loading' && !error && (\n <Slide enter direction=\"top\" style={{ textAlign: 'center' }}>\n <Loading style={{ fontSize: 42 }} />\n <Typography variant=\"body2\" color=\"primary.main\">\n Carregando...\n </Typography>\n </Slide>\n )\n }\n {\n state !== 'loading' && !success && !error && (\n <Slide enter direction=\"top\" style={{ textAlign: 'center' }}>\n <Icon\n name=\"cloud-upload\"\n color={state === 'empty' ? 'grey' : 'primary'}\n style={{ fontSize: 42 }}\n />\n <Typography\n color={state === 'empty' ? 'text.secondary' : 'primary.main'}\n variant=\"body2\"\n >\n {placeholder}\n </Typography>\n </Slide>\n )\n }\n {\n state !== 'loading' && success && !error && (\n <Zoom enter style={{ textAlign: 'center' }}>\n <Stack gap={0} alignItems=\"center\">\n <Icon\n color=\"success\"\n name=\"check-circle\"\n style={{ fontSize: 42 }}\n />\n <Typography color=\"success.main\">{helperText}</Typography>\n </Stack>\n </Zoom>\n )\n }\n {\n error && (\n <Zoom enter style={{ textAlign: 'center' }}>\n <Stack gap={0} alignItems=\"center\">\n <Icon\n color=\"error\"\n name=\"exclamation-octagon\"\n style={{ fontSize: 42 }}\n />\n <Typography color=\"error.main\">{helperText}</Typography>\n </Stack>\n </Zoom>\n )\n }\n </Stack>\n </div>\n {renderFiles && renderFiles(files)}\n </Stack>\n );\n}\n\nexport default createComponent(InputFile);\n"],"names":["InputFile","files","error","success","helperText","placeholder","renderFiles","onChange","props","inputRef","useRef","state","setState","useState","isFilled","useMemo","classes","joinClass","prefix","processFiles","newFiles","wait","Stack","jsxs","jsx","Slide","Loading","Typography","Icon","Zoom","InputFile_default","createComponent"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../chunks/Loading-zx7Fg7_c.cjs");require("react/jsx-runtime");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/convertPathToColor-D8eBpd_D.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("react");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");exports.default=e.Loading;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L as l}from"../../chunks/Loading-CD7bT3lU.js";import"react/jsx-runtime";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/convertPathToColor-DtOjH4ZP.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"react";import"../../chunks/generateSupportColors-BN5t8dA-.js";export{l as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/useMenu-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/useMenu-C2KhwKNS.cjs"),r=require("../../chunks/MenuButton-CsePYu0b.cjs");require("react/jsx-runtime");require("react");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/uuid-omnJ9TjZ.cjs");require("../../chunks/useListenerResized-AwpsZLcP.cjs");require("../../chunks/Card-CcOpPKfS.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/CardContent-D2cDaP4l.cjs");exports.Menu=e.Menu;exports.useMenu=e.useMenu;exports.MenuButton=r.MenuButton_default;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as
|
|
1
|
+
import{M as B,u as b}from"../../chunks/useMenu-DLaxCUF_.js";import{M as d}from"../../chunks/MenuButton-nVBc0ieJ.js";import"react/jsx-runtime";import"react";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/uuid-dGvr9vBZ.js";import"../../chunks/useListenerResized-Bnqxrt7k.js";import"../../chunks/Card-DDRUwdlG.js";import"../../chunks/Ripple-Bq9bxg4k.js";import"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/CardContent-DYAWf3xO.js";export{B as Menu,d as MenuButton,b as useMenu};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),o=require("../../chunks/index-DYxwT4uW.cjs"),f=require("../../chunks/joinClass-Jk3EszKD.cjs"),x=require("../../chunks/createComponent-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),o=require("../../chunks/index-DYxwT4uW.cjs"),f=require("../../chunks/joinClass-Jk3EszKD.cjs"),x=require("../../chunks/createComponent-B2C4sTOb.cjs"),v=require("../../chunks/Card-CcOpPKfS.cjs"),g=require("../../chunks/CardContent-D2cDaP4l.cjs"),C=require("../../chunks/Stack-lvjI3kV3.cjs"),_=require("../../chunks/ButtonIcon-CJ5Iz-uJ.cjs"),M=require("../../chunks/Icon-CFvy-l1V.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");function N({children:n,title:c,subtitle:l,isOpen:u,onClose:i,...m}){const[d,a]=s.useState({visible:!1,animation:"hide"}),r=s.useRef(null),j=300,p=f.joinClass(`${o.prefix}-modal`,`${o.prefix}-modal--${d.animation}`),b=f.joinClass(`${o.prefix}-modal__content`,m.className),h=f.joinClass(`${o.prefix}-modal__backdrop`,`${o.prefix}-modal__backdrop--${d.animation}`);s.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow="auto"}),[]),s.useEffect(()=>(u?y():q(),()=>{r.current&&(clearTimeout(r.current),r.current=null)}),[u]);const y=()=>{a(t=>({...t,visible:!0})),r.current=setTimeout(()=>{a(t=>({...t,animation:"show"})),document.body.style.overflow="hidden"},100)},q=()=>{a(t=>({...t,animation:"hide"})),r.current=setTimeout(()=>{a(t=>({...t,visible:!1})),document.body.style.overflow=""},j)};return d.visible&&e.jsx("div",{className:h,onClick:i,children:e.jsx("div",{className:`${o.prefix}-modal__container`,children:e.jsx(v.Card,{className:p,children:e.jsxs(g.CardContent,{onClick:t=>t.stopPropagation(),children:[e.jsxs(C.Stack,{alignItems:"center",flexDirection:"row",justifyContent:"space-between",style:{flexWrap:"nowrap"},children:[e.jsxs("div",{children:[c,l]}),e.jsx(_.ButtonIcon,{color:"grey",onClick:i,children:e.jsx(M.Icon,{name:"times"})})]}),e.jsx("div",{...m,className:b,children:n})]})})})})}const k=x.createComponent(N);function w({children:n}){return e.jsx(C.Stack,{flexDirection:"row",justifyContent:"flex-end",alignItems:"center",children:n})}const I=x.createComponent(w);function $({open:n=!1}={}){const[c,l]=s.useState(n);return[c,()=>l(i=>!i)]}exports.Modal=k;exports.ModalFooter=I;exports.useModal=$;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as d}from"react/jsx-runtime";import{useState as C,useRef as x,useEffect as p}from"react";import{p as t}from"../../chunks/index-CZ41y9Hn.js";import{j as f}from"../../chunks/joinClass-anSpaauN.js";import{c as h}from"../../chunks/createComponent-
|
|
1
|
+
import{jsx as e,jsxs as d}from"react/jsx-runtime";import{useState as C,useRef as x,useEffect as p}from"react";import{p as t}from"../../chunks/index-CZ41y9Hn.js";import{j as f}from"../../chunks/joinClass-anSpaauN.js";import{c as h}from"../../chunks/createComponent-D-IheGJm.js";import{C as I}from"../../chunks/Card-DDRUwdlG.js";import{C as M}from"../../chunks/CardContent-DYAWf3xO.js";import{S as b}from"../../chunks/Stack-C2zMFX0w.js";import{B as $}from"../../chunks/ButtonIcon-mMZe5V_1.js";import{I as k}from"../../chunks/Icon-B2zjgYkr.js";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/Ripple-Bq9bxg4k.js";function j({children:n,title:s,subtitle:l,isOpen:c,onClose:a,...u}){const[m,i]=C({visible:!1,animation:"hide"}),r=x(null),v=300,y=f(`${t}-modal`,`${t}-modal--${m.animation}`),_=f(`${t}-modal__content`,u.className),g=f(`${t}-modal__backdrop`,`${t}-modal__backdrop--${m.animation}`);p(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow="auto"}),[]),p(()=>(c?N():w(),()=>{r.current&&(clearTimeout(r.current),r.current=null)}),[c]);const N=()=>{i(o=>({...o,visible:!0})),r.current=setTimeout(()=>{i(o=>({...o,animation:"show"})),document.body.style.overflow="hidden"},100)},w=()=>{i(o=>({...o,animation:"hide"})),r.current=setTimeout(()=>{i(o=>({...o,visible:!1})),document.body.style.overflow=""},v)};return m.visible&&e("div",{className:g,onClick:a,children:e("div",{className:`${t}-modal__container`,children:e(I,{className:y,children:d(M,{onClick:o=>o.stopPropagation(),children:[d(b,{alignItems:"center",flexDirection:"row",justifyContent:"space-between",style:{flexWrap:"nowrap"},children:[d("div",{children:[s,l]}),e($,{color:"grey",onClick:a,children:e(k,{name:"times"})})]}),e("div",{...u,className:_,children:n})]})})})})}const G=h(j);function T({children:n}){return e(b,{flexDirection:"row",justifyContent:"flex-end",alignItems:"center",children:n})}const H=h(T);function J({open:n=!1}={}){const[s,l]=C(n);return[s,()=>l(a=>!a)]}export{G as Modal,H as ModalFooter,J as useModal};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("react"),s=require("../../chunks/index-DYxwT4uW.cjs"),n=require("../../chunks/joinClass-Jk3EszKD.cjs"),M=require("../../chunks/Icon-CFvy-l1V.cjs"),C=require("../../chunks/useMenu-C2KhwKNS.cjs"),k=require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/uuid-omnJ9TjZ.cjs");require("../../chunks/useListenerResized-AwpsZLcP.cjs");require("../../chunks/Card-CcOpPKfS.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");require("../../chunks/CardContent-D2cDaP4l.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");function S({error:c,color:a="grey",label:u,helperText:p,startIcon:x,children:j,disabled:l,onChange:d,...t}){const f=o.Children.toArray(j),q=o.useMemo(()=>f.find(e=>e.props.value===t.value)?.props.children||"",[t.value]),[_,$,m]=C.useMenu(),v=n.joinClass(`${s.prefix}-select-container`),h=n.joinClass(`${s.prefix}-select-label`,c&&`${s.prefix}-select-label--error`),N=n.joinClass(`${s.prefix}-select`,l&&`${s.prefix}-select--disabled`,c&&`${s.prefix}-select--error`,t.className),y=n.joinClass(`${s.prefix}-select__helper-text`,p&&`${s.prefix}-select__helper-text--visible`,c&&`${s.prefix}-select__helper-text--error`),b=e=>o.cloneElement(e,{className:n.joinClass(e.props.className,`${s.prefix}-select__icon--left`),type:"button",style:{color:a},onClick:i=>{i.stopPropagation(),e.props.onClick&&!l&&e.props.onClick(i)}}),g=()=>f.map(e=>o.cloneElement(e,{color:a,className:n.joinClass(e.props.className,e.props.value===t.value&&`${s.prefix}-select__option--selected`),onClick:i=>{!e.props.disabled&&d&&d(i)}}));return r.jsxs("div",{className:v,children:[u&&r.jsxs("label",{className:h,children:[u," ",t.required&&"*"]}),r.jsxs("button",{type:"button",className:N,onClick:m,disabled:l,children:[r.jsx("div",{children:x&&b(x)}),r.jsx("input",{...t,readOnly:!0,type:"text",value:q,disabled:l}),r.jsx(M.Icon,{name:"angle-down",sx:{color:({grey:e})=>e.main},className:`${s.prefix}-select__icon--right`})]}),r.jsx(C.Menu,{autoClose:!0,direction:"center",open:_,anchorEl:$,onClose:m,children:g()}),r.jsx("span",{className:y,children:p})]})}const E=k.createComponent(S);exports.default=E;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/fields/Select/Select.tsx"],"sourcesContent":["import {\n useMemo,\n Children,\n cloneElement,\n type ReactElement,\n type InputHTMLAttributes,\n type ButtonHTMLAttributes,\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { Colors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport Icon from '@/display/Icon';\nimport { Menu, useMenu } from '@/navigation/Menu';\n\nimport type { OptionProps } from './Option';\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Select.scss';\n\nexport interface SelectProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'color'> {\n error?: boolean;\n autoClose?: boolean;\n label?: string;\n helperText?: string;\n color?: Colors;\n startIcon?: React.JSX.Element | boolean;\n children: React.JSX.Element | React.JSX.Element[];\n}\n\nfunction Select({\n error,\n color = 'grey',\n label,\n helperText,\n startIcon,\n children,\n disabled,\n onChange,\n ...props\n}: SelectProps) {\n const arrayChildren = Children.toArray(children) as ReactElement<OptionProps>[];\n\n const newValue = useMemo(() => {\n return arrayChildren.find((child) =>\n child.props.value === props.value)?.props.children || '';\n }, [props.value]);\n\n const [open, el, toggle] = useMenu();\n\n const containerClss = joinClass(\n `${prefix}-select-container`\n );\n\n const labelClss = joinClass(\n `${prefix}-select-label`,\n error && `${prefix}-select-label--error`,\n );\n\n const clss = joinClass(\n `${prefix}-select`,\n disabled && `${prefix}-select--disabled`,\n error && `${prefix}-select--error`,\n props.className\n );\n\n const helperTextClss = joinClass(\n `${prefix}-select__helper-text`,\n helperText && `${prefix}-select__helper-text--visible`,\n error && `${prefix}-select__helper-text--error`\n );\n\n const renderIcon = (icon: ReactElement<ButtonHTMLAttributes<any>>) => {\n return cloneElement(icon, {\n className: joinClass(\n icon.props.className,\n `${prefix}-select__icon--left`\n ),\n type: 'button',\n style: { color },\n onClick: (e) => {\n e.stopPropagation();\n if (icon.props.onClick && !disabled) { icon.props.onClick(e); };\n }\n });\n };\n\n const renderOption = () => {\n return arrayChildren.map((child) => {\n return cloneElement(child, {\n color,\n className: joinClass(\n child.props.className,\n child.props.value === props.value && `${prefix}-select__option--selected`,\n ),\n onClick: (e) => {\n if (!child.props.disabled && onChange) { onChange(e as any); }\n }\n });\n });\n };\n\n return (\n <div className={containerClss}>\n {label && <label className={labelClss}>{label} {props.required && '*'}</label>}\n <button type=\"button\" className={clss} onClick={toggle} disabled={disabled}>\n <div>\n {startIcon && renderIcon(startIcon as React.JSX.Element)}\n </div>\n <input {...props} readOnly type=\"text\" value={newValue} disabled={disabled} />\n <Icon\n name=\"angle-down\"\n sx={{ color: ({ grey }) => grey.main }}\n className={`${prefix}-select__icon--right`}\n />\n </button>\n <Menu\n autoClose\n direction=\"center\"\n open={open}\n anchorEl={el}\n onClose={toggle}\n >\n {renderOption()}\n </Menu>\n <span className={helperTextClss}>{helperText}</span>\n </div>\n );\n}\n\nexport default createComponent(Select);\n"],"names":["Select","error","color","label","helperText","startIcon","children","disabled","onChange","props","arrayChildren","Children","newValue","useMemo","child","open","el","toggle","useMenu","containerClss","joinClass","prefix","labelClss","clss","helperTextClss","renderIcon","icon","cloneElement","e","renderOption","jsxs","jsx","Icon","grey","Menu","Select_default","createComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/fields/Select/Select.tsx"],"sourcesContent":["import {\n useMemo,\n Children,\n cloneElement,\n type ReactElement,\n type InputHTMLAttributes,\n type ButtonHTMLAttributes,\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { Colors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport Icon from '@/display/Icon';\nimport { Menu, useMenu } from '@/navigation/Menu';\n\nimport type { OptionProps } from './Option';\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Select.scss';\n\nexport interface SelectProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'color'> {\n error?: boolean;\n autoClose?: boolean;\n label?: string;\n helperText?: string;\n color?: Colors;\n startIcon?: React.JSX.Element | boolean;\n children: React.JSX.Element | React.JSX.Element[];\n}\n\nfunction Select({\n error,\n color = 'grey',\n label,\n helperText,\n startIcon,\n children,\n disabled,\n onChange,\n ...props\n}: SelectProps) {\n const arrayChildren = Children.toArray(children) as ReactElement<OptionProps>[];\n\n const newValue = useMemo(() => {\n return arrayChildren.find((child) =>\n child.props.value === props.value)?.props.children || '';\n }, [props.value]);\n\n const [open, el, toggle] = useMenu();\n\n const containerClss = joinClass(\n `${prefix}-select-container`\n );\n\n const labelClss = joinClass(\n `${prefix}-select-label`,\n error && `${prefix}-select-label--error`,\n );\n\n const clss = joinClass(\n `${prefix}-select`,\n disabled && `${prefix}-select--disabled`,\n error && `${prefix}-select--error`,\n props.className\n );\n\n const helperTextClss = joinClass(\n `${prefix}-select__helper-text`,\n helperText && `${prefix}-select__helper-text--visible`,\n error && `${prefix}-select__helper-text--error`\n );\n\n const renderIcon = (icon: ReactElement<ButtonHTMLAttributes<any>>) => {\n return cloneElement(icon, {\n className: joinClass(\n icon.props.className,\n `${prefix}-select__icon--left`\n ),\n type: 'button',\n style: { color },\n onClick: (e) => {\n e.stopPropagation();\n if (icon.props.onClick && !disabled) { icon.props.onClick(e); };\n }\n });\n };\n\n const renderOption = () => {\n return arrayChildren.map((child) => {\n return cloneElement(child, {\n color,\n className: joinClass(\n child.props.className,\n child.props.value === props.value && `${prefix}-select__option--selected`,\n ),\n onClick: (e) => {\n if (!child.props.disabled && onChange) { onChange(e as any); }\n }\n });\n });\n };\n\n return (\n <div className={containerClss}>\n {label && <label className={labelClss}>{label} {props.required && '*'}</label>}\n <button type=\"button\" className={clss} onClick={toggle} disabled={disabled}>\n <div>\n {startIcon && renderIcon(startIcon as React.JSX.Element)}\n </div>\n <input {...props} readOnly type=\"text\" value={newValue} disabled={disabled} />\n <Icon\n name=\"angle-down\"\n sx={{ color: ({ grey }) => grey.main }}\n className={`${prefix}-select__icon--right`}\n />\n </button>\n <Menu\n autoClose\n direction=\"center\"\n open={open}\n anchorEl={el}\n onClose={toggle}\n >\n {renderOption()}\n </Menu>\n <span className={helperTextClss}>{helperText}</span>\n </div>\n );\n}\n\nexport default createComponent(Select);\n"],"names":["Select","error","color","label","helperText","startIcon","children","disabled","onChange","props","arrayChildren","Children","newValue","useMemo","child","open","el","toggle","useMenu","containerClss","joinClass","prefix","labelClss","clss","helperTextClss","renderIcon","icon","cloneElement","e","renderOption","jsxs","jsx","Icon","grey","Menu","Select_default","createComponent"],"mappings":"suBAgCA,SAASA,EAAO,CACd,MAAAC,EACA,MAAAC,EAAQ,OACR,MAAAC,EACA,WAAAC,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAgB,CACd,MAAMC,EAAgBC,EAAAA,SAAS,QAAQL,CAAQ,EAEzCM,EAAWC,EAAAA,QAAQ,IAChBH,EAAc,KAAMI,GACzBA,EAAM,MAAM,QAAUL,EAAM,KAAK,GAAG,MAAM,UAAY,GACvD,CAACA,EAAM,KAAK,CAAC,EAEV,CAACM,EAAMC,EAAIC,CAAM,EAAIC,EAAAA,QAAA,EAErBC,EAAgBC,EAAAA,UACpB,GAAGC,EAAAA,MAAM,mBAAA,EAGLC,EAAYF,EAAAA,UAChB,GAAGC,EAAAA,MAAM,gBACTpB,GAAS,GAAGoB,EAAAA,MAAM,sBAAA,EAGdE,EAAOH,EAAAA,UACX,GAAGC,EAAAA,MAAM,UACTd,GAAY,GAAGc,EAAAA,MAAM,oBACrBpB,GAAS,GAAGoB,EAAAA,MAAM,iBAClBZ,EAAM,SAAA,EAGFe,EAAiBJ,EAAAA,UACrB,GAAGC,EAAAA,MAAM,uBACTjB,GAAc,GAAGiB,EAAAA,MAAM,gCACvBpB,GAAS,GAAGoB,EAAAA,MAAM,6BAAA,EAGdI,EAAcC,GACXC,EAAAA,aAAaD,EAAM,CACxB,UAAWN,EAAAA,UACTM,EAAK,MAAM,UACX,GAAGL,EAAAA,MAAM,qBAAA,EAEX,KAAM,SACN,MAAO,CAAE,MAAAnB,CAAA,EACT,QAAU0B,GAAM,CACdA,EAAE,gBAAA,EACEF,EAAK,MAAM,SAAW,CAACnB,GAAYmB,EAAK,MAAM,QAAQE,CAAC,CAC7D,CAAA,CACD,EAGGC,EAAe,IACZnB,EAAc,IAAKI,GACjBa,EAAAA,aAAab,EAAO,CACzB,MAAAZ,EACA,UAAWkB,EAAAA,UACTN,EAAM,MAAM,UACZA,EAAM,MAAM,QAAUL,EAAM,OAAS,GAAGY,EAAAA,MAAM,2BAAA,EAEhD,QAAUO,GAAM,CACV,CAACd,EAAM,MAAM,UAAYN,GAAYA,EAASoB,CAAQ,CAC5D,CAAA,CACD,CACF,EAGH,OACEE,EAAAA,KAAC,MAAA,CAAI,UAAWX,EACb,SAAA,CAAAhB,GAAS2B,EAAAA,KAAC,QAAA,CAAM,UAAWR,EAAY,SAAA,CAAAnB,EAAM,IAAEM,EAAM,UAAY,GAAA,EAAI,EACtEqB,EAAAA,KAAC,UAAO,KAAK,SAAS,UAAWP,EAAM,QAASN,EAAQ,SAAAV,EACtD,SAAA,CAAAwB,EAAAA,IAAC,MAAA,CACE,SAAA1B,GAAaoB,EAAWpB,CAA8B,EACzD,EACA0B,EAAAA,IAAC,QAAA,CAAO,GAAGtB,EAAO,SAAQ,GAAC,KAAK,OAAO,MAAOG,EAAU,SAAAL,CAAA,CAAoB,EAC5EwB,EAAAA,IAACC,EAAAA,KAAA,CACC,KAAK,aACL,GAAI,CAAE,MAAO,CAAC,CAAE,KAAAC,CAAA,IAAWA,EAAK,IAAA,EAChC,UAAW,GAAGZ,EAAAA,MAAM,sBAAA,CAAA,CACtB,EACF,EACAU,EAAAA,IAACG,EAAAA,KAAA,CACC,UAAS,GACT,UAAU,SACV,KAAAnB,EACA,SAAUC,EACV,QAASC,EAER,SAAAY,EAAA,CAAa,CAAA,EAEhBE,EAAAA,IAAC,OAAA,CAAK,UAAWP,EAAiB,SAAApB,CAAA,CAAW,CAAA,EAC/C,CAEJ,CAEA,MAAA+B,EAAeC,EAAAA,gBAAgBpC,CAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as a,jsx as l}from"react/jsx-runtime";import{Children as M,useMemo as w,cloneElement as _}from"react";import{p as t}from"../../chunks/index-CZ41y9Hn.js";import{j as r}from"../../chunks/joinClass-anSpaauN.js";import{I as E}from"../../chunks/Icon-
|
|
1
|
+
import{jsxs as a,jsx as l}from"react/jsx-runtime";import{Children as M,useMemo as w,cloneElement as _}from"react";import{p as t}from"../../chunks/index-CZ41y9Hn.js";import{j as r}from"../../chunks/joinClass-anSpaauN.js";import{I as E}from"../../chunks/Icon-B2zjgYkr.js";import{u as I,M as O}from"../../chunks/useMenu-DLaxCUF_.js";import{c as S}from"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/uuid-dGvr9vBZ.js";import"../../chunks/useListenerResized-Bnqxrt7k.js";import"../../chunks/Card-DDRUwdlG.js";import"../../chunks/Ripple-Bq9bxg4k.js";import"../../chunks/CardContent-DYAWf3xO.js";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";function q({error:c,color:i="grey",label:p,helperText:m,startIcon:u,children:$,disabled:o,onChange:d,...s}){const f=M.toArray($),h=w(()=>f.find(e=>e.props.value===s.value)?.props.children||"",[s.value]),[N,v,C]=I(),x=r(`${t}-select-container`),y=r(`${t}-select-label`,c&&`${t}-select-label--error`),b=r(`${t}-select`,o&&`${t}-select--disabled`,c&&`${t}-select--error`,s.className),g=r(`${t}-select__helper-text`,m&&`${t}-select__helper-text--visible`,c&&`${t}-select__helper-text--error`),k=e=>_(e,{className:r(e.props.className,`${t}-select__icon--left`),type:"button",style:{color:i},onClick:n=>{n.stopPropagation(),e.props.onClick&&!o&&e.props.onClick(n)}}),j=()=>f.map(e=>_(e,{color:i,className:r(e.props.className,e.props.value===s.value&&`${t}-select__option--selected`),onClick:n=>{!e.props.disabled&&d&&d(n)}}));return a("div",{className:x,children:[p&&a("label",{className:y,children:[p," ",s.required&&"*"]}),a("button",{type:"button",className:b,onClick:C,disabled:o,children:[l("div",{children:u&&k(u)}),l("input",{...s,readOnly:!0,type:"text",value:h,disabled:o}),l(E,{name:"angle-down",sx:{color:({grey:e})=>e.main},className:`${t}-select__icon--right`})]}),l(O,{autoClose:!0,direction:"center",open:N,anchorEl:v,onClose:C,children:j()}),l("span",{className:g,children:m})]})}const T=S(q);export{T as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/fields/Select/Select.tsx"],"sourcesContent":["import {\n useMemo,\n Children,\n cloneElement,\n type ReactElement,\n type InputHTMLAttributes,\n type ButtonHTMLAttributes,\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { Colors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport Icon from '@/display/Icon';\nimport { Menu, useMenu } from '@/navigation/Menu';\n\nimport type { OptionProps } from './Option';\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Select.scss';\n\nexport interface SelectProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'color'> {\n error?: boolean;\n autoClose?: boolean;\n label?: string;\n helperText?: string;\n color?: Colors;\n startIcon?: React.JSX.Element | boolean;\n children: React.JSX.Element | React.JSX.Element[];\n}\n\nfunction Select({\n error,\n color = 'grey',\n label,\n helperText,\n startIcon,\n children,\n disabled,\n onChange,\n ...props\n}: SelectProps) {\n const arrayChildren = Children.toArray(children) as ReactElement<OptionProps>[];\n\n const newValue = useMemo(() => {\n return arrayChildren.find((child) =>\n child.props.value === props.value)?.props.children || '';\n }, [props.value]);\n\n const [open, el, toggle] = useMenu();\n\n const containerClss = joinClass(\n `${prefix}-select-container`\n );\n\n const labelClss = joinClass(\n `${prefix}-select-label`,\n error && `${prefix}-select-label--error`,\n );\n\n const clss = joinClass(\n `${prefix}-select`,\n disabled && `${prefix}-select--disabled`,\n error && `${prefix}-select--error`,\n props.className\n );\n\n const helperTextClss = joinClass(\n `${prefix}-select__helper-text`,\n helperText && `${prefix}-select__helper-text--visible`,\n error && `${prefix}-select__helper-text--error`\n );\n\n const renderIcon = (icon: ReactElement<ButtonHTMLAttributes<any>>) => {\n return cloneElement(icon, {\n className: joinClass(\n icon.props.className,\n `${prefix}-select__icon--left`\n ),\n type: 'button',\n style: { color },\n onClick: (e) => {\n e.stopPropagation();\n if (icon.props.onClick && !disabled) { icon.props.onClick(e); };\n }\n });\n };\n\n const renderOption = () => {\n return arrayChildren.map((child) => {\n return cloneElement(child, {\n color,\n className: joinClass(\n child.props.className,\n child.props.value === props.value && `${prefix}-select__option--selected`,\n ),\n onClick: (e) => {\n if (!child.props.disabled && onChange) { onChange(e as any); }\n }\n });\n });\n };\n\n return (\n <div className={containerClss}>\n {label && <label className={labelClss}>{label} {props.required && '*'}</label>}\n <button type=\"button\" className={clss} onClick={toggle} disabled={disabled}>\n <div>\n {startIcon && renderIcon(startIcon as React.JSX.Element)}\n </div>\n <input {...props} readOnly type=\"text\" value={newValue} disabled={disabled} />\n <Icon\n name=\"angle-down\"\n sx={{ color: ({ grey }) => grey.main }}\n className={`${prefix}-select__icon--right`}\n />\n </button>\n <Menu\n autoClose\n direction=\"center\"\n open={open}\n anchorEl={el}\n onClose={toggle}\n >\n {renderOption()}\n </Menu>\n <span className={helperTextClss}>{helperText}</span>\n </div>\n );\n}\n\nexport default createComponent(Select);\n"],"names":["Select","error","color","label","helperText","startIcon","children","disabled","onChange","props","arrayChildren","Children","newValue","useMemo","child","open","el","toggle","useMenu","containerClss","joinClass","prefix","labelClss","clss","helperTextClss","renderIcon","icon","cloneElement","e","renderOption","jsxs","jsx","Icon","grey","Menu","Select_default","createComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/fields/Select/Select.tsx"],"sourcesContent":["import {\n useMemo,\n Children,\n cloneElement,\n type ReactElement,\n type InputHTMLAttributes,\n type ButtonHTMLAttributes,\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { Colors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport Icon from '@/display/Icon';\nimport { Menu, useMenu } from '@/navigation/Menu';\n\nimport type { OptionProps } from './Option';\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Select.scss';\n\nexport interface SelectProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'color'> {\n error?: boolean;\n autoClose?: boolean;\n label?: string;\n helperText?: string;\n color?: Colors;\n startIcon?: React.JSX.Element | boolean;\n children: React.JSX.Element | React.JSX.Element[];\n}\n\nfunction Select({\n error,\n color = 'grey',\n label,\n helperText,\n startIcon,\n children,\n disabled,\n onChange,\n ...props\n}: SelectProps) {\n const arrayChildren = Children.toArray(children) as ReactElement<OptionProps>[];\n\n const newValue = useMemo(() => {\n return arrayChildren.find((child) =>\n child.props.value === props.value)?.props.children || '';\n }, [props.value]);\n\n const [open, el, toggle] = useMenu();\n\n const containerClss = joinClass(\n `${prefix}-select-container`\n );\n\n const labelClss = joinClass(\n `${prefix}-select-label`,\n error && `${prefix}-select-label--error`,\n );\n\n const clss = joinClass(\n `${prefix}-select`,\n disabled && `${prefix}-select--disabled`,\n error && `${prefix}-select--error`,\n props.className\n );\n\n const helperTextClss = joinClass(\n `${prefix}-select__helper-text`,\n helperText && `${prefix}-select__helper-text--visible`,\n error && `${prefix}-select__helper-text--error`\n );\n\n const renderIcon = (icon: ReactElement<ButtonHTMLAttributes<any>>) => {\n return cloneElement(icon, {\n className: joinClass(\n icon.props.className,\n `${prefix}-select__icon--left`\n ),\n type: 'button',\n style: { color },\n onClick: (e) => {\n e.stopPropagation();\n if (icon.props.onClick && !disabled) { icon.props.onClick(e); };\n }\n });\n };\n\n const renderOption = () => {\n return arrayChildren.map((child) => {\n return cloneElement(child, {\n color,\n className: joinClass(\n child.props.className,\n child.props.value === props.value && `${prefix}-select__option--selected`,\n ),\n onClick: (e) => {\n if (!child.props.disabled && onChange) { onChange(e as any); }\n }\n });\n });\n };\n\n return (\n <div className={containerClss}>\n {label && <label className={labelClss}>{label} {props.required && '*'}</label>}\n <button type=\"button\" className={clss} onClick={toggle} disabled={disabled}>\n <div>\n {startIcon && renderIcon(startIcon as React.JSX.Element)}\n </div>\n <input {...props} readOnly type=\"text\" value={newValue} disabled={disabled} />\n <Icon\n name=\"angle-down\"\n sx={{ color: ({ grey }) => grey.main }}\n className={`${prefix}-select__icon--right`}\n />\n </button>\n <Menu\n autoClose\n direction=\"center\"\n open={open}\n anchorEl={el}\n onClose={toggle}\n >\n {renderOption()}\n </Menu>\n <span className={helperTextClss}>{helperText}</span>\n </div>\n );\n}\n\nexport default createComponent(Select);\n"],"names":["Select","error","color","label","helperText","startIcon","children","disabled","onChange","props","arrayChildren","Children","newValue","useMemo","child","open","el","toggle","useMenu","containerClss","joinClass","prefix","labelClss","clss","helperTextClss","renderIcon","icon","cloneElement","e","renderOption","jsxs","jsx","Icon","grey","Menu","Select_default","createComponent"],"mappings":"6rBAgCA,SAASA,EAAO,CACd,MAAAC,EACA,MAAAC,EAAQ,OACR,MAAAC,EACA,WAAAC,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAgB,CACd,MAAMC,EAAgBC,EAAS,QAAQL,CAAQ,EAEzCM,EAAWC,EAAQ,IAChBH,EAAc,KAAMI,GACzBA,EAAM,MAAM,QAAUL,EAAM,KAAK,GAAG,MAAM,UAAY,GACvD,CAACA,EAAM,KAAK,CAAC,EAEV,CAACM,EAAMC,EAAIC,CAAM,EAAIC,EAAA,EAErBC,EAAgBC,EACpB,GAAGC,CAAM,mBAAA,EAGLC,EAAYF,EAChB,GAAGC,CAAM,gBACTpB,GAAS,GAAGoB,CAAM,sBAAA,EAGdE,EAAOH,EACX,GAAGC,CAAM,UACTd,GAAY,GAAGc,CAAM,oBACrBpB,GAAS,GAAGoB,CAAM,iBAClBZ,EAAM,SAAA,EAGFe,EAAiBJ,EACrB,GAAGC,CAAM,uBACTjB,GAAc,GAAGiB,CAAM,gCACvBpB,GAAS,GAAGoB,CAAM,6BAAA,EAGdI,EAAcC,GACXC,EAAaD,EAAM,CACxB,UAAWN,EACTM,EAAK,MAAM,UACX,GAAGL,CAAM,qBAAA,EAEX,KAAM,SACN,MAAO,CAAE,MAAAnB,CAAA,EACT,QAAU0B,GAAM,CACdA,EAAE,gBAAA,EACEF,EAAK,MAAM,SAAW,CAACnB,GAAYmB,EAAK,MAAM,QAAQE,CAAC,CAC7D,CAAA,CACD,EAGGC,EAAe,IACZnB,EAAc,IAAKI,GACjBa,EAAab,EAAO,CACzB,MAAAZ,EACA,UAAWkB,EACTN,EAAM,MAAM,UACZA,EAAM,MAAM,QAAUL,EAAM,OAAS,GAAGY,CAAM,2BAAA,EAEhD,QAAUO,GAAM,CACV,CAACd,EAAM,MAAM,UAAYN,GAAYA,EAASoB,CAAQ,CAC5D,CAAA,CACD,CACF,EAGH,OACEE,EAAC,MAAA,CAAI,UAAWX,EACb,SAAA,CAAAhB,GAAS2B,EAAC,QAAA,CAAM,UAAWR,EAAY,SAAA,CAAAnB,EAAM,IAAEM,EAAM,UAAY,GAAA,EAAI,EACtEqB,EAAC,UAAO,KAAK,SAAS,UAAWP,EAAM,QAASN,EAAQ,SAAAV,EACtD,SAAA,CAAAwB,EAAC,MAAA,CACE,SAAA1B,GAAaoB,EAAWpB,CAA8B,EACzD,EACA0B,EAAC,QAAA,CAAO,GAAGtB,EAAO,SAAQ,GAAC,KAAK,OAAO,MAAOG,EAAU,SAAAL,CAAA,CAAoB,EAC5EwB,EAACC,EAAA,CACC,KAAK,aACL,GAAI,CAAE,MAAO,CAAC,CAAE,KAAAC,CAAA,IAAWA,EAAK,IAAA,EAChC,UAAW,GAAGZ,CAAM,sBAAA,CAAA,CACtB,EACF,EACAU,EAACG,EAAA,CACC,UAAS,GACT,UAAU,SACV,KAAAnB,EACA,SAAUC,EACV,QAASC,EAER,SAAAY,EAAA,CAAa,CAAA,EAEhBE,EAAC,OAAA,CAAK,UAAWP,EAAiB,SAAApB,CAAA,CAAW,CAAA,EAC/C,CAEJ,CAEA,MAAA+B,EAAeC,EAAgBpC,CAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),e=require("../../chunks/index-DYxwT4uW.cjs"),i=require("../../chunks/joinClass-Jk3EszKD.cjs"),u=require("../../chunks/createComponent-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),e=require("../../chunks/index-DYxwT4uW.cjs"),i=require("../../chunks/joinClass-Jk3EszKD.cjs"),u=require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("react");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");function l({width:t,height:r,variant:n="rounded"}){const o=i.joinClass(`${e.prefix}-skeleton`,`${e.prefix}-skeleton--${n}`);return s.jsx("div",{className:o,style:{width:t,height:r}})}const c=u.createComponent(l);exports.default=c;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as m}from"react/jsx-runtime";import{p as o}from"../../chunks/index-CZ41y9Hn.js";import{j as n}from"../../chunks/joinClass-anSpaauN.js";import{c as i}from"../../chunks/createComponent-
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{p as o}from"../../chunks/index-CZ41y9Hn.js";import{j as n}from"../../chunks/joinClass-anSpaauN.js";import{c as i}from"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"react";import"../../chunks/generateSupportColors-BN5t8dA-.js";function p({width:t,height:e,variant:r="rounded"}){const s=n(`${o}-skeleton`,`${o}-skeleton--${r}`);return m("div",{className:s,style:{width:t,height:e}})}const j=i(p);export{j as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../chunks/Stack-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../chunks/Stack-lvjI3kV3.cjs");require("react/jsx-runtime");require("react");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");exports.default=e.Stack;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as d}from"../../chunks/Stack-
|
|
1
|
+
import{S as d}from"../../chunks/Stack-C2zMFX0w.js";import"react/jsx-runtime";import"react";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";export{d as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),i=require("react"),e=require("../../chunks/index-DYxwT4uW.cjs"),r=require("../../chunks/joinClass-Jk3EszKD.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),i=require("react"),e=require("../../chunks/index-DYxwT4uW.cjs"),r=require("../../chunks/joinClass-Jk3EszKD.cjs"),m=require("../../chunks/uuid-omnJ9TjZ.cjs"),b=require("../../chunks/Stack-lvjI3kV3.cjs"),p=require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");function w({label:o,error:n,helperText:a,color:h="primary",...c}){const[l,u]=i.useState(!!c.checked),x=r.joinClass(`${e.prefix}-switch__checkbox`,`${e.prefix}-switch__checkbox--${h}`),d=r.joinClass(`${e.prefix}-switch__label`,n&&`${e.prefix}-switch__label--error`),_=r.joinClass(`${e.prefix}-switch__helper-text`,n&&`${e.prefix}-switch__helper-text--error`,a&&`${e.prefix}-switch__helper-text--visible`),s=i.useMemo(()=>`${e.prefix}-switch-${m.uuid()}`,[]);i.useEffect(()=>{u(!!c.checked)},[c.checked]);const f=()=>{c.onChange&&c.onChange({type:"checkbox",target:{checked:!l}})};return t.jsxs(b.Stack,{gap:2,style:{width:"fit-content"},children:[t.jsx("label",{htmlFor:s,className:d,children:o}),t.jsxs("div",{className:`${e.prefix}-switch`,children:[t.jsx("input",{...c,type:"checkbox",id:s,className:x,onChange:f,checked:l}),t.jsx("label",{className:`${e.prefix}-switch__box`,htmlFor:s,children:t.jsx("span",{className:`${e.prefix}-switch__button`})})]}),t.jsx("span",{className:_,children:a})]})}const j=p.createComponent(w);exports.default=j;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/fields/Switch/Switch.tsx"],"sourcesContent":["import { InputHTMLAttributes, useEffect, useMemo, useState } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { Colors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport { uuid } from '@iziui/toolkit/uuid';\n\nimport Stack from '@/layout/Stack';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Switch.scss';\n\nexport interface SwitchProps extends InputHTMLAttributes<HTMLInputElement> {\n label?: string;\n error?: boolean;\n helperText?: string;\n color?: Colors;\n auto?: boolean;\n}\n\nfunction Switch({ label, error, helperText, color = 'primary', ...props }: SwitchProps) {\n const [checked, setChecked] = useState(Boolean(props.checked));\n\n const classNameCheckbox = joinClass(\n `${prefix}-switch__checkbox`,\n `${prefix}-switch__checkbox--${color}`,\n );\n\n const classNameLabel = joinClass(\n `${prefix}-switch__label`,\n error && `${prefix}-switch__label--error`,\n );\n\n const helperTextClss = joinClass(\n `${prefix}-switch__helper-text`,\n error && `${prefix}-switch__helper-text--error`,\n helperText && `${prefix}-switch__helper-text--visible`,\n );\n\n const id = useMemo(() => `${prefix}-switch-${uuid()}`, []);\n\n useEffect(() => { setChecked(Boolean(props.checked)); }, [props.checked]);\n\n const handleToggle = () => {\n if (!props.onChange) { return; }\n\n props.onChange({\n type: 'checkbox',\n target: { checked: !checked }\n } as React.ChangeEvent<HTMLInputElement>);\n };\n\n return (\n <Stack gap={2} style={{ width: 'fit-content' }}>\n <label htmlFor={id} className={classNameLabel}>\n {label}\n </label>\n <div className={`${prefix}-switch`}>\n <input\n {...props}\n type=\"checkbox\"\n id={id}\n className={classNameCheckbox}\n onChange={handleToggle}\n checked={checked}\n />\n <label className={`${prefix}-switch__box`} htmlFor={id}>\n <span className={`${prefix}-switch__button`} />\n </label>\n </div>\n <span className={helperTextClss}>{helperText}</span>\n </Stack>\n );\n}\n\nexport default createComponent(Switch);"],"names":["Switch","label","error","helperText","color","props","checked","setChecked","useState","classNameCheckbox","joinClass","prefix","classNameLabel","helperTextClss","id","useMemo","uuid","useEffect","handleToggle","jsxs","Stack","jsx","Switch_default","createComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/fields/Switch/Switch.tsx"],"sourcesContent":["import { InputHTMLAttributes, useEffect, useMemo, useState } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { Colors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport { uuid } from '@iziui/toolkit/uuid';\n\nimport Stack from '@/layout/Stack';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Switch.scss';\n\nexport interface SwitchProps extends InputHTMLAttributes<HTMLInputElement> {\n label?: string;\n error?: boolean;\n helperText?: string;\n color?: Colors;\n auto?: boolean;\n}\n\nfunction Switch({ label, error, helperText, color = 'primary', ...props }: SwitchProps) {\n const [checked, setChecked] = useState(Boolean(props.checked));\n\n const classNameCheckbox = joinClass(\n `${prefix}-switch__checkbox`,\n `${prefix}-switch__checkbox--${color}`,\n );\n\n const classNameLabel = joinClass(\n `${prefix}-switch__label`,\n error && `${prefix}-switch__label--error`,\n );\n\n const helperTextClss = joinClass(\n `${prefix}-switch__helper-text`,\n error && `${prefix}-switch__helper-text--error`,\n helperText && `${prefix}-switch__helper-text--visible`,\n );\n\n const id = useMemo(() => `${prefix}-switch-${uuid()}`, []);\n\n useEffect(() => { setChecked(Boolean(props.checked)); }, [props.checked]);\n\n const handleToggle = () => {\n if (!props.onChange) { return; }\n\n props.onChange({\n type: 'checkbox',\n target: { checked: !checked }\n } as React.ChangeEvent<HTMLInputElement>);\n };\n\n return (\n <Stack gap={2} style={{ width: 'fit-content' }}>\n <label htmlFor={id} className={classNameLabel}>\n {label}\n </label>\n <div className={`${prefix}-switch`}>\n <input\n {...props}\n type=\"checkbox\"\n id={id}\n className={classNameCheckbox}\n onChange={handleToggle}\n checked={checked}\n />\n <label className={`${prefix}-switch__box`} htmlFor={id}>\n <span className={`${prefix}-switch__button`} />\n </label>\n </div>\n <span className={helperTextClss}>{helperText}</span>\n </Stack>\n );\n}\n\nexport default createComponent(Switch);"],"names":["Switch","label","error","helperText","color","props","checked","setChecked","useState","classNameCheckbox","joinClass","prefix","classNameLabel","helperTextClss","id","useMemo","uuid","useEffect","handleToggle","jsxs","Stack","jsx","Switch_default","createComponent"],"mappings":"2fAuBA,SAASA,EAAO,CAAE,MAAAC,EAAO,MAAAC,EAAO,WAAAC,EAAY,MAAAC,EAAQ,UAAW,GAAGC,GAAsB,CACtF,KAAM,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAS,EAAQH,EAAM,OAAQ,EAEvDI,EAAoBC,EAAAA,UACxB,GAAGC,EAAAA,MAAM,oBACT,GAAGA,EAAAA,MAAM,sBAAsBP,CAAK,EAAA,EAGhCQ,EAAiBF,EAAAA,UACrB,GAAGC,EAAAA,MAAM,iBACTT,GAAS,GAAGS,EAAAA,MAAM,uBAAA,EAGdE,EAAiBH,EAAAA,UACrB,GAAGC,EAAAA,MAAM,uBACTT,GAAS,GAAGS,EAAAA,MAAM,8BAClBR,GAAc,GAAGQ,EAAAA,MAAM,+BAAA,EAGnBG,EAAKC,UAAQ,IAAM,GAAGJ,EAAAA,MAAM,WAAWK,EAAAA,KAAA,CAAM,GAAI,EAAE,EAEzDC,EAAAA,UAAU,IAAM,CAAEV,EAAW,EAAQF,EAAM,OAAQ,CAAG,EAAG,CAACA,EAAM,OAAO,CAAC,EAExE,MAAMa,EAAe,IAAM,CACpBb,EAAM,UAEXA,EAAM,SAAS,CACb,KAAM,WACN,OAAQ,CAAE,QAAS,CAACC,CAAA,CAAQ,CACU,CAC1C,EAEA,OACEa,EAAAA,KAACC,SAAM,IAAK,EAAG,MAAO,CAAE,MAAO,eAC7B,SAAA,CAAAC,MAAC,QAAA,CAAM,QAASP,EAAI,UAAWF,EAC5B,SAAAX,EACH,EACAkB,EAAAA,KAAC,MAAA,CAAI,UAAW,GAAGR,QAAM,UACvB,SAAA,CAAAU,EAAAA,IAAC,QAAA,CACE,GAAGhB,EACJ,KAAK,WACL,GAAAS,EACA,UAAWL,EACX,SAAUS,EACV,QAAAZ,CAAA,CAAA,EAEFe,EAAAA,IAAC,QAAA,CAAM,UAAW,GAAGV,QAAM,eAAgB,QAASG,EAClD,SAAAO,EAAAA,IAAC,OAAA,CAAK,UAAW,GAAGV,QAAM,kBAAmB,CAAA,CAC/C,CAAA,EACF,EACAU,EAAAA,IAAC,OAAA,CAAK,UAAWR,EAAiB,SAAAV,CAAA,CAAW,CAAA,EAC/C,CAEJ,CAEA,MAAAmB,EAAeC,EAAAA,gBAAgBvB,CAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as l,jsx as c}from"react/jsx-runtime";import{useState as b,useMemo as
|
|
1
|
+
import{jsxs as l,jsx as c}from"react/jsx-runtime";import{useState as b,useMemo as p,useEffect as u}from"react";import{p as e}from"../../chunks/index-CZ41y9Hn.js";import{j as a}from"../../chunks/joinClass-anSpaauN.js";import{u as x}from"../../chunks/uuid-dGvr9vBZ.js";import{S as $}from"../../chunks/Stack-C2zMFX0w.js";import{c as k}from"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";function C({label:n,error:o,helperText:i,color:r="primary",...t}){const[h,m]=b(!!t.checked),_=a(`${e}-switch__checkbox`,`${e}-switch__checkbox--${r}`),d=a(`${e}-switch__label`,o&&`${e}-switch__label--error`),f=a(`${e}-switch__helper-text`,o&&`${e}-switch__helper-text--error`,i&&`${e}-switch__helper-text--visible`),s=p(()=>`${e}-switch-${x()}`,[]);u(()=>{m(!!t.checked)},[t.checked]);const w=()=>{t.onChange&&t.onChange({type:"checkbox",target:{checked:!h}})};return l($,{gap:2,style:{width:"fit-content"},children:[c("label",{htmlFor:s,className:d,children:n}),l("div",{className:`${e}-switch`,children:[c("input",{...t,type:"checkbox",id:s,className:_,onChange:w,checked:h}),c("label",{className:`${e}-switch__box`,htmlFor:s,children:c("span",{className:`${e}-switch__button`})})]}),c("span",{className:f,children:i})]})}const L=k(C);export{L as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/fields/Switch/Switch.tsx"],"sourcesContent":["import { InputHTMLAttributes, useEffect, useMemo, useState } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { Colors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport { uuid } from '@iziui/toolkit/uuid';\n\nimport Stack from '@/layout/Stack';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Switch.scss';\n\nexport interface SwitchProps extends InputHTMLAttributes<HTMLInputElement> {\n label?: string;\n error?: boolean;\n helperText?: string;\n color?: Colors;\n auto?: boolean;\n}\n\nfunction Switch({ label, error, helperText, color = 'primary', ...props }: SwitchProps) {\n const [checked, setChecked] = useState(Boolean(props.checked));\n\n const classNameCheckbox = joinClass(\n `${prefix}-switch__checkbox`,\n `${prefix}-switch__checkbox--${color}`,\n );\n\n const classNameLabel = joinClass(\n `${prefix}-switch__label`,\n error && `${prefix}-switch__label--error`,\n );\n\n const helperTextClss = joinClass(\n `${prefix}-switch__helper-text`,\n error && `${prefix}-switch__helper-text--error`,\n helperText && `${prefix}-switch__helper-text--visible`,\n );\n\n const id = useMemo(() => `${prefix}-switch-${uuid()}`, []);\n\n useEffect(() => { setChecked(Boolean(props.checked)); }, [props.checked]);\n\n const handleToggle = () => {\n if (!props.onChange) { return; }\n\n props.onChange({\n type: 'checkbox',\n target: { checked: !checked }\n } as React.ChangeEvent<HTMLInputElement>);\n };\n\n return (\n <Stack gap={2} style={{ width: 'fit-content' }}>\n <label htmlFor={id} className={classNameLabel}>\n {label}\n </label>\n <div className={`${prefix}-switch`}>\n <input\n {...props}\n type=\"checkbox\"\n id={id}\n className={classNameCheckbox}\n onChange={handleToggle}\n checked={checked}\n />\n <label className={`${prefix}-switch__box`} htmlFor={id}>\n <span className={`${prefix}-switch__button`} />\n </label>\n </div>\n <span className={helperTextClss}>{helperText}</span>\n </Stack>\n );\n}\n\nexport default createComponent(Switch);"],"names":["Switch","label","error","helperText","color","props","checked","setChecked","useState","classNameCheckbox","joinClass","prefix","classNameLabel","helperTextClss","id","useMemo","uuid","useEffect","handleToggle","jsxs","Stack","jsx","Switch_default","createComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/fields/Switch/Switch.tsx"],"sourcesContent":["import { InputHTMLAttributes, useEffect, useMemo, useState } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { Colors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport { uuid } from '@iziui/toolkit/uuid';\n\nimport Stack from '@/layout/Stack';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Switch.scss';\n\nexport interface SwitchProps extends InputHTMLAttributes<HTMLInputElement> {\n label?: string;\n error?: boolean;\n helperText?: string;\n color?: Colors;\n auto?: boolean;\n}\n\nfunction Switch({ label, error, helperText, color = 'primary', ...props }: SwitchProps) {\n const [checked, setChecked] = useState(Boolean(props.checked));\n\n const classNameCheckbox = joinClass(\n `${prefix}-switch__checkbox`,\n `${prefix}-switch__checkbox--${color}`,\n );\n\n const classNameLabel = joinClass(\n `${prefix}-switch__label`,\n error && `${prefix}-switch__label--error`,\n );\n\n const helperTextClss = joinClass(\n `${prefix}-switch__helper-text`,\n error && `${prefix}-switch__helper-text--error`,\n helperText && `${prefix}-switch__helper-text--visible`,\n );\n\n const id = useMemo(() => `${prefix}-switch-${uuid()}`, []);\n\n useEffect(() => { setChecked(Boolean(props.checked)); }, [props.checked]);\n\n const handleToggle = () => {\n if (!props.onChange) { return; }\n\n props.onChange({\n type: 'checkbox',\n target: { checked: !checked }\n } as React.ChangeEvent<HTMLInputElement>);\n };\n\n return (\n <Stack gap={2} style={{ width: 'fit-content' }}>\n <label htmlFor={id} className={classNameLabel}>\n {label}\n </label>\n <div className={`${prefix}-switch`}>\n <input\n {...props}\n type=\"checkbox\"\n id={id}\n className={classNameCheckbox}\n onChange={handleToggle}\n checked={checked}\n />\n <label className={`${prefix}-switch__box`} htmlFor={id}>\n <span className={`${prefix}-switch__button`} />\n </label>\n </div>\n <span className={helperTextClss}>{helperText}</span>\n </Stack>\n );\n}\n\nexport default createComponent(Switch);"],"names":["Switch","label","error","helperText","color","props","checked","setChecked","useState","classNameCheckbox","joinClass","prefix","classNameLabel","helperTextClss","id","useMemo","uuid","useEffect","handleToggle","jsxs","Stack","jsx","Switch_default","createComponent"],"mappings":"4dAuBA,SAASA,EAAO,CAAE,MAAAC,EAAO,MAAAC,EAAO,WAAAC,EAAY,MAAAC,EAAQ,UAAW,GAAGC,GAAsB,CACtF,KAAM,CAACC,EAASC,CAAU,EAAIC,EAAS,EAAQH,EAAM,OAAQ,EAEvDI,EAAoBC,EACxB,GAAGC,CAAM,oBACT,GAAGA,CAAM,sBAAsBP,CAAK,EAAA,EAGhCQ,EAAiBF,EACrB,GAAGC,CAAM,iBACTT,GAAS,GAAGS,CAAM,uBAAA,EAGdE,EAAiBH,EACrB,GAAGC,CAAM,uBACTT,GAAS,GAAGS,CAAM,8BAClBR,GAAc,GAAGQ,CAAM,+BAAA,EAGnBG,EAAKC,EAAQ,IAAM,GAAGJ,CAAM,WAAWK,EAAA,CAAM,GAAI,EAAE,EAEzDC,EAAU,IAAM,CAAEV,EAAW,EAAQF,EAAM,OAAQ,CAAG,EAAG,CAACA,EAAM,OAAO,CAAC,EAExE,MAAMa,EAAe,IAAM,CACpBb,EAAM,UAEXA,EAAM,SAAS,CACb,KAAM,WACN,OAAQ,CAAE,QAAS,CAACC,CAAA,CAAQ,CACU,CAC1C,EAEA,OACEa,EAACC,GAAM,IAAK,EAAG,MAAO,CAAE,MAAO,eAC7B,SAAA,CAAAC,EAAC,QAAA,CAAM,QAASP,EAAI,UAAWF,EAC5B,SAAAX,EACH,EACAkB,EAAC,MAAA,CAAI,UAAW,GAAGR,CAAM,UACvB,SAAA,CAAAU,EAAC,QAAA,CACE,GAAGhB,EACJ,KAAK,WACL,GAAAS,EACA,UAAWL,EACX,SAAUS,EACV,QAAAZ,CAAA,CAAA,EAEFe,EAAC,QAAA,CAAM,UAAW,GAAGV,CAAM,eAAgB,QAASG,EAClD,SAAAO,EAAC,OAAA,CAAK,UAAW,GAAGV,CAAM,kBAAmB,CAAA,CAC/C,CAAA,EACF,EACAU,EAAC,OAAA,CAAK,UAAWR,EAAiB,SAAAV,CAAA,CAAW,CAAA,EAC/C,CAEJ,CAEA,MAAAmB,EAAeC,EAAgBvB,CAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/TableHeader-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/TableHeader-D_fGRq9B.cjs");require("react/jsx-runtime");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("react");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/Card-CcOpPKfS.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");exports.Table=e.Table_default;exports.TableBody=e.TableBody;exports.TableCell=e.TableCell_default;exports.TableHeader=e.TableHeader;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as s,a as d,b as c,c as f}from"../../chunks/TableHeader-
|
|
1
|
+
import{T as s,a as d,b as c,c as f}from"../../chunks/TableHeader-Bra59bV0.js";import"react/jsx-runtime";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"react";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/Card-DDRUwdlG.js";import"../../chunks/Ripple-Bq9bxg4k.js";export{s as Table,d as TableBody,c as TableCell,f as TableHeader};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/useTabs-DaDm5Ou4.cjs");require("react/jsx-runtime");require("react");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/uuid-omnJ9TjZ.cjs");require("../../chunks/createComponent-B2C4sTOb.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/useListenerResized-AwpsZLcP.cjs");require("../../chunks/Slide-D4aLHjYS.cjs");exports.TabButton=e.TabButton;exports.TabContent=e.TabContent;exports.Tabs=e.Tabs_default;exports.useTabs=e.useTabs;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{T as u,a as f,b as x,u as B}from"../../chunks/useTabs-De_vpYsm.js";import"react/jsx-runtime";import"react";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/uuid-dGvr9vBZ.js";import"../../chunks/createComponent-D-IheGJm.js";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/useListenerResized-Bnqxrt7k.js";import"../../chunks/Slide-BxEwoZ70.js";export{u as TabButton,f as TabContent,x as Tabs,B as useTabs};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("react"),f=require("../../chunks/index-DYxwT4uW.cjs"),h=require("../../chunks/joinClass-Jk3EszKD.cjs"),C=require("../../chunks/createComponent-B2C4sTOb.cjs"),p=require("../../chunks/useTheme-DsrjDJKC.cjs"),b=require("../../chunks/Alert-BCDrxwmz.cjs"),R=require("../../chunks/uuid-omnJ9TjZ.cjs"),g=require("../../chunks/Zoom-BOnqwiDY.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/Stack-lvjI3kV3.cjs");require("../../chunks/Typography-B2gBDBkp.cjs");require("../../chunks/convertPathToColor-D8eBpd_D.cjs");require("../../chunks/ButtonIcon-CJ5Iz-uJ.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");require("../../chunks/Icon-CFvy-l1V.cjs");function y({id:o,color:i,message:u,icon:c,delay:a=2500,onRemove:l,...e}){const t=n.useRef(null),{theme:{mode:r}}=p.useTheme(),j=h.joinClass(`${f.prefix}-toast`,e.className);n.useEffect(()=>(T(),q),[]);const m=()=>{o&&l(o)},T=()=>{t.current=setTimeout(()=>{m()},a)},q=()=>{t.current&&(clearTimeout(t.current),t.current=null)};return s.jsx(b.Alert,{className:j,icon:c,sx:{backgroundColor:({text:d})=>d.primary,color:d=>d[i][r]},onClose:m,onMouseEnter:q,onMouseLeave:T,children:u})}const x=C.createComponent(y),v=n.createContext({toasts:[],add:()=>{}});function M({children:o}){const[i,u]=n.useState([]),c=n.useMemo(()=>({toasts:i,add:e=>{a(e)}}),[i]),a=e=>{u(t=>[...t,{id:R.uuid(),visible:!0,...e}])},l=e=>{u(t=>t.map(r=>(r.id===e&&(r.visible=!1),r))),setTimeout(()=>{u(t=>t.filter(r=>r.id!==e))},500)};return s.jsxs(v.Provider,{value:c,children:[s.jsx("div",{className:`${f.prefix}-toast-container`,children:i.map(({...e})=>s.jsx("div",{style:{marginBottom:15},children:s.jsx(g.Zoom,{enter:!!e.visible,children:s.jsx(x,{...e,onRemove:l})})},e.id))}),o]})}function P(){const{add:o}=n.useContext(v);return{addToast:o}}exports.Toast=x;exports.ToastProvider=M;exports.useToast=P;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/feedback/Toast/Toast.tsx","../../../src/feedback/Toast/ToastProvider.tsx","../../../src/feedback/Toast/useToast.ts"],"sourcesContent":["import { useEffect, useRef, type HTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { Colors } from '@iziui/core/theme';\n\nimport createComponent from '@/core/createComponent';\nimport { useTheme } from '@/theme';\n\nimport Alert from '../Alert';\n\nimport '@iziui/styles/components/Toast.scss';\n\ntype Icon = React.JSX.Element;\ntype Message = React.JSX.Element | string;\n\nexport type PickedToast = Pick<ToastProps,\n | 'id'\n | 'icon'\n | 'color'\n | 'message'\n | 'delay'\n | 'visible'\n>\n\nexport interface ToastProps extends HTMLAttributes<HTMLDivElement> {\n id?: string;\n icon?: Icon;\n color: Colors;\n message: Message;\n delay?: number;\n visible?: boolean;\n onRemove: (id: string) => void;\n};\n\nfunction Toast({ id, color, message, icon, delay = 2500, onRemove, ...props }: ToastProps) {\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const { theme: { mode } } = useTheme();\n\n const className = joinClass(\n `${prefix}-toast`,\n props.className\n );\n\n useEffect(() => {\n startTimer();\n return clearTimer;\n }, []);\n\n const handleRemove = () => {\n if (!id) { return; }\n onRemove(id);\n };\n\n const startTimer = () => {\n timeoutRef.current = setTimeout(() => { handleRemove(); }, delay);\n };\n\n const clearTimer = () => {\n if (!timeoutRef.current) { return; }\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n };\n\n return (\n <Alert\n className={className}\n icon={icon}\n sx={{\n backgroundColor: ({ text }) => text.primary,\n color: (palette) => palette[color][mode]\n }}\n onClose={handleRemove}\n onMouseEnter={clearTimer}\n onMouseLeave={startTimer}\n >\n {message}\n </Alert>\n );\n}\n\nexport default createComponent(Toast);\n","import { createContext, type PropsWithChildren, useMemo, useState } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { uuid } from '@iziui/toolkit/uuid';\n\nimport Zoom from '@/animations/Zoom';\n\nimport Toast, { type PickedToast } from './Toast';\n\nimport '@iziui/styles/components/Toast.scss';\n\nexport interface ToastContextConfig {\n toasts: Array<PickedToast>;\n add: (toast: PickedToast) => void;\n}\n\nexport const ToastContext = createContext<ToastContextConfig>({\n toasts: [],\n add: () => { }\n});\n\nexport default function ToastProvider({ children }: PropsWithChildren) {\n const [toasts, setToasts] = useState<Array<PickedToast>>([]);\n\n const context: ToastContextConfig = useMemo(() => ({\n toasts,\n add: (toast) => { addToast(toast); },\n }), [toasts]);\n\n const addToast = (toast: PickedToast) => {\n setToasts(prev => [...prev, { id: uuid(), visible: true, ...toast }]);\n };\n\n const remove = (id: string) => {\n setToasts(prev => prev.map(a => {\n if (a.id === id) { a.visible = false; }\n return a;\n }));\n setTimeout(() => { setToasts(prev => prev.filter(a => a.id !== id)); }, 500);\n };\n\n return (\n <ToastContext.Provider value={context}>\n <div className={`${prefix}-toast-container`}>\n {\n toasts.map(({ ...toast }) => {\n return (\n <div key={toast.id} style={{ marginBottom: 15 }}>\n <Zoom enter={Boolean(toast.visible)}>\n <Toast {...toast} onRemove={remove} />\n </Zoom>\n </div>\n );\n })\n }\n </div>\n {children}\n </ToastContext.Provider>\n );\n}","import { useContext } from 'react';\n\nimport { ToastContext } from './ToastProvider';\n\nexport default function useToast() {\n const { add } = useContext(ToastContext);\n\n return { addToast: add };\n}"],"names":["Toast","id","color","message","icon","delay","onRemove","props","timeoutRef","useRef","mode","useTheme","className","joinClass","prefix","useEffect","startTimer","clearTimer","handleRemove","jsx","Alert","text","palette","createComponent","ToastContext","createContext","ToastProvider","children","toasts","setToasts","useState","context","useMemo","toast","addToast","prev","uuid","remove","a","jsxs","Zoom","useToast","add","useContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/feedback/Toast/Toast.tsx","../../../src/feedback/Toast/ToastProvider.tsx","../../../src/feedback/Toast/useToast.ts"],"sourcesContent":["import { useEffect, useRef, type HTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { Colors } from '@iziui/core/theme';\n\nimport createComponent from '@/core/createComponent';\nimport { useTheme } from '@/theme';\n\nimport Alert from '../Alert';\n\nimport '@iziui/styles/components/Toast.scss';\n\ntype Icon = React.JSX.Element;\ntype Message = React.JSX.Element | string;\n\nexport type PickedToast = Pick<ToastProps,\n | 'id'\n | 'icon'\n | 'color'\n | 'message'\n | 'delay'\n | 'visible'\n>\n\nexport interface ToastProps extends HTMLAttributes<HTMLDivElement> {\n id?: string;\n icon?: Icon;\n color: Colors;\n message: Message;\n delay?: number;\n visible?: boolean;\n onRemove: (id: string) => void;\n};\n\nfunction Toast({ id, color, message, icon, delay = 2500, onRemove, ...props }: ToastProps) {\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const { theme: { mode } } = useTheme();\n\n const className = joinClass(\n `${prefix}-toast`,\n props.className\n );\n\n useEffect(() => {\n startTimer();\n return clearTimer;\n }, []);\n\n const handleRemove = () => {\n if (!id) { return; }\n onRemove(id);\n };\n\n const startTimer = () => {\n timeoutRef.current = setTimeout(() => { handleRemove(); }, delay);\n };\n\n const clearTimer = () => {\n if (!timeoutRef.current) { return; }\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n };\n\n return (\n <Alert\n className={className}\n icon={icon}\n sx={{\n backgroundColor: ({ text }) => text.primary,\n color: (palette) => palette[color][mode]\n }}\n onClose={handleRemove}\n onMouseEnter={clearTimer}\n onMouseLeave={startTimer}\n >\n {message}\n </Alert>\n );\n}\n\nexport default createComponent(Toast);\n","import { createContext, type PropsWithChildren, useMemo, useState } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { uuid } from '@iziui/toolkit/uuid';\n\nimport Zoom from '@/animations/Zoom';\n\nimport Toast, { type PickedToast } from './Toast';\n\nimport '@iziui/styles/components/Toast.scss';\n\nexport interface ToastContextConfig {\n toasts: Array<PickedToast>;\n add: (toast: PickedToast) => void;\n}\n\nexport const ToastContext = createContext<ToastContextConfig>({\n toasts: [],\n add: () => { }\n});\n\nexport default function ToastProvider({ children }: PropsWithChildren) {\n const [toasts, setToasts] = useState<Array<PickedToast>>([]);\n\n const context: ToastContextConfig = useMemo(() => ({\n toasts,\n add: (toast) => { addToast(toast); },\n }), [toasts]);\n\n const addToast = (toast: PickedToast) => {\n setToasts(prev => [...prev, { id: uuid(), visible: true, ...toast }]);\n };\n\n const remove = (id: string) => {\n setToasts(prev => prev.map(a => {\n if (a.id === id) { a.visible = false; }\n return a;\n }));\n setTimeout(() => { setToasts(prev => prev.filter(a => a.id !== id)); }, 500);\n };\n\n return (\n <ToastContext.Provider value={context}>\n <div className={`${prefix}-toast-container`}>\n {\n toasts.map(({ ...toast }) => {\n return (\n <div key={toast.id} style={{ marginBottom: 15 }}>\n <Zoom enter={Boolean(toast.visible)}>\n <Toast {...toast} onRemove={remove} />\n </Zoom>\n </div>\n );\n })\n }\n </div>\n {children}\n </ToastContext.Provider>\n );\n}","import { useContext } from 'react';\n\nimport { ToastContext } from './ToastProvider';\n\nexport default function useToast() {\n const { add } = useContext(ToastContext);\n\n return { addToast: add };\n}"],"names":["Toast","id","color","message","icon","delay","onRemove","props","timeoutRef","useRef","mode","useTheme","className","joinClass","prefix","useEffect","startTimer","clearTimer","handleRemove","jsx","Alert","text","palette","createComponent","ToastContext","createContext","ToastProvider","children","toasts","setToasts","useState","context","useMemo","toast","addToast","prev","uuid","remove","a","jsxs","Zoom","useToast","add","useContext"],"mappings":"syBAoCA,SAASA,EAAM,CAAE,GAAAC,EAAI,MAAAC,EAAO,QAAAC,EAAS,KAAAC,EAAM,MAAAC,EAAQ,KAAM,SAAAC,EAAU,GAAGC,GAAqB,CACzF,MAAMC,EAAaC,EAAAA,OAA6C,IAAI,EAE9D,CAAE,MAAO,CAAE,KAAAC,CAAA,CAAK,EAAMC,EAAAA,SAAA,EAEtBC,EAAYC,EAAAA,UAChB,GAAGC,EAAAA,MAAM,SACTP,EAAM,SAAA,EAGRQ,EAAAA,UAAU,KACRC,EAAA,EACOC,GACN,CAAA,CAAE,EAEL,MAAMC,EAAe,IAAM,CACpBjB,GACLK,EAASL,CAAE,CACb,EAEMe,EAAa,IAAM,CACvBR,EAAW,QAAU,WAAW,IAAM,CAAEU,EAAA,CAAgB,EAAGb,CAAK,CAClE,EAEMY,EAAa,IAAM,CAClBT,EAAW,UAChB,aAAaA,EAAW,OAAO,EAC/BA,EAAW,QAAU,KACvB,EAEA,OACEW,EAAAA,IAACC,EAAAA,MAAA,CACC,UAAAR,EACA,KAAAR,EACA,GAAI,CACF,gBAAiB,CAAC,CAAE,KAAAiB,CAAA,IAAWA,EAAK,QACpC,MAAQC,GAAYA,EAAQpB,CAAK,EAAEQ,CAAI,CAAA,EAEzC,QAASQ,EACT,aAAcD,EACd,aAAcD,EAEb,SAAAb,CAAA,CAAA,CAGP,CAEA,MAAAH,EAAeuB,EAAAA,gBAAgBvB,CAAK,EClEvBwB,EAAeC,EAAAA,cAAkC,CAC5D,OAAQ,CAAA,EACR,IAAK,IAAM,CAAE,CACf,CAAC,EAED,SAAwBC,EAAc,CAAE,SAAAC,GAA+B,CACrE,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAA6B,CAAA,CAAE,EAErDC,EAA8BC,EAAAA,QAAQ,KAAO,CACjD,OAAAJ,EACA,IAAMK,GAAU,CAAEC,EAASD,CAAK,CAAG,CAAA,GACjC,CAACL,CAAM,CAAC,EAENM,EAAYD,GAAuB,CACvCJ,EAAUM,GAAQ,CAAC,GAAGA,EAAM,CAAE,GAAIC,EAAAA,KAAA,EAAQ,QAAS,GAAM,GAAGH,CAAA,CAAO,CAAC,CACtE,EAEMI,EAAUpC,GAAe,CAC7B4B,EAAUM,GAAQA,EAAK,IAAIG,IACrBA,EAAE,KAAOrC,IAAMqC,EAAE,QAAU,IACxBA,EACR,CAAC,EACF,WAAW,IAAM,CAAET,KAAkBM,EAAK,UAAYG,EAAE,KAAOrC,CAAE,CAAC,CAAG,EAAG,GAAG,CAC7E,EAEA,OACEsC,EAAAA,KAACf,EAAa,SAAb,CAAsB,MAAOO,EAC5B,SAAA,CAAAZ,EAAAA,IAAC,MAAA,CAAI,UAAW,GAAGL,EAAAA,MAAM,mBAErB,SAAAc,EAAO,IAAI,CAAC,CAAE,GAAGK,CAAA,IAEbd,EAAAA,IAAC,OAAmB,MAAO,CAAE,aAAc,IACzC,SAAAA,EAAAA,IAACqB,EAAAA,KAAA,CAAK,MAAO,EAAQP,EAAM,QACzB,SAAAd,EAAAA,IAACnB,EAAA,CAAO,GAAGiC,EAAO,SAAUI,CAAA,CAAQ,CAAA,CACtC,GAHQJ,EAAM,EAIhB,CAEH,CAAA,CAEL,EACCN,CAAA,EACH,CAEJ,CCxDA,SAAwBc,GAAW,CACjC,KAAM,CAAE,IAAAC,CAAA,EAAQC,EAAAA,WAAWnB,CAAY,EAEvC,MAAO,CAAE,SAAUkB,CAAA,CACrB"}
|