@cakejp/design-system 0.22.1 → 0.24.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 +102 -0
- package/CLAUDE.md +4 -2
- package/MIGRATION.md +79 -0
- package/UPDATING.md +1 -1
- package/bin/check-tokens.mjs +20 -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 +75 -69
- package/dist/components/foundations/badge.js +8 -8
- 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 +19 -18
- 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 +8 -8
- package/dist/components/primitives/workspace-shell.js +8 -8
- package/dist/index.css +1 -1
- package/dist/index.js +1487 -712
- 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 +50 -24
- package/src/preset.css +36 -18
- package/src/styles/primitive.css +1 -0
- package/src/styles/semantic.css +21 -5
- package/tokens.json +48 -11
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
import * as w from "react";
|
|
4
4
|
import { cva as N } from "class-variance-authority";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { cn as
|
|
5
|
+
import h from "iconsax-reactjs/dist/esm/Warning2.js";
|
|
6
|
+
import I from "iconsax-reactjs/dist/esm/InfoCircle.js";
|
|
7
|
+
import V from "iconsax-reactjs/dist/esm/TickCircle.js";
|
|
8
|
+
import k from "iconsax-reactjs/dist/esm/CloseCircle.js";
|
|
9
|
+
import { cn as t } from "../../lib/utils.js";
|
|
10
10
|
const p = N(
|
|
11
11
|
"relative w-full",
|
|
12
12
|
{
|
|
13
13
|
variants: {
|
|
14
14
|
variant: {
|
|
15
|
-
/** success —
|
|
15
|
+
/** success — mint border, mint title, white bg(dark は従来の緑の枠) */
|
|
16
16
|
success: [
|
|
17
17
|
"flex flex-col items-start overflow-clip rounded-lg",
|
|
18
18
|
"bg-[var(--Surface-Primary)]",
|
|
19
|
-
"shadow-[0_0_0_5px_rgba(31,204,132,0.2)]"
|
|
19
|
+
"shadow-[0_0_0_5px_rgba(62,152,122,0.2)] dark:shadow-[0_0_0_5px_rgba(31,204,132,0.2)]"
|
|
20
20
|
].join(" "),
|
|
21
21
|
/** info — gray border, dark title, white bg */
|
|
22
22
|
info: [
|
|
@@ -65,7 +65,7 @@ const p = N(
|
|
|
65
65
|
{
|
|
66
66
|
variants: {
|
|
67
67
|
variant: {
|
|
68
|
-
success: "border-[var(--Focus-High-Emphasis)]",
|
|
68
|
+
success: "border-[var(--Object-Success)] dark:border-[var(--Focus-High-Emphasis)]",
|
|
69
69
|
info: "border-[var(--Border-Medium-Emphasis)]",
|
|
70
70
|
error: "border-[var(--Border-Caution)]",
|
|
71
71
|
warning: "border-[var(--Primitive-Wood-800)]",
|
|
@@ -78,92 +78,98 @@ const p = N(
|
|
|
78
78
|
variant: "info"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
), s =
|
|
82
|
-
success: { Icon:
|
|
83
|
-
info: { Icon:
|
|
84
|
-
error: { Icon:
|
|
85
|
-
warning: { Icon:
|
|
86
|
-
},
|
|
87
|
-
"inline-info": { Icon:
|
|
88
|
-
"inline-caution": { Icon:
|
|
89
|
-
"inline-warning": { Icon:
|
|
81
|
+
), s = w.createContext("info"), M = (r) => r === "success" || r === "info" || r === "error" || r === "warning", W = (r) => r === "inline-info" || r === "inline-caution" || r === "inline-warning", A = {
|
|
82
|
+
success: { Icon: V, color: "text-[var(--Text-Success)]" },
|
|
83
|
+
info: { Icon: I, color: "text-[var(--Text-Medium-Emphasis)]" },
|
|
84
|
+
error: { Icon: k, color: "text-[var(--Text-Caution)]" },
|
|
85
|
+
warning: { Icon: h, color: "text-[var(--Text-Warning)]" }
|
|
86
|
+
}, B = {
|
|
87
|
+
"inline-info": { Icon: I, color: "text-[var(--Text-Medium-Emphasis)]" },
|
|
88
|
+
"inline-caution": { Icon: h, color: "text-[var(--Text-Caution)]" },
|
|
89
|
+
"inline-warning": { Icon: h, color: "text-[var(--Text-Warning)]" }
|
|
90
|
+
}, H = (r) => r === "error" || r === "warning" || r === "inline-caution" || r === "inline-warning" ? "alert" : "status", R = (r, e, o) => {
|
|
91
|
+
if (o !== void 0) return o;
|
|
92
|
+
const i = e ?? H(r);
|
|
93
|
+
return i === "off" ? void 0 : i;
|
|
90
94
|
};
|
|
91
|
-
function
|
|
92
|
-
className:
|
|
95
|
+
function J({
|
|
96
|
+
className: r,
|
|
93
97
|
variant: e = "info",
|
|
94
98
|
children: o,
|
|
95
|
-
title:
|
|
99
|
+
title: i,
|
|
96
100
|
description: a,
|
|
97
|
-
icon:
|
|
101
|
+
icon: T,
|
|
98
102
|
action: l,
|
|
103
|
+
live: S,
|
|
104
|
+
role: E,
|
|
99
105
|
...d
|
|
100
106
|
}) {
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
const { Icon:
|
|
104
|
-
return /* @__PURE__ */
|
|
107
|
+
const x = R(e, S, E), m = M(e), C = W(e), _ = (m || C) && !o && (i || a);
|
|
108
|
+
if (_ && m) {
|
|
109
|
+
const { Icon: u, color: f } = A[e], v = b[e] ?? "", g = T ?? /* @__PURE__ */ n(u, { size: 24, className: t("shrink-0", f) });
|
|
110
|
+
return /* @__PURE__ */ n(s.Provider, { value: e, children: /* @__PURE__ */ n(
|
|
105
111
|
"div",
|
|
106
112
|
{
|
|
107
113
|
"data-slot": "alert",
|
|
108
114
|
"data-variant": e,
|
|
109
|
-
role:
|
|
110
|
-
className:
|
|
115
|
+
role: x,
|
|
116
|
+
className: t(p({ variant: e }), r),
|
|
111
117
|
...d,
|
|
112
118
|
children: /* @__PURE__ */ c("div", { className: y({ variant: e }), children: [
|
|
113
|
-
|
|
119
|
+
g,
|
|
114
120
|
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
115
|
-
|
|
116
|
-
a && /* @__PURE__ */
|
|
121
|
+
i && /* @__PURE__ */ n("div", { className: t("typo-label-md", v), children: i }),
|
|
122
|
+
a && /* @__PURE__ */ n("div", { className: "typo-body-sm text-[var(--Text-Medium-Emphasis)] mt-1", children: a })
|
|
117
123
|
] }),
|
|
118
|
-
l && /* @__PURE__ */
|
|
124
|
+
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
119
125
|
] })
|
|
120
126
|
}
|
|
121
127
|
) });
|
|
122
128
|
}
|
|
123
|
-
if (
|
|
124
|
-
const { Icon:
|
|
125
|
-
return /* @__PURE__ */
|
|
129
|
+
if (_ && C) {
|
|
130
|
+
const { Icon: u, color: f } = B[e], v = b[e] ?? "", g = j[e] ?? "", P = T ?? /* @__PURE__ */ n(u, { size: 20, className: t("shrink-0", f) });
|
|
131
|
+
return /* @__PURE__ */ n(s.Provider, { value: e, children: /* @__PURE__ */ c(
|
|
126
132
|
"div",
|
|
127
133
|
{
|
|
128
134
|
"data-slot": "alert",
|
|
129
135
|
"data-variant": e,
|
|
130
|
-
role:
|
|
131
|
-
className:
|
|
136
|
+
role: x,
|
|
137
|
+
className: t(p({ variant: e }), r),
|
|
132
138
|
...d,
|
|
133
139
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ n("div", { className: "flex items-center py-[2.5px] shrink-0", children: P }),
|
|
135
141
|
/* @__PURE__ */ c("div", { className: "flex flex-1 flex-col", children: [
|
|
136
|
-
|
|
137
|
-
a && /* @__PURE__ */
|
|
142
|
+
i && /* @__PURE__ */ n("div", { className: t("typo-label-md", v), children: i }),
|
|
143
|
+
a && /* @__PURE__ */ n(
|
|
138
144
|
"div",
|
|
139
145
|
{
|
|
140
|
-
className:
|
|
146
|
+
className: t(
|
|
141
147
|
"typo-body-sm",
|
|
142
|
-
|
|
148
|
+
g || "text-[var(--Text-Medium-Emphasis)]"
|
|
143
149
|
),
|
|
144
150
|
children: a
|
|
145
151
|
}
|
|
146
152
|
)
|
|
147
153
|
] }),
|
|
148
|
-
l && /* @__PURE__ */
|
|
154
|
+
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
149
155
|
]
|
|
150
156
|
}
|
|
151
157
|
) });
|
|
152
158
|
}
|
|
153
|
-
return /* @__PURE__ */
|
|
159
|
+
return /* @__PURE__ */ n(s.Provider, { value: e, children: /* @__PURE__ */ n(
|
|
154
160
|
"div",
|
|
155
161
|
{
|
|
156
162
|
"data-slot": "alert",
|
|
157
163
|
"data-variant": e,
|
|
158
|
-
role:
|
|
159
|
-
className:
|
|
164
|
+
role: x,
|
|
165
|
+
className: t(p({ variant: e }), r),
|
|
160
166
|
...d,
|
|
161
|
-
children: m ? /* @__PURE__ */
|
|
167
|
+
children: m ? /* @__PURE__ */ n("div", { className: y({ variant: e }), children: o }) : o
|
|
162
168
|
}
|
|
163
169
|
) });
|
|
164
170
|
}
|
|
165
|
-
const
|
|
166
|
-
success: "text-[var(--
|
|
171
|
+
const b = {
|
|
172
|
+
success: "text-[var(--Text-Success)]",
|
|
167
173
|
info: "text-[var(--Text-High-Emphasis)]",
|
|
168
174
|
error: "text-[var(--Text-Caution)]",
|
|
169
175
|
warning: "text-[var(--Text-Warning)]",
|
|
@@ -171,49 +177,49 @@ const h = {
|
|
|
171
177
|
"inline-caution": "text-[var(--Text-Caution)]",
|
|
172
178
|
"inline-warning": "text-[var(--Text-Warning)]"
|
|
173
179
|
};
|
|
174
|
-
function
|
|
175
|
-
const o =
|
|
176
|
-
return /* @__PURE__ */
|
|
180
|
+
function K({ className: r, ...e }) {
|
|
181
|
+
const o = w.useContext(s), i = b[o ?? "info"] ?? "";
|
|
182
|
+
return /* @__PURE__ */ n(
|
|
177
183
|
"div",
|
|
178
184
|
{
|
|
179
185
|
"data-slot": "alert-title",
|
|
180
|
-
className:
|
|
186
|
+
className: t(
|
|
181
187
|
"typo-label-md",
|
|
182
|
-
|
|
183
|
-
|
|
188
|
+
i,
|
|
189
|
+
r
|
|
184
190
|
),
|
|
185
191
|
...e
|
|
186
192
|
}
|
|
187
193
|
);
|
|
188
194
|
}
|
|
189
|
-
const
|
|
195
|
+
const j = {
|
|
190
196
|
error: "text-[var(--Text-Caution)]",
|
|
191
197
|
"inline-caution": "text-[var(--Text-Caution)]",
|
|
192
198
|
"inline-warning": "text-[var(--Text-Warning)]"
|
|
193
199
|
};
|
|
194
|
-
function
|
|
195
|
-
className:
|
|
200
|
+
function Q({
|
|
201
|
+
className: r,
|
|
196
202
|
...e
|
|
197
203
|
}) {
|
|
198
|
-
const o =
|
|
199
|
-
return /* @__PURE__ */
|
|
204
|
+
const o = w.useContext(s), i = j[o ?? ""] ?? "";
|
|
205
|
+
return /* @__PURE__ */ n(
|
|
200
206
|
"div",
|
|
201
207
|
{
|
|
202
208
|
"data-slot": "alert-description",
|
|
203
|
-
className:
|
|
209
|
+
className: t(
|
|
204
210
|
"typo-body-sm",
|
|
205
|
-
|
|
206
|
-
|
|
211
|
+
i || "text-[var(--Text-Medium-Emphasis)]",
|
|
212
|
+
r
|
|
207
213
|
),
|
|
208
214
|
...e
|
|
209
215
|
}
|
|
210
216
|
);
|
|
211
217
|
}
|
|
212
218
|
export {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
219
|
+
J as Alert,
|
|
220
|
+
Q as AlertDescription,
|
|
221
|
+
K as AlertTitle,
|
|
222
|
+
j as alertDescriptionVariants,
|
|
223
|
+
b as alertTitleVariants,
|
|
218
224
|
p as alertVariants
|
|
219
225
|
};
|
|
@@ -11,18 +11,18 @@ const u = o(
|
|
|
11
11
|
// ── 塗りつぶし(濃い背景 + 白文字) ──
|
|
12
12
|
default: "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)] [a&]:hover:bg-[var(--Hover-Primary-Button)]",
|
|
13
13
|
destructive: "bg-[var(--Surface-Caution)] text-[var(--Text-on-Inverse)] focus-visible:ring-destructive/20 [a&]:hover:bg-destructive/90",
|
|
14
|
-
success: "bg-[var(--
|
|
14
|
+
success: "bg-[var(--Surface-Success)] text-[var(--Text-on-Inverse)] [a&]:hover:bg-[var(--Primitive-Teal-900)] dark:[a&]:hover:bg-[var(--Primitive-Forest-700)]",
|
|
15
15
|
// ── サブトル(薄い背景 + 色文字)— ステータス表示用 ──
|
|
16
16
|
"info-subtle": "bg-[var(--Primitive-Sea-100)] text-[var(--Primitive-Sea-700)]",
|
|
17
|
-
"success-subtle": "bg-[var(--
|
|
17
|
+
"success-subtle": "bg-[var(--Surface-Success-Light)] text-[var(--Text-Success)]",
|
|
18
18
|
"accent-subtle": "bg-[var(--Surface-Accent-Primary-Light)] text-[var(--Text-Accent-Primary)]",
|
|
19
19
|
"caution-subtle": "bg-[var(--Surface-Caution-Light)] text-[var(--Text-Caution)]",
|
|
20
20
|
"warning-subtle": "bg-[var(--Surface-Warning)] text-[var(--Text-Warning)] border-[var(--Primitive-Wood-200)]",
|
|
21
|
-
"muted-subtle": "bg-[var(--Surface-Tertiary)] text-[var(--Text-Medium-Emphasis)]",
|
|
21
|
+
"muted-subtle": "bg-[var(--Surface-Neutral-Tertiary)] text-[var(--Text-Medium-Emphasis)]",
|
|
22
22
|
// ── 構造系 ──
|
|
23
|
-
secondary: "bg-[var(--Surface-Secondary)] text-[var(--Text-Medium-Emphasis)] [a&]:hover:bg-[var(--Surface-Tertiary)]",
|
|
24
|
-
outline: "border-[var(--Border-Medium-Emphasis)] text-[var(--Text-High-Emphasis)] [a&]:hover:bg-[var(--Surface-Secondary)]",
|
|
25
|
-
ghost: "text-[var(--Text-Medium-Emphasis)] [a&]:hover:bg-[var(--Surface-Secondary)]",
|
|
23
|
+
secondary: "bg-[var(--Surface-Neutral-Secondary)] text-[var(--Text-Medium-Emphasis)] [a&]:hover:bg-[var(--Surface-Neutral-Tertiary)]",
|
|
24
|
+
outline: "border-[var(--Border-Medium-Emphasis)] text-[var(--Text-High-Emphasis)] [a&]:hover:bg-[var(--Surface-Neutral-Secondary)]",
|
|
25
|
+
ghost: "text-[var(--Text-Medium-Emphasis)] [a&]:hover:bg-[var(--Surface-Neutral-Secondary)]",
|
|
26
26
|
link: "text-[var(--Brand-Cake-Orange)] underline-offset-4 [a&]:hover:underline"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
@@ -31,7 +31,7 @@ const u = o(
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
|
-
function
|
|
34
|
+
function f({
|
|
35
35
|
className: e,
|
|
36
36
|
variant: r = "default",
|
|
37
37
|
asChild: a = !1,
|
|
@@ -49,6 +49,6 @@ function m({
|
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
f as Badge,
|
|
53
53
|
u as badgeVariants
|
|
54
54
|
};
|
|
@@ -10,10 +10,10 @@ const u = y(
|
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
|
-
default: "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)] hover:bg-[var(--Hover-Primary-Button)] active:bg-[var(--Active-Primary-Button)] disabled:bg-[var(--Surface-Tertiary)] disabled:text-[var(--Text-Disable)]",
|
|
14
|
-
secondary: "border border-transparent bg-[var(--Surface-Accent-Primary-Light)] text-[var(--Text-Accent-Primary)] hover:border-[var(--Hover-Primary-Button)] hover:bg-[var(--Hover-Secondary-Button)] hover:text-[var(--Hover-Primary-Button)] active:border-[var(--Active-Primary-Button)] active:bg-[var(--Active-Secondary-Button)] active:text-[var(--Active-Primary-Button)] disabled:border-transparent disabled:bg-[var(--Surface-Tertiary)] disabled:text-[var(--Text-Disable)]",
|
|
15
|
-
tertiary: "bg-[var(--Surface-Tertiary)] text-[var(--Text-High-Emphasis)] hover:bg-[var(--Hover-Tertiary-Button)] active:bg-[var(--Active-Tertiary-Button)] disabled:text-[var(--Text-Disable)]",
|
|
16
|
-
destructive: "bg-[var(--Surface-Caution)] text-[var(--Text-on-Inverse)] hover:bg-[var(--Primitive-Sun-900)] active:bg-[var(--Primitive-Sun-900)] disabled:bg-[var(--Surface-Tertiary)] disabled:text-[var(--Text-Disable)]",
|
|
13
|
+
default: "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)] hover:bg-[var(--Hover-Primary-Button)] active:bg-[var(--Active-Primary-Button)] disabled:bg-[var(--Surface-Neutral-Tertiary)] disabled:text-[var(--Text-Disable)]",
|
|
14
|
+
secondary: "border border-transparent bg-[var(--Surface-Accent-Primary-Light)] text-[var(--Text-Accent-Primary)] hover:border-[var(--Hover-Primary-Button)] hover:bg-[var(--Hover-Secondary-Button)] hover:text-[var(--Hover-Primary-Button)] active:border-[var(--Active-Primary-Button)] active:bg-[var(--Active-Secondary-Button)] active:text-[var(--Active-Primary-Button)] disabled:border-transparent disabled:bg-[var(--Surface-Neutral-Tertiary)] disabled:text-[var(--Text-Disable)]",
|
|
15
|
+
tertiary: "bg-[var(--Surface-Neutral-Tertiary)] text-[var(--Text-High-Emphasis)] hover:bg-[var(--Hover-Tertiary-Button)] active:bg-[var(--Active-Tertiary-Button)] disabled:text-[var(--Text-Disable)]",
|
|
16
|
+
destructive: "bg-[var(--Surface-Caution)] text-[var(--Text-on-Inverse)] hover:bg-[var(--Primitive-Sun-900)] active:bg-[var(--Primitive-Sun-900)] disabled:bg-[var(--Surface-Neutral-Tertiary)] disabled:text-[var(--Text-Disable)]",
|
|
17
17
|
ghost: "text-[var(--Text-High-Emphasis)] hover:bg-[var(--Hover-Text-Button)] active:bg-[var(--Active-Text-Button)] disabled:text-[var(--Text-Disable)]",
|
|
18
18
|
/**
|
|
19
19
|
* outline — 白地 + 黒系の 1px 枠。ブランド色を使わない「準主役」の前進アクション
|
|
@@ -49,7 +49,7 @@ const u = y(
|
|
|
49
49
|
// 下地 Surface-Overlay-Light は「メディア上の可読性のため light/dark で切替えない」
|
|
50
50
|
// 設計(常に白80%)。文字色にセマンティック(dark で白に反転する Text-High-Emphasis)を
|
|
51
51
|
// 使うとダークモードで白地×白文字になり消えるため、文字も非反転の Primitive 固定にする
|
|
52
|
-
"border border-[var(--Border-Hairline)] bg-[var(--Surface-Overlay-Light)] text-[var(--Primitive-Gray-900)] shadow-md backdrop-blur-sm hover:bg-[var(--Primitive-White-alpha-900)] active:bg-[var(--Primitive-White-alpha-1000)] disabled:bg-[var(--Surface-Tertiary)] disabled:text-[var(--Text-Disable)] disabled:shadow-none"
|
|
52
|
+
"border border-[var(--Border-Hairline)] bg-[var(--Surface-Overlay-Light)] text-[var(--Primitive-Gray-900)] shadow-md backdrop-blur-sm hover:bg-[var(--Primitive-White-alpha-900)] active:bg-[var(--Primitive-White-alpha-1000)] disabled:bg-[var(--Surface-Neutral-Tertiary)] disabled:text-[var(--Text-Disable)] disabled:shadow-none"
|
|
53
53
|
)
|
|
54
54
|
},
|
|
55
55
|
size: {
|
|
@@ -119,11 +119,11 @@ function C(e) {
|
|
|
119
119
|
`[Button] loading の読み上げ文言の id「${e.id}」が重複しています。同じ aria-labelledby を複数のボタンで共有して loading にする場合は、各ボタンに id を付けてください。`
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function N(e, r) {
|
|
123
123
|
const t = e["aria-labelledby"]?.trim();
|
|
124
124
|
if (t) {
|
|
125
|
-
const
|
|
126
|
-
return { labelId:
|
|
125
|
+
const l = `${e.id ?? t.split(/\s+/).join("-")}-loading-label`;
|
|
126
|
+
return { labelId: l, attrs: { "aria-labelledby": `${t} ${l}` } };
|
|
127
127
|
}
|
|
128
128
|
const a = e["aria-label"];
|
|
129
129
|
return a && (typeof r == "string" || typeof r == "number") ? { attrs: { "aria-label": `${a} ${r}` } } : { attrs: {} };
|
|
@@ -133,12 +133,12 @@ function W({
|
|
|
133
133
|
variant: r = "default",
|
|
134
134
|
size: t = "default",
|
|
135
135
|
asChild: a = !1,
|
|
136
|
-
loading:
|
|
136
|
+
loading: l = !1,
|
|
137
137
|
loadingLabel: o = "処理中",
|
|
138
138
|
...b
|
|
139
139
|
}) {
|
|
140
140
|
const m = a ? p.Root : "button";
|
|
141
|
-
if (!
|
|
141
|
+
if (!l)
|
|
142
142
|
return /* @__PURE__ */ i(
|
|
143
143
|
m,
|
|
144
144
|
{
|
|
@@ -149,15 +149,15 @@ function W({
|
|
|
149
149
|
...b
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
|
-
const { children:
|
|
152
|
+
const { children: s, ...d } = b;
|
|
153
153
|
if (a) {
|
|
154
|
-
const x = h.isValidElement(
|
|
154
|
+
const x = h.isValidElement(s) ? h.cloneElement(s, {
|
|
155
155
|
"aria-disabled": !0,
|
|
156
156
|
tabIndex: -1,
|
|
157
157
|
onClick: n,
|
|
158
158
|
onClickCapture: n,
|
|
159
159
|
onAuxClickCapture: n
|
|
160
|
-
}) :
|
|
160
|
+
}) : s;
|
|
161
161
|
return /* @__PURE__ */ i(
|
|
162
162
|
p.Root,
|
|
163
163
|
{
|
|
@@ -173,7 +173,7 @@ function W({
|
|
|
173
173
|
}
|
|
174
174
|
);
|
|
175
175
|
}
|
|
176
|
-
const g = o != null && o !== !1 && o !== "", v = g ?
|
|
176
|
+
const g = o != null && o !== !1 && o !== "", v = g ? N(d, o) : { attrs: {} };
|
|
177
177
|
return /* @__PURE__ */ f(
|
|
178
178
|
"button",
|
|
179
179
|
{
|
|
@@ -194,7 +194,7 @@ function W({
|
|
|
194
194
|
onClickCapture: n,
|
|
195
195
|
onClick: n,
|
|
196
196
|
children: [
|
|
197
|
-
|
|
197
|
+
s,
|
|
198
198
|
g ? /* @__PURE__ */ i(
|
|
199
199
|
"span",
|
|
200
200
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
2
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
3
3
|
import * as x from "react";
|
|
4
4
|
import M from "iconsax-reactjs/dist/esm/TickSquare.js";
|
|
5
5
|
import { Checkbox as f } from "radix-ui";
|
|
@@ -22,7 +22,7 @@ function A({
|
|
|
22
22
|
function G({
|
|
23
23
|
className: c,
|
|
24
24
|
children: r,
|
|
25
|
-
description:
|
|
25
|
+
description: t,
|
|
26
26
|
expandedContent: o,
|
|
27
27
|
badge: d,
|
|
28
28
|
checked: i,
|
|
@@ -31,15 +31,15 @@ function G({
|
|
|
31
31
|
"aria-label": b,
|
|
32
32
|
"aria-labelledby": k,
|
|
33
33
|
"aria-describedby": y,
|
|
34
|
-
...
|
|
34
|
+
...N
|
|
35
35
|
}) {
|
|
36
|
-
const l = x.useId(), m = `${l}-label`,
|
|
36
|
+
const l = x.useId(), m = `${l}-label`, u = `${l}-description`, p = `${l}-expanded`, [S, B] = x.useState(n === !0), E = (i !== void 0 ? i : S) === !0, h = !!(r || d), C = k ?? (b === void 0 && h ? m : void 0), I = T(
|
|
37
37
|
// ラベルが無いカードは名前が内容(= 説明)になるので、説明を重ねて 2 回読ませない
|
|
38
|
-
|
|
39
|
-
o && E ?
|
|
38
|
+
t && h ? u : void 0,
|
|
39
|
+
o && E ? p : void 0,
|
|
40
40
|
y
|
|
41
41
|
);
|
|
42
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ s(
|
|
43
43
|
f.Root,
|
|
44
44
|
{
|
|
45
45
|
"data-slot": "checkbox-card-item",
|
|
@@ -55,18 +55,18 @@ function G({
|
|
|
55
55
|
// lint-scratch-allow: p-[15px] は border-2 を含めた見た目余白を Figma に合わせる補正値
|
|
56
56
|
"group flex cursor-pointer gap-2 rounded-lg border-2 border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Primary)] p-[15px] text-left outline-none transition-colors",
|
|
57
57
|
o ? "flex-col items-stretch" : "items-center",
|
|
58
|
-
"hover:border-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]",
|
|
58
|
+
"hover:border-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Neutral-Secondary)]",
|
|
59
59
|
"data-[state=checked]:border-[var(--Object-Accent-Primary)] data-[state=checked]:bg-[var(--Surface-Primary)]",
|
|
60
60
|
// フォーカス意匠は DS 共通(FOCUS_RING = 緑リング)。以前はオレンジの
|
|
61
61
|
// ring-2 で選択状態と紛らわしかったため統一した。
|
|
62
62
|
j,
|
|
63
63
|
"aria-invalid:border-[var(--Border-Caution)]",
|
|
64
|
-
"disabled:cursor-not-allowed disabled:border-[var(--Border-Medium-Emphasis)] disabled:bg-[var(--Surface-Secondary)] disabled:hover:border-[var(--Border-Medium-Emphasis)] disabled:hover:bg-[var(--Surface-Secondary)]",
|
|
64
|
+
"disabled:cursor-not-allowed disabled:border-[var(--Border-Medium-Emphasis)] disabled:bg-[var(--Surface-Neutral-Secondary)] disabled:hover:border-[var(--Border-Medium-Emphasis)] disabled:hover:bg-[var(--Surface-Neutral-Secondary)]",
|
|
65
65
|
c
|
|
66
66
|
),
|
|
67
|
-
...
|
|
67
|
+
...N,
|
|
68
68
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ s("span", { className: a("flex items-center gap-2", o && "w-full"), children: [
|
|
70
70
|
/* @__PURE__ */ e(
|
|
71
71
|
"span",
|
|
72
72
|
{
|
|
@@ -75,7 +75,7 @@ function G({
|
|
|
75
75
|
// lint-scratch-allow: rounded-[5px] は Figma チェックボックス固有値(トークン外)
|
|
76
76
|
"flex size-5 shrink-0 items-center justify-center rounded-[5px] border-2 border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Primary)] transition-colors",
|
|
77
77
|
"group-data-[state=checked]:border-transparent group-data-[state=checked]:bg-transparent",
|
|
78
|
-
"group-data-[disabled]:border-[var(--Border-Medium-Emphasis)] group-data-[disabled]:bg-[var(--Surface-Secondary)]"
|
|
78
|
+
"group-data-[disabled]:border-[var(--Border-Medium-Emphasis)] group-data-[disabled]:bg-[var(--Surface-Neutral-Secondary)]"
|
|
79
79
|
),
|
|
80
80
|
children: /* @__PURE__ */ e(
|
|
81
81
|
f.Indicator,
|
|
@@ -87,8 +87,8 @@ function G({
|
|
|
87
87
|
)
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
(r ||
|
|
91
|
-
(r || d) && /* @__PURE__ */
|
|
90
|
+
(r || t || d) && /* @__PURE__ */ s("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
91
|
+
(r || d) && /* @__PURE__ */ s("span", { id: m, className: "flex items-center gap-1.5", children: [
|
|
92
92
|
r && /* @__PURE__ */ e(
|
|
93
93
|
"span",
|
|
94
94
|
{
|
|
@@ -102,16 +102,16 @@ function G({
|
|
|
102
102
|
),
|
|
103
103
|
d && /* @__PURE__ */ e("span", { "data-slot": "checkbox-card-badge", children: d })
|
|
104
104
|
] }),
|
|
105
|
-
|
|
105
|
+
t && /* @__PURE__ */ e(
|
|
106
106
|
"span",
|
|
107
107
|
{
|
|
108
|
-
id:
|
|
108
|
+
id: u,
|
|
109
109
|
"data-slot": "checkbox-card-description",
|
|
110
110
|
className: a(
|
|
111
111
|
"typo-body-sm text-[var(--Text-Medium-Emphasis)]",
|
|
112
112
|
"group-data-[disabled]:text-[var(--Text-Low-Emphasis)]"
|
|
113
113
|
),
|
|
114
|
-
children:
|
|
114
|
+
children: t
|
|
115
115
|
}
|
|
116
116
|
)
|
|
117
117
|
] })
|
|
@@ -119,7 +119,7 @@ function G({
|
|
|
119
119
|
o && /* @__PURE__ */ e(
|
|
120
120
|
"span",
|
|
121
121
|
{
|
|
122
|
-
id:
|
|
122
|
+
id: p,
|
|
123
123
|
"data-slot": "checkbox-card-expanded",
|
|
124
124
|
className: "hidden border-t border-[var(--Border-Medium-Emphasis)] pt-3 group-data-[state=checked]:block",
|
|
125
125
|
children: o
|
|
@@ -53,20 +53,20 @@ function $({
|
|
|
53
53
|
count: a,
|
|
54
54
|
containerClassName: l,
|
|
55
55
|
className: m,
|
|
56
|
-
id:
|
|
56
|
+
id: N,
|
|
57
57
|
ref: u,
|
|
58
58
|
...s
|
|
59
59
|
}) {
|
|
60
|
-
const c = w(), b = i.useRef(null), f = i.useRef(void 0), [
|
|
60
|
+
const c = w(), b = i.useRef(null), f = i.useRef(void 0), [C, I] = i.useState(!1), R = i.useId(), n = N ?? R, h = i.useCallback((o) => {
|
|
61
61
|
const d = f.current;
|
|
62
62
|
f.current = void 0, d ? d() : o || k(u, null), b.current = o, o && (f.current = k(u, o));
|
|
63
63
|
}, [u]), v = `${n}-label`, p = r ? `${n}-description` : void 0;
|
|
64
64
|
if ((typeof window > "u" ? i.useEffect : i.useLayoutEffect)(() => {
|
|
65
65
|
if (e !== void 0 || !b.current || !c) return;
|
|
66
66
|
const o = Array.from(b.current.labels ?? []).filter((d) => d.id !== c.labelId);
|
|
67
|
-
|
|
67
|
+
I(o.length > 0);
|
|
68
68
|
}, [c, e]), e === void 0) {
|
|
69
|
-
const o = L({ ...s, id: n }, c,
|
|
69
|
+
const o = L({ ...s, id: n }, c, C);
|
|
70
70
|
return /* @__PURE__ */ t(g, { ref: h, id: n, className: m, ...s, ...o });
|
|
71
71
|
}
|
|
72
72
|
return /* @__PURE__ */ x(
|
|
@@ -77,8 +77,8 @@ function $({
|
|
|
77
77
|
"data-disabled": s.disabled || void 0,
|
|
78
78
|
className: E(
|
|
79
79
|
"flex items-center gap-3 rounded-md px-3 py-2 transition-colors cursor-pointer",
|
|
80
|
-
"hover:bg-[var(--Surface-Tertiary)]",
|
|
81
|
-
"has-[:focus-visible]:bg-[var(--Surface-Tertiary)]",
|
|
80
|
+
"hover:bg-[var(--Surface-Neutral-Tertiary)]",
|
|
81
|
+
"has-[:focus-visible]:bg-[var(--Surface-Neutral-Tertiary)]",
|
|
82
82
|
s.disabled && "cursor-not-allowed opacity-60 hover:bg-transparent has-[:focus-visible]:bg-transparent",
|
|
83
83
|
l
|
|
84
84
|
),
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { cva as e } from "class-variance-authority";
|
|
2
2
|
import { FOCUS_RING as a } from "../../lib/focus-ring.js";
|
|
3
|
-
const
|
|
3
|
+
const i = e(
|
|
4
4
|
`inline-flex items-center justify-center whitespace-nowrap transition-colors focus-visible:outline-none ${a}`,
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
8
|
filled: [
|
|
9
|
-
"bg-[var(--Surface-Secondary)] text-[var(--Text-High-Emphasis)]",
|
|
10
|
-
"hover:bg-[var(--Surface-Tertiary)]",
|
|
11
|
-
"disabled:text-[var(--Text-Disable)] disabled:hover:bg-[var(--Surface-Secondary)]"
|
|
9
|
+
"bg-[var(--Surface-Neutral-Secondary)] text-[var(--Text-High-Emphasis)]",
|
|
10
|
+
"hover:bg-[var(--Surface-Neutral-Tertiary)]",
|
|
11
|
+
"disabled:text-[var(--Text-Disable)] disabled:hover:bg-[var(--Surface-Neutral-Secondary)]"
|
|
12
12
|
].join(" "),
|
|
13
13
|
/** accent — 薄いブランド色地 + ブランド色文字。Chip の selected は使わなくなった(明示指定の互換のために残す) */
|
|
14
14
|
accent: [
|
|
15
15
|
"bg-[var(--Surface-Accent-Primary-Light)] text-[var(--Text-Accent-Primary)]",
|
|
16
16
|
"hover:bg-[var(--Surface-Accent-Primary)] hover:text-[var(--Text-on-Inverse)]",
|
|
17
|
-
"disabled:bg-[var(--Surface-Secondary)] disabled:text-[var(--Text-Disable)] disabled:hover:bg-[var(--Surface-Secondary)] disabled:hover:text-[var(--Text-Disable)]"
|
|
17
|
+
"disabled:bg-[var(--Surface-Neutral-Secondary)] disabled:text-[var(--Text-Disable)] disabled:hover:bg-[var(--Surface-Neutral-Secondary)] disabled:hover:text-[var(--Text-Disable)]"
|
|
18
18
|
].join(" "),
|
|
19
19
|
/**
|
|
20
20
|
* selected — Chip の選択中。ブランド色を使わず、グレー地 + 1px の黒系の枠で示す
|
|
@@ -24,9 +24,9 @@ const t = e(
|
|
|
24
24
|
* forced-colors では box-shadow が消えるため、Chip 側が Highlight の塗りで選択中を示す。
|
|
25
25
|
*/
|
|
26
26
|
selected: [
|
|
27
|
-
"bg-[var(--Surface-Tertiary)] text-[var(--Text-High-Emphasis)] inset-ring-1 inset-ring-[var(--Border-High-Emphasis)]",
|
|
27
|
+
"bg-[var(--Surface-Neutral-Tertiary)] text-[var(--Text-High-Emphasis)] inset-ring-1 inset-ring-[var(--Border-High-Emphasis)]",
|
|
28
28
|
"hover:bg-[var(--Hover-Tertiary-Button)]",
|
|
29
|
-
"disabled:bg-[var(--Surface-Secondary)] disabled:text-[var(--Text-Disable)] disabled:inset-ring-transparent disabled:hover:bg-[var(--Surface-Secondary)]"
|
|
29
|
+
"disabled:bg-[var(--Surface-Neutral-Secondary)] disabled:text-[var(--Text-Disable)] disabled:inset-ring-transparent disabled:hover:bg-[var(--Surface-Neutral-Secondary)]"
|
|
30
30
|
].join(" ")
|
|
31
31
|
},
|
|
32
32
|
size: {
|
|
@@ -50,5 +50,5 @@ const t = e(
|
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
export {
|
|
53
|
-
|
|
53
|
+
i as chipVariants
|
|
54
54
|
};
|