@cakejp/design-system 0.20.1 → 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 +172 -0
  2. package/CLAUDE.md +5 -3
  3. package/MIGRATION.md +3 -3
  4. package/README.md +31 -11
  5. package/contracts/components.json +420 -63
  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 +87 -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 +6 -6
  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 +3051 -924
  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 +18 -16
  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,176 +1,214 @@
1
1
  "use client";
2
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
3
- import * as y from "react";
4
- import v from "iconsax-reactjs/dist/esm/Calendar.js";
5
- import { X as H } from "lucide-react";
6
- import { ja as A } from "react-day-picker/locale";
7
- import { cn as S } from "../../lib/utils.js";
8
- import { Button as N } from "../foundations/button.js";
9
- import { Calendar as P } from "../foundations/calendar.js";
10
- import { Popover as z, PopoverTrigger as j, PopoverContent as k } from "../foundations/popover.js";
11
- import { Select as M, SelectTrigger as C, SelectValue as w, SelectContent as D, SelectItem as E } from "../foundations/select.js";
12
- const $ = ["日", "月", "火", "水", "木", "金", "土"];
13
- function T(e) {
14
- return `${e.getMonth() + 1}月${e.getDate()}日(${$[e.getDay()]})`;
2
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
3
+ import * as d from "react";
4
+ import j from "iconsax-reactjs/dist/esm/Calendar.js";
5
+ import { X as k } from "lucide-react";
6
+ import { ja as B } from "react-day-picker/locale";
7
+ import { cn as $ } from "../../lib/utils.js";
8
+ import { useFieldLabelling as D, resolveNativeFieldAria as F } from "../../lib/field-labelling.js";
9
+ import { Button as A } from "../foundations/button.js";
10
+ import { Calendar as R } from "../foundations/calendar.js";
11
+ import { Popover as V, PopoverTrigger as _, PopoverContent as J } from "../foundations/popover.js";
12
+ import { Select as T, SelectTrigger as w, SelectValue as E, SelectContent as H, SelectItem as P } from "../foundations/select.js";
13
+ const O = ["日", "月", "火", "水", "木", "金", "土"];
14
+ function z(e) {
15
+ return `${e.getMonth() + 1}月${e.getDate()}日(${O[e.getDay()]})`;
15
16
  }
16
- function V(e, o, s) {
17
- const a = [];
18
- return e && a.push({ before: e }), o && a.push({ after: o }), s && (Array.isArray(s) ? a.push(...s) : a.push(s)), a.length > 0 ? a : void 0;
17
+ function K(e, n, a) {
18
+ const s = [];
19
+ return e && s.push({ before: e }), n && s.push({ after: n }), a && (Array.isArray(a) ? s.push(...a) : s.push(a)), s.length > 0 ? s : void 0;
19
20
  }
20
- function _({
21
+ function W({
21
22
  value: e,
22
- onChange: o,
23
- placeholder: s = "日付を選択",
24
- min: a,
25
- max: l,
26
- disabledDates: p,
27
- disabled: c,
28
- clearable: u = !1,
29
- clearLabel: f = "日付をクリア",
30
- id: g,
31
- className: b
23
+ onChange: n,
24
+ placeholder: a = "日付を選択",
25
+ min: s,
26
+ max: g,
27
+ disabledDates: S,
28
+ disabled: m,
29
+ clearable: N = !1,
30
+ clearLabel: h = "日付をクリア",
31
+ id: l,
32
+ "aria-invalid": b,
33
+ "aria-describedby": u,
34
+ className: M
32
35
  }) {
33
- const [m, h] = y.useState(!1), d = V(a, l, p), t = u && !!e && !c;
36
+ const [y, v] = d.useState(!1), C = K(s, g, S), p = N && !!e && !m, x = d.useRef(null), f = `${d.useId()}-value`, r = D(), i = F(
37
+ { id: l, "aria-describedby": u, "aria-invalid": b },
38
+ r
39
+ ), o = r ? { "aria-labelledby": `${r.labelId} ${f}` } : { "aria-label": e ? z(e) : a };
34
40
  return (
35
41
  // クリアボタンは trigger の「兄弟」として絶対配置する。trigger の内側に置くと
36
42
  // button の入れ子になり a11y 上不正(Chip removable と同じ解決)。
37
- /* @__PURE__ */ n("div", { className: S("relative w-full", b), children: [
38
- /* @__PURE__ */ n(z, { open: m, onOpenChange: h, children: [
39
- /* @__PURE__ */ r(j, { asChild: !0, children: /* @__PURE__ */ n(
40
- N,
43
+ /* @__PURE__ */ c("div", { className: $("relative w-full", M), children: [
44
+ /* @__PURE__ */ c(V, { open: y, onOpenChange: v, children: [
45
+ /* @__PURE__ */ t(_, { asChild: !0, children: /* @__PURE__ */ c(
46
+ A,
41
47
  {
42
- id: g,
48
+ ref: x,
49
+ id: l,
50
+ "aria-invalid": b,
51
+ "aria-describedby": u,
52
+ ...i,
43
53
  type: "button",
44
54
  variant: "ghost",
45
- disabled: c,
46
- "aria-label": e ? T(e) : s,
55
+ disabled: m,
56
+ ...o,
47
57
  "data-empty": !e,
48
- className: S(
58
+ className: $(
49
59
  // h-11(44px)= 入力コントロールの共通高さ(Input / SelectTrigger / Button default と揃える)
50
60
  "h-11 w-full justify-start gap-2 border border-[var(--Border-High-Emphasis)] bg-transparent px-3 typo-body-md text-[var(--Text-High-Emphasis)] hover:border-[var(--Focus-High-Emphasis)] hover:bg-[var(--Surface-Secondary)] data-[empty=true]:text-[var(--Text-Low-Emphasis)]",
61
+ // エラー時の枠は Input / Select と同じ Border-Caution(Button 共通の destructive を上書き)
62
+ "aria-invalid:border-[var(--Border-Caution)]",
51
63
  // クリアボタンの領域を空ける
52
- t && "pr-10"
64
+ p && "pr-10"
53
65
  ),
54
66
  children: [
55
- /* @__PURE__ */ r(v, { size: 16, className: "shrink-0" }),
56
- /* @__PURE__ */ r("span", { className: "truncate", children: e ? T(e) : s })
67
+ /* @__PURE__ */ t(j, { size: 16, className: "shrink-0" }),
68
+ /* @__PURE__ */ t("span", { id: r ? f : void 0, className: "truncate", children: e ? z(e) : a })
57
69
  ]
58
70
  }
59
71
  ) }),
60
- /* @__PURE__ */ r(k, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ r(
61
- P,
72
+ /* @__PURE__ */ t(J, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ t(
73
+ R,
62
74
  {
63
75
  mode: "single",
64
76
  selected: e,
65
- onSelect: (i) => {
66
- o?.(i), h(!1);
77
+ onSelect: (I) => {
78
+ n?.(I), v(!1);
67
79
  },
68
- disabled: d,
69
- locale: A,
80
+ disabled: C,
81
+ locale: B,
70
82
  autoFocus: !0
71
83
  }
72
84
  ) })
73
85
  ] }),
74
- t && /* @__PURE__ */ r(
75
- N,
86
+ p && /* @__PURE__ */ t(
87
+ A,
76
88
  {
77
89
  type: "button",
78
90
  variant: "ghost",
79
91
  size: "icon-sm",
80
- "aria-label": f,
81
- onClick: () => o?.(void 0),
92
+ "aria-label": h,
93
+ onClick: () => {
94
+ n?.(void 0), x.current?.focus();
95
+ },
82
96
  className: "absolute top-1/2 right-1 -translate-y-1/2 text-[var(--Text-Medium-Emphasis)]",
83
- children: /* @__PURE__ */ r(H, { className: "size-4" })
97
+ children: /* @__PURE__ */ t(k, { className: "size-4" })
84
98
  }
85
99
  )
86
100
  ] })
87
101
  );
88
102
  }
89
- function Y({
103
+ function te({
90
104
  value: e,
91
- onChange: o,
92
- minuteStep: s = 5,
93
- hourLabel: a = "時",
94
- minuteLabel: l = "分",
95
- clearLabel: p = "日時をクリア",
96
- disabled: c,
97
- className: u,
98
- ...f
105
+ onChange: n,
106
+ minuteStep: a = 5,
107
+ hourLabel: s = "時",
108
+ minuteLabel: g = "分",
109
+ clearLabel: S = "日時をクリア",
110
+ disabled: m,
111
+ className: N,
112
+ "aria-invalid": h,
113
+ "aria-describedby": l,
114
+ ...b
99
115
  }) {
100
- const g = y.useMemo(
101
- () => Array.from({ length: 24 }, (t, i) => i),
116
+ const u = D(), M = d.useId(), y = (r, i) => {
117
+ if (!u) return { "aria-label": i };
118
+ const o = `${M}-${r}`;
119
+ return {
120
+ id: o,
121
+ "aria-label": i,
122
+ "aria-labelledby": `${u.labelId} ${o}`
123
+ };
124
+ }, v = d.useMemo(
125
+ () => Array.from({ length: 24 }, (r, i) => i),
102
126
  []
103
- ), b = y.useMemo(
127
+ ), C = d.useMemo(
104
128
  () => Array.from(
105
- { length: Math.ceil(60 / s) },
106
- (t, i) => i * s
129
+ { length: Math.ceil(60 / a) },
130
+ (r, i) => i * a
107
131
  ),
108
- [s]
109
- ), m = (t, i) => {
132
+ [a]
133
+ ), p = (r, i) => {
110
134
  if (!e) return;
111
- const x = new Date(e);
112
- t === "hours" ? x.setHours(Number(i)) : x.setMinutes(Number(i)), o?.(x);
113
- }, h = (t) => {
114
- if (!t || !e) {
115
- o?.(t);
135
+ const o = new Date(e);
136
+ r === "hours" ? o.setHours(Number(i)) : o.setMinutes(Number(i)), n?.(o);
137
+ }, x = (r) => {
138
+ if (!r || !e) {
139
+ n?.(r);
116
140
  return;
117
141
  }
118
- const i = new Date(t);
142
+ const i = new Date(r);
119
143
  i.setHours(
120
144
  e.getHours(),
121
145
  e.getMinutes(),
122
146
  e.getSeconds(),
123
147
  e.getMilliseconds()
124
- ), o?.(i);
125
- }, d = c || !e;
126
- return /* @__PURE__ */ n("div", { className: S("flex items-center gap-2", u), children: [
127
- /* @__PURE__ */ r(
128
- _,
148
+ ), n?.(i);
149
+ }, f = m || !e;
150
+ return /* @__PURE__ */ c("div", { className: $("flex items-center gap-2", N), children: [
151
+ /* @__PURE__ */ t(
152
+ W,
129
153
  {
130
- ...f,
154
+ ...b,
131
155
  value: e,
132
- onChange: h,
133
- disabled: c,
134
- clearLabel: p,
156
+ onChange: x,
157
+ disabled: m,
158
+ clearLabel: S,
159
+ "aria-invalid": h,
160
+ "aria-describedby": l,
135
161
  className: "flex-1"
136
162
  }
137
163
  ),
138
- /* @__PURE__ */ n(
139
- M,
164
+ /* @__PURE__ */ c(
165
+ T,
140
166
  {
141
167
  value: e ? String(e.getHours()) : void 0,
142
- onValueChange: (t) => m("hours", t),
143
- disabled: d,
168
+ onValueChange: (r) => p("hours", r),
169
+ disabled: f,
144
170
  children: [
145
- /* @__PURE__ */ r(C, { size: "default", className: "w-[72px]", "aria-label": a, children: /* @__PURE__ */ r(w, { placeholder: a }) }),
146
- /* @__PURE__ */ r(D, { children: g.map((t) => /* @__PURE__ */ r(E, { value: String(t), children: String(t).padStart(2, "0") }, t)) })
171
+ /* @__PURE__ */ t(
172
+ w,
173
+ {
174
+ size: "default",
175
+ className: "w-[72px]",
176
+ ...y("hour", s),
177
+ "aria-invalid": h,
178
+ "aria-describedby": l,
179
+ children: /* @__PURE__ */ t(E, { placeholder: s })
180
+ }
181
+ ),
182
+ /* @__PURE__ */ t(H, { children: v.map((r) => /* @__PURE__ */ t(P, { value: String(r), children: String(r).padStart(2, "0") }, r)) })
147
183
  ]
148
184
  }
149
185
  ),
150
- /* @__PURE__ */ r("span", { className: "typo-body-md text-[var(--Text-Medium-Emphasis)]", children: ":" }),
151
- /* @__PURE__ */ n(
152
- M,
186
+ /* @__PURE__ */ t("span", { className: "typo-body-md text-[var(--Text-Medium-Emphasis)]", children: ":" }),
187
+ /* @__PURE__ */ c(
188
+ T,
153
189
  {
154
190
  value: e ? String(e.getMinutes()) : void 0,
155
- onValueChange: (t) => m("minutes", t),
156
- disabled: d,
191
+ onValueChange: (r) => p("minutes", r),
192
+ disabled: f,
157
193
  children: [
158
- /* @__PURE__ */ r(
159
- C,
194
+ /* @__PURE__ */ t(
195
+ w,
160
196
  {
161
197
  size: "default",
162
198
  className: "w-[72px]",
163
- "aria-label": l,
164
- children: /* @__PURE__ */ r(w, { placeholder: l })
199
+ ...y("minute", g),
200
+ "aria-invalid": h,
201
+ "aria-describedby": l,
202
+ children: /* @__PURE__ */ t(E, { placeholder: g })
165
203
  }
166
204
  ),
167
- /* @__PURE__ */ r(D, { children: b.map((t) => /* @__PURE__ */ r(E, { value: String(t), children: String(t).padStart(2, "0") }, t)) })
205
+ /* @__PURE__ */ t(H, { children: C.map((r) => /* @__PURE__ */ t(P, { value: String(r), children: String(r).padStart(2, "0") }, r)) })
168
206
  ]
169
207
  }
170
208
  )
171
209
  ] });
172
210
  }
173
211
  export {
174
- _ as DatePicker,
175
- Y as DateTimePicker
212
+ W as DatePicker,
213
+ te as DateTimePicker
176
214
  };
@@ -1,13 +1,12 @@
1
1
  "use client";
2
- import { jsxs as s, Fragment as H, jsx as e } from "react/jsx-runtime";
2
+ import { jsxs as s, Fragment as M, jsx as e } from "react/jsx-runtime";
3
3
  import * as v from "react";
4
4
  import { cn as d } from "../../lib/utils.js";
5
- import { resolveLinkComponent as w } from "../../lib/link-component.js";
6
- function B({
7
- title: l,
5
+ function H({
6
+ title: o,
8
7
  children: i
9
8
  }) {
10
- const [r, o] = v.useState(!1), t = v.useRef(null), [n, c] = v.useState(0);
9
+ const [r, l] = v.useState(!1), t = v.useRef(null), [n, c] = v.useState(0);
11
10
  return v.useEffect(() => {
12
11
  t.current && c(t.current.scrollHeight);
13
12
  }, [r]), /* @__PURE__ */ s("div", { "data-slot": "footer-accordion", children: [
@@ -21,10 +20,10 @@ function B({
21
20
  "typo-body-md text-[var(--Text-High-Emphasis)]",
22
21
  "cursor-pointer"
23
22
  ),
24
- onClick: () => o(!r),
23
+ onClick: () => l(!r),
25
24
  "aria-expanded": r,
26
25
  children: [
27
- /* @__PURE__ */ e("span", { children: l }),
26
+ /* @__PURE__ */ e("span", { children: o }),
28
27
  /* @__PURE__ */ s("span", { className: "relative size-3 shrink-0", children: [
29
28
  /* @__PURE__ */ e("span", { className: "absolute top-1/2 left-0 block h-px w-3 -translate-y-1/2 bg-[var(--Text-High-Emphasis)] transition-transform duration-[var(--Motion-Duration-Base)]" }),
30
29
  /* @__PURE__ */ e(
@@ -51,11 +50,11 @@ function B({
51
50
  )
52
51
  ] });
53
52
  }
54
- function g({ groups: l, linkComponent: i }) {
55
- const r = l.length <= 4 ? "@lg:grid-cols-4" : l.length === 5 ? "@lg:grid-cols-5" : "@lg:grid-cols-6";
56
- return /* @__PURE__ */ e("div", { className: d("grid grid-cols-3 gap-6", r), children: l.map((o) => /* @__PURE__ */ s("div", { children: [
57
- /* @__PURE__ */ e("h3", { className: "typo-label-md text-[var(--Text-High-Emphasis)] mb-3", children: o.title }),
58
- /* @__PURE__ */ e("ul", { className: "space-y-1.5", children: o.links.map((t) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
53
+ function g({ groups: o, linkComponent: i }) {
54
+ const r = o.length <= 4 ? "@lg:grid-cols-4" : o.length === 5 ? "@lg:grid-cols-5" : "@lg:grid-cols-6";
55
+ return /* @__PURE__ */ e("div", { className: d("grid grid-cols-3 gap-6", r), children: o.map((l) => /* @__PURE__ */ s("div", { children: [
56
+ /* @__PURE__ */ e("h3", { className: "typo-label-md text-[var(--Text-High-Emphasis)] mb-3", children: l.title }),
57
+ /* @__PURE__ */ e("ul", { className: "space-y-1.5", children: l.links.map((t) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
59
58
  b,
60
59
  {
61
60
  link: t,
@@ -64,7 +63,7 @@ function g({ groups: l, linkComponent: i }) {
64
63
  children: t.label
65
64
  }
66
65
  ) }, t.label)) }),
67
- o.subGroups?.map((t) => /* @__PURE__ */ s("div", { className: "mt-4", children: [
66
+ l.subGroups?.map((t) => /* @__PURE__ */ s("div", { className: "mt-4", children: [
68
67
  /* @__PURE__ */ e("h4", { className: "typo-label-md text-[var(--Text-High-Emphasis)] mb-3", children: t.title }),
69
68
  /* @__PURE__ */ e("ul", { className: "space-y-1.5", children: t.links.map((n) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
70
69
  b,
@@ -76,27 +75,27 @@ function g({ groups: l, linkComponent: i }) {
76
75
  }
77
76
  ) }, n.label)) })
78
77
  ] }, t.title))
79
- ] }, o.title)) });
78
+ ] }, l.title)) });
80
79
  }
81
80
  function b({
82
- link: l,
81
+ link: o,
83
82
  linkComponent: i,
84
83
  className: r,
85
- children: o
84
+ children: l
86
85
  }) {
87
- const t = w(i, l.external);
86
+ const t = o.external ? "a" : i ?? "a";
88
87
  return /* @__PURE__ */ e(
89
88
  t,
90
89
  {
91
- href: l.href,
90
+ href: o.href,
92
91
  className: r,
93
- ...l.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
94
- children: o
92
+ ...o.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
93
+ children: l
95
94
  }
96
95
  );
97
96
  }
98
- function E({ links: l, linkComponent: i }) {
99
- return /* @__PURE__ */ e("ul", { children: l.map((r) => /* @__PURE__ */ e("li", { className: "border-b border-[var(--Border-Low-Emphasis)] last:border-b-0", children: /* @__PURE__ */ s(
97
+ function E({ links: o, linkComponent: i }) {
98
+ return /* @__PURE__ */ e("ul", { children: o.map((r) => /* @__PURE__ */ e("li", { className: "border-b border-[var(--Border-Low-Emphasis)] last:border-b-0", children: /* @__PURE__ */ s(
100
99
  b,
101
100
  {
102
101
  link: r,
@@ -123,24 +122,24 @@ function E({ links: l, linkComponent: i }) {
123
122
  }
124
123
  ) }, r.label)) });
125
124
  }
126
- function D({
127
- className: l,
125
+ function j({
126
+ className: o,
128
127
  linkGroups: i = [],
129
128
  copyright: r = "© Cake.jp Co., Ltd.",
130
- logo: o,
129
+ logo: l,
131
130
  logoHref: t = "/",
132
131
  socialLinks: n = [],
133
132
  description: c,
134
133
  paymentMethods: u = [],
135
134
  trustBadge: m,
136
135
  bottomLinks: y = [],
137
- variant: T = "default",
138
- bottomRightSlot: L,
136
+ variant: w = "default",
137
+ bottomRightSlot: T,
139
138
  linkComponent: h,
140
- ...M
139
+ ...L
141
140
  }) {
142
- const x = T === "brand-first", N = w(h), p = (o || c) && /* @__PURE__ */ s("div", { "data-slot": "footer-brand", className: "grid content-start gap-4", children: [
143
- o && /* @__PURE__ */ e(N, { href: t, className: "block w-fit text-[var(--Text-High-Emphasis)]", children: o }),
141
+ const x = w === "brand-first", N = h ?? "a", p = (l || c) && /* @__PURE__ */ s("div", { "data-slot": "footer-brand", className: "grid content-start gap-4", children: [
142
+ l && /* @__PURE__ */ e(N, { href: t, className: "block w-fit text-[var(--Text-High-Emphasis)]", children: l }),
144
143
  c && /* @__PURE__ */ e("p", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: c })
145
144
  ] });
146
145
  return /* @__PURE__ */ s(
@@ -150,13 +149,13 @@ function D({
150
149
  style: { containerType: "inline-size" },
151
150
  className: d(
152
151
  "bg-[var(--Surface-Primary)] text-[var(--Text-Medium-Emphasis)]",
153
- l
152
+ o
154
153
  ),
155
- ...M,
154
+ ...L,
156
155
  children: [
157
- i.length > 0 && /* @__PURE__ */ s(H, { children: [
156
+ i.length > 0 && /* @__PURE__ */ s(M, { children: [
158
157
  x && p && /* @__PURE__ */ e("div", { className: "border-t border-[var(--Border-Medium-Emphasis)] px-5 py-8 @lg:hidden", children: p }),
159
- /* @__PURE__ */ e("nav", { "aria-label": "フッターナビゲーション", "data-slot": "footer-links", className: d("border-t border-[var(--Border-Medium-Emphasis)] @lg:hidden", x && "border-t-0"), children: i.map((a) => /* @__PURE__ */ s(B, { title: a.title, children: [
158
+ /* @__PURE__ */ e("nav", { "aria-label": "フッターナビゲーション", "data-slot": "footer-links", className: d("border-t border-[var(--Border-Medium-Emphasis)] @lg:hidden", x && "border-t-0"), children: i.map((a) => /* @__PURE__ */ s(H, { title: a.title, children: [
160
159
  /* @__PURE__ */ e(E, { links: a.links, linkComponent: h }),
161
160
  a.subGroups?.map((f) => /* @__PURE__ */ s("div", { children: [
162
161
  /* @__PURE__ */ e("div", { className: "border-t border-[var(--Border-Low-Emphasis)] px-5 py-5 typo-body-md text-[var(--Text-High-Emphasis)]", children: f.title }),
@@ -291,7 +290,7 @@ function D({
291
290
  className: "border-t border-[var(--Border-Medium-Emphasis)] px-5 py-5",
292
291
  children: /* @__PURE__ */ s("div", { className: "mx-auto flex max-w-[1065px] flex-col gap-3 typo-body-sm text-[var(--Text-Low-Emphasis)] @lg:flex-row @lg:items-center @lg:justify-between", children: [
293
292
  /* @__PURE__ */ e("p", { children: r }),
294
- L
293
+ T
295
294
  ] })
296
295
  }
297
296
  )
@@ -301,7 +300,7 @@ function D({
301
300
  "data-slot": "footer-bottom",
302
301
  className: "border-t border-[var(--Border-Medium-Emphasis)] px-5 pt-8 pb-9 text-center",
303
302
  children: [
304
- o && /* @__PURE__ */ e("div", { className: "mx-auto w-fit max-w-[160px]", children: /* @__PURE__ */ e(N, { href: t, className: "block text-[var(--Text-High-Emphasis)]", children: o }) }),
303
+ l && /* @__PURE__ */ e("div", { className: "mx-auto w-fit max-w-[160px]", children: /* @__PURE__ */ e(N, { href: t, className: "block text-[var(--Text-High-Emphasis)]", children: l }) }),
305
304
  c && /* @__PURE__ */ e("p", { className: "mt-6 typo-body-sm text-[var(--Text-Low-Emphasis)]", children: c }),
306
305
  /* @__PURE__ */ e("p", { className: "mt-5 typo-body-sm text-[var(--Text-Low-Emphasis)]", children: r })
307
306
  ]
@@ -312,5 +311,5 @@ function D({
312
311
  );
313
312
  }
314
313
  export {
315
- D as Footer
314
+ j as Footer
316
315
  };