@wonjin-dev/reacts 1.5.0 → 1.5.1

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.
@@ -7,7 +7,7 @@ interface StyledProps {
7
7
  weight?: 400 | 500 | 600 | 700;
8
8
  color?: keyof typeof palette;
9
9
  size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
10
- highlight?: 'underline';
10
+ highlight?: 'underline' | 'left';
11
11
  }
12
12
  declare const Typography: <T extends React.ElementType = "p">({ as, children, size, weight, color, deco, highlight, className, ...props }: PolymorphicComponent<T, StyledProps>) => import("react/jsx-runtime").JSX.Element;
13
13
  export default Typography;
@@ -25,7 +25,7 @@ interface StyledProps$1 {
25
25
  weight?: 400 | 500 | 600 | 700;
26
26
  color?: keyof typeof palette;
27
27
  size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
28
- highlight?: 'underline';
28
+ highlight?: 'underline' | 'left';
29
29
  }
30
30
  declare const Typography: <T extends React.ElementType = "p">({ as, children, size, weight, color, deco, highlight, className, ...props }: PolymorphicComponent<T, StyledProps$1>) => react_jsx_runtime.JSX.Element;
31
31
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../../src/utils/classNames/index.ts","../../src/components/Typography/index.tsx","../../src/components/Flex/index.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","const classNames = (...args: (string | undefined)[]) => {\n\treturn args.reduce((acc, className) => {\n\t\tif (className) {\n\t\t\treturn acc ? `${acc} ${className}` : className;\n\t\t}\n\t\treturn acc;\n\t}, '');\n};\n\nexport default classNames;\n","import React, { type ElementType } from 'react';\nimport { PolymorphicComponent } from '../_types';\nimport styles from './styles.module.scss';\nimport { classNames } from '@/utils';\nimport { palette } from '../_design/palette';\n\ntype TypographyDecoType = 'normal' | 'italic' | 'underline' | 'line-through';\n\ninterface StyledProps {\n\tdeco?: TypographyDecoType | TypographyDecoType[];\n\tweight?: 400 | 500 | 600 | 700;\n\tcolor?: keyof typeof palette;\n\tsize?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';\n\thighlight?: 'underline';\n}\n\nconst Typography = <T extends ElementType = 'p'>({\n\tas,\n\tchildren,\n\tsize = 'md',\n\tweight = 400,\n\tcolor = 'grey900',\n\tdeco = 'normal',\n\thighlight,\n\tclassName = '',\n\t...props\n}: PolymorphicComponent<T, StyledProps>) => {\n\tconst Component = as || 'p';\n\n\tconst cx = classNames(\n\t\tstyles.typography,\n\t\tstyles[`typography_size_${size}`],\n\t\tstyles[`typography_weight_${weight}`],\n\t\tArray.isArray(deco)\n\t\t\t? deco.map((deco) => styles[`typography_deco_${deco}`]).join(' ')\n\t\t\t: styles[`typography_deco_${deco}`],\n\t\tstyles[`typography_color_${color}`],\n\t\tstyles[`typography_highlight_${highlight}`],\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Component className={cx} {...props}>\n\t\t\t{children}\n\t\t</Component>\n\t);\n};\n\nexport default Typography;\n","import React, { type ElementType } from 'react';\nimport type { PolymorphicComponent } from '../_types';\nimport styles from './styles.module.scss';\nimport { classNames } from '@/utils';\n\ninterface StyledProps {\n\tdirection?: 'row' | 'column';\n\tflex?: '1' | 'auto' | 'none' | 'initial';\n\tjustifyContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';\n\talignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';\n\tgap?: number;\n}\n\nconst Flex = <E extends ElementType = 'div'>({\n\tas,\n\tchildren,\n\tdirection = 'row',\n\tflex,\n\tjustifyContent,\n\talignItems,\n\tgap,\n\tclassName = '',\n\t...props\n}: PolymorphicComponent<E, StyledProps>) => {\n\tconst Component = as || 'div';\n\n\tconst classes = classNames(\n\t\tstyles.flex,\n\t\tstyles[`flex_direction_${direction}`],\n\t\tflex ? styles[`flex_${flex}`] : undefined,\n\t\tjustifyContent ? styles[`flex_justify_${justifyContent}`] : undefined,\n\t\talignItems ? styles[`flex_align_${alignItems}`] : undefined,\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={classes}\n\t\t\tstyle={gap ? { gap: `${gap / 16}rem`, ...props.style } : props.style}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Component>\n\t);\n};\n\nexport default Flex;\n"],"names":["styles","_jsx"],"mappings":";;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC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AAG,EAAE,GAAG,GAAG,GAAG,EAAE,CAAA,GAAA,CAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAChE,GAAA,KAAK,YAER,QAAQ,EAAA,CACE,EACX;AACH;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.esm.js","sources":["../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../../src/utils/classNames/index.ts","../../src/components/Typography/index.tsx","../../src/components/Flex/index.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","const classNames = (...args: (string | undefined)[]) => {\n\treturn args.reduce((acc, className) => {\n\t\tif (className) {\n\t\t\treturn acc ? `${acc} ${className}` : className;\n\t\t}\n\t\treturn acc;\n\t}, '');\n};\n\nexport default classNames;\n","import React, { type ElementType } from 'react';\nimport { PolymorphicComponent } from '../_types';\nimport styles from './styles.module.scss';\nimport { classNames } from '@/utils';\nimport { palette } from '../_design/palette';\n\ntype TypographyDecoType = 'normal' | 'italic' | 'underline' | 'line-through';\n\ninterface StyledProps {\n\tdeco?: TypographyDecoType | TypographyDecoType[];\n\tweight?: 400 | 500 | 600 | 700;\n\tcolor?: keyof typeof palette;\n\tsize?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';\n\thighlight?: 'underline' | 'left';\n}\n\nconst Typography = <T extends ElementType = 'p'>({\n\tas,\n\tchildren,\n\tsize = 'md',\n\tweight = 400,\n\tcolor = 'grey900',\n\tdeco = 'normal',\n\thighlight,\n\tclassName = '',\n\t...props\n}: PolymorphicComponent<T, StyledProps>) => {\n\tconst Component = as || 'p';\n\n\tconst cx = classNames(\n\t\tstyles.typography,\n\t\tstyles[`typography_size_${size}`],\n\t\tstyles[`typography_weight_${weight}`],\n\t\tArray.isArray(deco)\n\t\t\t? deco.map((deco) => styles[`typography_deco_${deco}`]).join(' ')\n\t\t\t: styles[`typography_deco_${deco}`],\n\t\tstyles[`typography_color_${color}`],\n\t\tstyles[`typography_highlight_${highlight}`],\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Component className={cx} {...props}>\n\t\t\t{children}\n\t\t</Component>\n\t);\n};\n\nexport default Typography;\n","import React, { type ElementType } from 'react';\nimport type { PolymorphicComponent } from '../_types';\nimport styles from './styles.module.scss';\nimport { classNames } from '@/utils';\n\ninterface StyledProps {\n\tdirection?: 'row' | 'column';\n\tflex?: '1' | 'auto' | 'none' | 'initial';\n\tjustifyContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';\n\talignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';\n\tgap?: number;\n}\n\nconst Flex = <E extends ElementType = 'div'>({\n\tas,\n\tchildren,\n\tdirection = 'row',\n\tflex,\n\tjustifyContent,\n\talignItems,\n\tgap,\n\tclassName = '',\n\t...props\n}: PolymorphicComponent<E, StyledProps>) => {\n\tconst Component = as || 'div';\n\n\tconst classes = classNames(\n\t\tstyles.flex,\n\t\tstyles[`flex_direction_${direction}`],\n\t\tflex ? styles[`flex_${flex}`] : undefined,\n\t\tjustifyContent ? styles[`flex_justify_${justifyContent}`] : undefined,\n\t\talignItems ? styles[`flex_align_${alignItems}`] : undefined,\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={classes}\n\t\t\tstyle={gap ? { gap: `${gap / 16}rem`, ...props.style } : props.style}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Component>\n\t);\n};\n\nex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QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,IAAI,EACJ,cAAc,EACd,UAAU,EACV,GAAG,EACH,SAAS,GAAG,EAAE,EACd,GAAG,KAAK,EAC8B,KAAI;AAC1C,IAAA,MAAM,SAAS,GAAG,EAAE,IAAI,KAAK,CAAC;AAE9B,IAAA,MAAM,OAAO,GAAG,UAAU,CACzB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,CAAkB,eAAA,EAAA,SAAS,CAAE,CAAA,CAAC,EACrC,IAAI,GAAG,MAAM,CAAC,CAAA,KAAA,EAAQ,IAAI,CAAA,CAAE,CAAC,GAAG,SAAS,EACzC,cAAc,GAAG,MAAM,CAAC,CAAA,aAAA,EAAgB,cAAc,CAAA,CAAE,CAAC,GAAG,SAAS,EACrE,UAAU,GAAG,MAAM,CAAC,CAAc,WAAA,EAAA,UAAU,CAAE,CAAA,CAAC,GAAG,SAAS,EAC3D,SAAS,CACT,CAAC;AAEF,IAAA,QACCA,GAAC,CAAA,SAAS,IACT,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,CAAA,GAAA,CAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAChE,GAAA,KAAK,YAER,QAAQ,EAAA,CACE,EACX;AACH;;;;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../../src/utils/classNames/index.ts","../../src/components/Typography/index.tsx","../../src/components/Flex/index.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","const classNames = (...args: (string | undefined)[]) => {\n\treturn args.reduce((acc, className) => {\n\t\tif (className) {\n\t\t\treturn acc ? `${acc} ${className}` : className;\n\t\t}\n\t\treturn acc;\n\t}, '');\n};\n\nexport default classNames;\n","import React, { type ElementType } from 'react';\nimport { PolymorphicComponent } from '../_types';\nimport styles from './styles.module.scss';\nimport { classNames } from '@/utils';\nimport { palette } from '../_design/palette';\n\ntype TypographyDecoType = 'normal' | 'italic' | 'underline' | 'line-through';\n\ninterface StyledProps {\n\tdeco?: TypographyDecoType | TypographyDecoType[];\n\tweight?: 400 | 500 | 600 | 700;\n\tcolor?: keyof typeof palette;\n\tsize?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';\n\thighlight?: 'underline';\n}\n\nconst Typography = <T extends ElementType = 'p'>({\n\tas,\n\tchildren,\n\tsize = 'md',\n\tweight = 400,\n\tcolor = 'grey900',\n\tdeco = 'normal',\n\thighlight,\n\tclassName = '',\n\t...props\n}: PolymorphicComponent<T, StyledProps>) => {\n\tconst Component = as || 'p';\n\n\tconst cx = classNames(\n\t\tstyles.typography,\n\t\tstyles[`typography_size_${size}`],\n\t\tstyles[`typography_weight_${weight}`],\n\t\tArray.isArray(deco)\n\t\t\t? deco.map((deco) => styles[`typography_deco_${deco}`]).join(' ')\n\t\t\t: styles[`typography_deco_${deco}`],\n\t\tstyles[`typography_color_${color}`],\n\t\tstyles[`typography_highlight_${highlight}`],\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Component className={cx} {...props}>\n\t\t\t{children}\n\t\t</Component>\n\t);\n};\n\nexport default Typography;\n","import React, { type ElementType } from 'react';\nimport type { PolymorphicComponent } from '../_types';\nimport styles from './styles.module.scss';\nimport { classNames } from '@/utils';\n\ninterface StyledProps {\n\tdirection?: 'row' | 'column';\n\tflex?: '1' | 'auto' | 'none' | 'initial';\n\tjustifyContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';\n\talignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';\n\tgap?: number;\n}\n\nconst Flex = <E extends ElementType = 'div'>({\n\tas,\n\tchildren,\n\tdirection = 'row',\n\tflex,\n\tjustifyContent,\n\talignItems,\n\tgap,\n\tclassName = '',\n\t...props\n}: PolymorphicComponent<E, StyledProps>) => {\n\tconst Component = as || 'div';\n\n\tconst classes = classNames(\n\t\tstyles.flex,\n\t\tstyles[`flex_direction_${direction}`],\n\t\tflex ? styles[`flex_${flex}`] : undefined,\n\t\tjustifyContent ? styles[`flex_justify_${justifyContent}`] : undefined,\n\t\talignItems ? styles[`flex_align_${alignItems}`] : undefined,\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={classes}\n\t\t\tstyle={gap ? { gap: `${gap / 16}rem`, ...props.style } : props.style}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Component>\n\t);\n};\n\nexport default Flex;\n"],"names":["styles","_jsx"],"mappings":";;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAA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AC,GAAG,SAAS,EAC3D,SAAS,CACT,CAAC;AAEF,IAAA,QACCA,cAAC,CAAA,SAAS,IACT,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,CAAA,GAAA,CAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAChE,GAAA,KAAK,YAER,QAAQ,EAAA,CACE,EACX;AACH;;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../../src/utils/classNames/index.ts","../../src/components/Typography/index.tsx","../../src/components/Flex/index.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","const classNames = (...args: (string | undefined)[]) => {\n\treturn args.reduce((acc, className) => {\n\t\tif (className) {\n\t\t\treturn acc ? `${acc} ${className}` : className;\n\t\t}\n\t\treturn acc;\n\t}, '');\n};\n\nexport default classNames;\n","import React, { type ElementType } from 'react';\nimport { PolymorphicComponent } from '../_types';\nimport styles from './styles.module.scss';\nimport { classNames } from '@/utils';\nimport { palette } from '../_design/palette';\n\ntype TypographyDecoType = 'normal' | 'italic' | 'underline' | 'line-through';\n\ninterface StyledProps {\n\tdeco?: TypographyDecoType | TypographyDecoType[];\n\tweight?: 400 | 500 | 600 | 700;\n\tcolor?: keyof typeof palette;\n\tsize?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';\n\thighlight?: 'underline' | 'left';\n}\n\nconst Typography = <T extends ElementType = 'p'>({\n\tas,\n\tchildren,\n\tsize = 'md',\n\tweight = 400,\n\tcolor = 'grey900',\n\tdeco = 'normal',\n\thighlight,\n\tclassName = '',\n\t...props\n}: PolymorphicComponent<T, StyledProps>) => {\n\tconst Component = as || 'p';\n\n\tconst cx = classNames(\n\t\tstyles.typography,\n\t\tstyles[`typography_size_${size}`],\n\t\tstyles[`typography_weight_${weight}`],\n\t\tArray.isArray(deco)\n\t\t\t? deco.map((deco) => styles[`typography_deco_${deco}`]).join(' ')\n\t\t\t: styles[`typography_deco_${deco}`],\n\t\tstyles[`typography_color_${color}`],\n\t\tstyles[`typography_highlight_${highlight}`],\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Component className={cx} {...props}>\n\t\t\t{children}\n\t\t</Component>\n\t);\n};\n\nexport default Typography;\n","import React, { type ElementType } from 'react';\nimport type { PolymorphicComponent } from '../_types';\nimport styles from './styles.module.scss';\nimport { classNames } from '@/utils';\n\ninterface StyledProps {\n\tdirection?: 'row' | 'column';\n\tflex?: '1' | 'auto' | 'none' | 'initial';\n\tjustifyContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';\n\talignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';\n\tgap?: number;\n}\n\nconst Flex = <E extends ElementType = 'div'>({\n\tas,\n\tchildren,\n\tdirection = 'row',\n\tflex,\n\tjustifyContent,\n\talignItems,\n\tgap,\n\tclassName = '',\n\t...props\n}: PolymorphicComponent<E, StyledProps>) => {\n\tconst Component = as || 'div';\n\n\tconst classes = classNames(\n\t\tstyles.flex,\n\t\tstyles[`flex_direction_${direction}`],\n\t\tflex ? styles[`flex_${flex}`] : undefined,\n\t\tjustifyContent ? styles[`flex_justify_${justifyContent}`] : undefined,\n\t\talignItems ? styles[`flex_align_${alignItems}`] : undefined,\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={classes}\n\t\t\tstyle={gap ? { gap: `${gap / 16}rem`, ...props.style } : props.style}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Component>\n\t);\n};\n\nexport default Flex;\n"],"names":["styles","_jsx"],"mappings":";;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CA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AS,EAAE,EAAE,EAAA,GAAM,KAAK,EAAA,QAAA,EACjC,QAAQ,EAAA,CACE,EACX;AACH;;;;;;ACjCA,MAAM,IAAI,GAAG,CAAgC,EAC5C,EAAE,EACF,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,IAAI,EACJ,cAAc,EACd,UAAU,EACV,GAAG,EACH,SAAS,GAAG,EAAE,EACd,GAAG,KAAK,EAC8B,KAAI;AAC1C,IAAA,MAAM,SAAS,GAAG,EAAE,IAAI,KAAK,CAAC;AAE9B,IAAA,MAAM,OAAO,GAAG,UAAU,CACzB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,CAAkB,eAAA,EAAA,SAAS,CAAE,CAAA,CAAC,EACrC,IAAI,GAAG,MAAM,CAAC,CAAA,KAAA,EAAQ,IAAI,CAAA,CAAE,CAAC,GAAG,SAAS,EACzC,cAAc,GAAG,MAAM,CAAC,CAAA,aAAA,EAAgB,cAAc,CAAA,CAAE,CAAC,GAAG,SAAS,EACrE,UAAU,GAAG,MAAM,CAAC,CAAc,WAAA,EAAA,UAAU,CAAE,CAAA,CAAC,GAAG,SAAS,EAC3D,SAAS,CACT,CAAC;AAEF,IAAA,QACCA,cAAC,CAAA,SAAS,IACT,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,CAAA,GAAA,CAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAChE,GAAA,KAAK,YAER,QAAQ,EAAA,CACE,EACX;AACH;;;;;","x_google_ignoreList":[0]}
@@ -7,7 +7,7 @@ interface StyledProps {
7
7
  weight?: 400 | 500 | 600 | 700;
8
8
  color?: keyof typeof palette;
9
9
  size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
10
- highlight?: 'underline';
10
+ highlight?: 'underline' | 'left';
11
11
  }
12
12
  declare const Typography: <T extends React.ElementType = "p">({ as, children, size, weight, color, deco, highlight, className, ...props }: PolymorphicComponent<T, StyledProps>) => import("react/jsx-runtime").JSX.Element;
13
13
  export default Typography;
@@ -7,7 +7,7 @@ interface StyledProps {
7
7
  weight?: 400 | 500 | 600 | 700;
8
8
  color?: keyof typeof palette;
9
9
  size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
10
- highlight?: 'underline';
10
+ highlight?: 'underline' | 'left';
11
11
  }
12
12
  declare const Typography: <T extends React.ElementType = "p">({ as, children, size, weight, color, deco, highlight, className, ...props }: PolymorphicComponent<T, StyledProps>) => import("react/jsx-runtime").JSX.Element;
13
13
  export default Typography;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wonjin-dev/reacts",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "author": "wonjin-dev",
5
5
  "license": "MIT",
6
6
  "type": "module",