@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,202 @@
1
+ import { jsxs as r, jsx as e, Fragment as N } from "react/jsx-runtime";
2
+ import * as d from "react";
3
+ import { cn as k } from "../../lib/utils.js";
4
+ import M from "iconsax-reactjs/dist/esm/Home2.js";
5
+ import z from "iconsax-reactjs/dist/esm/ShoppingCart.js";
6
+ import C from "iconsax-reactjs/dist/esm/Cake.js";
7
+ import A from "iconsax-reactjs/dist/esm/Shop.js";
8
+ import T from "iconsax-reactjs/dist/esm/Chart2.js";
9
+ import H from "iconsax-reactjs/dist/esm/Box.js";
10
+ import P from "iconsax-reactjs/dist/esm/Setting2.js";
11
+ import E from "iconsax-reactjs/dist/esm/InfoCircle.js";
12
+ import j from "iconsax-reactjs/dist/esm/Notification.js";
13
+ import w from "iconsax-reactjs/dist/esm/User.js";
14
+ import F from "iconsax-reactjs/dist/esm/ArrowRight2.js";
15
+ import I from "iconsax-reactjs/dist/esm/ArrowLeft.js";
16
+ import { AdminSideNav as O } from "../primitives/admin-side-nav.js";
17
+ import { AdminHeader as L } from "../primitives/admin-header.js";
18
+ import { Button as R } from "../foundations/button.js";
19
+ import { SkipLink as B } from "../foundations/skip-link.js";
20
+ function te({
21
+ name: i,
22
+ children: t,
23
+ className: l
24
+ }) {
25
+ return /* @__PURE__ */ r(
26
+ "div",
27
+ {
28
+ className: k(
29
+ "relative border-2 border-dashed border-red-500 rounded-lg",
30
+ l
31
+ ),
32
+ children: [
33
+ /* @__PURE__ */ r("span", { className: "absolute -top-3 left-2 bg-[var(--Primitive-Red-500)] text-[var(--Primitive-White-alpha-1000)] typo-label-xs px-1.5 py-0.5 rounded z-10", children: [
34
+ "DS未実装: ",
35
+ i
36
+ ] }),
37
+ t
38
+ ]
39
+ }
40
+ );
41
+ }
42
+ function a(i) {
43
+ return ({ active: t, placement: l }) => /* @__PURE__ */ e(
44
+ i,
45
+ {
46
+ size: l === "rail" ? 24 : 20,
47
+ variant: t ? "Bold" : "Outline"
48
+ }
49
+ );
50
+ }
51
+ const D = [
52
+ { key: "home", label: "ホーム", icon: a(M) },
53
+ {
54
+ key: "orders",
55
+ label: "注文管理",
56
+ icon: a(z),
57
+ subMenus: [
58
+ { label: "注文一覧", href: "#" },
59
+ { label: "注文CSV出力", href: "#" },
60
+ { label: "伝票番号一括登録", href: "#" },
61
+ { label: "納品書PDF出力", href: "#" },
62
+ { label: "受注分析", href: "#" }
63
+ ]
64
+ },
65
+ {
66
+ key: "items",
67
+ label: "商品管理",
68
+ icon: a(C),
69
+ subMenus: [
70
+ { label: "商品一覧", href: "#" },
71
+ { label: "商品登録", href: "#" },
72
+ { label: "カテゴリ管理", href: "#" },
73
+ { label: "商品グループ", href: "#" },
74
+ { label: "一括編集", href: "#" },
75
+ { label: "AI商品作成", href: "#" }
76
+ ]
77
+ },
78
+ {
79
+ key: "shop",
80
+ label: "ショップ管理",
81
+ icon: a(A),
82
+ subMenus: [
83
+ { label: "ショップ情報", href: "#" },
84
+ { label: "休業日設定", href: "#" },
85
+ { label: "配送設定", href: "#" },
86
+ { label: "送料設定", href: "#" },
87
+ { label: "クーポン管理", href: "#" },
88
+ { label: "レビュー管理", href: "#" },
89
+ { label: "ブランドデザイン", href: "#" }
90
+ ]
91
+ },
92
+ {
93
+ key: "sales",
94
+ label: "売上管理",
95
+ icon: a(T),
96
+ subMenus: [
97
+ { label: "売上詳細", href: "#" },
98
+ { label: "振込一覧", href: "#" },
99
+ { label: "KPI", href: "#" },
100
+ { label: "広告管理", href: "#" }
101
+ ]
102
+ },
103
+ { key: "services", label: "サービス", icon: a(H) },
104
+ {
105
+ key: "settings",
106
+ label: "設定",
107
+ icon: a(P),
108
+ subMenus: [
109
+ { label: "アカウント設定", href: "#" },
110
+ { label: "銀行口座", href: "#" },
111
+ { label: "クレジットカード", href: "#" },
112
+ { label: "プラン変更", href: "#" },
113
+ { label: "メールテンプレート", href: "#" }
114
+ ]
115
+ },
116
+ { key: "faq", label: "FAQ", icon: a(E) }
117
+ ];
118
+ function ne({
119
+ children: i,
120
+ activeNav: t = "home",
121
+ title: l = "",
122
+ breadcrumbs: n,
123
+ shopName: s = "Sample Shop",
124
+ brand: b,
125
+ sidebarHeader: p,
126
+ navItems: u = D,
127
+ headerActions: v,
128
+ onBack: m,
129
+ backLabel: x = "戻る",
130
+ mainId: f = "main-content",
131
+ skipLink: g
132
+ }) {
133
+ const [y, h] = d.useState(!1), S = /* @__PURE__ */ r(N, { children: [
134
+ /* @__PURE__ */ r("button", { className: "relative flex items-center justify-center size-10 shrink-0 rounded-lg hover:bg-[var(--Surface-Secondary)]", "aria-label": "通知", children: [
135
+ /* @__PURE__ */ e(j, { size: 20, className: "text-[var(--Text-High-Emphasis)]" }),
136
+ /* @__PURE__ */ e("span", { className: "absolute top-1.5 right-1.5 size-2 rounded-full bg-[var(--Surface-Caution)]" })
137
+ ] }),
138
+ /* @__PURE__ */ e("button", { className: "flex items-center justify-center size-10 shrink-0 rounded-full bg-[var(--Surface-Tertiary)]", "aria-label": "プロフィール", children: /* @__PURE__ */ e(w, { size: 20, className: "text-[var(--Text-Medium-Emphasis)]" }) })
139
+ ] });
140
+ return (
141
+ // 地が Surface-Secondary なので、配下 Card の既定サーフェスを白に切り替える文脈を宣言する
142
+ // (#150 の Section と同じ仕組み。dark は半透明白が重なって浮くため据え置き)。
143
+ /* @__PURE__ */ r(
144
+ "div",
145
+ {
146
+ className: "@container flex min-h-screen bg-[var(--Surface-Secondary)] [--card-surface:var(--Surface-Primary)] dark:[--card-surface:var(--Surface-Secondary)]",
147
+ "data-slot": "admin-shell",
148
+ children: [
149
+ g !== !1 && /* @__PURE__ */ e(B, { href: `#${f}` }),
150
+ /* @__PURE__ */ e(
151
+ O,
152
+ {
153
+ items: u,
154
+ activeKey: t,
155
+ drawerTitle: p ?? s,
156
+ open: y,
157
+ onOpenChange: h
158
+ }
159
+ ),
160
+ /* @__PURE__ */ r("div", { className: "@container/main flex flex-1 flex-col @md:pl-18", children: [
161
+ /* @__PURE__ */ e(
162
+ L,
163
+ {
164
+ brand: b ?? `${s}管理`,
165
+ onMenuClick: () => h(!0),
166
+ actions: v ?? S
167
+ }
168
+ ),
169
+ /* @__PURE__ */ r("main", { id: f, className: "mt-14 @md:mt-16 flex-1 p-4 @md:p-6", children: [
170
+ m && /* @__PURE__ */ r(
171
+ R,
172
+ {
173
+ variant: "ghost",
174
+ size: "sm",
175
+ className: "mb-2 gap-1",
176
+ onClick: m,
177
+ children: [
178
+ /* @__PURE__ */ e(I, { size: 16 }),
179
+ " ",
180
+ x
181
+ ]
182
+ }
183
+ ),
184
+ (n || l) && /* @__PURE__ */ r("div", { className: "mb-4 space-y-1", children: [
185
+ n && n.length > 0 && /* @__PURE__ */ e("nav", { className: "flex items-center gap-1 typo-body-sm text-[var(--Text-Low-Emphasis)]", "aria-label": "パンくず", children: n.map((o, c) => /* @__PURE__ */ r(d.Fragment, { children: [
186
+ c > 0 && /* @__PURE__ */ e(F, { size: 12 }),
187
+ o.href ? /* @__PURE__ */ e("a", { href: o.href, className: "hover:text-[var(--Text-Accent-Primary)] transition-colors", children: o.label }) : /* @__PURE__ */ e("span", { className: "text-[var(--Text-High-Emphasis)]", children: o.label })
188
+ ] }, c)) }),
189
+ l && /* @__PURE__ */ e("h1", { className: "typo-heading-2xl text-[var(--Text-High-Emphasis)]", children: l })
190
+ ] }),
191
+ i
192
+ ] })
193
+ ] })
194
+ ]
195
+ }
196
+ )
197
+ );
198
+ }
199
+ export {
200
+ ne as AdminShell,
201
+ te as MissingComponent
202
+ };
@@ -0,0 +1,63 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import h from "iconsax-reactjs/dist/esm/Calendar.js";
4
+ import { cn as u } from "../../lib/utils.js";
5
+ import { Button as i } from "../foundations/button.js";
6
+ function N({
7
+ name: n,
8
+ relation: d,
9
+ type: l,
10
+ date: c,
11
+ daysLeft: m,
12
+ memo: r,
13
+ editHref: s,
14
+ onEdit: t,
15
+ className: p,
16
+ ...o
17
+ }) {
18
+ const x = s ? /* @__PURE__ */ e(i, { variant: "tertiary", size: "xs", asChild: !0, children: /* @__PURE__ */ e("a", { href: s, children: "編集" }) }) : t ? /* @__PURE__ */ e(i, { variant: "tertiary", size: "xs", onClick: t, children: "編集" }) : null;
19
+ return /* @__PURE__ */ a(
20
+ "div",
21
+ {
22
+ "data-slot": "anniversary-card",
23
+ className: u(
24
+ "min-w-[200px] rounded-xl border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] p-4 space-y-2",
25
+ p
26
+ ),
27
+ ...o,
28
+ children: [
29
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-2", children: [
30
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
31
+ /* @__PURE__ */ e("p", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: n }),
32
+ /* @__PURE__ */ e("span", { className: "typo-label-xs text-[var(--Text-Medium-Emphasis)] bg-[var(--Surface-Secondary)] px-2 py-0.5 rounded-full", children: d })
33
+ ] }),
34
+ x
35
+ ] }),
36
+ /* @__PURE__ */ a("p", { className: "typo-body-sm text-[var(--Text-Medium-Emphasis)]", children: [
37
+ l,
38
+ " — ",
39
+ c
40
+ ] }),
41
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2 bg-[var(--Surface-Accent-Primary-Light)] rounded-lg px-3 py-2", children: [
42
+ /* @__PURE__ */ e(
43
+ h,
44
+ {
45
+ size: 16,
46
+ className: "text-[var(--Brand-Cake-Orange)]",
47
+ "aria-hidden": "true"
48
+ }
49
+ ),
50
+ /* @__PURE__ */ a("span", { className: "typo-label-md text-[var(--Brand-Cake-Orange)]", children: [
51
+ "あと",
52
+ m,
53
+ "日"
54
+ ] })
55
+ ] }),
56
+ r && /* @__PURE__ */ e("p", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: r })
57
+ ]
58
+ }
59
+ );
60
+ }
61
+ export {
62
+ N as AnniversaryCard
63
+ };
@@ -0,0 +1,38 @@
1
+ import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as q } from "../../lib/utils.js";
4
+ function d({
5
+ height: t = 24,
6
+ color: h,
7
+ className: o,
8
+ ...m
9
+ }) {
10
+ const c = Math.round(t * 5.2592592592592595);
11
+ return /* @__PURE__ */ r(
12
+ "svg",
13
+ {
14
+ "data-slot": "cake-logo",
15
+ xmlns: "http://www.w3.org/2000/svg",
16
+ viewBox: "0 0 568 108",
17
+ width: c,
18
+ height: t,
19
+ fill: h ?? "currentColor",
20
+ "aria-label": "Cake.jp",
21
+ role: "img",
22
+ className: q("shrink-0", o),
23
+ ...m,
24
+ children: [
25
+ /* @__PURE__ */ a("path", { d: "m79.09 78.16a31.92 31.92 0 0 1 -12.15 21.38q-10.38 8.26-25.27 8.26-19.12 0-30.06-11.8t-10.93-30.16q0-18 11.66-30.13t29-12.15q15.07 0 25.6 8.75a32.07 32.07 0 0 1 11.82 22.52h-16.68a19.2 19.2 0 0 0 -6.64-11.59q-5.52-4.77-14.44-4.77a21.38 21.38 0 0 0 -17.09 7.69q-6.57 7.7-6.56 19.68 0 12.31 6.23 19.85t17.9 7.53a21.15 21.15 0 0 0 13.39-4.22 20.8 20.8 0 0 0 7.37-10.85z" }),
26
+ /* @__PURE__ */ a("path", { d: "m159.22 25.18h16.2v81h-16.2v-10.69c-5.94 8.21-14.53 12.31-25.11 12.31a34 34 0 0 1 -26.4-11.74q-10.54-11.74-10.53-30.38 0-18.8 10.85-30.45a35.24 35.24 0 0 1 26.89-11.67q17.34 0 24.3 12.48zm-45.52 40.5q0 11.83 6.48 19.44a20.73 20.73 0 0 0 16.52 7.62 20.12 20.12 0 0 0 16.3-7.54q6.24-7.53 6.24-19.52t-6.24-19.52a20.11 20.11 0 0 0 -16.28-7.53 20.76 20.76 0 0 0 -16.6 7.53q-6.42 7.53-6.42 19.52z" }),
27
+ /* @__PURE__ */ a("path", { d: "m242.93 65.68c16.45-6 25.8-22.82 25.8-40.5h-16.2a32.43 32.43 0 0 1 -32.4 32.4v-32.4h-16.51v81h16.51v-32.4a32.44 32.44 0 0 1 32.4 32.4h16.2c0-17.68-9.35-34.55-25.8-40.5z" }),
28
+ /* @__PURE__ */ a("path", { d: "m325 23.56q17.32 0 28.18 11.67t9.4 34.5h-60.64q1 11.17 7.13 17.58t17.33 6.4a24.88 24.88 0 0 0 12.24-3 17.48 17.48 0 0 0 7.85-8.83h16a30.77 30.77 0 0 1 -13 19.12 40.64 40.64 0 0 1 -23.33 6.8q-18.63 0-29.48-11.58t-10.78-30.86q0-18.31 11.1-30t28-11.8zm-22.36 33.7h44.36a20.88 20.88 0 0 0 -6.16-14.34q-5.84-5.92-15.41-5.92a21.69 21.69 0 0 0 -15 5.42q-6.05 5.44-7.84 14.84z" }),
29
+ /* @__PURE__ */ a("path", { d: "m411.48 50.2a25 25 0 0 0 -25-25 25 25 0 0 0 25-25 25 25 0 0 0 25 25 25 25 0 0 0 -25 25z" }),
30
+ /* @__PURE__ */ a("path", { d: "m461.71 107.34c-8.15 0-14.56-2.36-19.06-7s-6.86-10.94-7-18.71v-.1h15.43v.09a13.45 13.45 0 0 0 2.92 8 9 9 0 0 0 7.25 3 9.25 9.25 0 0 0 7.32-3.14c1.82-2.08 2.74-5.23 2.74-9.34v-54.96h15.69v55.82c0 8.23-2.36 14.74-7 19.35s-10.83 6.99-18.29 6.99z" }),
31
+ /* @__PURE__ */ a("path", { d: "m508.48 106.18v-81h31.15c8.61 0 15.45 2.44 20.33 7.24s7.36 11.14 7.36 18.83c0 8.23-2.5 14.76-7.42 19.41s-11.89 7-20.73 7h-15.48v28.51zm29.52-42.68c4.34 0 7.69-1.09 10-3.26s3.43-5.19 3.43-9a11.44 11.44 0 0 0 -3.43-8.57c-2.28-2.21-5.48-3.32-9.51-3.32h-14.8v24.15z" })
32
+ ]
33
+ }
34
+ );
35
+ }
36
+ export {
37
+ d as CakeLogo
38
+ };
@@ -0,0 +1,91 @@
1
+ import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as c } from "../../lib/utils.js";
4
+ import { Switch as d } from "../foundations/switch.js";
5
+ const h = [
6
+ { value: "daily", label: "日別" },
7
+ { value: "weekly", label: "週別" },
8
+ { value: "monthly", label: "月別" }
9
+ ], u = [
10
+ { value: "3M", label: "3M" },
11
+ { value: "6M", label: "6M" },
12
+ { value: "12M", label: "12M" },
13
+ { value: "all", label: "全期間" }
14
+ ];
15
+ function n({
16
+ active: t,
17
+ onClick: s,
18
+ children: r
19
+ }) {
20
+ return /* @__PURE__ */ a(
21
+ "button",
22
+ {
23
+ type: "button",
24
+ onClick: s,
25
+ className: c(
26
+ "px-3 py-1 rounded typo-label-sm transition-colors",
27
+ t ? "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]"
28
+ ),
29
+ children: r
30
+ }
31
+ );
32
+ }
33
+ function g({
34
+ granularity: t = "daily",
35
+ onGranularityChange: s,
36
+ period: r = "3M",
37
+ onPeriodChange: i,
38
+ showPrevious: m = !1,
39
+ onShowPreviousChange: o,
40
+ className: v
41
+ }) {
42
+ return /* @__PURE__ */ l(
43
+ "div",
44
+ {
45
+ "data-slot": "chart-controls",
46
+ className: c(
47
+ "flex flex-wrap items-center gap-x-4 gap-y-2",
48
+ v
49
+ ),
50
+ children: [
51
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
52
+ /* @__PURE__ */ a("span", { className: "typo-label-sm text-[var(--Text-Low-Emphasis)]", children: "粒度" }),
53
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-0.5", children: h.map((e) => /* @__PURE__ */ a(
54
+ n,
55
+ {
56
+ active: t === e.value,
57
+ onClick: () => s?.(e.value),
58
+ children: e.label
59
+ },
60
+ e.value
61
+ )) })
62
+ ] }),
63
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
64
+ /* @__PURE__ */ a("span", { className: "typo-label-sm text-[var(--Text-Low-Emphasis)]", children: "期間" }),
65
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-0.5", children: u.map((e) => /* @__PURE__ */ a(
66
+ n,
67
+ {
68
+ active: r === e.value,
69
+ onClick: () => i?.(e.value),
70
+ children: e.label
71
+ },
72
+ e.value
73
+ )) })
74
+ ] }),
75
+ /* @__PURE__ */ l("label", { className: "flex items-center gap-2 cursor-pointer select-none ml-auto", children: [
76
+ /* @__PURE__ */ a(
77
+ d,
78
+ {
79
+ checked: m,
80
+ onCheckedChange: o
81
+ }
82
+ ),
83
+ /* @__PURE__ */ a("span", { className: "typo-label-sm text-[var(--Text-Medium-Emphasis)]", children: "前期比を重ねる" })
84
+ ] })
85
+ ]
86
+ }
87
+ );
88
+ }
89
+ export {
90
+ g as ChartControls
91
+ };
@@ -0,0 +1,50 @@
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as c } from "../../lib/utils.js";
4
+ function b({
5
+ variant: t = "active",
6
+ remainingSeconds: a = 0,
7
+ label: o,
8
+ className: s,
9
+ ...i
10
+ }) {
11
+ const d = Math.floor(a / 3600), m = Math.floor(a % 3600 / 60), p = a % 60, r = (h) => String(h).padStart(2, "0"), u = o ?? (t === "before" ? "開始まで" : t === "active" ? "終了まで" : "");
12
+ return t === "ended" ? /* @__PURE__ */ e(
13
+ "div",
14
+ {
15
+ "data-slot": "countdown-timer",
16
+ className: c(
17
+ "flex items-center justify-center rounded-lg bg-[var(--Surface-Secondary)] px-4 py-3 typo-label-md text-[var(--Text-Medium-Emphasis)]",
18
+ s
19
+ ),
20
+ ...i,
21
+ children: "次回の開催をお待ち下さい"
22
+ }
23
+ ) : /* @__PURE__ */ n(
24
+ "div",
25
+ {
26
+ "data-slot": "countdown-timer",
27
+ className: c(
28
+ "flex items-center justify-center gap-2 rounded-lg bg-[var(--Surface-Secondary)] px-4 py-3",
29
+ s
30
+ ),
31
+ ...i,
32
+ children: [
33
+ /* @__PURE__ */ e("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: u }),
34
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-0.5", children: [
35
+ /* @__PURE__ */ e(l, { value: r(d) }),
36
+ /* @__PURE__ */ e("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: ":" }),
37
+ /* @__PURE__ */ e(l, { value: r(m) }),
38
+ /* @__PURE__ */ e("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: ":" }),
39
+ /* @__PURE__ */ e(l, { value: r(p) })
40
+ ] })
41
+ ]
42
+ }
43
+ );
44
+ }
45
+ function l({ value: t }) {
46
+ return /* @__PURE__ */ e("span", { className: "flex h-7 min-w-7 items-center justify-center rounded bg-[var(--Primitive-Gray-900)] px-1 typo-label-md tabular-nums text-[var(--Primitive-White-alpha-1000)]", children: t });
47
+ }
48
+ export {
49
+ b as CountdownTimer
50
+ };
@@ -0,0 +1,136 @@
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import "react";
3
+ import y from "iconsax-reactjs/dist/esm/Ticket2.js";
4
+ import { Loader2 as g, Check as N } from "lucide-react";
5
+ import { cn as d } from "../../lib/utils.js";
6
+ function P({
7
+ title: r,
8
+ description: t,
9
+ imageUrl: l,
10
+ imageAlt: o,
11
+ shopThumbnailUrl: s,
12
+ shopName: a,
13
+ status: c = "available",
14
+ onAcquire: n,
15
+ acquireLabel: u = "クーポンを獲得する",
16
+ layout: p = "vertical",
17
+ limitLabel: f,
18
+ conditionText: b,
19
+ expiryText: x,
20
+ className: m,
21
+ ...v
22
+ }) {
23
+ return p === "horizontal" ? /* @__PURE__ */ e(
24
+ w,
25
+ {
26
+ title: r,
27
+ limitLabel: f,
28
+ conditionText: b,
29
+ expiryText: x,
30
+ status: c,
31
+ onAcquire: n,
32
+ className: m,
33
+ ...v
34
+ }
35
+ ) : /* @__PURE__ */ i(
36
+ "div",
37
+ {
38
+ "data-slot": "coupon-card",
39
+ className: d(
40
+ "min-w-[200px] overflow-hidden rounded-xl border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)]",
41
+ c === "unavailable" && "opacity-50",
42
+ m
43
+ ),
44
+ ...v,
45
+ children: [
46
+ l && /* @__PURE__ */ i("div", { className: "relative aspect-[5/2] w-full overflow-hidden bg-[var(--Surface-Secondary)]", children: [
47
+ /* @__PURE__ */ e(
48
+ "img",
49
+ {
50
+ src: l,
51
+ alt: o ?? r,
52
+ className: "h-full w-full object-cover",
53
+ loading: "lazy"
54
+ }
55
+ ),
56
+ s && /* @__PURE__ */ e("div", { className: "absolute bottom-2 left-2 z-[var(--Z-Local-2)] size-10 overflow-hidden rounded-full border-2 border-[var(--Surface-Primary)] bg-[var(--Surface-Primary)] shadow-sm", children: /* @__PURE__ */ e(
57
+ "img",
58
+ {
59
+ src: s,
60
+ alt: a ?? "ショップ",
61
+ className: "h-full w-full object-cover",
62
+ loading: "lazy"
63
+ }
64
+ ) })
65
+ ] }),
66
+ /* @__PURE__ */ i("div", { className: "px-4 pb-1 pt-3", children: [
67
+ /* @__PURE__ */ e("h3", { className: "break-words typo-heading-md text-[var(--Text-High-Emphasis)]", children: r }),
68
+ t && /* @__PURE__ */ e("p", { className: "mt-1 break-words typo-body-md text-[var(--Text-Medium-Emphasis)]", children: t })
69
+ ] }),
70
+ /* @__PURE__ */ e("div", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "border-t border-dashed border-[var(--Border-Medium-Emphasis)]" }) }),
71
+ /* @__PURE__ */ e("div", { className: "px-4 pb-4", children: /* @__PURE__ */ e(h, { status: c, onAcquire: n, label: u, size: "lg" }) })
72
+ ]
73
+ }
74
+ );
75
+ }
76
+ function w({
77
+ title: r,
78
+ limitLabel: t,
79
+ conditionText: l,
80
+ expiryText: o,
81
+ status: s = "available",
82
+ onAcquire: a,
83
+ className: c,
84
+ ...n
85
+ }) {
86
+ return /* @__PURE__ */ i(
87
+ "div",
88
+ {
89
+ "data-slot": "coupon-card",
90
+ "data-layout": "horizontal",
91
+ className: d("flex items-stretch min-w-0 overflow-hidden", c),
92
+ ...n,
93
+ children: [
94
+ /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 flex-col items-start justify-center gap-1 rounded-l-lg border-b border-l border-t border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] px-3 py-2", children: [
95
+ t && /* @__PURE__ */ e("span", { className: "shrink-0 rounded-full bg-[var(--Surface-Accent-Primary-Light)] px-2 py-0.5 typo-body-sm text-[var(--Text-Accent-Primary)]", children: t }),
96
+ /* @__PURE__ */ e("h3", { className: "typo-heading-lg text-[var(--Text-Accent-Primary)]", children: r }),
97
+ /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-col gap-0.5 self-stretch typo-body-sm", children: [
98
+ l && /* @__PURE__ */ e("p", { className: "truncate text-[var(--Text-Accent-Primary)]", children: l }),
99
+ o && /* @__PURE__ */ e("p", { className: "truncate text-[var(--Text-High-Emphasis)]", children: o })
100
+ ] })
101
+ ] }),
102
+ /* @__PURE__ */ e("div", { className: "flex items-stretch justify-center", children: /* @__PURE__ */ e("svg", { width: "2", height: "100%", preserveAspectRatio: "none", className: "text-[var(--Border-Medium-Emphasis)]", children: /* @__PURE__ */ e("line", { x1: "1", y1: "0", x2: "1", y2: "100%", stroke: "currentColor", strokeWidth: "2", strokeDasharray: "4 3" }) }) }),
103
+ /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-center rounded-r-lg border-b border-r border-t border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] px-3", children: /* @__PURE__ */ e(h, { status: s, onAcquire: a, label: "獲得する", size: "sm" }) })
104
+ ]
105
+ }
106
+ );
107
+ }
108
+ function h({
109
+ status: r,
110
+ onAcquire: t,
111
+ label: l,
112
+ size: o = "lg"
113
+ }) {
114
+ const s = o === "sm", a = s ? "flex h-9 items-center justify-center gap-0.5 rounded-lg px-4 typo-label-md" : "flex h-12 w-full items-center justify-center rounded-xl typo-label-lg";
115
+ return r === "available" ? /* @__PURE__ */ i(
116
+ "button",
117
+ {
118
+ type: "button",
119
+ onClick: t,
120
+ className: d(
121
+ a,
122
+ "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)] transition-colors hover:bg-[var(--Hover-Primary-Button)] active:scale-[0.98]"
123
+ ),
124
+ children: [
125
+ s && /* @__PURE__ */ e(y, { size: 16 }),
126
+ l
127
+ ]
128
+ }
129
+ ) : r === "acquiring" ? /* @__PURE__ */ e("div", { className: d(a, "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]"), children: /* @__PURE__ */ e(g, { className: "size-5 animate-spin" }) }) : r === "acquired" ? /* @__PURE__ */ i("div", { className: d(a, "bg-[var(--Surface-Secondary)] text-[var(--Text-Medium-Emphasis)] animate-in fade-in duration-[var(--Motion-Duration-Slow)] gap-1.5"), children: [
130
+ /* @__PURE__ */ e(N, { className: "size-4" }),
131
+ "獲得済み"
132
+ ] }) : /* @__PURE__ */ e("div", { className: d(a, "bg-[var(--Surface-Secondary)] text-[var(--Text-Low-Emphasis)]"), children: "獲得不可" });
133
+ }
134
+ export {
135
+ P as CouponCard
136
+ };