@cakejp/design-system 0.20.1 → 0.21.1

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 +181 -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 +103 -83
  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 +3070 -925
  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 +13 -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,34 +1,35 @@
1
- import { jsxs as l, jsx as a, Fragment as w } from "react/jsx-runtime";
1
+ import { jsxs as s, jsx as a, Fragment as N } from "react/jsx-runtime";
2
2
  import "react";
3
- import { cn as s } from "../../lib/utils.js";
4
- import { SectionHeader as v } from "./section-header.js";
5
- const N = {
3
+ import { cn as l } from "../../lib/utils.js";
4
+ import { SectionHeader as y } from "./section-header.js";
5
+ const C = {
6
6
  sm: "size-[60px]",
7
7
  md: "size-[100px]",
8
8
  lg: "size-[120px]"
9
- }, y = {
9
+ }, b = {
10
10
  sm: "max-w-[60px]",
11
11
  md: "max-w-[100px]",
12
12
  lg: "max-w-[120px]"
13
- }, C = {
13
+ }, k = {
14
14
  sm: "calc((100vw - 32px) / 4.05)",
15
15
  md: "calc((100vw - 32px) / 3.5)",
16
16
  lg: "calc((100vw - 32px) / 3.0)"
17
17
  };
18
- function A({
19
- title: m,
20
- moreHref: d,
21
- headerSize: x = "lg",
18
+ function q({
19
+ title: d,
20
+ moreHref: x,
21
+ headerSize: n = "lg",
22
22
  items: r,
23
23
  thumbnailSize: c = "md",
24
- thumbnailShape: n = "square",
24
+ thumbnailShape: g = "square",
25
25
  layout: h = "scroll",
26
- gridRows: g = 3,
26
+ gridRows: u = 3,
27
27
  pcGridCols: o,
28
- className: u
28
+ className: f,
29
+ linkComponent: t
29
30
  }) {
30
- const f = n === "circle" ? "rounded-full" : "rounded-lg", i = (e, t, p) => /* @__PURE__ */ l(
31
- "a",
31
+ const w = t ?? "a", v = g === "circle" ? "rounded-full" : "rounded-lg", i = (e, p, m) => /* @__PURE__ */ s(
32
+ w,
32
33
  {
33
34
  href: e.href,
34
35
  className: "flex flex-col items-center gap-1.5 group shrink-0",
@@ -36,10 +37,10 @@ function A({
36
37
  /* @__PURE__ */ a(
37
38
  "div",
38
39
  {
39
- className: s(
40
+ className: l(
40
41
  "overflow-hidden shrink-0",
41
- t ? "size-24" : p ? "w-full aspect-square" : N[c],
42
- f
42
+ p ? "size-24" : m ? "w-full aspect-square" : C[c],
43
+ v
43
44
  ),
44
45
  children: /* @__PURE__ */ a(
45
46
  "img",
@@ -54,9 +55,9 @@ function A({
54
55
  /* @__PURE__ */ a(
55
56
  "span",
56
57
  {
57
- className: s(
58
+ className: l(
58
59
  "typo-label-sm text-[var(--Text-High-Emphasis)] text-center",
59
- t ? "max-w-[96px]" : p ? "w-full" : y[c]
60
+ p ? "max-w-[96px]" : m ? "w-full" : b[c]
60
61
  ),
61
62
  children: e.name
62
63
  }
@@ -65,23 +66,32 @@ function A({
65
66
  },
66
67
  e.href
67
68
  );
68
- return /* @__PURE__ */ l("section", { "data-slot": "category-scroll", className: s(
69
+ return /* @__PURE__ */ s("section", { "data-slot": "category-scroll", className: l(
69
70
  // w-full: CSS Grid 直下で mx-auto が justify-self: stretch を無効化し
70
71
  // max-content 幅に縮むのを防ぐ(#207)。block 文脈の挙動は変わらない
71
72
  "w-full py-4 @[960px]:max-w-[960px] @[960px]:mx-auto",
72
- u
73
+ f
73
74
  ), children: [
74
- /* @__PURE__ */ a(v, { title: m, moreHref: d, size: x, className: "px-4" }),
75
- h === "grid" ? /* @__PURE__ */ l(w, { children: [
76
- /* @__PURE__ */ l("div", { className: s("mt-3 overflow-x-auto pl-4 pb-2 scrollbar-hide", o && "@[960px]:hidden"), children: [
75
+ /* @__PURE__ */ a(
76
+ y,
77
+ {
78
+ title: d,
79
+ moreHref: x,
80
+ size: n,
81
+ linkComponent: t,
82
+ className: "px-4"
83
+ }
84
+ ),
85
+ h === "grid" ? /* @__PURE__ */ s(N, { children: [
86
+ /* @__PURE__ */ s("div", { className: l("mt-3 overflow-x-auto pl-4 pb-2 scrollbar-hide", o && "@[960px]:hidden"), children: [
77
87
  /* @__PURE__ */ a(
78
88
  "div",
79
89
  {
80
90
  className: "grid gap-2",
81
91
  style: {
82
- gridTemplateRows: `repeat(${g}, auto)`,
92
+ gridTemplateRows: `repeat(${u}, auto)`,
83
93
  gridAutoFlow: "column",
84
- gridAutoColumns: C[c]
94
+ gridAutoColumns: k[c]
85
95
  },
86
96
  children: r.map((e) => i(e, !1, !0))
87
97
  }
@@ -98,7 +108,7 @@ function A({
98
108
  )
99
109
  ] }) : (
100
110
  /* デフォルト: 横スクロール1行 */
101
- /* @__PURE__ */ l("div", { className: "mt-3 flex gap-3 overflow-x-auto pl-4 pb-2 scrollbar-hide", children: [
111
+ /* @__PURE__ */ s("div", { className: "mt-3 flex gap-3 overflow-x-auto pl-4 pb-2 scrollbar-hide", children: [
102
112
  r.map((e) => i(e)),
103
113
  /* @__PURE__ */ a("div", { className: "shrink-0 w-4", "aria-hidden": "true" })
104
114
  ] })
@@ -106,5 +116,5 @@ function A({
106
116
  ] });
107
117
  }
108
118
  export {
109
- A as CategoryScroll
119
+ q as CategoryScroll
110
120
  };
@@ -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 f({ items: s, className: c }) {
4
+ function g({ items: c, className: s, linkComponent: l }) {
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
- c
11
+ s
12
12
  ),
13
13
  children: [
14
- s.map((r, t) => {
15
- const l = !!r.href || !!r.onClick, n = r.href ? "a" : "button", i = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
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 };
16
16
  return /* @__PURE__ */ o(
17
- n,
17
+ i,
18
18
  {
19
- ...i,
19
+ ...d,
20
20
  className: a(
21
21
  "flex shrink-0 flex-col items-center gap-1 rounded-lg p-1 transition-colors",
22
- l && "hover:bg-[var(--Surface-Secondary)]",
22
+ t && "hover:bg-[var(--Surface-Secondary)]",
23
23
  r.isSelected && "bg-[var(--Surface-Accent-Primary-Light)]"
24
24
  ),
25
25
  children: [
@@ -53,7 +53,7 @@ function f({ items: s, className: c }) {
53
53
  )
54
54
  ]
55
55
  },
56
- t
56
+ n
57
57
  );
58
58
  }),
59
59
  /* @__PURE__ */ e("div", { className: "shrink-0 w-2", "aria-hidden": "true" })
@@ -62,5 +62,5 @@ function f({ items: s, className: c }) {
62
62
  );
63
63
  }
64
64
  export {
65
- f as CategoryShortcuts
65
+ g as CategoryShortcuts
66
66
  };
@@ -1,109 +1,112 @@
1
1
  "use client";
2
- import { jsxs as w, jsx as o } from "react/jsx-runtime";
2
+ import { jsxs as C, jsx as r } from "react/jsx-runtime";
3
3
  import * as s from "react";
4
- import { SendHorizontal as q } from "lucide-react";
5
- import { cn as G } from "../../lib/utils.js";
6
- import { Button as J } from "../foundations/button.js";
7
- import { FileInput as M } from "../foundations/file-input.js";
8
- import { Textarea as O } from "../foundations/textarea.js";
9
- import { Chip as Q } from "./chip.js";
10
- function ee({
11
- value: a,
12
- onChange: C,
4
+ import { SendHorizontal as G } from "lucide-react";
5
+ import { cn as O } from "../../lib/utils.js";
6
+ import { FOCUS_RING_WITHIN as U } from "../../lib/focus-ring.js";
7
+ import { Button as W } from "../foundations/button.js";
8
+ import { FileInput as q } from "../foundations/file-input.js";
9
+ import { Textarea as J } from "../foundations/textarea.js";
10
+ import { Chip as M } from "./chip.js";
11
+ function re({
12
+ value: l,
13
+ onChange: N,
13
14
  onSubmit: S,
14
- submitKey: N = "enter",
15
+ submitKey: w = "enter",
15
16
  attachments: d,
16
- onAttachmentsChange: k,
17
- accept: z,
18
- maxFiles: l,
17
+ onAttachmentsChange: I,
18
+ accept: k,
19
+ maxFiles: a,
19
20
  maxSizeMb: f,
20
21
  onAttachmentError: u,
21
- disabled: n = !1,
22
- isSubmitting: h = !1,
23
- placeholder: E = "メッセージを入力",
24
- maxLength: p,
25
- label: F = "メッセージを入力",
26
- rows: K = 2,
27
- id: I,
28
- autoFocus: R,
29
- className: H
22
+ disabled: i = !1,
23
+ isSubmitting: p = !1,
24
+ placeholder: z = "メッセージを入力",
25
+ maxLength: h,
26
+ label: K = "メッセージを入力",
27
+ rows: F = 2,
28
+ id: R,
29
+ autoFocus: E,
30
+ className: j
30
31
  }) {
31
- const j = s.useId(), g = I ?? j, b = d !== void 0, [B, D] = s.useState([]), t = b ? d : B, [L, P] = s.useState(0), c = s.useRef(!1), m = n || h, x = !m && (a.trim().length > 0 || t.length > 0), y = (e) => {
32
- b || D(e), k?.(e);
32
+ const B = s.useId(), b = R ?? B, g = d !== void 0, [D, H] = s.useState([]), t = g ? d : D, [_, L] = s.useState(0), c = s.useRef(!1), m = i || p, y = !m && (l.trim().length > 0 || t.length > 0), x = (e) => {
33
+ g || H(e), I?.(e);
33
34
  }, v = () => {
34
- x && S(a, t);
35
- }, $ = (e) => {
35
+ y && S(l, t);
36
+ }, P = (e) => {
36
37
  if (e.key !== "Enter" || c.current || e.nativeEvent.isComposing) return;
37
- const r = e.metaKey || e.ctrlKey;
38
- if (N === "mod-enter") {
39
- if (!r) return;
38
+ const o = e.metaKey || e.ctrlKey;
39
+ if (w === "mod-enter") {
40
+ if (!o) return;
40
41
  } else if (e.shiftKey)
41
42
  return;
42
43
  e.preventDefault(), v();
43
44
  }, T = (e) => {
44
- if (P((i) => i + 1), e.length === 0) return;
45
- let r = t;
46
- for (const i of e) {
47
- if (l != null && r.length >= l) {
48
- u?.({ code: "max-files", file: i, limit: l });
45
+ if (L((n) => n + 1), e.length === 0) return;
46
+ let o = t;
47
+ for (const n of e) {
48
+ if (a != null && o.length >= a) {
49
+ u?.({ code: "max-files", file: n, limit: a });
49
50
  continue;
50
51
  }
51
- r = [...r, i];
52
+ o = [...o, n];
52
53
  }
53
- r !== t && y(r);
54
- }, _ = (e) => {
55
- y(t.filter((r, i) => i !== e));
54
+ o !== t && x(o);
55
+ }, $ = (e) => {
56
+ x(t.filter((o, n) => n !== e));
56
57
  };
57
- return /* @__PURE__ */ w(
58
+ return /* @__PURE__ */ C(
58
59
  "div",
59
60
  {
60
61
  "data-slot": "chat-composer",
61
- "data-disabled": n || void 0,
62
- className: G(
62
+ "data-disabled": i || void 0,
63
+ className: O(
63
64
  "flex flex-col gap-2 rounded-xl border border-[var(--Border-High-Emphasis)] bg-[var(--Surface-Primary)] p-2 transition-[color,box-shadow,border-color]",
64
- "focus-within:border-[var(--Focus-High-Emphasis)] focus-within:ring-[3px] focus-within:ring-[var(--Focus-High-Emphasis)]/50",
65
- n && "border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Secondary)]",
66
- H
65
+ // フォーカス意匠は DS 共通(FOCUS_RING_WITHIN。以前は同じクラスを手で書いていた)。
66
+ // 枠はこのラッパーが描く(内側の Textarea はリングを消している)
67
+ U,
68
+ i && "border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Secondary)]",
69
+ j
67
70
  ),
68
71
  children: [
69
- t.length > 0 && /* @__PURE__ */ o("ul", { "data-slot": "chat-composer-attachments", className: "flex flex-wrap gap-2", children: t.map((e, r) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
70
- Q,
72
+ t.length > 0 && /* @__PURE__ */ r("ul", { "data-slot": "chat-composer-attachments", className: "flex flex-wrap gap-2", children: t.map((e, o) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
73
+ M,
71
74
  {
72
75
  size: "sm",
73
76
  removable: !0,
74
77
  disabled: m,
75
- onRemove: () => _(r),
78
+ onRemove: () => $(o),
76
79
  children: e.name
77
80
  }
78
- ) }, `${e.name}-${r}`)) }),
79
- /* @__PURE__ */ o("label", { htmlFor: g, className: "sr-only", children: F }),
80
- /* @__PURE__ */ o(
81
- O,
81
+ ) }, `${e.name}-${o}`)) }),
82
+ /* @__PURE__ */ r("label", { htmlFor: b, className: "sr-only", children: K }),
83
+ /* @__PURE__ */ r(
84
+ J,
82
85
  {
83
- id: g,
84
- rows: K,
85
- value: a,
86
- maxLength: p,
87
- showCount: p != null,
88
- placeholder: E,
89
- disabled: n,
90
- autoFocus: R,
91
- onChange: (e) => C(e.target.value),
92
- onKeyDown: $,
86
+ id: b,
87
+ rows: F,
88
+ value: l,
89
+ maxLength: h,
90
+ showCount: h != null,
91
+ placeholder: z,
92
+ disabled: i,
93
+ autoFocus: E,
94
+ onChange: (e) => N(e.target.value),
95
+ onKeyDown: P,
93
96
  onCompositionStart: () => {
94
97
  c.current = !0;
95
98
  },
96
99
  onCompositionEnd: () => {
97
100
  c.current = !1;
98
101
  },
99
- className: "max-h-40 resize-none border-0 bg-transparent px-2 py-1.5 focus-visible:ring-0 disabled:bg-transparent"
102
+ className: "max-h-40 resize-none border-0 bg-transparent px-2 py-1.5 focus-visible:ring-0 forced-colors:focus-visible:outline-none disabled:bg-transparent"
100
103
  }
101
104
  ),
102
- /* @__PURE__ */ w("div", { className: "flex items-center justify-between gap-2", children: [
103
- /* @__PURE__ */ o(
104
- M,
105
+ /* @__PURE__ */ C("div", { className: "flex items-center justify-between gap-2", children: [
106
+ /* @__PURE__ */ r(
107
+ q,
105
108
  {
106
- accept: z,
109
+ accept: k,
107
110
  multiple: !0,
108
111
  disabled: m,
109
112
  maxSize: f != null ? f * 1024 * 1024 : void 0,
@@ -118,18 +121,18 @@ function ee({
118
121
  }),
119
122
  className: "shrink-0"
120
123
  },
121
- L
124
+ _
122
125
  ),
123
- /* @__PURE__ */ o(
124
- J,
126
+ /* @__PURE__ */ r(
127
+ W,
125
128
  {
126
129
  type: "button",
127
130
  size: "icon",
128
131
  className: "shrink-0 rounded-full",
129
- disabled: !x,
130
- "aria-label": h ? "送信中" : "送信",
132
+ disabled: !y,
133
+ "aria-label": p ? "送信中" : "送信",
131
134
  onClick: v,
132
- children: /* @__PURE__ */ o(q, { className: "size-4", "aria-hidden": "true" })
135
+ children: /* @__PURE__ */ r(G, { className: "size-4", "aria-hidden": "true" })
133
136
  }
134
137
  )
135
138
  ] })
@@ -138,5 +141,5 @@ function ee({
138
141
  );
139
142
  }
140
143
  export {
141
- ee as ChatComposer
144
+ re as ChatComposer
142
145
  };
@@ -1,123 +1,146 @@
1
- import { jsx as t, jsxs as n, Fragment as S } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as s, Fragment as R } from "react/jsx-runtime";
2
2
  import "react";
3
- import { X as T } from "lucide-react";
4
- import { cn as s } from "../../lib/utils.js";
5
- import { chipVariants as b } from "../foundations/chip-variants.js";
6
- function E({
3
+ import { X as _ } from "lucide-react";
4
+ import { cn as l } from "../../lib/utils.js";
5
+ import { chipVariants as v } from "../foundations/chip-variants.js";
6
+ const h = "forced-colors:data-[selected]:bg-[Highlight] forced-colors:data-[selected]:text-[HighlightText]", D = "forced-colors:has-[[data-slot=chip-trigger]:focus-visible]:outline-solid forced-colors:has-[[data-slot=chip-trigger]:focus-visible]:outline-2 forced-colors:has-[[data-slot=chip-trigger]:focus-visible]:outline-offset-2 forced-colors:has-[[data-slot=chip-trigger]:focus-visible]:outline-[Highlight]", F = /* @__PURE__ */ new Set([
7
+ "type",
8
+ "disabled",
9
+ "form",
10
+ "formAction",
11
+ "formEncType",
12
+ "formMethod",
13
+ "formNoValidate",
14
+ "formTarget",
15
+ "name",
16
+ "value"
17
+ ]);
18
+ function y(o) {
19
+ return Object.fromEntries(Object.entries(o).filter(([n]) => !F.has(n)));
20
+ }
21
+ function V({
7
22
  className: o,
8
- variant: h = "filled",
9
- size: l,
10
- shape: c,
23
+ variant: n = "filled",
24
+ size: c,
25
+ shape: d,
11
26
  href: r,
12
- selected: i = !1,
13
- soldOut: x = !1,
14
- removable: y = !1,
15
- onRemove: N,
16
- count: m,
17
- children: d,
18
- ...a
27
+ selected: a = !1,
28
+ soldOut: T = !1,
29
+ removable: E = !1,
30
+ onRemove: S,
31
+ removeLabel: N = "削除",
32
+ count: b,
33
+ linkComponent: C,
34
+ children: f,
35
+ ...t
19
36
  }) {
20
- const v = i ? "accent" : h, e = x && !i, u = e ? "border border-[var(--Text-Disable)] bg-[var(--Surface-Secondary)] text-[var(--Text-Disable)]" : void 0, g = m !== void 0 && /* @__PURE__ */ t(
37
+ const p = C ?? "a", u = a ? "selected" : n, e = T && !a, g = e ? "border border-[var(--Text-Disable)] bg-[var(--Surface-Secondary)] text-[var(--Text-Disable)]" : void 0, m = b !== void 0 && /* @__PURE__ */ i(
21
38
  "span",
22
39
  {
23
- className: s(
40
+ className: l(
24
41
  "inline-flex items-center justify-center rounded-full px-1.5 min-w-[1.25rem] typo-label-xs transition-colors",
25
- i ? "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)] group-hover:bg-[var(--Surface-Primary)] group-hover:text-[var(--Brand-Cake-Orange)]" : "bg-[var(--Surface-Tertiary)] text-[var(--Text-Medium-Emphasis)]"
42
+ a ? "bg-[var(--Surface-Primary)] text-[var(--Text-High-Emphasis)]" : "bg-[var(--Surface-Tertiary)] text-[var(--Text-Medium-Emphasis)]"
26
43
  ),
27
- children: m
44
+ children: b
28
45
  }
29
- ), f = e && /* @__PURE__ */ t("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ t("div", { className: "h-[67px] w-px origin-center rotate-45 bg-[var(--Text-Disable)]" }) });
30
- if (y)
31
- return /* @__PURE__ */ n(
46
+ ), x = e && /* @__PURE__ */ i("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "h-[67px] w-px origin-center rotate-45 bg-[var(--Text-Disable)]" }) });
47
+ if (E)
48
+ return /* @__PURE__ */ s(
32
49
  "span",
33
50
  {
34
51
  "data-slot": "chip",
35
- "data-selected": i || void 0,
36
- className: s(
52
+ "data-selected": a || void 0,
53
+ className: l(
37
54
  "group",
38
- b({ variant: v, size: l, shape: c }),
39
- e ? u : void 0,
55
+ v({ variant: u, size: c, shape: d }),
56
+ e ? g : void 0,
40
57
  e && "relative",
41
58
  "has-[[data-slot=chip-trigger]:focus-visible]:ring-2 has-[[data-slot=chip-trigger]:focus-visible]:ring-[var(--Focus-High-Emphasis)]",
59
+ h,
60
+ D,
42
61
  o
43
62
  ),
44
63
  children: [
45
- r ? /* @__PURE__ */ n(
46
- "a",
64
+ r ? /* @__PURE__ */ s(
65
+ p,
47
66
  {
48
67
  href: r,
49
68
  "data-slot": "chip-trigger",
50
69
  className: "inline-flex items-center gap-1.5 focus-visible:outline-none",
70
+ ...y(t),
51
71
  children: [
52
- d,
53
- g
72
+ f,
73
+ m
54
74
  ]
55
75
  }
56
- ) : /* @__PURE__ */ n(
76
+ ) : /* @__PURE__ */ s(
57
77
  "button",
58
78
  {
59
79
  type: "button",
60
80
  "data-slot": "chip-trigger",
61
- disabled: e || a.disabled,
81
+ disabled: e || t.disabled,
62
82
  className: "inline-flex items-center gap-1.5 focus-visible:outline-none",
63
- ...a,
83
+ ...t,
64
84
  children: [
65
- d,
66
- g
85
+ f,
86
+ m
67
87
  ]
68
88
  }
69
89
  ),
70
- f,
71
- /* @__PURE__ */ t(
90
+ x,
91
+ /* @__PURE__ */ i(
72
92
  "button",
73
93
  {
74
94
  type: "button",
75
- "aria-label": "削除",
76
- disabled: e || a.disabled,
77
- onClick: (O) => {
78
- O.stopPropagation(), N?.();
95
+ "data-slot": "chip-remove",
96
+ "aria-label": N,
97
+ disabled: e || t.disabled,
98
+ onClick: (j) => {
99
+ j.stopPropagation(), S?.();
79
100
  },
80
101
  className: "-mr-1 ml-0.5 inline-flex size-6 shrink-0 items-center justify-center rounded-full hover:bg-[var(--Overlay-Light)] focus-visible:ring-2 focus-visible:ring-[var(--Focus-High-Emphasis)]",
81
- children: /* @__PURE__ */ t(T, { className: "size-3.5" })
102
+ children: /* @__PURE__ */ i(_, { className: "size-3.5" })
82
103
  }
83
104
  )
84
105
  ]
85
106
  }
86
107
  );
87
- const p = /* @__PURE__ */ n(S, { children: [
88
- d,
89
- g,
90
- f
108
+ const O = /* @__PURE__ */ s(R, { children: [
109
+ f,
110
+ m,
111
+ x
91
112
  ] });
92
- return r ? /* @__PURE__ */ t(
93
- "a",
113
+ return r ? /* @__PURE__ */ i(
114
+ p,
94
115
  {
95
116
  href: r,
96
117
  "data-slot": "chip",
97
- "data-selected": i || void 0,
98
- className: s("group", b({ variant: v, size: l, shape: c }), u, o),
99
- children: p
118
+ "data-selected": a || void 0,
119
+ className: l("group", v({ variant: u, size: c, shape: d }), g, h, o),
120
+ ...y(t),
121
+ children: O
100
122
  }
101
- ) : /* @__PURE__ */ t(
123
+ ) : /* @__PURE__ */ i(
102
124
  "button",
103
125
  {
104
126
  type: "button",
105
127
  "data-slot": "chip",
106
- "data-selected": i || void 0,
107
- disabled: e || a.disabled,
108
- className: s(
128
+ "data-selected": a || void 0,
129
+ disabled: e || t.disabled,
130
+ className: l(
109
131
  "group",
110
- b({ variant: v, size: l, shape: c }),
111
- e ? u : void 0,
132
+ v({ variant: u, size: c, shape: d }),
133
+ e ? g : void 0,
112
134
  e && "relative",
135
+ h,
113
136
  o
114
137
  ),
115
- ...a,
116
- children: p
138
+ ...t,
139
+ children: O
117
140
  }
118
141
  );
119
142
  }
120
143
  export {
121
- E as Chip,
122
- b as chipVariants
144
+ V as Chip,
145
+ v as chipVariants
123
146
  };