@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,116 +1,117 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as t, jsx as e, Fragment as H } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import I from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
|
|
4
|
+
import R from "iconsax-reactjs/dist/esm/ArrowRight2.js";
|
|
5
5
|
import { cn as l } from "../../lib/utils.js";
|
|
6
|
-
import { Button as
|
|
7
|
-
const
|
|
6
|
+
import { Button as C } from "../foundations/button.js";
|
|
7
|
+
const w = "typo-label-lg whitespace-nowrap text-[var(--Text-Medium-Emphasis)] underline underline-offset-4 hover:text-[var(--Text-High-Emphasis)]", _ = {
|
|
8
8
|
"3xl": "h1",
|
|
9
9
|
"2xl": "h2",
|
|
10
10
|
xl: "h3",
|
|
11
11
|
lg: "h4",
|
|
12
12
|
md: "h5",
|
|
13
13
|
sm: "h6"
|
|
14
|
-
},
|
|
14
|
+
}, F = {
|
|
15
15
|
"3xl": "typo-heading-3xl",
|
|
16
16
|
"2xl": "typo-heading-2xl",
|
|
17
17
|
xl: "typo-heading-xl",
|
|
18
18
|
lg: "typo-heading-lg",
|
|
19
19
|
md: "typo-heading-md",
|
|
20
20
|
sm: "typo-heading-sm"
|
|
21
|
-
},
|
|
21
|
+
}, K = {
|
|
22
22
|
"5xl": "@md:typo-heading-5xl",
|
|
23
23
|
"4xl": "@md:typo-heading-4xl"
|
|
24
24
|
};
|
|
25
|
-
function
|
|
25
|
+
function Q({
|
|
26
26
|
className: d,
|
|
27
|
-
title:
|
|
28
|
-
subtitle:
|
|
29
|
-
moreHref:
|
|
30
|
-
moreLabel:
|
|
27
|
+
title: T,
|
|
28
|
+
subtitle: o,
|
|
29
|
+
moreHref: a,
|
|
30
|
+
moreLabel: c = "もっと見る",
|
|
31
31
|
onMoreClick: h,
|
|
32
32
|
action: m,
|
|
33
33
|
onPrev: x,
|
|
34
|
-
onNext:
|
|
35
|
-
prevDisabled:
|
|
36
|
-
nextDisabled:
|
|
34
|
+
onNext: g,
|
|
35
|
+
prevDisabled: E = !1,
|
|
36
|
+
nextDisabled: k = !1,
|
|
37
37
|
size: s = "lg",
|
|
38
|
-
desktopSize:
|
|
39
|
-
as:
|
|
40
|
-
align:
|
|
38
|
+
desktopSize: p,
|
|
39
|
+
as: L,
|
|
40
|
+
align: B = "start",
|
|
41
41
|
eyebrow: f,
|
|
42
|
+
linkComponent: j,
|
|
42
43
|
...u
|
|
43
44
|
}) {
|
|
44
|
-
const
|
|
45
|
-
y && (
|
|
46
|
-
|
|
45
|
+
const v = j ?? "a", M = L ?? _[s], S = ["3xl", "2xl", "xl", "lg"].includes(s), N = x || g, y = a || h, i = B === "center", z = !!a && !i, n = (y || m || N) && /* @__PURE__ */ t("div", { className: l("flex shrink-0 items-center gap-2", i && "justify-center"), children: [
|
|
46
|
+
y && (a ? /* @__PURE__ */ e(
|
|
47
|
+
v,
|
|
47
48
|
{
|
|
48
|
-
href:
|
|
49
|
-
className:
|
|
49
|
+
href: a,
|
|
50
|
+
className: w,
|
|
50
51
|
tabIndex: i ? void 0 : -1,
|
|
51
52
|
"aria-hidden": i ? void 0 : "true",
|
|
52
|
-
children:
|
|
53
|
+
children: c
|
|
53
54
|
}
|
|
54
55
|
) : /* @__PURE__ */ e(
|
|
55
56
|
"button",
|
|
56
57
|
{
|
|
57
58
|
type: "button",
|
|
58
59
|
onClick: h,
|
|
59
|
-
className:
|
|
60
|
-
children:
|
|
60
|
+
className: w,
|
|
61
|
+
children: c
|
|
61
62
|
}
|
|
62
63
|
)),
|
|
63
64
|
m,
|
|
64
|
-
|
|
65
|
+
N && /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
|
|
65
66
|
/* @__PURE__ */ e(
|
|
66
|
-
|
|
67
|
+
C,
|
|
67
68
|
{
|
|
68
69
|
variant: "ghost",
|
|
69
70
|
size: "icon-sm",
|
|
70
71
|
"aria-label": "前へ",
|
|
71
72
|
onClick: x,
|
|
72
|
-
disabled:
|
|
73
|
-
className: "rounded-full border border-[var(--Border-Medium-Emphasis)]",
|
|
74
|
-
children: /* @__PURE__ */ e(
|
|
73
|
+
disabled: E,
|
|
74
|
+
className: "rounded-full border border-[var(--Border-Control,var(--Border-Medium-Emphasis))]",
|
|
75
|
+
children: /* @__PURE__ */ e(I, { size: 16 })
|
|
75
76
|
}
|
|
76
77
|
),
|
|
77
78
|
/* @__PURE__ */ e(
|
|
78
|
-
|
|
79
|
+
C,
|
|
79
80
|
{
|
|
80
81
|
variant: "ghost",
|
|
81
82
|
size: "icon-sm",
|
|
82
83
|
"aria-label": "次へ",
|
|
83
|
-
onClick:
|
|
84
|
-
disabled:
|
|
85
|
-
className: "rounded-full border border-[var(--Border-Medium-Emphasis)]",
|
|
86
|
-
children: /* @__PURE__ */ e(
|
|
84
|
+
onClick: g,
|
|
85
|
+
disabled: k,
|
|
86
|
+
className: "rounded-full border border-[var(--Border-Control,var(--Border-Medium-Emphasis))]",
|
|
87
|
+
children: /* @__PURE__ */ e(R, { size: 16 })
|
|
87
88
|
}
|
|
88
89
|
)
|
|
89
90
|
] })
|
|
90
91
|
] }), r = /* @__PURE__ */ e(
|
|
91
|
-
|
|
92
|
+
M,
|
|
92
93
|
{
|
|
93
94
|
className: l(
|
|
94
95
|
"text-[var(--Text-High-Emphasis)]",
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
F[s],
|
|
97
|
+
p && K[p]
|
|
97
98
|
),
|
|
98
|
-
children:
|
|
99
|
+
children: T
|
|
99
100
|
}
|
|
100
|
-
),
|
|
101
|
+
), b = o && /* @__PURE__ */ e(
|
|
101
102
|
"p",
|
|
102
103
|
{
|
|
103
104
|
className: l(
|
|
104
105
|
"text-[var(--Text-High-Emphasis)]",
|
|
105
|
-
|
|
106
|
+
S ? "typo-body-lg" : "typo-body-md"
|
|
106
107
|
),
|
|
107
|
-
children:
|
|
108
|
+
children: o
|
|
108
109
|
}
|
|
109
|
-
),
|
|
110
|
+
), A = /* @__PURE__ */ t(H, { children: [
|
|
110
111
|
r,
|
|
111
|
-
|
|
112
|
+
b
|
|
112
113
|
] });
|
|
113
|
-
return i ? /* @__PURE__ */
|
|
114
|
+
return i ? /* @__PURE__ */ t(
|
|
114
115
|
"div",
|
|
115
116
|
{
|
|
116
117
|
"data-slot": "section-header",
|
|
@@ -122,11 +123,11 @@ function J({
|
|
|
122
123
|
...u,
|
|
123
124
|
children: [
|
|
124
125
|
f,
|
|
125
|
-
|
|
126
|
+
A,
|
|
126
127
|
n && /* @__PURE__ */ e("div", { className: "pt-1", children: n })
|
|
127
128
|
]
|
|
128
129
|
}
|
|
129
|
-
) : /* @__PURE__ */
|
|
130
|
+
) : /* @__PURE__ */ t(
|
|
130
131
|
"div",
|
|
131
132
|
{
|
|
132
133
|
"data-slot": "section-header",
|
|
@@ -135,17 +136,17 @@ function J({
|
|
|
135
136
|
...u,
|
|
136
137
|
children: [
|
|
137
138
|
f,
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
z ? /* @__PURE__ */ e(
|
|
139
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-1", children: [
|
|
140
|
+
/* @__PURE__ */ t("div", { className: "flex items-baseline justify-between gap-2 min-w-0", children: [
|
|
141
|
+
z ? /* @__PURE__ */ e(v, { href: a, className: "min-w-0 flex-1", children: r }) : /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: r }),
|
|
141
142
|
n
|
|
142
143
|
] }),
|
|
143
|
-
|
|
144
|
+
b
|
|
144
145
|
] })
|
|
145
146
|
]
|
|
146
147
|
}
|
|
147
148
|
);
|
|
148
149
|
}
|
|
149
150
|
export {
|
|
150
|
-
|
|
151
|
+
Q as SectionHeader
|
|
151
152
|
};
|
|
@@ -1,98 +1,99 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as y } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Separator as
|
|
6
|
-
function
|
|
7
|
-
const s = `/iframe.html?id=${encodeURIComponent(
|
|
3
|
+
import g from "iconsax-reactjs/dist/esm/ArrowRight2.js";
|
|
4
|
+
import { cn as x } from "../../lib/utils.js";
|
|
5
|
+
import { Separator as S } from "../foundations/separator.js";
|
|
6
|
+
function w(e) {
|
|
7
|
+
const s = `/iframe.html?id=${encodeURIComponent(e)}&viewMode=story`;
|
|
8
8
|
window.location.href = s;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function u(e) {
|
|
11
|
+
return e.length > 1 ? e.replace(/\/+$/, "") : e;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const { activeMenu:
|
|
15
|
-
if (
|
|
16
|
-
return new Set(c.filter(
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
13
|
+
function N(e, s) {
|
|
14
|
+
const { activeMenu: l, currentPath: m, activeMatch: o, isActive: h } = s, c = e.flatMap((r) => r.items);
|
|
15
|
+
if (h)
|
|
16
|
+
return new Set(c.filter(h).map((r) => r.key));
|
|
17
|
+
if (m != null) {
|
|
18
|
+
const r = u(m);
|
|
19
19
|
if (o === "prefix") {
|
|
20
|
-
let
|
|
21
|
-
for (const
|
|
22
|
-
const
|
|
23
|
-
(
|
|
20
|
+
let t, p = -1;
|
|
21
|
+
for (const d of c) {
|
|
22
|
+
const n = u(d.href);
|
|
23
|
+
(r === n || r.startsWith(n + "/")) && n.length > p && (t = d.key, p = n.length);
|
|
24
24
|
}
|
|
25
|
-
return new Set(
|
|
25
|
+
return new Set(t ? [t] : []);
|
|
26
26
|
}
|
|
27
27
|
return new Set(
|
|
28
|
-
c.filter((
|
|
28
|
+
c.filter((t) => u(t.href) === r).map((t) => t.key)
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
return new Set(
|
|
31
|
+
return new Set(l != null ? [l] : []);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
activeMenu:
|
|
33
|
+
function M({
|
|
34
|
+
activeMenu: e,
|
|
35
35
|
currentPath: s,
|
|
36
|
-
activeMatch:
|
|
37
|
-
isActive:
|
|
36
|
+
activeMatch: l = "exact",
|
|
37
|
+
isActive: m,
|
|
38
38
|
groups: o,
|
|
39
|
-
ariaLabel:
|
|
40
|
-
|
|
39
|
+
ariaLabel: h = "サイドメニュー",
|
|
40
|
+
linkComponent: c,
|
|
41
|
+
className: r,
|
|
41
42
|
...t
|
|
42
43
|
}) {
|
|
43
|
-
const a =
|
|
44
|
-
activeMenu:
|
|
44
|
+
const p = c ?? "a", d = N(o, {
|
|
45
|
+
activeMenu: e,
|
|
45
46
|
currentPath: s,
|
|
46
|
-
activeMatch:
|
|
47
|
-
isActive:
|
|
47
|
+
activeMatch: l,
|
|
48
|
+
isActive: m
|
|
48
49
|
});
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ a(
|
|
50
51
|
"nav",
|
|
51
52
|
{
|
|
52
53
|
"data-slot": "side-nav",
|
|
53
|
-
className:
|
|
54
|
+
className: x(
|
|
54
55
|
"w-64 shrink-0 bg-[var(--Surface-Primary)] border-r border-[var(--Border-Low-Emphasis)]",
|
|
55
|
-
|
|
56
|
+
r
|
|
56
57
|
),
|
|
57
|
-
"aria-label":
|
|
58
|
+
"aria-label": h,
|
|
58
59
|
...t,
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
-
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
const
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
|
|
60
|
+
children: /* @__PURE__ */ a("div", { className: "py-4", children: o.map((n, f) => /* @__PURE__ */ y("div", { className: "mb-1", children: [
|
|
61
|
+
n.groupLabel && /* @__PURE__ */ a("p", { className: "px-4 py-2 typo-label-xs text-[var(--Text-Low-Emphasis)] uppercase", children: n.groupLabel }),
|
|
62
|
+
/* @__PURE__ */ a("ul", { children: n.items.map((i) => {
|
|
63
|
+
const v = d.has(i.key);
|
|
64
|
+
return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ y(
|
|
65
|
+
p,
|
|
65
66
|
{
|
|
66
|
-
href:
|
|
67
|
-
onClick: (
|
|
68
|
-
|
|
67
|
+
href: i.href,
|
|
68
|
+
onClick: (b) => {
|
|
69
|
+
i.storyId && (b.preventDefault(), w(i.storyId));
|
|
69
70
|
},
|
|
70
|
-
className:
|
|
71
|
+
className: x(
|
|
71
72
|
// hover はモーショントークン参照(prefers-reduced-motion で自動停止する)。
|
|
72
73
|
// 素の transition-colors は Tailwind 既定値でトークン制御が効かない(#201)
|
|
73
74
|
"flex items-center gap-3 px-4 py-2.5 typo-body-md transition-colors duration-[var(--Motion-Duration-Base)] ease-[var(--Motion-Easing-Standard)] hover:bg-[var(--Surface-Secondary)] cursor-pointer",
|
|
74
|
-
|
|
75
|
+
v ? "border-l-2 border-[var(--Brand-Cake-Orange)] text-[var(--Text-Accent-Primary)] bg-[var(--Surface-Accent-Primary-Light)] pl-3.5" : "text-[var(--Text-High-Emphasis)] border-l-2 border-transparent"
|
|
75
76
|
),
|
|
76
|
-
"aria-current":
|
|
77
|
+
"aria-current": v ? "page" : void 0,
|
|
77
78
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ a(
|
|
79
80
|
"span",
|
|
80
81
|
{
|
|
81
|
-
className:
|
|
82
|
-
children:
|
|
82
|
+
className: v ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Object-High-Emphasis)]",
|
|
83
|
+
children: i.icon
|
|
83
84
|
}
|
|
84
85
|
),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ a("span", { className: "flex-1", children: i.label }),
|
|
87
|
+
/* @__PURE__ */ a(g, { size: 14, className: "text-[var(--Object-Low-Emphasis)]" })
|
|
87
88
|
]
|
|
88
89
|
}
|
|
89
|
-
) },
|
|
90
|
+
) }, i.key);
|
|
90
91
|
}) }),
|
|
91
|
-
|
|
92
|
-
] },
|
|
92
|
+
f < o.length - 1 && /* @__PURE__ */ a(S, { className: "my-2 mx-4" })
|
|
93
|
+
] }, f)) })
|
|
93
94
|
}
|
|
94
95
|
);
|
|
95
96
|
}
|
|
96
97
|
export {
|
|
97
|
-
|
|
98
|
+
M as SideNav
|
|
98
99
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { jsx as a, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as e } from "../../lib/utils.js";
|
|
4
|
-
import {
|
|
5
|
-
import { containerVariants as g } from "./container.js";
|
|
4
|
+
import { containerVariants as m } from "./container.js";
|
|
6
5
|
const u = "px-4 md:px-6";
|
|
7
|
-
function
|
|
8
|
-
className:
|
|
6
|
+
function E({
|
|
7
|
+
className: o,
|
|
9
8
|
items: x,
|
|
10
9
|
variant: n = "text",
|
|
11
10
|
linkComponent: b,
|
|
12
|
-
containerSize:
|
|
11
|
+
containerSize: s,
|
|
13
12
|
...l
|
|
14
13
|
}) {
|
|
15
14
|
const i = () => x.map((r) => {
|
|
16
|
-
const p = r.href ?
|
|
15
|
+
const p = r.href ? b ?? "a" : "button", v = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
|
|
17
16
|
return n === "chip" ? /* @__PURE__ */ a(
|
|
18
17
|
p,
|
|
19
18
|
{
|
|
@@ -25,7 +24,7 @@ function N({
|
|
|
25
24
|
children: r.label
|
|
26
25
|
},
|
|
27
26
|
r.label
|
|
28
|
-
) : /* @__PURE__ */
|
|
27
|
+
) : /* @__PURE__ */ f(
|
|
29
28
|
p,
|
|
30
29
|
{
|
|
31
30
|
className: e(
|
|
@@ -40,14 +39,14 @@ function N({
|
|
|
40
39
|
},
|
|
41
40
|
r.label
|
|
42
41
|
);
|
|
43
|
-
}),
|
|
44
|
-
return
|
|
42
|
+
}), t = n === "chip", c = t ? "div" : "nav", d = t ? e("flex gap-2 overflow-x-auto py-2 scrollbar-hide", u) : e("flex gap-4 overflow-x-auto scrollbar-hide", u), h = t ? void 0 : "border-b border-[var(--Border-Low-Emphasis)]";
|
|
43
|
+
return s ? /* @__PURE__ */ a(c, { "data-slot": "sub-nav", className: e(h, o), ...l, children: /* @__PURE__ */ a(
|
|
45
44
|
"div",
|
|
46
45
|
{
|
|
47
46
|
"data-slot": "sub-nav-container",
|
|
48
|
-
"data-container-size":
|
|
47
|
+
"data-container-size": s,
|
|
49
48
|
className: e(
|
|
50
|
-
|
|
49
|
+
m({ size: s, gutter: "none" }),
|
|
51
50
|
d
|
|
52
51
|
),
|
|
53
52
|
children: i()
|
|
@@ -56,12 +55,12 @@ function N({
|
|
|
56
55
|
c,
|
|
57
56
|
{
|
|
58
57
|
"data-slot": "sub-nav",
|
|
59
|
-
className: e(h, d,
|
|
58
|
+
className: e(h, d, o),
|
|
60
59
|
...l,
|
|
61
60
|
children: i()
|
|
62
61
|
}
|
|
63
62
|
);
|
|
64
63
|
}
|
|
65
64
|
export {
|
|
66
|
-
|
|
65
|
+
E as SubNav
|
|
67
66
|
};
|
|
@@ -8,6 +8,8 @@ const x = o(
|
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
default: "bg-[var(--Surface-Secondary)] text-[var(--Text-High-Emphasis)] dark:bg-[var(--Surface-Tertiary)] dark:text-[var(--Text-High-Emphasis)] dark:ring-1 dark:ring-[var(--Border-Medium-Emphasis)]",
|
|
11
|
+
// 写真上のオーバーレイ用。画像の明暗に依存しない不透明な面を使う。
|
|
12
|
+
image: "bg-[var(--Primitive-Gray-900)] text-[var(--Primitive-White-alpha-1000)]",
|
|
11
13
|
caution: "bg-[var(--Caution-Ultra-Light)] text-[var(--Text-Caution)] dark:bg-[var(--Text-Caution)]/20 dark:text-[var(--Text-Caution)]",
|
|
12
14
|
sale: "bg-[var(--Surface-Caution)] text-[var(--Text-on-Inverse)]",
|
|
13
15
|
warning: "bg-[var(--Primitive-Wood-100)] text-[var(--Text-Warning)]",
|
|
@@ -30,7 +32,7 @@ const x = o(
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
);
|
|
33
|
-
function
|
|
35
|
+
function p({
|
|
34
36
|
className: a,
|
|
35
37
|
variant: r,
|
|
36
38
|
size: t,
|
|
@@ -52,6 +54,6 @@ function u({
|
|
|
52
54
|
);
|
|
53
55
|
}
|
|
54
56
|
export {
|
|
55
|
-
|
|
57
|
+
p as Tag,
|
|
56
58
|
x as tagVariants
|
|
57
59
|
};
|