@iziui/react 0.0.53-rc → 0.0.54-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/layout/Container/Container.d.ts +11 -0
- package/dist/.types/layout/Container/Container.d.ts.map +1 -0
- package/dist/.types/layout/Container/Container.spec.d.ts +2 -0
- package/dist/.types/layout/Container/Container.spec.d.ts.map +1 -0
- package/dist/.types/layout/Container/Container.stories.d.ts +7 -0
- package/dist/.types/layout/Container/Container.stories.d.ts.map +1 -0
- package/dist/.types/layout/Container/index.d.ts +2 -0
- package/dist/.types/layout/Container/index.d.ts.map +1 -0
- package/dist/.types/layout/index.d.ts +1 -0
- package/dist/.types/layout/index.d.ts.map +1 -1
- package/dist/chunks/{Alert-DAYw7lG0.cjs → Alert-BSZpV_lB.cjs} +2 -2
- package/dist/chunks/{Alert-DAYw7lG0.cjs.map → Alert-BSZpV_lB.cjs.map} +1 -1
- package/dist/chunks/{Alert-Dvtv5drl.js → Alert-Eku3Mhx-.js} +2 -2
- package/dist/chunks/{Alert-Dvtv5drl.js.map → Alert-Eku3Mhx-.js.map} +1 -1
- package/dist/chunks/Typography-CmzvEsC_.js +2 -0
- package/dist/chunks/Typography-CmzvEsC_.js.map +1 -0
- package/dist/chunks/Typography-DaZ95boB.cjs +2 -0
- package/dist/chunks/Typography-DaZ95boB.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/Container/index.cjs +2 -0
- package/dist/components/Container/index.cjs.map +1 -0
- package/dist/components/Container/index.d.ts +2 -0
- package/dist/components/Container/index.js +2 -0
- package/dist/components/Container/index.js.map +1 -0
- 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/package.json +1 -1
- package/dist/chunks/Typography-BKIC6AW2.cjs +0 -2
- package/dist/chunks/Typography-BKIC6AW2.cjs.map +0 -1
- package/dist/chunks/Typography-C2ffsG3_.js +0 -2
- package/dist/chunks/Typography-C2ffsG3_.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../../src/display/Typography/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
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,UAAU,eAAgB,SAAQ,iBAAiB,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;IACvF,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;;AAwCD,wBAA2C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
type Width = string | number;
|
|
3
|
+
export interface ContainerProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
tag?: React.ElementType;
|
|
5
|
+
sm?: Width;
|
|
6
|
+
md?: Width;
|
|
7
|
+
lg?: Width;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import('react').FC<import('@iziui/core/options').Sx<ContainerProps & import('react').RefAttributes<HTMLElement>>>;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=Container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../src/layout/Container/Container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ5C,OAAO,yCAAyC,CAAC;AAEjD,KAAK,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7B,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,WAAW,CAAC;IACjE,GAAG,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACxB,EAAE,CAAC,EAAE,KAAK,CAAC;IACX,EAAE,CAAC,EAAE,KAAK,CAAC;IACX,EAAE,CAAC,EAAE,KAAK,CAAC;CACZ;;AA+CD,wBAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.spec.d.ts","sourceRoot":"","sources":["../../../../src/layout/Container/Container.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Container } from './Container';
|
|
3
|
+
export declare const Variant: StoryObj<typeof Container>;
|
|
4
|
+
export declare const Playground: StoryObj<typeof Container>;
|
|
5
|
+
declare const meta: Meta<typeof Container>;
|
|
6
|
+
export default meta;
|
|
7
|
+
//# sourceMappingURL=Container.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.stories.d.ts","sourceRoot":"","sources":["../../../../src/layout/Container/Container.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,SAAS,CAiB9C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,SAAS,CAEjD,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAyChC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layout/Container/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,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-B9mi696v.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-B9mi696v.cjs"),j=require("./Typography-DaZ95boB.cjs"),d=require("./ButtonIcon-CzxDZNK8.cjs"),y=require("./createComponent-6wUj8nAi.cjs"),q=require("./Icon-BEUDQFrk.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-BSZpV_lB.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert-
|
|
1
|
+
{"version":3,"file":"Alert-BSZpV_lB.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-DyhbU7Me.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-DyhbU7Me.js";import{T as y}from"./Typography-CmzvEsC_.js";import{B as g}from"./ButtonIcon-B5VfjTl_.js";import{c as x}from"./createComponent-DppVNf5x.js";import{I}from"./Icon-BCwUSOy5.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-Eku3Mhx-.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert-
|
|
1
|
+
{"version":3,"file":"Alert-Eku3Mhx-.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 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-BhIs8Txu.js";import{c as g}from"./createComponent-DppVNf5x.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-CmzvEsC_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography-CmzvEsC_.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"}
|
|
@@ -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"),C=require("./useTheme-BZ0xkY68.cjs"),T=require("./createComponent-6wUj8nAi.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-DaZ95boB.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography-DaZ95boB.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 +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-BSZpV_lB.cjs");require("react/jsx-runtime");require("react");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/joinClass-Jk3EszKD.cjs");require("../../chunks/Stack-B9mi696v.cjs");require("../../chunks/createComponent-6wUj8nAi.cjs");require("../../chunks/useTheme-BZ0xkY68.cjs");require("../../chunks/Typography-DaZ95boB.cjs");require("../../chunks/convertPathToColor-BlQMLS4V.cjs");require("../../chunks/ButtonIcon-CzxDZNK8.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");require("../../chunks/Icon-BEUDQFrk.cjs");exports.default=e.Alert;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A}from"../../chunks/Alert-
|
|
1
|
+
import{A}from"../../chunks/Alert-Eku3Mhx-.js";import"react/jsx-runtime";import"react";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/joinClass-anSpaauN.js";import"../../chunks/Stack-DyhbU7Me.js";import"../../chunks/createComponent-DppVNf5x.js";import"../../chunks/useTheme-BhIs8Txu.js";import"../../chunks/Typography-CmzvEsC_.js";import"../../chunks/convertPathToColor-D2SdAqGh.js";import"../../chunks/ButtonIcon-B5VfjTl_.js";import"../../chunks/Ripple-Bq9bxg4k.js";import"../../chunks/Icon-BCwUSOy5.js";export{A 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-6wUj8nAi.cjs"),v=require("../../chunks/Icon-BEUDQFrk.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-6wUj8nAi.cjs"),v=require("../../chunks/Icon-BEUDQFrk.cjs"),x=require("../../chunks/Typography-DaZ95boB.cjs");require("react");require("../../chunks/useTheme-BZ0xkY68.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-DppVNf5x.js";import{I as d}from"../../chunks/Icon-BCwUSOy5.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-DppVNf5x.js";import{I as d}from"../../chunks/Icon-BCwUSOy5.js";import{T as C}from"../../chunks/Typography-CmzvEsC_.js";import"react";import"../../chunks/useTheme-BhIs8Txu.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 z=v($);export{z as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("react/jsx-runtime"),s=require("react"),g=require("../../chunks/joinClass-Jk3EszKD.cjs"),q=require("../../chunks/useResize-B-oebgDR.cjs"),f=require("../../chunks/createComponent-6wUj8nAi.cjs");require("../../chunks/index-DYxwT4uW.cjs");require("../../chunks/useTheme-BZ0xkY68.cjs");const j=s.forwardRef(function({sm:o="100%",md:r=750,lg:i=950,children:a,tag:u="div",...n},c){const[l,e]=s.useState(0),t={sm:o,lg:i,md:r},d=g.joinClass(n.className);q.useResize({onXs:()=>e(t.sm),onSm:()=>e(t.md),onMd:()=>e(t.md),onLg:()=>e(t.lg),onXl:()=>e(t.lg)});const m=u;return C.jsx(m,{...n,ref:c,style:{width:"100%",maxWidth:l,margin:"auto",...n.style},className:d,children:a})}),h=f.createComponent(j);exports.default=h;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/layout/Container/Container.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport { forwardRef, useState } from 'react';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport useResize from '@/hooks/useResize';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Container.scss';\n\ntype Width = string | number;\n\nexport interface ContainerProps extends HTMLAttributes<HTMLElement> {\n tag?: React.ElementType;\n sm?: Width;\n md?: Width;\n lg?: Width;\n}\n\nconst Container = forwardRef<HTMLElement, ContainerProps>(\n function Container({\n sm = '100%',\n md = 750,\n lg = 950,\n children,\n tag = 'div',\n ...props\n }, ref) {\n const [width, setWidth] = useState<Width>(0);\n\n const MAP = { sm, lg, md };\n\n const className = joinClass(\n props.className\n );\n\n useResize({\n onXs: () => setWidth(MAP['sm']),\n onSm: () => setWidth(MAP['md']),\n onMd: () => setWidth(MAP['md']),\n onLg: () => setWidth(MAP['lg']),\n onXl: () => setWidth(MAP['lg']),\n });\n\n const CustomTag = tag;\n\n return (\n <CustomTag\n {...props}\n ref={ref}\n style={{\n width: '100%',\n maxWidth: width,\n margin: 'auto',\n ...props.style\n }}\n className={className}\n >\n {children}\n </CustomTag>\n );\n }\n);\n\nexport default createComponent(Container);\n"],"names":["Container","forwardRef","sm","md","lg","children","tag","props","ref","width","setWidth","useState","MAP","className","joinClass","useResize","CustomTag","jsx","Container_default","createComponent"],"mappings":"sZAmBA,MAAMA,EAAYC,EAAAA,WAChB,SAAmB,CACjB,GAAAC,EAAK,OACL,GAAAC,EAAK,IACL,GAAAC,EAAK,IACL,SAAAC,EACA,IAAAC,EAAM,MACN,GAAGC,CAAA,EACFC,EAAK,CACN,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAAA,SAAgB,CAAC,EAErCC,EAAM,CAAE,GAAAV,EAAI,GAAAE,EAAI,GAAAD,CAAA,EAEhBU,EAAYC,EAAAA,UAChBP,EAAM,SAAA,EAGRQ,YAAU,CACR,KAAM,IAAML,EAASE,EAAI,EAAK,EAC9B,KAAM,IAAMF,EAASE,EAAI,EAAK,EAC9B,KAAM,IAAMF,EAASE,EAAI,EAAK,EAC9B,KAAM,IAAMF,EAASE,EAAI,EAAK,EAC9B,KAAM,IAAMF,EAASE,EAAI,EAAK,CAAA,CAC/B,EAED,MAAMI,EAAYV,EAElB,OACEW,EAAAA,IAACD,EAAA,CACE,GAAGT,EACJ,IAAAC,EACA,MAAO,CACL,MAAO,OACP,SAAUC,EACV,OAAQ,OACR,GAAGF,EAAM,KAAA,EAEX,UAAAM,EAEC,SAAAR,CAAA,CAAA,CAGP,CACF,EAEAa,EAAeC,EAAAA,gBAAgBnB,CAAS"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as f}from"react/jsx-runtime";import{forwardRef as l,useState as u}from"react";import{j as C}from"../../chunks/joinClass-anSpaauN.js";import{u as g}from"../../chunks/useResize-BjM6tiAF.js";import{c as p}from"../../chunks/createComponent-DppVNf5x.js";import"../../chunks/index-CZ41y9Hn.js";import"../../chunks/useTheme-BhIs8Txu.js";const h=l(function({sm:n="100%",md:m=750,lg:a=950,children:e,tag:r="div",...s},i){const[c,t]=u(0),o={sm:n,lg:a,md:m},d=C(s.className);return g({onXs:()=>t(o.sm),onSm:()=>t(o.md),onMd:()=>t(o.md),onLg:()=>t(o.lg),onXl:()=>t(o.lg)}),f(r,{...s,ref:i,style:{width:"100%",maxWidth:c,margin:"auto",...s.style},className:d,children:e})}),W=p(h);export{W as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/layout/Container/Container.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport { forwardRef, useState } from 'react';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport useResize from '@/hooks/useResize';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Container.scss';\n\ntype Width = string | number;\n\nexport interface ContainerProps extends HTMLAttributes<HTMLElement> {\n tag?: React.ElementType;\n sm?: Width;\n md?: Width;\n lg?: Width;\n}\n\nconst Container = forwardRef<HTMLElement, ContainerProps>(\n function Container({\n sm = '100%',\n md = 750,\n lg = 950,\n children,\n tag = 'div',\n ...props\n }, ref) {\n const [width, setWidth] = useState<Width>(0);\n\n const MAP = { sm, lg, md };\n\n const className = joinClass(\n props.className\n );\n\n useResize({\n onXs: () => setWidth(MAP['sm']),\n onSm: () => setWidth(MAP['md']),\n onMd: () => setWidth(MAP['md']),\n onLg: () => setWidth(MAP['lg']),\n onXl: () => setWidth(MAP['lg']),\n });\n\n const CustomTag = tag;\n\n return (\n <CustomTag\n {...props}\n ref={ref}\n style={{\n width: '100%',\n maxWidth: width,\n margin: 'auto',\n ...props.style\n }}\n className={className}\n >\n {children}\n </CustomTag>\n );\n }\n);\n\nexport default createComponent(Container);\n"],"names":["Container","forwardRef","sm","md","lg","children","tag","props","ref","width","setWidth","useState","MAP","className","joinClass","useResize","jsx","Container_default","createComponent"],"mappings":"qVAmBA,MAAMA,EAAYC,EAChB,SAAmB,CACjB,GAAAC,EAAK,OACL,GAAAC,EAAK,IACL,GAAAC,EAAK,IACL,SAAAC,EACA,IAAAC,EAAM,MACN,GAAGC,CAAA,EACFC,EAAK,CACN,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAgB,CAAC,EAErCC,EAAM,CAAE,GAAAV,EAAI,GAAAE,EAAI,GAAAD,CAAA,EAEhBU,EAAYC,EAChBP,EAAM,SAAA,EAGR,OAAAQ,EAAU,CACR,KAAM,IAAML,EAASE,EAAI,EAAK,EAC9B,KAAM,IAAMF,EAASE,EAAI,EAAK,EAC9B,KAAM,IAAMF,EAASE,EAAI,EAAK,EAC9B,KAAM,IAAMF,EAASE,EAAI,EAAK,EAC9B,KAAM,IAAMF,EAASE,EAAI,EAAK,CAAA,CAC/B,EAKCI,EAHgBV,EAGf,CACE,GAAGC,EACJ,IAAAC,EACA,MAAO,CACL,MAAO,OACP,SAAUC,EACV,OAAQ,OACR,GAAGF,EAAM,KAAA,EAEX,UAAAM,EAEC,SAAAR,CAAA,CAAA,CAGP,CACF,EAEAY,EAAeC,EAAgBlB,CAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("react"),q=require("../../chunks/index-DYxwT4uW.cjs"),h=require("../../chunks/joinClass-Jk3EszKD.cjs"),C=require("../../chunks/createComponent-6wUj8nAi.cjs"),p=require("../../chunks/useTheme-BZ0xkY68.cjs"),b=require("../../chunks/Alert-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("react"),q=require("../../chunks/index-DYxwT4uW.cjs"),h=require("../../chunks/joinClass-Jk3EszKD.cjs"),C=require("../../chunks/createComponent-6wUj8nAi.cjs"),p=require("../../chunks/useTheme-BZ0xkY68.cjs"),b=require("../../chunks/Alert-BSZpV_lB.cjs"),R=require("../../chunks/uuid-omnJ9TjZ.cjs"),g=require("../../chunks/Zoom-BOnqwiDY.cjs");require("../../chunks/Stack-B9mi696v.cjs");require("../../chunks/Typography-DaZ95boB.cjs");require("../../chunks/convertPathToColor-BlQMLS4V.cjs");require("../../chunks/ButtonIcon-CzxDZNK8.cjs");require("../../chunks/Ripple-Dy4i91j1.cjs");require("../../chunks/Icon-BEUDQFrk.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(`${q.prefix}-toast`,e.className);n.useEffect(()=>(T(),f),[]);const m=()=>{o&&l(o)},T=()=>{t.current=setTimeout(()=>{m()},a)},f=()=>{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:f,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:`${q.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}from"../../chunks/index-CZ41y9Hn.js";import{j as N}from"../../chunks/joinClass-anSpaauN.js";import{c as $}from"../../chunks/createComponent-DppVNf5x.js";import{u as g}from"../../chunks/useTheme-BhIs8Txu.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}from"../../chunks/index-CZ41y9Hn.js";import{j as N}from"../../chunks/joinClass-anSpaauN.js";import{c as $}from"../../chunks/createComponent-DppVNf5x.js";import{u as g}from"../../chunks/useTheme-BhIs8Txu.js";import{A as y}from"../../chunks/Alert-Eku3Mhx-.js";import{u as A}from"../../chunks/uuid-dGvr9vBZ.js";import{Z as B}from"../../chunks/Zoom-DqgU4Wfv.js";import"../../chunks/Stack-DyhbU7Me.js";import"../../chunks/Typography-CmzvEsC_.js";import"../../chunks/convertPathToColor-D2SdAqGh.js";import"../../chunks/ButtonIcon-B5VfjTl_.js";import"../../chunks/Ripple-Bq9bxg4k.js";import"../../chunks/Icon-BCwUSOy5.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(`${p}-toast`,t.className);C(()=>(d(),f),[]);const l=()=>{r&&c(r)},d=()=>{o.current=setTimeout(()=>{l()},a)},f=()=>{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:f,onMouseLeave:d,children:n})}const P=$(E),T=R({toasts:[],add:()=>{}});function Q({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:`${p}-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 U(){const{add:r}=M(T);return{addToast:r}}export{P as Toast,Q as ToastProvider,U 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-DaZ95boB.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-BZ0xkY68.cjs");require("../../chunks/createComponent-6wUj8nAi.cjs");exports.default=e.Typography;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as d}from"../../chunks/Typography-
|
|
1
|
+
import{T as d}from"../../chunks/Typography-CmzvEsC_.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-BhIs8Txu.js";import"../../chunks/createComponent-DppVNf5x.js";export{d as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const p=require("react/jsx-runtime"),t=require("./index-DYxwT4uW.cjs"),u=require("./joinClass-Jk3EszKD.cjs"),l=require("./convertPathToColor-BlQMLS4V.cjs"),m=require("./useTheme-BZ0xkY68.cjs"),T=require("./createComponent-6wUj8nAi.cjs"),g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function x({children:s,variant:o="body1",color:h="text.primary",weight:r,textAlign:n,...e}){const{theme:{palette:c}}=m.useTheme(),y=g[o],a=u.joinClass(`${t.prefix}-typography`,`${t.prefix}-typography--${o}`,r&&`${t.prefix}-typography--weight-${r}`,e.className),i=l.convertPathToColor(h,c);return p.jsx(y,{...e,className:a,style:{color:i,textAlign:n,...e.style},children:s})}const C=T.createComponent(x);exports.Typography=C;
|
|
2
|
-
//# sourceMappingURL=Typography-BKIC6AW2.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Typography-BKIC6AW2.cjs","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import type { PropsWithChildren, HTMLAttributes, 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\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 = '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 c = convertPathToColor(color, palette);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n color: c,\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","c","convertPathToColor","jsx","createComponent"],"mappings":"0PA4BMA,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,MAAAC,EAAQ,eACR,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,EAAIC,EAAAA,mBAAmBX,EAAOI,CAAO,EAE3C,OACEQ,EAAAA,IAACN,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,MAAOG,EACP,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAD,EAAegB,EAAAA,gBAAgBhB,CAAU"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";import{p as t}from"./index-CZ41y9Hn.js";import{j as i}from"./joinClass-anSpaauN.js";import{c as l}from"./convertPathToColor-D2SdAqGh.js";import{u as f}from"./useTheme-BhIs8Txu.js";import{c as u}from"./createComponent-DppVNf5x.js";const g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function T({children:h,variant:r="body1",color:e="text.primary",weight:s,textAlign:p,...o}){const{theme:{palette:a}}=f(),m=g[r],c=i(`${t}-typography`,`${t}-typography--${r}`,s&&`${t}-typography--weight-${s}`,o.className),y=l(e,a);return n(m,{...o,className:c,style:{color:y,textAlign:p,...o.style},children:h})}const N=u(T);export{N as T};
|
|
2
|
-
//# sourceMappingURL=Typography-C2ffsG3_.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Typography-C2ffsG3_.js","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import type { PropsWithChildren, HTMLAttributes, 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\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 = '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 c = convertPathToColor(color, palette);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n color: c,\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","c","convertPathToColor","jsx","Typography$1","createComponent"],"mappings":"8QA4BA,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,MAAAC,EAAQ,eACR,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,EAAIC,EAAmBX,EAAOI,CAAO,EAE3C,OACEQ,EAACN,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,MAAOG,EACP,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAe,EAAeC,EAAgBjB,CAAU"}
|