@cakejp/design-system 0.20.0 → 0.21.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 (161) hide show
  1. package/CHANGELOG.md +179 -0
  2. package/CLAUDE.md +5 -3
  3. package/MIGRATION.md +3 -3
  4. package/README.md +31 -11
  5. package/contracts/components.json +424 -62
  6. package/contracts/composition.json +38 -4
  7. package/contracts/rules.json +27 -5
  8. package/contracts/screen-patterns.json +6 -4
  9. package/dist/components/ec/admin-shell.js +62 -60
  10. package/dist/components/ec/anniversary-card.js +13 -12
  11. package/dist/components/ec/coupon-card.js +11 -11
  12. package/dist/components/ec/delivery-calendar.js +51 -45
  13. package/dist/components/ec/mypage-shell.js +80 -69
  14. package/dist/components/ec/product-card.js +93 -76
  15. package/dist/components/ec/product-carousel.js +65 -60
  16. package/dist/components/ec/product-detail-bar.js +13 -11
  17. package/dist/components/ec/product-detail-sidebar.js +60 -58
  18. package/dist/components/ec/product-list-item.js +64 -63
  19. package/dist/components/ec/product-option.js +30 -26
  20. package/dist/components/ec/rating-stars.js +27 -27
  21. package/dist/components/ec/review-card.js +32 -32
  22. package/dist/components/ec/review-form.js +37 -37
  23. package/dist/components/ec/shop-card.js +21 -19
  24. package/dist/components/foundations/accordion.js +33 -31
  25. package/dist/components/foundations/alert-dialog.js +4 -5
  26. package/dist/components/foundations/badge.js +5 -5
  27. package/dist/components/foundations/breadcrumb.js +27 -26
  28. package/dist/components/foundations/button.js +144 -25
  29. package/dist/components/foundations/calendar.js +28 -26
  30. package/dist/components/foundations/checkbox-card.js +71 -47
  31. package/dist/components/foundations/checkbox-group.js +30 -27
  32. package/dist/components/foundations/checkbox.js +69 -52
  33. package/dist/components/foundations/chip-variants.js +13 -0
  34. package/dist/components/foundations/command.js +81 -79
  35. package/dist/components/foundations/confirm-dialog.js +136 -0
  36. package/dist/components/foundations/context-menu.js +43 -38
  37. package/dist/components/foundations/data-table.js +88 -84
  38. package/dist/components/foundations/dialog.js +45 -36
  39. package/dist/components/foundations/dropdown-menu.js +47 -42
  40. package/dist/components/foundations/file-input.js +97 -67
  41. package/dist/components/foundations/hover-card.js +21 -21
  42. package/dist/components/foundations/menubar.js +75 -69
  43. package/dist/components/foundations/navigation-menu.js +31 -26
  44. package/dist/components/foundations/pagination.js +54 -50
  45. package/dist/components/foundations/popover.js +7 -7
  46. package/dist/components/foundations/progress.js +10 -6
  47. package/dist/components/foundations/radio-group.js +6 -3
  48. package/dist/components/foundations/responsive-dialog.js +73 -55
  49. package/dist/components/foundations/scroll-area.js +18 -14
  50. package/dist/components/foundations/select.js +44 -39
  51. package/dist/components/foundations/sheet.js +45 -37
  52. package/dist/components/foundations/skeleton.js +6 -6
  53. package/dist/components/foundations/skip-link.js +10 -8
  54. package/dist/components/foundations/slider.js +73 -48
  55. package/dist/components/foundations/sonner.js +5 -4
  56. package/dist/components/foundations/spinner.js +7 -5
  57. package/dist/components/foundations/switch.js +11 -10
  58. package/dist/components/foundations/tabs.js +54 -39
  59. package/dist/components/foundations/toggle-group.js +29 -21
  60. package/dist/components/foundations/toggle.js +20 -16
  61. package/dist/components/primitives/admin-side-nav.js +65 -62
  62. package/dist/components/primitives/banner-carousel.js +32 -29
  63. package/dist/components/primitives/bottom-tab-bar.js +16 -15
  64. package/dist/components/primitives/category-scroll.js +39 -29
  65. package/dist/components/primitives/category-shortcuts.js +9 -9
  66. package/dist/components/primitives/chat-composer.js +77 -74
  67. package/dist/components/primitives/chip.js +84 -61
  68. package/dist/components/primitives/combobox.js +63 -47
  69. package/dist/components/primitives/container.js +9 -9
  70. package/dist/components/primitives/content-card.js +15 -17
  71. package/dist/components/primitives/content-carousel.js +79 -68
  72. package/dist/components/primitives/date-picker.js +137 -99
  73. package/dist/components/primitives/footer.js +36 -37
  74. package/dist/components/primitives/header.js +175 -168
  75. package/dist/components/primitives/image-carousel.js +107 -87
  76. package/dist/components/primitives/image-gallery.js +32 -27
  77. package/dist/components/primitives/image-uploader.js +43 -22
  78. package/dist/components/primitives/list-item.js +59 -51
  79. package/dist/components/primitives/menu-drawer.js +36 -38
  80. package/dist/components/primitives/multi-select.js +89 -58
  81. package/dist/components/primitives/notification-list.js +10 -9
  82. package/dist/components/primitives/number-input.js +116 -105
  83. package/dist/components/primitives/scroll-row.js +21 -0
  84. package/dist/components/primitives/search-bar.js +31 -28
  85. package/dist/components/primitives/section-header.js +54 -53
  86. package/dist/components/primitives/side-nav.js +57 -56
  87. package/dist/components/primitives/sub-nav.js +13 -14
  88. package/dist/components/primitives/tag.js +4 -2
  89. package/dist/index.css +1 -1
  90. package/dist/index.js +3076 -929
  91. package/dist/lib/field-labelling.js +31 -21
  92. package/dist/lib/focus-ring.js +22 -4
  93. package/dist/lib/high-contrast.js +4 -0
  94. package/dist/lib/image-index.js +8 -0
  95. package/dist/lib/use-prefers-reduced-motion.js +21 -0
  96. package/dist/types/components/ec/admin-shell.d.ts +11 -1
  97. package/dist/types/components/ec/anniversary-card.d.ts +9 -1
  98. package/dist/types/components/ec/mypage-shell.d.ts +12 -1
  99. package/dist/types/components/ec/product-card.d.ts +13 -1
  100. package/dist/types/components/ec/product-carousel.d.ts +13 -1
  101. package/dist/types/components/ec/product-detail-bar.d.ts +12 -1
  102. package/dist/types/components/ec/product-detail-sidebar.d.ts +11 -1
  103. package/dist/types/components/ec/product-list-item.d.ts +9 -1
  104. package/dist/types/components/ec/rating-stars.d.ts +2 -0
  105. package/dist/types/components/ec/review-card.d.ts +1 -1
  106. package/dist/types/components/ec/shop-card.d.ts +8 -1
  107. package/dist/types/components/foundations/badge.d.ts +1 -1
  108. package/dist/types/components/foundations/breadcrumb.d.ts +8 -1
  109. package/dist/types/components/foundations/button.d.ts +38 -3
  110. package/dist/types/components/foundations/checkbox-card.d.ts +7 -1
  111. package/dist/types/components/foundations/checkbox.d.ts +1 -1
  112. package/dist/types/components/foundations/chip-variants.d.ts +2 -2
  113. package/dist/types/components/foundations/confirm-dialog.d.ts +61 -0
  114. package/dist/types/components/foundations/data-table.d.ts +9 -2
  115. package/dist/types/components/foundations/dialog.d.ts +16 -1
  116. package/dist/types/components/foundations/pagination.d.ts +1 -1
  117. package/dist/types/components/foundations/responsive-dialog.d.ts +2 -1
  118. package/dist/types/components/foundations/sheet.d.ts +12 -1
  119. package/dist/types/components/foundations/skeleton.d.ts +6 -0
  120. package/dist/types/components/foundations/slider.d.ts +15 -1
  121. package/dist/types/components/foundations/tabs.d.ts +7 -0
  122. package/dist/types/components/primitives/admin-side-nav.d.ts +22 -2
  123. package/dist/types/components/primitives/banner-carousel.d.ts +9 -1
  124. package/dist/types/components/primitives/bottom-tab-bar.d.ts +13 -2
  125. package/dist/types/components/primitives/category-scroll.d.ts +10 -1
  126. package/dist/types/components/primitives/category-shortcuts.d.ts +11 -2
  127. package/dist/types/components/primitives/chip.d.ts +22 -3
  128. package/dist/types/components/primitives/combobox.d.ts +7 -2
  129. package/dist/types/components/primitives/container.d.ts +3 -0
  130. package/dist/types/components/primitives/content-card.d.ts +1 -1
  131. package/dist/types/components/primitives/content-carousel.d.ts +12 -4
  132. package/dist/types/components/primitives/date-picker.d.ts +10 -3
  133. package/dist/types/components/primitives/footer.d.ts +1 -1
  134. package/dist/types/components/primitives/header.d.ts +14 -2
  135. package/dist/types/components/primitives/image-carousel.d.ts +23 -5
  136. package/dist/types/components/primitives/list-item.d.ts +10 -1
  137. package/dist/types/components/primitives/menu-drawer.d.ts +1 -1
  138. package/dist/types/components/primitives/multi-select.d.ts +7 -2
  139. package/dist/types/components/primitives/notification-list.d.ts +10 -1
  140. package/dist/types/components/primitives/number-input.d.ts +18 -5
  141. package/dist/types/components/primitives/scroll-row.d.ts +43 -0
  142. package/dist/types/components/primitives/section-header.d.ts +9 -2
  143. package/dist/types/components/primitives/side-nav.d.ts +13 -1
  144. package/dist/types/components/primitives/sub-nav.d.ts +1 -1
  145. package/dist/types/components/primitives/tag.d.ts +1 -1
  146. package/dist/types/index.d.ts +7 -1
  147. package/dist/types/lib/field-labelling.d.ts +23 -8
  148. package/dist/types/lib/focus-ring.d.ts +70 -3
  149. package/dist/types/lib/high-contrast.d.ts +25 -0
  150. package/dist/types/lib/image-index.d.ts +2 -0
  151. package/dist/types/lib/link-component.d.ts +26 -21
  152. package/dist/types/lib/use-prefers-reduced-motion.d.ts +9 -0
  153. package/package.json +11 -3
  154. package/src/components/COMPONENT_LOOKUP.md +19 -17
  155. package/src/preset-standalone.css +42 -0
  156. package/src/preset.css +20 -1
  157. package/src/styles/semantic.css +57 -0
  158. package/templates/AGENTS.md +5 -1
  159. package/templates/CLAUDE.md +3 -1
  160. package/tokens.json +49 -0
  161. package/dist/lib/link-component.js +0 -6
@@ -1,11 +1,12 @@
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`,
1
+ import { jsx as i, jsxs as f } from "react/jsx-runtime";
2
+ import * as h from "react";
3
+ import { cva as y } from "class-variance-authority";
4
+ import { Loader2Icon as B } from "lucide-react";
5
+ import { Slot as p } from "radix-ui";
6
+ import { cn as c } from "../../lib/utils.js";
7
+ import { FOCUS_RING as T } from "../../lib/focus-ring.js";
8
+ const u = y(
9
+ `inline-flex shrink-0 items-center justify-center gap-2 rounded-lg typo-label-md whitespace-nowrap transition-all outline-none ${T} 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
  {
10
11
  variants: {
11
12
  variant: {
@@ -14,7 +15,18 @@ const b = n(
14
15
  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
16
  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
17
  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
+ * outline — 白地 + 黒系の 1px 枠。ブランド色を使わない「準主役」の前進アクション
20
+ * (一覧・カードで繰り返す操作、「一覧を見る」等の移動ボタン)。
21
+ * hover / active は ghost と同じ薄い下地(Hover-Text-Button / Active-Text-Button)。
22
+ * 枠は常時 Border-High-Emphasis(hover でも変えない)。disabled は枠・文字とも薄くする。
23
+ */
24
+ outline: "border border-[var(--Border-High-Emphasis)] bg-[var(--Surface-Primary)] text-[var(--Text-High-Emphasis)] hover:bg-[var(--Hover-Text-Button)] active:bg-[var(--Active-Text-Button)] disabled:border-[var(--Border-Medium-Emphasis)] disabled:bg-[var(--Surface-Primary)] disabled:text-[var(--Text-Disable)]",
25
+ /**
26
+ * link — 補助リンク(「もっと見る」「利用規約を見る」等)。ブランド色を使わず、
27
+ * 控えめなグレー(Text-Medium-Emphasis)+ 常時下線。hover で Text-High-Emphasis に濃くする。
28
+ */
29
+ link: "text-[var(--Text-Medium-Emphasis)] underline underline-offset-4 hover:text-[var(--Text-High-Emphasis)] disabled:text-[var(--Text-Disable)]",
18
30
  /**
19
31
  * inverse — 暗背景の上で使う primary CTA。
20
32
  * 白背景 + accent text (Brand Cake Orange)。
@@ -79,27 +91,134 @@ const b = n(
79
91
  size: "default"
80
92
  }
81
93
  }
82
- );
83
- function m({
84
- className: a,
85
- variant: e = "default",
86
- size: r = "default",
87
- asChild: t = !1,
88
- ...i
94
+ ), P = "relative [-webkit-text-fill-color:transparent] [&>*:not([data-slot=button-spinner])]:opacity-0 no-underline forced-colors:[forced-color-adjust:none] forced-colors:[color:ButtonText]! forced-colors:[border-color:ButtonText]!", k = {
95
+ default: "forced-colors:[background-color:ButtonFace]!",
96
+ secondary: "forced-colors:[background-color:ButtonFace]!",
97
+ tertiary: "forced-colors:[background-color:ButtonFace]!",
98
+ destructive: "forced-colors:[background-color:ButtonFace]!",
99
+ inverse: "forced-colors:[background-color:ButtonFace]!",
100
+ outline: "forced-colors:[background-color:ButtonFace]!",
101
+ ghost: "forced-colors:[background-color:transparent]!",
102
+ link: "forced-colors:[background-color:transparent]!",
103
+ "ghost-inverse": "forced-colors:[background-color:transparent]!",
104
+ overlay: "forced-colors:[background-color:color-mix(in_srgb,Canvas_80%,transparent)]! forced-colors:shadow-none"
105
+ };
106
+ function n(e) {
107
+ e.preventDefault(), e.stopPropagation();
108
+ }
109
+ function S() {
110
+ try {
111
+ return process.env.NODE_ENV !== "production";
112
+ } catch {
113
+ return !1;
114
+ }
115
+ }
116
+ function C(e) {
117
+ if (!e?.id) return;
118
+ e.ownerDocument.querySelectorAll(`[id="${e.id.replace(/["\\]/g, "\\$&")}"]`).length > 1 && console.warn(
119
+ `[Button] loading の読み上げ文言の id「${e.id}」が重複しています。同じ aria-labelledby を複数のボタンで共有して loading にする場合は、各ボタンに id を付けてください。`
120
+ );
121
+ }
122
+ function D(e, r) {
123
+ const t = e["aria-labelledby"]?.trim();
124
+ if (t) {
125
+ const s = `${e.id ?? t.split(/\s+/).join("-")}-loading-label`;
126
+ return { labelId: s, attrs: { "aria-labelledby": `${t} ${s}` } };
127
+ }
128
+ const a = e["aria-label"];
129
+ return a && (typeof r == "string" || typeof r == "number") ? { attrs: { "aria-label": `${a} ${r}` } } : { attrs: {} };
130
+ }
131
+ function W({
132
+ className: e,
133
+ variant: r = "default",
134
+ size: t = "default",
135
+ asChild: a = !1,
136
+ loading: s = !1,
137
+ loadingLabel: o = "処理中",
138
+ ...b
89
139
  }) {
90
- const v = t ? s.Root : "button";
91
- return /* @__PURE__ */ o(
92
- v,
140
+ const m = a ? p.Root : "button";
141
+ if (!s)
142
+ return /* @__PURE__ */ i(
143
+ m,
144
+ {
145
+ "data-slot": "button",
146
+ "data-variant": r,
147
+ "data-size": t,
148
+ className: c(u({ variant: r, size: t, className: e })),
149
+ ...b
150
+ }
151
+ );
152
+ const { children: l, ...d } = b;
153
+ if (a) {
154
+ const x = h.isValidElement(l) ? h.cloneElement(l, {
155
+ "aria-disabled": !0,
156
+ tabIndex: -1,
157
+ onClick: n,
158
+ onClickCapture: n,
159
+ onAuxClickCapture: n
160
+ }) : l;
161
+ return /* @__PURE__ */ i(
162
+ p.Root,
163
+ {
164
+ "data-slot": "button",
165
+ "data-variant": r,
166
+ "data-size": t,
167
+ className: c(u({ variant: r, size: t, className: e })),
168
+ ...d,
169
+ onClick: void 0,
170
+ onClickCapture: void 0,
171
+ "aria-busy": "true",
172
+ children: x
173
+ }
174
+ );
175
+ }
176
+ const g = o != null && o !== !1 && o !== "", v = g ? D(d, o) : { attrs: {} };
177
+ return /* @__PURE__ */ f(
178
+ "button",
93
179
  {
94
180
  "data-slot": "button",
95
- "data-variant": e,
96
- "data-size": r,
97
- className: d(b({ variant: e, size: r, className: a })),
98
- ...i
181
+ "data-variant": r,
182
+ "data-size": t,
183
+ className: c(
184
+ u({
185
+ variant: r,
186
+ size: t,
187
+ className: c(P, k[r ?? "default"], e)
188
+ })
189
+ ),
190
+ ...d,
191
+ ...v.attrs,
192
+ "aria-busy": "true",
193
+ "aria-disabled": "true",
194
+ onClickCapture: n,
195
+ onClick: n,
196
+ children: [
197
+ l,
198
+ g ? /* @__PURE__ */ i(
199
+ "span",
200
+ {
201
+ id: v.labelId,
202
+ ref: v.labelId && !d.id && S() ? C : void 0,
203
+ "data-slot": "button-loading-label",
204
+ className: "sr-only",
205
+ children: o
206
+ }
207
+ ) : null,
208
+ /* @__PURE__ */ i(
209
+ "span",
210
+ {
211
+ "data-slot": "button-spinner",
212
+ "aria-hidden": "true",
213
+ className: "pointer-events-none absolute inset-0 flex items-center justify-center",
214
+ children: /* @__PURE__ */ i(B, { className: "animate-spin motion-reduce:animate-none" })
215
+ }
216
+ )
217
+ ]
99
218
  }
100
219
  );
101
220
  }
102
221
  export {
103
- m as Button,
104
- b as buttonVariants
222
+ W as Button,
223
+ u as buttonVariants
105
224
  };
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsx as n } from "react/jsx-runtime";
2
+ import { jsx as o } from "react/jsx-runtime";
3
3
  import * as m from "react";
4
- import { ChevronLeftIcon as y, ChevronRightIcon as x, ChevronDownIcon as h } from "lucide-react";
5
- import { getDefaultClassNames as f, DayPicker as w } from "react-day-picker";
4
+ import { ChevronLeftIcon as h, ChevronRightIcon as x, ChevronDownIcon as y } from "lucide-react";
5
+ import { getDefaultClassNames as p, DayPicker as _ } from "react-day-picker";
6
6
  import { cn as e } from "../../lib/utils.js";
7
- import { buttonVariants as p, Button as _ } from "./button.js";
8
- function j({
7
+ import { buttonVariants as f, Button as v } from "./button.js";
8
+ function R({
9
9
  className: c,
10
10
  classNames: i,
11
11
  showOutsideDays: r = !0,
@@ -15,9 +15,9 @@ function j({
15
15
  components: b,
16
16
  ...g
17
17
  }) {
18
- const t = f();
19
- return /* @__PURE__ */ n(
20
- w,
18
+ const t = p();
19
+ return /* @__PURE__ */ o(
20
+ _,
21
21
  {
22
22
  showOutsideDays: r,
23
23
  className: e(
@@ -43,12 +43,12 @@ function j({
43
43
  t.nav
44
44
  ),
45
45
  button_previous: e(
46
- p({ variant: l }),
46
+ f({ variant: l }),
47
47
  "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
48
48
  t.button_previous
49
49
  ),
50
50
  button_next: e(
51
- p({ variant: l }),
51
+ f({ variant: l }),
52
52
  "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
53
53
  t.button_next
54
54
  ),
@@ -61,7 +61,9 @@ function j({
61
61
  t.dropdowns
62
62
  ),
63
63
  dropdown_root: e(
64
- "relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
64
+ "relative rounded-md border border-[var(--Border-Control,var(--input))] shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-[color:var(--Focus-Ring-Control,color-mix(in_oklab,var(--ring)_50%,transparent))]",
65
+ // forced-colors では ring(box-shadow)が消える。中の select は透明なので、枠のほうに輪郭線を出す
66
+ "forced-colors:has-focus:outline-solid forced-colors:has-focus:outline-2 forced-colors:has-focus:outline-offset-2 forced-colors:has-focus:outline-[Highlight]",
65
67
  t.dropdown_root
66
68
  ),
67
69
  dropdown: e(
@@ -115,41 +117,41 @@ function j({
115
117
  ...i
116
118
  },
117
119
  components: {
118
- Root: ({ className: a, rootRef: d, ...o }) => /* @__PURE__ */ n(
120
+ Root: ({ className: a, rootRef: n, ...d }) => /* @__PURE__ */ o(
119
121
  "div",
120
122
  {
121
123
  "data-slot": "calendar",
122
- ref: d,
124
+ ref: n,
123
125
  className: e(a),
124
- ...o
126
+ ...d
125
127
  }
126
128
  ),
127
- Chevron: ({ className: a, orientation: d, ...o }) => d === "left" ? /* @__PURE__ */ n(y, { className: e("size-4", a), ...o }) : d === "right" ? /* @__PURE__ */ n(
129
+ Chevron: ({ className: a, orientation: n, ...d }) => n === "left" ? /* @__PURE__ */ o(h, { className: e("size-4", a), ...d }) : n === "right" ? /* @__PURE__ */ o(
128
130
  x,
129
131
  {
130
132
  className: e("size-4", a),
131
- ...o
133
+ ...d
132
134
  }
133
- ) : /* @__PURE__ */ n(h, { className: e("size-4", a), ...o }),
134
- DayButton: v,
135
- 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
+ ) : /* @__PURE__ */ o(y, { className: e("size-4", a), ...d }),
136
+ DayButton: w,
137
+ WeekNumber: ({ children: a, ...n }) => /* @__PURE__ */ o("td", { ...n, children: /* @__PURE__ */ o("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: a }) }),
136
138
  ...b
137
139
  },
138
140
  ...g
139
141
  }
140
142
  );
141
143
  }
142
- function v({
144
+ function w({
143
145
  className: c,
144
146
  day: i,
145
147
  modifiers: r,
146
148
  ...s
147
149
  }) {
148
- const l = f(), u = m.useRef(null);
150
+ const l = p(), u = m.useRef(null);
149
151
  return m.useEffect(() => {
150
152
  r.focused && u.current?.focus();
151
- }, [r.focused]), /* @__PURE__ */ n(
152
- _,
153
+ }, [r.focused]), /* @__PURE__ */ o(
154
+ v,
153
155
  {
154
156
  ref: u,
155
157
  variant: "ghost",
@@ -160,7 +162,7 @@ function v({
160
162
  "data-range-end": r.range_end,
161
163
  "data-range-middle": r.range_middle,
162
164
  className: e(
163
- "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",
165
+ "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-[color:var(--Focus-Ring-Control,color-mix(in_oklab,var(--ring)_50%,transparent))] 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",
164
166
  l.day,
165
167
  c
166
168
  ),
@@ -169,6 +171,6 @@ function v({
169
171
  );
170
172
  }
171
173
  export {
172
- j as Calendar,
173
- v as CalendarDayButton
174
+ R as Calendar,
175
+ w as CalendarDayButton
174
176
  };
@@ -1,104 +1,128 @@
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
1
+ "use client";
2
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
3
+ import * as x from "react";
4
+ import M from "iconsax-reactjs/dist/esm/TickSquare.js";
5
+ import { Checkbox as f } from "radix-ui";
6
+ import { cn as a } from "../../lib/utils.js";
7
+ import { FOCUS_RING as j } from "../../lib/focus-ring.js";
8
+ import { mergeIdRefs as T } from "../../lib/field-labelling.js";
9
+ function A({
10
+ className: c,
11
+ ...r
10
12
  }) {
11
- return /* @__PURE__ */ r(
13
+ return /* @__PURE__ */ e(
12
14
  "div",
13
15
  {
14
16
  "data-slot": "checkbox-card-group",
15
- className: e("grid gap-3", d),
16
- ...a
17
+ className: a("grid gap-3", c),
18
+ ...r
17
19
  }
18
20
  );
19
21
  }
20
- function g({
21
- className: d,
22
- children: a,
23
- description: c,
24
- expandedContent: t,
25
- badge: o,
26
- ...l
22
+ function G({
23
+ className: c,
24
+ children: r,
25
+ description: s,
26
+ expandedContent: o,
27
+ badge: d,
28
+ checked: i,
29
+ defaultChecked: n,
30
+ onCheckedChange: g,
31
+ "aria-label": b,
32
+ "aria-labelledby": k,
33
+ "aria-describedby": y,
34
+ ...S
27
35
  }) {
28
- return /* @__PURE__ */ s(
29
- i.Root,
36
+ const l = x.useId(), m = `${l}-label`, p = `${l}-description`, h = `${l}-expanded`, [N, B] = x.useState(n === !0), E = (i !== void 0 ? i : N) === !0, u = !!(r || d), C = k ?? (b === void 0 && u ? m : void 0), I = T(
37
+ // ラベルが無いカードは名前が内容(= 説明)になるので、説明を重ねて 2 回読ませない
38
+ s && u ? p : void 0,
39
+ o && E ? h : void 0,
40
+ y
41
+ );
42
+ return /* @__PURE__ */ t(
43
+ f.Root,
30
44
  {
31
45
  "data-slot": "checkbox-card-item",
32
- className: e(
46
+ checked: i,
47
+ defaultChecked: n,
48
+ onCheckedChange: (v) => {
49
+ B(v === !0), g?.(v);
50
+ },
51
+ "aria-label": b,
52
+ "aria-labelledby": C,
53
+ "aria-describedby": I,
54
+ className: a(
33
55
  // 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",
56
+ "group flex cursor-pointer gap-2 rounded-lg border-2 border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Primary)] p-[15px] text-left outline-none transition-colors",
57
+ o ? "flex-col items-stretch" : "items-center",
36
58
  "hover:border-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]",
37
59
  "data-[state=checked]:border-[var(--Object-Accent-Primary)] data-[state=checked]:bg-[var(--Surface-Primary)]",
38
60
  // フォーカス意匠は DS 共通(FOCUS_RING = 緑リング)。以前はオレンジの
39
61
  // ring-2 で選択状態と紛らわしかったため統一した。
40
- n,
62
+ j,
41
63
  "aria-invalid:border-[var(--Border-Caution)]",
42
64
  "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
65
+ c
44
66
  ),
45
- ...l,
67
+ ...S,
46
68
  children: [
47
- /* @__PURE__ */ s("span", { className: e("flex items-center gap-2", t && "w-full"), children: [
48
- /* @__PURE__ */ r(
69
+ /* @__PURE__ */ t("span", { className: a("flex items-center gap-2", o && "w-full"), children: [
70
+ /* @__PURE__ */ e(
49
71
  "span",
50
72
  {
51
73
  "data-slot": "checkbox-card-icon",
52
- className: e(
74
+ className: a(
53
75
  // 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",
76
+ "flex size-5 shrink-0 items-center justify-center rounded-[5px] border-2 border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Primary)] transition-colors",
55
77
  "group-data-[state=checked]:border-transparent group-data-[state=checked]:bg-transparent",
56
78
  "group-data-[disabled]:border-[var(--Border-Medium-Emphasis)] group-data-[disabled]:bg-[var(--Surface-Secondary)]"
57
79
  ),
58
- children: /* @__PURE__ */ r(
59
- i.Indicator,
80
+ children: /* @__PURE__ */ e(
81
+ f.Indicator,
60
82
  {
61
83
  "data-slot": "checkbox-card-indicator",
62
84
  className: "flex items-center justify-center",
63
- children: /* @__PURE__ */ r(m, { size: 24, variant: "Bold", className: "text-[var(--Object-Accent-Primary)]" })
85
+ children: /* @__PURE__ */ e(M, { size: 24, variant: "Bold", className: "text-[var(--Object-Accent-Primary)]" })
64
86
  }
65
87
  )
66
88
  }
67
89
  ),
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(
90
+ (r || s || d) && /* @__PURE__ */ t("span", { className: "flex min-w-0 flex-1 flex-col", children: [
91
+ (r || d) && /* @__PURE__ */ t("span", { id: m, className: "flex items-center gap-1.5", children: [
92
+ r && /* @__PURE__ */ e(
71
93
  "span",
72
94
  {
73
95
  "data-slot": "checkbox-card-label",
74
- className: e(
96
+ className: a(
75
97
  "typo-body-lg text-[var(--Text-High-Emphasis)]",
76
98
  "group-data-[disabled]:text-[var(--Text-Low-Emphasis)]"
77
99
  ),
78
- children: a
100
+ children: r
79
101
  }
80
102
  ),
81
- o && /* @__PURE__ */ r("span", { "data-slot": "checkbox-card-badge", children: o })
103
+ d && /* @__PURE__ */ e("span", { "data-slot": "checkbox-card-badge", children: d })
82
104
  ] }),
83
- c && /* @__PURE__ */ r(
105
+ s && /* @__PURE__ */ e(
84
106
  "span",
85
107
  {
108
+ id: p,
86
109
  "data-slot": "checkbox-card-description",
87
- className: e(
110
+ className: a(
88
111
  "typo-body-sm text-[var(--Text-Medium-Emphasis)]",
89
112
  "group-data-[disabled]:text-[var(--Text-Low-Emphasis)]"
90
113
  ),
91
- children: c
114
+ children: s
92
115
  }
93
116
  )
94
117
  ] })
95
118
  ] }),
96
- t && /* @__PURE__ */ r(
119
+ o && /* @__PURE__ */ e(
97
120
  "span",
98
121
  {
122
+ id: h,
99
123
  "data-slot": "checkbox-card-expanded",
100
124
  className: "hidden border-t border-[var(--Border-Medium-Emphasis)] pt-3 group-data-[state=checked]:block",
101
- children: t
125
+ children: o
102
126
  }
103
127
  )
104
128
  ]
@@ -106,6 +130,6 @@ function g({
106
130
  );
107
131
  }
108
132
  export {
109
- f as CheckboxCardGroup,
110
- g as CheckboxCardItem
133
+ A as CheckboxCardGroup,
134
+ G as CheckboxCardItem
111
135
  };
@@ -1,13 +1,14 @@
1
1
  "use client";
2
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
3
3
  import * as p from "react";
4
4
  import x from "iconsax-reactjs/dist/esm/TickSquare.js";
5
- import { Checkbox as l } from "radix-ui";
6
- import { cn as s } from "../../lib/utils.js";
5
+ import { Checkbox as c } from "radix-ui";
6
+ import { cn as o } from "../../lib/utils.js";
7
+ import { FOCUS_RING as u } from "../../lib/focus-ring.js";
7
8
  import { Label as b } from "./label.js";
8
- function g({
9
- label: o,
10
- required: c,
9
+ function k({
10
+ label: i,
11
+ required: l,
11
12
  helpText: r,
12
13
  error: a,
13
14
  columns: t = 2,
@@ -15,51 +16,53 @@ function g({
15
16
  className: n
16
17
  }) {
17
18
  const m = t === 1 ? "grid-cols-1" : t === 3 ? "grid-cols-3" : "grid-cols-2";
18
- return /* @__PURE__ */ i(
19
+ return /* @__PURE__ */ s(
19
20
  "fieldset",
20
21
  {
21
22
  "data-slot": "checkbox-group",
22
- className: s("flex flex-col gap-3", n),
23
+ className: o("flex flex-col gap-3", n),
23
24
  "aria-invalid": !!a || void 0,
24
25
  children: [
25
- /* @__PURE__ */ i("legend", { className: "flex items-center gap-2", children: [
26
- /* @__PURE__ */ e("span", { className: "typo-label-md", children: o }),
27
- 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: "必須" })
26
+ /* @__PURE__ */ s("legend", { className: "flex items-center gap-2", children: [
27
+ /* @__PURE__ */ e("span", { className: "typo-label-md", children: i }),
28
+ l && /* @__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: "必須" })
28
29
  ] }),
29
- /* @__PURE__ */ e("div", { className: s("grid gap-2", m), children: d }),
30
+ /* @__PURE__ */ e("div", { className: o("grid gap-2", m), children: d }),
30
31
  r && !a && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Low-Emphasis)]", children: r }),
31
32
  a && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Caution)]", role: "alert", children: a })
32
33
  ]
33
34
  }
34
35
  );
35
36
  }
36
- function N({
37
- className: o,
38
- children: c,
37
+ function C({
38
+ className: i,
39
+ children: l,
39
40
  description: r,
40
41
  ...a
41
42
  }) {
42
43
  const t = p.useId();
43
- return /* @__PURE__ */ i(
44
+ return /* @__PURE__ */ s(
44
45
  "div",
45
46
  {
46
47
  "data-slot": "checkbox-group-item",
47
- className: s("flex items-start gap-2", o),
48
+ className: o("flex items-start gap-2", i),
48
49
  children: [
49
50
  /* @__PURE__ */ e(
50
- l.Root,
51
+ c.Root,
51
52
  {
52
53
  id: t,
53
- className: s(
54
+ className: o(
54
55
  // lint-scratch-allow: rounded-[5px] は Figma チェックボックス固有値(トークン外)
55
- "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",
56
+ "peer flex size-5 shrink-0 items-center justify-center rounded-[5px] border-2 border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Primary)] transition-colors outline-none mt-0.5",
56
57
  "data-[state=checked]:border-transparent data-[state=checked]:bg-transparent",
57
- "focus-visible:border-[var(--Object-Accent-Primary)] focus-visible:ring-2 focus-visible:ring-[var(--Object-Accent-Primary)]/20",
58
+ // フォーカス意匠は DS 共通(FOCUS_RING = 緑リング。rules.json A005)。
59
+ // 以前はオレンジの ring-2 で、選択状態の色と紛らわしかった(Checkbox と揃える)。
60
+ u,
58
61
  "aria-invalid:border-[var(--Border-Caution)]",
59
62
  "disabled:opacity-50 disabled:cursor-not-allowed"
60
63
  ),
61
64
  ...a,
62
- children: /* @__PURE__ */ e(l.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ e(
65
+ children: /* @__PURE__ */ e(c.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ e(
63
66
  x,
64
67
  {
65
68
  size: 24,
@@ -69,16 +72,16 @@ function N({
69
72
  ) })
70
73
  }
71
74
  ),
72
- /* @__PURE__ */ i("div", { className: "flex flex-col gap-0.5", children: [
75
+ /* @__PURE__ */ s("div", { className: "flex flex-col gap-0.5", children: [
73
76
  /* @__PURE__ */ e(
74
77
  b,
75
78
  {
76
79
  htmlFor: t,
77
- className: s(
80
+ className: o(
78
81
  "typo-body-md cursor-pointer",
79
82
  "peer-disabled:opacity-50 peer-disabled:cursor-not-allowed"
80
83
  ),
81
- children: c
84
+ children: l
82
85
  }
83
86
  ),
84
87
  r && /* @__PURE__ */ e("span", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: r })
@@ -88,6 +91,6 @@ function N({
88
91
  );
89
92
  }
90
93
  export {
91
- g as CheckboxGroup,
92
- N as CheckboxGroupItem
94
+ k as CheckboxGroup,
95
+ C as CheckboxGroupItem
93
96
  };