@cakejp/design-system 0.22.1 → 0.23.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 (119) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/CLAUDE.md +3 -1
  3. package/MIGRATION.md +43 -0
  4. package/UPDATING.md +1 -1
  5. package/bin/check-tokens.mjs +20 -0
  6. package/contracts/components.json +87 -25
  7. package/contracts/composition.json +9 -9
  8. package/contracts/rules.json +1 -1
  9. package/contracts/screen-patterns.json +1 -1
  10. package/dist/components/ec/admin-shell.js +7 -7
  11. package/dist/components/ec/anniversary-card.js +1 -1
  12. package/dist/components/ec/chart-controls.js +7 -7
  13. package/dist/components/ec/coupon-card.js +10 -10
  14. package/dist/components/ec/delivery-calendar.js +1 -1
  15. package/dist/components/ec/mypage-shell.js +1 -1
  16. package/dist/components/ec/order-section.js +1 -1
  17. package/dist/components/ec/order-summary.js +7 -5
  18. package/dist/components/ec/product-card.js +32 -30
  19. package/dist/components/ec/product-detail-sidebar.js +1 -1
  20. package/dist/components/ec/product-list-item.js +57 -56
  21. package/dist/components/ec/product-option.js +30 -30
  22. package/dist/components/ec/review-summary.js +1 -1
  23. package/dist/components/ec/shop-card.js +7 -7
  24. package/dist/components/foundations/accordion.js +1 -1
  25. package/dist/components/foundations/alert-dialog.js +65 -43
  26. package/dist/components/foundations/alert.js +74 -68
  27. package/dist/components/foundations/badge.js +4 -4
  28. package/dist/components/foundations/button.js +15 -15
  29. package/dist/components/foundations/checkbox-card.js +18 -18
  30. package/dist/components/foundations/checkbox.js +6 -6
  31. package/dist/components/foundations/chip-variants.js +8 -8
  32. package/dist/components/foundations/data-table.js +244 -209
  33. package/dist/components/foundations/dialog.js +84 -60
  34. package/dist/components/foundations/drawer.js +61 -53
  35. package/dist/components/foundations/field.js +51 -35
  36. package/dist/components/foundations/file-input.js +1 -1
  37. package/dist/components/foundations/input.js +9 -8
  38. package/dist/components/foundations/popover.js +15 -12
  39. package/dist/components/foundations/progress.js +19 -18
  40. package/dist/components/foundations/radio-group.js +26 -23
  41. package/dist/components/foundations/select.js +9 -8
  42. package/dist/components/foundations/sheet.js +82 -59
  43. package/dist/components/foundations/skeleton.js +6 -6
  44. package/dist/components/foundations/slider.js +7 -7
  45. package/dist/components/foundations/sonner.js +9 -8
  46. package/dist/components/foundations/switch.js +3 -2
  47. package/dist/components/foundations/tabs.js +5 -5
  48. package/dist/components/foundations/textarea.js +7 -6
  49. package/dist/components/foundations/toggle-group.js +5 -5
  50. package/dist/components/primitives/admin-header.js +3 -3
  51. package/dist/components/primitives/admin-side-nav.js +101 -92
  52. package/dist/components/primitives/category-shortcuts.js +6 -6
  53. package/dist/components/primitives/chat-composer.js +1 -1
  54. package/dist/components/primitives/chip.js +25 -25
  55. package/dist/components/primitives/combobox.js +74 -63
  56. package/dist/components/primitives/content-carousel.js +64 -62
  57. package/dist/components/primitives/date-picker.js +99 -96
  58. package/dist/components/primitives/error-state.js +9 -9
  59. package/dist/components/primitives/filter-bar.js +4 -4
  60. package/dist/components/primitives/footer.js +1 -1
  61. package/dist/components/primitives/form-field.js +8 -8
  62. package/dist/components/primitives/funnel-shell.js +5 -5
  63. package/dist/components/primitives/header.js +16 -16
  64. package/dist/components/primitives/image-carousel.js +42 -41
  65. package/dist/components/primitives/image-gallery.js +61 -58
  66. package/dist/components/primitives/image-input.js +2 -2
  67. package/dist/components/primitives/image-uploader.js +1 -1
  68. package/dist/components/primitives/kebab-menu.js +20 -16
  69. package/dist/components/primitives/list-item.js +17 -17
  70. package/dist/components/primitives/menu-drawer.js +11 -11
  71. package/dist/components/primitives/multi-select.js +66 -66
  72. package/dist/components/primitives/notification-list.js +13 -13
  73. package/dist/components/primitives/number-input.js +118 -112
  74. package/dist/components/primitives/progress-steps.js +3 -3
  75. package/dist/components/primitives/search-bar.js +6 -6
  76. package/dist/components/primitives/section-nav.js +1 -1
  77. package/dist/components/primitives/side-nav.js +1 -1
  78. package/dist/components/primitives/sub-nav.js +12 -12
  79. package/dist/components/primitives/tag.js +3 -3
  80. package/dist/components/primitives/workspace-shell.js +8 -8
  81. package/dist/index.css +1 -1
  82. package/dist/index.js +1479 -704
  83. package/dist/lib/focus-restore.js +67 -0
  84. package/dist/lib/focus-ring.js +1 -1
  85. package/dist/lib/ime.js +17 -0
  86. package/dist/lib/search-normalize.js +30 -0
  87. package/dist/types/components/ec/admin-shell.d.ts +1 -1
  88. package/dist/types/components/foundations/alert-dialog.d.ts +2 -2
  89. package/dist/types/components/foundations/alert.d.ts +14 -1
  90. package/dist/types/components/foundations/card.d.ts +3 -3
  91. package/dist/types/components/foundations/confirm-dialog.d.ts +3 -3
  92. package/dist/types/components/foundations/data-table.d.ts +1 -1
  93. package/dist/types/components/foundations/dialog.d.ts +2 -2
  94. package/dist/types/components/foundations/drawer.d.ts +1 -1
  95. package/dist/types/components/foundations/field.d.ts +23 -3
  96. package/dist/types/components/foundations/popover.d.ts +1 -1
  97. package/dist/types/components/foundations/sheet.d.ts +4 -3
  98. package/dist/types/components/foundations/sonner.d.ts +3 -2
  99. package/dist/types/components/primitives/admin-side-nav.d.ts +2 -0
  100. package/dist/types/components/primitives/combobox.d.ts +6 -0
  101. package/dist/types/components/primitives/date-picker.d.ts +8 -3
  102. package/dist/types/components/primitives/funnel-shell.d.ts +1 -1
  103. package/dist/types/components/primitives/kebab-menu.d.ts +10 -1
  104. package/dist/types/components/primitives/number-input.d.ts +20 -1
  105. package/dist/types/components/primitives/progress-steps.d.ts +1 -1
  106. package/dist/types/components/primitives/section.d.ts +1 -1
  107. package/dist/types/components/primitives/workspace-shell.d.ts +2 -2
  108. package/dist/types/index.d.ts +3 -4
  109. package/dist/types/lib/focus-restore.d.ts +52 -0
  110. package/dist/types/lib/focus-ring.d.ts +3 -0
  111. package/dist/types/lib/ime.d.ts +36 -0
  112. package/dist/types/lib/search-normalize.d.ts +28 -0
  113. package/package.json +3 -1
  114. package/src/components/COMPONENT_LOOKUP.md +12 -12
  115. package/src/preset-standalone.css +43 -21
  116. package/src/preset.css +36 -18
  117. package/src/styles/primitive.css +1 -0
  118. package/src/styles/semantic.css +12 -2
  119. package/tokens.json +22 -3
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  import { jsx as r } from "react/jsx-runtime";
3
- import { Loader2Icon as t, OctagonXIcon as i, TriangleAlertIcon as o, InfoIcon as n, CircleCheckIcon as s } from "lucide-react";
3
+ import { Loader2Icon as t, OctagonXIcon as i, TriangleAlertIcon as o, InfoIcon as s, CircleCheckIcon as n } from "lucide-react";
4
4
  import { useTheme as v } from "next-themes";
5
- import { Toaster as c } from "sonner";
5
+ import { toast as c, Toaster as m } from "sonner";
6
6
  const g = ({ ...a }) => {
7
7
  const { theme: e = "system" } = v();
8
8
  return /* @__PURE__ */ r(
9
- c,
9
+ m,
10
10
  {
11
11
  theme: e,
12
12
  className: "toaster group",
13
13
  icons: {
14
- success: /* @__PURE__ */ r(s, { className: "size-4 text-[var(--Text-Success)]" }),
15
- info: /* @__PURE__ */ r(n, { className: "size-4 text-[var(--Primitive-Sea-600)]" }),
14
+ success: /* @__PURE__ */ r(n, { className: "size-4 text-[var(--Text-Success)]" }),
15
+ info: /* @__PURE__ */ r(s, { className: "size-4 text-[var(--Primitive-Sea-600)]" }),
16
16
  warning: /* @__PURE__ */ r(o, { className: "size-4 text-[var(--Text-Warning)]" }),
17
17
  error: /* @__PURE__ */ r(i, { className: "size-4 text-[var(--Primitive-Sun-800)]" }),
18
18
  // 動きを減らす設定では回転を止める(--Motion-* の一括制御は animate-spin に効かない)
@@ -23,7 +23,7 @@ const g = ({ ...a }) => {
23
23
  toast: "!mx-auto",
24
24
  description: "!text-[var(--Text-Medium-Emphasis)]",
25
25
  actionButton: "!bg-[var(--Brand-Cake-Orange)] !text-[var(--Text-on-Inverse)] !typo-label-sm !rounded-lg !px-4 !py-2 !h-8 hover:!bg-[var(--Hover-Primary-Button)]",
26
- cancelButton: "!bg-[var(--Surface-Tertiary)] !text-[var(--Text-High-Emphasis)] !typo-label-sm !rounded-lg !px-4 !py-2 !h-8",
26
+ cancelButton: "!bg-[var(--Surface-Neutral-Tertiary)] !text-[var(--Text-High-Emphasis)] !typo-label-sm !rounded-lg !px-4 !py-2 !h-8",
27
27
  // 状態トースト(success/error/warning/info)は背景を primitive の明色で固定しているため、
28
28
  // 中の description / cancel もモード反転しない primitive に固定する。
29
29
  // semantic(Text-Medium-Emphasis 等)のままだとダークモードで白系に反転し、
@@ -45,7 +45,8 @@ const g = ({ ...a }) => {
45
45
  ...a
46
46
  }
47
47
  );
48
- };
48
+ }, p = c;
49
49
  export {
50
- g as Toaster
50
+ g as Toaster,
51
+ p as toast
51
52
  };
@@ -1,16 +1,17 @@
1
+ "use client";
1
2
  import { jsx as e } from "react/jsx-runtime";
2
3
  import "react";
3
4
  import { Switch as o } from "radix-ui";
4
5
  import { Check as n } from "lucide-react";
5
6
  import { cn as a } from "../../lib/utils.js";
6
7
  import { FOCUS_RING_ONLY as d } from "../../lib/focus-ring.js";
7
- import { resolveFieldAria as u, useFieldLabelling as m } from "../../lib/field-labelling.js";
8
+ import { resolveFieldAria as u, useFieldLabelling as l } from "../../lib/field-labelling.js";
8
9
  function v({
9
10
  className: s,
10
11
  size: r = "default",
11
12
  ...i
12
13
  }) {
13
- const t = r === "default", c = u(i, m());
14
+ const t = r === "default", c = u(i, l());
14
15
  return /* @__PURE__ */ e(
15
16
  o.Root,
16
17
  {
@@ -4,13 +4,13 @@ import { cva as l } from "class-variance-authority";
4
4
  import { Tabs as i } from "radix-ui";
5
5
  import { cn as s } from "../../lib/utils.js";
6
6
  import { FOCUS_RING as d } from "../../lib/focus-ring.js";
7
- const b = "data-[orientation=vertical]:flex-row data-[orientation=vertical]:items-start data-[orientation=vertical]:gap-4", g = "data-[orientation=vertical]:w-auto data-[orientation=vertical]:max-w-[50%] data-[orientation=vertical]:shrink-0 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", c = [
7
+ const b = "data-[orientation=vertical]:flex-row data-[orientation=vertical]:items-start data-[orientation=vertical]:gap-4", g = "data-[orientation=vertical]:w-auto data-[orientation=vertical]:max-w-[50%] data-[orientation=vertical]:shrink-0 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", u = [
8
8
  "data-[orientation=vertical]:justify-start data-[orientation=vertical]:whitespace-normal data-[orientation=vertical]:text-left",
9
9
  // underbar: 均等割り(flex-1)と下線をやめ、パネル側(右)の線で選択中を示す。高さは折り返しに合わせて伸ばす
10
10
  "group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:h-auto group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:min-h-12 group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:flex-none group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:border-b-0 group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:border-r-2 group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:px-4",
11
11
  // segment: 高さを折り返しに合わせて伸ばす(1 行なら従来の 37px)
12
12
  "group-data-[variant=segment]/tabs-list:data-[orientation=vertical]:h-auto group-data-[variant=segment]/tabs-list:data-[orientation=vertical]:min-h-[37px] group-data-[variant=segment]/tabs-list:data-[orientation=vertical]:py-2"
13
- ].join(" "), u = "data-[orientation=vertical]:min-w-0", p = [
13
+ ].join(" "), c = "data-[orientation=vertical]:min-w-0", p = [
14
14
  "forced-colors:group-data-[variant=segment]/tabs-list:data-[state=active]:bg-[Highlight] forced-colors:group-data-[variant=segment]/tabs-list:data-[state=active]:text-[HighlightText]",
15
15
  "forced-colors:group-data-[variant=underbar]/tabs-list:data-[state=inactive]:border-[Canvas] forced-colors:group-data-[variant=underbar]/tabs-list:data-[state=active]:border-[Highlight]"
16
16
  ].join(" "), v = "forced-colors:group-data-[scrollable]/tabs-list:group-data-[state=inactive]/trigger:border-[Canvas] forced-colors:group-data-[state=active]/trigger:border-[Highlight]";
@@ -34,7 +34,7 @@ const m = l(
34
34
  variant: {
35
35
  underbar: "w-full bg-transparent overflow-x-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",
36
36
  // 縦向きでは縦長の地に rounded-full だと上下が半円になり、先頭・末尾のタブの角がはみ出すため角丸を 2xl に抑える
37
- segment: "w-fit rounded-full bg-[var(--Surface-Tertiary)] p-2 data-[orientation=vertical]:rounded-2xl"
37
+ segment: "w-fit rounded-full bg-[var(--Surface-Neutral-Tertiary)] p-2 data-[orientation=vertical]:rounded-2xl"
38
38
  },
39
39
  scrollable: {
40
40
  true: "gap-4"
@@ -106,7 +106,7 @@ function C({
106
106
  "group-data-[size=sm]/tabs-list:!min-w-0 group-data-[size=sm]/tabs-list:!px-2",
107
107
  // Segment active
108
108
  "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)]",
109
- c,
109
+ u,
110
110
  p,
111
111
  t
112
112
  ),
@@ -123,7 +123,7 @@ function L({
123
123
  i.Content,
124
124
  {
125
125
  "data-slot": "tabs-content",
126
- className: s("flex-1 outline-none", d, u, t),
126
+ className: s("flex-1 outline-none", d, c, t),
127
127
  ...a
128
128
  }
129
129
  );
@@ -1,9 +1,10 @@
1
+ "use client";
1
2
  import { jsx as n, jsxs as s } from "react/jsx-runtime";
2
3
  import "react";
3
4
  import { cn as c } from "../../lib/utils.js";
4
5
  import { useValueLength as h } from "../../lib/use-value-length.js";
5
6
  import { FOCUS_RING as g } from "../../lib/focus-ring.js";
6
- import { resolveNativeFieldAria as y, useFieldLabelling as w } from "../../lib/field-labelling.js";
7
+ import { resolveNativeFieldAria as y, useFieldLabelling as N } from "../../lib/field-labelling.js";
7
8
  function D({
8
9
  className: m,
9
10
  showCount: r,
@@ -11,14 +12,14 @@ function D({
11
12
  value: a,
12
13
  defaultValue: t,
13
14
  onChange: o,
14
- ref: b,
15
+ ref: u,
15
16
  ...i
16
17
  }) {
17
- const u = y(i, w()), { ref: f, length: d, syncFromDom: p } = h({
18
+ const b = y(i, N()), { ref: f, length: d, syncFromDom: p } = h({
18
19
  enabled: r === !0,
19
20
  value: a,
20
21
  defaultValue: t,
21
- forwardedRef: b
22
+ forwardedRef: u
22
23
  }), l = /* @__PURE__ */ n(
23
24
  "textarea",
24
25
  {
@@ -31,13 +32,13 @@ function D({
31
32
  p(), o?.(v);
32
33
  } : o,
33
34
  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
+ "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-Neutral-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
36
  // フォーカス意匠は DS 共通(FOCUS_RING)。
36
37
  g,
37
38
  m
38
39
  ),
39
40
  ...i,
40
- ...u
41
+ ...b
41
42
  }
42
43
  );
43
44
  if (!r) return l;
@@ -6,7 +6,7 @@ import { ToggleGroup as c } from "radix-ui";
6
6
  import { cn as d } from "../../lib/utils.js";
7
7
  import { FORCED_COLORS_FOCUS_INSET as u } from "../../lib/focus-ring.js";
8
8
  const p = l(
9
- "flex items-center gap-1.5 py-1.5 overflow-x-auto scrollbar-none",
9
+ "flex items-center gap-1.5 py-1.5 overflow-x-auto scrollbar-hide",
10
10
  {
11
11
  variants: {
12
12
  /** グループ全体の幅 */
@@ -40,15 +40,15 @@ const p = l(
40
40
  variants: {
41
41
  variant: {
42
42
  default: [
43
- "bg-[var(--Surface-Tertiary)] text-[var(--Text-Medium-Emphasis)]",
44
- "hover:bg-[var(--Surface-Tertiary)]/80",
43
+ "bg-[var(--Surface-Neutral-Tertiary)] text-[var(--Text-Medium-Emphasis)]",
44
+ "hover:bg-[var(--Surface-Neutral-Tertiary)]/80",
45
45
  "data-[state=on]:bg-[var(--Surface-Accent-Primary-Light)] data-[state=on]:text-[var(--Text-Accent-Primary)] data-[state=on]:font-bold",
46
- "dark:bg-[var(--Surface-Secondary)] dark:text-[var(--Text-Low-Emphasis)]",
46
+ "dark:bg-[var(--Surface-Neutral-Secondary)] dark:text-[var(--Text-Low-Emphasis)]",
47
47
  "dark:data-[state=on]:bg-[var(--Surface-Accent-Primary-Light)] dark:data-[state=on]:text-[var(--Text-Accent-Primary)]"
48
48
  ].join(" "),
49
49
  outline: [
50
50
  "border border-[var(--Border-Control,var(--Border-Low-Emphasis))] bg-transparent text-[var(--Text-Low-Emphasis)]",
51
- "hover:bg-[var(--Surface-Tertiary)]",
51
+ "hover:bg-[var(--Surface-Neutral-Tertiary)]",
52
52
  "data-[state=on]:border-[var(--Text-High-Emphasis)] data-[state=on]:bg-transparent data-[state=on]:text-[var(--Text-High-Emphasis)]"
53
53
  ].join(" ")
54
54
  },
@@ -1,7 +1,7 @@
1
1
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import s from "iconsax-reactjs/dist/esm/HamburgerMenu.js";
4
- function l({ brand: r, onMenuClick: a, actions: t }) {
4
+ function n({ brand: r, onMenuClick: a, actions: t }) {
5
5
  return /* @__PURE__ */ i(
6
6
  "header",
7
7
  {
@@ -13,7 +13,7 @@ function l({ brand: r, onMenuClick: a, actions: t }) {
13
13
  "button",
14
14
  {
15
15
  type: "button",
16
- className: "flex items-center justify-center size-10 shrink-0 rounded-lg hover:bg-[var(--Surface-Secondary)] @md:hidden",
16
+ className: "flex items-center justify-center size-10 shrink-0 rounded-lg hover:bg-[var(--Surface-Neutral-Secondary)] @md:hidden",
17
17
  "aria-label": "メニュー",
18
18
  onClick: a,
19
19
  children: /* @__PURE__ */ e(s, { size: 20, className: "text-[var(--Text-High-Emphasis)]" })
@@ -27,5 +27,5 @@ function l({ brand: r, onMenuClick: a, actions: t }) {
27
27
  );
28
28
  }
29
29
  export {
30
- l as AdminHeader
30
+ n as AdminHeader
31
31
  };
@@ -1,58 +1,63 @@
1
1
  "use client";
2
- import { jsxs as f, Fragment as S, jsx as n } from "react/jsx-runtime";
2
+ import { jsxs as h, Fragment as S, jsx as n } from "react/jsx-runtime";
3
3
  import * as t from "react";
4
- import B from "iconsax-reactjs/dist/esm/ArrowDown2.js";
5
- import { XIcon as G } from "lucide-react";
6
- import { DropdownMenu as q, DropdownMenuTrigger as Z, DropdownMenuContent as U, DropdownMenuItem as W } from "../foundations/dropdown-menu.js";
7
- import { FOCUS_RING as X } from "../../lib/focus-ring.js";
4
+ import G from "iconsax-reactjs/dist/esm/ArrowDown2.js";
5
+ import { XIcon as K } from "lucide-react";
6
+ import { DropdownMenu as q, DropdownMenuTrigger as Z, DropdownMenuContent as _, DropdownMenuItem as U } from "../foundations/dropdown-menu.js";
7
+ import { FOCUS_RING as W } from "../../lib/focus-ring.js";
8
8
  import { cn as F } from "../../lib/utils.js";
9
- function H(v, w) {
10
- return typeof v == "function" ? v(w) : v;
9
+ function H(u, p) {
10
+ return typeof u == "function" ? u(p) : u;
11
11
  }
12
- function K({
13
- items: v,
14
- activeKey: w,
12
+ function L(u) {
13
+ if (u.button !== 0 || u.metaKey || u.ctrlKey || u.shiftKey || u.altKey) return !1;
14
+ const p = u.currentTarget.getAttribute("target");
15
+ return !(p && p !== "_self");
16
+ }
17
+ function ee({
18
+ items: u,
19
+ activeKey: p,
15
20
  drawerTitle: z,
16
- open: L = !1,
17
- onOpenChange: R,
21
+ open: I = !1,
22
+ onOpenChange: N,
18
23
  ariaLabel: E = "管理メニュー",
19
- linkComponent: I
24
+ linkComponent: j
20
25
  }) {
21
- const N = I ?? "a", [P, M] = 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()), T = t.useRef(/* @__PURE__ */ new Map()), d = t.useRef(null), p = t.useRef(null), D = t.useRef(null), o = t.useCallback(() => {
22
- p.current !== null && (clearTimeout(p.current), p.current = null);
23
- }, []), i = t.useCallback(() => {
24
- d.current !== null && (clearTimeout(d.current), d.current = null);
25
- }, []), j = t.useCallback(
26
+ const R = j ?? "a", [P, M] = t.useState(null), s = t.useRef(null), g = t.useRef(/* @__PURE__ */ new Set()), b = t.useRef(null), a = t.useRef(null), m = t.useRef(null), o = t.useRef(null), x = t.useRef(/* @__PURE__ */ new Map()), T = t.useRef(/* @__PURE__ */ new Map()), y = t.useRef(null), v = t.useRef(null), D = t.useRef(null), i = t.useCallback(() => {
27
+ v.current !== null && (clearTimeout(v.current), v.current = null);
28
+ }, []), f = t.useCallback(() => {
29
+ y.current !== null && (clearTimeout(y.current), y.current = null);
30
+ }, []), B = t.useCallback(
26
31
  (e, l) => {
27
- l !== "touch" && (i(), o(), d.current = setTimeout(() => {
28
- s.current !== null && s.current !== e && (s.current = null, g.current.get(e)?.focus({ preventScroll: !0 })), c.current = e, y.current.add(e), M(e), d.current = null;
32
+ l !== "touch" && (f(), i(), y.current = setTimeout(() => {
33
+ a.current !== null && a.current !== e && (a.current = null, x.current.get(e)?.focus({ preventScroll: !0 })), s.current = e, g.current.add(e), M(e), y.current = null;
29
34
  }, 80));
30
35
  },
31
- [o, i]
36
+ [i, f]
32
37
  ), A = t.useCallback(
33
38
  (e) => {
34
- i(), o(), p.current = setTimeout(() => {
35
- M((l) => l === e ? null : l), p.current = null;
39
+ f(), i(), v.current = setTimeout(() => {
40
+ M((l) => l === e ? null : l), v.current = null;
36
41
  }, 120);
37
42
  },
38
- [o, i]
43
+ [i, f]
39
44
  ), O = t.useCallback(() => {
40
- i(), o(), c.current = null, y.current.clear(), k.current = null, s.current = null, b.current = null, a.current = null, M(null);
41
- }, [o, i]);
45
+ f(), i(), s.current = null, g.current.clear(), b.current = null, a.current = null, m.current = null, o.current = null, M(null);
46
+ }, [i, f]);
42
47
  return t.useEffect(
43
48
  () => () => {
44
- 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(), T.current.clear();
49
+ y.current !== null && clearTimeout(y.current), v.current !== null && clearTimeout(v.current), b.current = null, a.current = null, m.current = null, o.current = null, x.current.clear(), T.current.clear();
45
50
  },
46
51
  []
47
52
  ), t.useEffect(() => {
48
53
  const e = D.current;
49
54
  if (!e || typeof ResizeObserver > "u") return;
50
55
  const l = () => {
51
- const u = e.getBoundingClientRect();
52
- (getComputedStyle(e).display === "none" || u.width === 0 || u.height === 0) && O();
53
- }, h = new ResizeObserver(l);
54
- return h.observe(e), l(), () => h.disconnect();
55
- }, [O]), /* @__PURE__ */ f(S, { children: [
56
+ const c = e.getBoundingClientRect();
57
+ (getComputedStyle(e).display === "none" || c.width === 0 || c.height === 0) && O();
58
+ }, k = new ResizeObserver(l);
59
+ return k.observe(e), l(), () => k.disconnect();
60
+ }, [O]), /* @__PURE__ */ h(S, { children: [
56
61
  /* @__PURE__ */ n(
57
62
  "nav",
58
63
  {
@@ -60,25 +65,25 @@ function K({
60
65
  "data-slot": "admin-side-nav",
61
66
  "aria-label": E,
62
67
  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)]",
63
- children: v.map((e) => {
64
- const l = w === e.key, h = !!e.subMenus && e.subMenus.length > 0;
68
+ children: u.map((e) => {
69
+ const l = p === e.key, k = !!e.subMenus && e.subMenus.length > 0;
65
70
  return /* @__PURE__ */ n("div", { className: "relative", children: (() => {
66
- const u = F(
71
+ const c = F(
67
72
  "flex h-16 w-16 flex-col items-center justify-center gap-1 rounded-md transition-colors",
68
73
  l ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]",
69
- X
70
- ), m = /* @__PURE__ */ f(S, { children: [
74
+ W
75
+ ), d = /* @__PURE__ */ h(S, { children: [
71
76
  H(e.icon, { active: l, placement: "rail" }),
72
77
  /* @__PURE__ */ n("span", { className: "max-w-12 text-center typo-label-xs", children: e.label })
73
78
  ] });
74
- return h ? /* @__PURE__ */ f(
79
+ return k ? /* @__PURE__ */ h(
75
80
  q,
76
81
  {
77
82
  modal: !1,
78
83
  open: P === e.key,
79
84
  onOpenChange: (r) => {
80
- o(), r ? (a.current === e.key && (a.current = null), c.current = null, y.current.delete(e.key), M(e.key)) : M(
81
- (x) => x === e.key ? null : x
85
+ i(), r ? (o.current === e.key && (o.current = null), s.current = null, g.current.delete(e.key), M(e.key)) : M(
86
+ (w) => w === e.key ? null : w
82
87
  );
83
88
  },
84
89
  children: [
@@ -86,67 +91,67 @@ function K({
86
91
  "button",
87
92
  {
88
93
  ref: (r) => {
89
- r ? g.current.set(e.key, r) : g.current.delete(e.key);
94
+ r ? x.current.set(e.key, r) : x.current.delete(e.key);
90
95
  },
91
96
  type: "button",
92
- className: u,
97
+ className: c,
93
98
  onFocus: () => {
94
- i(), k.current = e.key, c.current === e.key && (c.current = null), y.current.delete(e.key);
99
+ f(), b.current = e.key, s.current === e.key && (s.current = null), g.current.delete(e.key);
95
100
  },
96
101
  onBlur: () => {
97
- k.current === e.key && (k.current = null);
102
+ b.current === e.key && (b.current = null);
98
103
  },
99
104
  onPointerEnter: (r) => {
100
- k.current === e.key || b.current === e.key || j(e.key, r.pointerType);
105
+ b.current === e.key || m.current === e.key || B(e.key, r.pointerType);
101
106
  },
102
107
  onPointerDownCapture: () => {
103
- i(), P !== e.key && (s.current = e.key);
108
+ f(), P !== e.key && (a.current = e.key);
104
109
  },
105
110
  onPointerLeave: () => {
106
- b.current === e.key && (b.current = null), A(e.key);
111
+ m.current === e.key && (m.current = null), A(e.key);
107
112
  },
108
- children: m
113
+ children: d
109
114
  }
110
115
  ) }),
111
116
  /* @__PURE__ */ n(
112
- U,
117
+ _,
113
118
  {
114
119
  side: "right",
115
120
  align: "start",
116
121
  sideOffset: 0,
117
122
  collisionPadding: 8,
118
123
  className: "w-[240px] rounded-2xl p-2 shadow-menu",
119
- onPointerEnter: o,
124
+ onPointerEnter: i,
120
125
  onPointerLeave: () => A(e.key),
121
126
  onPointerMoveCapture: (r) => {
122
- c.current === e.key && r.preventDefault();
127
+ s.current === e.key && r.preventDefault();
123
128
  },
124
129
  onInteractOutside: (r) => {
125
- const x = g.current.get(e.key);
126
- s.current === e.key && r.target instanceof Node && !x?.contains(r.target) && (a.current = e.key);
130
+ const w = x.current.get(e.key);
131
+ a.current === e.key && r.target instanceof Node && !w?.contains(r.target) && (o.current = e.key);
127
132
  },
128
133
  onOpenAutoFocus: (r) => {
129
- c.current === e.key ? r.preventDefault() : s.current === e.key && (r.preventDefault(), requestAnimationFrame(() => {
134
+ s.current === e.key ? r.preventDefault() : a.current === e.key && (r.preventDefault(), requestAnimationFrame(() => {
130
135
  T.current.get(e.key)?.focus();
131
136
  }));
132
137
  },
133
138
  onCloseAutoFocus: (r) => {
134
- 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(() => {
135
- g.current.get(e.key)?.focus();
136
- }))), a.current === e.key && (a.current = null);
139
+ g.current.has(e.key) && (r.preventDefault(), g.current.delete(e.key), s.current === e.key && (s.current = null)), a.current === e.key && (r.preventDefault(), a.current = null, o.current !== e.key && (m.current = e.key, requestAnimationFrame(() => {
140
+ x.current.get(e.key)?.focus();
141
+ }))), o.current === e.key && (o.current = null);
137
142
  },
138
- children: e.subMenus.map((r, x) => /* @__PURE__ */ n(
139
- W,
143
+ children: e.subMenus.map((r, w) => /* @__PURE__ */ n(
144
+ U,
140
145
  {
141
146
  asChild: !0,
142
147
  className: "min-h-11 px-4",
143
148
  onPointerLeave: (C) => {
144
- c.current === e.key && C.preventDefault();
149
+ s.current === e.key && C.preventDefault();
145
150
  },
146
151
  children: /* @__PURE__ */ n(
147
- N,
152
+ R,
148
153
  {
149
- ref: x === 0 ? (C) => {
154
+ ref: w === 0 ? (C) => {
150
155
  C ? T.current.set(
151
156
  e.key,
152
157
  C
@@ -164,76 +169,80 @@ function K({
164
169
  ]
165
170
  }
166
171
  ) : e.href ? /* @__PURE__ */ n(
167
- N,
172
+ R,
168
173
  {
169
174
  href: e.href,
170
- className: u,
175
+ className: c,
171
176
  "aria-current": l ? "page" : void 0,
172
- children: m
177
+ children: d
173
178
  }
174
- ) : /* @__PURE__ */ n("button", { type: "button", className: u, children: m });
179
+ ) : /* @__PURE__ */ n("button", { type: "button", className: c, children: d });
175
180
  })() }, e.key);
176
181
  })
177
182
  }
178
183
  ),
179
- L && /* @__PURE__ */ f("div", { className: "fixed inset-0 z-[var(--Z-Overlay)] @md:hidden", children: [
184
+ I && /* @__PURE__ */ h("div", { className: "fixed inset-0 z-[var(--Z-Overlay)] @md:hidden", children: [
180
185
  /* @__PURE__ */ n(
181
186
  "div",
182
187
  {
183
188
  className: "absolute inset-0 bg-[var(--Overlay-Medium)]",
184
- onClick: () => R?.(!1)
189
+ onClick: () => N?.(!1)
185
190
  }
186
191
  ),
187
- /* @__PURE__ */ f(
192
+ /* @__PURE__ */ h(
188
193
  "nav",
189
194
  {
190
195
  "aria-label": E,
191
196
  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)]",
192
197
  children: [
193
- /* @__PURE__ */ f("div", { className: "flex items-center justify-between px-4 py-3", children: [
198
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-between px-4 py-3", children: [
194
199
  /* @__PURE__ */ n("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: z }),
195
200
  /* @__PURE__ */ n(
196
201
  "button",
197
202
  {
198
- onClick: () => R?.(!1),
199
- 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",
203
+ onClick: () => N?.(!1),
204
+ className: "flex size-10 shrink-0 items-center justify-center rounded-full text-[var(--Text-Low-Emphasis)] transition-colors hover:bg-[var(--Surface-Neutral-Tertiary)] hover:text-[var(--Text-High-Emphasis)] focus-visible:ring-2 focus-visible:ring-[var(--Focus-High-Emphasis)] focus-visible:outline-hidden",
200
205
  "aria-label": "閉じる",
201
- children: /* @__PURE__ */ n(G, { className: "size-5" })
206
+ children: /* @__PURE__ */ n(K, { className: "size-5" })
202
207
  }
203
208
  )
204
209
  ] }),
205
- v.map((e) => {
206
- const l = w === e.key, h = !!e.subMenus && e.subMenus.length > 0;
207
- return /* @__PURE__ */ f("div", { children: [
210
+ u.map((e) => {
211
+ const l = p === e.key, k = !!e.subMenus && e.subMenus.length > 0;
212
+ return /* @__PURE__ */ h("div", { children: [
208
213
  (() => {
209
- const u = F(
214
+ const c = F(
210
215
  "flex w-full items-center gap-3 px-4 py-3 transition-colors",
211
- l ? "text-[var(--Text-Accent-Primary)] bg-[var(--Surface-Accent-Primary-Light)]" : "text-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]"
212
- ), m = /* @__PURE__ */ f(S, { children: [
216
+ l ? "text-[var(--Text-Accent-Primary)] bg-[var(--Surface-Accent-Primary-Light)]" : "text-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Neutral-Secondary)]"
217
+ ), d = /* @__PURE__ */ h(S, { children: [
213
218
  H(e.icon, { active: l, placement: "drawer" }),
214
219
  /* @__PURE__ */ n("span", { className: "typo-label-md", children: e.label }),
215
- h && /* @__PURE__ */ n(B, { size: 16, className: "ml-auto text-[var(--Text-Low-Emphasis)]" })
220
+ k && /* @__PURE__ */ n(G, { size: 16, className: "ml-auto text-[var(--Text-Low-Emphasis)]" })
216
221
  ] });
217
222
  return e.href ? /* @__PURE__ */ n(
218
- N,
223
+ R,
219
224
  {
220
225
  href: e.href,
221
- className: u,
226
+ className: c,
222
227
  "aria-current": l ? "page" : void 0,
223
- onClick: () => R?.(!1),
224
- children: m
228
+ onClick: (r) => {
229
+ L(r) && N?.(!1);
230
+ },
231
+ children: d
225
232
  }
226
- ) : /* @__PURE__ */ n("button", { type: "button", className: u, children: m });
233
+ ) : /* @__PURE__ */ n("button", { type: "button", className: c, children: d });
227
234
  })(),
228
- h && /* @__PURE__ */ n("div", { className: "bg-[var(--Surface-Secondary)] dark:bg-[var(--Primitive-Gray-900)]", children: e.subMenus.map((u) => /* @__PURE__ */ n(
229
- N,
235
+ k && /* @__PURE__ */ n("div", { className: "bg-[var(--Surface-Neutral-Secondary)] dark:bg-[var(--Primitive-Gray-900)]", children: e.subMenus.map((c) => /* @__PURE__ */ n(
236
+ R,
230
237
  {
231
- href: u.href,
232
- onClick: () => R?.(!1),
238
+ href: c.href,
239
+ onClick: (d) => {
240
+ L(d) && N?.(!1);
241
+ },
233
242
  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)]",
234
- children: u.label
243
+ children: c.label
235
244
  },
236
- u.label
245
+ c.label
237
246
  )) })
238
247
  ] }, e.key);
239
248
  })
@@ -244,5 +253,5 @@ function K({
244
253
  ] });
245
254
  }
246
255
  export {
247
- K as AdminSideNav
256
+ ee as AdminSideNav
248
257
  };
@@ -1,25 +1,25 @@
1
1
  import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { cn as a } from "../../lib/utils.js";
4
- function g({ items: c, className: s, linkComponent: l }) {
4
+ function g({ items: c, className: l, linkComponent: s }) {
5
5
  return /* @__PURE__ */ o(
6
6
  "div",
7
7
  {
8
8
  "data-slot": "category-shortcuts",
9
9
  className: a(
10
10
  "flex gap-3 overflow-x-auto px-4 py-2 scrollbar-hide",
11
- s
11
+ l
12
12
  ),
13
13
  children: [
14
- c.map((r, n) => {
15
- const t = !!r.href || !!r.onClick, i = r.href ? l ?? "a" : "button", d = r.href ? { href: r.href, onClick: r.onClick } : { type: "button", onClick: r.onClick };
14
+ c.map((r, t) => {
15
+ const n = !!r.href || !!r.onClick, i = r.href ? s ?? "a" : "button", d = r.href ? { href: r.href, onClick: r.onClick } : { type: "button", onClick: r.onClick };
16
16
  return /* @__PURE__ */ o(
17
17
  i,
18
18
  {
19
19
  ...d,
20
20
  className: a(
21
21
  "flex shrink-0 flex-col items-center gap-1 rounded-lg p-1 transition-colors",
22
- t && "hover:bg-[var(--Surface-Secondary)]",
22
+ n && "hover:bg-[var(--Surface-Neutral-Secondary)]",
23
23
  r.isSelected && "bg-[var(--Surface-Accent-Primary-Light)]"
24
24
  ),
25
25
  children: [
@@ -53,7 +53,7 @@ function g({ items: c, className: s, linkComponent: l }) {
53
53
  )
54
54
  ]
55
55
  },
56
- n
56
+ t
57
57
  );
58
58
  }),
59
59
  /* @__PURE__ */ e("div", { className: "shrink-0 w-2", "aria-hidden": "true" })
@@ -65,7 +65,7 @@ function re({
65
65
  // フォーカス意匠は DS 共通(FOCUS_RING_WITHIN。以前は同じクラスを手で書いていた)。
66
66
  // 枠はこのラッパーが描く(内側の Textarea はリングを消している)
67
67
  U,
68
- i && "border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Secondary)]",
68
+ i && "border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Neutral-Secondary)]",
69
69
  j
70
70
  ),
71
71
  children: [