@cfx-dev/ui-components 0.0.19 → 0.0.21
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/Combination-Dp_plIQU.js +793 -0
- package/dist/{Icons-B26SczGZ.js → Icons-BlBKvJD8.js} +40 -98
- package/dist/{Rail-BCY3h7eP.js → Rail-CCuyJpf6.js} +11 -11
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/assets/InputDropzone.css +1 -0
- package/dist/assets/ItemPreview.css +1 -0
- package/dist/assets/Table.css +1 -0
- package/dist/components/BackdropPortal/BackdropPortal.d.ts +1 -0
- package/dist/components/BackdropPortal/BackdropPortal.js +9 -7
- package/dist/components/Badge/Badge.d.ts +2 -2
- package/dist/components/Button/Button.d.ts +2 -1
- package/dist/components/Button/Button.js +27 -25
- package/dist/components/Button/ButtonBar.d.ts +0 -1
- package/dist/components/Button/LinkButton.js +13 -13
- package/dist/components/Flyout/Flyout.d.ts +1 -0
- package/dist/components/Flyout/Flyout.js +28 -27
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/RichInput.js +2 -2
- package/dist/components/InputDropzone/InputDropzone.d.ts +14 -0
- package/dist/components/InputDropzone/InputDropzone.js +1103 -0
- package/dist/components/InputDropzone/ItemPreview.d.ts +8 -0
- package/dist/components/InputDropzone/ItemPreview.js +24 -0
- package/dist/components/Layout/Scrollable/Rail.js +3 -3
- package/dist/components/Layout/Scrollable/Scrollable.js +2 -2
- package/dist/components/Layout/Scrollable/VirtualScrollable.js +3 -4
- package/dist/components/Modal/Modal.d.ts +0 -2
- package/dist/components/Modal/Modal.js +3 -3
- package/dist/components/NavList/NavList.js +5 -5
- package/dist/components/OnScreenSensor.js +6 -6
- package/dist/components/Overlay/Overlay.d.ts +1 -0
- package/dist/components/Overlay/Overlay.js +16 -15
- package/dist/components/Select/Select.js +652 -663
- package/dist/components/Shroud/Shroud.js +20 -19
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/Table.d.ts +17 -0
- package/dist/components/Table/Table.js +61 -0
- package/dist/components/Tabular/Tabular.d.ts +1 -1
- package/dist/components/Text/Text.types.d.ts +0 -1
- package/dist/components/Title/Title.d.ts +1 -0
- package/dist/components/Title/Title.js +26 -25
- package/dist/{extends-Dk_bSU3E.js → extends-hS2Bh-Yp.js} +1 -2
- package/dist/{index-C75OpfGQ.js → index-2hJuj4UN.js} +2018 -2526
- package/dist/index-DQMInta3.js +663 -0
- package/dist/index.esm-BkynlSN6.js +72 -0
- package/dist/main.d.ts +17 -26
- package/dist/main.js +145 -122
- package/dist/{medium-Dc7QRuE0.js → medium-JVtzoF2c.js} +3 -3
- package/dist/style-guide/Colours/DarkThemeSwatches.d.ts +2 -0
- package/dist/style-guide/Colours/DarkThemeSwatches.js +110 -0
- package/dist/style-guide/Colours/LightThemeSwatches.d.ts +2 -0
- package/dist/style-guide/Colours/LightThemeSwatches.js +105 -0
- package/dist/style-guide/Colours/Swatches.d.ts +6 -0
- package/dist/style-guide/Colours/Swatches.js +48 -0
- package/dist/style-guide/Icons/IconDisplayGrid.d.ts +2 -0
- package/dist/style-guide/Icons/IconDisplayGrid.js +42 -0
- package/dist/style-guide/Icons/Icons.js +7 -0
- package/dist/tslib.es6-CBKHJX9H.js +151 -0
- package/dist/utils/functional.js +19 -6
- package/dist/utils/hooks.d.ts +2 -1
- package/dist/utils/hooks.js +77 -10
- package/dist/utils/links.js +1128 -12
- package/dist/utils/math.js +8 -3
- package/dist/utils/mergeRefs.d.ts +1 -1
- package/dist/utils/mergeRefs.js +2 -2
- package/dist/utils/outlet.js +19 -4
- package/dist/utils/string.js +42 -7
- package/package.json +7 -13
- package/dist/Combination-Dj-a6dCZ.js +0 -1462
- package/dist/components/Icons.js +0 -6
- package/dist/functional-C0pE183N.js +0 -30
- package/dist/hooks-GAujvL7d.js +0 -86
- package/dist/links-CgOD-Vfj.js +0 -1142
- package/dist/math-i2ceybzU.js +0 -16
- package/dist/outlet-B11a3Kgw.js +0 -27
- package/dist/string-NVxCUbqk.js +0 -54
- package/dist/tslib.es6-Dd_EkEfR.js +0 -48
- /package/dist/{components → style-guide/Icons}/Icons.d.ts +0 -0
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { ui as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as t, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
3
|
+
import { TITLE_OUTLET_ID as p } from "../Title/Title.js";
|
|
4
|
+
import { ui as _ } from "../ui.js";
|
|
5
|
+
import { useOutlet as v, useWindowResize as x } from "../../utils/hooks.js";
|
|
6
|
+
import '../../assets/Shroud.css';const b = "_root_7v6x1_1", g = "_tile_7v6x1_6", e = {
|
|
7
|
+
root: b,
|
|
8
|
+
tile: g
|
|
9
|
+
}, S = r.forwardRef(function(c, n) {
|
|
9
10
|
const {
|
|
10
|
-
forRef:
|
|
11
|
-
} = c, [u, d] =
|
|
12
|
-
if (!
|
|
11
|
+
forRef: s
|
|
12
|
+
} = c, [u, d] = r.useState({}), f = v(p, "before"), i = r.useCallback(() => {
|
|
13
|
+
if (!s.current)
|
|
13
14
|
return;
|
|
14
|
-
const
|
|
15
|
-
x:
|
|
16
|
-
y:
|
|
17
|
-
w:
|
|
18
|
-
h:
|
|
15
|
+
const o = s.current.getBoundingClientRect(), m = {
|
|
16
|
+
x: o.x,
|
|
17
|
+
y: o.y,
|
|
18
|
+
w: o.width,
|
|
19
|
+
h: o.height,
|
|
19
20
|
sw: globalThis.screen.availWidth,
|
|
20
21
|
sh: globalThis.screen.availHeight
|
|
21
22
|
};
|
|
22
23
|
d(
|
|
23
24
|
Object.fromEntries(
|
|
24
|
-
Object.entries(
|
|
25
|
-
[`--${a}`,
|
|
25
|
+
Object.entries(m).flatMap(([a, l]) => [
|
|
26
|
+
[`--${a}`, _.px(l)],
|
|
26
27
|
[`--${a}-raw`, l]
|
|
27
28
|
])
|
|
28
29
|
)
|
|
29
30
|
);
|
|
30
31
|
}, []);
|
|
31
|
-
return
|
|
32
|
+
return r.useEffect(i, []), x(i), /* @__PURE__ */ t(f, { children: /* @__PURE__ */ h("div", { ref: n, className: e.root, style: u, children: [
|
|
32
33
|
/* @__PURE__ */ t("div", { className: e.tile, "data-top": !0 }),
|
|
33
34
|
/* @__PURE__ */ t("div", { className: e.tile, "data-left": !0 }),
|
|
34
35
|
/* @__PURE__ */ t("div", { className: e.tile, "data-right": !0 }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import d from "react";
|
|
3
|
-
import { clsx as _ } from "../../utils/clsx.js";
|
|
4
3
|
import { Interactive as S } from "../Interactive/Interactive.js";
|
|
4
|
+
import { clsx as _ } from "../../utils/clsx.js";
|
|
5
5
|
import '../../assets/Switch.css';const g = "_root_11dd4_1", j = "_disabled_11dd4_7", k = "_descripted_11dd4_11", w = "_multiline_11dd4_14", E = "_options_11dd4_18", L = "_option_11dd4_18", O = "_description_11dd4_25", I = "_active_11dd4_73", e = {
|
|
6
6
|
root: g,
|
|
7
7
|
disabled: j,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ITableProps {
|
|
4
|
+
headers: string[];
|
|
5
|
+
data: Array<Array<string | number | Date | React.ReactNode>>;
|
|
6
|
+
includeRadio?: boolean;
|
|
7
|
+
onSelectChange?: (rowIndex: number) => void;
|
|
8
|
+
dataContainer?: React.FC<{
|
|
9
|
+
item: string | number | Date | React.ReactNode;
|
|
10
|
+
}> | undefined;
|
|
11
|
+
useSort?: boolean;
|
|
12
|
+
sortBy?: string;
|
|
13
|
+
sortOrder?: 'asc' | 'desc';
|
|
14
|
+
onSortChange?: (sortBy: string, sortOrder: 'asc' | 'desc') => void;
|
|
15
|
+
}
|
|
16
|
+
declare function Table({ headers, data, includeRadio, onSelectChange, dataContainer, useSort, sortBy: initialSortBy, sortOrder: initialSortOrder, onSortChange, }: ITableProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default Table;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import o, { useState as i } from "react";
|
|
3
|
+
import { F, a as A } from "../../index.esm-BkynlSN6.js";
|
|
4
|
+
import '../../assets/Table.css';const E = "_selectedRow_1jg2j_23", _ = {
|
|
5
|
+
"table-responsive": "_table-responsive_1jg2j_1",
|
|
6
|
+
selectedRow: E
|
|
7
|
+
};
|
|
8
|
+
function S({
|
|
9
|
+
headers: h = [],
|
|
10
|
+
data: w = [],
|
|
11
|
+
includeRadio: n = !1,
|
|
12
|
+
onSelectChange: c,
|
|
13
|
+
dataContainer: p,
|
|
14
|
+
useSort: m = !1,
|
|
15
|
+
sortBy: j,
|
|
16
|
+
sortOrder: v = "asc",
|
|
17
|
+
onSortChange: d
|
|
18
|
+
}) {
|
|
19
|
+
const [b, f] = i(null), [u, y] = i(j), [R, k] = i(v), O = (e) => {
|
|
20
|
+
const l = u === e && R === "asc" ? "desc" : "asc";
|
|
21
|
+
y(e), k(l), d == null || d(e, l);
|
|
22
|
+
}, $ = o.useCallback((e) => {
|
|
23
|
+
f(parseInt(e.target.value, 10)), c == null || c(parseInt(e.target.value, 10));
|
|
24
|
+
}, [f, c]);
|
|
25
|
+
return /* @__PURE__ */ t("div", { className: _.table, children: /* @__PURE__ */ a("table", { children: [
|
|
26
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ a("tr", { children: [
|
|
27
|
+
n && /* @__PURE__ */ t("th", { children: "Select Row" }),
|
|
28
|
+
h.map((e, s) => /* @__PURE__ */ a("th", { onClick: () => m && O(e), children: [
|
|
29
|
+
e,
|
|
30
|
+
m && u === e && /* @__PURE__ */ t("span", { children: R === "asc" ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(A, {}) })
|
|
31
|
+
] }, `header-${s}`))
|
|
32
|
+
] }) }),
|
|
33
|
+
/* @__PURE__ */ t("tbody", { children: w.map((e, s) => /* @__PURE__ */ a(
|
|
34
|
+
"tr",
|
|
35
|
+
{
|
|
36
|
+
className: b === s ? _.selectedRow : "",
|
|
37
|
+
children: [
|
|
38
|
+
n && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(
|
|
39
|
+
"input",
|
|
40
|
+
{
|
|
41
|
+
type: "radio",
|
|
42
|
+
name: "tableRowSelect",
|
|
43
|
+
value: s,
|
|
44
|
+
checked: b === s,
|
|
45
|
+
onChange: $,
|
|
46
|
+
"aria-label": `${s}`
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
e.map((l, B) => {
|
|
50
|
+
let r;
|
|
51
|
+
return o.isValidElement(l) ? r = l : p ? r = o.createElement(p, { item: l }) : r = String(l), /* @__PURE__ */ t("td", { children: r }, `item-${B}`);
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
`row-${s}`
|
|
56
|
+
)) })
|
|
57
|
+
] }) });
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
S as default
|
|
61
|
+
};
|
|
@@ -15,7 +15,7 @@ export declare function Tabular(props: TabularProps): import("react/jsx-runtime"
|
|
|
15
15
|
export declare namespace Tabular {
|
|
16
16
|
var Root: (props: TabularRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
var Item: React.ForwardRefExoticComponent<Pick<TabularItem, "label" | "disabled" | "icon"> & {
|
|
18
|
-
active?: boolean
|
|
18
|
+
active?: boolean;
|
|
19
19
|
onClick?(): void;
|
|
20
20
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
21
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export type TextColor = 'inherit' | 'main' | 'primary' | 'teal' | 'success' | 'warning' | 'error';
|
|
3
2
|
export type TextSize = 'xsmall' | 'small' | 'normal' | 'large' | 'xlarge' | 'xxlarge';
|
|
4
3
|
export type TextWeight = 'thin' | 'normal' | 'bold' | 'bolder';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
+
export declare const TITLE_OUTLET_ID = "title-outlet";
|
|
3
4
|
type FixedOn = 'top' | 'top-left' | 'right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left';
|
|
4
5
|
type TitleChildren = ((ref: React.RefObject<any>) => React.ReactNode) | React.ReactElement;
|
|
5
6
|
export interface TitleProps {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as T, Fragment as w, jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import f from "react";
|
|
3
3
|
import { clsx as O } from "../../utils/clsx.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import '../../assets/Title.css';const
|
|
7
|
-
wrapper:
|
|
8
|
-
appearance:
|
|
4
|
+
import { useOutlet as k } from "../../utils/hooks.js";
|
|
5
|
+
import { mergeRefs as y } from "../../utils/mergeRefs.js";
|
|
6
|
+
import '../../assets/Title.css';const C = "_wrapper_1l1sn_1", R = "_appearance_1l1sn_1", $ = "_animated_1l1sn_26", M = "_root_1l1sn_71", N = "_shortcut_1l1sn_84", m = {
|
|
7
|
+
wrapper: C,
|
|
8
|
+
appearance: R,
|
|
9
9
|
animated: $,
|
|
10
10
|
"fixed-on-top": "_fixed-on-top_1l1sn_29",
|
|
11
11
|
"fixed-on-top-left": "_fixed-on-top-left_1l1sn_35",
|
|
@@ -16,9 +16,9 @@ import '../../assets/Title.css';const R = "_wrapper_1l1sn_1", T = "_appearance_1
|
|
|
16
16
|
"fixed-on-right": "_fixed-on-right_1l1sn_65",
|
|
17
17
|
root: M,
|
|
18
18
|
shortcut: N
|
|
19
|
-
}, i = 10;
|
|
20
|
-
function
|
|
21
|
-
const r =
|
|
19
|
+
}, i = 10, S = "title-outlet";
|
|
20
|
+
function F(l, a, [e, n]) {
|
|
21
|
+
const r = l ? n : n - 20, s = l ? e : e + 16;
|
|
22
22
|
return {
|
|
23
23
|
// Prefer top and left for element to snap to the pixel grid
|
|
24
24
|
// as when using transform it will become blurry in most of the cases as top and left values are floats
|
|
@@ -26,18 +26,18 @@ function S(a, l, [e, n]) {
|
|
|
26
26
|
left: `${s}px`,
|
|
27
27
|
// transform: `translate(${left}px, ${top}px)`,
|
|
28
28
|
maxWidth: `calc(100vw - ${s}px - 10px)`,
|
|
29
|
-
animationDelay: `${
|
|
29
|
+
animationDelay: `${a}ms`
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function I(l, a) {
|
|
33
33
|
const {
|
|
34
34
|
x: e,
|
|
35
35
|
y: n,
|
|
36
36
|
width: r,
|
|
37
37
|
height: s
|
|
38
|
-
} =
|
|
38
|
+
} = l.getBoundingClientRect();
|
|
39
39
|
let t = 0, c = 0;
|
|
40
|
-
switch (
|
|
40
|
+
switch (a) {
|
|
41
41
|
case "top": {
|
|
42
42
|
t = e + r / 2, c = n - i;
|
|
43
43
|
break;
|
|
@@ -69,21 +69,21 @@ function F(a, l) {
|
|
|
69
69
|
}
|
|
70
70
|
return [t, c];
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function B(l) {
|
|
73
73
|
const {
|
|
74
|
-
title:
|
|
74
|
+
title: a,
|
|
75
75
|
children: e,
|
|
76
76
|
animated: n = !0,
|
|
77
77
|
fixedOn: r = "bottom",
|
|
78
78
|
delay: s = 0
|
|
79
|
-
} =
|
|
79
|
+
} = l, t = f.useRef(r);
|
|
80
80
|
t.current = r;
|
|
81
|
-
const c =
|
|
81
|
+
const c = k(S), o = f.useRef(null), [g, x] = f.useState(!1), [E, _] = f.useState([0, 0]);
|
|
82
82
|
f.useEffect(() => {
|
|
83
83
|
if (!o.current)
|
|
84
84
|
return;
|
|
85
85
|
const d = (u) => {
|
|
86
|
-
t.current && o.current ? _(
|
|
86
|
+
t.current && o.current ? _(I(o.current, t.current)) : _([u.clientX, u.clientY]), x(!0);
|
|
87
87
|
}, v = () => {
|
|
88
88
|
x(!1);
|
|
89
89
|
}, b = (u) => {
|
|
@@ -94,20 +94,21 @@ function D(a) {
|
|
|
94
94
|
};
|
|
95
95
|
}, []);
|
|
96
96
|
let h = null;
|
|
97
|
-
if (g &&
|
|
97
|
+
if (g && a) {
|
|
98
98
|
const d = O(m.wrapper, m[`fixed-on-${r}`], {
|
|
99
99
|
[m.animated]: n
|
|
100
100
|
});
|
|
101
|
-
h = /* @__PURE__ */ p(c, { children: /* @__PURE__ */ p("div", { className: d, style:
|
|
101
|
+
h = /* @__PURE__ */ p(c, { children: /* @__PURE__ */ p("div", { className: d, style: F(!!r, s, E), children: /* @__PURE__ */ p("div", { className: m.root, children: a }) }) });
|
|
102
102
|
}
|
|
103
|
-
const
|
|
104
|
-
ref:
|
|
103
|
+
const L = typeof e == "function" ? e(o) : f.cloneElement(e, {
|
|
104
|
+
ref: y(o, e.props.ref)
|
|
105
105
|
});
|
|
106
|
-
return /* @__PURE__ */
|
|
107
|
-
|
|
106
|
+
return /* @__PURE__ */ T(w, { children: [
|
|
107
|
+
L,
|
|
108
108
|
h
|
|
109
109
|
] });
|
|
110
110
|
}
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
S as TITLE_OUTLET_ID,
|
|
113
|
+
B as Title
|
|
113
114
|
};
|
|
@@ -2,8 +2,7 @@ function e() {
|
|
|
2
2
|
return e = Object.assign ? Object.assign.bind() : function(t) {
|
|
3
3
|
for (var n = 1; n < arguments.length; n++) {
|
|
4
4
|
var r = arguments[n];
|
|
5
|
-
for (var a in r)
|
|
6
|
-
({}).hasOwnProperty.call(r, a) && (t[a] = r[a]);
|
|
5
|
+
for (var a in r) ({}).hasOwnProperty.call(r, a) && (t[a] = r[a]);
|
|
7
6
|
}
|
|
8
7
|
return t;
|
|
9
8
|
}, e.apply(null, arguments);
|