@basiln/utils 0.1.6 → 0.1.8
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/Flex.js.map +1 -1
- package/dist/Flex.mjs +2 -2
- package/dist/SafeArea.js.map +1 -1
- package/dist/SafeArea.mjs +4 -4
- package/dist/Spacing.js.map +1 -1
- package/dist/Spacing.mjs +2 -2
- package/dist/{chunk-Z4QPISK7.mjs → chunk-3BSCIHE2.mjs} +1 -1
- package/dist/{chunk-Z4QPISK7.mjs.map → chunk-3BSCIHE2.mjs.map} +1 -1
- package/dist/{chunk-FUGA35PJ.mjs → chunk-ANMBV2U3.mjs} +2 -2
- package/dist/{chunk-FUGA35PJ.mjs.map → chunk-ANMBV2U3.mjs.map} +1 -1
- package/dist/{chunk-SJJHTYZC.mjs → chunk-EB5LTJRH.mjs} +2 -2
- package/dist/{chunk-SJJHTYZC.mjs.map → chunk-EB5LTJRH.mjs.map} +1 -1
- package/dist/{chunk-XBGZ3YNL.mjs → chunk-FTMJVXXH.mjs} +2 -2
- package/dist/{chunk-XBGZ3YNL.mjs.map → chunk-FTMJVXXH.mjs.map} +1 -1
- package/dist/{chunk-OIJ4AVT7.mjs → chunk-KIUJWSBE.mjs} +1 -1
- package/dist/{chunk-OIJ4AVT7.mjs.map → chunk-KIUJWSBE.mjs.map} +1 -1
- package/dist/{chunk-C7VOPXT2.mjs → chunk-KMMS4XJ6.mjs} +2 -3
- package/dist/{chunk-C7VOPXT2.mjs.map → chunk-KMMS4XJ6.mjs.map} +1 -1
- package/dist/{chunk-T7K7QYTL.mjs → chunk-OQ3L65JI.mjs} +1 -1
- package/dist/{chunk-T7K7QYTL.mjs.map → chunk-OQ3L65JI.mjs.map} +1 -1
- package/dist/{chunk-HLTXXENG.mjs → chunk-RASCHI5T.mjs} +3 -3
- package/dist/{chunk-Q3B6WSD7.mjs → chunk-UCZMT7TP.mjs} +2 -2
- package/dist/{chunk-Q3B6WSD7.mjs.map → chunk-UCZMT7TP.mjs.map} +1 -1
- package/dist/{chunk-DD3KGUQX.mjs → chunk-VIGWO4EN.mjs} +2 -2
- package/dist/{chunk-DD3KGUQX.mjs.map → chunk-VIGWO4EN.mjs.map} +1 -1
- package/dist/{chunk-WHYNBO2G.mjs → chunk-Z4UXDD2C.mjs} +1 -1
- package/dist/{chunk-WHYNBO2G.mjs.map → chunk-Z4UXDD2C.mjs.map} +1 -1
- package/dist/{chunk-U4T3KW7L.mjs → chunk-Z7YV6A56.mjs} +1 -1
- package/dist/{chunk-U4T3KW7L.mjs.map → chunk-Z7YV6A56.mjs.map} +1 -1
- package/dist/coerceCssPixelValue.js.map +1 -1
- package/dist/coerceCssPixelValue.mjs +1 -1
- package/dist/createContext.js.map +1 -1
- package/dist/createContext.mjs +1 -1
- package/dist/ellipsis.js +1 -1
- package/dist/ellipsis.js.map +1 -1
- package/dist/ellipsis.mjs +1 -1
- package/dist/getVar.js.map +1 -1
- package/dist/getVar.mjs +1 -1
- package/dist/hasBatchim.js +1 -2
- package/dist/hasBatchim.js.map +1 -1
- package/dist/hasBatchim.mjs +1 -1
- package/dist/hexToRgba.js.map +1 -1
- package/dist/hexToRgba.mjs +1 -1
- package/dist/index.d.mts +228 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/josa.js +1 -2
- package/dist/josa.js.map +1 -1
- package/dist/josa.mjs +2 -2
- package/dist/queryString.js.map +1 -1
- package/dist/queryString.mjs +1 -1
- package/dist/useSafeArea.js.map +1 -1
- package/dist/useSafeArea.mjs +2 -2
- package/package.json +4 -12
- /package/dist/{chunk-HLTXXENG.mjs.map → chunk-RASCHI5T.mjs.map} +0 -0
package/dist/Flex.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/Flex.tsx","../src/coerceCssPixelValue.ts"],"sourcesContent":["import { memo, type CSSProperties, type HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nimport { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\ntype Justify = CSSProperties['justifyContent'];\ntype Align = CSSProperties['alignItems'];\ntype Direction = CSSProperties['flexDirection'];\n\nexport type FlexProps = HTMLAttributes<HTMLDivElement> & {\n gap?: CSSPixelValue;\n justify?: Justify;\n align?: Align;\n direction?: Direction;\n};\n\nexport const Flex = memo(function Flex(props: FlexProps) {\n const {\n gap = 0,\n justify = 'center',\n align = 'center',\n direction = 'row',\n children,\n ...restProps\n } = props;\n\n return (\n <Container\n $gap={gap}\n $justify={justify}\n $align={align}\n $direction={direction}\n {...restProps}\n >\n {children}\n </Container>\n );\n});\n\nexport const Container = styled.div<{\n $gap: CSSPixelValue;\n $justify: Justify;\n $align: Align;\n $direction: Direction;\n}>`\n display: flex;\n flex-direction: ${({ $direction }) => $direction};\n gap: ${({ $gap }) => coerceCssPixelValue($gap)};\n align-items: ${({ $align }) => $align};\n justify-content: ${({ $justify }) => $justify};\n`;\n","export type CSSPixelValue = string | number;\n\nexport function coerceCssPixelValue(value: CSSPixelValue): string {\n return typeof value === 'string' ? value : `${value}px`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8D;AAC9D,+BAAuB;;;ACChB,SAAS,oBAAoB,OAA8B;AAChE,SAAO,OAAO,UAAU,WAAW,QAAQ,GAAG;
|
1
|
+
{"version":3,"sources":["../src/Flex.tsx","../src/coerceCssPixelValue.ts"],"sourcesContent":["import { memo, type CSSProperties, type HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nimport { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\ntype Justify = CSSProperties['justifyContent'];\ntype Align = CSSProperties['alignItems'];\ntype Direction = CSSProperties['flexDirection'];\n\nexport type FlexProps = HTMLAttributes<HTMLDivElement> & {\n gap?: CSSPixelValue;\n justify?: Justify;\n align?: Align;\n direction?: Direction;\n};\n\nexport const Flex = memo(function Flex(props: FlexProps) {\n const {\n gap = 0,\n justify = 'center',\n align = 'center',\n direction = 'row',\n children,\n ...restProps\n } = props;\n\n return (\n <Container\n $gap={gap}\n $justify={justify}\n $align={align}\n $direction={direction}\n {...restProps}\n >\n {children}\n </Container>\n );\n});\n\nexport const Container = styled.div<{\n $gap: CSSPixelValue;\n $justify: Justify;\n $align: Align;\n $direction: Direction;\n}>`\n display: flex;\n flex-direction: ${({ $direction }) => $direction};\n gap: ${({ $gap }) => coerceCssPixelValue($gap)};\n align-items: ${({ $align }) => $align};\n justify-content: ${({ $justify }) => $justify};\n`;\n","export type CSSPixelValue = string | number;\n\nexport function coerceCssPixelValue(value: CSSPixelValue): string {\n return typeof value === 'string' ? value : `${value}px`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8D;AAC9D,+BAAuB;;;ACChB,SAAS,oBAAoB,OAA8B;AAChE,SAAO,OAAO,UAAU,WAAW,QAAQ,GAAG,KAAK;AACrD;;;ADuBI;AAXG,IAAM,WAAO,mBAAK,SAASA,MAAK,OAAkB;AACvD,QAAM;AAAA,IACJ,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,YAAY;AAAA,MACX,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ,CAAC;AAEM,IAAM,YAAY,gCAAO;AAAA;AAAA,oBAOZ,CAAC,EAAE,WAAW,MAAM,UAAU;AAAA,SACzC,CAAC,EAAE,KAAK,MAAM,oBAAoB,IAAI,CAAC;AAAA,iBAC/B,CAAC,EAAE,OAAO,MAAM,MAAM;AAAA,qBAClB,CAAC,EAAE,SAAS,MAAM,QAAQ;AAAA;","names":["Flex"]}
|
package/dist/Flex.mjs
CHANGED
package/dist/SafeArea.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/SafeArea.tsx","../src/Spacing.tsx","../src/coerceCssPixelValue.ts","../src/useSafeArea.ts"],"sourcesContent":["import React, {\n memo,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react';\n\nimport { Spacing } from './Spacing';\nimport { useSafeArea } from './useSafeArea';\n\nexport type SafeAreaProps<T extends React.ElementType = 'div'> = {\n as?: T;\n children: ReactNode;\n} & ComponentPropsWithoutRef<T>;\n\nexport const SafeArea = <T extends React.ElementType = 'div'>({\n as,\n children,\n ...props\n}: SafeAreaProps<T>) => {\n const Component = as || 'div';\n\n return (\n <Component {...props}>\n <SafeAreaTop />\n {children}\n <SafeAreaBottom />\n </Component>\n );\n};\n\nconst SafeAreaTop = memo(function SafeAreaTop(\n props: Omit<ComponentPropsWithoutRef<typeof Spacing>, 'size'>\n) {\n const { top } = useSafeArea();\n return <Spacing {...props} size={top} />;\n});\n\nconst SafeAreaBottom = memo(function SafeAreaBottom(\n props: Omit<ComponentPropsWithoutRef<typeof Spacing>, 'size'>\n) {\n const { bottom } = useSafeArea();\n return <Spacing {...props} size={bottom} />;\n});\n\nSafeArea.Top = SafeAreaTop;\nSafeArea.Bottom = SafeAreaBottom;\n","import { memo, type HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nimport { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\ntype AxisDirection = 'vertical' | 'horizontal';\n\nexport type SpacingProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n direction?: AxisDirection;\n size: CSSPixelValue;\n};\n\nexport const Spacing = memo(function Spacing(props: SpacingProps) {\n const { direction = 'vertical', size, ...restProps } = props;\n\n return (\n <SpacingContainer $direction={direction} $size={size} {...restProps} />\n );\n});\n\nconst SpacingContainer = styled.div<{\n $direction: SpacingProps['direction'];\n $size: SpacingProps['size'];\n}>`\n flex: none;\n width: ${({ $direction, $size }) =>\n $direction === 'horizontal' ? coerceCssPixelValue($size) : undefined};\n height: ${({ $direction, $size }) =>\n $direction === 'vertical' ? coerceCssPixelValue($size) : undefined};\n`;\n","export type CSSPixelValue = string | number;\n\nexport function coerceCssPixelValue(value: CSSPixelValue): string {\n return typeof value === 'string' ? value : `${value}px`;\n}\n","import { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\nexport type SafeAreaCssValueProps = {\n top?: CSSPixelValue;\n bottom?: CSSPixelValue;\n left?: CSSPixelValue;\n right?: CSSPixelValue;\n};\n\nconst useSafeArea = ({\n top: T = 0,\n bottom: B = 0,\n left: L = 0,\n right: R = 0,\n}: SafeAreaCssValueProps = {}) => {\n const top = `max(${coerceCssPixelValue(T)}, env(safe-area-inset-top))`;\n const bottom = `max(${coerceCssPixelValue(B)}, env(safe-area-inset-bottom))`;\n const left = `max(${coerceCssPixelValue(L)}, env(safe-area-inset-left))`;\n const right = `max(${coerceCssPixelValue(R)}, env(safe-area-inset-right))`;\n\n return { top, bottom, left, right };\n};\n\nexport { useSafeArea };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAIO;;;ACJP,mBAA0C;AAC1C,+BAAuB;;;ACChB,SAAS,oBAAoB,OAA8B;AAChE,SAAO,OAAO,UAAU,WAAW,QAAQ,GAAG;
|
1
|
+
{"version":3,"sources":["../src/SafeArea.tsx","../src/Spacing.tsx","../src/coerceCssPixelValue.ts","../src/useSafeArea.ts"],"sourcesContent":["import React, {\n memo,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react';\n\nimport { Spacing } from './Spacing';\nimport { useSafeArea } from './useSafeArea';\n\nexport type SafeAreaProps<T extends React.ElementType = 'div'> = {\n as?: T;\n children: ReactNode;\n} & ComponentPropsWithoutRef<T>;\n\nexport const SafeArea = <T extends React.ElementType = 'div'>({\n as,\n children,\n ...props\n}: SafeAreaProps<T>) => {\n const Component = as || 'div';\n\n return (\n <Component {...props}>\n <SafeAreaTop />\n {children}\n <SafeAreaBottom />\n </Component>\n );\n};\n\nconst SafeAreaTop = memo(function SafeAreaTop(\n props: Omit<ComponentPropsWithoutRef<typeof Spacing>, 'size'>\n) {\n const { top } = useSafeArea();\n return <Spacing {...props} size={top} />;\n});\n\nconst SafeAreaBottom = memo(function SafeAreaBottom(\n props: Omit<ComponentPropsWithoutRef<typeof Spacing>, 'size'>\n) {\n const { bottom } = useSafeArea();\n return <Spacing {...props} size={bottom} />;\n});\n\nSafeArea.Top = SafeAreaTop;\nSafeArea.Bottom = SafeAreaBottom;\n","import { memo, type HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nimport { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\ntype AxisDirection = 'vertical' | 'horizontal';\n\nexport type SpacingProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n direction?: AxisDirection;\n size: CSSPixelValue;\n};\n\nexport const Spacing = memo(function Spacing(props: SpacingProps) {\n const { direction = 'vertical', size, ...restProps } = props;\n\n return (\n <SpacingContainer $direction={direction} $size={size} {...restProps} />\n );\n});\n\nconst SpacingContainer = styled.div<{\n $direction: SpacingProps['direction'];\n $size: SpacingProps['size'];\n}>`\n flex: none;\n width: ${({ $direction, $size }) =>\n $direction === 'horizontal' ? coerceCssPixelValue($size) : undefined};\n height: ${({ $direction, $size }) =>\n $direction === 'vertical' ? coerceCssPixelValue($size) : undefined};\n`;\n","export type CSSPixelValue = string | number;\n\nexport function coerceCssPixelValue(value: CSSPixelValue): string {\n return typeof value === 'string' ? value : `${value}px`;\n}\n","import { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\nexport type SafeAreaCssValueProps = {\n top?: CSSPixelValue;\n bottom?: CSSPixelValue;\n left?: CSSPixelValue;\n right?: CSSPixelValue;\n};\n\nconst useSafeArea = ({\n top: T = 0,\n bottom: B = 0,\n left: L = 0,\n right: R = 0,\n}: SafeAreaCssValueProps = {}) => {\n const top = `max(${coerceCssPixelValue(T)}, env(safe-area-inset-top))`;\n const bottom = `max(${coerceCssPixelValue(B)}, env(safe-area-inset-bottom))`;\n const left = `max(${coerceCssPixelValue(L)}, env(safe-area-inset-left))`;\n const right = `max(${coerceCssPixelValue(R)}, env(safe-area-inset-right))`;\n\n return { top, bottom, left, right };\n};\n\nexport { useSafeArea };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAIO;;;ACJP,mBAA0C;AAC1C,+BAAuB;;;ACChB,SAAS,oBAAoB,OAA8B;AAChE,SAAO,OAAO,UAAU,WAAW,QAAQ,GAAG,KAAK;AACrD;;;ADYI;AAJG,IAAM,cAAU,mBAAK,SAASC,SAAQ,OAAqB;AAChE,QAAM,EAAE,YAAY,YAAY,MAAM,GAAG,UAAU,IAAI;AAEvD,SACE,4CAAC,oBAAiB,YAAY,WAAW,OAAO,MAAO,GAAG,WAAW;AAEzE,CAAC;AAED,IAAM,mBAAmB,gCAAO;AAAA;AAAA,WAKrB,CAAC,EAAE,YAAY,MAAM,MAC5B,eAAe,eAAe,oBAAoB,KAAK,IAAI,MAAS;AAAA,YAC5D,CAAC,EAAE,YAAY,MAAM,MAC7B,eAAe,aAAa,oBAAoB,KAAK,IAAI,MAAS;AAAA;;;AEnBtE,IAAM,cAAc,CAAC;AAAA,EACnB,KAAK,IAAI;AAAA,EACT,QAAQ,IAAI;AAAA,EACZ,MAAM,IAAI;AAAA,EACV,OAAO,IAAI;AACb,IAA2B,CAAC,MAAM;AAChC,QAAM,MAAM,OAAO,oBAAoB,CAAC,CAAC;AACzC,QAAM,SAAS,OAAO,oBAAoB,CAAC,CAAC;AAC5C,QAAM,OAAO,OAAO,oBAAoB,CAAC,CAAC;AAC1C,QAAM,QAAQ,OAAO,oBAAoB,CAAC,CAAC;AAE3C,SAAO,EAAE,KAAK,QAAQ,MAAM,MAAM;AACpC;;;AHCI,IAAAC,sBAAA;AARG,IAAM,WAAW,CAAsC;AAAA,EAC5D;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAwB;AACtB,QAAM,YAAY,MAAM;AAExB,SACE,8CAAC,aAAW,GAAG,OACb;AAAA,iDAAC,eAAY;AAAA,IACZ;AAAA,IACD,6CAAC,kBAAe;AAAA,KAClB;AAEJ;AAEA,IAAM,kBAAc,oBAAK,SAASC,aAChC,OACA;AACA,QAAM,EAAE,IAAI,IAAI,YAAY;AAC5B,SAAO,6CAAC,WAAS,GAAG,OAAO,MAAM,KAAK;AACxC,CAAC;AAED,IAAM,qBAAiB,oBAAK,SAASC,gBACnC,OACA;AACA,QAAM,EAAE,OAAO,IAAI,YAAY;AAC/B,SAAO,6CAAC,WAAS,GAAG,OAAO,MAAM,QAAQ;AAC3C,CAAC;AAED,SAAS,MAAM;AACf,SAAS,SAAS;","names":["import_react","Spacing","import_jsx_runtime","SafeAreaTop","SafeAreaBottom"]}
|
package/dist/SafeArea.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import {
|
2
2
|
SafeArea
|
3
|
-
} from "./chunk-
|
4
|
-
import "./chunk-
|
5
|
-
import "./chunk-
|
6
|
-
import "./chunk-
|
3
|
+
} from "./chunk-RASCHI5T.mjs";
|
4
|
+
import "./chunk-ANMBV2U3.mjs";
|
5
|
+
import "./chunk-VIGWO4EN.mjs";
|
6
|
+
import "./chunk-OQ3L65JI.mjs";
|
7
7
|
export {
|
8
8
|
SafeArea
|
9
9
|
};
|
package/dist/Spacing.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/Spacing.tsx","../src/coerceCssPixelValue.ts"],"sourcesContent":["import { memo, type HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nimport { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\ntype AxisDirection = 'vertical' | 'horizontal';\n\nexport type SpacingProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n direction?: AxisDirection;\n size: CSSPixelValue;\n};\n\nexport const Spacing = memo(function Spacing(props: SpacingProps) {\n const { direction = 'vertical', size, ...restProps } = props;\n\n return (\n <SpacingContainer $direction={direction} $size={size} {...restProps} />\n );\n});\n\nconst SpacingContainer = styled.div<{\n $direction: SpacingProps['direction'];\n $size: SpacingProps['size'];\n}>`\n flex: none;\n width: ${({ $direction, $size }) =>\n $direction === 'horizontal' ? coerceCssPixelValue($size) : undefined};\n height: ${({ $direction, $size }) =>\n $direction === 'vertical' ? coerceCssPixelValue($size) : undefined};\n`;\n","export type CSSPixelValue = string | number;\n\nexport function coerceCssPixelValue(value: CSSPixelValue): string {\n return typeof value === 'string' ? value : `${value}px`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0C;AAC1C,+BAAuB;;;ACChB,SAAS,oBAAoB,OAA8B;AAChE,SAAO,OAAO,UAAU,WAAW,QAAQ,GAAG;
|
1
|
+
{"version":3,"sources":["../src/Spacing.tsx","../src/coerceCssPixelValue.ts"],"sourcesContent":["import { memo, type HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nimport { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\ntype AxisDirection = 'vertical' | 'horizontal';\n\nexport type SpacingProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n direction?: AxisDirection;\n size: CSSPixelValue;\n};\n\nexport const Spacing = memo(function Spacing(props: SpacingProps) {\n const { direction = 'vertical', size, ...restProps } = props;\n\n return (\n <SpacingContainer $direction={direction} $size={size} {...restProps} />\n );\n});\n\nconst SpacingContainer = styled.div<{\n $direction: SpacingProps['direction'];\n $size: SpacingProps['size'];\n}>`\n flex: none;\n width: ${({ $direction, $size }) =>\n $direction === 'horizontal' ? coerceCssPixelValue($size) : undefined};\n height: ${({ $direction, $size }) =>\n $direction === 'vertical' ? coerceCssPixelValue($size) : undefined};\n`;\n","export type CSSPixelValue = string | number;\n\nexport function coerceCssPixelValue(value: CSSPixelValue): string {\n return typeof value === 'string' ? value : `${value}px`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0C;AAC1C,+BAAuB;;;ACChB,SAAS,oBAAoB,OAA8B;AAChE,SAAO,OAAO,UAAU,WAAW,QAAQ,GAAG,KAAK;AACrD;;;ADYI;AAJG,IAAM,cAAU,mBAAK,SAASA,SAAQ,OAAqB;AAChE,QAAM,EAAE,YAAY,YAAY,MAAM,GAAG,UAAU,IAAI;AAEvD,SACE,4CAAC,oBAAiB,YAAY,WAAW,OAAO,MAAO,GAAG,WAAW;AAEzE,CAAC;AAED,IAAM,mBAAmB,gCAAO;AAAA;AAAA,WAKrB,CAAC,EAAE,YAAY,MAAM,MAC5B,eAAe,eAAe,oBAAoB,KAAK,IAAI,MAAS;AAAA,YAC5D,CAAC,EAAE,YAAY,MAAM,MAC7B,eAAe,aAAa,oBAAoB,KAAK,IAAI,MAAS;AAAA;","names":["Spacing"]}
|
package/dist/Spacing.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/createContext.tsx"],"sourcesContent":["import {\n useMemo,\n createContext as createContextRaw,\n useContext as useContextRaw,\n type PropsWithChildren,\n} from 'react';\n\nexport function createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = createContextRaw<ContextValueType | undefined>(\n defaultContext\n );\n\n function Provider(props: PropsWithChildren<ContextValueType>) {\n const { children, ...contextValues } = props;\n\n const value = useMemo(\n () => contextValues,\n [contextValues]\n ) as ContextValueType;\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n }\n\n function useContext(consumerName: string) {\n const context = useContextRaw(Context);\n if (context == null) {\n throw new Error(\n `${consumerName}은 ${rootComponentName}하위에서 사용해야 합니다.`\n );\n }\n\n return context;\n }\n\n Provider.displayName = `${rootComponentName}Provider`;\n return [Provider, useContext] as const;\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,OAET;AAkBI;AAhBJ,SAAS,cACd,mBACA,gBACA;AACA,QAAM,UAAU;AAAA,IACd;AAAA,EACF;AAEA,WAAS,SAAS,OAA4C;AAC5D,UAAM,EAAE,UAAU,GAAG,cAAc,IAAI;AAEvC,UAAM,QAAQ;AAAA,MACZ,MAAM;AAAA,MACN,CAAC,aAAa;AAAA,IAChB;AAEA,WAAO,oBAAC,QAAQ,UAAR,EAAiB,OAAe,UAAS;AAAA,EACnD;AAEA,WAAS,WAAW,cAAsB;AACxC,UAAM,UAAU,cAAc,OAAO;AACrC,QAAI,WAAW,MAAM;AACnB,YAAM,IAAI;AAAA,QACR,GAAG,
|
1
|
+
{"version":3,"sources":["../src/createContext.tsx"],"sourcesContent":["import {\n useMemo,\n createContext as createContextRaw,\n useContext as useContextRaw,\n type PropsWithChildren,\n} from 'react';\n\nexport function createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = createContextRaw<ContextValueType | undefined>(\n defaultContext\n );\n\n function Provider(props: PropsWithChildren<ContextValueType>) {\n const { children, ...contextValues } = props;\n\n const value = useMemo(\n () => contextValues,\n [contextValues]\n ) as ContextValueType;\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n }\n\n function useContext(consumerName: string) {\n const context = useContextRaw(Context);\n if (context == null) {\n throw new Error(\n `${consumerName}은 ${rootComponentName}하위에서 사용해야 합니다.`\n );\n }\n\n return context;\n }\n\n Provider.displayName = `${rootComponentName}Provider`;\n return [Provider, useContext] as const;\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,OAET;AAkBI;AAhBJ,SAAS,cACd,mBACA,gBACA;AACA,QAAM,UAAU;AAAA,IACd;AAAA,EACF;AAEA,WAAS,SAAS,OAA4C;AAC5D,UAAM,EAAE,UAAU,GAAG,cAAc,IAAI;AAEvC,UAAM,QAAQ;AAAA,MACZ,MAAM;AAAA,MACN,CAAC,aAAa;AAAA,IAChB;AAEA,WAAO,oBAAC,QAAQ,UAAR,EAAiB,OAAe,UAAS;AAAA,EACnD;AAEA,WAAS,WAAW,cAAsB;AACxC,UAAM,UAAU,cAAc,OAAO;AACrC,QAAI,WAAW,MAAM;AACnB,YAAM,IAAI;AAAA,QACR,GAAG,YAAY,UAAK,iBAAiB;AAAA,MACvC;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAEA,WAAS,cAAc,GAAG,iBAAiB;AAC3C,SAAO,CAAC,UAAU,UAAU;AAC9B;","names":[]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
coerceCssPixelValue
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-OQ3L65JI.mjs";
|
4
4
|
|
5
5
|
// src/useSafeArea.ts
|
6
6
|
var useSafeArea = ({
|
@@ -19,4 +19,4 @@ var useSafeArea = ({
|
|
19
19
|
export {
|
20
20
|
useSafeArea
|
21
21
|
};
|
22
|
-
//# sourceMappingURL=chunk-
|
22
|
+
//# sourceMappingURL=chunk-ANMBV2U3.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/useSafeArea.ts"],"sourcesContent":["import { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\nexport type SafeAreaCssValueProps = {\n top?: CSSPixelValue;\n bottom?: CSSPixelValue;\n left?: CSSPixelValue;\n right?: CSSPixelValue;\n};\n\nconst useSafeArea = ({\n top: T = 0,\n bottom: B = 0,\n left: L = 0,\n right: R = 0,\n}: SafeAreaCssValueProps = {}) => {\n const top = `max(${coerceCssPixelValue(T)}, env(safe-area-inset-top))`;\n const bottom = `max(${coerceCssPixelValue(B)}, env(safe-area-inset-bottom))`;\n const left = `max(${coerceCssPixelValue(L)}, env(safe-area-inset-left))`;\n const right = `max(${coerceCssPixelValue(R)}, env(safe-area-inset-right))`;\n\n return { top, bottom, left, right };\n};\n\nexport { useSafeArea };\n"],"mappings":";;;;;AASA,IAAM,cAAc,CAAC;AAAA,EACnB,KAAK,IAAI;AAAA,EACT,QAAQ,IAAI;AAAA,EACZ,MAAM,IAAI;AAAA,EACV,OAAO,IAAI;AACb,IAA2B,CAAC,MAAM;AAChC,QAAM,MAAM,OAAO,oBAAoB,CAAC;
|
1
|
+
{"version":3,"sources":["../src/useSafeArea.ts"],"sourcesContent":["import { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\nexport type SafeAreaCssValueProps = {\n top?: CSSPixelValue;\n bottom?: CSSPixelValue;\n left?: CSSPixelValue;\n right?: CSSPixelValue;\n};\n\nconst useSafeArea = ({\n top: T = 0,\n bottom: B = 0,\n left: L = 0,\n right: R = 0,\n}: SafeAreaCssValueProps = {}) => {\n const top = `max(${coerceCssPixelValue(T)}, env(safe-area-inset-top))`;\n const bottom = `max(${coerceCssPixelValue(B)}, env(safe-area-inset-bottom))`;\n const left = `max(${coerceCssPixelValue(L)}, env(safe-area-inset-left))`;\n const right = `max(${coerceCssPixelValue(R)}, env(safe-area-inset-right))`;\n\n return { top, bottom, left, right };\n};\n\nexport { useSafeArea };\n"],"mappings":";;;;;AASA,IAAM,cAAc,CAAC;AAAA,EACnB,KAAK,IAAI;AAAA,EACT,QAAQ,IAAI;AAAA,EACZ,MAAM,IAAI;AAAA,EACV,OAAO,IAAI;AACb,IAA2B,CAAC,MAAM;AAChC,QAAM,MAAM,OAAO,oBAAoB,CAAC,CAAC;AACzC,QAAM,SAAS,OAAO,oBAAoB,CAAC,CAAC;AAC5C,QAAM,OAAO,OAAO,oBAAoB,CAAC,CAAC;AAC1C,QAAM,QAAQ,OAAO,oBAAoB,CAAC,CAAC;AAE3C,SAAO,EAAE,KAAK,QAAQ,MAAM,MAAM;AACpC;","names":[]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
hasBatchim
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-KMMS4XJ6.mjs";
|
4
4
|
|
5
5
|
// src/josa.ts
|
6
6
|
function josa(props) {
|
@@ -27,4 +27,4 @@ josa.pick = josaPicker;
|
|
27
27
|
export {
|
28
28
|
josa
|
29
29
|
};
|
30
|
-
//# sourceMappingURL=chunk-
|
30
|
+
//# sourceMappingURL=chunk-EB5LTJRH.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/josa.ts"],"sourcesContent":["import { hasBatchim } from './hasBatchim';\n\ntype JosaOption = '이/가' | '을/를' | '은/는';\n\ntype ExtractJosaOption<T> = T extends `${infer A}/${infer B}` ? A | B : never;\n\nexport type JosaProps<U extends JosaOption> = {\n word: string;\n josa: U;\n};\n\n/**\n * 주어진 단어와 조사 옵션을 기반으로 올바른 조사를 반환합니다.\n * @returns 단어와 올바른 조사가 결합된 문자열\n */\nexport function josa<U extends JosaOption>(\n props: JosaProps<U>\n): `${JosaProps<U>['word']}${ExtractJosaOption<U>}` {\n const { word, josa } = props;\n\n if (!word) {\n return word as `${JosaProps<U>['word']}${ExtractJosaOption<U>}`;\n }\n\n return `${word}${josaPicker({\n word,\n josa,\n })}` as `${JosaProps<U>['word']}${ExtractJosaOption<U>}`;\n}\n\n/**\n * 주어진 단어와 조사 옵션을 기반으로 올바른 조사를 선택합니다.\n * @returns 올바른 조사\n */\nfunction josaPicker<U extends JosaOption>(\n props: JosaProps<U>\n): ExtractJosaOption<U> {\n const { word, josa } = props;\n\n if (!word) {\n return josa.split('/')[0] as ExtractJosaOption<U>;\n }\n\n const has받침 = hasBatchim(word);\n const index = has받침 ? 0 : 1;\n\n return josa.split('/')[index] as ExtractJosaOption<U>;\n}\n\njosa.pick = josaPicker;\n"],"mappings":";;;;;AAeO,SAAS,KACd,OACkD;AAClD,QAAM,EAAE,MAAM,MAAAA,MAAK,IAAI;AAEvB,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,SAAO,GAAG,
|
1
|
+
{"version":3,"sources":["../src/josa.ts"],"sourcesContent":["import { hasBatchim } from './hasBatchim';\n\ntype JosaOption = '이/가' | '을/를' | '은/는';\n\ntype ExtractJosaOption<T> = T extends `${infer A}/${infer B}` ? A | B : never;\n\nexport type JosaProps<U extends JosaOption> = {\n word: string;\n josa: U;\n};\n\n/**\n * 주어진 단어와 조사 옵션을 기반으로 올바른 조사를 반환합니다.\n * @returns 단어와 올바른 조사가 결합된 문자열\n */\nexport function josa<U extends JosaOption>(\n props: JosaProps<U>\n): `${JosaProps<U>['word']}${ExtractJosaOption<U>}` {\n const { word, josa } = props;\n\n if (!word) {\n return word as `${JosaProps<U>['word']}${ExtractJosaOption<U>}`;\n }\n\n return `${word}${josaPicker({\n word,\n josa,\n })}` as `${JosaProps<U>['word']}${ExtractJosaOption<U>}`;\n}\n\n/**\n * 주어진 단어와 조사 옵션을 기반으로 올바른 조사를 선택합니다.\n * @returns 올바른 조사\n */\nfunction josaPicker<U extends JosaOption>(\n props: JosaProps<U>\n): ExtractJosaOption<U> {\n const { word, josa } = props;\n\n if (!word) {\n return josa.split('/')[0] as ExtractJosaOption<U>;\n }\n\n const has받침 = hasBatchim(word);\n const index = has받침 ? 0 : 1;\n\n return josa.split('/')[index] as ExtractJosaOption<U>;\n}\n\njosa.pick = josaPicker;\n"],"mappings":";;;;;AAeO,SAAS,KACd,OACkD;AAClD,QAAM,EAAE,MAAM,MAAAA,MAAK,IAAI;AAEvB,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,SAAO,GAAG,IAAI,GAAG,WAAW;AAAA,IAC1B;AAAA,IACA,MAAAA;AAAA,EACF,CAAC,CAAC;AACJ;AAMA,SAAS,WACP,OACsB;AACtB,QAAM,EAAE,MAAM,MAAAA,MAAK,IAAI;AAEvB,MAAI,CAAC,MAAM;AACT,WAAOA,MAAK,MAAM,GAAG,EAAE,CAAC;AAAA,EAC1B;AAEA,QAAM,kBAAQ,WAAW,IAAI;AAC7B,QAAM,QAAQ,kBAAQ,IAAI;AAE1B,SAAOA,MAAK,MAAM,GAAG,EAAE,KAAK;AAC9B;AAEA,KAAK,OAAO;","names":["josa"]}
|
@@ -2,8 +2,8 @@
|
|
2
2
|
import { css } from "styled-components";
|
3
3
|
var ellipsis = css`
|
4
4
|
overflow: hidden;
|
5
|
-
white-space: nowrap;
|
6
5
|
text-overflow: ellipsis;
|
6
|
+
white-space: nowrap;
|
7
7
|
`;
|
8
8
|
var multiLineEllipsis = ({ line }) => css`
|
9
9
|
display: -webkit-box;
|
@@ -17,4 +17,4 @@ export {
|
|
17
17
|
ellipsis,
|
18
18
|
multiLineEllipsis
|
19
19
|
};
|
20
|
-
//# sourceMappingURL=chunk-
|
20
|
+
//# sourceMappingURL=chunk-FTMJVXXH.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/ellipsis.ts"],"sourcesContent":["import { css } from 'styled-components';\n\nexport type MultiLineEllipsisProps = {\n line: number;\n};\n\nexport const ellipsis = css`\n overflow: hidden;\n
|
1
|
+
{"version":3,"sources":["../src/ellipsis.ts"],"sourcesContent":["import { css } from 'styled-components';\n\nexport type MultiLineEllipsisProps = {\n line: number;\n};\n\nexport const ellipsis = css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nexport const multiLineEllipsis = ({ line }: MultiLineEllipsisProps) => css`\n display: -webkit-box;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-line-clamp: ${line};\n -webkit-box-orient: vertical;\n`;\n"],"mappings":";AAAA,SAAS,WAAW;AAMb,IAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAMjB,IAAM,oBAAoB,CAAC,EAAE,KAAK,MAA8B;AAAA;AAAA;AAAA;AAAA,wBAI/C,IAAI;AAAA;AAAA;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/hexToRgba.ts"],"sourcesContent":["export type HexToRgbaProps = { hex: string; alpha?: number };\n\nfunction parseHexToDecimal(hex: string): number {\n return parseInt(hex, 16);\n}\n\nfunction validateHex(hex: string): string {\n const match = /^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.exec(hex);\n if (!match) {\n throw new Error(\n `Invalid hex value: \"${hex}\". Expected formats: \"#RGB\", \"RGB\", \"#RRGGBB\", or \"RRGGBB\".`\n );\n }\n return match[1];\n}\n\nfunction expandHex(hex: string): string {\n return hex.length === 3\n ? hex\n .split('')\n .map((char) => char + char)\n .join('')\n : hex;\n}\n\nfunction isValidAlpha(alpha: number): boolean {\n return alpha >= 0 && alpha <= 1;\n}\n\nexport function hexToRgba({ hex, alpha = 1 }: HexToRgbaProps): string {\n if (!isValidAlpha(alpha)) {\n throw new Error(\n `Invalid alpha value. Must be between 0 and 1, received: ${alpha}`\n );\n }\n\n const validatedHex = validateHex(hex);\n const expandedHex = expandHex(validatedHex);\n\n const r = parseHexToDecimal(expandedHex.slice(0, 2));\n const g = parseHexToDecimal(expandedHex.slice(2, 4));\n const b = parseHexToDecimal(expandedHex.slice(4, 6));\n\n return `rgba(${r},${g},${b},${alpha})`;\n}\n"],"mappings":";AAEA,SAAS,kBAAkB,KAAqB;AAC9C,SAAO,SAAS,KAAK,EAAE;AACzB;AAEA,SAAS,YAAY,KAAqB;AACxC,QAAM,QAAQ,sCAAsC,KAAK,GAAG;AAC5D,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR,uBAAuB;AAAA,
|
1
|
+
{"version":3,"sources":["../src/hexToRgba.ts"],"sourcesContent":["export type HexToRgbaProps = { hex: string; alpha?: number };\n\nfunction parseHexToDecimal(hex: string): number {\n return parseInt(hex, 16);\n}\n\nfunction validateHex(hex: string): string {\n const match = /^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.exec(hex);\n if (!match) {\n throw new Error(\n `Invalid hex value: \"${hex}\". Expected formats: \"#RGB\", \"RGB\", \"#RRGGBB\", or \"RRGGBB\".`\n );\n }\n return match[1];\n}\n\nfunction expandHex(hex: string): string {\n return hex.length === 3\n ? hex\n .split('')\n .map((char) => char + char)\n .join('')\n : hex;\n}\n\nfunction isValidAlpha(alpha: number): boolean {\n return alpha >= 0 && alpha <= 1;\n}\n\nexport function hexToRgba({ hex, alpha = 1 }: HexToRgbaProps): string {\n if (!isValidAlpha(alpha)) {\n throw new Error(\n `Invalid alpha value. Must be between 0 and 1, received: ${alpha}`\n );\n }\n\n const validatedHex = validateHex(hex);\n const expandedHex = expandHex(validatedHex);\n\n const r = parseHexToDecimal(expandedHex.slice(0, 2));\n const g = parseHexToDecimal(expandedHex.slice(2, 4));\n const b = parseHexToDecimal(expandedHex.slice(4, 6));\n\n return `rgba(${r},${g},${b},${alpha})`;\n}\n"],"mappings":";AAEA,SAAS,kBAAkB,KAAqB;AAC9C,SAAO,SAAS,KAAK,EAAE;AACzB;AAEA,SAAS,YAAY,KAAqB;AACxC,QAAM,QAAQ,sCAAsC,KAAK,GAAG;AAC5D,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR,uBAAuB,GAAG;AAAA,IAC5B;AAAA,EACF;AACA,SAAO,MAAM,CAAC;AAChB;AAEA,SAAS,UAAU,KAAqB;AACtC,SAAO,IAAI,WAAW,IAClB,IACG,MAAM,EAAE,EACR,IAAI,CAAC,SAAS,OAAO,IAAI,EACzB,KAAK,EAAE,IACV;AACN;AAEA,SAAS,aAAa,OAAwB;AAC5C,SAAO,SAAS,KAAK,SAAS;AAChC;AAEO,SAAS,UAAU,EAAE,KAAK,QAAQ,EAAE,GAA2B;AACpE,MAAI,CAAC,aAAa,KAAK,GAAG;AACxB,UAAM,IAAI;AAAA,MACR,2DAA2D,KAAK;AAAA,IAClE;AAAA,EACF;AAEA,QAAM,eAAe,YAAY,GAAG;AACpC,QAAM,cAAc,UAAU,YAAY;AAE1C,QAAM,IAAI,kBAAkB,YAAY,MAAM,GAAG,CAAC,CAAC;AACnD,QAAM,IAAI,kBAAkB,YAAY,MAAM,GAAG,CAAC,CAAC;AACnD,QAAM,IAAI,kBAAkB,YAAY,MAAM,GAAG,CAAC,CAAC;AAEnD,SAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK;AACrC;","names":[]}
|
@@ -7,8 +7,7 @@ import {
|
|
7
7
|
// src/hasBatchim.ts
|
8
8
|
function hasBatchim(str) {
|
9
9
|
const lastChar = str[str.length - 1];
|
10
|
-
if (!lastChar)
|
11
|
-
return false;
|
10
|
+
if (!lastChar) return false;
|
12
11
|
const charCode = lastChar.charCodeAt(0);
|
13
12
|
if (charCode < COMPLETE_HANGUL_START_CHARCODE || charCode > COMPLETE_HANGUL_END_CHARCODE) {
|
14
13
|
return false;
|
@@ -20,4 +19,4 @@ function hasBatchim(str) {
|
|
20
19
|
export {
|
21
20
|
hasBatchim
|
22
21
|
};
|
23
|
-
//# sourceMappingURL=chunk-
|
22
|
+
//# sourceMappingURL=chunk-KMMS4XJ6.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/hasBatchim.ts"],"sourcesContent":["import {\n COMPLETE_HANGUL_END_CHARCODE,\n COMPLETE_HANGUL_START_CHARCODE,\n NUMBER_OF_JONGSEONG,\n} from './constants/josa';\n\n/**\n * 한글 음절의 받침 유무를 확인합니다.\n * @param str - 검사할 문자열\n * @returns 받침이 있으면 true, 없으면 false\n */\nexport function hasBatchim(str: string): boolean {\n const lastChar = str[str.length - 1];\n if (!lastChar) return false;\n\n const charCode = lastChar.charCodeAt(0);\n\n // 한글 완성형 문자인지 확인\n if (\n charCode < COMPLETE_HANGUL_START_CHARCODE ||\n charCode > COMPLETE_HANGUL_END_CHARCODE\n ) {\n return false;\n }\n\n // 받침 코드 계산\n const batchimCode =\n (charCode - COMPLETE_HANGUL_START_CHARCODE) % NUMBER_OF_JONGSEONG;\n\n return batchimCode > 0; // 받침이 있으면 true\n}\n"],"mappings":";;;;;;;AAWO,SAAS,WAAW,KAAsB;AAC/C,QAAM,WAAW,IAAI,IAAI,SAAS,CAAC;AACnC,MAAI,CAAC
|
1
|
+
{"version":3,"sources":["../src/hasBatchim.ts"],"sourcesContent":["import {\n COMPLETE_HANGUL_END_CHARCODE,\n COMPLETE_HANGUL_START_CHARCODE,\n NUMBER_OF_JONGSEONG,\n} from './constants/josa';\n\n/**\n * 한글 음절의 받침 유무를 확인합니다.\n * @param str - 검사할 문자열\n * @returns 받침이 있으면 true, 없으면 false\n */\nexport function hasBatchim(str: string): boolean {\n const lastChar = str[str.length - 1];\n if (!lastChar) return false;\n\n const charCode = lastChar.charCodeAt(0);\n\n // 한글 완성형 문자인지 확인\n if (\n charCode < COMPLETE_HANGUL_START_CHARCODE ||\n charCode > COMPLETE_HANGUL_END_CHARCODE\n ) {\n return false;\n }\n\n // 받침 코드 계산\n const batchimCode =\n (charCode - COMPLETE_HANGUL_START_CHARCODE) % NUMBER_OF_JONGSEONG;\n\n return batchimCode > 0; // 받침이 있으면 true\n}\n"],"mappings":";;;;;;;AAWO,SAAS,WAAW,KAAsB;AAC/C,QAAM,WAAW,IAAI,IAAI,SAAS,CAAC;AACnC,MAAI,CAAC,SAAU,QAAO;AAEtB,QAAM,WAAW,SAAS,WAAW,CAAC;AAGtC,MACE,WAAW,kCACX,WAAW,8BACX;AACA,WAAO;AAAA,EACT;AAGA,QAAM,eACH,WAAW,kCAAkC;AAEhD,SAAO,cAAc;AACvB;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/coerceCssPixelValue.ts"],"sourcesContent":["export type CSSPixelValue = string | number;\n\nexport function coerceCssPixelValue(value: CSSPixelValue): string {\n return typeof value === 'string' ? value : `${value}px`;\n}\n"],"mappings":";AAEO,SAAS,oBAAoB,OAA8B;AAChE,SAAO,OAAO,UAAU,WAAW,QAAQ,GAAG;
|
1
|
+
{"version":3,"sources":["../src/coerceCssPixelValue.ts"],"sourcesContent":["export type CSSPixelValue = string | number;\n\nexport function coerceCssPixelValue(value: CSSPixelValue): string {\n return typeof value === 'string' ? value : `${value}px`;\n}\n"],"mappings":";AAEO,SAAS,oBAAoB,OAA8B;AAChE,SAAO,OAAO,UAAU,WAAW,QAAQ,GAAG,KAAK;AACrD;","names":[]}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import {
|
2
2
|
useSafeArea
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-ANMBV2U3.mjs";
|
4
4
|
import {
|
5
5
|
Spacing
|
6
|
-
} from "./chunk-
|
6
|
+
} from "./chunk-VIGWO4EN.mjs";
|
7
7
|
|
8
8
|
// src/SafeArea.tsx
|
9
9
|
import {
|
@@ -36,4 +36,4 @@ SafeArea.Bottom = SafeAreaBottom;
|
|
36
36
|
export {
|
37
37
|
SafeArea
|
38
38
|
};
|
39
|
-
//# sourceMappingURL=chunk-
|
39
|
+
//# sourceMappingURL=chunk-RASCHI5T.mjs.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
coerceCssPixelValue
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-OQ3L65JI.mjs";
|
4
4
|
|
5
5
|
// src/Flex.tsx
|
6
6
|
import { memo } from "react";
|
@@ -39,4 +39,4 @@ export {
|
|
39
39
|
Flex,
|
40
40
|
Container
|
41
41
|
};
|
42
|
-
//# sourceMappingURL=chunk-
|
42
|
+
//# sourceMappingURL=chunk-UCZMT7TP.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/Flex.tsx"],"sourcesContent":["import { memo, type CSSProperties, type HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nimport { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\ntype Justify = CSSProperties['justifyContent'];\ntype Align = CSSProperties['alignItems'];\ntype Direction = CSSProperties['flexDirection'];\n\nexport type FlexProps = HTMLAttributes<HTMLDivElement> & {\n gap?: CSSPixelValue;\n justify?: Justify;\n align?: Align;\n direction?: Direction;\n};\n\nexport const Flex = memo(function Flex(props: FlexProps) {\n const {\n gap = 0,\n justify = 'center',\n align = 'center',\n direction = 'row',\n children,\n ...restProps\n } = props;\n\n return (\n <Container\n $gap={gap}\n $justify={justify}\n $align={align}\n $direction={direction}\n {...restProps}\n >\n {children}\n </Container>\n );\n});\n\nexport const Container = styled.div<{\n $gap: CSSPixelValue;\n $justify: Justify;\n $align: Align;\n $direction: Direction;\n}>`\n display: flex;\n flex-direction: ${({ $direction }) => $direction};\n gap: ${({ $gap }) => coerceCssPixelValue($gap)};\n align-items: ${({ $align }) => $align};\n justify-content: ${({ $justify }) => $justify};\n`;\n"],"mappings":";;;;;AAAA,SAAS,YAAqD;AAC9D,SAAS,cAAc;AA0BnB;AAXG,IAAM,OAAO,KAAK,SAASA,MAAK,OAAkB;AACvD,QAAM;AAAA,IACJ,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,YAAY;AAAA,MACX,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ,CAAC;AAEM,IAAM,YAAY,OAAO;AAAA;AAAA,oBAOZ,CAAC,EAAE,WAAW,MAAM;AAAA,
|
1
|
+
{"version":3,"sources":["../src/Flex.tsx"],"sourcesContent":["import { memo, type CSSProperties, type HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nimport { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\ntype Justify = CSSProperties['justifyContent'];\ntype Align = CSSProperties['alignItems'];\ntype Direction = CSSProperties['flexDirection'];\n\nexport type FlexProps = HTMLAttributes<HTMLDivElement> & {\n gap?: CSSPixelValue;\n justify?: Justify;\n align?: Align;\n direction?: Direction;\n};\n\nexport const Flex = memo(function Flex(props: FlexProps) {\n const {\n gap = 0,\n justify = 'center',\n align = 'center',\n direction = 'row',\n children,\n ...restProps\n } = props;\n\n return (\n <Container\n $gap={gap}\n $justify={justify}\n $align={align}\n $direction={direction}\n {...restProps}\n >\n {children}\n </Container>\n );\n});\n\nexport const Container = styled.div<{\n $gap: CSSPixelValue;\n $justify: Justify;\n $align: Align;\n $direction: Direction;\n}>`\n display: flex;\n flex-direction: ${({ $direction }) => $direction};\n gap: ${({ $gap }) => coerceCssPixelValue($gap)};\n align-items: ${({ $align }) => $align};\n justify-content: ${({ $justify }) => $justify};\n`;\n"],"mappings":";;;;;AAAA,SAAS,YAAqD;AAC9D,SAAS,cAAc;AA0BnB;AAXG,IAAM,OAAO,KAAK,SAASA,MAAK,OAAkB;AACvD,QAAM;AAAA,IACJ,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,YAAY;AAAA,MACX,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ,CAAC;AAEM,IAAM,YAAY,OAAO;AAAA;AAAA,oBAOZ,CAAC,EAAE,WAAW,MAAM,UAAU;AAAA,SACzC,CAAC,EAAE,KAAK,MAAM,oBAAoB,IAAI,CAAC;AAAA,iBAC/B,CAAC,EAAE,OAAO,MAAM,MAAM;AAAA,qBAClB,CAAC,EAAE,SAAS,MAAM,QAAQ;AAAA;","names":["Flex"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
coerceCssPixelValue
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-OQ3L65JI.mjs";
|
4
4
|
|
5
5
|
// src/Spacing.tsx
|
6
6
|
import { memo } from "react";
|
@@ -19,4 +19,4 @@ var SpacingContainer = styled.div`
|
|
19
19
|
export {
|
20
20
|
Spacing
|
21
21
|
};
|
22
|
-
//# sourceMappingURL=chunk-
|
22
|
+
//# sourceMappingURL=chunk-VIGWO4EN.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/Spacing.tsx"],"sourcesContent":["import { memo, type HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nimport { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\ntype AxisDirection = 'vertical' | 'horizontal';\n\nexport type SpacingProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n direction?: AxisDirection;\n size: CSSPixelValue;\n};\n\nexport const Spacing = memo(function Spacing(props: SpacingProps) {\n const { direction = 'vertical', size, ...restProps } = props;\n\n return (\n <SpacingContainer $direction={direction} $size={size} {...restProps} />\n );\n});\n\nconst SpacingContainer = styled.div<{\n $direction: SpacingProps['direction'];\n $size: SpacingProps['size'];\n}>`\n flex: none;\n width: ${({ $direction, $size }) =>\n $direction === 'horizontal' ? coerceCssPixelValue($size) : undefined};\n height: ${({ $direction, $size }) =>\n $direction === 'vertical' ? coerceCssPixelValue($size) : undefined};\n`;\n"],"mappings":";;;;;AAAA,SAAS,YAAiC;AAC1C,SAAS,cAAc;AAenB;AAJG,IAAM,UAAU,KAAK,SAASA,SAAQ,OAAqB;AAChE,QAAM,EAAE,YAAY,YAAY,MAAM,GAAG,UAAU,IAAI;AAEvD,SACE,oBAAC,oBAAiB,YAAY,WAAW,OAAO,MAAO,GAAG,WAAW;AAEzE,CAAC;AAED,IAAM,mBAAmB,OAAO;AAAA;AAAA,WAKrB,CAAC,EAAE,YAAY,MAAM,MAC5B,eAAe,eAAe,oBAAoB,KAAK,IAAI;AAAA,
|
1
|
+
{"version":3,"sources":["../src/Spacing.tsx"],"sourcesContent":["import { memo, type HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nimport { coerceCssPixelValue, type CSSPixelValue } from './coerceCssPixelValue';\n\ntype AxisDirection = 'vertical' | 'horizontal';\n\nexport type SpacingProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n direction?: AxisDirection;\n size: CSSPixelValue;\n};\n\nexport const Spacing = memo(function Spacing(props: SpacingProps) {\n const { direction = 'vertical', size, ...restProps } = props;\n\n return (\n <SpacingContainer $direction={direction} $size={size} {...restProps} />\n );\n});\n\nconst SpacingContainer = styled.div<{\n $direction: SpacingProps['direction'];\n $size: SpacingProps['size'];\n}>`\n flex: none;\n width: ${({ $direction, $size }) =>\n $direction === 'horizontal' ? coerceCssPixelValue($size) : undefined};\n height: ${({ $direction, $size }) =>\n $direction === 'vertical' ? coerceCssPixelValue($size) : undefined};\n`;\n"],"mappings":";;;;;AAAA,SAAS,YAAiC;AAC1C,SAAS,cAAc;AAenB;AAJG,IAAM,UAAU,KAAK,SAASA,SAAQ,OAAqB;AAChE,QAAM,EAAE,YAAY,YAAY,MAAM,GAAG,UAAU,IAAI;AAEvD,SACE,oBAAC,oBAAiB,YAAY,WAAW,OAAO,MAAO,GAAG,WAAW;AAEzE,CAAC;AAED,IAAM,mBAAmB,OAAO;AAAA;AAAA,WAKrB,CAAC,EAAE,YAAY,MAAM,MAC5B,eAAe,eAAe,oBAAoB,KAAK,IAAI,MAAS;AAAA,YAC5D,CAAC,EAAE,YAAY,MAAM,MAC7B,eAAe,aAAa,oBAAoB,KAAK,IAAI,MAAS;AAAA;","names":["Spacing"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/getVar.ts"],"sourcesContent":["export type VariableType = `--${string}`;\n\nexport function getVar(variable: VariableType, defaultValue?: string) {\n if (defaultValue) {\n return `var(${variable}, ${defaultValue})`;\n }\n\n return `var(${variable})`;\n}\n"],"mappings":";AAEO,SAAS,OAAO,UAAwB,cAAuB;AACpE,MAAI,cAAc;AAChB,WAAO,OAAO,
|
1
|
+
{"version":3,"sources":["../src/getVar.ts"],"sourcesContent":["export type VariableType = `--${string}`;\n\nexport function getVar(variable: VariableType, defaultValue?: string) {\n if (defaultValue) {\n return `var(${variable}, ${defaultValue})`;\n }\n\n return `var(${variable})`;\n}\n"],"mappings":";AAEO,SAAS,OAAO,UAAwB,cAAuB;AACpE,MAAI,cAAc;AAChB,WAAO,OAAO,QAAQ,KAAK,YAAY;AAAA,EACzC;AAEA,SAAO,OAAO,QAAQ;AACxB;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/queryString.ts"],"sourcesContent":["/**\n * @description 쿼리 스트링을 생성합니다.\n * @example createSearchParamString({ a: 1, b: 2, c: 3 }) // 'a=1&b=2&c=3'\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createSearchParamString(params: Record<string, any>) {\n return (\n new URLSearchParams(\n Object.entries(params)\n .filter(([, value]) => value != null)\n .map(([key, value]) => {\n if (Array.isArray(value)) {\n return value.map((x) => [key, x]);\n }\n return [[key, value]];\n })\n .flat()\n )\n .toString()\n // Convert space characters to '%20' according to RFC3986 spec, from RFC1738.\n .replace(/\\+/g, '%20')\n );\n}\n\n/**\n * @description 물음표를 포함한 쿼리 스트링을 생성합니다.\n * @example createQueryString({ a: 1, b: 2, c: 3 }) // '?a=1&b=2&c=3'\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createQueryString(params: Record<string, any>) {\n const queryString = createSearchParamString(params);\n\n if (queryString === '') {\n return '';\n }\n\n return `?${queryString}`;\n}\n\n/**\n * @description 이터러블에서 키와 값을 가진 객체로 변환합니다.\n * @example fromEntries([['a', 1], ['b', 2], ['c', 3]]) // { a: 1, b: 2, c: 3 }\n */\nfunction fromEntries<T extends readonly [string | number, unknown]>(\n iterable: Iterable<T>\n) {\n const result: Record<string | number | symbol, T[1]> = {};\n\n for (const [key, value] of Array.from(iterable)) {\n if (result[key]) {\n if (Array.isArray(result[key])) {\n (result[key] as Array<string | number>).push(value as string | number);\n } else {\n result[key] = [result[key], value];\n }\n } else {\n result[key] = value;\n }\n }\n\n return result;\n}\n\n/**\n * @description 쿼리 스트링을 객체로 변환합니다.\n * @example parseQueryString('?a=1&b=2&c=3') // { a: '1', b: '2', c: '3' }\n */\nfunction parseQueryString<Result = Record<string, string>>(\n queryString: string = typeof location !== 'undefined' ? location.search : ''\n): Result {\n const query = queryString.trim().replace(/^[?#&]/, '');\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return fromEntries(new URLSearchParams(query)) as any;\n}\n\n/**\n * @description 쿼리 스트링에서 특정 키의 값을 가져옵니다.\n *\n * @param name 가져올 쿼리 스트링의 키\n * @param parser 가져온 값을 파싱할 함수\n * @returns 파싱된 값\n *\n * @example\n * url: 'http://example.com/?a=1'\n * getQueryString('a') // '1'\n * getQueryString('a', parseInt) // 1\n * getQueryString('b') // undefined\n * getQueryString('b', parseInt) // undefined\n */\nfunction getQueryString(name: string): string | undefined;\nfunction getQueryString<T>(\n name: string,\n parser: (val: string) => T\n): T | undefined;\nfunction getQueryString<T = string>(name: string, parser?: (val: string) => T) {\n const value = queryString.parse<{ [name: string]: string | undefined }>()[\n name\n ];\n\n if (parser == null || value == null) {\n return value;\n } else {\n return parser(value);\n }\n}\n\n/**\n * @description 기존 쿼리 스트링에 새로운 쿼리 스트링을 추가합니다.\n * @example setQueryString({ qs: '?a=1', key: 'b', value: '2' }) // '?a=1&b=2'\n */\nfunction setQueryString({\n qs,\n key,\n value,\n}: {\n qs: string;\n key: string;\n value: string;\n}) {\n const parsed = parseQueryString(qs);\n\n return createQueryString({\n ...parsed,\n [key]: value,\n });\n}\n\nexport const queryString = {\n create: createQueryString,\n parse: parseQueryString,\n get: getQueryString,\n set: setQueryString,\n};\n"],"mappings":";AAKA,SAAS,wBAAwB,QAA6B;AAC5D,SACE,IAAI;AAAA,IACF,OAAO,QAAQ,MAAM,EAClB,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,SAAS,IAAI,EACnC,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACrB,UAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,eAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAAA,MAClC;AACA,aAAO,CAAC,CAAC,KAAK,KAAK,CAAC;AAAA,IACtB,CAAC,EACA,KAAK;AAAA,EACV,EACG,SAAS,EAET,QAAQ,OAAO,KAAK;AAE3B;AAOA,SAAS,kBAAkB,QAA6B;AACtD,QAAMA,eAAc,wBAAwB,MAAM;AAElD,MAAIA,iBAAgB,IAAI;AACtB,WAAO;AAAA,EACT;AAEA,SAAO,IAAIA;
|
1
|
+
{"version":3,"sources":["../src/queryString.ts"],"sourcesContent":["/**\n * @description 쿼리 스트링을 생성합니다.\n * @example createSearchParamString({ a: 1, b: 2, c: 3 }) // 'a=1&b=2&c=3'\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createSearchParamString(params: Record<string, any>) {\n return (\n new URLSearchParams(\n Object.entries(params)\n .filter(([, value]) => value != null)\n .map(([key, value]) => {\n if (Array.isArray(value)) {\n return value.map((x) => [key, x]);\n }\n return [[key, value]];\n })\n .flat()\n )\n .toString()\n // Convert space characters to '%20' according to RFC3986 spec, from RFC1738.\n .replace(/\\+/g, '%20')\n );\n}\n\n/**\n * @description 물음표를 포함한 쿼리 스트링을 생성합니다.\n * @example createQueryString({ a: 1, b: 2, c: 3 }) // '?a=1&b=2&c=3'\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createQueryString(params: Record<string, any>) {\n const queryString = createSearchParamString(params);\n\n if (queryString === '') {\n return '';\n }\n\n return `?${queryString}`;\n}\n\n/**\n * @description 이터러블에서 키와 값을 가진 객체로 변환합니다.\n * @example fromEntries([['a', 1], ['b', 2], ['c', 3]]) // { a: 1, b: 2, c: 3 }\n */\nfunction fromEntries<T extends readonly [string | number, unknown]>(\n iterable: Iterable<T>\n) {\n const result: Record<string | number | symbol, T[1]> = {};\n\n for (const [key, value] of Array.from(iterable)) {\n if (result[key]) {\n if (Array.isArray(result[key])) {\n (result[key] as Array<string | number>).push(value as string | number);\n } else {\n result[key] = [result[key], value];\n }\n } else {\n result[key] = value;\n }\n }\n\n return result;\n}\n\n/**\n * @description 쿼리 스트링을 객체로 변환합니다.\n * @example parseQueryString('?a=1&b=2&c=3') // { a: '1', b: '2', c: '3' }\n */\nfunction parseQueryString<Result = Record<string, string>>(\n queryString: string = typeof location !== 'undefined' ? location.search : ''\n): Result {\n const query = queryString.trim().replace(/^[?#&]/, '');\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return fromEntries(new URLSearchParams(query)) as any;\n}\n\n/**\n * @description 쿼리 스트링에서 특정 키의 값을 가져옵니다.\n *\n * @param name 가져올 쿼리 스트링의 키\n * @param parser 가져온 값을 파싱할 함수\n * @returns 파싱된 값\n *\n * @example\n * url: 'http://example.com/?a=1'\n * getQueryString('a') // '1'\n * getQueryString('a', parseInt) // 1\n * getQueryString('b') // undefined\n * getQueryString('b', parseInt) // undefined\n */\nfunction getQueryString(name: string): string | undefined;\nfunction getQueryString<T>(\n name: string,\n parser: (val: string) => T\n): T | undefined;\nfunction getQueryString<T = string>(name: string, parser?: (val: string) => T) {\n const value = queryString.parse<{ [name: string]: string | undefined }>()[\n name\n ];\n\n if (parser == null || value == null) {\n return value;\n } else {\n return parser(value);\n }\n}\n\n/**\n * @description 기존 쿼리 스트링에 새로운 쿼리 스트링을 추가합니다.\n * @example setQueryString({ qs: '?a=1', key: 'b', value: '2' }) // '?a=1&b=2'\n */\nfunction setQueryString({\n qs,\n key,\n value,\n}: {\n qs: string;\n key: string;\n value: string;\n}) {\n const parsed = parseQueryString(qs);\n\n return createQueryString({\n ...parsed,\n [key]: value,\n });\n}\n\nexport const queryString = {\n create: createQueryString,\n parse: parseQueryString,\n get: getQueryString,\n set: setQueryString,\n};\n"],"mappings":";AAKA,SAAS,wBAAwB,QAA6B;AAC5D,SACE,IAAI;AAAA,IACF,OAAO,QAAQ,MAAM,EAClB,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,SAAS,IAAI,EACnC,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACrB,UAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,eAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAAA,MAClC;AACA,aAAO,CAAC,CAAC,KAAK,KAAK,CAAC;AAAA,IACtB,CAAC,EACA,KAAK;AAAA,EACV,EACG,SAAS,EAET,QAAQ,OAAO,KAAK;AAE3B;AAOA,SAAS,kBAAkB,QAA6B;AACtD,QAAMA,eAAc,wBAAwB,MAAM;AAElD,MAAIA,iBAAgB,IAAI;AACtB,WAAO;AAAA,EACT;AAEA,SAAO,IAAIA,YAAW;AACxB;AAMA,SAAS,YACP,UACA;AACA,QAAM,SAAiD,CAAC;AAExD,aAAW,CAAC,KAAK,KAAK,KAAK,MAAM,KAAK,QAAQ,GAAG;AAC/C,QAAI,OAAO,GAAG,GAAG;AACf,UAAI,MAAM,QAAQ,OAAO,GAAG,CAAC,GAAG;AAC9B,QAAC,OAAO,GAAG,EAA6B,KAAK,KAAwB;AAAA,MACvE,OAAO;AACL,eAAO,GAAG,IAAI,CAAC,OAAO,GAAG,GAAG,KAAK;AAAA,MACnC;AAAA,IACF,OAAO;AACL,aAAO,GAAG,IAAI;AAAA,IAChB;AAAA,EACF;AAEA,SAAO;AACT;AAMA,SAAS,iBACPA,eAAsB,OAAO,aAAa,cAAc,SAAS,SAAS,IAClE;AACR,QAAM,QAAQA,aAAY,KAAK,EAAE,QAAQ,UAAU,EAAE;AAGrD,SAAO,YAAY,IAAI,gBAAgB,KAAK,CAAC;AAC/C;AAqBA,SAAS,eAA2B,MAAc,QAA6B;AAC7E,QAAM,QAAQ,YAAY,MAA8C,EACtE,IACF;AAEA,MAAI,UAAU,QAAQ,SAAS,MAAM;AACnC,WAAO;AAAA,EACT,OAAO;AACL,WAAO,OAAO,KAAK;AAAA,EACrB;AACF;AAMA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,SAAS,iBAAiB,EAAE;AAElC,SAAO,kBAAkB;AAAA,IACvB,GAAG;AAAA,IACH,CAAC,GAAG,GAAG;AAAA,EACT,CAAC;AACH;AAEO,IAAM,cAAc;AAAA,EACzB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,KAAK;AAAA,EACL,KAAK;AACP;","names":["queryString"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/coerceCssPixelValue.ts"],"sourcesContent":["export type CSSPixelValue = string | number;\n\nexport function coerceCssPixelValue(value: CSSPixelValue): string {\n return typeof value === 'string' ? value : `${value}px`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,oBAAoB,OAA8B;AAChE,SAAO,OAAO,UAAU,WAAW,QAAQ,GAAG;
|
1
|
+
{"version":3,"sources":["../src/coerceCssPixelValue.ts"],"sourcesContent":["export type CSSPixelValue = string | number;\n\nexport function coerceCssPixelValue(value: CSSPixelValue): string {\n return typeof value === 'string' ? value : `${value}px`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,oBAAoB,OAA8B;AAChE,SAAO,OAAO,UAAU,WAAW,QAAQ,GAAG,KAAK;AACrD;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/createContext.tsx"],"sourcesContent":["import {\n useMemo,\n createContext as createContextRaw,\n useContext as useContextRaw,\n type PropsWithChildren,\n} from 'react';\n\nexport function createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = createContextRaw<ContextValueType | undefined>(\n defaultContext\n );\n\n function Provider(props: PropsWithChildren<ContextValueType>) {\n const { children, ...contextValues } = props;\n\n const value = useMemo(\n () => contextValues,\n [contextValues]\n ) as ContextValueType;\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n }\n\n function useContext(consumerName: string) {\n const context = useContextRaw(Context);\n if (context == null) {\n throw new Error(\n `${consumerName}은 ${rootComponentName}하위에서 사용해야 합니다.`\n );\n }\n\n return context;\n }\n\n Provider.displayName = `${rootComponentName}Provider`;\n return [Provider, useContext] as const;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAKO;AAkBI;AAhBJ,SAAS,cACd,mBACA,gBACA;AACA,QAAM,cAAU,aAAAA;AAAA,IACd;AAAA,EACF;AAEA,WAAS,SAAS,OAA4C;AAC5D,UAAM,EAAE,UAAU,GAAG,cAAc,IAAI;AAEvC,UAAM,YAAQ;AAAA,MACZ,MAAM;AAAA,MACN,CAAC,aAAa;AAAA,IAChB;AAEA,WAAO,4CAAC,QAAQ,UAAR,EAAiB,OAAe,UAAS;AAAA,EACnD;AAEA,WAAS,WAAW,cAAsB;AACxC,UAAM,cAAU,aAAAC,YAAc,OAAO;AACrC,QAAI,WAAW,MAAM;AACnB,YAAM,IAAI;AAAA,QACR,GAAG,
|
1
|
+
{"version":3,"sources":["../src/createContext.tsx"],"sourcesContent":["import {\n useMemo,\n createContext as createContextRaw,\n useContext as useContextRaw,\n type PropsWithChildren,\n} from 'react';\n\nexport function createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = createContextRaw<ContextValueType | undefined>(\n defaultContext\n );\n\n function Provider(props: PropsWithChildren<ContextValueType>) {\n const { children, ...contextValues } = props;\n\n const value = useMemo(\n () => contextValues,\n [contextValues]\n ) as ContextValueType;\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n }\n\n function useContext(consumerName: string) {\n const context = useContextRaw(Context);\n if (context == null) {\n throw new Error(\n `${consumerName}은 ${rootComponentName}하위에서 사용해야 합니다.`\n );\n }\n\n return context;\n }\n\n Provider.displayName = `${rootComponentName}Provider`;\n return [Provider, useContext] as const;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAKO;AAkBI;AAhBJ,SAAS,cACd,mBACA,gBACA;AACA,QAAM,cAAU,aAAAA;AAAA,IACd;AAAA,EACF;AAEA,WAAS,SAAS,OAA4C;AAC5D,UAAM,EAAE,UAAU,GAAG,cAAc,IAAI;AAEvC,UAAM,YAAQ;AAAA,MACZ,MAAM;AAAA,MACN,CAAC,aAAa;AAAA,IAChB;AAEA,WAAO,4CAAC,QAAQ,UAAR,EAAiB,OAAe,UAAS;AAAA,EACnD;AAEA,WAAS,WAAW,cAAsB;AACxC,UAAM,cAAU,aAAAC,YAAc,OAAO;AACrC,QAAI,WAAW,MAAM;AACnB,YAAM,IAAI;AAAA,QACR,GAAG,YAAY,UAAK,iBAAiB;AAAA,MACvC;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAEA,WAAS,cAAc,GAAG,iBAAiB;AAC3C,SAAO,CAAC,UAAU,UAAU;AAC9B;","names":["createContextRaw","useContextRaw"]}
|
package/dist/createContext.mjs
CHANGED
package/dist/ellipsis.js
CHANGED
@@ -27,8 +27,8 @@ module.exports = __toCommonJS(ellipsis_exports);
|
|
27
27
|
var import_styled_components = require("styled-components");
|
28
28
|
var ellipsis = import_styled_components.css`
|
29
29
|
overflow: hidden;
|
30
|
-
white-space: nowrap;
|
31
30
|
text-overflow: ellipsis;
|
31
|
+
white-space: nowrap;
|
32
32
|
`;
|
33
33
|
var multiLineEllipsis = ({ line }) => import_styled_components.css`
|
34
34
|
display: -webkit-box;
|
package/dist/ellipsis.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/ellipsis.ts"],"sourcesContent":["import { css } from 'styled-components';\n\nexport type MultiLineEllipsisProps = {\n line: number;\n};\n\nexport const ellipsis = css`\n overflow: hidden;\n
|
1
|
+
{"version":3,"sources":["../src/ellipsis.ts"],"sourcesContent":["import { css } from 'styled-components';\n\nexport type MultiLineEllipsisProps = {\n line: number;\n};\n\nexport const ellipsis = css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nexport const multiLineEllipsis = ({ line }: MultiLineEllipsisProps) => css`\n display: -webkit-box;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-line-clamp: ${line};\n -webkit-box-orient: vertical;\n`;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAoB;AAMb,IAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAMjB,IAAM,oBAAoB,CAAC,EAAE,KAAK,MAA8B;AAAA;AAAA;AAAA;AAAA,wBAI/C,IAAI;AAAA;AAAA;","names":[]}
|
package/dist/ellipsis.mjs
CHANGED
package/dist/getVar.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/getVar.ts"],"sourcesContent":["export type VariableType = `--${string}`;\n\nexport function getVar(variable: VariableType, defaultValue?: string) {\n if (defaultValue) {\n return `var(${variable}, ${defaultValue})`;\n }\n\n return `var(${variable})`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,OAAO,UAAwB,cAAuB;AACpE,MAAI,cAAc;AAChB,WAAO,OAAO,
|
1
|
+
{"version":3,"sources":["../src/getVar.ts"],"sourcesContent":["export type VariableType = `--${string}`;\n\nexport function getVar(variable: VariableType, defaultValue?: string) {\n if (defaultValue) {\n return `var(${variable}, ${defaultValue})`;\n }\n\n return `var(${variable})`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,OAAO,UAAwB,cAAuB;AACpE,MAAI,cAAc;AAChB,WAAO,OAAO,QAAQ,KAAK,YAAY;AAAA,EACzC;AAEA,SAAO,OAAO,QAAQ;AACxB;","names":[]}
|
package/dist/getVar.mjs
CHANGED
package/dist/hasBatchim.js
CHANGED
@@ -95,8 +95,7 @@ var JONGSEONGS = [
|
|
95
95
|
// src/hasBatchim.ts
|
96
96
|
function hasBatchim(str) {
|
97
97
|
const lastChar = str[str.length - 1];
|
98
|
-
if (!lastChar)
|
99
|
-
return false;
|
98
|
+
if (!lastChar) return false;
|
100
99
|
const charCode = lastChar.charCodeAt(0);
|
101
100
|
if (charCode < COMPLETE_HANGUL_START_CHARCODE || charCode > COMPLETE_HANGUL_END_CHARCODE) {
|
102
101
|
return false;
|
package/dist/hasBatchim.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/hasBatchim.ts","../src/constants/josa.ts"],"sourcesContent":["import {\n COMPLETE_HANGUL_END_CHARCODE,\n COMPLETE_HANGUL_START_CHARCODE,\n NUMBER_OF_JONGSEONG,\n} from './constants/josa';\n\n/**\n * 한글 음절의 받침 유무를 확인합니다.\n * @param str - 검사할 문자열\n * @returns 받침이 있으면 true, 없으면 false\n */\nexport function hasBatchim(str: string): boolean {\n const lastChar = str[str.length - 1];\n if (!lastChar) return false;\n\n const charCode = lastChar.charCodeAt(0);\n\n // 한글 완성형 문자인지 확인\n if (\n charCode < COMPLETE_HANGUL_START_CHARCODE ||\n charCode > COMPLETE_HANGUL_END_CHARCODE\n ) {\n return false;\n }\n\n // 받침 코드 계산\n const batchimCode =\n (charCode - COMPLETE_HANGUL_START_CHARCODE) % NUMBER_OF_JONGSEONG;\n\n return batchimCode > 0; // 받침이 있으면 true\n}\n","export const COMPLETE_HANGUL_START_CHARCODE = '가'.charCodeAt(0);\nexport const COMPLETE_HANGUL_END_CHARCODE = '힣'.charCodeAt(0);\n\nexport const NUMBER_OF_JONGSEONG = 28;\nexport const NUMBER_OF_JUNGSEONG = 21;\n\nconst DISASSEMBLED_CONSONANTS_BY_CONSONANT = {\n '': '',\n ㄱ: 'ㄱ',\n ㄲ: 'ㄲ',\n ㄳ: 'ㄱㅅ',\n ㄴ: 'ㄴ',\n ㄵ: 'ㄴㅈ',\n ㄶ: 'ㄴㅎ',\n ㄷ: 'ㄷ',\n ㄸ: 'ㄸ',\n ㄹ: 'ㄹ',\n ㄺ: 'ㄹㄱ',\n ㄻ: 'ㄹㅁ',\n ㄼ: 'ㄹㅂ',\n ㄽ: 'ㄹㅅ',\n ㄾ: 'ㄹㅌ',\n ㄿ: 'ㄹㅍ',\n ㅀ: 'ㄹㅎ',\n ㅁ: 'ㅁ',\n ㅂ: 'ㅂ',\n ㅃ: 'ㅃ',\n ㅄ: 'ㅂㅅ',\n ㅅ: 'ㅅ',\n ㅆ: 'ㅆ',\n ㅇ: 'ㅇ',\n ㅈ: 'ㅈ',\n ㅉ: 'ㅉ',\n ㅊ: 'ㅊ',\n ㅋ: 'ㅋ',\n ㅌ: 'ㅌ',\n ㅍ: 'ㅍ',\n ㅎ: 'ㅎ',\n} as const;\n\nexport const JONGSEONGS = (\n [\n '',\n 'ㄱ',\n 'ㄲ',\n 'ㄳ',\n 'ㄴ',\n 'ㄵ',\n 'ㄶ',\n 'ㄷ',\n 'ㄹ',\n 'ㄺ',\n 'ㄻ',\n 'ㄼ',\n 'ㄽ',\n 'ㄾ',\n 'ㄿ',\n 'ㅀ',\n 'ㅁ',\n 'ㅂ',\n 'ㅄ',\n 'ㅅ',\n 'ㅆ',\n 'ㅇ',\n 'ㅈ',\n 'ㅊ',\n 'ㅋ',\n 'ㅌ',\n 'ㅍ',\n 'ㅎ',\n ] as const\n).map((consonant) => DISASSEMBLED_CONSONANTS_BY_CONSONANT[consonant]);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,iCAAiC,SAAI,WAAW,CAAC;AACvD,IAAM,+BAA+B,SAAI,WAAW,CAAC;AAErD,IAAM,sBAAsB;AAGnC,IAAM,uCAAuC;AAAA,EAC3C,IAAI;AAAA,EACJ,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AACL;AAEO,IAAM,aACX;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EACA,IAAI,CAAC,cAAc,qCAAqC,SAAS,CAAC;;;AD5D7D,SAAS,WAAW,KAAsB;AAC/C,QAAM,WAAW,IAAI,IAAI,SAAS,CAAC;AACnC,MAAI,CAAC
|
1
|
+
{"version":3,"sources":["../src/hasBatchim.ts","../src/constants/josa.ts"],"sourcesContent":["import {\n COMPLETE_HANGUL_END_CHARCODE,\n COMPLETE_HANGUL_START_CHARCODE,\n NUMBER_OF_JONGSEONG,\n} from './constants/josa';\n\n/**\n * 한글 음절의 받침 유무를 확인합니다.\n * @param str - 검사할 문자열\n * @returns 받침이 있으면 true, 없으면 false\n */\nexport function hasBatchim(str: string): boolean {\n const lastChar = str[str.length - 1];\n if (!lastChar) return false;\n\n const charCode = lastChar.charCodeAt(0);\n\n // 한글 완성형 문자인지 확인\n if (\n charCode < COMPLETE_HANGUL_START_CHARCODE ||\n charCode > COMPLETE_HANGUL_END_CHARCODE\n ) {\n return false;\n }\n\n // 받침 코드 계산\n const batchimCode =\n (charCode - COMPLETE_HANGUL_START_CHARCODE) % NUMBER_OF_JONGSEONG;\n\n return batchimCode > 0; // 받침이 있으면 true\n}\n","export const COMPLETE_HANGUL_START_CHARCODE = '가'.charCodeAt(0);\nexport const COMPLETE_HANGUL_END_CHARCODE = '힣'.charCodeAt(0);\n\nexport const NUMBER_OF_JONGSEONG = 28;\nexport const NUMBER_OF_JUNGSEONG = 21;\n\nconst DISASSEMBLED_CONSONANTS_BY_CONSONANT = {\n '': '',\n ㄱ: 'ㄱ',\n ㄲ: 'ㄲ',\n ㄳ: 'ㄱㅅ',\n ㄴ: 'ㄴ',\n ㄵ: 'ㄴㅈ',\n ㄶ: 'ㄴㅎ',\n ㄷ: 'ㄷ',\n ㄸ: 'ㄸ',\n ㄹ: 'ㄹ',\n ㄺ: 'ㄹㄱ',\n ㄻ: 'ㄹㅁ',\n ㄼ: 'ㄹㅂ',\n ㄽ: 'ㄹㅅ',\n ㄾ: 'ㄹㅌ',\n ㄿ: 'ㄹㅍ',\n ㅀ: 'ㄹㅎ',\n ㅁ: 'ㅁ',\n ㅂ: 'ㅂ',\n ㅃ: 'ㅃ',\n ㅄ: 'ㅂㅅ',\n ㅅ: 'ㅅ',\n ㅆ: 'ㅆ',\n ㅇ: 'ㅇ',\n ㅈ: 'ㅈ',\n ㅉ: 'ㅉ',\n ㅊ: 'ㅊ',\n ㅋ: 'ㅋ',\n ㅌ: 'ㅌ',\n ㅍ: 'ㅍ',\n ㅎ: 'ㅎ',\n} as const;\n\nexport const JONGSEONGS = (\n [\n '',\n 'ㄱ',\n 'ㄲ',\n 'ㄳ',\n 'ㄴ',\n 'ㄵ',\n 'ㄶ',\n 'ㄷ',\n 'ㄹ',\n 'ㄺ',\n 'ㄻ',\n 'ㄼ',\n 'ㄽ',\n 'ㄾ',\n 'ㄿ',\n 'ㅀ',\n 'ㅁ',\n 'ㅂ',\n 'ㅄ',\n 'ㅅ',\n 'ㅆ',\n 'ㅇ',\n 'ㅈ',\n 'ㅊ',\n 'ㅋ',\n 'ㅌ',\n 'ㅍ',\n 'ㅎ',\n ] as const\n).map((consonant) => DISASSEMBLED_CONSONANTS_BY_CONSONANT[consonant]);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,iCAAiC,SAAI,WAAW,CAAC;AACvD,IAAM,+BAA+B,SAAI,WAAW,CAAC;AAErD,IAAM,sBAAsB;AAGnC,IAAM,uCAAuC;AAAA,EAC3C,IAAI;AAAA,EACJ,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AAAA,EACH,QAAG;AACL;AAEO,IAAM,aACX;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EACA,IAAI,CAAC,cAAc,qCAAqC,SAAS,CAAC;;;AD5D7D,SAAS,WAAW,KAAsB;AAC/C,QAAM,WAAW,IAAI,IAAI,SAAS,CAAC;AACnC,MAAI,CAAC,SAAU,QAAO;AAEtB,QAAM,WAAW,SAAS,WAAW,CAAC;AAGtC,MACE,WAAW,kCACX,WAAW,8BACX;AACA,WAAO;AAAA,EACT;AAGA,QAAM,eACH,WAAW,kCAAkC;AAEhD,SAAO,cAAc;AACvB;","names":[]}
|
package/dist/hasBatchim.mjs
CHANGED
package/dist/hexToRgba.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/hexToRgba.ts"],"sourcesContent":["export type HexToRgbaProps = { hex: string; alpha?: number };\n\nfunction parseHexToDecimal(hex: string): number {\n return parseInt(hex, 16);\n}\n\nfunction validateHex(hex: string): string {\n const match = /^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.exec(hex);\n if (!match) {\n throw new Error(\n `Invalid hex value: \"${hex}\". Expected formats: \"#RGB\", \"RGB\", \"#RRGGBB\", or \"RRGGBB\".`\n );\n }\n return match[1];\n}\n\nfunction expandHex(hex: string): string {\n return hex.length === 3\n ? hex\n .split('')\n .map((char) => char + char)\n .join('')\n : hex;\n}\n\nfunction isValidAlpha(alpha: number): boolean {\n return alpha >= 0 && alpha <= 1;\n}\n\nexport function hexToRgba({ hex, alpha = 1 }: HexToRgbaProps): string {\n if (!isValidAlpha(alpha)) {\n throw new Error(\n `Invalid alpha value. Must be between 0 and 1, received: ${alpha}`\n );\n }\n\n const validatedHex = validateHex(hex);\n const expandedHex = expandHex(validatedHex);\n\n const r = parseHexToDecimal(expandedHex.slice(0, 2));\n const g = parseHexToDecimal(expandedHex.slice(2, 4));\n const b = parseHexToDecimal(expandedHex.slice(4, 6));\n\n return `rgba(${r},${g},${b},${alpha})`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,SAAS,kBAAkB,KAAqB;AAC9C,SAAO,SAAS,KAAK,EAAE;AACzB;AAEA,SAAS,YAAY,KAAqB;AACxC,QAAM,QAAQ,sCAAsC,KAAK,GAAG;AAC5D,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR,uBAAuB;AAAA,
|
1
|
+
{"version":3,"sources":["../src/hexToRgba.ts"],"sourcesContent":["export type HexToRgbaProps = { hex: string; alpha?: number };\n\nfunction parseHexToDecimal(hex: string): number {\n return parseInt(hex, 16);\n}\n\nfunction validateHex(hex: string): string {\n const match = /^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.exec(hex);\n if (!match) {\n throw new Error(\n `Invalid hex value: \"${hex}\". Expected formats: \"#RGB\", \"RGB\", \"#RRGGBB\", or \"RRGGBB\".`\n );\n }\n return match[1];\n}\n\nfunction expandHex(hex: string): string {\n return hex.length === 3\n ? hex\n .split('')\n .map((char) => char + char)\n .join('')\n : hex;\n}\n\nfunction isValidAlpha(alpha: number): boolean {\n return alpha >= 0 && alpha <= 1;\n}\n\nexport function hexToRgba({ hex, alpha = 1 }: HexToRgbaProps): string {\n if (!isValidAlpha(alpha)) {\n throw new Error(\n `Invalid alpha value. Must be between 0 and 1, received: ${alpha}`\n );\n }\n\n const validatedHex = validateHex(hex);\n const expandedHex = expandHex(validatedHex);\n\n const r = parseHexToDecimal(expandedHex.slice(0, 2));\n const g = parseHexToDecimal(expandedHex.slice(2, 4));\n const b = parseHexToDecimal(expandedHex.slice(4, 6));\n\n return `rgba(${r},${g},${b},${alpha})`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,SAAS,kBAAkB,KAAqB;AAC9C,SAAO,SAAS,KAAK,EAAE;AACzB;AAEA,SAAS,YAAY,KAAqB;AACxC,QAAM,QAAQ,sCAAsC,KAAK,GAAG;AAC5D,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR,uBAAuB,GAAG;AAAA,IAC5B;AAAA,EACF;AACA,SAAO,MAAM,CAAC;AAChB;AAEA,SAAS,UAAU,KAAqB;AACtC,SAAO,IAAI,WAAW,IAClB,IACG,MAAM,EAAE,EACR,IAAI,CAAC,SAAS,OAAO,IAAI,EACzB,KAAK,EAAE,IACV;AACN;AAEA,SAAS,aAAa,OAAwB;AAC5C,SAAO,SAAS,KAAK,SAAS;AAChC;AAEO,SAAS,UAAU,EAAE,KAAK,QAAQ,EAAE,GAA2B;AACpE,MAAI,CAAC,aAAa,KAAK,GAAG;AACxB,UAAM,IAAI;AAAA,MACR,2DAA2D,KAAK;AAAA,IAClE;AAAA,EACF;AAEA,QAAM,eAAe,YAAY,GAAG;AACpC,QAAM,cAAc,UAAU,YAAY;AAE1C,QAAM,IAAI,kBAAkB,YAAY,MAAM,GAAG,CAAC,CAAC;AACnD,QAAM,IAAI,kBAAkB,YAAY,MAAM,GAAG,CAAC,CAAC;AACnD,QAAM,IAAI,kBAAkB,YAAY,MAAM,GAAG,CAAC,CAAC;AAEnD,SAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK;AACrC;","names":[]}
|