@cakejp/design-system 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -0
- package/CLAUDE.md +5 -1
- package/MIGRATION.md +43 -0
- package/UPDATING.md +2 -0
- package/bin/check-tokens.mjs +136 -0
- package/bin/init.js +9 -0
- package/contracts/components.json +87 -25
- package/contracts/composition.json +9 -9
- package/contracts/rules.json +1 -1
- package/contracts/screen-patterns.json +1 -1
- package/dist/components/ec/admin-shell.js +7 -7
- package/dist/components/ec/anniversary-card.js +1 -1
- package/dist/components/ec/chart-controls.js +7 -7
- package/dist/components/ec/coupon-card.js +10 -10
- package/dist/components/ec/delivery-calendar.js +1 -1
- package/dist/components/ec/mypage-shell.js +1 -1
- package/dist/components/ec/order-section.js +1 -1
- package/dist/components/ec/order-summary.js +7 -5
- package/dist/components/ec/product-card.js +32 -30
- package/dist/components/ec/product-detail-sidebar.js +1 -1
- package/dist/components/ec/product-list-item.js +57 -56
- package/dist/components/ec/product-option.js +30 -30
- package/dist/components/ec/review-summary.js +1 -1
- package/dist/components/ec/shop-card.js +7 -7
- package/dist/components/foundations/accordion.js +1 -1
- package/dist/components/foundations/alert-dialog.js +65 -43
- package/dist/components/foundations/alert.js +74 -68
- package/dist/components/foundations/badge.js +4 -4
- package/dist/components/foundations/button.js +15 -15
- package/dist/components/foundations/checkbox-card.js +18 -18
- package/dist/components/foundations/checkbox.js +6 -6
- package/dist/components/foundations/chip-variants.js +8 -8
- package/dist/components/foundations/data-table.js +244 -209
- package/dist/components/foundations/dialog.js +84 -60
- package/dist/components/foundations/drawer.js +61 -53
- package/dist/components/foundations/field.js +51 -35
- package/dist/components/foundations/file-input.js +1 -1
- package/dist/components/foundations/input.js +9 -8
- package/dist/components/foundations/popover.js +15 -12
- package/dist/components/foundations/progress.js +19 -18
- package/dist/components/foundations/radio-group.js +26 -23
- package/dist/components/foundations/select.js +9 -8
- package/dist/components/foundations/sheet.js +82 -59
- package/dist/components/foundations/skeleton.js +6 -6
- package/dist/components/foundations/slider.js +7 -7
- package/dist/components/foundations/sonner.js +9 -8
- package/dist/components/foundations/switch.js +3 -2
- package/dist/components/foundations/tabs.js +5 -5
- package/dist/components/foundations/textarea.js +7 -6
- package/dist/components/foundations/toggle-group.js +5 -5
- package/dist/components/primitives/admin-header.js +3 -3
- package/dist/components/primitives/admin-side-nav.js +101 -92
- package/dist/components/primitives/category-shortcuts.js +6 -6
- package/dist/components/primitives/chat-composer.js +1 -1
- package/dist/components/primitives/chip.js +25 -25
- package/dist/components/primitives/combobox.js +74 -63
- package/dist/components/primitives/content-carousel.js +64 -62
- package/dist/components/primitives/date-picker.js +99 -96
- package/dist/components/primitives/error-state.js +9 -9
- package/dist/components/primitives/filter-bar.js +4 -4
- package/dist/components/primitives/footer.js +1 -1
- package/dist/components/primitives/form-field.js +8 -8
- package/dist/components/primitives/funnel-shell.js +5 -5
- package/dist/components/primitives/header.js +16 -16
- package/dist/components/primitives/image-carousel.js +42 -41
- package/dist/components/primitives/image-gallery.js +61 -58
- package/dist/components/primitives/image-input.js +2 -2
- package/dist/components/primitives/image-uploader.js +1 -1
- package/dist/components/primitives/kebab-menu.js +20 -16
- package/dist/components/primitives/list-item.js +17 -17
- package/dist/components/primitives/menu-drawer.js +11 -11
- package/dist/components/primitives/multi-select.js +66 -66
- package/dist/components/primitives/notification-list.js +13 -13
- package/dist/components/primitives/number-input.js +118 -112
- package/dist/components/primitives/progress-steps.js +3 -3
- package/dist/components/primitives/search-bar.js +6 -6
- package/dist/components/primitives/section-nav.js +1 -1
- package/dist/components/primitives/side-nav.js +1 -1
- package/dist/components/primitives/sub-nav.js +12 -12
- package/dist/components/primitives/tag.js +3 -3
- package/dist/components/primitives/workspace-shell.js +8 -8
- package/dist/index.css +1 -1
- package/dist/index.js +1479 -704
- package/dist/lib/focus-restore.js +67 -0
- package/dist/lib/focus-ring.js +1 -1
- package/dist/lib/ime.js +17 -0
- package/dist/lib/search-normalize.js +30 -0
- package/dist/types/components/ec/admin-shell.d.ts +1 -1
- package/dist/types/components/foundations/alert-dialog.d.ts +2 -2
- package/dist/types/components/foundations/alert.d.ts +14 -1
- package/dist/types/components/foundations/card.d.ts +3 -3
- package/dist/types/components/foundations/confirm-dialog.d.ts +3 -3
- package/dist/types/components/foundations/data-table.d.ts +1 -1
- package/dist/types/components/foundations/dialog.d.ts +2 -2
- package/dist/types/components/foundations/drawer.d.ts +1 -1
- package/dist/types/components/foundations/field.d.ts +23 -3
- package/dist/types/components/foundations/popover.d.ts +1 -1
- package/dist/types/components/foundations/sheet.d.ts +4 -3
- package/dist/types/components/foundations/sonner.d.ts +3 -2
- package/dist/types/components/primitives/admin-side-nav.d.ts +2 -0
- package/dist/types/components/primitives/combobox.d.ts +6 -0
- package/dist/types/components/primitives/date-picker.d.ts +8 -3
- package/dist/types/components/primitives/funnel-shell.d.ts +1 -1
- package/dist/types/components/primitives/kebab-menu.d.ts +10 -1
- package/dist/types/components/primitives/number-input.d.ts +20 -1
- package/dist/types/components/primitives/progress-steps.d.ts +1 -1
- package/dist/types/components/primitives/section.d.ts +1 -1
- package/dist/types/components/primitives/workspace-shell.d.ts +2 -2
- package/dist/types/index.d.ts +3 -4
- package/dist/types/lib/focus-restore.d.ts +52 -0
- package/dist/types/lib/focus-ring.d.ts +3 -0
- package/dist/types/lib/ime.d.ts +36 -0
- package/dist/types/lib/search-normalize.d.ts +28 -0
- package/package.json +3 -1
- package/src/components/COMPONENT_LOOKUP.md +12 -12
- package/src/preset-standalone.css +43 -21
- package/src/preset.css +36 -18
- package/src/styles/primitive.css +1 -0
- package/src/styles/semantic.css +12 -2
- package/tokens.json +22 -3
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as d, jsxs as s } from "react/jsx-runtime";
|
|
2
3
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
+
import { cn as u } from "../../lib/utils.js";
|
|
4
5
|
import { useValueLength as g } from "../../lib/use-value-length.js";
|
|
5
6
|
import { FOCUS_RING as y } from "../../lib/focus-ring.js";
|
|
6
7
|
import { resolveNativeFieldAria as w, useFieldLabelling as N } from "../../lib/field-labelling.js";
|
|
7
8
|
function R({
|
|
8
|
-
className:
|
|
9
|
-
type:
|
|
9
|
+
className: c,
|
|
10
|
+
type: p,
|
|
10
11
|
showCount: r,
|
|
11
12
|
maxLength: e,
|
|
12
13
|
value: o,
|
|
@@ -23,7 +24,7 @@ function R({
|
|
|
23
24
|
}), n = /* @__PURE__ */ d(
|
|
24
25
|
"input",
|
|
25
26
|
{
|
|
26
|
-
type:
|
|
27
|
+
type: p,
|
|
27
28
|
"data-slot": "input",
|
|
28
29
|
ref: m,
|
|
29
30
|
value: o,
|
|
@@ -32,18 +33,18 @@ function R({
|
|
|
32
33
|
onChange: r ? (x) => {
|
|
33
34
|
h(), i?.(x);
|
|
34
35
|
} : i,
|
|
35
|
-
className:
|
|
36
|
+
className: u(
|
|
36
37
|
// h-11(44px)= 入力コントロールの共通高さ。
|
|
37
38
|
// SelectTrigger(default) / DatePicker trigger / Button(default) と同値。
|
|
38
39
|
// tokens.json の touchTarget["text-input"].min = 44px を満たす最小サイズで、
|
|
39
40
|
// 管理画面の情報密度とタッチターゲットのバランスが取れる(iOS HIG の 44pt とも一致)。
|
|
40
41
|
// より大きくしたい場合は consumer が className="h-12" 等で上書きする。
|
|
41
|
-
"h-11 w-full min-w-0 rounded-lg border border-[var(--Border-High-Emphasis)] bg-transparent px-3 py-1 typo-body-lg md:typo-body-md transition-[color,box-shadow,border-color] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:typo-label-sm file:text-foreground placeholder:text-muted-foreground hover:border-[var(--Focus-High-Emphasis)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-[var(--Border-Low-Emphasis)] disabled:bg-[var(--Surface-Secondary)] disabled:text-[var(--Text-Disable)] disabled:placeholder:text-[var(--Text-Disable)]",
|
|
42
|
+
"h-11 w-full min-w-0 rounded-lg border border-[var(--Border-High-Emphasis)] bg-transparent px-3 py-1 typo-body-lg md:typo-body-md transition-[color,box-shadow,border-color] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:typo-label-sm file:text-foreground placeholder:text-muted-foreground hover:border-[var(--Focus-High-Emphasis)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-[var(--Border-Low-Emphasis)] disabled:bg-[var(--Surface-Neutral-Secondary)] disabled:text-[var(--Text-Disable)] disabled:placeholder:text-[var(--Text-Disable)]",
|
|
42
43
|
// フォーカス意匠は DS 共通(FOCUS_RING)。Tailwind の variant 順で
|
|
43
44
|
// focus-visible は hover より後に出力されるため、hover の枠線に必ず勝つ。
|
|
44
45
|
y,
|
|
45
46
|
"aria-invalid:border-[var(--Border-Caution)] aria-invalid:ring-[var(--Border-Caution)]/20",
|
|
46
|
-
|
|
47
|
+
c
|
|
47
48
|
),
|
|
48
49
|
...a,
|
|
49
50
|
...b
|
|
@@ -57,7 +58,7 @@ function R({
|
|
|
57
58
|
"span",
|
|
58
59
|
{
|
|
59
60
|
"data-slot": "input-count",
|
|
60
|
-
className:
|
|
61
|
+
className: u(
|
|
61
62
|
"typo-body-xs",
|
|
62
63
|
v ? "text-[var(--Text-Caution)]" : "text-[var(--Text-Low-Emphasis)]"
|
|
63
64
|
),
|
|
@@ -2,22 +2,24 @@
|
|
|
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
|
|
6
|
-
|
|
5
|
+
import { cn as d } from "../../lib/utils.js";
|
|
6
|
+
import { composeEscapeKeyDownWithImeGuard as p } from "../../lib/ime.js";
|
|
7
|
+
function v({
|
|
7
8
|
...o
|
|
8
9
|
}) {
|
|
9
10
|
return /* @__PURE__ */ t(e.Root, { "data-slot": "popover", ...o });
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
+
function u({
|
|
12
13
|
...o
|
|
13
14
|
}) {
|
|
14
15
|
return /* @__PURE__ */ t(e.Trigger, { "data-slot": "popover-trigger", ...o });
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function g({
|
|
17
18
|
className: o,
|
|
18
19
|
align: r = "center",
|
|
19
20
|
sideOffset: a = 4,
|
|
20
|
-
|
|
21
|
+
onEscapeKeyDown: n,
|
|
22
|
+
...i
|
|
21
23
|
}) {
|
|
22
24
|
return /* @__PURE__ */ t(e.Portal, { children: /* @__PURE__ */ t(
|
|
23
25
|
e.Content,
|
|
@@ -25,22 +27,23 @@ function v({
|
|
|
25
27
|
"data-slot": "popover-content",
|
|
26
28
|
align: r,
|
|
27
29
|
sideOffset: a,
|
|
28
|
-
|
|
30
|
+
onEscapeKeyDown: p(n),
|
|
31
|
+
className: d(
|
|
29
32
|
"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
33
|
o
|
|
31
34
|
),
|
|
32
|
-
...
|
|
35
|
+
...i
|
|
33
36
|
}
|
|
34
37
|
) });
|
|
35
38
|
}
|
|
36
|
-
function
|
|
39
|
+
function h({
|
|
37
40
|
...o
|
|
38
41
|
}) {
|
|
39
42
|
return /* @__PURE__ */ t(e.Anchor, { "data-slot": "popover-anchor", ...o });
|
|
40
43
|
}
|
|
41
44
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
v as Popover,
|
|
46
|
+
h as PopoverAnchor,
|
|
47
|
+
g as PopoverContent,
|
|
48
|
+
u as PopoverTrigger
|
|
46
49
|
};
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Progress as
|
|
4
|
-
import { cn as
|
|
5
|
-
function
|
|
6
|
-
className:
|
|
7
|
-
value:
|
|
8
|
-
...
|
|
3
|
+
import { Progress as i } from "radix-ui";
|
|
4
|
+
import { cn as m } from "../../lib/utils.js";
|
|
5
|
+
function b({
|
|
6
|
+
className: l,
|
|
7
|
+
value: r,
|
|
8
|
+
...o
|
|
9
9
|
}) {
|
|
10
|
-
const
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
10
|
+
const n = o["aria-label"] !== void 0 || o["aria-labelledby"] !== void 0, a = typeof o.max == "number" && Number.isFinite(o.max) && o.max > 0 ? o.max : 100, e = typeof r == "number" && Number.isFinite(r) ? Math.min(a, Math.max(0, r)) : void 0, s = e === void 0 ? 0 : e / a * 100;
|
|
11
|
+
return /* @__PURE__ */ t(
|
|
12
|
+
i.Root,
|
|
13
13
|
{
|
|
14
14
|
"data-slot": "progress",
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
value: e,
|
|
16
|
+
"aria-label": n ? void 0 : "進捗",
|
|
17
|
+
className: m(
|
|
17
18
|
"relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
18
19
|
// forced-colors(Windows ハイコントラスト)ではレールも帯も Canvas に置き換わり進み具合が
|
|
19
20
|
// 見えなかった。レールは輪郭線(レイアウトに影響しない outline)、帯は OS の選択色で示す。
|
|
20
21
|
// 通常表示は不変
|
|
21
22
|
"forced-colors:outline forced-colors:outline-1 forced-colors:outline-[CanvasText]",
|
|
22
|
-
|
|
23
|
+
l
|
|
23
24
|
),
|
|
24
|
-
...
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
|
|
25
|
+
...o,
|
|
26
|
+
children: /* @__PURE__ */ t(
|
|
27
|
+
i.Indicator,
|
|
27
28
|
{
|
|
28
29
|
"data-slot": "progress-indicator",
|
|
29
30
|
className: "h-full w-full flex-1 bg-primary transition-all forced-colors:bg-[Highlight]",
|
|
30
|
-
style: { transform: `translateX(-${100 -
|
|
31
|
+
style: { transform: `translateX(-${100 - s}%)` }
|
|
31
32
|
}
|
|
32
33
|
)
|
|
33
34
|
}
|
|
34
35
|
);
|
|
35
36
|
}
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
b as Progress
|
|
38
39
|
};
|
|
@@ -3,14 +3,16 @@ import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
|
3
3
|
import * as l from "react";
|
|
4
4
|
import { RadioGroup as i } from "radix-ui";
|
|
5
5
|
import { cn as e } from "../../lib/utils.js";
|
|
6
|
-
import { FOCUS_RING as
|
|
7
|
-
import {
|
|
6
|
+
import { FOCUS_RING as u } from "../../lib/focus-ring.js";
|
|
7
|
+
import { resolveFieldAria as m, useFieldLabelling as p } from "../../lib/field-labelling.js";
|
|
8
|
+
import { chipVariants as h } from "./chip-variants.js";
|
|
8
9
|
const n = l.createContext("tile");
|
|
9
|
-
function
|
|
10
|
-
className:
|
|
10
|
+
function S({
|
|
11
|
+
className: d,
|
|
11
12
|
variant: a = "tile",
|
|
12
13
|
...t
|
|
13
14
|
}) {
|
|
15
|
+
const o = m(t, p());
|
|
14
16
|
return /* @__PURE__ */ r(n.Provider, { value: a, children: /* @__PURE__ */ r(
|
|
15
17
|
i.Root,
|
|
16
18
|
{
|
|
@@ -18,17 +20,18 @@ function x({
|
|
|
18
20
|
"data-variant": a,
|
|
19
21
|
className: e(
|
|
20
22
|
a === "chip" ? "flex flex-wrap gap-2" : "grid gap-3",
|
|
21
|
-
|
|
23
|
+
d
|
|
22
24
|
),
|
|
23
|
-
...t
|
|
25
|
+
...t,
|
|
26
|
+
...o
|
|
24
27
|
}
|
|
25
28
|
) });
|
|
26
29
|
}
|
|
27
|
-
function
|
|
28
|
-
className:
|
|
30
|
+
function k({
|
|
31
|
+
className: d,
|
|
29
32
|
children: a,
|
|
30
33
|
description: t,
|
|
31
|
-
expandedContent:
|
|
34
|
+
expandedContent: o,
|
|
32
35
|
...c
|
|
33
36
|
}) {
|
|
34
37
|
return l.useContext(n) === "chip" ? /* @__PURE__ */ r(
|
|
@@ -39,7 +42,7 @@ function y({
|
|
|
39
42
|
className: e(
|
|
40
43
|
// Chip 本体と同一の chipVariants(CVA)を再利用。unselected=filled 意匠。
|
|
41
44
|
// レイアウト・サイズ・角丸・typo・focus リングはここから供給され、Chip 意匠変更に自動追従する。
|
|
42
|
-
|
|
45
|
+
h({ variant: "filled", size: "md", shape: "pill" }),
|
|
43
46
|
"cursor-pointer outline-none",
|
|
44
47
|
// checked = 入力部品のオン状態なのでブランド色のまま(brandColorUsage の allowed)。
|
|
45
48
|
// Chip の selected はグレー地 + 黒系の枠に変わったため、見た目は Chip と別(Chip の accent と同一トークン)。
|
|
@@ -51,7 +54,7 @@ function y({
|
|
|
51
54
|
// form 固有の状態(chipVariants に無い分のみ compose)。disabled の配色は chipVariants filled が担う。
|
|
52
55
|
"aria-invalid:border aria-invalid:border-[var(--Border-Caution)]",
|
|
53
56
|
"disabled:cursor-not-allowed",
|
|
54
|
-
|
|
57
|
+
d
|
|
55
58
|
),
|
|
56
59
|
...c,
|
|
57
60
|
children: a
|
|
@@ -63,19 +66,19 @@ function y({
|
|
|
63
66
|
className: e(
|
|
64
67
|
// lint-scratch-allow: p-[15px] は border-2 を含めた見た目余白を Figma に合わせる補正値
|
|
65
68
|
"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",
|
|
66
|
-
|
|
67
|
-
"hover:border-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]",
|
|
69
|
+
o ? "flex-col items-stretch" : "items-center",
|
|
70
|
+
"hover:border-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Neutral-Secondary)]",
|
|
68
71
|
"data-[state=checked]:border-[var(--Object-Accent-Primary)] data-[state=checked]:bg-[var(--Surface-Primary)]",
|
|
69
72
|
// フォーカス意匠は DS 共通(FOCUS_RING = 緑リング)。以前はオレンジの
|
|
70
73
|
// ring-2 で checked 状態(同じくブランド色の枠)と紛らわしかったため統一した。
|
|
71
|
-
|
|
74
|
+
u,
|
|
72
75
|
"aria-invalid:border-[var(--Border-Caution)]",
|
|
73
|
-
"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)]",
|
|
74
|
-
|
|
76
|
+
"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)]",
|
|
77
|
+
d
|
|
75
78
|
),
|
|
76
79
|
...c,
|
|
77
80
|
children: [
|
|
78
|
-
/* @__PURE__ */ s("span", { className: e("flex items-center gap-2",
|
|
81
|
+
/* @__PURE__ */ s("span", { className: e("flex items-center gap-2", o && "w-full"), children: [
|
|
79
82
|
/* @__PURE__ */ r(
|
|
80
83
|
"span",
|
|
81
84
|
{
|
|
@@ -83,14 +86,14 @@ function y({
|
|
|
83
86
|
className: e(
|
|
84
87
|
"flex size-5 shrink-0 items-center justify-center rounded-full border-2 border-[var(--Border-High-Emphasis)] bg-[var(--Surface-Primary)] transition-colors",
|
|
85
88
|
"group-data-[state=checked]:border-[var(--Object-Accent-Primary)]",
|
|
86
|
-
"group-data-[disabled]:border-[var(--Border-Medium-Emphasis)] group-data-[disabled]:bg-[var(--Surface-Secondary)]"
|
|
89
|
+
"group-data-[disabled]:border-[var(--Border-Medium-Emphasis)] group-data-[disabled]:bg-[var(--Surface-Neutral-Secondary)]"
|
|
87
90
|
),
|
|
88
91
|
children: /* @__PURE__ */ r(
|
|
89
92
|
i.Indicator,
|
|
90
93
|
{
|
|
91
94
|
"data-slot": "radio-group-indicator",
|
|
92
95
|
className: "flex items-center justify-center",
|
|
93
|
-
children: /* @__PURE__ */ r("span", { className: "size-2.5 rounded-full bg-[var(--Object-Accent-Primary)]" })
|
|
96
|
+
children: /* @__PURE__ */ r("span", { className: "size-2.5 rounded-full bg-[var(--Object-Accent-Primary)] forced-colors:bg-[Highlight] forced-colors:group-data-[disabled]:bg-[GrayText]" })
|
|
94
97
|
}
|
|
95
98
|
)
|
|
96
99
|
}
|
|
@@ -120,12 +123,12 @@ function y({
|
|
|
120
123
|
)
|
|
121
124
|
] })
|
|
122
125
|
] }),
|
|
123
|
-
|
|
126
|
+
o && /* @__PURE__ */ r(
|
|
124
127
|
"span",
|
|
125
128
|
{
|
|
126
129
|
"data-slot": "radio-group-expanded",
|
|
127
130
|
className: "hidden border-t border-[var(--Border-Medium-Emphasis)] pt-3 group-data-[state=checked]:block",
|
|
128
|
-
children:
|
|
131
|
+
children: o
|
|
129
132
|
}
|
|
130
133
|
)
|
|
131
134
|
]
|
|
@@ -133,6 +136,6 @@ function y({
|
|
|
133
136
|
);
|
|
134
137
|
}
|
|
135
138
|
export {
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
S as RadioGroup,
|
|
140
|
+
k as RadioGroupItem
|
|
138
141
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
3
|
import "react";
|
|
3
|
-
import { CheckIcon as c, ChevronDownIcon as
|
|
4
|
+
import { CheckIcon as c, ChevronDownIcon as d, ChevronUpIcon as u } from "lucide-react";
|
|
4
5
|
import { Select as a } from "radix-ui";
|
|
5
6
|
import { cn as s } from "../../lib/utils.js";
|
|
6
7
|
import { FOCUS_RING as m, FORCED_COLORS_MENU_ITEM as p } from "../../lib/focus-ring.js";
|
|
@@ -27,13 +28,13 @@ function B({
|
|
|
27
28
|
...l
|
|
28
29
|
}) {
|
|
29
30
|
const n = f(l, g());
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ i(
|
|
31
32
|
a.Trigger,
|
|
32
33
|
{
|
|
33
34
|
"data-slot": "select-trigger",
|
|
34
35
|
"data-size": r,
|
|
35
36
|
className: s(
|
|
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
|
+
"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-Neutral-Secondary)] disabled:cursor-not-allowed disabled:border-[var(--Border-Medium-Emphasis)] disabled:bg-[var(--Surface-Neutral-Secondary)] disabled:text-[var(--Text-Disable)] disabled:hover:border-[var(--Border-Medium-Emphasis)] disabled:hover:bg-[var(--Surface-Neutral-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
38
|
// フォーカス意匠は DS 共通(FOCUS_RING)。
|
|
38
39
|
m,
|
|
39
40
|
// 高さは「素のクラス」で当てる。data 属性セレクタ(data-[size=default]:h-10)だと
|
|
@@ -47,7 +48,7 @@ function B({
|
|
|
47
48
|
...n,
|
|
48
49
|
children: [
|
|
49
50
|
o,
|
|
50
|
-
/* @__PURE__ */ t(a.Icon, { asChild: !0, children: /* @__PURE__ */ t(
|
|
51
|
+
/* @__PURE__ */ t(a.Icon, { asChild: !0, children: /* @__PURE__ */ t(d, { className: "size-4 text-[var(--Text-High-Emphasis)]" }) })
|
|
51
52
|
]
|
|
52
53
|
}
|
|
53
54
|
);
|
|
@@ -59,7 +60,7 @@ function E({
|
|
|
59
60
|
align: l = "center",
|
|
60
61
|
...n
|
|
61
62
|
}) {
|
|
62
|
-
return /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */ i(
|
|
63
64
|
a.Content,
|
|
64
65
|
{
|
|
65
66
|
"data-slot": "select-content",
|
|
@@ -110,7 +111,7 @@ function T({
|
|
|
110
111
|
children: r,
|
|
111
112
|
...o
|
|
112
113
|
}) {
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
+
return /* @__PURE__ */ i(
|
|
114
115
|
a.Item,
|
|
115
116
|
{
|
|
116
117
|
"data-slot": "select-item",
|
|
@@ -177,7 +178,7 @@ function h({
|
|
|
177
178
|
e
|
|
178
179
|
),
|
|
179
180
|
...r,
|
|
180
|
-
children: /* @__PURE__ */ t(
|
|
181
|
+
children: /* @__PURE__ */ t(d, { className: "size-4" })
|
|
181
182
|
}
|
|
182
183
|
);
|
|
183
184
|
}
|
|
@@ -1,31 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
2
3
|
import "react";
|
|
3
|
-
import { XIcon as
|
|
4
|
+
import { XIcon as v } from "lucide-react";
|
|
4
5
|
import { Dialog as a } from "radix-ui";
|
|
5
6
|
import { cn as r } from "../../lib/utils.js";
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
import { useOverlayFocusRoot as x, OverlayFocusRootContext as y, useRestoreFocusToOpener as b } from "../../lib/focus-restore.js";
|
|
8
|
+
import { composeEscapeKeyDownWithImeGuard as S } from "../../lib/ime.js";
|
|
9
|
+
function M({
|
|
10
|
+
open: t,
|
|
11
|
+
defaultOpen: e,
|
|
12
|
+
onOpenChange: s,
|
|
13
|
+
...l
|
|
14
|
+
}) {
|
|
15
|
+
const { root: d, handleOpenChange: i } = x(t, e, s);
|
|
16
|
+
return /* @__PURE__ */ o(y.Provider, { value: d, children: /* @__PURE__ */ o(
|
|
17
|
+
a.Root,
|
|
18
|
+
{
|
|
19
|
+
"data-slot": "sheet",
|
|
20
|
+
open: t,
|
|
21
|
+
defaultOpen: e,
|
|
22
|
+
onOpenChange: i,
|
|
23
|
+
...l
|
|
24
|
+
}
|
|
25
|
+
) });
|
|
8
26
|
}
|
|
9
|
-
function
|
|
27
|
+
function H({
|
|
10
28
|
...t
|
|
11
29
|
}) {
|
|
12
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ o(a.Trigger, { "data-slot": "sheet-trigger", ...t });
|
|
13
31
|
}
|
|
14
|
-
function
|
|
32
|
+
function R({
|
|
15
33
|
...t
|
|
16
34
|
}) {
|
|
17
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ o(a.Close, { "data-slot": "sheet-close", ...t });
|
|
18
36
|
}
|
|
19
|
-
function
|
|
37
|
+
function w({
|
|
20
38
|
...t
|
|
21
39
|
}) {
|
|
22
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ o(a.Portal, { "data-slot": "sheet-portal", ...t });
|
|
23
41
|
}
|
|
24
|
-
function
|
|
42
|
+
function C({
|
|
25
43
|
className: t,
|
|
26
|
-
...
|
|
44
|
+
...e
|
|
27
45
|
}) {
|
|
28
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ o(
|
|
29
47
|
a.Overlay,
|
|
30
48
|
{
|
|
31
49
|
"data-slot": "sheet-overlay",
|
|
@@ -33,38 +51,43 @@ function x({
|
|
|
33
51
|
"fixed inset-0 z-[var(--Z-Overlay)] bg-[var(--Overlay-Medium)] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
34
52
|
t
|
|
35
53
|
),
|
|
36
|
-
...
|
|
54
|
+
...e
|
|
37
55
|
}
|
|
38
56
|
);
|
|
39
57
|
}
|
|
40
|
-
const
|
|
58
|
+
const c = {
|
|
41
59
|
sm: "sm:max-w-sm",
|
|
42
60
|
md: "sm:max-w-[576px]",
|
|
43
61
|
lg: "sm:max-w-[768px]"
|
|
44
62
|
};
|
|
45
|
-
function
|
|
63
|
+
function j({
|
|
46
64
|
className: t,
|
|
47
|
-
children:
|
|
65
|
+
children: e,
|
|
48
66
|
side: s = "right",
|
|
49
|
-
size:
|
|
50
|
-
showCloseButton:
|
|
51
|
-
autoFocus:
|
|
67
|
+
size: l = "sm",
|
|
68
|
+
showCloseButton: d = !0,
|
|
69
|
+
autoFocus: i = !0,
|
|
52
70
|
onOpenAutoFocus: m,
|
|
53
|
-
onCloseAutoFocus:
|
|
54
|
-
|
|
71
|
+
onCloseAutoFocus: h,
|
|
72
|
+
onEscapeKeyDown: f,
|
|
73
|
+
...p
|
|
55
74
|
}) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
75
|
+
const g = b({
|
|
76
|
+
onOpenAutoFocus: (n) => {
|
|
77
|
+
i || n.preventDefault(), m?.(n);
|
|
78
|
+
},
|
|
79
|
+
onCloseAutoFocus: (n) => {
|
|
80
|
+
i || n.preventDefault(), h?.(n);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
return /* @__PURE__ */ u(w, { children: [
|
|
84
|
+
/* @__PURE__ */ o(C, {}),
|
|
85
|
+
/* @__PURE__ */ u(
|
|
59
86
|
a.Content,
|
|
60
87
|
{
|
|
61
88
|
"data-slot": "sheet-content",
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
onCloseAutoFocus: (n) => {
|
|
66
|
-
l || n.preventDefault(), f?.(n);
|
|
67
|
-
},
|
|
89
|
+
...g,
|
|
90
|
+
onEscapeKeyDown: S(f),
|
|
68
91
|
className: r(
|
|
69
92
|
"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)]",
|
|
70
93
|
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",
|
|
@@ -72,74 +95,74 @@ function T({
|
|
|
72
95
|
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
96
|
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
97
|
// 型に無い size(AlertDialog の "default" と取り違えた JSX など)でも幅の上限を消さず、既定の sm にする
|
|
75
|
-
(s === "right" || s === "left") && (
|
|
98
|
+
(s === "right" || s === "left") && (c[l] ?? c.sm),
|
|
76
99
|
t
|
|
77
100
|
),
|
|
78
|
-
...
|
|
101
|
+
...p,
|
|
79
102
|
children: [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
103
|
+
e,
|
|
104
|
+
d && /* @__PURE__ */ u(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-Neutral-Tertiary)] hover:text-[var(--Text-High-Emphasis)] focus:ring-2 focus:ring-[var(--Focus-High-Emphasis)] focus:outline-hidden disabled:pointer-events-none", children: [
|
|
105
|
+
/* @__PURE__ */ o(v, { className: "size-5" }),
|
|
106
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: "閉じる" })
|
|
84
107
|
] })
|
|
85
108
|
]
|
|
86
109
|
}
|
|
87
110
|
)
|
|
88
111
|
] });
|
|
89
112
|
}
|
|
90
|
-
function
|
|
91
|
-
return /* @__PURE__ */
|
|
113
|
+
function P({ className: t, ...e }) {
|
|
114
|
+
return /* @__PURE__ */ o(
|
|
92
115
|
"div",
|
|
93
116
|
{
|
|
94
117
|
"data-slot": "sheet-header",
|
|
95
118
|
className: r("flex flex-col gap-1.5 p-4", t),
|
|
96
|
-
...
|
|
119
|
+
...e
|
|
97
120
|
}
|
|
98
121
|
);
|
|
99
122
|
}
|
|
100
|
-
function
|
|
101
|
-
return /* @__PURE__ */
|
|
123
|
+
function A({ className: t, ...e }) {
|
|
124
|
+
return /* @__PURE__ */ o(
|
|
102
125
|
"div",
|
|
103
126
|
{
|
|
104
127
|
"data-slot": "sheet-footer",
|
|
105
128
|
className: r("mt-auto flex flex-col gap-2 p-4", t),
|
|
106
|
-
...
|
|
129
|
+
...e
|
|
107
130
|
}
|
|
108
131
|
);
|
|
109
132
|
}
|
|
110
|
-
function
|
|
133
|
+
function I({
|
|
111
134
|
className: t,
|
|
112
|
-
...
|
|
135
|
+
...e
|
|
113
136
|
}) {
|
|
114
|
-
return /* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ o(
|
|
115
138
|
a.Title,
|
|
116
139
|
{
|
|
117
140
|
"data-slot": "sheet-title",
|
|
118
141
|
className: r("typo-heading-lg text-foreground", t),
|
|
119
|
-
...
|
|
142
|
+
...e
|
|
120
143
|
}
|
|
121
144
|
);
|
|
122
145
|
}
|
|
123
|
-
function
|
|
146
|
+
function K({
|
|
124
147
|
className: t,
|
|
125
|
-
...
|
|
148
|
+
...e
|
|
126
149
|
}) {
|
|
127
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ o(
|
|
128
151
|
a.Description,
|
|
129
152
|
{
|
|
130
153
|
"data-slot": "sheet-description",
|
|
131
154
|
className: r("typo-body-sm text-muted-foreground", t),
|
|
132
|
-
...
|
|
155
|
+
...e
|
|
133
156
|
}
|
|
134
157
|
);
|
|
135
158
|
}
|
|
136
159
|
export {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
160
|
+
M as Sheet,
|
|
161
|
+
R as SheetClose,
|
|
162
|
+
j as SheetContent,
|
|
163
|
+
K as SheetDescription,
|
|
164
|
+
A as SheetFooter,
|
|
165
|
+
P as SheetHeader,
|
|
166
|
+
I as SheetTitle,
|
|
167
|
+
H as SheetTrigger
|
|
145
168
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
function m({ className: e, ...
|
|
4
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as o } from "../../lib/utils.js";
|
|
3
|
+
function m({ className: e, ...r }) {
|
|
4
|
+
return /* @__PURE__ */ t(
|
|
5
5
|
"div",
|
|
6
6
|
{
|
|
7
7
|
"data-slot": "skeleton",
|
|
8
|
-
className:
|
|
9
|
-
...
|
|
8
|
+
className: o("animate-pulse motion-reduce:animate-none rounded-md bg-[var(--Surface-Neutral-Tertiary)]", e),
|
|
9
|
+
...r
|
|
10
10
|
}
|
|
11
11
|
);
|
|
12
12
|
}
|
|
@@ -24,13 +24,13 @@ function Q({
|
|
|
24
24
|
"aria-labelledby": C,
|
|
25
25
|
...z
|
|
26
26
|
}) {
|
|
27
|
-
const S = G(), i = Array.isArray(l), g = i ? l.length : Array.isArray(o) ? o.length : 1, s = g > 1, [D,
|
|
27
|
+
const S = G(), i = Array.isArray(l), g = i ? l.length : Array.isArray(o) ? o.length : 1, s = g > 1, [D, N] = K.useState(
|
|
28
28
|
() => Array.isArray(o) ? o : [n]
|
|
29
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)),
|
|
31
|
-
if (
|
|
32
|
-
const m = t.map((j, B) => B === r ?
|
|
33
|
-
i ||
|
|
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)), T = Number(H.toFixed(I));
|
|
31
|
+
if (T === t[r]) return;
|
|
32
|
+
const m = t.map((j, B) => B === r ? T : j);
|
|
33
|
+
i || N(m), y?.(m), k?.(m);
|
|
34
34
|
}, $ = (r) => (a) => {
|
|
35
35
|
!s || p || a.key !== "Home" && a.key !== "End" || (a.preventDefault(), O(r, a.key === "Home" ? "start" : "end"));
|
|
36
36
|
}, F = (r, a) => {
|
|
@@ -51,7 +51,7 @@ function Q({
|
|
|
51
51
|
defaultValue: s ? void 0 : o,
|
|
52
52
|
value: s ? t : l,
|
|
53
53
|
onValueChange: (r) => {
|
|
54
|
-
s && !i &&
|
|
54
|
+
s && !i && N(r), y?.(r);
|
|
55
55
|
},
|
|
56
56
|
onValueCommit: k,
|
|
57
57
|
min: n,
|
|
@@ -67,7 +67,7 @@ function Q({
|
|
|
67
67
|
{
|
|
68
68
|
"data-slot": "slider-track",
|
|
69
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",
|
|
70
|
+
"relative grow overflow-hidden rounded-full bg-[var(--Surface-Control-Track,var(--Surface-Neutral-Tertiary))] data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
|
|
71
71
|
// forced-colors(Windows ハイコントラスト)ではレールも範囲も Canvas に置き換わり見えなかった。
|
|
72
72
|
// レールは輪郭線(レイアウトに影響しない outline)、範囲は OS の選択色で示す。通常表示は不変
|
|
73
73
|
"forced-colors:outline forced-colors:outline-1 forced-colors:outline-[CanvasText]"
|