@cfx-dev/ui-components 0.0.19 → 0.0.20
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.js +4 -4
- 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.js +21 -21
- 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.js +10 -10
- package/dist/components/Select/Select.js +652 -663
- package/dist/components/Shroud/Shroud.js +16 -16
- 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.js +2 -2
- 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 +12 -22
- package/dist/main.js +143 -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 -0
- package/dist/utils/hooks.js +100 -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,34 @@
|
|
|
1
1
|
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import '../../assets/Shroud.css';const _ = "_root_7v6x1_1",
|
|
2
|
+
import s from "react";
|
|
3
|
+
import { ui as p } from "../ui.js";
|
|
4
|
+
import { useOutletBefore as v, useWindowResize as x } from "../../utils/hooks.js";
|
|
5
|
+
import '../../assets/Shroud.css';const _ = "_root_7v6x1_1", g = "_tile_7v6x1_6", e = {
|
|
6
6
|
root: _,
|
|
7
|
-
tile:
|
|
8
|
-
}, S =
|
|
7
|
+
tile: g
|
|
8
|
+
}, S = s.forwardRef(function(c, n) {
|
|
9
9
|
const {
|
|
10
10
|
forRef: r
|
|
11
|
-
} = c, [u, d] =
|
|
11
|
+
} = c, [u, d] = s.useState({}), f = v("title"), i = s.useCallback(() => {
|
|
12
12
|
if (!r.current)
|
|
13
13
|
return;
|
|
14
|
-
const
|
|
15
|
-
x:
|
|
16
|
-
y:
|
|
17
|
-
w:
|
|
18
|
-
h:
|
|
14
|
+
const o = r.current.getBoundingClientRect(), h = {
|
|
15
|
+
x: o.x,
|
|
16
|
+
y: o.y,
|
|
17
|
+
w: o.width,
|
|
18
|
+
h: o.height,
|
|
19
19
|
sw: globalThis.screen.availWidth,
|
|
20
20
|
sh: globalThis.screen.availHeight
|
|
21
21
|
};
|
|
22
22
|
d(
|
|
23
23
|
Object.fromEntries(
|
|
24
|
-
Object.entries(h).flatMap(([
|
|
25
|
-
[`--${
|
|
26
|
-
[`--${
|
|
24
|
+
Object.entries(h).flatMap(([l, a]) => [
|
|
25
|
+
[`--${l}`, p.px(a)],
|
|
26
|
+
[`--${l}-raw`, a]
|
|
27
27
|
])
|
|
28
28
|
)
|
|
29
29
|
);
|
|
30
30
|
}, []);
|
|
31
|
-
return
|
|
31
|
+
return s.useEffect(i, []), x(i), /* @__PURE__ */ t(f, { children: /* @__PURE__ */ m("div", { ref: n, className: e.root, style: u, children: [
|
|
32
32
|
/* @__PURE__ */ t("div", { className: e.tile, "data-top": !0 }),
|
|
33
33
|
/* @__PURE__ */ t("div", { className: e.tile, "data-left": !0 }),
|
|
34
34
|
/* @__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,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as L, Fragment as k, 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 C from "../../utils/mergeRefs.js";
|
|
4
|
+
import { useOutlet as y } from "../../utils/hooks.js";
|
|
5
|
+
import { mergeRefs as C } from "../../utils/mergeRefs.js";
|
|
6
6
|
import '../../assets/Title.css';const R = "_wrapper_1l1sn_1", T = "_appearance_1l1sn_1", $ = "_animated_1l1sn_26", M = "_root_1l1sn_71", N = "_shortcut_1l1sn_84", m = {
|
|
7
7
|
wrapper: R,
|
|
8
8
|
appearance: T,
|
|
@@ -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);
|