@cakejp/design-system 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -0
- package/CLAUDE.md +5 -1
- package/MIGRATION.md +43 -0
- package/UPDATING.md +2 -0
- package/bin/check-tokens.mjs +136 -0
- package/bin/init.js +9 -0
- package/contracts/components.json +87 -25
- package/contracts/composition.json +9 -9
- package/contracts/rules.json +1 -1
- package/contracts/screen-patterns.json +1 -1
- package/dist/components/ec/admin-shell.js +7 -7
- package/dist/components/ec/anniversary-card.js +1 -1
- package/dist/components/ec/chart-controls.js +7 -7
- package/dist/components/ec/coupon-card.js +10 -10
- package/dist/components/ec/delivery-calendar.js +1 -1
- package/dist/components/ec/mypage-shell.js +1 -1
- package/dist/components/ec/order-section.js +1 -1
- package/dist/components/ec/order-summary.js +7 -5
- package/dist/components/ec/product-card.js +32 -30
- package/dist/components/ec/product-detail-sidebar.js +1 -1
- package/dist/components/ec/product-list-item.js +57 -56
- package/dist/components/ec/product-option.js +30 -30
- package/dist/components/ec/review-summary.js +1 -1
- package/dist/components/ec/shop-card.js +7 -7
- package/dist/components/foundations/accordion.js +1 -1
- package/dist/components/foundations/alert-dialog.js +65 -43
- package/dist/components/foundations/alert.js +74 -68
- package/dist/components/foundations/badge.js +4 -4
- package/dist/components/foundations/button.js +15 -15
- package/dist/components/foundations/checkbox-card.js +18 -18
- package/dist/components/foundations/checkbox.js +6 -6
- package/dist/components/foundations/chip-variants.js +8 -8
- package/dist/components/foundations/data-table.js +244 -209
- package/dist/components/foundations/dialog.js +84 -60
- package/dist/components/foundations/drawer.js +61 -53
- package/dist/components/foundations/field.js +51 -35
- package/dist/components/foundations/file-input.js +1 -1
- package/dist/components/foundations/input.js +9 -8
- package/dist/components/foundations/popover.js +15 -12
- package/dist/components/foundations/progress.js +19 -18
- package/dist/components/foundations/radio-group.js +26 -23
- package/dist/components/foundations/select.js +9 -8
- package/dist/components/foundations/sheet.js +82 -59
- package/dist/components/foundations/skeleton.js +6 -6
- package/dist/components/foundations/slider.js +7 -7
- package/dist/components/foundations/sonner.js +9 -8
- package/dist/components/foundations/switch.js +3 -2
- package/dist/components/foundations/tabs.js +5 -5
- package/dist/components/foundations/textarea.js +7 -6
- package/dist/components/foundations/toggle-group.js +5 -5
- package/dist/components/primitives/admin-header.js +3 -3
- package/dist/components/primitives/admin-side-nav.js +101 -92
- package/dist/components/primitives/category-shortcuts.js +6 -6
- package/dist/components/primitives/chat-composer.js +1 -1
- package/dist/components/primitives/chip.js +25 -25
- package/dist/components/primitives/combobox.js +74 -63
- package/dist/components/primitives/content-carousel.js +64 -62
- package/dist/components/primitives/date-picker.js +99 -96
- package/dist/components/primitives/error-state.js +9 -9
- package/dist/components/primitives/filter-bar.js +4 -4
- package/dist/components/primitives/footer.js +1 -1
- package/dist/components/primitives/form-field.js +8 -8
- package/dist/components/primitives/funnel-shell.js +5 -5
- package/dist/components/primitives/header.js +16 -16
- package/dist/components/primitives/image-carousel.js +42 -41
- package/dist/components/primitives/image-gallery.js +61 -58
- package/dist/components/primitives/image-input.js +2 -2
- package/dist/components/primitives/image-uploader.js +1 -1
- package/dist/components/primitives/kebab-menu.js +20 -16
- package/dist/components/primitives/list-item.js +17 -17
- package/dist/components/primitives/menu-drawer.js +11 -11
- package/dist/components/primitives/multi-select.js +66 -66
- package/dist/components/primitives/notification-list.js +13 -13
- package/dist/components/primitives/number-input.js +118 -112
- package/dist/components/primitives/progress-steps.js +3 -3
- package/dist/components/primitives/search-bar.js +6 -6
- package/dist/components/primitives/section-nav.js +1 -1
- package/dist/components/primitives/side-nav.js +1 -1
- package/dist/components/primitives/sub-nav.js +12 -12
- package/dist/components/primitives/tag.js +3 -3
- package/dist/components/primitives/workspace-shell.js +8 -8
- package/dist/index.css +1 -1
- package/dist/index.js +1479 -704
- package/dist/lib/focus-restore.js +67 -0
- package/dist/lib/focus-ring.js +1 -1
- package/dist/lib/ime.js +17 -0
- package/dist/lib/search-normalize.js +30 -0
- package/dist/types/components/ec/admin-shell.d.ts +1 -1
- package/dist/types/components/foundations/alert-dialog.d.ts +2 -2
- package/dist/types/components/foundations/alert.d.ts +14 -1
- package/dist/types/components/foundations/card.d.ts +3 -3
- package/dist/types/components/foundations/confirm-dialog.d.ts +3 -3
- package/dist/types/components/foundations/data-table.d.ts +1 -1
- package/dist/types/components/foundations/dialog.d.ts +2 -2
- package/dist/types/components/foundations/drawer.d.ts +1 -1
- package/dist/types/components/foundations/field.d.ts +23 -3
- package/dist/types/components/foundations/popover.d.ts +1 -1
- package/dist/types/components/foundations/sheet.d.ts +4 -3
- package/dist/types/components/foundations/sonner.d.ts +3 -2
- package/dist/types/components/primitives/admin-side-nav.d.ts +2 -0
- package/dist/types/components/primitives/combobox.d.ts +6 -0
- package/dist/types/components/primitives/date-picker.d.ts +8 -3
- package/dist/types/components/primitives/funnel-shell.d.ts +1 -1
- package/dist/types/components/primitives/kebab-menu.d.ts +10 -1
- package/dist/types/components/primitives/number-input.d.ts +20 -1
- package/dist/types/components/primitives/progress-steps.d.ts +1 -1
- package/dist/types/components/primitives/section.d.ts +1 -1
- package/dist/types/components/primitives/workspace-shell.d.ts +2 -2
- package/dist/types/index.d.ts +3 -4
- package/dist/types/lib/focus-restore.d.ts +52 -0
- package/dist/types/lib/focus-ring.d.ts +3 -0
- package/dist/types/lib/ime.d.ts +36 -0
- package/dist/types/lib/search-normalize.d.ts +28 -0
- package/package.json +3 -1
- package/src/components/COMPONENT_LOOKUP.md +12 -12
- package/src/preset-standalone.css +43 -21
- package/src/preset.css +36 -18
- package/src/styles/primitive.css +1 -0
- package/src/styles/semantic.css +12 -2
- package/tokens.json +22 -3
|
@@ -1,83 +1,105 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as r, jsxs as q } from "react/jsx-runtime";
|
|
3
3
|
import * as l from "react";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import W from "iconsax-reactjs/dist/esm/Add.js";
|
|
5
|
+
import X from "iconsax-reactjs/dist/esm/Minus.js";
|
|
6
|
+
import Y from "iconsax-reactjs/dist/esm/Trash.js";
|
|
7
7
|
import { cn as n } from "../../lib/utils.js";
|
|
8
8
|
import { FOCUS_RING as c } from "../../lib/focus-ring.js";
|
|
9
|
-
import { HIGH_CONTRAST_OUTLINE as
|
|
10
|
-
import { useFieldLabelling as
|
|
11
|
-
function
|
|
9
|
+
import { HIGH_CONTRAST_OUTLINE as ge } from "../../lib/high-contrast.js";
|
|
10
|
+
import { useFieldLabelling as ye, mergeIdRefs as xe } from "../../lib/field-labelling.js";
|
|
11
|
+
function Ne({
|
|
12
12
|
className: D,
|
|
13
|
-
value:
|
|
14
|
-
defaultValue:
|
|
13
|
+
value: O,
|
|
14
|
+
defaultValue: Z,
|
|
15
15
|
min: u = 1,
|
|
16
|
-
max:
|
|
17
|
-
step:
|
|
18
|
-
onChange:
|
|
16
|
+
max: I = 99,
|
|
17
|
+
step: H = 1,
|
|
18
|
+
onChange: ee,
|
|
19
19
|
disabled: a = !1,
|
|
20
|
-
error:
|
|
21
|
-
size:
|
|
22
|
-
editable:
|
|
23
|
-
showTrash:
|
|
24
|
-
onDelete:
|
|
25
|
-
formatOptions:
|
|
26
|
-
locale:
|
|
27
|
-
inputId:
|
|
28
|
-
|
|
20
|
+
error: re,
|
|
21
|
+
size: te = "md",
|
|
22
|
+
editable: d = !0,
|
|
23
|
+
showTrash: ae = !1,
|
|
24
|
+
onDelete: ne,
|
|
25
|
+
formatOptions: p,
|
|
26
|
+
locale: ie = "ja-JP",
|
|
27
|
+
inputId: oe,
|
|
28
|
+
name: S,
|
|
29
|
+
inputRef: se,
|
|
30
|
+
inputProps: B,
|
|
31
|
+
label: M,
|
|
29
32
|
...z
|
|
30
33
|
}) {
|
|
31
|
-
const
|
|
32
|
-
...s ? { "aria-labelledby": s } : { "aria-label": `${
|
|
33
|
-
"aria-describedby": o ?
|
|
34
|
+
const h = M ?? "数量", o = ye(), le = l.useId(), s = M === void 0 ? o?.labelId : void 0, f = re ?? !!o?.errorId, $ = s ? { "aria-labelledby": s } : { "aria-label": h }, ce = oe ?? o?.controlId, F = {
|
|
35
|
+
...s ? { "aria-labelledby": s } : { "aria-label": `${h}を入力` },
|
|
36
|
+
"aria-describedby": o ? xe(o.descriptionId, o.errorId) : void 0,
|
|
34
37
|
"aria-invalid": f || void 0
|
|
35
|
-
},
|
|
36
|
-
if (!s) return { "aria-label":
|
|
37
|
-
const
|
|
38
|
-
return { id:
|
|
39
|
-
},
|
|
40
|
-
(e) => Math.min(
|
|
41
|
-
[u,
|
|
42
|
-
), [
|
|
38
|
+
}, E = (e, i, fe) => {
|
|
39
|
+
if (!s) return { "aria-label": fe };
|
|
40
|
+
const Q = `${le}-${e}`;
|
|
41
|
+
return { id: Q, "aria-label": i, "aria-labelledby": `${s} ${Q}` };
|
|
42
|
+
}, L = O !== void 0, P = l.useCallback(
|
|
43
|
+
(e) => Math.min(I, Math.max(u, e)),
|
|
44
|
+
[u, I]
|
|
45
|
+
), [ue, de] = l.useState(() => P(Z ?? u)), t = L ? O : ue, [T, A] = l.useState(!1), [k, g] = l.useState(String(t)), m = ae && t <= u, v = t > u && !a, b = t < I && !a, y = m && !a, R = m ? E("decrement", "削除", "削除") : E("decrement", "減らす", `${h}を減らす`), K = E("increment", "増やす", `${h}を増やす`), x = (e) => a ? { disabled: !0 } : { "aria-disabled": e ? void 0 : !0 };
|
|
43
46
|
l.useEffect(() => {
|
|
44
|
-
|
|
45
|
-
}, [t,
|
|
46
|
-
const
|
|
47
|
+
T || g(String(t));
|
|
48
|
+
}, [t, T]);
|
|
49
|
+
const j = (e) => {
|
|
47
50
|
const i = P(e);
|
|
48
|
-
|
|
49
|
-
},
|
|
51
|
+
L || de(i), g(String(i)), ee?.(i);
|
|
52
|
+
}, w = () => {
|
|
50
53
|
if (m) {
|
|
51
|
-
|
|
54
|
+
ne?.();
|
|
52
55
|
return;
|
|
53
56
|
}
|
|
54
|
-
v &&
|
|
55
|
-
}, w = () => {
|
|
56
|
-
b && k(t + O);
|
|
57
|
-
}, U = (e) => {
|
|
58
|
-
const i = e.target.value;
|
|
59
|
-
(i === "" || /^-?\d*$/.test(i)) && d(i);
|
|
57
|
+
v && j(t - H);
|
|
60
58
|
}, C = () => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
b && j(t + H);
|
|
60
|
+
}, me = (e) => {
|
|
61
|
+
const i = e.target.value;
|
|
62
|
+
(i === "" || /^-?\d*$/.test(i)) && g(i);
|
|
63
|
+
}, U = () => {
|
|
64
|
+
const e = parseInt(k, 10);
|
|
65
|
+
j(Number.isNaN(e) ? t : e), A(!1);
|
|
66
|
+
}, ve = (e) => {
|
|
67
|
+
if (B?.onKeyDown?.(e), !e.defaultPrevented) {
|
|
68
|
+
if (e.key === "Enter") {
|
|
69
|
+
U();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
e.key === "ArrowUp" && (e.preventDefault(), C()), e.key === "ArrowDown" && (e.preventDefault(), w());
|
|
67
73
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
}, { onFocus: be, onBlur: pe, className: V, ...he } = B ?? {}, _ = d && !p ? S : void 0, G = S !== void 0 && _ === void 0 ? /* @__PURE__ */ r("input", { type: "hidden", name: S, value: t, disabled: a, form: B?.form }) : null, J = {
|
|
75
|
+
...he,
|
|
76
|
+
ref: se,
|
|
77
|
+
name: _,
|
|
78
|
+
type: "text",
|
|
79
|
+
inputMode: "numeric",
|
|
80
|
+
pattern: "[0-9]*",
|
|
81
|
+
id: ce,
|
|
82
|
+
onFocus: (e) => {
|
|
83
|
+
A(!0), g(String(t)), be?.(e);
|
|
84
|
+
},
|
|
85
|
+
onChange: me,
|
|
86
|
+
onBlur: (e) => {
|
|
87
|
+
U(), pe?.(e);
|
|
88
|
+
},
|
|
89
|
+
onKeyDown: ve,
|
|
90
|
+
disabled: a
|
|
91
|
+
}, N = T ? k : p ? new Intl.NumberFormat(ie, p).format(t).replace(/¥/g, "¥") : k;
|
|
92
|
+
return te === "sm" ? /* @__PURE__ */ q(
|
|
71
93
|
"div",
|
|
72
94
|
{
|
|
73
95
|
"data-slot": "number-input",
|
|
74
|
-
"data-editable":
|
|
96
|
+
"data-editable": d || void 0,
|
|
75
97
|
className: n(
|
|
76
98
|
// px-1(4px)は上下の余白((36-28)/2 = 4px)と揃える値。
|
|
77
99
|
// ホバー時の円が外枠に対して上下左右とも同じ内側余白で収まる
|
|
78
100
|
// shrink-0 必須: カート行など flex row の子として置かれるため、既定の flex-shrink:1 だと 108px が潰れる
|
|
79
|
-
"inline-flex h-9 w-[108px] shrink-0 items-center justify-between rounded-full bg-[var(--Surface-Tertiary)] px-1",
|
|
80
|
-
|
|
101
|
+
"inline-flex h-9 w-[108px] shrink-0 items-center justify-between rounded-full bg-[var(--Surface-Neutral-Tertiary)] px-1",
|
|
102
|
+
ge,
|
|
81
103
|
f && "ring-2 ring-[var(--Surface-Caution)]",
|
|
82
104
|
a && "cursor-not-allowed",
|
|
83
105
|
D
|
|
@@ -93,36 +115,27 @@ function de({
|
|
|
93
115
|
className: n(
|
|
94
116
|
"flex size-7 shrink-0 items-center justify-center rounded-full transition-colors outline-none",
|
|
95
117
|
c,
|
|
96
|
-
v ||
|
|
118
|
+
v || y ? "text-[var(--Object-High-Emphasis)] hover:bg-[var(--Overlay-Light)] active:bg-[var(--Overlay-Medium)]" : "text-[var(--Object-Disable)]"
|
|
97
119
|
),
|
|
98
|
-
onClick:
|
|
99
|
-
...
|
|
120
|
+
onClick: w,
|
|
121
|
+
...x(v || y),
|
|
100
122
|
...R,
|
|
101
|
-
children: m ? /* @__PURE__ */ r(
|
|
123
|
+
children: m ? /* @__PURE__ */ r(Y, { size: 14 }) : /* @__PURE__ */ r(X, { size: 14 })
|
|
102
124
|
}
|
|
103
125
|
),
|
|
104
|
-
|
|
126
|
+
d ? /* @__PURE__ */ r(
|
|
105
127
|
"input",
|
|
106
128
|
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
pattern: "[0-9]*",
|
|
110
|
-
id: L,
|
|
111
|
-
value: x,
|
|
112
|
-
onFocus: () => {
|
|
113
|
-
N(!0), d(String(t));
|
|
114
|
-
},
|
|
115
|
-
onChange: U,
|
|
116
|
-
onBlur: C,
|
|
117
|
-
onKeyDown: _,
|
|
118
|
-
disabled: a,
|
|
129
|
+
...J,
|
|
130
|
+
value: N,
|
|
119
131
|
className: n(
|
|
120
132
|
"w-7 shrink-0 rounded bg-transparent text-center typo-label-md outline-none transition-colors",
|
|
121
133
|
"hover:bg-[var(--Overlay-Light)] focus-visible:bg-[var(--Surface-Primary)]",
|
|
122
134
|
c,
|
|
123
|
-
a ? "text-[var(--Text-Disable)]" : "text-[var(--Text-High-Emphasis)]"
|
|
135
|
+
a ? "text-[var(--Text-Disable)]" : "text-[var(--Text-High-Emphasis)]",
|
|
136
|
+
V
|
|
124
137
|
),
|
|
125
|
-
...
|
|
138
|
+
...F,
|
|
126
139
|
"aria-live": "polite"
|
|
127
140
|
}
|
|
128
141
|
) : /* @__PURE__ */ r(
|
|
@@ -134,7 +147,7 @@ function de({
|
|
|
134
147
|
),
|
|
135
148
|
"aria-live": "polite",
|
|
136
149
|
"aria-atomic": "true",
|
|
137
|
-
children:
|
|
150
|
+
children: N
|
|
138
151
|
}
|
|
139
152
|
),
|
|
140
153
|
/* @__PURE__ */ r(
|
|
@@ -146,19 +159,20 @@ function de({
|
|
|
146
159
|
c,
|
|
147
160
|
b ? "text-[var(--Object-High-Emphasis)] hover:bg-[var(--Overlay-Light)] active:bg-[var(--Overlay-Medium)]" : "text-[var(--Object-Disable)]"
|
|
148
161
|
),
|
|
149
|
-
onClick:
|
|
150
|
-
...
|
|
162
|
+
onClick: C,
|
|
163
|
+
...x(b),
|
|
151
164
|
...K,
|
|
152
|
-
children: /* @__PURE__ */ r(
|
|
165
|
+
children: /* @__PURE__ */ r(W, { size: 14 })
|
|
153
166
|
}
|
|
154
|
-
)
|
|
167
|
+
),
|
|
168
|
+
G
|
|
155
169
|
]
|
|
156
170
|
}
|
|
157
|
-
) : /* @__PURE__ */
|
|
171
|
+
) : /* @__PURE__ */ q(
|
|
158
172
|
"div",
|
|
159
173
|
{
|
|
160
174
|
"data-slot": "number-input",
|
|
161
|
-
"data-editable":
|
|
175
|
+
"data-editable": d || void 0,
|
|
162
176
|
className: n("inline-flex shrink-0 items-center gap-3", D),
|
|
163
177
|
role: "group",
|
|
164
178
|
...$,
|
|
@@ -171,40 +185,31 @@ function de({
|
|
|
171
185
|
className: n(
|
|
172
186
|
"flex size-10 shrink-0 items-center justify-center rounded-full border transition-colors outline-none",
|
|
173
187
|
c,
|
|
174
|
-
v ||
|
|
188
|
+
v || y ? "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-Neutral-Tertiary)] active:bg-[var(--Surface-Neutral-Tertiary)]" : "border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] text-[var(--Object-Disable)]"
|
|
175
189
|
),
|
|
176
|
-
onClick:
|
|
177
|
-
...
|
|
190
|
+
onClick: w,
|
|
191
|
+
...x(v || y),
|
|
178
192
|
...R,
|
|
179
|
-
children: m ? /* @__PURE__ */ r(
|
|
193
|
+
children: m ? /* @__PURE__ */ r(Y, { size: 18 }) : /* @__PURE__ */ r(X, { size: 18 })
|
|
180
194
|
}
|
|
181
195
|
),
|
|
182
|
-
|
|
196
|
+
d ? /* @__PURE__ */ r(
|
|
183
197
|
"input",
|
|
184
198
|
{
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
pattern: "[0-9]*",
|
|
188
|
-
id: L,
|
|
189
|
-
value: x,
|
|
190
|
-
onFocus: () => {
|
|
191
|
-
N(!0), d(String(t));
|
|
192
|
-
},
|
|
193
|
-
onChange: U,
|
|
194
|
-
onBlur: C,
|
|
195
|
-
onKeyDown: _,
|
|
196
|
-
disabled: a,
|
|
199
|
+
...J,
|
|
200
|
+
value: N,
|
|
197
201
|
className: n(
|
|
198
202
|
// formatOptions で桁が増えるため、内容に応じて広がるよう min-w にしている
|
|
199
203
|
"h-10 shrink-0 rounded-lg border text-center typo-label-lg outline-none transition-colors",
|
|
200
204
|
// 既定は Figma 準拠の固定幅。桁区切り・通貨表示のときだけ内容に追従させる
|
|
201
205
|
// (input は size 属性由来の既定幅を持つため、w-12 を外すと 200px 超に広がる)
|
|
202
|
-
|
|
206
|
+
p ? "field-sizing-content min-w-12 max-w-40 px-2" : "w-12",
|
|
203
207
|
f ? "border-[var(--Border-Caution)]" : "border-[var(--Border-Control,var(--Border-Medium-Emphasis))] hover:border-[var(--Border-High-Emphasis)]",
|
|
204
208
|
c,
|
|
205
|
-
a ? "bg-[var(--Surface-Tertiary)] text-[var(--Text-Disable)]" : "bg-[var(--Surface-Secondary)] text-[var(--Text-High-Emphasis)]"
|
|
209
|
+
a ? "bg-[var(--Surface-Neutral-Tertiary)] text-[var(--Text-Disable)]" : "bg-[var(--Surface-Neutral-Secondary)] text-[var(--Text-High-Emphasis)]",
|
|
210
|
+
V
|
|
206
211
|
),
|
|
207
|
-
...
|
|
212
|
+
...F,
|
|
208
213
|
"aria-live": "polite"
|
|
209
214
|
}
|
|
210
215
|
) : /* @__PURE__ */ r(
|
|
@@ -214,11 +219,11 @@ function de({
|
|
|
214
219
|
// span は内容幅なので min-w-12 で Figma の 48px を下限にする
|
|
215
220
|
"flex h-10 min-w-12 shrink-0 items-center justify-center rounded-lg border px-2 text-center typo-label-lg",
|
|
216
221
|
f ? "border-[var(--Border-Caution)]" : "border-[var(--Border-Control,var(--Border-Medium-Emphasis))]",
|
|
217
|
-
a ? "bg-[var(--Surface-Tertiary)] text-[var(--Text-Disable)]" : "bg-[var(--Surface-Secondary)] text-[var(--Text-High-Emphasis)]"
|
|
222
|
+
a ? "bg-[var(--Surface-Neutral-Tertiary)] text-[var(--Text-Disable)]" : "bg-[var(--Surface-Neutral-Secondary)] text-[var(--Text-High-Emphasis)]"
|
|
218
223
|
),
|
|
219
224
|
"aria-live": "polite",
|
|
220
225
|
"aria-atomic": "true",
|
|
221
|
-
children:
|
|
226
|
+
children: N
|
|
222
227
|
}
|
|
223
228
|
),
|
|
224
229
|
/* @__PURE__ */ r(
|
|
@@ -228,20 +233,21 @@ function de({
|
|
|
228
233
|
className: n(
|
|
229
234
|
"flex size-10 shrink-0 items-center justify-center rounded-full border transition-colors outline-none",
|
|
230
235
|
c,
|
|
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)]"
|
|
236
|
+
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-Neutral-Tertiary)] active:bg-[var(--Surface-Neutral-Tertiary)]" : "border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] text-[var(--Object-Disable)]"
|
|
232
237
|
),
|
|
233
|
-
onClick:
|
|
234
|
-
...
|
|
238
|
+
onClick: C,
|
|
239
|
+
...x(b),
|
|
235
240
|
...K,
|
|
236
|
-
children: /* @__PURE__ */ r(
|
|
241
|
+
children: /* @__PURE__ */ r(W, { size: 18 })
|
|
237
242
|
}
|
|
238
|
-
)
|
|
243
|
+
),
|
|
244
|
+
G
|
|
239
245
|
]
|
|
240
246
|
}
|
|
241
247
|
);
|
|
242
248
|
}
|
|
243
|
-
const
|
|
249
|
+
const Ce = Ne;
|
|
244
250
|
export {
|
|
245
|
-
|
|
246
|
-
|
|
251
|
+
Ne as NumberInput,
|
|
252
|
+
Ce as QuantitySelector
|
|
247
253
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { Check as p } from "lucide-react";
|
|
4
4
|
import { cn as s } from "../../lib/utils.js";
|
|
5
|
-
function
|
|
5
|
+
function N({
|
|
6
6
|
className: d,
|
|
7
7
|
steps: a,
|
|
8
8
|
currentStep: i,
|
|
@@ -26,7 +26,7 @@ function b({
|
|
|
26
26
|
{
|
|
27
27
|
className: s(
|
|
28
28
|
"flex size-7 items-center justify-center rounded-full typo-label-sm transition-colors",
|
|
29
|
-
o ? "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]" : "bg-[var(--Surface-Tertiary)] text-[var(--Text-Low-Emphasis)]"
|
|
29
|
+
o ? "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]" : "bg-[var(--Surface-Neutral-Tertiary)] text-[var(--Text-Low-Emphasis)]"
|
|
30
30
|
),
|
|
31
31
|
"aria-current": n ? "step" : void 0,
|
|
32
32
|
children: x && t ? /* @__PURE__ */ e(p, { className: "size-4 shrink-0" }) : r + 1
|
|
@@ -58,5 +58,5 @@ function b({
|
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
export {
|
|
61
|
-
|
|
61
|
+
N as ProgressSteps
|
|
62
62
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as g, 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";
|
|
@@ -28,7 +28,7 @@ const B = s.forwardRef(
|
|
|
28
28
|
)));
|
|
29
29
|
}, w = (r) => {
|
|
30
30
|
r.key === "Enter" && !t && h(), d.onKeyDown?.(r);
|
|
31
|
-
},
|
|
31
|
+
}, N = (r) => {
|
|
32
32
|
const b = n.current?.value ?? "";
|
|
33
33
|
if (!b.trim()) {
|
|
34
34
|
r.preventDefault();
|
|
@@ -36,14 +36,14 @@ const B = s.forwardRef(
|
|
|
36
36
|
}
|
|
37
37
|
l?.(b);
|
|
38
38
|
}, f = i(
|
|
39
|
-
"group flex items-center overflow-hidden rounded-lg border border-[var(--Border-Control,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-Neutral-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
43
|
R,
|
|
44
44
|
a === "sm" ? "h-9" : "h-11",
|
|
45
45
|
v
|
|
46
|
-
), p = /* @__PURE__ */
|
|
46
|
+
), p = /* @__PURE__ */ g(S, { children: [
|
|
47
47
|
/* @__PURE__ */ o(
|
|
48
48
|
"input",
|
|
49
49
|
{
|
|
@@ -65,7 +65,7 @@ const B = 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-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)]",
|
|
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-Neutral-Tertiary)] hover:text-[var(--Text-High-Emphasis)]",
|
|
69
69
|
// 親が overflow-hidden なので外向きリングは切れる。内側に描く。
|
|
70
70
|
C,
|
|
71
71
|
// 高さは親の枠(border 1px)の内側いっぱい(h-full)。以前は親と同じ高さ(h-9 / h-11)で、
|
|
@@ -86,7 +86,7 @@ const B = s.forwardRef(
|
|
|
86
86
|
action: m,
|
|
87
87
|
method: "get",
|
|
88
88
|
role: "search",
|
|
89
|
-
onSubmit:
|
|
89
|
+
onSubmit: N,
|
|
90
90
|
className: f,
|
|
91
91
|
children: p
|
|
92
92
|
}
|
|
@@ -61,7 +61,7 @@ function m({
|
|
|
61
61
|
onClick: () => s?.(r.key),
|
|
62
62
|
className: t(
|
|
63
63
|
"flex items-center gap-3 px-4 py-2.5 typo-body-md transition-colors cursor-pointer",
|
|
64
|
-
e ? "border-l-2 border-[var(--Brand-Cake-Orange)] text-[var(--Text-Accent-Primary)] bg-[var(--Surface-Accent-Primary-Light)] pl-3.5" : "border-l-2 border-transparent text-[var(--Text-Medium-Emphasis)] hover:bg-[var(--Surface-Secondary)] hover:text-[var(--Text-High-Emphasis)]"
|
|
64
|
+
e ? "border-l-2 border-[var(--Brand-Cake-Orange)] text-[var(--Text-Accent-Primary)] bg-[var(--Surface-Accent-Primary-Light)] pl-3.5" : "border-l-2 border-transparent text-[var(--Text-Medium-Emphasis)] hover:bg-[var(--Surface-Neutral-Secondary)] hover:text-[var(--Text-High-Emphasis)]"
|
|
65
65
|
),
|
|
66
66
|
"aria-current": e ? "location" : void 0,
|
|
67
67
|
children: [
|
|
@@ -71,7 +71,7 @@ function M({
|
|
|
71
71
|
className: x(
|
|
72
72
|
// hover はモーショントークン参照(prefers-reduced-motion で自動停止する)。
|
|
73
73
|
// 素の transition-colors は Tailwind 既定値でトークン制御が効かない(#201)
|
|
74
|
-
"flex items-center gap-3 px-4 py-2.5 typo-body-md transition-colors duration-[var(--Motion-Duration-Base)] ease-[var(--Motion-Easing-Standard)] hover:bg-[var(--Surface-Secondary)] cursor-pointer",
|
|
74
|
+
"flex items-center gap-3 px-4 py-2.5 typo-body-md transition-colors duration-[var(--Motion-Duration-Base)] ease-[var(--Motion-Easing-Standard)] hover:bg-[var(--Surface-Neutral-Secondary)] cursor-pointer",
|
|
75
75
|
v ? "border-l-2 border-[var(--Brand-Cake-Orange)] text-[var(--Text-Accent-Primary)] bg-[var(--Surface-Accent-Primary-Light)] pl-3.5" : "text-[var(--Text-High-Emphasis)] border-l-2 border-transparent"
|
|
76
76
|
),
|
|
77
77
|
"aria-current": v ? "page" : void 0,
|
|
@@ -2,25 +2,25 @@ import { jsx as a, jsxs as f } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as e } from "../../lib/utils.js";
|
|
4
4
|
import { containerVariants as m } from "./container.js";
|
|
5
|
-
const
|
|
6
|
-
function
|
|
5
|
+
const v = "px-4 md:px-6";
|
|
6
|
+
function N({
|
|
7
7
|
className: o,
|
|
8
8
|
items: x,
|
|
9
9
|
variant: n = "text",
|
|
10
10
|
linkComponent: b,
|
|
11
|
-
containerSize:
|
|
11
|
+
containerSize: t,
|
|
12
12
|
...l
|
|
13
13
|
}) {
|
|
14
14
|
const i = () => x.map((r) => {
|
|
15
|
-
const p = r.href ? b ?? "a" : "button",
|
|
15
|
+
const p = r.href ? b ?? "a" : "button", u = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
|
|
16
16
|
return n === "chip" ? /* @__PURE__ */ a(
|
|
17
17
|
p,
|
|
18
18
|
{
|
|
19
19
|
className: e(
|
|
20
20
|
"shrink-0 rounded-full px-3 typo-label-sm transition-colors h-8 inline-flex items-center justify-center",
|
|
21
|
-
r.isActive ? "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]" : "bg-[var(--Surface-Secondary)] text-[var(--Text-Medium-Emphasis)] hover:bg-[var(--Surface-Tertiary)]"
|
|
21
|
+
r.isActive ? "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]" : "bg-[var(--Surface-Neutral-Secondary)] text-[var(--Text-Medium-Emphasis)] hover:bg-[var(--Surface-Neutral-Tertiary)]"
|
|
22
22
|
),
|
|
23
|
-
...
|
|
23
|
+
...u,
|
|
24
24
|
children: r.label
|
|
25
25
|
},
|
|
26
26
|
r.label
|
|
@@ -31,7 +31,7 @@ function E({
|
|
|
31
31
|
"relative shrink-0 py-2.5 typo-label-md transition-colors",
|
|
32
32
|
r.isActive ? "text-[var(--Text-High-Emphasis)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]"
|
|
33
33
|
),
|
|
34
|
-
...
|
|
34
|
+
...u,
|
|
35
35
|
children: [
|
|
36
36
|
r.label,
|
|
37
37
|
r.isActive && /* @__PURE__ */ a("span", { className: "absolute inset-x-0 bottom-0 h-0.5 rounded-full bg-[var(--Text-High-Emphasis)]" })
|
|
@@ -39,14 +39,14 @@ function E({
|
|
|
39
39
|
},
|
|
40
40
|
r.label
|
|
41
41
|
);
|
|
42
|
-
}),
|
|
43
|
-
return
|
|
42
|
+
}), s = n === "chip", c = s ? "div" : "nav", d = s ? e("flex gap-2 overflow-x-auto py-2 scrollbar-hide", v) : e("flex gap-4 overflow-x-auto scrollbar-hide", v), h = s ? void 0 : "border-b border-[var(--Border-Low-Emphasis)]";
|
|
43
|
+
return t ? /* @__PURE__ */ a(c, { "data-slot": "sub-nav", className: e(h, o), ...l, children: /* @__PURE__ */ a(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
"data-slot": "sub-nav-container",
|
|
47
|
-
"data-container-size":
|
|
47
|
+
"data-container-size": t,
|
|
48
48
|
className: e(
|
|
49
|
-
m({ size:
|
|
49
|
+
m({ size: t, gutter: "none" }),
|
|
50
50
|
d
|
|
51
51
|
),
|
|
52
52
|
children: i()
|
|
@@ -62,5 +62,5 @@ function E({
|
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
export {
|
|
65
|
-
|
|
65
|
+
N as SubNav
|
|
66
66
|
};
|
|
@@ -7,7 +7,7 @@ const x = o(
|
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
|
-
default: "bg-[var(--Surface-Secondary)] text-[var(--Text-High-Emphasis)] dark:bg-[var(--Surface-Tertiary)] dark:text-[var(--Text-High-Emphasis)] dark:ring-1 dark:ring-[var(--Border-Medium-Emphasis)]",
|
|
10
|
+
default: "bg-[var(--Surface-Neutral-Secondary)] text-[var(--Text-High-Emphasis)] dark:bg-[var(--Surface-Neutral-Tertiary)] dark:text-[var(--Text-High-Emphasis)] dark:ring-1 dark:ring-[var(--Border-Medium-Emphasis)]",
|
|
11
11
|
// 写真上のオーバーレイ用。画像の明暗に依存しない不透明な面を使う。
|
|
12
12
|
image: "bg-[var(--Primitive-Gray-900)] text-[var(--Primitive-White-alpha-1000)]",
|
|
13
13
|
caution: "bg-[var(--Caution-Ultra-Light)] text-[var(--Text-Caution)] dark:bg-[var(--Text-Caution)]/20 dark:text-[var(--Text-Caution)]",
|
|
@@ -32,7 +32,7 @@ const x = o(
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
|
-
function
|
|
35
|
+
function d({
|
|
36
36
|
className: a,
|
|
37
37
|
variant: r,
|
|
38
38
|
size: t,
|
|
@@ -54,6 +54,6 @@ function p({
|
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
export {
|
|
57
|
-
|
|
57
|
+
d as Tag,
|
|
58
58
|
x as tagVariants
|
|
59
59
|
};
|
|
@@ -4,7 +4,7 @@ import { cn as p } from "../../lib/utils.js";
|
|
|
4
4
|
import { SkipLink as g } from "../foundations/skip-link.js";
|
|
5
5
|
import { Header as h } from "./header.js";
|
|
6
6
|
import { Container as v } from "./container.js";
|
|
7
|
-
function
|
|
7
|
+
function N({
|
|
8
8
|
title: o,
|
|
9
9
|
onBack: s,
|
|
10
10
|
backLabel: n = "戻る",
|
|
@@ -12,9 +12,9 @@ function b({
|
|
|
12
12
|
sectionNav: a,
|
|
13
13
|
asidePanel: e,
|
|
14
14
|
children: i,
|
|
15
|
-
className:
|
|
15
|
+
className: t,
|
|
16
16
|
mainId: l = "main-content",
|
|
17
|
-
skipLink:
|
|
17
|
+
skipLink: m,
|
|
18
18
|
headerLayout: f = "start"
|
|
19
19
|
}) {
|
|
20
20
|
return /* @__PURE__ */ c(
|
|
@@ -22,13 +22,13 @@ function b({
|
|
|
22
22
|
{
|
|
23
23
|
"data-slot": "workspace-shell",
|
|
24
24
|
className: p(
|
|
25
|
-
// 地が Surface-Secondary なので、配下 Card の既定サーフェスを白に切り替える文脈を宣言する
|
|
25
|
+
// 地が Surface-Neutral-Secondary なので、配下 Card の既定サーフェスを白に切り替える文脈を宣言する
|
|
26
26
|
// (#150 の Section と同じ仕組み。dark は半透明白が重なって浮くため据え置き)。
|
|
27
|
-
"@container min-h-screen bg-[var(--Surface-Secondary)] [--card-surface:var(--Surface-Primary)] dark:[--card-surface:var(--Surface-Secondary)]",
|
|
28
|
-
|
|
27
|
+
"@container min-h-screen bg-[var(--Surface-Neutral-Secondary)] [--card-surface:var(--Surface-Primary)] dark:[--card-surface:var(--Surface-Secondary)]",
|
|
28
|
+
t
|
|
29
29
|
),
|
|
30
30
|
children: [
|
|
31
|
-
|
|
31
|
+
m !== !1 && /* @__PURE__ */ r(g, { href: `#${l}` }),
|
|
32
32
|
/* @__PURE__ */ r(
|
|
33
33
|
h,
|
|
34
34
|
{
|
|
@@ -53,5 +53,5 @@ function b({
|
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
export {
|
|
56
|
-
|
|
56
|
+
N as WorkspaceShell
|
|
57
57
|
};
|