@cakejp/design-system 0.20.1 → 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 +172 -0
  2. package/CLAUDE.md +5 -3
  3. package/MIGRATION.md +3 -3
  4. package/README.md +31 -11
  5. package/contracts/components.json +420 -63
  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 +87 -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 +6 -6
  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 +3051 -924
  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 +18 -16
  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,32 +1,31 @@
1
1
  "use client";
2
- import { jsxs as l, jsx as e, Fragment as c } from "react/jsx-runtime";
3
- import * as z from "react";
4
- import j from "iconsax-reactjs/dist/esm/ArrowDown2.js";
5
- import S from "iconsax-reactjs/dist/esm/ArrowRight2.js";
6
- import B from "iconsax-reactjs/dist/esm/ArrowUp2.js";
7
- import L from "iconsax-reactjs/dist/esm/Add.js";
2
+ import { jsxs as l, jsx as e, Fragment as n } from "react/jsx-runtime";
3
+ import * as E from "react";
4
+ import T from "iconsax-reactjs/dist/esm/ArrowDown2.js";
5
+ import z from "iconsax-reactjs/dist/esm/ArrowRight2.js";
6
+ import j from "iconsax-reactjs/dist/esm/ArrowUp2.js";
7
+ import S from "iconsax-reactjs/dist/esm/Add.js";
8
8
  import { X as M } from "lucide-react";
9
9
  import { cn as A } from "../../lib/utils.js";
10
- import { resolveLinkComponent as m } from "../../lib/link-component.js";
11
10
  import { Button as x } from "../foundations/button.js";
12
11
  const v = "flex min-h-12 items-center gap-1 mx-2 rounded-lg px-2 py-3 typo-body-md text-[var(--Text-High-Emphasis)] transition-colors duration-[var(--Motion-Duration-Base)] ease-[var(--Motion-Easing-Standard)] hover:bg-[var(--Surface-Secondary)] active:bg-[var(--Surface-Tertiary)]";
13
- function _({
12
+ function U({
14
13
  userName: r,
15
14
  isLoggedIn: t = !1,
16
- hideLoginLink: d = !1,
15
+ hideLoginLink: o = !1,
17
16
  sections: g,
18
- banners: o,
19
- onClose: h,
20
- onLogin: p,
17
+ banners: c,
18
+ onClose: d,
19
+ onLogin: m,
21
20
  loginHref: N = "/security/login_link/",
22
21
  className: b,
23
- linkComponent: n,
22
+ linkComponent: h,
24
23
  ...y
25
24
  }) {
26
- const w = m(n), k = m(n), [f, E] = z.useState(
25
+ const p = h ?? "a", [f, w] = E.useState(
27
26
  /* @__PURE__ */ new Set()
28
- ), T = (a) => {
29
- E((i) => {
27
+ ), k = (a) => {
28
+ w((i) => {
30
29
  const s = new Set(i);
31
30
  return s.has(a) ? s.delete(a) : s.add(a), s;
32
31
  });
@@ -41,33 +40,33 @@ function _({
41
40
  ),
42
41
  ...y,
43
42
  children: [
44
- (t || h) && /* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3", children: [
43
+ (t || d) && /* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3", children: [
45
44
  t ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ l("p", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: [
46
45
  r ?? "ゲスト",
47
46
  "さま"
48
47
  ] }) }) : /* @__PURE__ */ e("div", {}),
49
- h && /* @__PURE__ */ e(
48
+ d && /* @__PURE__ */ e(
50
49
  x,
51
50
  {
52
51
  variant: "ghost",
53
52
  size: "icon-sm",
54
- onClick: h,
53
+ onClick: d,
55
54
  "aria-label": "メニューを閉じる",
56
55
  children: /* @__PURE__ */ e(M, { className: "size-5" })
57
56
  }
58
57
  )
59
58
  ] }),
60
- !t && !d && /* @__PURE__ */ l(c, { children: [
59
+ !t && !o && /* @__PURE__ */ l(n, { children: [
61
60
  /* @__PURE__ */ e("div", { className: "py-2", children: /* @__PURE__ */ e("ul", { children: /* @__PURE__ */ e("li", { children: /* @__PURE__ */ l(
62
- w,
61
+ p,
63
62
  {
64
63
  href: N,
65
- onClick: p ? (a) => {
66
- a.preventDefault(), p();
64
+ onClick: m ? (a) => {
65
+ a.preventDefault(), m();
67
66
  } : void 0,
68
67
  className: v,
69
68
  children: [
70
- /* @__PURE__ */ e("span", { className: "flex size-5 shrink-0 items-center justify-center text-[var(--Text-Medium-Emphasis)]", children: /* @__PURE__ */ e(L, { size: 16 }) }),
69
+ /* @__PURE__ */ e("span", { className: "flex size-5 shrink-0 items-center justify-center text-[var(--Text-Medium-Emphasis)]", children: /* @__PURE__ */ e(S, { size: 16 }) }),
71
70
  /* @__PURE__ */ e("span", { className: "flex-1", children: "ログイン・新規会員登録" })
72
71
  ]
73
72
  }
@@ -82,29 +81,29 @@ function _({
82
81
  a.icon && /* @__PURE__ */ e("span", { className: "flex size-5 shrink-0 items-center justify-center", children: a.icon }),
83
82
  /* @__PURE__ */ e("span", { children: a.title })
84
83
  ] }) }),
85
- /* @__PURE__ */ e("ul", { children: a.items.map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(u, { linkComponent: n, item: s }) }, s.label)) }),
86
- a.itemsExtra && a.itemsExtra.length > 0 && /* @__PURE__ */ l(c, { children: [
87
- f.has(i) && /* @__PURE__ */ e("ul", { children: a.itemsExtra.map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(u, { linkComponent: n, item: s }) }, s.label)) }),
84
+ /* @__PURE__ */ e("ul", { children: a.items.map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(u, { linkComponent: h, item: s }) }, s.label)) }),
85
+ a.itemsExtra && a.itemsExtra.length > 0 && /* @__PURE__ */ l(n, { children: [
86
+ f.has(i) && /* @__PURE__ */ e("ul", { children: a.itemsExtra.map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(u, { linkComponent: h, item: s }) }, s.label)) }),
88
87
  /* @__PURE__ */ e(
89
88
  x,
90
89
  {
91
90
  variant: "ghost",
92
91
  className: "flex w-full items-center justify-center gap-1 rounded-none px-4 py-3 typo-label-md text-[var(--Text-Accent-Primary)]",
93
- onClick: () => T(i),
94
- children: f.has(i) ? /* @__PURE__ */ l(c, { children: [
92
+ onClick: () => k(i),
93
+ children: f.has(i) ? /* @__PURE__ */ l(n, { children: [
95
94
  /* @__PURE__ */ e("span", { children: "折りたたむ" }),
96
- /* @__PURE__ */ e(B, { size: 16 })
97
- ] }) : /* @__PURE__ */ l(c, { children: [
98
- /* @__PURE__ */ e("span", { children: "すべて表示" }),
99
95
  /* @__PURE__ */ e(j, { size: 16 })
96
+ ] }) : /* @__PURE__ */ l(n, { children: [
97
+ /* @__PURE__ */ e("span", { children: "すべて表示" }),
98
+ /* @__PURE__ */ e(T, { size: 16 })
100
99
  ] })
101
100
  }
102
101
  )
103
102
  ] })
104
103
  ] })
105
104
  ] }, i)),
106
- o && o.length > 0 && /* @__PURE__ */ e("div", { className: "px-6 py-6", children: /* @__PURE__ */ e("ul", { className: "flex justify-center", children: o.map((a, i) => /* @__PURE__ */ e("li", { className: "w-1/2 max-w-28 px-2", children: /* @__PURE__ */ e(
107
- k,
105
+ c && c.length > 0 && /* @__PURE__ */ e("div", { className: "px-6 py-6", children: /* @__PURE__ */ e("ul", { className: "flex justify-center", children: c.map((a, i) => /* @__PURE__ */ e("li", { className: "w-1/2 max-w-28 px-2", children: /* @__PURE__ */ e(
106
+ p,
108
107
  {
109
108
  href: a.href ?? "#",
110
109
  className: "block overflow-hidden rounded",
@@ -125,9 +124,8 @@ function _({
125
124
  );
126
125
  }
127
126
  function u({ item: r, linkComponent: t }) {
128
- const d = m(t);
129
127
  return /* @__PURE__ */ l(
130
- d,
128
+ t ?? "a",
131
129
  {
132
130
  href: r.href ?? "#",
133
131
  onClick: r.onClick,
@@ -148,11 +146,11 @@ function u({ item: r, linkComponent: t }) {
148
146
  r.badge && /* @__PURE__ */ e("span", { className: "rounded-full bg-[var(--Brand-Cake-Orange)] px-2 py-0.5 typo-label-xs text-[var(--Text-on-Inverse)]", children: r.badge }),
149
147
  r.subText && /* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: r.subText })
150
148
  ] }),
151
- r.hasChildren && /* @__PURE__ */ e(S, { size: 16, className: "shrink-0 text-[var(--Object-High-Emphasis)]" })
149
+ r.hasChildren && /* @__PURE__ */ e(z, { size: 16, className: "shrink-0 text-[var(--Object-High-Emphasis)]" })
152
150
  ]
153
151
  }
154
152
  );
155
153
  }
156
154
  export {
157
- _ as MenuDrawer
155
+ U as MenuDrawer
158
156
  };
@@ -1,75 +1,103 @@
1
1
  "use client";
2
- import { jsxs as r, jsx as a } from "react/jsx-runtime";
3
- import * as E from "react";
4
- import { ChevronsUpDown as P, Check as S } from "lucide-react";
5
- import { cn as b } from "../../lib/utils.js";
6
- import { Button as k } from "../foundations/button.js";
7
- import { Command as O, CommandInput as T, CommandList as A, CommandEmpty as F, CommandGroup as I, CommandItem as M } from "../foundations/command.js";
8
- import { Popover as R, PopoverTrigger as B, PopoverContent as G } from "../foundations/popover.js";
9
- import { useFieldLabelling as H, resolveFieldAria as U } from "../../lib/field-labelling.js";
10
- import { Chip as $ } from "./chip.js";
11
- function W({
12
- options: n,
2
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
3
+ import * as t from "react";
4
+ import { ChevronsUpDown as I, Check as O } from "lucide-react";
5
+ import { cn as m } from "../../lib/utils.js";
6
+ import { Button as P } from "../foundations/button.js";
7
+ import { Command as k, CommandInput as B, CommandList as H, CommandEmpty as F, CommandGroup as G, CommandItem as L } from "../foundations/command.js";
8
+ import { Popover as M, PopoverTrigger as U, PopoverContent as _ } from "../foundations/popover.js";
9
+ import { useFieldLabelling as $, resolveFieldAria as q } from "../../lib/field-labelling.js";
10
+ import { HIGH_CONTRAST_OUTLINE as z } from "../../lib/high-contrast.js";
11
+ import { Chip as D } from "./chip.js";
12
+ function le({
13
+ options: u,
13
14
  value: l = [],
14
- onValueChange: f,
15
- placeholder: d = "選択してください",
16
- searchPlaceholder: v = "検索",
17
- emptyLabel: g = "候補がありません",
18
- disabled: m,
19
- className: x,
20
- id: o,
21
- "aria-invalid": y,
22
- "aria-describedby": c,
23
- "aria-label": t,
24
- "aria-labelledby": s
15
+ onValueChange: R,
16
+ placeholder: f = "選択してください",
17
+ searchPlaceholder: w = "検索",
18
+ emptyLabel: E = "候補がありません",
19
+ disabled: v,
20
+ className: T,
21
+ id: h,
22
+ "aria-invalid": p,
23
+ "aria-describedby": b,
24
+ "aria-label": s,
25
+ "aria-labelledby": c
25
26
  }) {
26
- const [p, C] = E.useState(!1), i = n.filter((e) => l.includes(e.value)), h = H(), w = U(
27
+ const [g, S] = t.useState(!1), n = u.filter((e) => l.includes(e.value)), x = $(), j = q(
27
28
  {
28
- id: o,
29
- "aria-label": t,
30
- "aria-labelledby": s,
31
- "aria-describedby": c
29
+ id: h,
30
+ "aria-label": s,
31
+ "aria-labelledby": c,
32
+ "aria-describedby": b,
33
+ // 渡さないと、利用側の明示指定が FormField 由来の値(error の有無)で上書きされる
34
+ "aria-invalid": p
32
35
  },
33
- h
34
- ), N = !h && !t && !s ? d : void 0, u = (e) => f?.(l.includes(e) ? l.filter((j) => j !== e) : [...l, e]);
35
- return /* @__PURE__ */ r("div", { "data-slot": "multi-select", className: b("flex flex-col gap-2", x), children: [
36
- /* @__PURE__ */ r(R, { open: p, onOpenChange: C, children: [
37
- /* @__PURE__ */ a(B, { asChild: !0, children: /* @__PURE__ */ r(
38
- k,
36
+ x
37
+ ), A = !x && !s && !c ? f : void 0, C = (e) => R?.(l.includes(e) ? l.filter((a) => a !== e) : [...l, e]), y = t.useRef(null), d = t.useRef(null), o = t.useRef(null);
38
+ return t.useEffect(() => {
39
+ const e = o.current;
40
+ if (!e) return;
41
+ const a = document.activeElement;
42
+ if (l.includes(e.value)) {
43
+ a?.isConnected && d.current?.contains(a) || (o.current = null);
44
+ return;
45
+ }
46
+ if (o.current = null, a && a !== document.body && a.isConnected) return;
47
+ const N = Array.from(
48
+ d.current?.querySelectorAll('[data-slot="chip-remove"]') ?? []
49
+ );
50
+ (N[e.index] ?? N[e.index - 1] ?? y.current)?.focus();
51
+ }, [l]), /* @__PURE__ */ i("div", { "data-slot": "multi-select", className: m("flex flex-col gap-2", T), children: [
52
+ /* @__PURE__ */ i(M, { open: g, onOpenChange: S, children: [
53
+ /* @__PURE__ */ r(U, { asChild: !0, children: /* @__PURE__ */ i(
54
+ P,
39
55
  {
56
+ ref: y,
40
57
  type: "button",
41
58
  variant: "tertiary",
42
59
  role: "combobox",
43
- id: o,
44
- "aria-expanded": p,
60
+ id: h,
61
+ "aria-expanded": g,
45
62
  "aria-haspopup": "listbox",
46
- "aria-invalid": y,
47
- "aria-describedby": c,
48
- "aria-label": t ?? N,
49
- "aria-labelledby": s,
50
- ...w,
51
- disabled: m,
52
- className: "w-full justify-between bg-[var(--Surface-Primary)]",
63
+ "aria-invalid": p,
64
+ "aria-describedby": b,
65
+ "aria-label": s ?? A,
66
+ "aria-labelledby": c,
67
+ ...j,
68
+ disabled: v,
69
+ className: m(
70
+ "w-full justify-between bg-[var(--Surface-Primary)]",
71
+ // 高コントラスト(prefers-contrast: more / data-contrast="more")のときだけ見える内側 1px の輪郭(#301)
72
+ z,
73
+ // エラー時の赤枠。トリガーは Button tertiary(枠幅 0)なので border 色だけ変えても見えず、
74
+ // border を足すと 1px 広がる。内側リング(inset-ring)で描いて高さを変えない。
75
+ // inset-ring は ring(フォーカスリング)と別の box-shadow 層なので同時に表示される。
76
+ "aria-invalid:inset-ring-1 aria-invalid:inset-ring-[var(--Border-Caution)]",
77
+ // forced-colors(Windows ハイコントラスト)では box-shadow が消えるため、エラー時だけ輪郭線
78
+ // (outline。レイアウトに影響しない)で境界を出す。forced-colors 以外では効かない
79
+ "forced-colors:aria-invalid:outline-solid forced-colors:aria-invalid:outline-1 forced-colors:aria-invalid:-outline-offset-1 forced-colors:aria-invalid:outline-[CanvasText]"
80
+ ),
53
81
  children: [
54
- /* @__PURE__ */ a("span", { className: i.length ? "text-[var(--Text-High-Emphasis)]" : "text-[var(--Text-Low-Emphasis)]", children: i.length ? `${i.length}件選択中` : d }),
55
- /* @__PURE__ */ a(P, { "aria-hidden": "true", className: "text-[var(--Object-Medium-Emphasis)]" })
82
+ /* @__PURE__ */ r("span", { className: n.length ? "text-[var(--Text-High-Emphasis)]" : "text-[var(--Text-Low-Emphasis)]", children: n.length ? `${n.length}件選択中` : f }),
83
+ /* @__PURE__ */ r(I, { "aria-hidden": "true", className: "text-[var(--Object-Medium-Emphasis)]" })
56
84
  ]
57
85
  }
58
86
  ) }),
59
- /* @__PURE__ */ a(G, { align: "start", className: "w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ r(O, { children: [
60
- /* @__PURE__ */ a(T, { placeholder: v }),
61
- /* @__PURE__ */ r(A, { children: [
62
- /* @__PURE__ */ a(F, { children: g }),
63
- /* @__PURE__ */ a(I, { children: n.map((e) => /* @__PURE__ */ r(
64
- M,
87
+ /* @__PURE__ */ r(_, { align: "start", className: "w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ i(k, { children: [
88
+ /* @__PURE__ */ r(B, { placeholder: w }),
89
+ /* @__PURE__ */ i(H, { children: [
90
+ /* @__PURE__ */ r(F, { children: E }),
91
+ /* @__PURE__ */ r(G, { children: u.map((e) => /* @__PURE__ */ i(
92
+ L,
65
93
  {
66
94
  value: [e.label, ...e.keywords ?? []].join(" "),
67
95
  disabled: e.disabled,
68
- onSelect: () => u(e.value),
96
+ onSelect: () => C(e.value),
69
97
  children: [
70
- /* @__PURE__ */ a(S, { "aria-hidden": "true", className: b(l.includes(e.value) ? "opacity-100" : "opacity-0") }),
98
+ /* @__PURE__ */ r(O, { "aria-hidden": "true", className: m(l.includes(e.value) ? "opacity-100" : "opacity-0") }),
71
99
  e.label,
72
- l.includes(e.value) && /* @__PURE__ */ a("span", { className: "sr-only", children: "選択済み" })
100
+ l.includes(e.value) && /* @__PURE__ */ r("span", { className: "sr-only", children: "選択済み" })
73
101
  ]
74
102
  },
75
103
  e.value
@@ -77,12 +105,15 @@ function W({
77
105
  ] })
78
106
  ] }) })
79
107
  ] }),
80
- i.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1.5", role: "group", "aria-label": "選択済み", children: i.map((e) => /* @__PURE__ */ a(
81
- $,
108
+ n.length > 0 && /* @__PURE__ */ r("div", { ref: d, className: "flex flex-wrap gap-1.5", role: "group", "aria-label": "選択済み", children: n.map((e, a) => /* @__PURE__ */ r(
109
+ D,
82
110
  {
83
111
  removable: !0,
84
- onRemove: () => u(e.value),
85
- disabled: m,
112
+ removeLabel: `${e.label}を削除`,
113
+ onRemove: () => {
114
+ o.current = { value: e.value, index: a }, C(e.value);
115
+ },
116
+ disabled: v,
86
117
  children: e.label
87
118
  },
88
119
  e.value
@@ -90,5 +121,5 @@ function W({
90
121
  ] });
91
122
  }
92
123
  export {
93
- W as MultiSelect
124
+ le as MultiSelect
94
125
  };
@@ -1,13 +1,14 @@
1
1
  import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
2
  import "react";
3
- import d from "iconsax-reactjs/dist/esm/Notification.js";
4
- import h from "iconsax-reactjs/dist/esm/ArrowRight2.js";
5
- import { Badge as m } from "../foundations/badge.js";
3
+ import h from "iconsax-reactjs/dist/esm/Notification.js";
4
+ import m from "iconsax-reactjs/dist/esm/ArrowRight2.js";
5
+ import { Badge as p } from "../foundations/badge.js";
6
6
  import { cn as l } from "../../lib/utils.js";
7
- function g({
7
+ function u({
8
8
  notifications: r,
9
9
  variant: n = "vertical",
10
10
  emptyMessage: c = "新着のお知らせはありません",
11
+ linkComponent: d,
11
12
  className: i,
12
13
  ...t
13
14
  }) {
@@ -21,7 +22,7 @@ function g({
21
22
  ),
22
23
  ...t,
23
24
  children: [
24
- /* @__PURE__ */ a(d, { size: 48, className: "text-[var(--Text-Low-Emphasis)]" }),
25
+ /* @__PURE__ */ a(h, { size: 48, className: "text-[var(--Text-Low-Emphasis)]" }),
25
26
  /* @__PURE__ */ a("p", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: c })
26
27
  ]
27
28
  }
@@ -32,7 +33,7 @@ function g({
32
33
  className: l("w-full divide-y divide-[var(--Border-Low-Emphasis)]", i),
33
34
  ...t,
34
35
  children: r.map((e) => {
35
- const o = e.href ? "a" : "div";
36
+ const o = e.href ? d ?? "a" : "div";
36
37
  return n === "horizontal" ? /* @__PURE__ */ s(
37
38
  o,
38
39
  {
@@ -41,10 +42,10 @@ function g({
41
42
  children: [
42
43
  /* @__PURE__ */ a("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)] shrink-0 w-[88px]", children: e.date }),
43
44
  /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
44
- e.isUnread && /* @__PURE__ */ a(m, { variant: "destructive", className: "shrink-0 w-fit", children: "NEW" }),
45
+ e.isUnread && /* @__PURE__ */ a(p, { variant: "destructive", className: "shrink-0 w-fit", children: "NEW" }),
45
46
  /* @__PURE__ */ a("span", { className: "typo-body-md text-[var(--Text-High-Emphasis)] truncate", children: e.message })
46
47
  ] }),
47
- /* @__PURE__ */ a(h, { size: 16, className: "text-[var(--Text-Low-Emphasis)] shrink-0 ml-auto" })
48
+ /* @__PURE__ */ a(m, { size: 16, className: "text-[var(--Text-Low-Emphasis)] shrink-0 ml-auto" })
48
49
  ]
49
50
  },
50
51
  e.id
@@ -68,5 +69,5 @@ function g({
68
69
  );
69
70
  }
70
71
  export {
71
- g as NotificationList
72
+ u as NotificationList
72
73
  };