@cakejp/design-system 0.17.1 → 0.20.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 +85 -0
- package/CLAUDE.md +16 -0
- package/bin/init.js +191 -28
- package/contracts/components.json +176 -17
- 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/order-summary.js +16 -15
- 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-dialog.js +7 -7
- 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/data-table.js +489 -16
- package/dist/components/foundations/dialog.js +13 -13
- package/dist/components/foundations/drawer.js +6 -5
- 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 +41 -34
- 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-header.js +1 -1
- package/dist/components/primitives/admin-side-nav.js +196 -86
- package/dist/components/primitives/bottom-tab-bar.js +20 -20
- 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 +226 -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/sticky-action-bar.js +2 -1
- package/dist/components/primitives/sub-nav.js +52 -52
- package/dist/index.css +1 -1
- package/dist/index.js +2027 -752
- 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/admin-side-nav.d.ts +3 -0
- 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 +7 -2
- package/dist/types/lib/link-component.d.ts +35 -0
- package/package.json +5 -4
- package/src/components/COMPONENT_LOOKUP.md +8 -6
- package/src/preset-standalone.css +3 -0
- package/src/preset.css +21 -3
- package/src/styles/semantic.css +11 -0
- package/templates/AGENTS.md +4 -2
- package/templates/AGENTS.stub.md +25 -0
- package/templates/CLAUDE.md +4 -2
- package/templates/CLAUDE.stub.md +25 -0
- package/tokens.json +17 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn as s } from "../../lib/utils.js";
|
|
4
|
+
import { FOCUS_RING as v } from "../../lib/focus-ring.js";
|
|
5
|
+
import { resolveLinkComponent as h } from "../../lib/link-component.js";
|
|
6
|
+
import { Tag as u } from "./tag.js";
|
|
7
|
+
const x = {
|
|
8
|
+
"16/10": "aspect-[16/10]",
|
|
9
|
+
"16/9": "aspect-[16/9]",
|
|
10
|
+
"1/1": "aspect-[1/1]"
|
|
11
|
+
}, w = {
|
|
12
|
+
vertical: "flex-col gap-2",
|
|
13
|
+
horizontal: "flex-row items-start gap-3",
|
|
14
|
+
list: "flex-row-reverse items-start gap-3"
|
|
15
|
+
}, g = {
|
|
16
|
+
vertical: "w-full",
|
|
17
|
+
horizontal: "w-28 shrink-0",
|
|
18
|
+
list: "w-24 shrink-0"
|
|
19
|
+
};
|
|
20
|
+
function k({
|
|
21
|
+
className: a,
|
|
22
|
+
title: e,
|
|
23
|
+
href: c,
|
|
24
|
+
imageSlot: i,
|
|
25
|
+
tag: r,
|
|
26
|
+
meta: n,
|
|
27
|
+
orientation: o = "vertical",
|
|
28
|
+
aspect: d = "16/10",
|
|
29
|
+
linkComponent: m,
|
|
30
|
+
...p
|
|
31
|
+
}) {
|
|
32
|
+
const f = h(m);
|
|
33
|
+
return /* @__PURE__ */ l(
|
|
34
|
+
f,
|
|
35
|
+
{
|
|
36
|
+
"data-slot": "content-card",
|
|
37
|
+
"data-orientation": o,
|
|
38
|
+
href: c,
|
|
39
|
+
className: s(
|
|
40
|
+
"group flex rounded-lg bg-[var(--card-surface,var(--Surface-Primary))]",
|
|
41
|
+
w[o],
|
|
42
|
+
v,
|
|
43
|
+
a
|
|
44
|
+
),
|
|
45
|
+
...p,
|
|
46
|
+
children: [
|
|
47
|
+
i && /* @__PURE__ */ l(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "content-card-media",
|
|
51
|
+
className: s(
|
|
52
|
+
"relative overflow-hidden rounded-lg",
|
|
53
|
+
x[d],
|
|
54
|
+
g[o]
|
|
55
|
+
),
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ t("div", { className: "h-full w-full transition-transform duration-[var(--Motion-Duration-Base)] ease-[var(--Motion-Easing-Standard)] group-hover:scale-[1.02]", children: i }),
|
|
58
|
+
r && /* @__PURE__ */ t(
|
|
59
|
+
u,
|
|
60
|
+
{
|
|
61
|
+
variant: r.variant,
|
|
62
|
+
className: "absolute bottom-2 left-2 max-w-[calc(100%-1rem)] overflow-hidden text-ellipsis",
|
|
63
|
+
children: r.label
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
"span",
|
|
72
|
+
{
|
|
73
|
+
"data-slot": "content-card-title",
|
|
74
|
+
className: "line-clamp-2 min-h-[2lh] typo-body-md font-medium text-[var(--Text-High-Emphasis)]",
|
|
75
|
+
children: e
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
n && /* @__PURE__ */ t(
|
|
79
|
+
"span",
|
|
80
|
+
{
|
|
81
|
+
"data-slot": "content-card-meta",
|
|
82
|
+
className: "mt-auto truncate typo-body-sm text-[var(--Text-Medium-Emphasis)]",
|
|
83
|
+
children: n
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
function M({
|
|
92
|
+
className: a,
|
|
93
|
+
...e
|
|
94
|
+
}) {
|
|
95
|
+
return /* @__PURE__ */ t(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
"data-slot": "content-list",
|
|
99
|
+
className: s(
|
|
100
|
+
"flex flex-col divide-y divide-[var(--Border-Low-Emphasis)]",
|
|
101
|
+
"[&>*]:py-4 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0",
|
|
102
|
+
a
|
|
103
|
+
),
|
|
104
|
+
...e
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
k as ContentCard,
|
|
110
|
+
M as ContentList
|
|
111
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs as v, jsx as a, Fragment as z } from "react/jsx-runtime";
|
|
2
3
|
import * as s from "react";
|
|
3
4
|
import F from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
|
|
@@ -13,16 +14,16 @@ function M({
|
|
|
13
14
|
slides: c,
|
|
14
15
|
showDots: b = !0,
|
|
15
16
|
showArrows: y = !0,
|
|
16
|
-
autoPlay:
|
|
17
|
+
autoPlay: u = 0,
|
|
17
18
|
peek: p = !1,
|
|
18
19
|
itemsPerView: f = 1,
|
|
19
20
|
ariaLabel: g = "コンテンツカルーセル",
|
|
20
21
|
className: w,
|
|
21
22
|
...E
|
|
22
23
|
}) {
|
|
23
|
-
const
|
|
24
|
+
const d = s.useRef(null), [o, I] = s.useState(0), t = c.length;
|
|
24
25
|
s.useEffect(() => {
|
|
25
|
-
const r =
|
|
26
|
+
const r = d.current;
|
|
26
27
|
if (!r) return;
|
|
27
28
|
let e = 0;
|
|
28
29
|
const n = () => {
|
|
@@ -42,18 +43,18 @@ function M({
|
|
|
42
43
|
};
|
|
43
44
|
}, [t]);
|
|
44
45
|
function l(r) {
|
|
45
|
-
const e =
|
|
46
|
+
const e = d.current;
|
|
46
47
|
if (!e) return;
|
|
47
48
|
const n = e.children[r];
|
|
48
49
|
n && e.scrollTo({ left: n.offsetLeft, behavior: "smooth" });
|
|
49
50
|
}
|
|
50
51
|
s.useEffect(() => {
|
|
51
|
-
if (
|
|
52
|
+
if (u <= 0 || t <= 1) return;
|
|
52
53
|
const r = setInterval(() => {
|
|
53
54
|
l((o + 1) % t);
|
|
54
|
-
},
|
|
55
|
+
}, u);
|
|
55
56
|
return () => clearInterval(r);
|
|
56
|
-
}, [
|
|
57
|
+
}, [u, o, t]);
|
|
57
58
|
function N() {
|
|
58
59
|
l(o <= 0 ? t - 1 : o - 1);
|
|
59
60
|
}
|
|
@@ -73,7 +74,7 @@ function M({
|
|
|
73
74
|
/* @__PURE__ */ a(
|
|
74
75
|
"div",
|
|
75
76
|
{
|
|
76
|
-
ref:
|
|
77
|
+
ref: d,
|
|
77
78
|
className: i(
|
|
78
79
|
"flex snap-x snap-mandatory overflow-x-auto scroll-smooth scrollbar-none",
|
|
79
80
|
p && "pl-4 @[960px]:pl-0",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
3
|
import * as y from "react";
|
|
3
4
|
import v from "iconsax-reactjs/dist/esm/Calendar.js";
|
|
@@ -24,12 +25,12 @@ function _({
|
|
|
24
25
|
max: l,
|
|
25
26
|
disabledDates: p,
|
|
26
27
|
disabled: c,
|
|
27
|
-
clearable:
|
|
28
|
-
clearLabel:
|
|
28
|
+
clearable: u = !1,
|
|
29
|
+
clearLabel: f = "日付をクリア",
|
|
29
30
|
id: g,
|
|
30
31
|
className: b
|
|
31
32
|
}) {
|
|
32
|
-
const [m, h] = y.useState(!1), d = V(a, l, p), t =
|
|
33
|
+
const [m, h] = y.useState(!1), d = V(a, l, p), t = u && !!e && !c;
|
|
33
34
|
return (
|
|
34
35
|
// クリアボタンは trigger の「兄弟」として絶対配置する。trigger の内側に置くと
|
|
35
36
|
// button の入れ子になり a11y 上不正(Chip removable と同じ解決)。
|
|
@@ -76,7 +77,7 @@ function _({
|
|
|
76
77
|
type: "button",
|
|
77
78
|
variant: "ghost",
|
|
78
79
|
size: "icon-sm",
|
|
79
|
-
"aria-label":
|
|
80
|
+
"aria-label": f,
|
|
80
81
|
onClick: () => o?.(void 0),
|
|
81
82
|
className: "absolute top-1/2 right-1 -translate-y-1/2 text-[var(--Text-Medium-Emphasis)]",
|
|
82
83
|
children: /* @__PURE__ */ r(H, { className: "size-4" })
|
|
@@ -93,8 +94,8 @@ function Y({
|
|
|
93
94
|
minuteLabel: l = "分",
|
|
94
95
|
clearLabel: p = "日時をクリア",
|
|
95
96
|
disabled: c,
|
|
96
|
-
className:
|
|
97
|
-
...
|
|
97
|
+
className: u,
|
|
98
|
+
...f
|
|
98
99
|
}) {
|
|
99
100
|
const g = y.useMemo(
|
|
100
101
|
() => Array.from({ length: 24 }, (t, i) => i),
|
|
@@ -122,11 +123,11 @@ function Y({
|
|
|
122
123
|
e.getMilliseconds()
|
|
123
124
|
), o?.(i);
|
|
124
125
|
}, d = c || !e;
|
|
125
|
-
return /* @__PURE__ */ n("div", { className: S("flex items-center gap-2",
|
|
126
|
+
return /* @__PURE__ */ n("div", { className: S("flex items-center gap-2", u), children: [
|
|
126
127
|
/* @__PURE__ */ r(
|
|
127
128
|
_,
|
|
128
129
|
{
|
|
129
|
-
...
|
|
130
|
+
...f,
|
|
130
131
|
value: e,
|
|
131
132
|
onChange: h,
|
|
132
133
|
disabled: c,
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as s, Fragment as H, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import * as v from "react";
|
|
4
|
+
import { cn as d } from "../../lib/utils.js";
|
|
5
|
+
import { resolveLinkComponent as w } from "../../lib/link-component.js";
|
|
6
|
+
function B({
|
|
5
7
|
title: l,
|
|
6
|
-
children:
|
|
8
|
+
children: i
|
|
7
9
|
}) {
|
|
8
|
-
const [
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
}, [
|
|
12
|
-
/* @__PURE__ */
|
|
10
|
+
const [r, o] = v.useState(!1), t = v.useRef(null), [n, c] = v.useState(0);
|
|
11
|
+
return v.useEffect(() => {
|
|
12
|
+
t.current && c(t.current.scrollHeight);
|
|
13
|
+
}, [r]), /* @__PURE__ */ s("div", { "data-slot": "footer-accordion", children: [
|
|
14
|
+
/* @__PURE__ */ s(
|
|
13
15
|
"button",
|
|
14
16
|
{
|
|
15
17
|
type: "button",
|
|
16
|
-
className:
|
|
18
|
+
className: d(
|
|
17
19
|
"flex w-full items-center justify-between",
|
|
18
20
|
"border-t border-[var(--Border-Low-Emphasis)] px-5 py-5",
|
|
19
21
|
"typo-body-md text-[var(--Text-High-Emphasis)]",
|
|
20
22
|
"cursor-pointer"
|
|
21
23
|
),
|
|
22
|
-
onClick: () =>
|
|
23
|
-
"aria-expanded":
|
|
24
|
+
onClick: () => o(!r),
|
|
25
|
+
"aria-expanded": r,
|
|
24
26
|
children: [
|
|
25
27
|
/* @__PURE__ */ e("span", { children: l }),
|
|
26
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ s("span", { className: "relative size-3 shrink-0", children: [
|
|
27
29
|
/* @__PURE__ */ e("span", { className: "absolute top-1/2 left-0 block h-px w-3 -translate-y-1/2 bg-[var(--Text-High-Emphasis)] transition-transform duration-[var(--Motion-Duration-Base)]" }),
|
|
28
30
|
/* @__PURE__ */ e(
|
|
29
31
|
"span",
|
|
30
32
|
{
|
|
31
|
-
className:
|
|
33
|
+
className: d(
|
|
32
34
|
"absolute top-1/2 left-0 block h-px w-3 -translate-y-1/2 bg-[var(--Text-High-Emphasis)] transition-transform duration-[var(--Motion-Duration-Base)]",
|
|
33
|
-
|
|
35
|
+
r ? "rotate-0" : "rotate-90"
|
|
34
36
|
)
|
|
35
37
|
}
|
|
36
38
|
)
|
|
@@ -41,54 +43,71 @@ function y({
|
|
|
41
43
|
/* @__PURE__ */ e(
|
|
42
44
|
"div",
|
|
43
45
|
{
|
|
44
|
-
ref:
|
|
46
|
+
ref: t,
|
|
45
47
|
className: "overflow-hidden transition-[max-height] duration-[var(--Motion-Duration-Base)] ease-in-out",
|
|
46
|
-
style: { maxHeight:
|
|
47
|
-
children: /* @__PURE__ */ e("div", { className: "bg-[var(--Surface-Secondary)]", children:
|
|
48
|
+
style: { maxHeight: r ? `${n}px` : "0px" },
|
|
49
|
+
children: /* @__PURE__ */ e("div", { className: "bg-[var(--Surface-Secondary)]", children: i })
|
|
48
50
|
}
|
|
49
51
|
)
|
|
50
52
|
] });
|
|
51
53
|
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
return /* @__PURE__ */ e("div", { className:
|
|
55
|
-
/* @__PURE__ */ e("h3", { className: "typo-label-md text-[var(--Text-High-Emphasis)] mb-3", children:
|
|
56
|
-
/* @__PURE__ */ e("ul", { className: "space-y-1.5", children:
|
|
57
|
-
|
|
54
|
+
function g({ groups: l, linkComponent: i }) {
|
|
55
|
+
const r = l.length <= 4 ? "@lg:grid-cols-4" : l.length === 5 ? "@lg:grid-cols-5" : "@lg:grid-cols-6";
|
|
56
|
+
return /* @__PURE__ */ e("div", { className: d("grid grid-cols-3 gap-6", r), children: l.map((o) => /* @__PURE__ */ s("div", { children: [
|
|
57
|
+
/* @__PURE__ */ e("h3", { className: "typo-label-md text-[var(--Text-High-Emphasis)] mb-3", children: o.title }),
|
|
58
|
+
/* @__PURE__ */ e("ul", { className: "space-y-1.5", children: o.links.map((t) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
59
|
+
b,
|
|
58
60
|
{
|
|
59
|
-
|
|
61
|
+
link: t,
|
|
62
|
+
linkComponent: i,
|
|
60
63
|
className: "typo-body-sm text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)] transition-colors duration-[var(--Motion-Duration-Fast)]",
|
|
61
|
-
|
|
62
|
-
children: a.label
|
|
64
|
+
children: t.label
|
|
63
65
|
}
|
|
64
|
-
) },
|
|
65
|
-
|
|
66
|
-
/* @__PURE__ */ e("h4", { className: "typo-label-md text-[var(--Text-High-Emphasis)] mb-3", children:
|
|
67
|
-
/* @__PURE__ */ e("ul", { className: "space-y-1.5", children:
|
|
68
|
-
|
|
66
|
+
) }, t.label)) }),
|
|
67
|
+
o.subGroups?.map((t) => /* @__PURE__ */ s("div", { className: "mt-4", children: [
|
|
68
|
+
/* @__PURE__ */ e("h4", { className: "typo-label-md text-[var(--Text-High-Emphasis)] mb-3", children: t.title }),
|
|
69
|
+
/* @__PURE__ */ e("ul", { className: "space-y-1.5", children: t.links.map((n) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
70
|
+
b,
|
|
69
71
|
{
|
|
70
|
-
|
|
72
|
+
link: n,
|
|
73
|
+
linkComponent: i,
|
|
71
74
|
className: "typo-body-sm text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)] transition-colors duration-[var(--Motion-Duration-Fast)]",
|
|
72
|
-
|
|
73
|
-
children: o.label
|
|
75
|
+
children: n.label
|
|
74
76
|
}
|
|
75
|
-
) },
|
|
76
|
-
] },
|
|
77
|
-
] },
|
|
77
|
+
) }, n.label)) })
|
|
78
|
+
] }, t.title))
|
|
79
|
+
] }, o.title)) });
|
|
78
80
|
}
|
|
79
|
-
function b({
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
function b({
|
|
82
|
+
link: l,
|
|
83
|
+
linkComponent: i,
|
|
84
|
+
className: r,
|
|
85
|
+
children: o
|
|
86
|
+
}) {
|
|
87
|
+
const t = w(i, l.external);
|
|
88
|
+
return /* @__PURE__ */ e(
|
|
89
|
+
t,
|
|
90
|
+
{
|
|
91
|
+
href: l.href,
|
|
92
|
+
className: r,
|
|
93
|
+
...l.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
94
|
+
children: o
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function E({ links: l, linkComponent: i }) {
|
|
99
|
+
return /* @__PURE__ */ e("ul", { children: l.map((r) => /* @__PURE__ */ e("li", { className: "border-b border-[var(--Border-Low-Emphasis)] last:border-b-0", children: /* @__PURE__ */ s(
|
|
100
|
+
b,
|
|
82
101
|
{
|
|
83
|
-
|
|
84
|
-
|
|
102
|
+
link: r,
|
|
103
|
+
linkComponent: i,
|
|
104
|
+
className: d(
|
|
85
105
|
"flex items-center justify-between px-5 py-5",
|
|
86
106
|
"typo-body-sm text-[var(--Text-Medium-Emphasis)]",
|
|
87
107
|
"hover:text-[var(--Text-High-Emphasis)] transition-colors duration-[var(--Motion-Duration-Fast)]"
|
|
88
108
|
),
|
|
89
|
-
...s.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
90
109
|
children: [
|
|
91
|
-
/* @__PURE__ */ e("span", { children:
|
|
110
|
+
/* @__PURE__ */ e("span", { children: r.label }),
|
|
92
111
|
/* @__PURE__ */ e(
|
|
93
112
|
"svg",
|
|
94
113
|
{
|
|
@@ -102,139 +121,189 @@ function b({ links: l }) {
|
|
|
102
121
|
)
|
|
103
122
|
]
|
|
104
123
|
}
|
|
105
|
-
) },
|
|
124
|
+
) }, r.label)) });
|
|
106
125
|
}
|
|
107
|
-
function
|
|
126
|
+
function D({
|
|
108
127
|
className: l,
|
|
109
|
-
linkGroups:
|
|
110
|
-
copyright:
|
|
111
|
-
logo:
|
|
112
|
-
logoHref:
|
|
113
|
-
socialLinks:
|
|
114
|
-
description:
|
|
115
|
-
paymentMethods:
|
|
116
|
-
trustBadge:
|
|
117
|
-
bottomLinks:
|
|
118
|
-
|
|
128
|
+
linkGroups: i = [],
|
|
129
|
+
copyright: r = "© Cake.jp Co., Ltd.",
|
|
130
|
+
logo: o,
|
|
131
|
+
logoHref: t = "/",
|
|
132
|
+
socialLinks: n = [],
|
|
133
|
+
description: c,
|
|
134
|
+
paymentMethods: u = [],
|
|
135
|
+
trustBadge: m,
|
|
136
|
+
bottomLinks: y = [],
|
|
137
|
+
variant: T = "default",
|
|
138
|
+
bottomRightSlot: L,
|
|
139
|
+
linkComponent: h,
|
|
140
|
+
...M
|
|
119
141
|
}) {
|
|
120
|
-
|
|
142
|
+
const x = T === "brand-first", N = w(h), p = (o || c) && /* @__PURE__ */ s("div", { "data-slot": "footer-brand", className: "grid content-start gap-4", children: [
|
|
143
|
+
o && /* @__PURE__ */ e(N, { href: t, className: "block w-fit text-[var(--Text-High-Emphasis)]", children: o }),
|
|
144
|
+
c && /* @__PURE__ */ e("p", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: c })
|
|
145
|
+
] });
|
|
146
|
+
return /* @__PURE__ */ s(
|
|
121
147
|
"footer",
|
|
122
148
|
{
|
|
123
149
|
"data-slot": "footer",
|
|
124
150
|
style: { containerType: "inline-size" },
|
|
125
|
-
className:
|
|
151
|
+
className: d(
|
|
126
152
|
"bg-[var(--Surface-Primary)] text-[var(--Text-Medium-Emphasis)]",
|
|
127
153
|
l
|
|
128
154
|
),
|
|
129
|
-
...
|
|
155
|
+
...M,
|
|
130
156
|
children: [
|
|
131
|
-
|
|
132
|
-
/* @__PURE__ */ e("
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
/* @__PURE__ */ e(
|
|
137
|
-
|
|
138
|
-
|
|
157
|
+
i.length > 0 && /* @__PURE__ */ s(H, { children: [
|
|
158
|
+
x && p && /* @__PURE__ */ e("div", { className: "border-t border-[var(--Border-Medium-Emphasis)] px-5 py-8 @lg:hidden", children: p }),
|
|
159
|
+
/* @__PURE__ */ e("nav", { "aria-label": "フッターナビゲーション", "data-slot": "footer-links", className: d("border-t border-[var(--Border-Medium-Emphasis)] @lg:hidden", x && "border-t-0"), children: i.map((a) => /* @__PURE__ */ s(B, { title: a.title, children: [
|
|
160
|
+
/* @__PURE__ */ e(E, { links: a.links, linkComponent: h }),
|
|
161
|
+
a.subGroups?.map((f) => /* @__PURE__ */ s("div", { children: [
|
|
162
|
+
/* @__PURE__ */ e("div", { className: "border-t border-[var(--Border-Low-Emphasis)] px-5 py-5 typo-body-md text-[var(--Text-High-Emphasis)]", children: f.title }),
|
|
163
|
+
/* @__PURE__ */ e(E, { links: f.links, linkComponent: h })
|
|
164
|
+
] }, f.title))
|
|
165
|
+
] }, a.title)) }),
|
|
139
166
|
/* @__PURE__ */ e(
|
|
140
167
|
"nav",
|
|
141
168
|
{
|
|
142
169
|
"aria-label": "フッターナビゲーション",
|
|
143
170
|
"data-slot": "footer-links-pc",
|
|
144
171
|
className: "hidden @lg:block border-t border-[var(--Border-Medium-Emphasis)]",
|
|
145
|
-
children: /* @__PURE__ */ e("div", { className: "mx-auto max-w-[1065px] px-5 py-16", children:
|
|
172
|
+
children: /* @__PURE__ */ e("div", { className: "mx-auto max-w-[1065px] px-5 py-16", children: x ? (
|
|
173
|
+
// FooterColumnNav は 1 つの grid 子としてリンク群をまとめて持つ。
|
|
174
|
+
// auto-fit だと nav 全体が 1 トラックに潰れて中で再分割されるため、
|
|
175
|
+
// ブランド列と nav 領域の比率を明示する(求人サイトの 1.6 : 3.4 相当)。
|
|
176
|
+
// brandBlock が無い(logo も description も未指定)ときに 2 カラムへ
|
|
177
|
+
// すると nav が 1.6fr のブランド側トラックへ入って左に寄るため、
|
|
178
|
+
// その場合は nav 単独レイアウトにする。
|
|
179
|
+
/* @__PURE__ */ s(
|
|
180
|
+
"div",
|
|
181
|
+
{
|
|
182
|
+
className: d(
|
|
183
|
+
"grid gap-8",
|
|
184
|
+
p && "@lg:grid-cols-[minmax(0,1.6fr)_minmax(0,3.4fr)]"
|
|
185
|
+
),
|
|
186
|
+
children: [
|
|
187
|
+
p,
|
|
188
|
+
/* @__PURE__ */ e(g, { groups: i, linkComponent: h })
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
) : /* @__PURE__ */ e(g, { groups: i, linkComponent: h }) })
|
|
146
193
|
}
|
|
147
194
|
)
|
|
148
195
|
] }),
|
|
149
|
-
|
|
196
|
+
x && i.length === 0 && p && /* @__PURE__ */ e(
|
|
197
|
+
"div",
|
|
198
|
+
{
|
|
199
|
+
"data-slot": "footer-brand-only",
|
|
200
|
+
className: "border-t border-[var(--Border-Medium-Emphasis)] px-5 py-8 @lg:py-16",
|
|
201
|
+
children: /* @__PURE__ */ e("div", { className: "mx-auto max-w-[1065px]", children: p })
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
n.length > 0 && /* @__PURE__ */ e(
|
|
150
205
|
"div",
|
|
151
206
|
{
|
|
152
207
|
"data-slot": "footer-social",
|
|
153
208
|
className: "flex flex-wrap items-center justify-center gap-4 px-4 py-6 @sm:gap-8 @sm:px-0 @sm:py-8",
|
|
154
|
-
children:
|
|
209
|
+
children: n.map((a) => /* @__PURE__ */ e(
|
|
155
210
|
"a",
|
|
156
211
|
{
|
|
157
|
-
href:
|
|
158
|
-
className:
|
|
212
|
+
href: a.href,
|
|
213
|
+
className: d(
|
|
159
214
|
// shrink-0 必須: SNS アイコンの 40px タッチターゲットを flex row で保つ
|
|
160
215
|
"flex size-10 shrink-0 items-center justify-center",
|
|
161
216
|
"text-[var(--Text-High-Emphasis)]",
|
|
162
217
|
"transition-colors duration-[var(--Motion-Duration-Fast)] hover:text-[var(--Text-Medium-Emphasis)]"
|
|
163
218
|
),
|
|
164
|
-
"aria-label":
|
|
219
|
+
"aria-label": a.label,
|
|
165
220
|
target: "_blank",
|
|
166
221
|
rel: "noopener noreferrer",
|
|
167
|
-
children:
|
|
222
|
+
children: a.icon
|
|
168
223
|
},
|
|
169
|
-
|
|
224
|
+
a.label
|
|
170
225
|
))
|
|
171
226
|
}
|
|
172
227
|
),
|
|
173
|
-
|
|
228
|
+
u.length > 0 && /* @__PURE__ */ s(
|
|
174
229
|
"div",
|
|
175
230
|
{
|
|
176
231
|
"data-slot": "footer-payment",
|
|
177
232
|
className: "border-t border-[var(--Border-Low-Emphasis)] px-5 py-6",
|
|
178
233
|
children: [
|
|
179
234
|
/* @__PURE__ */ e("p", { className: "typo-label-sm text-[var(--Text-Low-Emphasis)] text-center mb-3", children: "お支払い方法" }),
|
|
180
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap items-center justify-center gap-1.5 @sm:gap-2", children:
|
|
235
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap items-center justify-center gap-1.5 @sm:gap-2", children: u.map((a) => /* @__PURE__ */ e(
|
|
181
236
|
"div",
|
|
182
237
|
{
|
|
183
238
|
className: "flex items-center justify-center",
|
|
184
|
-
"aria-label":
|
|
185
|
-
children:
|
|
239
|
+
"aria-label": a.label,
|
|
240
|
+
children: a.icon
|
|
186
241
|
},
|
|
187
|
-
|
|
242
|
+
a.label
|
|
188
243
|
)) })
|
|
189
244
|
]
|
|
190
245
|
}
|
|
191
246
|
),
|
|
192
|
-
|
|
247
|
+
m && /* @__PURE__ */ s(
|
|
193
248
|
"div",
|
|
194
249
|
{
|
|
195
250
|
"data-slot": "footer-trust",
|
|
196
251
|
className: "flex items-center gap-3 border-t border-[var(--Border-Low-Emphasis)] px-5 py-5",
|
|
197
252
|
children: [
|
|
198
|
-
|
|
253
|
+
m.href ? /* @__PURE__ */ e(
|
|
199
254
|
"a",
|
|
200
255
|
{
|
|
201
|
-
href:
|
|
256
|
+
href: m.href,
|
|
202
257
|
target: "_blank",
|
|
203
258
|
rel: "noopener noreferrer",
|
|
204
259
|
className: "shrink-0",
|
|
205
|
-
children:
|
|
260
|
+
children: m.icon
|
|
206
261
|
}
|
|
207
|
-
) : /* @__PURE__ */ e("div", { className: "shrink-0", children:
|
|
208
|
-
|
|
262
|
+
) : /* @__PURE__ */ e("div", { className: "shrink-0", children: m.icon }),
|
|
263
|
+
m.description && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Low-Emphasis)]", children: m.description })
|
|
209
264
|
]
|
|
210
265
|
}
|
|
211
266
|
),
|
|
212
|
-
|
|
267
|
+
y.length > 0 && /* @__PURE__ */ e(
|
|
213
268
|
"div",
|
|
214
269
|
{
|
|
215
270
|
"data-slot": "footer-bottom-links",
|
|
216
271
|
className: "border-t border-[var(--Border-Low-Emphasis)] px-5 py-4",
|
|
217
|
-
children: /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center justify-center gap-x-3 gap-y-2 @sm:gap-x-4", children:
|
|
218
|
-
|
|
272
|
+
children: /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center justify-center gap-x-3 gap-y-2 @sm:gap-x-4", children: y.map((a) => /* @__PURE__ */ e(
|
|
273
|
+
b,
|
|
219
274
|
{
|
|
220
|
-
|
|
275
|
+
link: a,
|
|
276
|
+
linkComponent: h,
|
|
221
277
|
className: "typo-body-xs text-[var(--Text-Low-Emphasis)] hover:text-[var(--Text-Medium-Emphasis)] transition-colors duration-[var(--Motion-Duration-Fast)]",
|
|
222
|
-
|
|
223
|
-
children: r.label
|
|
278
|
+
children: a.label
|
|
224
279
|
},
|
|
225
|
-
|
|
280
|
+
a.label
|
|
226
281
|
)) })
|
|
227
282
|
}
|
|
228
283
|
),
|
|
229
|
-
|
|
284
|
+
x ? (
|
|
285
|
+
// ロゴ・説明文はブランド列で出し済みなので、ここはコピーライトと
|
|
286
|
+
// bottomRightSlot(Powered by 等)を左右に振り分けるだけにする。
|
|
287
|
+
/* @__PURE__ */ e(
|
|
288
|
+
"div",
|
|
289
|
+
{
|
|
290
|
+
"data-slot": "footer-bottom",
|
|
291
|
+
className: "border-t border-[var(--Border-Medium-Emphasis)] px-5 py-5",
|
|
292
|
+
children: /* @__PURE__ */ s("div", { className: "mx-auto flex max-w-[1065px] flex-col gap-3 typo-body-sm text-[var(--Text-Low-Emphasis)] @lg:flex-row @lg:items-center @lg:justify-between", children: [
|
|
293
|
+
/* @__PURE__ */ e("p", { children: r }),
|
|
294
|
+
L
|
|
295
|
+
] })
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
) : /* @__PURE__ */ s(
|
|
230
299
|
"div",
|
|
231
300
|
{
|
|
232
301
|
"data-slot": "footer-bottom",
|
|
233
302
|
className: "border-t border-[var(--Border-Medium-Emphasis)] px-5 pt-8 pb-9 text-center",
|
|
234
303
|
children: [
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
/* @__PURE__ */ e("p", { className: "mt-5 typo-body-sm text-[var(--Text-Low-Emphasis)]", children:
|
|
304
|
+
o && /* @__PURE__ */ e("div", { className: "mx-auto w-fit max-w-[160px]", children: /* @__PURE__ */ e(N, { href: t, className: "block text-[var(--Text-High-Emphasis)]", children: o }) }),
|
|
305
|
+
c && /* @__PURE__ */ e("p", { className: "mt-6 typo-body-sm text-[var(--Text-Low-Emphasis)]", children: c }),
|
|
306
|
+
/* @__PURE__ */ e("p", { className: "mt-5 typo-body-sm text-[var(--Text-Low-Emphasis)]", children: r })
|
|
238
307
|
]
|
|
239
308
|
}
|
|
240
309
|
)
|
|
@@ -243,5 +312,5 @@ function w({
|
|
|
243
312
|
);
|
|
244
313
|
}
|
|
245
314
|
export {
|
|
246
|
-
|
|
315
|
+
D as Footer
|
|
247
316
|
};
|