@cakejp/design-system 0.17.1 → 0.20.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 (101) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/CLAUDE.md +16 -0
  3. package/bin/init.js +191 -28
  4. package/contracts/components.json +176 -17
  5. package/contracts/composition.json +1 -1
  6. package/contracts/rules.json +5 -1
  7. package/contracts/screen-patterns.json +1 -1
  8. package/dist/components/ec/admin-shell.js +7 -6
  9. package/dist/components/ec/order-summary.js +16 -15
  10. package/dist/components/ec/product-card.js +107 -102
  11. package/dist/components/ec/product-option.js +1 -0
  12. package/dist/components/ec/review-card.js +22 -20
  13. package/dist/components/ec/review-form.js +1 -0
  14. package/dist/components/foundations/accordion.js +23 -22
  15. package/dist/components/foundations/alert-dialog.js +7 -7
  16. package/dist/components/foundations/alert.js +1 -0
  17. package/dist/components/foundations/aspect-ratio.js +3 -2
  18. package/dist/components/foundations/avatar.js +1 -0
  19. package/dist/components/foundations/button.js +7 -1
  20. package/dist/components/foundations/calendar.js +1 -0
  21. package/dist/components/foundations/checkbox-group.js +1 -0
  22. package/dist/components/foundations/checkbox.js +1 -0
  23. package/dist/components/foundations/command.js +1 -0
  24. package/dist/components/foundations/context-menu.js +1 -0
  25. package/dist/components/foundations/data-table.js +489 -16
  26. package/dist/components/foundations/dialog.js +13 -13
  27. package/dist/components/foundations/drawer.js +6 -5
  28. package/dist/components/foundations/file-input.js +1 -0
  29. package/dist/components/foundations/form.js +26 -25
  30. package/dist/components/foundations/pagination.js +49 -46
  31. package/dist/components/foundations/popover.js +9 -8
  32. package/dist/components/foundations/radio-group.js +3 -2
  33. package/dist/components/foundations/responsive-dialog.js +1 -0
  34. package/dist/components/foundations/separator.js +7 -6
  35. package/dist/components/foundations/sheet.js +41 -34
  36. package/dist/components/foundations/slider.js +7 -6
  37. package/dist/components/foundations/social-icon.js +30 -10
  38. package/dist/components/foundations/sonner.js +5 -4
  39. package/dist/components/foundations/tabs.js +45 -25
  40. package/dist/components/foundations/toggle-group.js +6 -5
  41. package/dist/components/primitives/admin-header.js +1 -1
  42. package/dist/components/primitives/admin-side-nav.js +196 -86
  43. package/dist/components/primitives/bottom-tab-bar.js +20 -20
  44. package/dist/components/primitives/chat-composer.js +1 -0
  45. package/dist/components/primitives/combobox.js +1 -0
  46. package/dist/components/primitives/content-card.js +111 -0
  47. package/dist/components/primitives/content-carousel.js +9 -8
  48. package/dist/components/primitives/date-picker.js +9 -8
  49. package/dist/components/primitives/footer.js +169 -100
  50. package/dist/components/primitives/form-field.js +1 -0
  51. package/dist/components/primitives/header.js +226 -176
  52. package/dist/components/primitives/image-carousel.js +8 -7
  53. package/dist/components/primitives/image-gallery.js +15 -14
  54. package/dist/components/primitives/image-input.js +9 -8
  55. package/dist/components/primitives/list-item.js +9 -8
  56. package/dist/components/primitives/menu-drawer.js +60 -56
  57. package/dist/components/primitives/multi-select.js +7 -6
  58. package/dist/components/primitives/number-input.js +1 -0
  59. package/dist/components/primitives/prose.js +52 -0
  60. package/dist/components/primitives/search-bar.js +81 -66
  61. package/dist/components/primitives/section-header.js +58 -55
  62. package/dist/components/primitives/share-buttons.js +93 -85
  63. package/dist/components/primitives/status-count-tabs.js +8 -7
  64. package/dist/components/primitives/sticky-action-bar.js +2 -1
  65. package/dist/components/primitives/sub-nav.js +52 -52
  66. package/dist/index.css +1 -1
  67. package/dist/index.js +2027 -752
  68. package/dist/lib/field-labelling.js +7 -6
  69. package/dist/lib/link-component.js +6 -0
  70. package/dist/lib/use-value-length.js +1 -0
  71. package/dist/types/components/ec/product-card.d.ts +12 -19
  72. package/dist/types/components/ec/review-card.d.ts +6 -1
  73. package/dist/types/components/foundations/button.d.ts +1 -1
  74. package/dist/types/components/foundations/chip-variants.d.ts +1 -1
  75. package/dist/types/components/foundations/data-table.d.ts +9 -1
  76. package/dist/types/components/foundations/pagination.d.ts +7 -1
  77. package/dist/types/components/foundations/sheet.d.ts +6 -1
  78. package/dist/types/components/foundations/social-icon.d.ts +1 -1
  79. package/dist/types/components/foundations/tabs.d.ts +2 -1
  80. package/dist/types/components/primitives/admin-side-nav.d.ts +3 -0
  81. package/dist/types/components/primitives/content-card.d.ts +67 -0
  82. package/dist/types/components/primitives/footer.d.ts +21 -1
  83. package/dist/types/components/primitives/header.d.ts +30 -2
  84. package/dist/types/components/primitives/menu-drawer.d.ts +7 -1
  85. package/dist/types/components/primitives/prose.d.ts +35 -0
  86. package/dist/types/components/primitives/search-bar.d.ts +14 -1
  87. package/dist/types/components/primitives/section-header.d.ts +2 -1
  88. package/dist/types/components/primitives/share-buttons.d.ts +26 -4
  89. package/dist/types/components/primitives/sub-nav.d.ts +16 -1
  90. package/dist/types/index.d.ts +7 -2
  91. package/dist/types/lib/link-component.d.ts +35 -0
  92. package/package.json +5 -4
  93. package/src/components/COMPONENT_LOOKUP.md +8 -6
  94. package/src/preset-standalone.css +3 -0
  95. package/src/preset.css +21 -3
  96. package/src/styles/semantic.css +11 -0
  97. package/templates/AGENTS.md +4 -2
  98. package/templates/AGENTS.stub.md +25 -0
  99. package/templates/CLAUDE.md +4 -2
  100. package/templates/CLAUDE.stub.md +25 -0
  101. package/tokens.json +17 -1
@@ -1,16 +1,17 @@
1
+ "use client";
1
2
  import { jsx as r } from "react/jsx-runtime";
2
- import { Loader2Icon as t, OctagonXIcon as i, TriangleAlertIcon as o, InfoIcon as s, CircleCheckIcon as v } from "lucide-react";
3
- import { useTheme as n } from "next-themes";
3
+ import { Loader2Icon as t, OctagonXIcon as i, TriangleAlertIcon as o, InfoIcon as s, CircleCheckIcon as n } from "lucide-react";
4
+ import { useTheme as v } from "next-themes";
4
5
  import { Toaster as c } from "sonner";
5
6
  const g = ({ ...a }) => {
6
- const { theme: e = "system" } = n();
7
+ const { theme: e = "system" } = v();
7
8
  return /* @__PURE__ */ r(
8
9
  c,
9
10
  {
10
11
  theme: e,
11
12
  className: "toaster group",
12
13
  icons: {
13
- success: /* @__PURE__ */ r(v, { className: "size-4 text-[var(--Text-Success)]" }),
14
+ success: /* @__PURE__ */ r(n, { className: "size-4 text-[var(--Text-Success)]" }),
14
15
  info: /* @__PURE__ */ r(s, { className: "size-4 text-[var(--Primitive-Sea-600)]" }),
15
16
  warning: /* @__PURE__ */ r(o, { className: "size-4 text-[var(--Text-Warning)]" }),
16
17
  error: /* @__PURE__ */ r(i, { className: "size-4 text-[var(--Primitive-Sun-800)]" }),
@@ -1,13 +1,13 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as s } from "react/jsx-runtime";
2
2
  import "react";
3
- import { cva as o } from "class-variance-authority";
3
+ import { cva as n } from "class-variance-authority";
4
4
  import { Tabs as e } from "radix-ui";
5
5
  import { cn as i } from "../../lib/utils.js";
6
- function c({
6
+ function v({
7
7
  className: t,
8
8
  ...a
9
9
  }) {
10
- return /* @__PURE__ */ r(
10
+ return /* @__PURE__ */ s(
11
11
  e.Root,
12
12
  {
13
13
  "data-slot": "tabs",
@@ -16,7 +16,7 @@ function c({
16
16
  }
17
17
  );
18
18
  }
19
- const n = o(
19
+ const b = n(
20
20
  "group/tabs-list inline-flex items-center",
21
21
  {
22
22
  variants: {
@@ -26,37 +26,51 @@ const n = o(
26
26
  },
27
27
  scrollable: {
28
28
  true: "gap-4"
29
+ },
30
+ /**
31
+ * 狭い置き場所(サイドバー等)向けの詰め設定。
32
+ * segment の 1 項目あたりの最小幅(100px)を外し、左右の padding を詰める(issue #235)。
33
+ */
34
+ size: {
35
+ md: "",
36
+ sm: ""
29
37
  }
30
38
  },
39
+ compoundVariants: [
40
+ { variant: "segment", size: "sm", class: "p-1" }
41
+ ],
31
42
  defaultVariants: {
32
43
  variant: "underbar",
33
- scrollable: !1
44
+ scrollable: !1,
45
+ size: "md"
34
46
  }
35
47
  }
36
48
  );
37
- function v({
49
+ function m({
38
50
  className: t,
39
51
  variant: a = "underbar",
40
- scrollable: s = !1,
41
- ...l
52
+ scrollable: r = !1,
53
+ size: l = "md",
54
+ ...o
42
55
  }) {
43
- return /* @__PURE__ */ r(
56
+ return /* @__PURE__ */ s(
44
57
  e.List,
45
58
  {
46
59
  "data-slot": "tabs-list",
47
60
  "data-variant": a,
48
- "data-scrollable": s || void 0,
49
- className: i(n({ variant: a, scrollable: s }), t),
50
- ...l
61
+ "data-scrollable": r || void 0,
62
+ "data-size": l,
63
+ className: i(b({ variant: a, scrollable: r, size: l }), t),
64
+ ...o
51
65
  }
52
66
  );
53
67
  }
54
- function m({
68
+ function x({
55
69
  className: t,
56
70
  children: a,
57
- ...s
71
+ ...r
58
72
  }) {
59
- return /* @__PURE__ */ r(
73
+ return /* @__PURE__ */ s(
60
74
  e.Trigger,
61
75
  {
62
76
  "data-slot": "tabs-trigger",
@@ -64,19 +78,25 @@ function m({
64
78
  // Base
65
79
  "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
80
  // 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)]",
81
+ // px-2: 均等割りで幅が詰まったとき、隣のラベルと文字が接触しないための最小余白(issue #235)
82
+ "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:px-2 group-data-[variant=underbar]/tabs-list:typo-label-md group-data-[variant=underbar]/tabs-list:text-[var(--Text-Low-Emphasis)]",
68
83
  // Underbar active
69
84
  "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
85
  // 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",
86
+ // gap-4 で間隔を取っているので左右 padding は戻す(従来の間隔を保つ)
87
+ "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:!px-0 group-data-[scrollable]/tabs-list:data-[state=active]:!border-b-0 group-data-[scrollable]/tabs-list:typo-label-md",
72
88
  // Segment variant
73
89
  "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)]",
90
+ // size="sm": 狭い置き場所(サイドバー等)向け。1 項目あたりの最小幅を外し、
91
+ // 左右の padding を詰める。min-w を持つのは segment だけ、underbar の px-2 は同値なので
92
+ // 実際に効くのは segment。variant 側の group-data と具体度が並ぶため ! で順序依存を断つ(issue #235)
93
+ "group-data-[size=sm]/tabs-list:!min-w-0 group-data-[size=sm]/tabs-list:!px-2",
74
94
  // Segment active
75
95
  "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
96
  t
77
97
  ),
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 })
98
+ ...r,
99
+ children: /* @__PURE__ */ s("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
100
  }
81
101
  );
82
102
  }
@@ -84,7 +104,7 @@ function f({
84
104
  className: t,
85
105
  ...a
86
106
  }) {
87
- return /* @__PURE__ */ r(
107
+ return /* @__PURE__ */ s(
88
108
  e.Content,
89
109
  {
90
110
  "data-slot": "tabs-content",
@@ -94,9 +114,9 @@ function f({
94
114
  );
95
115
  }
96
116
  export {
97
- c as Tabs,
117
+ v as Tabs,
98
118
  f as TabsContent,
99
- v as TabsList,
100
- m as TabsTrigger,
101
- n as tabsListVariants
119
+ m as TabsList,
120
+ x as TabsTrigger,
121
+ b as tabsListVariants
102
122
  };
@@ -1,9 +1,10 @@
1
+ "use client";
1
2
  import { jsx as i } from "react/jsx-runtime";
2
3
  import * as s from "react";
3
4
  import { cva as l } from "class-variance-authority";
4
5
  import { ToggleGroup as d } from "radix-ui";
5
6
  import { cn as g } from "../../lib/utils.js";
6
- const p = l(
7
+ const c = l(
7
8
  "flex items-center gap-1.5 py-1.5 overflow-x-auto scrollbar-none",
8
9
  {
9
10
  variants: {
@@ -17,7 +18,7 @@ const p = l(
17
18
  width: "fit"
18
19
  }
19
20
  }
20
- ), c = l(
21
+ ), p = l(
21
22
  [
22
23
  "inline-flex shrink-0 items-center justify-center",
23
24
  "h-9 rounded-full px-3",
@@ -70,7 +71,7 @@ function h({
70
71
  d.Root,
71
72
  {
72
73
  "data-slot": "toggle-group",
73
- className: g(p({ width: o }), a),
74
+ className: g(c({ width: o }), a),
74
75
  ...t,
75
76
  children: /* @__PURE__ */ i(u.Provider, { value: { variant: e, size: r }, children: n })
76
77
  }
@@ -89,7 +90,7 @@ function b({
89
90
  {
90
91
  "data-slot": "toggle-group-item",
91
92
  className: g(
92
- c({
93
+ p({
93
94
  variant: t.variant || r,
94
95
  size: t.size || o
95
96
  }),
@@ -103,5 +104,5 @@ function b({
103
104
  export {
104
105
  h as ToggleGroup,
105
106
  b as ToggleGroupItem,
106
- c as toggleGroupItemVariants
107
+ p as toggleGroupItemVariants
107
108
  };
@@ -6,7 +6,7 @@ function l({ brand: r, onMenuClick: a, actions: t }) {
6
6
  "header",
7
7
  {
8
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",
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-Elevated)] border-b border-[var(--Border-Low-Emphasis)] px-4 @md:px-6",
10
10
  children: [
11
11
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2 @md:gap-3", children: [
12
12
  a && /* @__PURE__ */ e(
@@ -1,126 +1,236 @@
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;
1
+ "use client";
2
+ import { jsxs as f, Fragment as T, jsx as n } from "react/jsx-runtime";
3
+ import * as t from "react";
4
+ import L from "iconsax-reactjs/dist/esm/ArrowDown2.js";
5
+ import { XIcon as j } from "lucide-react";
6
+ import { DropdownMenu as B, DropdownMenuTrigger as G, DropdownMenuContent as q, DropdownMenuItem as Z } from "../foundations/dropdown-menu.js";
7
+ import { FOCUS_RING as U } from "../../lib/focus-ring.js";
8
+ import { cn as A } from "../../lib/utils.js";
9
+ function F(v, M) {
10
+ return typeof v == "function" ? v(M) : v;
8
11
  }
9
- function M({
10
- items: n,
11
- activeKey: o,
12
- drawerTitle: p,
13
- open: f = !1,
14
- onOpenChange: h,
15
- ariaLabel: d = "管理メニュー"
12
+ function Y({
13
+ items: v,
14
+ activeKey: M,
15
+ drawerTitle: H,
16
+ open: z = !1,
17
+ onOpenChange: C,
18
+ ariaLabel: S = "管理メニュー"
16
19
  }) {
17
- const [x, u] = b.useState(null);
18
- return /* @__PURE__ */ s(c, { children: [
19
- /* @__PURE__ */ r(
20
+ const [P, w] = t.useState(null), c = t.useRef(null), y = t.useRef(/* @__PURE__ */ new Set()), k = t.useRef(null), s = t.useRef(null), b = t.useRef(null), a = t.useRef(null), g = t.useRef(/* @__PURE__ */ new Map()), R = t.useRef(/* @__PURE__ */ new Map()), d = t.useRef(null), p = t.useRef(null), E = t.useRef(null), o = t.useCallback(() => {
21
+ p.current !== null && (clearTimeout(p.current), p.current = null);
22
+ }, []), i = t.useCallback(() => {
23
+ d.current !== null && (clearTimeout(d.current), d.current = null);
24
+ }, []), I = t.useCallback(
25
+ (e, l) => {
26
+ l !== "touch" && (i(), o(), d.current = setTimeout(() => {
27
+ s.current !== null && s.current !== e && (s.current = null, g.current.get(e)?.focus({ preventScroll: !0 })), c.current = e, y.current.add(e), w(e), d.current = null;
28
+ }, 80));
29
+ },
30
+ [o, i]
31
+ ), D = t.useCallback(
32
+ (e) => {
33
+ i(), o(), p.current = setTimeout(() => {
34
+ w((l) => l === e ? null : l), p.current = null;
35
+ }, 120);
36
+ },
37
+ [o, i]
38
+ ), O = t.useCallback(() => {
39
+ i(), o(), c.current = null, y.current.clear(), k.current = null, s.current = null, b.current = null, a.current = null, w(null);
40
+ }, [o, i]);
41
+ return t.useEffect(
42
+ () => () => {
43
+ d.current !== null && clearTimeout(d.current), p.current !== null && clearTimeout(p.current), k.current = null, s.current = null, b.current = null, a.current = null, g.current.clear(), R.current.clear();
44
+ },
45
+ []
46
+ ), t.useEffect(() => {
47
+ const e = E.current;
48
+ if (!e || typeof ResizeObserver > "u") return;
49
+ const l = () => {
50
+ const u = e.getBoundingClientRect();
51
+ (getComputedStyle(e).display === "none" || u.width === 0 || u.height === 0) && O();
52
+ }, h = new ResizeObserver(l);
53
+ return h.observe(e), l(), () => h.disconnect();
54
+ }, [O]), /* @__PURE__ */ f(T, { children: [
55
+ /* @__PURE__ */ n(
20
56
  "nav",
21
57
  {
58
+ ref: E,
22
59
  "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",
60
+ "aria-label": S,
61
+ className: "hidden @md:flex fixed left-0 top-16 bottom-0 z-[var(--Z-Sticky)] w-[72px] flex-col items-center bg-[var(--Surface-Elevated)] border-r border-[var(--Border-Low-Emphasis)]",
62
+ children: v.map((e) => {
63
+ const l = M === e.key, h = !!e.subMenus && e.subMenus.length > 0;
64
+ return /* @__PURE__ */ n("div", { className: "relative", children: (() => {
65
+ const u = A(
66
+ "flex h-16 w-16 flex-col items-center justify-center gap-1 rounded-md transition-colors",
67
+ l ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]",
68
+ U
69
+ ), m = /* @__PURE__ */ f(T, { children: [
70
+ F(e.icon, { active: l, placement: "rail" }),
71
+ /* @__PURE__ */ n("span", { className: "max-w-12 text-center typo-label-xs", children: e.label })
72
+ ] });
73
+ return h ? /* @__PURE__ */ f(
74
+ B,
75
+ {
76
+ modal: !1,
77
+ open: P === e.key,
78
+ onOpenChange: (r) => {
79
+ o(), r ? (a.current === e.key && (a.current = null), c.current = null, y.current.delete(e.key), w(e.key)) : w(
80
+ (x) => x === e.key ? null : x
81
+ );
82
+ },
83
+ children: [
84
+ /* @__PURE__ */ n(G, { asChild: !0, children: /* @__PURE__ */ n(
85
+ "button",
44
86
  {
45
- href: e.href,
46
- className: a,
47
- "aria-current": t ? "page" : void 0,
48
- children: i
87
+ ref: (r) => {
88
+ r ? g.current.set(e.key, r) : g.current.delete(e.key);
89
+ },
90
+ type: "button",
91
+ className: u,
92
+ onFocus: () => {
93
+ i(), k.current = e.key, c.current === e.key && (c.current = null), y.current.delete(e.key);
94
+ },
95
+ onBlur: () => {
96
+ k.current === e.key && (k.current = null);
97
+ },
98
+ onPointerEnter: (r) => {
99
+ k.current === e.key || b.current === e.key || I(e.key, r.pointerType);
100
+ },
101
+ onPointerDownCapture: () => {
102
+ i(), P !== e.key && (s.current = e.key);
103
+ },
104
+ onPointerLeave: () => {
105
+ b.current === e.key && (b.current = null), D(e.key);
106
+ },
107
+ children: m
49
108
  }
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
- );
109
+ ) }),
110
+ /* @__PURE__ */ n(
111
+ q,
112
+ {
113
+ side: "right",
114
+ align: "start",
115
+ sideOffset: 0,
116
+ collisionPadding: 8,
117
+ className: "w-[240px] rounded-2xl p-2 shadow-menu",
118
+ onPointerEnter: o,
119
+ onPointerLeave: () => D(e.key),
120
+ onPointerMoveCapture: (r) => {
121
+ c.current === e.key && r.preventDefault();
122
+ },
123
+ onInteractOutside: (r) => {
124
+ const x = g.current.get(e.key);
125
+ s.current === e.key && r.target instanceof Node && !x?.contains(r.target) && (a.current = e.key);
126
+ },
127
+ onOpenAutoFocus: (r) => {
128
+ c.current === e.key ? r.preventDefault() : s.current === e.key && (r.preventDefault(), requestAnimationFrame(() => {
129
+ R.current.get(e.key)?.focus();
130
+ }));
131
+ },
132
+ onCloseAutoFocus: (r) => {
133
+ y.current.has(e.key) && (r.preventDefault(), y.current.delete(e.key), c.current === e.key && (c.current = null)), s.current === e.key && (r.preventDefault(), s.current = null, a.current !== e.key && (b.current = e.key, requestAnimationFrame(() => {
134
+ g.current.get(e.key)?.focus();
135
+ }))), a.current === e.key && (a.current = null);
136
+ },
137
+ children: e.subMenus.map((r, x) => /* @__PURE__ */ n(
138
+ Z,
139
+ {
140
+ asChild: !0,
141
+ className: "min-h-11 px-4",
142
+ onPointerLeave: (N) => {
143
+ c.current === e.key && N.preventDefault();
144
+ },
145
+ children: /* @__PURE__ */ n(
146
+ "a",
147
+ {
148
+ ref: x === 0 ? (N) => {
149
+ N ? R.current.set(
150
+ e.key,
151
+ N
152
+ ) : R.current.delete(e.key);
153
+ } : void 0,
154
+ href: r.href,
155
+ children: r.label
156
+ }
157
+ )
158
+ },
159
+ r.label
160
+ ))
161
+ }
162
+ )
163
+ ]
164
+ }
165
+ ) : e.href ? /* @__PURE__ */ n(
166
+ "a",
167
+ {
168
+ href: e.href,
169
+ className: u,
170
+ "aria-current": l ? "page" : void 0,
171
+ children: m
172
+ }
173
+ ) : /* @__PURE__ */ n("button", { type: "button", className: u, children: m });
174
+ })() }, e.key);
65
175
  })
66
176
  }
67
177
  ),
68
- f && /* @__PURE__ */ s("div", { className: "fixed inset-0 z-[var(--Z-Overlay)] @md:hidden", children: [
69
- /* @__PURE__ */ r(
178
+ z && /* @__PURE__ */ f("div", { className: "fixed inset-0 z-[var(--Z-Overlay)] @md:hidden", children: [
179
+ /* @__PURE__ */ n(
70
180
  "div",
71
181
  {
72
182
  className: "absolute inset-0 bg-[var(--Primitive-Black-alpha-1000)]/40",
73
- onClick: () => h?.(!1)
183
+ onClick: () => C?.(!1)
74
184
  }
75
185
  ),
76
- /* @__PURE__ */ s(
186
+ /* @__PURE__ */ f(
77
187
  "nav",
78
188
  {
79
- "aria-label": d,
189
+ "aria-label": S,
80
190
  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
191
  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(
192
+ /* @__PURE__ */ f("div", { className: "flex items-center justify-between px-4 py-3", children: [
193
+ /* @__PURE__ */ n("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: H }),
194
+ /* @__PURE__ */ n(
85
195
  "button",
86
196
  {
87
- onClick: () => h?.(!1),
197
+ onClick: () => C?.(!1),
88
198
  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
199
  "aria-label": "閉じる",
90
- children: /* @__PURE__ */ r(g, { className: "size-5" })
200
+ children: /* @__PURE__ */ n(j, { className: "size-5" })
91
201
  }
92
202
  )
93
203
  ] }),
94
- n.map((e) => {
95
- const t = o === e.key, l = !!e.subMenus && e.subMenus.length > 0;
96
- return /* @__PURE__ */ s("div", { children: [
204
+ v.map((e) => {
205
+ const l = M === e.key, h = !!e.subMenus && e.subMenus.length > 0;
206
+ return /* @__PURE__ */ f("div", { children: [
97
207
  (() => {
98
- const a = m(
208
+ const u = A(
99
209
  "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)]" })
210
+ l ? "text-[var(--Text-Accent-Primary)] bg-[var(--Surface-Accent-Primary-Light)]" : "text-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]"
211
+ ), m = /* @__PURE__ */ f(T, { children: [
212
+ F(e.icon, { active: l, placement: "drawer" }),
213
+ /* @__PURE__ */ n("span", { className: "typo-label-md", children: e.label }),
214
+ h && /* @__PURE__ */ n(L, { size: 16, className: "ml-auto text-[var(--Text-Low-Emphasis)]" })
105
215
  ] });
106
- return e.href ? /* @__PURE__ */ r(
216
+ return e.href ? /* @__PURE__ */ n(
107
217
  "a",
108
218
  {
109
219
  href: e.href,
110
- className: a,
111
- "aria-current": t ? "page" : void 0,
112
- children: i
220
+ className: u,
221
+ "aria-current": l ? "page" : void 0,
222
+ children: m
113
223
  }
114
- ) : /* @__PURE__ */ r("button", { type: "button", className: a, children: i });
224
+ ) : /* @__PURE__ */ n("button", { type: "button", className: u, children: m });
115
225
  })(),
116
- l && /* @__PURE__ */ r("div", { className: "bg-[var(--Surface-Secondary)] dark:bg-[var(--Primitive-Gray-900)]", children: e.subMenus.map((a) => /* @__PURE__ */ r(
226
+ h && /* @__PURE__ */ n("div", { className: "bg-[var(--Surface-Secondary)] dark:bg-[var(--Primitive-Gray-900)]", children: e.subMenus.map((u) => /* @__PURE__ */ n(
117
227
  "a",
118
228
  {
119
- href: a.href,
229
+ href: u.href,
120
230
  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
231
+ children: u.label
122
232
  },
123
- a.label
233
+ u.label
124
234
  )) })
125
235
  ] }, e.key);
126
236
  })
@@ -131,5 +241,5 @@ function M({
131
241
  ] });
132
242
  }
133
243
  export {
134
- M as AdminSideNav
244
+ Y as AdminSideNav
135
245
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { cn as a } from "../../lib/utils.js";
4
4
  import { NotificationBadge as d } from "./notification-badge.js";
@@ -6,7 +6,7 @@ function x({
6
6
  className: n,
7
7
  items: s,
8
8
  banner: t,
9
- ...i
9
+ ...c
10
10
  }) {
11
11
  return /* @__PURE__ */ o(
12
12
  "nav",
@@ -14,12 +14,12 @@ function x({
14
14
  "data-slot": "bottom-tab-bar",
15
15
  "aria-label": "メインナビゲーション",
16
16
  className: a(
17
- "fixed inset-x-0 bottom-0 z-[var(--Z-Floating)] border-t border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Primary)] pb-[env(safe-area-inset-bottom)] @md:hidden",
17
+ "fixed inset-x-0 bottom-0 z-[var(--Z-Floating)] border-t border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Elevated)] pb-[env(safe-area-inset-bottom)] @md:hidden",
18
18
  n
19
19
  ),
20
- ...i,
20
+ ...c,
21
21
  children: [
22
- t && /* @__PURE__ */ e(
22
+ t && /* @__PURE__ */ r(
23
23
  "div",
24
24
  {
25
25
  "data-slot": "bottom-tab-bar-banner",
@@ -27,49 +27,49 @@ function x({
27
27
  children: t
28
28
  }
29
29
  ),
30
- /* @__PURE__ */ e("div", { className: "flex h-[52px] items-center justify-around px-1 @sm:px-4", children: s.map((r) => {
31
- const c = r.href ? "a" : "button", l = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
30
+ /* @__PURE__ */ r("div", { className: "flex h-[52px] items-center justify-around px-1 @sm:px-4", children: s.map((e) => {
31
+ const i = e.href ? "a" : "button", l = e.href ? { href: e.href } : { type: "button", onClick: e.onClick };
32
32
  return /* @__PURE__ */ o(
33
- c,
33
+ i,
34
34
  {
35
35
  className: a(
36
36
  "relative flex flex-1 flex-col items-center gap-0.5 pb-1 pt-0.5 transition-colors min-w-0",
37
- r.isActive ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Text-High-Emphasis)]"
37
+ e.isActive ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Text-High-Emphasis)]"
38
38
  ),
39
- "aria-current": r.isActive ? "page" : void 0,
39
+ "aria-current": e.isActive ? "page" : void 0,
40
40
  ...l,
41
41
  children: [
42
- /* @__PURE__ */ e(
42
+ /* @__PURE__ */ r(
43
43
  "span",
44
44
  {
45
45
  className: a(
46
46
  "relative flex h-7 w-14 shrink-0 items-center justify-center rounded-full overflow-visible transition-colors",
47
- r.isActive && "bg-[var(--Surface-Accent-Primary-Light)]"
47
+ e.isActive && "bg-[var(--Surface-Accent-Primary-Light)]"
48
48
  ),
49
- children: /* @__PURE__ */ e(
49
+ children: /* @__PURE__ */ r(
50
50
  d,
51
51
  {
52
- count: r.badgeCount,
52
+ count: e.badgeCount,
53
53
  size: "md",
54
- hidden: r.badgeCount == null || r.badgeCount <= 0,
55
- children: r.isActive && r.activeIcon ? r.activeIcon : r.icon
54
+ hidden: e.badgeCount == null || e.badgeCount <= 0,
55
+ children: e.isActive && e.activeIcon ? e.activeIcon : e.icon
56
56
  }
57
57
  )
58
58
  }
59
59
  ),
60
- /* @__PURE__ */ e(
60
+ /* @__PURE__ */ r(
61
61
  "span",
62
62
  {
63
63
  className: a(
64
64
  "truncate max-w-full px-0.5 text-center",
65
- r.isActive ? "typo-label-xs" : "typo-body-xs"
65
+ e.isActive ? "typo-label-xs" : "typo-body-xs"
66
66
  ),
67
- children: r.label
67
+ children: e.label
68
68
  }
69
69
  )
70
70
  ]
71
71
  },
72
- r.label
72
+ e.label
73
73
  );
74
74
  }) })
75
75
  ]