@cakejp/design-system 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +172 -0
- package/CLAUDE.md +5 -3
- package/MIGRATION.md +3 -3
- package/README.md +31 -11
- package/contracts/components.json +420 -63
- package/contracts/composition.json +38 -4
- package/contracts/rules.json +27 -5
- package/contracts/screen-patterns.json +6 -4
- package/dist/components/ec/admin-shell.js +62 -60
- package/dist/components/ec/anniversary-card.js +13 -12
- package/dist/components/ec/coupon-card.js +11 -11
- package/dist/components/ec/delivery-calendar.js +51 -45
- package/dist/components/ec/mypage-shell.js +80 -69
- package/dist/components/ec/product-card.js +93 -76
- package/dist/components/ec/product-carousel.js +65 -60
- package/dist/components/ec/product-detail-bar.js +13 -11
- package/dist/components/ec/product-detail-sidebar.js +60 -58
- package/dist/components/ec/product-list-item.js +64 -63
- package/dist/components/ec/product-option.js +30 -26
- package/dist/components/ec/rating-stars.js +27 -27
- package/dist/components/ec/review-card.js +32 -32
- package/dist/components/ec/review-form.js +37 -37
- package/dist/components/ec/shop-card.js +21 -19
- package/dist/components/foundations/accordion.js +33 -31
- package/dist/components/foundations/alert-dialog.js +4 -5
- package/dist/components/foundations/badge.js +5 -5
- package/dist/components/foundations/breadcrumb.js +27 -26
- package/dist/components/foundations/button.js +144 -25
- package/dist/components/foundations/calendar.js +28 -26
- package/dist/components/foundations/checkbox-card.js +71 -47
- package/dist/components/foundations/checkbox-group.js +30 -27
- package/dist/components/foundations/checkbox.js +69 -52
- package/dist/components/foundations/chip-variants.js +13 -0
- package/dist/components/foundations/command.js +81 -79
- package/dist/components/foundations/confirm-dialog.js +136 -0
- package/dist/components/foundations/context-menu.js +43 -38
- package/dist/components/foundations/data-table.js +87 -84
- package/dist/components/foundations/dialog.js +45 -36
- package/dist/components/foundations/dropdown-menu.js +47 -42
- package/dist/components/foundations/file-input.js +97 -67
- package/dist/components/foundations/hover-card.js +21 -21
- package/dist/components/foundations/menubar.js +75 -69
- package/dist/components/foundations/navigation-menu.js +31 -26
- package/dist/components/foundations/pagination.js +54 -50
- package/dist/components/foundations/popover.js +7 -7
- package/dist/components/foundations/progress.js +10 -6
- package/dist/components/foundations/radio-group.js +6 -3
- package/dist/components/foundations/responsive-dialog.js +73 -55
- package/dist/components/foundations/scroll-area.js +18 -14
- package/dist/components/foundations/select.js +44 -39
- package/dist/components/foundations/sheet.js +45 -37
- package/dist/components/foundations/skeleton.js +6 -6
- package/dist/components/foundations/skip-link.js +10 -8
- package/dist/components/foundations/slider.js +73 -48
- package/dist/components/foundations/sonner.js +5 -4
- package/dist/components/foundations/spinner.js +7 -5
- package/dist/components/foundations/switch.js +11 -10
- package/dist/components/foundations/tabs.js +54 -39
- package/dist/components/foundations/toggle-group.js +29 -21
- package/dist/components/foundations/toggle.js +20 -16
- package/dist/components/primitives/admin-side-nav.js +65 -62
- package/dist/components/primitives/banner-carousel.js +32 -29
- package/dist/components/primitives/bottom-tab-bar.js +16 -15
- package/dist/components/primitives/category-scroll.js +39 -29
- package/dist/components/primitives/category-shortcuts.js +9 -9
- package/dist/components/primitives/chat-composer.js +77 -74
- package/dist/components/primitives/chip.js +84 -61
- package/dist/components/primitives/combobox.js +63 -47
- package/dist/components/primitives/container.js +9 -9
- package/dist/components/primitives/content-card.js +15 -17
- package/dist/components/primitives/content-carousel.js +79 -68
- package/dist/components/primitives/date-picker.js +137 -99
- package/dist/components/primitives/footer.js +36 -37
- package/dist/components/primitives/header.js +175 -168
- package/dist/components/primitives/image-carousel.js +107 -87
- package/dist/components/primitives/image-gallery.js +32 -27
- package/dist/components/primitives/image-uploader.js +6 -6
- package/dist/components/primitives/list-item.js +59 -51
- package/dist/components/primitives/menu-drawer.js +36 -38
- package/dist/components/primitives/multi-select.js +89 -58
- package/dist/components/primitives/notification-list.js +10 -9
- package/dist/components/primitives/number-input.js +116 -105
- package/dist/components/primitives/scroll-row.js +21 -0
- package/dist/components/primitives/search-bar.js +31 -28
- package/dist/components/primitives/section-header.js +54 -53
- package/dist/components/primitives/side-nav.js +57 -56
- package/dist/components/primitives/sub-nav.js +13 -14
- package/dist/components/primitives/tag.js +4 -2
- package/dist/index.css +1 -1
- package/dist/index.js +3051 -924
- package/dist/lib/field-labelling.js +31 -21
- package/dist/lib/focus-ring.js +22 -4
- package/dist/lib/high-contrast.js +4 -0
- package/dist/lib/image-index.js +8 -0
- package/dist/lib/use-prefers-reduced-motion.js +21 -0
- package/dist/types/components/ec/admin-shell.d.ts +11 -1
- package/dist/types/components/ec/anniversary-card.d.ts +9 -1
- package/dist/types/components/ec/mypage-shell.d.ts +12 -1
- package/dist/types/components/ec/product-card.d.ts +13 -1
- package/dist/types/components/ec/product-carousel.d.ts +13 -1
- package/dist/types/components/ec/product-detail-bar.d.ts +12 -1
- package/dist/types/components/ec/product-detail-sidebar.d.ts +11 -1
- package/dist/types/components/ec/product-list-item.d.ts +9 -1
- package/dist/types/components/ec/rating-stars.d.ts +2 -0
- package/dist/types/components/ec/review-card.d.ts +1 -1
- package/dist/types/components/ec/shop-card.d.ts +8 -1
- package/dist/types/components/foundations/badge.d.ts +1 -1
- package/dist/types/components/foundations/breadcrumb.d.ts +8 -1
- package/dist/types/components/foundations/button.d.ts +38 -3
- package/dist/types/components/foundations/checkbox-card.d.ts +7 -1
- package/dist/types/components/foundations/checkbox.d.ts +1 -1
- package/dist/types/components/foundations/chip-variants.d.ts +2 -2
- package/dist/types/components/foundations/confirm-dialog.d.ts +61 -0
- package/dist/types/components/foundations/data-table.d.ts +9 -2
- package/dist/types/components/foundations/dialog.d.ts +16 -1
- package/dist/types/components/foundations/pagination.d.ts +1 -1
- package/dist/types/components/foundations/responsive-dialog.d.ts +2 -1
- package/dist/types/components/foundations/sheet.d.ts +12 -1
- package/dist/types/components/foundations/skeleton.d.ts +6 -0
- package/dist/types/components/foundations/slider.d.ts +15 -1
- package/dist/types/components/foundations/tabs.d.ts +7 -0
- package/dist/types/components/primitives/admin-side-nav.d.ts +22 -2
- package/dist/types/components/primitives/banner-carousel.d.ts +9 -1
- package/dist/types/components/primitives/bottom-tab-bar.d.ts +13 -2
- package/dist/types/components/primitives/category-scroll.d.ts +10 -1
- package/dist/types/components/primitives/category-shortcuts.d.ts +11 -2
- package/dist/types/components/primitives/chip.d.ts +22 -3
- package/dist/types/components/primitives/combobox.d.ts +7 -2
- package/dist/types/components/primitives/container.d.ts +3 -0
- package/dist/types/components/primitives/content-card.d.ts +1 -1
- package/dist/types/components/primitives/content-carousel.d.ts +12 -4
- package/dist/types/components/primitives/date-picker.d.ts +10 -3
- package/dist/types/components/primitives/footer.d.ts +1 -1
- package/dist/types/components/primitives/header.d.ts +14 -2
- package/dist/types/components/primitives/image-carousel.d.ts +23 -5
- package/dist/types/components/primitives/list-item.d.ts +10 -1
- package/dist/types/components/primitives/menu-drawer.d.ts +1 -1
- package/dist/types/components/primitives/multi-select.d.ts +7 -2
- package/dist/types/components/primitives/notification-list.d.ts +10 -1
- package/dist/types/components/primitives/number-input.d.ts +18 -5
- package/dist/types/components/primitives/scroll-row.d.ts +43 -0
- package/dist/types/components/primitives/section-header.d.ts +9 -2
- package/dist/types/components/primitives/side-nav.d.ts +13 -1
- package/dist/types/components/primitives/sub-nav.d.ts +1 -1
- package/dist/types/components/primitives/tag.d.ts +1 -1
- package/dist/types/index.d.ts +7 -1
- package/dist/types/lib/field-labelling.d.ts +23 -8
- package/dist/types/lib/focus-ring.d.ts +70 -3
- package/dist/types/lib/high-contrast.d.ts +25 -0
- package/dist/types/lib/image-index.d.ts +2 -0
- package/dist/types/lib/link-component.d.ts +26 -21
- package/dist/types/lib/use-prefers-reduced-motion.d.ts +9 -0
- package/package.json +11 -3
- package/src/components/COMPONENT_LOOKUP.md +18 -16
- package/src/preset-standalone.css +42 -0
- package/src/preset.css +20 -1
- package/src/styles/semantic.css +57 -0
- package/templates/AGENTS.md +5 -1
- package/templates/CLAUDE.md +3 -1
- package/tokens.json +49 -0
- package/dist/lib/link-component.js +0 -6
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { XIcon as
|
|
3
|
+
import { XIcon as p } from "lucide-react";
|
|
4
4
|
import { Dialog as a } from "radix-ui";
|
|
5
5
|
import { cn as r } from "../../lib/utils.js";
|
|
6
|
-
function
|
|
6
|
+
function N({ ...t }) {
|
|
7
7
|
return /* @__PURE__ */ e(a.Root, { "data-slot": "sheet", ...t });
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function C({
|
|
10
10
|
...t
|
|
11
11
|
}) {
|
|
12
12
|
return /* @__PURE__ */ e(a.Trigger, { "data-slot": "sheet-trigger", ...t });
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function D({
|
|
15
15
|
...t
|
|
16
16
|
}) {
|
|
17
17
|
return /* @__PURE__ */ e(a.Close, { "data-slot": "sheet-close", ...t });
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function g({
|
|
20
20
|
...t
|
|
21
21
|
}) {
|
|
22
22
|
return /* @__PURE__ */ e(a.Portal, { "data-slot": "sheet-portal", ...t });
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function x({
|
|
25
25
|
className: t,
|
|
26
26
|
...o
|
|
27
27
|
}) {
|
|
@@ -37,41 +37,49 @@ function p({
|
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
const d = {
|
|
41
|
+
sm: "sm:max-w-sm",
|
|
42
|
+
md: "sm:max-w-[576px]",
|
|
43
|
+
lg: "sm:max-w-[768px]"
|
|
44
|
+
};
|
|
45
|
+
function T({
|
|
41
46
|
className: t,
|
|
42
47
|
children: o,
|
|
43
|
-
side:
|
|
44
|
-
|
|
48
|
+
side: s = "right",
|
|
49
|
+
size: u = "sm",
|
|
50
|
+
showCloseButton: c = !0,
|
|
45
51
|
autoFocus: l = !0,
|
|
46
|
-
onOpenAutoFocus:
|
|
47
|
-
onCloseAutoFocus:
|
|
48
|
-
...
|
|
52
|
+
onOpenAutoFocus: m,
|
|
53
|
+
onCloseAutoFocus: f,
|
|
54
|
+
...h
|
|
49
55
|
}) {
|
|
50
|
-
return /* @__PURE__ */ i(
|
|
51
|
-
/* @__PURE__ */ e(
|
|
56
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
57
|
+
/* @__PURE__ */ e(x, {}),
|
|
52
58
|
/* @__PURE__ */ i(
|
|
53
59
|
a.Content,
|
|
54
60
|
{
|
|
55
61
|
"data-slot": "sheet-content",
|
|
56
|
-
onOpenAutoFocus: (
|
|
57
|
-
l ||
|
|
62
|
+
onOpenAutoFocus: (n) => {
|
|
63
|
+
l || n.preventDefault(), m?.(n);
|
|
58
64
|
},
|
|
59
|
-
onCloseAutoFocus: (
|
|
60
|
-
l ||
|
|
65
|
+
onCloseAutoFocus: (n) => {
|
|
66
|
+
l || n.preventDefault(), f?.(n);
|
|
61
67
|
},
|
|
62
68
|
className: r(
|
|
63
69
|
"fixed z-[var(--Z-Modal)] flex flex-col gap-4 border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Elevated)] shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-[var(--Motion-Duration-Slow)] data-[state=open]:animate-in data-[state=open]:duration-[var(--Motion-Duration-Slower)]",
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
s === "right" && "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
|
|
71
|
+
s === "left" && "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",
|
|
72
|
+
s === "top" && "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
73
|
+
s === "bottom" && "inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
74
|
+
// 型に無い size(AlertDialog の "default" と取り違えた JSX など)でも幅の上限を消さず、既定の sm にする
|
|
75
|
+
(s === "right" || s === "left") && (d[u] ?? d.sm),
|
|
68
76
|
t
|
|
69
77
|
),
|
|
70
|
-
...
|
|
78
|
+
...h,
|
|
71
79
|
children: [
|
|
72
80
|
o,
|
|
73
|
-
|
|
74
|
-
/* @__PURE__ */ e(
|
|
81
|
+
c && /* @__PURE__ */ i(a.Close, { className: "absolute top-2 right-2 flex size-10 items-center justify-center rounded-full text-[var(--Text-Low-Emphasis)] transition-colors hover:bg-[var(--Surface-Tertiary)] hover:text-[var(--Text-High-Emphasis)] focus:ring-2 focus:ring-[var(--Focus-High-Emphasis)] focus:outline-hidden disabled:pointer-events-none", children: [
|
|
82
|
+
/* @__PURE__ */ e(p, { className: "size-5" }),
|
|
75
83
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "閉じる" })
|
|
76
84
|
] })
|
|
77
85
|
]
|
|
@@ -79,7 +87,7 @@ function D({
|
|
|
79
87
|
)
|
|
80
88
|
] });
|
|
81
89
|
}
|
|
82
|
-
function
|
|
90
|
+
function z({ className: t, ...o }) {
|
|
83
91
|
return /* @__PURE__ */ e(
|
|
84
92
|
"div",
|
|
85
93
|
{
|
|
@@ -89,7 +97,7 @@ function T({ className: t, ...o }) {
|
|
|
89
97
|
}
|
|
90
98
|
);
|
|
91
99
|
}
|
|
92
|
-
function
|
|
100
|
+
function E({ className: t, ...o }) {
|
|
93
101
|
return /* @__PURE__ */ e(
|
|
94
102
|
"div",
|
|
95
103
|
{
|
|
@@ -99,7 +107,7 @@ function C({ className: t, ...o }) {
|
|
|
99
107
|
}
|
|
100
108
|
);
|
|
101
109
|
}
|
|
102
|
-
function
|
|
110
|
+
function M({
|
|
103
111
|
className: t,
|
|
104
112
|
...o
|
|
105
113
|
}) {
|
|
@@ -112,7 +120,7 @@ function E({
|
|
|
112
120
|
}
|
|
113
121
|
);
|
|
114
122
|
}
|
|
115
|
-
function
|
|
123
|
+
function O({
|
|
116
124
|
className: t,
|
|
117
125
|
...o
|
|
118
126
|
}) {
|
|
@@ -126,12 +134,12 @@ function M({
|
|
|
126
134
|
);
|
|
127
135
|
}
|
|
128
136
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
N as Sheet,
|
|
138
|
+
D as SheetClose,
|
|
139
|
+
T as SheetContent,
|
|
140
|
+
O as SheetDescription,
|
|
141
|
+
E as SheetFooter,
|
|
142
|
+
z as SheetHeader,
|
|
143
|
+
M as SheetTitle,
|
|
144
|
+
C as SheetTrigger
|
|
137
145
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
function m({ className: e, ...
|
|
4
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as t } from "../../lib/utils.js";
|
|
3
|
+
function m({ className: e, ...o }) {
|
|
4
|
+
return /* @__PURE__ */ r(
|
|
5
5
|
"div",
|
|
6
6
|
{
|
|
7
7
|
"data-slot": "skeleton",
|
|
8
|
-
className:
|
|
9
|
-
...
|
|
8
|
+
className: t("animate-pulse motion-reduce:animate-none rounded-md bg-[var(--Surface-Tertiary)]", e),
|
|
9
|
+
...o
|
|
10
10
|
}
|
|
11
11
|
);
|
|
12
12
|
}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { cn as u } from "../../lib/utils.js";
|
|
4
|
+
import { FORCED_COLORS_FOCUS as f } from "../../lib/focus-ring.js";
|
|
5
|
+
function e({ href: o = "#main-content", label: s = "コンテンツへ移動", className: r, ...c }) {
|
|
6
|
+
return /* @__PURE__ */ i(
|
|
6
7
|
"a",
|
|
7
8
|
{
|
|
8
9
|
"data-slot": "skip-link",
|
|
9
10
|
href: o,
|
|
10
|
-
className:
|
|
11
|
+
className: u(
|
|
11
12
|
// 通常は視覚的に隠す(読み上げ・タブ順には残す)。フォーカス時のみ左上に可視化。
|
|
12
13
|
"sr-only",
|
|
13
14
|
"focus:not-sr-only focus:absolute focus:left-4 focus:top-4 focus:z-[var(--Z-SkipLink)] focus:px-4 focus:py-2",
|
|
14
15
|
"focus:rounded-md focus:shadow-md focus:outline-none",
|
|
15
16
|
"focus:bg-[var(--Surface-Primary)] focus:text-[var(--Text-High-Emphasis)]",
|
|
16
17
|
"focus:ring-2 focus:ring-[var(--Focus-High-Emphasis)]",
|
|
18
|
+
f,
|
|
17
19
|
"typo-label-md",
|
|
18
|
-
|
|
20
|
+
r
|
|
19
21
|
),
|
|
20
|
-
...
|
|
22
|
+
...c,
|
|
21
23
|
children: s
|
|
22
24
|
}
|
|
23
25
|
);
|
|
24
26
|
}
|
|
25
27
|
export {
|
|
26
|
-
|
|
28
|
+
e as SkipLink
|
|
27
29
|
};
|
|
@@ -1,74 +1,99 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { Slider as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { FOCUS_RING as
|
|
7
|
-
import { useFieldLabelling as
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
import { jsxs as E, jsx as b } from "react/jsx-runtime";
|
|
3
|
+
import * as K from "react";
|
|
4
|
+
import { Slider as c } from "radix-ui";
|
|
5
|
+
import { cn as d } from "../../lib/utils.js";
|
|
6
|
+
import { FOCUS_RING as _ } from "../../lib/focus-ring.js";
|
|
7
|
+
import { useFieldLabelling as G } from "../../lib/field-labelling.js";
|
|
8
|
+
function R(u) {
|
|
9
|
+
return (String(u).split(".")[1] || "").length;
|
|
10
|
+
}
|
|
11
|
+
function Q({
|
|
12
|
+
className: u,
|
|
13
|
+
defaultValue: o,
|
|
14
|
+
value: l,
|
|
15
|
+
min: n = 0,
|
|
16
|
+
max: f = 100,
|
|
17
|
+
step: h = 1,
|
|
18
|
+
minStepsBetweenThumbs: v = 0,
|
|
19
|
+
onValueChange: y,
|
|
20
|
+
onValueCommit: k,
|
|
21
|
+
disabled: p,
|
|
22
|
+
thumbLabels: w,
|
|
23
|
+
"aria-label": A,
|
|
24
|
+
"aria-labelledby": C,
|
|
25
|
+
...z
|
|
18
26
|
}) {
|
|
19
|
-
const
|
|
20
|
-
() => Array.isArray(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
const S = G(), i = Array.isArray(l), g = i ? l.length : Array.isArray(o) ? o.length : 1, s = g > 1, [D, T] = K.useState(
|
|
28
|
+
() => Array.isArray(o) ? o : [n]
|
|
29
|
+
), t = i ? l : D, O = (r, a) => {
|
|
30
|
+
const e = v * h, H = a === "start" ? r === 0 ? n : (t[r - 1] ?? n) + e : r === t.length - 1 ? f : (t[r + 1] ?? f) - e, I = Math.max(R(h), R(e)), N = Number(H.toFixed(I));
|
|
31
|
+
if (N === t[r]) return;
|
|
32
|
+
const m = t.map((j, B) => B === r ? N : j);
|
|
33
|
+
i || T(m), y?.(m), k?.(m);
|
|
34
|
+
}, $ = (r) => (a) => {
|
|
35
|
+
!s || p || a.key !== "Home" && a.key !== "End" || (a.preventDefault(), O(r, a.key === "Home" ? "start" : "end"));
|
|
36
|
+
}, F = (r, a) => {
|
|
37
|
+
if (w?.[r]) return { "aria-label": w[r] };
|
|
38
|
+
if (A) {
|
|
39
|
+
const e = a === 1 ? "" : r === 0 ? "(下限)" : r === a - 1 ? "(上限)" : `(${r + 1}つ目)`;
|
|
40
|
+
return { "aria-label": `${A}${e}` };
|
|
27
41
|
}
|
|
28
|
-
return
|
|
42
|
+
return C ? { "aria-labelledby": C } : S ? { "aria-labelledby": S.labelId } : {};
|
|
29
43
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
|
|
44
|
+
return /* @__PURE__ */ E(
|
|
45
|
+
c.Root,
|
|
32
46
|
{
|
|
33
47
|
"data-slot": "slider",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
step: h,
|
|
49
|
+
minStepsBetweenThumbs: v,
|
|
50
|
+
disabled: p,
|
|
51
|
+
defaultValue: s ? void 0 : o,
|
|
52
|
+
value: s ? t : l,
|
|
53
|
+
onValueChange: (r) => {
|
|
54
|
+
s && !i && T(r), y?.(r);
|
|
55
|
+
},
|
|
56
|
+
onValueCommit: k,
|
|
57
|
+
min: n,
|
|
58
|
+
max: f,
|
|
59
|
+
className: d(
|
|
39
60
|
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
40
|
-
|
|
61
|
+
u
|
|
41
62
|
),
|
|
42
|
-
...
|
|
63
|
+
...z,
|
|
43
64
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
65
|
+
/* @__PURE__ */ b(
|
|
66
|
+
c.Track,
|
|
46
67
|
{
|
|
47
68
|
"data-slot": "slider-track",
|
|
48
|
-
className:
|
|
49
|
-
"relative grow overflow-hidden rounded-full bg-[var(--Surface-Tertiary)] data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
69
|
+
className: d(
|
|
70
|
+
"relative grow overflow-hidden rounded-full bg-[var(--Surface-Control-Track,var(--Surface-Tertiary))] data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
|
|
71
|
+
// forced-colors(Windows ハイコントラスト)ではレールも範囲も Canvas に置き換わり見えなかった。
|
|
72
|
+
// レールは輪郭線(レイアウトに影響しない outline)、範囲は OS の選択色で示す。通常表示は不変
|
|
73
|
+
"forced-colors:outline forced-colors:outline-1 forced-colors:outline-[CanvasText]"
|
|
50
74
|
),
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
|
|
75
|
+
children: /* @__PURE__ */ b(
|
|
76
|
+
c.Range,
|
|
53
77
|
{
|
|
54
78
|
"data-slot": "slider-range",
|
|
55
|
-
className:
|
|
56
|
-
"absolute bg-[var(--Brand-Cake-Orange)] data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
79
|
+
className: d(
|
|
80
|
+
"absolute bg-[var(--Brand-Cake-Orange)] data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full forced-colors:bg-[Highlight]"
|
|
57
81
|
)
|
|
58
82
|
}
|
|
59
83
|
)
|
|
60
84
|
}
|
|
61
85
|
),
|
|
62
|
-
Array.from({ length:
|
|
63
|
-
|
|
86
|
+
Array.from({ length: g }, (r, a) => /* @__PURE__ */ b(
|
|
87
|
+
c.Thumb,
|
|
64
88
|
{
|
|
65
89
|
"data-slot": "slider-thumb",
|
|
66
|
-
...
|
|
67
|
-
|
|
90
|
+
...F(a, g),
|
|
91
|
+
onKeyDown: $(a),
|
|
92
|
+
className: d(
|
|
68
93
|
"block size-5 shrink-0 rounded-full border-2 border-[var(--Brand-Cake-Orange)] bg-[var(--Surface-Primary)] shadow-sm ring-[var(--Brand-Cake-Orange)]/20 transition-[color,box-shadow,transform] hover:ring-4 hover:scale-125 focus-visible:outline-hidden active:scale-110 active:ring-6 active:shadow-md disabled:pointer-events-none disabled:opacity-50",
|
|
69
94
|
// hover もリングを出すため、フォーカスは DS 共通の緑リング(FOCUS_RING)
|
|
70
95
|
// で区別できるようにする(以前は hover と同じオレンジ ring-4 だった)。
|
|
71
|
-
|
|
96
|
+
_
|
|
72
97
|
)
|
|
73
98
|
},
|
|
74
99
|
a
|
|
@@ -78,5 +103,5 @@ function O({
|
|
|
78
103
|
);
|
|
79
104
|
}
|
|
80
105
|
export {
|
|
81
|
-
|
|
106
|
+
Q as Slider
|
|
82
107
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { Loader2Icon as t, OctagonXIcon as i, TriangleAlertIcon as o, InfoIcon as
|
|
3
|
+
import { Loader2Icon as t, OctagonXIcon as i, TriangleAlertIcon as o, InfoIcon as n, CircleCheckIcon as s } from "lucide-react";
|
|
4
4
|
import { useTheme as v } from "next-themes";
|
|
5
5
|
import { Toaster as c } from "sonner";
|
|
6
6
|
const g = ({ ...a }) => {
|
|
@@ -11,11 +11,12 @@ const g = ({ ...a }) => {
|
|
|
11
11
|
theme: e,
|
|
12
12
|
className: "toaster group",
|
|
13
13
|
icons: {
|
|
14
|
-
success: /* @__PURE__ */ r(
|
|
15
|
-
info: /* @__PURE__ */ r(
|
|
14
|
+
success: /* @__PURE__ */ r(s, { className: "size-4 text-[var(--Text-Success)]" }),
|
|
15
|
+
info: /* @__PURE__ */ r(n, { className: "size-4 text-[var(--Primitive-Sea-600)]" }),
|
|
16
16
|
warning: /* @__PURE__ */ r(o, { className: "size-4 text-[var(--Text-Warning)]" }),
|
|
17
17
|
error: /* @__PURE__ */ r(i, { className: "size-4 text-[var(--Primitive-Sun-800)]" }),
|
|
18
|
-
|
|
18
|
+
// 動きを減らす設定では回転を止める(--Motion-* の一括制御は animate-spin に効かない)
|
|
19
|
+
loading: /* @__PURE__ */ r(t, { className: "size-4 animate-spin motion-reduce:animate-none text-[var(--Text-Medium-Emphasis)]" })
|
|
19
20
|
},
|
|
20
21
|
toastOptions: {
|
|
21
22
|
classNames: {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
function
|
|
3
|
+
import { cn as n } from "../../lib/utils.js";
|
|
4
|
+
function t({ className: e, size: s = "md", ...a }) {
|
|
5
5
|
return /* @__PURE__ */ r(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
8
|
"data-slot": "spinner",
|
|
9
9
|
role: "status",
|
|
10
10
|
"aria-label": "読み込み中",
|
|
11
|
-
className:
|
|
11
|
+
className: n(
|
|
12
12
|
// shrink-0 必須: 「読み込み中…」テキストと横並びにされるため、既定の flex-shrink:1 だと円が楕円に潰れる
|
|
13
|
-
|
|
13
|
+
// motion-reduce:animate-none: 動きを減らす設定では回転を止める(--Motion-* の一括制御は
|
|
14
|
+
// animate-spin に効かないため個別に指定)。止めても上辺だけ色付きの欠けた輪と role="status" で処理中と分かる
|
|
15
|
+
"shrink-0 animate-spin motion-reduce:animate-none rounded-full border-[var(--Border-Medium-Emphasis)] border-t-[var(--Brand-Cake-Orange)]",
|
|
14
16
|
{
|
|
15
17
|
sm: "size-4 border-2",
|
|
16
18
|
md: "size-8 border-[3px]",
|
|
@@ -24,5 +26,5 @@ function m({ className: e, size: s = "md", ...a }) {
|
|
|
24
26
|
);
|
|
25
27
|
}
|
|
26
28
|
export {
|
|
27
|
-
|
|
29
|
+
t as Spinner
|
|
28
30
|
};
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Switch as
|
|
3
|
+
import { Switch as o } from "radix-ui";
|
|
4
4
|
import { Check as n } from "lucide-react";
|
|
5
5
|
import { cn as a } from "../../lib/utils.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { FOCUS_RING_ONLY as d } from "../../lib/focus-ring.js";
|
|
7
|
+
import { resolveFieldAria as u, useFieldLabelling as m } from "../../lib/field-labelling.js";
|
|
8
|
+
function v({
|
|
9
|
+
className: s,
|
|
9
10
|
size: r = "default",
|
|
10
11
|
...i
|
|
11
12
|
}) {
|
|
12
|
-
const t = r === "default", c =
|
|
13
|
+
const t = r === "default", c = u(i, m());
|
|
13
14
|
return /* @__PURE__ */ e(
|
|
14
|
-
|
|
15
|
+
o.Root,
|
|
15
16
|
{
|
|
16
17
|
"data-slot": "switch",
|
|
17
18
|
"data-size": r,
|
|
18
19
|
className: a(
|
|
19
20
|
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 transition-colors duration-[var(--Motion-Duration-Base)] outline-none",
|
|
20
|
-
|
|
21
|
+
d,
|
|
21
22
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
22
23
|
"data-[state=checked]:border-[var(--Object-Accent-Primary)] data-[state=checked]:bg-[var(--Object-Accent-Primary)]",
|
|
23
24
|
"data-[state=unchecked]:border-[var(--Object-Low-Emphasis)] data-[state=unchecked]:bg-[var(--Object-Low-Emphasis)]",
|
|
24
25
|
"dark:data-[state=unchecked]:border-[var(--Object-Medium-Emphasis)] dark:data-[state=unchecked]:bg-[var(--Object-Medium-Emphasis)]",
|
|
25
26
|
t ? "h-8 w-[52px]" : "h-6 w-10",
|
|
26
|
-
|
|
27
|
+
s
|
|
27
28
|
),
|
|
28
29
|
...i,
|
|
29
30
|
...c,
|
|
30
31
|
children: /* @__PURE__ */ e(
|
|
31
|
-
|
|
32
|
+
o.Thumb,
|
|
32
33
|
{
|
|
33
34
|
"data-slot": "switch-thumb",
|
|
34
35
|
className: a(
|
|
@@ -50,5 +51,5 @@ function k({
|
|
|
50
51
|
);
|
|
51
52
|
}
|
|
52
53
|
export {
|
|
53
|
-
|
|
54
|
+
v as Switch
|
|
54
55
|
};
|
|
@@ -1,28 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cva as
|
|
4
|
-
import { Tabs as
|
|
5
|
-
import { cn as
|
|
6
|
-
|
|
3
|
+
import { cva as l } from "class-variance-authority";
|
|
4
|
+
import { Tabs as i } from "radix-ui";
|
|
5
|
+
import { cn as s } from "../../lib/utils.js";
|
|
6
|
+
import { FOCUS_RING as d } from "../../lib/focus-ring.js";
|
|
7
|
+
const b = "data-[orientation=vertical]:flex-row data-[orientation=vertical]:items-start data-[orientation=vertical]:gap-4", g = "data-[orientation=vertical]:w-auto data-[orientation=vertical]:max-w-[50%] data-[orientation=vertical]:shrink-0 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", c = [
|
|
8
|
+
"data-[orientation=vertical]:justify-start data-[orientation=vertical]:whitespace-normal data-[orientation=vertical]:text-left",
|
|
9
|
+
// underbar: 均等割り(flex-1)と下線をやめ、パネル側(右)の線で選択中を示す。高さは折り返しに合わせて伸ばす
|
|
10
|
+
"group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:h-auto group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:min-h-12 group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:flex-none group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:border-b-0 group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:border-r-2 group-data-[variant=underbar]/tabs-list:data-[orientation=vertical]:px-4",
|
|
11
|
+
// segment: 高さを折り返しに合わせて伸ばす(1 行なら従来の 37px)
|
|
12
|
+
"group-data-[variant=segment]/tabs-list:data-[orientation=vertical]:h-auto group-data-[variant=segment]/tabs-list:data-[orientation=vertical]:min-h-[37px] group-data-[variant=segment]/tabs-list:data-[orientation=vertical]:py-2"
|
|
13
|
+
].join(" "), u = "data-[orientation=vertical]:min-w-0", p = [
|
|
14
|
+
"forced-colors:group-data-[variant=segment]/tabs-list:data-[state=active]:bg-[Highlight] forced-colors:group-data-[variant=segment]/tabs-list:data-[state=active]:text-[HighlightText]",
|
|
15
|
+
"forced-colors:group-data-[variant=underbar]/tabs-list:data-[state=inactive]:border-[Canvas] forced-colors:group-data-[variant=underbar]/tabs-list:data-[state=active]:border-[Highlight]"
|
|
16
|
+
].join(" "), v = "forced-colors:group-data-[scrollable]/tabs-list:group-data-[state=inactive]/trigger:border-[Canvas] forced-colors:group-data-[state=active]/trigger:border-[Highlight]";
|
|
17
|
+
function E({
|
|
7
18
|
className: t,
|
|
8
19
|
...a
|
|
9
20
|
}) {
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
|
|
21
|
+
return /* @__PURE__ */ r(
|
|
22
|
+
i.Root,
|
|
12
23
|
{
|
|
13
24
|
"data-slot": "tabs",
|
|
14
|
-
className:
|
|
25
|
+
className: s("flex flex-col", b, t),
|
|
15
26
|
...a
|
|
16
27
|
}
|
|
17
28
|
);
|
|
18
29
|
}
|
|
19
|
-
const
|
|
30
|
+
const m = l(
|
|
20
31
|
"group/tabs-list inline-flex items-center",
|
|
21
32
|
{
|
|
22
33
|
variants: {
|
|
23
34
|
variant: {
|
|
24
35
|
underbar: "w-full bg-transparent overflow-x-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",
|
|
25
|
-
|
|
36
|
+
// 縦向きでは縦長の地に rounded-full だと上下が半円になり、先頭・末尾のタブの角がはみ出すため角丸を 2xl に抑える
|
|
37
|
+
segment: "w-fit rounded-full bg-[var(--Surface-Tertiary)] p-2 data-[orientation=vertical]:rounded-2xl"
|
|
26
38
|
},
|
|
27
39
|
scrollable: {
|
|
28
40
|
true: "gap-4"
|
|
@@ -46,37 +58,37 @@ const b = n(
|
|
|
46
58
|
}
|
|
47
59
|
}
|
|
48
60
|
);
|
|
49
|
-
function
|
|
61
|
+
function R({
|
|
50
62
|
className: t,
|
|
51
63
|
variant: a = "underbar",
|
|
52
|
-
scrollable:
|
|
53
|
-
size:
|
|
54
|
-
...
|
|
64
|
+
scrollable: e = !1,
|
|
65
|
+
size: o = "md",
|
|
66
|
+
...n
|
|
55
67
|
}) {
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
|
|
68
|
+
return /* @__PURE__ */ r(
|
|
69
|
+
i.List,
|
|
58
70
|
{
|
|
59
71
|
"data-slot": "tabs-list",
|
|
60
72
|
"data-variant": a,
|
|
61
|
-
"data-scrollable":
|
|
62
|
-
"data-size":
|
|
63
|
-
className:
|
|
64
|
-
...
|
|
73
|
+
"data-scrollable": e || void 0,
|
|
74
|
+
"data-size": o,
|
|
75
|
+
className: s(m({ variant: a, scrollable: e, size: o }), g, t),
|
|
76
|
+
...n
|
|
65
77
|
}
|
|
66
78
|
);
|
|
67
79
|
}
|
|
68
|
-
function
|
|
80
|
+
function C({
|
|
69
81
|
className: t,
|
|
70
82
|
children: a,
|
|
71
|
-
...
|
|
83
|
+
...e
|
|
72
84
|
}) {
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
|
|
85
|
+
return /* @__PURE__ */ r(
|
|
86
|
+
i.Trigger,
|
|
75
87
|
{
|
|
76
88
|
"data-slot": "tabs-trigger",
|
|
77
|
-
className:
|
|
78
|
-
// Base
|
|
79
|
-
"group/trigger relative inline-flex items-center justify-center whitespace-nowrap transition-colors focus-visible:outline-2 focus-visible
|
|
89
|
+
className: s(
|
|
90
|
+
// Base(フォーカスの輪郭線は内側に描く: TabsList の overflow-x-auto が外側の輪郭線を全辺切り取っていた)
|
|
91
|
+
"group/trigger relative inline-flex items-center justify-center whitespace-nowrap transition-colors focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring/70 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
80
92
|
// Underbar variant (default: equal-width tabs with full-width underline)
|
|
81
93
|
// px-2: 均等割りで幅が詰まったとき、隣のラベルと文字が接触しないための最小余白(issue #235)
|
|
82
94
|
"group-data-[variant=underbar]/tabs-list:h-12 group-data-[variant=underbar]/tabs-list:flex-1 group-data-[variant=underbar]/tabs-list:border-b-2 group-data-[variant=underbar]/tabs-list:border-transparent group-data-[variant=underbar]/tabs-list:px-2 group-data-[variant=underbar]/tabs-list:typo-label-md group-data-[variant=underbar]/tabs-list:text-[var(--Text-Low-Emphasis)]",
|
|
@@ -84,7 +96,8 @@ function x({
|
|
|
84
96
|
"group-data-[variant=underbar]/tabs-list:data-[state=active]:border-[var(--Text-High-Emphasis)] group-data-[variant=underbar]/tabs-list:data-[state=active]:text-[var(--Text-High-Emphasis)]",
|
|
85
97
|
// Scrollable underbar: shrink to text width, bold text, remove trigger border (underline moves to inner span)
|
|
86
98
|
// gap-4 で間隔を取っているので左右 padding は戻す(従来の間隔を保つ)
|
|
87
|
-
|
|
99
|
+
// !border-r-0: 縦向き underbar の右端の線(VERTICAL_TRIGGER)も scrollable では内側 span の下線に任せる
|
|
100
|
+
"group-data-[scrollable]/tabs-list:!flex-initial group-data-[scrollable]/tabs-list:!shrink-0 group-data-[scrollable]/tabs-list:!border-b-0 group-data-[scrollable]/tabs-list:!border-r-0 group-data-[scrollable]/tabs-list:!px-0 group-data-[scrollable]/tabs-list:data-[state=active]:!border-b-0 group-data-[scrollable]/tabs-list:typo-label-md",
|
|
88
101
|
// Segment variant
|
|
89
102
|
"group-data-[variant=segment]/tabs-list:h-[37px] group-data-[variant=segment]/tabs-list:min-w-[100px] group-data-[variant=segment]/tabs-list:rounded-full group-data-[variant=segment]/tabs-list:px-3 group-data-[variant=segment]/tabs-list:typo-body-md group-data-[variant=segment]/tabs-list:text-[var(--Text-High-Emphasis)]",
|
|
90
103
|
// size="sm": 狭い置き場所(サイドバー等)向け。1 項目あたりの最小幅を外し、
|
|
@@ -93,30 +106,32 @@ function x({
|
|
|
93
106
|
"group-data-[size=sm]/tabs-list:!min-w-0 group-data-[size=sm]/tabs-list:!px-2",
|
|
94
107
|
// Segment active
|
|
95
108
|
"group-data-[variant=segment]/tabs-list:data-[state=active]:bg-[var(--Surface-Primary)] group-data-[variant=segment]/tabs-list:data-[state=active]:shadow-[0px_4px_6px_-4px_rgba(24,39,75,0.12),0px_8px_8px_-4px_rgba(24,39,75,0.08)]",
|
|
109
|
+
c,
|
|
110
|
+
p,
|
|
96
111
|
t
|
|
97
112
|
),
|
|
98
|
-
...
|
|
99
|
-
children: /* @__PURE__ */
|
|
113
|
+
...e,
|
|
114
|
+
children: /* @__PURE__ */ r("span", { className: `group-data-[scrollable]/tabs-list:inline-block group-data-[scrollable]/tabs-list:border-b-2 group-data-[scrollable]/tabs-list:border-transparent group-data-[scrollable]/tabs-list:pb-px group-data-[state=active]/trigger:border-[var(--Text-High-Emphasis)] ${v}`, children: a })
|
|
100
115
|
}
|
|
101
116
|
);
|
|
102
117
|
}
|
|
103
|
-
function
|
|
118
|
+
function L({
|
|
104
119
|
className: t,
|
|
105
120
|
...a
|
|
106
121
|
}) {
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
|
|
122
|
+
return /* @__PURE__ */ r(
|
|
123
|
+
i.Content,
|
|
109
124
|
{
|
|
110
125
|
"data-slot": "tabs-content",
|
|
111
|
-
className:
|
|
126
|
+
className: s("flex-1 outline-none", d, u, t),
|
|
112
127
|
...a
|
|
113
128
|
}
|
|
114
129
|
);
|
|
115
130
|
}
|
|
116
131
|
export {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
132
|
+
E as Tabs,
|
|
133
|
+
L as TabsContent,
|
|
134
|
+
R as TabsList,
|
|
135
|
+
C as TabsTrigger,
|
|
136
|
+
m as tabsListVariants
|
|
122
137
|
};
|