@cfx-dev/ui-components 2.0.10 → 2.1.1

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,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 s } from "react/jsx-runtime";
2
- import u from "react";
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", E = "_stretch_w5him_51", T = "_horizontal_w5him_57", e = {
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: E,
22
- horizontal: T,
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 j(r, i) {
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
- stretch: o = !1,
42
- wrap: c = !1,
43
- alignToEnd: h = !1,
44
- alignToEndAxis: m = !1,
45
- spaceBetween: p = !1,
46
- reverseOrder: w = !1,
47
- gap: g = "normal",
48
- children: d,
49
- className: x
50
- } = r, f = b(e.root, x, e[`gap-${g}`], {
51
- [e["full-width"]]: _,
52
- [e["full-height"]]: n,
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]: o,
61
- [e.wrap]: c,
62
- [e["align-to-end"]]: h,
63
- [e["align-to-end-axis"]]: m,
64
- [e["space-between"]]: p,
65
- [e["reverse-order"]]: w
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__ */ s("div", { ref: i, className: f, children: d });
65
+ return /* @__PURE__ */ i(
66
+ u,
67
+ {
68
+ ref: s,
69
+ className: d,
70
+ ...x,
71
+ children: w
72
+ }
73
+ );
68
74
  }
69
- const A = u.forwardRef(j), l = A;
70
- l.Restricted = function({
71
- children: i
75
+ const j = f.forwardRef(T), _ = j;
76
+ _.Restricted = function({
77
+ children: s
72
78
  }) {
73
- return /* @__PURE__ */ s(l, { children: /* @__PURE__ */ s(v, { children: i }) });
79
+ return /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(v, { children: s }) });
74
80
  };
75
81
  export {
76
- l as Flex
82
+ _ as Flex
77
83
  };
@@ -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 {};
@@ -1,86 +1,145 @@
1
- import { jsx as o, jsxs as i } from "react/jsx-runtime";
2
- import f, { useState as m } from "react";
3
- import O from "../Checkbox/Checkbox.js";
4
- import j from "../IconButton/IconButton.js";
5
- import '../../assets/Table.css';const x = "_pointer_19b0f_18", A = "_selectedRow_19b0f_22", E = "_headerContent_19b0f_40", z = "_sortButton_19b0f_47", l = {
6
- "table-responsive": "_table-responsive_19b0f_1",
7
- pointer: x,
8
- selectedRow: A,
9
- headerContent: E,
10
- sortButton: z
1
+ import { jsx as t, jsxs as C } from "react/jsx-runtime";
2
+ import l, { useState as k } from "react";
3
+ import g from "../Checkbox/Checkbox.js";
4
+ import B from "../IconButton/IconButton.js";
5
+ import { Text as v } from "../Text/Text.js";
6
+ import { clsx as y } from "../../utils/clsx.js";
7
+ import '../../assets/Table.css';const $ = "_root_13qg4_1", T = "_radio_13qg4_14", j = "_pointer_13qg4_21", z = "_selectedRow_13qg4_24", A = "_headerContent_13qg4_34", E = "_sortable_13qg4_40", O = "_empty_13qg4_40", S = "_sortButton_13qg4_43", r = {
8
+ root: $,
9
+ radio: T,
10
+ pointer: j,
11
+ selectedRow: z,
12
+ headerContent: A,
13
+ sortable: E,
14
+ empty: O,
15
+ sortButton: S
11
16
  };
12
- function F({
13
- headers: u = [],
14
- data: B = [],
15
- includeRadio: r = !1,
16
- onSelectChange: c,
17
+ function F(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 = y(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__ */ C("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 H(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 = y({
62
+ [r.selectedRow]: s === e,
63
+ [r.pointer]: o
64
+ });
65
+ return /* @__PURE__ */ C(
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
+ g,
73
+ {
74
+ size: "small",
75
+ onCheckedChange: f,
76
+ "aria-label": `${e}`,
77
+ checked: s === e
78
+ }
79
+ ) }),
80
+ b.map((n, u) => {
81
+ let d;
82
+ return l.isValidElement(n) ? d = n : m ? d = l.createElement(m, { item: n }) : d = String(n), /* @__PURE__ */ t("td", { children: d }, `item-${u}`);
83
+ })
84
+ ]
85
+ },
86
+ `row-${e}`
87
+ );
88
+ }
89
+ function L({
90
+ headers: h = [],
91
+ data: e = [],
92
+ includeRadio: o = !1,
93
+ onSelectChange: s,
17
94
  dataContainer: b,
18
- useSort: n = !1,
19
- sortBy: k,
20
- sortOrder: v = "asc",
21
- onSortChange: d
95
+ selectedRow: m = null,
96
+ sortBy: a,
97
+ sortOrder: f = "asc",
98
+ onSortChange: _
22
99
  }) {
23
- const [p, y] = m(null), [R, w] = m(k), [$, N] = m(v), _ = (e) => {
24
- const t = R === e && $ === "asc" ? "desc" : "asc";
25
- w(e), N(t), d == null || d(e, t);
26
- }, h = f.useCallback(
27
- (e, s) => {
28
- if (typeof e == "boolean") {
29
- const t = e ? s : null;
30
- y(t), t !== null && (c == null || c(t));
31
- }
100
+ const [p, n] = k(m), [u, d] = k(a), [w, x] = k(f), q = l.useCallback((c) => {
101
+ const R = u === c && w === "asc" ? "desc" : "asc";
102
+ d(c), x(R), _ == null || _(c, R);
103
+ }, [_, u, w]), N = l.useCallback(
104
+ (c) => {
105
+ const i = c === p ? null : c;
106
+ n(i), s == null || s(i);
32
107
  },
33
- [c]
108
+ [s, p]
34
109
  );
35
- return /* @__PURE__ */ o("div", { className: l.tableResponsive, children: /* @__PURE__ */ i("table", { children: [
36
- /* @__PURE__ */ o("thead", { children: /* @__PURE__ */ i("tr", { children: [
37
- r && /* @__PURE__ */ o("th", { "aria-label": "Select Row" }),
38
- u.map((e, s) => /* @__PURE__ */ o(
39
- "th",
110
+ return l.useEffect(() => {
111
+ n(m);
112
+ }, [m]), l.useEffect(() => {
113
+ d(a);
114
+ }, [a]), l.useEffect(() => {
115
+ x(f);
116
+ }, [f]), /* @__PURE__ */ t("div", { className: r.root, children: /* @__PURE__ */ C("table", { children: [
117
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ C("tr", { children: [
118
+ o && /* @__PURE__ */ t("th", { "aria-label": "Select Row" }),
119
+ h.map((c, i) => /* @__PURE__ */ t(
120
+ F,
40
121
  {
41
- className: n ? l.pointer : "",
42
- onClick: () => n && _(e),
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: q
55
124
  },
56
- `header-${s}`
125
+ `header-${i}`
57
126
  ))
58
127
  ] }) }),
59
- /* @__PURE__ */ o("tbody", { children: B.map((e, s) => /* @__PURE__ */ i(
60
- "tr",
128
+ /* @__PURE__ */ t("tbody", { children: e.map((c, i) => /* @__PURE__ */ t(
129
+ H,
61
130
  {
62
- className: `${p === s ? l.selectedRow : ""} ${r ? l.pointer : ""}`,
63
- onClick: r ? () => h(!0, s) : void 0,
64
- children: [
65
- r && /* @__PURE__ */ o("td", { children: /* @__PURE__ */ o(
66
- O,
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: i,
132
+ item: c,
133
+ includeRadio: o,
134
+ selectedRow: p,
135
+ onSelectChange: N,
136
+ dataContainer: b
79
137
  },
80
- `row-${s}`
138
+ `row-${i}`
81
139
  )) })
82
140
  ] }) });
83
141
  }
84
142
  export {
85
- F as Table
143
+ L as Table,
144
+ F 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 = ["Header 1", "Header 2", "Header 3", "Date", "Item"];
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: [
@@ -0,0 +1,2 @@
1
+ export { Table } from './Table';
2
+ export type { TableProps } from './Table';
@@ -0,0 +1,4 @@
1
+ import { Table as r } from "./Table.js";
2
+ export {
3
+ r as Table
4
+ };
@@ -1,17 +1,54 @@
1
1
  import { TextProps } from './Text/Text.types';
2
2
 
3
- export type OffesetType = 'none' | 'hairthin' | 'thin' | 'xxsmall' | 'xsmall' | 'small' | 'normal' | 'medium' | 'large' | 'xlarge' | 'safezone';
4
- export type MediaQueryType = 'initial' | 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
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
  }