@cakejp/design-system 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +179 -0
- package/CLAUDE.md +5 -3
- package/MIGRATION.md +3 -3
- package/README.md +31 -11
- package/contracts/components.json +424 -62
- 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 +88 -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 +43 -22
- 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 +3076 -929
- 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 +19 -17
- 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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import { Popover as e } from "radix-ui";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as i } from "../../lib/utils.js";
|
|
6
6
|
function l({
|
|
7
7
|
...o
|
|
8
8
|
}) {
|
|
@@ -13,7 +13,7 @@ function c({
|
|
|
13
13
|
}) {
|
|
14
14
|
return /* @__PURE__ */ t(e.Trigger, { "data-slot": "popover-trigger", ...o });
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function v({
|
|
17
17
|
className: o,
|
|
18
18
|
align: r = "center",
|
|
19
19
|
sideOffset: a = 4,
|
|
@@ -25,22 +25,22 @@ function f({
|
|
|
25
25
|
"data-slot": "popover-content",
|
|
26
26
|
align: r,
|
|
27
27
|
sideOffset: a,
|
|
28
|
-
className:
|
|
29
|
-
"z-[var(--Z-Popover)] w-72 origin-(--radix-popover-content-transform-origin) rounded-md border border-[var(--Border-Medium-Emphasis)] bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
28
|
+
className: i(
|
|
29
|
+
"z-[var(--Z-Popover)] w-72 max-w-(--radix-popover-content-available-width) origin-(--radix-popover-content-transform-origin) rounded-md border border-[var(--Border-Medium-Emphasis)] bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
30
30
|
o
|
|
31
31
|
),
|
|
32
32
|
...n
|
|
33
33
|
}
|
|
34
34
|
) });
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function f({
|
|
37
37
|
...o
|
|
38
38
|
}) {
|
|
39
39
|
return /* @__PURE__ */ t(e.Anchor, { "data-slot": "popover-anchor", ...o });
|
|
40
40
|
}
|
|
41
41
|
export {
|
|
42
42
|
l as Popover,
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
f as PopoverAnchor,
|
|
44
|
+
v as PopoverContent,
|
|
45
45
|
c as PopoverTrigger
|
|
46
46
|
};
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { Progress as l } from "radix-ui";
|
|
4
4
|
import { cn as t } from "../../lib/utils.js";
|
|
5
5
|
function f({
|
|
6
|
-
className:
|
|
6
|
+
className: a,
|
|
7
7
|
value: e,
|
|
8
8
|
...r
|
|
9
9
|
}) {
|
|
10
10
|
const s = r["aria-label"] !== void 0 || r["aria-labelledby"] !== void 0;
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ o(
|
|
12
12
|
l.Root,
|
|
13
13
|
{
|
|
14
14
|
"data-slot": "progress",
|
|
15
15
|
"aria-label": s ? void 0 : "進捗",
|
|
16
16
|
className: t(
|
|
17
17
|
"relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
18
|
-
|
|
18
|
+
// forced-colors(Windows ハイコントラスト)ではレールも帯も Canvas に置き換わり進み具合が
|
|
19
|
+
// 見えなかった。レールは輪郭線(レイアウトに影響しない outline)、帯は OS の選択色で示す。
|
|
20
|
+
// 通常表示は不変
|
|
21
|
+
"forced-colors:outline forced-colors:outline-1 forced-colors:outline-[CanvasText]",
|
|
22
|
+
a
|
|
19
23
|
),
|
|
20
24
|
...r,
|
|
21
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ o(
|
|
22
26
|
l.Indicator,
|
|
23
27
|
{
|
|
24
28
|
"data-slot": "progress-indicator",
|
|
25
|
-
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
29
|
+
className: "h-full w-full flex-1 bg-primary transition-all forced-colors:bg-[Highlight]",
|
|
26
30
|
style: { transform: `translateX(-${100 - (e || 0)}%)` }
|
|
27
31
|
}
|
|
28
32
|
)
|
|
@@ -41,10 +41,13 @@ function y({
|
|
|
41
41
|
// レイアウト・サイズ・角丸・typo・focus リングはここから供給され、Chip 意匠変更に自動追従する。
|
|
42
42
|
u({ variant: "filled", size: "md", shape: "pill" }),
|
|
43
43
|
"cursor-pointer outline-none",
|
|
44
|
-
// checked =
|
|
45
|
-
//
|
|
44
|
+
// checked = 入力部品のオン状態なのでブランド色のまま(brandColorUsage の allowed)。
|
|
45
|
+
// Chip の selected はグレー地 + 黒系の枠に変わったため、見た目は Chip と別(Chip の accent と同一トークン)。
|
|
46
46
|
"data-[state=checked]:bg-[var(--Surface-Accent-Primary-Light)] data-[state=checked]:text-[var(--Brand-Cake-Orange)]",
|
|
47
47
|
"data-[state=checked]:hover:bg-[var(--Surface-Accent-Primary)] data-[state=checked]:hover:text-[var(--Text-on-Inverse)]",
|
|
48
|
+
// forced-colors(Windows ハイコントラスト)では薄オレンジ地が Canvas に置き換わり、未選択と
|
|
49
|
+
// 見分けがつかないため、選択中だけ OS の選択色で示す(Chip の selected と同じ。通常表示は不変)
|
|
50
|
+
"forced-colors:data-[state=checked]:bg-[Highlight] forced-colors:data-[state=checked]:text-[HighlightText]",
|
|
48
51
|
// form 固有の状態(chipVariants に無い分のみ compose)。disabled の配色は chipVariants filled が担う。
|
|
49
52
|
"aria-invalid:border aria-invalid:border-[var(--Border-Caution)]",
|
|
50
53
|
"disabled:cursor-not-allowed",
|
|
@@ -59,7 +62,7 @@ function y({
|
|
|
59
62
|
"data-slot": "radio-group-item",
|
|
60
63
|
className: e(
|
|
61
64
|
// lint-scratch-allow: p-[15px] は border-2 を含めた見た目余白を Figma に合わせる補正値
|
|
62
|
-
"group flex cursor-pointer gap-2 rounded-lg border-2 border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] p-[15px] text-left outline-none transition-colors",
|
|
65
|
+
"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",
|
|
63
66
|
d ? "flex-col items-stretch" : "items-center",
|
|
64
67
|
"hover:border-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]",
|
|
65
68
|
"data-[state=checked]:border-[var(--Object-Accent-Primary)] data-[state=checked]:bg-[var(--Surface-Primary)]",
|
|
@@ -1,77 +1,95 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
function
|
|
8
|
-
const [
|
|
9
|
-
return
|
|
10
|
-
const
|
|
11
|
-
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { cn as d } from "../../lib/utils.js";
|
|
5
|
+
import { DialogClose as w, DialogContent as C, DialogDescription as v, DialogFooter as h, DialogHeader as R, DialogTitle as x, DialogTrigger as I, Dialog as T } from "./dialog.js";
|
|
6
|
+
import { DrawerClose as O, DrawerContent as E, DrawerDescription as F, DrawerFooter as H, DrawerHeader as S, DrawerTitle as y, DrawerTrigger as L, Drawer as P } from "./drawer.js";
|
|
7
|
+
function M(e = 768) {
|
|
8
|
+
const [o, i] = s.useState(!1);
|
|
9
|
+
return s.useEffect(() => {
|
|
10
|
+
const n = window.matchMedia(`(max-width: ${e - 1}px)`), l = (c) => {
|
|
11
|
+
i(c.matches);
|
|
12
12
|
};
|
|
13
|
-
return
|
|
14
|
-
}, [
|
|
13
|
+
return l(n), n.addEventListener("change", l), () => n.removeEventListener("change", l);
|
|
14
|
+
}, [e]), o;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const m = s.createContext(null);
|
|
17
|
+
function r() {
|
|
18
|
+
const e = s.useContext(m), o = M();
|
|
19
|
+
return e?.isMobile ?? o;
|
|
18
20
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
function A({ children: e, ...o }) {
|
|
22
|
+
const i = M(), n = o.open !== void 0, [l, c] = s.useState(!1), f = n ? o.open : l, [p, u] = s.useState(!1), g = s.useRef(!1);
|
|
23
|
+
s.useEffect(() => {
|
|
24
|
+
if (g.current)
|
|
25
|
+
f || u(i);
|
|
26
|
+
else {
|
|
27
|
+
const a = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(max-width: 767px)").matches;
|
|
28
|
+
u(a), g.current = !0;
|
|
29
|
+
}
|
|
30
|
+
}, [f, i]);
|
|
31
|
+
const D = { ...o, onOpenChange: (a) => {
|
|
32
|
+
n || (a && u(i), c(a)), o.onOpenChange?.(a);
|
|
33
|
+
} }, b = p ? /* @__PURE__ */ t(P, { ...D, children: e }) : /* @__PURE__ */ t(T, { ...D, children: e });
|
|
34
|
+
return /* @__PURE__ */ t(m.Provider, { value: { isMobile: p }, children: b });
|
|
35
|
+
}
|
|
36
|
+
function B({
|
|
37
|
+
className: e,
|
|
38
|
+
...o
|
|
22
39
|
}) {
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */ t(
|
|
40
|
+
const n = r() ? L : I;
|
|
41
|
+
return /* @__PURE__ */ t(n, { className: e, ...o });
|
|
25
42
|
}
|
|
26
|
-
function
|
|
27
|
-
className:
|
|
28
|
-
children:
|
|
43
|
+
function G({
|
|
44
|
+
className: e,
|
|
45
|
+
children: o,
|
|
46
|
+
size: i,
|
|
29
47
|
...n
|
|
30
48
|
}) {
|
|
31
|
-
return
|
|
49
|
+
return r() ? /* @__PURE__ */ t(E, { className: d("px-4 pb-6", e), ...n, children: o }) : /* @__PURE__ */ t(C, { className: e, size: i, ...n, children: o });
|
|
32
50
|
}
|
|
33
|
-
function
|
|
34
|
-
className:
|
|
35
|
-
...
|
|
51
|
+
function J({
|
|
52
|
+
className: e,
|
|
53
|
+
...o
|
|
36
54
|
}) {
|
|
37
|
-
const
|
|
38
|
-
return /* @__PURE__ */ t(
|
|
55
|
+
const n = r() ? S : R;
|
|
56
|
+
return /* @__PURE__ */ t(n, { className: e, ...o });
|
|
39
57
|
}
|
|
40
|
-
function
|
|
41
|
-
className:
|
|
42
|
-
...
|
|
58
|
+
function K({
|
|
59
|
+
className: e,
|
|
60
|
+
...o
|
|
43
61
|
}) {
|
|
44
|
-
const
|
|
45
|
-
return /* @__PURE__ */ t(
|
|
62
|
+
const n = r() ? H : h;
|
|
63
|
+
return /* @__PURE__ */ t(n, { className: e, ...o });
|
|
46
64
|
}
|
|
47
|
-
function
|
|
48
|
-
className:
|
|
49
|
-
...
|
|
65
|
+
function N({
|
|
66
|
+
className: e,
|
|
67
|
+
...o
|
|
50
68
|
}) {
|
|
51
|
-
const
|
|
52
|
-
return /* @__PURE__ */ t(
|
|
69
|
+
const n = r() ? y : x;
|
|
70
|
+
return /* @__PURE__ */ t(n, { className: e, ...o });
|
|
53
71
|
}
|
|
54
|
-
function
|
|
55
|
-
className:
|
|
56
|
-
...
|
|
72
|
+
function Q({
|
|
73
|
+
className: e,
|
|
74
|
+
...o
|
|
57
75
|
}) {
|
|
58
|
-
const
|
|
59
|
-
return /* @__PURE__ */ t(
|
|
76
|
+
const n = r() ? F : v;
|
|
77
|
+
return /* @__PURE__ */ t(n, { className: e, ...o });
|
|
60
78
|
}
|
|
61
|
-
function
|
|
62
|
-
...
|
|
79
|
+
function U({
|
|
80
|
+
...e
|
|
63
81
|
}) {
|
|
64
|
-
const
|
|
65
|
-
return /* @__PURE__ */ t(
|
|
82
|
+
const i = r() ? O : w;
|
|
83
|
+
return /* @__PURE__ */ t(i, { ...e });
|
|
66
84
|
}
|
|
67
85
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
86
|
+
A as ResponsiveDialog,
|
|
87
|
+
U as ResponsiveDialogClose,
|
|
88
|
+
G as ResponsiveDialogContent,
|
|
89
|
+
Q as ResponsiveDialogDescription,
|
|
90
|
+
K as ResponsiveDialogFooter,
|
|
91
|
+
J as ResponsiveDialogHeader,
|
|
92
|
+
N as ResponsiveDialogTitle,
|
|
93
|
+
B as ResponsiveDialogTrigger,
|
|
94
|
+
M as useIsMobile
|
|
77
95
|
};
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import { jsxs as s, jsx as
|
|
1
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { ScrollArea as
|
|
3
|
+
import { ScrollArea as l } from "radix-ui";
|
|
4
4
|
import { cn as t } from "../../lib/utils.js";
|
|
5
|
-
|
|
5
|
+
import { FORCED_COLORS_FOCUS as n } from "../../lib/focus-ring.js";
|
|
6
|
+
function f({
|
|
6
7
|
className: e,
|
|
7
8
|
children: r,
|
|
8
9
|
...a
|
|
9
10
|
}) {
|
|
10
11
|
return /* @__PURE__ */ s(
|
|
11
|
-
|
|
12
|
+
l.Root,
|
|
12
13
|
{
|
|
13
14
|
"data-slot": "scroll-area",
|
|
14
15
|
className: t("relative", e),
|
|
15
16
|
...a,
|
|
16
17
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
|
|
18
|
+
/* @__PURE__ */ o(
|
|
19
|
+
l.Viewport,
|
|
19
20
|
{
|
|
20
21
|
"data-slot": "scroll-area-viewport",
|
|
21
22
|
tabIndex: 0,
|
|
22
|
-
className:
|
|
23
|
+
className: t(
|
|
24
|
+
"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-[color:var(--Focus-Ring-Control,color-mix(in_oklab,var(--ring)_50%,transparent))] focus-visible:outline-1",
|
|
25
|
+
n
|
|
26
|
+
),
|
|
23
27
|
children: r
|
|
24
28
|
}
|
|
25
29
|
),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */ l
|
|
30
|
+
/* @__PURE__ */ o(c, {}),
|
|
31
|
+
/* @__PURE__ */ o(l.Corner, {})
|
|
28
32
|
]
|
|
29
33
|
}
|
|
30
34
|
);
|
|
@@ -34,8 +38,8 @@ function c({
|
|
|
34
38
|
orientation: r = "vertical",
|
|
35
39
|
...a
|
|
36
40
|
}) {
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
|
|
41
|
+
return /* @__PURE__ */ o(
|
|
42
|
+
l.ScrollAreaScrollbar,
|
|
39
43
|
{
|
|
40
44
|
"data-slot": "scroll-area-scrollbar",
|
|
41
45
|
orientation: r,
|
|
@@ -46,8 +50,8 @@ function c({
|
|
|
46
50
|
e
|
|
47
51
|
),
|
|
48
52
|
...a,
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
-
|
|
53
|
+
children: /* @__PURE__ */ o(
|
|
54
|
+
l.ScrollAreaThumb,
|
|
51
55
|
{
|
|
52
56
|
"data-slot": "scroll-area-thumb",
|
|
53
57
|
className: "relative flex-1 rounded-full bg-border"
|
|
@@ -57,6 +61,6 @@ function c({
|
|
|
57
61
|
);
|
|
58
62
|
}
|
|
59
63
|
export {
|
|
60
|
-
|
|
64
|
+
f as ScrollArea,
|
|
61
65
|
c as ScrollBar
|
|
62
66
|
};
|
|
@@ -2,15 +2,15 @@ import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { CheckIcon as c, ChevronDownIcon as i, ChevronUpIcon as u } from "lucide-react";
|
|
4
4
|
import { Select as a } from "radix-ui";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { FOCUS_RING as m } from "../../lib/focus-ring.js";
|
|
7
|
-
import { resolveFieldAria as
|
|
8
|
-
function
|
|
5
|
+
import { cn as s } from "../../lib/utils.js";
|
|
6
|
+
import { FOCUS_RING as m, FORCED_COLORS_MENU_ITEM as p } from "../../lib/focus-ring.js";
|
|
7
|
+
import { resolveFieldAria as f, useFieldLabelling as g } from "../../lib/field-labelling.js";
|
|
8
|
+
function _({
|
|
9
9
|
...e
|
|
10
10
|
}) {
|
|
11
11
|
return /* @__PURE__ */ t(a.Root, { "data-slot": "select", ...e });
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function C({
|
|
14
14
|
...e
|
|
15
15
|
}) {
|
|
16
16
|
return /* @__PURE__ */ t(a.Group, { "data-slot": "select-group", ...e });
|
|
@@ -20,19 +20,19 @@ function I({
|
|
|
20
20
|
}) {
|
|
21
21
|
return /* @__PURE__ */ t(a.Value, { "data-slot": "select-value", ...e });
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function B({
|
|
24
24
|
className: e,
|
|
25
25
|
size: r = "default",
|
|
26
|
-
children:
|
|
26
|
+
children: o,
|
|
27
27
|
...l
|
|
28
28
|
}) {
|
|
29
|
-
const n =
|
|
29
|
+
const n = f(l, g());
|
|
30
30
|
return /* @__PURE__ */ d(
|
|
31
31
|
a.Trigger,
|
|
32
32
|
{
|
|
33
33
|
"data-slot": "select-trigger",
|
|
34
34
|
"data-size": r,
|
|
35
|
-
className:
|
|
35
|
+
className: s(
|
|
36
36
|
"flex w-full items-center justify-between gap-2 rounded-lg border border-[var(--Border-High-Emphasis)] bg-transparent px-3 py-2 typo-body-md whitespace-nowrap transition-[color,box-shadow,border-color] outline-none hover:border-[var(--Focus-High-Emphasis)] hover:bg-[var(--Surface-Secondary)] disabled:cursor-not-allowed disabled:border-[var(--Border-Medium-Emphasis)] disabled:bg-[var(--Surface-Secondary)] disabled:text-[var(--Text-Disable)] disabled:hover:border-[var(--Border-Medium-Emphasis)] disabled:hover:bg-[var(--Surface-Secondary)] aria-invalid:border-[var(--Border-Caution)] aria-invalid:ring-[var(--Border-Caution)]/20 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
37
37
|
// フォーカス意匠は DS 共通(FOCUS_RING)。
|
|
38
38
|
m,
|
|
@@ -46,16 +46,16 @@ function C({
|
|
|
46
46
|
...l,
|
|
47
47
|
...n,
|
|
48
48
|
children: [
|
|
49
|
-
|
|
49
|
+
o,
|
|
50
50
|
/* @__PURE__ */ t(a.Icon, { asChild: !0, children: /* @__PURE__ */ t(i, { className: "size-4 text-[var(--Text-High-Emphasis)]" }) })
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function E({
|
|
56
56
|
className: e,
|
|
57
57
|
children: r,
|
|
58
|
-
position:
|
|
58
|
+
position: o = "item-aligned",
|
|
59
59
|
align: l = "center",
|
|
60
60
|
...n
|
|
61
61
|
}) {
|
|
@@ -63,27 +63,31 @@ function _({
|
|
|
63
63
|
a.Content,
|
|
64
64
|
{
|
|
65
65
|
"data-slot": "select-content",
|
|
66
|
-
className:
|
|
66
|
+
className: s(
|
|
67
67
|
"relative z-[var(--Z-Popover)] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-[var(--Border-Medium-Emphasis)] bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
68
|
-
|
|
68
|
+
o === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
69
|
+
// 画面内に使える幅まで(popper のときだけ Radix が変数を出す)。長い選択肢があると
|
|
70
|
+
// 一覧が 1 行の長さまで伸び、幅 390px の画面で右端 684px まではみ出していた。
|
|
71
|
+
// 収まる一覧には効かない(既定の見た目は変わらない)。item-aligned(既定)は Radix が画面内に寄せる。
|
|
72
|
+
o === "popper" && "max-w-(--radix-select-content-available-width)",
|
|
69
73
|
e
|
|
70
74
|
),
|
|
71
|
-
position:
|
|
75
|
+
position: o,
|
|
72
76
|
align: l,
|
|
73
77
|
...n,
|
|
74
78
|
children: [
|
|
75
|
-
/* @__PURE__ */ t(
|
|
79
|
+
/* @__PURE__ */ t(v, {}),
|
|
76
80
|
/* @__PURE__ */ t(
|
|
77
81
|
a.Viewport,
|
|
78
82
|
{
|
|
79
|
-
className:
|
|
83
|
+
className: s(
|
|
80
84
|
"p-1",
|
|
81
|
-
|
|
85
|
+
o === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
82
86
|
),
|
|
83
87
|
children: r
|
|
84
88
|
}
|
|
85
89
|
),
|
|
86
|
-
/* @__PURE__ */ t(
|
|
90
|
+
/* @__PURE__ */ t(h, {})
|
|
87
91
|
]
|
|
88
92
|
}
|
|
89
93
|
) });
|
|
@@ -96,25 +100,26 @@ function j({
|
|
|
96
100
|
a.Label,
|
|
97
101
|
{
|
|
98
102
|
"data-slot": "select-label",
|
|
99
|
-
className:
|
|
103
|
+
className: s("px-2 py-1.5 typo-body-sm text-muted-foreground", e),
|
|
100
104
|
...r
|
|
101
105
|
}
|
|
102
106
|
);
|
|
103
107
|
}
|
|
104
|
-
function
|
|
108
|
+
function T({
|
|
105
109
|
className: e,
|
|
106
110
|
children: r,
|
|
107
|
-
...
|
|
111
|
+
...o
|
|
108
112
|
}) {
|
|
109
113
|
return /* @__PURE__ */ d(
|
|
110
114
|
a.Item,
|
|
111
115
|
{
|
|
112
116
|
"data-slot": "select-item",
|
|
113
|
-
className:
|
|
114
|
-
"relative flex w-full cursor-default items-center gap-2 rounded-md py-2.5 pr-8 pl-3 typo-body-md outline-
|
|
117
|
+
className: s(
|
|
118
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-md py-2.5 pr-8 pl-3 typo-body-md outline-none select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
119
|
+
p,
|
|
115
120
|
e
|
|
116
121
|
),
|
|
117
|
-
...
|
|
122
|
+
...o,
|
|
118
123
|
children: [
|
|
119
124
|
/* @__PURE__ */ t(
|
|
120
125
|
"span",
|
|
@@ -129,7 +134,7 @@ function E({
|
|
|
129
134
|
}
|
|
130
135
|
);
|
|
131
136
|
}
|
|
132
|
-
function
|
|
137
|
+
function D({
|
|
133
138
|
className: e,
|
|
134
139
|
...r
|
|
135
140
|
}) {
|
|
@@ -137,12 +142,12 @@ function T({
|
|
|
137
142
|
a.Separator,
|
|
138
143
|
{
|
|
139
144
|
"data-slot": "select-separator",
|
|
140
|
-
className:
|
|
145
|
+
className: s("pointer-events-none -mx-1 my-1 h-px bg-border", e),
|
|
141
146
|
...r
|
|
142
147
|
}
|
|
143
148
|
);
|
|
144
149
|
}
|
|
145
|
-
function
|
|
150
|
+
function v({
|
|
146
151
|
className: e,
|
|
147
152
|
...r
|
|
148
153
|
}) {
|
|
@@ -150,7 +155,7 @@ function g({
|
|
|
150
155
|
a.ScrollUpButton,
|
|
151
156
|
{
|
|
152
157
|
"data-slot": "select-scroll-up-button",
|
|
153
|
-
className:
|
|
158
|
+
className: s(
|
|
154
159
|
"flex cursor-default items-center justify-center py-1",
|
|
155
160
|
e
|
|
156
161
|
),
|
|
@@ -159,7 +164,7 @@ function g({
|
|
|
159
164
|
}
|
|
160
165
|
);
|
|
161
166
|
}
|
|
162
|
-
function
|
|
167
|
+
function h({
|
|
163
168
|
className: e,
|
|
164
169
|
...r
|
|
165
170
|
}) {
|
|
@@ -167,7 +172,7 @@ function v({
|
|
|
167
172
|
a.ScrollDownButton,
|
|
168
173
|
{
|
|
169
174
|
"data-slot": "select-scroll-down-button",
|
|
170
|
-
className:
|
|
175
|
+
className: s(
|
|
171
176
|
"flex cursor-default items-center justify-center py-1",
|
|
172
177
|
e
|
|
173
178
|
),
|
|
@@ -177,14 +182,14 @@ function v({
|
|
|
177
182
|
);
|
|
178
183
|
}
|
|
179
184
|
export {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
_ as Select,
|
|
186
|
+
E as SelectContent,
|
|
187
|
+
C as SelectGroup,
|
|
188
|
+
T as SelectItem,
|
|
184
189
|
j as SelectLabel,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
190
|
+
h as SelectScrollDownButton,
|
|
191
|
+
v as SelectScrollUpButton,
|
|
192
|
+
D as SelectSeparator,
|
|
193
|
+
B as SelectTrigger,
|
|
189
194
|
I as SelectValue
|
|
190
195
|
};
|