@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,40 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Breadcrumb } from "./breadcrumb";
3
+ const meta = {
4
+ title: "components/breadcrumb",
5
+ component: Breadcrumb.List
6
+ };
7
+ var breadcrumb_stories_default = meta;
8
+ const Medium = {
9
+ render: () => /* @__PURE__ */ jsxs(Breadcrumb.List, { children: [
10
+ /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.Link, { href: "/", children: "Home" }) }),
11
+ /* @__PURE__ */ jsx(Breadcrumb.Separator, {}),
12
+ /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.Link, { href: "/quizzes", children: "Quizzes" }) }),
13
+ /* @__PURE__ */ jsx(Breadcrumb.Separator, {}),
14
+ /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.Link, { current: true, href: "/quizzes/fish-kanji", children: "\u3046\u304A\u3078\u3093\u30AF\u30A4\u30BA" }) })
15
+ ] })
16
+ };
17
+ const Large = {
18
+ render: () => /* @__PURE__ */ jsxs(Breadcrumb.List, { size: "lg", children: [
19
+ /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.Link, { href: "/", children: "Home" }) }),
20
+ /* @__PURE__ */ jsx(Breadcrumb.Separator, {}),
21
+ /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.Link, { href: "/quizzes", children: "Quizzes" }) }),
22
+ /* @__PURE__ */ jsx(Breadcrumb.Separator, {}),
23
+ /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.Link, { current: true, href: "/quizzes/fish-kanji", children: "\u3046\u304A\u3078\u3093\u30AF\u30A4\u30BA" }) })
24
+ ] })
25
+ };
26
+ const Small = {
27
+ render: () => /* @__PURE__ */ jsxs(Breadcrumb.List, { size: "sm", children: [
28
+ /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.Link, { href: "/", children: "Home" }) }),
29
+ /* @__PURE__ */ jsx(Breadcrumb.Separator, {}),
30
+ /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.Link, { href: "/quizzes", children: "Quizzes" }) }),
31
+ /* @__PURE__ */ jsx(Breadcrumb.Separator, {}),
32
+ /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.Link, { current: true, href: "/quizzes/fish-kanji", children: "\u3046\u304A\u3078\u3093\u30AF\u30A4\u30BA" }) })
33
+ ] })
34
+ };
35
+ export {
36
+ Large,
37
+ Medium,
38
+ Small,
39
+ breadcrumb_stories_default as default
40
+ };
@@ -0,0 +1 @@
1
+ export * from './breadcrumb';
@@ -0,0 +1 @@
1
+ export * from "./breadcrumb";
@@ -0,0 +1,10 @@
1
+ import type { FC, HTMLProps, ReactNode } from 'react';
2
+ export declare const Button: FC<{
3
+ type?: 'button' | 'submit';
4
+ size?: 'sm' | 'md' | 'lg';
5
+ color?: 'primary' | 'gray';
6
+ variant?: 'contained' | 'outlined' | 'skeleton';
7
+ fullWidth?: boolean;
8
+ startIcon?: ReactNode;
9
+ endIcon?: ReactNode;
10
+ } & Omit<HTMLProps<HTMLButtonElement>, 'size' | 'type'>>;
@@ -0,0 +1,55 @@
1
+ import { jsxs } from "react/jsx-runtime";
2
+ import { cn } from "./../../helpers/cn";
3
+ const Button = ({
4
+ ref,
5
+ children,
6
+ type = "button",
7
+ size = "md",
8
+ color = "primary",
9
+ variant = "contained",
10
+ disabled = false,
11
+ fullWidth = false,
12
+ onClick,
13
+ startIcon,
14
+ endIcon,
15
+ ...rest
16
+ }) => {
17
+ return /* @__PURE__ */ jsxs(
18
+ "button",
19
+ {
20
+ className: cn(
21
+ "cursor-pointer rounded-lg text-center font-bold",
22
+ {
23
+ "bg-primary-bg text-fg hover:bg-primary-bg/90 active:bg-primary-bg/80": variant === "contained" && color === "primary",
24
+ "bg-bg-subtle text-fg-base hover:bg-bg-mute active:bg-bg-emphasize": variant === "contained" && color === "gray",
25
+ "cursor-not-allowed opacity-35 hover:bg-primary-bg active:bg-primary-bg": disabled && variant === "contained",
26
+ "border-2 border-primary-border bg-bg-base text-primary-fg hover:bg-bg-subtle active:bg-bg-emphasize": variant === "outlined" && color === "primary",
27
+ "border-2 border-border-base bg-bg-base text-fg-base hover:bg-bg-subtle active:bg-bg-emphasize": variant === "outlined" && color === "gray",
28
+ "cursor-not-allowed bg-bg-base opacity-35 hover:bg-bg-base active:bg-bg-base": disabled && variant === "outlined",
29
+ "bg-transparent text-fg-mute hover:text-fg-base active:text-fg-base": variant === "skeleton",
30
+ "cursor-not-allowed bg-transparent text-fg-mute opacity-35 hover:text-fg-mute active:text-fg-mute": disabled && variant === "skeleton"
31
+ },
32
+ "focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info",
33
+ size === "sm" && "px-3 py-1 text-sm",
34
+ size === "md" && "px-4 py-2 text-md",
35
+ size === "lg" && "px-6 py-3 text-lg",
36
+ fullWidth && "w-full",
37
+ Boolean(startIcon ?? endIcon) && "flex items-center gap-2",
38
+ startIcon && endIcon ? "justify-between" : startIcon && variant !== "skeleton" ? "justify-center" : endIcon && "justify-between"
39
+ ),
40
+ disabled,
41
+ onClick,
42
+ ref,
43
+ type,
44
+ ...rest,
45
+ children: [
46
+ startIcon,
47
+ children,
48
+ endIcon
49
+ ]
50
+ }
51
+ );
52
+ };
53
+ export {
54
+ Button
55
+ };
@@ -0,0 +1,96 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { CopyIcon } from "../icons";
3
+ import { Button } from "./button";
4
+ const meta = {
5
+ title: "components/button",
6
+ component: Button,
7
+ args: {
8
+ type: "button",
9
+ onClick: () => {
10
+ console.log("clicked");
11
+ }
12
+ },
13
+ render: (props) => {
14
+ return /* @__PURE__ */ jsx(Button, { ...props, children: "\u30DC\u30BF\u30F3" });
15
+ }
16
+ };
17
+ var button_stories_default = meta;
18
+ const Primary = {};
19
+ const Outlined = {
20
+ args: {
21
+ variant: "outlined"
22
+ }
23
+ };
24
+ const Skeleton = {
25
+ args: {
26
+ variant: "skeleton"
27
+ }
28
+ };
29
+ const Gray = {
30
+ args: {
31
+ color: "gray"
32
+ }
33
+ };
34
+ const OutlinedGray = {
35
+ args: {
36
+ color: "gray",
37
+ variant: "outlined"
38
+ }
39
+ };
40
+ const FullWidth = {
41
+ args: {
42
+ fullWidth: true
43
+ }
44
+ };
45
+ const Large = {
46
+ args: {
47
+ size: "lg"
48
+ }
49
+ };
50
+ const Medium = {
51
+ args: {
52
+ size: "md"
53
+ }
54
+ };
55
+ const Small = {
56
+ args: {
57
+ size: "sm"
58
+ }
59
+ };
60
+ const Disabled = {
61
+ args: {
62
+ disabled: true
63
+ }
64
+ };
65
+ const DisabledOutlined = {
66
+ args: {
67
+ variant: "outlined",
68
+ disabled: true
69
+ }
70
+ };
71
+ const StartIcon = {
72
+ args: {
73
+ startIcon: /* @__PURE__ */ jsx(CopyIcon, {})
74
+ }
75
+ };
76
+ const EndIcon = {
77
+ args: {
78
+ endIcon: /* @__PURE__ */ jsx(CopyIcon, {})
79
+ }
80
+ };
81
+ export {
82
+ Disabled,
83
+ DisabledOutlined,
84
+ EndIcon,
85
+ FullWidth,
86
+ Gray,
87
+ Large,
88
+ Medium,
89
+ Outlined,
90
+ OutlinedGray,
91
+ Primary,
92
+ Skeleton,
93
+ Small,
94
+ StartIcon,
95
+ button_stories_default as default
96
+ };
@@ -0,0 +1 @@
1
+ export * from './button';
@@ -0,0 +1 @@
1
+ export * from "./button";
@@ -0,0 +1,3 @@
1
+ import type { FC } from 'react';
2
+ import type { CardProps } from './type';
3
+ export declare const Card: FC<CardProps>;
@@ -0,0 +1,26 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "./../../helpers/cn";
3
+ const Card = ({
4
+ children,
5
+ variant = "primary",
6
+ title,
7
+ width = "full"
8
+ }) => /* @__PURE__ */ jsxs(
9
+ "section",
10
+ {
11
+ className: cn(
12
+ "rounded-lg bg-bg-base/90 shadow-md",
13
+ width === "full" && "w-full",
14
+ width === "fit" && "w-fit",
15
+ variant === "primary" && "bg-bg-base/90",
16
+ variant === "secondary" && "bg-bg-mute"
17
+ ),
18
+ children: [
19
+ title && /* @__PURE__ */ jsx("div", { className: "flex justify-center rounded-t-lg bg-linear-60 from-primary-bg-mute to-secondary-bg-mute p-4", children: /* @__PURE__ */ jsx("p", { className: "font-bold text-xl", children: title }) }),
20
+ children
21
+ ]
22
+ }
23
+ );
24
+ export {
25
+ Card
26
+ };
@@ -0,0 +1,38 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Card } from "./card";
3
+ import { InteractiveCard } from "./interactive-card";
4
+ const meta = {
5
+ title: "components/card",
6
+ component: Card
7
+ };
8
+ var card_stories_default = meta;
9
+ const Primary = {
10
+ args: {
11
+ children: "card"
12
+ }
13
+ };
14
+ const Title = {
15
+ args: {
16
+ children: "card",
17
+ title: "title"
18
+ }
19
+ };
20
+ const Secondary = {
21
+ args: {
22
+ children: "card",
23
+ variant: "secondary"
24
+ }
25
+ };
26
+ const Interactive = {
27
+ args: {
28
+ children: "card"
29
+ },
30
+ render: (props) => /* @__PURE__ */ jsx(InteractiveCard, { ...props })
31
+ };
32
+ export {
33
+ Interactive,
34
+ Primary,
35
+ Secondary,
36
+ Title,
37
+ card_stories_default as default
38
+ };
@@ -0,0 +1,2 @@
1
+ export * from './card';
2
+ export * from './interactive-card';
@@ -0,0 +1,2 @@
1
+ export * from "./card";
2
+ export * from "./interactive-card";
@@ -0,0 +1,3 @@
1
+ import type { FC } from 'react';
2
+ import type { CardProps } from './type';
3
+ export declare const InteractiveCard: FC<CardProps>;
@@ -0,0 +1,34 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as motion from "motion/react-client";
3
+ import { cn } from "./../../helpers/cn";
4
+ const InteractiveCard = ({
5
+ children,
6
+ variant = "primary",
7
+ width = "full",
8
+ title
9
+ }) => /* @__PURE__ */ jsxs(
10
+ motion.section,
11
+ {
12
+ className: cn(
13
+ "rounded-lg bg-bg-base/90 shadow-md",
14
+ width === "full" && "w-full",
15
+ width === "fit" && "w-fit",
16
+ variant === "primary" && "bg-bg-base/90",
17
+ variant === "secondary" && "bg-bg-mute"
18
+ ),
19
+ tabIndex: -1,
20
+ whileHover: {
21
+ scale: 1.02
22
+ },
23
+ whileTap: {
24
+ scale: 0.98
25
+ },
26
+ children: [
27
+ title && /* @__PURE__ */ jsx("div", { className: "flex justify-center rounded-t-lg bg-linear-60 from-primary-bg-mute to-secondary-bg-mute p-4", children: /* @__PURE__ */ jsx("p", { className: "font-bold text-xl", children: title }) }),
28
+ children
29
+ ]
30
+ }
31
+ );
32
+ export {
33
+ InteractiveCard
34
+ };
@@ -0,0 +1,6 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ export type CardProps = PropsWithChildren<{
3
+ variant?: 'primary' | 'secondary';
4
+ title?: string;
5
+ width?: 'full' | 'fit';
6
+ }>;
File without changes
@@ -0,0 +1,4 @@
1
+ import { type FC } from 'react';
2
+ export declare const Code: FC<{
3
+ children: string;
4
+ }>;
@@ -0,0 +1,38 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
3
+ import { findAllColors } from "./../../helpers/color/find-all-colors";
4
+ const Code = ({ children }) => {
5
+ const colors = findAllColors(children);
6
+ if (colors.length === 0) {
7
+ return /* @__PURE__ */ jsx("code", { className: "m-0.5 rounded-md bg-bg-mute px-1.5 sm:py-0.5", children });
8
+ }
9
+ const parts = [];
10
+ let lastIndex = 0;
11
+ colors.forEach((colorInfo, index) => {
12
+ if (colorInfo.start > lastIndex) {
13
+ parts.push(children.slice(lastIndex, colorInfo.start));
14
+ }
15
+ parts.push(
16
+ /* @__PURE__ */ jsxs(Fragment, { children: [
17
+ /* @__PURE__ */ jsx(
18
+ "span",
19
+ {
20
+ "aria-label": `Color: ${colorInfo.color}`,
21
+ className: "inline-block h-3 w-3 flex-shrink-0 rounded-sm border border-gray-300",
22
+ role: "img",
23
+ style: { backgroundColor: colorInfo.color }
24
+ }
25
+ ),
26
+ children.slice(colorInfo.start, colorInfo.end)
27
+ ] }, `color-${String(index)}`)
28
+ );
29
+ lastIndex = colorInfo.end;
30
+ });
31
+ if (lastIndex < children.length) {
32
+ parts.push(children.slice(lastIndex));
33
+ }
34
+ return /* @__PURE__ */ jsx("code", { className: "m-0.5 inline-flex items-center gap-1 rounded-md bg-bg-mute px-1.5 sm:py-0.5", children: parts });
35
+ };
36
+ export {
37
+ Code
38
+ };
@@ -0,0 +1,60 @@
1
+ import { Code } from "./code";
2
+ const meta = {
3
+ title: "components/code",
4
+ component: Code,
5
+ parameters: {
6
+ layout: "centered"
7
+ }
8
+ };
9
+ var code_stories_default = meta;
10
+ const Default = {
11
+ args: {
12
+ children: 'const example = "Hello World";'
13
+ }
14
+ };
15
+ const HSLColor = {
16
+ args: {
17
+ children: "hsl(280, 70%, 50%)"
18
+ }
19
+ };
20
+ const RGBColor = {
21
+ args: {
22
+ children: "rgb(255, 0, 128)"
23
+ }
24
+ };
25
+ const HexColor = {
26
+ args: {
27
+ children: "#ff0080"
28
+ }
29
+ };
30
+ const NamedColor = {
31
+ args: {
32
+ children: "background-color: red"
33
+ }
34
+ };
35
+ const ComplexCSS = {
36
+ args: {
37
+ children: "background-color: hsl(calc(sign(var(--x)) * 80 + 200), 70%, 50%)"
38
+ }
39
+ };
40
+ const MultipleColors = {
41
+ args: {
42
+ children: "border: 1px solid #ff0080; background: hsl(280, 70%, 50%); color: rgb(255, 255, 255);"
43
+ }
44
+ };
45
+ const GradientWithMultipleColors = {
46
+ args: {
47
+ children: "background: linear-gradient(45deg, #ff0080, hsl(280, 70%, 50%), rgba(255, 0, 128, 0.5))"
48
+ }
49
+ };
50
+ export {
51
+ ComplexCSS,
52
+ Default,
53
+ GradientWithMultipleColors,
54
+ HSLColor,
55
+ HexColor,
56
+ MultipleColors,
57
+ NamedColor,
58
+ RGBColor,
59
+ code_stories_default as default
60
+ };
@@ -0,0 +1 @@
1
+ export { Code } from './code';
@@ -0,0 +1,4 @@
1
+ import { Code } from "./code";
2
+ export {
3
+ Code
4
+ };
@@ -0,0 +1,17 @@
1
+ import { type FC, type PropsWithChildren, type Ref } from 'react';
2
+ export declare const Content: FC<PropsWithChildren>;
3
+ export declare const Dialog: {
4
+ Root: FC<PropsWithChildren<{
5
+ ref?: Ref<HTMLElement> | undefined;
6
+ id?: string | undefined;
7
+ tabIndex?: number | undefined;
8
+ role?: string | undefined;
9
+ }>>;
10
+ Header: FC<{
11
+ title: string;
12
+ onClose: () => void;
13
+ }>;
14
+ Content: FC<{
15
+ children?: React.ReactNode | undefined;
16
+ }>;
17
+ };
@@ -0,0 +1,85 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ createContext,
4
+ use,
5
+ useId
6
+ } from "react";
7
+ import { Heading } from "../heading";
8
+ import { IconButton } from "../icon-button";
9
+ import { CloseIcon } from "../icons";
10
+ const DialogContext = createContext(null);
11
+ const useDialogContext = () => {
12
+ const context = use(DialogContext);
13
+ if (context === null) {
14
+ throw new Error("useDialogContext must be used within a DialogProvider");
15
+ }
16
+ return context;
17
+ };
18
+ const Root = ({ ref, id, children, tabIndex, role = "dialog" }) => {
19
+ const fallbackId = useId();
20
+ const rootId = id ?? fallbackId;
21
+ return /* @__PURE__ */ jsx(
22
+ "section",
23
+ {
24
+ "aria-describedby": `${rootId}-content`,
25
+ "aria-labelledby": `${rootId}-header`,
26
+ className: "relative w-full rounded-lg border border-border-subtle bg-bg-base shadow-xl",
27
+ id,
28
+ ref,
29
+ role,
30
+ tabIndex,
31
+ children: /* @__PURE__ */ jsx(DialogContext, { value: { rootId }, children })
32
+ }
33
+ );
34
+ };
35
+ const Header = ({ title, onClose }) => {
36
+ const { rootId } = useDialogContext();
37
+ return /* @__PURE__ */ jsxs(
38
+ "div",
39
+ {
40
+ className: "flex items-center justify-center p-4 pb-2",
41
+ id: `${rootId}-header`,
42
+ children: [
43
+ /* @__PURE__ */ jsx(Heading, { type: "h3", children: title }),
44
+ /* @__PURE__ */ jsx("div", { className: "absolute top-2 right-2", children: /* @__PURE__ */ jsx(
45
+ IconButton,
46
+ {
47
+ label: "\u9589\u3058\u308B",
48
+ onClick: (e) => {
49
+ e.stopPropagation();
50
+ onClose();
51
+ },
52
+ children: /* @__PURE__ */ jsx(CloseIcon, { size: "sm" })
53
+ }
54
+ ) })
55
+ ]
56
+ }
57
+ );
58
+ };
59
+ const Content = ({ children }) => {
60
+ const { rootId } = useDialogContext();
61
+ return (
62
+ // biome-ignore lint/a11y/noStaticElementInteractions: propagationなので
63
+ // biome-ignore lint/a11y/useKeyWithClickEvents: propagationなので
64
+ /* @__PURE__ */ jsx(
65
+ "div",
66
+ {
67
+ className: "p-4",
68
+ id: `${rootId}-content`,
69
+ onClick: (e) => {
70
+ e.stopPropagation();
71
+ },
72
+ children
73
+ }
74
+ )
75
+ );
76
+ };
77
+ const Dialog = {
78
+ Root,
79
+ Header,
80
+ Content
81
+ };
82
+ export {
83
+ Content,
84
+ Dialog
85
+ };
@@ -0,0 +1,98 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { fn } from "storybook/test";
4
+ import { Button } from "../button";
5
+ import { Modal } from "../modal";
6
+ import { Popover, useOpenContext } from "../popover";
7
+ import { Dialog } from "./dialog";
8
+ const meta = {
9
+ title: "components/dialog",
10
+ component: Dialog.Root
11
+ };
12
+ var dialog_stories_default = meta;
13
+ const Default = {
14
+ render: () => /* @__PURE__ */ jsxs(Dialog.Root, { children: [
15
+ /* @__PURE__ */ jsx(Dialog.Header, { onClose: fn, title: "\u30C0\u30A4\u30A2\u30ED\u30B0" }),
16
+ /* @__PURE__ */ jsx(Dialog.Content, { children: "\u3053\u3093\u306B\u3061\u306F" })
17
+ ] })
18
+ };
19
+ const StoryDialog = (props) => {
20
+ const { onClose } = useOpenContext();
21
+ return /* @__PURE__ */ jsxs(Dialog.Root, { ...props, ref: props.ref, children: [
22
+ /* @__PURE__ */ jsx(Dialog.Header, { onClose, title: "\u30C0\u30A4\u30A2\u30ED\u30B0" }),
23
+ /* @__PURE__ */ jsx(Dialog.Content, { children: "\u3053\u3093\u306B\u3061\u306F\u3053\u3093\u306B\u3061\u306F\u3053\u3093\u306B\u3061\u306F\u3053\u3093\u306B\u3061\u306F" })
24
+ ] });
25
+ };
26
+ const PopoverDialog = {
27
+ render: () => /* @__PURE__ */ jsxs(Popover.Root, { type: "dialog", children: [
28
+ /* @__PURE__ */ jsx(
29
+ Popover.Trigger,
30
+ {
31
+ renderItem: (props) => /* @__PURE__ */ jsx(Button, { ...props, size: "md", type: "button", children: "\u30DD\u30C3\u30D7\u30AA\u30FC\u30D0\u30FC" })
32
+ }
33
+ ),
34
+ /* @__PURE__ */ jsx(Popover.Content, { renderItem: (props) => /* @__PURE__ */ jsx(StoryDialog, { ...props }) })
35
+ ] }),
36
+ play: async ({ canvas, userEvent }) => {
37
+ const trigger = canvas.getByRole("button", {
38
+ name: "\u30DD\u30C3\u30D7\u30AA\u30FC\u30D0\u30FC"
39
+ });
40
+ trigger.focus();
41
+ await userEvent.keyboard("{Enter}");
42
+ },
43
+ parameters: {
44
+ a11y: {
45
+ options: {
46
+ rules: {
47
+ // https://github.com/floating-ui/floating-ui/pull/2298#issuecomment-1518101512
48
+ "aria-hidden-focus": { enabled: false }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ };
54
+ const ModalDialog = {
55
+ render: () => {
56
+ const [open, setOpen] = useState(false);
57
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
58
+ /* @__PURE__ */ jsx(
59
+ Button,
60
+ {
61
+ onClick: () => {
62
+ setOpen(true);
63
+ },
64
+ size: "md",
65
+ type: "button",
66
+ children: "\u30E2\u30FC\u30C0\u30EB"
67
+ }
68
+ ),
69
+ /* @__PURE__ */ jsx(
70
+ Modal,
71
+ {
72
+ isOpen: open,
73
+ onClose: () => {
74
+ setOpen(false);
75
+ },
76
+ type: "center",
77
+ children: /* @__PURE__ */ jsxs(Dialog.Root, { children: [
78
+ /* @__PURE__ */ jsx(Dialog.Header, { onClose: fn, title: "\u30E2\u30FC\u30C0\u30EB" }),
79
+ /* @__PURE__ */ jsx(Dialog.Content, { children: "\u3053\u3093\u306B\u3061\u306F" })
80
+ ] })
81
+ }
82
+ )
83
+ ] });
84
+ },
85
+ play: async ({ canvas, userEvent }) => {
86
+ const trigger = canvas.getByRole("button", {
87
+ name: "\u30E2\u30FC\u30C0\u30EB"
88
+ });
89
+ trigger.focus();
90
+ await userEvent.keyboard("{Enter}");
91
+ }
92
+ };
93
+ export {
94
+ Default,
95
+ ModalDialog,
96
+ PopoverDialog,
97
+ dialog_stories_default as default
98
+ };
@@ -0,0 +1 @@
1
+ export * from './dialog';
@@ -0,0 +1 @@
1
+ export * from "./dialog";
@@ -0,0 +1,6 @@
1
+ import { type FC, type PropsWithChildren } from 'react';
2
+ export declare const Drawer: FC<PropsWithChildren<{
3
+ title: string;
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ }>>;