@cakejp/design-system 0.17.1 → 0.19.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 +50 -0
- package/CLAUDE.md +15 -0
- package/contracts/components.json +144 -16
- package/contracts/composition.json +1 -1
- package/contracts/rules.json +5 -1
- package/contracts/screen-patterns.json +1 -1
- package/dist/components/ec/admin-shell.js +7 -6
- package/dist/components/ec/product-card.js +107 -102
- package/dist/components/ec/product-option.js +1 -0
- package/dist/components/ec/review-card.js +22 -20
- package/dist/components/ec/review-form.js +1 -0
- package/dist/components/foundations/accordion.js +23 -22
- package/dist/components/foundations/alert.js +1 -0
- package/dist/components/foundations/aspect-ratio.js +3 -2
- package/dist/components/foundations/avatar.js +1 -0
- package/dist/components/foundations/button.js +7 -1
- package/dist/components/foundations/calendar.js +1 -0
- package/dist/components/foundations/checkbox-group.js +1 -0
- package/dist/components/foundations/checkbox.js +1 -0
- package/dist/components/foundations/command.js +1 -0
- package/dist/components/foundations/context-menu.js +1 -0
- package/dist/components/foundations/drawer.js +1 -0
- package/dist/components/foundations/file-input.js +1 -0
- package/dist/components/foundations/form.js +26 -25
- package/dist/components/foundations/pagination.js +49 -46
- package/dist/components/foundations/popover.js +9 -8
- package/dist/components/foundations/radio-group.js +3 -2
- package/dist/components/foundations/responsive-dialog.js +1 -0
- package/dist/components/foundations/separator.js +7 -6
- package/dist/components/foundations/sheet.js +40 -33
- package/dist/components/foundations/slider.js +7 -6
- package/dist/components/foundations/social-icon.js +30 -10
- package/dist/components/foundations/sonner.js +5 -4
- package/dist/components/foundations/tabs.js +45 -25
- package/dist/components/foundations/toggle-group.js +6 -5
- package/dist/components/primitives/admin-side-nav.js +1 -0
- package/dist/components/primitives/chat-composer.js +1 -0
- package/dist/components/primitives/combobox.js +1 -0
- package/dist/components/primitives/content-card.js +111 -0
- package/dist/components/primitives/content-carousel.js +9 -8
- package/dist/components/primitives/date-picker.js +9 -8
- package/dist/components/primitives/footer.js +169 -100
- package/dist/components/primitives/form-field.js +1 -0
- package/dist/components/primitives/header.js +220 -176
- package/dist/components/primitives/image-carousel.js +8 -7
- package/dist/components/primitives/image-gallery.js +15 -14
- package/dist/components/primitives/image-input.js +9 -8
- package/dist/components/primitives/list-item.js +9 -8
- package/dist/components/primitives/menu-drawer.js +60 -56
- package/dist/components/primitives/multi-select.js +7 -6
- package/dist/components/primitives/number-input.js +1 -0
- package/dist/components/primitives/prose.js +52 -0
- package/dist/components/primitives/search-bar.js +81 -66
- package/dist/components/primitives/section-header.js +58 -55
- package/dist/components/primitives/share-buttons.js +93 -85
- package/dist/components/primitives/status-count-tabs.js +8 -7
- package/dist/components/primitives/sub-nav.js +52 -52
- package/dist/index.css +1 -1
- package/dist/index.js +1513 -559
- package/dist/lib/field-labelling.js +7 -6
- package/dist/lib/link-component.js +6 -0
- package/dist/lib/use-value-length.js +1 -0
- package/dist/types/components/ec/product-card.d.ts +12 -19
- package/dist/types/components/ec/review-card.d.ts +6 -1
- package/dist/types/components/foundations/button.d.ts +1 -1
- package/dist/types/components/foundations/chip-variants.d.ts +1 -1
- package/dist/types/components/foundations/data-table.d.ts +9 -1
- package/dist/types/components/foundations/pagination.d.ts +7 -1
- package/dist/types/components/foundations/sheet.d.ts +6 -1
- package/dist/types/components/foundations/social-icon.d.ts +1 -1
- package/dist/types/components/foundations/tabs.d.ts +2 -1
- package/dist/types/components/primitives/content-card.d.ts +67 -0
- package/dist/types/components/primitives/footer.d.ts +21 -1
- package/dist/types/components/primitives/header.d.ts +30 -2
- package/dist/types/components/primitives/menu-drawer.d.ts +7 -1
- package/dist/types/components/primitives/prose.d.ts +35 -0
- package/dist/types/components/primitives/search-bar.d.ts +14 -1
- package/dist/types/components/primitives/section-header.d.ts +2 -1
- package/dist/types/components/primitives/share-buttons.d.ts +26 -4
- package/dist/types/components/primitives/sub-nav.d.ts +16 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/lib/link-component.d.ts +26 -0
- package/package.json +4 -3
- package/src/components/COMPONENT_LOOKUP.md +7 -5
- package/src/preset-standalone.css +1 -0
- package/src/preset.css +8 -0
- package/src/styles/semantic.css +1 -0
- package/tokens.json +8 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsxs as a, jsx as e, Fragment as
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as L } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { cn as
|
|
3
|
+
import M from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
|
|
4
|
+
import S from "iconsax-reactjs/dist/esm/ArrowRight2.js";
|
|
5
|
+
import { cn as l } from "../../lib/utils.js";
|
|
6
6
|
import { Button as b } from "../foundations/button.js";
|
|
7
|
-
const
|
|
7
|
+
const F = {
|
|
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
|
+
}, H = {
|
|
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
|
+
}, I = {
|
|
22
22
|
"5xl": "@md:typo-heading-5xl",
|
|
23
23
|
"4xl": "@md:typo-heading-4xl"
|
|
24
24
|
};
|
|
25
|
-
function
|
|
25
|
+
function J({
|
|
26
26
|
className: d,
|
|
27
|
-
title:
|
|
27
|
+
title: w,
|
|
28
28
|
subtitle: c,
|
|
29
29
|
moreHref: t,
|
|
30
30
|
moreLabel: o = "もっと見る",
|
|
@@ -32,23 +32,23 @@ function D({
|
|
|
32
32
|
action: m,
|
|
33
33
|
onPrev: x,
|
|
34
34
|
onNext: p,
|
|
35
|
-
prevDisabled:
|
|
36
|
-
nextDisabled:
|
|
35
|
+
prevDisabled: C = !1,
|
|
36
|
+
nextDisabled: T = !1,
|
|
37
37
|
size: s = "lg",
|
|
38
38
|
desktopSize: g,
|
|
39
|
-
as:
|
|
40
|
-
align:
|
|
39
|
+
as: k,
|
|
40
|
+
align: j = "start",
|
|
41
41
|
eyebrow: f,
|
|
42
|
-
...
|
|
42
|
+
...u
|
|
43
43
|
}) {
|
|
44
|
-
const
|
|
45
|
-
|
|
44
|
+
const A = k ?? F[s], E = ["3xl", "2xl", "xl", "lg"].includes(s), v = x || p, y = t || h, i = j === "center", z = !!t && !i, n = (y || m || v) && /* @__PURE__ */ a("div", { className: l("flex shrink-0 items-center gap-2", i && "justify-center"), children: [
|
|
45
|
+
y && (t ? /* @__PURE__ */ e(
|
|
46
46
|
"a",
|
|
47
47
|
{
|
|
48
48
|
href: t,
|
|
49
49
|
className: "typo-label-lg text-[var(--Text-Accent-Primary)] whitespace-nowrap",
|
|
50
|
-
tabIndex:
|
|
51
|
-
"aria-hidden":
|
|
50
|
+
tabIndex: i ? void 0 : -1,
|
|
51
|
+
"aria-hidden": i ? void 0 : "true",
|
|
52
52
|
children: o
|
|
53
53
|
}
|
|
54
54
|
) : /* @__PURE__ */ e(
|
|
@@ -61,7 +61,7 @@ function D({
|
|
|
61
61
|
}
|
|
62
62
|
)),
|
|
63
63
|
m,
|
|
64
|
-
|
|
64
|
+
v && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
65
65
|
/* @__PURE__ */ e(
|
|
66
66
|
b,
|
|
67
67
|
{
|
|
@@ -69,9 +69,9 @@ function D({
|
|
|
69
69
|
size: "icon-sm",
|
|
70
70
|
"aria-label": "前へ",
|
|
71
71
|
onClick: x,
|
|
72
|
-
disabled:
|
|
72
|
+
disabled: C,
|
|
73
73
|
className: "rounded-full border border-[var(--Border-Medium-Emphasis)]",
|
|
74
|
-
children: /* @__PURE__ */ e(
|
|
74
|
+
children: /* @__PURE__ */ e(M, { size: 16 })
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
77
|
/* @__PURE__ */ e(
|
|
@@ -81,48 +81,48 @@ function D({
|
|
|
81
81
|
size: "icon-sm",
|
|
82
82
|
"aria-label": "次へ",
|
|
83
83
|
onClick: p,
|
|
84
|
-
disabled:
|
|
84
|
+
disabled: T,
|
|
85
85
|
className: "rounded-full border border-[var(--Border-Medium-Emphasis)]",
|
|
86
|
-
children: /* @__PURE__ */ e(
|
|
86
|
+
children: /* @__PURE__ */ e(S, { size: 16 })
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
] })
|
|
90
|
-
] }), r = /* @__PURE__ */
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
90
|
+
] }), r = /* @__PURE__ */ e(
|
|
91
|
+
A,
|
|
92
|
+
{
|
|
93
|
+
className: l(
|
|
94
|
+
"text-[var(--Text-High-Emphasis)]",
|
|
95
|
+
H[s],
|
|
96
|
+
g && I[g]
|
|
97
|
+
),
|
|
98
|
+
children: w
|
|
99
|
+
}
|
|
100
|
+
), N = c && /* @__PURE__ */ e(
|
|
101
|
+
"p",
|
|
102
|
+
{
|
|
103
|
+
className: l(
|
|
104
|
+
"text-[var(--Text-High-Emphasis)]",
|
|
105
|
+
E ? "typo-body-lg" : "typo-body-md"
|
|
106
|
+
),
|
|
107
|
+
children: c
|
|
108
|
+
}
|
|
109
|
+
), B = /* @__PURE__ */ a(L, { children: [
|
|
110
|
+
r,
|
|
111
|
+
N
|
|
112
112
|
] });
|
|
113
|
-
return
|
|
113
|
+
return i ? /* @__PURE__ */ a(
|
|
114
114
|
"div",
|
|
115
115
|
{
|
|
116
116
|
"data-slot": "section-header",
|
|
117
117
|
"data-align": "center",
|
|
118
|
-
className:
|
|
118
|
+
className: l(
|
|
119
119
|
"flex flex-col items-center gap-2 text-center [&>p]:mx-auto [&>p]:max-w-2xl",
|
|
120
120
|
d
|
|
121
121
|
),
|
|
122
|
-
...
|
|
122
|
+
...u,
|
|
123
123
|
children: [
|
|
124
124
|
f,
|
|
125
|
-
|
|
125
|
+
B,
|
|
126
126
|
n && /* @__PURE__ */ e("div", { className: "pt-1", children: n })
|
|
127
127
|
]
|
|
128
128
|
}
|
|
@@ -131,18 +131,21 @@ function D({
|
|
|
131
131
|
{
|
|
132
132
|
"data-slot": "section-header",
|
|
133
133
|
"data-align": "start",
|
|
134
|
-
className:
|
|
135
|
-
...
|
|
134
|
+
className: l("flex flex-col gap-2", d),
|
|
135
|
+
...u,
|
|
136
136
|
children: [
|
|
137
137
|
f,
|
|
138
|
-
/* @__PURE__ */ a("div", { className: "flex
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col gap-1", children: [
|
|
139
|
+
/* @__PURE__ */ a("div", { className: "flex items-baseline justify-between gap-2 min-w-0", children: [
|
|
140
|
+
z ? /* @__PURE__ */ e("a", { href: t, className: "min-w-0 flex-1", children: r }) : /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: r }),
|
|
141
|
+
n
|
|
142
|
+
] }),
|
|
143
|
+
N
|
|
141
144
|
] })
|
|
142
145
|
]
|
|
143
146
|
}
|
|
144
147
|
);
|
|
145
148
|
}
|
|
146
149
|
export {
|
|
147
|
-
|
|
150
|
+
J as SectionHeader
|
|
148
151
|
};
|
|
@@ -1,102 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import * as c from "react";
|
|
3
4
|
import g from "iconsax-reactjs/dist/esm/Link2.js";
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { SocialIcon as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { cn as S } from "../../lib/utils.js";
|
|
6
|
+
import { Button as h } from "../foundations/button.js";
|
|
7
|
+
import { SocialIcon as l } from "../foundations/social-icon.js";
|
|
8
|
+
const E = ["line", "x", "copy"], w = {
|
|
9
|
+
line: {
|
|
10
|
+
label: "LINE",
|
|
11
|
+
ariaLabel: "LINEでシェア",
|
|
12
|
+
href: (t) => `https://social-plugins.line.me/lineit/share?url=${encodeURIComponent(t)}`,
|
|
13
|
+
icon: /* @__PURE__ */ o(l, { platform: "line", size: 16 })
|
|
14
|
+
},
|
|
15
|
+
x: {
|
|
16
|
+
label: "X",
|
|
17
|
+
ariaLabel: "Xでシェア",
|
|
18
|
+
href: (t, a) => `https://twitter.com/intent/tweet?url=${encodeURIComponent(t)}&text=${encodeURIComponent(a)}`,
|
|
19
|
+
// X のブランド色は黒固定でダーク地に溶けるため、地の文字色に追従させる
|
|
20
|
+
icon: /* @__PURE__ */ o(l, { platform: "x", size: 14, tone: "mono" })
|
|
21
|
+
},
|
|
22
|
+
facebook: {
|
|
23
|
+
label: "Facebook",
|
|
24
|
+
ariaLabel: "Facebookでシェア",
|
|
25
|
+
href: (t) => `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(t)}`,
|
|
26
|
+
icon: /* @__PURE__ */ o(l, { platform: "facebook", size: 16 })
|
|
27
|
+
},
|
|
28
|
+
hatena: {
|
|
29
|
+
label: "はてブ",
|
|
30
|
+
ariaLabel: "はてなブックマークに追加",
|
|
31
|
+
href: (t, a) => `https://b.hatena.ne.jp/entry/panel/?url=${encodeURIComponent(t)}&title=${encodeURIComponent(a)}`,
|
|
32
|
+
icon: /* @__PURE__ */ o(l, { platform: "hatena", size: 16 })
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
function A({
|
|
36
|
+
className: t,
|
|
37
|
+
url: a = "",
|
|
38
|
+
text: s = "",
|
|
39
|
+
services: b = E,
|
|
11
40
|
copyLabel: d = "URLをコピー",
|
|
12
|
-
copiedLabel:
|
|
13
|
-
copyErrorLabel:
|
|
14
|
-
onCopy:
|
|
15
|
-
...
|
|
41
|
+
copiedLabel: y = "コピーしました",
|
|
42
|
+
copyErrorLabel: R = "コピーできませんでした",
|
|
43
|
+
onCopy: C,
|
|
44
|
+
...L
|
|
16
45
|
}) {
|
|
17
|
-
const [
|
|
46
|
+
const [p, m] = c.useState(
|
|
18
47
|
"idle"
|
|
19
|
-
),
|
|
20
|
-
|
|
21
|
-
|
|
48
|
+
), n = c.useRef(null);
|
|
49
|
+
c.useEffect(() => () => {
|
|
50
|
+
n.current && clearTimeout(n.current);
|
|
22
51
|
}, []);
|
|
23
|
-
const
|
|
24
|
-
let
|
|
52
|
+
const I = async () => {
|
|
53
|
+
let e = "error";
|
|
25
54
|
try {
|
|
26
|
-
|
|
55
|
+
a && navigator.clipboard && (await navigator.clipboard.writeText(a), e = "success");
|
|
27
56
|
} catch {
|
|
28
|
-
|
|
57
|
+
e = "error";
|
|
29
58
|
}
|
|
30
|
-
|
|
31
|
-
}, x =
|
|
59
|
+
m(e), C?.(e), n.current && clearTimeout(n.current), n.current = setTimeout(() => m("idle"), 2e3);
|
|
60
|
+
}, x = p === "success" ? y : p === "error" ? R : d, f = (e, r, i, k, U) => /* @__PURE__ */ o(h, { variant: "tertiary", size: "sm", className: "flex-1 gap-1.5", asChild: !0, children: /* @__PURE__ */ u("a", { href: r, target: "_blank", rel: "noopener noreferrer", "aria-label": i, children: [
|
|
61
|
+
k,
|
|
62
|
+
/* @__PURE__ */ o("span", { className: "typo-body-sm", children: U })
|
|
63
|
+
] }) }, e);
|
|
32
64
|
return /* @__PURE__ */ o(
|
|
33
65
|
"div",
|
|
34
66
|
{
|
|
35
67
|
"data-slot": "share-buttons",
|
|
36
|
-
className:
|
|
37
|
-
...
|
|
38
|
-
children:
|
|
39
|
-
|
|
40
|
-
i,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
rel: "noopener noreferrer",
|
|
74
|
-
"aria-label": "Xでシェア",
|
|
75
|
-
children: [
|
|
76
|
-
/* @__PURE__ */ e(c, { platform: "x", size: 14, tone: "mono" }),
|
|
77
|
-
/* @__PURE__ */ e("span", { className: "typo-body-sm", children: "X" })
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
/* @__PURE__ */ o(
|
|
84
|
-
i,
|
|
85
|
-
{
|
|
86
|
-
variant: "tertiary",
|
|
87
|
-
size: "sm",
|
|
88
|
-
className: "flex-1 gap-1.5",
|
|
89
|
-
onClick: b,
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ e(g, { size: 14, "aria-hidden": "true" }),
|
|
92
|
-
/* @__PURE__ */ e("span", { className: "typo-body-sm", "aria-live": "polite", children: x })
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
]
|
|
68
|
+
className: S("flex items-center gap-2", t),
|
|
69
|
+
...L,
|
|
70
|
+
children: b.map((e) => {
|
|
71
|
+
if (typeof e != "string") {
|
|
72
|
+
const i = e.href.replace("{url}", encodeURIComponent(a)).replace("{text}", encodeURIComponent(s));
|
|
73
|
+
return f(
|
|
74
|
+
e.key,
|
|
75
|
+
i,
|
|
76
|
+
e.ariaLabel ?? e.label,
|
|
77
|
+
e.icon,
|
|
78
|
+
e.label
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
if (e === "copy")
|
|
82
|
+
return /* @__PURE__ */ u(
|
|
83
|
+
h,
|
|
84
|
+
{
|
|
85
|
+
variant: "tertiary",
|
|
86
|
+
size: "sm",
|
|
87
|
+
className: "flex-1 gap-1.5",
|
|
88
|
+
onClick: I,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ o(g, { size: 14, "aria-hidden": "true" }),
|
|
91
|
+
/* @__PURE__ */ o("span", { className: "typo-body-sm", "aria-live": "polite", children: x })
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"copy"
|
|
95
|
+
);
|
|
96
|
+
const r = w[e];
|
|
97
|
+
return f(
|
|
98
|
+
e,
|
|
99
|
+
r.href(a, s),
|
|
100
|
+
r.ariaLabel,
|
|
101
|
+
r.icon,
|
|
102
|
+
r.label
|
|
103
|
+
);
|
|
104
|
+
})
|
|
97
105
|
}
|
|
98
106
|
);
|
|
99
107
|
}
|
|
100
108
|
export {
|
|
101
|
-
|
|
109
|
+
A as ShareButtons
|
|
102
110
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
3
|
import * as r from "react";
|
|
3
4
|
import { cn as f } from "../../lib/utils.js";
|
|
@@ -8,12 +9,12 @@ function h({
|
|
|
8
9
|
onSelect: n,
|
|
9
10
|
className: u
|
|
10
11
|
}) {
|
|
11
|
-
const [
|
|
12
|
+
const [s, a] = r.useState(o);
|
|
12
13
|
r.useEffect(() => {
|
|
13
|
-
|
|
14
|
+
a(o);
|
|
14
15
|
}, [o]);
|
|
15
16
|
const i = (t) => {
|
|
16
|
-
|
|
17
|
+
a(t), n?.(t);
|
|
17
18
|
};
|
|
18
19
|
return /* @__PURE__ */ l(
|
|
19
20
|
"div",
|
|
@@ -21,15 +22,15 @@ function h({
|
|
|
21
22
|
"data-slot": "status-count-tabs",
|
|
22
23
|
className: f("flex gap-2 overflow-x-auto scrollbar-hide", u),
|
|
23
24
|
role: "tablist",
|
|
24
|
-
children: c.map((t,
|
|
25
|
+
children: c.map((t, e) => /* @__PURE__ */ l(
|
|
25
26
|
m,
|
|
26
27
|
{
|
|
27
|
-
selected:
|
|
28
|
+
selected: s === e,
|
|
28
29
|
count: t.count,
|
|
29
30
|
size: "sm",
|
|
30
|
-
onClick: () => i(
|
|
31
|
+
onClick: () => i(e),
|
|
31
32
|
role: "tab",
|
|
32
|
-
"aria-selected":
|
|
33
|
+
"aria-selected": s === e,
|
|
33
34
|
children: t.label
|
|
34
35
|
},
|
|
35
36
|
t.label
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { cn as e } from "../../lib/utils.js";
|
|
4
|
+
import { resolveLinkComponent as f } from "../../lib/link-component.js";
|
|
5
|
+
import { containerVariants as g } from "./container.js";
|
|
6
|
+
const u = "px-4 md:px-6";
|
|
7
|
+
function N({
|
|
8
|
+
className: t,
|
|
9
|
+
items: x,
|
|
10
|
+
variant: n = "text",
|
|
11
|
+
linkComponent: b,
|
|
12
|
+
containerSize: o,
|
|
8
13
|
...l
|
|
9
14
|
}) {
|
|
10
|
-
|
|
15
|
+
const i = () => x.map((r) => {
|
|
16
|
+
const p = r.href ? f(b) : "button", v = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
|
|
17
|
+
return n === "chip" ? /* @__PURE__ */ a(
|
|
18
|
+
p,
|
|
19
|
+
{
|
|
20
|
+
className: e(
|
|
21
|
+
"shrink-0 rounded-full px-3 typo-label-sm transition-colors h-8 inline-flex items-center justify-center",
|
|
22
|
+
r.isActive ? "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]" : "bg-[var(--Surface-Secondary)] text-[var(--Text-Medium-Emphasis)] hover:bg-[var(--Surface-Tertiary)]"
|
|
23
|
+
),
|
|
24
|
+
...v,
|
|
25
|
+
children: r.label
|
|
26
|
+
},
|
|
27
|
+
r.label
|
|
28
|
+
) : /* @__PURE__ */ m(
|
|
29
|
+
p,
|
|
30
|
+
{
|
|
31
|
+
className: e(
|
|
32
|
+
"relative shrink-0 py-2.5 typo-label-md transition-colors",
|
|
33
|
+
r.isActive ? "text-[var(--Text-High-Emphasis)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]"
|
|
34
|
+
),
|
|
35
|
+
...v,
|
|
36
|
+
children: [
|
|
37
|
+
r.label,
|
|
38
|
+
r.isActive && /* @__PURE__ */ a("span", { className: "absolute inset-x-0 bottom-0 h-0.5 rounded-full bg-[var(--Text-High-Emphasis)]" })
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
r.label
|
|
42
|
+
);
|
|
43
|
+
}), s = n === "chip", c = s ? "div" : "nav", d = s ? e("flex gap-2 overflow-x-auto py-2 scrollbar-hide", u) : e("flex gap-4 overflow-x-auto scrollbar-hide", u), h = s ? void 0 : "border-b border-[var(--Border-Low-Emphasis)]";
|
|
44
|
+
return o ? /* @__PURE__ */ a(c, { "data-slot": "sub-nav", className: e(h, t), ...l, children: /* @__PURE__ */ a(
|
|
11
45
|
"div",
|
|
12
46
|
{
|
|
13
|
-
"data-slot": "sub-nav",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
47
|
+
"data-slot": "sub-nav-container",
|
|
48
|
+
"data-container-size": o,
|
|
49
|
+
className: e(
|
|
50
|
+
g({ size: o, gutter: "none" }),
|
|
51
|
+
d
|
|
17
52
|
),
|
|
18
|
-
|
|
19
|
-
children: n.map((r) => {
|
|
20
|
-
const o = r.href ? "a" : "button", t = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
|
|
21
|
-
return /* @__PURE__ */ e(
|
|
22
|
-
o,
|
|
23
|
-
{
|
|
24
|
-
className: a(
|
|
25
|
-
"shrink-0 rounded-full px-3 typo-label-sm transition-colors h-8 inline-flex items-center justify-center",
|
|
26
|
-
r.isActive ? "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]" : "bg-[var(--Surface-Secondary)] text-[var(--Text-Medium-Emphasis)] hover:bg-[var(--Surface-Tertiary)]"
|
|
27
|
-
),
|
|
28
|
-
...t,
|
|
29
|
-
children: r.label
|
|
30
|
-
},
|
|
31
|
-
r.label
|
|
32
|
-
);
|
|
33
|
-
})
|
|
53
|
+
children: i()
|
|
34
54
|
}
|
|
35
|
-
) : /* @__PURE__ */
|
|
36
|
-
|
|
55
|
+
) }) : /* @__PURE__ */ a(
|
|
56
|
+
c,
|
|
37
57
|
{
|
|
38
58
|
"data-slot": "sub-nav",
|
|
39
|
-
className:
|
|
40
|
-
"flex gap-4 overflow-x-auto border-b border-[var(--Border-Low-Emphasis)] px-4 scrollbar-hide",
|
|
41
|
-
s
|
|
42
|
-
),
|
|
59
|
+
className: e(h, d, t),
|
|
43
60
|
...l,
|
|
44
|
-
children:
|
|
45
|
-
const o = r.href ? "a" : "button", t = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
|
|
46
|
-
return /* @__PURE__ */ i(
|
|
47
|
-
o,
|
|
48
|
-
{
|
|
49
|
-
className: a(
|
|
50
|
-
"relative shrink-0 py-2.5 typo-label-md transition-colors",
|
|
51
|
-
r.isActive ? "text-[var(--Text-High-Emphasis)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]"
|
|
52
|
-
),
|
|
53
|
-
...t,
|
|
54
|
-
children: [
|
|
55
|
-
r.label,
|
|
56
|
-
r.isActive && /* @__PURE__ */ e("span", { className: "absolute inset-x-0 bottom-0 h-0.5 rounded-full bg-[var(--Text-High-Emphasis)]" })
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
r.label
|
|
60
|
-
);
|
|
61
|
-
})
|
|
61
|
+
children: i()
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
65
|
export {
|
|
66
|
-
|
|
66
|
+
N as SubNav
|
|
67
67
|
};
|