@cakejp/design-system 0.16.0 → 0.17.1

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 (151) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/CLAUDE.md +1 -0
  3. package/bin/init.js +29 -6
  4. package/contracts/components.json +42 -7
  5. package/contracts/composition.json +8 -2
  6. package/contracts/rules.json +5 -1
  7. package/contracts/screen-patterns.json +1 -1
  8. package/dist/components/ec/_mypage-menu-data.js +166 -0
  9. package/dist/components/ec/admin-shell.js +202 -0
  10. package/dist/components/ec/anniversary-card.js +63 -0
  11. package/dist/components/ec/cake-logo.js +38 -0
  12. package/dist/components/ec/chart-controls.js +91 -0
  13. package/dist/components/ec/countdown-timer.js +50 -0
  14. package/dist/components/ec/coupon-card.js +136 -0
  15. package/dist/components/ec/delivery-calendar.js +105 -0
  16. package/dist/components/ec/mypage-shell.js +98 -0
  17. package/dist/components/ec/order-section.js +53 -0
  18. package/dist/components/ec/order-summary.js +78 -0
  19. package/dist/components/ec/payment-method.js +81 -0
  20. package/dist/components/ec/product-card.js +235 -0
  21. package/dist/components/ec/product-carousel.js +106 -0
  22. package/dist/components/ec/product-cta.js +80 -0
  23. package/dist/components/ec/product-detail-bar.js +86 -0
  24. package/dist/components/ec/product-detail-sidebar.js +296 -0
  25. package/dist/components/ec/product-list-item.js +266 -0
  26. package/dist/components/ec/product-option.js +165 -0
  27. package/dist/components/ec/rating-stars.js +74 -0
  28. package/dist/components/ec/review-card.js +126 -0
  29. package/dist/components/ec/review-form.js +181 -0
  30. package/dist/components/ec/review-summary.js +95 -0
  31. package/dist/components/ec/shop-card.js +179 -0
  32. package/dist/components/ec/stat-card.js +50 -0
  33. package/dist/components/foundations/accordion.js +67 -0
  34. package/dist/components/foundations/alert-dialog.js +165 -0
  35. package/dist/components/foundations/alert.js +218 -0
  36. package/dist/components/foundations/aspect-ratio.js +10 -0
  37. package/dist/components/foundations/avatar.js +58 -0
  38. package/dist/components/foundations/badge.js +54 -0
  39. package/dist/components/foundations/breadcrumb.js +104 -0
  40. package/dist/components/foundations/button.js +99 -0
  41. package/dist/components/foundations/calendar.js +173 -0
  42. package/dist/components/foundations/card.js +109 -0
  43. package/dist/components/foundations/checkbox-card.js +111 -0
  44. package/dist/components/foundations/checkbox-group.js +92 -0
  45. package/dist/components/foundations/checkbox.js +90 -0
  46. package/dist/components/foundations/chip-variants.js +41 -0
  47. package/dist/components/foundations/collapsible.js +34 -0
  48. package/dist/components/foundations/command.js +171 -0
  49. package/dist/components/foundations/context-menu.js +225 -0
  50. package/dist/components/foundations/data-table.js +59 -0
  51. package/dist/components/foundations/dialog.js +148 -0
  52. package/dist/components/foundations/drawer.js +129 -0
  53. package/dist/components/foundations/dropdown-menu.js +232 -0
  54. package/dist/components/foundations/field.js +150 -0
  55. package/dist/components/foundations/file-input.js +116 -0
  56. package/dist/components/foundations/form.js +101 -0
  57. package/dist/components/foundations/hover-card.js +41 -0
  58. package/dist/components/foundations/icon-badge.js +41 -0
  59. package/dist/components/foundations/input.js +74 -0
  60. package/dist/components/foundations/label.js +29 -0
  61. package/dist/components/foundations/menubar.js +252 -0
  62. package/dist/components/foundations/navigation-menu.js +171 -0
  63. package/dist/components/foundations/pagination.js +120 -0
  64. package/dist/components/foundations/popover.js +45 -0
  65. package/dist/components/foundations/progress.js +34 -0
  66. package/dist/components/foundations/radio-group.js +134 -0
  67. package/dist/components/foundations/responsive-dialog.js +76 -0
  68. package/dist/components/foundations/scroll-area.js +62 -0
  69. package/dist/components/foundations/select.js +190 -0
  70. package/dist/components/foundations/separator.js +27 -0
  71. package/dist/components/foundations/sheet.js +130 -0
  72. package/dist/components/foundations/skeleton.js +15 -0
  73. package/dist/components/foundations/skip-link.js +27 -0
  74. package/dist/components/foundations/slider.js +81 -0
  75. package/dist/components/foundations/social-icon.js +36 -0
  76. package/dist/components/foundations/sonner.js +49 -0
  77. package/dist/components/foundations/spinner.js +28 -0
  78. package/dist/components/foundations/switch.js +54 -0
  79. package/dist/components/foundations/table.js +115 -0
  80. package/dist/components/foundations/tabs.js +102 -0
  81. package/dist/components/foundations/textarea.js +65 -0
  82. package/dist/components/foundations/toggle-group.js +107 -0
  83. package/dist/components/foundations/toggle.js +44 -0
  84. package/dist/components/foundations/tooltip.js +56 -0
  85. package/dist/components/primitives/admin-header.js +31 -0
  86. package/dist/components/primitives/admin-side-nav.js +135 -0
  87. package/dist/components/primitives/banner-carousel.js +97 -0
  88. package/dist/components/primitives/bottom-tab-bar.js +81 -0
  89. package/dist/components/primitives/bulk-action-bar.js +27 -0
  90. package/dist/components/primitives/category-scroll.js +110 -0
  91. package/dist/components/primitives/category-shortcuts.js +66 -0
  92. package/dist/components/primitives/chat-composer.js +141 -0
  93. package/dist/components/primitives/chip.js +123 -0
  94. package/dist/components/primitives/coach-mark.js +102 -0
  95. package/dist/components/primitives/combobox.js +88 -0
  96. package/dist/components/primitives/container.js +50 -0
  97. package/dist/components/primitives/content-carousel.js +144 -0
  98. package/dist/components/primitives/date-picker.js +175 -0
  99. package/dist/components/primitives/empty-state.js +32 -0
  100. package/dist/components/primitives/error-state.js +115 -0
  101. package/dist/components/primitives/filter-bar.js +144 -0
  102. package/dist/components/primitives/footer.js +247 -0
  103. package/dist/components/primitives/form-field.js +38 -0
  104. package/dist/components/primitives/funnel-shell.js +99 -0
  105. package/dist/components/primitives/header.js +257 -0
  106. package/dist/components/primitives/image-carousel.js +156 -0
  107. package/dist/components/primitives/image-gallery.js +177 -0
  108. package/dist/components/primitives/image-input.js +207 -0
  109. package/dist/components/primitives/image-uploader.js +69 -0
  110. package/dist/components/primitives/kebab-menu.js +40 -0
  111. package/dist/components/primitives/list-item.js +80 -0
  112. package/dist/components/primitives/menu-drawer.js +154 -0
  113. package/dist/components/primitives/multi-select.js +93 -0
  114. package/dist/components/primitives/notification-badge.js +61 -0
  115. package/dist/components/primitives/notification-list.js +72 -0
  116. package/dist/components/primitives/number-input.js +235 -0
  117. package/dist/components/primitives/price-display.js +101 -0
  118. package/dist/components/primitives/progress-steps.js +62 -0
  119. package/dist/components/primitives/search-bar.js +81 -0
  120. package/dist/components/primitives/search-panel.js +43 -0
  121. package/dist/components/primitives/section-header.js +148 -0
  122. package/dist/components/primitives/section-nav.js +85 -0
  123. package/dist/components/primitives/section.js +78 -0
  124. package/dist/components/primitives/share-buttons.js +102 -0
  125. package/dist/components/primitives/side-nav.js +98 -0
  126. package/dist/components/primitives/social-login-button.js +53 -0
  127. package/dist/components/primitives/standard-page-shell.js +34 -0
  128. package/dist/components/primitives/status-count-tabs.js +42 -0
  129. package/dist/components/primitives/sticky-action-bar.js +26 -0
  130. package/dist/components/primitives/sub-nav.js +67 -0
  131. package/dist/components/primitives/tag.js +57 -0
  132. package/dist/components/primitives/timeline.js +55 -0
  133. package/dist/components/primitives/workspace-shell.js +57 -0
  134. package/dist/index.css +1 -1
  135. package/dist/index.js +22961 -13130
  136. package/dist/lib/field-labelling.js +29 -0
  137. package/dist/lib/focus-ring.js +6 -0
  138. package/dist/lib/pagination-range.js +42 -0
  139. package/dist/lib/use-value-length.js +63 -0
  140. package/dist/lib/utils.js +33 -0
  141. package/dist/types/components/foundations/accordion.d.ts +8 -1
  142. package/dist/types/components/foundations/data-table.d.ts +6 -1
  143. package/dist/types/components/foundations/slider.d.ts +13 -1
  144. package/dist/types/components/primitives/admin-header.d.ts +10 -0
  145. package/dist/types/components/primitives/admin-side-nav.d.ts +18 -0
  146. package/dist/types/components/primitives/combobox.d.ts +9 -1
  147. package/dist/types/components/primitives/menu-drawer.d.ts +0 -16
  148. package/dist/types/components/primitives/multi-select.d.ts +9 -1
  149. package/dist/types/lib/field-labelling.d.ts +66 -0
  150. package/package.json +8 -4
  151. package/scripts/codemod/README.md +9 -0
@@ -0,0 +1,181 @@
1
+ import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import I from "iconsax-reactjs/dist/esm/Camera.js";
4
+ import { X as P } from "lucide-react";
5
+ import { cn as k } from "../../lib/utils.js";
6
+ import { SparkleIcon as A } from "./rating-stars.js";
7
+ import { Button as E } from "../foundations/button.js";
8
+ import { Textarea as D } from "../foundations/textarea.js";
9
+ function K({
10
+ defaultRating: w = 0,
11
+ defaultText: z = "",
12
+ onSubmit: L,
13
+ onCancel: h,
14
+ isSubmitting: g = !1,
15
+ maxImages: m = 3,
16
+ maxLength: x = 500,
17
+ productName: d,
18
+ productImageUrl: b,
19
+ className: j,
20
+ ...S
21
+ }) {
22
+ const [l, T] = s.useState(w), [C, y] = s.useState(0), [f, O] = s.useState(z), [p, N] = s.useState([]), [o, R] = s.useState([]), n = s.useRef(null), u = C || l;
23
+ function U(e) {
24
+ const t = Array.from(e.target.files ?? []), c = [...p, ...t].slice(0, m);
25
+ N(c);
26
+ const i = c.map((v) => URL.createObjectURL(v));
27
+ o.forEach((v) => URL.revokeObjectURL(v)), R(i), n.current && (n.current.value = "");
28
+ }
29
+ function M(e) {
30
+ URL.revokeObjectURL(o[e]), N((t) => t.filter((c, i) => i !== e)), R((t) => t.filter((c, i) => i !== e));
31
+ }
32
+ function B(e) {
33
+ e.preventDefault(), l !== 0 && L?.({ rating: l, text: f, images: p });
34
+ }
35
+ s.useEffect(() => () => {
36
+ o.forEach((e) => URL.revokeObjectURL(e));
37
+ }, []);
38
+ const H = ["", "残念", "いまいち", "普通", "満足", "最高!"];
39
+ return /* @__PURE__ */ r(
40
+ "form",
41
+ {
42
+ "data-slot": "review-form",
43
+ className: k(
44
+ "flex flex-col gap-4 rounded-xl bg-[var(--Surface-Primary)] p-4",
45
+ j
46
+ ),
47
+ onSubmit: B,
48
+ ...S,
49
+ children: [
50
+ d && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-lg bg-[var(--Surface-Secondary)] p-3", children: [
51
+ b && /* @__PURE__ */ a(
52
+ "img",
53
+ {
54
+ src: b,
55
+ alt: d,
56
+ className: "size-12 shrink-0 rounded-lg object-cover"
57
+ }
58
+ ),
59
+ /* @__PURE__ */ a("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: d })
60
+ ] }),
61
+ /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2", children: [
62
+ /* @__PURE__ */ a("p", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: "評価を選択してください" }),
63
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1", role: "radiogroup", "aria-label": "星評価", children: [1, 2, 3, 4, 5].map((e) => /* @__PURE__ */ a(
64
+ "button",
65
+ {
66
+ type: "button",
67
+ role: "radio",
68
+ "aria-checked": l === e,
69
+ "aria-label": `${e}つ星`,
70
+ className: "rounded-full p-1 transition-transform hover:scale-110 focus-visible:ring-2 focus-visible:ring-[var(--Focus-High-Emphasis)]",
71
+ onClick: () => T(e),
72
+ onMouseEnter: () => y(e),
73
+ onMouseLeave: () => y(0),
74
+ children: /* @__PURE__ */ a(
75
+ A,
76
+ {
77
+ size: 32,
78
+ className: k(
79
+ "transition-colors",
80
+ e <= u ? "text-[var(--Brand-Cake-Orange)]" : "text-[var(--Border-Medium-Emphasis)]"
81
+ )
82
+ }
83
+ )
84
+ },
85
+ e
86
+ )) }),
87
+ u > 0 && /* @__PURE__ */ a("p", { className: "typo-body-sm text-[var(--Text-Accent-Primary)]", children: H[u] })
88
+ ] }),
89
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
90
+ /* @__PURE__ */ a(
91
+ D,
92
+ {
93
+ placeholder: "商品の感想を書いてください(任意)",
94
+ value: f,
95
+ onChange: (e) => O(e.target.value.slice(0, x)),
96
+ rows: 5,
97
+ className: "resize-none"
98
+ }
99
+ ),
100
+ /* @__PURE__ */ r("p", { className: "self-end typo-body-xs text-[var(--Text-Low-Emphasis)]", children: [
101
+ f.length,
102
+ " / ",
103
+ x
104
+ ] })
105
+ ] }),
106
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-2", children: [
107
+ /* @__PURE__ */ r("p", { className: "typo-label-sm text-[var(--Text-Medium-Emphasis)]", children: [
108
+ "写真を追加(最大",
109
+ m,
110
+ "枚)"
111
+ ] }),
112
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-2", children: [
113
+ o.map((e, t) => /* @__PURE__ */ r("div", { className: "relative size-20 overflow-hidden rounded-lg", children: [
114
+ /* @__PURE__ */ a("img", { src: e, alt: `添付画像${t + 1}`, className: "size-full object-cover" }),
115
+ /* @__PURE__ */ a(
116
+ "button",
117
+ {
118
+ type: "button",
119
+ onClick: () => M(t),
120
+ className: "absolute right-1 top-1 flex size-5 items-center justify-center rounded-full bg-[var(--Overlay-Dark)] text-[var(--Text-on-Inverse)] transition-colors hover:bg-[var(--Overlay-Dark)]",
121
+ "aria-label": `画像${t + 1}を削除`,
122
+ children: /* @__PURE__ */ a(P, { className: "size-3" })
123
+ }
124
+ )
125
+ ] }, t)),
126
+ p.length < m && /* @__PURE__ */ r(
127
+ "button",
128
+ {
129
+ type: "button",
130
+ onClick: () => n.current?.click(),
131
+ className: "flex size-20 flex-col items-center justify-center gap-1 rounded-lg border border-dashed border-[var(--Border-Medium-Emphasis)] text-[var(--Text-Low-Emphasis)] transition-colors hover:border-[var(--Border-High-Emphasis)] hover:text-[var(--Text-Medium-Emphasis)]",
132
+ "aria-label": "写真を追加",
133
+ children: [
134
+ /* @__PURE__ */ a(I, { size: 20 }),
135
+ /* @__PURE__ */ a("span", { className: "typo-body-xs", children: "追加" })
136
+ ]
137
+ }
138
+ ),
139
+ /* @__PURE__ */ a(
140
+ "input",
141
+ {
142
+ ref: n,
143
+ type: "file",
144
+ accept: "image/*",
145
+ multiple: !0,
146
+ className: "hidden",
147
+ onChange: U
148
+ }
149
+ )
150
+ ] })
151
+ ] }),
152
+ /* @__PURE__ */ r("div", { className: "flex gap-3", children: [
153
+ h && /* @__PURE__ */ a(
154
+ E,
155
+ {
156
+ type: "button",
157
+ variant: "tertiary",
158
+ size: "lg",
159
+ className: "flex-1",
160
+ onClick: h,
161
+ children: "キャンセル"
162
+ }
163
+ ),
164
+ /* @__PURE__ */ a(
165
+ E,
166
+ {
167
+ type: "submit",
168
+ size: "lg",
169
+ className: "flex-1",
170
+ disabled: l === 0 || g,
171
+ children: g ? "送信中..." : "レビューを投稿する"
172
+ }
173
+ )
174
+ ] })
175
+ ]
176
+ }
177
+ );
178
+ }
179
+ export {
180
+ K as ReviewForm
181
+ };
@@ -0,0 +1,95 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as d } from "../../lib/utils.js";
4
+ import { RatingStars as p, SparkleIcon as x } from "./rating-stars.js";
5
+ function g({
6
+ averageRating: l,
7
+ totalCount: m,
8
+ breakdown: t,
9
+ className: n,
10
+ ...i
11
+ }) {
12
+ const r = t ? Math.max(...t.map((s) => s.count), 1) : 1;
13
+ return /* @__PURE__ */ a(
14
+ "div",
15
+ {
16
+ "data-slot": "review-summary",
17
+ className: d("space-y-3", n),
18
+ ...i,
19
+ children: [
20
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
21
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
22
+ /* @__PURE__ */ e(x, { size: 28, className: "text-[var(--Brand-Cake-Orange)]" }),
23
+ /* @__PURE__ */ e("span", { className: "typo-heading-3xl tabular-nums text-[var(--Text-High-Emphasis)]", children: l.toFixed(2) })
24
+ ] }),
25
+ /* @__PURE__ */ a("span", { className: "typo-body-sm text-[var(--Text-Medium-Emphasis)]", children: [
26
+ m.toLocaleString(),
27
+ "件のレビュー"
28
+ ] })
29
+ ] }),
30
+ t && t.length > 0 && /* @__PURE__ */ e("div", { className: "space-y-1", children: t.map((s) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
31
+ /* @__PURE__ */ e("span", { className: "w-3 shrink-0 text-right typo-label-sm tabular-nums text-[var(--Text-Medium-Emphasis)]", children: s.stars }),
32
+ /* @__PURE__ */ e("div", { className: "h-2.5 flex-1 overflow-hidden rounded-full bg-[var(--Surface-Secondary)]", children: /* @__PURE__ */ e(
33
+ "div",
34
+ {
35
+ className: "h-full rounded-full bg-[var(--Brand-Cake-Orange)] transition-all duration-[var(--Motion-Duration-Base)]",
36
+ style: {
37
+ width: `${s.count / r * 100}%`
38
+ }
39
+ }
40
+ ) }),
41
+ /* @__PURE__ */ e("span", { className: "w-10 shrink-0 text-right typo-body-sm tabular-nums text-[var(--Text-Medium-Emphasis)]", children: s.count.toLocaleString() })
42
+ ] }, s.stars)) })
43
+ ]
44
+ }
45
+ );
46
+ }
47
+ function f({
48
+ reviewer: l,
49
+ rating: m,
50
+ date: t,
51
+ comment: n,
52
+ productName: i,
53
+ imageUrls: r,
54
+ className: s,
55
+ ...o
56
+ }) {
57
+ return /* @__PURE__ */ a(
58
+ "div",
59
+ {
60
+ "data-slot": "review-item",
61
+ className: d(
62
+ "space-y-2 border-b border-[var(--Border-Low-Emphasis)] py-4 last:border-b-0",
63
+ s
64
+ ),
65
+ ...o,
66
+ children: [
67
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
68
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
69
+ /* @__PURE__ */ e(p, { rating: m, size: "sm" }),
70
+ /* @__PURE__ */ e("span", { className: "typo-label-sm text-[var(--Text-High-Emphasis)]", children: l })
71
+ ] }),
72
+ /* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: t })
73
+ ] }),
74
+ i && /* @__PURE__ */ a("p", { className: "typo-body-sm text-[var(--Text-Medium-Emphasis)]", children: [
75
+ "購入商品: ",
76
+ i
77
+ ] }),
78
+ /* @__PURE__ */ e("p", { className: "typo-body-md text-[var(--Text-High-Emphasis)]", children: n }),
79
+ r && r.length > 0 && /* @__PURE__ */ e("div", { className: "flex gap-2", children: r.map((h, c) => /* @__PURE__ */ e(
80
+ "img",
81
+ {
82
+ src: h,
83
+ alt: `レビュー画像 ${c + 1}`,
84
+ className: "size-16 rounded-md object-cover"
85
+ },
86
+ c
87
+ )) })
88
+ ]
89
+ }
90
+ );
91
+ }
92
+ export {
93
+ f as ReviewItem,
94
+ g as ReviewSummary
95
+ };
@@ -0,0 +1,179 @@
1
+ import { jsxs as e, jsx as a } from "react/jsx-runtime";
2
+ import "react";
3
+ import u from "iconsax-reactjs/dist/esm/Location.js";
4
+ import N from "iconsax-reactjs/dist/esm/Star1.js";
5
+ import { StarHalf as g } from "lucide-react";
6
+ import { cn as m } from "../../lib/utils.js";
7
+ import { Button as y } from "../foundations/button.js";
8
+ import { BookmarkRibbonIcon as w } from "./product-card.js";
9
+ function E({ rating: r }) {
10
+ const t = Math.floor(r), l = r - t >= 0.5, i = [];
11
+ for (let s = 1; s <= 5; s++)
12
+ s <= t ? i.push(
13
+ /* @__PURE__ */ a(
14
+ N,
15
+ {
16
+ size: 12,
17
+ className: "fill-[var(--Brand-Cake-Orange)] text-[var(--Brand-Cake-Orange)]",
18
+ variant: "Bold"
19
+ },
20
+ s
21
+ )
22
+ ) : l && s === t + 1 ? i.push(
23
+ /* @__PURE__ */ a(
24
+ g,
25
+ {
26
+ className: "size-3 fill-[var(--Brand-Cake-Orange)] text-[var(--Brand-Cake-Orange)]"
27
+ },
28
+ s
29
+ )
30
+ ) : i.push(
31
+ /* @__PURE__ */ a(
32
+ N,
33
+ {
34
+ size: 12,
35
+ className: "text-[var(--Border-Medium-Emphasis)]"
36
+ },
37
+ s
38
+ )
39
+ );
40
+ return /* @__PURE__ */ a("div", { className: "flex items-center", children: i });
41
+ }
42
+ function O({
43
+ name: r,
44
+ ruby: t,
45
+ productImageUrl: l,
46
+ shopImageUrl: i,
47
+ rating: s,
48
+ reviewCount: p,
49
+ area: o,
50
+ deliveryDate: h,
51
+ isBookmarked: d = !1,
52
+ onBookmarkToggle: v,
53
+ href: c,
54
+ variant: b = "default",
55
+ className: x,
56
+ ...f
57
+ }) {
58
+ return b === "compact" ? /* @__PURE__ */ e(
59
+ c ? "a" : "div",
60
+ {
61
+ ...c ? { href: c } : {},
62
+ "data-slot": "shop-card",
63
+ className: m(
64
+ "flex items-center gap-3 rounded-lg border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] p-3 transition-colors hover:bg-[var(--Surface-Secondary)] max-w-[400px]",
65
+ x
66
+ ),
67
+ ...f,
68
+ children: [
69
+ (l || i) && /* @__PURE__ */ a(
70
+ "img",
71
+ {
72
+ src: l || i,
73
+ alt: r,
74
+ className: "size-12 shrink-0 rounded object-cover"
75
+ }
76
+ ),
77
+ /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: [
78
+ /* @__PURE__ */ a("p", { className: "truncate typo-label-md text-[var(--Text-High-Emphasis)]", children: r }),
79
+ o && /* @__PURE__ */ e("p", { className: "flex items-center gap-1 typo-body-sm text-[var(--Text-Low-Emphasis)]", children: [
80
+ /* @__PURE__ */ a(u, { size: 12, className: "shrink-0" }),
81
+ o
82
+ ] })
83
+ ] })
84
+ ]
85
+ }
86
+ ) : /* @__PURE__ */ e(
87
+ "div",
88
+ {
89
+ "data-slot": "shop-card",
90
+ className: m(
91
+ "relative min-w-[200px] grid grid-rows-[auto_1fr] gap-2 rounded-lg border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] p-3 transition-colors hover:bg-[var(--Surface-Secondary)]",
92
+ x
93
+ ),
94
+ ...f,
95
+ children: [
96
+ /* @__PURE__ */ e("div", { className: "flex overflow-hidden rounded", children: [
97
+ l && /* @__PURE__ */ e("div", { className: "relative w-1/2", children: [
98
+ /* @__PURE__ */ a("div", { className: "pb-[100%]" }),
99
+ /* @__PURE__ */ a(
100
+ "img",
101
+ {
102
+ src: l,
103
+ alt: `${r}の商品画像`,
104
+ className: "absolute inset-0 size-full object-cover"
105
+ }
106
+ )
107
+ ] }),
108
+ i && /* @__PURE__ */ e("div", { className: "relative w-1/2", children: [
109
+ /* @__PURE__ */ a("div", { className: "pb-[100%]" }),
110
+ /* @__PURE__ */ a(
111
+ "img",
112
+ {
113
+ src: i,
114
+ alt: `${r}の店舗画像`,
115
+ className: "absolute inset-0 size-full object-cover"
116
+ }
117
+ )
118
+ ] })
119
+ ] }),
120
+ /* @__PURE__ */ e("div", { className: "grid items-end", children: [
121
+ /* @__PURE__ */ e("h3", { className: "mb-auto pb-1 typo-heading-xl text-[var(--Text-High-Emphasis)]", children: [
122
+ /* @__PURE__ */ a("span", { className: "line-clamp-2", children: r }),
123
+ t && /* @__PURE__ */ a("small", { className: "block typo-body-sm text-[var(--Text-Low-Emphasis)]", children: t })
124
+ ] }),
125
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-[1fr_auto] items-end gap-2", children: [
126
+ /* @__PURE__ */ e("div", { className: "grid gap-1", children: [
127
+ o && /* @__PURE__ */ a("p", { className: "line-clamp-2 typo-body-sm text-[var(--Text-Low-Emphasis)]", children: o }),
128
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: [
129
+ s !== void 0 && s >= 1 && /* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: [
130
+ /* @__PURE__ */ a(E, { rating: s }),
131
+ /* @__PURE__ */ a("span", { className: "typo-body-sm text-[var(--Text-High-Emphasis)]", children: s.toFixed(1) }),
132
+ p !== void 0 && /* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: [
133
+ "(",
134
+ p,
135
+ ")"
136
+ ] })
137
+ ] }),
138
+ h && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Accent-Primary)]", children: [
139
+ "最短",
140
+ h,
141
+ "お届け"
142
+ ] })
143
+ ] })
144
+ ] }),
145
+ v && /* @__PURE__ */ a(
146
+ y,
147
+ {
148
+ variant: "ghost",
149
+ size: "icon",
150
+ onClick: (n) => {
151
+ n.preventDefault(), n.stopPropagation(), v();
152
+ },
153
+ className: m(
154
+ "z-[var(--Z-Local-1)] shrink-0 rounded-full",
155
+ d ? "text-[var(--Brand-Cake-Orange)]" : "text-[var(--Object-High-Emphasis)]"
156
+ ),
157
+ "aria-label": d ? "お気に入り解除" : "お気に入りに追加",
158
+ children: /* @__PURE__ */ a(
159
+ w,
160
+ {
161
+ size: 20,
162
+ filled: d
163
+ }
164
+ )
165
+ }
166
+ )
167
+ ] })
168
+ ] }),
169
+ c && /* @__PURE__ */ a("a", { href: c, className: "absolute inset-0", "aria-label": r, children: /* @__PURE__ */ e("span", { className: "sr-only", children: [
170
+ r,
171
+ "のショップページへ"
172
+ ] }) })
173
+ ]
174
+ }
175
+ );
176
+ }
177
+ export {
178
+ O as ShopCard
179
+ };
@@ -0,0 +1,50 @@
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as t } from "../../lib/utils.js";
4
+ import { Card as o, CardContent as n } from "../foundations/card.js";
5
+ import x from "iconsax-reactjs/dist/esm/TrendUp.js";
6
+ import p from "iconsax-reactjs/dist/esm/TrendDown.js";
7
+ function y({
8
+ label: i,
9
+ value: r,
10
+ icon: l,
11
+ iconBgClass: c = "bg-[var(--Surface-Accent-Primary-Light)]",
12
+ trend: s,
13
+ className: m
14
+ }) {
15
+ return /* @__PURE__ */ e(o, { className: t("min-w-[140px] p-0", m), "data-slot": "stat-card", children: /* @__PURE__ */ a(n, { className: "p-4", children: [
16
+ /* @__PURE__ */ a("div", { className: "flex flex-col items-start gap-1.5", children: [
17
+ /* @__PURE__ */ e(
18
+ "div",
19
+ {
20
+ className: t(
21
+ "flex items-center justify-center size-10 rounded-lg",
22
+ c
23
+ ),
24
+ children: l
25
+ }
26
+ ),
27
+ /* @__PURE__ */ e("p", { className: "typo-body-sm text-[var(--Text-Medium-Emphasis)]", children: i })
28
+ ] }),
29
+ /* @__PURE__ */ a("div", { className: "flex items-baseline justify-between mt-2", children: [
30
+ /* @__PURE__ */ e("p", { className: "typo-heading-xl text-[var(--Text-High-Emphasis)]", children: r }),
31
+ s && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
32
+ s.isPositive ? /* @__PURE__ */ e(x, { size: 14, className: "text-[var(--Text-Success)]" }) : /* @__PURE__ */ e(p, { size: 14, className: "text-[var(--Text-Caution)]" }),
33
+ /* @__PURE__ */ e(
34
+ "span",
35
+ {
36
+ className: t(
37
+ "typo-label-xs",
38
+ s.isPositive ? "text-[var(--Text-Success)]" : "text-[var(--Text-Caution)]"
39
+ ),
40
+ children: s.value
41
+ }
42
+ ),
43
+ s.label && /* @__PURE__ */ e("span", { className: "typo-body-xs text-[var(--Text-Low-Emphasis)]", children: s.label })
44
+ ] })
45
+ ] })
46
+ ] }) });
47
+ }
48
+ export {
49
+ y as StatCard
50
+ };
@@ -0,0 +1,67 @@
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import "react";
3
+ import { ChevronDownIcon as d } from "lucide-react";
4
+ import { Accordion as t } from "radix-ui";
5
+ import { cn as i } from "../../lib/utils.js";
6
+ function b({
7
+ ...o
8
+ }) {
9
+ return /* @__PURE__ */ e(t.Root, { "data-slot": "accordion", ...o });
10
+ }
11
+ function g({
12
+ className: o,
13
+ ...r
14
+ }) {
15
+ return /* @__PURE__ */ e(
16
+ t.Item,
17
+ {
18
+ "data-slot": "accordion-item",
19
+ className: i("border-b border-[var(--Border-Medium-Emphasis)] last:border-b-0", o),
20
+ ...r
21
+ }
22
+ );
23
+ }
24
+ function v({
25
+ className: o,
26
+ children: r,
27
+ headingLevel: n = 3,
28
+ ...a
29
+ }) {
30
+ const s = `h${n}`;
31
+ return /* @__PURE__ */ e(t.Header, { asChild: !0, children: /* @__PURE__ */ e(s, { className: "flex", children: /* @__PURE__ */ c(
32
+ t.Trigger,
33
+ {
34
+ "data-slot": "accordion-trigger",
35
+ className: i(
36
+ "flex w-full flex-1 cursor-pointer items-center justify-between gap-4 py-4 text-left typo-label-md text-[var(--Text-High-Emphasis)] transition-all outline-none hover:bg-[var(--Surface-Tertiary)]/60 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
37
+ o
38
+ ),
39
+ ...a,
40
+ children: [
41
+ r,
42
+ /* @__PURE__ */ e(d, { className: "pointer-events-none size-4 shrink-0 text-[var(--Text-Medium-Emphasis)] transition-transform duration-[var(--Motion-Duration-Base)]" })
43
+ ]
44
+ }
45
+ ) }) });
46
+ }
47
+ function h({
48
+ className: o,
49
+ children: r,
50
+ ...n
51
+ }) {
52
+ return /* @__PURE__ */ e(
53
+ t.Content,
54
+ {
55
+ "data-slot": "accordion-content",
56
+ className: "overflow-hidden typo-body-md data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
57
+ ...n,
58
+ children: /* @__PURE__ */ e("div", { className: i("pt-0 pb-4", o), children: r })
59
+ }
60
+ );
61
+ }
62
+ export {
63
+ b as Accordion,
64
+ h as AccordionContent,
65
+ g as AccordionItem,
66
+ v as AccordionTrigger
67
+ };