@cakejp/design-system 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +172 -0
- package/CLAUDE.md +5 -3
- package/MIGRATION.md +3 -3
- package/README.md +31 -11
- package/contracts/components.json +420 -63
- package/contracts/composition.json +38 -4
- package/contracts/rules.json +27 -5
- package/contracts/screen-patterns.json +6 -4
- package/dist/components/ec/admin-shell.js +62 -60
- package/dist/components/ec/anniversary-card.js +13 -12
- package/dist/components/ec/coupon-card.js +11 -11
- package/dist/components/ec/delivery-calendar.js +51 -45
- package/dist/components/ec/mypage-shell.js +80 -69
- package/dist/components/ec/product-card.js +93 -76
- package/dist/components/ec/product-carousel.js +65 -60
- package/dist/components/ec/product-detail-bar.js +13 -11
- package/dist/components/ec/product-detail-sidebar.js +60 -58
- package/dist/components/ec/product-list-item.js +64 -63
- package/dist/components/ec/product-option.js +30 -26
- package/dist/components/ec/rating-stars.js +27 -27
- package/dist/components/ec/review-card.js +32 -32
- package/dist/components/ec/review-form.js +37 -37
- package/dist/components/ec/shop-card.js +21 -19
- package/dist/components/foundations/accordion.js +33 -31
- package/dist/components/foundations/alert-dialog.js +4 -5
- package/dist/components/foundations/badge.js +5 -5
- package/dist/components/foundations/breadcrumb.js +27 -26
- package/dist/components/foundations/button.js +144 -25
- package/dist/components/foundations/calendar.js +28 -26
- package/dist/components/foundations/checkbox-card.js +71 -47
- package/dist/components/foundations/checkbox-group.js +30 -27
- package/dist/components/foundations/checkbox.js +69 -52
- package/dist/components/foundations/chip-variants.js +13 -0
- package/dist/components/foundations/command.js +81 -79
- package/dist/components/foundations/confirm-dialog.js +136 -0
- package/dist/components/foundations/context-menu.js +43 -38
- package/dist/components/foundations/data-table.js +87 -84
- package/dist/components/foundations/dialog.js +45 -36
- package/dist/components/foundations/dropdown-menu.js +47 -42
- package/dist/components/foundations/file-input.js +97 -67
- package/dist/components/foundations/hover-card.js +21 -21
- package/dist/components/foundations/menubar.js +75 -69
- package/dist/components/foundations/navigation-menu.js +31 -26
- package/dist/components/foundations/pagination.js +54 -50
- package/dist/components/foundations/popover.js +7 -7
- package/dist/components/foundations/progress.js +10 -6
- package/dist/components/foundations/radio-group.js +6 -3
- package/dist/components/foundations/responsive-dialog.js +73 -55
- package/dist/components/foundations/scroll-area.js +18 -14
- package/dist/components/foundations/select.js +44 -39
- package/dist/components/foundations/sheet.js +45 -37
- package/dist/components/foundations/skeleton.js +6 -6
- package/dist/components/foundations/skip-link.js +10 -8
- package/dist/components/foundations/slider.js +73 -48
- package/dist/components/foundations/sonner.js +5 -4
- package/dist/components/foundations/spinner.js +7 -5
- package/dist/components/foundations/switch.js +11 -10
- package/dist/components/foundations/tabs.js +54 -39
- package/dist/components/foundations/toggle-group.js +29 -21
- package/dist/components/foundations/toggle.js +20 -16
- package/dist/components/primitives/admin-side-nav.js +65 -62
- package/dist/components/primitives/banner-carousel.js +32 -29
- package/dist/components/primitives/bottom-tab-bar.js +16 -15
- package/dist/components/primitives/category-scroll.js +39 -29
- package/dist/components/primitives/category-shortcuts.js +9 -9
- package/dist/components/primitives/chat-composer.js +77 -74
- package/dist/components/primitives/chip.js +84 -61
- package/dist/components/primitives/combobox.js +63 -47
- package/dist/components/primitives/container.js +9 -9
- package/dist/components/primitives/content-card.js +15 -17
- package/dist/components/primitives/content-carousel.js +79 -68
- package/dist/components/primitives/date-picker.js +137 -99
- package/dist/components/primitives/footer.js +36 -37
- package/dist/components/primitives/header.js +175 -168
- package/dist/components/primitives/image-carousel.js +107 -87
- package/dist/components/primitives/image-gallery.js +32 -27
- package/dist/components/primitives/image-uploader.js +6 -6
- package/dist/components/primitives/list-item.js +59 -51
- package/dist/components/primitives/menu-drawer.js +36 -38
- package/dist/components/primitives/multi-select.js +89 -58
- package/dist/components/primitives/notification-list.js +10 -9
- package/dist/components/primitives/number-input.js +116 -105
- package/dist/components/primitives/scroll-row.js +21 -0
- package/dist/components/primitives/search-bar.js +31 -28
- package/dist/components/primitives/section-header.js +54 -53
- package/dist/components/primitives/side-nav.js +57 -56
- package/dist/components/primitives/sub-nav.js +13 -14
- package/dist/components/primitives/tag.js +4 -2
- package/dist/index.css +1 -1
- package/dist/index.js +3051 -924
- package/dist/lib/field-labelling.js +31 -21
- package/dist/lib/focus-ring.js +22 -4
- package/dist/lib/high-contrast.js +4 -0
- package/dist/lib/image-index.js +8 -0
- package/dist/lib/use-prefers-reduced-motion.js +21 -0
- package/dist/types/components/ec/admin-shell.d.ts +11 -1
- package/dist/types/components/ec/anniversary-card.d.ts +9 -1
- package/dist/types/components/ec/mypage-shell.d.ts +12 -1
- package/dist/types/components/ec/product-card.d.ts +13 -1
- package/dist/types/components/ec/product-carousel.d.ts +13 -1
- package/dist/types/components/ec/product-detail-bar.d.ts +12 -1
- package/dist/types/components/ec/product-detail-sidebar.d.ts +11 -1
- package/dist/types/components/ec/product-list-item.d.ts +9 -1
- package/dist/types/components/ec/rating-stars.d.ts +2 -0
- package/dist/types/components/ec/review-card.d.ts +1 -1
- package/dist/types/components/ec/shop-card.d.ts +8 -1
- package/dist/types/components/foundations/badge.d.ts +1 -1
- package/dist/types/components/foundations/breadcrumb.d.ts +8 -1
- package/dist/types/components/foundations/button.d.ts +38 -3
- package/dist/types/components/foundations/checkbox-card.d.ts +7 -1
- package/dist/types/components/foundations/checkbox.d.ts +1 -1
- package/dist/types/components/foundations/chip-variants.d.ts +2 -2
- package/dist/types/components/foundations/confirm-dialog.d.ts +61 -0
- package/dist/types/components/foundations/data-table.d.ts +9 -2
- package/dist/types/components/foundations/dialog.d.ts +16 -1
- package/dist/types/components/foundations/pagination.d.ts +1 -1
- package/dist/types/components/foundations/responsive-dialog.d.ts +2 -1
- package/dist/types/components/foundations/sheet.d.ts +12 -1
- package/dist/types/components/foundations/skeleton.d.ts +6 -0
- package/dist/types/components/foundations/slider.d.ts +15 -1
- package/dist/types/components/foundations/tabs.d.ts +7 -0
- package/dist/types/components/primitives/admin-side-nav.d.ts +22 -2
- package/dist/types/components/primitives/banner-carousel.d.ts +9 -1
- package/dist/types/components/primitives/bottom-tab-bar.d.ts +13 -2
- package/dist/types/components/primitives/category-scroll.d.ts +10 -1
- package/dist/types/components/primitives/category-shortcuts.d.ts +11 -2
- package/dist/types/components/primitives/chip.d.ts +22 -3
- package/dist/types/components/primitives/combobox.d.ts +7 -2
- package/dist/types/components/primitives/container.d.ts +3 -0
- package/dist/types/components/primitives/content-card.d.ts +1 -1
- package/dist/types/components/primitives/content-carousel.d.ts +12 -4
- package/dist/types/components/primitives/date-picker.d.ts +10 -3
- package/dist/types/components/primitives/footer.d.ts +1 -1
- package/dist/types/components/primitives/header.d.ts +14 -2
- package/dist/types/components/primitives/image-carousel.d.ts +23 -5
- package/dist/types/components/primitives/list-item.d.ts +10 -1
- package/dist/types/components/primitives/menu-drawer.d.ts +1 -1
- package/dist/types/components/primitives/multi-select.d.ts +7 -2
- package/dist/types/components/primitives/notification-list.d.ts +10 -1
- package/dist/types/components/primitives/number-input.d.ts +18 -5
- package/dist/types/components/primitives/scroll-row.d.ts +43 -0
- package/dist/types/components/primitives/section-header.d.ts +9 -2
- package/dist/types/components/primitives/side-nav.d.ts +13 -1
- package/dist/types/components/primitives/sub-nav.d.ts +1 -1
- package/dist/types/components/primitives/tag.d.ts +1 -1
- package/dist/types/index.d.ts +7 -1
- package/dist/types/lib/field-labelling.d.ts +23 -8
- package/dist/types/lib/focus-ring.d.ts +70 -3
- package/dist/types/lib/high-contrast.d.ts +25 -0
- package/dist/types/lib/image-index.d.ts +2 -0
- package/dist/types/lib/link-component.d.ts +26 -21
- package/dist/types/lib/use-prefers-reduced-motion.d.ts +9 -0
- package/package.json +11 -3
- package/src/components/COMPONENT_LOOKUP.md +18 -16
- package/src/preset-standalone.css +42 -0
- package/src/preset.css +20 -1
- package/src/styles/semantic.css +57 -0
- package/templates/AGENTS.md +5 -1
- package/templates/CLAUDE.md +3 -1
- package/tokens.json +49 -0
- package/dist/lib/link-component.js +0 -6
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, jsx as a, Fragment as N } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { SectionHeader as
|
|
5
|
-
const
|
|
3
|
+
import { cn as l } from "../../lib/utils.js";
|
|
4
|
+
import { SectionHeader as y } from "./section-header.js";
|
|
5
|
+
const C = {
|
|
6
6
|
sm: "size-[60px]",
|
|
7
7
|
md: "size-[100px]",
|
|
8
8
|
lg: "size-[120px]"
|
|
9
|
-
},
|
|
9
|
+
}, b = {
|
|
10
10
|
sm: "max-w-[60px]",
|
|
11
11
|
md: "max-w-[100px]",
|
|
12
12
|
lg: "max-w-[120px]"
|
|
13
|
-
},
|
|
13
|
+
}, k = {
|
|
14
14
|
sm: "calc((100vw - 32px) / 4.05)",
|
|
15
15
|
md: "calc((100vw - 32px) / 3.5)",
|
|
16
16
|
lg: "calc((100vw - 32px) / 3.0)"
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
title:
|
|
20
|
-
moreHref:
|
|
21
|
-
headerSize:
|
|
18
|
+
function q({
|
|
19
|
+
title: d,
|
|
20
|
+
moreHref: x,
|
|
21
|
+
headerSize: n = "lg",
|
|
22
22
|
items: r,
|
|
23
23
|
thumbnailSize: c = "md",
|
|
24
|
-
thumbnailShape:
|
|
24
|
+
thumbnailShape: g = "square",
|
|
25
25
|
layout: h = "scroll",
|
|
26
|
-
gridRows:
|
|
26
|
+
gridRows: u = 3,
|
|
27
27
|
pcGridCols: o,
|
|
28
|
-
className:
|
|
28
|
+
className: f,
|
|
29
|
+
linkComponent: t
|
|
29
30
|
}) {
|
|
30
|
-
const
|
|
31
|
-
|
|
31
|
+
const w = t ?? "a", v = g === "circle" ? "rounded-full" : "rounded-lg", i = (e, p, m) => /* @__PURE__ */ s(
|
|
32
|
+
w,
|
|
32
33
|
{
|
|
33
34
|
href: e.href,
|
|
34
35
|
className: "flex flex-col items-center gap-1.5 group shrink-0",
|
|
@@ -36,10 +37,10 @@ function A({
|
|
|
36
37
|
/* @__PURE__ */ a(
|
|
37
38
|
"div",
|
|
38
39
|
{
|
|
39
|
-
className:
|
|
40
|
+
className: l(
|
|
40
41
|
"overflow-hidden shrink-0",
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
p ? "size-24" : m ? "w-full aspect-square" : C[c],
|
|
43
|
+
v
|
|
43
44
|
),
|
|
44
45
|
children: /* @__PURE__ */ a(
|
|
45
46
|
"img",
|
|
@@ -54,9 +55,9 @@ function A({
|
|
|
54
55
|
/* @__PURE__ */ a(
|
|
55
56
|
"span",
|
|
56
57
|
{
|
|
57
|
-
className:
|
|
58
|
+
className: l(
|
|
58
59
|
"typo-label-sm text-[var(--Text-High-Emphasis)] text-center",
|
|
59
|
-
|
|
60
|
+
p ? "max-w-[96px]" : m ? "w-full" : b[c]
|
|
60
61
|
),
|
|
61
62
|
children: e.name
|
|
62
63
|
}
|
|
@@ -65,23 +66,32 @@ function A({
|
|
|
65
66
|
},
|
|
66
67
|
e.href
|
|
67
68
|
);
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ s("section", { "data-slot": "category-scroll", className: l(
|
|
69
70
|
// w-full: CSS Grid 直下で mx-auto が justify-self: stretch を無効化し
|
|
70
71
|
// max-content 幅に縮むのを防ぐ(#207)。block 文脈の挙動は変わらない
|
|
71
72
|
"w-full py-4 @[960px]:max-w-[960px] @[960px]:mx-auto",
|
|
72
|
-
|
|
73
|
+
f
|
|
73
74
|
), children: [
|
|
74
|
-
/* @__PURE__ */ a(
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
/* @__PURE__ */ a(
|
|
76
|
+
y,
|
|
77
|
+
{
|
|
78
|
+
title: d,
|
|
79
|
+
moreHref: x,
|
|
80
|
+
size: n,
|
|
81
|
+
linkComponent: t,
|
|
82
|
+
className: "px-4"
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
h === "grid" ? /* @__PURE__ */ s(N, { children: [
|
|
86
|
+
/* @__PURE__ */ s("div", { className: l("mt-3 overflow-x-auto pl-4 pb-2 scrollbar-hide", o && "@[960px]:hidden"), children: [
|
|
77
87
|
/* @__PURE__ */ a(
|
|
78
88
|
"div",
|
|
79
89
|
{
|
|
80
90
|
className: "grid gap-2",
|
|
81
91
|
style: {
|
|
82
|
-
gridTemplateRows: `repeat(${
|
|
92
|
+
gridTemplateRows: `repeat(${u}, auto)`,
|
|
83
93
|
gridAutoFlow: "column",
|
|
84
|
-
gridAutoColumns:
|
|
94
|
+
gridAutoColumns: k[c]
|
|
85
95
|
},
|
|
86
96
|
children: r.map((e) => i(e, !1, !0))
|
|
87
97
|
}
|
|
@@ -98,7 +108,7 @@ function A({
|
|
|
98
108
|
)
|
|
99
109
|
] }) : (
|
|
100
110
|
/* デフォルト: 横スクロール1行 */
|
|
101
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ s("div", { className: "mt-3 flex gap-3 overflow-x-auto pl-4 pb-2 scrollbar-hide", children: [
|
|
102
112
|
r.map((e) => i(e)),
|
|
103
113
|
/* @__PURE__ */ a("div", { className: "shrink-0 w-4", "aria-hidden": "true" })
|
|
104
114
|
] })
|
|
@@ -106,5 +116,5 @@ function A({
|
|
|
106
116
|
] });
|
|
107
117
|
}
|
|
108
118
|
export {
|
|
109
|
-
|
|
119
|
+
q as CategoryScroll
|
|
110
120
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as a } from "../../lib/utils.js";
|
|
4
|
-
function
|
|
4
|
+
function g({ items: c, className: s, linkComponent: l }) {
|
|
5
5
|
return /* @__PURE__ */ o(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
8
|
"data-slot": "category-shortcuts",
|
|
9
9
|
className: a(
|
|
10
10
|
"flex gap-3 overflow-x-auto px-4 py-2 scrollbar-hide",
|
|
11
|
-
|
|
11
|
+
s
|
|
12
12
|
),
|
|
13
13
|
children: [
|
|
14
|
-
|
|
15
|
-
const
|
|
14
|
+
c.map((r, n) => {
|
|
15
|
+
const t = !!r.href || !!r.onClick, i = r.href ? l ?? "a" : "button", d = r.href ? { href: r.href, onClick: r.onClick } : { type: "button", onClick: r.onClick };
|
|
16
16
|
return /* @__PURE__ */ o(
|
|
17
|
-
|
|
17
|
+
i,
|
|
18
18
|
{
|
|
19
|
-
...
|
|
19
|
+
...d,
|
|
20
20
|
className: a(
|
|
21
21
|
"flex shrink-0 flex-col items-center gap-1 rounded-lg p-1 transition-colors",
|
|
22
|
-
|
|
22
|
+
t && "hover:bg-[var(--Surface-Secondary)]",
|
|
23
23
|
r.isSelected && "bg-[var(--Surface-Accent-Primary-Light)]"
|
|
24
24
|
),
|
|
25
25
|
children: [
|
|
@@ -53,7 +53,7 @@ function f({ items: s, className: c }) {
|
|
|
53
53
|
)
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
|
-
|
|
56
|
+
n
|
|
57
57
|
);
|
|
58
58
|
}),
|
|
59
59
|
/* @__PURE__ */ e("div", { className: "shrink-0 w-2", "aria-hidden": "true" })
|
|
@@ -62,5 +62,5 @@ function f({ items: s, className: c }) {
|
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
export {
|
|
65
|
-
|
|
65
|
+
g as CategoryShortcuts
|
|
66
66
|
};
|
|
@@ -1,109 +1,112 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as C, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import * as s from "react";
|
|
4
|
-
import { SendHorizontal as
|
|
5
|
-
import { cn as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
import { SendHorizontal as G } from "lucide-react";
|
|
5
|
+
import { cn as O } from "../../lib/utils.js";
|
|
6
|
+
import { FOCUS_RING_WITHIN as U } from "../../lib/focus-ring.js";
|
|
7
|
+
import { Button as W } from "../foundations/button.js";
|
|
8
|
+
import { FileInput as q } from "../foundations/file-input.js";
|
|
9
|
+
import { Textarea as J } from "../foundations/textarea.js";
|
|
10
|
+
import { Chip as M } from "./chip.js";
|
|
11
|
+
function re({
|
|
12
|
+
value: l,
|
|
13
|
+
onChange: N,
|
|
13
14
|
onSubmit: S,
|
|
14
|
-
submitKey:
|
|
15
|
+
submitKey: w = "enter",
|
|
15
16
|
attachments: d,
|
|
16
|
-
onAttachmentsChange:
|
|
17
|
-
accept:
|
|
18
|
-
maxFiles:
|
|
17
|
+
onAttachmentsChange: I,
|
|
18
|
+
accept: k,
|
|
19
|
+
maxFiles: a,
|
|
19
20
|
maxSizeMb: f,
|
|
20
21
|
onAttachmentError: u,
|
|
21
|
-
disabled:
|
|
22
|
-
isSubmitting:
|
|
23
|
-
placeholder:
|
|
24
|
-
maxLength:
|
|
25
|
-
label:
|
|
26
|
-
rows:
|
|
27
|
-
id:
|
|
28
|
-
autoFocus:
|
|
29
|
-
className:
|
|
22
|
+
disabled: i = !1,
|
|
23
|
+
isSubmitting: p = !1,
|
|
24
|
+
placeholder: z = "メッセージを入力",
|
|
25
|
+
maxLength: h,
|
|
26
|
+
label: K = "メッセージを入力",
|
|
27
|
+
rows: F = 2,
|
|
28
|
+
id: R,
|
|
29
|
+
autoFocus: E,
|
|
30
|
+
className: j
|
|
30
31
|
}) {
|
|
31
|
-
const
|
|
32
|
-
|
|
32
|
+
const B = s.useId(), b = R ?? B, g = d !== void 0, [D, H] = s.useState([]), t = g ? d : D, [_, L] = s.useState(0), c = s.useRef(!1), m = i || p, y = !m && (l.trim().length > 0 || t.length > 0), x = (e) => {
|
|
33
|
+
g || H(e), I?.(e);
|
|
33
34
|
}, v = () => {
|
|
34
|
-
|
|
35
|
-
},
|
|
35
|
+
y && S(l, t);
|
|
36
|
+
}, P = (e) => {
|
|
36
37
|
if (e.key !== "Enter" || c.current || e.nativeEvent.isComposing) return;
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
if (!
|
|
38
|
+
const o = e.metaKey || e.ctrlKey;
|
|
39
|
+
if (w === "mod-enter") {
|
|
40
|
+
if (!o) return;
|
|
40
41
|
} else if (e.shiftKey)
|
|
41
42
|
return;
|
|
42
43
|
e.preventDefault(), v();
|
|
43
44
|
}, T = (e) => {
|
|
44
|
-
if (
|
|
45
|
-
let
|
|
46
|
-
for (const
|
|
47
|
-
if (
|
|
48
|
-
u?.({ code: "max-files", file:
|
|
45
|
+
if (L((n) => n + 1), e.length === 0) return;
|
|
46
|
+
let o = t;
|
|
47
|
+
for (const n of e) {
|
|
48
|
+
if (a != null && o.length >= a) {
|
|
49
|
+
u?.({ code: "max-files", file: n, limit: a });
|
|
49
50
|
continue;
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
+
o = [...o, n];
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
54
|
+
o !== t && x(o);
|
|
55
|
+
}, $ = (e) => {
|
|
56
|
+
x(t.filter((o, n) => n !== e));
|
|
56
57
|
};
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ C(
|
|
58
59
|
"div",
|
|
59
60
|
{
|
|
60
61
|
"data-slot": "chat-composer",
|
|
61
|
-
"data-disabled":
|
|
62
|
-
className:
|
|
62
|
+
"data-disabled": i || void 0,
|
|
63
|
+
className: O(
|
|
63
64
|
"flex flex-col gap-2 rounded-xl border border-[var(--Border-High-Emphasis)] bg-[var(--Surface-Primary)] p-2 transition-[color,box-shadow,border-color]",
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
// フォーカス意匠は DS 共通(FOCUS_RING_WITHIN。以前は同じクラスを手で書いていた)。
|
|
66
|
+
// 枠はこのラッパーが描く(内側の Textarea はリングを消している)
|
|
67
|
+
U,
|
|
68
|
+
i && "border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Secondary)]",
|
|
69
|
+
j
|
|
67
70
|
),
|
|
68
71
|
children: [
|
|
69
|
-
t.length > 0 && /* @__PURE__ */
|
|
70
|
-
|
|
72
|
+
t.length > 0 && /* @__PURE__ */ r("ul", { "data-slot": "chat-composer-attachments", className: "flex flex-wrap gap-2", children: t.map((e, o) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
|
|
73
|
+
M,
|
|
71
74
|
{
|
|
72
75
|
size: "sm",
|
|
73
76
|
removable: !0,
|
|
74
77
|
disabled: m,
|
|
75
|
-
onRemove: () =>
|
|
78
|
+
onRemove: () => $(o),
|
|
76
79
|
children: e.name
|
|
77
80
|
}
|
|
78
|
-
) }, `${e.name}-${
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
81
|
+
) }, `${e.name}-${o}`)) }),
|
|
82
|
+
/* @__PURE__ */ r("label", { htmlFor: b, className: "sr-only", children: K }),
|
|
83
|
+
/* @__PURE__ */ r(
|
|
84
|
+
J,
|
|
82
85
|
{
|
|
83
|
-
id:
|
|
84
|
-
rows:
|
|
85
|
-
value:
|
|
86
|
-
maxLength:
|
|
87
|
-
showCount:
|
|
88
|
-
placeholder:
|
|
89
|
-
disabled:
|
|
90
|
-
autoFocus:
|
|
91
|
-
onChange: (e) =>
|
|
92
|
-
onKeyDown:
|
|
86
|
+
id: b,
|
|
87
|
+
rows: F,
|
|
88
|
+
value: l,
|
|
89
|
+
maxLength: h,
|
|
90
|
+
showCount: h != null,
|
|
91
|
+
placeholder: z,
|
|
92
|
+
disabled: i,
|
|
93
|
+
autoFocus: E,
|
|
94
|
+
onChange: (e) => N(e.target.value),
|
|
95
|
+
onKeyDown: P,
|
|
93
96
|
onCompositionStart: () => {
|
|
94
97
|
c.current = !0;
|
|
95
98
|
},
|
|
96
99
|
onCompositionEnd: () => {
|
|
97
100
|
c.current = !1;
|
|
98
101
|
},
|
|
99
|
-
className: "max-h-40 resize-none border-0 bg-transparent px-2 py-1.5 focus-visible:ring-0 disabled:bg-transparent"
|
|
102
|
+
className: "max-h-40 resize-none border-0 bg-transparent px-2 py-1.5 focus-visible:ring-0 forced-colors:focus-visible:outline-none disabled:bg-transparent"
|
|
100
103
|
}
|
|
101
104
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
105
|
+
/* @__PURE__ */ C("div", { className: "flex items-center justify-between gap-2", children: [
|
|
106
|
+
/* @__PURE__ */ r(
|
|
107
|
+
q,
|
|
105
108
|
{
|
|
106
|
-
accept:
|
|
109
|
+
accept: k,
|
|
107
110
|
multiple: !0,
|
|
108
111
|
disabled: m,
|
|
109
112
|
maxSize: f != null ? f * 1024 * 1024 : void 0,
|
|
@@ -118,18 +121,18 @@ function ee({
|
|
|
118
121
|
}),
|
|
119
122
|
className: "shrink-0"
|
|
120
123
|
},
|
|
121
|
-
|
|
124
|
+
_
|
|
122
125
|
),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
126
|
+
/* @__PURE__ */ r(
|
|
127
|
+
W,
|
|
125
128
|
{
|
|
126
129
|
type: "button",
|
|
127
130
|
size: "icon",
|
|
128
131
|
className: "shrink-0 rounded-full",
|
|
129
|
-
disabled: !
|
|
130
|
-
"aria-label":
|
|
132
|
+
disabled: !y,
|
|
133
|
+
"aria-label": p ? "送信中" : "送信",
|
|
131
134
|
onClick: v,
|
|
132
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ r(G, { className: "size-4", "aria-hidden": "true" })
|
|
133
136
|
}
|
|
134
137
|
)
|
|
135
138
|
] })
|
|
@@ -138,5 +141,5 @@ function ee({
|
|
|
138
141
|
);
|
|
139
142
|
}
|
|
140
143
|
export {
|
|
141
|
-
|
|
144
|
+
re as ChatComposer
|
|
142
145
|
};
|
|
@@ -1,123 +1,146 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, jsxs as s, Fragment as R } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { X as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { chipVariants as
|
|
6
|
-
|
|
3
|
+
import { X as _ } from "lucide-react";
|
|
4
|
+
import { cn as l } from "../../lib/utils.js";
|
|
5
|
+
import { chipVariants as v } from "../foundations/chip-variants.js";
|
|
6
|
+
const h = "forced-colors:data-[selected]:bg-[Highlight] forced-colors:data-[selected]:text-[HighlightText]", D = "forced-colors:has-[[data-slot=chip-trigger]:focus-visible]:outline-solid forced-colors:has-[[data-slot=chip-trigger]:focus-visible]:outline-2 forced-colors:has-[[data-slot=chip-trigger]:focus-visible]:outline-offset-2 forced-colors:has-[[data-slot=chip-trigger]:focus-visible]:outline-[Highlight]", F = /* @__PURE__ */ new Set([
|
|
7
|
+
"type",
|
|
8
|
+
"disabled",
|
|
9
|
+
"form",
|
|
10
|
+
"formAction",
|
|
11
|
+
"formEncType",
|
|
12
|
+
"formMethod",
|
|
13
|
+
"formNoValidate",
|
|
14
|
+
"formTarget",
|
|
15
|
+
"name",
|
|
16
|
+
"value"
|
|
17
|
+
]);
|
|
18
|
+
function y(o) {
|
|
19
|
+
return Object.fromEntries(Object.entries(o).filter(([n]) => !F.has(n)));
|
|
20
|
+
}
|
|
21
|
+
function V({
|
|
7
22
|
className: o,
|
|
8
|
-
variant:
|
|
9
|
-
size:
|
|
10
|
-
shape:
|
|
23
|
+
variant: n = "filled",
|
|
24
|
+
size: c,
|
|
25
|
+
shape: d,
|
|
11
26
|
href: r,
|
|
12
|
-
selected:
|
|
13
|
-
soldOut:
|
|
14
|
-
removable:
|
|
15
|
-
onRemove:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
selected: a = !1,
|
|
28
|
+
soldOut: T = !1,
|
|
29
|
+
removable: E = !1,
|
|
30
|
+
onRemove: S,
|
|
31
|
+
removeLabel: N = "削除",
|
|
32
|
+
count: b,
|
|
33
|
+
linkComponent: C,
|
|
34
|
+
children: f,
|
|
35
|
+
...t
|
|
19
36
|
}) {
|
|
20
|
-
const
|
|
37
|
+
const p = C ?? "a", u = a ? "selected" : n, e = T && !a, g = e ? "border border-[var(--Text-Disable)] bg-[var(--Surface-Secondary)] text-[var(--Text-Disable)]" : void 0, m = b !== void 0 && /* @__PURE__ */ i(
|
|
21
38
|
"span",
|
|
22
39
|
{
|
|
23
|
-
className:
|
|
40
|
+
className: l(
|
|
24
41
|
"inline-flex items-center justify-center rounded-full px-1.5 min-w-[1.25rem] typo-label-xs transition-colors",
|
|
25
|
-
|
|
42
|
+
a ? "bg-[var(--Surface-Primary)] text-[var(--Text-High-Emphasis)]" : "bg-[var(--Surface-Tertiary)] text-[var(--Text-Medium-Emphasis)]"
|
|
26
43
|
),
|
|
27
|
-
children:
|
|
44
|
+
children: b
|
|
28
45
|
}
|
|
29
|
-
),
|
|
30
|
-
if (
|
|
31
|
-
return /* @__PURE__ */
|
|
46
|
+
), x = e && /* @__PURE__ */ i("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "h-[67px] w-px origin-center rotate-45 bg-[var(--Text-Disable)]" }) });
|
|
47
|
+
if (E)
|
|
48
|
+
return /* @__PURE__ */ s(
|
|
32
49
|
"span",
|
|
33
50
|
{
|
|
34
51
|
"data-slot": "chip",
|
|
35
|
-
"data-selected":
|
|
36
|
-
className:
|
|
52
|
+
"data-selected": a || void 0,
|
|
53
|
+
className: l(
|
|
37
54
|
"group",
|
|
38
|
-
|
|
39
|
-
e ?
|
|
55
|
+
v({ variant: u, size: c, shape: d }),
|
|
56
|
+
e ? g : void 0,
|
|
40
57
|
e && "relative",
|
|
41
58
|
"has-[[data-slot=chip-trigger]:focus-visible]:ring-2 has-[[data-slot=chip-trigger]:focus-visible]:ring-[var(--Focus-High-Emphasis)]",
|
|
59
|
+
h,
|
|
60
|
+
D,
|
|
42
61
|
o
|
|
43
62
|
),
|
|
44
63
|
children: [
|
|
45
|
-
r ? /* @__PURE__ */
|
|
46
|
-
|
|
64
|
+
r ? /* @__PURE__ */ s(
|
|
65
|
+
p,
|
|
47
66
|
{
|
|
48
67
|
href: r,
|
|
49
68
|
"data-slot": "chip-trigger",
|
|
50
69
|
className: "inline-flex items-center gap-1.5 focus-visible:outline-none",
|
|
70
|
+
...y(t),
|
|
51
71
|
children: [
|
|
52
|
-
|
|
53
|
-
|
|
72
|
+
f,
|
|
73
|
+
m
|
|
54
74
|
]
|
|
55
75
|
}
|
|
56
|
-
) : /* @__PURE__ */
|
|
76
|
+
) : /* @__PURE__ */ s(
|
|
57
77
|
"button",
|
|
58
78
|
{
|
|
59
79
|
type: "button",
|
|
60
80
|
"data-slot": "chip-trigger",
|
|
61
|
-
disabled: e ||
|
|
81
|
+
disabled: e || t.disabled,
|
|
62
82
|
className: "inline-flex items-center gap-1.5 focus-visible:outline-none",
|
|
63
|
-
...
|
|
83
|
+
...t,
|
|
64
84
|
children: [
|
|
65
|
-
|
|
66
|
-
|
|
85
|
+
f,
|
|
86
|
+
m
|
|
67
87
|
]
|
|
68
88
|
}
|
|
69
89
|
),
|
|
70
|
-
|
|
71
|
-
/* @__PURE__ */
|
|
90
|
+
x,
|
|
91
|
+
/* @__PURE__ */ i(
|
|
72
92
|
"button",
|
|
73
93
|
{
|
|
74
94
|
type: "button",
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
95
|
+
"data-slot": "chip-remove",
|
|
96
|
+
"aria-label": N,
|
|
97
|
+
disabled: e || t.disabled,
|
|
98
|
+
onClick: (j) => {
|
|
99
|
+
j.stopPropagation(), S?.();
|
|
79
100
|
},
|
|
80
101
|
className: "-mr-1 ml-0.5 inline-flex size-6 shrink-0 items-center justify-center rounded-full hover:bg-[var(--Overlay-Light)] focus-visible:ring-2 focus-visible:ring-[var(--Focus-High-Emphasis)]",
|
|
81
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ i(_, { className: "size-3.5" })
|
|
82
103
|
}
|
|
83
104
|
)
|
|
84
105
|
]
|
|
85
106
|
}
|
|
86
107
|
);
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
108
|
+
const O = /* @__PURE__ */ s(R, { children: [
|
|
109
|
+
f,
|
|
110
|
+
m,
|
|
111
|
+
x
|
|
91
112
|
] });
|
|
92
|
-
return r ? /* @__PURE__ */
|
|
93
|
-
|
|
113
|
+
return r ? /* @__PURE__ */ i(
|
|
114
|
+
p,
|
|
94
115
|
{
|
|
95
116
|
href: r,
|
|
96
117
|
"data-slot": "chip",
|
|
97
|
-
"data-selected":
|
|
98
|
-
className:
|
|
99
|
-
|
|
118
|
+
"data-selected": a || void 0,
|
|
119
|
+
className: l("group", v({ variant: u, size: c, shape: d }), g, h, o),
|
|
120
|
+
...y(t),
|
|
121
|
+
children: O
|
|
100
122
|
}
|
|
101
|
-
) : /* @__PURE__ */
|
|
123
|
+
) : /* @__PURE__ */ i(
|
|
102
124
|
"button",
|
|
103
125
|
{
|
|
104
126
|
type: "button",
|
|
105
127
|
"data-slot": "chip",
|
|
106
|
-
"data-selected":
|
|
107
|
-
disabled: e ||
|
|
108
|
-
className:
|
|
128
|
+
"data-selected": a || void 0,
|
|
129
|
+
disabled: e || t.disabled,
|
|
130
|
+
className: l(
|
|
109
131
|
"group",
|
|
110
|
-
|
|
111
|
-
e ?
|
|
132
|
+
v({ variant: u, size: c, shape: d }),
|
|
133
|
+
e ? g : void 0,
|
|
112
134
|
e && "relative",
|
|
135
|
+
h,
|
|
113
136
|
o
|
|
114
137
|
),
|
|
115
|
-
...
|
|
116
|
-
children:
|
|
138
|
+
...t,
|
|
139
|
+
children: O
|
|
117
140
|
}
|
|
118
141
|
);
|
|
119
142
|
}
|
|
120
143
|
export {
|
|
121
|
-
|
|
122
|
-
|
|
144
|
+
V as Chip,
|
|
145
|
+
v as chipVariants
|
|
123
146
|
};
|