@iziui/react 0.0.67-rc → 0.0.68-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 +1 -1
- package/dist/.types/display/Typography/Typography.d.ts.map +1 -1
- package/dist/.types/display/Typography/index.d.ts +1 -0
- package/dist/.types/display/Typography/index.d.ts.map +1 -1
- package/dist/chunks/{Alert-C1vwma3Y.cjs → Alert-BxZX8Ifk.cjs} +2 -2
- package/dist/chunks/{Alert-C1vwma3Y.cjs.map → Alert-BxZX8Ifk.cjs.map} +1 -1
- package/dist/chunks/{Alert-Cn-EvcSp.js → Alert-Em-sG89m.js} +2 -2
- package/dist/chunks/{Alert-Cn-EvcSp.js.map → Alert-Em-sG89m.js.map} +1 -1
- package/dist/chunks/Typography-BIZP_DtQ.js +2 -0
- package/dist/chunks/Typography-BIZP_DtQ.js.map +1 -0
- package/dist/chunks/Typography-CAQXUFSQ.cjs +2 -0
- package/dist/chunks/Typography-CAQXUFSQ.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/package.json +1 -1
- package/dist/chunks/Typography-DitZ-9b5.cjs +0 -2
- package/dist/chunks/Typography-DitZ-9b5.cjs.map +0 -1
- package/dist/chunks/Typography-v-XX3oAk.js +0 -2
- package/dist/chunks/Typography-v-XX3oAk.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { PropsWithChildren, HTMLAttributes, CSSProperties } from 'react';
|
|
|
2
2
|
import { MappedColors } from '../../_internal/core/theme';
|
|
3
3
|
export declare const variants: readonly ["h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2"];
|
|
4
4
|
export type Variant = typeof variants[number];
|
|
5
|
-
interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {
|
|
5
|
+
export interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {
|
|
6
6
|
variant?: Variant;
|
|
7
7
|
color?: MappedColors;
|
|
8
8
|
textAlign?: CSSProperties['textAlign'];
|
|
@@ -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,EAAW,MAAM,OAAO,CAAC;AAIjG,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,
|
|
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,EAAW,MAAM,OAAO,CAAC;AAIjG,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;;AAyCD,wBAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/display/Typography/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/display/Typography/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,cAAc,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-beBM7a60.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-beBM7a60.cjs"),j=require("./Typography-CAQXUFSQ.cjs"),d=require("./ButtonIcon-Cz8zJH-E.cjs"),y=require("./createComponent-CTufIEiN.cjs"),q=require("./Icon-COl2Nhp9.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-BxZX8Ifk.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert-
|
|
1
|
+
{"version":3,"file":"Alert-BxZX8Ifk.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-DK5pfu2w.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-DK5pfu2w.js";import{T as y}from"./Typography-BIZP_DtQ.js";import{B as g}from"./ButtonIcon-CsX4oYeI.js";import{c as x}from"./createComponent-WNQRXK89.js";import{I}from"./Icon-CCIgEwA9.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-Em-sG89m.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert-
|
|
1
|
+
{"version":3,"file":"Alert-Em-sG89m.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 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-D2SdAqGh.js";import{u as f}from"./useTheme-njpgklWP.js";import{c as b}from"./createComponent-WNQRXK89.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:e,variant:s="body1",color:o,weight:h,textAlign:a,...t}){const{theme:{palette:m}}=f(),p=g[s],n=l(`${r}-typography`,`${r}-typography--${s}`,h&&`${r}-typography--weight-${h}`,t.className),y=i(()=>o?u(o,m):"currentColor",[o]);return c(p,{...t,className:n,style:{color:y,textAlign:a,...t.style},children:e})}const P=b(T);export{P as T,N as v};
|
|
2
|
+
//# sourceMappingURL=Typography-BIZP_DtQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography-BIZP_DtQ.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,\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]);\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,EACP,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,CAAM,CAAC,EAEX,OACEa,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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
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-BlQMLS4V.cjs"),b=require("./useTheme-DoESyi5h.cjs"),C=require("./createComponent-CTufIEiN.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:h,variant:r="body1",color:e,weight:s,textAlign:n,...t}){const{theme:{palette:c}}=b.useTheme(),i=g[r],u=l.joinClass(`${o.prefix}-typography`,`${o.prefix}-typography--${r}`,s&&`${o.prefix}-typography--weight-${s}`,t.className),a=p.useMemo(()=>e?m.convertPathToColor(e,c):"currentColor",[e]);return y.jsx(i,{...t,className:u,style:{color:a,textAlign:n,...t.style},children:h})}const d=C.createComponent(q);exports.Typography=d;exports.variants=T;
|
|
2
|
+
//# sourceMappingURL=Typography-CAQXUFSQ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography-CAQXUFSQ.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,\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]);\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,EACP,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,CAAM,CAAC,EAEX,OACEa,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 +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-BxZX8Ifk.cjs");require("react/jsx-runtime");require("react");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/Stack-beBM7a60.cjs");require("../../chunks/createComponent-CTufIEiN.cjs");require("../../chunks/useTheme-DoESyi5h.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/Typography-CAQXUFSQ.cjs");require("../../chunks/convertPathToColor-BlQMLS4V.cjs");require("../../chunks/ButtonIcon-Cz8zJH-E.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");require("../../chunks/Icon-COl2Nhp9.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-Em-sG89m.js";import"react/jsx-runtime";import"react";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/Stack-DK5pfu2w.js";import"../../chunks/createComponent-WNQRXK89.js";import"../../chunks/useTheme-njpgklWP.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/Typography-BIZP_DtQ.js";import"../../chunks/convertPathToColor-D2SdAqGh.js";import"../../chunks/ButtonIcon-CsX4oYeI.js";import"../../chunks/Ripple-Bq9bxg4k.js";import"../../chunks/Icon-CCIgEwA9.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-CTufIEiN.cjs"),v=require("../../chunks/Icon-COl2Nhp9.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-CTufIEiN.cjs"),v=require("../../chunks/Icon-COl2Nhp9.cjs"),x=require("../../chunks/Typography-CAQXUFSQ.cjs");require("react");require("../../chunks/useTheme-DoESyi5h.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/convertPathToColor-BlQMLS4V.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-WNQRXK89.js";import{I as d}from"../../chunks/Icon-CCIgEwA9.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-WNQRXK89.js";import{I as d}from"../../chunks/Icon-CCIgEwA9.js";import{T as C}from"../../chunks/Typography-BIZP_DtQ.js";import"react";import"../../chunks/useTheme-njpgklWP.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/convertPathToColor-D2SdAqGh.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-CTufIEiN.cjs"),p=require("../../chunks/useTheme-DoESyi5h.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-CTufIEiN.cjs"),p=require("../../chunks/useTheme-DoESyi5h.cjs"),b=require("../../chunks/Alert-BxZX8Ifk.cjs"),R=require("../../chunks/uuid-omnJ9TjZ.cjs"),g=require("../../chunks/Zoom-BOnqwiDY.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/Stack-beBM7a60.cjs");require("../../chunks/Typography-CAQXUFSQ.cjs");require("../../chunks/convertPathToColor-BlQMLS4V.cjs");require("../../chunks/ButtonIcon-Cz8zJH-E.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");require("../../chunks/Icon-COl2Nhp9.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-WNQRXK89.js";import{u as g}from"../../chunks/useTheme-njpgklWP.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-WNQRXK89.js";import{u as g}from"../../chunks/useTheme-njpgklWP.js";import{A as y}from"../../chunks/Alert-Em-sG89m.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-DK5pfu2w.js";import"../../chunks/Typography-BIZP_DtQ.js";import"../../chunks/convertPathToColor-D2SdAqGh.js";import"../../chunks/ButtonIcon-CsX4oYeI.js";import"../../chunks/Ripple-Bq9bxg4k.js";import"../../chunks/Icon-CCIgEwA9.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-CAQXUFSQ.cjs");require("react/jsx-runtime");require("react");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/convertPathToColor-BlQMLS4V.cjs");require("../../chunks/useTheme-DoESyi5h.cjs");require("../../chunks/generateSupportColors-CTMoGhDf.cjs");require("../../chunks/createComponent-CTufIEiN.cjs");exports.default=e.Typography;exports.variants=e.variants;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as
|
|
1
|
+
import{T as v,v as d}from"../../chunks/Typography-BIZP_DtQ.js";import"react/jsx-runtime";import"react";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/convertPathToColor-D2SdAqGh.js";import"../../chunks/useTheme-njpgklWP.js";import"../../chunks/generateSupportColors-BN5t8dA-.js";import"../../chunks/createComponent-WNQRXK89.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 r=require("./chunks/useTheme-DoESyi5h.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./chunks/useTheme-DoESyi5h.cjs"),i=require("./chunks/Bounce-ByNbJjX0.cjs"),e=require("./chunks/useForm-TyKbw7O8.cjs"),t=require("./chunks/Fade-CM-5xRVt.cjs"),s=require("./chunks/Slide-D4aLHjYS.cjs"),n=require("./chunks/Zoom-BOnqwiDY.cjs"),d=require("./chunks/useListenerResized-AwpsZLcP.cjs"),u=require("./chunks/useMenu-C0u9aTiR.cjs"),q=require("./chunks/useResize-B-oebgDR.cjs"),a=require("./chunks/Card-B8XSgLaD.cjs"),c=require("./chunks/CardContent-BivcVoIc.cjs"),m=require("./chunks/Drawer-0wOdungj.cjs"),o=require("./chunks/GridItem-wwo-SHGR.cjs"),C=require("./chunks/MenuButton-AyzSxRY0.cjs"),l=require("./chunks/Typography-CAQXUFSQ.cjs");require("react");require("react/jsx-runtime");require("./chunks/generateSupportColors-CTMoGhDf.cjs");require("./chunks/index-DYxwT4uW.cjs");require("./chunks/joinClass-Jk3EszKD.cjs");require("./chunks/uuid-omnJ9TjZ.cjs");require("./chunks/createComponent-CTufIEiN.cjs");require("./chunks/Ripple-Dy4i91j1.cjs");require("./chunks/Stack-beBM7a60.cjs");require("./chunks/convertPathToColor-BlQMLS4V.cjs");exports.ThemeProvider=r.ThemeProvider;exports.createTheme=r.createTheme;exports.useTheme=r.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=t.Fade;exports.Slide=s.Slide;exports.Zoom=n.Zoom;exports.useListenerResized=d.useListenerResized;exports.Menu=u.Menu;exports.useMenu=u.useMenu;exports.useResize=q.useResize;exports.Card=a.Card;exports.CardContent=c.CardContent;exports.Drawer=m.Drawer_default;exports.Grid=o.Grid;exports.GridItem=o.GridItem;exports.MenuButton=C.MenuButton_default;exports.variants=l.variants;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as
|
|
1
|
+
import{T as n,c as d,u as C}from"./chunks/useTheme-njpgklWP.js";import{B as M}from"./chunks/Bounce-DP0PU3kr.js";import{C as T,F as c,u as h,a as l,b as v}from"./chunks/useForm-3oClzOJC.js";import{F as z}from"./chunks/Fade-spxq-W-Q.js";import{S as R}from"./chunks/Slide-BxEwoZ70.js";import{Z}from"./chunks/Zoom-DqgU4Wfv.js";import{u as w}from"./chunks/useListenerResized-Bnqxrt7k.js";import{M as L,u as P}from"./chunks/useMenu-BNL22pOQ.js";import{u as j}from"./chunks/useResize-BjM6tiAF.js";import{C as q}from"./chunks/Card-DOsl4_nu.js";import{C as A}from"./chunks/CardContent-C8ypE7yH.js";import{D as H}from"./chunks/Drawer-D1lAWrdi.js";import{G as K,a as N}from"./chunks/GridItem-CaoPZmBu.js";import{M as Q}from"./chunks/MenuButton-DLf22r80.js";import{v as V}from"./chunks/Typography-BIZP_DtQ.js";import"react";import"react/jsx-runtime";import"./chunks/generateSupportColors-BN5t8dA-.js";import"./chunks/index-CZ41y9Hn.js";import"./chunks/joinClass-anSpaauN.js";import"./chunks/uuid-dGvr9vBZ.js";import"./chunks/createComponent-WNQRXK89.js";import"./chunks/Ripple-Bq9bxg4k.js";import"./chunks/Stack-DK5pfu2w.js";import"./chunks/convertPathToColor-D2SdAqGh.js";export{M as Bounce,q as Card,A as CardContent,T as Control,H as Drawer,z as Fade,c as Form,K as Grid,N as GridItem,L as Menu,Q as MenuButton,R as Slide,n as ThemeProvider,Z as Zoom,d as createTheme,h as useControl,l as useForm,v as useFormGroup,w as useListenerResized,P as useMenu,j as useResize,C as useTheme,V as variants};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
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-BlQMLS4V.cjs"),C=require("./useTheme-DoESyi5h.cjs"),T=require("./createComponent-CTufIEiN.cjs"),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,weight:s,textAlign:h,...t}){const{theme:{palette:c}}=C.useTheme(),u=g[r],i=l.joinClass(`${o.prefix}-typography`,`${o.prefix}-typography--${r}`,s&&`${o.prefix}-typography--weight-${s}`,t.className),a=p.useMemo(()=>e?m.convertPathToColor(e,c):"currentColor",[e]);return y.jsx(u,{...t,className:i,style:{color:a,textAlign:h,...t.style},children:n})}const x=T.createComponent(q);exports.Typography=x;
|
|
2
|
-
//# sourceMappingURL=Typography-DitZ-9b5.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Typography-DitZ-9b5.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\ninterface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\nfunction Typography({\n children,\n variant = 'body1',\n color: _color,\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]);\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":["MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","useMemo","convertPathToColor","jsx","createComponent"],"mappings":"6QA4BMA,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EAQA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EACP,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,CAAM,CAAC,EAEX,OACEa,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 y}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-D2SdAqGh.js";import{u as f}from"./useTheme-njpgklWP.js";import{c as g}from"./createComponent-WNQRXK89.js";const T={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function $({children:h,variant:e="body1",color:o,weight:s,textAlign:m,...t}){const{theme:{palette:p}}=f(),a=T[e],c=l(`${r}-typography`,`${r}-typography--${e}`,s&&`${r}-typography--weight-${s}`,t.className),n=i(()=>o?u(o,p):"currentColor",[o]);return y(a,{...t,className:c,style:{color:n,textAlign:m,...t.style},children:h})}const P=g($);export{P as T};
|
|
2
|
-
//# sourceMappingURL=Typography-v-XX3oAk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Typography-v-XX3oAk.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\ninterface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\nfunction Typography({\n children,\n variant = 'body1',\n color: _color,\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]);\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":["MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","useMemo","convertPathToColor","jsx","Typography$1","createComponent"],"mappings":"8SA4BA,MAAMA,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EAQA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EACP,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,CAAM,CAAC,EAEX,OACEa,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"}
|