@cakejp/design-system 0.16.0 → 0.17.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 +49 -0
- package/CLAUDE.md +1 -0
- package/bin/init.js +29 -6
- package/contracts/components.json +42 -7
- package/contracts/composition.json +8 -2
- package/contracts/rules.json +5 -1
- package/contracts/screen-patterns.json +1 -1
- package/dist/components/ec/_mypage-menu-data.js +166 -0
- package/dist/components/ec/admin-shell.js +202 -0
- package/dist/components/ec/anniversary-card.js +63 -0
- package/dist/components/ec/cake-logo.js +38 -0
- package/dist/components/ec/chart-controls.js +91 -0
- package/dist/components/ec/countdown-timer.js +50 -0
- package/dist/components/ec/coupon-card.js +136 -0
- package/dist/components/ec/delivery-calendar.js +105 -0
- package/dist/components/ec/mypage-shell.js +98 -0
- package/dist/components/ec/order-section.js +53 -0
- package/dist/components/ec/order-summary.js +78 -0
- package/dist/components/ec/payment-method.js +81 -0
- package/dist/components/ec/product-card.js +235 -0
- package/dist/components/ec/product-carousel.js +106 -0
- package/dist/components/ec/product-cta.js +80 -0
- package/dist/components/ec/product-detail-bar.js +86 -0
- package/dist/components/ec/product-detail-sidebar.js +296 -0
- package/dist/components/ec/product-list-item.js +266 -0
- package/dist/components/ec/product-option.js +165 -0
- package/dist/components/ec/rating-stars.js +74 -0
- package/dist/components/ec/review-card.js +126 -0
- package/dist/components/ec/review-form.js +181 -0
- package/dist/components/ec/review-summary.js +95 -0
- package/dist/components/ec/shop-card.js +179 -0
- package/dist/components/ec/stat-card.js +50 -0
- package/dist/components/foundations/accordion.js +67 -0
- package/dist/components/foundations/alert-dialog.js +165 -0
- package/dist/components/foundations/alert.js +218 -0
- package/dist/components/foundations/aspect-ratio.js +10 -0
- package/dist/components/foundations/avatar.js +58 -0
- package/dist/components/foundations/badge.js +54 -0
- package/dist/components/foundations/breadcrumb.js +104 -0
- package/dist/components/foundations/button.js +99 -0
- package/dist/components/foundations/calendar.js +173 -0
- package/dist/components/foundations/card.js +109 -0
- package/dist/components/foundations/checkbox-card.js +111 -0
- package/dist/components/foundations/checkbox-group.js +92 -0
- package/dist/components/foundations/checkbox.js +90 -0
- package/dist/components/foundations/chip-variants.js +41 -0
- package/dist/components/foundations/collapsible.js +34 -0
- package/dist/components/foundations/command.js +171 -0
- package/dist/components/foundations/context-menu.js +225 -0
- package/dist/components/foundations/data-table.js +59 -0
- package/dist/components/foundations/dialog.js +148 -0
- package/dist/components/foundations/drawer.js +129 -0
- package/dist/components/foundations/dropdown-menu.js +232 -0
- package/dist/components/foundations/field.js +150 -0
- package/dist/components/foundations/file-input.js +116 -0
- package/dist/components/foundations/form.js +101 -0
- package/dist/components/foundations/hover-card.js +41 -0
- package/dist/components/foundations/icon-badge.js +41 -0
- package/dist/components/foundations/input.js +74 -0
- package/dist/components/foundations/label.js +29 -0
- package/dist/components/foundations/menubar.js +252 -0
- package/dist/components/foundations/navigation-menu.js +171 -0
- package/dist/components/foundations/pagination.js +120 -0
- package/dist/components/foundations/popover.js +45 -0
- package/dist/components/foundations/progress.js +34 -0
- package/dist/components/foundations/radio-group.js +134 -0
- package/dist/components/foundations/responsive-dialog.js +76 -0
- package/dist/components/foundations/scroll-area.js +62 -0
- package/dist/components/foundations/select.js +190 -0
- package/dist/components/foundations/separator.js +27 -0
- package/dist/components/foundations/sheet.js +130 -0
- package/dist/components/foundations/skeleton.js +15 -0
- package/dist/components/foundations/skip-link.js +27 -0
- package/dist/components/foundations/slider.js +81 -0
- package/dist/components/foundations/social-icon.js +36 -0
- package/dist/components/foundations/sonner.js +49 -0
- package/dist/components/foundations/spinner.js +28 -0
- package/dist/components/foundations/switch.js +54 -0
- package/dist/components/foundations/table.js +115 -0
- package/dist/components/foundations/tabs.js +102 -0
- package/dist/components/foundations/textarea.js +65 -0
- package/dist/components/foundations/toggle-group.js +107 -0
- package/dist/components/foundations/toggle.js +44 -0
- package/dist/components/foundations/tooltip.js +56 -0
- package/dist/components/primitives/admin-header.js +31 -0
- package/dist/components/primitives/admin-side-nav.js +135 -0
- package/dist/components/primitives/banner-carousel.js +97 -0
- package/dist/components/primitives/bottom-tab-bar.js +81 -0
- package/dist/components/primitives/bulk-action-bar.js +27 -0
- package/dist/components/primitives/category-scroll.js +110 -0
- package/dist/components/primitives/category-shortcuts.js +66 -0
- package/dist/components/primitives/chat-composer.js +141 -0
- package/dist/components/primitives/chip.js +123 -0
- package/dist/components/primitives/coach-mark.js +102 -0
- package/dist/components/primitives/combobox.js +88 -0
- package/dist/components/primitives/container.js +50 -0
- package/dist/components/primitives/content-carousel.js +144 -0
- package/dist/components/primitives/date-picker.js +175 -0
- package/dist/components/primitives/empty-state.js +32 -0
- package/dist/components/primitives/error-state.js +115 -0
- package/dist/components/primitives/filter-bar.js +144 -0
- package/dist/components/primitives/footer.js +247 -0
- package/dist/components/primitives/form-field.js +38 -0
- package/dist/components/primitives/funnel-shell.js +99 -0
- package/dist/components/primitives/header.js +257 -0
- package/dist/components/primitives/image-carousel.js +156 -0
- package/dist/components/primitives/image-gallery.js +177 -0
- package/dist/components/primitives/image-input.js +207 -0
- package/dist/components/primitives/image-uploader.js +69 -0
- package/dist/components/primitives/kebab-menu.js +40 -0
- package/dist/components/primitives/list-item.js +80 -0
- package/dist/components/primitives/menu-drawer.js +154 -0
- package/dist/components/primitives/multi-select.js +93 -0
- package/dist/components/primitives/notification-badge.js +61 -0
- package/dist/components/primitives/notification-list.js +72 -0
- package/dist/components/primitives/number-input.js +235 -0
- package/dist/components/primitives/price-display.js +101 -0
- package/dist/components/primitives/progress-steps.js +62 -0
- package/dist/components/primitives/search-bar.js +81 -0
- package/dist/components/primitives/search-panel.js +43 -0
- package/dist/components/primitives/section-header.js +148 -0
- package/dist/components/primitives/section-nav.js +85 -0
- package/dist/components/primitives/section.js +78 -0
- package/dist/components/primitives/share-buttons.js +102 -0
- package/dist/components/primitives/side-nav.js +98 -0
- package/dist/components/primitives/social-login-button.js +53 -0
- package/dist/components/primitives/standard-page-shell.js +34 -0
- package/dist/components/primitives/status-count-tabs.js +42 -0
- package/dist/components/primitives/sticky-action-bar.js +26 -0
- package/dist/components/primitives/sub-nav.js +67 -0
- package/dist/components/primitives/tag.js +57 -0
- package/dist/components/primitives/timeline.js +55 -0
- package/dist/components/primitives/workspace-shell.js +57 -0
- package/dist/index.css +1 -1
- package/dist/index.js +22961 -13130
- package/dist/lib/field-labelling.js +29 -0
- package/dist/lib/focus-ring.js +6 -0
- package/dist/lib/pagination-range.js +42 -0
- package/dist/lib/use-value-length.js +63 -0
- package/dist/lib/utils.js +33 -0
- package/dist/types/components/ec/_mypage-menu-data.d.ts +3 -3
- package/dist/types/components/ec/admin-shell.d.ts +1 -1
- package/dist/types/components/ec/anniversary-card.d.ts +1 -1
- package/dist/types/components/ec/mypage-shell.d.ts +3 -3
- package/dist/types/components/ec/product-card.d.ts +1 -1
- package/dist/types/components/ec/product-carousel.d.ts +3 -3
- package/dist/types/components/ec/stat-card.d.ts +1 -1
- package/dist/types/components/foundations/accordion.d.ts +8 -1
- package/dist/types/components/foundations/alert-dialog.d.ts +1 -1
- package/dist/types/components/foundations/calendar.d.ts +1 -1
- package/dist/types/components/foundations/checkbox-group.d.ts +1 -1
- package/dist/types/components/foundations/command.d.ts +1 -1
- package/dist/types/components/foundations/data-table.d.ts +6 -1
- package/dist/types/components/foundations/field.d.ts +2 -2
- package/dist/types/components/foundations/file-input.d.ts +1 -1
- package/dist/types/components/foundations/pagination.d.ts +1 -1
- package/dist/types/components/foundations/responsive-dialog.d.ts +1 -1
- package/dist/types/components/foundations/skip-link.d.ts +1 -1
- package/dist/types/components/foundations/slider.d.ts +13 -1
- package/dist/types/components/primitives/admin-header.d.ts +11 -1
- package/dist/types/components/primitives/admin-side-nav.d.ts +19 -1
- package/dist/types/components/primitives/banner-carousel.d.ts +2 -2
- package/dist/types/components/primitives/category-scroll.d.ts +2 -2
- package/dist/types/components/primitives/category-shortcuts.d.ts +1 -1
- package/dist/types/components/primitives/chat-composer.d.ts +1 -1
- package/dist/types/components/primitives/chip.d.ts +1 -1
- package/dist/types/components/primitives/combobox.d.ts +9 -1
- package/dist/types/components/primitives/content-carousel.d.ts +1 -1
- package/dist/types/components/primitives/form-field.d.ts +1 -1
- package/dist/types/components/primitives/image-input.d.ts +1 -1
- package/dist/types/components/primitives/kebab-menu.d.ts +1 -1
- package/dist/types/components/primitives/menu-drawer.d.ts +0 -16
- package/dist/types/components/primitives/multi-select.d.ts +9 -1
- package/dist/types/components/primitives/notification-list.d.ts +1 -1
- package/dist/types/components/primitives/search-panel.d.ts +1 -1
- package/dist/types/components/primitives/section-nav.d.ts +1 -1
- package/dist/types/components/primitives/side-nav.d.ts +1 -1
- package/dist/types/components/primitives/social-login-button.d.ts +1 -1
- package/dist/types/lib/field-labelling.d.ts +66 -0
- package/package.json +2 -2
- package/scripts/codemod/README.md +9 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { X as x } from "lucide-react";
|
|
4
|
+
import { cn as a } from "../../lib/utils.js";
|
|
5
|
+
import { Button as m } from "../foundations/button.js";
|
|
6
|
+
const h = {
|
|
7
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-[-6px]",
|
|
8
|
+
"top-left": "bottom-full left-5 mb-[-6px]",
|
|
9
|
+
"top-right": "bottom-full right-5 mb-[-6px]",
|
|
10
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-[-6px]",
|
|
11
|
+
"bottom-left": "top-full left-5 mt-[-6px]",
|
|
12
|
+
"bottom-right": "top-full right-5 mt-[-6px]",
|
|
13
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-[-6px]",
|
|
14
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-[-6px]"
|
|
15
|
+
}, c = {
|
|
16
|
+
top: "rotate-45 rounded-tl-[2px]",
|
|
17
|
+
"top-left": "rotate-45 rounded-tl-[2px]",
|
|
18
|
+
"top-right": "rotate-45 rounded-tl-[2px]",
|
|
19
|
+
bottom: "rotate-45 rounded-br-[2px]",
|
|
20
|
+
"bottom-left": "rotate-45 rounded-br-[2px]",
|
|
21
|
+
"bottom-right": "rotate-45 rounded-br-[2px]",
|
|
22
|
+
left: "rotate-45 rounded-bl-[2px]",
|
|
23
|
+
right: "rotate-45 rounded-tr-[2px]"
|
|
24
|
+
};
|
|
25
|
+
function y({
|
|
26
|
+
className: p,
|
|
27
|
+
direction: o = "bottom",
|
|
28
|
+
onClose: l,
|
|
29
|
+
step: e,
|
|
30
|
+
onNext: r,
|
|
31
|
+
nextLabel: s = "次へ",
|
|
32
|
+
children: d,
|
|
33
|
+
...n
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ t(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "coach-mark",
|
|
39
|
+
className: a("relative inline-block", p),
|
|
40
|
+
...n,
|
|
41
|
+
children: /* @__PURE__ */ i(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: a(
|
|
45
|
+
"relative rounded-lg bg-[var(--Primitive-Gray-900)] p-3 typo-body-md text-[var(--Primitive-White-alpha-1000)]",
|
|
46
|
+
"shadow-[0px_4px_6px_-4px_rgba(24,39,75,0.12),0px_8px_8px_-4px_rgba(24,39,75,0.08)]",
|
|
47
|
+
e || r ? "min-w-[256px]" : "max-w-[256px]"
|
|
48
|
+
),
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ i("div", { className: "flex items-start gap-1", children: [
|
|
51
|
+
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: d }),
|
|
52
|
+
l && /* @__PURE__ */ t(
|
|
53
|
+
m,
|
|
54
|
+
{
|
|
55
|
+
variant: "ghost",
|
|
56
|
+
size: "icon-xs",
|
|
57
|
+
className: "shrink-0 text-[var(--Primitive-White-alpha-1000)]/70 hover:bg-[var(--Primitive-White-alpha-1000)]/10 hover:text-[var(--Primitive-White-alpha-1000)]",
|
|
58
|
+
onClick: l,
|
|
59
|
+
"aria-label": "閉じる",
|
|
60
|
+
children: /* @__PURE__ */ t(x, { className: "size-4" })
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] }),
|
|
64
|
+
(e || r) && /* @__PURE__ */ i("div", { className: "mt-2 flex items-center justify-between pl-2", children: [
|
|
65
|
+
/* @__PURE__ */ t("span", { className: "typo-body-md text-[var(--Primitive-White-alpha-1000)]/90", children: e ?? "" }),
|
|
66
|
+
r && /* @__PURE__ */ t(
|
|
67
|
+
m,
|
|
68
|
+
{
|
|
69
|
+
variant: "tertiary",
|
|
70
|
+
size: "sm",
|
|
71
|
+
onClick: r,
|
|
72
|
+
children: s
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ t(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: a(
|
|
80
|
+
"absolute z-[var(--Z-Local-1)] size-3",
|
|
81
|
+
h[o]
|
|
82
|
+
),
|
|
83
|
+
children: /* @__PURE__ */ t(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: a(
|
|
87
|
+
"size-3 bg-[var(--Primitive-Gray-900)]",
|
|
88
|
+
c[o]
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
y as CoachMark
|
|
102
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as w from "react";
|
|
3
|
+
import { ChevronsUpDown as N, Check as j } from "lucide-react";
|
|
4
|
+
import { cn as h } from "../../lib/utils.js";
|
|
5
|
+
import { Button as k } from "../foundations/button.js";
|
|
6
|
+
import { Command as E, CommandInput as P, CommandList as O, CommandEmpty as S, CommandGroup as T, CommandItem as A } from "../foundations/command.js";
|
|
7
|
+
import { Popover as F, PopoverTrigger as I, PopoverContent as B } from "../foundations/popover.js";
|
|
8
|
+
import { useFieldLabelling as G, resolveFieldAria as H } from "../../lib/field-labelling.js";
|
|
9
|
+
function K({
|
|
10
|
+
options: s,
|
|
11
|
+
value: l,
|
|
12
|
+
onValueChange: u,
|
|
13
|
+
placeholder: o = "選択してください",
|
|
14
|
+
searchPlaceholder: f = "検索",
|
|
15
|
+
emptyLabel: v = "候補がありません",
|
|
16
|
+
disabled: x,
|
|
17
|
+
className: y,
|
|
18
|
+
id: d,
|
|
19
|
+
"aria-invalid": C,
|
|
20
|
+
"aria-describedby": n,
|
|
21
|
+
"aria-label": i,
|
|
22
|
+
"aria-labelledby": t
|
|
23
|
+
}) {
|
|
24
|
+
const [m, c] = w.useState(!1), p = s.find((e) => e.value === l), b = G(), g = H(
|
|
25
|
+
{
|
|
26
|
+
id: d,
|
|
27
|
+
"aria-label": i,
|
|
28
|
+
"aria-labelledby": t,
|
|
29
|
+
"aria-describedby": n
|
|
30
|
+
},
|
|
31
|
+
b
|
|
32
|
+
);
|
|
33
|
+
return /* @__PURE__ */ r(F, { open: m, onOpenChange: c, children: [
|
|
34
|
+
/* @__PURE__ */ a(I, { asChild: !0, children: /* @__PURE__ */ r(
|
|
35
|
+
k,
|
|
36
|
+
{
|
|
37
|
+
type: "button",
|
|
38
|
+
variant: "tertiary",
|
|
39
|
+
role: "combobox",
|
|
40
|
+
id: d,
|
|
41
|
+
"aria-expanded": m,
|
|
42
|
+
"aria-haspopup": "listbox",
|
|
43
|
+
"aria-invalid": C,
|
|
44
|
+
"aria-describedby": n,
|
|
45
|
+
"aria-label": i ?? (!b && !i && !t ? o : void 0),
|
|
46
|
+
"aria-labelledby": t,
|
|
47
|
+
...g,
|
|
48
|
+
disabled: x,
|
|
49
|
+
className: h("w-full justify-between bg-[var(--Surface-Primary)]", y),
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ a("span", { className: p ? "text-[var(--Text-High-Emphasis)]" : "text-[var(--Text-Low-Emphasis)]", children: p?.label ?? o }),
|
|
52
|
+
/* @__PURE__ */ a(N, { "aria-hidden": "true", className: "text-[var(--Object-Medium-Emphasis)]" })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
) }),
|
|
56
|
+
/* @__PURE__ */ a(B, { align: "start", className: "w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ r(E, { children: [
|
|
57
|
+
/* @__PURE__ */ a(P, { placeholder: f }),
|
|
58
|
+
/* @__PURE__ */ r(O, { children: [
|
|
59
|
+
/* @__PURE__ */ a(S, { children: v }),
|
|
60
|
+
/* @__PURE__ */ a(T, { children: s.map((e) => /* @__PURE__ */ r(
|
|
61
|
+
A,
|
|
62
|
+
{
|
|
63
|
+
value: [e.label, ...e.keywords ?? []].join(" "),
|
|
64
|
+
disabled: e.disabled,
|
|
65
|
+
onSelect: () => {
|
|
66
|
+
u?.(e.value), c(!1);
|
|
67
|
+
},
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ a(
|
|
70
|
+
j,
|
|
71
|
+
{
|
|
72
|
+
"aria-hidden": "true",
|
|
73
|
+
className: h(e.value === l ? "opacity-100" : "opacity-0")
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
e.label,
|
|
77
|
+
e.value === l && /* @__PURE__ */ a("span", { className: "sr-only", children: "選択済み" })
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
e.value
|
|
81
|
+
)) })
|
|
82
|
+
] })
|
|
83
|
+
] }) })
|
|
84
|
+
] });
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
K as Combobox
|
|
88
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cva as o } from "class-variance-authority";
|
|
4
|
+
import { cn as i } from "../../lib/utils.js";
|
|
5
|
+
const p = o("mx-auto w-full", {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
// コンテンツ最大幅。4px グリッド対象外のレイアウト幅なので任意値で固定。
|
|
9
|
+
page: "max-w-[1280px]",
|
|
10
|
+
// 標準ページ = breakpoints.xl(コンテンツ上限段)
|
|
11
|
+
narrow: "max-w-[760px]",
|
|
12
|
+
// 記事・フォーム等の読み物幅
|
|
13
|
+
wide: "max-w-[1440px]",
|
|
14
|
+
// ワイドなランディング
|
|
15
|
+
fluid: "max-w-none"
|
|
16
|
+
// 上限なし(全幅)
|
|
17
|
+
},
|
|
18
|
+
gutter: {
|
|
19
|
+
default: "px-4 md:px-6",
|
|
20
|
+
// SP 16 / PC 24
|
|
21
|
+
tight: "px-3 md:px-4",
|
|
22
|
+
// SP 12 / PC 16
|
|
23
|
+
none: "px-0"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
size: "page",
|
|
28
|
+
gutter: "default"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
function u({
|
|
32
|
+
className: t,
|
|
33
|
+
size: a,
|
|
34
|
+
gutter: r,
|
|
35
|
+
...e
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */ n(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "container",
|
|
41
|
+
"data-size": a ?? "page",
|
|
42
|
+
className: i(p({ size: a, gutter: r }), t),
|
|
43
|
+
...e
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
u as Container,
|
|
49
|
+
p as containerVariants
|
|
50
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsxs as v, jsx as a, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import F from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
|
|
4
|
+
import L from "iconsax-reactjs/dist/esm/ArrowRight2.js";
|
|
5
|
+
import { cn as i } from "../../lib/utils.js";
|
|
6
|
+
const k = {
|
|
7
|
+
1: "@[960px]:w-full",
|
|
8
|
+
2: "@[960px]:w-[calc((100%-16px)/2)]",
|
|
9
|
+
3: "@[960px]:w-[calc((100%-32px)/3)]",
|
|
10
|
+
4: "@[960px]:w-[calc((100%-48px)/4)]"
|
|
11
|
+
};
|
|
12
|
+
function M({
|
|
13
|
+
slides: c,
|
|
14
|
+
showDots: b = !0,
|
|
15
|
+
showArrows: y = !0,
|
|
16
|
+
autoPlay: d = 0,
|
|
17
|
+
peek: p = !1,
|
|
18
|
+
itemsPerView: f = 1,
|
|
19
|
+
ariaLabel: g = "コンテンツカルーセル",
|
|
20
|
+
className: w,
|
|
21
|
+
...E
|
|
22
|
+
}) {
|
|
23
|
+
const u = s.useRef(null), [o, I] = s.useState(0), t = c.length;
|
|
24
|
+
s.useEffect(() => {
|
|
25
|
+
const r = u.current;
|
|
26
|
+
if (!r) return;
|
|
27
|
+
let e = 0;
|
|
28
|
+
const n = () => {
|
|
29
|
+
cancelAnimationFrame(e), e = requestAnimationFrame(() => {
|
|
30
|
+
const A = Array.from(
|
|
31
|
+
r.querySelectorAll("[data-slide]")
|
|
32
|
+
);
|
|
33
|
+
let m = 0, h = Number.POSITIVE_INFINITY;
|
|
34
|
+
A.forEach((T, j) => {
|
|
35
|
+
const x = Math.abs(T.offsetLeft - r.scrollLeft);
|
|
36
|
+
x < h && (h = x, m = j);
|
|
37
|
+
}), I(m);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
return n(), r.addEventListener("scroll", n, { passive: !0 }), () => {
|
|
41
|
+
cancelAnimationFrame(e), r.removeEventListener("scroll", n);
|
|
42
|
+
};
|
|
43
|
+
}, [t]);
|
|
44
|
+
function l(r) {
|
|
45
|
+
const e = u.current;
|
|
46
|
+
if (!e) return;
|
|
47
|
+
const n = e.children[r];
|
|
48
|
+
n && e.scrollTo({ left: n.offsetLeft, behavior: "smooth" });
|
|
49
|
+
}
|
|
50
|
+
s.useEffect(() => {
|
|
51
|
+
if (d <= 0 || t <= 1) return;
|
|
52
|
+
const r = setInterval(() => {
|
|
53
|
+
l((o + 1) % t);
|
|
54
|
+
}, d);
|
|
55
|
+
return () => clearInterval(r);
|
|
56
|
+
}, [d, o, t]);
|
|
57
|
+
function N() {
|
|
58
|
+
l(o <= 0 ? t - 1 : o - 1);
|
|
59
|
+
}
|
|
60
|
+
function S() {
|
|
61
|
+
l(o >= t - 1 ? 0 : o + 1);
|
|
62
|
+
}
|
|
63
|
+
return t === 0 ? null : /* @__PURE__ */ v(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "content-carousel",
|
|
67
|
+
role: "region",
|
|
68
|
+
"aria-roledescription": "carousel",
|
|
69
|
+
"aria-label": g,
|
|
70
|
+
className: i("@container group/carousel relative", w),
|
|
71
|
+
...E,
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ a(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
ref: u,
|
|
77
|
+
className: i(
|
|
78
|
+
"flex snap-x snap-mandatory overflow-x-auto scroll-smooth scrollbar-none",
|
|
79
|
+
p && "pl-4 @[960px]:pl-0",
|
|
80
|
+
f > 1 && "@[960px]:gap-4"
|
|
81
|
+
),
|
|
82
|
+
style: { scrollbarWidth: "none", msOverflowStyle: "none" },
|
|
83
|
+
children: c.map((r, e) => /* @__PURE__ */ a(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
"data-slide": !0,
|
|
87
|
+
"data-index": e,
|
|
88
|
+
role: "group",
|
|
89
|
+
"aria-roledescription": "スライド",
|
|
90
|
+
"aria-label": `${e + 1} / ${t}`,
|
|
91
|
+
className: i(
|
|
92
|
+
"shrink-0 snap-start",
|
|
93
|
+
p ? "w-[calc(100%-48px)] pr-3 @[960px]:pr-0" : "w-full",
|
|
94
|
+
k[f]
|
|
95
|
+
),
|
|
96
|
+
children: r
|
|
97
|
+
},
|
|
98
|
+
e
|
|
99
|
+
))
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
y && t > 1 && /* @__PURE__ */ v(z, { children: [
|
|
103
|
+
/* @__PURE__ */ a(
|
|
104
|
+
"button",
|
|
105
|
+
{
|
|
106
|
+
type: "button",
|
|
107
|
+
onClick: N,
|
|
108
|
+
"aria-label": "前へ",
|
|
109
|
+
className: "absolute left-2 top-1/2 z-10 hidden size-10 -translate-y-1/2 items-center justify-center rounded-full border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Secondary)] shadow-md transition-opacity hover:bg-[var(--Surface-Tertiary)] @md:flex @[960px]:opacity-0 @[960px]:group-hover/carousel:opacity-100",
|
|
110
|
+
children: /* @__PURE__ */ a(F, { size: 20, className: "text-[var(--Object-High-Emphasis)]" })
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ a(
|
|
114
|
+
"button",
|
|
115
|
+
{
|
|
116
|
+
type: "button",
|
|
117
|
+
onClick: S,
|
|
118
|
+
"aria-label": "次へ",
|
|
119
|
+
className: "absolute right-2 top-1/2 z-10 hidden size-10 -translate-y-1/2 items-center justify-center rounded-full border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Secondary)] shadow-md transition-opacity hover:bg-[var(--Surface-Tertiary)] @md:flex @[960px]:opacity-0 @[960px]:group-hover/carousel:opacity-100",
|
|
120
|
+
children: /* @__PURE__ */ a(L, { size: 20, className: "text-[var(--Object-High-Emphasis)]" })
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] }),
|
|
124
|
+
b && t > 1 && /* @__PURE__ */ a("div", { className: "mt-2 flex flex-wrap items-center justify-center gap-1.5 @[960px]:hidden", children: c.map((r, e) => /* @__PURE__ */ a(
|
|
125
|
+
"button",
|
|
126
|
+
{
|
|
127
|
+
type: "button",
|
|
128
|
+
onClick: () => l(e),
|
|
129
|
+
"aria-label": `スライド ${e + 1}`,
|
|
130
|
+
className: i(
|
|
131
|
+
// shrink-0 必須: 空要素なので min-content 幅が 0、既定の flex-shrink:1 だとドットが消える
|
|
132
|
+
"size-2 shrink-0 rounded-full transition-colors",
|
|
133
|
+
e === o ? "bg-[var(--Text-High-Emphasis)]" : "bg-[var(--Surface-Tertiary)]"
|
|
134
|
+
)
|
|
135
|
+
},
|
|
136
|
+
e
|
|
137
|
+
)) })
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
export {
|
|
143
|
+
M as ContentCarousel
|
|
144
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as y from "react";
|
|
3
|
+
import v from "iconsax-reactjs/dist/esm/Calendar.js";
|
|
4
|
+
import { X as H } from "lucide-react";
|
|
5
|
+
import { ja as A } from "react-day-picker/locale";
|
|
6
|
+
import { cn as S } from "../../lib/utils.js";
|
|
7
|
+
import { Button as N } from "../foundations/button.js";
|
|
8
|
+
import { Calendar as P } from "../foundations/calendar.js";
|
|
9
|
+
import { Popover as z, PopoverTrigger as j, PopoverContent as k } from "../foundations/popover.js";
|
|
10
|
+
import { Select as M, SelectTrigger as C, SelectValue as w, SelectContent as D, SelectItem as E } from "../foundations/select.js";
|
|
11
|
+
const $ = ["日", "月", "火", "水", "木", "金", "土"];
|
|
12
|
+
function T(e) {
|
|
13
|
+
return `${e.getMonth() + 1}月${e.getDate()}日(${$[e.getDay()]})`;
|
|
14
|
+
}
|
|
15
|
+
function V(e, o, s) {
|
|
16
|
+
const a = [];
|
|
17
|
+
return e && a.push({ before: e }), o && a.push({ after: o }), s && (Array.isArray(s) ? a.push(...s) : a.push(s)), a.length > 0 ? a : void 0;
|
|
18
|
+
}
|
|
19
|
+
function _({
|
|
20
|
+
value: e,
|
|
21
|
+
onChange: o,
|
|
22
|
+
placeholder: s = "日付を選択",
|
|
23
|
+
min: a,
|
|
24
|
+
max: l,
|
|
25
|
+
disabledDates: p,
|
|
26
|
+
disabled: c,
|
|
27
|
+
clearable: f = !1,
|
|
28
|
+
clearLabel: u = "日付をクリア",
|
|
29
|
+
id: g,
|
|
30
|
+
className: b
|
|
31
|
+
}) {
|
|
32
|
+
const [m, h] = y.useState(!1), d = V(a, l, p), t = f && !!e && !c;
|
|
33
|
+
return (
|
|
34
|
+
// クリアボタンは trigger の「兄弟」として絶対配置する。trigger の内側に置くと
|
|
35
|
+
// button の入れ子になり a11y 上不正(Chip removable と同じ解決)。
|
|
36
|
+
/* @__PURE__ */ n("div", { className: S("relative w-full", b), children: [
|
|
37
|
+
/* @__PURE__ */ n(z, { open: m, onOpenChange: h, children: [
|
|
38
|
+
/* @__PURE__ */ r(j, { asChild: !0, children: /* @__PURE__ */ n(
|
|
39
|
+
N,
|
|
40
|
+
{
|
|
41
|
+
id: g,
|
|
42
|
+
type: "button",
|
|
43
|
+
variant: "ghost",
|
|
44
|
+
disabled: c,
|
|
45
|
+
"aria-label": e ? T(e) : s,
|
|
46
|
+
"data-empty": !e,
|
|
47
|
+
className: S(
|
|
48
|
+
// h-11(44px)= 入力コントロールの共通高さ(Input / SelectTrigger / Button default と揃える)
|
|
49
|
+
"h-11 w-full justify-start gap-2 border border-[var(--Border-High-Emphasis)] bg-transparent px-3 typo-body-md text-[var(--Text-High-Emphasis)] hover:border-[var(--Focus-High-Emphasis)] hover:bg-[var(--Surface-Secondary)] data-[empty=true]:text-[var(--Text-Low-Emphasis)]",
|
|
50
|
+
// クリアボタンの領域を空ける
|
|
51
|
+
t && "pr-10"
|
|
52
|
+
),
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ r(v, { size: 16, className: "shrink-0" }),
|
|
55
|
+
/* @__PURE__ */ r("span", { className: "truncate", children: e ? T(e) : s })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
) }),
|
|
59
|
+
/* @__PURE__ */ r(k, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ r(
|
|
60
|
+
P,
|
|
61
|
+
{
|
|
62
|
+
mode: "single",
|
|
63
|
+
selected: e,
|
|
64
|
+
onSelect: (i) => {
|
|
65
|
+
o?.(i), h(!1);
|
|
66
|
+
},
|
|
67
|
+
disabled: d,
|
|
68
|
+
locale: A,
|
|
69
|
+
autoFocus: !0
|
|
70
|
+
}
|
|
71
|
+
) })
|
|
72
|
+
] }),
|
|
73
|
+
t && /* @__PURE__ */ r(
|
|
74
|
+
N,
|
|
75
|
+
{
|
|
76
|
+
type: "button",
|
|
77
|
+
variant: "ghost",
|
|
78
|
+
size: "icon-sm",
|
|
79
|
+
"aria-label": u,
|
|
80
|
+
onClick: () => o?.(void 0),
|
|
81
|
+
className: "absolute top-1/2 right-1 -translate-y-1/2 text-[var(--Text-Medium-Emphasis)]",
|
|
82
|
+
children: /* @__PURE__ */ r(H, { className: "size-4" })
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] })
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
function Y({
|
|
89
|
+
value: e,
|
|
90
|
+
onChange: o,
|
|
91
|
+
minuteStep: s = 5,
|
|
92
|
+
hourLabel: a = "時",
|
|
93
|
+
minuteLabel: l = "分",
|
|
94
|
+
clearLabel: p = "日時をクリア",
|
|
95
|
+
disabled: c,
|
|
96
|
+
className: f,
|
|
97
|
+
...u
|
|
98
|
+
}) {
|
|
99
|
+
const g = y.useMemo(
|
|
100
|
+
() => Array.from({ length: 24 }, (t, i) => i),
|
|
101
|
+
[]
|
|
102
|
+
), b = y.useMemo(
|
|
103
|
+
() => Array.from(
|
|
104
|
+
{ length: Math.ceil(60 / s) },
|
|
105
|
+
(t, i) => i * s
|
|
106
|
+
),
|
|
107
|
+
[s]
|
|
108
|
+
), m = (t, i) => {
|
|
109
|
+
if (!e) return;
|
|
110
|
+
const x = new Date(e);
|
|
111
|
+
t === "hours" ? x.setHours(Number(i)) : x.setMinutes(Number(i)), o?.(x);
|
|
112
|
+
}, h = (t) => {
|
|
113
|
+
if (!t || !e) {
|
|
114
|
+
o?.(t);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const i = new Date(t);
|
|
118
|
+
i.setHours(
|
|
119
|
+
e.getHours(),
|
|
120
|
+
e.getMinutes(),
|
|
121
|
+
e.getSeconds(),
|
|
122
|
+
e.getMilliseconds()
|
|
123
|
+
), o?.(i);
|
|
124
|
+
}, d = c || !e;
|
|
125
|
+
return /* @__PURE__ */ n("div", { className: S("flex items-center gap-2", f), children: [
|
|
126
|
+
/* @__PURE__ */ r(
|
|
127
|
+
_,
|
|
128
|
+
{
|
|
129
|
+
...u,
|
|
130
|
+
value: e,
|
|
131
|
+
onChange: h,
|
|
132
|
+
disabled: c,
|
|
133
|
+
clearLabel: p,
|
|
134
|
+
className: "flex-1"
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
/* @__PURE__ */ n(
|
|
138
|
+
M,
|
|
139
|
+
{
|
|
140
|
+
value: e ? String(e.getHours()) : void 0,
|
|
141
|
+
onValueChange: (t) => m("hours", t),
|
|
142
|
+
disabled: d,
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ r(C, { size: "default", className: "w-[72px]", "aria-label": a, children: /* @__PURE__ */ r(w, { placeholder: a }) }),
|
|
145
|
+
/* @__PURE__ */ r(D, { children: g.map((t) => /* @__PURE__ */ r(E, { value: String(t), children: String(t).padStart(2, "0") }, t)) })
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ r("span", { className: "typo-body-md text-[var(--Text-Medium-Emphasis)]", children: ":" }),
|
|
150
|
+
/* @__PURE__ */ n(
|
|
151
|
+
M,
|
|
152
|
+
{
|
|
153
|
+
value: e ? String(e.getMinutes()) : void 0,
|
|
154
|
+
onValueChange: (t) => m("minutes", t),
|
|
155
|
+
disabled: d,
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ r(
|
|
158
|
+
C,
|
|
159
|
+
{
|
|
160
|
+
size: "default",
|
|
161
|
+
className: "w-[72px]",
|
|
162
|
+
"aria-label": l,
|
|
163
|
+
children: /* @__PURE__ */ r(w, { placeholder: l })
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ r(D, { children: b.map((t) => /* @__PURE__ */ r(E, { value: String(t), children: String(t).padStart(2, "0") }, t)) })
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
] });
|
|
171
|
+
}
|
|
172
|
+
export {
|
|
173
|
+
_ as DatePicker,
|
|
174
|
+
Y as DateTimePicker
|
|
175
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn as c } from "../../lib/utils.js";
|
|
4
|
+
function n({
|
|
5
|
+
className: s,
|
|
6
|
+
icon: a,
|
|
7
|
+
title: r,
|
|
8
|
+
description: t,
|
|
9
|
+
action: m,
|
|
10
|
+
...i
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ d(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "empty-state",
|
|
16
|
+
className: c(
|
|
17
|
+
"flex flex-col items-center justify-center px-4 py-20",
|
|
18
|
+
s
|
|
19
|
+
),
|
|
20
|
+
...i,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ e("div", { className: "text-[var(--Border-Medium-Emphasis)]", children: a }),
|
|
23
|
+
/* @__PURE__ */ e("p", { className: "mt-4 typo-heading-md text-[var(--Text-High-Emphasis)]", children: r }),
|
|
24
|
+
t && /* @__PURE__ */ e("div", { className: "mt-1 text-center typo-body-md text-[var(--Text-Medium-Emphasis)]", children: t }),
|
|
25
|
+
m && /* @__PURE__ */ e("div", { className: "mt-6", children: m })
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
n as EmptyState
|
|
32
|
+
};
|