@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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
3
|
import * as s from "react";
|
|
4
4
|
import { cva as l } from "class-variance-authority";
|
|
5
5
|
import { ToggleGroup as d } from "radix-ui";
|
|
6
6
|
import { cn as g } from "../../lib/utils.js";
|
|
7
|
-
|
|
7
|
+
import { FORCED_COLORS_FOCUS_INSET as u } from "../../lib/focus-ring.js";
|
|
8
|
+
const p = l(
|
|
8
9
|
"flex items-center gap-1.5 py-1.5 overflow-x-auto scrollbar-none",
|
|
9
10
|
{
|
|
10
11
|
variants: {
|
|
@@ -18,15 +19,22 @@ const c = l(
|
|
|
18
19
|
width: "fit"
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
|
-
),
|
|
22
|
+
), f = l(
|
|
22
23
|
[
|
|
23
24
|
"inline-flex shrink-0 items-center justify-center",
|
|
24
25
|
"h-9 rounded-full px-3",
|
|
25
26
|
"typo-label-md whitespace-nowrap",
|
|
26
27
|
"outline-none transition-colors",
|
|
27
|
-
|
|
28
|
+
// 内側に描く(ring-inset / FORCED_COLORS_FOCUS_INSET): ToggleGroup 本体の overflow-x-auto が外側のリングを左右で切り取る
|
|
29
|
+
"focus-visible:ring-2 focus-visible:ring-[color:var(--Focus-Ring-Control,color-mix(in_oklab,var(--ring)_50%,transparent))]",
|
|
30
|
+
"focus-visible:ring-inset",
|
|
31
|
+
u,
|
|
28
32
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
29
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
33
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
34
|
+
// forced-colors(Windows ハイコントラスト)では押されている項目の薄オレンジ地・濃い枠が
|
|
35
|
+
// Canvas / CanvasText に置き換わり、押されていない項目と見分けがつかないため、
|
|
36
|
+
// 押されている項目だけ OS の選択色で示す(default / outline 共通。通常表示は不変)
|
|
37
|
+
"forced-colors:data-[state=on]:bg-[Highlight] forced-colors:data-[state=on]:text-[HighlightText]"
|
|
30
38
|
].join(" "),
|
|
31
39
|
{
|
|
32
40
|
variants: {
|
|
@@ -39,7 +47,7 @@ const c = l(
|
|
|
39
47
|
"dark:data-[state=on]:bg-[var(--Surface-Accent-Primary-Light)] dark:data-[state=on]:text-[var(--Text-Accent-Primary)]"
|
|
40
48
|
].join(" "),
|
|
41
49
|
outline: [
|
|
42
|
-
"border border-[var(--Border-Low-Emphasis)] bg-transparent text-[var(--Text-Low-Emphasis)]",
|
|
50
|
+
"border border-[var(--Border-Control,var(--Border-Low-Emphasis))] bg-transparent text-[var(--Text-Low-Emphasis)]",
|
|
43
51
|
"hover:bg-[var(--Surface-Tertiary)]",
|
|
44
52
|
"data-[state=on]:border-[var(--Text-High-Emphasis)] data-[state=on]:bg-transparent data-[state=on]:text-[var(--Text-High-Emphasis)]"
|
|
45
53
|
].join(" ")
|
|
@@ -55,54 +63,54 @@ const c = l(
|
|
|
55
63
|
size: "default"
|
|
56
64
|
}
|
|
57
65
|
}
|
|
58
|
-
),
|
|
66
|
+
), c = s.createContext({
|
|
59
67
|
variant: "default",
|
|
60
68
|
size: "default"
|
|
61
69
|
});
|
|
62
|
-
function
|
|
70
|
+
function T({
|
|
63
71
|
className: a,
|
|
64
72
|
variant: e,
|
|
65
73
|
size: r,
|
|
66
74
|
width: o,
|
|
67
|
-
children:
|
|
75
|
+
children: i,
|
|
68
76
|
...t
|
|
69
77
|
}) {
|
|
70
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ n(
|
|
71
79
|
d.Root,
|
|
72
80
|
{
|
|
73
81
|
"data-slot": "toggle-group",
|
|
74
|
-
className: g(
|
|
82
|
+
className: g(p({ width: o }), a),
|
|
75
83
|
...t,
|
|
76
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ n(c.Provider, { value: { variant: e, size: r }, children: i })
|
|
77
85
|
}
|
|
78
86
|
);
|
|
79
87
|
}
|
|
80
|
-
function
|
|
88
|
+
function y({
|
|
81
89
|
className: a,
|
|
82
90
|
children: e,
|
|
83
91
|
variant: r,
|
|
84
92
|
size: o,
|
|
85
|
-
...
|
|
93
|
+
...i
|
|
86
94
|
}) {
|
|
87
|
-
const t = s.useContext(
|
|
88
|
-
return /* @__PURE__ */
|
|
95
|
+
const t = s.useContext(c);
|
|
96
|
+
return /* @__PURE__ */ n(
|
|
89
97
|
d.Item,
|
|
90
98
|
{
|
|
91
99
|
"data-slot": "toggle-group-item",
|
|
92
100
|
className: g(
|
|
93
|
-
|
|
101
|
+
f({
|
|
94
102
|
variant: t.variant || r,
|
|
95
103
|
size: t.size || o
|
|
96
104
|
}),
|
|
97
105
|
a
|
|
98
106
|
),
|
|
99
|
-
...
|
|
107
|
+
...i,
|
|
100
108
|
children: e
|
|
101
109
|
}
|
|
102
110
|
);
|
|
103
111
|
}
|
|
104
112
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
T as ToggleGroup,
|
|
114
|
+
y as ToggleGroupItem,
|
|
115
|
+
f as toggleGroupItemVariants
|
|
108
116
|
};
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cva as
|
|
4
|
-
import { Toggle as
|
|
3
|
+
import { cva as i } from "class-variance-authority";
|
|
4
|
+
import { Toggle as n } from "radix-ui";
|
|
5
5
|
import { cn as s } from "../../lib/utils.js";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { FORCED_COLORS_FOCUS as d } from "../../lib/focus-ring.js";
|
|
7
|
+
const l = i(
|
|
8
|
+
// forced-colors:data-[state=on]:…: Windows ハイコントラスト(forced-colors)では押されているときの
|
|
9
|
+
// 地(bg-accent)が Canvas に置き換わり、押されていないものと見分けがつかないため、
|
|
10
|
+
// 押されているときだけ OS の選択色で示す(ToggleGroup と同じ方式。通常表示は不変)
|
|
11
|
+
["forced-colors:data-[state=on]:bg-[Highlight] forced-colors:data-[state=on]:text-[HighlightText] inline-flex items-center justify-center gap-2 rounded-md typo-label-sm whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-[color:var(--Focus-Ring-Control,color-mix(in_oklab,var(--ring)_50%,transparent))] disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", d],
|
|
8
12
|
{
|
|
9
13
|
variants: {
|
|
10
14
|
variant: {
|
|
11
15
|
default: "bg-transparent",
|
|
12
|
-
outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"
|
|
16
|
+
outline: "border border-[var(--Border-Control,var(--input))] bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"
|
|
13
17
|
},
|
|
14
18
|
size: {
|
|
15
19
|
default: "h-9 min-w-9 px-2",
|
|
@@ -23,22 +27,22 @@ const d = o(
|
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
);
|
|
26
|
-
function
|
|
27
|
-
className:
|
|
28
|
-
variant:
|
|
30
|
+
function f({
|
|
31
|
+
className: t,
|
|
32
|
+
variant: e,
|
|
29
33
|
size: r,
|
|
30
|
-
...
|
|
34
|
+
...o
|
|
31
35
|
}) {
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
36
|
+
return /* @__PURE__ */ a(
|
|
37
|
+
n.Root,
|
|
34
38
|
{
|
|
35
39
|
"data-slot": "toggle",
|
|
36
|
-
className: s(
|
|
37
|
-
...
|
|
40
|
+
className: s(l({ variant: e, size: r, className: t })),
|
|
41
|
+
...o
|
|
38
42
|
}
|
|
39
43
|
);
|
|
40
44
|
}
|
|
41
45
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
f as Toggle,
|
|
47
|
+
l as toggleVariants
|
|
44
48
|
};
|
|
@@ -1,87 +1,88 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as f, Fragment as
|
|
2
|
+
import { jsxs as f, Fragment as S, jsx as n } from "react/jsx-runtime";
|
|
3
3
|
import * as t from "react";
|
|
4
|
-
import
|
|
5
|
-
import { XIcon as
|
|
6
|
-
import { DropdownMenu as
|
|
7
|
-
import { FOCUS_RING as
|
|
8
|
-
import { cn as
|
|
9
|
-
function
|
|
10
|
-
return typeof v == "function" ? v(
|
|
4
|
+
import B from "iconsax-reactjs/dist/esm/ArrowDown2.js";
|
|
5
|
+
import { XIcon as G } from "lucide-react";
|
|
6
|
+
import { DropdownMenu as q, DropdownMenuTrigger as Z, DropdownMenuContent as U, DropdownMenuItem as W } from "../foundations/dropdown-menu.js";
|
|
7
|
+
import { FOCUS_RING as X } from "../../lib/focus-ring.js";
|
|
8
|
+
import { cn as F } from "../../lib/utils.js";
|
|
9
|
+
function H(v, w) {
|
|
10
|
+
return typeof v == "function" ? v(w) : v;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function K({
|
|
13
13
|
items: v,
|
|
14
|
-
activeKey:
|
|
15
|
-
drawerTitle:
|
|
16
|
-
open:
|
|
17
|
-
onOpenChange:
|
|
18
|
-
ariaLabel:
|
|
14
|
+
activeKey: w,
|
|
15
|
+
drawerTitle: z,
|
|
16
|
+
open: L = !1,
|
|
17
|
+
onOpenChange: R,
|
|
18
|
+
ariaLabel: E = "管理メニュー",
|
|
19
|
+
linkComponent: I
|
|
19
20
|
}) {
|
|
20
|
-
const [P,
|
|
21
|
+
const N = I ?? "a", [P, M] = t.useState(null), c = t.useRef(null), y = t.useRef(/* @__PURE__ */ new Set()), k = t.useRef(null), s = t.useRef(null), b = t.useRef(null), a = t.useRef(null), g = t.useRef(/* @__PURE__ */ new Map()), T = t.useRef(/* @__PURE__ */ new Map()), d = t.useRef(null), p = t.useRef(null), D = t.useRef(null), o = t.useCallback(() => {
|
|
21
22
|
p.current !== null && (clearTimeout(p.current), p.current = null);
|
|
22
23
|
}, []), i = t.useCallback(() => {
|
|
23
24
|
d.current !== null && (clearTimeout(d.current), d.current = null);
|
|
24
|
-
}, []),
|
|
25
|
+
}, []), j = t.useCallback(
|
|
25
26
|
(e, l) => {
|
|
26
27
|
l !== "touch" && (i(), o(), d.current = setTimeout(() => {
|
|
27
|
-
s.current !== null && s.current !== e && (s.current = null, g.current.get(e)?.focus({ preventScroll: !0 })), c.current = e, y.current.add(e),
|
|
28
|
+
s.current !== null && s.current !== e && (s.current = null, g.current.get(e)?.focus({ preventScroll: !0 })), c.current = e, y.current.add(e), M(e), d.current = null;
|
|
28
29
|
}, 80));
|
|
29
30
|
},
|
|
30
31
|
[o, i]
|
|
31
|
-
),
|
|
32
|
+
), A = t.useCallback(
|
|
32
33
|
(e) => {
|
|
33
34
|
i(), o(), p.current = setTimeout(() => {
|
|
34
|
-
|
|
35
|
+
M((l) => l === e ? null : l), p.current = null;
|
|
35
36
|
}, 120);
|
|
36
37
|
},
|
|
37
38
|
[o, i]
|
|
38
39
|
), O = t.useCallback(() => {
|
|
39
|
-
i(), o(), c.current = null, y.current.clear(), k.current = null, s.current = null, b.current = null, a.current = null,
|
|
40
|
+
i(), o(), c.current = null, y.current.clear(), k.current = null, s.current = null, b.current = null, a.current = null, M(null);
|
|
40
41
|
}, [o, i]);
|
|
41
42
|
return t.useEffect(
|
|
42
43
|
() => () => {
|
|
43
|
-
d.current !== null && clearTimeout(d.current), p.current !== null && clearTimeout(p.current), k.current = null, s.current = null, b.current = null, a.current = null, g.current.clear(),
|
|
44
|
+
d.current !== null && clearTimeout(d.current), p.current !== null && clearTimeout(p.current), k.current = null, s.current = null, b.current = null, a.current = null, g.current.clear(), T.current.clear();
|
|
44
45
|
},
|
|
45
46
|
[]
|
|
46
47
|
), t.useEffect(() => {
|
|
47
|
-
const e =
|
|
48
|
+
const e = D.current;
|
|
48
49
|
if (!e || typeof ResizeObserver > "u") return;
|
|
49
50
|
const l = () => {
|
|
50
51
|
const u = e.getBoundingClientRect();
|
|
51
52
|
(getComputedStyle(e).display === "none" || u.width === 0 || u.height === 0) && O();
|
|
52
53
|
}, h = new ResizeObserver(l);
|
|
53
54
|
return h.observe(e), l(), () => h.disconnect();
|
|
54
|
-
}, [O]), /* @__PURE__ */ f(
|
|
55
|
+
}, [O]), /* @__PURE__ */ f(S, { children: [
|
|
55
56
|
/* @__PURE__ */ n(
|
|
56
57
|
"nav",
|
|
57
58
|
{
|
|
58
|
-
ref:
|
|
59
|
+
ref: D,
|
|
59
60
|
"data-slot": "admin-side-nav",
|
|
60
|
-
"aria-label":
|
|
61
|
+
"aria-label": E,
|
|
61
62
|
className: "hidden @md:flex fixed left-0 top-16 bottom-0 z-[var(--Z-Sticky)] w-[72px] flex-col items-center bg-[var(--Surface-Elevated)] border-r border-[var(--Border-Low-Emphasis)]",
|
|
62
63
|
children: v.map((e) => {
|
|
63
|
-
const l =
|
|
64
|
+
const l = w === e.key, h = !!e.subMenus && e.subMenus.length > 0;
|
|
64
65
|
return /* @__PURE__ */ n("div", { className: "relative", children: (() => {
|
|
65
|
-
const u =
|
|
66
|
+
const u = F(
|
|
66
67
|
"flex h-16 w-16 flex-col items-center justify-center gap-1 rounded-md transition-colors",
|
|
67
68
|
l ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]",
|
|
68
|
-
|
|
69
|
-
), m = /* @__PURE__ */ f(
|
|
70
|
-
|
|
69
|
+
X
|
|
70
|
+
), m = /* @__PURE__ */ f(S, { children: [
|
|
71
|
+
H(e.icon, { active: l, placement: "rail" }),
|
|
71
72
|
/* @__PURE__ */ n("span", { className: "max-w-12 text-center typo-label-xs", children: e.label })
|
|
72
73
|
] });
|
|
73
74
|
return h ? /* @__PURE__ */ f(
|
|
74
|
-
|
|
75
|
+
q,
|
|
75
76
|
{
|
|
76
77
|
modal: !1,
|
|
77
78
|
open: P === e.key,
|
|
78
79
|
onOpenChange: (r) => {
|
|
79
|
-
o(), r ? (a.current === e.key && (a.current = null), c.current = null, y.current.delete(e.key),
|
|
80
|
+
o(), r ? (a.current === e.key && (a.current = null), c.current = null, y.current.delete(e.key), M(e.key)) : M(
|
|
80
81
|
(x) => x === e.key ? null : x
|
|
81
82
|
);
|
|
82
83
|
},
|
|
83
84
|
children: [
|
|
84
|
-
/* @__PURE__ */ n(
|
|
85
|
+
/* @__PURE__ */ n(Z, { asChild: !0, children: /* @__PURE__ */ n(
|
|
85
86
|
"button",
|
|
86
87
|
{
|
|
87
88
|
ref: (r) => {
|
|
@@ -96,19 +97,19 @@ function Y({
|
|
|
96
97
|
k.current === e.key && (k.current = null);
|
|
97
98
|
},
|
|
98
99
|
onPointerEnter: (r) => {
|
|
99
|
-
k.current === e.key || b.current === e.key ||
|
|
100
|
+
k.current === e.key || b.current === e.key || j(e.key, r.pointerType);
|
|
100
101
|
},
|
|
101
102
|
onPointerDownCapture: () => {
|
|
102
103
|
i(), P !== e.key && (s.current = e.key);
|
|
103
104
|
},
|
|
104
105
|
onPointerLeave: () => {
|
|
105
|
-
b.current === e.key && (b.current = null),
|
|
106
|
+
b.current === e.key && (b.current = null), A(e.key);
|
|
106
107
|
},
|
|
107
108
|
children: m
|
|
108
109
|
}
|
|
109
110
|
) }),
|
|
110
111
|
/* @__PURE__ */ n(
|
|
111
|
-
|
|
112
|
+
U,
|
|
112
113
|
{
|
|
113
114
|
side: "right",
|
|
114
115
|
align: "start",
|
|
@@ -116,7 +117,7 @@ function Y({
|
|
|
116
117
|
collisionPadding: 8,
|
|
117
118
|
className: "w-[240px] rounded-2xl p-2 shadow-menu",
|
|
118
119
|
onPointerEnter: o,
|
|
119
|
-
onPointerLeave: () =>
|
|
120
|
+
onPointerLeave: () => A(e.key),
|
|
120
121
|
onPointerMoveCapture: (r) => {
|
|
121
122
|
c.current === e.key && r.preventDefault();
|
|
122
123
|
},
|
|
@@ -126,7 +127,7 @@ function Y({
|
|
|
126
127
|
},
|
|
127
128
|
onOpenAutoFocus: (r) => {
|
|
128
129
|
c.current === e.key ? r.preventDefault() : s.current === e.key && (r.preventDefault(), requestAnimationFrame(() => {
|
|
129
|
-
|
|
130
|
+
T.current.get(e.key)?.focus();
|
|
130
131
|
}));
|
|
131
132
|
},
|
|
132
133
|
onCloseAutoFocus: (r) => {
|
|
@@ -135,21 +136,21 @@ function Y({
|
|
|
135
136
|
}))), a.current === e.key && (a.current = null);
|
|
136
137
|
},
|
|
137
138
|
children: e.subMenus.map((r, x) => /* @__PURE__ */ n(
|
|
138
|
-
|
|
139
|
+
W,
|
|
139
140
|
{
|
|
140
141
|
asChild: !0,
|
|
141
142
|
className: "min-h-11 px-4",
|
|
142
|
-
onPointerLeave: (
|
|
143
|
-
c.current === e.key &&
|
|
143
|
+
onPointerLeave: (C) => {
|
|
144
|
+
c.current === e.key && C.preventDefault();
|
|
144
145
|
},
|
|
145
146
|
children: /* @__PURE__ */ n(
|
|
146
|
-
|
|
147
|
+
N,
|
|
147
148
|
{
|
|
148
|
-
ref: x === 0 ? (
|
|
149
|
-
|
|
149
|
+
ref: x === 0 ? (C) => {
|
|
150
|
+
C ? T.current.set(
|
|
150
151
|
e.key,
|
|
151
|
-
|
|
152
|
-
) :
|
|
152
|
+
C
|
|
153
|
+
) : T.current.delete(e.key);
|
|
153
154
|
} : void 0,
|
|
154
155
|
href: r.href,
|
|
155
156
|
children: r.label
|
|
@@ -163,7 +164,7 @@ function Y({
|
|
|
163
164
|
]
|
|
164
165
|
}
|
|
165
166
|
) : e.href ? /* @__PURE__ */ n(
|
|
166
|
-
|
|
167
|
+
N,
|
|
167
168
|
{
|
|
168
169
|
href: e.href,
|
|
169
170
|
className: u,
|
|
@@ -175,58 +176,60 @@ function Y({
|
|
|
175
176
|
})
|
|
176
177
|
}
|
|
177
178
|
),
|
|
178
|
-
|
|
179
|
+
L && /* @__PURE__ */ f("div", { className: "fixed inset-0 z-[var(--Z-Overlay)] @md:hidden", children: [
|
|
179
180
|
/* @__PURE__ */ n(
|
|
180
181
|
"div",
|
|
181
182
|
{
|
|
182
|
-
className: "absolute inset-0 bg-[var(--
|
|
183
|
-
onClick: () =>
|
|
183
|
+
className: "absolute inset-0 bg-[var(--Overlay-Medium)]",
|
|
184
|
+
onClick: () => R?.(!1)
|
|
184
185
|
}
|
|
185
186
|
),
|
|
186
187
|
/* @__PURE__ */ f(
|
|
187
188
|
"nav",
|
|
188
189
|
{
|
|
189
|
-
"aria-label":
|
|
190
|
+
"aria-label": E,
|
|
190
191
|
className: "absolute left-0 top-0 h-full w-[280px] bg-[var(--Surface-Primary)] shadow-lg overflow-y-auto dark:bg-[var(--Primitive-Gray-900)]",
|
|
191
192
|
children: [
|
|
192
193
|
/* @__PURE__ */ f("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
193
|
-
/* @__PURE__ */ n("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children:
|
|
194
|
+
/* @__PURE__ */ n("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: z }),
|
|
194
195
|
/* @__PURE__ */ n(
|
|
195
196
|
"button",
|
|
196
197
|
{
|
|
197
|
-
onClick: () =>
|
|
198
|
+
onClick: () => R?.(!1),
|
|
198
199
|
className: "flex size-10 shrink-0 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-visible:ring-2 focus-visible:ring-[var(--Focus-High-Emphasis)] focus-visible:outline-hidden",
|
|
199
200
|
"aria-label": "閉じる",
|
|
200
|
-
children: /* @__PURE__ */ n(
|
|
201
|
+
children: /* @__PURE__ */ n(G, { className: "size-5" })
|
|
201
202
|
}
|
|
202
203
|
)
|
|
203
204
|
] }),
|
|
204
205
|
v.map((e) => {
|
|
205
|
-
const l =
|
|
206
|
+
const l = w === e.key, h = !!e.subMenus && e.subMenus.length > 0;
|
|
206
207
|
return /* @__PURE__ */ f("div", { children: [
|
|
207
208
|
(() => {
|
|
208
|
-
const u =
|
|
209
|
+
const u = F(
|
|
209
210
|
"flex w-full items-center gap-3 px-4 py-3 transition-colors",
|
|
210
211
|
l ? "text-[var(--Text-Accent-Primary)] bg-[var(--Surface-Accent-Primary-Light)]" : "text-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]"
|
|
211
|
-
), m = /* @__PURE__ */ f(
|
|
212
|
-
|
|
212
|
+
), m = /* @__PURE__ */ f(S, { children: [
|
|
213
|
+
H(e.icon, { active: l, placement: "drawer" }),
|
|
213
214
|
/* @__PURE__ */ n("span", { className: "typo-label-md", children: e.label }),
|
|
214
|
-
h && /* @__PURE__ */ n(
|
|
215
|
+
h && /* @__PURE__ */ n(B, { size: 16, className: "ml-auto text-[var(--Text-Low-Emphasis)]" })
|
|
215
216
|
] });
|
|
216
217
|
return e.href ? /* @__PURE__ */ n(
|
|
217
|
-
|
|
218
|
+
N,
|
|
218
219
|
{
|
|
219
220
|
href: e.href,
|
|
220
221
|
className: u,
|
|
221
222
|
"aria-current": l ? "page" : void 0,
|
|
223
|
+
onClick: () => R?.(!1),
|
|
222
224
|
children: m
|
|
223
225
|
}
|
|
224
226
|
) : /* @__PURE__ */ n("button", { type: "button", className: u, children: m });
|
|
225
227
|
})(),
|
|
226
228
|
h && /* @__PURE__ */ n("div", { className: "bg-[var(--Surface-Secondary)] dark:bg-[var(--Primitive-Gray-900)]", children: e.subMenus.map((u) => /* @__PURE__ */ n(
|
|
227
|
-
|
|
229
|
+
N,
|
|
228
230
|
{
|
|
229
231
|
href: u.href,
|
|
232
|
+
onClick: () => R?.(!1),
|
|
230
233
|
className: "flex min-h-11 items-center px-12 py-2.5 typo-body-md text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]",
|
|
231
234
|
children: u.label
|
|
232
235
|
},
|
|
@@ -241,5 +244,5 @@ function Y({
|
|
|
241
244
|
] });
|
|
242
245
|
}
|
|
243
246
|
export {
|
|
244
|
-
|
|
247
|
+
K as AdminSideNav
|
|
245
248
|
};
|
|
@@ -1,54 +1,57 @@
|
|
|
1
|
-
import { jsxs as r, jsx as a, Fragment as
|
|
1
|
+
import { jsxs as r, jsx as a, Fragment as w } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as e } from "../../lib/utils.js";
|
|
4
|
-
import { SectionHeader as
|
|
5
|
-
const
|
|
4
|
+
import { SectionHeader as b } from "./section-header.js";
|
|
5
|
+
const i = {
|
|
6
6
|
sm: "w-[48vw] @md:w-[180px]",
|
|
7
7
|
md: "w-[70vw] @md:w-[260px]",
|
|
8
8
|
lg: "w-[85vw] @md:w-[320px]"
|
|
9
|
-
},
|
|
9
|
+
}, N = {
|
|
10
10
|
"16/9": "aspect-[16/9]",
|
|
11
11
|
"1/1": "aspect-[1/1]",
|
|
12
12
|
"4/3": "aspect-[4/3]",
|
|
13
13
|
"3/4": "aspect-[3/4]"
|
|
14
14
|
};
|
|
15
|
-
function
|
|
15
|
+
function T({
|
|
16
16
|
title: n,
|
|
17
|
-
subtitle:
|
|
18
|
-
moreHref:
|
|
19
|
-
moreLabel:
|
|
20
|
-
headerSize:
|
|
21
|
-
items:
|
|
22
|
-
aspectRatio:
|
|
17
|
+
subtitle: d,
|
|
18
|
+
moreHref: p,
|
|
19
|
+
moreLabel: m,
|
|
20
|
+
headerSize: h,
|
|
21
|
+
items: u,
|
|
22
|
+
aspectRatio: v = "16/9",
|
|
23
23
|
bannerSize: l = "md",
|
|
24
|
-
className:
|
|
24
|
+
className: x,
|
|
25
|
+
linkComponent: c
|
|
25
26
|
}) {
|
|
27
|
+
const f = c ?? "a";
|
|
26
28
|
return /* @__PURE__ */ r(
|
|
27
29
|
"section",
|
|
28
30
|
{
|
|
29
31
|
"data-slot": "banner-carousel",
|
|
30
|
-
className: e("py-4",
|
|
32
|
+
className: e("py-4", x),
|
|
31
33
|
children: [
|
|
32
34
|
/* @__PURE__ */ a(
|
|
33
|
-
|
|
35
|
+
b,
|
|
34
36
|
{
|
|
35
37
|
title: n,
|
|
36
|
-
subtitle:
|
|
37
|
-
moreHref:
|
|
38
|
-
moreLabel:
|
|
39
|
-
size:
|
|
38
|
+
subtitle: d,
|
|
39
|
+
moreHref: p,
|
|
40
|
+
moreLabel: m,
|
|
41
|
+
size: h,
|
|
42
|
+
linkComponent: c,
|
|
40
43
|
className: "px-4"
|
|
41
44
|
}
|
|
42
45
|
),
|
|
43
46
|
/* @__PURE__ */ r("div", { className: "flex gap-3 overflow-x-auto px-4 pb-2 scrollbar-hide mt-3", children: [
|
|
44
|
-
|
|
45
|
-
const
|
|
47
|
+
u.map((s, t) => {
|
|
48
|
+
const o = /* @__PURE__ */ r(w, { children: [
|
|
46
49
|
/* @__PURE__ */ a(
|
|
47
50
|
"div",
|
|
48
51
|
{
|
|
49
52
|
className: e(
|
|
50
53
|
"overflow-hidden rounded-lg",
|
|
51
|
-
|
|
54
|
+
N[v]
|
|
52
55
|
),
|
|
53
56
|
children: /* @__PURE__ */ a(
|
|
54
57
|
"img",
|
|
@@ -64,26 +67,26 @@ function j({
|
|
|
64
67
|
s.sublabel && /* @__PURE__ */ a("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: s.sublabel })
|
|
65
68
|
] });
|
|
66
69
|
return s.href ? /* @__PURE__ */ a(
|
|
67
|
-
|
|
70
|
+
f,
|
|
68
71
|
{
|
|
69
72
|
href: s.href,
|
|
70
73
|
className: e(
|
|
71
74
|
"group shrink-0",
|
|
72
|
-
|
|
75
|
+
i[l]
|
|
73
76
|
),
|
|
74
|
-
children: /* @__PURE__ */ a("div", { className: "transition-opacity duration-[var(--Motion-Duration-Fast)] group-hover:opacity-80", children:
|
|
77
|
+
children: /* @__PURE__ */ a("div", { className: "transition-opacity duration-[var(--Motion-Duration-Fast)] group-hover:opacity-80", children: o })
|
|
75
78
|
},
|
|
76
|
-
|
|
79
|
+
t
|
|
77
80
|
) : /* @__PURE__ */ a(
|
|
78
81
|
"div",
|
|
79
82
|
{
|
|
80
83
|
className: e(
|
|
81
84
|
"shrink-0",
|
|
82
|
-
|
|
85
|
+
i[l]
|
|
83
86
|
),
|
|
84
|
-
children:
|
|
87
|
+
children: o
|
|
85
88
|
},
|
|
86
|
-
|
|
89
|
+
t
|
|
87
90
|
);
|
|
88
91
|
}),
|
|
89
92
|
/* @__PURE__ */ a("div", { className: "shrink-0 w-4", "aria-hidden": "true" })
|
|
@@ -93,5 +96,5 @@ function j({
|
|
|
93
96
|
);
|
|
94
97
|
}
|
|
95
98
|
export {
|
|
96
|
-
|
|
99
|
+
T as BannerCarousel
|
|
97
100
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as a } from "../../lib/utils.js";
|
|
4
|
-
import { NotificationBadge as
|
|
5
|
-
function
|
|
4
|
+
import { NotificationBadge as b } from "./notification-badge.js";
|
|
5
|
+
function h({
|
|
6
6
|
className: n,
|
|
7
7
|
items: s,
|
|
8
|
-
banner:
|
|
9
|
-
|
|
8
|
+
banner: o,
|
|
9
|
+
linkComponent: c,
|
|
10
|
+
...i
|
|
10
11
|
}) {
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ t(
|
|
12
13
|
"nav",
|
|
13
14
|
{
|
|
14
15
|
"data-slot": "bottom-tab-bar",
|
|
@@ -17,27 +18,27 @@ function x({
|
|
|
17
18
|
"fixed inset-x-0 bottom-0 z-[var(--Z-Floating)] border-t border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Elevated)] pb-[env(safe-area-inset-bottom)] @md:hidden",
|
|
18
19
|
n
|
|
19
20
|
),
|
|
20
|
-
...
|
|
21
|
+
...i,
|
|
21
22
|
children: [
|
|
22
|
-
|
|
23
|
+
o && /* @__PURE__ */ r(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
25
26
|
"data-slot": "bottom-tab-bar-banner",
|
|
26
27
|
className: "border-b border-[var(--Border-Low-Emphasis)]",
|
|
27
|
-
children:
|
|
28
|
+
children: o
|
|
28
29
|
}
|
|
29
30
|
),
|
|
30
31
|
/* @__PURE__ */ r("div", { className: "flex h-[52px] items-center justify-around px-1 @sm:px-4", children: s.map((e) => {
|
|
31
|
-
const
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
32
|
+
const l = e.href ? c ?? "a" : "button", d = e.href ? { href: e.href, onClick: e.onClick } : { type: "button", onClick: e.onClick };
|
|
33
|
+
return /* @__PURE__ */ t(
|
|
34
|
+
l,
|
|
34
35
|
{
|
|
35
36
|
className: a(
|
|
36
37
|
"relative flex flex-1 flex-col items-center gap-0.5 pb-1 pt-0.5 transition-colors min-w-0",
|
|
37
38
|
e.isActive ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Text-High-Emphasis)]"
|
|
38
39
|
),
|
|
39
40
|
"aria-current": e.isActive ? "page" : void 0,
|
|
40
|
-
...
|
|
41
|
+
...d,
|
|
41
42
|
children: [
|
|
42
43
|
/* @__PURE__ */ r(
|
|
43
44
|
"span",
|
|
@@ -47,7 +48,7 @@ function x({
|
|
|
47
48
|
e.isActive && "bg-[var(--Surface-Accent-Primary-Light)]"
|
|
48
49
|
),
|
|
49
50
|
children: /* @__PURE__ */ r(
|
|
50
|
-
|
|
51
|
+
b,
|
|
51
52
|
{
|
|
52
53
|
count: e.badgeCount,
|
|
53
54
|
size: "md",
|
|
@@ -77,5 +78,5 @@ function x({
|
|
|
77
78
|
);
|
|
78
79
|
}
|
|
79
80
|
export {
|
|
80
|
-
|
|
81
|
+
h as BottomTabBar
|
|
81
82
|
};
|