@cakejp/design-system 0.20.0 → 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 +179 -0
- package/CLAUDE.md +5 -3
- package/MIGRATION.md +3 -3
- package/README.md +31 -11
- package/contracts/components.json +424 -62
- 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 +88 -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 +43 -22
- 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 +3076 -929
- 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 +19 -17
- 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,32 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as l, jsx as e, Fragment as
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import { jsxs as l, jsx as e, Fragment as n } from "react/jsx-runtime";
|
|
3
|
+
import * as E from "react";
|
|
4
|
+
import T from "iconsax-reactjs/dist/esm/ArrowDown2.js";
|
|
5
|
+
import z from "iconsax-reactjs/dist/esm/ArrowRight2.js";
|
|
6
|
+
import j from "iconsax-reactjs/dist/esm/ArrowUp2.js";
|
|
7
|
+
import S from "iconsax-reactjs/dist/esm/Add.js";
|
|
8
8
|
import { X as M } from "lucide-react";
|
|
9
9
|
import { cn as A } from "../../lib/utils.js";
|
|
10
|
-
import { resolveLinkComponent as m } from "../../lib/link-component.js";
|
|
11
10
|
import { Button as x } from "../foundations/button.js";
|
|
12
11
|
const v = "flex min-h-12 items-center gap-1 mx-2 rounded-lg px-2 py-3 typo-body-md text-[var(--Text-High-Emphasis)] transition-colors duration-[var(--Motion-Duration-Base)] ease-[var(--Motion-Easing-Standard)] hover:bg-[var(--Surface-Secondary)] active:bg-[var(--Surface-Tertiary)]";
|
|
13
|
-
function
|
|
12
|
+
function U({
|
|
14
13
|
userName: r,
|
|
15
14
|
isLoggedIn: t = !1,
|
|
16
|
-
hideLoginLink:
|
|
15
|
+
hideLoginLink: o = !1,
|
|
17
16
|
sections: g,
|
|
18
|
-
banners:
|
|
19
|
-
onClose:
|
|
20
|
-
onLogin:
|
|
17
|
+
banners: c,
|
|
18
|
+
onClose: d,
|
|
19
|
+
onLogin: m,
|
|
21
20
|
loginHref: N = "/security/login_link/",
|
|
22
21
|
className: b,
|
|
23
|
-
linkComponent:
|
|
22
|
+
linkComponent: h,
|
|
24
23
|
...y
|
|
25
24
|
}) {
|
|
26
|
-
const
|
|
25
|
+
const p = h ?? "a", [f, w] = E.useState(
|
|
27
26
|
/* @__PURE__ */ new Set()
|
|
28
|
-
),
|
|
29
|
-
|
|
27
|
+
), k = (a) => {
|
|
28
|
+
w((i) => {
|
|
30
29
|
const s = new Set(i);
|
|
31
30
|
return s.has(a) ? s.delete(a) : s.add(a), s;
|
|
32
31
|
});
|
|
@@ -41,33 +40,33 @@ function _({
|
|
|
41
40
|
),
|
|
42
41
|
...y,
|
|
43
42
|
children: [
|
|
44
|
-
(t ||
|
|
43
|
+
(t || d) && /* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
45
44
|
t ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ l("p", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: [
|
|
46
45
|
r ?? "ゲスト",
|
|
47
46
|
"さま"
|
|
48
47
|
] }) }) : /* @__PURE__ */ e("div", {}),
|
|
49
|
-
|
|
48
|
+
d && /* @__PURE__ */ e(
|
|
50
49
|
x,
|
|
51
50
|
{
|
|
52
51
|
variant: "ghost",
|
|
53
52
|
size: "icon-sm",
|
|
54
|
-
onClick:
|
|
53
|
+
onClick: d,
|
|
55
54
|
"aria-label": "メニューを閉じる",
|
|
56
55
|
children: /* @__PURE__ */ e(M, { className: "size-5" })
|
|
57
56
|
}
|
|
58
57
|
)
|
|
59
58
|
] }),
|
|
60
|
-
!t && !
|
|
59
|
+
!t && !o && /* @__PURE__ */ l(n, { children: [
|
|
61
60
|
/* @__PURE__ */ e("div", { className: "py-2", children: /* @__PURE__ */ e("ul", { children: /* @__PURE__ */ e("li", { children: /* @__PURE__ */ l(
|
|
62
|
-
|
|
61
|
+
p,
|
|
63
62
|
{
|
|
64
63
|
href: N,
|
|
65
|
-
onClick:
|
|
66
|
-
a.preventDefault(),
|
|
64
|
+
onClick: m ? (a) => {
|
|
65
|
+
a.preventDefault(), m();
|
|
67
66
|
} : void 0,
|
|
68
67
|
className: v,
|
|
69
68
|
children: [
|
|
70
|
-
/* @__PURE__ */ e("span", { className: "flex size-5 shrink-0 items-center justify-center text-[var(--Text-Medium-Emphasis)]", children: /* @__PURE__ */ e(
|
|
69
|
+
/* @__PURE__ */ e("span", { className: "flex size-5 shrink-0 items-center justify-center text-[var(--Text-Medium-Emphasis)]", children: /* @__PURE__ */ e(S, { size: 16 }) }),
|
|
71
70
|
/* @__PURE__ */ e("span", { className: "flex-1", children: "ログイン・新規会員登録" })
|
|
72
71
|
]
|
|
73
72
|
}
|
|
@@ -82,29 +81,29 @@ function _({
|
|
|
82
81
|
a.icon && /* @__PURE__ */ e("span", { className: "flex size-5 shrink-0 items-center justify-center", children: a.icon }),
|
|
83
82
|
/* @__PURE__ */ e("span", { children: a.title })
|
|
84
83
|
] }) }),
|
|
85
|
-
/* @__PURE__ */ e("ul", { children: a.items.map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(u, { linkComponent:
|
|
86
|
-
a.itemsExtra && a.itemsExtra.length > 0 && /* @__PURE__ */ l(
|
|
87
|
-
f.has(i) && /* @__PURE__ */ e("ul", { children: a.itemsExtra.map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(u, { linkComponent:
|
|
84
|
+
/* @__PURE__ */ e("ul", { children: a.items.map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(u, { linkComponent: h, item: s }) }, s.label)) }),
|
|
85
|
+
a.itemsExtra && a.itemsExtra.length > 0 && /* @__PURE__ */ l(n, { children: [
|
|
86
|
+
f.has(i) && /* @__PURE__ */ e("ul", { children: a.itemsExtra.map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(u, { linkComponent: h, item: s }) }, s.label)) }),
|
|
88
87
|
/* @__PURE__ */ e(
|
|
89
88
|
x,
|
|
90
89
|
{
|
|
91
90
|
variant: "ghost",
|
|
92
91
|
className: "flex w-full items-center justify-center gap-1 rounded-none px-4 py-3 typo-label-md text-[var(--Text-Accent-Primary)]",
|
|
93
|
-
onClick: () =>
|
|
94
|
-
children: f.has(i) ? /* @__PURE__ */ l(
|
|
92
|
+
onClick: () => k(i),
|
|
93
|
+
children: f.has(i) ? /* @__PURE__ */ l(n, { children: [
|
|
95
94
|
/* @__PURE__ */ e("span", { children: "折りたたむ" }),
|
|
96
|
-
/* @__PURE__ */ e(B, { size: 16 })
|
|
97
|
-
] }) : /* @__PURE__ */ l(c, { children: [
|
|
98
|
-
/* @__PURE__ */ e("span", { children: "すべて表示" }),
|
|
99
95
|
/* @__PURE__ */ e(j, { size: 16 })
|
|
96
|
+
] }) : /* @__PURE__ */ l(n, { children: [
|
|
97
|
+
/* @__PURE__ */ e("span", { children: "すべて表示" }),
|
|
98
|
+
/* @__PURE__ */ e(T, { size: 16 })
|
|
100
99
|
] })
|
|
101
100
|
}
|
|
102
101
|
)
|
|
103
102
|
] })
|
|
104
103
|
] })
|
|
105
104
|
] }, i)),
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
c && c.length > 0 && /* @__PURE__ */ e("div", { className: "px-6 py-6", children: /* @__PURE__ */ e("ul", { className: "flex justify-center", children: c.map((a, i) => /* @__PURE__ */ e("li", { className: "w-1/2 max-w-28 px-2", children: /* @__PURE__ */ e(
|
|
106
|
+
p,
|
|
108
107
|
{
|
|
109
108
|
href: a.href ?? "#",
|
|
110
109
|
className: "block overflow-hidden rounded",
|
|
@@ -125,9 +124,8 @@ function _({
|
|
|
125
124
|
);
|
|
126
125
|
}
|
|
127
126
|
function u({ item: r, linkComponent: t }) {
|
|
128
|
-
const d = m(t);
|
|
129
127
|
return /* @__PURE__ */ l(
|
|
130
|
-
|
|
128
|
+
t ?? "a",
|
|
131
129
|
{
|
|
132
130
|
href: r.href ?? "#",
|
|
133
131
|
onClick: r.onClick,
|
|
@@ -148,11 +146,11 @@ function u({ item: r, linkComponent: t }) {
|
|
|
148
146
|
r.badge && /* @__PURE__ */ e("span", { className: "rounded-full bg-[var(--Brand-Cake-Orange)] px-2 py-0.5 typo-label-xs text-[var(--Text-on-Inverse)]", children: r.badge }),
|
|
149
147
|
r.subText && /* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: r.subText })
|
|
150
148
|
] }),
|
|
151
|
-
r.hasChildren && /* @__PURE__ */ e(
|
|
149
|
+
r.hasChildren && /* @__PURE__ */ e(z, { size: 16, className: "shrink-0 text-[var(--Object-High-Emphasis)]" })
|
|
152
150
|
]
|
|
153
151
|
}
|
|
154
152
|
);
|
|
155
153
|
}
|
|
156
154
|
export {
|
|
157
|
-
|
|
155
|
+
U as MenuDrawer
|
|
158
156
|
};
|
|
@@ -1,75 +1,103 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { ChevronsUpDown as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Command as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { useFieldLabelling as
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { ChevronsUpDown as I, Check as O } from "lucide-react";
|
|
5
|
+
import { cn as m } from "../../lib/utils.js";
|
|
6
|
+
import { Button as P } from "../foundations/button.js";
|
|
7
|
+
import { Command as k, CommandInput as B, CommandList as H, CommandEmpty as F, CommandGroup as G, CommandItem as L } from "../foundations/command.js";
|
|
8
|
+
import { Popover as M, PopoverTrigger as U, PopoverContent as _ } from "../foundations/popover.js";
|
|
9
|
+
import { useFieldLabelling as $, resolveFieldAria as q } from "../../lib/field-labelling.js";
|
|
10
|
+
import { HIGH_CONTRAST_OUTLINE as z } from "../../lib/high-contrast.js";
|
|
11
|
+
import { Chip as D } from "./chip.js";
|
|
12
|
+
function le({
|
|
13
|
+
options: u,
|
|
13
14
|
value: l = [],
|
|
14
|
-
onValueChange:
|
|
15
|
-
placeholder:
|
|
16
|
-
searchPlaceholder:
|
|
17
|
-
emptyLabel:
|
|
18
|
-
disabled:
|
|
19
|
-
className:
|
|
20
|
-
id:
|
|
21
|
-
"aria-invalid":
|
|
22
|
-
"aria-describedby":
|
|
23
|
-
"aria-label":
|
|
24
|
-
"aria-labelledby":
|
|
15
|
+
onValueChange: R,
|
|
16
|
+
placeholder: f = "選択してください",
|
|
17
|
+
searchPlaceholder: w = "検索",
|
|
18
|
+
emptyLabel: E = "候補がありません",
|
|
19
|
+
disabled: v,
|
|
20
|
+
className: T,
|
|
21
|
+
id: h,
|
|
22
|
+
"aria-invalid": p,
|
|
23
|
+
"aria-describedby": b,
|
|
24
|
+
"aria-label": s,
|
|
25
|
+
"aria-labelledby": c
|
|
25
26
|
}) {
|
|
26
|
-
const [
|
|
27
|
+
const [g, S] = t.useState(!1), n = u.filter((e) => l.includes(e.value)), x = $(), j = q(
|
|
27
28
|
{
|
|
28
|
-
id:
|
|
29
|
-
"aria-label":
|
|
30
|
-
"aria-labelledby":
|
|
31
|
-
"aria-describedby":
|
|
29
|
+
id: h,
|
|
30
|
+
"aria-label": s,
|
|
31
|
+
"aria-labelledby": c,
|
|
32
|
+
"aria-describedby": b,
|
|
33
|
+
// 渡さないと、利用側の明示指定が FormField 由来の値(error の有無)で上書きされる
|
|
34
|
+
"aria-invalid": p
|
|
32
35
|
},
|
|
33
|
-
|
|
34
|
-
),
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
x
|
|
37
|
+
), A = !x && !s && !c ? f : void 0, C = (e) => R?.(l.includes(e) ? l.filter((a) => a !== e) : [...l, e]), y = t.useRef(null), d = t.useRef(null), o = t.useRef(null);
|
|
38
|
+
return t.useEffect(() => {
|
|
39
|
+
const e = o.current;
|
|
40
|
+
if (!e) return;
|
|
41
|
+
const a = document.activeElement;
|
|
42
|
+
if (l.includes(e.value)) {
|
|
43
|
+
a?.isConnected && d.current?.contains(a) || (o.current = null);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (o.current = null, a && a !== document.body && a.isConnected) return;
|
|
47
|
+
const N = Array.from(
|
|
48
|
+
d.current?.querySelectorAll('[data-slot="chip-remove"]') ?? []
|
|
49
|
+
);
|
|
50
|
+
(N[e.index] ?? N[e.index - 1] ?? y.current)?.focus();
|
|
51
|
+
}, [l]), /* @__PURE__ */ i("div", { "data-slot": "multi-select", className: m("flex flex-col gap-2", T), children: [
|
|
52
|
+
/* @__PURE__ */ i(M, { open: g, onOpenChange: S, children: [
|
|
53
|
+
/* @__PURE__ */ r(U, { asChild: !0, children: /* @__PURE__ */ i(
|
|
54
|
+
P,
|
|
39
55
|
{
|
|
56
|
+
ref: y,
|
|
40
57
|
type: "button",
|
|
41
58
|
variant: "tertiary",
|
|
42
59
|
role: "combobox",
|
|
43
|
-
id:
|
|
44
|
-
"aria-expanded":
|
|
60
|
+
id: h,
|
|
61
|
+
"aria-expanded": g,
|
|
45
62
|
"aria-haspopup": "listbox",
|
|
46
|
-
"aria-invalid":
|
|
47
|
-
"aria-describedby":
|
|
48
|
-
"aria-label":
|
|
49
|
-
"aria-labelledby":
|
|
50
|
-
...
|
|
51
|
-
disabled:
|
|
52
|
-
className:
|
|
63
|
+
"aria-invalid": p,
|
|
64
|
+
"aria-describedby": b,
|
|
65
|
+
"aria-label": s ?? A,
|
|
66
|
+
"aria-labelledby": c,
|
|
67
|
+
...j,
|
|
68
|
+
disabled: v,
|
|
69
|
+
className: m(
|
|
70
|
+
"w-full justify-between bg-[var(--Surface-Primary)]",
|
|
71
|
+
// 高コントラスト(prefers-contrast: more / data-contrast="more")のときだけ見える内側 1px の輪郭(#301)
|
|
72
|
+
z,
|
|
73
|
+
// エラー時の赤枠。トリガーは Button tertiary(枠幅 0)なので border 色だけ変えても見えず、
|
|
74
|
+
// border を足すと 1px 広がる。内側リング(inset-ring)で描いて高さを変えない。
|
|
75
|
+
// inset-ring は ring(フォーカスリング)と別の box-shadow 層なので同時に表示される。
|
|
76
|
+
"aria-invalid:inset-ring-1 aria-invalid:inset-ring-[var(--Border-Caution)]",
|
|
77
|
+
// forced-colors(Windows ハイコントラスト)では box-shadow が消えるため、エラー時だけ輪郭線
|
|
78
|
+
// (outline。レイアウトに影響しない)で境界を出す。forced-colors 以外では効かない
|
|
79
|
+
"forced-colors:aria-invalid:outline-solid forced-colors:aria-invalid:outline-1 forced-colors:aria-invalid:-outline-offset-1 forced-colors:aria-invalid:outline-[CanvasText]"
|
|
80
|
+
),
|
|
53
81
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ r("span", { className: n.length ? "text-[var(--Text-High-Emphasis)]" : "text-[var(--Text-Low-Emphasis)]", children: n.length ? `${n.length}件選択中` : f }),
|
|
83
|
+
/* @__PURE__ */ r(I, { "aria-hidden": "true", className: "text-[var(--Object-Medium-Emphasis)]" })
|
|
56
84
|
]
|
|
57
85
|
}
|
|
58
86
|
) }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
87
|
+
/* @__PURE__ */ r(_, { align: "start", className: "w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ i(k, { children: [
|
|
88
|
+
/* @__PURE__ */ r(B, { placeholder: w }),
|
|
89
|
+
/* @__PURE__ */ i(H, { children: [
|
|
90
|
+
/* @__PURE__ */ r(F, { children: E }),
|
|
91
|
+
/* @__PURE__ */ r(G, { children: u.map((e) => /* @__PURE__ */ i(
|
|
92
|
+
L,
|
|
65
93
|
{
|
|
66
94
|
value: [e.label, ...e.keywords ?? []].join(" "),
|
|
67
95
|
disabled: e.disabled,
|
|
68
|
-
onSelect: () =>
|
|
96
|
+
onSelect: () => C(e.value),
|
|
69
97
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ r(O, { "aria-hidden": "true", className: m(l.includes(e.value) ? "opacity-100" : "opacity-0") }),
|
|
71
99
|
e.label,
|
|
72
|
-
l.includes(e.value) && /* @__PURE__ */
|
|
100
|
+
l.includes(e.value) && /* @__PURE__ */ r("span", { className: "sr-only", children: "選択済み" })
|
|
73
101
|
]
|
|
74
102
|
},
|
|
75
103
|
e.value
|
|
@@ -77,12 +105,15 @@ function W({
|
|
|
77
105
|
] })
|
|
78
106
|
] }) })
|
|
79
107
|
] }),
|
|
80
|
-
|
|
81
|
-
|
|
108
|
+
n.length > 0 && /* @__PURE__ */ r("div", { ref: d, className: "flex flex-wrap gap-1.5", role: "group", "aria-label": "選択済み", children: n.map((e, a) => /* @__PURE__ */ r(
|
|
109
|
+
D,
|
|
82
110
|
{
|
|
83
111
|
removable: !0,
|
|
84
|
-
|
|
85
|
-
|
|
112
|
+
removeLabel: `${e.label}を削除`,
|
|
113
|
+
onRemove: () => {
|
|
114
|
+
o.current = { value: e.value, index: a }, C(e.value);
|
|
115
|
+
},
|
|
116
|
+
disabled: v,
|
|
86
117
|
children: e.label
|
|
87
118
|
},
|
|
88
119
|
e.value
|
|
@@ -90,5 +121,5 @@ function W({
|
|
|
90
121
|
] });
|
|
91
122
|
}
|
|
92
123
|
export {
|
|
93
|
-
|
|
124
|
+
le as MultiSelect
|
|
94
125
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Badge as
|
|
3
|
+
import h from "iconsax-reactjs/dist/esm/Notification.js";
|
|
4
|
+
import m from "iconsax-reactjs/dist/esm/ArrowRight2.js";
|
|
5
|
+
import { Badge as p } from "../foundations/badge.js";
|
|
6
6
|
import { cn as l } from "../../lib/utils.js";
|
|
7
|
-
function
|
|
7
|
+
function u({
|
|
8
8
|
notifications: r,
|
|
9
9
|
variant: n = "vertical",
|
|
10
10
|
emptyMessage: c = "新着のお知らせはありません",
|
|
11
|
+
linkComponent: d,
|
|
11
12
|
className: i,
|
|
12
13
|
...t
|
|
13
14
|
}) {
|
|
@@ -21,7 +22,7 @@ function g({
|
|
|
21
22
|
),
|
|
22
23
|
...t,
|
|
23
24
|
children: [
|
|
24
|
-
/* @__PURE__ */ a(
|
|
25
|
+
/* @__PURE__ */ a(h, { size: 48, className: "text-[var(--Text-Low-Emphasis)]" }),
|
|
25
26
|
/* @__PURE__ */ a("p", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: c })
|
|
26
27
|
]
|
|
27
28
|
}
|
|
@@ -32,7 +33,7 @@ function g({
|
|
|
32
33
|
className: l("w-full divide-y divide-[var(--Border-Low-Emphasis)]", i),
|
|
33
34
|
...t,
|
|
34
35
|
children: r.map((e) => {
|
|
35
|
-
const o = e.href ? "a" : "div";
|
|
36
|
+
const o = e.href ? d ?? "a" : "div";
|
|
36
37
|
return n === "horizontal" ? /* @__PURE__ */ s(
|
|
37
38
|
o,
|
|
38
39
|
{
|
|
@@ -41,10 +42,10 @@ function g({
|
|
|
41
42
|
children: [
|
|
42
43
|
/* @__PURE__ */ a("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)] shrink-0 w-[88px]", children: e.date }),
|
|
43
44
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
44
|
-
e.isUnread && /* @__PURE__ */ a(
|
|
45
|
+
e.isUnread && /* @__PURE__ */ a(p, { variant: "destructive", className: "shrink-0 w-fit", children: "NEW" }),
|
|
45
46
|
/* @__PURE__ */ a("span", { className: "typo-body-md text-[var(--Text-High-Emphasis)] truncate", children: e.message })
|
|
46
47
|
] }),
|
|
47
|
-
/* @__PURE__ */ a(
|
|
48
|
+
/* @__PURE__ */ a(m, { size: 16, className: "text-[var(--Text-Low-Emphasis)] shrink-0 ml-auto" })
|
|
48
49
|
]
|
|
49
50
|
},
|
|
50
51
|
e.id
|
|
@@ -68,5 +69,5 @@ function g({
|
|
|
68
69
|
);
|
|
69
70
|
}
|
|
70
71
|
export {
|
|
71
|
-
|
|
72
|
+
u as NotificationList
|
|
72
73
|
};
|