@serendie/ui 1.0.0 → 2.0.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/dist/assets/checkboxIndeterminate.svg.js +5 -0
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Chart/SerendieChartProps.d.ts +40 -0
- package/dist/components/Chart/SerendieChartProps.js +127 -0
- package/dist/components/Chart/SerendieChartTheme.d.ts +2 -0
- package/dist/components/Chart/SerendieChartTheme.js +150 -0
- package/dist/components/Chart/chartData.d.ts +29 -0
- package/dist/components/Chart/index.d.ts +3 -0
- package/dist/components/Chart/index.js +15 -0
- package/dist/components/ChoiceBox/ChoiceBox.js +47 -41
- package/dist/components/DataTable/DataTableComponent.d.ts +23 -0
- package/dist/components/DataTable/DataTableComponent.js +52 -0
- package/dist/components/DataTable/createColumnHelper.d.ts +2 -0
- package/dist/components/DataTable/createColumnHelper.js +5 -0
- package/dist/components/DataTable/index.d.ts +19 -0
- package/dist/components/DataTable/index.js +28 -0
- package/dist/components/DataTable/table/BodyCell.d.ts +55 -0
- package/dist/components/DataTable/table/BodyCell.js +127 -0
- package/dist/components/DataTable/table/BodyCheckbox.d.ts +4 -0
- package/dist/components/DataTable/table/BodyCheckbox.js +22 -0
- package/dist/components/DataTable/table/HeaderCell.d.ts +8 -0
- package/dist/components/DataTable/table/HeaderCell.js +79 -0
- package/dist/components/DataTable/table/HeaderCheckbox.d.ts +2 -0
- package/dist/components/DataTable/table/HeaderCheckbox.js +26 -0
- package/dist/components/DataTable/table/HeaderRow.d.ts +11 -0
- package/dist/components/DataTable/table/HeaderRow.js +40 -0
- package/dist/components/DataTable/table/Root.d.ts +5 -0
- package/dist/components/DataTable/table/Root.js +34 -0
- package/dist/components/DataTable/table/Row.d.ts +5 -0
- package/dist/components/DataTable/table/Row.js +90 -0
- package/dist/components/DataTable/table/Tbody.d.ts +1 -0
- package/dist/components/DataTable/table/Tbody.js +7 -0
- package/dist/components/DataTable/table/Thead.d.ts +1 -0
- package/dist/components/DataTable/table/Thead.js +7 -0
- package/dist/components/DataTable/table/Tr.d.ts +1 -0
- package/dist/components/DataTable/table/Tr.js +27 -0
- package/dist/components/DataTable/table/index.d.ts +10 -0
- package/dist/components/DataTable/table/index.js +22 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/RadioButton/RadioButton.d.ts +1 -1
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Tabs/TabItem.d.ts +1 -1
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +109 -92
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +100 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1741 -0
- package/dist/styled-system/tokens/index.js +4758 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/getToken.js +4 -4
- package/dist/utils/colors.d.ts +1 -0
- package/dist/utils/colors.js +12 -0
- package/package.json +8 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createColumnHelper as r } from "./createColumnHelper.js";
|
|
2
|
+
import { DataTableComponent as e } from "./DataTableComponent.js";
|
|
3
|
+
import { Root as m } from "./table/Root.js";
|
|
4
|
+
import { Thead as t } from "./table/Thead.js";
|
|
5
|
+
import { Tr as a } from "./table/Tr.js";
|
|
6
|
+
import { Row as p } from "./table/Row.js";
|
|
7
|
+
import { HeaderRow as d } from "./table/HeaderRow.js";
|
|
8
|
+
import { BodyCell as l } from "./table/BodyCell.js";
|
|
9
|
+
import { HeaderCheckbox as f } from "./table/HeaderCheckbox.js";
|
|
10
|
+
import { BodyCheckbox as i } from "./table/BodyCheckbox.js";
|
|
11
|
+
import { Tbody as C } from "./table/Tbody.js";
|
|
12
|
+
import { HeaderCell as b } from "./table/HeaderCell.js";
|
|
13
|
+
const o = e;
|
|
14
|
+
o.BodyCell = l;
|
|
15
|
+
o.BodyCheckbox = i;
|
|
16
|
+
o.Tbody = C;
|
|
17
|
+
o.HeaderCell = b;
|
|
18
|
+
o.HeaderCheckbox = f;
|
|
19
|
+
o.HeaderRow = d;
|
|
20
|
+
o.Root = m;
|
|
21
|
+
o.Row = p;
|
|
22
|
+
o.Thead = t;
|
|
23
|
+
o.Tr = a;
|
|
24
|
+
o.createColumnHelper = r;
|
|
25
|
+
export {
|
|
26
|
+
o as DataTable,
|
|
27
|
+
e as DataTableComponent
|
|
28
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { RecipeVariantProps } from '../../../../styled-system/css';
|
|
2
|
+
declare const cellStyle: import('../../../../styled-system/types').RecipeRuntimeFn<{
|
|
3
|
+
type: {
|
|
4
|
+
default: {
|
|
5
|
+
background: "sd.system.color.component.surface";
|
|
6
|
+
};
|
|
7
|
+
success: {
|
|
8
|
+
background: "sd.system.color.impression.positiveContainerVariant";
|
|
9
|
+
};
|
|
10
|
+
notice: {
|
|
11
|
+
background: "sd.system.color.impression.noticeContainerVariant";
|
|
12
|
+
};
|
|
13
|
+
error: {
|
|
14
|
+
background: "sd.system.color.impression.negativeContainerVariant";
|
|
15
|
+
color: "sd.system.color.impression.onNegativeContainerVariant";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
state: {
|
|
19
|
+
enabled: {};
|
|
20
|
+
hovered: {
|
|
21
|
+
background: "color-mix(in srgb, token(colors.sd.system.color.component.surface) 95%, token(colors.sd.system.color.component.inverseSurface) 5%)";
|
|
22
|
+
};
|
|
23
|
+
selected: {
|
|
24
|
+
background: "sd.system.color.component.inversePrimary";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
size: {
|
|
28
|
+
small: {
|
|
29
|
+
fontSize: "11px";
|
|
30
|
+
height: "24px";
|
|
31
|
+
};
|
|
32
|
+
medium: {
|
|
33
|
+
fontSize: "13px";
|
|
34
|
+
height: "32px";
|
|
35
|
+
};
|
|
36
|
+
large: {
|
|
37
|
+
fontSize: "15px";
|
|
38
|
+
height: "40px";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
type CellStyleVariants = RecipeVariantProps<typeof cellStyle>;
|
|
43
|
+
type ExtractVariantProperty<T, K extends string> = NonNullable<T> extends infer V ? V extends {
|
|
44
|
+
[P in K]?: infer U;
|
|
45
|
+
} ? U : never : never;
|
|
46
|
+
export type CellType = ExtractVariantProperty<CellStyleVariants, "type">;
|
|
47
|
+
type CellState = ExtractVariantProperty<CellStyleVariants, "state">;
|
|
48
|
+
type CellSize = ExtractVariantProperty<CellStyleVariants, "size">;
|
|
49
|
+
export declare const BodyCell: React.FC<{
|
|
50
|
+
children: React.ReactNode;
|
|
51
|
+
size?: CellSize;
|
|
52
|
+
type?: CellType | string;
|
|
53
|
+
state?: CellState;
|
|
54
|
+
}>;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import "../../../styled-system/css/css.js";
|
|
3
|
+
import { cva as i } from "../../../styled-system/css/cva.js";
|
|
4
|
+
import "../../../styled-system/helpers.js";
|
|
5
|
+
const a = i({
|
|
6
|
+
base: {
|
|
7
|
+
borderBottom: "1px solid",
|
|
8
|
+
borderColor: "sd.system.color.component.outline",
|
|
9
|
+
fontFamily: "Roboto, sans-serif",
|
|
10
|
+
color: "sd.system.color.component.onSurface",
|
|
11
|
+
textAlign: "left",
|
|
12
|
+
verticalAlign: "middle",
|
|
13
|
+
fontWeight: 400,
|
|
14
|
+
fontSize: "13px",
|
|
15
|
+
px: "sd.system.dimension.spacing.extraSmall",
|
|
16
|
+
py: "sd.system.dimension.spacing.twoExtraSmall",
|
|
17
|
+
height: "32px",
|
|
18
|
+
whiteSpace: "nowrap"
|
|
19
|
+
},
|
|
20
|
+
variants: {
|
|
21
|
+
type: {
|
|
22
|
+
default: {
|
|
23
|
+
background: "sd.system.color.component.surface"
|
|
24
|
+
},
|
|
25
|
+
success: {
|
|
26
|
+
background: "sd.system.color.impression.positiveContainerVariant"
|
|
27
|
+
},
|
|
28
|
+
notice: {
|
|
29
|
+
background: "sd.system.color.impression.noticeContainerVariant"
|
|
30
|
+
},
|
|
31
|
+
error: {
|
|
32
|
+
background: "sd.system.color.impression.negativeContainerVariant",
|
|
33
|
+
color: "sd.system.color.impression.onNegativeContainerVariant"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
state: {
|
|
37
|
+
enabled: {},
|
|
38
|
+
hovered: {
|
|
39
|
+
background: "color-mix(in srgb, token(colors.sd.system.color.component.surface) 95%, token(colors.sd.system.color.component.inverseSurface) 5%)"
|
|
40
|
+
},
|
|
41
|
+
selected: {
|
|
42
|
+
background: "sd.system.color.component.inversePrimary"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
small: { fontSize: "11px", height: "24px" },
|
|
47
|
+
medium: { fontSize: "13px", height: "32px" },
|
|
48
|
+
large: { fontSize: "15px", height: "40px" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
compoundVariants: [
|
|
52
|
+
{
|
|
53
|
+
type: "success",
|
|
54
|
+
state: "hovered",
|
|
55
|
+
css: {
|
|
56
|
+
background: "color-mix(in srgb, token(colors.sd.system.color.impression.positiveContainerVariant) 95%, token(colors.sd.system.color.component.inverseSurface) 5%)",
|
|
57
|
+
opacity: 0.95
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: "notice",
|
|
62
|
+
state: "hovered",
|
|
63
|
+
css: {
|
|
64
|
+
background: "color-mix(in srgb, token(colors.sd.system.color.impression.noticeContainerVariant) 95%, token(colors.sd.system.color.component.inverseSurface) 5%)",
|
|
65
|
+
opacity: 0.95
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: "error",
|
|
70
|
+
state: "hovered",
|
|
71
|
+
css: {
|
|
72
|
+
background: "color-mix(in srgb, token(colors.sd.system.color.impression.negativeContainerVariant) 95%, token(colors.sd.system.color.component.inverseSurface) 5%)",
|
|
73
|
+
opacity: 0.95
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: "success",
|
|
78
|
+
state: "selected",
|
|
79
|
+
css: {
|
|
80
|
+
background: "color-mix(in srgb, token(colors.sd.system.color.impression.positiveContainerVariant) 95%, token(colors.sd.system.color.component.inverseSurface) 5%)",
|
|
81
|
+
opacity: 0.98
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
type: "notice",
|
|
86
|
+
state: "selected",
|
|
87
|
+
css: {
|
|
88
|
+
background: "color-mix(in srgb, token(colors.sd.system.color.impression.noticeContainerVariant) 95%, token(colors.sd.system.color.component.inverseSurface) 5%)",
|
|
89
|
+
opacity: 0.98
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: "error",
|
|
94
|
+
state: "selected",
|
|
95
|
+
css: {
|
|
96
|
+
background: "color-mix(in srgb, token(colors.sd.system.color.impression.negativeContainerVariant) 95%, token(colors.sd.system.color.component.inverseSurface) 5%)",
|
|
97
|
+
opacity: 0.98
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
defaultVariants: {
|
|
102
|
+
type: "default",
|
|
103
|
+
state: "enabled"
|
|
104
|
+
}
|
|
105
|
+
}), l = ["default", "success", "notice", "error"], m = (o) => l.includes(o) ? o : "default", g = ({
|
|
106
|
+
children: o,
|
|
107
|
+
size: t = "medium",
|
|
108
|
+
type: r = "default",
|
|
109
|
+
state: e = "enabled",
|
|
110
|
+
...n
|
|
111
|
+
}) => {
|
|
112
|
+
const s = m(r);
|
|
113
|
+
return /* @__PURE__ */ c(
|
|
114
|
+
"td",
|
|
115
|
+
{
|
|
116
|
+
role: "cell",
|
|
117
|
+
"data-type": s,
|
|
118
|
+
"data-state": e,
|
|
119
|
+
className: a({ size: t, type: s, state: e }),
|
|
120
|
+
...n,
|
|
121
|
+
children: o
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
export {
|
|
126
|
+
g as BodyCell
|
|
127
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { ChoiceBox as i } from "../../ChoiceBox/ChoiceBox.js";
|
|
3
|
+
import { DataTable as l } from "../index.js";
|
|
4
|
+
const b = ({
|
|
5
|
+
checked: e,
|
|
6
|
+
onChange: r,
|
|
7
|
+
value: t,
|
|
8
|
+
state: c = "enabled",
|
|
9
|
+
...m
|
|
10
|
+
}) => /* @__PURE__ */ o(l.BodyCell, { state: c, children: /* @__PURE__ */ o(
|
|
11
|
+
i,
|
|
12
|
+
{
|
|
13
|
+
...m,
|
|
14
|
+
type: "checkbox",
|
|
15
|
+
value: t,
|
|
16
|
+
checked: e,
|
|
17
|
+
onChange: r
|
|
18
|
+
}
|
|
19
|
+
) });
|
|
20
|
+
export {
|
|
21
|
+
b as BodyCheckbox
|
|
22
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const HeaderCell: ({ children, size, state, sortable, sortDirection, onSort, className, ...props }: React.PropsWithChildren<{
|
|
2
|
+
size?: "small" | "medium" | "large";
|
|
3
|
+
state?: "enabled" | "hovered";
|
|
4
|
+
sortable?: boolean;
|
|
5
|
+
sortDirection?: "asc" | "desc" | false;
|
|
6
|
+
onSort?: () => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
}> & React.ComponentProps<"th">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as l, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { SerendieSymbol as a } from "@serendie/symbols";
|
|
3
|
+
import { css as p } from "../../../styled-system/css/css.js";
|
|
4
|
+
import { cx as f } from "../../../styled-system/css/cx.js";
|
|
5
|
+
import { cva as y } from "../../../styled-system/css/cva.js";
|
|
6
|
+
import "../../../styled-system/helpers.js";
|
|
7
|
+
const u = y({
|
|
8
|
+
base: {
|
|
9
|
+
borderBottom: "1px solid",
|
|
10
|
+
borderColor: "sd.system.color.component.outline",
|
|
11
|
+
fontFamily: "Roboto, sans-serif",
|
|
12
|
+
color: "sd.system.color.component.onSurface",
|
|
13
|
+
textAlign: "left",
|
|
14
|
+
fontWeight: 400,
|
|
15
|
+
fontSize: "14px",
|
|
16
|
+
px: "sd.system.dimension.spacing.extraSmall",
|
|
17
|
+
py: "sd.system.dimension.spacing.twoExtraSmall",
|
|
18
|
+
height: "32px",
|
|
19
|
+
background: "sd.system.color.component.inversePrimary",
|
|
20
|
+
verticalAlign: "middle",
|
|
21
|
+
whiteSpace: "nowrap"
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {}
|
|
24
|
+
}), C = ({
|
|
25
|
+
children: i,
|
|
26
|
+
size: d = "medium",
|
|
27
|
+
state: m = "enabled",
|
|
28
|
+
sortable: e = !1,
|
|
29
|
+
sortDirection: n,
|
|
30
|
+
onSort: o,
|
|
31
|
+
className: r,
|
|
32
|
+
...t
|
|
33
|
+
}) => /* @__PURE__ */ l(
|
|
34
|
+
"th",
|
|
35
|
+
{
|
|
36
|
+
role: "columnheader",
|
|
37
|
+
"aria-sort": n === "asc" ? "ascending" : n === "desc" ? "descending" : e ? "none" : void 0,
|
|
38
|
+
tabIndex: e ? 0 : void 0,
|
|
39
|
+
onClick: e ? o : void 0,
|
|
40
|
+
onKeyDown: (s) => {
|
|
41
|
+
e && (s.key === "Enter" || s.key === " ") && (s.preventDefault(), o == null || o());
|
|
42
|
+
},
|
|
43
|
+
className: f(u({ size: d, state: m }), r),
|
|
44
|
+
style: {
|
|
45
|
+
cursor: e ? "pointer" : "default",
|
|
46
|
+
userSelect: "none"
|
|
47
|
+
},
|
|
48
|
+
...t,
|
|
49
|
+
children: /* @__PURE__ */ c(
|
|
50
|
+
"span",
|
|
51
|
+
{
|
|
52
|
+
className: p({
|
|
53
|
+
display: "inline-flex",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
verticalAlign: "middle"
|
|
56
|
+
}),
|
|
57
|
+
children: [
|
|
58
|
+
i,
|
|
59
|
+
e && (n === "asc" ? /* @__PURE__ */ l(
|
|
60
|
+
a,
|
|
61
|
+
{
|
|
62
|
+
name: "chevron-double-up",
|
|
63
|
+
style: { marginLeft: 4 }
|
|
64
|
+
}
|
|
65
|
+
) : n === "desc" ? /* @__PURE__ */ l(
|
|
66
|
+
a,
|
|
67
|
+
{
|
|
68
|
+
name: "chevron-double-down",
|
|
69
|
+
style: { marginLeft: 4 }
|
|
70
|
+
}
|
|
71
|
+
) : /* @__PURE__ */ l(a, { name: "chevron-up-down", style: { marginLeft: 4 } }))
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
export {
|
|
78
|
+
C as HeaderCell
|
|
79
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ChoiceBox as m } from "../../ChoiceBox/ChoiceBox.js";
|
|
3
|
+
import { DataTable as t } from "../index.js";
|
|
4
|
+
import { css as i } from "../../../styled-system/css/css.js";
|
|
5
|
+
import { cx as c } from "../../../styled-system/css/cx.js";
|
|
6
|
+
import "../../../styled-system/helpers.js";
|
|
7
|
+
const d = ({
|
|
8
|
+
className: r,
|
|
9
|
+
...o
|
|
10
|
+
}) => /* @__PURE__ */ e(t.HeaderCell, { children: /* @__PURE__ */ e(
|
|
11
|
+
m,
|
|
12
|
+
{
|
|
13
|
+
...o,
|
|
14
|
+
type: "checkbox",
|
|
15
|
+
className: c(
|
|
16
|
+
i({
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
verticalAlign: "middle"
|
|
19
|
+
}),
|
|
20
|
+
r
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
) });
|
|
24
|
+
export {
|
|
25
|
+
d as HeaderCheckbox
|
|
26
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HeaderGroup } from '@tanstack/react-table';
|
|
2
|
+
export interface HeaderRowProps<TData> {
|
|
3
|
+
headerGroup: HeaderGroup<TData>;
|
|
4
|
+
enableRowSelection?: boolean;
|
|
5
|
+
table: {
|
|
6
|
+
getIsAllRowsSelected: () => boolean;
|
|
7
|
+
getIsSomeRowsSelected: () => boolean;
|
|
8
|
+
getToggleAllRowsSelectedHandler: () => (event: unknown) => void;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare function HeaderRow<TData>({ headerGroup, enableRowSelection, table, }: HeaderRowProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { flexRender as i } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
|
+
import { DataTable as t } from "../index.js";
|
|
4
|
+
import { css as a } from "../../../styled-system/css/css.js";
|
|
5
|
+
import "../../../styled-system/helpers.js";
|
|
6
|
+
function p({
|
|
7
|
+
headerGroup: l,
|
|
8
|
+
enableRowSelection: n,
|
|
9
|
+
table: o
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ m(t.Tr, { children: [
|
|
12
|
+
n && /* @__PURE__ */ r(
|
|
13
|
+
t.HeaderCheckbox,
|
|
14
|
+
{
|
|
15
|
+
checked: o.getIsSomeRowsSelected() ? "indeterminate" : !!o.getIsAllRowsSelected(),
|
|
16
|
+
onChange: o.getToggleAllRowsSelectedHandler(),
|
|
17
|
+
value: "select-all",
|
|
18
|
+
className: a({
|
|
19
|
+
verticalAlign: "middle"
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
l.headers.map((e) => {
|
|
24
|
+
const c = e.column.getCanSort(), s = e.column.getIsSorted();
|
|
25
|
+
return /* @__PURE__ */ r(
|
|
26
|
+
t.HeaderCell,
|
|
27
|
+
{
|
|
28
|
+
sortable: c,
|
|
29
|
+
sortDirection: s,
|
|
30
|
+
onSort: () => e.column.toggleSorting(),
|
|
31
|
+
children: i(e.column.columnDef.header, e.getContext())
|
|
32
|
+
},
|
|
33
|
+
e.id
|
|
34
|
+
);
|
|
35
|
+
})
|
|
36
|
+
] }, l.id);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
p as HeaderRow
|
|
40
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "../../../styled-system/css/css.js";
|
|
3
|
+
import { cx as s } from "../../../styled-system/css/cx.js";
|
|
4
|
+
import "../../../styled-system/helpers.js";
|
|
5
|
+
import { sva as a } from "../../../styled-system/css/sva.js";
|
|
6
|
+
const l = a({
|
|
7
|
+
slots: ["container", "table"],
|
|
8
|
+
base: {
|
|
9
|
+
container: {
|
|
10
|
+
border: "1px solid",
|
|
11
|
+
borderColor: "sd.system.color.component.outline",
|
|
12
|
+
borderRadius: "4px",
|
|
13
|
+
overflow: "hidden",
|
|
14
|
+
boxShadow: "sm",
|
|
15
|
+
background: "sd.system.color.component.surface",
|
|
16
|
+
overflowX: "auto"
|
|
17
|
+
},
|
|
18
|
+
table: {
|
|
19
|
+
w: "100%",
|
|
20
|
+
borderCollapse: "separate",
|
|
21
|
+
borderSpacing: 0
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
function b({
|
|
26
|
+
children: r,
|
|
27
|
+
className: t
|
|
28
|
+
}) {
|
|
29
|
+
const o = l();
|
|
30
|
+
return /* @__PURE__ */ e("div", { className: s(o.container, t), children: /* @__PURE__ */ e("table", { role: "table", className: o.table, children: r }) });
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
b as Root
|
|
34
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { flexRender as l } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
|
+
import { DataTable as o } from "../index.js";
|
|
4
|
+
import "../../../styled-system/css/css.js";
|
|
5
|
+
import { cva as m } from "../../../styled-system/css/cva.js";
|
|
6
|
+
import "../../../styled-system/helpers.js";
|
|
7
|
+
const c = m({
|
|
8
|
+
base: {
|
|
9
|
+
_hover: {
|
|
10
|
+
_after: {
|
|
11
|
+
content: "''",
|
|
12
|
+
position: "absolute",
|
|
13
|
+
top: 0,
|
|
14
|
+
left: 0,
|
|
15
|
+
pointerEvents: "none",
|
|
16
|
+
w: "100%",
|
|
17
|
+
h: "100%",
|
|
18
|
+
bg: "sd.system.color.interaction.hoveredVariant",
|
|
19
|
+
zIndex: 1
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
state: {
|
|
25
|
+
selected: {
|
|
26
|
+
base: {
|
|
27
|
+
_after: {
|
|
28
|
+
content: "''",
|
|
29
|
+
position: "absolute",
|
|
30
|
+
top: 0,
|
|
31
|
+
left: 0,
|
|
32
|
+
pointerEvents: "none",
|
|
33
|
+
w: "100%",
|
|
34
|
+
h: "100%",
|
|
35
|
+
bg: "sd.system.color.component.inversePrimary",
|
|
36
|
+
zIndex: 1,
|
|
37
|
+
mixBlendMode: "multiply"
|
|
38
|
+
},
|
|
39
|
+
_hover: {
|
|
40
|
+
_after: {
|
|
41
|
+
content: "''",
|
|
42
|
+
position: "absolute",
|
|
43
|
+
top: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
pointerEvents: "none",
|
|
46
|
+
w: "100%",
|
|
47
|
+
h: "100%",
|
|
48
|
+
bg: "color-mix(in srgb, token(colors.sd.system.color.component.inversePrimary) 95%, token(colors.sd.system.color.component.inverseSurface) 5%)",
|
|
49
|
+
zIndex: 1,
|
|
50
|
+
mixBlendMode: "multiply"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
function v({
|
|
59
|
+
row: e,
|
|
60
|
+
enableRowSelection: r
|
|
61
|
+
}) {
|
|
62
|
+
return /* @__PURE__ */ i(
|
|
63
|
+
o.Tr,
|
|
64
|
+
{
|
|
65
|
+
className: c({
|
|
66
|
+
state: e.getIsSelected() ? "selected" : void 0
|
|
67
|
+
}),
|
|
68
|
+
children: [
|
|
69
|
+
r && /* @__PURE__ */ n(
|
|
70
|
+
o.BodyCheckbox,
|
|
71
|
+
{
|
|
72
|
+
checked: e.getIsSelected(),
|
|
73
|
+
onChange: e.getToggleSelectedHandler(),
|
|
74
|
+
value: e.id
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
e.getVisibleCells().map((t) => {
|
|
78
|
+
const s = a(t);
|
|
79
|
+
return /* @__PURE__ */ n(o.BodyCell, { type: s, children: l(t.column.columnDef.cell, t.getContext()) }, t.id);
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
function a(e) {
|
|
86
|
+
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";
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
v as Row
|
|
90
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Tbody({ children, ...props }: React.ComponentProps<"tbody">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Thead({ children, ...props }: React.ComponentProps<"thead">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Tr({ children, className, ...props }: React.ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { css as m } from "../../../styled-system/css/css.js";
|
|
3
|
+
import { cx as e } from "../../../styled-system/css/cx.js";
|
|
4
|
+
import "../../../styled-system/helpers.js";
|
|
5
|
+
function n({
|
|
6
|
+
children: r,
|
|
7
|
+
className: o,
|
|
8
|
+
...t
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ i(
|
|
11
|
+
"tr",
|
|
12
|
+
{
|
|
13
|
+
role: "row",
|
|
14
|
+
className: e(
|
|
15
|
+
m({
|
|
16
|
+
position: "relative"
|
|
17
|
+
}),
|
|
18
|
+
o
|
|
19
|
+
),
|
|
20
|
+
...t,
|
|
21
|
+
children: r
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
n as Tr
|
|
27
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Root } from './Root';
|
|
2
|
+
export { Thead } from './Thead';
|
|
3
|
+
export { Tr } from './Tr';
|
|
4
|
+
export { Row } from './Row';
|
|
5
|
+
export { HeaderRow } from './HeaderRow';
|
|
6
|
+
export { BodyCell } from './BodyCell';
|
|
7
|
+
export { HeaderCheckbox } from './HeaderCheckbox';
|
|
8
|
+
export { BodyCheckbox } from './BodyCheckbox';
|
|
9
|
+
export { Tbody } from './Tbody';
|
|
10
|
+
export { HeaderCell } from './HeaderCell';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Root as e } from "./Root.js";
|
|
2
|
+
import { Thead as t } from "./Thead.js";
|
|
3
|
+
import { Tr as m } from "./Tr.js";
|
|
4
|
+
import { Row as d } from "./Row.js";
|
|
5
|
+
import { HeaderRow as l } from "./HeaderRow.js";
|
|
6
|
+
import { BodyCell as b } from "./BodyCell.js";
|
|
7
|
+
import { HeaderCheckbox as y } from "./HeaderCheckbox.js";
|
|
8
|
+
import { BodyCheckbox as R } from "./BodyCheckbox.js";
|
|
9
|
+
import { Tbody as c } from "./Tbody.js";
|
|
10
|
+
import { HeaderCell as w } from "./HeaderCell.js";
|
|
11
|
+
export {
|
|
12
|
+
b as BodyCell,
|
|
13
|
+
R as BodyCheckbox,
|
|
14
|
+
w as HeaderCell,
|
|
15
|
+
y as HeaderCheckbox,
|
|
16
|
+
l as HeaderRow,
|
|
17
|
+
e as Root,
|
|
18
|
+
d as Row,
|
|
19
|
+
c as Tbody,
|
|
20
|
+
t as Thead,
|
|
21
|
+
m as Tr
|
|
22
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MenuRootProps } from '@ark-ui/react';
|
|
2
|
-
export declare const DropdownMenuStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"content" | "
|
|
2
|
+
export declare const DropdownMenuStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"content" | "button" | "item" | "itemGroup" | "itemIcon" | "buttonIcon", import('../../../styled-system/types').SlotRecipeVariantRecord<"content" | "button" | "item" | "itemGroup" | "itemIcon" | "buttonIcon">>;
|
|
3
3
|
export type MenuItemProps = {
|
|
4
4
|
value: string;
|
|
5
5
|
label: string;
|