@basiln/utils 0.1.9 → 0.1.11
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/README.md +39 -1
- package/dist/Choose.js.map +1 -1
- package/dist/Choose.mjs +1 -1
- package/dist/Flex.js +13 -13
- package/dist/Flex.js.map +1 -1
- package/dist/Flex.mjs +1 -1
- package/dist/SafeArea.js +12 -2
- package/dist/SafeArea.js.map +1 -1
- package/dist/SafeArea.mjs +2 -2
- package/dist/Spacing.js +12 -2
- package/dist/Spacing.js.map +1 -1
- package/dist/Spacing.mjs +1 -1
- package/dist/Validate.js.map +1 -1
- package/dist/Validate.mjs +1 -1
- package/dist/{chunk-R23KSR7N.mjs → chunk-5MSITYTP.mjs} +1 -1
- package/dist/{chunk-R23KSR7N.mjs.map → chunk-5MSITYTP.mjs.map} +1 -1
- package/dist/{chunk-FTMJVXXH.mjs → chunk-5OCEFCYV.mjs} +2 -2
- package/dist/chunk-5OCEFCYV.mjs.map +1 -0
- package/dist/{chunk-RASCHI5T.mjs → chunk-75ILZSEA.mjs} +3 -5
- package/dist/chunk-75ILZSEA.mjs.map +1 -0
- package/dist/{chunk-EB5LTJRH.mjs → chunk-ASPAKWHO.mjs} +2 -2
- package/dist/{chunk-EB5LTJRH.mjs.map → chunk-ASPAKWHO.mjs.map} +1 -1
- package/dist/chunk-D2YRH4XY.mjs +19 -0
- package/dist/chunk-D2YRH4XY.mjs.map +1 -0
- package/dist/{chunk-3BSCIHE2.mjs → chunk-FEPXSL77.mjs} +4 -11
- package/dist/chunk-FEPXSL77.mjs.map +1 -0
- package/dist/{chunk-QD5QDTUG.mjs → chunk-HCRCYF7A.mjs} +1 -1
- package/dist/chunk-HCRCYF7A.mjs.map +1 -0
- package/dist/chunk-HOC4D4DT.mjs +57 -0
- package/dist/chunk-HOC4D4DT.mjs.map +1 -0
- package/dist/{chunk-KIUJWSBE.mjs → chunk-JTQFGEBG.mjs} +2 -4
- package/dist/chunk-JTQFGEBG.mjs.map +1 -0
- package/dist/{chunk-KMMS4XJ6.mjs → chunk-K7254VDU.mjs} +1 -1
- package/dist/{chunk-KMMS4XJ6.mjs.map → chunk-K7254VDU.mjs.map} +1 -1
- package/dist/{chunk-7WNTKDNW.mjs → chunk-KFMJD3YK.mjs} +1 -1
- package/dist/chunk-KFMJD3YK.mjs.map +1 -0
- package/dist/chunk-QGQNMD22.mjs +15 -0
- package/dist/chunk-QGQNMD22.mjs.map +1 -0
- package/dist/{chunk-UCZMT7TP.mjs → chunk-QKAXJVK7.mjs} +3 -13
- package/dist/chunk-QKAXJVK7.mjs.map +1 -0
- package/dist/{chunk-Z7YV6A56.mjs → chunk-RQ2CQOT7.mjs} +2 -6
- package/dist/chunk-RQ2CQOT7.mjs.map +1 -0
- package/dist/{chunk-VIGWO4EN.mjs → chunk-YQMA54XQ.mjs} +2 -2
- package/dist/chunk-YQMA54XQ.mjs.map +1 -0
- package/dist/composeEventHandlers.js.map +1 -1
- package/dist/composeEventHandlers.mjs +1 -1
- package/dist/createContext.js +3 -10
- package/dist/createContext.js.map +1 -1
- package/dist/createContext.mjs +1 -1
- package/dist/ellipsis.js +3 -3
- package/dist/ellipsis.js.map +1 -1
- package/dist/ellipsis.mjs +1 -1
- package/dist/hasBatchim.js.map +1 -1
- package/dist/hasBatchim.mjs +1 -1
- package/dist/hexToRgba.js +1 -3
- package/dist/hexToRgba.js.map +1 -1
- package/dist/hexToRgba.mjs +1 -1
- package/dist/index.d.mts +21 -8
- package/dist/index.d.ts +21 -8
- package/dist/index.js +107 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -12
- package/dist/josa.js.map +1 -1
- package/dist/josa.mjs +2 -2
- package/dist/queryString.js +1 -5
- package/dist/queryString.js.map +1 -1
- package/dist/queryString.mjs +1 -1
- package/dist/useCombinedRefs.js +43 -0
- package/dist/useCombinedRefs.js.map +1 -0
- package/dist/useCombinedRefs.mjs +7 -0
- package/dist/useCombinedRefs.mjs.map +1 -0
- package/dist/useControllableState.js +100 -0
- package/dist/useControllableState.js.map +1 -0
- package/dist/useControllableState.mjs +10 -0
- package/dist/useControllableState.mjs.map +1 -0
- package/dist/usePreservedCallback.js +35 -0
- package/dist/usePreservedCallback.js.map +1 -0
- package/dist/usePreservedCallback.mjs +7 -0
- package/dist/usePreservedCallback.mjs.map +1 -0
- package/package.json +6 -4
- package/dist/chunk-3BSCIHE2.mjs.map +0 -1
- package/dist/chunk-7WNTKDNW.mjs.map +0 -1
- package/dist/chunk-FTMJVXXH.mjs.map +0 -1
- package/dist/chunk-KIUJWSBE.mjs.map +0 -1
- package/dist/chunk-QD5QDTUG.mjs.map +0 -1
- package/dist/chunk-RASCHI5T.mjs.map +0 -1
- package/dist/chunk-UCZMT7TP.mjs.map +0 -1
- package/dist/chunk-VIGWO4EN.mjs.map +0 -1
- package/dist/chunk-Z7YV6A56.mjs.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/usePreservedCallback.ts"],"sourcesContent":["import { useEffect, useMemo, useRef } from 'react';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst usePreservedCallback = <T extends (...args: any[]) => any>(callback: T): T => {\n const callbackRef = useRef(callback);\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n return useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n};\nexport default usePreservedCallback;\n"],"mappings":";AAAA,SAAS,WAAW,SAAS,cAAc;AAE3C,IAAM,uBAAuB,CAAoC,aAAmB;AAClF,QAAM,cAAc,OAAO,QAAQ;AACnC,YAAU,MAAM;AACd,gBAAY,UAAU;AAAA,EACxB,GAAG,CAAC,QAAQ,CAAC;AACb,SAAO,QAAQ,MAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AAC7E;AACA,IAAO,+BAAQ;","names":[]}
|
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
|
5
5
|
// src/Flex.tsx
|
6
6
|
import { memo } from "react";
|
7
|
-
import
|
7
|
+
import styled from "@emotion/styled";
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
9
9
|
var Flex = memo(function Flex2(props) {
|
10
10
|
const {
|
@@ -15,17 +15,7 @@ var Flex = memo(function Flex2(props) {
|
|
15
15
|
children,
|
16
16
|
...restProps
|
17
17
|
} = props;
|
18
|
-
return /* @__PURE__ */ jsx(
|
19
|
-
Container,
|
20
|
-
{
|
21
|
-
$gap: gap,
|
22
|
-
$justify: justify,
|
23
|
-
$align: align,
|
24
|
-
$direction: direction,
|
25
|
-
...restProps,
|
26
|
-
children
|
27
|
-
}
|
28
|
-
);
|
18
|
+
return /* @__PURE__ */ jsx(Container, { $gap: gap, $justify: justify, $align: align, $direction: direction, ...restProps, children });
|
29
19
|
});
|
30
20
|
var Container = styled.div`
|
31
21
|
display: flex;
|
@@ -39,4 +29,4 @@ export {
|
|
39
29
|
Flex,
|
40
30
|
Container
|
41
31
|
};
|
42
|
-
//# sourceMappingURL=chunk-
|
32
|
+
//# sourceMappingURL=chunk-QKAXJVK7.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/Flex.tsx"],"sourcesContent":["import { memo, type CSSProperties, type HTMLAttributes } from 'react';\nimport styled from '@emotion/styled';\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 $gap={gap} $justify={justify} $align={align} $direction={direction} {...restProps}>\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,OAAO,YAAY;AA0Bf;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,oBAAC,aAAU,MAAM,KAAK,UAAU,SAAS,QAAQ,OAAO,YAAY,WAAY,GAAG,WAChF,UACH;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"]}
|
@@ -43,11 +43,7 @@ function getQueryString(name, parser) {
|
|
43
43
|
return parser(value);
|
44
44
|
}
|
45
45
|
}
|
46
|
-
function setQueryString({
|
47
|
-
qs,
|
48
|
-
key,
|
49
|
-
value
|
50
|
-
}) {
|
46
|
+
function setQueryString({ qs, key, value }) {
|
51
47
|
const parsed = parseQueryString(qs);
|
52
48
|
return createQueryString({
|
53
49
|
...parsed,
|
@@ -64,4 +60,4 @@ var queryString = {
|
|
64
60
|
export {
|
65
61
|
queryString
|
66
62
|
};
|
67
|
-
//# sourceMappingURL=chunk-
|
63
|
+
//# sourceMappingURL=chunk-RQ2CQOT7.mjs.map
|
@@ -0,0 +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]>(iterable: Iterable<T>) {\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>(name: string, parser: (val: string) => T): T | undefined;\nfunction getQueryString<T = string>(name: string, parser?: (val: string) => T) {\n const value = queryString.parse<{ [name: string]: string | undefined }>()[name];\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({ qs, key, value }: { qs: string; key: string; value: string }) {\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,YAA2D,UAAuB;AACzF,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;AAkBA,SAAS,eAA2B,MAAc,QAA6B;AAC7E,QAAM,QAAQ,YAAY,MAA8C,EAAE,IAAI;AAE9E,MAAI,UAAU,QAAQ,SAAS,MAAM;AACnC,WAAO;AAAA,EACT,OAAO;AACL,WAAO,OAAO,KAAK;AAAA,EACrB;AACF;AAMA,SAAS,eAAe,EAAE,IAAI,KAAK,MAAM,GAA+C;AACtF,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"]}
|
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
|
5
5
|
// src/Spacing.tsx
|
6
6
|
import { memo } from "react";
|
7
|
-
import
|
7
|
+
import styled from "@emotion/styled";
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
9
9
|
var Spacing = memo(function Spacing2(props) {
|
10
10
|
const { direction = "vertical", size, ...restProps } = props;
|
@@ -19,4 +19,4 @@ var SpacingContainer = styled.div`
|
|
19
19
|
export {
|
20
20
|
Spacing
|
21
21
|
};
|
22
|
-
//# sourceMappingURL=chunk-
|
22
|
+
//# sourceMappingURL=chunk-YQMA54XQ.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/Spacing.tsx"],"sourcesContent":["import { memo, type HTMLAttributes } from 'react';\nimport styled from '@emotion/styled';\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 <SpacingContainer $direction={direction} $size={size} {...restProps} />;\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,OAAO,YAAY;AAcV;AAHF,IAAM,UAAU,KAAK,SAASA,SAAQ,OAAqB;AAChE,QAAM,EAAE,YAAY,YAAY,MAAM,GAAG,UAAU,IAAI;AAEvD,SAAO,oBAAC,oBAAiB,YAAY,WAAW,OAAO,MAAO,GAAG,WAAW;AAC9E,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/composeEventHandlers.ts"],"sourcesContent":["// @see https://github.com/radix-ui/primitives/blob/main/packages/core/primitive/src/primitive.tsx\n\nexport function composeEventHandlers<E>(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (
|
1
|
+
{"version":3,"sources":["../src/composeEventHandlers.ts"],"sourcesContent":["// @see https://github.com/radix-ui/primitives/blob/main/packages/core/primitive/src/primitive.tsx\n\nexport function composeEventHandlers<E>(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !(event as unknown as Event).defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,qBACd,sBACA,iBACA,EAAE,2BAA2B,KAAK,IAAI,CAAC,GACvC;AACA,SAAO,SAAS,YAAY,OAAU;AACpC,2BAAuB,KAAK;AAE5B,QAAI,6BAA6B,SAAS,CAAE,MAA2B,kBAAkB;AACvF,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;","names":[]}
|
package/dist/createContext.js
CHANGED
@@ -26,23 +26,16 @@ module.exports = __toCommonJS(createContext_exports);
|
|
26
26
|
var import_react = require("react");
|
27
27
|
var import_jsx_runtime = require("react/jsx-runtime");
|
28
28
|
function createContext(rootComponentName, defaultContext) {
|
29
|
-
const Context = (0, import_react.createContext)(
|
30
|
-
defaultContext
|
31
|
-
);
|
29
|
+
const Context = (0, import_react.createContext)(defaultContext);
|
32
30
|
function Provider(props) {
|
33
31
|
const { children, ...contextValues } = props;
|
34
|
-
const value = (0, import_react.useMemo)(
|
35
|
-
() => contextValues,
|
36
|
-
[contextValues]
|
37
|
-
);
|
32
|
+
const value = (0, import_react.useMemo)(() => contextValues, [contextValues]);
|
38
33
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children });
|
39
34
|
}
|
40
35
|
function useContext(consumerName) {
|
41
36
|
const context = (0, import_react.useContext)(Context);
|
42
37
|
if (context == null) {
|
43
|
-
throw new Error(
|
44
|
-
`${consumerName}\uC740 ${rootComponentName}\uD558\uC704\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.`
|
45
|
-
);
|
38
|
+
throw new Error(`${consumerName}\uC740 ${rootComponentName}\uD558\uC704\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.`);
|
46
39
|
}
|
47
40
|
return context;
|
48
41
|
}
|
@@ -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>(
|
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>(defaultContext);\n\n function Provider(props: PropsWithChildren<ContextValueType>) {\n const { children, ...contextValues } = props;\n\n const value = useMemo(() => contextValues, [contextValues]) 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(`${consumerName}은 ${rootComponentName}하위에서 사용해야 합니다.`);\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;AAaI;AAXJ,SAAS,cACd,mBACA,gBACA;AACA,QAAM,cAAU,aAAAA,eAA+C,cAAc;AAE7E,WAAS,SAAS,OAA4C;AAC5D,UAAM,EAAE,UAAU,GAAG,cAAc,IAAI;AAEvC,UAAM,YAAQ,sBAAQ,MAAM,eAAe,CAAC,aAAa,CAAC;AAE1D,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,MAAM,GAAG,YAAY,UAAK,iBAAiB,uEAAgB;AAAA,IACvE;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
@@ -24,13 +24,13 @@ __export(ellipsis_exports, {
|
|
24
24
|
multiLineEllipsis: () => multiLineEllipsis
|
25
25
|
});
|
26
26
|
module.exports = __toCommonJS(ellipsis_exports);
|
27
|
-
var
|
28
|
-
var ellipsis =
|
27
|
+
var import_react = require("@emotion/react");
|
28
|
+
var ellipsis = import_react.css`
|
29
29
|
overflow: hidden;
|
30
30
|
text-overflow: ellipsis;
|
31
31
|
white-space: nowrap;
|
32
32
|
`;
|
33
|
-
var multiLineEllipsis = ({ line }) =>
|
33
|
+
var multiLineEllipsis = ({ line }) => import_react.css`
|
34
34
|
display: -webkit-box;
|
35
35
|
overflow: hidden;
|
36
36
|
text-overflow: ellipsis;
|
package/dist/ellipsis.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/ellipsis.ts"],"sourcesContent":["import { css } from '
|
1
|
+
{"version":3,"sources":["../src/ellipsis.ts"],"sourcesContent":["import { css } from '@emotion/react';\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,mBAAoB;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/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 (
|
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 (charCode < COMPLETE_HANGUL_START_CHARCODE || charCode > COMPLETE_HANGUL_END_CHARCODE) {\n return false;\n }\n\n // 받침 코드 계산\n const batchimCode = (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,MAAI,WAAW,kCAAkC,WAAW,8BAA8B;AACxF,WAAO;AAAA,EACT;AAGA,QAAM,eAAe,WAAW,kCAAkC;AAElE,SAAO,cAAc;AACvB;","names":[]}
|
package/dist/hasBatchim.mjs
CHANGED
package/dist/hexToRgba.js
CHANGED
@@ -43,9 +43,7 @@ function isValidAlpha(alpha) {
|
|
43
43
|
}
|
44
44
|
function hexToRgba({ hex, alpha = 1 }) {
|
45
45
|
if (!isValidAlpha(alpha)) {
|
46
|
-
throw new Error(
|
47
|
-
`Invalid alpha value. Must be between 0 and 1, received: ${alpha}`
|
48
|
-
);
|
46
|
+
throw new Error(`Invalid alpha value. Must be between 0 and 1, received: ${alpha}`);
|
49
47
|
}
|
50
48
|
const validatedHex = validateHex(hex);
|
51
49
|
const expandedHex = expandHex(validatedHex);
|
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(
|
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(`Invalid alpha value. Must be between 0 and 1, received: ${alpha}`);\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,MAAM,2DAA2D,KAAK,EAAE;AAAA,EACpF;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":[]}
|
package/dist/hexToRgba.mjs
CHANGED
package/dist/index.d.mts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
2
|
import * as React from 'react';
|
3
|
-
import React__default, { ReactNode, FC, PropsWithChildren, HTMLAttributes, CSSProperties, ComponentPropsWithoutRef } from 'react';
|
4
|
-
import * as
|
3
|
+
import React__default, { ReactNode, FC, PropsWithChildren, HTMLAttributes, CSSProperties, ComponentPropsWithoutRef, Ref } from 'react';
|
4
|
+
import * as _emotion_react from '@emotion/react';
|
5
5
|
|
6
6
|
type ChooseWhenProps = {
|
7
7
|
condition: boolean;
|
@@ -53,8 +53,8 @@ declare const Flex: React.NamedExoticComponent<FlexProps>;
|
|
53
53
|
type MultiLineEllipsisProps = {
|
54
54
|
line: number;
|
55
55
|
};
|
56
|
-
declare const ellipsis:
|
57
|
-
declare const multiLineEllipsis: ({ line }: MultiLineEllipsisProps) =>
|
56
|
+
declare const ellipsis: _emotion_react.SerializedStyles;
|
57
|
+
declare const multiLineEllipsis: ({ line }: MultiLineEllipsisProps) => _emotion_react.SerializedStyles;
|
58
58
|
|
59
59
|
type HexToRgbaProps = {
|
60
60
|
hex: string;
|
@@ -120,11 +120,11 @@ type SafeAreaProps<T extends React__default.ElementType = 'div'> = {
|
|
120
120
|
declare const SafeArea: {
|
121
121
|
<T extends React__default.ElementType = "div">({ as, children, ...props }: SafeAreaProps<T>): react_jsx_runtime.JSX.Element;
|
122
122
|
Top: React__default.NamedExoticComponent<Omit<Omit<React__default.HTMLAttributes<HTMLDivElement>, "children"> & {
|
123
|
-
direction?: "
|
123
|
+
direction?: "vertical" | "horizontal";
|
124
124
|
size: CSSPixelValue;
|
125
125
|
}, "size">>;
|
126
126
|
Bottom: React__default.NamedExoticComponent<Omit<Omit<React__default.HTMLAttributes<HTMLDivElement>, "children"> & {
|
127
|
-
direction?: "
|
127
|
+
direction?: "vertical" | "horizontal";
|
128
128
|
size: CSSPixelValue;
|
129
129
|
}, "size">>;
|
130
130
|
};
|
@@ -159,7 +159,7 @@ declare function getQueryString<T>(name: string, parser: (val: string) => T): T
|
|
159
159
|
* @description 기존 쿼리 스트링에 새로운 쿼리 스트링을 추가합니다.
|
160
160
|
* @example setQueryString({ qs: '?a=1', key: 'b', value: '2' }) // '?a=1&b=2'
|
161
161
|
*/
|
162
|
-
declare function setQueryString({ qs, key, value
|
162
|
+
declare function setQueryString({ qs, key, value }: {
|
163
163
|
qs: string;
|
164
164
|
key: string;
|
165
165
|
value: string;
|
@@ -247,4 +247,17 @@ declare const DomainFormat: {
|
|
247
247
|
}) => string;
|
248
248
|
};
|
249
249
|
|
250
|
-
|
250
|
+
declare const useCombinedRefs: <T>(...refs: Array<Ref<T>>) => Ref<T>;
|
251
|
+
|
252
|
+
type UseControllableStateParams<T> = {
|
253
|
+
prop?: T | undefined;
|
254
|
+
defaultProp?: T | undefined;
|
255
|
+
onChange?: (state: T) => void;
|
256
|
+
};
|
257
|
+
/**
|
258
|
+
* @description
|
259
|
+
* Radix UI's useControllableState
|
260
|
+
*/
|
261
|
+
declare const useControllableState: <T>({ prop, defaultProp, onChange, }: UseControllableStateParams<T>) => readonly [T | undefined, React.Dispatch<React.SetStateAction<T | undefined>>];
|
262
|
+
|
263
|
+
export { type AirLevel, Choose, type ChooseOtherwiseProps, type ChooseProps, type ChooseWhenProps, type DebouncedFunction, DomainFormat, Flex, type FlexProps, Format, type HexToRgbaProps, If, type IfProps, type JosaProps, type Mode, type MultiLineEllipsisProps, SafeArea, type SafeAreaCssValueProps, type SafeAreaProps, Spacing, type SpacingProps, type UseControllableStateParams, type UserLevel, Validate, type VariableType, type Wind, composeEventHandlers, createContext, debounce, ellipsis, getVar, hexToRgba, josa, multiLineEllipsis, queryString, useCombinedRefs, useControllableState, useSafeArea };
|
package/dist/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
2
|
import * as React from 'react';
|
3
|
-
import React__default, { ReactNode, FC, PropsWithChildren, HTMLAttributes, CSSProperties, ComponentPropsWithoutRef } from 'react';
|
4
|
-
import * as
|
3
|
+
import React__default, { ReactNode, FC, PropsWithChildren, HTMLAttributes, CSSProperties, ComponentPropsWithoutRef, Ref } from 'react';
|
4
|
+
import * as _emotion_react from '@emotion/react';
|
5
5
|
|
6
6
|
type ChooseWhenProps = {
|
7
7
|
condition: boolean;
|
@@ -53,8 +53,8 @@ declare const Flex: React.NamedExoticComponent<FlexProps>;
|
|
53
53
|
type MultiLineEllipsisProps = {
|
54
54
|
line: number;
|
55
55
|
};
|
56
|
-
declare const ellipsis:
|
57
|
-
declare const multiLineEllipsis: ({ line }: MultiLineEllipsisProps) =>
|
56
|
+
declare const ellipsis: _emotion_react.SerializedStyles;
|
57
|
+
declare const multiLineEllipsis: ({ line }: MultiLineEllipsisProps) => _emotion_react.SerializedStyles;
|
58
58
|
|
59
59
|
type HexToRgbaProps = {
|
60
60
|
hex: string;
|
@@ -120,11 +120,11 @@ type SafeAreaProps<T extends React__default.ElementType = 'div'> = {
|
|
120
120
|
declare const SafeArea: {
|
121
121
|
<T extends React__default.ElementType = "div">({ as, children, ...props }: SafeAreaProps<T>): react_jsx_runtime.JSX.Element;
|
122
122
|
Top: React__default.NamedExoticComponent<Omit<Omit<React__default.HTMLAttributes<HTMLDivElement>, "children"> & {
|
123
|
-
direction?: "
|
123
|
+
direction?: "vertical" | "horizontal";
|
124
124
|
size: CSSPixelValue;
|
125
125
|
}, "size">>;
|
126
126
|
Bottom: React__default.NamedExoticComponent<Omit<Omit<React__default.HTMLAttributes<HTMLDivElement>, "children"> & {
|
127
|
-
direction?: "
|
127
|
+
direction?: "vertical" | "horizontal";
|
128
128
|
size: CSSPixelValue;
|
129
129
|
}, "size">>;
|
130
130
|
};
|
@@ -159,7 +159,7 @@ declare function getQueryString<T>(name: string, parser: (val: string) => T): T
|
|
159
159
|
* @description 기존 쿼리 스트링에 새로운 쿼리 스트링을 추가합니다.
|
160
160
|
* @example setQueryString({ qs: '?a=1', key: 'b', value: '2' }) // '?a=1&b=2'
|
161
161
|
*/
|
162
|
-
declare function setQueryString({ qs, key, value
|
162
|
+
declare function setQueryString({ qs, key, value }: {
|
163
163
|
qs: string;
|
164
164
|
key: string;
|
165
165
|
value: string;
|
@@ -247,4 +247,17 @@ declare const DomainFormat: {
|
|
247
247
|
}) => string;
|
248
248
|
};
|
249
249
|
|
250
|
-
|
250
|
+
declare const useCombinedRefs: <T>(...refs: Array<Ref<T>>) => Ref<T>;
|
251
|
+
|
252
|
+
type UseControllableStateParams<T> = {
|
253
|
+
prop?: T | undefined;
|
254
|
+
defaultProp?: T | undefined;
|
255
|
+
onChange?: (state: T) => void;
|
256
|
+
};
|
257
|
+
/**
|
258
|
+
* @description
|
259
|
+
* Radix UI's useControllableState
|
260
|
+
*/
|
261
|
+
declare const useControllableState: <T>({ prop, defaultProp, onChange, }: UseControllableStateParams<T>) => readonly [T | undefined, React.Dispatch<React.SetStateAction<T | undefined>>];
|
262
|
+
|
263
|
+
export { type AirLevel, Choose, type ChooseOtherwiseProps, type ChooseProps, type ChooseWhenProps, type DebouncedFunction, DomainFormat, Flex, type FlexProps, Format, type HexToRgbaProps, If, type IfProps, type JosaProps, type Mode, type MultiLineEllipsisProps, SafeArea, type SafeAreaCssValueProps, type SafeAreaProps, Spacing, type SpacingProps, type UseControllableStateParams, type UserLevel, Validate, type VariableType, type Wind, composeEventHandlers, createContext, debounce, ellipsis, getVar, hexToRgba, josa, multiLineEllipsis, queryString, useCombinedRefs, useControllableState, useSafeArea };
|