@basiln/utils 0.1.1 → 0.1.2

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/dist/Choose.js +50 -0
  3. package/dist/Choose.js.map +1 -0
  4. package/dist/Choose.mjs +7 -0
  5. package/dist/Choose.mjs.map +1 -0
  6. package/dist/Flex.js +70 -0
  7. package/dist/Flex.js.map +1 -0
  8. package/dist/Flex.mjs +10 -0
  9. package/dist/Flex.mjs.map +1 -0
  10. package/dist/If.js +35 -0
  11. package/dist/If.js.map +1 -0
  12. package/dist/If.mjs +7 -0
  13. package/dist/If.mjs.map +1 -0
  14. package/dist/SafeArea.js +91 -0
  15. package/dist/SafeArea.js.map +1 -0
  16. package/dist/SafeArea.mjs +10 -0
  17. package/dist/SafeArea.mjs.map +1 -0
  18. package/dist/Spacing.js +49 -0
  19. package/dist/Spacing.js.map +1 -0
  20. package/dist/Spacing.mjs +8 -0
  21. package/dist/Spacing.mjs.map +1 -0
  22. package/dist/Validate.js +43 -0
  23. package/dist/Validate.js.map +1 -0
  24. package/dist/Validate.mjs +7 -0
  25. package/dist/Validate.mjs.map +1 -0
  26. package/dist/chunk-7WNTKDNW.mjs +26 -0
  27. package/dist/chunk-7WNTKDNW.mjs.map +1 -0
  28. package/dist/chunk-C7VOPXT2.mjs +23 -0
  29. package/dist/chunk-C7VOPXT2.mjs.map +1 -0
  30. package/dist/chunk-FUGA35PJ.mjs +22 -0
  31. package/dist/chunk-FUGA35PJ.mjs.map +1 -0
  32. package/dist/chunk-GQPOYY4X.mjs +77 -0
  33. package/dist/chunk-GQPOYY4X.mjs.map +1 -0
  34. package/dist/chunk-LKUAG7PE.mjs +22 -0
  35. package/dist/chunk-LKUAG7PE.mjs.map +1 -0
  36. package/dist/chunk-OIJ4AVT7.mjs +37 -0
  37. package/dist/chunk-OIJ4AVT7.mjs.map +1 -0
  38. package/dist/chunk-Q3B6WSD7.mjs +42 -0
  39. package/dist/chunk-Q3B6WSD7.mjs.map +1 -0
  40. package/dist/chunk-QD5QDTUG.mjs +14 -0
  41. package/dist/chunk-QD5QDTUG.mjs.map +1 -0
  42. package/dist/chunk-R23KSR7N.mjs +19 -0
  43. package/dist/chunk-R23KSR7N.mjs.map +1 -0
  44. package/dist/chunk-SJJHTYZC.mjs +30 -0
  45. package/dist/chunk-SJJHTYZC.mjs.map +1 -0
  46. package/dist/chunk-T7K7QYTL.mjs +9 -0
  47. package/dist/chunk-T7K7QYTL.mjs.map +1 -0
  48. package/dist/chunk-U4T3KW7L.mjs +67 -0
  49. package/dist/chunk-U4T3KW7L.mjs.map +1 -0
  50. package/dist/chunk-UFRXNT2I.mjs +11 -0
  51. package/dist/chunk-UFRXNT2I.mjs.map +1 -0
  52. package/dist/chunk-WHYNBO2G.mjs +12 -0
  53. package/dist/chunk-WHYNBO2G.mjs.map +1 -0
  54. package/dist/chunk-WOYL5AA5.mjs +39 -0
  55. package/dist/chunk-WOYL5AA5.mjs.map +1 -0
  56. package/dist/chunk-XBGZ3YNL.mjs +20 -0
  57. package/dist/chunk-XBGZ3YNL.mjs.map +1 -0
  58. package/dist/chunk-Z4QPISK7.mjs +36 -0
  59. package/dist/chunk-Z4QPISK7.mjs.map +1 -0
  60. package/dist/coerceCssPixelValue.js +33 -0
  61. package/dist/coerceCssPixelValue.js.map +1 -0
  62. package/dist/coerceCssPixelValue.mjs +7 -0
  63. package/dist/coerceCssPixelValue.mjs.map +1 -0
  64. package/dist/composeEventHandlers.js +38 -0
  65. package/dist/composeEventHandlers.js.map +1 -0
  66. package/dist/composeEventHandlers.mjs +7 -0
  67. package/dist/composeEventHandlers.mjs.map +1 -0
  68. package/dist/constants/josa.js +105 -0
  69. package/dist/constants/josa.js.map +1 -0
  70. package/dist/constants/josa.mjs +15 -0
  71. package/dist/constants/josa.mjs.map +1 -0
  72. package/dist/createContext.js +56 -0
  73. package/dist/createContext.js.map +1 -0
  74. package/dist/createContext.mjs +7 -0
  75. package/dist/createContext.mjs.map +1 -0
  76. package/dist/ellipsis.js +45 -0
  77. package/dist/ellipsis.js.map +1 -0
  78. package/dist/ellipsis.mjs +9 -0
  79. package/dist/ellipsis.mjs.map +1 -0
  80. package/dist/getVar.js +36 -0
  81. package/dist/getVar.js.map +1 -0
  82. package/dist/getVar.mjs +7 -0
  83. package/dist/getVar.mjs.map +1 -0
  84. package/dist/hasBatchim.js +111 -0
  85. package/dist/hasBatchim.js.map +1 -0
  86. package/dist/hasBatchim.mjs +8 -0
  87. package/dist/hasBatchim.mjs.map +1 -0
  88. package/dist/hexToRgba.js +61 -0
  89. package/dist/hexToRgba.js.map +1 -0
  90. package/dist/hexToRgba.mjs +7 -0
  91. package/dist/hexToRgba.mjs.map +1 -0
  92. package/dist/index.d.ts +174 -0
  93. package/dist/index.js +456 -0
  94. package/dist/index.js.map +1 -0
  95. package/dist/index.mjs +64 -0
  96. package/dist/index.mjs.map +1 -0
  97. package/dist/josa.js +133 -0
  98. package/dist/josa.js.map +1 -0
  99. package/dist/josa.mjs +9 -0
  100. package/dist/josa.mjs.map +1 -0
  101. package/dist/queryString.js +91 -0
  102. package/dist/queryString.js.map +1 -0
  103. package/dist/queryString.mjs +7 -0
  104. package/dist/queryString.mjs.map +1 -0
  105. package/dist/useSafeArea.js +49 -0
  106. package/dist/useSafeArea.js.map +1 -0
  107. package/dist/useSafeArea.mjs +8 -0
  108. package/dist/useSafeArea.mjs.map +1 -0
  109. package/package.json +5 -2
  110. package/src/Flex.tsx +51 -0
  111. package/src/SafeArea.tsx +46 -0
  112. package/src/Spacing.tsx +30 -0
  113. package/src/Validate.ts +25 -0
  114. package/src/coerceCssPixelValue.ts +5 -0
  115. package/src/constants/josa.ts +72 -0
  116. package/src/ellipsis.ts +19 -0
  117. package/src/hasBatchim.ts +31 -0
  118. package/src/hexToRgba.ts +45 -0
  119. package/src/index.ts +25 -0
  120. package/src/josa.ts +50 -0
  121. package/src/queryString.ts +134 -0
  122. package/src/useSafeArea.ts +24 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,119 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#8](https://github.com/seedn-corp/basiln-packages-fe/pull/8) [`7c1a636`](https://github.com/seedn-corp/basiln-packages-fe/commit/7c1a636efe1ba5c04609094f0c359ca959adf0f4) Thanks [@im-binary](https://github.com/im-binary)! - 선언적으로 flex box를 적용하고 싶을 때 사용할 수 있는 유틸 컴포넌트 Flex 추가
8
+
9
+ ```tsx
10
+ // 사용 방법
11
+
12
+ <Flex justify="space-between" align="center">
13
+ ...
14
+ </Flex>
15
+ ```
16
+
17
+ - [#20](https://github.com/seedn-corp/basiln-packages-fe/pull/20) [`d26fcf7`](https://github.com/seedn-corp/basiln-packages-fe/commit/d26fcf7fb13987553af612bacafc814f3d6ee926) Thanks [@yoonhihi97](https://github.com/yoonhihi97)! - 정규식 검사를 할 수 있는 Validate 유틸 추가
18
+
19
+ ```tsx
20
+ Validate.email('basiln@basiln.com');
21
+ Validate.phoneNumber('basiln@basiln.com');
22
+ ```
23
+
24
+ - [#22](https://github.com/seedn-corp/basiln-packages-fe/pull/22) [`3f8b55e`](https://github.com/seedn-corp/basiln-packages-fe/commit/3f8b55e0125332036408cb91d2a255a4a8c51f3c) Thanks [@im-binary](https://github.com/im-binary)! - - Flex 유틸 컴포넌트의 속성 gap 을 number 타입도 허용
25
+
26
+ - [#24](https://github.com/seedn-corp/basiln-packages-fe/pull/24) [`dabf0c8`](https://github.com/seedn-corp/basiln-packages-fe/commit/dabf0c8154e7da5f0f12cb65142b396bb6e3c3f6) Thanks [@im-binary](https://github.com/im-binary)! - queryString을 create, parse, get, set할 때 사용할 수 있는 유틸입니다.
27
+
28
+ ```ts
29
+ // queryString create
30
+ queryString.create({ a: '1', b: '2' }); // ?a=1&b=2&c=3
31
+
32
+ // queryString parse
33
+ queryString.parse('?a=1&b=2&c=3'); // { a: '1', b: '2' }
34
+
35
+ // queryString get
36
+ queryString.get('a'); // '1'
37
+ queryString.get('a', parseInt); // 1
38
+
39
+ // queryString set
40
+ queryString.set({ qs: '?a=1', key: 'b', value: '2' }); // '?a=1&b=2'
41
+ ```
42
+
43
+ - [#13](https://github.com/seedn-corp/basiln-packages-fe/pull/13) [`68e5c1a`](https://github.com/seedn-corp/basiln-packages-fe/commit/68e5c1a57deb628f7322fff2e30c0e4be995ecb7) Thanks [@yoonhihi97](https://github.com/yoonhihi97)! - 16진수 컬러 코드를 rgba() 표기로 변환하는 유틸 추가
44
+
45
+ ```tsx
46
+ // 사용 방법
47
+
48
+ hexToRgba({ hex: '#000000', alpha: 0.5 }); // 'rgba(0, 0, 0, 0.5)'
49
+ hexToRgba({ hex: '#000', alpha: 0.5 }); // 'rgba(0, 0, 0, 0.5)'
50
+ ```
51
+
52
+ - [#25](https://github.com/seedn-corp/basiln-packages-fe/pull/25) [`203b91d`](https://github.com/seedn-corp/basiln-packages-fe/commit/203b91d64561931167fda6205422b34bb1962786) Thanks [@yoonhihi97](https://github.com/yoonhihi97)! - 웹뷰 환경에서 Safe Area를 선언적으로 사용할 수 있는 유틸 컴포넌트 추가
53
+
54
+ ```tsx
55
+ // 사용 방법
56
+
57
+ <SafeArea>
58
+ <p>안녕하세요</p>
59
+ </SafeArea>
60
+ ```
61
+
62
+ 웹뷰 환경에서 SafeArea 값을 사용하기 위한 유틸 추가
63
+
64
+ ```tsx
65
+ // 사용 방법
66
+
67
+ const { top } = useSafeArea();
68
+ ```
69
+
70
+ - [#19](https://github.com/seedn-corp/basiln-packages-fe/pull/19) [`2a2c812`](https://github.com/seedn-corp/basiln-packages-fe/commit/2a2c812494e63c599c573ff9bf8338a5b584928d) Thanks [@im-binary](https://github.com/im-binary)! - 선언적으로 요소들의 간격을 주고 싶을 때 사용할 수 있는 Spacing 유틸 컴포넌트 추가
71
+
72
+ ```tsx
73
+ // 사용 방법
74
+
75
+ <Spacing size={30}>
76
+
77
+ <Spacing size="3rem">
78
+
79
+ <Spacing size="30px" direction="horizontal">
80
+ ```
81
+
82
+ - [#11](https://github.com/seedn-corp/basiln-packages-fe/pull/11) [`2e1833e`](https://github.com/seedn-corp/basiln-packages-fe/commit/2e1833e76c920b97231671cc4f64bb17d68646b3) Thanks [@yoonhihi97](https://github.com/yoonhihi97)! - ellipsis 스타일링을 위한 유틸리티 추가
83
+
84
+ ```tsx
85
+ // ellipsis 사용 방법
86
+
87
+ <p css={ellipsis}>
88
+ ...
89
+ </p>
90
+
91
+ const Text = styled.p`
92
+ ...
93
+ ${ellipsis}
94
+ `
95
+
96
+ // multiLineEllipsis 사용 방법
97
+ // line: 몇번째 line에 ellipsis를 적용할지 지정
98
+ <p css={multiLineEllipsis({line: 3})}>
99
+ ...
100
+ </p>
101
+
102
+ const Text = styled.p`
103
+ ...
104
+ ${multiLineEllipsis({line: 3})}
105
+ `
106
+ ```
107
+
108
+ - [#16](https://github.com/seedn-corp/basiln-packages-fe/pull/16) [`044a33c`](https://github.com/seedn-corp/basiln-packages-fe/commit/044a33cee600fbd1de1ba0971f2e02ba4280227e) Thanks [@yoonhihi97](https://github.com/yoonhihi97)! - 한글 문자열에 맞는 조사를 반환하는 유틸 추가
109
+ (이/가, 을/를, 은/는 제공)
110
+
111
+ ```tsx
112
+ // 사용 방법
113
+ josa({ josa: '을/를', word: '망곰이' }); // 망곰이를
114
+ josa.pick({ josa: '은/는', word: '하츄핑' }); // 은
115
+ ```
116
+
3
117
  ## 0.1.1
4
118
 
5
119
  ### Patch Changes
package/dist/Choose.js ADDED
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/Choose.tsx
21
+ var Choose_exports = {};
22
+ __export(Choose_exports, {
23
+ Choose: () => Choose
24
+ });
25
+ module.exports = __toCommonJS(Choose_exports);
26
+ var import_react = require("react");
27
+ var import_jsx_runtime = require("react/jsx-runtime");
28
+ function Choose({ children }) {
29
+ const validChildren = import_react.Children.toArray(children);
30
+ const matchingChild = validChildren.find(
31
+ (child) => (0, import_react.isValidElement)(child) && child.type === Choose.When && child.props.condition
32
+ );
33
+ if (matchingChild) {
34
+ return matchingChild;
35
+ }
36
+ const otherwiseChild = validChildren.find(
37
+ (child) => (0, import_react.isValidElement)(child) && child.type === Choose.Otherwise
38
+ );
39
+ return otherwiseChild || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
40
+ }
41
+ var ChooseWhen = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
42
+ ChooseWhen.displayName = "Choose.When";
43
+ var ChooseOtherwise = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
44
+ Choose.When = ChooseWhen;
45
+ Choose.Otherwise = ChooseOtherwise;
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ Choose
49
+ });
50
+ //# sourceMappingURL=Choose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Choose.tsx"],"sourcesContent":["import { isValidElement, type ReactNode, type FC, Children } from 'react';\n\nexport type ChooseWhenProps = {\n condition: boolean;\n children: ReactNode;\n};\n\nexport type ChooseProps = {\n children: ReactNode;\n};\n\nexport type ChooseOtherwiseProps = {\n children: ReactNode;\n};\n\nexport function Choose({ children }: ChooseProps) {\n const validChildren = Children.toArray(children);\n\n const matchingChild = validChildren.find(\n (child) =>\n isValidElement<ChooseWhenProps>(child) &&\n child.type === Choose.When &&\n child.props.condition\n );\n\n if (matchingChild) {\n return matchingChild;\n }\n\n const otherwiseChild = validChildren.find(\n (child) => isValidElement(child) && child.type === Choose.Otherwise\n );\n\n return otherwiseChild || <></>;\n}\n\nconst ChooseWhen: FC<ChooseWhenProps> = ({ children }) => <>{children}</>;\nChooseWhen.displayName = 'Choose.When';\n\nconst ChooseOtherwise: FC<ChooseOtherwiseProps> = ({ children }) => (\n <>{children}</>\n);\n\nChoose.When = ChooseWhen;\nChoose.Otherwise = ChooseOtherwise;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkE;AAiCvC;AAlBpB,SAAS,OAAO,EAAE,SAAS,GAAgB;AAChD,QAAM,gBAAgB,sBAAS,QAAQ,QAAQ;AAE/C,QAAM,gBAAgB,cAAc;AAAA,IAClC,CAAC,cACC,6BAAgC,KAAK,KACrC,MAAM,SAAS,OAAO,QACtB,MAAM,MAAM;AAAA,EAChB;AAEA,MAAI,eAAe;AACjB,WAAO;AAAA,EACT;AAEA,QAAM,iBAAiB,cAAc;AAAA,IACnC,CAAC,cAAU,6BAAe,KAAK,KAAK,MAAM,SAAS,OAAO;AAAA,EAC5D;AAEA,SAAO,kBAAkB,2EAAE;AAC7B;AAEA,IAAM,aAAkC,CAAC,EAAE,SAAS,MAAM,2EAAG,UAAS;AACtE,WAAW,cAAc;AAEzB,IAAM,kBAA4C,CAAC,EAAE,SAAS,MAC5D,2EAAG,UAAS;AAGd,OAAO,OAAO;AACd,OAAO,YAAY;","names":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ Choose
3
+ } from "./chunk-7WNTKDNW.mjs";
4
+ export {
5
+ Choose
6
+ };
7
+ //# sourceMappingURL=Choose.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/Flex.js ADDED
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/Flex.tsx
21
+ var Flex_exports = {};
22
+ __export(Flex_exports, {
23
+ Container: () => Container,
24
+ Flex: () => Flex
25
+ });
26
+ module.exports = __toCommonJS(Flex_exports);
27
+ var import_react = require("react");
28
+ var import_styled_components = require("styled-components");
29
+
30
+ // src/coerceCssPixelValue.ts
31
+ function coerceCssPixelValue(value) {
32
+ return typeof value === "string" ? value : `${value}px`;
33
+ }
34
+
35
+ // src/Flex.tsx
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var Flex = (0, import_react.memo)(function Flex2(props) {
38
+ const {
39
+ gap = 0,
40
+ justify = "center",
41
+ align = "center",
42
+ direction = "row",
43
+ children,
44
+ ...restProps
45
+ } = props;
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ Container,
48
+ {
49
+ $gap: gap,
50
+ $justify: justify,
51
+ $align: align,
52
+ $direction: direction,
53
+ ...restProps,
54
+ children
55
+ }
56
+ );
57
+ });
58
+ var Container = import_styled_components.styled.div`
59
+ display: flex;
60
+ flex-direction: ${({ $direction }) => $direction};
61
+ gap: ${({ $gap }) => coerceCssPixelValue($gap)};
62
+ align-items: ${({ $align }) => $align};
63
+ justify-content: ${({ $justify }) => $justify};
64
+ `;
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ Container,
68
+ Flex
69
+ });
70
+ //# sourceMappingURL=Flex.js.map
@@ -0,0 +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;AAChD;;;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;AAAA,SAC/B,CAAC,EAAE,KAAK,MAAM,oBAAoB,IAAI;AAAA,iBAC9B,CAAC,EAAE,OAAO,MAAM;AAAA,qBACZ,CAAC,EAAE,SAAS,MAAM;AAAA;","names":["Flex"]}
package/dist/Flex.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ Container,
3
+ Flex
4
+ } from "./chunk-Q3B6WSD7.mjs";
5
+ import "./chunk-T7K7QYTL.mjs";
6
+ export {
7
+ Container,
8
+ Flex
9
+ };
10
+ //# sourceMappingURL=Flex.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/If.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/If.tsx
21
+ var If_exports = {};
22
+ __export(If_exports, {
23
+ If: () => If
24
+ });
25
+ module.exports = __toCommonJS(If_exports);
26
+ var import_jsx_runtime = require("react/jsx-runtime");
27
+ function If(props) {
28
+ const { condition, children } = props;
29
+ return condition ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children }) : null;
30
+ }
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ If
34
+ });
35
+ //# sourceMappingURL=If.js.map
package/dist/If.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/If.tsx"],"sourcesContent":["import { type ReactNode } from 'react';\n\nexport type IfProps = {\n condition: boolean;\n children: ReactNode;\n};\n\nexport function If(props: IfProps) {\n const { condition, children } = props;\n\n return condition ? <>{children}</> : null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUqB;AAHd,SAAS,GAAG,OAAgB;AACjC,QAAM,EAAE,WAAW,SAAS,IAAI;AAEhC,SAAO,YAAY,2EAAG,UAAS,IAAM;AACvC;","names":[]}
package/dist/If.mjs ADDED
@@ -0,0 +1,7 @@
1
+ import {
2
+ If
3
+ } from "./chunk-UFRXNT2I.mjs";
4
+ export {
5
+ If
6
+ };
7
+ //# sourceMappingURL=If.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/SafeArea.tsx
21
+ var SafeArea_exports = {};
22
+ __export(SafeArea_exports, {
23
+ SafeArea: () => SafeArea
24
+ });
25
+ module.exports = __toCommonJS(SafeArea_exports);
26
+ var import_react2 = require("react");
27
+
28
+ // src/Spacing.tsx
29
+ var import_react = require("react");
30
+ var import_styled_components = require("styled-components");
31
+
32
+ // src/coerceCssPixelValue.ts
33
+ function coerceCssPixelValue(value) {
34
+ return typeof value === "string" ? value : `${value}px`;
35
+ }
36
+
37
+ // src/Spacing.tsx
38
+ var import_jsx_runtime = require("react/jsx-runtime");
39
+ var Spacing = (0, import_react.memo)(function Spacing2(props) {
40
+ const { direction = "horizontal", size, ...restProps } = props;
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpacingContainer, { $direction: direction, $size: size, ...restProps });
42
+ });
43
+ var SpacingContainer = import_styled_components.styled.div`
44
+ flex: none;
45
+ width: ${({ $direction, $size }) => $direction === "horizontal" ? coerceCssPixelValue($size) : void 0};
46
+ height: ${({ $direction, $size }) => $direction === "vertical" ? coerceCssPixelValue($size) : void 0};
47
+ `;
48
+
49
+ // src/useSafeArea.ts
50
+ var useSafeArea = ({
51
+ top: T = 0,
52
+ bottom: B = 0,
53
+ left: L = 0,
54
+ right: R = 0
55
+ } = {}) => {
56
+ const top = `max(${coerceCssPixelValue(T)}, env(safe-area-inset-top))`;
57
+ const bottom = `max(${coerceCssPixelValue(B)}, env(safe-area-inset-bottom))`;
58
+ const left = `max(${coerceCssPixelValue(L)}, env(safe-area-inset-left))`;
59
+ const right = `max(${coerceCssPixelValue(R)}, env(safe-area-inset-right))`;
60
+ return { top, bottom, left, right };
61
+ };
62
+
63
+ // src/SafeArea.tsx
64
+ var import_jsx_runtime2 = require("react/jsx-runtime");
65
+ var SafeArea = ({
66
+ as,
67
+ children,
68
+ ...props
69
+ }) => {
70
+ const Component = as || "div";
71
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Component, { ...props, children: [
72
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SafeAreaTop, {}),
73
+ children,
74
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SafeAreaBottom, {})
75
+ ] });
76
+ };
77
+ var SafeAreaTop = (0, import_react2.memo)(function SafeAreaTop2(props) {
78
+ const { top } = useSafeArea();
79
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Spacing, { ...props, size: top });
80
+ });
81
+ var SafeAreaBottom = (0, import_react2.memo)(function SafeAreaBottom2(props) {
82
+ const { bottom } = useSafeArea();
83
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Spacing, { ...props, size: bottom });
84
+ });
85
+ SafeArea.Top = SafeAreaTop;
86
+ SafeArea.Bottom = SafeAreaBottom;
87
+ // Annotate the CommonJS export names for ESM import in node:
88
+ 0 && (module.exports = {
89
+ SafeArea
90
+ });
91
+ //# sourceMappingURL=SafeArea.js.map
@@ -0,0 +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 = 'horizontal', 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;AAChD;;;ADYI;AAJG,IAAM,cAAU,mBAAK,SAASC,SAAQ,OAAqB;AAChE,QAAM,EAAE,YAAY,cAAc,MAAM,GAAG,UAAU,IAAI;AAEzD,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;AAAA,YACnD,CAAC,EAAE,YAAY,MAAM,MAC7B,eAAe,aAAa,oBAAoB,KAAK,IAAI;AAAA;;;AEnB7D,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;AACxC,QAAM,SAAS,OAAO,oBAAoB,CAAC;AAC3C,QAAM,OAAO,OAAO,oBAAoB,CAAC;AACzC,QAAM,QAAQ,OAAO,oBAAoB,CAAC;AAE1C,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"]}
@@ -0,0 +1,10 @@
1
+ import {
2
+ SafeArea
3
+ } from "./chunk-WOYL5AA5.mjs";
4
+ import "./chunk-FUGA35PJ.mjs";
5
+ import "./chunk-LKUAG7PE.mjs";
6
+ import "./chunk-T7K7QYTL.mjs";
7
+ export {
8
+ SafeArea
9
+ };
10
+ //# sourceMappingURL=SafeArea.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/Spacing.tsx
21
+ var Spacing_exports = {};
22
+ __export(Spacing_exports, {
23
+ Spacing: () => Spacing
24
+ });
25
+ module.exports = __toCommonJS(Spacing_exports);
26
+ var import_react = require("react");
27
+ var import_styled_components = require("styled-components");
28
+
29
+ // src/coerceCssPixelValue.ts
30
+ function coerceCssPixelValue(value) {
31
+ return typeof value === "string" ? value : `${value}px`;
32
+ }
33
+
34
+ // src/Spacing.tsx
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var Spacing = (0, import_react.memo)(function Spacing2(props) {
37
+ const { direction = "horizontal", size, ...restProps } = props;
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpacingContainer, { $direction: direction, $size: size, ...restProps });
39
+ });
40
+ var SpacingContainer = import_styled_components.styled.div`
41
+ flex: none;
42
+ width: ${({ $direction, $size }) => $direction === "horizontal" ? coerceCssPixelValue($size) : void 0};
43
+ height: ${({ $direction, $size }) => $direction === "vertical" ? coerceCssPixelValue($size) : void 0};
44
+ `;
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 && (module.exports = {
47
+ Spacing
48
+ });
49
+ //# sourceMappingURL=Spacing.js.map
@@ -0,0 +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 = 'horizontal', 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;AAChD;;;ADYI;AAJG,IAAM,cAAU,mBAAK,SAASA,SAAQ,OAAqB;AAChE,QAAM,EAAE,YAAY,cAAc,MAAM,GAAG,UAAU,IAAI;AAEzD,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;AAAA,YACnD,CAAC,EAAE,YAAY,MAAM,MAC7B,eAAe,aAAa,oBAAoB,KAAK,IAAI;AAAA;","names":["Spacing"]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ Spacing
3
+ } from "./chunk-LKUAG7PE.mjs";
4
+ import "./chunk-T7K7QYTL.mjs";
5
+ export {
6
+ Spacing
7
+ };
8
+ //# sourceMappingURL=Spacing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/Validate.ts
21
+ var Validate_exports = {};
22
+ __export(Validate_exports, {
23
+ Validate: () => Validate
24
+ });
25
+ module.exports = __toCommonJS(Validate_exports);
26
+ function isEmail(email) {
27
+ const regExp = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
28
+ return regExp.test(email);
29
+ }
30
+ function isPhoneNumber(phoneNumber) {
31
+ const regExpWithHyphen = /^01([0|1|6|7|8|9])-([0-9]{3,4})-([0-9]{4})$/;
32
+ const regExpWithoutHyphen = /^01([0|1|6|7|8|9])([0-9]{3,4})([0-9]{4})$/;
33
+ return regExpWithHyphen.test(phoneNumber) || regExpWithoutHyphen.test(phoneNumber);
34
+ }
35
+ var Validate = {
36
+ email: isEmail,
37
+ phoneNumber: isPhoneNumber
38
+ };
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ Validate
42
+ });
43
+ //# sourceMappingURL=Validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Validate.ts"],"sourcesContent":["/**\n *\n * @see 이메일 주소가 RFC 5322 표준을 따르는지 검사합니다. {@link https://emailregex.com/}\n */\nfunction isEmail(email: string) {\n const regExp =\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return regExp.test(email);\n}\n\nfunction isPhoneNumber(phoneNumber: string) {\n // 하이픈 있는 형식\n const regExpWithHyphen = /^01([0|1|6|7|8|9])-([0-9]{3,4})-([0-9]{4})$/;\n // 하이픈 없는 형식\n const regExpWithoutHyphen = /^01([0|1|6|7|8|9])([0-9]{3,4})([0-9]{4})$/;\n\n return (\n regExpWithHyphen.test(phoneNumber) || regExpWithoutHyphen.test(phoneNumber)\n );\n}\n\nexport const Validate = {\n email: isEmail,\n phoneNumber: isPhoneNumber,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAS,QAAQ,OAAe;AAC9B,QAAM,SACJ;AACF,SAAO,OAAO,KAAK,KAAK;AAC1B;AAEA,SAAS,cAAc,aAAqB;AAE1C,QAAM,mBAAmB;AAEzB,QAAM,sBAAsB;AAE5B,SACE,iBAAiB,KAAK,WAAW,KAAK,oBAAoB,KAAK,WAAW;AAE9E;AAEO,IAAM,WAAW;AAAA,EACtB,OAAO;AAAA,EACP,aAAa;AACf;","names":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ Validate
3
+ } from "./chunk-R23KSR7N.mjs";
4
+ export {
5
+ Validate
6
+ };
7
+ //# sourceMappingURL=Validate.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,26 @@
1
+ // src/Choose.tsx
2
+ import { isValidElement, Children } from "react";
3
+ import { Fragment, jsx } from "react/jsx-runtime";
4
+ function Choose({ children }) {
5
+ const validChildren = Children.toArray(children);
6
+ const matchingChild = validChildren.find(
7
+ (child) => isValidElement(child) && child.type === Choose.When && child.props.condition
8
+ );
9
+ if (matchingChild) {
10
+ return matchingChild;
11
+ }
12
+ const otherwiseChild = validChildren.find(
13
+ (child) => isValidElement(child) && child.type === Choose.Otherwise
14
+ );
15
+ return otherwiseChild || /* @__PURE__ */ jsx(Fragment, {});
16
+ }
17
+ var ChooseWhen = ({ children }) => /* @__PURE__ */ jsx(Fragment, { children });
18
+ ChooseWhen.displayName = "Choose.When";
19
+ var ChooseOtherwise = ({ children }) => /* @__PURE__ */ jsx(Fragment, { children });
20
+ Choose.When = ChooseWhen;
21
+ Choose.Otherwise = ChooseOtherwise;
22
+
23
+ export {
24
+ Choose
25
+ };
26
+ //# sourceMappingURL=chunk-7WNTKDNW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Choose.tsx"],"sourcesContent":["import { isValidElement, type ReactNode, type FC, Children } from 'react';\n\nexport type ChooseWhenProps = {\n condition: boolean;\n children: ReactNode;\n};\n\nexport type ChooseProps = {\n children: ReactNode;\n};\n\nexport type ChooseOtherwiseProps = {\n children: ReactNode;\n};\n\nexport function Choose({ children }: ChooseProps) {\n const validChildren = Children.toArray(children);\n\n const matchingChild = validChildren.find(\n (child) =>\n isValidElement<ChooseWhenProps>(child) &&\n child.type === Choose.When &&\n child.props.condition\n );\n\n if (matchingChild) {\n return matchingChild;\n }\n\n const otherwiseChild = validChildren.find(\n (child) => isValidElement(child) && child.type === Choose.Otherwise\n );\n\n return otherwiseChild || <></>;\n}\n\nconst ChooseWhen: FC<ChooseWhenProps> = ({ children }) => <>{children}</>;\nChooseWhen.displayName = 'Choose.When';\n\nconst ChooseOtherwise: FC<ChooseOtherwiseProps> = ({ children }) => (\n <>{children}</>\n);\n\nChoose.When = ChooseWhen;\nChoose.Otherwise = ChooseOtherwise;\n"],"mappings":";AAAA,SAAS,gBAAyC,gBAAgB;AAiCvC;AAlBpB,SAAS,OAAO,EAAE,SAAS,GAAgB;AAChD,QAAM,gBAAgB,SAAS,QAAQ,QAAQ;AAE/C,QAAM,gBAAgB,cAAc;AAAA,IAClC,CAAC,UACC,eAAgC,KAAK,KACrC,MAAM,SAAS,OAAO,QACtB,MAAM,MAAM;AAAA,EAChB;AAEA,MAAI,eAAe;AACjB,WAAO;AAAA,EACT;AAEA,QAAM,iBAAiB,cAAc;AAAA,IACnC,CAAC,UAAU,eAAe,KAAK,KAAK,MAAM,SAAS,OAAO;AAAA,EAC5D;AAEA,SAAO,kBAAkB,gCAAE;AAC7B;AAEA,IAAM,aAAkC,CAAC,EAAE,SAAS,MAAM,gCAAG,UAAS;AACtE,WAAW,cAAc;AAEzB,IAAM,kBAA4C,CAAC,EAAE,SAAS,MAC5D,gCAAG,UAAS;AAGd,OAAO,OAAO;AACd,OAAO,YAAY;","names":[]}
@@ -0,0 +1,23 @@
1
+ import {
2
+ COMPLETE_HANGUL_END_CHARCODE,
3
+ COMPLETE_HANGUL_START_CHARCODE,
4
+ NUMBER_OF_JONGSEONG
5
+ } from "./chunk-GQPOYY4X.mjs";
6
+
7
+ // src/hasBatchim.ts
8
+ function hasBatchim(str) {
9
+ const lastChar = str[str.length - 1];
10
+ if (!lastChar)
11
+ return false;
12
+ const charCode = lastChar.charCodeAt(0);
13
+ if (charCode < COMPLETE_HANGUL_START_CHARCODE || charCode > COMPLETE_HANGUL_END_CHARCODE) {
14
+ return false;
15
+ }
16
+ const batchimCode = (charCode - COMPLETE_HANGUL_START_CHARCODE) % NUMBER_OF_JONGSEONG;
17
+ return batchimCode > 0;
18
+ }
19
+
20
+ export {
21
+ hasBatchim
22
+ };
23
+ //# sourceMappingURL=chunk-C7VOPXT2.mjs.map
@@ -0,0 +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;AAAU,WAAO;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":[]}