@cfx-dev/ui-components 2.0.9 → 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.
@@ -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 m } from "react/jsx-runtime";
2
- import g from "react";
3
- import { useContextualStyle as u } from "../../Style/Style.js";
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 x } from "../../../utils/clsx.js";
6
- import '../../../assets/Box.css';const p = "_root_1e1ao_1", k = "_grow_1e1ao_7", r = {
7
- root: p,
8
- "no-overflow": "_no-overflow_1e1ao_1",
9
- "no-shrink": "_no-shrink_1e1ao_4",
10
- grow: k,
11
- "no-grow": "_no-grow_1e1ao_10"
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 f(t) {
14
- return typeof t == "string" ? t : d.q(t);
15
+ function b(r) {
16
+ return typeof r == "string" ? r : d.q(r);
15
17
  }
16
- const B = g.forwardRef(function(s, a) {
18
+ const J = m.forwardRef(function(x, y) {
17
19
  const {
18
- noOverflow: w = !1,
19
- noShrink: _ = !1,
20
- grow: n = void 0,
21
- width: e,
22
- height: i,
23
- children: l,
24
- className: c
25
- } = s, h = x(r.root, c, {
26
- [r["no-overflow"]]: w,
27
- [r["no-shrink"]]: _,
28
- [r["no-grow"]]: n === !1,
29
- [r.grow]: n === !0
30
- }), o = {
31
- ...u(),
32
- ...s.style || {}
33
- };
34
- return (e || i) && (e && (o.width = f(e)), i && (o.height = f(i))), !o.width && n === !0 && (o.width = "1px"), /* @__PURE__ */ m("div", { ref: a, className: h, style: o, children: l });
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
- B as Box
103
+ J as Box
38
104
  };
@@ -1,18 +1,17 @@
1
1
  import { default as React } from 'react';
2
+ import { BoxProps } from '../Box/Box';
3
+ import { OffesetType } from '../../ui';
2
4
 
3
- export interface FlexProps {
4
- fullWidth?: boolean;
5
- fullHeight?: boolean;
5
+ export interface FlexProps extends BoxProps {
6
6
  centered?: boolean | 'axis' | 'cross-axis' | 'baseline-axis' | 'baseline-cross-axis';
7
7
  vertical?: boolean;
8
8
  reverseOrder?: boolean;
9
- repell?: boolean;
10
9
  stretch?: boolean;
11
10
  wrap?: boolean;
12
11
  spaceBetween?: boolean;
13
12
  alignToEnd?: boolean;
14
13
  alignToEndAxis?: boolean;
15
- gap?: 'none' | 'thin' | 'small' | 'normal' | 'large' | 'xlarge';
14
+ gap?: OffesetType;
16
15
  children?: React.ReactNode;
17
16
  className?: string;
18
17
  }
@@ -1,55 +1,53 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import w from "react";
3
- import { clsx as v } from "../../../utils/clsx.js";
4
- import { FlexRestricter as z } from "./FlexRestricter.js";
5
- import '../../../assets/Flex.css';const R = "_root_1bx3e_1", F = "_centered_1bx3e_11", C = "_vertical_1bx3e_30", N = "_repell_1bx3e_36", E = "_wrap_1bx3e_39", T = "_stretch_1bx3e_51", j = "_horizontal_1bx3e_57", e = {
6
- root: R,
7
- "full-width": "_full-width_1bx3e_5",
8
- "full-height": "_full-height_1bx3e_8",
9
- centered: F,
10
- "centered-axis": "_centered-axis_1bx3e_15",
11
- "centered-cross-axis": "_centered-cross-axis_1bx3e_18",
12
- "baseline-axis": "_baseline-axis_1bx3e_21",
13
- "baseline-cross-axis": "_baseline-cross-axis_1bx3e_24",
14
- "reverse-order": "_reverse-order_1bx3e_27",
15
- vertical: C,
16
- repell: N,
17
- wrap: E,
18
- "align-to-end": "_align-to-end_1bx3e_42",
19
- "align-to-end-axis": "_align-to-end-axis_1bx3e_45",
20
- "space-between": "_space-between_1bx3e_48",
21
- stretch: T,
22
- horizontal: j,
23
- "gap-none": "_gap-none_1bx3e_63",
24
- "gap-hairthin": "_gap-hairthin_1bx3e_66",
25
- "gap-thin": "_gap-thin_1bx3e_69",
26
- "gap-xxsmall": "_gap-xxsmall_1bx3e_72",
27
- "gap-xsmall": "_gap-xsmall_1bx3e_75",
28
- "gap-small": "_gap-small_1bx3e_78",
29
- "gap-normal": "_gap-normal_1bx3e_81",
30
- "gap-large": "_gap-large_1bx3e_84",
31
- "gap-xlarge": "_gap-xlarge_1bx3e_87",
32
- "gap-safezone": "_gap-safezone_1bx3e_90"
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import f from "react";
3
+ import { Box as u } from "../Box/Box.js";
4
+ import { clsx as b } from "../../../utils/clsx.js";
5
+ import { FlexRestricter as v } from "./FlexRestricter.js";
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 = {
7
+ root: z,
8
+ "full-width": "_full-width_w5him_5",
9
+ "full-height": "_full-height_w5him_8",
10
+ centered: R,
11
+ "centered-axis": "_centered-axis_w5him_15",
12
+ "centered-cross-axis": "_centered-cross-axis_w5him_18",
13
+ "baseline-axis": "_baseline-axis_w5him_21",
14
+ "baseline-cross-axis": "_baseline-cross-axis_w5him_24",
15
+ "reverse-order": "_reverse-order_w5him_27",
16
+ vertical: F,
17
+ repell: C,
18
+ wrap: N,
19
+ "align-to-end": "_align-to-end_w5him_42",
20
+ "align-to-end-axis": "_align-to-end-axis_w5him_45",
21
+ "space-between": "_space-between_w5him_48",
22
+ stretch: B,
23
+ horizontal: E,
24
+ "gap-none": "_gap-none_w5him_63",
25
+ "gap-hairthin": "_gap-hairthin_w5him_66",
26
+ "gap-thin": "_gap-thin_w5him_69",
27
+ "gap-xxsmall": "_gap-xxsmall_w5him_72",
28
+ "gap-xsmall": "_gap-xsmall_w5him_75",
29
+ "gap-small": "_gap-small_w5him_78",
30
+ "gap-normal": "_gap-normal_w5him_81",
31
+ "gap-medium": "_gap-medium_w5him_84",
32
+ "gap-large": "_gap-large_w5him_87",
33
+ "gap-xlarge": "_gap-xlarge_w5him_90",
34
+ "gap-safezone": "_gap-safezone_w5him_93"
33
35
  };
34
- function A(l, s) {
36
+ function T(r, s) {
35
37
  const {
36
- fullWidth: n = !1,
37
- fullHeight: o = !1,
38
- vertical: t = !1,
39
38
  centered: a = !1,
40
- repell: i = !1,
41
- stretch: x = !1,
42
- wrap: c = !1,
43
- alignToEnd: p = !1,
44
- alignToEndAxis: b = !1,
45
- spaceBetween: g = !1,
46
- reverseOrder: d = !1,
47
- gap: f = "normal",
48
- children: h,
49
- className: m
50
- } = l, u = v(e.root, m, e[`gap-${f}`], {
51
- [e["full-width"]]: n,
52
- [e["full-height"]]: o,
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,28 @@ function A(l, s) {
57
55
  [e["baseline-cross-axis"]]: a === "baseline-cross-axis",
58
56
  [e.vertical]: t,
59
57
  [e.horizontal]: !t,
60
- [e.repell]: i,
61
- [e.stretch]: x,
62
- [e.wrap]: c,
63
- [e["align-to-end"]]: p,
64
- [e["align-to-end-axis"]]: b,
65
- [e["space-between"]]: g,
66
- [e["reverse-order"]]: d
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
67
64
  });
68
- return /* @__PURE__ */ r("div", { ref: s, className: u, children: h });
65
+ return /* @__PURE__ */ i(
66
+ u,
67
+ {
68
+ ref: s,
69
+ className: d,
70
+ ...x,
71
+ children: w
72
+ }
73
+ );
69
74
  }
70
- const B = w.forwardRef(A), _ = B;
75
+ const j = f.forwardRef(T), _ = j;
71
76
  _.Restricted = function({
72
77
  children: s
73
78
  }) {
74
- return /* @__PURE__ */ r(_, { children: /* @__PURE__ */ r(z, { children: s }) });
79
+ return /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(v, { children: s }) });
75
80
  };
76
81
  export {
77
82
  _ as Flex
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { FlexProps } from './Flex';
3
+
4
+ declare function FlexShowcase(props: FlexProps): import("react/jsx-runtime").JSX.Element;
5
+ declare const _default: React.MemoExoticComponent<typeof FlexShowcase>;
6
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import l from "react";
3
+ import { Flex as s } from "./Flex.js";
4
+ import '../../../assets/FlexShowcase.css';const t = "_box_1118n_1", o = {
5
+ box: t
6
+ };
7
+ function r(a) {
8
+ return /* @__PURE__ */ e(s, { gap: "large", vertical: !0, children: /* @__PURE__ */ c(s, { ...a, children: [
9
+ /* @__PURE__ */ e("div", { className: o.box }),
10
+ /* @__PURE__ */ e("div", { className: o.box }),
11
+ /* @__PURE__ */ e("div", { className: o.box }),
12
+ /* @__PURE__ */ e("div", { className: o.box }),
13
+ /* @__PURE__ */ e("div", { className: o.box })
14
+ ] }) });
15
+ }
16
+ const d = l.memo(r);
17
+ export {
18
+ d as default
19
+ };
@@ -1,39 +1,40 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { clsx as u } from "../../../utils/clsx.js";
3
- import '../../../assets/Pad.css';const i = "_root_1wpeu_1", o = {
3
+ import '../../../assets/Pad.css';const i = "_root_1aquh_1", o = {
4
4
  root: i,
5
- "offset-none": "_offset-none_1wpeu_1",
6
- "offset-hairthin": "_offset-hairthin_1wpeu_4",
7
- "offset-thin": "_offset-thin_1wpeu_7",
8
- "offset-xxsmall": "_offset-xxsmall_1wpeu_10",
9
- "offset-xsmall": "_offset-xsmall_1wpeu_13",
10
- "offset-small": "_offset-small_1wpeu_16",
11
- "offset-normal": "_offset-normal_1wpeu_19",
12
- "offset-large": "_offset-large_1wpeu_22",
13
- "offset-xlarge": "_offset-xlarge_1wpeu_25",
14
- "offset-safezone": "_offset-safezone_1wpeu_28",
15
- "only-top": "_only-top_1wpeu_31",
16
- "only-left": "_only-left_1wpeu_34",
17
- "only-right": "_only-right_1wpeu_37",
18
- "only-bottom": "_only-bottom_1wpeu_40"
5
+ "offset-none": "_offset-none_1aquh_1",
6
+ "offset-hairthin": "_offset-hairthin_1aquh_4",
7
+ "offset-thin": "_offset-thin_1aquh_7",
8
+ "offset-xxsmall": "_offset-xxsmall_1aquh_10",
9
+ "offset-xsmall": "_offset-xsmall_1aquh_13",
10
+ "offset-small": "_offset-small_1aquh_16",
11
+ "offset-normal": "_offset-normal_1aquh_19",
12
+ "offset-medium": "_offset-medium_1aquh_22",
13
+ "offset-large": "_offset-large_1aquh_25",
14
+ "offset-xlarge": "_offset-xlarge_1aquh_28",
15
+ "offset-safezone": "_offset-safezone_1aquh_31",
16
+ "only-top": "_only-top_1aquh_34",
17
+ "only-left": "_only-left_1aquh_37",
18
+ "only-right": "_only-right_1aquh_40",
19
+ "only-bottom": "_only-bottom_1aquh_43"
19
20
  };
20
- function h(_) {
21
+ function x(l) {
21
22
  const {
22
- top: t = !1,
23
- left: f = !1,
23
+ top: f = !1,
24
+ left: e = !1,
24
25
  right: s = !1,
25
- bottom: l = !1,
26
- size: n = "normal",
27
- children: a,
28
- className: r
29
- } = _, e = !(t || f || s || l), p = u(o.root, r, o[`offset-${n}`], {
30
- [o["only-top"]]: e || t,
31
- [o["only-left"]]: e || f,
32
- [o["only-right"]]: e || s,
33
- [o["only-bottom"]]: e || l
26
+ bottom: _ = !1,
27
+ size: a = "normal",
28
+ children: n,
29
+ className: h
30
+ } = l, t = !(f || e || s || _), r = u(o.root, h, o[`offset-${a}`], {
31
+ [o["only-top"]]: t || f,
32
+ [o["only-left"]]: t || e,
33
+ [o["only-right"]]: t || s,
34
+ [o["only-bottom"]]: t || _
34
35
  });
35
- return /* @__PURE__ */ m("div", { className: p, children: a });
36
+ return /* @__PURE__ */ m("div", { className: r, children: n });
36
37
  }
37
38
  export {
38
- h as Pad
39
+ x as Pad
39
40
  };
@@ -1,40 +1,41 @@
1
- import { jsxs as n, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as _, jsx as t } from "react/jsx-runtime";
2
2
  import { clsx as l } from "../../utils/clsx.js";
3
- import '../../assets/Separator.css';const m = "_root_1aovm_1", p = "_separator_1aovm_4", c = "_content_1aovm_39", i = "_thin_1aovm_42", v = "_vertical_1aovm_48", x = "_text_1aovm_92", a = {
4
- root: m,
5
- "separator-offset-none": "_separator-offset-none_1aovm_4",
6
- "separator-offset-hairthin": "_separator-offset-hairthin_1aovm_7",
7
- "separator-offset-thin": "_separator-offset-thin_1aovm_10",
8
- "separator-offset-xxsmall": "_separator-offset-xxsmall_1aovm_13",
9
- "separator-offset-xsmall": "_separator-offset-xsmall_1aovm_16",
10
- "separator-offset-small": "_separator-offset-small_1aovm_19",
11
- "separator-offset-normal": "_separator-offset-normal_1aovm_22",
12
- "separator-offset-large": "_separator-offset-large_1aovm_25",
13
- "separator-offset-xlarge": "_separator-offset-xlarge_1aovm_28",
14
- "separator-offset-safezone": "_separator-offset-safezone_1aovm_31",
15
- separator: p,
3
+ import '../../assets/Separator.css';const p = "_root_dsunb_1", i = "_separator_dsunb_4", c = "_content_dsunb_42", d = "_thin_dsunb_45", m = "_vertical_dsunb_51", u = "_text_dsunb_98", s = {
4
+ root: p,
5
+ "separator-offset-none": "_separator-offset-none_dsunb_4",
6
+ "separator-offset-hairthin": "_separator-offset-hairthin_dsunb_7",
7
+ "separator-offset-thin": "_separator-offset-thin_dsunb_10",
8
+ "separator-offset-xxsmall": "_separator-offset-xxsmall_dsunb_13",
9
+ "separator-offset-xsmall": "_separator-offset-xsmall_dsunb_16",
10
+ "separator-offset-small": "_separator-offset-small_dsunb_19",
11
+ "separator-offset-normal": "_separator-offset-normal_dsunb_22",
12
+ "separator-offset-medium": "_separator-offset-medium_dsunb_25",
13
+ "separator-offset-large": "_separator-offset-large_dsunb_28",
14
+ "separator-offset-xlarge": "_separator-offset-xlarge_dsunb_31",
15
+ "separator-offset-safezone": "_separator-offset-safezone_dsunb_34",
16
+ separator: i,
16
17
  content: c,
17
- thin: i,
18
- vertical: v,
19
- text: x
18
+ thin: d,
19
+ vertical: m,
20
+ text: u
20
21
  };
21
- function N(s) {
22
+ function h(o) {
22
23
  const {
23
- content: t,
24
+ content: a,
24
25
  thin: r = !1,
25
- vertical: f = !1,
26
- offset: _ = "none"
27
- } = s, e = l(a.root, a[`separator-offset-${_}`], {
28
- [a.text]: !!t,
29
- [a.thin]: r,
30
- [a.vertical]: f
26
+ vertical: n = !1,
27
+ offset: f = "none"
28
+ } = o, e = l(s.root, s[`separator-offset-${f}`], {
29
+ [s.text]: !!a,
30
+ [s.thin]: r,
31
+ [s.vertical]: n
31
32
  });
32
- return t ? /* @__PURE__ */ n("div", { className: e, children: [
33
- /* @__PURE__ */ o("div", { className: a.separator }),
34
- /* @__PURE__ */ o("div", { className: a.content, children: t }),
35
- /* @__PURE__ */ o("div", { className: a.separator })
36
- ] }) : /* @__PURE__ */ o("div", { className: e, children: /* @__PURE__ */ o("div", { className: a.separator }) });
33
+ return a ? /* @__PURE__ */ _("div", { className: e, children: [
34
+ /* @__PURE__ */ t("div", { className: s.separator }),
35
+ /* @__PURE__ */ t("div", { className: s.content, children: a }),
36
+ /* @__PURE__ */ t("div", { className: s.separator })
37
+ ] }) : /* @__PURE__ */ t("div", { className: e, children: /* @__PURE__ */ t("div", { className: s.separator }) });
37
38
  }
38
39
  export {
39
- N as Separator
40
+ h as Separator
40
41
  };
@@ -1,29 +1,30 @@
1
- import { jsx as a } from "react/jsx-runtime";
1
+ import { jsx as o } from "react/jsx-runtime";
2
2
  import { clsx as l } from "../../utils/clsx.js";
3
- import '../../assets/Spacer.css';const r = "_root_17cx7_1", t = "_horizontal_17cx7_1", c = "_vertical_17cx7_34", s = {
3
+ import '../../assets/Spacer.css';const r = "_root_x8a9c_1", z = "_horizontal_x8a9c_1", c = "_vertical_x8a9c_37", e = {
4
4
  root: r,
5
- horizontal: t,
6
- "size-none": "_size-none_17cx7_4",
7
- "size-hairthin": "_size-hairthin_17cx7_7",
8
- "size-thin": "_size-thin_17cx7_10",
9
- "size-xxsmall": "_size-xxsmall_17cx7_13",
10
- "size-xsmall": "_size-xsmall_17cx7_16",
11
- "size-small": "_size-small_17cx7_19",
12
- "size-normal": "_size-normal_17cx7_22",
13
- "size-large": "_size-large_17cx7_25",
14
- "size-xlarge": "_size-xlarge_17cx7_28",
15
- "size-safezone": "_size-safezone_17cx7_31",
5
+ horizontal: z,
6
+ "size-none": "_size-none_x8a9c_4",
7
+ "size-hairthin": "_size-hairthin_x8a9c_7",
8
+ "size-thin": "_size-thin_x8a9c_10",
9
+ "size-xxsmall": "_size-xxsmall_x8a9c_13",
10
+ "size-xsmall": "_size-xsmall_x8a9c_16",
11
+ "size-small": "_size-small_x8a9c_19",
12
+ "size-normal": "_size-normal_x8a9c_22",
13
+ "size-medium": "_size-medium_x8a9c_25",
14
+ "size-large": "_size-large_x8a9c_28",
15
+ "size-xlarge": "_size-xlarge_x8a9c_31",
16
+ "size-safezone": "_size-safezone_x8a9c_34",
16
17
  vertical: c
17
18
  };
18
- function x(i) {
19
+ function x(s) {
19
20
  const {
20
- size: _ = "normal",
21
- vertical: e = !1
22
- } = i, o = l(s.root, s[`size-${_}`], {
23
- [s.horizontal]: !e,
24
- [s.vertical]: e
21
+ size: i = "normal",
22
+ vertical: a = !1
23
+ } = s, _ = l(e.root, e[`size-${i}`], {
24
+ [e.horizontal]: !a,
25
+ [e.vertical]: a
25
26
  });
26
- return /* @__PURE__ */ a("div", { className: o });
27
+ return /* @__PURE__ */ o("div", { className: _ });
27
28
  }
28
29
  export {
29
30
  x as Spacer
@@ -1,17 +1,29 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- interface ITableProps {
4
- headers: string[];
5
- data: Array<Array<string | number | Date | React.ReactNode>>;
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?: React.FC<{
9
- item: string | number | Date | React.ReactNode;
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, useSort, sortBy: initialSortBy, sortOrder: initialSortOrder, onSortChange, }: ITableProps): import("react/jsx-runtime").JSX.Element;
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 {};