@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,93 +1,104 @@
1
1
  "use client";
2
- import { jsxs as $, jsx as r } from "react/jsx-runtime";
3
- import * as v from "react";
4
- import P from "iconsax-reactjs/dist/esm/Add.js";
5
- import F from "iconsax-reactjs/dist/esm/Minus.js";
6
- import A from "iconsax-reactjs/dist/esm/Trash.js";
7
- import { cn as i } from "../../lib/utils.js";
2
+ import { jsxs as V, jsx as r } from "react/jsx-runtime";
3
+ import * as l from "react";
4
+ import J from "iconsax-reactjs/dist/esm/Add.js";
5
+ import Q from "iconsax-reactjs/dist/esm/Minus.js";
6
+ import q from "iconsax-reactjs/dist/esm/Trash.js";
7
+ import { cn as n } from "../../lib/utils.js";
8
8
  import { FOCUS_RING as c } from "../../lib/focus-ring.js";
9
- function _({
9
+ import { HIGH_CONTRAST_OUTLINE as le } from "../../lib/high-contrast.js";
10
+ import { useFieldLabelling as ce, mergeIdRefs as ue } from "../../lib/field-labelling.js";
11
+ function de({
10
12
  className: D,
11
- value: N,
12
- defaultValue: K,
13
- min: l = 1,
14
- max: f = 99,
15
- step: B = 1,
16
- onChange: L,
13
+ value: M,
14
+ defaultValue: W,
15
+ min: u = 1,
16
+ max: S = 99,
17
+ step: O = 1,
18
+ onChange: X,
17
19
  disabled: a = !1,
18
- error: g = !1,
19
- size: R = "md",
20
+ error: Y,
21
+ size: Z = "md",
20
22
  editable: h = !0,
21
- showTrash: U = !1,
22
- onDelete: V,
23
- formatOptions: x,
24
- locale: G = "ja-JP",
25
- inputId: M,
26
- label: n = "数量",
27
- ...C
23
+ showTrash: ee = !1,
24
+ onDelete: re,
25
+ formatOptions: I,
26
+ locale: te = "ja-JP",
27
+ inputId: ae,
28
+ label: H,
29
+ ...z
28
30
  }) {
29
- const O = N !== void 0, z = v.useCallback(
30
- (e) => Math.min(f, Math.max(l, e)),
31
- [l, f]
32
- ), [J, Q] = v.useState(() => z(K ?? l)), t = O ? N : J, [y, S] = v.useState(!1), [E, u] = v.useState(String(t)), s = U && t <= l, m = t > l && !a, d = t < f && !a, b = s && !a;
33
- v.useEffect(() => {
34
- y || u(String(t));
35
- }, [t, y]);
31
+ const p = H ?? "数量", o = ce(), ne = l.useId(), s = H === void 0 ? o?.labelId : void 0, f = Y ?? !!o?.errorId, $ = s ? { "aria-labelledby": s } : { "aria-label": p }, L = ae ?? o?.controlId, A = {
32
+ ...s ? { "aria-labelledby": s } : { "aria-label": `${p}を入力` },
33
+ "aria-describedby": o ? ue(o.descriptionId, o.errorId) : void 0,
34
+ "aria-invalid": f || void 0
35
+ }, B = (e, i, se) => {
36
+ if (!s) return { "aria-label": se };
37
+ const G = `${ne}-${e}`;
38
+ return { id: G, "aria-label": i, "aria-labelledby": `${s} ${G}` };
39
+ }, F = M !== void 0, P = l.useCallback(
40
+ (e) => Math.min(S, Math.max(u, e)),
41
+ [u, S]
42
+ ), [ie, oe] = l.useState(() => P(W ?? u)), t = F ? M : ie, [E, N] = l.useState(!1), [T, d] = l.useState(String(t)), m = ee && t <= u, v = t > u && !a, b = t < S && !a, g = m && !a, R = m ? B("decrement", "削除", "削除") : B("decrement", "減らす", `${p}を減らす`), K = B("increment", "増やす", `${p}を増やす`), y = (e) => a ? { disabled: !0 } : { "aria-disabled": e ? void 0 : !0 };
43
+ l.useEffect(() => {
44
+ E || d(String(t));
45
+ }, [t, E]);
36
46
  const k = (e) => {
37
- const o = z(e);
38
- O || Q(o), u(String(o)), L?.(o);
39
- }, T = () => {
40
- if (s) {
41
- V?.();
47
+ const i = P(e);
48
+ F || oe(i), d(String(i)), X?.(i);
49
+ }, j = () => {
50
+ if (m) {
51
+ re?.();
42
52
  return;
43
53
  }
44
- m && k(t - B);
45
- }, j = () => {
46
- d && k(t + B);
47
- }, H = (e) => {
48
- const o = e.target.value;
49
- (o === "" || /^-?\d*$/.test(o)) && u(o);
54
+ v && k(t - O);
50
55
  }, w = () => {
51
- const e = parseInt(E, 10);
52
- k(Number.isNaN(e) ? t : e), S(!1);
53
- }, I = (e) => {
56
+ b && k(t + O);
57
+ }, U = (e) => {
58
+ const i = e.target.value;
59
+ (i === "" || /^-?\d*$/.test(i)) && d(i);
60
+ }, C = () => {
61
+ const e = parseInt(T, 10);
62
+ k(Number.isNaN(e) ? t : e), N(!1);
63
+ }, _ = (e) => {
54
64
  if (e.key === "Enter") {
55
- w();
65
+ C();
56
66
  return;
57
67
  }
58
- e.key === "ArrowUp" && (e.preventDefault(), j()), e.key === "ArrowDown" && (e.preventDefault(), T());
59
- }, p = y ? E : x ? new Intl.NumberFormat(G, x).format(t).replace(/¥/g, "¥") : E;
60
- return R === "sm" ? /* @__PURE__ */ $(
68
+ e.key === "ArrowUp" && (e.preventDefault(), w()), e.key === "ArrowDown" && (e.preventDefault(), j());
69
+ }, x = E ? T : I ? new Intl.NumberFormat(te, I).format(t).replace(/¥/g, "¥") : T;
70
+ return Z === "sm" ? /* @__PURE__ */ V(
61
71
  "div",
62
72
  {
63
73
  "data-slot": "number-input",
64
74
  "data-editable": h || void 0,
65
- className: i(
75
+ className: n(
66
76
  // px-1(4px)は上下の余白((36-28)/2 = 4px)と揃える値。
67
77
  // ホバー時の円が外枠に対して上下左右とも同じ内側余白で収まる
68
78
  // shrink-0 必須: カート行など flex row の子として置かれるため、既定の flex-shrink:1 だと 108px が潰れる
69
79
  "inline-flex h-9 w-[108px] shrink-0 items-center justify-between rounded-full bg-[var(--Surface-Tertiary)] px-1",
70
- g && "ring-2 ring-[var(--Surface-Caution)]",
80
+ le,
81
+ f && "ring-2 ring-[var(--Surface-Caution)]",
71
82
  a && "cursor-not-allowed",
72
83
  D
73
84
  ),
74
85
  role: "group",
75
- "aria-label": n,
76
- ...C,
86
+ ...$,
87
+ ...z,
77
88
  children: [
78
89
  /* @__PURE__ */ r(
79
90
  "button",
80
91
  {
81
92
  type: "button",
82
- className: i(
93
+ className: n(
83
94
  "flex size-7 shrink-0 items-center justify-center rounded-full transition-colors outline-none",
84
95
  c,
85
- m || b ? "text-[var(--Object-High-Emphasis)] hover:bg-[var(--Overlay-Light)] active:bg-[var(--Overlay-Medium)]" : "text-[var(--Object-Disable)]"
96
+ v || g ? "text-[var(--Object-High-Emphasis)] hover:bg-[var(--Overlay-Light)] active:bg-[var(--Overlay-Medium)]" : "text-[var(--Object-Disable)]"
86
97
  ),
87
- onClick: T,
88
- disabled: !(m || b),
89
- "aria-label": s ? "削除" : `${n}を減らす`,
90
- children: s ? /* @__PURE__ */ r(A, { size: 14 }) : /* @__PURE__ */ r(F, { size: 14 })
98
+ onClick: j,
99
+ ...y(v || g),
100
+ ...R,
101
+ children: m ? /* @__PURE__ */ r(q, { size: 14 }) : /* @__PURE__ */ r(Q, { size: 14 })
91
102
  }
92
103
  ),
93
104
  h ? /* @__PURE__ */ r(
@@ -96,76 +107,76 @@ function _({
96
107
  type: "text",
97
108
  inputMode: "numeric",
98
109
  pattern: "[0-9]*",
99
- id: M,
100
- value: p,
110
+ id: L,
111
+ value: x,
101
112
  onFocus: () => {
102
- S(!0), u(String(t));
113
+ N(!0), d(String(t));
103
114
  },
104
- onChange: H,
105
- onBlur: w,
106
- onKeyDown: I,
115
+ onChange: U,
116
+ onBlur: C,
117
+ onKeyDown: _,
107
118
  disabled: a,
108
- className: i(
119
+ className: n(
109
120
  "w-7 shrink-0 rounded bg-transparent text-center typo-label-md outline-none transition-colors",
110
121
  "hover:bg-[var(--Overlay-Light)] focus-visible:bg-[var(--Surface-Primary)]",
111
122
  c,
112
123
  a ? "text-[var(--Text-Disable)]" : "text-[var(--Text-High-Emphasis)]"
113
124
  ),
114
- "aria-label": `${n}を入力`,
125
+ ...A,
115
126
  "aria-live": "polite"
116
127
  }
117
128
  ) : /* @__PURE__ */ r(
118
129
  "span",
119
130
  {
120
- className: i(
131
+ className: n(
121
132
  "w-7 shrink-0 select-none text-center typo-label-md",
122
133
  a ? "text-[var(--Text-Disable)]" : "text-[var(--Text-High-Emphasis)]"
123
134
  ),
124
135
  "aria-live": "polite",
125
136
  "aria-atomic": "true",
126
- children: p
137
+ children: x
127
138
  }
128
139
  ),
129
140
  /* @__PURE__ */ r(
130
141
  "button",
131
142
  {
132
143
  type: "button",
133
- className: i(
144
+ className: n(
134
145
  "flex size-7 shrink-0 items-center justify-center rounded-full transition-colors outline-none",
135
146
  c,
136
- d ? "text-[var(--Object-High-Emphasis)] hover:bg-[var(--Overlay-Light)] active:bg-[var(--Overlay-Medium)]" : "text-[var(--Object-Disable)]"
147
+ b ? "text-[var(--Object-High-Emphasis)] hover:bg-[var(--Overlay-Light)] active:bg-[var(--Overlay-Medium)]" : "text-[var(--Object-Disable)]"
137
148
  ),
138
- onClick: j,
139
- disabled: !d,
140
- "aria-label": `${n}を増やす`,
141
- children: /* @__PURE__ */ r(P, { size: 14 })
149
+ onClick: w,
150
+ ...y(b),
151
+ ...K,
152
+ children: /* @__PURE__ */ r(J, { size: 14 })
142
153
  }
143
154
  )
144
155
  ]
145
156
  }
146
- ) : /* @__PURE__ */ $(
157
+ ) : /* @__PURE__ */ V(
147
158
  "div",
148
159
  {
149
160
  "data-slot": "number-input",
150
161
  "data-editable": h || void 0,
151
- className: i("inline-flex shrink-0 items-center gap-3", D),
162
+ className: n("inline-flex shrink-0 items-center gap-3", D),
152
163
  role: "group",
153
- "aria-label": n,
154
- ...C,
164
+ ...$,
165
+ ...z,
155
166
  children: [
156
167
  /* @__PURE__ */ r(
157
168
  "button",
158
169
  {
159
170
  type: "button",
160
- className: i(
171
+ className: n(
161
172
  "flex size-10 shrink-0 items-center justify-center rounded-full border transition-colors outline-none",
162
173
  c,
163
- m || b ? "border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] text-[var(--Object-High-Emphasis)] hover:border-[var(--Border-High-Emphasis)] hover:bg-[var(--Surface-Tertiary)] active:bg-[var(--Surface-Tertiary)]" : "border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] text-[var(--Object-Disable)]"
174
+ v || g ? "border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Primary)] text-[var(--Object-High-Emphasis)] hover:border-[var(--Border-High-Emphasis)] hover:bg-[var(--Surface-Tertiary)] active:bg-[var(--Surface-Tertiary)]" : "border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] text-[var(--Object-Disable)]"
164
175
  ),
165
- onClick: T,
166
- disabled: !(m || b),
167
- "aria-label": s ? "削除" : `${n}を減らす`,
168
- children: s ? /* @__PURE__ */ r(A, { size: 18 }) : /* @__PURE__ */ r(F, { size: 18 })
176
+ onClick: j,
177
+ ...y(v || g),
178
+ ...R,
179
+ children: m ? /* @__PURE__ */ r(q, { size: 18 }) : /* @__PURE__ */ r(Q, { size: 18 })
169
180
  }
170
181
  ),
171
182
  h ? /* @__PURE__ */ r(
@@ -174,63 +185,63 @@ function _({
174
185
  type: "text",
175
186
  inputMode: "numeric",
176
187
  pattern: "[0-9]*",
177
- id: M,
178
- value: p,
188
+ id: L,
189
+ value: x,
179
190
  onFocus: () => {
180
- S(!0), u(String(t));
191
+ N(!0), d(String(t));
181
192
  },
182
- onChange: H,
183
- onBlur: w,
184
- onKeyDown: I,
193
+ onChange: U,
194
+ onBlur: C,
195
+ onKeyDown: _,
185
196
  disabled: a,
186
- className: i(
197
+ className: n(
187
198
  // formatOptions で桁が増えるため、内容に応じて広がるよう min-w にしている
188
199
  "h-10 shrink-0 rounded-lg border text-center typo-label-lg outline-none transition-colors",
189
200
  // 既定は Figma 準拠の固定幅。桁区切り・通貨表示のときだけ内容に追従させる
190
201
  // (input は size 属性由来の既定幅を持つため、w-12 を外すと 200px 超に広がる)
191
- x ? "field-sizing-content min-w-12 max-w-40 px-2" : "w-12",
192
- g ? "border-[var(--Border-Caution)]" : "border-[var(--Border-Medium-Emphasis)] hover:border-[var(--Border-High-Emphasis)]",
202
+ I ? "field-sizing-content min-w-12 max-w-40 px-2" : "w-12",
203
+ f ? "border-[var(--Border-Caution)]" : "border-[var(--Border-Control,var(--Border-Medium-Emphasis))] hover:border-[var(--Border-High-Emphasis)]",
193
204
  c,
194
205
  a ? "bg-[var(--Surface-Tertiary)] text-[var(--Text-Disable)]" : "bg-[var(--Surface-Secondary)] text-[var(--Text-High-Emphasis)]"
195
206
  ),
196
- "aria-label": `${n}を入力`,
207
+ ...A,
197
208
  "aria-live": "polite"
198
209
  }
199
210
  ) : /* @__PURE__ */ r(
200
211
  "span",
201
212
  {
202
- className: i(
213
+ className: n(
203
214
  // span は内容幅なので min-w-12 で Figma の 48px を下限にする
204
215
  "flex h-10 min-w-12 shrink-0 items-center justify-center rounded-lg border px-2 text-center typo-label-lg",
205
- g ? "border-[var(--Border-Caution)]" : "border-[var(--Border-Medium-Emphasis)]",
216
+ f ? "border-[var(--Border-Caution)]" : "border-[var(--Border-Control,var(--Border-Medium-Emphasis))]",
206
217
  a ? "bg-[var(--Surface-Tertiary)] text-[var(--Text-Disable)]" : "bg-[var(--Surface-Secondary)] text-[var(--Text-High-Emphasis)]"
207
218
  ),
208
219
  "aria-live": "polite",
209
220
  "aria-atomic": "true",
210
- children: p
221
+ children: x
211
222
  }
212
223
  ),
213
224
  /* @__PURE__ */ r(
214
225
  "button",
215
226
  {
216
227
  type: "button",
217
- className: i(
228
+ className: n(
218
229
  "flex size-10 shrink-0 items-center justify-center rounded-full border transition-colors outline-none",
219
230
  c,
220
- d ? "border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] text-[var(--Object-High-Emphasis)] hover:border-[var(--Border-High-Emphasis)] hover:bg-[var(--Surface-Tertiary)] active:bg-[var(--Surface-Tertiary)]" : "border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] text-[var(--Object-Disable)]"
231
+ b ? "border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Primary)] text-[var(--Object-High-Emphasis)] hover:border-[var(--Border-High-Emphasis)] hover:bg-[var(--Surface-Tertiary)] active:bg-[var(--Surface-Tertiary)]" : "border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] text-[var(--Object-Disable)]"
221
232
  ),
222
- onClick: j,
223
- disabled: !d,
224
- "aria-label": `${n}を増やす`,
225
- children: /* @__PURE__ */ r(P, { size: 18 })
233
+ onClick: w,
234
+ ...y(b),
235
+ ...K,
236
+ children: /* @__PURE__ */ r(J, { size: 18 })
226
237
  }
227
238
  )
228
239
  ]
229
240
  }
230
241
  );
231
242
  }
232
- const re = _;
243
+ const xe = de;
233
244
  export {
234
- _ as NumberInput,
235
- re as QuantitySelector
245
+ de as NumberInput,
246
+ xe as QuantitySelector
236
247
  };
@@ -0,0 +1,21 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as e } from "../../lib/utils.js";
4
+ function i({ bleed: r = !0, snap: o = !1, className: t, ...a }) {
5
+ return /* @__PURE__ */ n(
6
+ "div",
7
+ {
8
+ "data-slot": "scroll-row",
9
+ className: e(
10
+ "-my-1 flex gap-3 overflow-x-auto py-1 [-webkit-overflow-scrolling:touch] *:shrink-0",
11
+ r && "-mx-[var(--Container-Gutter,0px)] px-[var(--Container-Gutter,0px)] scroll-px-[var(--Container-Gutter,0px)]",
12
+ o && "snap-x snap-mandatory *:snap-start",
13
+ t
14
+ ),
15
+ ...a
16
+ }
17
+ );
18
+ }
19
+ export {
20
+ i as ScrollRow
21
+ };
@@ -3,44 +3,44 @@ import { jsxs as N, Fragment as S, jsx as o } from "react/jsx-runtime";
3
3
  import * as s from "react";
4
4
  import E from "iconsax-reactjs/dist/esm/SearchNormal1.js";
5
5
  import { cn as i } from "../../lib/utils.js";
6
- import { FOCUS_RING_INSET as R, FOCUS_RING_WITHIN as T } from "../../lib/focus-ring.js";
7
- const C = s.forwardRef(
6
+ import { FOCUS_RING_INSET as C, FOCUS_RING_WITHIN as R } from "../../lib/focus-ring.js";
7
+ const B = s.forwardRef(
8
8
  ({
9
9
  className: v,
10
10
  placeholder: y = "キーワードを入力してください",
11
- onSearch: c,
11
+ onSearch: l,
12
12
  size: a = "md",
13
- searchHref: m,
14
- action: l,
13
+ searchHref: c,
14
+ action: m,
15
15
  name: u,
16
16
  ...d
17
- }, r) => {
18
- const t = !!l, n = s.useRef(null), x = s.useCallback(
19
- (e) => {
20
- n.current = e, typeof r == "function" ? r(e) : r && (r.current = e);
17
+ }, e) => {
18
+ const t = !!m, n = s.useRef(null), x = s.useCallback(
19
+ (r) => {
20
+ n.current = r, typeof e == "function" ? e(r) : e && (e.current = r);
21
21
  },
22
- [r]
22
+ [e]
23
23
  ), h = () => {
24
- const e = n.current?.value ?? "";
25
- e.trim() && (c?.(e), m && (window.location.href = m.replace(
24
+ const r = n.current?.value ?? "";
25
+ r.trim() && (l?.(r), c && (window.location.href = c.replace(
26
26
  "{query}",
27
- encodeURIComponent(e)
27
+ encodeURIComponent(r)
28
28
  )));
29
- }, g = (e) => {
30
- e.key === "Enter" && !t && h(), d.onKeyDown?.(e);
31
- }, w = (e) => {
29
+ }, w = (r) => {
30
+ r.key === "Enter" && !t && h(), d.onKeyDown?.(r);
31
+ }, g = (r) => {
32
32
  const b = n.current?.value ?? "";
33
33
  if (!b.trim()) {
34
- e.preventDefault();
34
+ r.preventDefault();
35
35
  return;
36
36
  }
37
- c?.(b);
37
+ l?.(b);
38
38
  }, f = i(
39
- "group flex items-center overflow-hidden rounded-lg border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Secondary)] transition-colors",
39
+ "group flex items-center overflow-hidden rounded-lg border border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Secondary)] transition-colors",
40
40
  // Tailwind の variant 順では focus-within が hover より先に出力される
41
41
  // = hover が後勝ちしてフォーカス枠を潰すため、hover 側を明示的に抑制する。
42
42
  "hover:not-focus-within:border-[var(--Border-High-Emphasis)]",
43
- T,
43
+ R,
44
44
  a === "sm" ? "h-9" : "h-11",
45
45
  v
46
46
  ), p = /* @__PURE__ */ N(S, { children: [
@@ -56,7 +56,7 @@ const C = s.forwardRef(
56
56
  "min-w-0 flex-1 bg-transparent px-3 text-[var(--Text-High-Emphasis)] outline-none placeholder:text-[var(--Text-Low-Emphasis)]",
57
57
  a === "sm" ? "typo-body-sm" : "typo-body-md"
58
58
  ),
59
- onKeyDown: g,
59
+ onKeyDown: w,
60
60
  ...d
61
61
  }
62
62
  ),
@@ -65,10 +65,13 @@ const C = s.forwardRef(
65
65
  {
66
66
  type: t ? "submit" : "button",
67
67
  className: i(
68
- "flex shrink-0 items-center justify-center border-l border-[var(--Border-Medium-Emphasis)] text-[var(--Text-Low-Emphasis)] transition-colors outline-none hover:bg-[var(--Surface-Tertiary)] hover:text-[var(--Text-High-Emphasis)]",
68
+ "flex shrink-0 items-center justify-center border-l border-[var(--Border-Control,var(--Border-Medium-Emphasis))] text-[var(--Text-Low-Emphasis)] transition-colors outline-none hover:bg-[var(--Surface-Tertiary)] hover:text-[var(--Text-High-Emphasis)]",
69
69
  // 親が overflow-hidden なので外向きリングは切れる。内側に描く。
70
- R,
71
- a === "sm" ? "size-9" : "h-11 w-11"
70
+ C,
71
+ // 高さは親の枠(border 1px)の内側いっぱい(h-full)。以前は親と同じ高さ(h-9 / h-11)で、
72
+ // 上下 1px が親の overflow-hidden に切り取られ、内側のリング・輪郭線も 1px 切れていた。
73
+ // 切られていた 1px は元から見えないので、静止時の見た目は変わらない
74
+ a === "sm" ? "h-full w-9" : "h-full w-11"
72
75
  ),
73
76
  onClick: t ? void 0 : h,
74
77
  "aria-label": "検索",
@@ -80,17 +83,17 @@ const C = s.forwardRef(
80
83
  "form",
81
84
  {
82
85
  "data-slot": "search-bar",
83
- action: l,
86
+ action: m,
84
87
  method: "get",
85
88
  role: "search",
86
- onSubmit: w,
89
+ onSubmit: g,
87
90
  className: f,
88
91
  children: p
89
92
  }
90
93
  ) : /* @__PURE__ */ o("div", { "data-slot": "search-bar", className: f, children: p });
91
94
  }
92
95
  );
93
- C.displayName = "SearchBar";
96
+ B.displayName = "SearchBar";
94
97
  export {
95
- C as SearchBar
98
+ B as SearchBar
96
99
  };