@cakejp/design-system 0.16.0 → 0.17.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 (181) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/CLAUDE.md +1 -0
  3. package/bin/init.js +29 -6
  4. package/contracts/components.json +42 -7
  5. package/contracts/composition.json +8 -2
  6. package/contracts/rules.json +5 -1
  7. package/contracts/screen-patterns.json +1 -1
  8. package/dist/components/ec/_mypage-menu-data.js +166 -0
  9. package/dist/components/ec/admin-shell.js +202 -0
  10. package/dist/components/ec/anniversary-card.js +63 -0
  11. package/dist/components/ec/cake-logo.js +38 -0
  12. package/dist/components/ec/chart-controls.js +91 -0
  13. package/dist/components/ec/countdown-timer.js +50 -0
  14. package/dist/components/ec/coupon-card.js +136 -0
  15. package/dist/components/ec/delivery-calendar.js +105 -0
  16. package/dist/components/ec/mypage-shell.js +98 -0
  17. package/dist/components/ec/order-section.js +53 -0
  18. package/dist/components/ec/order-summary.js +78 -0
  19. package/dist/components/ec/payment-method.js +81 -0
  20. package/dist/components/ec/product-card.js +235 -0
  21. package/dist/components/ec/product-carousel.js +106 -0
  22. package/dist/components/ec/product-cta.js +80 -0
  23. package/dist/components/ec/product-detail-bar.js +86 -0
  24. package/dist/components/ec/product-detail-sidebar.js +296 -0
  25. package/dist/components/ec/product-list-item.js +266 -0
  26. package/dist/components/ec/product-option.js +165 -0
  27. package/dist/components/ec/rating-stars.js +74 -0
  28. package/dist/components/ec/review-card.js +126 -0
  29. package/dist/components/ec/review-form.js +181 -0
  30. package/dist/components/ec/review-summary.js +95 -0
  31. package/dist/components/ec/shop-card.js +179 -0
  32. package/dist/components/ec/stat-card.js +50 -0
  33. package/dist/components/foundations/accordion.js +67 -0
  34. package/dist/components/foundations/alert-dialog.js +165 -0
  35. package/dist/components/foundations/alert.js +218 -0
  36. package/dist/components/foundations/aspect-ratio.js +10 -0
  37. package/dist/components/foundations/avatar.js +58 -0
  38. package/dist/components/foundations/badge.js +54 -0
  39. package/dist/components/foundations/breadcrumb.js +104 -0
  40. package/dist/components/foundations/button.js +99 -0
  41. package/dist/components/foundations/calendar.js +173 -0
  42. package/dist/components/foundations/card.js +109 -0
  43. package/dist/components/foundations/checkbox-card.js +111 -0
  44. package/dist/components/foundations/checkbox-group.js +92 -0
  45. package/dist/components/foundations/checkbox.js +90 -0
  46. package/dist/components/foundations/chip-variants.js +41 -0
  47. package/dist/components/foundations/collapsible.js +34 -0
  48. package/dist/components/foundations/command.js +171 -0
  49. package/dist/components/foundations/context-menu.js +225 -0
  50. package/dist/components/foundations/data-table.js +59 -0
  51. package/dist/components/foundations/dialog.js +148 -0
  52. package/dist/components/foundations/drawer.js +129 -0
  53. package/dist/components/foundations/dropdown-menu.js +232 -0
  54. package/dist/components/foundations/field.js +150 -0
  55. package/dist/components/foundations/file-input.js +116 -0
  56. package/dist/components/foundations/form.js +101 -0
  57. package/dist/components/foundations/hover-card.js +41 -0
  58. package/dist/components/foundations/icon-badge.js +41 -0
  59. package/dist/components/foundations/input.js +74 -0
  60. package/dist/components/foundations/label.js +29 -0
  61. package/dist/components/foundations/menubar.js +252 -0
  62. package/dist/components/foundations/navigation-menu.js +171 -0
  63. package/dist/components/foundations/pagination.js +120 -0
  64. package/dist/components/foundations/popover.js +45 -0
  65. package/dist/components/foundations/progress.js +34 -0
  66. package/dist/components/foundations/radio-group.js +134 -0
  67. package/dist/components/foundations/responsive-dialog.js +76 -0
  68. package/dist/components/foundations/scroll-area.js +62 -0
  69. package/dist/components/foundations/select.js +190 -0
  70. package/dist/components/foundations/separator.js +27 -0
  71. package/dist/components/foundations/sheet.js +130 -0
  72. package/dist/components/foundations/skeleton.js +15 -0
  73. package/dist/components/foundations/skip-link.js +27 -0
  74. package/dist/components/foundations/slider.js +81 -0
  75. package/dist/components/foundations/social-icon.js +36 -0
  76. package/dist/components/foundations/sonner.js +49 -0
  77. package/dist/components/foundations/spinner.js +28 -0
  78. package/dist/components/foundations/switch.js +54 -0
  79. package/dist/components/foundations/table.js +115 -0
  80. package/dist/components/foundations/tabs.js +102 -0
  81. package/dist/components/foundations/textarea.js +65 -0
  82. package/dist/components/foundations/toggle-group.js +107 -0
  83. package/dist/components/foundations/toggle.js +44 -0
  84. package/dist/components/foundations/tooltip.js +56 -0
  85. package/dist/components/primitives/admin-header.js +31 -0
  86. package/dist/components/primitives/admin-side-nav.js +135 -0
  87. package/dist/components/primitives/banner-carousel.js +97 -0
  88. package/dist/components/primitives/bottom-tab-bar.js +81 -0
  89. package/dist/components/primitives/bulk-action-bar.js +27 -0
  90. package/dist/components/primitives/category-scroll.js +110 -0
  91. package/dist/components/primitives/category-shortcuts.js +66 -0
  92. package/dist/components/primitives/chat-composer.js +141 -0
  93. package/dist/components/primitives/chip.js +123 -0
  94. package/dist/components/primitives/coach-mark.js +102 -0
  95. package/dist/components/primitives/combobox.js +88 -0
  96. package/dist/components/primitives/container.js +50 -0
  97. package/dist/components/primitives/content-carousel.js +144 -0
  98. package/dist/components/primitives/date-picker.js +175 -0
  99. package/dist/components/primitives/empty-state.js +32 -0
  100. package/dist/components/primitives/error-state.js +115 -0
  101. package/dist/components/primitives/filter-bar.js +144 -0
  102. package/dist/components/primitives/footer.js +247 -0
  103. package/dist/components/primitives/form-field.js +38 -0
  104. package/dist/components/primitives/funnel-shell.js +99 -0
  105. package/dist/components/primitives/header.js +257 -0
  106. package/dist/components/primitives/image-carousel.js +156 -0
  107. package/dist/components/primitives/image-gallery.js +177 -0
  108. package/dist/components/primitives/image-input.js +207 -0
  109. package/dist/components/primitives/image-uploader.js +69 -0
  110. package/dist/components/primitives/kebab-menu.js +40 -0
  111. package/dist/components/primitives/list-item.js +80 -0
  112. package/dist/components/primitives/menu-drawer.js +154 -0
  113. package/dist/components/primitives/multi-select.js +93 -0
  114. package/dist/components/primitives/notification-badge.js +61 -0
  115. package/dist/components/primitives/notification-list.js +72 -0
  116. package/dist/components/primitives/number-input.js +235 -0
  117. package/dist/components/primitives/price-display.js +101 -0
  118. package/dist/components/primitives/progress-steps.js +62 -0
  119. package/dist/components/primitives/search-bar.js +81 -0
  120. package/dist/components/primitives/search-panel.js +43 -0
  121. package/dist/components/primitives/section-header.js +148 -0
  122. package/dist/components/primitives/section-nav.js +85 -0
  123. package/dist/components/primitives/section.js +78 -0
  124. package/dist/components/primitives/share-buttons.js +102 -0
  125. package/dist/components/primitives/side-nav.js +98 -0
  126. package/dist/components/primitives/social-login-button.js +53 -0
  127. package/dist/components/primitives/standard-page-shell.js +34 -0
  128. package/dist/components/primitives/status-count-tabs.js +42 -0
  129. package/dist/components/primitives/sticky-action-bar.js +26 -0
  130. package/dist/components/primitives/sub-nav.js +67 -0
  131. package/dist/components/primitives/tag.js +57 -0
  132. package/dist/components/primitives/timeline.js +55 -0
  133. package/dist/components/primitives/workspace-shell.js +57 -0
  134. package/dist/index.css +1 -1
  135. package/dist/index.js +22961 -13130
  136. package/dist/lib/field-labelling.js +29 -0
  137. package/dist/lib/focus-ring.js +6 -0
  138. package/dist/lib/pagination-range.js +42 -0
  139. package/dist/lib/use-value-length.js +63 -0
  140. package/dist/lib/utils.js +33 -0
  141. package/dist/types/components/ec/_mypage-menu-data.d.ts +3 -3
  142. package/dist/types/components/ec/admin-shell.d.ts +1 -1
  143. package/dist/types/components/ec/anniversary-card.d.ts +1 -1
  144. package/dist/types/components/ec/mypage-shell.d.ts +3 -3
  145. package/dist/types/components/ec/product-card.d.ts +1 -1
  146. package/dist/types/components/ec/product-carousel.d.ts +3 -3
  147. package/dist/types/components/ec/stat-card.d.ts +1 -1
  148. package/dist/types/components/foundations/accordion.d.ts +8 -1
  149. package/dist/types/components/foundations/alert-dialog.d.ts +1 -1
  150. package/dist/types/components/foundations/calendar.d.ts +1 -1
  151. package/dist/types/components/foundations/checkbox-group.d.ts +1 -1
  152. package/dist/types/components/foundations/command.d.ts +1 -1
  153. package/dist/types/components/foundations/data-table.d.ts +6 -1
  154. package/dist/types/components/foundations/field.d.ts +2 -2
  155. package/dist/types/components/foundations/file-input.d.ts +1 -1
  156. package/dist/types/components/foundations/pagination.d.ts +1 -1
  157. package/dist/types/components/foundations/responsive-dialog.d.ts +1 -1
  158. package/dist/types/components/foundations/skip-link.d.ts +1 -1
  159. package/dist/types/components/foundations/slider.d.ts +13 -1
  160. package/dist/types/components/primitives/admin-header.d.ts +11 -1
  161. package/dist/types/components/primitives/admin-side-nav.d.ts +19 -1
  162. package/dist/types/components/primitives/banner-carousel.d.ts +2 -2
  163. package/dist/types/components/primitives/category-scroll.d.ts +2 -2
  164. package/dist/types/components/primitives/category-shortcuts.d.ts +1 -1
  165. package/dist/types/components/primitives/chat-composer.d.ts +1 -1
  166. package/dist/types/components/primitives/chip.d.ts +1 -1
  167. package/dist/types/components/primitives/combobox.d.ts +9 -1
  168. package/dist/types/components/primitives/content-carousel.d.ts +1 -1
  169. package/dist/types/components/primitives/form-field.d.ts +1 -1
  170. package/dist/types/components/primitives/image-input.d.ts +1 -1
  171. package/dist/types/components/primitives/kebab-menu.d.ts +1 -1
  172. package/dist/types/components/primitives/menu-drawer.d.ts +0 -16
  173. package/dist/types/components/primitives/multi-select.d.ts +9 -1
  174. package/dist/types/components/primitives/notification-list.d.ts +1 -1
  175. package/dist/types/components/primitives/search-panel.d.ts +1 -1
  176. package/dist/types/components/primitives/section-nav.d.ts +1 -1
  177. package/dist/types/components/primitives/side-nav.d.ts +1 -1
  178. package/dist/types/components/primitives/social-login-button.d.ts +1 -1
  179. package/dist/types/lib/field-labelling.d.ts +66 -0
  180. package/package.json +2 -2
  181. package/scripts/codemod/README.md +9 -0
@@ -0,0 +1,99 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cva as n } from "class-variance-authority";
4
+ import { Slot as s } from "radix-ui";
5
+ import { cn as d } from "../../lib/utils.js";
6
+ import { FOCUS_RING as l } from "../../lib/focus-ring.js";
7
+ const b = n(
8
+ `inline-flex shrink-0 items-center justify-center gap-2 rounded-lg typo-label-md whitespace-nowrap transition-all outline-none ${l} disabled:pointer-events-none aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)] hover:bg-[var(--Hover-Primary-Button)] active:bg-[var(--Active-Primary-Button)] disabled:bg-[var(--Surface-Tertiary)] disabled:text-[var(--Text-Disable)]",
13
+ secondary: "border border-transparent outline outline-2 outline-transparent bg-[var(--Surface-Accent-Primary-Light)] text-[var(--Brand-Cake-Orange)] hover:border-[var(--Hover-Primary-Button)] hover:outline-[var(--Hover-Primary-Button)] hover:bg-[var(--Hover-Secondary-Button)] hover:text-[var(--Hover-Primary-Button)] active:border-[var(--Active-Primary-Button)] active:outline-[var(--Active-Primary-Button)] active:bg-[var(--Active-Secondary-Button)] active:text-[var(--Active-Primary-Button)] disabled:border-transparent disabled:outline-transparent disabled:bg-[var(--Surface-Tertiary)] disabled:text-[var(--Text-Disable)]",
14
+ tertiary: "bg-[var(--Surface-Tertiary)] text-[var(--Text-High-Emphasis)] hover:bg-[var(--Hover-Tertiary-Button)] active:bg-[var(--Active-Tertiary-Button)] disabled:text-[var(--Text-Disable)]",
15
+ destructive: "bg-[var(--Surface-Caution)] text-[var(--Text-on-Inverse)] hover:bg-[var(--Primitive-Sun-900)] active:bg-[var(--Primitive-Sun-900)] disabled:bg-[var(--Surface-Tertiary)] disabled:text-[var(--Text-Disable)]",
16
+ ghost: "text-[var(--Text-High-Emphasis)] hover:bg-[var(--Hover-Text-Button)] active:bg-[var(--Active-Text-Button)] disabled:text-[var(--Text-Disable)]",
17
+ link: "text-[var(--Brand-Cake-Orange)] underline-offset-4 hover:underline disabled:text-[var(--Text-Disable)]",
18
+ /**
19
+ * inverse — 暗背景の上で使う primary CTA。
20
+ * 白背景 + accent text (Brand Cake Orange)。
21
+ * hover で薄く陰り、active で更に。
22
+ */
23
+ inverse: "bg-[var(--Surface-Primary)] text-[var(--Brand-Cake-Orange)] hover:bg-[var(--Primitive-White-alpha-900)] active:bg-[var(--Primitive-White-alpha-800)] disabled:bg-[var(--Primitive-White-alpha-300)] disabled:text-[var(--Text-Disable)]",
24
+ /**
25
+ * ghost-inverse — 暗背景の上で使う secondary CTA。
26
+ * 透過背景 + 白テキスト + 白ボーダー。
27
+ * hover で白 alpha がうっすら入る。
28
+ */
29
+ "ghost-inverse": "border border-[var(--Primitive-White-alpha-300)] bg-transparent text-[var(--Text-on-Inverse)] hover:bg-[var(--Primitive-White-alpha-200)] hover:border-[var(--Primitive-White-alpha-1000)] active:bg-[var(--Primitive-White-alpha-300)] disabled:border-[var(--Primitive-White-alpha-200)] disabled:text-[var(--Primitive-White-alpha-300)]",
30
+ /**
31
+ * overlay — 画像・メディアの上に載せる操作ボタン。
32
+ * 半透過白の下地(Surface-Overlay-Light)+ 微細ボーダー + shadow-md + backdrop-blur。
33
+ * ImageCarousel の矢印ボタンと同系の「メディア上に浮く白い円形/角丸ボタン」意匠。
34
+ * icon 系 size(`size="icon"` + `className="rounded-full"` 等)と組み合わせて使う。
35
+ */
36
+ overlay: (
37
+ // 下地 Surface-Overlay-Light は「メディア上の可読性のため light/dark で切替えない」
38
+ // 設計(常に白80%)。文字色にセマンティック(dark で白に反転する Text-High-Emphasis)を
39
+ // 使うとダークモードで白地×白文字になり消えるため、文字も非反転の Primitive 固定にする
40
+ "border border-[var(--Border-Hairline)] bg-[var(--Surface-Overlay-Light)] text-[var(--Primitive-Gray-900)] shadow-md backdrop-blur-sm hover:bg-[var(--Primitive-White-alpha-900)] active:bg-[var(--Primitive-White-alpha-1000)] disabled:bg-[var(--Surface-Tertiary)] disabled:text-[var(--Text-Disable)] disabled:shadow-none"
41
+ )
42
+ },
43
+ size: {
44
+ /**
45
+ * default — 44px(h-11)。フォーム入力コントロール(Input / SelectTrigger default /
46
+ * DatePicker trigger)と同じ共通高さで、入力行にボタンを並置しても揃う。
47
+ * tokens.json の touchTarget["text-input"].min = 44px を満たす(iOS HIG の 44pt と一致)。
48
+ */
49
+ default: "h-11 px-5 py-2 has-[>svg]:px-4",
50
+ xs: "h-6 gap-1 rounded px-2 typo-label-sm has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
51
+ sm: "h-8 gap-1.5 rounded-lg px-3 has-[>svg]:px-2.5",
52
+ /**
53
+ * lg — 48px(h-12)。default(44px) との差は 4px だが、角丸(rounded-xl)・
54
+ * タイポ(typo-label-lg)・padding も一段上がるため視覚的な段は保たれる。
55
+ * 48px は rules.json の touchTarget recommended 値でもあり、主要 CTA の受け皿として据え置く。
56
+ */
57
+ lg: "h-12 rounded-xl px-6 typo-label-lg has-[>svg]:px-5",
58
+ xl: "h-14 rounded-xl px-6 typo-label-lg has-[>svg]:px-5",
59
+ /**
60
+ * hero — トップページの hero / final-CTA 専用の特大 CTA。
61
+ * min-height 3.5rem (56px), padding 0 1.5rem, fully rounded。
62
+ * xl と異なり pill shape (rounded-full) で印象的に。
63
+ */
64
+ hero: "min-h-14 rounded-full px-6 typo-label-lg has-[>svg]:px-5",
65
+ icon: "size-9 rounded-lg",
66
+ "icon-xs": "size-6 rounded [&_svg:not([class*='size-'])]:size-3",
67
+ "icon-sm": "size-8 rounded-lg",
68
+ "icon-lg": "size-10 rounded-lg"
69
+ }
70
+ },
71
+ defaultVariants: {
72
+ variant: "default",
73
+ size: "default"
74
+ }
75
+ }
76
+ );
77
+ function m({
78
+ className: a,
79
+ variant: e = "default",
80
+ size: r = "default",
81
+ asChild: t = !1,
82
+ ...i
83
+ }) {
84
+ const v = t ? s.Root : "button";
85
+ return /* @__PURE__ */ o(
86
+ v,
87
+ {
88
+ "data-slot": "button",
89
+ "data-variant": e,
90
+ "data-size": r,
91
+ className: d(b({ variant: e, size: r, className: a })),
92
+ ...i
93
+ }
94
+ );
95
+ }
96
+ export {
97
+ m as Button,
98
+ b as buttonVariants
99
+ };
@@ -0,0 +1,173 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import * as m from "react";
3
+ import { ChevronLeftIcon as y, ChevronRightIcon as x, ChevronDownIcon as h } from "lucide-react";
4
+ import { getDefaultClassNames as f, DayPicker as w } from "react-day-picker";
5
+ import { cn as e } from "../../lib/utils.js";
6
+ import { buttonVariants as p, Button as _ } from "./button.js";
7
+ function j({
8
+ className: c,
9
+ classNames: i,
10
+ showOutsideDays: r = !0,
11
+ captionLayout: s = "label",
12
+ buttonVariant: l = "ghost",
13
+ formatters: u,
14
+ components: b,
15
+ ...g
16
+ }) {
17
+ const t = f();
18
+ return /* @__PURE__ */ n(
19
+ w,
20
+ {
21
+ showOutsideDays: r,
22
+ className: e(
23
+ "group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
24
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
25
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
26
+ c
27
+ ),
28
+ captionLayout: s,
29
+ formatters: {
30
+ formatMonthDropdown: (a) => a.toLocaleString("default", { month: "short" }),
31
+ ...u
32
+ },
33
+ classNames: {
34
+ root: e("w-fit", t.root),
35
+ months: e(
36
+ "relative flex flex-col gap-4 md:flex-row",
37
+ t.months
38
+ ),
39
+ month: e("flex w-full flex-col gap-4", t.month),
40
+ nav: e(
41
+ "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
42
+ t.nav
43
+ ),
44
+ button_previous: e(
45
+ p({ variant: l }),
46
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
47
+ t.button_previous
48
+ ),
49
+ button_next: e(
50
+ p({ variant: l }),
51
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
52
+ t.button_next
53
+ ),
54
+ month_caption: e(
55
+ "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
56
+ t.month_caption
57
+ ),
58
+ dropdowns: e(
59
+ "flex h-(--cell-size) w-full items-center justify-center gap-1.5 typo-label-sm",
60
+ t.dropdowns
61
+ ),
62
+ dropdown_root: e(
63
+ "relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
64
+ t.dropdown_root
65
+ ),
66
+ dropdown: e(
67
+ "absolute inset-0 bg-popover opacity-0",
68
+ t.dropdown
69
+ ),
70
+ caption_label: e(
71
+ "typo-label-sm select-none text-[var(--Text-Medium-Emphasis)]",
72
+ s === "label" ? "" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
73
+ t.caption_label
74
+ ),
75
+ table: "w-full border-collapse",
76
+ weekdays: e("flex", t.weekdays),
77
+ weekday: e(
78
+ "flex-1 rounded-md typo-body-sm text-muted-foreground select-none",
79
+ t.weekday
80
+ ),
81
+ week: e("mt-2 flex w-full", t.week),
82
+ week_number_header: e(
83
+ "w-(--cell-size) select-none",
84
+ t.week_number_header
85
+ ),
86
+ week_number: e(
87
+ "typo-body-sm text-muted-foreground select-none",
88
+ t.week_number
89
+ ),
90
+ day: e(
91
+ "group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md",
92
+ g.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md",
93
+ t.day
94
+ ),
95
+ range_start: e(
96
+ "rounded-l-md bg-accent",
97
+ t.range_start
98
+ ),
99
+ range_middle: e("rounded-none", t.range_middle),
100
+ range_end: e("rounded-r-md bg-accent", t.range_end),
101
+ today: e(
102
+ "rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",
103
+ t.today
104
+ ),
105
+ outside: e(
106
+ "text-muted-foreground aria-selected:text-muted-foreground",
107
+ t.outside
108
+ ),
109
+ disabled: e(
110
+ "text-muted-foreground opacity-50",
111
+ t.disabled
112
+ ),
113
+ hidden: e("invisible", t.hidden),
114
+ ...i
115
+ },
116
+ components: {
117
+ Root: ({ className: a, rootRef: d, ...o }) => /* @__PURE__ */ n(
118
+ "div",
119
+ {
120
+ "data-slot": "calendar",
121
+ ref: d,
122
+ className: e(a),
123
+ ...o
124
+ }
125
+ ),
126
+ Chevron: ({ className: a, orientation: d, ...o }) => d === "left" ? /* @__PURE__ */ n(y, { className: e("size-4", a), ...o }) : d === "right" ? /* @__PURE__ */ n(
127
+ x,
128
+ {
129
+ className: e("size-4", a),
130
+ ...o
131
+ }
132
+ ) : /* @__PURE__ */ n(h, { className: e("size-4", a), ...o }),
133
+ DayButton: v,
134
+ WeekNumber: ({ children: a, ...d }) => /* @__PURE__ */ n("td", { ...d, children: /* @__PURE__ */ n("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: a }) }),
135
+ ...b
136
+ },
137
+ ...g
138
+ }
139
+ );
140
+ }
141
+ function v({
142
+ className: c,
143
+ day: i,
144
+ modifiers: r,
145
+ ...s
146
+ }) {
147
+ const l = f(), u = m.useRef(null);
148
+ return m.useEffect(() => {
149
+ r.focused && u.current?.focus();
150
+ }, [r.focused]), /* @__PURE__ */ n(
151
+ _,
152
+ {
153
+ ref: u,
154
+ variant: "ghost",
155
+ size: "icon",
156
+ "data-day": i.date.toLocaleDateString(),
157
+ "data-selected-single": r.selected && !r.range_start && !r.range_end && !r.range_middle,
158
+ "data-range-start": r.range_start,
159
+ "data-range-end": r.range_end,
160
+ "data-range-middle": r.range_middle,
161
+ className: e(
162
+ "flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 typo-body-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-[var(--Surface-Accent-Primary-Light)] data-[range-middle=true]:text-[var(--Text-High-Emphasis)] data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:typo-body-xs [&>span]:opacity-70",
163
+ l.day,
164
+ c
165
+ ),
166
+ ...s
167
+ }
168
+ );
169
+ }
170
+ export {
171
+ j as Calendar,
172
+ v as CalendarDayButton
173
+ };
@@ -0,0 +1,109 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cva as o } from "class-variance-authority";
4
+ import { cn as d } from "../../lib/utils.js";
5
+ const s = o(
6
+ "flex flex-col gap-4 rounded-2xl border border-[var(--Border-Medium-Emphasis)] p-4 text-card-foreground",
7
+ {
8
+ variants: {
9
+ surface: {
10
+ default: "bg-[var(--card-surface,var(--card))]",
11
+ primary: "bg-[var(--Surface-Primary)]"
12
+ }
13
+ },
14
+ defaultVariants: {
15
+ surface: "default"
16
+ }
17
+ }
18
+ );
19
+ function u({
20
+ className: r,
21
+ surface: a,
22
+ ...e
23
+ }) {
24
+ return /* @__PURE__ */ t(
25
+ "div",
26
+ {
27
+ "data-slot": "card",
28
+ "data-surface": a ?? "default",
29
+ className: d(s({ surface: a }), r),
30
+ ...e
31
+ }
32
+ );
33
+ }
34
+ function f({ className: r, ...a }) {
35
+ return /* @__PURE__ */ t(
36
+ "div",
37
+ {
38
+ "data-slot": "card-header",
39
+ className: d(
40
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-4",
41
+ r
42
+ ),
43
+ ...a
44
+ }
45
+ );
46
+ }
47
+ function m({ className: r, ...a }) {
48
+ return /* @__PURE__ */ t(
49
+ "div",
50
+ {
51
+ "data-slot": "card-title",
52
+ className: d("typo-label-md", r),
53
+ ...a
54
+ }
55
+ );
56
+ }
57
+ function p({ className: r, ...a }) {
58
+ return /* @__PURE__ */ t(
59
+ "div",
60
+ {
61
+ "data-slot": "card-description",
62
+ className: d("typo-body-sm text-muted-foreground", r),
63
+ ...a
64
+ }
65
+ );
66
+ }
67
+ function v({ className: r, ...a }) {
68
+ return /* @__PURE__ */ t(
69
+ "div",
70
+ {
71
+ "data-slot": "card-action",
72
+ className: d(
73
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
74
+ r
75
+ ),
76
+ ...a
77
+ }
78
+ );
79
+ }
80
+ function b({ className: r, ...a }) {
81
+ return /* @__PURE__ */ t(
82
+ "div",
83
+ {
84
+ "data-slot": "card-content",
85
+ className: d(r),
86
+ ...a
87
+ }
88
+ );
89
+ }
90
+ function g({ className: r, ...a }) {
91
+ return /* @__PURE__ */ t(
92
+ "div",
93
+ {
94
+ "data-slot": "card-footer",
95
+ className: d("flex items-center [.border-t]:pt-4", r),
96
+ ...a
97
+ }
98
+ );
99
+ }
100
+ export {
101
+ u as Card,
102
+ v as CardAction,
103
+ b as CardContent,
104
+ p as CardDescription,
105
+ g as CardFooter,
106
+ f as CardHeader,
107
+ m as CardTitle,
108
+ s as cardVariants
109
+ };
@@ -0,0 +1,111 @@
1
+ import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
+ import "react";
3
+ import m from "iconsax-reactjs/dist/esm/TickSquare.js";
4
+ import { Checkbox as i } from "radix-ui";
5
+ import { cn as e } from "../../lib/utils.js";
6
+ import { FOCUS_RING as n } from "../../lib/focus-ring.js";
7
+ function f({
8
+ className: d,
9
+ ...a
10
+ }) {
11
+ return /* @__PURE__ */ r(
12
+ "div",
13
+ {
14
+ "data-slot": "checkbox-card-group",
15
+ className: e("grid gap-3", d),
16
+ ...a
17
+ }
18
+ );
19
+ }
20
+ function g({
21
+ className: d,
22
+ children: a,
23
+ description: c,
24
+ expandedContent: t,
25
+ badge: o,
26
+ ...l
27
+ }) {
28
+ return /* @__PURE__ */ s(
29
+ i.Root,
30
+ {
31
+ "data-slot": "checkbox-card-item",
32
+ className: e(
33
+ // lint-scratch-allow: p-[15px] は border-2 を含めた見た目余白を Figma に合わせる補正値
34
+ "group flex cursor-pointer gap-2 rounded-lg border-2 border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] p-[15px] text-left outline-none transition-colors",
35
+ t ? "flex-col items-stretch" : "items-center",
36
+ "hover:border-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]",
37
+ "data-[state=checked]:border-[var(--Object-Accent-Primary)] data-[state=checked]:bg-[var(--Surface-Primary)]",
38
+ // フォーカス意匠は DS 共通(FOCUS_RING = 緑リング)。以前はオレンジの
39
+ // ring-2 で選択状態と紛らわしかったため統一した。
40
+ n,
41
+ "aria-invalid:border-[var(--Border-Caution)]",
42
+ "disabled:cursor-not-allowed disabled:border-[var(--Border-Medium-Emphasis)] disabled:bg-[var(--Surface-Secondary)] disabled:hover:border-[var(--Border-Medium-Emphasis)] disabled:hover:bg-[var(--Surface-Secondary)]",
43
+ d
44
+ ),
45
+ ...l,
46
+ children: [
47
+ /* @__PURE__ */ s("span", { className: e("flex items-center gap-2", t && "w-full"), children: [
48
+ /* @__PURE__ */ r(
49
+ "span",
50
+ {
51
+ "data-slot": "checkbox-card-icon",
52
+ className: e(
53
+ // lint-scratch-allow: rounded-[5px] は Figma チェックボックス固有値(トークン外)
54
+ "flex size-5 shrink-0 items-center justify-center rounded-[5px] border-2 border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] transition-colors",
55
+ "group-data-[state=checked]:border-transparent group-data-[state=checked]:bg-transparent",
56
+ "group-data-[disabled]:border-[var(--Border-Medium-Emphasis)] group-data-[disabled]:bg-[var(--Surface-Secondary)]"
57
+ ),
58
+ children: /* @__PURE__ */ r(
59
+ i.Indicator,
60
+ {
61
+ "data-slot": "checkbox-card-indicator",
62
+ className: "flex items-center justify-center",
63
+ children: /* @__PURE__ */ r(m, { size: 24, variant: "Bold", className: "text-[var(--Object-Accent-Primary)]" })
64
+ }
65
+ )
66
+ }
67
+ ),
68
+ (a || c || o) && /* @__PURE__ */ s("span", { className: "flex min-w-0 flex-1 flex-col", children: [
69
+ (a || o) && /* @__PURE__ */ s("span", { className: "flex items-center gap-1.5", children: [
70
+ a && /* @__PURE__ */ r(
71
+ "span",
72
+ {
73
+ "data-slot": "checkbox-card-label",
74
+ className: e(
75
+ "typo-body-lg text-[var(--Text-High-Emphasis)]",
76
+ "group-data-[disabled]:text-[var(--Text-Low-Emphasis)]"
77
+ ),
78
+ children: a
79
+ }
80
+ ),
81
+ o && /* @__PURE__ */ r("span", { "data-slot": "checkbox-card-badge", children: o })
82
+ ] }),
83
+ c && /* @__PURE__ */ r(
84
+ "span",
85
+ {
86
+ "data-slot": "checkbox-card-description",
87
+ className: e(
88
+ "typo-body-sm text-[var(--Text-Medium-Emphasis)]",
89
+ "group-data-[disabled]:text-[var(--Text-Low-Emphasis)]"
90
+ ),
91
+ children: c
92
+ }
93
+ )
94
+ ] })
95
+ ] }),
96
+ t && /* @__PURE__ */ r(
97
+ "span",
98
+ {
99
+ "data-slot": "checkbox-card-expanded",
100
+ className: "hidden border-t border-[var(--Border-Medium-Emphasis)] pt-3 group-data-[state=checked]:block",
101
+ children: t
102
+ }
103
+ )
104
+ ]
105
+ }
106
+ );
107
+ }
108
+ export {
109
+ f as CheckboxCardGroup,
110
+ g as CheckboxCardItem
111
+ };
@@ -0,0 +1,92 @@
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import * as p from "react";
3
+ import x from "iconsax-reactjs/dist/esm/TickSquare.js";
4
+ import { Checkbox as l } from "radix-ui";
5
+ import { cn as s } from "../../lib/utils.js";
6
+ import { Label as b } from "./label.js";
7
+ function g({
8
+ label: o,
9
+ required: c,
10
+ helpText: r,
11
+ error: a,
12
+ columns: t = 2,
13
+ children: d,
14
+ className: n
15
+ }) {
16
+ const m = t === 1 ? "grid-cols-1" : t === 3 ? "grid-cols-3" : "grid-cols-2";
17
+ return /* @__PURE__ */ i(
18
+ "fieldset",
19
+ {
20
+ "data-slot": "checkbox-group",
21
+ className: s("flex flex-col gap-3", n),
22
+ "aria-invalid": !!a || void 0,
23
+ children: [
24
+ /* @__PURE__ */ i("legend", { className: "flex items-center gap-2", children: [
25
+ /* @__PURE__ */ e("span", { className: "typo-label-md", children: o }),
26
+ c && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded bg-[var(--Surface-Caution)] typo-label-xs text-[var(--Text-on-Inverse)]", children: "必須" })
27
+ ] }),
28
+ /* @__PURE__ */ e("div", { className: s("grid gap-2", m), children: d }),
29
+ r && !a && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Low-Emphasis)]", children: r }),
30
+ a && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Caution)]", role: "alert", children: a })
31
+ ]
32
+ }
33
+ );
34
+ }
35
+ function N({
36
+ className: o,
37
+ children: c,
38
+ description: r,
39
+ ...a
40
+ }) {
41
+ const t = p.useId();
42
+ return /* @__PURE__ */ i(
43
+ "div",
44
+ {
45
+ "data-slot": "checkbox-group-item",
46
+ className: s("flex items-start gap-2", o),
47
+ children: [
48
+ /* @__PURE__ */ e(
49
+ l.Root,
50
+ {
51
+ id: t,
52
+ className: s(
53
+ // lint-scratch-allow: rounded-[5px] は Figma チェックボックス固有値(トークン外)
54
+ "peer flex size-5 shrink-0 items-center justify-center rounded-[5px] border-2 border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] transition-colors outline-none mt-0.5",
55
+ "data-[state=checked]:border-transparent data-[state=checked]:bg-transparent",
56
+ "focus-visible:border-[var(--Object-Accent-Primary)] focus-visible:ring-2 focus-visible:ring-[var(--Object-Accent-Primary)]/20",
57
+ "aria-invalid:border-[var(--Border-Caution)]",
58
+ "disabled:opacity-50 disabled:cursor-not-allowed"
59
+ ),
60
+ ...a,
61
+ children: /* @__PURE__ */ e(l.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ e(
62
+ x,
63
+ {
64
+ size: 24,
65
+ variant: "Bold",
66
+ className: "text-[var(--Object-Accent-Primary)]"
67
+ }
68
+ ) })
69
+ }
70
+ ),
71
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-0.5", children: [
72
+ /* @__PURE__ */ e(
73
+ b,
74
+ {
75
+ htmlFor: t,
76
+ className: s(
77
+ "typo-body-md cursor-pointer",
78
+ "peer-disabled:opacity-50 peer-disabled:cursor-not-allowed"
79
+ ),
80
+ children: c
81
+ }
82
+ ),
83
+ r && /* @__PURE__ */ e("span", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: r })
84
+ ] })
85
+ ]
86
+ }
87
+ );
88
+ }
89
+ export {
90
+ g as CheckboxGroup,
91
+ N as CheckboxGroupItem
92
+ };
@@ -0,0 +1,90 @@
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import * as p from "react";
3
+ import y from "iconsax-reactjs/dist/esm/TickSquare.js";
4
+ import k from "iconsax-reactjs/dist/esm/MinusSquare.js";
5
+ import { Checkbox as l } from "radix-ui";
6
+ import { cn as b } from "../../lib/utils.js";
7
+ import { FOCUS_RING as g } from "../../lib/focus-ring.js";
8
+ import { useFieldLabelling as N, resolveFieldAria as T } from "../../lib/field-labelling.js";
9
+ function m({
10
+ className: i,
11
+ ...a
12
+ }) {
13
+ return /* @__PURE__ */ e(
14
+ l.Root,
15
+ {
16
+ "data-slot": "checkbox",
17
+ className: b(
18
+ // lint-scratch-allow: rounded-[5px] は Figma チェックボックス固有値(トークン外)
19
+ "peer flex size-5 shrink-0 items-center justify-center rounded-[5px] border-2 border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] transition-colors outline-none",
20
+ "data-[state=checked]:border-transparent data-[state=checked]:bg-transparent",
21
+ "data-[state=indeterminate]:border-transparent data-[state=indeterminate]:bg-transparent",
22
+ // hover はフォーカス中に抑制する(checked 時の border-transparent が
23
+ // フォーカスリングの枠を消してしまうため)。
24
+ "hover:border-[var(--Focus-High-Emphasis)] data-[state=checked]:hover:not-focus-visible:border-transparent data-[state=indeterminate]:hover:not-focus-visible:border-transparent",
25
+ g,
26
+ "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:border-[var(--Border-Medium-Emphasis)]",
27
+ i
28
+ ),
29
+ ...a,
30
+ children: /* @__PURE__ */ e(
31
+ l.Indicator,
32
+ {
33
+ "data-slot": "checkbox-indicator",
34
+ className: "flex items-center justify-center",
35
+ children: a.checked === "indeterminate" ? /* @__PURE__ */ e(k, { size: 24, variant: "Bold", className: "text-[var(--Object-Accent-Primary)]" }) : /* @__PURE__ */ e(y, { size: 24, variant: "Bold", className: "text-[var(--Object-Accent-Primary)]" })
36
+ }
37
+ )
38
+ }
39
+ );
40
+ }
41
+ function w({
42
+ label: i,
43
+ description: a,
44
+ count: o,
45
+ containerClassName: h,
46
+ className: s,
47
+ id: u,
48
+ ...r
49
+ }) {
50
+ const v = N(), x = p.useId(), t = u ?? x, d = `${t}-label`, n = a ? `${t}-description` : void 0;
51
+ if (i === void 0) {
52
+ const f = T({ ...r, id: t }, v);
53
+ return /* @__PURE__ */ e(m, { id: t, className: s, ...r, ...f });
54
+ }
55
+ return /* @__PURE__ */ c(
56
+ "label",
57
+ {
58
+ htmlFor: t,
59
+ "data-slot": "checkbox-row",
60
+ "data-disabled": r.disabled || void 0,
61
+ className: b(
62
+ "flex items-center gap-3 rounded-md px-3 py-2 transition-colors cursor-pointer",
63
+ "hover:bg-[var(--Surface-Tertiary)]",
64
+ "has-[:focus-visible]:bg-[var(--Surface-Tertiary)]",
65
+ r.disabled && "cursor-not-allowed opacity-60 hover:bg-transparent has-[:focus-visible]:bg-transparent",
66
+ h
67
+ ),
68
+ children: [
69
+ /* @__PURE__ */ e(
70
+ m,
71
+ {
72
+ id: t,
73
+ className: s,
74
+ "aria-labelledby": r["aria-label"] ? void 0 : d,
75
+ "aria-describedby": n,
76
+ ...r
77
+ }
78
+ ),
79
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
80
+ /* @__PURE__ */ e("span", { id: d, className: "typo-body-md text-[var(--Text-High-Emphasis)]", children: i }),
81
+ a && /* @__PURE__ */ e("span", { id: n, className: "block typo-body-sm text-[var(--Text-Medium-Emphasis)] mt-0.5", children: a })
82
+ ] }),
83
+ o !== void 0 && /* @__PURE__ */ e("span", { className: "shrink-0 typo-label-sm text-[var(--Text-Medium-Emphasis)] tabular-nums", children: o.toLocaleString() })
84
+ ]
85
+ }
86
+ );
87
+ }
88
+ export {
89
+ w as Checkbox
90
+ };