@cakejp/design-system 0.17.0 → 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 +59 -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 +1785 -831
- 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/_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 +13 -20
- package/dist/types/components/ec/product-carousel.d.ts +3 -3
- package/dist/types/components/ec/review-card.d.ts +6 -1
- package/dist/types/components/ec/stat-card.d.ts +1 -1
- package/dist/types/components/foundations/alert-dialog.d.ts +1 -1
- package/dist/types/components/foundations/button.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/chip-variants.d.ts +1 -1
- package/dist/types/components/foundations/command.d.ts +1 -1
- package/dist/types/components/foundations/data-table.d.ts +9 -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 +8 -2
- package/dist/types/components/foundations/responsive-dialog.d.ts +1 -1
- package/dist/types/components/foundations/sheet.d.ts +6 -1
- package/dist/types/components/foundations/skip-link.d.ts +1 -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-header.d.ts +1 -1
- package/dist/types/components/primitives/admin-side-nav.d.ts +1 -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/content-card.d.ts +67 -0
- package/dist/types/components/primitives/content-carousel.d.ts +1 -1
- package/dist/types/components/primitives/footer.d.ts +21 -1
- package/dist/types/components/primitives/form-field.d.ts +1 -1
- package/dist/types/components/primitives/header.d.ts +30 -2
- 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 +7 -1
- package/dist/types/components/primitives/notification-list.d.ts +1 -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/search-panel.d.ts +1 -1
- package/dist/types/components/primitives/section-header.d.ts +2 -1
- package/dist/types/components/primitives/section-nav.d.ts +1 -1
- package/dist/types/components/primitives/share-buttons.d.ts +26 -4
- 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/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 +10 -5
- 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,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cva as
|
|
3
|
+
import { cva as n } from "class-variance-authority";
|
|
4
4
|
import { Tabs as e } from "radix-ui";
|
|
5
5
|
import { cn as i } from "../../lib/utils.js";
|
|
6
|
-
function
|
|
6
|
+
function v({
|
|
7
7
|
className: t,
|
|
8
8
|
...a
|
|
9
9
|
}) {
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ s(
|
|
11
11
|
e.Root,
|
|
12
12
|
{
|
|
13
13
|
"data-slot": "tabs",
|
|
@@ -16,7 +16,7 @@ function c({
|
|
|
16
16
|
}
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const b = n(
|
|
20
20
|
"group/tabs-list inline-flex items-center",
|
|
21
21
|
{
|
|
22
22
|
variants: {
|
|
@@ -26,37 +26,51 @@ const n = o(
|
|
|
26
26
|
},
|
|
27
27
|
scrollable: {
|
|
28
28
|
true: "gap-4"
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* 狭い置き場所(サイドバー等)向けの詰め設定。
|
|
32
|
+
* segment の 1 項目あたりの最小幅(100px)を外し、左右の padding を詰める(issue #235)。
|
|
33
|
+
*/
|
|
34
|
+
size: {
|
|
35
|
+
md: "",
|
|
36
|
+
sm: ""
|
|
29
37
|
}
|
|
30
38
|
},
|
|
39
|
+
compoundVariants: [
|
|
40
|
+
{ variant: "segment", size: "sm", class: "p-1" }
|
|
41
|
+
],
|
|
31
42
|
defaultVariants: {
|
|
32
43
|
variant: "underbar",
|
|
33
|
-
scrollable: !1
|
|
44
|
+
scrollable: !1,
|
|
45
|
+
size: "md"
|
|
34
46
|
}
|
|
35
47
|
}
|
|
36
48
|
);
|
|
37
|
-
function
|
|
49
|
+
function m({
|
|
38
50
|
className: t,
|
|
39
51
|
variant: a = "underbar",
|
|
40
|
-
scrollable:
|
|
41
|
-
|
|
52
|
+
scrollable: r = !1,
|
|
53
|
+
size: l = "md",
|
|
54
|
+
...o
|
|
42
55
|
}) {
|
|
43
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ s(
|
|
44
57
|
e.List,
|
|
45
58
|
{
|
|
46
59
|
"data-slot": "tabs-list",
|
|
47
60
|
"data-variant": a,
|
|
48
|
-
"data-scrollable":
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
"data-scrollable": r || void 0,
|
|
62
|
+
"data-size": l,
|
|
63
|
+
className: i(b({ variant: a, scrollable: r, size: l }), t),
|
|
64
|
+
...o
|
|
51
65
|
}
|
|
52
66
|
);
|
|
53
67
|
}
|
|
54
|
-
function
|
|
68
|
+
function x({
|
|
55
69
|
className: t,
|
|
56
70
|
children: a,
|
|
57
|
-
...
|
|
71
|
+
...r
|
|
58
72
|
}) {
|
|
59
|
-
return /* @__PURE__ */
|
|
73
|
+
return /* @__PURE__ */ s(
|
|
60
74
|
e.Trigger,
|
|
61
75
|
{
|
|
62
76
|
"data-slot": "tabs-trigger",
|
|
@@ -64,19 +78,25 @@ function m({
|
|
|
64
78
|
// Base
|
|
65
79
|
"group/trigger relative inline-flex items-center justify-center whitespace-nowrap transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
66
80
|
// Underbar variant (default: equal-width tabs with full-width underline)
|
|
67
|
-
|
|
81
|
+
// px-2: 均等割りで幅が詰まったとき、隣のラベルと文字が接触しないための最小余白(issue #235)
|
|
82
|
+
"group-data-[variant=underbar]/tabs-list:h-12 group-data-[variant=underbar]/tabs-list:flex-1 group-data-[variant=underbar]/tabs-list:border-b-2 group-data-[variant=underbar]/tabs-list:border-transparent group-data-[variant=underbar]/tabs-list:px-2 group-data-[variant=underbar]/tabs-list:typo-label-md group-data-[variant=underbar]/tabs-list:text-[var(--Text-Low-Emphasis)]",
|
|
68
83
|
// Underbar active
|
|
69
84
|
"group-data-[variant=underbar]/tabs-list:data-[state=active]:border-[var(--Text-High-Emphasis)] group-data-[variant=underbar]/tabs-list:data-[state=active]:text-[var(--Text-High-Emphasis)]",
|
|
70
85
|
// Scrollable underbar: shrink to text width, bold text, remove trigger border (underline moves to inner span)
|
|
71
|
-
|
|
86
|
+
// gap-4 で間隔を取っているので左右 padding は戻す(従来の間隔を保つ)
|
|
87
|
+
"group-data-[scrollable]/tabs-list:!flex-initial group-data-[scrollable]/tabs-list:!shrink-0 group-data-[scrollable]/tabs-list:!border-b-0 group-data-[scrollable]/tabs-list:!px-0 group-data-[scrollable]/tabs-list:data-[state=active]:!border-b-0 group-data-[scrollable]/tabs-list:typo-label-md",
|
|
72
88
|
// Segment variant
|
|
73
89
|
"group-data-[variant=segment]/tabs-list:h-[37px] group-data-[variant=segment]/tabs-list:min-w-[100px] group-data-[variant=segment]/tabs-list:rounded-full group-data-[variant=segment]/tabs-list:px-3 group-data-[variant=segment]/tabs-list:typo-body-md group-data-[variant=segment]/tabs-list:text-[var(--Text-High-Emphasis)]",
|
|
90
|
+
// size="sm": 狭い置き場所(サイドバー等)向け。1 項目あたりの最小幅を外し、
|
|
91
|
+
// 左右の padding を詰める。min-w を持つのは segment だけ、underbar の px-2 は同値なので
|
|
92
|
+
// 実際に効くのは segment。variant 側の group-data と具体度が並ぶため ! で順序依存を断つ(issue #235)
|
|
93
|
+
"group-data-[size=sm]/tabs-list:!min-w-0 group-data-[size=sm]/tabs-list:!px-2",
|
|
74
94
|
// Segment active
|
|
75
95
|
"group-data-[variant=segment]/tabs-list:data-[state=active]:bg-[var(--Surface-Primary)] group-data-[variant=segment]/tabs-list:data-[state=active]:shadow-[0px_4px_6px_-4px_rgba(24,39,75,0.12),0px_8px_8px_-4px_rgba(24,39,75,0.08)]",
|
|
76
96
|
t
|
|
77
97
|
),
|
|
78
|
-
...
|
|
79
|
-
children: /* @__PURE__ */
|
|
98
|
+
...r,
|
|
99
|
+
children: /* @__PURE__ */ s("span", { className: "group-data-[scrollable]/tabs-list:inline-block group-data-[scrollable]/tabs-list:border-b-2 group-data-[scrollable]/tabs-list:border-transparent group-data-[scrollable]/tabs-list:pb-px group-data-[state=active]/trigger:border-[var(--Text-High-Emphasis)]", children: a })
|
|
80
100
|
}
|
|
81
101
|
);
|
|
82
102
|
}
|
|
@@ -84,7 +104,7 @@ function f({
|
|
|
84
104
|
className: t,
|
|
85
105
|
...a
|
|
86
106
|
}) {
|
|
87
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ s(
|
|
88
108
|
e.Content,
|
|
89
109
|
{
|
|
90
110
|
"data-slot": "tabs-content",
|
|
@@ -94,9 +114,9 @@ function f({
|
|
|
94
114
|
);
|
|
95
115
|
}
|
|
96
116
|
export {
|
|
97
|
-
|
|
117
|
+
v as Tabs,
|
|
98
118
|
f as TabsContent,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
119
|
+
m as TabsList,
|
|
120
|
+
x as TabsTrigger,
|
|
121
|
+
b as tabsListVariants
|
|
102
122
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
3
|
import * as s from "react";
|
|
3
4
|
import { cva as l } from "class-variance-authority";
|
|
4
5
|
import { ToggleGroup as d } from "radix-ui";
|
|
5
6
|
import { cn as g } from "../../lib/utils.js";
|
|
6
|
-
const
|
|
7
|
+
const c = l(
|
|
7
8
|
"flex items-center gap-1.5 py-1.5 overflow-x-auto scrollbar-none",
|
|
8
9
|
{
|
|
9
10
|
variants: {
|
|
@@ -17,7 +18,7 @@ const p = l(
|
|
|
17
18
|
width: "fit"
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
),
|
|
21
|
+
), p = l(
|
|
21
22
|
[
|
|
22
23
|
"inline-flex shrink-0 items-center justify-center",
|
|
23
24
|
"h-9 rounded-full px-3",
|
|
@@ -70,7 +71,7 @@ function h({
|
|
|
70
71
|
d.Root,
|
|
71
72
|
{
|
|
72
73
|
"data-slot": "toggle-group",
|
|
73
|
-
className: g(
|
|
74
|
+
className: g(c({ width: o }), a),
|
|
74
75
|
...t,
|
|
75
76
|
children: /* @__PURE__ */ i(u.Provider, { value: { variant: e, size: r }, children: n })
|
|
76
77
|
}
|
|
@@ -89,7 +90,7 @@ function b({
|
|
|
89
90
|
{
|
|
90
91
|
"data-slot": "toggle-group-item",
|
|
91
92
|
className: g(
|
|
92
|
-
|
|
93
|
+
p({
|
|
93
94
|
variant: t.variant || r,
|
|
94
95
|
size: t.size || o
|
|
95
96
|
}),
|
|
@@ -103,5 +104,5 @@ function b({
|
|
|
103
104
|
export {
|
|
104
105
|
h as ToggleGroup,
|
|
105
106
|
b as ToggleGroupItem,
|
|
106
|
-
|
|
107
|
+
p as toggleGroupItemVariants
|
|
107
108
|
};
|
|
@@ -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,
|