@cakejp/design-system 0.20.0 → 0.21.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 (161) hide show
  1. package/CHANGELOG.md +179 -0
  2. package/CLAUDE.md +5 -3
  3. package/MIGRATION.md +3 -3
  4. package/README.md +31 -11
  5. package/contracts/components.json +424 -62
  6. package/contracts/composition.json +38 -4
  7. package/contracts/rules.json +27 -5
  8. package/contracts/screen-patterns.json +6 -4
  9. package/dist/components/ec/admin-shell.js +62 -60
  10. package/dist/components/ec/anniversary-card.js +13 -12
  11. package/dist/components/ec/coupon-card.js +11 -11
  12. package/dist/components/ec/delivery-calendar.js +51 -45
  13. package/dist/components/ec/mypage-shell.js +80 -69
  14. package/dist/components/ec/product-card.js +93 -76
  15. package/dist/components/ec/product-carousel.js +65 -60
  16. package/dist/components/ec/product-detail-bar.js +13 -11
  17. package/dist/components/ec/product-detail-sidebar.js +60 -58
  18. package/dist/components/ec/product-list-item.js +64 -63
  19. package/dist/components/ec/product-option.js +30 -26
  20. package/dist/components/ec/rating-stars.js +27 -27
  21. package/dist/components/ec/review-card.js +32 -32
  22. package/dist/components/ec/review-form.js +37 -37
  23. package/dist/components/ec/shop-card.js +21 -19
  24. package/dist/components/foundations/accordion.js +33 -31
  25. package/dist/components/foundations/alert-dialog.js +4 -5
  26. package/dist/components/foundations/badge.js +5 -5
  27. package/dist/components/foundations/breadcrumb.js +27 -26
  28. package/dist/components/foundations/button.js +144 -25
  29. package/dist/components/foundations/calendar.js +28 -26
  30. package/dist/components/foundations/checkbox-card.js +71 -47
  31. package/dist/components/foundations/checkbox-group.js +30 -27
  32. package/dist/components/foundations/checkbox.js +69 -52
  33. package/dist/components/foundations/chip-variants.js +13 -0
  34. package/dist/components/foundations/command.js +81 -79
  35. package/dist/components/foundations/confirm-dialog.js +136 -0
  36. package/dist/components/foundations/context-menu.js +43 -38
  37. package/dist/components/foundations/data-table.js +88 -84
  38. package/dist/components/foundations/dialog.js +45 -36
  39. package/dist/components/foundations/dropdown-menu.js +47 -42
  40. package/dist/components/foundations/file-input.js +97 -67
  41. package/dist/components/foundations/hover-card.js +21 -21
  42. package/dist/components/foundations/menubar.js +75 -69
  43. package/dist/components/foundations/navigation-menu.js +31 -26
  44. package/dist/components/foundations/pagination.js +54 -50
  45. package/dist/components/foundations/popover.js +7 -7
  46. package/dist/components/foundations/progress.js +10 -6
  47. package/dist/components/foundations/radio-group.js +6 -3
  48. package/dist/components/foundations/responsive-dialog.js +73 -55
  49. package/dist/components/foundations/scroll-area.js +18 -14
  50. package/dist/components/foundations/select.js +44 -39
  51. package/dist/components/foundations/sheet.js +45 -37
  52. package/dist/components/foundations/skeleton.js +6 -6
  53. package/dist/components/foundations/skip-link.js +10 -8
  54. package/dist/components/foundations/slider.js +73 -48
  55. package/dist/components/foundations/sonner.js +5 -4
  56. package/dist/components/foundations/spinner.js +7 -5
  57. package/dist/components/foundations/switch.js +11 -10
  58. package/dist/components/foundations/tabs.js +54 -39
  59. package/dist/components/foundations/toggle-group.js +29 -21
  60. package/dist/components/foundations/toggle.js +20 -16
  61. package/dist/components/primitives/admin-side-nav.js +65 -62
  62. package/dist/components/primitives/banner-carousel.js +32 -29
  63. package/dist/components/primitives/bottom-tab-bar.js +16 -15
  64. package/dist/components/primitives/category-scroll.js +39 -29
  65. package/dist/components/primitives/category-shortcuts.js +9 -9
  66. package/dist/components/primitives/chat-composer.js +77 -74
  67. package/dist/components/primitives/chip.js +84 -61
  68. package/dist/components/primitives/combobox.js +63 -47
  69. package/dist/components/primitives/container.js +9 -9
  70. package/dist/components/primitives/content-card.js +15 -17
  71. package/dist/components/primitives/content-carousel.js +79 -68
  72. package/dist/components/primitives/date-picker.js +137 -99
  73. package/dist/components/primitives/footer.js +36 -37
  74. package/dist/components/primitives/header.js +175 -168
  75. package/dist/components/primitives/image-carousel.js +107 -87
  76. package/dist/components/primitives/image-gallery.js +32 -27
  77. package/dist/components/primitives/image-uploader.js +43 -22
  78. package/dist/components/primitives/list-item.js +59 -51
  79. package/dist/components/primitives/menu-drawer.js +36 -38
  80. package/dist/components/primitives/multi-select.js +89 -58
  81. package/dist/components/primitives/notification-list.js +10 -9
  82. package/dist/components/primitives/number-input.js +116 -105
  83. package/dist/components/primitives/scroll-row.js +21 -0
  84. package/dist/components/primitives/search-bar.js +31 -28
  85. package/dist/components/primitives/section-header.js +54 -53
  86. package/dist/components/primitives/side-nav.js +57 -56
  87. package/dist/components/primitives/sub-nav.js +13 -14
  88. package/dist/components/primitives/tag.js +4 -2
  89. package/dist/index.css +1 -1
  90. package/dist/index.js +3076 -929
  91. package/dist/lib/field-labelling.js +31 -21
  92. package/dist/lib/focus-ring.js +22 -4
  93. package/dist/lib/high-contrast.js +4 -0
  94. package/dist/lib/image-index.js +8 -0
  95. package/dist/lib/use-prefers-reduced-motion.js +21 -0
  96. package/dist/types/components/ec/admin-shell.d.ts +11 -1
  97. package/dist/types/components/ec/anniversary-card.d.ts +9 -1
  98. package/dist/types/components/ec/mypage-shell.d.ts +12 -1
  99. package/dist/types/components/ec/product-card.d.ts +13 -1
  100. package/dist/types/components/ec/product-carousel.d.ts +13 -1
  101. package/dist/types/components/ec/product-detail-bar.d.ts +12 -1
  102. package/dist/types/components/ec/product-detail-sidebar.d.ts +11 -1
  103. package/dist/types/components/ec/product-list-item.d.ts +9 -1
  104. package/dist/types/components/ec/rating-stars.d.ts +2 -0
  105. package/dist/types/components/ec/review-card.d.ts +1 -1
  106. package/dist/types/components/ec/shop-card.d.ts +8 -1
  107. package/dist/types/components/foundations/badge.d.ts +1 -1
  108. package/dist/types/components/foundations/breadcrumb.d.ts +8 -1
  109. package/dist/types/components/foundations/button.d.ts +38 -3
  110. package/dist/types/components/foundations/checkbox-card.d.ts +7 -1
  111. package/dist/types/components/foundations/checkbox.d.ts +1 -1
  112. package/dist/types/components/foundations/chip-variants.d.ts +2 -2
  113. package/dist/types/components/foundations/confirm-dialog.d.ts +61 -0
  114. package/dist/types/components/foundations/data-table.d.ts +9 -2
  115. package/dist/types/components/foundations/dialog.d.ts +16 -1
  116. package/dist/types/components/foundations/pagination.d.ts +1 -1
  117. package/dist/types/components/foundations/responsive-dialog.d.ts +2 -1
  118. package/dist/types/components/foundations/sheet.d.ts +12 -1
  119. package/dist/types/components/foundations/skeleton.d.ts +6 -0
  120. package/dist/types/components/foundations/slider.d.ts +15 -1
  121. package/dist/types/components/foundations/tabs.d.ts +7 -0
  122. package/dist/types/components/primitives/admin-side-nav.d.ts +22 -2
  123. package/dist/types/components/primitives/banner-carousel.d.ts +9 -1
  124. package/dist/types/components/primitives/bottom-tab-bar.d.ts +13 -2
  125. package/dist/types/components/primitives/category-scroll.d.ts +10 -1
  126. package/dist/types/components/primitives/category-shortcuts.d.ts +11 -2
  127. package/dist/types/components/primitives/chip.d.ts +22 -3
  128. package/dist/types/components/primitives/combobox.d.ts +7 -2
  129. package/dist/types/components/primitives/container.d.ts +3 -0
  130. package/dist/types/components/primitives/content-card.d.ts +1 -1
  131. package/dist/types/components/primitives/content-carousel.d.ts +12 -4
  132. package/dist/types/components/primitives/date-picker.d.ts +10 -3
  133. package/dist/types/components/primitives/footer.d.ts +1 -1
  134. package/dist/types/components/primitives/header.d.ts +14 -2
  135. package/dist/types/components/primitives/image-carousel.d.ts +23 -5
  136. package/dist/types/components/primitives/list-item.d.ts +10 -1
  137. package/dist/types/components/primitives/menu-drawer.d.ts +1 -1
  138. package/dist/types/components/primitives/multi-select.d.ts +7 -2
  139. package/dist/types/components/primitives/notification-list.d.ts +10 -1
  140. package/dist/types/components/primitives/number-input.d.ts +18 -5
  141. package/dist/types/components/primitives/scroll-row.d.ts +43 -0
  142. package/dist/types/components/primitives/section-header.d.ts +9 -2
  143. package/dist/types/components/primitives/side-nav.d.ts +13 -1
  144. package/dist/types/components/primitives/sub-nav.d.ts +1 -1
  145. package/dist/types/components/primitives/tag.d.ts +1 -1
  146. package/dist/types/index.d.ts +7 -1
  147. package/dist/types/lib/field-labelling.d.ts +23 -8
  148. package/dist/types/lib/focus-ring.d.ts +70 -3
  149. package/dist/types/lib/high-contrast.d.ts +25 -0
  150. package/dist/types/lib/image-index.d.ts +2 -0
  151. package/dist/types/lib/link-component.d.ts +26 -21
  152. package/dist/types/lib/use-prefers-reduced-motion.d.ts +9 -0
  153. package/package.json +11 -3
  154. package/src/components/COMPONENT_LOOKUP.md +19 -17
  155. package/src/preset-standalone.css +42 -0
  156. package/src/preset.css +20 -1
  157. package/src/styles/semantic.css +57 -0
  158. package/templates/AGENTS.md +5 -1
  159. package/templates/CLAUDE.md +3 -1
  160. package/tokens.json +49 -0
  161. package/dist/lib/link-component.js +0 -6
@@ -1,27 +1,27 @@
1
1
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import "react";
3
- import { XIcon as h } from "lucide-react";
3
+ import { XIcon as p } from "lucide-react";
4
4
  import { Dialog as a } from "radix-ui";
5
5
  import { cn as r } from "../../lib/utils.js";
6
- function y({ ...t }) {
6
+ function N({ ...t }) {
7
7
  return /* @__PURE__ */ e(a.Root, { "data-slot": "sheet", ...t });
8
8
  }
9
- function N({
9
+ function C({
10
10
  ...t
11
11
  }) {
12
12
  return /* @__PURE__ */ e(a.Trigger, { "data-slot": "sheet-trigger", ...t });
13
13
  }
14
- function w({
14
+ function D({
15
15
  ...t
16
16
  }) {
17
17
  return /* @__PURE__ */ e(a.Close, { "data-slot": "sheet-close", ...t });
18
18
  }
19
- function m({
19
+ function g({
20
20
  ...t
21
21
  }) {
22
22
  return /* @__PURE__ */ e(a.Portal, { "data-slot": "sheet-portal", ...t });
23
23
  }
24
- function p({
24
+ function x({
25
25
  className: t,
26
26
  ...o
27
27
  }) {
@@ -37,41 +37,49 @@ function p({
37
37
  }
38
38
  );
39
39
  }
40
- function D({
40
+ const d = {
41
+ sm: "sm:max-w-sm",
42
+ md: "sm:max-w-[576px]",
43
+ lg: "sm:max-w-[768px]"
44
+ };
45
+ function T({
41
46
  className: t,
42
47
  children: o,
43
- side: n = "right",
44
- showCloseButton: d = !0,
48
+ side: s = "right",
49
+ size: u = "sm",
50
+ showCloseButton: c = !0,
45
51
  autoFocus: l = !0,
46
- onOpenAutoFocus: u,
47
- onCloseAutoFocus: c,
48
- ...f
52
+ onOpenAutoFocus: m,
53
+ onCloseAutoFocus: f,
54
+ ...h
49
55
  }) {
50
- return /* @__PURE__ */ i(m, { children: [
51
- /* @__PURE__ */ e(p, {}),
56
+ return /* @__PURE__ */ i(g, { children: [
57
+ /* @__PURE__ */ e(x, {}),
52
58
  /* @__PURE__ */ i(
53
59
  a.Content,
54
60
  {
55
61
  "data-slot": "sheet-content",
56
- onOpenAutoFocus: (s) => {
57
- l || s.preventDefault(), u?.(s);
62
+ onOpenAutoFocus: (n) => {
63
+ l || n.preventDefault(), m?.(n);
58
64
  },
59
- onCloseAutoFocus: (s) => {
60
- l || s.preventDefault(), c?.(s);
65
+ onCloseAutoFocus: (n) => {
66
+ l || n.preventDefault(), f?.(n);
61
67
  },
62
68
  className: r(
63
69
  "fixed z-[var(--Z-Modal)] flex flex-col gap-4 border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Elevated)] shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-[var(--Motion-Duration-Slow)] data-[state=open]:animate-in data-[state=open]:duration-[var(--Motion-Duration-Slower)]",
64
- n === "right" && "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
65
- n === "left" && "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
66
- n === "top" && "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
67
- n === "bottom" && "inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
70
+ s === "right" && "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
71
+ s === "left" && "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",
72
+ s === "top" && "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
73
+ s === "bottom" && "inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
74
+ // 型に無い size(AlertDialog の "default" と取り違えた JSX など)でも幅の上限を消さず、既定の sm にする
75
+ (s === "right" || s === "left") && (d[u] ?? d.sm),
68
76
  t
69
77
  ),
70
- ...f,
78
+ ...h,
71
79
  children: [
72
80
  o,
73
- d && /* @__PURE__ */ i(a.Close, { className: "absolute top-2 right-2 flex size-10 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:ring-2 focus:ring-[var(--Focus-High-Emphasis)] focus:outline-hidden disabled:pointer-events-none", children: [
74
- /* @__PURE__ */ e(h, { className: "size-5" }),
81
+ c && /* @__PURE__ */ i(a.Close, { className: "absolute top-2 right-2 flex size-10 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:ring-2 focus:ring-[var(--Focus-High-Emphasis)] focus:outline-hidden disabled:pointer-events-none", children: [
82
+ /* @__PURE__ */ e(p, { className: "size-5" }),
75
83
  /* @__PURE__ */ e("span", { className: "sr-only", children: "閉じる" })
76
84
  ] })
77
85
  ]
@@ -79,7 +87,7 @@ function D({
79
87
  )
80
88
  ] });
81
89
  }
82
- function T({ className: t, ...o }) {
90
+ function z({ className: t, ...o }) {
83
91
  return /* @__PURE__ */ e(
84
92
  "div",
85
93
  {
@@ -89,7 +97,7 @@ function T({ className: t, ...o }) {
89
97
  }
90
98
  );
91
99
  }
92
- function C({ className: t, ...o }) {
100
+ function E({ className: t, ...o }) {
93
101
  return /* @__PURE__ */ e(
94
102
  "div",
95
103
  {
@@ -99,7 +107,7 @@ function C({ className: t, ...o }) {
99
107
  }
100
108
  );
101
109
  }
102
- function E({
110
+ function M({
103
111
  className: t,
104
112
  ...o
105
113
  }) {
@@ -112,7 +120,7 @@ function E({
112
120
  }
113
121
  );
114
122
  }
115
- function M({
123
+ function O({
116
124
  className: t,
117
125
  ...o
118
126
  }) {
@@ -126,12 +134,12 @@ function M({
126
134
  );
127
135
  }
128
136
  export {
129
- y as Sheet,
130
- w as SheetClose,
131
- D as SheetContent,
132
- M as SheetDescription,
133
- C as SheetFooter,
134
- T as SheetHeader,
135
- E as SheetTitle,
136
- N as SheetTrigger
137
+ N as Sheet,
138
+ D as SheetClose,
139
+ T as SheetContent,
140
+ O as SheetDescription,
141
+ E as SheetFooter,
142
+ z as SheetHeader,
143
+ M as SheetTitle,
144
+ C as SheetTrigger
137
145
  };
@@ -1,12 +1,12 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { cn as o } from "../../lib/utils.js";
3
- function m({ className: e, ...r }) {
4
- return /* @__PURE__ */ t(
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { cn as t } from "../../lib/utils.js";
3
+ function m({ className: e, ...o }) {
4
+ return /* @__PURE__ */ r(
5
5
  "div",
6
6
  {
7
7
  "data-slot": "skeleton",
8
- className: o("animate-pulse rounded-md bg-[var(--Surface-Tertiary)]", e),
9
- ...r
8
+ className: t("animate-pulse motion-reduce:animate-none rounded-md bg-[var(--Surface-Tertiary)]", e),
9
+ ...o
10
10
  }
11
11
  );
12
12
  }
@@ -1,27 +1,29 @@
1
- import { jsx as u } from "react/jsx-runtime";
1
+ import { jsx as i } from "react/jsx-runtime";
2
2
  import "react";
3
- import { cn as i } from "../../lib/utils.js";
4
- function a({ href: o = "#main-content", label: s = "コンテンツへ移動", className: c, ...r }) {
5
- return /* @__PURE__ */ u(
3
+ import { cn as u } from "../../lib/utils.js";
4
+ import { FORCED_COLORS_FOCUS as f } from "../../lib/focus-ring.js";
5
+ function e({ href: o = "#main-content", label: s = "コンテンツへ移動", className: r, ...c }) {
6
+ return /* @__PURE__ */ i(
6
7
  "a",
7
8
  {
8
9
  "data-slot": "skip-link",
9
10
  href: o,
10
- className: i(
11
+ className: u(
11
12
  // 通常は視覚的に隠す(読み上げ・タブ順には残す)。フォーカス時のみ左上に可視化。
12
13
  "sr-only",
13
14
  "focus:not-sr-only focus:absolute focus:left-4 focus:top-4 focus:z-[var(--Z-SkipLink)] focus:px-4 focus:py-2",
14
15
  "focus:rounded-md focus:shadow-md focus:outline-none",
15
16
  "focus:bg-[var(--Surface-Primary)] focus:text-[var(--Text-High-Emphasis)]",
16
17
  "focus:ring-2 focus:ring-[var(--Focus-High-Emphasis)]",
18
+ f,
17
19
  "typo-label-md",
18
- c
20
+ r
19
21
  ),
20
- ...r,
22
+ ...c,
21
23
  children: s
22
24
  }
23
25
  );
24
26
  }
25
27
  export {
26
- a as SkipLink
28
+ e as SkipLink
27
29
  };
@@ -1,74 +1,99 @@
1
1
  "use client";
2
- import { jsxs as y, jsx as s } from "react/jsx-runtime";
3
- import * as p from "react";
4
- import { Slider as i } from "radix-ui";
5
- import { cn as o } from "../../lib/utils.js";
6
- import { FOCUS_RING as w } from "../../lib/focus-ring.js";
7
- import { useFieldLabelling as k } from "../../lib/field-labelling.js";
8
- function O({
9
- className: b,
10
- defaultValue: e,
11
- value: t,
12
- min: l = 0,
13
- max: n = 100,
14
- thumbLabels: d,
15
- "aria-label": c,
16
- "aria-labelledby": f,
17
- ...u
2
+ import { jsxs as E, jsx as b } from "react/jsx-runtime";
3
+ import * as K from "react";
4
+ import { Slider as c } from "radix-ui";
5
+ import { cn as d } from "../../lib/utils.js";
6
+ import { FOCUS_RING as _ } from "../../lib/focus-ring.js";
7
+ import { useFieldLabelling as G } from "../../lib/field-labelling.js";
8
+ function R(u) {
9
+ return (String(u).split(".")[1] || "").length;
10
+ }
11
+ function Q({
12
+ className: u,
13
+ defaultValue: o,
14
+ value: l,
15
+ min: n = 0,
16
+ max: f = 100,
17
+ step: h = 1,
18
+ minStepsBetweenThumbs: v = 0,
19
+ onValueChange: y,
20
+ onValueCommit: k,
21
+ disabled: p,
22
+ thumbLabels: w,
23
+ "aria-label": A,
24
+ "aria-labelledby": C,
25
+ ...z
18
26
  }) {
19
- const h = k(), m = p.useMemo(
20
- () => Array.isArray(t) ? t : Array.isArray(e) ? e : [l, n],
21
- [t, e, l, n]
22
- ), v = (r, a) => {
23
- if (d?.[r]) return { "aria-label": d[r] };
24
- if (c) {
25
- const g = a === 1 ? "" : r === 0 ? "(下限)" : r === a - 1 ? "(上限)" : `(${r + 1}つ目)`;
26
- return { "aria-label": `${c}${g}` };
27
+ const S = G(), i = Array.isArray(l), g = i ? l.length : Array.isArray(o) ? o.length : 1, s = g > 1, [D, T] = K.useState(
28
+ () => Array.isArray(o) ? o : [n]
29
+ ), t = i ? l : D, O = (r, a) => {
30
+ const e = v * h, H = a === "start" ? r === 0 ? n : (t[r - 1] ?? n) + e : r === t.length - 1 ? f : (t[r + 1] ?? f) - e, I = Math.max(R(h), R(e)), N = Number(H.toFixed(I));
31
+ if (N === t[r]) return;
32
+ const m = t.map((j, B) => B === r ? N : j);
33
+ i || T(m), y?.(m), k?.(m);
34
+ }, $ = (r) => (a) => {
35
+ !s || p || a.key !== "Home" && a.key !== "End" || (a.preventDefault(), O(r, a.key === "Home" ? "start" : "end"));
36
+ }, F = (r, a) => {
37
+ if (w?.[r]) return { "aria-label": w[r] };
38
+ if (A) {
39
+ const e = a === 1 ? "" : r === 0 ? "(下限)" : r === a - 1 ? "(上限)" : `(${r + 1}つ目)`;
40
+ return { "aria-label": `${A}${e}` };
27
41
  }
28
- return f ? { "aria-labelledby": f } : h ? { "aria-labelledby": h.labelId } : {};
42
+ return C ? { "aria-labelledby": C } : S ? { "aria-labelledby": S.labelId } : {};
29
43
  };
30
- return /* @__PURE__ */ y(
31
- i.Root,
44
+ return /* @__PURE__ */ E(
45
+ c.Root,
32
46
  {
33
47
  "data-slot": "slider",
34
- defaultValue: e,
35
- value: t,
36
- min: l,
37
- max: n,
38
- className: o(
48
+ step: h,
49
+ minStepsBetweenThumbs: v,
50
+ disabled: p,
51
+ defaultValue: s ? void 0 : o,
52
+ value: s ? t : l,
53
+ onValueChange: (r) => {
54
+ s && !i && T(r), y?.(r);
55
+ },
56
+ onValueCommit: k,
57
+ min: n,
58
+ max: f,
59
+ className: d(
39
60
  "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
40
- b
61
+ u
41
62
  ),
42
- ...u,
63
+ ...z,
43
64
  children: [
44
- /* @__PURE__ */ s(
45
- i.Track,
65
+ /* @__PURE__ */ b(
66
+ c.Track,
46
67
  {
47
68
  "data-slot": "slider-track",
48
- className: o(
49
- "relative grow overflow-hidden rounded-full bg-[var(--Surface-Tertiary)] data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
69
+ className: d(
70
+ "relative grow overflow-hidden rounded-full bg-[var(--Surface-Control-Track,var(--Surface-Tertiary))] data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
71
+ // forced-colors(Windows ハイコントラスト)ではレールも範囲も Canvas に置き換わり見えなかった。
72
+ // レールは輪郭線(レイアウトに影響しない outline)、範囲は OS の選択色で示す。通常表示は不変
73
+ "forced-colors:outline forced-colors:outline-1 forced-colors:outline-[CanvasText]"
50
74
  ),
51
- children: /* @__PURE__ */ s(
52
- i.Range,
75
+ children: /* @__PURE__ */ b(
76
+ c.Range,
53
77
  {
54
78
  "data-slot": "slider-range",
55
- className: o(
56
- "absolute bg-[var(--Brand-Cake-Orange)] data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
79
+ className: d(
80
+ "absolute bg-[var(--Brand-Cake-Orange)] data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full forced-colors:bg-[Highlight]"
57
81
  )
58
82
  }
59
83
  )
60
84
  }
61
85
  ),
62
- Array.from({ length: m.length }, (r, a) => /* @__PURE__ */ s(
63
- i.Thumb,
86
+ Array.from({ length: g }, (r, a) => /* @__PURE__ */ b(
87
+ c.Thumb,
64
88
  {
65
89
  "data-slot": "slider-thumb",
66
- ...v(a, m.length),
67
- className: o(
90
+ ...F(a, g),
91
+ onKeyDown: $(a),
92
+ className: d(
68
93
  "block size-5 shrink-0 rounded-full border-2 border-[var(--Brand-Cake-Orange)] bg-[var(--Surface-Primary)] shadow-sm ring-[var(--Brand-Cake-Orange)]/20 transition-[color,box-shadow,transform] hover:ring-4 hover:scale-125 focus-visible:outline-hidden active:scale-110 active:ring-6 active:shadow-md disabled:pointer-events-none disabled:opacity-50",
69
94
  // hover もリングを出すため、フォーカスは DS 共通の緑リング(FOCUS_RING)
70
95
  // で区別できるようにする(以前は hover と同じオレンジ ring-4 だった)。
71
- w
96
+ _
72
97
  )
73
98
  },
74
99
  a
@@ -78,5 +103,5 @@ function O({
78
103
  );
79
104
  }
80
105
  export {
81
- O as Slider
106
+ Q as Slider
82
107
  };
@@ -1,6 +1,6 @@
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 s, CircleCheckIcon as n } from "lucide-react";
3
+ import { Loader2Icon as t, OctagonXIcon as i, TriangleAlertIcon as o, InfoIcon as n, CircleCheckIcon as s } from "lucide-react";
4
4
  import { useTheme as v } from "next-themes";
5
5
  import { Toaster as c } from "sonner";
6
6
  const g = ({ ...a }) => {
@@ -11,11 +11,12 @@ const g = ({ ...a }) => {
11
11
  theme: e,
12
12
  className: "toaster group",
13
13
  icons: {
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)]" }),
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)]" }),
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
- loading: /* @__PURE__ */ r(t, { className: "size-4 animate-spin text-[var(--Text-Medium-Emphasis)]" })
18
+ // 動きを減らす設定では回転を止める(--Motion-* の一括制御は animate-spin に効かない)
19
+ loading: /* @__PURE__ */ r(t, { className: "size-4 animate-spin motion-reduce:animate-none text-[var(--Text-Medium-Emphasis)]" })
19
20
  },
20
21
  toastOptions: {
21
22
  classNames: {
@@ -1,16 +1,18 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import "react";
3
- import { cn as i } from "../../lib/utils.js";
4
- function m({ className: e, size: s = "md", ...a }) {
3
+ import { cn as n } from "../../lib/utils.js";
4
+ function t({ className: e, size: s = "md", ...a }) {
5
5
  return /* @__PURE__ */ r(
6
6
  "div",
7
7
  {
8
8
  "data-slot": "spinner",
9
9
  role: "status",
10
10
  "aria-label": "読み込み中",
11
- className: i(
11
+ className: n(
12
12
  // shrink-0 必須: 「読み込み中…」テキストと横並びにされるため、既定の flex-shrink:1 だと円が楕円に潰れる
13
- "shrink-0 animate-spin rounded-full border-[var(--Border-Medium-Emphasis)] border-t-[var(--Brand-Cake-Orange)]",
13
+ // motion-reduce:animate-none: 動きを減らす設定では回転を止める(--Motion-* の一括制御は
14
+ // animate-spin に効かないため個別に指定)。止めても上辺だけ色付きの欠けた輪と role="status" で処理中と分かる
15
+ "shrink-0 animate-spin motion-reduce:animate-none rounded-full border-[var(--Border-Medium-Emphasis)] border-t-[var(--Brand-Cake-Orange)]",
14
16
  {
15
17
  sm: "size-4 border-2",
16
18
  md: "size-8 border-[3px]",
@@ -24,5 +26,5 @@ function m({ className: e, size: s = "md", ...a }) {
24
26
  );
25
27
  }
26
28
  export {
27
- m as Spinner
29
+ t as Spinner
28
30
  };
@@ -1,34 +1,35 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import "react";
3
- import { Switch as s } from "radix-ui";
3
+ import { Switch as o } from "radix-ui";
4
4
  import { Check as n } from "lucide-react";
5
5
  import { cn as a } from "../../lib/utils.js";
6
- import { resolveFieldAria as d, useFieldLabelling as u } from "../../lib/field-labelling.js";
7
- function k({
8
- className: o,
6
+ 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
+ function v({
9
+ className: s,
9
10
  size: r = "default",
10
11
  ...i
11
12
  }) {
12
- const t = r === "default", c = d(i, u());
13
+ const t = r === "default", c = u(i, m());
13
14
  return /* @__PURE__ */ e(
14
- s.Root,
15
+ o.Root,
15
16
  {
16
17
  "data-slot": "switch",
17
18
  "data-size": r,
18
19
  className: a(
19
20
  "peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 transition-colors duration-[var(--Motion-Duration-Base)] outline-none",
20
- "focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50",
21
+ d,
21
22
  "disabled:cursor-not-allowed disabled:opacity-50",
22
23
  "data-[state=checked]:border-[var(--Object-Accent-Primary)] data-[state=checked]:bg-[var(--Object-Accent-Primary)]",
23
24
  "data-[state=unchecked]:border-[var(--Object-Low-Emphasis)] data-[state=unchecked]:bg-[var(--Object-Low-Emphasis)]",
24
25
  "dark:data-[state=unchecked]:border-[var(--Object-Medium-Emphasis)] dark:data-[state=unchecked]:bg-[var(--Object-Medium-Emphasis)]",
25
26
  t ? "h-8 w-[52px]" : "h-6 w-10",
26
- o
27
+ s
27
28
  ),
28
29
  ...i,
29
30
  ...c,
30
31
  children: /* @__PURE__ */ e(
31
- s.Thumb,
32
+ o.Thumb,
32
33
  {
33
34
  "data-slot": "switch-thumb",
34
35
  className: a(
@@ -50,5 +51,5 @@ function k({
50
51
  );
51
52
  }
52
53
  export {
53
- k as Switch
54
+ v as Switch
54
55
  };
@@ -1,28 +1,40 @@
1
- import { jsx as s } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import "react";
3
- import { cva as n } from "class-variance-authority";
4
- import { Tabs as e } from "radix-ui";
5
- import { cn as i } from "../../lib/utils.js";
6
- function v({
3
+ import { cva as l } from "class-variance-authority";
4
+ import { Tabs as i } from "radix-ui";
5
+ import { cn as s } from "../../lib/utils.js";
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 = [
8
+ "data-[orientation=vertical]:justify-start data-[orientation=vertical]:whitespace-normal data-[orientation=vertical]:text-left",
9
+ // underbar: 均等割り(flex-1)と下線をやめ、パネル側(右)の線で選択中を示す。高さは折り返しに合わせて伸ばす
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
+ // segment: 高さを折り返しに合わせて伸ばす(1 行なら従来の 37px)
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 = [
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
+ "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
+ ].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]";
17
+ function E({
7
18
  className: t,
8
19
  ...a
9
20
  }) {
10
- return /* @__PURE__ */ s(
11
- e.Root,
21
+ return /* @__PURE__ */ r(
22
+ i.Root,
12
23
  {
13
24
  "data-slot": "tabs",
14
- className: i("flex flex-col", t),
25
+ className: s("flex flex-col", b, t),
15
26
  ...a
16
27
  }
17
28
  );
18
29
  }
19
- const b = n(
30
+ const m = l(
20
31
  "group/tabs-list inline-flex items-center",
21
32
  {
22
33
  variants: {
23
34
  variant: {
24
35
  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"
36
+ // 縦向きでは縦長の地に rounded-full だと上下が半円になり、先頭・末尾のタブの角がはみ出すため角丸を 2xl に抑える
37
+ segment: "w-fit rounded-full bg-[var(--Surface-Tertiary)] p-2 data-[orientation=vertical]:rounded-2xl"
26
38
  },
27
39
  scrollable: {
28
40
  true: "gap-4"
@@ -46,37 +58,37 @@ const b = n(
46
58
  }
47
59
  }
48
60
  );
49
- function m({
61
+ function R({
50
62
  className: t,
51
63
  variant: a = "underbar",
52
- scrollable: r = !1,
53
- size: l = "md",
54
- ...o
64
+ scrollable: e = !1,
65
+ size: o = "md",
66
+ ...n
55
67
  }) {
56
- return /* @__PURE__ */ s(
57
- e.List,
68
+ return /* @__PURE__ */ r(
69
+ i.List,
58
70
  {
59
71
  "data-slot": "tabs-list",
60
72
  "data-variant": a,
61
- "data-scrollable": r || void 0,
62
- "data-size": l,
63
- className: i(b({ variant: a, scrollable: r, size: l }), t),
64
- ...o
73
+ "data-scrollable": e || void 0,
74
+ "data-size": o,
75
+ className: s(m({ variant: a, scrollable: e, size: o }), g, t),
76
+ ...n
65
77
  }
66
78
  );
67
79
  }
68
- function x({
80
+ function C({
69
81
  className: t,
70
82
  children: a,
71
- ...r
83
+ ...e
72
84
  }) {
73
- return /* @__PURE__ */ s(
74
- e.Trigger,
85
+ return /* @__PURE__ */ r(
86
+ i.Trigger,
75
87
  {
76
88
  "data-slot": "tabs-trigger",
77
- className: i(
78
- // Base
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",
89
+ className: s(
90
+ // Base(フォーカスの輪郭線は内側に描く: TabsList の overflow-x-auto が外側の輪郭線を全辺切り取っていた)
91
+ "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",
80
92
  // Underbar variant (default: equal-width tabs with full-width underline)
81
93
  // px-2: 均等割りで幅が詰まったとき、隣のラベルと文字が接触しないための最小余白(issue #235)
82
94
  "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)]",
@@ -84,7 +96,8 @@ function x({
84
96
  "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)]",
85
97
  // Scrollable underbar: shrink to text width, bold text, remove trigger border (underline moves to inner span)
86
98
  // 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",
99
+ // !border-r-0: 縦向き underbar の右端の線(VERTICAL_TRIGGER)も scrollable では内側 span の下線に任せる
100
+ "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:!border-r-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",
88
101
  // Segment variant
89
102
  "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
103
  // size="sm": 狭い置き場所(サイドバー等)向け。1 項目あたりの最小幅を外し、
@@ -93,30 +106,32 @@ function x({
93
106
  "group-data-[size=sm]/tabs-list:!min-w-0 group-data-[size=sm]/tabs-list:!px-2",
94
107
  // Segment active
95
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,
110
+ p,
96
111
  t
97
112
  ),
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 })
113
+ ...e,
114
+ 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)] ${v}`, children: a })
100
115
  }
101
116
  );
102
117
  }
103
- function f({
118
+ function L({
104
119
  className: t,
105
120
  ...a
106
121
  }) {
107
- return /* @__PURE__ */ s(
108
- e.Content,
122
+ return /* @__PURE__ */ r(
123
+ i.Content,
109
124
  {
110
125
  "data-slot": "tabs-content",
111
- className: i("flex-1 outline-none", t),
126
+ className: s("flex-1 outline-none", d, u, t),
112
127
  ...a
113
128
  }
114
129
  );
115
130
  }
116
131
  export {
117
- v as Tabs,
118
- f as TabsContent,
119
- m as TabsList,
120
- x as TabsTrigger,
121
- b as tabsListVariants
132
+ E as Tabs,
133
+ L as TabsContent,
134
+ R as TabsList,
135
+ C as TabsTrigger,
136
+ m as tabsListVariants
122
137
  };