@k8o/arte-odyssey 0.0.0

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 (276) hide show
  1. package/LICENSE +21 -0
  2. package/dist/components/accordion/accordion-button.d.ts +2 -0
  3. package/dist/components/accordion/accordion-button.js +40 -0
  4. package/dist/components/accordion/accordion-item.d.ts +4 -0
  5. package/dist/components/accordion/accordion-item.js +11 -0
  6. package/dist/components/accordion/accordion-panel.d.ts +2 -0
  7. package/dist/components/accordion/accordion-panel.js +21 -0
  8. package/dist/components/accordion/accordion.d.ts +2 -0
  9. package/dist/components/accordion/accordion.js +17 -0
  10. package/dist/components/accordion/accordion.stories.js +89 -0
  11. package/dist/components/accordion/context.d.ts +10 -0
  12. package/dist/components/accordion/context.js +38 -0
  13. package/dist/components/accordion/index.d.ts +4 -0
  14. package/dist/components/accordion/index.js +4 -0
  15. package/dist/components/alert/alert.d.ts +8 -0
  16. package/dist/components/alert/alert.js +46 -0
  17. package/dist/components/alert/alert.stories.js +51 -0
  18. package/dist/components/alert/index.d.ts +1 -0
  19. package/dist/components/alert/index.js +1 -0
  20. package/dist/components/anchor/anchor.d.ts +14 -0
  21. package/dist/components/anchor/anchor.js +31 -0
  22. package/dist/components/anchor/anchor.stories.js +23 -0
  23. package/dist/components/anchor/index.d.ts +1 -0
  24. package/dist/components/anchor/index.js +1 -0
  25. package/dist/components/baseline-status/baseline-status.d.ts +16 -0
  26. package/dist/components/baseline-status/baseline-status.js +39 -0
  27. package/dist/components/baseline-status/baseline-status.stories.js +15 -0
  28. package/dist/components/baseline-status/index.d.ts +1 -0
  29. package/dist/components/baseline-status/index.js +1 -0
  30. package/dist/components/breadcrumb/breadcrumb.d.ts +18 -0
  31. package/dist/components/breadcrumb/breadcrumb.js +36 -0
  32. package/dist/components/breadcrumb/breadcrumb.stories.js +40 -0
  33. package/dist/components/breadcrumb/index.d.ts +1 -0
  34. package/dist/components/breadcrumb/index.js +1 -0
  35. package/dist/components/button/button.d.ts +10 -0
  36. package/dist/components/button/button.js +55 -0
  37. package/dist/components/button/button.stories.js +96 -0
  38. package/dist/components/button/index.d.ts +1 -0
  39. package/dist/components/button/index.js +1 -0
  40. package/dist/components/card/card.d.ts +3 -0
  41. package/dist/components/card/card.js +26 -0
  42. package/dist/components/card/card.stories.js +38 -0
  43. package/dist/components/card/index.d.ts +2 -0
  44. package/dist/components/card/index.js +2 -0
  45. package/dist/components/card/interactive-card.d.ts +3 -0
  46. package/dist/components/card/interactive-card.js +34 -0
  47. package/dist/components/card/type.d.ts +6 -0
  48. package/dist/components/card/type.js +0 -0
  49. package/dist/components/code/code.d.ts +4 -0
  50. package/dist/components/code/code.js +38 -0
  51. package/dist/components/code/code.stories.js +60 -0
  52. package/dist/components/code/index.d.ts +1 -0
  53. package/dist/components/code/index.js +4 -0
  54. package/dist/components/dialog/dialog.d.ts +17 -0
  55. package/dist/components/dialog/dialog.js +85 -0
  56. package/dist/components/dialog/dialog.stories.js +98 -0
  57. package/dist/components/dialog/index.d.ts +1 -0
  58. package/dist/components/dialog/index.js +1 -0
  59. package/dist/components/drawer/drawer.d.ts +6 -0
  60. package/dist/components/drawer/drawer.js +56 -0
  61. package/dist/components/drawer/drawer.stories.js +25 -0
  62. package/dist/components/drawer/index.d.ts +1 -0
  63. package/dist/components/drawer/index.js +1 -0
  64. package/dist/components/dropdown-menu/dropdown-menu.d.ts +24 -0
  65. package/dist/components/dropdown-menu/dropdown-menu.js +130 -0
  66. package/dist/components/dropdown-menu/dropdown-menu.stories.js +111 -0
  67. package/dist/components/dropdown-menu/hooks.d.ts +23 -0
  68. package/dist/components/dropdown-menu/hooks.js +56 -0
  69. package/dist/components/dropdown-menu/index.d.ts +1 -0
  70. package/dist/components/dropdown-menu/index.js +1 -0
  71. package/dist/components/error-boundary/index.d.ts +1 -0
  72. package/dist/components/error-boundary/index.js +4 -0
  73. package/dist/components/form/autocomplete/autocomplete.d.ts +14 -0
  74. package/dist/components/form/autocomplete/autocomplete.js +225 -0
  75. package/dist/components/form/autocomplete/autocomplete.stories.js +59 -0
  76. package/dist/components/form/autocomplete/index.d.ts +1 -0
  77. package/dist/components/form/autocomplete/index.js +1 -0
  78. package/dist/components/form/checkbox/checkbox.d.ts +8 -0
  79. package/dist/components/form/checkbox/checkbox.js +40 -0
  80. package/dist/components/form/checkbox/checkbox.stories.js +27 -0
  81. package/dist/components/form/checkbox/index.d.ts +1 -0
  82. package/dist/components/form/checkbox/index.js +1 -0
  83. package/dist/components/form/form-control/form-control.d.ts +20 -0
  84. package/dist/components/form/form-control/form-control.js +53 -0
  85. package/dist/components/form/form-control/form-control.stories.js +94 -0
  86. package/dist/components/form/form-control/index.d.ts +1 -0
  87. package/dist/components/form/form-control/index.js +1 -0
  88. package/dist/components/form/number-field/index.d.ts +1 -0
  89. package/dist/components/form/number-field/index.js +1 -0
  90. package/dist/components/form/number-field/number-field.d.ts +17 -0
  91. package/dist/components/form/number-field/number-field.js +150 -0
  92. package/dist/components/form/number-field/number-field.stories.js +106 -0
  93. package/dist/components/form/radio/index.d.ts +1 -0
  94. package/dist/components/form/radio/index.js +1 -0
  95. package/dist/components/form/radio/radio.d.ts +11 -0
  96. package/dist/components/form/radio/radio.js +51 -0
  97. package/dist/components/form/radio/radio.stories.js +55 -0
  98. package/dist/components/form/range-field/index.d.ts +1 -0
  99. package/dist/components/form/range-field/index.js +4 -0
  100. package/dist/components/form/range-field/range-field.d.ts +17 -0
  101. package/dist/components/form/range-field/range-field.js +54 -0
  102. package/dist/components/form/range-field/range-field.stories.js +162 -0
  103. package/dist/components/form/select/index.d.ts +1 -0
  104. package/dist/components/form/select/index.js +1 -0
  105. package/dist/components/form/select/select.d.ts +14 -0
  106. package/dist/components/form/select/select.js +39 -0
  107. package/dist/components/form/select/select.stories.js +58 -0
  108. package/dist/components/form/text-field/index.d.ts +1 -0
  109. package/dist/components/form/text-field/index.js +1 -0
  110. package/dist/components/form/text-field/text-field.d.ts +15 -0
  111. package/dist/components/form/text-field/text-field.js +40 -0
  112. package/dist/components/form/text-field/text-field.stories.js +61 -0
  113. package/dist/components/form/textarea/index.d.ts +1 -0
  114. package/dist/components/form/textarea/index.js +1 -0
  115. package/dist/components/form/textarea/textarea.d.ts +18 -0
  116. package/dist/components/form/textarea/textarea.js +56 -0
  117. package/dist/components/form/textarea/textarea.stories.js +92 -0
  118. package/dist/components/heading/heading.d.ts +8 -0
  119. package/dist/components/heading/heading.js +77 -0
  120. package/dist/components/heading/heading.stories.js +52 -0
  121. package/dist/components/heading/index.d.ts +1 -0
  122. package/dist/components/heading/index.js +1 -0
  123. package/dist/components/icon-button/icon-button.d.ts +8 -0
  124. package/dist/components/icon-button/icon-button.js +38 -0
  125. package/dist/components/icon-button/icon-button.stories.js +54 -0
  126. package/dist/components/icon-button/index.d.ts +1 -0
  127. package/dist/components/icon-button/index.js +1 -0
  128. package/dist/components/icon-link/icon-link.d.ts +17 -0
  129. package/dist/components/icon-link/icon-link.js +37 -0
  130. package/dist/components/icon-link/icon-link.stories.js +40 -0
  131. package/dist/components/icon-link/index.d.ts +1 -0
  132. package/dist/components/icon-link/index.js +1 -0
  133. package/dist/components/icons/arte-odyssey.d.ts +3 -0
  134. package/dist/components/icons/arte-odyssey.js +463 -0
  135. package/dist/components/icons/base.d.ts +9 -0
  136. package/dist/components/icons/base.js +13 -0
  137. package/dist/components/icons/github-mark.d.ts +3 -0
  138. package/dist/components/icons/github-mark.js +33 -0
  139. package/dist/components/icons/icons.stories.js +276 -0
  140. package/dist/components/icons/index.d.ts +7 -0
  141. package/dist/components/icons/index.js +7 -0
  142. package/dist/components/icons/logo.d.ts +6 -0
  143. package/dist/components/icons/logo.js +50 -0
  144. package/dist/components/icons/lucide.d.ts +50 -0
  145. package/dist/components/icons/lucide.js +569 -0
  146. package/dist/components/icons/qiita.d.ts +3 -0
  147. package/dist/components/icons/qiita.js +48 -0
  148. package/dist/components/icons/twitter.d.ts +3 -0
  149. package/dist/components/icons/twitter.js +34 -0
  150. package/dist/components/icons/zenn.d.ts +6 -0
  151. package/dist/components/icons/zenn.js +41 -0
  152. package/dist/components/index.d.ts +37 -0
  153. package/dist/components/index.js +37 -0
  154. package/dist/components/link-button/index.d.ts +1 -0
  155. package/dist/components/link-button/index.js +1 -0
  156. package/dist/components/link-button/link-button.d.ts +19 -0
  157. package/dist/components/link-button/link-button.js +46 -0
  158. package/dist/components/link-button/link-button.stories.js +51 -0
  159. package/dist/components/list-box/hooks.d.ts +37 -0
  160. package/dist/components/list-box/hooks.js +70 -0
  161. package/dist/components/list-box/index.d.ts +1 -0
  162. package/dist/components/list-box/index.js +1 -0
  163. package/dist/components/list-box/list-box.d.ts +22 -0
  164. package/dist/components/list-box/list-box.js +145 -0
  165. package/dist/components/list-box/list-box.stories.js +69 -0
  166. package/dist/components/modal/index.d.ts +1 -0
  167. package/dist/components/modal/index.js +1 -0
  168. package/dist/components/modal/modal.d.ts +8 -0
  169. package/dist/components/modal/modal.js +118 -0
  170. package/dist/components/modal/modal.stories.js +22 -0
  171. package/dist/components/popover/hooks.d.ts +65 -0
  172. package/dist/components/popover/hooks.js +187 -0
  173. package/dist/components/popover/index.d.ts +1 -0
  174. package/dist/components/popover/index.js +1 -0
  175. package/dist/components/popover/popover.d.ts +18 -0
  176. package/dist/components/popover/popover.js +141 -0
  177. package/dist/components/popover/popover.stories.js +45 -0
  178. package/dist/components/progress/index.d.ts +1 -0
  179. package/dist/components/progress/index.js +1 -0
  180. package/dist/components/progress/progress.d.ts +7 -0
  181. package/dist/components/progress/progress.js +21 -0
  182. package/dist/components/progress/progress.stories.js +16 -0
  183. package/dist/components/providers/component-provider.d.ts +2 -0
  184. package/dist/components/providers/component-provider.js +9 -0
  185. package/dist/components/providers/index.d.ts +2 -0
  186. package/dist/components/providers/index.js +2 -0
  187. package/dist/components/providers/portal-root.d.ts +5 -0
  188. package/dist/components/providers/portal-root.js +17 -0
  189. package/dist/components/scroll-linked/index.d.ts +1 -0
  190. package/dist/components/scroll-linked/index.js +1 -0
  191. package/dist/components/scroll-linked/scroll-linked.d.ts +2 -0
  192. package/dist/components/scroll-linked/scroll-linked.js +21 -0
  193. package/dist/components/scroll-linked/scroll-linked.stories.js +18 -0
  194. package/dist/components/separator/index.d.ts +1 -0
  195. package/dist/components/separator/index.js +1 -0
  196. package/dist/components/separator/separator.d.ts +4 -0
  197. package/dist/components/separator/separator.js +20 -0
  198. package/dist/components/separator/separator.stories.js +27 -0
  199. package/dist/components/tabs/index.d.ts +1 -0
  200. package/dist/components/tabs/index.js +1 -0
  201. package/dist/components/tabs/tabs.d.ts +16 -0
  202. package/dist/components/tabs/tabs.js +145 -0
  203. package/dist/components/tabs/tabs.stories.js +49 -0
  204. package/dist/components/text-tag/index.d.ts +1 -0
  205. package/dist/components/text-tag/index.js +1 -0
  206. package/dist/components/text-tag/text-tag.d.ts +5 -0
  207. package/dist/components/text-tag/text-tag.js +23 -0
  208. package/dist/components/text-tag/text-tag.stories.js +30 -0
  209. package/dist/components/toast/index.d.ts +1 -0
  210. package/dist/components/toast/index.js +5 -0
  211. package/dist/components/toast/provider.d.ts +11 -0
  212. package/dist/components/toast/provider.js +125 -0
  213. package/dist/components/toast/toast.d.ts +9 -0
  214. package/dist/components/toast/toast.js +19 -0
  215. package/dist/components/toast/toast.stories.js +45 -0
  216. package/dist/components/tooltip/index.d.ts +1 -0
  217. package/dist/components/tooltip/index.js +1 -0
  218. package/dist/components/tooltip/tooltip.d.ts +13 -0
  219. package/dist/components/tooltip/tooltip.js +60 -0
  220. package/dist/components/tooltip/tooltip.stories.js +40 -0
  221. package/dist/helpers/cn.d.ts +2 -0
  222. package/dist/helpers/cn.js +8 -0
  223. package/dist/helpers/color/find-all-colors.d.ts +12 -0
  224. package/dist/helpers/color/find-all-colors.js +210 -0
  225. package/dist/helpers/is-internal-route.d.ts +1 -0
  226. package/dist/helpers/is-internal-route.js +12 -0
  227. package/dist/helpers/number/between.d.ts +1 -0
  228. package/dist/helpers/number/between.js +19 -0
  229. package/dist/helpers/number/cast.d.ts +1 -0
  230. package/dist/helpers/number/cast.js +41 -0
  231. package/dist/helpers/number/commalize.d.ts +1 -0
  232. package/dist/helpers/number/commalize.js +22 -0
  233. package/dist/helpers/number/index.d.ts +4 -0
  234. package/dist/helpers/number/index.js +10 -0
  235. package/dist/helpers/number/to-precision.d.ts +1 -0
  236. package/dist/helpers/number/to-precision.js +17 -0
  237. package/dist/helpers/uuid-v4.d.ts +1 -0
  238. package/dist/helpers/uuid-v4.js +32 -0
  239. package/dist/hooks/click-away/index.d.ts +2 -0
  240. package/dist/hooks/click-away/index.js +24 -0
  241. package/dist/hooks/click-away/index.test.js +31 -0
  242. package/dist/hooks/client/index.d.ts +1 -0
  243. package/dist/hooks/client/index.js +12 -0
  244. package/dist/hooks/clipboard/index.d.ts +4 -0
  245. package/dist/hooks/clipboard/index.js +17 -0
  246. package/dist/hooks/clipboard/index.test.js +35 -0
  247. package/dist/hooks/hash/index.d.ts +1 -0
  248. package/dist/hooks/hash/index.js +28 -0
  249. package/dist/hooks/hash/index.test.js +46 -0
  250. package/dist/hooks/index.d.ts +10 -0
  251. package/dist/hooks/index.js +10 -0
  252. package/dist/hooks/interval/index.d.ts +1 -0
  253. package/dist/hooks/interval/index.js +17 -0
  254. package/dist/hooks/interval/index.test.js +32 -0
  255. package/dist/hooks/local-storage/index.d.ts +1 -0
  256. package/dist/hooks/local-storage/index.js +48 -0
  257. package/dist/hooks/local-storage/index.test.js +82 -0
  258. package/dist/hooks/scroll-direction/index.d.ts +6 -0
  259. package/dist/hooks/scroll-direction/index.js +40 -0
  260. package/dist/hooks/scroll-direction/index.test.js +174 -0
  261. package/dist/hooks/step/index.d.ts +13 -0
  262. package/dist/hooks/step/index.js +39 -0
  263. package/dist/hooks/step/index.test.js +85 -0
  264. package/dist/hooks/timeout/index.d.ts +1 -0
  265. package/dist/hooks/timeout/index.js +17 -0
  266. package/dist/hooks/timeout/index.test.js +31 -0
  267. package/dist/hooks/window-size/index.d.ts +6 -0
  268. package/dist/hooks/window-size/index.js +22 -0
  269. package/dist/hooks/window-size/index.test.js +18 -0
  270. package/dist/index.d.ts +2 -0
  271. package/dist/index.js +2 -0
  272. package/dist/package.json +6 -0
  273. package/dist/styles/index.css +394 -0
  274. package/dist/types/variables.d.ts +6 -0
  275. package/dist/types/variables.js +0 -0
  276. package/package.json +110 -0
@@ -0,0 +1,92 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Textarea } from "./textarea";
3
+ const meta = {
4
+ title: "components/form/textarea",
5
+ component: Textarea,
6
+ decorators: [
7
+ (Story) => /* @__PURE__ */ jsx("div", { className: "h-screen", children: /* @__PURE__ */ jsx(Story, {}) })
8
+ ],
9
+ args: {
10
+ id: "textarea",
11
+ describedbyId: "textarea-feedback",
12
+ value: "10",
13
+ onChange: (e) => {
14
+ console.log(e.target.value);
15
+ }
16
+ },
17
+ parameters: {
18
+ a11y: {
19
+ options: {
20
+ rules: {
21
+ // TextArea単体ではラベルを付随しない
22
+ label: { enabled: false },
23
+ "label-title-only": { enabled: false }
24
+ }
25
+ }
26
+ }
27
+ }
28
+ };
29
+ var textarea_stories_default = meta;
30
+ const Default = {
31
+ args: {
32
+ isDisabled: false,
33
+ isInvalid: false,
34
+ isRequired: false
35
+ }
36
+ };
37
+ const FullHeight = {
38
+ args: {
39
+ isDisabled: false,
40
+ isInvalid: false,
41
+ isRequired: false,
42
+ fullHeight: true
43
+ }
44
+ };
45
+ const AutoResize = {
46
+ args: {
47
+ isDisabled: false,
48
+ isInvalid: false,
49
+ isRequired: false,
50
+ autoResize: true
51
+ }
52
+ };
53
+ const Rows = {
54
+ args: {
55
+ isDisabled: false,
56
+ isInvalid: false,
57
+ isRequired: false,
58
+ rows: 10
59
+ }
60
+ };
61
+ const Placeholder = {
62
+ args: {
63
+ isDisabled: false,
64
+ isInvalid: false,
65
+ isRequired: false,
66
+ placeholder: "10\u9032\u6570"
67
+ }
68
+ };
69
+ const Invalid = {
70
+ args: {
71
+ isDisabled: false,
72
+ isInvalid: true,
73
+ isRequired: false
74
+ }
75
+ };
76
+ const Disabled = {
77
+ args: {
78
+ isDisabled: true,
79
+ isInvalid: false,
80
+ isRequired: false
81
+ }
82
+ };
83
+ export {
84
+ AutoResize,
85
+ Default,
86
+ Disabled,
87
+ FullHeight,
88
+ Invalid,
89
+ Placeholder,
90
+ Rows,
91
+ textarea_stories_default as default
92
+ };
@@ -0,0 +1,8 @@
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ type Props = PropsWithChildren<{
3
+ id?: string;
4
+ type: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
5
+ lineClamp?: number;
6
+ }>;
7
+ export declare const Heading: FC<Props>;
8
+ export {};
@@ -0,0 +1,77 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "./../../helpers/cn";
3
+ const Heading = ({ children, id, type, lineClamp }) => {
4
+ if (type === "h1") {
5
+ return /* @__PURE__ */ jsx(
6
+ "h1",
7
+ {
8
+ className: cn("font-bold text-2xl md:text-3xl", {
9
+ [`line-clamp-${lineClamp?.toString() ?? ""}`]: lineClamp
10
+ }),
11
+ id,
12
+ children
13
+ }
14
+ );
15
+ }
16
+ if (type === "h2") {
17
+ return /* @__PURE__ */ jsx(
18
+ "h2",
19
+ {
20
+ className: cn("font-bold text-xl md:text-2xl", {
21
+ [`line-clamp-${lineClamp?.toString() ?? ""}`]: lineClamp
22
+ }),
23
+ id,
24
+ children
25
+ }
26
+ );
27
+ }
28
+ if (type === "h3") {
29
+ return /* @__PURE__ */ jsx(
30
+ "h3",
31
+ {
32
+ className: cn("font-bold text-lg md:text-xl", {
33
+ [`line-clamp-${lineClamp?.toString() ?? ""}`]: lineClamp
34
+ }),
35
+ id,
36
+ children
37
+ }
38
+ );
39
+ }
40
+ if (type === "h4") {
41
+ return /* @__PURE__ */ jsx(
42
+ "h4",
43
+ {
44
+ className: cn("font-bold text-md md:text-lg", {
45
+ [`line-clamp-${lineClamp?.toString() ?? ""}`]: lineClamp
46
+ }),
47
+ id,
48
+ children
49
+ }
50
+ );
51
+ }
52
+ if (type === "h5") {
53
+ return /* @__PURE__ */ jsx(
54
+ "h5",
55
+ {
56
+ className: cn("font-bold text-sm md:text-md", {
57
+ [`line-clamp-${lineClamp?.toString() ?? ""}`]: lineClamp
58
+ }),
59
+ id,
60
+ children
61
+ }
62
+ );
63
+ }
64
+ return /* @__PURE__ */ jsx(
65
+ "h6",
66
+ {
67
+ className: cn("font-bold text-xs md:text-sm", {
68
+ [`line-clamp-${lineClamp?.toString() ?? ""}`]: lineClamp
69
+ }),
70
+ id,
71
+ children
72
+ }
73
+ );
74
+ };
75
+ export {
76
+ Heading
77
+ };
@@ -0,0 +1,52 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Heading } from "./heading";
3
+ const meta = {
4
+ title: "components/heading",
5
+ component: Heading
6
+ };
7
+ var heading_stories_default = meta;
8
+ const H1 = {
9
+ args: {
10
+ type: "h1"
11
+ },
12
+ render: (args) => /* @__PURE__ */ jsx(Heading, { ...args, children: "k8o" })
13
+ };
14
+ const H2 = {
15
+ args: {
16
+ type: "h2"
17
+ },
18
+ render: (args) => /* @__PURE__ */ jsx(Heading, { ...args, children: "k8o" })
19
+ };
20
+ const H3 = {
21
+ args: {
22
+ type: "h3"
23
+ },
24
+ render: (args) => /* @__PURE__ */ jsx(Heading, { ...args, children: "k8o" })
25
+ };
26
+ const H4 = {
27
+ args: {
28
+ type: "h4"
29
+ },
30
+ render: (args) => /* @__PURE__ */ jsx(Heading, { ...args, children: "k8o" })
31
+ };
32
+ const H5 = {
33
+ args: {
34
+ type: "h5"
35
+ },
36
+ render: (args) => /* @__PURE__ */ jsx(Heading, { ...args, children: "k8o" })
37
+ };
38
+ const H6 = {
39
+ args: {
40
+ type: "h6"
41
+ },
42
+ render: (args) => /* @__PURE__ */ jsx(Heading, { ...args, children: "k8o" })
43
+ };
44
+ export {
45
+ H1,
46
+ H2,
47
+ H3,
48
+ H4,
49
+ H5,
50
+ H6,
51
+ heading_stories_default as default
52
+ };
@@ -0,0 +1 @@
1
+ export * from './heading';
@@ -0,0 +1 @@
1
+ export * from "./heading";
@@ -0,0 +1,8 @@
1
+ import type { FC, HTMLProps } from 'react';
2
+ type Props = {
3
+ size?: 'sm' | 'md' | 'lg';
4
+ bg?: 'transparent' | 'base' | 'primary';
5
+ label: string;
6
+ } & Omit<HTMLProps<HTMLButtonElement>, 'size' | 'type'>;
7
+ export declare const IconButton: FC<Props>;
8
+ export {};
@@ -0,0 +1,38 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "./../../helpers/cn";
3
+ const IconButton = ({
4
+ ref,
5
+ size = "md",
6
+ bg = "transparent",
7
+ label,
8
+ children,
9
+ ...props
10
+ }) => {
11
+ return /* @__PURE__ */ jsxs(
12
+ "button",
13
+ {
14
+ "aria-label": props.role ? label : void 0,
15
+ className: cn(
16
+ "inline-flex rounded-full bg-transparent",
17
+ "hover:bg-bg-subtle",
18
+ "focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info active:bg-bg-emphasize",
19
+ bg === "base" && "bg-bg-base/90",
20
+ bg === "transparent" && "bg-transparent",
21
+ bg === "primary" && "bg-primary-bg/90 hover:bg-primary-bg active:bg-primary-bg-emphasize",
22
+ size === "sm" && "p-1",
23
+ size === "md" && "p-2",
24
+ size === "lg" && "p-3",
25
+ props.disabled && "cursor-not-allowed opacity-50 hover:bg-transparent active:bg-transparent"
26
+ ),
27
+ ref,
28
+ ...props,
29
+ children: [
30
+ !props.role && /* @__PURE__ */ jsx("span", { className: "sr-only", children: label }),
31
+ children
32
+ ]
33
+ }
34
+ );
35
+ };
36
+ export {
37
+ IconButton
38
+ };
@@ -0,0 +1,54 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { CopyIcon } from "../icons";
3
+ import { IconButton } from "./icon-button";
4
+ const meta = {
5
+ title: "components/button/icon-button",
6
+ component: IconButton,
7
+ args: {
8
+ onClick: () => {
9
+ console.log("clicked");
10
+ },
11
+ label: "Copy",
12
+ children: /* @__PURE__ */ jsx(CopyIcon, {})
13
+ }
14
+ };
15
+ var icon_button_stories_default = meta;
16
+ const Large = {
17
+ args: {
18
+ size: "lg"
19
+ }
20
+ };
21
+ const Medium = {
22
+ args: {
23
+ size: "md"
24
+ }
25
+ };
26
+ const Small = {
27
+ args: {
28
+ size: "sm"
29
+ }
30
+ };
31
+ const Disabled = {
32
+ args: {
33
+ disabled: true
34
+ }
35
+ };
36
+ const BgBase = {
37
+ args: {
38
+ bg: "base"
39
+ }
40
+ };
41
+ const BgPrimary = {
42
+ args: {
43
+ bg: "primary"
44
+ }
45
+ };
46
+ export {
47
+ BgBase,
48
+ BgPrimary,
49
+ Disabled,
50
+ Large,
51
+ Medium,
52
+ Small,
53
+ icon_button_stories_default as default
54
+ };
@@ -0,0 +1 @@
1
+ export * from './icon-button';
@@ -0,0 +1 @@
1
+ export * from "./icon-button";
@@ -0,0 +1,17 @@
1
+ import type { FC, PropsWithChildren, ReactNode } from 'react';
2
+ type IconLinkProps = PropsWithChildren<{
3
+ size?: 'sm' | 'md' | 'lg';
4
+ bg?: 'transparent' | 'base';
5
+ label?: string;
6
+ href: string;
7
+ openInNewTab?: boolean;
8
+ renderAnchor?: (props: {
9
+ href: string;
10
+ className: string;
11
+ target?: string;
12
+ rel?: string;
13
+ children: ReactNode;
14
+ }) => ReactNode;
15
+ }>;
16
+ export declare const IconLink: FC<IconLinkProps>;
17
+ export {};
@@ -0,0 +1,37 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "./../../helpers/cn";
3
+ import { isInternalRoute } from "./../../helpers/is-internal-route";
4
+ const IconLink = ({
5
+ size = "md",
6
+ bg = "transparent",
7
+ label,
8
+ href,
9
+ children,
10
+ openInNewTab = false,
11
+ renderAnchor = ({ children: children2, ...props }) => /* @__PURE__ */ jsx("a", { ...props, children: children2 })
12
+ }) => {
13
+ const type = isInternalRoute(href) && !openInNewTab ? "internal" : "external";
14
+ const props = type === "internal" ? {} : {
15
+ target: "_blank",
16
+ rel: "noopener noreferrer"
17
+ };
18
+ return renderAnchor({
19
+ href,
20
+ className: cn(
21
+ "inline-flex rounded-full hover:bg-bg-subtle active:bg-bg-emphasize focus-visible:ring-2 focus-visible:ring-border-info",
22
+ bg === "base" && "bg-bg-base/90",
23
+ bg === "transparent" && "bg-transparent",
24
+ size === "sm" && "p-1",
25
+ size === "md" && "p-2",
26
+ size === "lg" && "p-3"
27
+ ),
28
+ ...props,
29
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
30
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: label }),
31
+ children
32
+ ] })
33
+ });
34
+ };
35
+ export {
36
+ IconLink
37
+ };
@@ -0,0 +1,40 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { CopyIcon } from "../icons";
3
+ import { IconLink } from "./icon-link";
4
+ const meta = {
5
+ title: "components/icon-link",
6
+ component: IconLink,
7
+ args: {
8
+ href: "https://example.com",
9
+ children: /* @__PURE__ */ jsx(CopyIcon, {}),
10
+ label: "Copy to clipboard"
11
+ }
12
+ };
13
+ var icon_link_stories_default = meta;
14
+ const Large = {
15
+ args: {
16
+ size: "lg"
17
+ }
18
+ };
19
+ const Medium = {
20
+ args: {
21
+ size: "md"
22
+ }
23
+ };
24
+ const Small = {
25
+ args: {
26
+ size: "sm"
27
+ }
28
+ };
29
+ const BgBase = {
30
+ args: {
31
+ bg: "base"
32
+ }
33
+ };
34
+ export {
35
+ BgBase,
36
+ Large,
37
+ Medium,
38
+ Small,
39
+ icon_link_stories_default as default
40
+ };
@@ -0,0 +1 @@
1
+ export * from './icon-link';
@@ -0,0 +1 @@
1
+ export * from "./icon-link";
@@ -0,0 +1,3 @@
1
+ import type { FC } from 'react';
2
+ import { type BaseIconProps } from './base';
3
+ export declare const ArteOdyssey: FC<Partial<BaseIconProps>>;