@cfx-dev/ui-components 2.0.10 → 2.1.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/Box.css +1 -1
- package/dist/assets/Table.css +1 -1
- package/dist/assets/global.css +1 -1
- package/dist/components/Layout/Box/Box.d.ts +4 -1
- package/dist/components/Layout/Box/Box.js +97 -31
- package/dist/components/Layout/Flex/Flex.d.ts +2 -3
- package/dist/components/Layout/Flex/Flex.js +39 -33
- package/dist/components/Table/Table.d.ts +21 -9
- package/dist/components/Table/Table.js +129 -70
- package/dist/components/Table/TableShowcase.js +7 -1
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/index.js +4 -0
- package/dist/components/ui.d.ts +60 -16
- package/dist/components/ui.js +52 -17
- package/dist/styles-scss/global.scss +1 -0
- package/dist/styles-scss/tokens.scss +25 -0
- package/package.json +1 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { MPProps } from '../../ui';
|
|
2
3
|
|
|
3
|
-
export interface BoxProps {
|
|
4
|
+
export interface BoxProps extends MPProps {
|
|
4
5
|
noOverflow?: boolean;
|
|
5
6
|
noShrink?: boolean;
|
|
6
7
|
grow?: boolean;
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
fullHeight?: boolean;
|
|
7
10
|
/**
|
|
8
11
|
* Number values is treated like quant multiplier
|
|
9
12
|
* String value used as is
|
|
@@ -1,38 +1,104 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useContextualStyle as
|
|
1
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
2
|
+
import m from "react";
|
|
3
|
+
import { useContextualStyle as j } from "../../Style/Style.js";
|
|
4
4
|
import { ui as d } from "../../ui.js";
|
|
5
|
-
import { clsx as
|
|
6
|
-
import '../../../assets/Box.css';const
|
|
7
|
-
root:
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"no-
|
|
5
|
+
import { clsx as H } from "../../../utils/clsx.js";
|
|
6
|
+
import '../../../assets/Box.css';const W = "_root_1bvck_1", z = "_grow_1bvck_13", o = {
|
|
7
|
+
root: W,
|
|
8
|
+
"full-width": "_full-width_1bvck_1",
|
|
9
|
+
"full-height": "_full-height_1bvck_4",
|
|
10
|
+
"no-overflow": "_no-overflow_1bvck_7",
|
|
11
|
+
"no-shrink": "_no-shrink_1bvck_10",
|
|
12
|
+
grow: z,
|
|
13
|
+
"no-grow": "_no-grow_1bvck_16"
|
|
12
14
|
};
|
|
13
|
-
function
|
|
14
|
-
return typeof
|
|
15
|
+
function b(r) {
|
|
16
|
+
return typeof r == "string" ? r : d.q(r);
|
|
15
17
|
}
|
|
16
|
-
const
|
|
18
|
+
const J = m.forwardRef(function(x, y) {
|
|
17
19
|
const {
|
|
18
|
-
noOverflow:
|
|
19
|
-
noShrink:
|
|
20
|
-
grow:
|
|
21
|
-
width:
|
|
22
|
-
height:
|
|
23
|
-
children:
|
|
24
|
-
className:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
noOverflow: S = !1,
|
|
21
|
+
noShrink: M = !1,
|
|
22
|
+
grow: e = void 0,
|
|
23
|
+
width: g,
|
|
24
|
+
height: a,
|
|
25
|
+
children: A,
|
|
26
|
+
className: N,
|
|
27
|
+
fullWidth: R,
|
|
28
|
+
fullHeight: q,
|
|
29
|
+
style: p,
|
|
30
|
+
// --- MPProps
|
|
31
|
+
m: l,
|
|
32
|
+
mt: s,
|
|
33
|
+
mr: n,
|
|
34
|
+
mb: f,
|
|
35
|
+
ml: i,
|
|
36
|
+
p: c,
|
|
37
|
+
pt: h,
|
|
38
|
+
pr: u,
|
|
39
|
+
pb: _,
|
|
40
|
+
pl: w
|
|
41
|
+
} = x, k = j(), B = H(o.root, N, {
|
|
42
|
+
[o["full-width"]]: R,
|
|
43
|
+
[o["full-height"]]: q,
|
|
44
|
+
[o["no-overflow"]]: S,
|
|
45
|
+
[o["no-shrink"]]: M,
|
|
46
|
+
[o["no-grow"]]: e === !1,
|
|
47
|
+
[o.grow]: e === !0
|
|
48
|
+
}), C = m.useMemo(() => d.getAllMPAttrs({
|
|
49
|
+
m: l,
|
|
50
|
+
mt: s,
|
|
51
|
+
mr: n,
|
|
52
|
+
mb: f,
|
|
53
|
+
ml: i,
|
|
54
|
+
p: c,
|
|
55
|
+
pt: h,
|
|
56
|
+
pr: u,
|
|
57
|
+
pb: _,
|
|
58
|
+
pl: w
|
|
59
|
+
}), [
|
|
60
|
+
l,
|
|
61
|
+
s,
|
|
62
|
+
n,
|
|
63
|
+
f,
|
|
64
|
+
i,
|
|
65
|
+
c,
|
|
66
|
+
h,
|
|
67
|
+
u,
|
|
68
|
+
_,
|
|
69
|
+
w
|
|
70
|
+
]), v = m.useMemo(() => d.getAllMPStyles({
|
|
71
|
+
m: l,
|
|
72
|
+
mt: s,
|
|
73
|
+
mr: n,
|
|
74
|
+
mb: f,
|
|
75
|
+
ml: i,
|
|
76
|
+
p: c,
|
|
77
|
+
pt: h,
|
|
78
|
+
pr: u,
|
|
79
|
+
pb: _,
|
|
80
|
+
pl: w
|
|
81
|
+
}), [
|
|
82
|
+
l,
|
|
83
|
+
s,
|
|
84
|
+
n,
|
|
85
|
+
f,
|
|
86
|
+
i,
|
|
87
|
+
c,
|
|
88
|
+
h,
|
|
89
|
+
u,
|
|
90
|
+
_,
|
|
91
|
+
w
|
|
92
|
+
]), O = m.useMemo(() => {
|
|
93
|
+
const t = {
|
|
94
|
+
...v,
|
|
95
|
+
...k,
|
|
96
|
+
...p || {}
|
|
97
|
+
};
|
|
98
|
+
return g && (t.width = b(g)), a && (t.height = b(a)), !t.width && e === !0 && (t.width = "1px"), t;
|
|
99
|
+
}, [e, a, v, p, g, k]);
|
|
100
|
+
return /* @__PURE__ */ P("div", { ...C, ref: y, className: B, style: O, children: A });
|
|
35
101
|
});
|
|
36
102
|
export {
|
|
37
|
-
|
|
103
|
+
J as Box
|
|
38
104
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { BoxProps } from '../Box/Box';
|
|
2
3
|
import { OffesetType } from '../../ui';
|
|
3
4
|
|
|
4
|
-
export interface FlexProps {
|
|
5
|
-
fullWidth?: boolean;
|
|
6
|
-
fullHeight?: boolean;
|
|
5
|
+
export interface FlexProps extends BoxProps {
|
|
7
6
|
centered?: boolean | 'axis' | 'cross-axis' | 'baseline-axis' | 'baseline-cross-axis';
|
|
8
7
|
vertical?: boolean;
|
|
9
8
|
reverseOrder?: boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import { Box as u } from "../Box/Box.js";
|
|
3
4
|
import { clsx as b } from "../../../utils/clsx.js";
|
|
4
5
|
import { FlexRestricter as v } from "./FlexRestricter.js";
|
|
5
|
-
import '../../../assets/Flex.css';const z = "_root_w5him_1", R = "_centered_w5him_11", F = "_vertical_w5him_30", C = "_repell_w5him_36", N = "_wrap_w5him_39",
|
|
6
|
+
import '../../../assets/Flex.css';const z = "_root_w5him_1", R = "_centered_w5him_11", F = "_vertical_w5him_30", C = "_repell_w5him_36", N = "_wrap_w5him_39", B = "_stretch_w5him_51", E = "_horizontal_w5him_57", e = {
|
|
6
7
|
root: z,
|
|
7
8
|
"full-width": "_full-width_w5him_5",
|
|
8
9
|
"full-height": "_full-height_w5him_8",
|
|
@@ -18,8 +19,8 @@ import '../../../assets/Flex.css';const z = "_root_w5him_1", R = "_centered_w5hi
|
|
|
18
19
|
"align-to-end": "_align-to-end_w5him_42",
|
|
19
20
|
"align-to-end-axis": "_align-to-end-axis_w5him_45",
|
|
20
21
|
"space-between": "_space-between_w5him_48",
|
|
21
|
-
stretch:
|
|
22
|
-
horizontal:
|
|
22
|
+
stretch: B,
|
|
23
|
+
horizontal: E,
|
|
23
24
|
"gap-none": "_gap-none_w5him_63",
|
|
24
25
|
"gap-hairthin": "_gap-hairthin_w5him_66",
|
|
25
26
|
"gap-thin": "_gap-thin_w5him_69",
|
|
@@ -32,24 +33,21 @@ import '../../../assets/Flex.css';const z = "_root_w5him_1", R = "_centered_w5hi
|
|
|
32
33
|
"gap-xlarge": "_gap-xlarge_w5him_90",
|
|
33
34
|
"gap-safezone": "_gap-safezone_w5him_93"
|
|
34
35
|
};
|
|
35
|
-
function
|
|
36
|
+
function T(r, s) {
|
|
36
37
|
const {
|
|
37
|
-
fullWidth: _ = !1,
|
|
38
|
-
fullHeight: n = !1,
|
|
39
|
-
vertical: t = !1,
|
|
40
38
|
centered: a = !1,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
spaceBetween:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
vertical: t = !1,
|
|
40
|
+
reverseOrder: n = !1,
|
|
41
|
+
stretch: l = !1,
|
|
42
|
+
wrap: o = !1,
|
|
43
|
+
spaceBetween: c = !1,
|
|
44
|
+
alignToEnd: m = !1,
|
|
45
|
+
alignToEndAxis: h = !1,
|
|
46
|
+
gap: p = "normal",
|
|
47
|
+
children: w,
|
|
48
|
+
className: g,
|
|
49
|
+
...x
|
|
50
|
+
} = r, d = b(e.root, g, e[`gap-${p}`], {
|
|
53
51
|
[e.centered]: a === !0,
|
|
54
52
|
[e["centered-axis"]]: a === "axis",
|
|
55
53
|
[e["centered-cross-axis"]]: a === "cross-axis",
|
|
@@ -57,21 +55,29 @@ function j(r, i) {
|
|
|
57
55
|
[e["baseline-cross-axis"]]: a === "baseline-cross-axis",
|
|
58
56
|
[e.vertical]: t,
|
|
59
57
|
[e.horizontal]: !t,
|
|
60
|
-
[e.stretch]:
|
|
61
|
-
[e.wrap]:
|
|
62
|
-
[e["align-to-end"]]:
|
|
63
|
-
[e["align-to-end-axis"]]:
|
|
64
|
-
[e["space-between"]]:
|
|
65
|
-
[e["reverse-order"]]:
|
|
58
|
+
[e.stretch]: l,
|
|
59
|
+
[e.wrap]: o,
|
|
60
|
+
[e["align-to-end"]]: m,
|
|
61
|
+
[e["align-to-end-axis"]]: h,
|
|
62
|
+
[e["space-between"]]: c,
|
|
63
|
+
[e["reverse-order"]]: n
|
|
66
64
|
});
|
|
67
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ i(
|
|
66
|
+
u,
|
|
67
|
+
{
|
|
68
|
+
ref: s,
|
|
69
|
+
className: d,
|
|
70
|
+
...x,
|
|
71
|
+
children: w
|
|
72
|
+
}
|
|
73
|
+
);
|
|
68
74
|
}
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
children:
|
|
75
|
+
const j = f.forwardRef(T), _ = j;
|
|
76
|
+
_.Restricted = function({
|
|
77
|
+
children: s
|
|
72
78
|
}) {
|
|
73
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(v, { children: s }) });
|
|
74
80
|
};
|
|
75
81
|
export {
|
|
76
|
-
|
|
82
|
+
_ as Flex
|
|
77
83
|
};
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export interface TableHeaderType {
|
|
4
|
+
text: string;
|
|
5
|
+
sortable?: boolean;
|
|
6
|
+
sortKey?: string;
|
|
7
|
+
}
|
|
8
|
+
export type TableRowType = Array<string | number | Date | React.ReactNode>;
|
|
9
|
+
export type DataContainerType = React.FC<{
|
|
10
|
+
item: string | number | Date | React.ReactNode;
|
|
11
|
+
}>;
|
|
12
|
+
interface TableHeaderItemProps {
|
|
13
|
+
item: TableHeaderType;
|
|
14
|
+
onSortClick?: (sortKey: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function TableHeaderItem(props: TableHeaderItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface TableProps {
|
|
18
|
+
headers: TableHeaderType[];
|
|
19
|
+
data: TableRowType[];
|
|
6
20
|
includeRadio?: boolean;
|
|
7
|
-
onSelectChange?: (rowIndex: number) => void;
|
|
8
|
-
dataContainer?:
|
|
9
|
-
|
|
10
|
-
}> | undefined;
|
|
11
|
-
useSort?: boolean;
|
|
21
|
+
onSelectChange?: (rowIndex: number | null) => void;
|
|
22
|
+
dataContainer?: DataContainerType;
|
|
23
|
+
selectedRow?: number | null;
|
|
12
24
|
sortBy?: string;
|
|
13
25
|
sortOrder?: 'asc' | 'desc';
|
|
14
26
|
onSortChange?: (sortBy: string, sortOrder: 'asc' | 'desc') => void;
|
|
15
27
|
}
|
|
16
|
-
export declare function Table({ headers, data, includeRadio, onSelectChange, dataContainer,
|
|
28
|
+
export declare function Table({ headers, data, includeRadio, onSelectChange, dataContainer, selectedRow: outerSelectedRow, sortBy: outerSortBy, sortOrder: outerSortOrder, onSortChange, }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
17
29
|
export {};
|
|
@@ -1,86 +1,145 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as t, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import l, { useState as C } from "react";
|
|
3
|
+
import N from "../Checkbox/Checkbox.js";
|
|
4
|
+
import B from "../IconButton/IconButton.js";
|
|
5
|
+
import { Text as v } from "../Text/Text.js";
|
|
6
|
+
import { clsx as z } from "../../utils/clsx.js";
|
|
7
|
+
import '../../assets/Table.css';const $ = "_root_jdj5z_1", T = "_radio_jdj5z_15", A = "_pointer_jdj5z_21", E = "_selectedRow_jdj5z_24", O = "_headerContent_jdj5z_34", S = "_sortable_jdj5z_40", F = "_empty_jdj5z_40", H = "_sortButton_jdj5z_43", r = {
|
|
8
|
+
root: $,
|
|
9
|
+
radio: T,
|
|
10
|
+
pointer: A,
|
|
11
|
+
selectedRow: E,
|
|
12
|
+
headerContent: O,
|
|
13
|
+
sortable: S,
|
|
14
|
+
empty: F,
|
|
15
|
+
sortButton: H
|
|
11
16
|
};
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
function V(h) {
|
|
18
|
+
const {
|
|
19
|
+
item: e,
|
|
20
|
+
onSortClick: o
|
|
21
|
+
} = h, s = l.useCallback(() => {
|
|
22
|
+
o && o(e.sortKey || e.text);
|
|
23
|
+
}, [e.sortKey, e.text, o]), b = z(r.headerContent, {
|
|
24
|
+
[r.sortable]: e.sortable,
|
|
25
|
+
[r.empty]: !e.text
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ t(
|
|
28
|
+
"th",
|
|
29
|
+
{
|
|
30
|
+
className: e.sortable ? r.pointer : void 0,
|
|
31
|
+
onClick: e.sortable ? s : void 0,
|
|
32
|
+
children: /* @__PURE__ */ j("div", { className: b, children: [
|
|
33
|
+
/* @__PURE__ */ t(v, { color: "secondary", weight: "bold", uppercase: !0, size: "xxsmall", children: e.text }),
|
|
34
|
+
!!e.sortable && /* @__PURE__ */ t(
|
|
35
|
+
B,
|
|
36
|
+
{
|
|
37
|
+
className: r.sortButton,
|
|
38
|
+
color: "secondary",
|
|
39
|
+
name: "Sort",
|
|
40
|
+
onClick: s
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] })
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function q(h) {
|
|
48
|
+
const {
|
|
49
|
+
index: e,
|
|
50
|
+
includeRadio: o = !1,
|
|
51
|
+
selectedRow: s,
|
|
52
|
+
item: b,
|
|
53
|
+
dataContainer: m,
|
|
54
|
+
onSelectChange: a
|
|
55
|
+
} = h, f = l.useCallback((n) => {
|
|
56
|
+
a(
|
|
57
|
+
n ? e : null
|
|
58
|
+
);
|
|
59
|
+
}, [a, e]), _ = l.useCallback(() => {
|
|
60
|
+
a(e);
|
|
61
|
+
}, [a, e]), p = z({
|
|
62
|
+
[r.selectedRow]: s === e,
|
|
63
|
+
[r.pointer]: o
|
|
64
|
+
});
|
|
65
|
+
return /* @__PURE__ */ j(
|
|
66
|
+
"tr",
|
|
67
|
+
{
|
|
68
|
+
className: p,
|
|
69
|
+
onClick: o ? _ : void 0,
|
|
70
|
+
children: [
|
|
71
|
+
o && /* @__PURE__ */ t("td", { className: r.radio, children: /* @__PURE__ */ t(
|
|
72
|
+
N,
|
|
73
|
+
{
|
|
74
|
+
size: "small",
|
|
75
|
+
onCheckedChange: f,
|
|
76
|
+
"aria-label": `${e}`,
|
|
77
|
+
checked: s === e
|
|
78
|
+
}
|
|
79
|
+
) }),
|
|
80
|
+
b.map((n, u) => {
|
|
81
|
+
let i;
|
|
82
|
+
return l.isValidElement(n) ? i = n : m ? i = l.createElement(m, { item: n }) : i = String(n), /* @__PURE__ */ t("td", { children: i }, `item-${u}`);
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
`row-${e}`
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function M({
|
|
90
|
+
headers: h = [],
|
|
91
|
+
data: e = [],
|
|
92
|
+
includeRadio: o = !1,
|
|
93
|
+
onSelectChange: s,
|
|
17
94
|
dataContainer: b,
|
|
18
|
-
|
|
19
|
-
sortBy:
|
|
20
|
-
sortOrder:
|
|
21
|
-
onSortChange:
|
|
95
|
+
selectedRow: m = null,
|
|
96
|
+
sortBy: a,
|
|
97
|
+
sortOrder: f = "asc",
|
|
98
|
+
onSortChange: _
|
|
22
99
|
}) {
|
|
23
|
-
const [p,
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
y(t), t !== null && (c == null || c(t));
|
|
31
|
-
}
|
|
100
|
+
const [p, n] = C(m), [u, i] = C(a), [k, w] = C(f), R = l.useCallback((c) => {
|
|
101
|
+
const x = u === c && k === "asc" ? "desc" : "asc";
|
|
102
|
+
i(c), w(x), _ == null || _(c, x);
|
|
103
|
+
}, [_, u, k]), y = l.useCallback(
|
|
104
|
+
(c) => {
|
|
105
|
+
const d = c === p ? null : c;
|
|
106
|
+
n(d), s == null || s(d);
|
|
32
107
|
},
|
|
33
|
-
[
|
|
108
|
+
[s, p]
|
|
34
109
|
);
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
110
|
+
return l.useEffect(() => {
|
|
111
|
+
n(m);
|
|
112
|
+
}, [m]), l.useEffect(() => {
|
|
113
|
+
i(a);
|
|
114
|
+
}, [a]), l.useEffect(() => {
|
|
115
|
+
w(f);
|
|
116
|
+
}, [f]), /* @__PURE__ */ t("div", { className: r.root, children: /* @__PURE__ */ j("table", { children: [
|
|
117
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ j("tr", { children: [
|
|
118
|
+
o && /* @__PURE__ */ t("th", { "aria-label": "Select Row" }),
|
|
119
|
+
h.map((c, d) => /* @__PURE__ */ t(
|
|
120
|
+
V,
|
|
40
121
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
children: /* @__PURE__ */ i("div", { className: l.headerContent, children: [
|
|
44
|
-
e,
|
|
45
|
-
n && /* @__PURE__ */ o(
|
|
46
|
-
j,
|
|
47
|
-
{
|
|
48
|
-
className: l.sortButton,
|
|
49
|
-
color: "secondary",
|
|
50
|
-
name: "Sort",
|
|
51
|
-
onClick: n ? () => _(e) : void 0
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
] })
|
|
122
|
+
item: c,
|
|
123
|
+
onSortClick: R
|
|
55
124
|
},
|
|
56
|
-
`header-${
|
|
125
|
+
`header-${d}`
|
|
57
126
|
))
|
|
58
127
|
] }) }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
128
|
+
/* @__PURE__ */ t("tbody", { children: e.map((c, d) => /* @__PURE__ */ t(
|
|
129
|
+
q,
|
|
61
130
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
size: "small",
|
|
69
|
-
onCheckedChange: (t) => h(t, s),
|
|
70
|
-
"aria-label": `${s}`,
|
|
71
|
-
checked: p === s
|
|
72
|
-
}
|
|
73
|
-
) }),
|
|
74
|
-
e.map((t, C) => {
|
|
75
|
-
let a;
|
|
76
|
-
return f.isValidElement(t) ? a = t : b ? a = f.createElement(b, { item: t }) : a = String(t), /* @__PURE__ */ o("td", { children: a }, `item-${C}`);
|
|
77
|
-
})
|
|
78
|
-
]
|
|
131
|
+
index: d,
|
|
132
|
+
item: c,
|
|
133
|
+
includeRadio: o,
|
|
134
|
+
selectedRow: p,
|
|
135
|
+
onSelectChange: y,
|
|
136
|
+
dataContainer: b
|
|
79
137
|
},
|
|
80
|
-
`row-${
|
|
138
|
+
`row-${d}`
|
|
81
139
|
)) })
|
|
82
140
|
] }) });
|
|
83
141
|
}
|
|
84
142
|
export {
|
|
85
|
-
|
|
143
|
+
M as Table,
|
|
144
|
+
V as TableHeaderItem
|
|
86
145
|
};
|
|
@@ -27,7 +27,13 @@ const i = [
|
|
|
27
27
|
["Cell 7", "Cell 8", "Cell 9", new Date(2023, 2, 1).toLocaleDateString(), /* @__PURE__ */ e(l, { children: "Badge" }, "3")],
|
|
28
28
|
["Cell 4", "Cell 5", "Cell 6", new Date(2023, 1, 1).toLocaleDateString(), /* @__PURE__ */ e(l, { children: "Badge" }, "2")],
|
|
29
29
|
["Cell 7", "Cell 8", "Cell 9", new Date(2023, 2, 1).toLocaleDateString(), /* @__PURE__ */ e(l, { children: "Badge" }, "3")]
|
|
30
|
-
], n = [
|
|
30
|
+
], n = [
|
|
31
|
+
{ text: "Header 1" },
|
|
32
|
+
{ text: "Header 2" },
|
|
33
|
+
{ text: "Header 3" },
|
|
34
|
+
{ text: "Date" },
|
|
35
|
+
{ text: "Item" }
|
|
36
|
+
];
|
|
31
37
|
function C() {
|
|
32
38
|
return /* @__PURE__ */ t(a, { gap: "large", vertical: !0, children: [
|
|
33
39
|
/* @__PURE__ */ t(a, { gap: "normal", vertical: !0, children: [
|
package/dist/components/ui.d.ts
CHANGED
|
@@ -1,17 +1,54 @@
|
|
|
1
1
|
import { TextProps } from './Text/Text.types';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export declare enum OffsetEnum {
|
|
4
|
+
none = "none",
|
|
5
|
+
hairthin = "hairthin",
|
|
6
|
+
thin = "thin",
|
|
7
|
+
xxsmall = "xxsmall",
|
|
8
|
+
xsmall = "xsmall",
|
|
9
|
+
small = "small",
|
|
10
|
+
normal = "normal",
|
|
11
|
+
medium = "medium",
|
|
12
|
+
large = "large",
|
|
13
|
+
xlarge = "xlarge",
|
|
14
|
+
safezone = "safezone"
|
|
15
|
+
}
|
|
16
|
+
export type OffesetType = keyof typeof OffsetEnum;
|
|
17
|
+
export declare enum MediaQueryEnum {
|
|
18
|
+
initial = "initial",
|
|
19
|
+
xxsmall = "xxsmall",
|
|
20
|
+
xsmall = "xsmall",
|
|
21
|
+
small = "small",
|
|
22
|
+
medium = "medium",
|
|
23
|
+
large = "large",
|
|
24
|
+
xlarge = "xlarge"
|
|
25
|
+
}
|
|
26
|
+
export type MediaQueryType = keyof typeof MediaQueryEnum;
|
|
27
|
+
export type ResponsiveOffsetType = OffesetType | number | {
|
|
28
|
+
[key in MediaQueryType]?: OffesetType | number;
|
|
29
|
+
};
|
|
30
|
+
export interface MPProps {
|
|
31
|
+
m?: ResponsiveOffsetType;
|
|
32
|
+
mt?: ResponsiveOffsetType;
|
|
33
|
+
mr?: ResponsiveOffsetType;
|
|
34
|
+
mb?: ResponsiveOffsetType;
|
|
35
|
+
ml?: ResponsiveOffsetType;
|
|
36
|
+
p?: ResponsiveOffsetType;
|
|
37
|
+
pt?: ResponsiveOffsetType;
|
|
38
|
+
pr?: ResponsiveOffsetType;
|
|
39
|
+
pb?: ResponsiveOffsetType;
|
|
40
|
+
pl?: ResponsiveOffsetType;
|
|
41
|
+
}
|
|
5
42
|
export declare namespace ui {
|
|
6
43
|
/**
|
|
7
44
|
* Returns CSS value of quant value with applied multiplier
|
|
8
45
|
*/
|
|
9
|
-
function q(multiplier?: number): string;
|
|
10
|
-
function offset(size: OffesetType): string;
|
|
11
|
-
function fontSize(size?: TextProps['size']): string;
|
|
12
|
-
function borderRadius(size?: 'xsmall' | 'small' | 'normal'): string;
|
|
13
|
-
function color(name: string, variantRaw?: string | number, alpha?: number): string;
|
|
14
|
-
namespace cls {
|
|
46
|
+
export function q(multiplier?: number): string;
|
|
47
|
+
export function offset(size: OffesetType): string;
|
|
48
|
+
export function fontSize(size?: TextProps['size']): string;
|
|
49
|
+
export function borderRadius(size?: 'xsmall' | 'small' | 'normal'): string;
|
|
50
|
+
export function color(name: string, variantRaw?: string | number, alpha?: number): string;
|
|
51
|
+
export namespace cls {
|
|
15
52
|
const fullWidth = "util-full-width";
|
|
16
53
|
const fullHeight = "util-full-height";
|
|
17
54
|
const flexGrow = "util-flex-grow";
|
|
@@ -19,12 +56,19 @@ export declare namespace ui {
|
|
|
19
56
|
const userSelectableText = "util-text-selectable";
|
|
20
57
|
const zIndex9000 = "util-z-index-9000";
|
|
21
58
|
}
|
|
22
|
-
const pc: (x: number | string) => string;
|
|
23
|
-
const px: (x: number | string) => string;
|
|
24
|
-
const ch: (x: number | string) => string;
|
|
25
|
-
const em: (x: number | string) => string;
|
|
26
|
-
const rem: (x: number | string) => string;
|
|
27
|
-
const vh: (x: number | string) => string;
|
|
28
|
-
const vw: (x: number | string) => string;
|
|
29
|
-
const url: (u: unknown) => string;
|
|
59
|
+
export const pc: (x: number | string) => string;
|
|
60
|
+
export const px: (x: number | string) => string;
|
|
61
|
+
export const ch: (x: number | string) => string;
|
|
62
|
+
export const em: (x: number | string) => string;
|
|
63
|
+
export const rem: (x: number | string) => string;
|
|
64
|
+
export const vh: (x: number | string) => string;
|
|
65
|
+
export const vw: (x: number | string) => string;
|
|
66
|
+
export const url: (u: unknown) => string;
|
|
67
|
+
export const getOffsetAttrs: (name: string, value: ResponsiveOffsetType) => Record<string, string>;
|
|
68
|
+
export const getOffsetStyles: (name: string, value: ResponsiveOffsetType) => Record<string, string>;
|
|
69
|
+
type CallbackType<T> = (name: string, value: ResponsiveOffsetType) => T;
|
|
70
|
+
export function callAllMPProps<T>(props: Partial<MPProps>, callback: CallbackType<T>): {};
|
|
71
|
+
export const getAllMPStyles: (props: Partial<MPProps>) => React.CSSProperties;
|
|
72
|
+
export const getAllMPAttrs: (props: Partial<MPProps>) => Record<string, string>;
|
|
73
|
+
export {};
|
|
30
74
|
}
|