@wonjin-dev/reacts 1.6.0 → 1.7.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.
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.esm.js +3 -11
- package/dist/components/index.esm.js.map +1 -1
- package/dist/components/index.js +5 -13
- package/dist/components/index.js.map +1 -1
- package/dist/index-YWKd76N5.js +11 -0
- package/dist/index-YWKd76N5.js.map +1 -0
- package/dist/index-ijzhcmvM.js +13 -0
- package/dist/index-ijzhcmvM.js.map +1 -0
- package/dist/utils/index.esm.js +2 -9
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js +2 -9
- package/dist/utils/index.js.map +1 -1
- package/package.json +31 -15
- package/dist/components/components/Flex/index.d.ts +0 -11
- package/dist/components/components/Typography/index.d.ts +0 -13
- package/dist/components/components/_design/palette.d.ts +0 -11
- package/dist/components/components/_types/index.d.ts +0 -6
- package/dist/components/components/index.d.ts +0 -3
- package/dist/components/hooks/index.d.ts +0 -1
- package/dist/components/hooks/useFetch/index.d.ts +0 -7
- package/dist/components/utils/classNames/index.d.ts +0 -2
- package/dist/components/utils/classNames/index.test.d.ts +0 -1
- package/dist/components/utils/formatCareerPeriod/index.d.ts +0 -42
- package/dist/components/utils/formatCareerPeriod/index.test.d.ts +0 -1
- package/dist/components/utils/index.d.ts +0 -2
- package/dist/hooks/components/Flex/index.d.ts +0 -11
- package/dist/hooks/components/Typography/index.d.ts +0 -13
- package/dist/hooks/components/_design/palette.d.ts +0 -11
- package/dist/hooks/components/_types/index.d.ts +0 -6
- package/dist/hooks/components/index.d.ts +0 -3
- package/dist/hooks/hooks/index.d.ts +0 -1
- package/dist/hooks/hooks/useFetch/index.d.ts +0 -7
- package/dist/hooks/utils/classNames/index.d.ts +0 -2
- package/dist/hooks/utils/classNames/index.test.d.ts +0 -1
- package/dist/hooks/utils/formatCareerPeriod/index.d.ts +0 -42
- package/dist/hooks/utils/formatCareerPeriod/index.test.d.ts +0 -1
- package/dist/hooks/utils/index.d.ts +0 -2
- package/dist/utils/components/Flex/index.d.ts +0 -11
- package/dist/utils/components/Typography/index.d.ts +0 -13
- package/dist/utils/components/_design/palette.d.ts +0 -11
- package/dist/utils/components/_types/index.d.ts +0 -6
- package/dist/utils/components/index.d.ts +0 -3
- package/dist/utils/hooks/index.d.ts +0 -1
- package/dist/utils/hooks/useFetch/index.d.ts +0 -7
- package/dist/utils/utils/classNames/index.d.ts +0 -2
- package/dist/utils/utils/classNames/index.test.d.ts +0 -1
- package/dist/utils/utils/formatCareerPeriod/index.d.ts +0 -42
- package/dist/utils/utils/formatCareerPeriod/index.test.d.ts +0 -1
- package/dist/utils/utils/index.d.ts +0 -2
|
@@ -25,7 +25,7 @@ interface StyledProps$1 {
|
|
|
25
25
|
weight?: 400 | 500 | 600 | 700;
|
|
26
26
|
color?: keyof typeof palette;
|
|
27
27
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
28
|
-
highlight?: 'underline' | 'left';
|
|
28
|
+
highlight?: 'underline' | 'left' | 'callout';
|
|
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,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { c as classNames } from '../index-YWKd76N5.js';
|
|
2
3
|
|
|
3
4
|
function styleInject(css, ref) {
|
|
4
5
|
if ( ref === void 0 ) ref = {};
|
|
@@ -27,19 +28,10 @@ function styleInject(css, ref) {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
var css_248z$1 = ".styles-module__typography___uJJgf{font-family:inherit;font-size:1rem;font-style:normal;font-weight:400;line-height:1.5}.styles-module__typography_color_grey900___tH77b{color:#21252a}.styles-module__typography_color_grey800___f4wMy{color:#3b3f45}.styles-module__typography_color_grey700___GSJui{color:#737373}.styles-module__typography_color_grey600___x6U6a{color:#7f848a}.styles-module__typography_color_grey500___VffNJ{color:#878e98}.styles-module__typography_color_grey400___h8LXZ{color:#a1a6ae}.styles-module__typography_color_grey300___CrH9u{color:#bcc0c6}.styles-module__typography_color_grey200___4e7wo{color:#d8dbe0}.styles-module__typography_color_grey100___s2JGa{color:#f1f3f5}.styles-module__typography_size_xs___zHguj{font-size:.5rem}.styles-module__typography_size_sm___IXCiS{font-size:.75rem}.styles-module__typography_size_md___vBKHL{font-size:1rem}.styles-module__typography_size_lg___UE2ty{font-size:1.125rem}.styles-module__typography_size_xl___e2zNJ{font-size:1.375rem}.styles-module__typography_size_2xl___XPIIz{font-size:1.75rem}.styles-module__typography_size_3xl___6dl0M{font-size:2rem}.styles-module__typography_weight_400___LwHSh{font-weight:400}.styles-module__typography_weight_500___QwNXS{font-weight:500}.styles-module__typography_weight_600___tWEhF{font-weight:600}.styles-module__typography_weight_700___V455e{font-weight:700}.styles-module__typography_deco_normal___LdTNr{font-style:normal}.styles-module__typography_deco_italic___MXbnH{font-style:italic}.styles-module__typography_deco_underline___cVSHd{text-decoration:underline;text-decoration-skip-ink:none}.styles-module__typography_deco_line-through___BISKr{text-decoration:line-through}.styles-module__typography_highlight_underline___a-iY0{display:inline-block;position:relative;z-index:1}.styles-module__typography_highlight_underline___a-iY0:after{background-color:#ffe600;border-radius:.1375em;bottom:.125rem;content:\"\";height:.4em;left:0;opacity:.7;position:absolute;width:100%;z-index:-1}.styles-module__typography_highlight_left___3rZDb{border-left:.25rem solid #ffe600;padding:.1375rem}";
|
|
31
|
-
var styles$1 = {"typography":"styles-module__typography___uJJgf","typography_color_grey900":"styles-module__typography_color_grey900___tH77b","typography_color_grey800":"styles-module__typography_color_grey800___f4wMy","typography_color_grey700":"styles-module__typography_color_grey700___GSJui","typography_color_grey600":"styles-module__typography_color_grey600___x6U6a","typography_color_grey500":"styles-module__typography_color_grey500___VffNJ","typography_color_grey400":"styles-module__typography_color_grey400___h8LXZ","typography_color_grey300":"styles-module__typography_color_grey300___CrH9u","typography_color_grey200":"styles-module__typography_color_grey200___4e7wo","typography_color_grey100":"styles-module__typography_color_grey100___s2JGa","typography_size_xs":"styles-module__typography_size_xs___zHguj","typography_size_sm":"styles-module__typography_size_sm___IXCiS","typography_size_md":"styles-module__typography_size_md___vBKHL","typography_size_lg":"styles-module__typography_size_lg___UE2ty","typography_size_xl":"styles-module__typography_size_xl___e2zNJ","typography_size_2xl":"styles-module__typography_size_2xl___XPIIz","typography_size_3xl":"styles-module__typography_size_3xl___6dl0M","typography_weight_400":"styles-module__typography_weight_400___LwHSh","typography_weight_500":"styles-module__typography_weight_500___QwNXS","typography_weight_600":"styles-module__typography_weight_600___tWEhF","typography_weight_700":"styles-module__typography_weight_700___V455e","typography_deco_normal":"styles-module__typography_deco_normal___LdTNr","typography_deco_italic":"styles-module__typography_deco_italic___MXbnH","typography_deco_underline":"styles-module__typography_deco_underline___cVSHd","typography_deco_line-through":"styles-module__typography_deco_line-through___BISKr","typography_highlight_underline":"styles-module__typography_highlight_underline___a-iY0","typography_highlight_left":"styles-module__typography_highlight_left___3rZDb"};
|
|
31
|
+
var css_248z$1 = ".styles-module__typography___uJJgf{font-family:inherit;font-size:1rem;font-style:normal;font-weight:400;line-height:1.5}.styles-module__typography_color_grey900___tH77b{color:#21252a}.styles-module__typography_color_grey800___f4wMy{color:#3b3f45}.styles-module__typography_color_grey700___GSJui{color:#737373}.styles-module__typography_color_grey600___x6U6a{color:#7f848a}.styles-module__typography_color_grey500___VffNJ{color:#878e98}.styles-module__typography_color_grey400___h8LXZ{color:#a1a6ae}.styles-module__typography_color_grey300___CrH9u{color:#bcc0c6}.styles-module__typography_color_grey200___4e7wo{color:#d8dbe0}.styles-module__typography_color_grey100___s2JGa{color:#f1f3f5}.styles-module__typography_size_xs___zHguj{font-size:.5rem}.styles-module__typography_size_sm___IXCiS{font-size:.75rem}.styles-module__typography_size_md___vBKHL{font-size:1rem}.styles-module__typography_size_lg___UE2ty{font-size:1.125rem}.styles-module__typography_size_xl___e2zNJ{font-size:1.375rem}.styles-module__typography_size_2xl___XPIIz{font-size:1.75rem}.styles-module__typography_size_3xl___6dl0M{font-size:2rem}.styles-module__typography_weight_400___LwHSh{font-weight:400}.styles-module__typography_weight_500___QwNXS{font-weight:500}.styles-module__typography_weight_600___tWEhF{font-weight:600}.styles-module__typography_weight_700___V455e{font-weight:700}.styles-module__typography_deco_normal___LdTNr{font-style:normal}.styles-module__typography_deco_italic___MXbnH{font-style:italic}.styles-module__typography_deco_underline___cVSHd{text-decoration:underline;text-decoration-skip-ink:none}.styles-module__typography_deco_line-through___BISKr{text-decoration:line-through}.styles-module__typography_highlight_underline___a-iY0{display:inline-block;position:relative;z-index:1}.styles-module__typography_highlight_underline___a-iY0:after{background-color:#ffe600;border-radius:.1375em;bottom:.125rem;content:\"\";height:.4em;left:0;opacity:.7;position:absolute;width:100%;z-index:-1}.styles-module__typography_highlight_left___3rZDb{border-left:.25rem solid #ffe600;padding:.1375rem}.styles-module__typography_highlight_callout___64KQ8{background-color:#fffde7;border-radius:.5em;padding:1em;width:fit-content}";
|
|
32
|
+
var styles$1 = {"typography":"styles-module__typography___uJJgf","typography_color_grey900":"styles-module__typography_color_grey900___tH77b","typography_color_grey800":"styles-module__typography_color_grey800___f4wMy","typography_color_grey700":"styles-module__typography_color_grey700___GSJui","typography_color_grey600":"styles-module__typography_color_grey600___x6U6a","typography_color_grey500":"styles-module__typography_color_grey500___VffNJ","typography_color_grey400":"styles-module__typography_color_grey400___h8LXZ","typography_color_grey300":"styles-module__typography_color_grey300___CrH9u","typography_color_grey200":"styles-module__typography_color_grey200___4e7wo","typography_color_grey100":"styles-module__typography_color_grey100___s2JGa","typography_size_xs":"styles-module__typography_size_xs___zHguj","typography_size_sm":"styles-module__typography_size_sm___IXCiS","typography_size_md":"styles-module__typography_size_md___vBKHL","typography_size_lg":"styles-module__typography_size_lg___UE2ty","typography_size_xl":"styles-module__typography_size_xl___e2zNJ","typography_size_2xl":"styles-module__typography_size_2xl___XPIIz","typography_size_3xl":"styles-module__typography_size_3xl___6dl0M","typography_weight_400":"styles-module__typography_weight_400___LwHSh","typography_weight_500":"styles-module__typography_weight_500___QwNXS","typography_weight_600":"styles-module__typography_weight_600___tWEhF","typography_weight_700":"styles-module__typography_weight_700___V455e","typography_deco_normal":"styles-module__typography_deco_normal___LdTNr","typography_deco_italic":"styles-module__typography_deco_italic___MXbnH","typography_deco_underline":"styles-module__typography_deco_underline___cVSHd","typography_deco_line-through":"styles-module__typography_deco_line-through___BISKr","typography_highlight_underline":"styles-module__typography_highlight_underline___a-iY0","typography_highlight_left":"styles-module__typography_highlight_left___3rZDb","typography_highlight_callout":"styles-module__typography_highlight_callout___64KQ8"};
|
|
32
33
|
styleInject(css_248z$1);
|
|
33
34
|
|
|
34
|
-
const classNames = (...args) => {
|
|
35
|
-
return args.reduce((acc, className) => {
|
|
36
|
-
if (className) {
|
|
37
|
-
return acc ? `${acc} ${className}` : className;
|
|
38
|
-
}
|
|
39
|
-
return acc;
|
|
40
|
-
}, '');
|
|
41
|
-
};
|
|
42
|
-
|
|
43
35
|
const Typography = ({ as, children, size = 'md', weight = 400, color = 'grey900', deco = 'normal', highlight, className = '', ...props }) => {
|
|
44
36
|
const Component = as || 'p';
|
|
45
37
|
const cx = classNames(styles$1.typography, styles$1[`typography_size_${size}`], styles$1[`typography_weight_${weight}`], Array.isArray(deco)
|
|
@@ -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/
|
|
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/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","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?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';\n\thighlight?: 'underline' | 'left' | 'callout';\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,KA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;AACH;;;;","x_google_ignoreList":[0]}
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var index = require('../index-ijzhcmvM.js');
|
|
4
5
|
|
|
5
6
|
function styleInject(css, ref) {
|
|
6
7
|
if ( ref === void 0 ) ref = {};
|
|
@@ -29,22 +30,13 @@ function styleInject(css, ref) {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
var css_248z$1 = ".styles-module__typography___uJJgf{font-family:inherit;font-size:1rem;font-style:normal;font-weight:400;line-height:1.5}.styles-module__typography_color_grey900___tH77b{color:#21252a}.styles-module__typography_color_grey800___f4wMy{color:#3b3f45}.styles-module__typography_color_grey700___GSJui{color:#737373}.styles-module__typography_color_grey600___x6U6a{color:#7f848a}.styles-module__typography_color_grey500___VffNJ{color:#878e98}.styles-module__typography_color_grey400___h8LXZ{color:#a1a6ae}.styles-module__typography_color_grey300___CrH9u{color:#bcc0c6}.styles-module__typography_color_grey200___4e7wo{color:#d8dbe0}.styles-module__typography_color_grey100___s2JGa{color:#f1f3f5}.styles-module__typography_size_xs___zHguj{font-size:.5rem}.styles-module__typography_size_sm___IXCiS{font-size:.75rem}.styles-module__typography_size_md___vBKHL{font-size:1rem}.styles-module__typography_size_lg___UE2ty{font-size:1.125rem}.styles-module__typography_size_xl___e2zNJ{font-size:1.375rem}.styles-module__typography_size_2xl___XPIIz{font-size:1.75rem}.styles-module__typography_size_3xl___6dl0M{font-size:2rem}.styles-module__typography_weight_400___LwHSh{font-weight:400}.styles-module__typography_weight_500___QwNXS{font-weight:500}.styles-module__typography_weight_600___tWEhF{font-weight:600}.styles-module__typography_weight_700___V455e{font-weight:700}.styles-module__typography_deco_normal___LdTNr{font-style:normal}.styles-module__typography_deco_italic___MXbnH{font-style:italic}.styles-module__typography_deco_underline___cVSHd{text-decoration:underline;text-decoration-skip-ink:none}.styles-module__typography_deco_line-through___BISKr{text-decoration:line-through}.styles-module__typography_highlight_underline___a-iY0{display:inline-block;position:relative;z-index:1}.styles-module__typography_highlight_underline___a-iY0:after{background-color:#ffe600;border-radius:.1375em;bottom:.125rem;content:\"\";height:.4em;left:0;opacity:.7;position:absolute;width:100%;z-index:-1}.styles-module__typography_highlight_left___3rZDb{border-left:.25rem solid #ffe600;padding:.1375rem}";
|
|
33
|
-
var styles$1 = {"typography":"styles-module__typography___uJJgf","typography_color_grey900":"styles-module__typography_color_grey900___tH77b","typography_color_grey800":"styles-module__typography_color_grey800___f4wMy","typography_color_grey700":"styles-module__typography_color_grey700___GSJui","typography_color_grey600":"styles-module__typography_color_grey600___x6U6a","typography_color_grey500":"styles-module__typography_color_grey500___VffNJ","typography_color_grey400":"styles-module__typography_color_grey400___h8LXZ","typography_color_grey300":"styles-module__typography_color_grey300___CrH9u","typography_color_grey200":"styles-module__typography_color_grey200___4e7wo","typography_color_grey100":"styles-module__typography_color_grey100___s2JGa","typography_size_xs":"styles-module__typography_size_xs___zHguj","typography_size_sm":"styles-module__typography_size_sm___IXCiS","typography_size_md":"styles-module__typography_size_md___vBKHL","typography_size_lg":"styles-module__typography_size_lg___UE2ty","typography_size_xl":"styles-module__typography_size_xl___e2zNJ","typography_size_2xl":"styles-module__typography_size_2xl___XPIIz","typography_size_3xl":"styles-module__typography_size_3xl___6dl0M","typography_weight_400":"styles-module__typography_weight_400___LwHSh","typography_weight_500":"styles-module__typography_weight_500___QwNXS","typography_weight_600":"styles-module__typography_weight_600___tWEhF","typography_weight_700":"styles-module__typography_weight_700___V455e","typography_deco_normal":"styles-module__typography_deco_normal___LdTNr","typography_deco_italic":"styles-module__typography_deco_italic___MXbnH","typography_deco_underline":"styles-module__typography_deco_underline___cVSHd","typography_deco_line-through":"styles-module__typography_deco_line-through___BISKr","typography_highlight_underline":"styles-module__typography_highlight_underline___a-iY0","typography_highlight_left":"styles-module__typography_highlight_left___3rZDb"};
|
|
33
|
+
var css_248z$1 = ".styles-module__typography___uJJgf{font-family:inherit;font-size:1rem;font-style:normal;font-weight:400;line-height:1.5}.styles-module__typography_color_grey900___tH77b{color:#21252a}.styles-module__typography_color_grey800___f4wMy{color:#3b3f45}.styles-module__typography_color_grey700___GSJui{color:#737373}.styles-module__typography_color_grey600___x6U6a{color:#7f848a}.styles-module__typography_color_grey500___VffNJ{color:#878e98}.styles-module__typography_color_grey400___h8LXZ{color:#a1a6ae}.styles-module__typography_color_grey300___CrH9u{color:#bcc0c6}.styles-module__typography_color_grey200___4e7wo{color:#d8dbe0}.styles-module__typography_color_grey100___s2JGa{color:#f1f3f5}.styles-module__typography_size_xs___zHguj{font-size:.5rem}.styles-module__typography_size_sm___IXCiS{font-size:.75rem}.styles-module__typography_size_md___vBKHL{font-size:1rem}.styles-module__typography_size_lg___UE2ty{font-size:1.125rem}.styles-module__typography_size_xl___e2zNJ{font-size:1.375rem}.styles-module__typography_size_2xl___XPIIz{font-size:1.75rem}.styles-module__typography_size_3xl___6dl0M{font-size:2rem}.styles-module__typography_weight_400___LwHSh{font-weight:400}.styles-module__typography_weight_500___QwNXS{font-weight:500}.styles-module__typography_weight_600___tWEhF{font-weight:600}.styles-module__typography_weight_700___V455e{font-weight:700}.styles-module__typography_deco_normal___LdTNr{font-style:normal}.styles-module__typography_deco_italic___MXbnH{font-style:italic}.styles-module__typography_deco_underline___cVSHd{text-decoration:underline;text-decoration-skip-ink:none}.styles-module__typography_deco_line-through___BISKr{text-decoration:line-through}.styles-module__typography_highlight_underline___a-iY0{display:inline-block;position:relative;z-index:1}.styles-module__typography_highlight_underline___a-iY0:after{background-color:#ffe600;border-radius:.1375em;bottom:.125rem;content:\"\";height:.4em;left:0;opacity:.7;position:absolute;width:100%;z-index:-1}.styles-module__typography_highlight_left___3rZDb{border-left:.25rem solid #ffe600;padding:.1375rem}.styles-module__typography_highlight_callout___64KQ8{background-color:#fffde7;border-radius:.5em;padding:1em;width:fit-content}";
|
|
34
|
+
var styles$1 = {"typography":"styles-module__typography___uJJgf","typography_color_grey900":"styles-module__typography_color_grey900___tH77b","typography_color_grey800":"styles-module__typography_color_grey800___f4wMy","typography_color_grey700":"styles-module__typography_color_grey700___GSJui","typography_color_grey600":"styles-module__typography_color_grey600___x6U6a","typography_color_grey500":"styles-module__typography_color_grey500___VffNJ","typography_color_grey400":"styles-module__typography_color_grey400___h8LXZ","typography_color_grey300":"styles-module__typography_color_grey300___CrH9u","typography_color_grey200":"styles-module__typography_color_grey200___4e7wo","typography_color_grey100":"styles-module__typography_color_grey100___s2JGa","typography_size_xs":"styles-module__typography_size_xs___zHguj","typography_size_sm":"styles-module__typography_size_sm___IXCiS","typography_size_md":"styles-module__typography_size_md___vBKHL","typography_size_lg":"styles-module__typography_size_lg___UE2ty","typography_size_xl":"styles-module__typography_size_xl___e2zNJ","typography_size_2xl":"styles-module__typography_size_2xl___XPIIz","typography_size_3xl":"styles-module__typography_size_3xl___6dl0M","typography_weight_400":"styles-module__typography_weight_400___LwHSh","typography_weight_500":"styles-module__typography_weight_500___QwNXS","typography_weight_600":"styles-module__typography_weight_600___tWEhF","typography_weight_700":"styles-module__typography_weight_700___V455e","typography_deco_normal":"styles-module__typography_deco_normal___LdTNr","typography_deco_italic":"styles-module__typography_deco_italic___MXbnH","typography_deco_underline":"styles-module__typography_deco_underline___cVSHd","typography_deco_line-through":"styles-module__typography_deco_line-through___BISKr","typography_highlight_underline":"styles-module__typography_highlight_underline___a-iY0","typography_highlight_left":"styles-module__typography_highlight_left___3rZDb","typography_highlight_callout":"styles-module__typography_highlight_callout___64KQ8"};
|
|
34
35
|
styleInject(css_248z$1);
|
|
35
36
|
|
|
36
|
-
const classNames = (...args) => {
|
|
37
|
-
return args.reduce((acc, className) => {
|
|
38
|
-
if (className) {
|
|
39
|
-
return acc ? `${acc} ${className}` : className;
|
|
40
|
-
}
|
|
41
|
-
return acc;
|
|
42
|
-
}, '');
|
|
43
|
-
};
|
|
44
|
-
|
|
45
37
|
const Typography = ({ as, children, size = 'md', weight = 400, color = 'grey900', deco = 'normal', highlight, className = '', ...props }) => {
|
|
46
38
|
const Component = as || 'p';
|
|
47
|
-
const cx = classNames(styles$1.typography, styles$1[`typography_size_${size}`], styles$1[`typography_weight_${weight}`], Array.isArray(deco)
|
|
39
|
+
const cx = index.classNames(styles$1.typography, styles$1[`typography_size_${size}`], styles$1[`typography_weight_${weight}`], Array.isArray(deco)
|
|
48
40
|
? deco.map((deco) => styles$1[`typography_deco_${deco}`]).join(' ')
|
|
49
41
|
: styles$1[`typography_deco_${deco}`], styles$1[`typography_color_${color}`], styles$1[`typography_highlight_${highlight}`], className);
|
|
50
42
|
return (jsxRuntime.jsx(Component, { className: cx, ...props, children: children }));
|
|
@@ -56,7 +48,7 @@ styleInject(css_248z);
|
|
|
56
48
|
|
|
57
49
|
const Flex = ({ as, children, direction = 'row', flex, justifyContent, alignItems, gap, className = '', ...props }) => {
|
|
58
50
|
const Component = as || 'div';
|
|
59
|
-
const classes = classNames(styles.flex, styles[`flex_direction_${direction}`], flex ? styles[`flex_${flex}`] : undefined, justifyContent ? styles[`flex_justify_${justifyContent}`] : undefined, alignItems ? styles[`flex_align_${alignItems}`] : undefined, className);
|
|
51
|
+
const classes = index.classNames(styles.flex, styles[`flex_direction_${direction}`], flex ? styles[`flex_${flex}`] : undefined, justifyContent ? styles[`flex_justify_${justifyContent}`] : undefined, alignItems ? styles[`flex_align_${alignItems}`] : undefined, className);
|
|
60
52
|
return (jsxRuntime.jsx(Component, { className: classes, style: gap ? { gap: `${gap / 16}rem`, ...props.style } : props.style, ...props, children: children }));
|
|
61
53
|
};
|
|
62
54
|
|
|
@@ -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/
|
|
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/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","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?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';\n\thighlight?: 'underline' | 'left' | 'callout';\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":["classNames","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;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,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAChE,GAAA,KAAK,YAER,QAAQ,EAAA,CACE,EACX;AACH;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-YWKd76N5.js","sources":["../src/utils/classNames/index.ts"],"sourcesContent":["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"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAC,GAAG,IAA4B,KAAI;IACtD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,SAAS,KAAI;QACrC,IAAI,SAAS,EAAE;AACd,YAAA,OAAO,GAAG,GAAG,CAAG,EAAA,GAAG,CAAI,CAAA,EAAA,SAAS,CAAE,CAAA,GAAG,SAAS,CAAC;SAC/C;AACD,QAAA,OAAO,GAAG,CAAC;KACX,EAAE,EAAE,CAAC,CAAC;AACR;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const classNames = (...args) => {
|
|
4
|
+
return args.reduce((acc, className) => {
|
|
5
|
+
if (className) {
|
|
6
|
+
return acc ? `${acc} ${className}` : className;
|
|
7
|
+
}
|
|
8
|
+
return acc;
|
|
9
|
+
}, '');
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.classNames = classNames;
|
|
13
|
+
//# sourceMappingURL=index-ijzhcmvM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-ijzhcmvM.js","sources":["../src/utils/classNames/index.ts"],"sourcesContent":["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"],"names":[],"mappings":";;AAAA,MAAM,UAAU,GAAG,CAAC,GAAG,IAA4B,KAAI;IACtD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,SAAS,KAAI;QACrC,IAAI,SAAS,EAAE;AACd,YAAA,OAAO,GAAG,GAAG,CAAG,EAAA,GAAG,CAAI,CAAA,EAAA,SAAS,CAAE,CAAA,GAAG,SAAS,CAAC;SAC/C;AACD,QAAA,OAAO,GAAG,CAAC;KACX,EAAE,EAAE,CAAC,CAAC;AACR;;;;"}
|
package/dist/utils/index.esm.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
return args.reduce((acc, className) => {
|
|
3
|
-
if (className) {
|
|
4
|
-
return acc ? `${acc} ${className}` : className;
|
|
5
|
-
}
|
|
6
|
-
return acc;
|
|
7
|
-
}, '');
|
|
8
|
-
};
|
|
1
|
+
export { c as classNames } from '../index-YWKd76N5.js';
|
|
9
2
|
|
|
10
3
|
/**
|
|
11
4
|
* Formats the career duration between two dates into a readable string.
|
|
@@ -77,5 +70,5 @@ const formatCareerPeriod = ({ startAt, endAt, showDuration = true, lng = 'ko', }
|
|
|
77
70
|
return `${startText} ~ ${endText}${durationSuffix}`;
|
|
78
71
|
};
|
|
79
72
|
|
|
80
|
-
export {
|
|
73
|
+
export { formatCareerPeriod };
|
|
81
74
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../src/utils/
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../src/utils/formatCareerPeriod/index.ts"],"sourcesContent":["type SupportedLang = 'ko' | 'en';\n\n/**\n * Formats the career duration between two dates into a readable string.\n * It handles internationalization (Korean/English) and the \"Present\" status for ongoing roles.\n *\n * @param props - The configuration object.\n * @param props.startAt - The start date of the period.\n * @param props.endAt - The end date. If undefined, it defaults to the current date (calculates duration up to now) and displays \"Present\" or \"현재\".\n * @param props.showDuration - Whether to append the calculated duration (e.g., \"(2y 6m)\"). Defaults to true.\n * @param props.lng - Language code ('ko' | 'en'). Defaults to 'ko'.\n * @returns A formatted string: \"YYYY.MM ~ YYYY.MM (Duration)\" or \"YYYY.MM ~ Present (Duration)\".\n *\n * @example\n * // 1. Ongoing role (Korean default)\n * // Current date: 2024-02\n * formatCareerPeriod({ startAt: new Date('2023-01-01') });\n * // Output: \"2023.01 ~ 현재 (1년 2개월)\"\n *\n * @example\n * // 2. Completed role with duration (English)\n * formatCareerPeriod({\n * startAt: new Date('2020-01-01'),\n * endAt: new Date('2022-06-01'),\n * lng: 'en'\n * });\n * // Output: \"2020.01 ~ 2022.06 (2y 6m)\"\n *\n * @example\n * // 3. Hide duration\n * formatCareerPeriod({\n * startAt: new Date('2020-01-01'),\n * endAt: new Date('2020-05-01'),\n * showDuration: false\n * });\n * // Output: \"2020.01 ~ 2020.05\"\n */\nconst formatCareerPeriod = ({\n\tstartAt,\n\tendAt,\n\tshowDuration = true,\n\tlng = 'ko',\n}: {\n\tstartAt: Date;\n\tendAt?: Date;\n\tshowDuration?: boolean;\n\tlng?: string;\n}): string => {\n\tconst lang: SupportedLang = lng === 'en' ? 'en' : 'ko';\n\n\tconst LABELS = {\n\t\tcurrent: { ko: '현재', en: 'Present' },\n\t\tyear: { ko: '년', en: 'y' },\n\t\tmonth: { ko: '개월', en: 'm' },\n\t} as const;\n\n\tconst formatYearMonth = (d: Date) => {\n\t\tconst year = d.getFullYear();\n\t\tconst month = String(d.getMonth() + 1).padStart(2, '0');\n\t\treturn `${year}.${month}`;\n\t};\n\n\tconst endDate = endAt || new Date();\n\n\tconst startText = formatYearMonth(startAt);\n\tconst endText = endAt ? formatYearMonth(endAt) : LABELS.current[lang];\n\n\tif (!showDuration) {\n\t\treturn `${startText} ~ ${endText}`;\n\t}\n\n\tconst totalMonths =\n\t\t(endDate.getFullYear() - startAt.getFullYear()) * 12 +\n\t\t(endDate.getMonth() - startAt.getMonth()) +\n\t\t1;\n\n\tif (totalMonths < 1) {\n\t\treturn `${startText} ~ ${endText}`;\n\t}\n\n\tconst years = Math.floor(totalMonths / 12);\n\tconst months = totalMonths % 12;\n\n\tconst durationParts = [\n\t\tyears > 0 ? `${years}${LABELS.year[lang]}` : null,\n\t\tmonths > 0 ? `${months}${LABELS.month[lang]}` : null,\n\t].filter(Boolean);\n\n\tconst durationString = durationParts.join(' ');\n\tconst durationSuffix = durationString ? ` (${durationString})` : '';\n\n\treturn `${startText} ~ ${endText}${durationSuffix}`;\n};\n\nexport default formatCareerPeriod;\n"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,MAAM,kBAAkB,GAAG,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,YAAY,GAAG,IAAI,EACnB,GAAG,GAAG,IAAI,GAMV,KAAY;AACZ,IAAA,MAAM,IAAI,GAAkB,GAAG,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvD,IAAA,MAAM,MAAM,GAAG;QACd,OAAO,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE;QACpC,IAAI,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE;QAC1B,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE;KACnB,CAAC;AAEX,IAAA,MAAM,eAAe,GAAG,CAAC,CAAO,KAAI;AACnC,QAAA,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7B,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACxD,QAAA,OAAO,CAAG,EAAA,IAAI,CAAI,CAAA,EAAA,KAAK,EAAE,CAAC;AAC3B,KAAC,CAAC;AAEF,IA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EAAA,cAAc,CAAG,CAAA,CAAA,GAAG,EAAE,CAAC;AAEpE,IAAA,OAAO,GAAG,SAAS,CAAA,GAAA,EAAM,OAAO,CAAG,EAAA,cAAc,EAAE,CAAC;AACrD;;;;"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
return args.reduce((acc, className) => {
|
|
5
|
-
if (className) {
|
|
6
|
-
return acc ? `${acc} ${className}` : className;
|
|
7
|
-
}
|
|
8
|
-
return acc;
|
|
9
|
-
}, '');
|
|
10
|
-
};
|
|
3
|
+
var index = require('../index-ijzhcmvM.js');
|
|
11
4
|
|
|
12
5
|
/**
|
|
13
6
|
* Formats the career duration between two dates into a readable string.
|
|
@@ -79,6 +72,6 @@ const formatCareerPeriod = ({ startAt, endAt, showDuration = true, lng = 'ko', }
|
|
|
79
72
|
return `${startText} ~ ${endText}${durationSuffix}`;
|
|
80
73
|
};
|
|
81
74
|
|
|
82
|
-
exports.classNames = classNames;
|
|
75
|
+
exports.classNames = index.classNames;
|
|
83
76
|
exports.formatCareerPeriod = formatCareerPeriod;
|
|
84
77
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/formatCareerPeriod/index.ts"],"sourcesContent":["type SupportedLang = 'ko' | 'en';\n\n/**\n * Formats the career duration between two dates into a readable string.\n * It handles internationalization (Korean/English) and the \"Present\" status for ongoing roles.\n *\n * @param props - The configuration object.\n * @param props.startAt - The start date of the period.\n * @param props.endAt - The end date. If undefined, it defaults to the current date (calculates duration up to now) and displays \"Present\" or \"현재\".\n * @param props.showDuration - Whether to append the calculated duration (e.g., \"(2y 6m)\"). Defaults to true.\n * @param props.lng - Language code ('ko' | 'en'). Defaults to 'ko'.\n * @returns A formatted string: \"YYYY.MM ~ YYYY.MM (Duration)\" or \"YYYY.MM ~ Present (Duration)\".\n *\n * @example\n * // 1. Ongoing role (Korean default)\n * // Current date: 2024-02\n * formatCareerPeriod({ startAt: new Date('2023-01-01') });\n * // Output: \"2023.01 ~ 현재 (1년 2개월)\"\n *\n * @example\n * // 2. Completed role with duration (English)\n * formatCareerPeriod({\n * startAt: new Date('2020-01-01'),\n * endAt: new Date('2022-06-01'),\n * lng: 'en'\n * });\n * // Output: \"2020.01 ~ 2022.06 (2y 6m)\"\n *\n * @example\n * // 3. Hide duration\n * formatCareerPeriod({\n * startAt: new Date('2020-01-01'),\n * endAt: new Date('2020-05-01'),\n * showDuration: false\n * });\n * // Output: \"2020.01 ~ 2020.05\"\n */\nconst formatCareerPeriod = ({\n\tstartAt,\n\tendAt,\n\tshowDuration = true,\n\tlng = 'ko',\n}: {\n\tstartAt: Date;\n\tendAt?: Date;\n\tshowDuration?: boolean;\n\tlng?: string;\n}): string => {\n\tconst lang: SupportedLang = lng === 'en' ? 'en' : 'ko';\n\n\tconst LABELS = {\n\t\tcurrent: { ko: '현재', en: 'Present' },\n\t\tyear: { ko: '년', en: 'y' },\n\t\tmonth: { ko: '개월', en: 'm' },\n\t} as const;\n\n\tconst formatYearMonth = (d: Date) => {\n\t\tconst year = d.getFullYear();\n\t\tconst month = String(d.getMonth() + 1).padStart(2, '0');\n\t\treturn `${year}.${month}`;\n\t};\n\n\tconst endDate = endAt || new Date();\n\n\tconst startText = formatYearMonth(startAt);\n\tconst endText = endAt ? formatYearMonth(endAt) : LABELS.current[lang];\n\n\tif (!showDuration) {\n\t\treturn `${startText} ~ ${endText}`;\n\t}\n\n\tconst totalMonths =\n\t\t(endDate.getFullYear() - startAt.getFullYear()) * 12 +\n\t\t(endDate.getMonth() - startAt.getMonth()) +\n\t\t1;\n\n\tif (totalMonths < 1) {\n\t\treturn `${startText} ~ ${endText}`;\n\t}\n\n\tconst years = Math.floor(totalMonths / 12);\n\tconst months = totalMonths % 12;\n\n\tconst durationParts = [\n\t\tyears > 0 ? `${years}${LABELS.year[lang]}` : null,\n\t\tmonths > 0 ? `${months}${LABELS.month[lang]}` : null,\n\t].filter(Boolean);\n\n\tconst durationString = durationParts.join(' ');\n\tconst durationSuffix = durationString ? ` (${durationString})` : '';\n\n\treturn `${startText} ~ ${endText}${durationSuffix}`;\n};\n\nexport default formatCareerPeriod;\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,MAAM,kBAAkB,GAAG,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,YAAY,GAAG,IAAI,EACnB,GAAG,GAAG,IAAI,GAMV,KAAY;AACZ,IAAA,MAAM,IAAI,GAAkB,GAAG,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvD,IAAA,MAAM,MAAM,GAAG;QACd,OAAO,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE;QACpC,IAAI,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE;QAC1B,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE;KACnB,CAAC;AAEX,IAAA,MAAM,eAAe,GAAG,CAAC,CAAO,KAAI;AACnC,QAAA,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7B,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACxD,QAAA,OAAO,CAAG,EAAA,IAAI,CAAI,CAAA,EAAA,KAAK,EAAE,CAAC;AAC3B,KAAC,CAAC;AAEF,IAAA,MAAM,OAAO,GAAG,KAAK,IAAI,IAAI,IAAI,EAAE,CAAC;AAEpC,IAAA,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AA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EAAE,CAAC;AACrD;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wonjin-dev/reacts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"author": "wonjin-dev",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,9 +13,23 @@
|
|
|
13
13
|
"@rollup/plugin-commonjs": "25.0.7",
|
|
14
14
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
15
15
|
"@rollup/plugin-typescript": "11.1.6",
|
|
16
|
+
"@storybook/addon-essentials": "8.6.14",
|
|
17
|
+
"@storybook/addon-interactions": "8.6.14",
|
|
18
|
+
"@storybook/addon-links": "10.2.8",
|
|
19
|
+
"@storybook/addon-mdx-gfm": "8.6.14",
|
|
20
|
+
"@storybook/addon-styling": "1.3.7",
|
|
21
|
+
"@storybook/blocks": "8.6.14",
|
|
22
|
+
"@storybook/jest": "0.2.3",
|
|
23
|
+
"@storybook/manager-api": "8.6.14",
|
|
24
|
+
"@storybook/preset-scss": "1.0.3",
|
|
25
|
+
"@storybook/react": "10.2.8",
|
|
26
|
+
"@storybook/react-vite": "10.2.8",
|
|
27
|
+
"@storybook/test": "8.6.15",
|
|
28
|
+
"@storybook/testing-library": "0.2.2",
|
|
29
|
+
"@storybook/theming": "8.6.14",
|
|
16
30
|
"@types/jest": "30.0.0",
|
|
17
|
-
"@types/react": "
|
|
18
|
-
"@types/react-dom": "
|
|
31
|
+
"@types/react": "19.0.0",
|
|
32
|
+
"@types/react-dom": "19.0.0",
|
|
19
33
|
"jest": "30.1.1",
|
|
20
34
|
"postcss-modules": "6.0.1",
|
|
21
35
|
"rollup": "4.9.1",
|
|
@@ -24,29 +38,29 @@
|
|
|
24
38
|
"rollup-plugin-postcss": "4.0.2",
|
|
25
39
|
"rollup-plugin-scss": "4.0.0",
|
|
26
40
|
"sass": "1.70.0",
|
|
41
|
+
"storybook": "10.2.8",
|
|
27
42
|
"ts-jest": "29.4.1",
|
|
28
43
|
"tslib": "2.6.2",
|
|
29
|
-
"typescript": "5.3.3"
|
|
44
|
+
"typescript": "5.3.3",
|
|
45
|
+
"vite": "7.3.1",
|
|
46
|
+
"vite-tsconfig-paths": "6.1.1",
|
|
47
|
+
"vite-plugin-dts": "4.5.4"
|
|
30
48
|
},
|
|
31
49
|
"exports": {
|
|
32
50
|
"./components": {
|
|
51
|
+
"types": "./dist/components/index.d.ts",
|
|
33
52
|
"import": "./dist/components/index.esm.js",
|
|
34
|
-
"require": "./dist/components/index.js"
|
|
35
|
-
"types": "./dist/components/index.d.ts"
|
|
36
|
-
},
|
|
37
|
-
"./components/styles": {
|
|
38
|
-
"import": "./dist/components/index.css",
|
|
39
|
-
"require": "./dist/components/index.css"
|
|
53
|
+
"require": "./dist/components/index.js"
|
|
40
54
|
},
|
|
41
55
|
"./hooks": {
|
|
56
|
+
"types": "./dist/hooks/index.d.ts",
|
|
42
57
|
"import": "./dist/hooks/index.esm.js",
|
|
43
|
-
"require": "./dist/hooks/index.js"
|
|
44
|
-
"types": "./dist/hooks/index.d.ts"
|
|
58
|
+
"require": "./dist/hooks/index.js"
|
|
45
59
|
},
|
|
46
60
|
"./utils": {
|
|
61
|
+
"types": "./dist/utils/index.d.ts",
|
|
47
62
|
"import": "./dist/utils/index.esm.js",
|
|
48
|
-
"require": "./dist/utils/index.js"
|
|
49
|
-
"types": "./dist/utils/index.d.ts"
|
|
63
|
+
"require": "./dist/utils/index.js"
|
|
50
64
|
}
|
|
51
65
|
},
|
|
52
66
|
"files": [
|
|
@@ -57,6 +71,8 @@
|
|
|
57
71
|
"dev": "rollup -c -w",
|
|
58
72
|
"clean": "rm -rf dist",
|
|
59
73
|
"test": "jest",
|
|
60
|
-
"deploy": "pnpm run prepublishOnly && pnpm publish --access public"
|
|
74
|
+
"deploy": "pnpm run prepublishOnly && pnpm publish --access public",
|
|
75
|
+
"storybook": "storybook dev -p 6006",
|
|
76
|
+
"build-storybook": "storybook build"
|
|
61
77
|
}
|
|
62
78
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PolymorphicComponent } from '../_types';
|
|
3
|
-
interface StyledProps {
|
|
4
|
-
direction?: 'row' | 'column';
|
|
5
|
-
flex?: '1' | 'auto' | 'none' | 'initial';
|
|
6
|
-
justifyContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
7
|
-
alignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
8
|
-
gap?: number;
|
|
9
|
-
}
|
|
10
|
-
declare const Flex: <E extends React.ElementType = "div">({ as, children, direction, flex, justifyContent, alignItems, gap, className, ...props }: PolymorphicComponent<E, StyledProps>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default Flex;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PolymorphicComponent } from '../_types';
|
|
3
|
-
import { palette } from '../_design/palette';
|
|
4
|
-
type TypographyDecoType = 'normal' | 'italic' | 'underline' | 'line-through';
|
|
5
|
-
interface StyledProps {
|
|
6
|
-
deco?: TypographyDecoType | TypographyDecoType[];
|
|
7
|
-
weight?: 400 | 500 | 600 | 700;
|
|
8
|
-
color?: keyof typeof palette;
|
|
9
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
10
|
-
highlight?: 'underline' | 'left';
|
|
11
|
-
}
|
|
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
|
-
export default Typography;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useFetch } from './useFetch';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formats the career duration between two dates into a readable string.
|
|
3
|
-
* It handles internationalization (Korean/English) and the "Present" status for ongoing roles.
|
|
4
|
-
*
|
|
5
|
-
* @param props - The configuration object.
|
|
6
|
-
* @param props.startAt - The start date of the period.
|
|
7
|
-
* @param props.endAt - The end date. If undefined, it defaults to the current date (calculates duration up to now) and displays "Present" or "현재".
|
|
8
|
-
* @param props.showDuration - Whether to append the calculated duration (e.g., "(2y 6m)"). Defaults to true.
|
|
9
|
-
* @param props.lng - Language code ('ko' | 'en'). Defaults to 'ko'.
|
|
10
|
-
* @returns A formatted string: "YYYY.MM ~ YYYY.MM (Duration)" or "YYYY.MM ~ Present (Duration)".
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* // 1. Ongoing role (Korean default)
|
|
14
|
-
* // Current date: 2024-02
|
|
15
|
-
* formatCareerPeriod({ startAt: new Date('2023-01-01') });
|
|
16
|
-
* // Output: "2023.01 ~ 현재 (1년 2개월)"
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // 2. Completed role with duration (English)
|
|
20
|
-
* formatCareerPeriod({
|
|
21
|
-
* startAt: new Date('2020-01-01'),
|
|
22
|
-
* endAt: new Date('2022-06-01'),
|
|
23
|
-
* lng: 'en'
|
|
24
|
-
* });
|
|
25
|
-
* // Output: "2020.01 ~ 2022.06 (2y 6m)"
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* // 3. Hide duration
|
|
29
|
-
* formatCareerPeriod({
|
|
30
|
-
* startAt: new Date('2020-01-01'),
|
|
31
|
-
* endAt: new Date('2020-05-01'),
|
|
32
|
-
* showDuration: false
|
|
33
|
-
* });
|
|
34
|
-
* // Output: "2020.01 ~ 2020.05"
|
|
35
|
-
*/
|
|
36
|
-
declare const formatCareerPeriod: ({ startAt, endAt, showDuration, lng, }: {
|
|
37
|
-
startAt: Date;
|
|
38
|
-
endAt?: Date | undefined;
|
|
39
|
-
showDuration?: boolean | undefined;
|
|
40
|
-
lng?: string | undefined;
|
|
41
|
-
}) => string;
|
|
42
|
-
export default formatCareerPeriod;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PolymorphicComponent } from '../_types';
|
|
3
|
-
interface StyledProps {
|
|
4
|
-
direction?: 'row' | 'column';
|
|
5
|
-
flex?: '1' | 'auto' | 'none' | 'initial';
|
|
6
|
-
justifyContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
7
|
-
alignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
8
|
-
gap?: number;
|
|
9
|
-
}
|
|
10
|
-
declare const Flex: <E extends React.ElementType = "div">({ as, children, direction, flex, justifyContent, alignItems, gap, className, ...props }: PolymorphicComponent<E, StyledProps>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default Flex;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PolymorphicComponent } from '../_types';
|
|
3
|
-
import { palette } from '../_design/palette';
|
|
4
|
-
type TypographyDecoType = 'normal' | 'italic' | 'underline' | 'line-through';
|
|
5
|
-
interface StyledProps {
|
|
6
|
-
deco?: TypographyDecoType | TypographyDecoType[];
|
|
7
|
-
weight?: 400 | 500 | 600 | 700;
|
|
8
|
-
color?: keyof typeof palette;
|
|
9
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
10
|
-
highlight?: 'underline' | 'left';
|
|
11
|
-
}
|
|
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
|
-
export default Typography;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useFetch } from './useFetch';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formats the career duration between two dates into a readable string.
|
|
3
|
-
* It handles internationalization (Korean/English) and the "Present" status for ongoing roles.
|
|
4
|
-
*
|
|
5
|
-
* @param props - The configuration object.
|
|
6
|
-
* @param props.startAt - The start date of the period.
|
|
7
|
-
* @param props.endAt - The end date. If undefined, it defaults to the current date (calculates duration up to now) and displays "Present" or "현재".
|
|
8
|
-
* @param props.showDuration - Whether to append the calculated duration (e.g., "(2y 6m)"). Defaults to true.
|
|
9
|
-
* @param props.lng - Language code ('ko' | 'en'). Defaults to 'ko'.
|
|
10
|
-
* @returns A formatted string: "YYYY.MM ~ YYYY.MM (Duration)" or "YYYY.MM ~ Present (Duration)".
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* // 1. Ongoing role (Korean default)
|
|
14
|
-
* // Current date: 2024-02
|
|
15
|
-
* formatCareerPeriod({ startAt: new Date('2023-01-01') });
|
|
16
|
-
* // Output: "2023.01 ~ 현재 (1년 2개월)"
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // 2. Completed role with duration (English)
|
|
20
|
-
* formatCareerPeriod({
|
|
21
|
-
* startAt: new Date('2020-01-01'),
|
|
22
|
-
* endAt: new Date('2022-06-01'),
|
|
23
|
-
* lng: 'en'
|
|
24
|
-
* });
|
|
25
|
-
* // Output: "2020.01 ~ 2022.06 (2y 6m)"
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* // 3. Hide duration
|
|
29
|
-
* formatCareerPeriod({
|
|
30
|
-
* startAt: new Date('2020-01-01'),
|
|
31
|
-
* endAt: new Date('2020-05-01'),
|
|
32
|
-
* showDuration: false
|
|
33
|
-
* });
|
|
34
|
-
* // Output: "2020.01 ~ 2020.05"
|
|
35
|
-
*/
|
|
36
|
-
declare const formatCareerPeriod: ({ startAt, endAt, showDuration, lng, }: {
|
|
37
|
-
startAt: Date;
|
|
38
|
-
endAt?: Date | undefined;
|
|
39
|
-
showDuration?: boolean | undefined;
|
|
40
|
-
lng?: string | undefined;
|
|
41
|
-
}) => string;
|
|
42
|
-
export default formatCareerPeriod;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PolymorphicComponent } from '../_types';
|
|
3
|
-
interface StyledProps {
|
|
4
|
-
direction?: 'row' | 'column';
|
|
5
|
-
flex?: '1' | 'auto' | 'none' | 'initial';
|
|
6
|
-
justifyContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
7
|
-
alignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
8
|
-
gap?: number;
|
|
9
|
-
}
|
|
10
|
-
declare const Flex: <E extends React.ElementType = "div">({ as, children, direction, flex, justifyContent, alignItems, gap, className, ...props }: PolymorphicComponent<E, StyledProps>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default Flex;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PolymorphicComponent } from '../_types';
|
|
3
|
-
import { palette } from '../_design/palette';
|
|
4
|
-
type TypographyDecoType = 'normal' | 'italic' | 'underline' | 'line-through';
|
|
5
|
-
interface StyledProps {
|
|
6
|
-
deco?: TypographyDecoType | TypographyDecoType[];
|
|
7
|
-
weight?: 400 | 500 | 600 | 700;
|
|
8
|
-
color?: keyof typeof palette;
|
|
9
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
10
|
-
highlight?: 'underline' | 'left';
|
|
11
|
-
}
|
|
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
|
-
export default Typography;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useFetch } from './useFetch';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formats the career duration between two dates into a readable string.
|
|
3
|
-
* It handles internationalization (Korean/English) and the "Present" status for ongoing roles.
|
|
4
|
-
*
|
|
5
|
-
* @param props - The configuration object.
|
|
6
|
-
* @param props.startAt - The start date of the period.
|
|
7
|
-
* @param props.endAt - The end date. If undefined, it defaults to the current date (calculates duration up to now) and displays "Present" or "현재".
|
|
8
|
-
* @param props.showDuration - Whether to append the calculated duration (e.g., "(2y 6m)"). Defaults to true.
|
|
9
|
-
* @param props.lng - Language code ('ko' | 'en'). Defaults to 'ko'.
|
|
10
|
-
* @returns A formatted string: "YYYY.MM ~ YYYY.MM (Duration)" or "YYYY.MM ~ Present (Duration)".
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* // 1. Ongoing role (Korean default)
|
|
14
|
-
* // Current date: 2024-02
|
|
15
|
-
* formatCareerPeriod({ startAt: new Date('2023-01-01') });
|
|
16
|
-
* // Output: "2023.01 ~ 현재 (1년 2개월)"
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // 2. Completed role with duration (English)
|
|
20
|
-
* formatCareerPeriod({
|
|
21
|
-
* startAt: new Date('2020-01-01'),
|
|
22
|
-
* endAt: new Date('2022-06-01'),
|
|
23
|
-
* lng: 'en'
|
|
24
|
-
* });
|
|
25
|
-
* // Output: "2020.01 ~ 2022.06 (2y 6m)"
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* // 3. Hide duration
|
|
29
|
-
* formatCareerPeriod({
|
|
30
|
-
* startAt: new Date('2020-01-01'),
|
|
31
|
-
* endAt: new Date('2020-05-01'),
|
|
32
|
-
* showDuration: false
|
|
33
|
-
* });
|
|
34
|
-
* // Output: "2020.01 ~ 2020.05"
|
|
35
|
-
*/
|
|
36
|
-
declare const formatCareerPeriod: ({ startAt, endAt, showDuration, lng, }: {
|
|
37
|
-
startAt: Date;
|
|
38
|
-
endAt?: Date | undefined;
|
|
39
|
-
showDuration?: boolean | undefined;
|
|
40
|
-
lng?: string | undefined;
|
|
41
|
-
}) => string;
|
|
42
|
-
export default formatCareerPeriod;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|