daleui 0.0.2 → 0.0.5

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 (176) hide show
  1. package/README.md +43 -0
  2. package/dist/check-DEVerfH5.js +72 -0
  3. package/dist/components/Box/Box.d.ts +34 -0
  4. package/dist/components/Box/Box.js +34 -0
  5. package/dist/components/Button/Button.d.ts +37 -0
  6. package/dist/components/Button/Button.js +367 -0
  7. package/dist/components/Card/Card.d.ts +68 -0
  8. package/dist/components/Card/Card.js +132 -0
  9. package/dist/components/Checkbox/Checkbox.d.ts +34 -0
  10. package/dist/components/Checkbox/Checkbox.js +657 -0
  11. package/dist/components/Flex/Flex.d.ts +361 -0
  12. package/dist/components/Flex/Flex.js +65 -0
  13. package/dist/components/HStack/HStack.d.ts +23 -0
  14. package/dist/components/HStack/HStack.js +35 -0
  15. package/dist/components/Heading/Heading.d.ts +33 -0
  16. package/dist/components/Heading/Heading.js +67 -0
  17. package/dist/components/Icon/Icon.d.ts +20 -0
  18. package/dist/components/Icon/Icon.js +325 -0
  19. package/dist/components/Label/Label.d.ts +35 -0
  20. package/dist/components/Label/Label.js +74 -0
  21. package/dist/components/Link/Link.d.ts +33 -0
  22. package/dist/components/Link/Link.js +176 -0
  23. package/dist/components/PasswordInput/PasswordInput.d.ts +17 -0
  24. package/dist/components/PasswordInput/PasswordInput.js +151 -0
  25. package/dist/components/RadioGroup/RadioGroup.d.ts +82 -0
  26. package/dist/components/RadioGroup/RadioGroup.js +713 -0
  27. package/dist/components/Select/Select.d.ts +39 -0
  28. package/dist/components/Select/Select.js +222 -0
  29. package/dist/components/Tag/Tag.d.ts +26 -0
  30. package/dist/components/Tag/Tag.js +189 -0
  31. package/dist/components/Text/Text.d.ts +22 -0
  32. package/dist/components/Text/Text.js +115 -0
  33. package/dist/components/TextInput/TextInput.d.ts +21 -0
  34. package/dist/components/TextInput/TextInput.js +106 -0
  35. package/dist/components/VStack/VStack.d.ts +23 -0
  36. package/dist/components/VStack/VStack.js +35 -0
  37. package/dist/css-QiVVeZaw.js +212 -0
  38. package/dist/cva-BrKodHDH.js +57 -0
  39. package/dist/cx-DN21T1EH.js +9 -0
  40. package/dist/hstack-cCrHxysi.js +43 -0
  41. package/dist/index.css +1 -0
  42. package/dist/index.d.ts +18 -0
  43. package/dist/index.js +37 -0
  44. package/dist/tokens/colors.d.ts +4 -0
  45. package/dist/tokens/iconography.d.ts +45 -0
  46. package/dist/tokens/spacing.d.ts +42 -0
  47. package/dist/tokens/typography.d.ts +312 -0
  48. package/dist/use-locale-context-DYXE7B4r.js +775 -0
  49. package/package.json +62 -39
  50. package/styled-system/css/conditions.mjs +36 -0
  51. package/styled-system/css/css.d.ts +22 -0
  52. package/styled-system/css/css.mjs +45 -0
  53. package/styled-system/css/cva.d.ts +6 -0
  54. package/styled-system/css/cva.mjs +87 -0
  55. package/styled-system/css/cx.d.ts +5 -0
  56. package/styled-system/css/cx.mjs +15 -0
  57. package/styled-system/css/index.d.ts +5 -0
  58. package/styled-system/css/index.mjs +4 -0
  59. package/styled-system/css/sva.d.ts +4 -0
  60. package/styled-system/css/sva.mjs +46 -0
  61. package/styled-system/helpers.mjs +316 -0
  62. package/styled-system/patterns/aspect-ratio.d.ts +20 -0
  63. package/styled-system/patterns/aspect-ratio.mjs +38 -0
  64. package/styled-system/patterns/bleed.d.ts +21 -0
  65. package/styled-system/patterns/bleed.mjs +24 -0
  66. package/styled-system/patterns/box.d.ts +20 -0
  67. package/styled-system/patterns/box.mjs +15 -0
  68. package/styled-system/patterns/center.d.ts +20 -0
  69. package/styled-system/patterns/center.mjs +21 -0
  70. package/styled-system/patterns/circle.d.ts +20 -0
  71. package/styled-system/patterns/circle.mjs +25 -0
  72. package/styled-system/patterns/container.d.ts +20 -0
  73. package/styled-system/patterns/container.mjs +21 -0
  74. package/styled-system/patterns/cq.d.ts +21 -0
  75. package/styled-system/patterns/cq.mjs +21 -0
  76. package/styled-system/patterns/divider.d.ts +22 -0
  77. package/styled-system/patterns/divider.mjs +25 -0
  78. package/styled-system/patterns/flex.d.ts +26 -0
  79. package/styled-system/patterns/flex.mjs +26 -0
  80. package/styled-system/patterns/float.d.ts +23 -0
  81. package/styled-system/patterns/float.mjs +52 -0
  82. package/styled-system/patterns/grid-item.d.ts +25 -0
  83. package/styled-system/patterns/grid-item.mjs +25 -0
  84. package/styled-system/patterns/grid.d.ts +24 -0
  85. package/styled-system/patterns/grid.mjs +27 -0
  86. package/styled-system/patterns/hstack.d.ts +21 -0
  87. package/styled-system/patterns/hstack.mjs +24 -0
  88. package/styled-system/patterns/index.d.ts +21 -0
  89. package/styled-system/patterns/index.mjs +20 -0
  90. package/styled-system/patterns/link-overlay.d.ts +20 -0
  91. package/styled-system/patterns/link-overlay.mjs +24 -0
  92. package/styled-system/patterns/spacer.d.ts +20 -0
  93. package/styled-system/patterns/spacer.mjs +21 -0
  94. package/styled-system/patterns/square.d.ts +20 -0
  95. package/styled-system/patterns/square.mjs +24 -0
  96. package/styled-system/patterns/stack.d.ts +23 -0
  97. package/styled-system/patterns/stack.mjs +24 -0
  98. package/styled-system/patterns/visually-hidden.d.ts +20 -0
  99. package/styled-system/patterns/visually-hidden.mjs +18 -0
  100. package/styled-system/patterns/vstack.d.ts +21 -0
  101. package/styled-system/patterns/vstack.mjs +24 -0
  102. package/styled-system/patterns/wrap.d.ts +24 -0
  103. package/styled-system/patterns/wrap.mjs +25 -0
  104. package/styled-system/tokens/index.d.ts +9 -0
  105. package/styled-system/tokens/index.mjs +3176 -0
  106. package/styled-system/tokens/tokens.d.ts +63 -0
  107. package/styled-system/types/composition.d.ts +224 -0
  108. package/styled-system/types/conditions.d.ts +310 -0
  109. package/styled-system/types/csstype.d.ts +21298 -0
  110. package/styled-system/types/global.d.ts +20 -0
  111. package/styled-system/types/index.d.ts +7 -0
  112. package/styled-system/types/parts.d.ts +8 -0
  113. package/styled-system/types/pattern.d.ts +78 -0
  114. package/styled-system/types/prop-type.d.ts +265 -0
  115. package/styled-system/types/recipe.d.ts +181 -0
  116. package/styled-system/types/selectors.d.ts +59 -0
  117. package/styled-system/types/static-css.d.ts +56 -0
  118. package/styled-system/types/style-props.d.ts +7504 -0
  119. package/styled-system/types/system-types.d.ts +269 -0
  120. package/.github/CODEOWNERS +0 -1
  121. package/.github/FUNDING.yml +0 -1
  122. package/.github/workflows/automation.yml +0 -13
  123. package/.github/workflows/chromatic.yml +0 -19
  124. package/.github/workflows/deployment.yml +0 -32
  125. package/.github/workflows/integration.yml +0 -15
  126. package/.github/workflows/storybook-tests.yml +0 -17
  127. package/.storybook/main.ts +0 -18
  128. package/.storybook/preview.ts +0 -29
  129. package/.storybook/test-runner.ts +0 -33
  130. package/bun.lock +0 -2099
  131. package/chromatic.config.json +0 -5
  132. package/eslint.config.js +0 -28
  133. package/index.html +0 -13
  134. package/panda.config.ts +0 -61
  135. package/postcss.config.cjs +0 -5
  136. package/public/logo.svg +0 -9
  137. package/src/App.tsx +0 -67
  138. package/src/assets/Discord.svg +0 -1
  139. package/src/assets/GitHub.svg +0 -1
  140. package/src/assets/LinkedIn.svg +0 -1
  141. package/src/assets/Medium.svg +0 -1
  142. package/src/assets/YouTube.svg +0 -1
  143. package/src/components/Button/Button.stories.tsx +0 -115
  144. package/src/components/Button/Button.test.tsx +0 -108
  145. package/src/components/Button/Button.tsx +0 -245
  146. package/src/components/Button/index.tsx +0 -1
  147. package/src/components/Checkbox/Checkbox.stories.tsx +0 -129
  148. package/src/components/Checkbox/Checkbox.test.tsx +0 -169
  149. package/src/components/Checkbox/Checkbox.tsx +0 -190
  150. package/src/components/Heading/Heading.stories.tsx +0 -72
  151. package/src/components/Heading/Heading.test.tsx +0 -55
  152. package/src/components/Heading/Heading.tsx +0 -73
  153. package/src/components/Heading/index.tsx +0 -1
  154. package/src/components/Icon/Icon.stories.tsx +0 -106
  155. package/src/components/Icon/Icon.test.tsx +0 -44
  156. package/src/components/Icon/Icon.tsx +0 -116
  157. package/src/components/Icon/index.tsx +0 -1
  158. package/src/components/Text/Text.stories.tsx +0 -65
  159. package/src/components/Text/Text.test.tsx +0 -54
  160. package/src/components/Text/Text.tsx +0 -93
  161. package/src/components/Text/index.tsx +0 -1
  162. package/src/index.css +0 -2
  163. package/src/main.tsx +0 -10
  164. package/src/setupTests.tsx +0 -5
  165. package/src/styles/globalCss.ts +0 -43
  166. package/src/tokens/colors.mdx +0 -100
  167. package/src/tokens/colors.ts +0 -288
  168. package/src/tokens/iconography.mdx +0 -15
  169. package/src/tokens/iconography.tsx +0 -54
  170. package/src/tokens/typography.mdx +0 -38
  171. package/src/tokens/typography.ts +0 -132
  172. package/src/vite-env.d.ts +0 -2
  173. package/tsconfig.app.json +0 -25
  174. package/tsconfig.json +0 -7
  175. package/tsconfig.node.json +0 -22
  176. package/vite.config.ts +0 -16
package/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  [![NPM Version](https://img.shields.io/npm/v/daleui)](https://www.npmjs.com/package/daleui)
2
2
  [![Chromatic 🎨](https://github.com/DaleStudy/daleui/actions/workflows/chromatic.yml/badge.svg)](https://github.com/DaleStudy/daleui/actions/workflows/chromatic.yml)
3
3
  [![Integration 🔀](https://github.com/DaleStudy/daleui/actions/workflows/integration.yml/badge.svg)](https://github.com/DaleStudy/daleui/actions/workflows/integration.yml)
4
+ [![codecov](https://codecov.io/github/DaleStudy/daleui/graph/badge.svg)](https://codecov.io/github/DaleStudy/daleui)
5
+ [![bundle size](https://codecov.io/github/DaleStudy/daleui/graph/bundle/daleui-bundle-esm/badge.svg)](https://app.codecov.io/github/DaleStudy/daleui/bundles/main/daleui-bundle-esm)
6
+ [![All Contributors](https://img.shields.io/github/all-contributors/DaleStudy/daleui?color=ee8449&style=flat-square)](#contributors)
4
7
 
5
8
  # 달레 UI
6
9
 
@@ -8,3 +11,43 @@
8
11
 
9
12
  - [스토리북](https://main--675790d317ba346348aa3490.chromatic.com)
10
13
  - [위키](https://github.com/DaleStudy/daleui/wiki)
14
+
15
+ ## Contributors ✨
16
+
17
+ 이 프로젝트는 [all-contributors](https://github.com/all-contributors/all-contributors) 스펙을 따릅니다. 모든 종류의 기여를 환영합니다!
18
+
19
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
20
+ <!-- prettier-ignore-start -->
21
+ <!-- markdownlint-disable -->
22
+ <table>
23
+ <tbody>
24
+ <tr>
25
+ <td align="center" valign="top" width="14.28%"><a href="https://www.daleseo.com/"><img src="https://avatars.githubusercontent.com/u/5466341?v=4?s=100" width="100px;" alt="Dale Seo"/><br /><sub><b>Dale Seo</b></sub></a><br /><a href="https://github.com/DaleStudy/daleui/commits?author=DaleSeo" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=DaleSeo" title="Documentation">📖</a></td>
26
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/yolophg"><img src="https://avatars.githubusercontent.com/u/38199103?v=4?s=100" width="100px;" alt="Helena Park"/><br /><sub><b>Helena Park</b></sub></a><br /><a href="https://github.com/DaleStudy/daleui/commits?author=yolophg" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=yolophg" title="Documentation">📖</a></td>
27
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/sounmind"><img src="https://avatars.githubusercontent.com/u/37020415?v=4?s=100" width="100px;" alt="Evan Suhyeong Lee"/><br /><sub><b>Evan Suhyeong Lee</b></sub></a><br /><a href="https://github.com/DaleStudy/daleui/commits?author=sounmind" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=sounmind" title="Documentation">📖</a></td>
28
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/hyoseong1994"><img src="https://avatars.githubusercontent.com/u/50227228?v=4?s=100" width="100px;" alt="hyoseong"/><br /><sub><b>hyoseong</b></sub></a><br /><a href="#blog-hyoseong1994" title="Blogposts">📝</a> <a href="https://github.com/DaleStudy/daleui/commits?author=hyoseong1994" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=hyoseong1994" title="Documentation">📖</a></td>
29
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/RiaOh"><img src="https://avatars.githubusercontent.com/u/83909755?v=4?s=100" width="100px;" alt="오예림 Ria Oh"/><br /><sub><b>오예림 Ria Oh</b></sub></a><br /><a href="https://github.com/DaleStudy/daleui/commits?author=RiaOh" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=RiaOh" title="Documentation">📖</a></td>
30
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/Lustellz"><img src="https://avatars.githubusercontent.com/u/45252527?v=4?s=100" width="100px;" alt="Tasha(살미)"/><br /><sub><b>Tasha(살미)</b></sub></a><br /><a href="https://github.com/DaleStudy/daleui/commits?author=Lustellz" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=Lustellz" title="Documentation">📖</a></td>
31
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/y00eunji"><img src="https://avatars.githubusercontent.com/u/27201591?v=4?s=100" width="100px;" alt="유은지"/><br /><sub><b>유은지</b></sub></a><br /><a href="https://github.com/DaleStudy/daleui/commits?author=y00eunji" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=y00eunji" title="Documentation">📖</a></td>
32
+ </tr>
33
+ <tr>
34
+ <td align="center" valign="top" width="14.28%"><a href="https://velog.io/@hecklebot"><img src="https://avatars.githubusercontent.com/u/51806574?v=4?s=100" width="100px;" alt="Hansaem.so"/><br /><sub><b>Hansaem.so</b></sub></a><br /><a href="https://github.com/DaleStudy/daleui/commits?author=Hecklebot" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=Hecklebot" title="Documentation">📖</a></td>
35
+ <td align="center" valign="top" width="14.28%"><a href="https://seozi.io/"><img src="https://avatars.githubusercontent.com/u/30362922?v=4?s=100" width="100px;" alt="서진혁 (Aka)"/><br /><sub><b>서진혁 (Aka)</b></sub></a><br /><a href="https://github.com/DaleStudy/daleui/commits?author=HowToBeAHappyBoy" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=HowToBeAHappyBoy" title="Documentation">📖</a></td>
36
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/sseung30"><img src="https://avatars.githubusercontent.com/u/69985950?v=4?s=100" width="100px;" alt="seunghyun"/><br /><sub><b>seunghyun</b></sub></a><br /><a href="#design-sseung30" title="Design">🎨</a></td>
37
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/jj5u"><img src="https://avatars.githubusercontent.com/u/89135410?v=4?s=100" width="100px;" alt="Jahye"/><br /><sub><b>Jahye</b></sub></a><br /><a href="#design-jj5u" title="Design">🎨</a></td>
38
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/boldkang"><img src="https://avatars.githubusercontent.com/u/202710030?v=4?s=100" width="100px;" alt="mkang"/><br /><sub><b>mkang</b></sub></a><br /><a href="#blog-boldkang" title="Blogposts">📝</a> <a href="#design-boldkang" title="Design">🎨</a></td>
39
+ <td align="center" valign="top" width="14.28%"><a href="https://sunjae95.github.io/"><img src="https://avatars.githubusercontent.com/u/63578094?v=4?s=100" width="100px;" alt="이선재"/><br /><sub><b>이선재</b></sub></a><br /><a href="#blog-Sunjae95" title="Blogposts">📝</a> <a href="https://github.com/DaleStudy/daleui/commits?author=Sunjae95" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=Sunjae95" title="Documentation">📖</a></td>
40
+ <td align="center" valign="top" width="14.28%"><a href="https://sehwanlee.dev/"><img src="https://avatars.githubusercontent.com/u/39740066?v=4?s=100" width="100px;" alt="Sehwan"/><br /><sub><b>Sehwan</b></sub></a><br /><a href="#blog-nhistory" title="Blogposts">📝</a> <a href="https://github.com/DaleStudy/daleui/commits?author=nhistory" title="Code">💻</a> <a href="https://github.com/DaleStudy/daleui/commits?author=nhistory" title="Documentation">📖</a></td>
41
+ </tr>
42
+ <tr>
43
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/bkidea"><img src="https://avatars.githubusercontent.com/u/201320266?v=4?s=100" width="100px;" alt="BK LEE"/><br /><sub><b>BK LEE</b></sub></a><br /><a href="#design-bkidea" title="Design">🎨</a></td>
44
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/graycrisp"><img src="https://avatars.githubusercontent.com/u/51190669?v=4?s=100" width="100px;" alt="graycrisp"/><br /><sub><b>graycrisp</b></sub></a><br /><a href="#design-graycrisp" title="Design">🎨</a></td>
45
+ <td align="center" valign="top" width="14.28%"><a href="https://lylamin.com/"><img src="https://avatars.githubusercontent.com/u/50537876?v=4?s=100" width="100px;" alt="Lyla (Minju) Park"/><br /><sub><b>Lyla (Minju) Park</b></sub></a><br /><a href="https://github.com/DaleStudy/daleui/commits?author=lylaminju" title="Code">💻</a></td>
46
+ </tr>
47
+ </tbody>
48
+ </table>
49
+
50
+ <!-- markdownlint-restore -->
51
+ <!-- prettier-ignore-end -->
52
+
53
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
@@ -0,0 +1,72 @@
1
+ import { forwardRef as l, createElement as n } from "react";
2
+ const h = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (t) => t.replace(
3
+ /^([A-Z])|[\s-_]+(\w)/g,
4
+ (e, r, o) => o ? o.toUpperCase() : r.toLowerCase()
5
+ ), i = (t) => {
6
+ const e = w(t);
7
+ return e.charAt(0).toUpperCase() + e.slice(1);
8
+ }, u = (...t) => t.filter((e, r, o) => !!e && e.trim() !== "" && o.indexOf(e) === r).join(" ").trim(), f = (t) => {
9
+ for (const e in t)
10
+ if (e.startsWith("aria-") || e === "role" || e === "title")
11
+ return !0;
12
+ };
13
+ var g = {
14
+ xmlns: "http://www.w3.org/2000/svg",
15
+ width: 24,
16
+ height: 24,
17
+ viewBox: "0 0 24 24",
18
+ fill: "none",
19
+ stroke: "currentColor",
20
+ strokeWidth: 2,
21
+ strokeLinecap: "round",
22
+ strokeLinejoin: "round"
23
+ };
24
+ const k = l(
25
+ ({
26
+ color: t = "currentColor",
27
+ size: e = 24,
28
+ strokeWidth: r = 2,
29
+ absoluteStrokeWidth: o,
30
+ className: a = "",
31
+ children: s,
32
+ iconNode: p,
33
+ ...c
34
+ }, C) => n(
35
+ "svg",
36
+ {
37
+ ref: C,
38
+ ...g,
39
+ width: e,
40
+ height: e,
41
+ stroke: t,
42
+ strokeWidth: o ? Number(r) * 24 / Number(e) : r,
43
+ className: u("lucide", a),
44
+ ...!s && !f(c) && { "aria-hidden": "true" },
45
+ ...c
46
+ },
47
+ [
48
+ ...p.map(([d, m]) => n(d, m)),
49
+ ...Array.isArray(s) ? s : [s]
50
+ ]
51
+ )
52
+ );
53
+ const A = (t, e) => {
54
+ const r = l(
55
+ ({ className: o, ...a }, s) => n(k, {
56
+ ref: s,
57
+ iconNode: e,
58
+ className: u(
59
+ `lucide-${h(i(t))}`,
60
+ `lucide-${t}`,
61
+ o
62
+ ),
63
+ ...a
64
+ })
65
+ );
66
+ return r.displayName = i(t), r;
67
+ };
68
+ const b = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], L = A("check", b);
69
+ export {
70
+ L as C,
71
+ A as c
72
+ };
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ import type { Spacing } from "../../tokens/spacing";
3
+ type As = "div" | "section" | "article" | "main" | "aside" | "header" | "footer" | "nav" | "span";
4
+ type CSSLength = `${number}px` | `${number}em` | `${number}rem` | `${number}%`;
5
+ export interface BoxProps extends React.HTMLAttributes<HTMLElement> {
6
+ /** 자식 요소들 */
7
+ children?: React.ReactNode;
8
+ /** 렌더링할 HTML 요소 */
9
+ as?: As;
10
+ /** padding */
11
+ padding?: Spacing;
12
+ /** margin */
13
+ margin?: Spacing;
14
+ /** 너비 (예: "100px", "2rem", "2em", "50%") */
15
+ width?: CSSLength;
16
+ /** 높이 (예: "100px", "2rem", "2em", "50%") */
17
+ height?: CSSLength;
18
+ }
19
+ /**
20
+ * Box는 가장 기본적인 레이아웃 컴포넌트입니다.
21
+ *
22
+ * - `children` 속성을 통해서 자식 요소들을 전달할 수 있습니다.
23
+ * - `as` 속성을 통해서 렌더링할 HTML 요소를 지정할 수 있습니다. 기본값은 `div`입니다.
24
+ * - `padding`, `margin` 속성을 통해서 spacing을 지정할 수 있습니다.
25
+ * - `width`, `height` 속성을 통해서 크기를 지정할 수 있습니다.
26
+ * - `className` 속성을 통해서 추가 스타일을 적용할 수 있습니다.
27
+ * - `as="span"`을 사용할 경우, span은 기본적으로 `inline` 요소이므로 `width`와 `height` 속성이 적용되지 않습니다.
28
+ *
29
+ * ### 접근성(Accessibility) 안내
30
+ * - 이미 시맨틱 태그를 쓰면(as=`nav` | `main` | `aside` | `footer` 등) 중복 role 지정은 피하시길 바랍니다.
31
+ * - 접근성을 위해 기본적으로 적절한 HTML 시맨틱 요소를 사용하고 필요시 ARIA 속성을 활용하여 접근성을 향상시킵니다.
32
+ */
33
+ export declare const Box: ({ children, as, padding, margin, width, height, className, ...rest }: BoxProps) => import("react/jsx-runtime").JSX.Element;
34
+ export {};
@@ -0,0 +1,34 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import "react";
3
+ import { c as x } from "../../css-QiVVeZaw.js";
4
+ import { c as f } from "../../cx-DN21T1EH.js";
5
+ const b = ({
6
+ children: t,
7
+ as: r = "div",
8
+ padding: c,
9
+ margin: m,
10
+ width: o,
11
+ height: s,
12
+ className: n,
13
+ ...e
14
+ }) => {
15
+ const i = r, p = x({
16
+ padding: c,
17
+ margin: m
18
+ }), a = {
19
+ ...o !== void 0 && { width: o },
20
+ ...s !== void 0 && { height: s }
21
+ };
22
+ return /* @__PURE__ */ l(
23
+ i,
24
+ {
25
+ className: f(p, n),
26
+ style: a,
27
+ ...e,
28
+ children: t
29
+ }
30
+ );
31
+ };
32
+ export {
33
+ b as Box
34
+ };
@@ -0,0 +1,37 @@
1
+ import { type HTMLAttributes } from "react";
2
+ import { type IconName } from "../../tokens/iconography";
3
+ type size = "sm" | "md" | "lg";
4
+ /** 공통 버튼 속성 */
5
+ export interface ButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, "style"> {
6
+ /** 버튼 텍스트 */
7
+ children: string;
8
+ /** 버튼 비활성화 여부 */
9
+ disabled?: boolean;
10
+ /** 버튼 너비 100% */
11
+ fullWidth?: boolean;
12
+ loading?: boolean;
13
+ /** 좌측 아이콘 */
14
+ leftIcon?: IconName;
15
+ /** 우측 아이콘 */
16
+ rightIcon?: IconName;
17
+ /** 클릭 시 실행함수 */
18
+ onClick?: () => void;
19
+ /** 버튼의 크기 */
20
+ size?: size;
21
+ /** 버튼의 색상 강조 */
22
+ tone?: "brand" | "neutral" | "danger";
23
+ /** 타입 */
24
+ type?: "button" | "submit" | "reset";
25
+ /** 버튼의 스타일 종류 */
26
+ variant?: "solid" | "outline" | "ghost";
27
+ }
28
+ /**
29
+ * - `variant` 속성으로 버튼의 스타일 종류를 지정할 수 있습니다.
30
+ * - `tone` 속성으로 버튼의 색상 강조를 지정할 수 있습니다.
31
+ * - `size` 속성으로 버튼의 크기를 지정할 수 있습니다.
32
+ * - `type` 속성으로 버튼의 타입을 지정할 수 있습니다.
33
+ * - `disabled` 속성을 사용하여 버튼을 비활성화할 수 있습니다.
34
+ * - `loading` 속성을 사용하여 버튼을 로딩 상태로 지정할 수 있습니다.
35
+ */
36
+ export declare const Button: ({ children, variant, disabled, fullWidth, loading, leftIcon, rightIcon, onClick, size, tone, type, ...rest }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
37
+ export {};
@@ -0,0 +1,367 @@
1
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import { c as r } from "../../css-QiVVeZaw.js";
4
+ import { c as f } from "../../cx-DN21T1EH.js";
5
+ import { c as m } from "../../cva-BrKodHDH.js";
6
+ import { Icon as t } from "../Icon/Icon.js";
7
+ import { h as p } from "../../hstack-cCrHxysi.js";
8
+ const j = ({
9
+ children: c,
10
+ variant: i = "solid",
11
+ disabled: l,
12
+ fullWidth: g,
13
+ loading: s,
14
+ leftIcon: a,
15
+ rightIcon: n,
16
+ onClick: b,
17
+ size: o = "md",
18
+ tone: v = "brand",
19
+ type: u = "button",
20
+ ...h
21
+ }) => /* @__PURE__ */ d(
22
+ "button",
23
+ {
24
+ className: x({
25
+ tone: v ?? (i === "ghost" ? "neutral" : "brand"),
26
+ variant: i,
27
+ size: o,
28
+ disabled: l,
29
+ fullWidth: g
30
+ }),
31
+ type: u,
32
+ onClick: b,
33
+ disabled: l,
34
+ ...h,
35
+ children: [
36
+ /* @__PURE__ */ d(
37
+ "div",
38
+ {
39
+ className: f(
40
+ p({ gap: "4" }),
41
+ r({ visibility: s ? "hidden" : "visible" })
42
+ ),
43
+ children: [
44
+ a && /* @__PURE__ */ e("span", { className: r({ flexShrink: 0 }), children: /* @__PURE__ */ e(
45
+ t,
46
+ {
47
+ "data-testid": `icon-${a}`,
48
+ name: a,
49
+ size: o
50
+ }
51
+ ) }),
52
+ /* @__PURE__ */ e(
53
+ "span",
54
+ {
55
+ className: r({
56
+ whiteSpace: "normal",
57
+ wordBreak: "keep-all",
58
+ overflowWrap: "anywhere"
59
+ }),
60
+ children: c
61
+ }
62
+ ),
63
+ n && /* @__PURE__ */ e("span", { className: r({ flexShrink: 0 }), children: /* @__PURE__ */ e(
64
+ t,
65
+ {
66
+ "data-testid": `icon-${n}`,
67
+ name: n,
68
+ size: o
69
+ }
70
+ ) })
71
+ ]
72
+ }
73
+ ),
74
+ s && /* @__PURE__ */ e(
75
+ "div",
76
+ {
77
+ className: r({
78
+ position: "absolute",
79
+ top: "50%",
80
+ left: "50%",
81
+ transform: "translate(-50%, -50%)"
82
+ }),
83
+ children: /* @__PURE__ */ e(
84
+ t,
85
+ {
86
+ name: "loaderCircle",
87
+ size: o,
88
+ "data-testid": "button-loader",
89
+ className: r({
90
+ animation: "spin 1s linear infinite"
91
+ })
92
+ }
93
+ )
94
+ }
95
+ )
96
+ ]
97
+ }
98
+ ), x = m({
99
+ base: {
100
+ appearance: "none",
101
+ margin: "0",
102
+ fontWeight: 500,
103
+ textAlign: "center",
104
+ textDecoration: "none",
105
+ display: "flex",
106
+ alignItems: "center",
107
+ justifyContent: "center",
108
+ width: "auto",
109
+ borderRadius: "sm",
110
+ cursor: "pointer",
111
+ transition: "0.2s",
112
+ lineHeight: "1",
113
+ outline: "0",
114
+ position: "relative",
115
+ boxSizing: "border-box",
116
+ "&:disabled": {
117
+ cursor: "not-allowed"
118
+ },
119
+ "&:focus-visible": {
120
+ outlineStyle: "solid",
121
+ outlineWidth: "sm",
122
+ outlineOffset: "3px"
123
+ }
124
+ },
125
+ variants: {
126
+ size: {
127
+ sm: {
128
+ px: "8",
129
+ py: "4",
130
+ height: "32px",
131
+ fontSize: "sm"
132
+ },
133
+ md: {
134
+ px: "12",
135
+ py: "4",
136
+ height: "40px",
137
+ fontSize: "md"
138
+ },
139
+ lg: {
140
+ px: "16",
141
+ py: "8",
142
+ height: "48px",
143
+ fontSize: "lg"
144
+ }
145
+ },
146
+ variant: {
147
+ solid: {},
148
+ outline: {},
149
+ ghost: {
150
+ bg: "transparent",
151
+ border: "none"
152
+ }
153
+ },
154
+ tone: {
155
+ brand: {},
156
+ neutral: {},
157
+ danger: {}
158
+ },
159
+ disabled: {
160
+ true: {},
161
+ false: {}
162
+ },
163
+ fullWidth: {
164
+ true: {
165
+ width: "100%"
166
+ },
167
+ false: {}
168
+ }
169
+ },
170
+ compoundVariants: [
171
+ {
172
+ variant: "solid",
173
+ tone: "brand",
174
+ css: {
175
+ bg: "bgSolid.brand",
176
+ color: "fgSolid.brand",
177
+ "&:hover": {
178
+ bg: "bgSolid.brand.hover"
179
+ },
180
+ "&:active": {
181
+ bg: "bgSolid.brand.active"
182
+ }
183
+ }
184
+ },
185
+ {
186
+ variant: "solid",
187
+ tone: "neutral",
188
+ css: {
189
+ bg: "bgSolid.neutral",
190
+ color: "fgSolid.neutral",
191
+ "&:hover": {
192
+ bg: "bgSolid.neutral.hover"
193
+ },
194
+ "&:active": {
195
+ bg: "bgSolid.neutral.active"
196
+ }
197
+ }
198
+ },
199
+ {
200
+ variant: "solid",
201
+ tone: "danger",
202
+ css: {
203
+ bg: "bgSolid.danger",
204
+ color: "fgSolid.danger",
205
+ "&:hover": {
206
+ bg: "bgSolid.danger.hover"
207
+ },
208
+ "&:active": {
209
+ bg: "bgSolid.danger.active"
210
+ }
211
+ }
212
+ },
213
+ {
214
+ variant: "outline",
215
+ tone: "brand",
216
+ css: {
217
+ border: "brand",
218
+ borderWidth: "sm",
219
+ color: "fg.brand",
220
+ "&:hover": {
221
+ color: "fg.brand.hover",
222
+ backgroundColor: "bg.brand.hover"
223
+ },
224
+ "&:active": {
225
+ color: "fg.brand.active",
226
+ backgroundColor: "bg.brand.active"
227
+ }
228
+ }
229
+ },
230
+ {
231
+ variant: "outline",
232
+ tone: "neutral",
233
+ css: {
234
+ border: "neutral",
235
+ borderWidth: "sm",
236
+ color: "fg.neutral",
237
+ "&:hover": {
238
+ color: "fg.neutral.hover",
239
+ backgroundColor: "bg.neutral.hover"
240
+ },
241
+ "&:active": {
242
+ color: "fg.neutral.active",
243
+ backgroundColor: "bg.neutral.active"
244
+ }
245
+ }
246
+ },
247
+ {
248
+ variant: "outline",
249
+ tone: "danger",
250
+ css: {
251
+ border: "danger",
252
+ borderWidth: "sm",
253
+ color: "fg.danger",
254
+ "&:hover": {
255
+ color: "fg.danger.hover",
256
+ backgroundColor: "bg.danger.hover"
257
+ },
258
+ "&:active": {
259
+ color: "fg.danger.active",
260
+ backgroundColor: "bg.danger.active"
261
+ }
262
+ }
263
+ },
264
+ {
265
+ variant: "outline",
266
+ size: "sm",
267
+ css: {
268
+ px: "0.4rem"
269
+ }
270
+ },
271
+ {
272
+ variant: "outline",
273
+ size: "md",
274
+ css: {
275
+ px: "0.65rem"
276
+ }
277
+ },
278
+ {
279
+ variant: "outline",
280
+ size: "lg",
281
+ css: {
282
+ px: "0.9rem"
283
+ }
284
+ },
285
+ {
286
+ variant: "ghost",
287
+ tone: "brand",
288
+ css: {
289
+ color: "fg.brand",
290
+ "&:hover": {
291
+ bg: "bg.brand.hover",
292
+ color: "fg.brand.hover"
293
+ },
294
+ "&:active": {
295
+ bg: "bg.brand.active",
296
+ color: "fg.brand.active"
297
+ }
298
+ }
299
+ },
300
+ {
301
+ variant: "ghost",
302
+ tone: "neutral",
303
+ css: {
304
+ color: "fg.neutral",
305
+ "&:hover": {
306
+ bg: "bg.neutral.hover",
307
+ color: "fg.neutral.hover"
308
+ },
309
+ "&:active": {
310
+ bg: "bg.neutral.active",
311
+ color: "fg.neutral.active"
312
+ }
313
+ }
314
+ },
315
+ {
316
+ variant: "ghost",
317
+ tone: "danger",
318
+ css: {
319
+ color: "fg.danger",
320
+ "&:hover": {
321
+ bg: "bg.danger.hover",
322
+ color: "fg.danger.hover"
323
+ },
324
+ "&:active": {
325
+ bg: "bg.danger.active",
326
+ color: "fg.danger.active"
327
+ }
328
+ }
329
+ },
330
+ {
331
+ disabled: !0,
332
+ css: {
333
+ bg: "bg.neutral.disabled!",
334
+ color: "fg.neutral.disabled!",
335
+ border: "none!"
336
+ }
337
+ },
338
+ // borders 토큰과 스타일이 달라 별도로 설정
339
+ {
340
+ tone: "brand",
341
+ css: {
342
+ "&:focus-visible": {
343
+ outlineColor: "border.brand.focus"
344
+ }
345
+ }
346
+ },
347
+ {
348
+ tone: "neutral",
349
+ css: {
350
+ "&:focus-visible": {
351
+ outlineColor: "border.neutral.focus"
352
+ }
353
+ }
354
+ },
355
+ {
356
+ tone: "danger",
357
+ css: {
358
+ "&:focus-visible": {
359
+ outlineColor: "border.danger"
360
+ }
361
+ }
362
+ }
363
+ ]
364
+ });
365
+ export {
366
+ j as Button
367
+ };
@@ -0,0 +1,68 @@
1
+ import type { AnchorHTMLAttributes, HTMLAttributes, ReactNode, SVGProps } from "react";
2
+ import type { Tone } from "../../tokens/colors";
3
+ import type { IconName } from "../../tokens/iconography";
4
+ interface CardRootProps extends Omit<HTMLAttributes<HTMLElement>, "style"> {
5
+ /** 색조 */
6
+ tone?: Extract<Tone, "neutral" | "brand">;
7
+ /** border 여부 */
8
+ outline?: boolean;
9
+ children: ReactNode;
10
+ }
11
+ declare function CardRoot({ tone, outline, className, children, ...rest }: CardRootProps): import("react/jsx-runtime").JSX.Element;
12
+ interface CardBodyProps extends Omit<HTMLAttributes<HTMLDivElement>, "style"> {
13
+ children: ReactNode;
14
+ }
15
+ declare function CardBody({ className, children, ...rest }: CardBodyProps): import("react/jsx-runtime").JSX.Element;
16
+ interface CardIconProps extends SVGProps<SVGSVGElement> {
17
+ /** 아이콘 이름 */
18
+ name: IconName;
19
+ /** 아이콘 크기 */
20
+ size?: "sm" | "md" | "lg";
21
+ }
22
+ declare function CardIcon({ name, size, ...rest }: CardIconProps): import("react/jsx-runtime").JSX.Element;
23
+ interface CardTitleProps extends Omit<HTMLAttributes<HTMLElement>, "style"> {
24
+ children: ReactNode;
25
+ }
26
+ declare function CardTitle({ children, ...rest }: CardTitleProps): import("react/jsx-runtime").JSX.Element;
27
+ interface CardDescriptionProps extends Omit<HTMLAttributes<HTMLElement>, "style"> {
28
+ children: ReactNode;
29
+ }
30
+ declare function CardDescription({ children, ...rest }: CardDescriptionProps): import("react/jsx-runtime").JSX.Element;
31
+ interface CardLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
32
+ children: ReactNode;
33
+ /** 링크 URL */
34
+ href: string;
35
+ /** 외부 링크 여부 (true일 경우 새 탭에서 열리며 아이콘 추가) */
36
+ external?: boolean;
37
+ }
38
+ declare function CardLink({ children, href, external, ...rest }: CardLinkProps): import("react/jsx-runtime").JSX.Element;
39
+ /**
40
+ * Card의 최상위 컨테이너입니다. tone과 outline 속성을 설정하며,
41
+ * tone은 하위의 Icon과 Link 컴포넌트에 자동으로 전달됩니다.
42
+ */
43
+ export declare const Card: typeof CardRoot & {
44
+ /**
45
+ * Card의 제목과 설명을 감싸는 컨테이너입니다.
46
+ * 제목과 설명 사이의 간격을 관리합니다.
47
+ */
48
+ Body: typeof CardBody;
49
+ /**
50
+ * Card의 아이콘을 표시합니다. Card 바로 아래에 배치하며,
51
+ * tone은 Card로부터 자동으로 전달받습니다.
52
+ */
53
+ Icon: typeof CardIcon;
54
+ /**
55
+ * Card의 제목을 표시합니다. CardBody 안에서 사용합니다.
56
+ */
57
+ Title: typeof CardTitle;
58
+ /**
59
+ * Card의 설명을 표시합니다. CardBody 안에서 CardTitle 아래에 사용합니다.
60
+ */
61
+ Description: typeof CardDescription;
62
+ /**
63
+ * Card 하단에 링크를 표시합니다. tone은 Card로부터 자동으로 전달받으며,
64
+ * external prop이 true일 경우 외부 링크 아이콘이 자동으로 추가됩니다.
65
+ */
66
+ Link: typeof CardLink;
67
+ };
68
+ export {};