@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,105 +1,111 @@
1
- import { jsxs as g, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import E from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
4
4
  import z from "iconsax-reactjs/dist/esm/ArrowRight2.js";
5
- import { cn as m } from "../../lib/utils.js";
5
+ import { cn as v } from "../../lib/utils.js";
6
6
  import { Button as u } from "../foundations/button.js";
7
7
  const A = ["日", "月", "火", "水", "木", "金", "土"];
8
- function H({
8
+ function W({
9
9
  year: a,
10
10
  month: r,
11
- days: h,
12
- onMonthChange: v,
13
- onDaySelect: x,
11
+ days: x,
12
+ onMonthChange: h,
13
+ onDaySelect: f,
14
14
  selectedDate: c,
15
- className: f,
16
- ...y
15
+ className: y,
16
+ ...b
17
17
  }) {
18
- const b = new Date(a, r - 1, 1), D = new Date(a, r, 0), N = b.getDay(), w = D.getDate(), p = [];
19
- let l = Array(N).fill(null);
20
- for (let e = 1; e <= w; e++) {
21
- const n = new Date(a, r - 1, e), i = h.find(
22
- (s) => s.date.getFullYear() === a && s.date.getMonth() === r - 1 && s.date.getDate() === e
18
+ const D = new Date(a, r - 1, 1), N = new Date(a, r, 0), w = D.getDay(), T = N.getDate(), m = [];
19
+ let l = Array(w).fill(null);
20
+ for (let e = 1; e <= T; e++) {
21
+ const s = new Date(a, r - 1, e), i = x.find(
22
+ (n) => n.date.getFullYear() === a && n.date.getMonth() === r - 1 && n.date.getDate() === e
23
23
  );
24
24
  l.push(
25
- i ?? { date: n, availability: "available" }
26
- ), l.length === 7 && (p.push(l), l = []);
25
+ i ?? { date: s, availability: "available" }
26
+ ), l.length === 7 && (m.push(l), l = []);
27
27
  }
28
28
  if (l.length > 0) {
29
29
  for (; l.length < 7; ) l.push(null);
30
- p.push(l);
30
+ m.push(l);
31
31
  }
32
32
  const k = () => {
33
33
  const e = r === 1 ? { y: a - 1, m: 12 } : { y: a, m: r - 1 };
34
- v?.(e.y, e.m);
35
- }, T = () => {
34
+ h?.(e.y, e.m);
35
+ }, C = () => {
36
36
  const e = r === 12 ? { y: a + 1, m: 1 } : { y: a, m: r + 1 };
37
- v?.(e.y, e.m);
38
- }, C = (e) => c && e.getFullYear() === c.getFullYear() && e.getMonth() === c.getMonth() && e.getDate() === c.getDate();
39
- return /* @__PURE__ */ g(
37
+ h?.(e.y, e.m);
38
+ }, S = (e) => c && e.getFullYear() === c.getFullYear() && e.getMonth() === c.getMonth() && e.getDate() === c.getDate();
39
+ return /* @__PURE__ */ p(
40
40
  "div",
41
41
  {
42
42
  "data-slot": "delivery-calendar",
43
- className: m("space-y-2", f),
44
- ...y,
43
+ className: v("space-y-2", y),
44
+ ...b,
45
45
  children: [
46
- /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
46
+ /* @__PURE__ */ p("div", { className: "flex items-center justify-between", children: [
47
47
  /* @__PURE__ */ t(u, { variant: "ghost", size: "icon-sm", onClick: k, "aria-label": "前月", children: /* @__PURE__ */ t(E, { size: 16 }) }),
48
- /* @__PURE__ */ g("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: [
48
+ /* @__PURE__ */ p("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: [
49
49
  r,
50
50
  "月"
51
51
  ] }),
52
- /* @__PURE__ */ t(u, { variant: "ghost", size: "icon-sm", onClick: T, "aria-label": "次月", children: /* @__PURE__ */ t(z, { size: 16 }) })
52
+ /* @__PURE__ */ t(u, { variant: "ghost", size: "icon-sm", onClick: C, "aria-label": "次月", children: /* @__PURE__ */ t(z, { size: 16 }) })
53
53
  ] }),
54
- /* @__PURE__ */ t("div", { className: "grid grid-cols-7 text-center", children: A.map((e, n) => /* @__PURE__ */ t(
54
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-7 text-center", children: A.map((e, s) => /* @__PURE__ */ t(
55
55
  "span",
56
56
  {
57
- className: m(
57
+ className: v(
58
58
  "py-1 typo-label-sm",
59
- n === 0 && "text-[var(--Text-Caution)]",
60
- n === 6 && "text-[var(--Primitive-Sea-600)]",
61
- n > 0 && n < 6 && "text-[var(--Text-Medium-Emphasis)]"
59
+ s === 0 && "text-[var(--Text-Caution)]",
60
+ s === 6 && "text-[var(--Primitive-Sea-600)]",
61
+ s > 0 && s < 6 && "text-[var(--Text-Medium-Emphasis)]"
62
62
  ),
63
63
  children: e
64
64
  },
65
65
  e
66
66
  )) }),
67
- p.map((e, n) => /* @__PURE__ */ t("div", { className: "grid grid-cols-7 text-center", children: e.map((i, s) => {
67
+ m.map((e, s) => /* @__PURE__ */ t("div", { className: "grid grid-cols-7 text-center", children: e.map((i, n) => {
68
68
  if (!i)
69
- return /* @__PURE__ */ t("div", { className: "py-1" }, `empty-${s}`);
70
- const o = i.date.getDay(), S = C(i.date), d = i.availability !== "unavailable";
71
- return /* @__PURE__ */ g(
69
+ return /* @__PURE__ */ t("div", { className: "py-1" }, `empty-${n}`);
70
+ const o = i.date.getDay(), d = S(i.date), g = i.availability !== "unavailable";
71
+ return /* @__PURE__ */ p(
72
72
  "button",
73
73
  {
74
74
  type: "button",
75
- disabled: !d,
76
- onClick: () => d && x?.(i.date),
77
- className: m(
75
+ disabled: !g,
76
+ "aria-pressed": d,
77
+ "data-selected": d || void 0,
78
+ onClick: () => g && f?.(i.date),
79
+ className: v(
78
80
  "flex flex-col items-center gap-0.5 rounded-md py-1.5 typo-body-md transition-colors",
79
- d && "cursor-pointer hover:bg-[var(--Surface-Secondary)]",
80
- S && "relative z-10 bg-[var(--Brand-Cake-Orange)]/10 ring-1 ring-inset ring-[var(--Brand-Cake-Orange)]",
81
- !d && "cursor-default opacity-60",
81
+ g && "cursor-pointer hover:bg-[var(--Surface-Secondary)]",
82
+ d && "relative z-10 bg-[var(--Brand-Cake-Orange)]/10 ring-1 ring-inset ring-[var(--Brand-Cake-Orange)]",
83
+ // forced-colors(Windows ハイコントラスト)では薄い地が Canvas に、枠(ring = box-shadow)が
84
+ // 消えて選んだ日が見えなかった。選んだ日だけ OS の選択色で示し、日付と ○△× も
85
+ // HighlightText にそろえる(子の span は自前の文字色を持つため * で指定)。通常表示は不変
86
+ d && "forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:*:text-[HighlightText]",
87
+ !g && "cursor-default opacity-60",
82
88
  o === 0 && "text-[var(--Text-Caution)]",
83
89
  o === 6 && "text-[var(--Primitive-Sea-600)]",
84
90
  o > 0 && o < 6 && "text-[var(--Text-High-Emphasis)]"
85
91
  ),
86
92
  children: [
87
93
  /* @__PURE__ */ t("span", { children: i.date.getDate() }),
88
- /* @__PURE__ */ t(Y, { availability: i.availability })
94
+ /* @__PURE__ */ t(H, { availability: i.availability })
89
95
  ]
90
96
  },
91
97
  i.date.getDate()
92
98
  );
93
- }) }, n))
99
+ }) }, s))
94
100
  ]
95
101
  }
96
102
  );
97
103
  }
98
- function Y({
104
+ function H({
99
105
  availability: a
100
106
  }) {
101
107
  return a === "available" ? /* @__PURE__ */ t("span", { className: "typo-heading-lg text-[var(--Text-Success)]", children: "○" }) : a === "few" ? /* @__PURE__ */ t("span", { className: "typo-heading-lg text-[var(--Text-Warning)]", children: "△" }) : /* @__PURE__ */ t("span", { className: "typo-heading-lg text-[var(--Text-Low-Emphasis)]", children: "×" });
102
108
  }
103
109
  export {
104
- H as DeliveryCalendar
110
+ W as DeliveryCalendar
105
111
  };
@@ -1,98 +1,109 @@
1
- import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
- import L from "react";
3
- import z from "iconsax-reactjs/dist/esm/Home2.js";
4
- import c from "iconsax-reactjs/dist/esm/SearchNormal1.js";
5
- import _ from "iconsax-reactjs/dist/esm/Shop.js";
6
- import w from "iconsax-reactjs/dist/esm/Calendar.js";
7
- import H from "iconsax-reactjs/dist/esm/Bookmark.js";
8
- import P from "iconsax-reactjs/dist/esm/User.js";
9
- import E from "iconsax-reactjs/dist/esm/ShoppingCart.js";
10
- import { BreadcrumbList as C, BreadcrumbSeparator as T, BreadcrumbItem as j, BreadcrumbPage as A, BreadcrumbLink as M, Breadcrumb as s } from "../foundations/breadcrumb.js";
11
- import { SkipLink as F } from "../foundations/skip-link.js";
12
- import { Header as n } from "../primitives/header.js";
13
- import { SideNav as G } from "../primitives/side-nav.js";
14
- import { CakeLogo as I } from "./cake-logo.js";
15
- import { mypageMenuGroups as R } from "./_mypage-menu-data.js";
16
- import { BottomTabBar as U } from "../primitives/bottom-tab-bar.js";
17
- const $ = [
18
- { icon: /* @__PURE__ */ e(c, { size: 20 }), label: "検索" },
19
- { icon: /* @__PURE__ */ e(P, { size: 20 }), label: "マイページ" },
20
- { icon: /* @__PURE__ */ e(E, { size: 20 }), label: "カート" }
21
- ], q = [
22
- { label: "ホーム", icon: /* @__PURE__ */ e(z, { size: 20 }), href: "/" },
23
- { label: "探す", icon: /* @__PURE__ */ e(c, { size: 20 }), href: "/search/" },
24
- { label: "店舗受取予約", icon: /* @__PURE__ */ e(_, { size: 20 }), href: "/takeout/" },
1
+ import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
+ import z from "react";
3
+ import _ from "iconsax-reactjs/dist/esm/Home2.js";
4
+ import n from "iconsax-reactjs/dist/esm/SearchNormal1.js";
5
+ import w from "iconsax-reactjs/dist/esm/Shop.js";
6
+ import H from "iconsax-reactjs/dist/esm/Calendar.js";
7
+ import P from "iconsax-reactjs/dist/esm/Bookmark.js";
8
+ import E from "iconsax-reactjs/dist/esm/User.js";
9
+ import T from "iconsax-reactjs/dist/esm/ShoppingCart.js";
10
+ import { BreadcrumbList as j, BreadcrumbSeparator as A, BreadcrumbItem as M, BreadcrumbPage as F, BreadcrumbLink as G, Breadcrumb as c } from "../foundations/breadcrumb.js";
11
+ import { SkipLink as I } from "../foundations/skip-link.js";
12
+ import { Header as t } from "../primitives/header.js";
13
+ import { SideNav as R } from "../primitives/side-nav.js";
14
+ import { CakeLogo as U } from "./cake-logo.js";
15
+ import { mypageMenuGroups as $ } from "./_mypage-menu-data.js";
16
+ import { BottomTabBar as q } from "../primitives/bottom-tab-bar.js";
17
+ const C = [
18
+ { icon: /* @__PURE__ */ r(n, { size: 20 }), label: "検索" },
19
+ { icon: /* @__PURE__ */ r(E, { size: 20 }), label: "マイページ" },
20
+ { icon: /* @__PURE__ */ r(T, { size: 20 }), label: "カート" }
21
+ ], D = [
22
+ { label: "ホーム", icon: /* @__PURE__ */ r(_, { size: 20 }), href: "/" },
23
+ { label: "探す", icon: /* @__PURE__ */ r(n, { size: 20 }), href: "/search/" },
24
+ { label: "店舗受取予約", icon: /* @__PURE__ */ r(w, { size: 20 }), href: "/takeout/" },
25
25
  {
26
26
  label: "記念日",
27
- icon: /* @__PURE__ */ e(w, { size: 20 }),
27
+ icon: /* @__PURE__ */ r(H, { size: 20 }),
28
28
  href: "/mypage/anniversary/"
29
29
  },
30
30
  {
31
31
  label: "ブックマーク",
32
- icon: /* @__PURE__ */ e(H, { size: 20 }),
32
+ icon: /* @__PURE__ */ r(P, { size: 20 }),
33
33
  href: "/mypage/bookmark/item_list/"
34
34
  }
35
35
  ];
36
- function D(r) {
36
+ function J(e) {
37
37
  return [
38
38
  { label: "ホーム", href: "/" },
39
39
  { label: "山田 太郎 さまのマイページ", href: "/mypage/" },
40
- { label: r }
40
+ { label: e }
41
41
  ];
42
42
  }
43
- function le({
44
- title: r,
45
- activeMenu: t,
46
- currentPath: h,
47
- activeMatch: p,
48
- isActiveMenuItem: b,
49
- children: f,
50
- breadcrumbs: u,
51
- bottomNavItems: g = q,
52
- menuGroups: v = R,
53
- headerActions: x = $,
54
- logo: N = /* @__PURE__ */ e(I, {}),
55
- navItems: y,
56
- onBack: k,
57
- mainId: d = "main-content",
58
- skipLink: B
43
+ function lr({
44
+ title: e,
45
+ activeMenu: h,
46
+ currentPath: p,
47
+ activeMatch: b,
48
+ isActiveMenuItem: f,
49
+ children: u,
50
+ breadcrumbs: g,
51
+ bottomNavItems: v = D,
52
+ menuGroups: x = $,
53
+ headerActions: N = C,
54
+ logo: y = /* @__PURE__ */ r(U, {}),
55
+ navItems: B,
56
+ onBack: S,
57
+ mainId: o = "main-content",
58
+ skipLink: k,
59
+ linkComponent: i
59
60
  }) {
60
- const o = u ?? D(r), l = /* @__PURE__ */ e(C, { children: o.map((i, m) => {
61
- const S = m === o.length - 1;
62
- return /* @__PURE__ */ a(L.Fragment, { children: [
63
- m > 0 && /* @__PURE__ */ e(T, {}),
64
- /* @__PURE__ */ e(j, { children: S ? /* @__PURE__ */ e(A, { children: i.label }) : /* @__PURE__ */ e(M, { href: i.href ?? "#", children: i.label }) })
65
- ] }, m);
61
+ const s = g ?? J(e), l = /* @__PURE__ */ r(j, { children: s.map((m, d) => {
62
+ const L = d === s.length - 1;
63
+ return /* @__PURE__ */ a(z.Fragment, { children: [
64
+ d > 0 && /* @__PURE__ */ r(A, {}),
65
+ /* @__PURE__ */ r(M, { children: L ? /* @__PURE__ */ r(F, { children: m.label }) : /* @__PURE__ */ r(G, { href: m.href ?? "#", linkComponent: i, children: m.label }) })
66
+ ] }, d);
66
67
  }) });
67
68
  return /* @__PURE__ */ a("div", { className: "@container min-h-screen bg-[var(--Surface-Secondary)]", children: [
68
- B !== !1 && /* @__PURE__ */ e(F, { href: `#${d}` }),
69
+ k !== !1 && /* @__PURE__ */ r(I, { href: `#${o}` }),
69
70
  /* @__PURE__ */ a("div", { className: "@md:hidden bg-[var(--Surface-Primary)]", children: [
70
- /* @__PURE__ */ e(n, { variant: "back", onBack: k }),
71
- /* @__PURE__ */ e("div", { className: "px-4 pt-3", children: /* @__PURE__ */ e(s, { children: l }) }),
72
- /* @__PURE__ */ e("h1", { className: "typo-heading-xl text-[var(--Text-High-Emphasis)] px-4 pt-1 pb-3", children: r })
71
+ /* @__PURE__ */ r(t, { variant: "back", onBack: S }),
72
+ /* @__PURE__ */ r("div", { className: "px-4 pt-3", children: /* @__PURE__ */ r(c, { children: l }) }),
73
+ /* @__PURE__ */ r("h1", { className: "typo-heading-xl text-[var(--Text-High-Emphasis)] px-4 pt-1 pb-3", children: e })
73
74
  ] }),
74
- /* @__PURE__ */ e("div", { className: "hidden @md:block", children: /* @__PURE__ */ e(n, { logo: N, variant: "logo", actions: x, navItems: y }) }),
75
- /* @__PURE__ */ e("div", { className: "hidden @md:block bg-[var(--Surface-Primary)] border-b border-[var(--Border-Low-Emphasis)]", children: /* @__PURE__ */ e("div", { className: "max-w-[1280px] mx-auto px-6 py-3", children: /* @__PURE__ */ e(s, { children: l }) }) }),
75
+ /* @__PURE__ */ r("div", { className: "hidden @md:block", children: /* @__PURE__ */ r(
76
+ t,
77
+ {
78
+ logo: y,
79
+ variant: "logo",
80
+ actions: N,
81
+ navItems: B,
82
+ linkComponent: i
83
+ }
84
+ ) }),
85
+ /* @__PURE__ */ r("div", { className: "hidden @md:block bg-[var(--Surface-Primary)] border-b border-[var(--Border-Low-Emphasis)]", children: /* @__PURE__ */ r("div", { className: "max-w-[1280px] mx-auto px-6 py-3", children: /* @__PURE__ */ r(c, { children: l }) }) }),
76
86
  /* @__PURE__ */ a("div", { className: "@md:max-w-[1280px] @md:mx-auto @md:px-6 @md:mt-10 @md:mb-10 @md:grid @md:[grid-template:'side_main'_1fr_/_256px_1fr] @md:gap-6 @md:items-start", children: [
77
- /* @__PURE__ */ e("div", { className: "hidden @md:block @md:[grid-area:side] rounded-2xl overflow-hidden shadow-sm", children: /* @__PURE__ */ e(
78
- G,
87
+ /* @__PURE__ */ r("div", { className: "hidden @md:block @md:[grid-area:side] rounded-2xl overflow-hidden shadow-sm", children: /* @__PURE__ */ r(
88
+ R,
79
89
  {
80
- groups: v,
81
- activeMenu: t,
82
- currentPath: h,
83
- activeMatch: p,
84
- isActive: b,
85
- ariaLabel: "マイページメニュー"
90
+ groups: x,
91
+ activeMenu: h,
92
+ currentPath: p,
93
+ activeMatch: b,
94
+ isActive: f,
95
+ ariaLabel: "マイページメニュー",
96
+ linkComponent: i
86
97
  }
87
98
  ) }),
88
- /* @__PURE__ */ a("main", { id: d, className: "@container @md:[grid-area:main] bg-[var(--Surface-Primary)] @md:rounded-2xl @md:shadow-sm pb-20 @md:pb-8", children: [
89
- /* @__PURE__ */ e("div", { className: "hidden @md:flex items-center gap-3 px-6 py-5 border-b border-[var(--Border-Low-Emphasis)]", children: /* @__PURE__ */ e("h1", { className: "typo-heading-lg text-[var(--Text-High-Emphasis)]", children: r }) }),
90
- f
99
+ /* @__PURE__ */ a("main", { id: o, className: "@container @md:[grid-area:main] bg-[var(--Surface-Primary)] @md:rounded-2xl @md:shadow-sm pb-20 @md:pb-8", children: [
100
+ /* @__PURE__ */ r("div", { className: "hidden @md:flex items-center gap-3 px-6 py-5 border-b border-[var(--Border-Low-Emphasis)]", children: /* @__PURE__ */ r("h1", { className: "typo-heading-lg text-[var(--Text-High-Emphasis)]", children: e }) }),
101
+ u
91
102
  ] })
92
103
  ] }),
93
- /* @__PURE__ */ e(U, { items: g, className: "@md:hidden" })
104
+ /* @__PURE__ */ r(q, { items: v, className: "@md:hidden", linkComponent: i })
94
105
  ] });
95
106
  }
96
107
  export {
97
- le as MypageShell
108
+ lr as MypageShell
98
109
  };
@@ -1,16 +1,19 @@
1
1
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
2
  import "react";
3
- import { cn as m } from "../../lib/utils.js";
4
- import { PriceDisplay as k } from "../primitives/price-display.js";
5
- import { RatingStars as B } from "./rating-stars.js";
6
- import { Tag as v } from "../primitives/tag.js";
3
+ import { cn as c } from "../../lib/utils.js";
4
+ import { buttonVariants as I } from "../foundations/button.js";
5
+ import { PriceDisplay as B } from "../primitives/price-display.js";
6
+ import { RatingStars as M } from "./rating-stars.js";
7
+ import { Tag as b } from "../primitives/tag.js";
7
8
  function j({
8
9
  href: a,
9
10
  onClick: r,
10
- name: t
11
+ name: t,
12
+ linkComponent: i
11
13
  }) {
14
+ const o = i ?? "a";
12
15
  return a ? /* @__PURE__ */ e(
13
- "a",
16
+ o,
14
17
  {
15
18
  href: a,
16
19
  className: "absolute inset-0 z-[var(--Z-Local-1)]",
@@ -29,7 +32,7 @@ function j({
29
32
  }
30
33
  ) : null;
31
34
  }
32
- function $({ size: a = 20, filled: r = !1 }) {
35
+ function V({ size: a = 20, filled: r = !1 }) {
33
36
  return /* @__PURE__ */ e(
34
37
  "svg",
35
38
  {
@@ -52,7 +55,7 @@ function $({ size: a = 20, filled: r = !1 }) {
52
55
  }
53
56
  );
54
57
  }
55
- function M({
58
+ function Z({
56
59
  isFavorite: a,
57
60
  onToggle: r,
58
61
  size: t = "md"
@@ -61,16 +64,16 @@ function M({
61
64
  "button",
62
65
  {
63
66
  type: "button",
64
- className: m(
65
- "relative z-10 flex items-center justify-center rounded-full border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)]/80 backdrop-blur-sm transition-colors hover:border-[var(--Border-High-Emphasis)] hover:bg-[var(--Surface-Tertiary)]",
67
+ className: c(
68
+ "relative z-10 flex items-center justify-center rounded-full border border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Primary)]/80 backdrop-blur-sm transition-colors hover:border-[var(--Border-High-Emphasis)] hover:bg-[var(--Surface-Tertiary)]",
66
69
  t === "sm" ? "size-[30px]" : "size-9"
67
70
  ),
68
- onClick: (o) => {
69
- o.preventDefault(), o.stopPropagation(), r();
71
+ onClick: (i) => {
72
+ i.preventDefault(), i.stopPropagation(), r();
70
73
  },
71
74
  "aria-label": a ? "お気に入りから削除" : "お気に入りに追加",
72
75
  children: /* @__PURE__ */ e(
73
- $,
76
+ V,
74
77
  {
75
78
  size: t === "sm" ? 16 : 20,
76
79
  filled: a
@@ -79,7 +82,7 @@ function M({
79
82
  }
80
83
  );
81
84
  }
82
- function Z({ rank: a }) {
85
+ function S({ rank: a }) {
83
86
  return /* @__PURE__ */ e(
84
87
  "img",
85
88
  {
@@ -90,89 +93,95 @@ function Z({ rank: a }) {
90
93
  }
91
94
  );
92
95
  }
93
- function D(a, r) {
96
+ function q(a, r) {
94
97
  return r == null || r <= a ? null : `${Math.round((r - a) / r * 100)}%OFF`;
95
98
  }
96
- function C({ name: a, href: r }) {
99
+ function H({
100
+ name: a,
101
+ href: r,
102
+ linkComponent: t
103
+ }) {
104
+ const i = t ?? "a";
97
105
  return r ? /* @__PURE__ */ e(
98
- "a",
106
+ i,
99
107
  {
100
108
  href: r,
101
109
  className: "relative z-10 truncate typo-body-sm text-[var(--Text-Low-Emphasis)] hover:text-[var(--Text-Medium-Emphasis)] hover:underline",
102
- onClick: (t) => t.stopPropagation(),
110
+ onClick: (o) => o.stopPropagation(),
103
111
  children: a
104
112
  }
105
113
  ) : /* @__PURE__ */ e("p", { className: "truncate typo-body-sm text-[var(--Text-Low-Emphasis)]", children: a });
106
114
  }
107
- function H(a) {
115
+ function O(a) {
108
116
  if (a !== "none")
109
117
  return a === "fade" ? "transition-[filter] group-hover:brightness-110" : "transition-transform group-hover:scale-105";
110
118
  }
111
- function J({
119
+ function Y({
112
120
  className: a,
113
121
  name: r,
114
122
  imageUrl: t,
115
- imageAlt: o,
116
- price: f,
117
- originalPrice: b,
118
- caption: u,
119
- rating: i,
123
+ imageAlt: i,
124
+ price: o,
125
+ originalPrice: x,
126
+ caption: h,
127
+ rating: d,
120
128
  reviewCount: y,
121
- shopName: h,
122
- shopHref: N,
129
+ shopName: p,
130
+ shopHref: z,
123
131
  hoverEffect: P,
124
- tags: x = [],
125
- isFavorite: g = !1,
126
- onFavoriteToggle: p,
127
- onCardClick: z,
128
- href: w,
132
+ tags: N = [],
133
+ isFavorite: w = !1,
134
+ onFavoriteToggle: v,
135
+ onCardClick: g,
136
+ href: L,
129
137
  ranking: n,
130
- deliveryDate: c,
131
- orientation: E = "vertical",
132
- showDiscountBadge: S = !0,
133
- showCartButton: O = !1,
134
- onCartAdd: I,
135
- cartButtonLabel: R = "カートに追加",
136
- ...L
138
+ deliveryDate: m,
139
+ orientation: T = "vertical",
140
+ showDiscountBadge: C = !0,
141
+ showCartButton: R = !1,
142
+ onCartAdd: $,
143
+ cartButtonLabel: D = "カートに追加",
144
+ linkComponent: f,
145
+ ...E
137
146
  }) {
138
- const T = P ?? (E === "horizontal" ? "none" : "zoom"), d = S ? D(f, b) : null;
139
- return E === "horizontal" ? /* @__PURE__ */ l(
147
+ const k = P ?? (T === "horizontal" ? "none" : "zoom"), u = C ? q(o, x) : null;
148
+ return T === "horizontal" ? /* @__PURE__ */ l(
140
149
  "div",
141
150
  {
142
151
  "data-slot": "product-card",
143
152
  "data-orientation": "horizontal",
144
- className: m(
153
+ className: c(
145
154
  // min-w-0: 列トラック(1fr = minmax(auto,1fr))が nowrap の内容や
146
155
  // 固定 min-width に押し広げられ、カードが列からはみ出すのを防ぐ(#210)
147
156
  "group relative flex min-w-0 rounded-lg bg-[var(--Surface-Primary)]",
148
157
  n != null && "pt-3",
149
158
  a
150
159
  ),
151
- ...L,
160
+ ...E,
152
161
  children: [
153
- /* @__PURE__ */ e(j, { href: w, onClick: z, name: r }),
154
- n != null && /* @__PURE__ */ e(Z, { rank: n }),
162
+ /* @__PURE__ */ e(j, { href: L, onClick: g, name: r, linkComponent: f }),
163
+ n != null && /* @__PURE__ */ e(S, { rank: n }),
155
164
  /* @__PURE__ */ l("div", { className: "relative h-auto w-28 shrink-0 overflow-hidden rounded-lg @sm:w-36", children: [
156
- /* @__PURE__ */ e("img", { src: t, alt: o ?? r, className: m("h-full w-full object-cover duration-[var(--Motion-Duration-Base)]", H(T)), loading: "lazy" }),
157
- d && /* @__PURE__ */ e(v, { variant: "sale", size: "sm", className: "absolute bottom-1.5 left-1.5 z-[var(--Z-Local-2)]", children: d }),
158
- x.length > 0 && /* @__PURE__ */ e("div", { className: "absolute bottom-1.5 left-1.5 z-[var(--Z-Local-2)] flex flex-wrap gap-1", children: !d && x.map((s) => /* @__PURE__ */ e(v, { variant: s.variant, size: "sm", children: s.label }, s.label)) }),
159
- p && /* @__PURE__ */ e("div", { className: "absolute bottom-1 right-1 z-10", children: /* @__PURE__ */ e(M, { isFavorite: g, onToggle: p, size: "sm" }) })
165
+ /* @__PURE__ */ e("img", { src: t, alt: i ?? r, className: c("h-full w-full object-cover duration-[var(--Motion-Duration-Base)]", O(k)), loading: "lazy" }),
166
+ u && /* @__PURE__ */ e(b, { variant: "sale", size: "sm", className: "absolute bottom-1.5 left-1.5 z-[var(--Z-Local-2)]", children: u }),
167
+ N.length > 0 && /* @__PURE__ */ e("div", { className: "absolute bottom-1.5 left-1.5 z-[var(--Z-Local-2)] flex flex-wrap gap-1", children: !u && N.map((s) => /* @__PURE__ */ e(b, { variant: s.variant, size: "sm", children: s.label }, s.label)) }),
168
+ v && /* @__PURE__ */ e("div", { className: "absolute bottom-1 right-1 z-10", children: /* @__PURE__ */ e(Z, { isFavorite: w, onToggle: v, size: "sm" }) })
160
169
  ] }),
161
170
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col justify-between py-1 pl-3 pr-1", children: [
162
171
  /* @__PURE__ */ l("div", { className: "space-y-0.5", children: [
163
- h && /* @__PURE__ */ e(C, { name: h, href: N }),
172
+ p && /* @__PURE__ */ e(H, { name: p, href: z, linkComponent: f }),
164
173
  /* @__PURE__ */ e("h3", { className: "line-clamp-2 typo-body-md text-[var(--Text-High-Emphasis)]", children: r })
165
174
  ] }),
166
175
  /* @__PURE__ */ l("div", { className: "mt-1 min-w-0 space-y-0.5", children: [
167
176
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
168
- i != null && /* @__PURE__ */ e(B, { rating: i, reviewCount: y, size: "sm" }),
169
- c && /* @__PURE__ */ l("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: [
177
+ d != null && /* @__PURE__ */ e(M, { rating: d, reviewCount: y, size: "sm" }),
178
+ m && /* @__PURE__ */ l("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: [
170
179
  "最短 ",
171
- c
180
+ m
172
181
  ] })
173
182
  ] }),
174
- /* @__PURE__ */ e(k, { price: f, originalPrice: b, size: "sm", showTaxLabel: !1 }),
175
- u && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: u })
183
+ /* @__PURE__ */ e(B, { price: o, originalPrice: x, size: "sm", showTaxLabel: !1 }),
184
+ h && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: h })
176
185
  ] })
177
186
  ] })
178
187
  ]
@@ -182,7 +191,7 @@ function J({
182
191
  {
183
192
  "data-slot": "product-card",
184
193
  "data-orientation": "vertical",
185
- className: m(
194
+ className: c(
186
195
  // max-w: 広いグリッドセルでもカードが膨らみすぎないようカード自身が上限を持つ。
187
196
  // 280px は本番の検索結果グリッド(PC 5列 ≈ カード215px)では未到達=影響なし。
188
197
  // マイページ等の3列グリッド(実効幅 ~950px)で 3×280+gap が収まる上限として採用。
@@ -192,42 +201,50 @@ function J({
192
201
  n != null && "pt-3",
193
202
  a
194
203
  ),
195
- ...L,
204
+ ...E,
196
205
  children: [
197
- /* @__PURE__ */ e(j, { href: w, onClick: z, name: r }),
198
- n != null && /* @__PURE__ */ e(Z, { rank: n }),
206
+ /* @__PURE__ */ e(j, { href: L, onClick: g, name: r, linkComponent: f }),
207
+ n != null && /* @__PURE__ */ e(S, { rank: n }),
199
208
  /* @__PURE__ */ l("div", { className: "relative", children: [
200
209
  /* @__PURE__ */ l("div", { className: "aspect-square overflow-hidden rounded-lg", children: [
201
- /* @__PURE__ */ e("img", { src: t, alt: o ?? r, className: m("h-full w-full object-cover duration-[var(--Motion-Duration-Base)]", H(T)), loading: "lazy" }),
210
+ /* @__PURE__ */ e("img", { src: t, alt: i ?? r, className: c("h-full w-full object-cover duration-[var(--Motion-Duration-Base)]", O(k)), loading: "lazy" }),
202
211
  /* @__PURE__ */ e("div", { className: "absolute inset-x-1 bottom-1 z-[var(--Z-Local-3)] flex items-end", children: /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1", children: [
203
- d && /* @__PURE__ */ e(v, { variant: "sale", size: "sm", children: d }),
204
- x.map((s) => /* @__PURE__ */ e(v, { variant: s.variant, size: "sm", children: s.label }, s.label))
212
+ u && /* @__PURE__ */ e(b, { variant: "sale", size: "sm", children: u }),
213
+ N.map((s) => /* @__PURE__ */ e(
214
+ b,
215
+ {
216
+ variant: s.variant === void 0 || s.variant === "default" ? "image" : s.variant,
217
+ size: "sm",
218
+ children: s.label
219
+ },
220
+ s.label
221
+ ))
205
222
  ] }) })
206
223
  ] }),
207
- p && /* @__PURE__ */ e("div", { className: "absolute bottom-1.5 right-1.5 z-[var(--Z-Local-4)]", children: /* @__PURE__ */ e(M, { isFavorite: g, onToggle: p }) })
224
+ v && /* @__PURE__ */ e("div", { className: "absolute bottom-1.5 right-1.5 z-[var(--Z-Local-4)]", children: /* @__PURE__ */ e(Z, { isFavorite: w, onToggle: v }) })
208
225
  ] }),
209
226
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
210
- h && /* @__PURE__ */ e(C, { name: h, href: N }),
227
+ p && /* @__PURE__ */ e(H, { name: p, href: z, linkComponent: f }),
211
228
  /* @__PURE__ */ e("h3", { className: "line-clamp-2 min-h-[2lh] typo-body-md text-[var(--Text-High-Emphasis)]", children: r }),
212
- (i != null || c) && /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
213
- i != null && /* @__PURE__ */ e(B, { rating: i, reviewCount: y, size: "sm" }),
214
- c && /* @__PURE__ */ l("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: [
229
+ (d != null || m) && /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
230
+ d != null && /* @__PURE__ */ e(M, { rating: d, reviewCount: y, size: "sm" }),
231
+ m && /* @__PURE__ */ l("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: [
215
232
  "最短 ",
216
- c
233
+ m
217
234
  ] })
218
235
  ] }),
219
- /* @__PURE__ */ e(k, { price: f, originalPrice: b, size: "md", showTaxLabel: !1 }),
220
- u && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: u })
236
+ /* @__PURE__ */ e(B, { price: o, originalPrice: x, size: "md", showTaxLabel: !1 }),
237
+ h && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: h })
221
238
  ] }),
222
- O && /* @__PURE__ */ e(
239
+ R && /* @__PURE__ */ e(
223
240
  "button",
224
241
  {
225
242
  type: "button",
226
- className: "relative z-10 flex h-9 w-full items-center justify-center gap-0.5 rounded-lg bg-[var(--Brand-Cake-Orange)] typo-label-md text-[var(--Text-on-Inverse)] transition-colors hover:bg-[var(--Hover-Primary-Button)] active:bg-[var(--Active-Primary-Button)]",
243
+ className: c(I({ variant: "outline", size: "sm" }), "relative z-10 h-9 w-full gap-0.5"),
227
244
  onClick: (s) => {
228
- s.preventDefault(), s.stopPropagation(), I?.();
245
+ s.preventDefault(), s.stopPropagation(), $?.();
229
246
  },
230
- children: R
247
+ children: D
231
248
  }
232
249
  )
233
250
  ]
@@ -235,6 +252,6 @@ function J({
235
252
  );
236
253
  }
237
254
  export {
238
- $ as BookmarkRibbonIcon,
239
- J as ProductCard
255
+ V as BookmarkRibbonIcon,
256
+ Y as ProductCard
240
257
  };