@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,115 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as o } from "../../lib/utils.js";
4
+ function s({ className: t, ...e }) {
5
+ return /* @__PURE__ */ a(
6
+ "div",
7
+ {
8
+ "data-slot": "table-container",
9
+ className: "relative w-full overflow-x-auto",
10
+ children: /* @__PURE__ */ a(
11
+ "table",
12
+ {
13
+ "data-slot": "table",
14
+ className: o("w-full caption-bottom typo-body-md", t),
15
+ ...e
16
+ }
17
+ )
18
+ }
19
+ );
20
+ }
21
+ function b({ className: t, ...e }) {
22
+ return /* @__PURE__ */ a(
23
+ "thead",
24
+ {
25
+ "data-slot": "table-header",
26
+ className: o("[&_tr]:border-b [&_tr]:border-[var(--Border-Medium-Emphasis)]", t),
27
+ ...e
28
+ }
29
+ );
30
+ }
31
+ function n({ className: t, ...e }) {
32
+ return /* @__PURE__ */ a(
33
+ "tbody",
34
+ {
35
+ "data-slot": "table-body",
36
+ className: o("[&_tr:last-child]:border-0", t),
37
+ ...e
38
+ }
39
+ );
40
+ }
41
+ function c({ className: t, ...e }) {
42
+ return /* @__PURE__ */ a(
43
+ "tfoot",
44
+ {
45
+ "data-slot": "table-footer",
46
+ className: o(
47
+ "border-t border-[var(--Border-Medium-Emphasis)] bg-muted/50 typo-label-sm [&>tr]:last:border-b-0",
48
+ t
49
+ ),
50
+ ...e
51
+ }
52
+ );
53
+ }
54
+ function i({ className: t, ...e }) {
55
+ return /* @__PURE__ */ a(
56
+ "tr",
57
+ {
58
+ "data-slot": "table-row",
59
+ className: o(
60
+ "border-b border-[var(--Border-Medium-Emphasis)] transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
61
+ t
62
+ ),
63
+ ...e
64
+ }
65
+ );
66
+ }
67
+ function m({ className: t, ...e }) {
68
+ return /* @__PURE__ */ a(
69
+ "th",
70
+ {
71
+ "data-slot": "table-head",
72
+ className: o(
73
+ "h-10 px-2 text-left align-middle typo-label-sm whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
74
+ t
75
+ ),
76
+ ...e
77
+ }
78
+ );
79
+ }
80
+ function u({ className: t, ...e }) {
81
+ return /* @__PURE__ */ a(
82
+ "td",
83
+ {
84
+ "data-slot": "table-cell",
85
+ className: o(
86
+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
87
+ t
88
+ ),
89
+ ...e
90
+ }
91
+ );
92
+ }
93
+ function p({
94
+ className: t,
95
+ ...e
96
+ }) {
97
+ return /* @__PURE__ */ a(
98
+ "caption",
99
+ {
100
+ "data-slot": "table-caption",
101
+ className: o("mt-4 typo-body-md text-muted-foreground", t),
102
+ ...e
103
+ }
104
+ );
105
+ }
106
+ export {
107
+ s as Table,
108
+ n as TableBody,
109
+ p as TableCaption,
110
+ u as TableCell,
111
+ c as TableFooter,
112
+ m as TableHead,
113
+ b as TableHeader,
114
+ i as TableRow
115
+ };
@@ -0,0 +1,102 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cva as o } from "class-variance-authority";
4
+ import { Tabs as e } from "radix-ui";
5
+ import { cn as i } from "../../lib/utils.js";
6
+ function c({
7
+ className: t,
8
+ ...a
9
+ }) {
10
+ return /* @__PURE__ */ r(
11
+ e.Root,
12
+ {
13
+ "data-slot": "tabs",
14
+ className: i("flex flex-col", t),
15
+ ...a
16
+ }
17
+ );
18
+ }
19
+ const n = o(
20
+ "group/tabs-list inline-flex items-center",
21
+ {
22
+ variants: {
23
+ variant: {
24
+ underbar: "w-full bg-transparent overflow-x-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",
25
+ segment: "w-fit rounded-full bg-[var(--Surface-Tertiary)] p-2"
26
+ },
27
+ scrollable: {
28
+ true: "gap-4"
29
+ }
30
+ },
31
+ defaultVariants: {
32
+ variant: "underbar",
33
+ scrollable: !1
34
+ }
35
+ }
36
+ );
37
+ function v({
38
+ className: t,
39
+ variant: a = "underbar",
40
+ scrollable: s = !1,
41
+ ...l
42
+ }) {
43
+ return /* @__PURE__ */ r(
44
+ e.List,
45
+ {
46
+ "data-slot": "tabs-list",
47
+ "data-variant": a,
48
+ "data-scrollable": s || void 0,
49
+ className: i(n({ variant: a, scrollable: s }), t),
50
+ ...l
51
+ }
52
+ );
53
+ }
54
+ function m({
55
+ className: t,
56
+ children: a,
57
+ ...s
58
+ }) {
59
+ return /* @__PURE__ */ r(
60
+ e.Trigger,
61
+ {
62
+ "data-slot": "tabs-trigger",
63
+ className: i(
64
+ // Base
65
+ "group/trigger relative inline-flex items-center justify-center whitespace-nowrap transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
66
+ // Underbar variant (default: equal-width tabs with full-width underline)
67
+ "group-data-[variant=underbar]/tabs-list:h-12 group-data-[variant=underbar]/tabs-list:flex-1 group-data-[variant=underbar]/tabs-list:border-b-2 group-data-[variant=underbar]/tabs-list:border-transparent group-data-[variant=underbar]/tabs-list:typo-label-md group-data-[variant=underbar]/tabs-list:text-[var(--Text-Low-Emphasis)]",
68
+ // Underbar active
69
+ "group-data-[variant=underbar]/tabs-list:data-[state=active]:border-[var(--Text-High-Emphasis)] group-data-[variant=underbar]/tabs-list:data-[state=active]:text-[var(--Text-High-Emphasis)]",
70
+ // Scrollable underbar: shrink to text width, bold text, remove trigger border (underline moves to inner span)
71
+ "group-data-[scrollable]/tabs-list:!flex-initial group-data-[scrollable]/tabs-list:!shrink-0 group-data-[scrollable]/tabs-list:!border-b-0 group-data-[scrollable]/tabs-list:data-[state=active]:!border-b-0 group-data-[scrollable]/tabs-list:typo-label-md",
72
+ // Segment variant
73
+ "group-data-[variant=segment]/tabs-list:h-[37px] group-data-[variant=segment]/tabs-list:min-w-[100px] group-data-[variant=segment]/tabs-list:rounded-full group-data-[variant=segment]/tabs-list:px-3 group-data-[variant=segment]/tabs-list:typo-body-md group-data-[variant=segment]/tabs-list:text-[var(--Text-High-Emphasis)]",
74
+ // Segment active
75
+ "group-data-[variant=segment]/tabs-list:data-[state=active]:bg-[var(--Surface-Primary)] group-data-[variant=segment]/tabs-list:data-[state=active]:shadow-[0px_4px_6px_-4px_rgba(24,39,75,0.12),0px_8px_8px_-4px_rgba(24,39,75,0.08)]",
76
+ t
77
+ ),
78
+ ...s,
79
+ children: /* @__PURE__ */ r("span", { className: "group-data-[scrollable]/tabs-list:inline-block group-data-[scrollable]/tabs-list:border-b-2 group-data-[scrollable]/tabs-list:border-transparent group-data-[scrollable]/tabs-list:pb-px group-data-[state=active]/trigger:border-[var(--Text-High-Emphasis)]", children: a })
80
+ }
81
+ );
82
+ }
83
+ function f({
84
+ className: t,
85
+ ...a
86
+ }) {
87
+ return /* @__PURE__ */ r(
88
+ e.Content,
89
+ {
90
+ "data-slot": "tabs-content",
91
+ className: i("flex-1 outline-none", t),
92
+ ...a
93
+ }
94
+ );
95
+ }
96
+ export {
97
+ c as Tabs,
98
+ f as TabsContent,
99
+ v as TabsList,
100
+ m as TabsTrigger,
101
+ n as tabsListVariants
102
+ };
@@ -0,0 +1,65 @@
1
+ import { jsx as n, jsxs as s } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as c } from "../../lib/utils.js";
4
+ import { useValueLength as h } from "../../lib/use-value-length.js";
5
+ import { FOCUS_RING as g } from "../../lib/focus-ring.js";
6
+ import { resolveNativeFieldAria as y, useFieldLabelling as w } from "../../lib/field-labelling.js";
7
+ function D({
8
+ className: m,
9
+ showCount: r,
10
+ maxLength: e,
11
+ value: a,
12
+ defaultValue: t,
13
+ onChange: o,
14
+ ref: b,
15
+ ...i
16
+ }) {
17
+ const u = y(i, w()), { ref: f, length: d, syncFromDom: p } = h({
18
+ enabled: r === !0,
19
+ value: a,
20
+ defaultValue: t,
21
+ forwardedRef: b
22
+ }), l = /* @__PURE__ */ n(
23
+ "textarea",
24
+ {
25
+ "data-slot": "textarea",
26
+ ref: f,
27
+ value: a,
28
+ defaultValue: t,
29
+ maxLength: e,
30
+ onChange: r ? (v) => {
31
+ p(), o?.(v);
32
+ } : o,
33
+ className: c(
34
+ "flex field-sizing-content min-h-16 w-full rounded-lg border border-[var(--Border-High-Emphasis)] bg-transparent px-3 py-2 typo-body-lg md:typo-body-md transition-[color,box-shadow,border-color] outline-none placeholder:text-muted-foreground hover:border-[var(--Focus-High-Emphasis)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-[var(--Border-Low-Emphasis)] disabled:bg-[var(--Surface-Secondary)] disabled:text-[var(--Text-Disable)] disabled:placeholder:text-[var(--Text-Disable)] aria-invalid:border-[var(--Border-Caution)] aria-invalid:ring-[var(--Border-Caution)]/20",
35
+ // フォーカス意匠は DS 共通(FOCUS_RING)。
36
+ g,
37
+ m
38
+ ),
39
+ ...i,
40
+ ...u
41
+ }
42
+ );
43
+ if (!r) return l;
44
+ const x = e != null && d >= e;
45
+ return /* @__PURE__ */ s("div", { "data-slot": "textarea-with-count", className: "w-full", children: [
46
+ l,
47
+ /* @__PURE__ */ n("div", { className: "mt-1 flex justify-end", children: /* @__PURE__ */ s(
48
+ "span",
49
+ {
50
+ "data-slot": "textarea-count",
51
+ className: c(
52
+ "typo-body-xs",
53
+ x ? "text-[var(--Text-Caution)]" : "text-[var(--Text-Low-Emphasis)]"
54
+ ),
55
+ children: [
56
+ d,
57
+ e != null ? `/${e}` : ""
58
+ ]
59
+ }
60
+ ) })
61
+ ] });
62
+ }
63
+ export {
64
+ D as Textarea
65
+ };
@@ -0,0 +1,107 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { cva as l } from "class-variance-authority";
4
+ import { ToggleGroup as d } from "radix-ui";
5
+ import { cn as g } from "../../lib/utils.js";
6
+ const p = l(
7
+ "flex items-center gap-1.5 py-1.5 overflow-x-auto scrollbar-none",
8
+ {
9
+ variants: {
10
+ /** グループ全体の幅 */
11
+ width: {
12
+ fit: "w-fit",
13
+ full: "w-full"
14
+ }
15
+ },
16
+ defaultVariants: {
17
+ width: "fit"
18
+ }
19
+ }
20
+ ), c = l(
21
+ [
22
+ "inline-flex shrink-0 items-center justify-center",
23
+ "h-9 rounded-full px-3",
24
+ "typo-label-md whitespace-nowrap",
25
+ "outline-none transition-colors",
26
+ "focus-visible:ring-2 focus-visible:ring-ring/50",
27
+ "disabled:pointer-events-none disabled:opacity-50",
28
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
29
+ ].join(" "),
30
+ {
31
+ variants: {
32
+ variant: {
33
+ default: [
34
+ "bg-[var(--Surface-Tertiary)] text-[var(--Text-Medium-Emphasis)]",
35
+ "hover:bg-[var(--Surface-Tertiary)]/80",
36
+ "data-[state=on]:bg-[var(--Surface-Accent-Primary-Light)] data-[state=on]:text-[var(--Brand-Cake-Orange)] data-[state=on]:font-bold",
37
+ "dark:bg-[var(--Surface-Secondary)] dark:text-[var(--Text-Low-Emphasis)]",
38
+ "dark:data-[state=on]:bg-[var(--Surface-Accent-Primary-Light)] dark:data-[state=on]:text-[var(--Text-Accent-Primary)]"
39
+ ].join(" "),
40
+ outline: [
41
+ "border border-[var(--Border-Low-Emphasis)] bg-transparent text-[var(--Text-Low-Emphasis)]",
42
+ "hover:bg-[var(--Surface-Tertiary)]",
43
+ "data-[state=on]:border-[var(--Text-High-Emphasis)] data-[state=on]:bg-transparent data-[state=on]:text-[var(--Text-High-Emphasis)]"
44
+ ].join(" ")
45
+ },
46
+ size: {
47
+ default: "h-9 px-3 typo-label-md",
48
+ sm: "h-8 px-2.5 typo-label-sm",
49
+ lg: "h-10 px-4 typo-label-md"
50
+ }
51
+ },
52
+ defaultVariants: {
53
+ variant: "default",
54
+ size: "default"
55
+ }
56
+ }
57
+ ), u = s.createContext({
58
+ variant: "default",
59
+ size: "default"
60
+ });
61
+ function h({
62
+ className: a,
63
+ variant: e,
64
+ size: r,
65
+ width: o,
66
+ children: n,
67
+ ...t
68
+ }) {
69
+ return /* @__PURE__ */ i(
70
+ d.Root,
71
+ {
72
+ "data-slot": "toggle-group",
73
+ className: g(p({ width: o }), a),
74
+ ...t,
75
+ children: /* @__PURE__ */ i(u.Provider, { value: { variant: e, size: r }, children: n })
76
+ }
77
+ );
78
+ }
79
+ function b({
80
+ className: a,
81
+ children: e,
82
+ variant: r,
83
+ size: o,
84
+ ...n
85
+ }) {
86
+ const t = s.useContext(u);
87
+ return /* @__PURE__ */ i(
88
+ d.Item,
89
+ {
90
+ "data-slot": "toggle-group-item",
91
+ className: g(
92
+ c({
93
+ variant: t.variant || r,
94
+ size: t.size || o
95
+ }),
96
+ a
97
+ ),
98
+ ...n,
99
+ children: e
100
+ }
101
+ );
102
+ }
103
+ export {
104
+ h as ToggleGroup,
105
+ b as ToggleGroupItem,
106
+ c as toggleGroupItemVariants
107
+ };
@@ -0,0 +1,44 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cva as o } from "class-variance-authority";
4
+ import { Toggle as a } from "radix-ui";
5
+ import { cn as s } from "../../lib/utils.js";
6
+ const d = o(
7
+ "inline-flex items-center justify-center gap-2 rounded-md typo-label-sm whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-transparent",
12
+ outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"
13
+ },
14
+ size: {
15
+ default: "h-9 min-w-9 px-2",
16
+ sm: "h-8 min-w-8 px-1.5",
17
+ lg: "h-10 min-w-10 px-2.5"
18
+ }
19
+ },
20
+ defaultVariants: {
21
+ variant: "default",
22
+ size: "default"
23
+ }
24
+ }
25
+ );
26
+ function p({
27
+ className: e,
28
+ variant: t,
29
+ size: r,
30
+ ...i
31
+ }) {
32
+ return /* @__PURE__ */ n(
33
+ a.Root,
34
+ {
35
+ "data-slot": "toggle",
36
+ className: s(d({ variant: t, size: r, className: e })),
37
+ ...i
38
+ }
39
+ );
40
+ }
41
+ export {
42
+ p as Toggle,
43
+ d as toggleVariants
44
+ };
@@ -0,0 +1,56 @@
1
+ import { jsx as r, jsxs as n } from "react/jsx-runtime";
2
+ import "react";
3
+ import { Tooltip as o } from "radix-ui";
4
+ import { cn as d } from "../../lib/utils.js";
5
+ function f({
6
+ delayDuration: t = 0,
7
+ ...i
8
+ }) {
9
+ return /* @__PURE__ */ r(
10
+ o.Provider,
11
+ {
12
+ "data-slot": "tooltip-provider",
13
+ delayDuration: t,
14
+ ...i
15
+ }
16
+ );
17
+ }
18
+ function c({
19
+ ...t
20
+ }) {
21
+ return /* @__PURE__ */ r(o.Root, { "data-slot": "tooltip", ...t });
22
+ }
23
+ function u({
24
+ ...t
25
+ }) {
26
+ return /* @__PURE__ */ r(o.Trigger, { "data-slot": "tooltip-trigger", ...t });
27
+ }
28
+ function g({
29
+ className: t,
30
+ sideOffset: i = 6,
31
+ children: e,
32
+ ...a
33
+ }) {
34
+ return /* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ n(
35
+ o.Content,
36
+ {
37
+ "data-slot": "tooltip-content",
38
+ sideOffset: i,
39
+ className: d(
40
+ "z-[var(--Z-Tooltip)] w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 typo-body-sm text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
41
+ t
42
+ ),
43
+ ...a,
44
+ children: [
45
+ e,
46
+ /* @__PURE__ */ r(o.Arrow, { className: "z-[var(--Z-Tooltip)] size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-xs bg-foreground fill-foreground" })
47
+ ]
48
+ }
49
+ ) });
50
+ }
51
+ export {
52
+ c as Tooltip,
53
+ g as TooltipContent,
54
+ f as TooltipProvider,
55
+ u as TooltipTrigger
56
+ };
@@ -0,0 +1,31 @@
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import s from "iconsax-reactjs/dist/esm/HamburgerMenu.js";
4
+ function l({ brand: r, onMenuClick: a, actions: t }) {
5
+ return /* @__PURE__ */ i(
6
+ "header",
7
+ {
8
+ "data-slot": "admin-header",
9
+ className: "fixed top-0 left-0 right-0 z-[var(--Z-Nav)] flex h-14 @md:h-16 items-center justify-between bg-[var(--Surface-Primary)] border-b border-[var(--Border-Low-Emphasis)] px-4 @md:px-6",
10
+ children: [
11
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2 @md:gap-3", children: [
12
+ a && /* @__PURE__ */ e(
13
+ "button",
14
+ {
15
+ type: "button",
16
+ className: "flex items-center justify-center size-10 shrink-0 rounded-lg hover:bg-[var(--Surface-Secondary)] @md:hidden",
17
+ "aria-label": "メニュー",
18
+ onClick: a,
19
+ children: /* @__PURE__ */ e(s, { size: 20, className: "text-[var(--Text-High-Emphasis)]" })
20
+ }
21
+ ),
22
+ typeof r == "string" ? /* @__PURE__ */ e("p", { className: "typo-heading-md @md:typo-heading-lg text-[var(--Text-High-Emphasis)] truncate", children: r }) : r
23
+ ] }),
24
+ t && /* @__PURE__ */ e("div", { className: "flex items-center gap-1 @md:gap-2", children: t })
25
+ ]
26
+ }
27
+ );
28
+ }
29
+ export {
30
+ l as AdminHeader
31
+ };
@@ -0,0 +1,135 @@
1
+ import { jsxs as s, Fragment as c, jsx as r } from "react/jsx-runtime";
2
+ import * as b from "react";
3
+ import y from "iconsax-reactjs/dist/esm/ArrowDown2.js";
4
+ import { XIcon as g } from "lucide-react";
5
+ import { cn as m } from "../../lib/utils.js";
6
+ function v(n, o) {
7
+ return typeof n == "function" ? n(o) : n;
8
+ }
9
+ function M({
10
+ items: n,
11
+ activeKey: o,
12
+ drawerTitle: p,
13
+ open: f = !1,
14
+ onOpenChange: h,
15
+ ariaLabel: d = "管理メニュー"
16
+ }) {
17
+ const [x, u] = b.useState(null);
18
+ return /* @__PURE__ */ s(c, { children: [
19
+ /* @__PURE__ */ r(
20
+ "nav",
21
+ {
22
+ "data-slot": "admin-side-nav",
23
+ "aria-label": d,
24
+ className: "hidden @md:flex fixed left-0 top-16 bottom-0 z-[var(--Z-Sticky)] w-[72px] flex-col items-center bg-[var(--Surface-Primary)] border-r border-[var(--Border-Low-Emphasis)]",
25
+ children: n.map((e) => {
26
+ const t = o === e.key, l = !!e.subMenus && e.subMenus.length > 0;
27
+ return /* @__PURE__ */ s(
28
+ "div",
29
+ {
30
+ className: "relative",
31
+ onMouseEnter: () => u(l ? e.key : null),
32
+ onMouseLeave: () => u(null),
33
+ children: [
34
+ (() => {
35
+ const a = m(
36
+ "flex h-16 w-16 flex-col items-center justify-center gap-1 transition-colors",
37
+ t ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]"
38
+ ), i = /* @__PURE__ */ s(c, { children: [
39
+ v(e.icon, { active: t, placement: "rail" }),
40
+ /* @__PURE__ */ r("span", { className: "max-w-12 text-center typo-label-xs", children: e.label })
41
+ ] });
42
+ return e.href ? /* @__PURE__ */ r(
43
+ "a",
44
+ {
45
+ href: e.href,
46
+ className: a,
47
+ "aria-current": t ? "page" : void 0,
48
+ children: i
49
+ }
50
+ ) : /* @__PURE__ */ r("button", { type: "button", className: a, children: i });
51
+ })(),
52
+ l && x === e.key && /* @__PURE__ */ r("div", { className: "absolute left-full top-0 z-[var(--Z-Popover)] ml-0 w-[240px] rounded-2xl bg-[var(--Surface-Primary)] shadow-menu border border-[var(--Border-Low-Emphasis)] py-2", children: e.subMenus.map((a) => /* @__PURE__ */ r(
53
+ "a",
54
+ {
55
+ href: a.href,
56
+ className: "flex min-h-11 items-center px-4 py-2.5 typo-body-sm text-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)] transition-colors",
57
+ children: a.label
58
+ },
59
+ a.label
60
+ )) })
61
+ ]
62
+ },
63
+ e.key
64
+ );
65
+ })
66
+ }
67
+ ),
68
+ f && /* @__PURE__ */ s("div", { className: "fixed inset-0 z-[var(--Z-Overlay)] @md:hidden", children: [
69
+ /* @__PURE__ */ r(
70
+ "div",
71
+ {
72
+ className: "absolute inset-0 bg-[var(--Primitive-Black-alpha-1000)]/40",
73
+ onClick: () => h?.(!1)
74
+ }
75
+ ),
76
+ /* @__PURE__ */ s(
77
+ "nav",
78
+ {
79
+ "aria-label": d,
80
+ className: "absolute left-0 top-0 h-full w-[280px] bg-[var(--Surface-Primary)] shadow-lg overflow-y-auto dark:bg-[var(--Primitive-Gray-900)]",
81
+ children: [
82
+ /* @__PURE__ */ s("div", { className: "flex items-center justify-between px-4 py-3", children: [
83
+ /* @__PURE__ */ r("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: p }),
84
+ /* @__PURE__ */ r(
85
+ "button",
86
+ {
87
+ onClick: () => h?.(!1),
88
+ className: "flex size-10 shrink-0 items-center justify-center rounded-full text-[var(--Text-Low-Emphasis)] transition-colors hover:bg-[var(--Surface-Tertiary)] hover:text-[var(--Text-High-Emphasis)] focus-visible:ring-2 focus-visible:ring-[var(--Focus-High-Emphasis)] focus-visible:outline-hidden",
89
+ "aria-label": "閉じる",
90
+ children: /* @__PURE__ */ r(g, { className: "size-5" })
91
+ }
92
+ )
93
+ ] }),
94
+ n.map((e) => {
95
+ const t = o === e.key, l = !!e.subMenus && e.subMenus.length > 0;
96
+ return /* @__PURE__ */ s("div", { children: [
97
+ (() => {
98
+ const a = m(
99
+ "flex w-full items-center gap-3 px-4 py-3 transition-colors",
100
+ t ? "text-[var(--Text-Accent-Primary)] bg-[var(--Surface-Accent-Primary-Light)]" : "text-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]"
101
+ ), i = /* @__PURE__ */ s(c, { children: [
102
+ v(e.icon, { active: t, placement: "drawer" }),
103
+ /* @__PURE__ */ r("span", { className: "typo-label-md", children: e.label }),
104
+ l && /* @__PURE__ */ r(y, { size: 16, className: "ml-auto text-[var(--Text-Low-Emphasis)]" })
105
+ ] });
106
+ return e.href ? /* @__PURE__ */ r(
107
+ "a",
108
+ {
109
+ href: e.href,
110
+ className: a,
111
+ "aria-current": t ? "page" : void 0,
112
+ children: i
113
+ }
114
+ ) : /* @__PURE__ */ r("button", { type: "button", className: a, children: i });
115
+ })(),
116
+ l && /* @__PURE__ */ r("div", { className: "bg-[var(--Surface-Secondary)] dark:bg-[var(--Primitive-Gray-900)]", children: e.subMenus.map((a) => /* @__PURE__ */ r(
117
+ "a",
118
+ {
119
+ href: a.href,
120
+ className: "flex min-h-11 items-center px-12 py-2.5 typo-body-md text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]",
121
+ children: a.label
122
+ },
123
+ a.label
124
+ )) })
125
+ ] }, e.key);
126
+ })
127
+ ]
128
+ }
129
+ )
130
+ ] })
131
+ ] });
132
+ }
133
+ export {
134
+ M as AdminSideNav
135
+ };