@serendie/ui 3.5.1 → 3.6.0-dev.202607070300
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/dist/client.js +128 -124
- package/dist/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +84 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +268 -0
- package/dist/components/Breadcrumbs/index.d.ts +2 -0
- package/dist/components/Breadcrumbs/index.js +6 -0
- package/dist/components/DataTable/DataTable.sampleData.d.ts +12 -0
- package/dist/components/DataTable/DataTable.sampleData.test.d.ts +1 -0
- package/dist/components/DataTable/DataTableComponent.d.ts +1 -1
- package/dist/components/DataTable/DataTableComponent.js +30 -26
- package/dist/components/DataTable/table/BodyCheckbox.d.ts +1 -1
- package/dist/components/DataTable/table/HeaderCell.js +18 -16
- package/dist/components/DataTable/table/HeaderRow.js +21 -20
- package/dist/components/DataTable/table/Row.js +22 -14
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/List/ListItem.d.ts +42 -12
- package/dist/components/List/ListItem.js +122 -75
- package/dist/components/ProgressIndicator/AnimatedArc.d.ts +1 -0
- package/dist/components/ProgressIndicator/AnimatedArc.js +31 -34
- package/dist/components/ProgressIndicator/AnimatedArc.test.d.ts +1 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +2 -1
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +49 -36
- package/dist/components/ProgressIndicator/animatedArcProps.d.ts +11 -0
- package/dist/components/ProgressIndicator/animatedArcProps.js +19 -0
- package/dist/components/Tabs/TabItem.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/i18n/dictionary.d.ts +4 -0
- package/dist/i18n/dictionary.js +8 -4
- package/dist/i18n/provider.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +128 -124
- package/dist/node_modules/@zag-js/accordion/dist/accordion.connect.js +49 -50
- package/dist/node_modules/@zag-js/combobox/dist/combobox.connect.js +70 -68
- package/dist/node_modules/@zag-js/combobox/dist/combobox.machine.js +1 -1
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.connect.js +322 -308
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.machine.js +93 -79
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.utils.js +35 -43
- package/dist/node_modules/@zag-js/date-utils/dist/locale.js +12 -0
- package/dist/node_modules/@zag-js/dialog/dist/dialog.dom.js +36 -35
- package/dist/node_modules/@zag-js/dialog/dist/dialog.machine.js +27 -37
- package/dist/node_modules/@zag-js/dismissable/dist/dismissable-layer.js +56 -41
- package/dist/node_modules/@zag-js/dismissable/dist/layer-stack.js +51 -31
- package/dist/node_modules/@zag-js/dismissable/dist/pointer-event-outside.js +46 -25
- package/dist/node_modules/@zag-js/dom-query/dist/controller.js +5 -5
- package/dist/node_modules/@zag-js/dom-query/dist/overflow.js +13 -21
- package/dist/node_modules/@zag-js/dom-query/dist/scroll.js +11 -0
- package/dist/node_modules/@zag-js/live-region/dist/index.js +29 -19
- package/dist/node_modules/@zag-js/menu/dist/menu.connect.js +138 -135
- package/dist/node_modules/@zag-js/menu/dist/menu.dom.js +24 -24
- package/dist/node_modules/@zag-js/menu/dist/menu.machine.js +1 -1
- package/dist/node_modules/@zag-js/popper/dist/get-placement.js +82 -71
- package/dist/node_modules/@zag-js/react/dist/machine.js +105 -96
- package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +34 -26
- package/dist/node_modules/@zag-js/select/dist/select.connect.js +104 -101
- package/dist/node_modules/@zag-js/select/dist/select.machine.js +1 -1
- package/dist/node_modules/@zag-js/tabs/dist/tabs.machine.js +63 -60
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +27 -25
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +15 -14
- package/dist/styles.css +1 -1
- package/dist/theme/initColorScheme.d.ts +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,5 +2,5 @@ import { TableOptions } from '@tanstack/react-table';
|
|
|
2
2
|
export interface DataTableComponentProps<TData = Record<string, unknown>> extends Omit<TableOptions<TData>, "getCoreRowModel" | "getSortedRowModel"> {
|
|
3
3
|
className?: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function DataTableComponent<TData = Record<string, unknown>>({ className, enableRowSelection, onRowSelectionChange, onSortingChange, state, ...tableOptions }: DataTableComponentProps<TData>): import("react
|
|
5
|
+
export declare function DataTableComponent<TData = Record<string, unknown>>({ className, enableRowSelection, onRowSelectionChange, onSortingChange, state, ...tableOptions }: DataTableComponentProps<TData>): import("react").JSX.Element;
|
|
6
6
|
export default DataTableComponent;
|
|
@@ -1,53 +1,57 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useReactTable as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsxs as p, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useReactTable as M } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
|
+
import { useState as f } from "react";
|
|
4
4
|
import { DataTable as r } from "./index.js";
|
|
5
|
-
import { getSortedRowModel as
|
|
6
|
-
function
|
|
5
|
+
import { getSortedRowModel as T, getCoreRowModel as S } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
6
|
+
function g({
|
|
7
7
|
className: s,
|
|
8
|
-
enableRowSelection:
|
|
9
|
-
onRowSelectionChange:
|
|
10
|
-
onSortingChange:
|
|
8
|
+
enableRowSelection: t = !0,
|
|
9
|
+
onRowSelectionChange: d,
|
|
10
|
+
onSortingChange: i,
|
|
11
11
|
state: e,
|
|
12
|
-
...
|
|
12
|
+
...c
|
|
13
13
|
}) {
|
|
14
|
-
const [
|
|
15
|
-
getCoreRowModel:
|
|
16
|
-
getSortedRowModel:
|
|
17
|
-
enableRowSelection:
|
|
18
|
-
...
|
|
14
|
+
const [R, n] = f({}), [u, b] = f([]), m = M({
|
|
15
|
+
getCoreRowModel: S(),
|
|
16
|
+
getSortedRowModel: T(),
|
|
17
|
+
enableRowSelection: t,
|
|
18
|
+
...c,
|
|
19
|
+
defaultColumn: {
|
|
20
|
+
size: void 0,
|
|
21
|
+
...c.defaultColumn
|
|
22
|
+
},
|
|
19
23
|
state: {
|
|
20
|
-
rowSelection: (e == null ? void 0 : e.rowSelection) ??
|
|
21
|
-
sorting: (e == null ? void 0 : e.sorting) ??
|
|
24
|
+
rowSelection: (e == null ? void 0 : e.rowSelection) ?? R,
|
|
25
|
+
sorting: (e == null ? void 0 : e.sorting) ?? u,
|
|
22
26
|
...e
|
|
23
27
|
},
|
|
24
28
|
onRowSelectionChange: (o) => {
|
|
25
|
-
|
|
29
|
+
n(o), d == null || d(o);
|
|
26
30
|
},
|
|
27
31
|
onSortingChange: (o) => {
|
|
28
|
-
|
|
32
|
+
b(o), i == null || i(o);
|
|
29
33
|
}
|
|
30
|
-
}),
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */ l(r.Thead, { children:
|
|
34
|
+
}), w = t !== !1;
|
|
35
|
+
return /* @__PURE__ */ p(r.Root, { className: s, children: [
|
|
36
|
+
/* @__PURE__ */ l(r.Thead, { children: m.getHeaderGroups().map((o) => /* @__PURE__ */ l(
|
|
33
37
|
r.HeaderRow,
|
|
34
38
|
{
|
|
35
39
|
headerGroup: o,
|
|
36
|
-
enableRowSelection:
|
|
37
|
-
table:
|
|
40
|
+
enableRowSelection: w,
|
|
41
|
+
table: m
|
|
38
42
|
},
|
|
39
43
|
o.id
|
|
40
44
|
)) }),
|
|
41
|
-
/* @__PURE__ */ l(r.Tbody, { children:
|
|
45
|
+
/* @__PURE__ */ l(r.Tbody, { children: m.getRowModel().rows.map((o) => /* @__PURE__ */ l(
|
|
42
46
|
r.Row,
|
|
43
47
|
{
|
|
44
48
|
row: o,
|
|
45
|
-
enableRowSelection:
|
|
49
|
+
enableRowSelection: w
|
|
46
50
|
},
|
|
47
51
|
o.id
|
|
48
52
|
)) })
|
|
49
53
|
] });
|
|
50
54
|
}
|
|
51
55
|
export {
|
|
52
|
-
|
|
56
|
+
g as DataTableComponent
|
|
53
57
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ChoiceBoxProps } from '../../ChoiceBox';
|
|
2
2
|
export declare const BodyCheckbox: ({ checked, onChange, value, state, ...props }: {
|
|
3
3
|
state?: "enabled" | "hovered" | "selected";
|
|
4
|
-
} & Omit<ChoiceBoxProps, "type">) => import("react
|
|
4
|
+
} & Omit<ChoiceBoxProps, "type">) => import("react").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as l, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import y from "react";
|
|
3
3
|
import { SerendieSymbol as a } from "@serendie/symbols";
|
|
4
|
-
import { css as
|
|
5
|
-
import { cx as
|
|
6
|
-
import { cva as
|
|
7
|
-
const
|
|
4
|
+
import { css as u } from "../../../styled-system/css/css.js";
|
|
5
|
+
import { cx as g } from "../../../styled-system/css/cx.js";
|
|
6
|
+
import { cva as h } from "../../../styled-system/css/cva.js";
|
|
7
|
+
const x = h({
|
|
8
8
|
base: {
|
|
9
9
|
borderBottomWidth: "1px",
|
|
10
10
|
borderBottomStyle: "solid",
|
|
@@ -22,7 +22,7 @@ const h = g({
|
|
|
22
22
|
whiteSpace: "nowrap"
|
|
23
23
|
},
|
|
24
24
|
defaultVariants: {}
|
|
25
|
-
}),
|
|
25
|
+
}), B = y.forwardRef(
|
|
26
26
|
({
|
|
27
27
|
children: s,
|
|
28
28
|
size: r = "medium",
|
|
@@ -31,11 +31,12 @@ const h = g({
|
|
|
31
31
|
sortDirection: n,
|
|
32
32
|
onSort: o,
|
|
33
33
|
className: i,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
style: m,
|
|
35
|
+
...c
|
|
36
|
+
}, p) => /* @__PURE__ */ l(
|
|
36
37
|
"th",
|
|
37
38
|
{
|
|
38
|
-
ref:
|
|
39
|
+
ref: p,
|
|
39
40
|
role: "columnheader",
|
|
40
41
|
"aria-sort": n === "asc" ? "ascending" : n === "desc" ? "descending" : e ? "none" : void 0,
|
|
41
42
|
tabIndex: e ? 0 : void 0,
|
|
@@ -43,16 +44,17 @@ const h = g({
|
|
|
43
44
|
onKeyDown: (t) => {
|
|
44
45
|
e && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), o == null || o());
|
|
45
46
|
},
|
|
46
|
-
className:
|
|
47
|
+
className: g(x({ size: r, state: d }), i),
|
|
47
48
|
style: {
|
|
48
49
|
cursor: e ? "pointer" : "default",
|
|
49
|
-
userSelect: "none"
|
|
50
|
+
userSelect: "none",
|
|
51
|
+
...m
|
|
50
52
|
},
|
|
51
|
-
...
|
|
52
|
-
children: /* @__PURE__ */
|
|
53
|
+
...c,
|
|
54
|
+
children: /* @__PURE__ */ f(
|
|
53
55
|
"span",
|
|
54
56
|
{
|
|
55
|
-
className:
|
|
57
|
+
className: u({
|
|
56
58
|
display: "inline-flex",
|
|
57
59
|
alignItems: "center",
|
|
58
60
|
verticalAlign: "middle"
|
|
@@ -85,5 +87,5 @@ const h = g({
|
|
|
85
87
|
)
|
|
86
88
|
);
|
|
87
89
|
export {
|
|
88
|
-
|
|
90
|
+
B as HeaderCell
|
|
89
91
|
};
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { flexRender as
|
|
1
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import u from "react";
|
|
3
|
+
import { flexRender as f } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
4
|
import { DataTable as t } from "../index.js";
|
|
5
|
-
import { css as
|
|
6
|
-
const
|
|
7
|
-
headerGroup:
|
|
8
|
-
enableRowSelection:
|
|
5
|
+
import { css as w } from "../../../styled-system/css/css.js";
|
|
6
|
+
const R = ({
|
|
7
|
+
headerGroup: l,
|
|
8
|
+
enableRowSelection: m,
|
|
9
9
|
table: o,
|
|
10
|
-
children:
|
|
10
|
+
children: n,
|
|
11
11
|
className: c
|
|
12
|
-
}, s) =>
|
|
13
|
-
|
|
12
|
+
}, s) => n ? /* @__PURE__ */ r(t.Tr, { ref: s, className: c, children: n }) : !l || !o ? null : /* @__PURE__ */ g(t.Tr, { ref: s, className: c, children: [
|
|
13
|
+
m && /* @__PURE__ */ r(
|
|
14
14
|
t.HeaderCheckbox,
|
|
15
15
|
{
|
|
16
16
|
checked: o.getIsSomeRowsSelected() ? "indeterminate" : !!o.getIsAllRowsSelected(),
|
|
17
17
|
onChange: o.getToggleAllRowsSelectedHandler(),
|
|
18
18
|
value: "select-all",
|
|
19
|
-
className:
|
|
19
|
+
className: w({
|
|
20
20
|
verticalAlign: "middle"
|
|
21
21
|
})
|
|
22
22
|
}
|
|
23
23
|
),
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
return /* @__PURE__ */
|
|
24
|
+
l.headers.map((e) => {
|
|
25
|
+
const d = e.column.getCanSort(), a = e.column.getIsSorted();
|
|
26
|
+
return /* @__PURE__ */ r(
|
|
27
27
|
t.HeaderCell,
|
|
28
28
|
{
|
|
29
|
-
sortable:
|
|
29
|
+
sortable: d,
|
|
30
30
|
sortDirection: a,
|
|
31
31
|
onSort: () => e.column.toggleSorting(),
|
|
32
|
-
|
|
32
|
+
style: e.column.columnDef.size != null ? { width: e.getSize() } : void 0,
|
|
33
|
+
children: f(e.column.columnDef.header, e.getContext())
|
|
33
34
|
},
|
|
34
35
|
e.id
|
|
35
36
|
);
|
|
36
37
|
})
|
|
37
|
-
] },
|
|
38
|
-
|
|
39
|
-
const
|
|
38
|
+
] }, l.id), i = u.forwardRef(R);
|
|
39
|
+
i.displayName = "HeaderRow";
|
|
40
|
+
const D = i;
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
D as HeaderRow
|
|
42
43
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
3
|
import { flexRender as y } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
4
|
import { DataTable as o } from "../index.js";
|
|
5
|
-
import { cx as
|
|
5
|
+
import { cx as m } from "../../../styled-system/css/cx.js";
|
|
6
6
|
import { cva as g } from "../../../styled-system/css/cva.js";
|
|
7
|
-
const
|
|
7
|
+
const l = g({
|
|
8
8
|
base: {
|
|
9
9
|
_hover: {
|
|
10
10
|
_after: {
|
|
@@ -58,18 +58,18 @@ const m = g({
|
|
|
58
58
|
o.Tr,
|
|
59
59
|
{
|
|
60
60
|
ref: i,
|
|
61
|
-
className:
|
|
62
|
-
|
|
61
|
+
className: m(
|
|
62
|
+
l({ state: d ? "selected" : void 0 }),
|
|
63
63
|
s
|
|
64
64
|
),
|
|
65
65
|
children: r
|
|
66
66
|
}
|
|
67
|
-
) : e ? /* @__PURE__ */
|
|
67
|
+
) : e ? /* @__PURE__ */ p(
|
|
68
68
|
o.Tr,
|
|
69
69
|
{
|
|
70
70
|
ref: i,
|
|
71
|
-
className:
|
|
72
|
-
|
|
71
|
+
className: m(
|
|
72
|
+
l({
|
|
73
73
|
state: e.getIsSelected() ? "selected" : void 0
|
|
74
74
|
}),
|
|
75
75
|
s
|
|
@@ -84,17 +84,25 @@ const m = g({
|
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
86
|
e.getVisibleCells().map((t) => {
|
|
87
|
-
const
|
|
88
|
-
return /* @__PURE__ */ n(
|
|
87
|
+
const u = x(t);
|
|
88
|
+
return /* @__PURE__ */ n(
|
|
89
|
+
o.BodyCell,
|
|
90
|
+
{
|
|
91
|
+
type: u,
|
|
92
|
+
style: t.column.columnDef.size != null ? { width: t.column.getSize() } : void 0,
|
|
93
|
+
children: y(t.column.columnDef.cell, t.getContext())
|
|
94
|
+
},
|
|
95
|
+
t.id
|
|
96
|
+
);
|
|
89
97
|
})
|
|
90
98
|
]
|
|
91
99
|
}
|
|
92
|
-
) : null, a =
|
|
100
|
+
) : null, a = f.forwardRef(v);
|
|
93
101
|
a.displayName = "Row";
|
|
94
|
-
const
|
|
102
|
+
const R = a;
|
|
95
103
|
function x(e) {
|
|
96
104
|
return e.column.columnDef.meta && "getType" in e.column.columnDef.meta && typeof e.column.columnDef.meta.getType == "function" ? e.column.columnDef.meta.getType(e.row.original) : "default";
|
|
97
105
|
}
|
|
98
106
|
export {
|
|
99
|
-
|
|
107
|
+
R as Row
|
|
100
108
|
};
|
|
@@ -29,5 +29,5 @@ export declare const DividerStyle: import('../../../styled-system/types').Recipe
|
|
|
29
29
|
};
|
|
30
30
|
}>;
|
|
31
31
|
type DividerProps = ComponentProps<"hr"> & RecipeVariantProps<typeof DividerStyle>;
|
|
32
|
-
export declare const Divider: (props: DividerProps) => import("react
|
|
32
|
+
export declare const Divider: (props: DividerProps) => import("react").JSX.Element;
|
|
33
33
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
export declare const List: ({ children, ...props }: ComponentProps<"ul">) => import("react
|
|
2
|
+
export declare const List: ({ children, ...props }: ComponentProps<"ul">) => import("react").JSX.Element;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
export declare const ListItemStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"title" | "description" | "root" | "badge" | "
|
|
3
|
-
|
|
1
|
+
import { default as React, ComponentProps } from 'react';
|
|
2
|
+
export declare const ListItemStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"title" | "description" | "root" | "badge" | "wrapper" | "textGroup" | "subDescription" | "trailingElement" | "headingElement", {
|
|
3
|
+
isLargeHeadingElement: {
|
|
4
4
|
true: {
|
|
5
|
-
|
|
5
|
+
headingElement: {
|
|
6
|
+
"& svg": {
|
|
7
|
+
width: "40px";
|
|
8
|
+
height: "40px";
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
false: {};
|
|
13
|
+
};
|
|
14
|
+
isLargeTrailingElement: {
|
|
15
|
+
true: {
|
|
16
|
+
trailingElement: {
|
|
6
17
|
"& svg": {
|
|
7
18
|
width: "40px";
|
|
8
19
|
height: "40px";
|
|
@@ -22,25 +33,44 @@ export declare const ListItemStyle: import('../../../styled-system/types').SlotR
|
|
|
22
33
|
type ListItemBaseProps = {
|
|
23
34
|
title: string;
|
|
24
35
|
description?: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
subDescription?: string;
|
|
37
|
+
trailingElement?: React.ReactElement;
|
|
38
|
+
headingElement?: React.ReactElement;
|
|
39
|
+
isLargeHeadingElement?: boolean;
|
|
40
|
+
isLargeTrailingElement?: boolean;
|
|
28
41
|
badge?: number;
|
|
29
42
|
children?: React.ReactNode;
|
|
30
43
|
disabled?: boolean;
|
|
31
44
|
selected?: boolean;
|
|
32
45
|
focusVisible?: boolean;
|
|
33
46
|
size?: "small";
|
|
47
|
+
/** @deprecated `leftIcon` は廃止予定です。`headingElement` を使ってください */
|
|
48
|
+
leftIcon?: React.ReactElement;
|
|
49
|
+
/** @deprecated `rightIcon` は廃止予定です。`trailingElement` を使ってください */
|
|
50
|
+
rightIcon?: React.ReactElement;
|
|
51
|
+
/** @deprecated `isLargeLeftIcon` は廃止予定です。`isLargeHeadingElement` を使ってください */
|
|
52
|
+
isLargeLeftIcon?: boolean;
|
|
53
|
+
/** @deprecated `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください */
|
|
54
|
+
isLargeRightIcon?: boolean;
|
|
34
55
|
};
|
|
35
|
-
type
|
|
56
|
+
type ExclusiveTrailingItemProps = ({
|
|
36
57
|
badge?: number;
|
|
37
58
|
} & {
|
|
59
|
+
trailingElement?: never;
|
|
60
|
+
isLargeTrailingElement?: never;
|
|
61
|
+
/** @deprecated `rightIcon` は廃止予定です。`trailingElement` を使ってください */
|
|
38
62
|
rightIcon?: never;
|
|
39
|
-
|
|
63
|
+
/** @deprecated `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください */
|
|
64
|
+
isLargeRightIcon?: never;
|
|
65
|
+
}) | {
|
|
40
66
|
badge?: never;
|
|
41
|
-
|
|
67
|
+
trailingElement?: React.ReactElement;
|
|
68
|
+
isLargeTrailingElement?: boolean;
|
|
69
|
+
/** @deprecated `rightIcon` は廃止予定です。`trailingElement` を使ってください */
|
|
42
70
|
rightIcon?: React.ReactElement;
|
|
43
|
-
|
|
44
|
-
|
|
71
|
+
/** @deprecated `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください */
|
|
72
|
+
isLargeRightIcon?: boolean;
|
|
73
|
+
};
|
|
74
|
+
type ListItemProps = ComponentProps<"li"> & ListItemBaseProps & ExclusiveTrailingItemProps;
|
|
45
75
|
export declare const ListItem: React.FC<ListItemProps>;
|
|
46
76
|
export {};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as D, useEffect as G } from "react";
|
|
3
|
+
import { NotificationBadge as O } from "../NotificationBadge/NotificationBadge.js";
|
|
4
|
+
import { cx as i } from "../../styled-system/css/cx.js";
|
|
5
|
+
import { css as g } from "../../styled-system/css/css.js";
|
|
6
|
+
import { sva as P } from "../../styled-system/css/sva.js";
|
|
7
|
+
const E = P({
|
|
7
8
|
slots: [
|
|
8
9
|
"root",
|
|
9
10
|
"wrapper",
|
|
10
11
|
"textGroup",
|
|
11
12
|
"title",
|
|
12
13
|
"description",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
14
|
+
"subDescription",
|
|
15
|
+
"trailingElement",
|
|
16
|
+
"headingElement",
|
|
15
17
|
"badge"
|
|
16
18
|
],
|
|
17
19
|
base: {
|
|
@@ -64,8 +66,6 @@ const p = v({
|
|
|
64
66
|
}
|
|
65
67
|
},
|
|
66
68
|
description: {
|
|
67
|
-
display: "flex",
|
|
68
|
-
flexDirection: "column",
|
|
69
69
|
textStyle: "sd.system.typography.body.extraSmall_compact",
|
|
70
70
|
color: "sd.system.color.component.onSurfaceVariant",
|
|
71
71
|
_expanded: {
|
|
@@ -75,7 +75,17 @@ const p = v({
|
|
|
75
75
|
opacity: 0.3
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
|
|
78
|
+
subDescription: {
|
|
79
|
+
textStyle: "sd.system.typography.body.extraSmall_compact",
|
|
80
|
+
color: "sd.system.color.component.onSurfaceVariant",
|
|
81
|
+
_expanded: {
|
|
82
|
+
textStyle: "sd.system.typography.body.extraSmall_expanded"
|
|
83
|
+
},
|
|
84
|
+
_disabled: {
|
|
85
|
+
opacity: 0.3
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
headingElement: {
|
|
79
89
|
flexShrink: 0,
|
|
80
90
|
"& svg": {
|
|
81
91
|
display: "block",
|
|
@@ -88,7 +98,7 @@ const p = v({
|
|
|
88
98
|
opacity: 0.3
|
|
89
99
|
}
|
|
90
100
|
},
|
|
91
|
-
|
|
101
|
+
trailingElement: {
|
|
92
102
|
flexShrink: 0,
|
|
93
103
|
"& svg": {
|
|
94
104
|
width: "24px",
|
|
@@ -99,17 +109,24 @@ const p = v({
|
|
|
99
109
|
}
|
|
100
110
|
},
|
|
101
111
|
badge: {
|
|
102
|
-
|
|
103
|
-
right: "sd.system.dimension.spacing.medium",
|
|
104
|
-
top: "sd.system.dimension.spacing.extraSmall",
|
|
105
|
-
height: 24,
|
|
106
|
-
minW: 24
|
|
112
|
+
flexShrink: 0
|
|
107
113
|
}
|
|
108
114
|
},
|
|
109
115
|
variants: {
|
|
110
|
-
|
|
116
|
+
isLargeHeadingElement: {
|
|
117
|
+
true: {
|
|
118
|
+
headingElement: {
|
|
119
|
+
"& svg": {
|
|
120
|
+
width: "40px",
|
|
121
|
+
height: "40px"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
false: {}
|
|
126
|
+
},
|
|
127
|
+
isLargeTrailingElement: {
|
|
111
128
|
true: {
|
|
112
|
-
|
|
129
|
+
trailingElement: {
|
|
113
130
|
"& svg": {
|
|
114
131
|
width: "40px",
|
|
115
132
|
height: "40px"
|
|
@@ -126,65 +143,95 @@ const p = v({
|
|
|
126
143
|
}
|
|
127
144
|
}
|
|
128
145
|
}
|
|
129
|
-
}),
|
|
130
|
-
|
|
146
|
+
}), Y = ({
|
|
147
|
+
headingElement: v,
|
|
148
|
+
trailingElement: b,
|
|
149
|
+
title: w,
|
|
150
|
+
description: s,
|
|
151
|
+
subDescription: a,
|
|
152
|
+
badge: n,
|
|
153
|
+
children: S,
|
|
154
|
+
disabled: _,
|
|
155
|
+
selected: L,
|
|
156
|
+
focusVisible: N,
|
|
157
|
+
className: H,
|
|
158
|
+
leftIcon: l,
|
|
131
159
|
rightIcon: r,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
children: d,
|
|
136
|
-
disabled: x,
|
|
137
|
-
selected: y,
|
|
138
|
-
focusVisible: g,
|
|
139
|
-
className: h,
|
|
140
|
-
...n
|
|
160
|
+
isLargeLeftIcon: o,
|
|
161
|
+
isLargeRightIcon: d,
|
|
162
|
+
...m
|
|
141
163
|
}) => {
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
"
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
164
|
+
const y = D(!1);
|
|
165
|
+
G(() => {
|
|
166
|
+
y.current || process.env.NODE_ENV !== "production" && (l || r || o || d) && (y.current = !0, l && console.warn(
|
|
167
|
+
"[ListItem] `leftIcon` は廃止予定です。`headingElement` を使ってください。"
|
|
168
|
+
), r && console.warn(
|
|
169
|
+
"[ListItem] `rightIcon` は廃止予定です。`trailingElement` を使ってください。"
|
|
170
|
+
), o && console.warn(
|
|
171
|
+
"[ListItem] `isLargeLeftIcon` は廃止予定です。`isLargeHeadingElement` を使ってください。"
|
|
172
|
+
), d && console.warn(
|
|
173
|
+
"[ListItem] `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください。"
|
|
174
|
+
));
|
|
175
|
+
}, []);
|
|
176
|
+
const x = v ?? l, h = b ?? r, c = m.isLargeHeadingElement ?? o, u = m.isLargeTrailingElement ?? d, [T, k] = E.splitVariantProps(m), e = E({
|
|
177
|
+
...T,
|
|
178
|
+
isLargeHeadingElement: c,
|
|
179
|
+
isLargeTrailingElement: u
|
|
180
|
+
}), p = (!!s || !!a) && !(!!c && !!s && !a), I = i(
|
|
181
|
+
e.wrapper,
|
|
182
|
+
p && g({ alignItems: "flex-start" })
|
|
183
|
+
), V = i(
|
|
184
|
+
e.headingElement,
|
|
185
|
+
p && g({ marginTop: "sd.system.dimension.spacing.twoExtraSmall" })
|
|
186
|
+
), C = i(
|
|
187
|
+
e.trailingElement,
|
|
188
|
+
p && g({ marginTop: "sd.system.dimension.spacing.twoExtraSmall" })
|
|
189
|
+
);
|
|
190
|
+
return /* @__PURE__ */ t("li", { className: i(e.root, H), ...k, children: /* @__PURE__ */ f(
|
|
191
|
+
"div",
|
|
192
|
+
{
|
|
193
|
+
tabIndex: 1,
|
|
194
|
+
className: I,
|
|
195
|
+
"data-disabled": _ ? !0 : void 0,
|
|
196
|
+
"data-selected": L ? !0 : void 0,
|
|
197
|
+
"data-focus-visible": N ? !0 : void 0,
|
|
198
|
+
children: [
|
|
199
|
+
x && /* @__PURE__ */ t(
|
|
200
|
+
"div",
|
|
201
|
+
{
|
|
202
|
+
className: V,
|
|
203
|
+
style: c ? { padding: "0", width: "40px", height: "40px" } : { padding: "0", width: "24px", height: "24px" },
|
|
204
|
+
children: x
|
|
205
|
+
}
|
|
151
206
|
),
|
|
152
|
-
"
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
),
|
|
180
|
-
r && /* @__PURE__ */ t("div", { className: e.rightIcon, children: r })
|
|
181
|
-
]
|
|
182
|
-
}
|
|
183
|
-
),
|
|
184
|
-
l && /* @__PURE__ */ t("div", { className: e.badge, children: /* @__PURE__ */ t(b, { count: l, variant: "secondary" }) })
|
|
185
|
-
] });
|
|
207
|
+
/* @__PURE__ */ f("div", { className: e.textGroup, children: [
|
|
208
|
+
/* @__PURE__ */ t("span", { className: e.title, children: w }),
|
|
209
|
+
s && /* @__PURE__ */ t("span", { className: e.description, children: s }),
|
|
210
|
+
a && /* @__PURE__ */ t("span", { className: e.subDescription, children: a }),
|
|
211
|
+
S
|
|
212
|
+
] }),
|
|
213
|
+
h && /* @__PURE__ */ t(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
className: C,
|
|
217
|
+
style: u ? { width: "40px", height: "40px" } : { width: "24px", height: "24px" },
|
|
218
|
+
children: h
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
n != null && n > 0 && /* @__PURE__ */ t("div", { className: e.badge, children: /* @__PURE__ */ t(
|
|
222
|
+
O,
|
|
223
|
+
{
|
|
224
|
+
count: n,
|
|
225
|
+
variant: "secondary",
|
|
226
|
+
size: "small",
|
|
227
|
+
position: "relative"
|
|
228
|
+
}
|
|
229
|
+
) })
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
) });
|
|
186
233
|
};
|
|
187
234
|
export {
|
|
188
|
-
|
|
189
|
-
|
|
235
|
+
Y as ListItem,
|
|
236
|
+
E as ListItemStyle
|
|
190
237
|
};
|