@cakejp/design-system 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/CLAUDE.md +1 -0
  3. package/bin/init.js +29 -6
  4. package/contracts/components.json +42 -7
  5. package/contracts/composition.json +8 -2
  6. package/contracts/rules.json +5 -1
  7. package/contracts/screen-patterns.json +1 -1
  8. package/dist/components/ec/_mypage-menu-data.js +166 -0
  9. package/dist/components/ec/admin-shell.js +202 -0
  10. package/dist/components/ec/anniversary-card.js +63 -0
  11. package/dist/components/ec/cake-logo.js +38 -0
  12. package/dist/components/ec/chart-controls.js +91 -0
  13. package/dist/components/ec/countdown-timer.js +50 -0
  14. package/dist/components/ec/coupon-card.js +136 -0
  15. package/dist/components/ec/delivery-calendar.js +105 -0
  16. package/dist/components/ec/mypage-shell.js +98 -0
  17. package/dist/components/ec/order-section.js +53 -0
  18. package/dist/components/ec/order-summary.js +78 -0
  19. package/dist/components/ec/payment-method.js +81 -0
  20. package/dist/components/ec/product-card.js +235 -0
  21. package/dist/components/ec/product-carousel.js +106 -0
  22. package/dist/components/ec/product-cta.js +80 -0
  23. package/dist/components/ec/product-detail-bar.js +86 -0
  24. package/dist/components/ec/product-detail-sidebar.js +296 -0
  25. package/dist/components/ec/product-list-item.js +266 -0
  26. package/dist/components/ec/product-option.js +165 -0
  27. package/dist/components/ec/rating-stars.js +74 -0
  28. package/dist/components/ec/review-card.js +126 -0
  29. package/dist/components/ec/review-form.js +181 -0
  30. package/dist/components/ec/review-summary.js +95 -0
  31. package/dist/components/ec/shop-card.js +179 -0
  32. package/dist/components/ec/stat-card.js +50 -0
  33. package/dist/components/foundations/accordion.js +67 -0
  34. package/dist/components/foundations/alert-dialog.js +165 -0
  35. package/dist/components/foundations/alert.js +218 -0
  36. package/dist/components/foundations/aspect-ratio.js +10 -0
  37. package/dist/components/foundations/avatar.js +58 -0
  38. package/dist/components/foundations/badge.js +54 -0
  39. package/dist/components/foundations/breadcrumb.js +104 -0
  40. package/dist/components/foundations/button.js +99 -0
  41. package/dist/components/foundations/calendar.js +173 -0
  42. package/dist/components/foundations/card.js +109 -0
  43. package/dist/components/foundations/checkbox-card.js +111 -0
  44. package/dist/components/foundations/checkbox-group.js +92 -0
  45. package/dist/components/foundations/checkbox.js +90 -0
  46. package/dist/components/foundations/chip-variants.js +41 -0
  47. package/dist/components/foundations/collapsible.js +34 -0
  48. package/dist/components/foundations/command.js +171 -0
  49. package/dist/components/foundations/context-menu.js +225 -0
  50. package/dist/components/foundations/data-table.js +59 -0
  51. package/dist/components/foundations/dialog.js +148 -0
  52. package/dist/components/foundations/drawer.js +129 -0
  53. package/dist/components/foundations/dropdown-menu.js +232 -0
  54. package/dist/components/foundations/field.js +150 -0
  55. package/dist/components/foundations/file-input.js +116 -0
  56. package/dist/components/foundations/form.js +101 -0
  57. package/dist/components/foundations/hover-card.js +41 -0
  58. package/dist/components/foundations/icon-badge.js +41 -0
  59. package/dist/components/foundations/input.js +74 -0
  60. package/dist/components/foundations/label.js +29 -0
  61. package/dist/components/foundations/menubar.js +252 -0
  62. package/dist/components/foundations/navigation-menu.js +171 -0
  63. package/dist/components/foundations/pagination.js +120 -0
  64. package/dist/components/foundations/popover.js +45 -0
  65. package/dist/components/foundations/progress.js +34 -0
  66. package/dist/components/foundations/radio-group.js +134 -0
  67. package/dist/components/foundations/responsive-dialog.js +76 -0
  68. package/dist/components/foundations/scroll-area.js +62 -0
  69. package/dist/components/foundations/select.js +190 -0
  70. package/dist/components/foundations/separator.js +27 -0
  71. package/dist/components/foundations/sheet.js +130 -0
  72. package/dist/components/foundations/skeleton.js +15 -0
  73. package/dist/components/foundations/skip-link.js +27 -0
  74. package/dist/components/foundations/slider.js +81 -0
  75. package/dist/components/foundations/social-icon.js +36 -0
  76. package/dist/components/foundations/sonner.js +49 -0
  77. package/dist/components/foundations/spinner.js +28 -0
  78. package/dist/components/foundations/switch.js +54 -0
  79. package/dist/components/foundations/table.js +115 -0
  80. package/dist/components/foundations/tabs.js +102 -0
  81. package/dist/components/foundations/textarea.js +65 -0
  82. package/dist/components/foundations/toggle-group.js +107 -0
  83. package/dist/components/foundations/toggle.js +44 -0
  84. package/dist/components/foundations/tooltip.js +56 -0
  85. package/dist/components/primitives/admin-header.js +31 -0
  86. package/dist/components/primitives/admin-side-nav.js +135 -0
  87. package/dist/components/primitives/banner-carousel.js +97 -0
  88. package/dist/components/primitives/bottom-tab-bar.js +81 -0
  89. package/dist/components/primitives/bulk-action-bar.js +27 -0
  90. package/dist/components/primitives/category-scroll.js +110 -0
  91. package/dist/components/primitives/category-shortcuts.js +66 -0
  92. package/dist/components/primitives/chat-composer.js +141 -0
  93. package/dist/components/primitives/chip.js +123 -0
  94. package/dist/components/primitives/coach-mark.js +102 -0
  95. package/dist/components/primitives/combobox.js +88 -0
  96. package/dist/components/primitives/container.js +50 -0
  97. package/dist/components/primitives/content-carousel.js +144 -0
  98. package/dist/components/primitives/date-picker.js +175 -0
  99. package/dist/components/primitives/empty-state.js +32 -0
  100. package/dist/components/primitives/error-state.js +115 -0
  101. package/dist/components/primitives/filter-bar.js +144 -0
  102. package/dist/components/primitives/footer.js +247 -0
  103. package/dist/components/primitives/form-field.js +38 -0
  104. package/dist/components/primitives/funnel-shell.js +99 -0
  105. package/dist/components/primitives/header.js +257 -0
  106. package/dist/components/primitives/image-carousel.js +156 -0
  107. package/dist/components/primitives/image-gallery.js +177 -0
  108. package/dist/components/primitives/image-input.js +207 -0
  109. package/dist/components/primitives/image-uploader.js +69 -0
  110. package/dist/components/primitives/kebab-menu.js +40 -0
  111. package/dist/components/primitives/list-item.js +80 -0
  112. package/dist/components/primitives/menu-drawer.js +154 -0
  113. package/dist/components/primitives/multi-select.js +93 -0
  114. package/dist/components/primitives/notification-badge.js +61 -0
  115. package/dist/components/primitives/notification-list.js +72 -0
  116. package/dist/components/primitives/number-input.js +235 -0
  117. package/dist/components/primitives/price-display.js +101 -0
  118. package/dist/components/primitives/progress-steps.js +62 -0
  119. package/dist/components/primitives/search-bar.js +81 -0
  120. package/dist/components/primitives/search-panel.js +43 -0
  121. package/dist/components/primitives/section-header.js +148 -0
  122. package/dist/components/primitives/section-nav.js +85 -0
  123. package/dist/components/primitives/section.js +78 -0
  124. package/dist/components/primitives/share-buttons.js +102 -0
  125. package/dist/components/primitives/side-nav.js +98 -0
  126. package/dist/components/primitives/social-login-button.js +53 -0
  127. package/dist/components/primitives/standard-page-shell.js +34 -0
  128. package/dist/components/primitives/status-count-tabs.js +42 -0
  129. package/dist/components/primitives/sticky-action-bar.js +26 -0
  130. package/dist/components/primitives/sub-nav.js +67 -0
  131. package/dist/components/primitives/tag.js +57 -0
  132. package/dist/components/primitives/timeline.js +55 -0
  133. package/dist/components/primitives/workspace-shell.js +57 -0
  134. package/dist/index.css +1 -1
  135. package/dist/index.js +22961 -13130
  136. package/dist/lib/field-labelling.js +29 -0
  137. package/dist/lib/focus-ring.js +6 -0
  138. package/dist/lib/pagination-range.js +42 -0
  139. package/dist/lib/use-value-length.js +63 -0
  140. package/dist/lib/utils.js +33 -0
  141. package/dist/types/components/ec/_mypage-menu-data.d.ts +3 -3
  142. package/dist/types/components/ec/admin-shell.d.ts +1 -1
  143. package/dist/types/components/ec/anniversary-card.d.ts +1 -1
  144. package/dist/types/components/ec/mypage-shell.d.ts +3 -3
  145. package/dist/types/components/ec/product-card.d.ts +1 -1
  146. package/dist/types/components/ec/product-carousel.d.ts +3 -3
  147. package/dist/types/components/ec/stat-card.d.ts +1 -1
  148. package/dist/types/components/foundations/accordion.d.ts +8 -1
  149. package/dist/types/components/foundations/alert-dialog.d.ts +1 -1
  150. package/dist/types/components/foundations/calendar.d.ts +1 -1
  151. package/dist/types/components/foundations/checkbox-group.d.ts +1 -1
  152. package/dist/types/components/foundations/command.d.ts +1 -1
  153. package/dist/types/components/foundations/data-table.d.ts +6 -1
  154. package/dist/types/components/foundations/field.d.ts +2 -2
  155. package/dist/types/components/foundations/file-input.d.ts +1 -1
  156. package/dist/types/components/foundations/pagination.d.ts +1 -1
  157. package/dist/types/components/foundations/responsive-dialog.d.ts +1 -1
  158. package/dist/types/components/foundations/skip-link.d.ts +1 -1
  159. package/dist/types/components/foundations/slider.d.ts +13 -1
  160. package/dist/types/components/primitives/admin-header.d.ts +11 -1
  161. package/dist/types/components/primitives/admin-side-nav.d.ts +19 -1
  162. package/dist/types/components/primitives/banner-carousel.d.ts +2 -2
  163. package/dist/types/components/primitives/category-scroll.d.ts +2 -2
  164. package/dist/types/components/primitives/category-shortcuts.d.ts +1 -1
  165. package/dist/types/components/primitives/chat-composer.d.ts +1 -1
  166. package/dist/types/components/primitives/chip.d.ts +1 -1
  167. package/dist/types/components/primitives/combobox.d.ts +9 -1
  168. package/dist/types/components/primitives/content-carousel.d.ts +1 -1
  169. package/dist/types/components/primitives/form-field.d.ts +1 -1
  170. package/dist/types/components/primitives/image-input.d.ts +1 -1
  171. package/dist/types/components/primitives/kebab-menu.d.ts +1 -1
  172. package/dist/types/components/primitives/menu-drawer.d.ts +0 -16
  173. package/dist/types/components/primitives/multi-select.d.ts +9 -1
  174. package/dist/types/components/primitives/notification-list.d.ts +1 -1
  175. package/dist/types/components/primitives/search-panel.d.ts +1 -1
  176. package/dist/types/components/primitives/section-nav.d.ts +1 -1
  177. package/dist/types/components/primitives/side-nav.d.ts +1 -1
  178. package/dist/types/components/primitives/social-login-button.d.ts +1 -1
  179. package/dist/types/lib/field-labelling.d.ts +66 -0
  180. package/package.json +2 -2
  181. package/scripts/codemod/README.md +9 -0
@@ -0,0 +1,266 @@
1
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as r } from "../../lib/utils.js";
4
+ import { Button as m } from "../foundations/button.js";
5
+ import { Tag as Z } from "../primitives/tag.js";
6
+ import { NumberInput as _ } from "../primitives/number-input.js";
7
+ import { PriceDisplay as q } from "../primitives/price-display.js";
8
+ import { BookmarkRibbonIcon as F } from "./product-card.js";
9
+ function te({
10
+ name: n,
11
+ imageUrl: o,
12
+ price: p,
13
+ caption: h,
14
+ shopName: f,
15
+ shopHref: z,
16
+ brandName: d,
17
+ tags: y,
18
+ hashTags: u,
19
+ statusLabel: x,
20
+ variant: i = "default",
21
+ showCartButton: k = !1,
22
+ onAddToCart: R,
23
+ showDetailButton: j = !1,
24
+ onViewDetail: V,
25
+ showBookmark: W = !1,
26
+ href: M,
27
+ orderDate: S,
28
+ deliveryInfo: H,
29
+ totalPrice: v,
30
+ showReviewButton: C = !1,
31
+ optionInfo: L,
32
+ // cart variant props
33
+ quantity: b,
34
+ onQuantityChange: A,
35
+ quantitySize: G = "sm",
36
+ originalPrice: J,
37
+ priceLabel: N,
38
+ deliveryText: B,
39
+ onDelete: g,
40
+ onSaveForLater: w,
41
+ imageSize: K = "size-20",
42
+ subtotal: O,
43
+ subtotalLabel: Q = "小計",
44
+ // slot props
45
+ leftSlot: E,
46
+ rightSlot: P,
47
+ bottomSlot: $,
48
+ className: X,
49
+ ...Y
50
+ }) {
51
+ const t = i === "small" || i === "xsm", c = i === "review", a = i === "cart", I = a ? K : i === "xsm" ? "size-10" : t ? "size-14" : "size-[102px]";
52
+ return /* @__PURE__ */ s(
53
+ "div",
54
+ {
55
+ "data-slot": "list-item",
56
+ className: r(
57
+ "flex flex-col bg-[var(--Surface-Primary)]",
58
+ i === "lp" && "flex-col rounded-xl bg-[var(--Surface-Secondary)] p-4",
59
+ X
60
+ ),
61
+ ...Y,
62
+ children: [
63
+ /* @__PURE__ */ s("div", { className: r(
64
+ "flex gap-2 px-4 py-2 min-w-0 overflow-hidden",
65
+ t && "gap-2 px-3 py-2",
66
+ a && "gap-3 p-4",
67
+ i === "lp" && "gap-3 px-0 py-0"
68
+ ), children: [
69
+ E ? /* @__PURE__ */ e("div", { className: "shrink-0", children: E }) : o && !a ? /* @__PURE__ */ s("a", { href: M ?? "#", className: "relative shrink-0", children: [
70
+ /* @__PURE__ */ e(
71
+ "img",
72
+ {
73
+ src: o,
74
+ alt: n,
75
+ className: r(
76
+ "rounded-lg object-cover",
77
+ I,
78
+ i === "lp" && "aspect-video w-full size-auto rounded-lg"
79
+ )
80
+ }
81
+ ),
82
+ x && /* @__PURE__ */ e("span", { className: "absolute top-1.5 left-1.5 rounded bg-[var(--Surface-Primary)]/80 px-1.5 py-0.5 typo-label-xs text-[var(--Text-Medium-Emphasis)]", children: x })
83
+ ] }) : null,
84
+ !E && o && a && /* @__PURE__ */ s(
85
+ "div",
86
+ {
87
+ className: r(
88
+ "relative shrink-0 overflow-hidden rounded-lg bg-[var(--Surface-Secondary)]",
89
+ I
90
+ ),
91
+ children: [
92
+ /* @__PURE__ */ e(
93
+ "img",
94
+ {
95
+ src: o,
96
+ alt: n,
97
+ className: "h-full w-full object-cover"
98
+ }
99
+ ),
100
+ x && /* @__PURE__ */ e("span", { className: "absolute top-1.5 left-1.5 rounded bg-[var(--Surface-Primary)]/80 px-1.5 py-0.5 typo-label-xs text-[var(--Text-Medium-Emphasis)]", children: x })
101
+ ]
102
+ }
103
+ ),
104
+ /* @__PURE__ */ s("div", { className: r(
105
+ "min-w-0 flex-1",
106
+ c ? "flex flex-col justify-between self-stretch" : a ? "flex flex-col gap-2" : "space-y-1"
107
+ ), children: [
108
+ (f || d) && !t && !c && (z ? /* @__PURE__ */ s(
109
+ "a",
110
+ {
111
+ href: z,
112
+ className: "block truncate typo-body-sm text-[var(--Text-Medium-Emphasis)] underline decoration-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]",
113
+ children: [
114
+ f,
115
+ d && ` / ${d}`
116
+ ]
117
+ }
118
+ ) : /* @__PURE__ */ s("p", { className: "truncate typo-body-sm text-[var(--Text-Medium-Emphasis)]", children: [
119
+ f,
120
+ d && ` / ${d}`
121
+ ] })),
122
+ a ? /* @__PURE__ */ e("h3", { className: "line-clamp-2 typo-body-md text-[var(--Text-High-Emphasis)] min-w-0 break-words", children: n }) : /* @__PURE__ */ e(
123
+ "a",
124
+ {
125
+ href: M ?? "#",
126
+ className: r(
127
+ "block text-[var(--Text-High-Emphasis)]",
128
+ t ? "truncate typo-body-sm" : "line-clamp-2 typo-label-md"
129
+ ),
130
+ children: n
131
+ }
132
+ ),
133
+ u && u.length > 0 && !t && !c && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-x-1", children: u.map((l) => /* @__PURE__ */ s("span", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: [
134
+ "#",
135
+ l
136
+ ] }, l)) }),
137
+ y && y.length > 0 && !t && !c && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: y.map((l, T) => /* @__PURE__ */ e(Z, { variant: l.variant, size: a ? "sm" : void 0, children: l.label }, T)) }),
138
+ a && B && /* @__PURE__ */ e("p", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: B }),
139
+ a && p !== void 0 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between min-w-0 gap-2 overflow-hidden", children: [
140
+ N && /* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)] shrink-0", children: N }),
141
+ /* @__PURE__ */ e("div", { className: r("min-w-0 shrink-0", !N && "ml-auto"), children: /* @__PURE__ */ e(
142
+ q,
143
+ {
144
+ price: p,
145
+ originalPrice: J,
146
+ size: "sm",
147
+ showTaxLabel: !1
148
+ }
149
+ ) })
150
+ ] }),
151
+ a && h && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: h }),
152
+ a && (b !== void 0 || g || w) && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
153
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
154
+ g && /* @__PURE__ */ e(
155
+ m,
156
+ {
157
+ variant: "tertiary",
158
+ size: "sm",
159
+ onClick: g,
160
+ "aria-label": "削除",
161
+ children: "削除"
162
+ }
163
+ ),
164
+ w && /* @__PURE__ */ s(
165
+ m,
166
+ {
167
+ variant: "tertiary",
168
+ size: "sm",
169
+ onClick: w,
170
+ "aria-label": "あとで買う",
171
+ children: [
172
+ /* @__PURE__ */ e(F, { size: 16 }),
173
+ "あとで買う"
174
+ ]
175
+ }
176
+ )
177
+ ] }),
178
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [
179
+ b !== void 0 && /* @__PURE__ */ e(
180
+ _,
181
+ {
182
+ value: b,
183
+ size: G,
184
+ onChange: A
185
+ }
186
+ ),
187
+ O !== void 0 && /* @__PURE__ */ s("div", { className: "flex items-baseline gap-1", children: [
188
+ /* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: Q }),
189
+ /* @__PURE__ */ s("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: [
190
+ "¥",
191
+ O.toLocaleString()
192
+ ] })
193
+ ] })
194
+ ] })
195
+ ] }),
196
+ p !== void 0 && !c && !a && /* @__PURE__ */ s("p", { className: r(
197
+ "text-[var(--Text-High-Emphasis)]",
198
+ t ? "typo-label-sm" : "typo-label-md"
199
+ ), children: [
200
+ "¥",
201
+ p.toLocaleString()
202
+ ] }),
203
+ h && !a && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: h }),
204
+ c && v !== void 0 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
205
+ /* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: "合計" }),
206
+ /* @__PURE__ */ s("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: [
207
+ "¥",
208
+ v.toLocaleString()
209
+ ] })
210
+ ] }),
211
+ i === "order-history" && /* @__PURE__ */ s("div", { className: "space-y-0.5 typo-body-sm text-[var(--Text-Low-Emphasis)]", children: [
212
+ S && /* @__PURE__ */ s("p", { children: [
213
+ "お届け日:",
214
+ S
215
+ ] }),
216
+ H && /* @__PURE__ */ s("p", { children: [
217
+ "お届け先:",
218
+ H
219
+ ] }),
220
+ v !== void 0 && /* @__PURE__ */ s("p", { children: [
221
+ "合計:",
222
+ /* @__PURE__ */ s("span", { className: "typo-label-sm text-[var(--Text-High-Emphasis)]", children: [
223
+ "¥",
224
+ v.toLocaleString()
225
+ ] })
226
+ ] })
227
+ ] }),
228
+ L && /* @__PURE__ */ e("div", { className: "space-y-0.5 typo-body-sm text-[var(--Text-Low-Emphasis)]", children: Object.entries(L).map(([l, T]) => /* @__PURE__ */ s("p", { children: [
229
+ l,
230
+ ":",
231
+ /* @__PURE__ */ e("span", { className: "text-[var(--Text-Medium-Emphasis)]", children: T })
232
+ ] }, l)) })
233
+ ] }),
234
+ P ? /* @__PURE__ */ e("div", { className: "shrink-0 self-start", children: P }) : W && !c && /* @__PURE__ */ e(
235
+ "button",
236
+ {
237
+ type: "button",
238
+ className: "flex size-9 shrink-0 items-center justify-center self-start rounded-full border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Secondary)] transition-colors hover:border-[var(--Border-High-Emphasis)] hover:bg-[var(--Surface-Tertiary)]",
239
+ "aria-label": "ブックマーク",
240
+ children: /* @__PURE__ */ e(
241
+ "svg",
242
+ {
243
+ xmlns: "http://www.w3.org/2000/svg",
244
+ viewBox: "0 0 24 24",
245
+ fill: "none",
246
+ stroke: "currentColor",
247
+ strokeWidth: 2,
248
+ className: "size-4 text-[var(--Object-High-Emphasis)]",
249
+ children: /* @__PURE__ */ e("path", { d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z" })
250
+ }
251
+ )
252
+ }
253
+ )
254
+ ] }),
255
+ $ ? /* @__PURE__ */ e("div", { className: "px-4 py-3", children: $ }) : (k || j || C) && /* @__PURE__ */ s("div", { className: "flex justify-end gap-3.5 px-4 py-3", children: [
256
+ j && /* @__PURE__ */ e(m, { variant: "tertiary", size: "sm", onClick: V, children: "商品詳細を見る" }),
257
+ C && /* @__PURE__ */ e(m, { variant: "secondary", size: "sm", children: "レビューを書く" }),
258
+ k && /* @__PURE__ */ e(m, { size: "sm", onClick: R, children: "カートに追加" })
259
+ ] })
260
+ ]
261
+ }
262
+ );
263
+ }
264
+ export {
265
+ te as ProductListItem
266
+ };
@@ -0,0 +1,165 @@
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import * as d from "react";
3
+ import x from "iconsax-reactjs/dist/esm/ArrowDown2.js";
4
+ import y from "iconsax-reactjs/dist/esm/Add.js";
5
+ import g from "iconsax-reactjs/dist/esm/Minus.js";
6
+ import E from "iconsax-reactjs/dist/esm/ExportSquare.js";
7
+ import { cn as N } from "../../lib/utils.js";
8
+ import { Button as h } from "../foundations/button.js";
9
+ import { Input as C } from "../foundations/input.js";
10
+ import { Label as T } from "../foundations/label.js";
11
+ function j({
12
+ type: r,
13
+ label: i,
14
+ required: t = !1,
15
+ price: a,
16
+ helpText: o,
17
+ error: s,
18
+ children: n,
19
+ className: b,
20
+ ...v
21
+ }) {
22
+ const c = d.useId(), p = o ? `${c}-help` : void 0, u = s ? `${c}-error` : void 0, f = [p, u].filter(Boolean).join(" ") || void 0;
23
+ return /* @__PURE__ */ l(
24
+ "div",
25
+ {
26
+ "data-slot": "product-option",
27
+ role: "group",
28
+ "aria-labelledby": `${c}-label`,
29
+ className: N(
30
+ "space-y-2 rounded-lg border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] p-3",
31
+ s && "border-[var(--Border-Caution)]",
32
+ b
33
+ ),
34
+ ...v,
35
+ children: [
36
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
37
+ /* @__PURE__ */ l(T, { id: `${c}-label`, className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: [
38
+ i,
39
+ t && /* @__PURE__ */ e("span", { className: "ml-1 text-[var(--Text-Caution)]", "aria-hidden": "true", children: "*" })
40
+ ] }),
41
+ t && /* @__PURE__ */ e("span", { className: "sr-only", children: "(必須)" }),
42
+ a && /* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Medium-Emphasis)]", children: a })
43
+ ] }),
44
+ d.Children.map(n, (m) => d.isValidElement(m) ? d.cloneElement(m, {
45
+ "aria-describedby": f,
46
+ "aria-invalid": s ? !0 : void 0
47
+ }) : m),
48
+ o && /* @__PURE__ */ e("p", { id: p, className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: o }),
49
+ s && /* @__PURE__ */ e("p", { id: u, className: "typo-body-sm text-[var(--Text-Caution)]", role: "alert", children: s })
50
+ ]
51
+ }
52
+ );
53
+ }
54
+ function $({
55
+ value: r,
56
+ min: i = 0,
57
+ max: t = 99,
58
+ onChange: a,
59
+ ...o
60
+ }) {
61
+ return /* @__PURE__ */ l("div", { className: "flex items-center gap-2", role: "group", "aria-label": "数量選択", ...o, children: [
62
+ /* @__PURE__ */ e(
63
+ h,
64
+ {
65
+ variant: "tertiary",
66
+ size: "icon-sm",
67
+ onClick: () => a?.(Math.max(i, r - 1)),
68
+ disabled: r <= i,
69
+ "aria-label": "減らす",
70
+ children: /* @__PURE__ */ e(g, { size: 16 })
71
+ }
72
+ ),
73
+ /* @__PURE__ */ e("span", { className: "w-8 shrink-0 text-center typo-label-md tabular-nums text-[var(--Text-High-Emphasis)]", "aria-live": "polite", children: r }),
74
+ /* @__PURE__ */ e(
75
+ h,
76
+ {
77
+ variant: "tertiary",
78
+ size: "icon-sm",
79
+ onClick: () => a?.(Math.min(t, r + 1)),
80
+ disabled: r >= t,
81
+ "aria-label": "増やす",
82
+ children: /* @__PURE__ */ e(y, { size: 16 })
83
+ }
84
+ )
85
+ ] });
86
+ }
87
+ function F({
88
+ value: r,
89
+ options: i,
90
+ onChange: t,
91
+ placeholder: a = "テキスト",
92
+ ...o
93
+ }) {
94
+ const s = d.useId();
95
+ return /* @__PURE__ */ l("div", { className: "relative", ...o, children: [
96
+ /* @__PURE__ */ l(
97
+ "select",
98
+ {
99
+ id: s,
100
+ value: r,
101
+ onChange: (n) => t?.(n.target.value),
102
+ "aria-label": a,
103
+ className: "w-full appearance-none rounded-md border border-[var(--Border-High-Emphasis)] bg-[var(--Surface-Primary)] px-3 py-2 pr-8 typo-body-md text-[var(--Text-High-Emphasis)] focus:border-[var(--Focus-High-Emphasis)] focus:outline-none focus:ring-[3px] focus:ring-[var(--Focus-High-Emphasis)]/50",
104
+ children: [
105
+ /* @__PURE__ */ e("option", { value: "", disabled: !0, children: a }),
106
+ i.map((n) => /* @__PURE__ */ e("option", { value: n.value, children: n.label }, n.value))
107
+ ]
108
+ }
109
+ ),
110
+ /* @__PURE__ */ e(x, { size: 16, className: "pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[var(--Text-Low-Emphasis)]" })
111
+ ] });
112
+ }
113
+ function L({
114
+ value: r,
115
+ onChange: i,
116
+ placeholder: t = "プレイスホルダー",
117
+ maxLength: a,
118
+ ...o
119
+ }) {
120
+ const s = d.useId();
121
+ return /* @__PURE__ */ l("div", { className: "space-y-1", ...o, children: [
122
+ /* @__PURE__ */ e(
123
+ C,
124
+ {
125
+ id: s,
126
+ value: r,
127
+ onChange: (n) => i?.(n.target.value),
128
+ placeholder: t,
129
+ maxLength: a,
130
+ "aria-label": t
131
+ }
132
+ ),
133
+ a && /* @__PURE__ */ l("p", { className: "text-right typo-body-sm text-[var(--Text-Low-Emphasis)]", "aria-live": "polite", children: [
134
+ r?.length ?? 0,
135
+ "/",
136
+ a
137
+ ] })
138
+ ] });
139
+ }
140
+ function P({
141
+ onUpload: r,
142
+ ...i
143
+ }) {
144
+ return /* @__PURE__ */ l(
145
+ "button",
146
+ {
147
+ type: "button",
148
+ onClick: r,
149
+ "aria-label": "画像をアップロード",
150
+ className: "flex h-24 w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Secondary)] text-[var(--Text-Low-Emphasis)] transition-colors hover:border-[var(--Brand-Cake-Orange)] hover:text-[var(--Brand-Cake-Orange)] focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50 focus-visible:outline-none",
151
+ ...i,
152
+ children: [
153
+ /* @__PURE__ */ e(E, { size: 24 }),
154
+ /* @__PURE__ */ e("span", { className: "typo-body-sm", children: "画像を選択" })
155
+ ]
156
+ }
157
+ );
158
+ }
159
+ export {
160
+ P as OptionImageUpload,
161
+ $ as OptionQuantity,
162
+ F as OptionSelect,
163
+ L as OptionText,
164
+ j as ProductOption
165
+ };
@@ -0,0 +1,74 @@
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as n } from "../../lib/utils.js";
4
+ function g({
5
+ size: a = 14,
6
+ className: l
7
+ }) {
8
+ return /* @__PURE__ */ e(
9
+ "svg",
10
+ {
11
+ width: a,
12
+ height: a,
13
+ viewBox: "0 0 16 16",
14
+ fill: "currentColor",
15
+ className: l,
16
+ "aria-hidden": "true",
17
+ children: /* @__PURE__ */ e("path", { d: "M8 0C8.4 3.6 12.4 7.6 16 8C12.4 8.4 8.4 12.4 8 16C7.6 12.4 3.6 8.4 0 8C3.6 7.6 7.6 3.6 8 0Z" })
18
+ }
19
+ );
20
+ }
21
+ const x = {
22
+ sm: { iconSize: 12, valueCls: "typo-label-sm", countCls: "typo-body-xs" },
23
+ md: { iconSize: 14, valueCls: "typo-label-md", countCls: "typo-body-sm" },
24
+ lg: { iconSize: 18, valueCls: "typo-label-lg", countCls: "typo-body-md" }
25
+ };
26
+ function b({
27
+ className: a,
28
+ rating: l,
29
+ reviewCount: t,
30
+ size: i = "sm",
31
+ showCount: r = !0,
32
+ showValue: c = !0,
33
+ ...m
34
+ }) {
35
+ const s = Math.max(0, Math.min(5, l)), { iconSize: d, valueCls: p, countCls: u } = x[i];
36
+ return /* @__PURE__ */ o(
37
+ "div",
38
+ {
39
+ "data-slot": "rating-stars",
40
+ className: n("inline-flex items-center gap-0.5", a),
41
+ role: "img",
42
+ "aria-label": `評価 ${s.toFixed(1)} / 5${t != null ? ` (${t}件)` : ""}`,
43
+ ...m,
44
+ children: [
45
+ /* @__PURE__ */ e(
46
+ g,
47
+ {
48
+ size: d,
49
+ className: "text-[var(--Brand-Cake-Orange)]"
50
+ }
51
+ ),
52
+ c && /* @__PURE__ */ e(
53
+ "span",
54
+ {
55
+ className: n(
56
+ "text-[var(--Brand-Cake-Orange)]",
57
+ p
58
+ ),
59
+ children: s.toFixed(2)
60
+ }
61
+ ),
62
+ r && t != null && /* @__PURE__ */ o("span", { className: n("text-[var(--Text-Low-Emphasis)]", u), children: [
63
+ "(",
64
+ t.toLocaleString("ja-JP"),
65
+ ")"
66
+ ] })
67
+ ]
68
+ }
69
+ );
70
+ }
71
+ export {
72
+ b as RatingStars,
73
+ g as SparkleIcon
74
+ };
@@ -0,0 +1,126 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import T from "iconsax-reactjs/dist/esm/Like1.js";
4
+ import { cn as r } from "../../lib/utils.js";
5
+ import { SparkleIcon as z } from "./rating-stars.js";
6
+ function O({
7
+ className: f,
8
+ variant: m = "list",
9
+ rating: v,
10
+ date: h,
11
+ text: s,
12
+ imageUrl: d,
13
+ productName: l,
14
+ productImageUrl: o,
15
+ helpfulCount: i,
16
+ isLiked: t = !1,
17
+ onLikeClick: g,
18
+ onMoreClick: u,
19
+ maxLength: c = 80,
20
+ ...y
21
+ }) {
22
+ const n = m === "pc", p = m === "card", b = s.length > c ? s.slice(0, c) + "..." : s, N = s.length > c, w = n ? "size-64" : "size-20";
23
+ return /* @__PURE__ */ a(
24
+ "div",
25
+ {
26
+ "data-slot": "review-card",
27
+ className: r(
28
+ "flex flex-col rounded-lg border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)]",
29
+ n ? "w-full max-w-[680px] gap-4 p-6" : "min-w-[240px] w-full gap-2 p-4",
30
+ p && "items-center",
31
+ f
32
+ ),
33
+ ...y,
34
+ children: [
35
+ p && l && /* @__PURE__ */ a("div", { className: "flex w-full items-center gap-1.5 rounded bg-[var(--Surface-Secondary)] p-2", children: [
36
+ o && /* @__PURE__ */ e(
37
+ "img",
38
+ {
39
+ src: o,
40
+ alt: l,
41
+ className: "size-8 shrink-0 rounded object-cover"
42
+ }
43
+ ),
44
+ /* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-High-Emphasis)]", children: l })
45
+ ] }),
46
+ /* @__PURE__ */ a("div", { className: "flex w-full items-center justify-between", children: [
47
+ /* @__PURE__ */ e("div", { className: "flex items-start", children: Array.from({ length: 5 }).map((E, x) => /* @__PURE__ */ e(
48
+ z,
49
+ {
50
+ size: 20,
51
+ className: r(
52
+ x < v ? "text-[var(--Brand-Cake-Orange)]" : "text-[var(--Border-Low-Emphasis)]"
53
+ )
54
+ },
55
+ x
56
+ )) }),
57
+ /* @__PURE__ */ e("span", { className: "typo-body-md text-[var(--Text-High-Emphasis)]", children: h })
58
+ ] }),
59
+ /* @__PURE__ */ a(
60
+ "div",
61
+ {
62
+ className: r(
63
+ "flex w-full items-start",
64
+ n ? "gap-4" : "gap-2"
65
+ ),
66
+ children: [
67
+ /* @__PURE__ */ a("p", { className: "min-w-0 flex-1 typo-body-md text-[var(--Text-High-Emphasis)]", children: [
68
+ b,
69
+ N && /* @__PURE__ */ e(
70
+ "button",
71
+ {
72
+ type: "button",
73
+ className: "typo-label-md text-[var(--Text-Accent-Primary)]",
74
+ onClick: u,
75
+ children: "もっと見る"
76
+ }
77
+ )
78
+ ] }),
79
+ d && /* @__PURE__ */ e("div", { className: r("shrink-0 overflow-hidden rounded-lg", w), children: /* @__PURE__ */ e(
80
+ "img",
81
+ {
82
+ src: d,
83
+ alt: "レビュー画像",
84
+ className: "size-full object-cover"
85
+ }
86
+ ) })
87
+ ]
88
+ }
89
+ ),
90
+ i != null && /* @__PURE__ */ a(
91
+ "button",
92
+ {
93
+ type: "button",
94
+ className: "flex items-center gap-0.5 self-start rounded-lg px-4 py-3",
95
+ onClick: g,
96
+ children: [
97
+ /* @__PURE__ */ e(
98
+ T,
99
+ {
100
+ size: 16,
101
+ className: r(
102
+ t ? "fill-[var(--Brand-Cake-Orange)] text-[var(--Brand-Cake-Orange)]" : "text-[var(--Text-Medium-Emphasis)]"
103
+ ),
104
+ variant: t ? "Bold" : "Outline"
105
+ }
106
+ ),
107
+ /* @__PURE__ */ e(
108
+ "span",
109
+ {
110
+ className: r(
111
+ "typo-label-md",
112
+ t ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Text-Medium-Emphasis)]"
113
+ ),
114
+ children: t ? i.toString() : `参考になった ${i}`
115
+ }
116
+ )
117
+ ]
118
+ }
119
+ )
120
+ ]
121
+ }
122
+ );
123
+ }
124
+ export {
125
+ O as ReviewCard
126
+ };