@iziui/react 0.0.84-rc → 0.0.85-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/display/Typography/Typography.d.ts.map +1 -1
- package/dist/.types/display/Typography/Typography.stories.d.ts.map +1 -1
- package/dist/chunks/{Alert-sdcu8SYG.cjs → Alert-4P5QvgB7.cjs} +2 -2
- package/dist/chunks/{Alert-sdcu8SYG.cjs.map → Alert-4P5QvgB7.cjs.map} +1 -1
- package/dist/chunks/{Alert-BJ03NmUp.js → Alert-CD5wAMRz.js} +2 -2
- package/dist/chunks/{Alert-BJ03NmUp.js.map → Alert-CD5wAMRz.js.map} +1 -1
- package/dist/chunks/Typography-B_WR62ip.js +2 -0
- package/dist/chunks/Typography-B_WR62ip.js.map +1 -0
- package/dist/chunks/Typography-Ch-BLqCH.cjs +2 -0
- package/dist/chunks/Typography-Ch-BLqCH.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.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/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 +2 -2
- package/package.json +1 -1
- package/dist/chunks/Typography-BgYf02bJ.cjs +0 -2
- package/dist/chunks/Typography-BgYf02bJ.cjs.map +0 -1
- package/dist/chunks/Typography-BuWesgHA.js +0 -2
- package/dist/chunks/Typography-BuWesgHA.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../../src/display/Typography/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../../src/display/Typography/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOtD,OAAO,0CAA0C,CAAC;AAElD,eAAO,MAAM,QAAQ,2FAWX,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAe9C,MAAM,WAAW,eAAgB,SAAQ,iBAAiB,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;IAC9F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC;;AAsCD,wBAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.stories.d.ts","sourceRoot":"","sources":["../../../../src/display/Typography/Typography.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Typography.stories.d.ts","sourceRoot":"","sources":["../../../../src/display/Typography/Typography.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,UAAwB,MAAM,cAAc,CAAC;AAIpD,eAAO,MAAM,IAAI,EAAE,QAAQ,CAAC,OAAO,UAAU,CAmB5C,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,UAAU,CAqC/C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,UAAU,CAElD,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAmEjC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),p=require("react"),t=require("./index-DYxwT4uW.cjs"),i=require("./joinClass-Jk3EszKD.cjs"),a=require("./Stack-CF3Wyma9.cjs"),j=require("./Typography-
|
|
2
|
-
//# sourceMappingURL=Alert-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),p=require("react"),t=require("./index-DYxwT4uW.cjs"),i=require("./joinClass-Jk3EszKD.cjs"),a=require("./Stack-CF3Wyma9.cjs"),j=require("./Typography-Ch-BLqCH.cjs"),d=require("./ButtonIcon-C7gsGi0Q.cjs"),y=require("./createComponent-Bls5N6x8.cjs"),q=require("./Icon-RMp_DPL7.cjs");function $({children:n,icon:s,color:r="primary",onClose:c,...o}){const l=i.joinClass(`${t.prefix}-alert`,`${t.prefix}-alert--${r}`,o.className),u=i.joinClass(`${t.prefix}-alert__button`,`${t.prefix}-alert__button--${r}`),x=()=>typeof n=="string"?e.jsx(j.Typography,{variant:"body1",style:{color:"currentcolor"},children:n}):n,m=f=>p.cloneElement(f,{color:`${r}.dark`});return e.jsxs(a.Stack,{fullWidth:!0,gap:0,flexDirection:"row",alignItems:"center",justifyContent:"center",...o,className:l,children:[e.jsxs(a.Stack,{fullWidth:!0,gap:8,flexDirection:"row",alignItems:"center",className:`${t.prefix}-alert__content`,children:[s&&m(s),x()]}),c&&e.jsx("div",{children:e.jsx(d.ButtonIcon,{className:u,onClick:c,color:r,style:{color:"currentColor"},children:e.jsx(q.Icon,{name:"times"})})})]})}const g=y.createComponent($);exports.Alert=g;
|
|
2
|
+
//# sourceMappingURL=Alert-4P5QvgB7.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert-
|
|
1
|
+
{"version":3,"file":"Alert-4P5QvgB7.cjs","sources":["../../src/feedback/Alert/Alert.tsx"],"sourcesContent":["import { cloneElement, type HtmlHTMLAttributes } 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 Stack from '@/layout/Stack';\nimport Typography from '@/display/Typography';\nimport ButtonIcon from '@/actions/ButtonIcon';\nimport createComponent from '@/core/createComponent';\nimport Icon, { type IconProps } from '@/display/Icon';\n\nimport '@iziui/styles/components/Alert.scss';\n\nexport interface AlertProps extends HtmlHTMLAttributes<HTMLDivElement> {\n color?: Colors;\n icon?: React.JSX.Element;\n children: React.ReactNode;\n onClose?: () => void;\n}\n\nfunction Alert({\n children,\n icon,\n color = 'primary',\n onClose,\n ...props\n}: AlertProps) {\n const className = joinClass(\n `${prefix}-alert`,\n `${prefix}-alert--${color}`,\n props.className\n );\n\n const classNameAction = joinClass(\n `${prefix}-alert__button`,\n `${prefix}-alert__button--${color}`,\n );\n\n const renderMessage = () => {\n if (typeof children === 'string') {\n return (\n <Typography variant=\"body1\" style={{ color: 'currentcolor' }}>\n {children}\n </Typography>\n );\n }\n\n return children;\n };\n\n const renderIcon = (icon: React.JSX.Element) => {\n return cloneElement<IconProps>(icon, {\n color: `${color}.dark`\n });\n };\n\n return (\n <Stack\n fullWidth\n gap={0}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n {...props}\n className={className}\n >\n <Stack\n fullWidth\n gap={8}\n flexDirection=\"row\"\n alignItems=\"center\"\n className={`${prefix}-alert__content`}\n >\n {icon && renderIcon(icon)}\n {renderMessage()}\n </Stack>\n {\n onClose && (\n <div>\n <ButtonIcon\n className={classNameAction}\n onClick={onClose}\n color={color}\n style={{ color: 'currentColor' }}\n >\n <Icon name=\"times\" />\n </ButtonIcon>\n </div>)\n }\n </Stack>\n );\n}\n\nexport default createComponent(Alert);"],"names":["Alert","children","icon","color","onClose","props","className","joinClass","prefix","classNameAction","renderMessage","jsx","Typography","renderIcon","cloneElement","jsxs","Stack","ButtonIcon","Icon","createComponent"],"mappings":"0UAsBA,SAASA,EAAM,CACb,SAAAC,EACA,KAAAC,EACA,MAAAC,EAAQ,UACR,QAAAC,EACA,GAAGC,CACL,EAAe,CACb,MAAMC,EAAYC,EAAAA,UAChB,GAAGC,EAAAA,MAAM,SACT,GAAGA,EAAAA,MAAM,WAAWL,CAAK,GACzBE,EAAM,SAAA,EAGFI,EAAkBF,EAAAA,UACtB,GAAGC,EAAAA,MAAM,iBACT,GAAGA,EAAAA,MAAM,mBAAmBL,CAAK,EAAA,EAG7BO,EAAgB,IAChB,OAAOT,GAAa,SAEpBU,MAACC,EAAAA,YAAW,QAAQ,QAAQ,MAAO,CAAE,MAAO,gBACzC,SAAAX,EACH,EAIGA,EAGHY,EAAcX,GACXY,EAAAA,aAAwBZ,EAAM,CACnC,MAAO,GAAGC,CAAK,OAAA,CAChB,EAGH,OACEY,EAAAA,KAACC,EAAAA,MAAA,CACC,UAAS,GACT,IAAK,EACL,cAAc,MACd,WAAW,SACX,eAAe,SACd,GAAGX,EACJ,UAAAC,EAEA,SAAA,CAAAS,EAAAA,KAACC,EAAAA,MAAA,CACC,UAAS,GACT,IAAK,EACL,cAAc,MACd,WAAW,SACX,UAAW,GAAGR,EAAAA,MAAM,kBAEnB,SAAA,CAAAN,GAAQW,EAAWX,CAAI,EACvBQ,EAAA,CAAc,CAAA,CAAA,EAGfN,SACG,MAAA,CACC,SAAAO,EAAAA,IAACM,EAAAA,WAAA,CACC,UAAWR,EACX,QAASL,EACT,MAAAD,EACA,MAAO,CAAE,MAAO,cAAA,EAEhB,SAAAQ,EAAAA,IAACO,EAAAA,KAAA,CAAK,KAAK,OAAA,CAAQ,CAAA,CAAA,CACrB,CACF,CAAA,CAAA,CAAA,CAIV,CAEA,MAAAlB,EAAemB,EAAAA,gBAAgBnB,CAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as c,jsx as e}from"react/jsx-runtime";import{cloneElement as $}from"react";import{p as r}from"./index-CZ41y9Hn.js";import{j as i}from"./joinClass-anSpaauN.js";import{S as m}from"./Stack-CHR_pZC4.js";import{T as y}from"./Typography-
|
|
2
|
-
//# sourceMappingURL=Alert-
|
|
1
|
+
import{jsxs as c,jsx as e}from"react/jsx-runtime";import{cloneElement as $}from"react";import{p as r}from"./index-CZ41y9Hn.js";import{j as i}from"./joinClass-anSpaauN.js";import{S as m}from"./Stack-CHR_pZC4.js";import{T as y}from"./Typography-B_WR62ip.js";import{B as g}from"./ButtonIcon-CVMYFuqn.js";import{c as x}from"./createComponent-BmdhWozT.js";import{I}from"./Icon-DOCC8cxy.js";function _({children:o,icon:n,color:t="primary",onClose:a,...s}){const l=i(`${r}-alert`,`${r}-alert--${t}`,s.className),f=i(`${r}-alert__button`,`${r}-alert__button--${t}`),p=()=>typeof o=="string"?e(y,{variant:"body1",style:{color:"currentcolor"},children:o}):o,u=d=>$(d,{color:`${t}.dark`});return c(m,{fullWidth:!0,gap:0,flexDirection:"row",alignItems:"center",justifyContent:"center",...s,className:l,children:[c(m,{fullWidth:!0,gap:8,flexDirection:"row",alignItems:"center",className:`${r}-alert__content`,children:[n&&u(n),p()]}),a&&e("div",{children:e(g,{className:f,onClick:a,color:t,style:{color:"currentColor"},children:e(I,{name:"times"})})})]})}const B=x(_);export{B as A};
|
|
2
|
+
//# sourceMappingURL=Alert-CD5wAMRz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert-
|
|
1
|
+
{"version":3,"file":"Alert-CD5wAMRz.js","sources":["../../src/feedback/Alert/Alert.tsx"],"sourcesContent":["import { cloneElement, type HtmlHTMLAttributes } 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 Stack from '@/layout/Stack';\nimport Typography from '@/display/Typography';\nimport ButtonIcon from '@/actions/ButtonIcon';\nimport createComponent from '@/core/createComponent';\nimport Icon, { type IconProps } from '@/display/Icon';\n\nimport '@iziui/styles/components/Alert.scss';\n\nexport interface AlertProps extends HtmlHTMLAttributes<HTMLDivElement> {\n color?: Colors;\n icon?: React.JSX.Element;\n children: React.ReactNode;\n onClose?: () => void;\n}\n\nfunction Alert({\n children,\n icon,\n color = 'primary',\n onClose,\n ...props\n}: AlertProps) {\n const className = joinClass(\n `${prefix}-alert`,\n `${prefix}-alert--${color}`,\n props.className\n );\n\n const classNameAction = joinClass(\n `${prefix}-alert__button`,\n `${prefix}-alert__button--${color}`,\n );\n\n const renderMessage = () => {\n if (typeof children === 'string') {\n return (\n <Typography variant=\"body1\" style={{ color: 'currentcolor' }}>\n {children}\n </Typography>\n );\n }\n\n return children;\n };\n\n const renderIcon = (icon: React.JSX.Element) => {\n return cloneElement<IconProps>(icon, {\n color: `${color}.dark`\n });\n };\n\n return (\n <Stack\n fullWidth\n gap={0}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n {...props}\n className={className}\n >\n <Stack\n fullWidth\n gap={8}\n flexDirection=\"row\"\n alignItems=\"center\"\n className={`${prefix}-alert__content`}\n >\n {icon && renderIcon(icon)}\n {renderMessage()}\n </Stack>\n {\n onClose && (\n <div>\n <ButtonIcon\n className={classNameAction}\n onClick={onClose}\n color={color}\n style={{ color: 'currentColor' }}\n >\n <Icon name=\"times\" />\n </ButtonIcon>\n </div>)\n }\n </Stack>\n );\n}\n\nexport default createComponent(Alert);"],"names":["Alert","children","icon","color","onClose","props","className","joinClass","prefix","classNameAction","renderMessage","jsx","Typography","renderIcon","cloneElement","jsxs","Stack","ButtonIcon","Icon","Alert$1","createComponent"],"mappings":"iYAsBA,SAASA,EAAM,CACb,SAAAC,EACA,KAAAC,EACA,MAAAC,EAAQ,UACR,QAAAC,EACA,GAAGC,CACL,EAAe,CACb,MAAMC,EAAYC,EAChB,GAAGC,CAAM,SACT,GAAGA,CAAM,WAAWL,CAAK,GACzBE,EAAM,SAAA,EAGFI,EAAkBF,EACtB,GAAGC,CAAM,iBACT,GAAGA,CAAM,mBAAmBL,CAAK,EAAA,EAG7BO,EAAgB,IAChB,OAAOT,GAAa,SAEpBU,EAACC,GAAW,QAAQ,QAAQ,MAAO,CAAE,MAAO,gBACzC,SAAAX,EACH,EAIGA,EAGHY,EAAcX,GACXY,EAAwBZ,EAAM,CACnC,MAAO,GAAGC,CAAK,OAAA,CAChB,EAGH,OACEY,EAACC,EAAA,CACC,UAAS,GACT,IAAK,EACL,cAAc,MACd,WAAW,SACX,eAAe,SACd,GAAGX,EACJ,UAAAC,EAEA,SAAA,CAAAS,EAACC,EAAA,CACC,UAAS,GACT,IAAK,EACL,cAAc,MACd,WAAW,SACX,UAAW,GAAGR,CAAM,kBAEnB,SAAA,CAAAN,GAAQW,EAAWX,CAAI,EACvBQ,EAAA,CAAc,CAAA,CAAA,EAGfN,KACG,MAAA,CACC,SAAAO,EAACM,EAAA,CACC,UAAWR,EACX,QAASL,EACT,MAAAD,EACA,MAAO,CAAE,MAAO,cAAA,EAEhB,SAAAQ,EAACO,EAAA,CAAK,KAAK,OAAA,CAAQ,CAAA,CAAA,CACrB,CACF,CAAA,CAAA,CAAA,CAIV,CAEA,MAAAC,EAAeC,EAAgBpB,CAAK"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{p as t}from"./index-CZ41y9Hn.js";import{j as l}from"./joinClass-anSpaauN.js";import{c as n}from"./convertPathToColor-DtOjH4ZP.js";import{u as b}from"./useTheme-BYuNiCiH.js";import{c as u}from"./createComponent-BmdhWozT.js";const v=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2"],f={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function g({children:e,variant:s="body1",color:a="text.primary",weight:h,textAlign:p,...o}){const{theme:{palette:m}}=b(),y=f[s],c=l(`${t}-typography`,`${t}-typography--${s}`,h&&`${t}-typography--weight-${h}`,o.className),r=n(a,m);return i(y,{...o,className:c,style:{...r?{color:r}:{},textAlign:p,...o.style},children:e})}const N=u(g);export{N as T,v};
|
|
2
|
+
//# sourceMappingURL=Typography-B_WR62ip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography-B_WR62ip.js","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import { type PropsWithChildren, type HTMLAttributes, type CSSProperties } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { MappedColors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { convertPathToColor } from '@iziui/core/utils/convertPathToColor';\n\nimport { useTheme } from '@/theme';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Typography.scss';\n\nexport const variants = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n] as const;\n\nexport type Variant = typeof variants[number];\n\nconst MAP: { [x: string]: React.ElementType } = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n};\n\nexport interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\n\nfunction Typography({\n children,\n variant = 'body1',\n color: _color = 'text.primary',\n weight,\n textAlign,\n ...props\n}: TypographyProps) {\n const { theme: { palette } } = useTheme();\n\n const CustomTag = MAP[variant];\n\n const cls = joinClass(\n `${prefix}-typography`,\n `${prefix}-typography--${variant}`,\n weight && `${prefix}-typography--weight-${weight}`,\n props.className\n );\n\n const color = convertPathToColor(_color, palette);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n ...(color ? { color } : {}),\n textAlign,\n ...props.style\n }}\n >\n {children}\n </CustomTag>\n );\n}\n\nexport default createComponent(Typography);"],"names":["variants","MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","convertPathToColor","jsx","Typography$1","createComponent"],"mappings":"8QAaO,MAAMA,EAAW,CACtB,KACA,KACA,KACA,KACA,KACA,KACA,YACA,YACA,QACA,OACF,EAIMC,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EASA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EAAS,eAChB,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAA,EAEzBC,EAAYV,EAAIG,CAAO,EAEvBQ,EAAMC,EACV,GAAGC,CAAM,cACT,GAAGA,CAAM,gBAAgBV,CAAO,GAChCE,GAAU,GAAGQ,CAAM,uBAAuBR,CAAM,GAChDE,EAAM,SAAA,EAGFO,EAAQC,EAAmBX,EAAQI,CAAO,EAEhD,OACEQ,EAACN,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,GAAIG,EAAQ,CAAE,MAAAA,CAAA,EAAU,CAAA,EACxB,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAe,EAAeC,EAAgBjB,CAAU"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const p=require("react/jsx-runtime"),t=require("./index-DYxwT4uW.cjs"),u=require("./joinClass-Jk3EszKD.cjs"),l=require("./convertPathToColor-D8eBpd_D.cjs"),m=require("./useTheme-DsrjDJKC.cjs"),b=require("./createComponent-Bls5N6x8.cjs"),T=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2"],g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function x({children:h,variant:o="body1",color:n="text.primary",weight:s,textAlign:c,...e}){const{theme:{palette:a}}=m.useTheme(),i=g[o],y=u.joinClass(`${t.prefix}-typography`,`${t.prefix}-typography--${o}`,s&&`${t.prefix}-typography--weight-${s}`,e.className),r=l.convertPathToColor(n,a);return p.jsx(i,{...e,className:y,style:{...r?{color:r}:{},textAlign:c,...e.style},children:h})}const C=b.createComponent(x);exports.Typography=C;exports.variants=T;
|
|
2
|
+
//# sourceMappingURL=Typography-Ch-BLqCH.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography-Ch-BLqCH.cjs","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import { type PropsWithChildren, type HTMLAttributes, type CSSProperties } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { MappedColors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { convertPathToColor } from '@iziui/core/utils/convertPathToColor';\n\nimport { useTheme } from '@/theme';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Typography.scss';\n\nexport const variants = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n] as const;\n\nexport type Variant = typeof variants[number];\n\nconst MAP: { [x: string]: React.ElementType } = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n};\n\nexport interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\n\nfunction Typography({\n children,\n variant = 'body1',\n color: _color = 'text.primary',\n weight,\n textAlign,\n ...props\n}: TypographyProps) {\n const { theme: { palette } } = useTheme();\n\n const CustomTag = MAP[variant];\n\n const cls = joinClass(\n `${prefix}-typography`,\n `${prefix}-typography--${variant}`,\n weight && `${prefix}-typography--weight-${weight}`,\n props.className\n );\n\n const color = convertPathToColor(_color, palette);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n ...(color ? { color } : {}),\n textAlign,\n ...props.style\n }}\n >\n {children}\n </CustomTag>\n );\n}\n\nexport default createComponent(Typography);"],"names":["variants","MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","convertPathToColor","jsx","createComponent"],"mappings":"0PAaaA,EAAW,CACtB,KACA,KACA,KACA,KACA,KACA,KACA,YACA,YACA,QACA,OACF,EAIMC,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EASA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EAAS,eAChB,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAAA,SAAA,EAEzBC,EAAYV,EAAIG,CAAO,EAEvBQ,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,cACT,GAAGA,EAAAA,MAAM,gBAAgBV,CAAO,GAChCE,GAAU,GAAGQ,EAAAA,MAAM,uBAAuBR,CAAM,GAChDE,EAAM,SAAA,EAGFO,EAAQC,EAAAA,mBAAmBX,EAAQI,CAAO,EAEhD,OACEQ,EAAAA,IAACN,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,GAAIG,EAAQ,CAAE,MAAAA,CAAA,EAAU,CAAA,EACxB,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAD,EAAegB,EAAAA,gBAAgBhB,CAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../chunks/Alert-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../chunks/Alert-4P5QvgB7.cjs");require("react/jsx-runtime");require("react");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/Stack-CF3Wyma9.cjs");require("../../chunks/createComponent-Bls5N6x8.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/Typography-Ch-BLqCH.cjs");require("../../chunks/convertPathToColor-D8eBpd_D.cjs");require("../../chunks/ButtonIcon-C7gsGi0Q.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");require("../../chunks/Icon-RMp_DPL7.cjs");exports.default=e.Alert;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as b}from"../../chunks/Alert-
|
|
1
|
+
import{A as b}from"../../chunks/Alert-CD5wAMRz.js";import"react/jsx-runtime";import"react";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/Stack-CHR_pZC4.js";import"../../chunks/createComponent-BmdhWozT.js";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/Typography-B_WR62ip.js";import"../../chunks/convertPathToColor-DtOjH4ZP.js";import"../../chunks/ButtonIcon-CVMYFuqn.js";import"../../chunks/Ripple-Bq9bxg4k.js";import"../../chunks/Icon-DOCC8cxy.js";export{b 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 o=require("react/jsx-runtime"),t=require("../../chunks/index-DYxwT4uW.cjs"),f=require("../../chunks/joinClass-Jk3EszKD.cjs"),d=require("../../chunks/Ripple-Dy4i91j1.cjs"),g=require("../../chunks/createComponent-Bls5N6x8.cjs"),v=require("../../chunks/Icon-RMp_DPL7.cjs"),x=require("../../chunks/Typography-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),t=require("../../chunks/index-DYxwT4uW.cjs"),f=require("../../chunks/joinClass-Jk3EszKD.cjs"),d=require("../../chunks/Ripple-Dy4i91j1.cjs"),g=require("../../chunks/createComponent-Bls5N6x8.cjs"),v=require("../../chunks/Icon-RMp_DPL7.cjs"),x=require("../../chunks/Typography-Ch-BLqCH.cjs");require("react");require("../../chunks/useTheme-DsrjDJKC.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/convertPathToColor-D8eBpd_D.cjs");function s(e){return e.normalize("NFD").trim().toLowerCase().replace(/a-zA-Z0-9_.-+/g,"").replace(/_/g,"").replace(/[^\w\s]/gi,"")}function m(e){const a=e.trim().split(" "),i=a.length===1,r=s(a[0]).charAt(0).toLocaleUpperCase(),c=i?s(a[0]).charAt(1).toLocaleUpperCase():s(a.reverse()[0]).charAt(0).toLocaleUpperCase();return r+c}function y({src:e,alt:a,name:i,size:r=40,variant:c="circular",color:u="primary",icon:l,...n}){const h=f.joinClass(`${t.prefix}-avatar`,`${t.prefix}-avatar--${c}`,`${t.prefix}-avatar--${u}`,e&&`${t.prefix}-avatar--image`,i&&`${t.prefix}-avatar--name`,!e&&!i||l&&`${t.prefix}-avatar--icon`,n.onClick&&`${t.prefix}-avatar--clickable`,n.className),p=()=>e?o.jsx("img",{src:e,alt:a,width:r,height:r,sizes:"100vw",loading:"lazy",style:{width:"100%",height:"auto"}}):i?o.jsx(x.Typography,{style:{fontSize:r/2,color:"currentColor"},children:m(i)}):l||o.jsx(v.Icon,{name:"user",size:r/1.6,style:{color:"currentColor"}});return o.jsxs("div",{...n,style:{width:r,height:r,...n.style},className:h,children:[p(),n.children,n.onClick&&o.jsx(d.Ripple,{})]})}const C=g.createComponent(y);exports.default=C;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as h,jsx as n}from"react/jsx-runtime";import{p as r}from"../../chunks/index-CZ41y9Hn.js";import{j as u}from"../../chunks/joinClass-anSpaauN.js";import{R as g}from"../../chunks/Ripple-Bq9bxg4k.js";import{c as v}from"../../chunks/createComponent-BmdhWozT.js";import{I as d}from"../../chunks/Icon-DOCC8cxy.js";import{T as C}from"../../chunks/Typography-
|
|
1
|
+
import{jsxs as h,jsx as n}from"react/jsx-runtime";import{p as r}from"../../chunks/index-CZ41y9Hn.js";import{j as u}from"../../chunks/joinClass-anSpaauN.js";import{R as g}from"../../chunks/Ripple-Bq9bxg4k.js";import{c as v}from"../../chunks/createComponent-BmdhWozT.js";import{I as d}from"../../chunks/Icon-DOCC8cxy.js";import{T as C}from"../../chunks/Typography-B_WR62ip.js";import"react";import"../../chunks/useTheme-BYuNiCiH.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/convertPathToColor-DtOjH4ZP.js";function s(t){return t.normalize("NFD").trim().toLowerCase().replace(/a-zA-Z0-9_.-+/g,"").replace(/_/g,"").replace(/[^\w\s]/gi,"")}function y(t){const e=t.trim().split(" "),o=e.length===1,a=s(e[0]).charAt(0).toLocaleUpperCase(),l=o?s(e[0]).charAt(1).toLocaleUpperCase():s(e.reverse()[0]).charAt(0).toLocaleUpperCase();return a+l}function $({src:t,alt:e,name:o,size:a=40,variant:l="circular",color:m="primary",icon:c,...i}){const p=u(`${r}-avatar`,`${r}-avatar--${l}`,`${r}-avatar--${m}`,t&&`${r}-avatar--image`,o&&`${r}-avatar--name`,!t&&!o||c&&`${r}-avatar--icon`,i.onClick&&`${r}-avatar--clickable`,i.className),f=()=>t?n("img",{src:t,alt:e,width:a,height:a,sizes:"100vw",loading:"lazy",style:{width:"100%",height:"auto"}}):o?n(C,{style:{fontSize:a/2,color:"currentColor"},children:y(o)}):c||n(d,{name:"user",size:a/1.6,style:{color:"currentColor"}});return h("div",{...i,style:{width:a,height:a,...i.style},className:p,children:[f(),i.children,i.onClick&&n(g,{})]})}const R=v($);export{R as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
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-Bls5N6x8.cjs"),p=require("../../chunks/useTheme-DsrjDJKC.cjs"),b=require("../../chunks/Alert-
|
|
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-Bls5N6x8.cjs"),p=require("../../chunks/useTheme-DsrjDJKC.cjs"),b=require("../../chunks/Alert-4P5QvgB7.cjs"),R=require("../../chunks/uuid-omnJ9TjZ.cjs"),g=require("../../chunks/Zoom-BOnqwiDY.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/Stack-CF3Wyma9.cjs");require("../../chunks/Typography-Ch-BLqCH.cjs");require("../../chunks/convertPathToColor-D8eBpd_D.cjs");require("../../chunks/ButtonIcon-C7gsGi0Q.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");require("../../chunks/Icon-RMp_DPL7.cjs");function y({id:o,color:i,message:u,icon:c,delay:a,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,2 +1,2 @@
|
|
|
1
|
-
import{jsx as i,jsxs as x}from"react/jsx-runtime";import{useRef as h,useEffect as C,useState as b,useMemo as j,createContext as R,useContext as M}from"react";import{p as f}from"../../chunks/index-CZ41y9Hn.js";import{j as N}from"../../chunks/joinClass-anSpaauN.js";import{c as $}from"../../chunks/createComponent-BmdhWozT.js";import{u as g}from"../../chunks/useTheme-BYuNiCiH.js";import{A as y}from"../../chunks/Alert-
|
|
1
|
+
import{jsx as i,jsxs as x}from"react/jsx-runtime";import{useRef as h,useEffect as C,useState as b,useMemo as j,createContext as R,useContext as M}from"react";import{p as f}from"../../chunks/index-CZ41y9Hn.js";import{j as N}from"../../chunks/joinClass-anSpaauN.js";import{c as $}from"../../chunks/createComponent-BmdhWozT.js";import{u as g}from"../../chunks/useTheme-BYuNiCiH.js";import{A as y}from"../../chunks/Alert-CD5wAMRz.js";import{u as A}from"../../chunks/uuid-dGvr9vBZ.js";import{Z as B}from"../../chunks/Zoom-DqgU4Wfv.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/Stack-CHR_pZC4.js";import"../../chunks/Typography-B_WR62ip.js";import"../../chunks/convertPathToColor-DtOjH4ZP.js";import"../../chunks/ButtonIcon-CVMYFuqn.js";import"../../chunks/Ripple-Bq9bxg4k.js";import"../../chunks/Icon-DOCC8cxy.js";function E({id:r,color:s,message:n,icon:m,delay:a,onRemove:c,...t}){const o=h(null),{theme:{mode:e}}=g(),v=N(`${f}-toast`,t.className);C(()=>(d(),p),[]);const l=()=>{r&&c(r)},d=()=>{o.current=setTimeout(()=>{l()},a)},p=()=>{o.current&&(clearTimeout(o.current),o.current=null)};return i(y,{className:v,icon:m,sx:{backgroundColor:({text:u})=>u.primary,color:u=>u[s][e]},onClose:l,onMouseEnter:p,onMouseLeave:d,children:n})}const P=$(E),T=R({toasts:[],add:()=>{}});function U({children:r}){const[s,n]=b([]),m=j(()=>({toasts:s,add:t=>{a(t)}}),[s]),a=t=>{n(o=>[...o,{id:A(),visible:!0,...t}])},c=t=>{n(o=>o.map(e=>(e.id===t&&(e.visible=!1),e))),setTimeout(()=>{n(o=>o.filter(e=>e.id!==t))},500)};return x(T.Provider,{value:m,children:[i("div",{className:`${f}-toast-container`,children:s.map(({...t})=>i("div",{style:{marginBottom:15},children:i(B,{enter:!!t.visible,children:i(P,{...t,onRemove:c})})},t.id))}),r]})}function V(){const{add:r}=M(T);return{addToast:r}}export{P as Toast,U as ToastProvider,V as useToast};
|
|
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/Typography-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../chunks/Typography-Ch-BLqCH.cjs");require("react/jsx-runtime");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/convertPathToColor-D8eBpd_D.cjs");require("../../chunks/useTheme-DsrjDJKC.cjs");require("react");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/createComponent-Bls5N6x8.cjs");exports.default=e.Typography;exports.variants=e.variants;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as v,v as d}from"../../chunks/Typography-
|
|
1
|
+
import{T as v,v as d}from"../../chunks/Typography-B_WR62ip.js";import"react/jsx-runtime";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/convertPathToColor-DtOjH4ZP.js";import"../../chunks/useTheme-BYuNiCiH.js";import"react";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/createComponent-BmdhWozT.js";export{v as default,d as variants};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/useTheme-DsrjDJKC.cjs"),i=require("./chunks/Bounce-ByNbJjX0.cjs"),e=require("./chunks/useForm-TyKbw7O8.cjs"),a=require("./chunks/Fade-CM-5xRVt.cjs"),s=require("./chunks/Slide-D4aLHjYS.cjs"),u=require("./chunks/TableHeader-D0wXM5mO.cjs"),d=require("./chunks/Zoom-BOnqwiDY.cjs"),r=require("./chunks/DrawerContent-DUDCTXPM.cjs"),l=require("./chunks/useListenerResized-AwpsZLcP.cjs"),t=require("./chunks/useMenu-CvPJe62S.cjs"),q=require("./chunks/useResize-B-oebgDR.cjs"),c=require("./chunks/Card-Bqgukgip.cjs"),m=require("./chunks/CardContent-DPL-tBOS.cjs"),n=require("./chunks/GridItem-wwo-SHGR.cjs"),C=require("./chunks/MenuButton-Dpbow8YC.cjs"),T=require("./chunks/Typography-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/useTheme-DsrjDJKC.cjs"),i=require("./chunks/Bounce-ByNbJjX0.cjs"),e=require("./chunks/useForm-TyKbw7O8.cjs"),a=require("./chunks/Fade-CM-5xRVt.cjs"),s=require("./chunks/Slide-D4aLHjYS.cjs"),u=require("./chunks/TableHeader-D0wXM5mO.cjs"),d=require("./chunks/Zoom-BOnqwiDY.cjs"),r=require("./chunks/DrawerContent-DUDCTXPM.cjs"),l=require("./chunks/useListenerResized-AwpsZLcP.cjs"),t=require("./chunks/useMenu-CvPJe62S.cjs"),q=require("./chunks/useResize-B-oebgDR.cjs"),c=require("./chunks/Card-Bqgukgip.cjs"),m=require("./chunks/CardContent-DPL-tBOS.cjs"),n=require("./chunks/GridItem-wwo-SHGR.cjs"),C=require("./chunks/MenuButton-Dpbow8YC.cjs"),T=require("./chunks/Typography-Ch-BLqCH.cjs");require("react");require("react/jsx-runtime");require("./chunks/generateSupportColors-CTMoGhDf.cjs");require("./chunks/index-DYxwT4uW.cjs");require("./chunks/joinClass-Jk3EszKD.cjs");require("./chunks/createComponent-Bls5N6x8.cjs");require("./chunks/Stack-CF3Wyma9.cjs");require("./chunks/ButtonIcon-C7gsGi0Q.cjs");require("./chunks/convertPathToColor-D8eBpd_D.cjs");require("./chunks/Ripple-Dy4i91j1.cjs");require("./chunks/Icon-RMp_DPL7.cjs");require("./chunks/uuid-omnJ9TjZ.cjs");exports.ThemeProvider=o.ThemeProvider;exports.createTheme=o.createTheme;exports.useTheme=o.useTheme;exports.Bounce=i.Bounce;exports.Control=e.Control;exports.Form=e.Form;exports.useControl=e.useControl;exports.useForm=e.useForm;exports.useFormGroup=e.useFormGroup;exports.Fade=a.Fade;exports.Slide=s.Slide;exports.Table=u.Table_default;exports.TableBody=u.TableBody;exports.TableCell=u.TableCell_default;exports.TableHeader=u.TableHeader;exports.Zoom=d.Zoom;exports.Drawer=r.Drawer_default;exports.DrawerContent=r.DrawerContent_default;exports.DrawerFooter=r.DrawerFooter_default;exports.DrawerHeader=r.DrawerHeader_default;exports.useDrawer=r.useDrawer;exports.useListenerResized=l.useListenerResized;exports.Menu=t.Menu;exports.useMenu=t.useMenu;exports.useResize=q.useResize;exports.Card=c.Card;exports.CardContent=m.CardContent;exports.Grid=n.Grid;exports.GridItem=n.GridItem;exports.MenuButton=C.MenuButton_default;exports.variants=T.variants;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as C,c as l,u as T}from"./chunks/useTheme-BYuNiCiH.js";import{B as F}from"./chunks/Bounce-DP0PU3kr.js";import{C as c,F as w,u as M,a as B,b as G}from"./chunks/useForm-3oClzOJC.js";import{F as v}from"./chunks/Fade-spxq-W-Q.js";import{S as H}from"./chunks/Slide-BxEwoZ70.js";import{T as S,a as Z,b as y,c as I}from"./chunks/TableHeader-CrbbJXyv.js";import{Z as P}from"./chunks/Zoom-DqgU4Wfv.js";import{D as j,a as k,b as q,c as A,u as E}from"./chunks/DrawerContent-BgqtYhBm.js";import{u as K}from"./chunks/useListenerResized-Bnqxrt7k.js";import{M as O,u as Q}from"./chunks/useMenu-we523Eob.js";import{u as V}from"./chunks/useResize-BjM6tiAF.js";import{C as X}from"./chunks/Card-C2mSdoXV.js";import{C as _}from"./chunks/CardContent-CViecz1a.js";import{G as rr,a as er}from"./chunks/GridItem-CaoPZmBu.js";import{M as ar}from"./chunks/MenuButton-31ZFG3JW.js";import{v as tr}from"./chunks/Typography-
|
|
1
|
+
import{T as C,c as l,u as T}from"./chunks/useTheme-BYuNiCiH.js";import{B as F}from"./chunks/Bounce-DP0PU3kr.js";import{C as c,F as w,u as M,a as B,b as G}from"./chunks/useForm-3oClzOJC.js";import{F as v}from"./chunks/Fade-spxq-W-Q.js";import{S as H}from"./chunks/Slide-BxEwoZ70.js";import{T as S,a as Z,b as y,c as I}from"./chunks/TableHeader-CrbbJXyv.js";import{Z as P}from"./chunks/Zoom-DqgU4Wfv.js";import{D as j,a as k,b as q,c as A,u as E}from"./chunks/DrawerContent-BgqtYhBm.js";import{u as K}from"./chunks/useListenerResized-Bnqxrt7k.js";import{M as O,u as Q}from"./chunks/useMenu-we523Eob.js";import{u as V}from"./chunks/useResize-BjM6tiAF.js";import{C as X}from"./chunks/Card-C2mSdoXV.js";import{C as _}from"./chunks/CardContent-CViecz1a.js";import{G as rr,a as er}from"./chunks/GridItem-CaoPZmBu.js";import{M as ar}from"./chunks/MenuButton-31ZFG3JW.js";import{v as tr}from"./chunks/Typography-B_WR62ip.js";import"react";import"react/jsx-runtime";import"./chunks/generateSupportColors-BN5t8dA-.js";import"./chunks/index-CZ41y9Hn.js";import"./chunks/joinClass-anSpaauN.js";import"./chunks/createComponent-BmdhWozT.js";import"./chunks/Stack-CHR_pZC4.js";import"./chunks/ButtonIcon-CVMYFuqn.js";import"./chunks/convertPathToColor-DtOjH4ZP.js";import"./chunks/Ripple-Bq9bxg4k.js";import"./chunks/Icon-DOCC8cxy.js";import"./chunks/uuid-dGvr9vBZ.js";export{F as Bounce,X as Card,_ as CardContent,c as Control,j as Drawer,k as DrawerContent,q as DrawerFooter,A as DrawerHeader,v as Fade,w as Form,rr as Grid,er as GridItem,O as Menu,ar as MenuButton,H as Slide,S as Table,Z as TableBody,y as TableCell,I as TableHeader,C as ThemeProvider,P as Zoom,l as createTheme,M as useControl,E as useDrawer,B as useForm,G as useFormGroup,K as useListenerResized,Q as useMenu,V as useResize,T as useTheme,tr as variants};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/style.css
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
/* assets/Alert-rsv63MkH.css */
|
|
21
21
|
.iziui-alert{min-height:48px;width:max-content;border-radius:var(--radius)}.iziui-alert--primary{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;color:var(--primary-dark);overflow:hidden;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:var(--primary-opacity)}.iziui-alert--secondary{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;color:var(--secondary-dark);overflow:hidden;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:var(--secondary-opacity)}.iziui-alert--info{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;color:var(--info-dark);overflow:hidden;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:var(--info-opacity)}.iziui-alert--error{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;color:var(--error-dark);overflow:hidden;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:var(--error-opacity)}.iziui-alert--warning{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;color:var(--warning-dark);overflow:hidden;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:var(--warning-opacity)}.iziui-alert--success{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;color:var(--success-dark);overflow:hidden;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:var(--success-opacity)}.iziui-alert--grey{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;color:var(--grey-dark);overflow:hidden;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:var(--grey-opacity)}.iziui-alert__content{padding:8px 16px}.iziui-alert__button{margin-right:16px}
|
|
22
22
|
/*$vite$:1*/
|
|
23
|
-
/* assets/Typography-
|
|
24
|
-
.iziui-typography{transition:all .3s cubic-bezier(.4,0,.2,1);
|
|
23
|
+
/* assets/Typography-DsZmVVQw.css */
|
|
24
|
+
.iziui-typography{color:currentColor;margin:0;transition:all .3s cubic-bezier(.4,0,.2,1);text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.iziui-typography--weight-bold{font-weight:700!important}.iziui-typography--weight-light{font-weight:300!important}.iziui-typography--weight-normal{font-weight:500!important}.iziui-typography--h1{font-size:clamp(2rem,1.65rem + 1.6vw,3rem);line-height:1.12;letter-spacing:-.02em}.iziui-typography--h2{font-size:clamp(1.75rem,1.5rem + 1.2vw,2.5rem);line-height:1.16;letter-spacing:-.015em;font-weight:700}.iziui-typography--h3{font-size:clamp(1.5rem,1.35rem + .9vw,2rem);line-height:1.2;letter-spacing:-.01em}.iziui-typography--h4{font-size:clamp(1.25rem,1.15rem + .6vw,1.5rem);line-height:1.25;letter-spacing:-.005em}.iziui-typography--h5{font-size:clamp(1.125rem,1.05rem + .4vw,1.25rem);line-height:1.3;letter-spacing:0;font-weight:600}.iziui-typography--h6{font-size:clamp(1rem,.98rem + .25vw,1.125rem);line-height:1.35;letter-spacing:.01em}.iziui-typography--subtitle1{font-size:clamp(1.0625rem,1.02rem + .25vw,1.125rem);line-height:1.5;letter-spacing:.005em}.iziui-typography--subtitle2{font-size:clamp(.9375rem,.92rem + .2vw,1rem);line-height:1.45;letter-spacing:.01em}.iziui-typography--body1{font-size:clamp(1rem,.95rem + .2vw,1.0625rem);line-height:1.6;letter-spacing:0}.iziui-typography--body2{font-size:clamp(.875rem,.85rem + .2vw,.9375rem);line-height:1.55;letter-spacing:0}
|
|
25
25
|
/*$vite$:1*/
|
|
26
26
|
/* assets/index-BBM31GWI.css */
|
|
27
27
|
.iziui-switch{position:relative}.iziui-switch__label{font-size:12px;color:var(--text-secondary);display:block;margin-bottom:5px}.iziui-switch__label--error{color:var(--error)}.iziui-switch__checkbox{height:0;width:0;visibility:hidden;position:absolute}.iziui-switch__checkbox:active+.iziui-switch__box .iziui-switch__button{width:36px}.iziui-switch__checkbox:checked+.iziui-switch__box .iziui-switch__button{left:100%;transform:translate(calc(-100% + 2px),-50%)}.iziui-switch__checkbox--primary:checked+.iziui-switch__box{background-color:var(--primary)}.iziui-switch__checkbox--secondary:checked+.iziui-switch__box{background-color:var(--secondary)}.iziui-switch__checkbox--info:checked+.iziui-switch__box{background-color:var(--info)}.iziui-switch__checkbox--error:checked+.iziui-switch__box{background-color:var(--error)}.iziui-switch__checkbox--warning:checked+.iziui-switch__box{background-color:var(--warning)}.iziui-switch__checkbox--success:checked+.iziui-switch__box{background-color:var(--success)}.iziui-switch__checkbox--grey:checked+.iziui-switch__box{background-color:var(--grey)}.iziui-switch__box{display:flex;align-items:center;justify-content:space-between;box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;cursor:pointer;width:58px;height:24px;background:var(--divider);border-radius:100px;position:relative;transition:background-color .3s cubic-bezier(.4,0,.2,1)}.iziui-switch__button{content:"";position:absolute;top:50%;transform:translateY(-50%);left:-2px;width:28px;height:28px;border-radius:45px;transition:all .3s cubic-bezier(.4,0,.2,1);background:#fff;box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d}.iziui-switch__helper-text{opacity:0;transition:all .3s cubic-bezier(.4,0,.2,1);font-size:12px;transform:translateY(-10px)}.iziui-switch__helper-text--visible{opacity:1;transform:translateY(0)}.iziui-switch__helper-text--error{color:var(--error)}
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const y=require("react/jsx-runtime"),p=require("react"),o=require("./index-DYxwT4uW.cjs"),l=require("./joinClass-Jk3EszKD.cjs"),m=require("./convertPathToColor-D8eBpd_D.cjs"),b=require("./useTheme-DsrjDJKC.cjs"),C=require("./createComponent-Bls5N6x8.cjs"),T=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2"],g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function q({children:n,variant:r="body1",color:e="text.primary",weight:s,textAlign:c,...t}){const{theme:{palette:h}}=b.useTheme(),i=g[r],a=l.joinClass(`${o.prefix}-typography`,`${o.prefix}-typography--${r}`,s&&`${o.prefix}-typography--weight-${s}`,t.className),u=p.useMemo(()=>e?m.convertPathToColor(e,h):"currentColor",[e,h]);return y.jsx(i,{...t,className:a,style:{color:u,textAlign:c,...t.style},children:n})}const x=C.createComponent(q);exports.Typography=x;exports.variants=T;
|
|
2
|
-
//# sourceMappingURL=Typography-BgYf02bJ.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Typography-BgYf02bJ.cjs","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import { type PropsWithChildren, type HTMLAttributes, type CSSProperties, useMemo } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { MappedColors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { convertPathToColor } from '@iziui/core/utils/convertPathToColor';\n\nimport { useTheme } from '@/theme';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Typography.scss';\n\nexport const variants = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n] as const;\n\nexport type Variant = typeof variants[number];\n\nconst MAP: { [x: string]: React.ElementType } = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n};\n\nexport interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\n\nfunction Typography({\n children,\n variant = 'body1',\n color: _color = 'text.primary',\n weight,\n textAlign,\n ...props\n}: TypographyProps) {\n const { theme: { palette } } = useTheme();\n\n const CustomTag = MAP[variant];\n\n const cls = joinClass(\n `${prefix}-typography`,\n `${prefix}-typography--${variant}`,\n weight && `${prefix}-typography--weight-${weight}`,\n props.className\n );\n\n const color = useMemo(() => {\n if (!_color) { return 'currentColor'; }\n return convertPathToColor(_color, palette);\n }, [_color, palette]);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n color,\n textAlign,\n ...props.style\n }}\n >\n {children}\n </CustomTag>\n );\n}\n\nexport default createComponent(Typography);"],"names":["variants","MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","useMemo","convertPathToColor","jsx","createComponent"],"mappings":"6QAaaA,EAAW,CACtB,KACA,KACA,KACA,KACA,KACA,KACA,YACA,YACA,QACA,OACF,EAIMC,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EASA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EAAS,eAChB,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAAA,SAAA,EAEzBC,EAAYV,EAAIG,CAAO,EAEvBQ,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,cACT,GAAGA,EAAAA,MAAM,gBAAgBV,CAAO,GAChCE,GAAU,GAAGQ,EAAAA,MAAM,uBAAuBR,CAAM,GAChDE,EAAM,SAAA,EAGFO,EAAQC,EAAAA,QAAQ,IACfX,EACEY,EAAAA,mBAAmBZ,EAAQI,CAAO,EADnB,eAErB,CAACJ,EAAQI,CAAO,CAAC,EAEpB,OACES,EAAAA,IAACP,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,MAAAG,EACA,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAD,EAAeiB,EAAAA,gBAAgBjB,CAAU"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as c}from"react/jsx-runtime";import{useMemo as i}from"react";import{p as r}from"./index-CZ41y9Hn.js";import{j as l}from"./joinClass-anSpaauN.js";import{c as u}from"./convertPathToColor-DtOjH4ZP.js";import{u as f}from"./useTheme-BYuNiCiH.js";import{c as b}from"./createComponent-BmdhWozT.js";const N=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2"],g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function T({children:a,variant:s="body1",color:t="text.primary",weight:e,textAlign:m,...o}){const{theme:{palette:h}}=f(),p=g[s],y=l(`${r}-typography`,`${r}-typography--${s}`,e&&`${r}-typography--weight-${e}`,o.className),n=i(()=>t?u(t,h):"currentColor",[t,h]);return c(p,{...o,className:y,style:{color:n,textAlign:m,...o.style},children:a})}const P=b(T);export{P as T,N as v};
|
|
2
|
-
//# sourceMappingURL=Typography-BuWesgHA.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Typography-BuWesgHA.js","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import { type PropsWithChildren, type HTMLAttributes, type CSSProperties, useMemo } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { MappedColors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { convertPathToColor } from '@iziui/core/utils/convertPathToColor';\n\nimport { useTheme } from '@/theme';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Typography.scss';\n\nexport const variants = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n] as const;\n\nexport type Variant = typeof variants[number];\n\nconst MAP: { [x: string]: React.ElementType } = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n};\n\nexport interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\n\nfunction Typography({\n children,\n variant = 'body1',\n color: _color = 'text.primary',\n weight,\n textAlign,\n ...props\n}: TypographyProps) {\n const { theme: { palette } } = useTheme();\n\n const CustomTag = MAP[variant];\n\n const cls = joinClass(\n `${prefix}-typography`,\n `${prefix}-typography--${variant}`,\n weight && `${prefix}-typography--weight-${weight}`,\n props.className\n );\n\n const color = useMemo(() => {\n if (!_color) { return 'currentColor'; }\n return convertPathToColor(_color, palette);\n }, [_color, palette]);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n color,\n textAlign,\n ...props.style\n }}\n >\n {children}\n </CustomTag>\n );\n}\n\nexport default createComponent(Typography);"],"names":["variants","MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","useMemo","convertPathToColor","jsx","Typography$1","createComponent"],"mappings":"8SAaO,MAAMA,EAAW,CACtB,KACA,KACA,KACA,KACA,KACA,KACA,YACA,YACA,QACA,OACF,EAIMC,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EASA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EAAS,eAChB,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAA,EAEzBC,EAAYV,EAAIG,CAAO,EAEvBQ,EAAMC,EACV,GAAGC,CAAM,cACT,GAAGA,CAAM,gBAAgBV,CAAO,GAChCE,GAAU,GAAGQ,CAAM,uBAAuBR,CAAM,GAChDE,EAAM,SAAA,EAGFO,EAAQC,EAAQ,IACfX,EACEY,EAAmBZ,EAAQI,CAAO,EADnB,eAErB,CAACJ,EAAQI,CAAO,CAAC,EAEpB,OACES,EAACP,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,MAAAG,EACA,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAgB,EAAeC,EAAgBlB,CAAU"}
|