@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.
Files changed (73) hide show
  1. package/dist/Combination-Dp_plIQU.js +793 -0
  2. package/dist/{Icons-B26SczGZ.js → Icons-BlBKvJD8.js} +40 -98
  3. package/dist/{Rail-BCY3h7eP.js → Rail-CCuyJpf6.js} +11 -11
  4. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  5. package/dist/assets/InputDropzone.css +1 -0
  6. package/dist/assets/ItemPreview.css +1 -0
  7. package/dist/assets/Table.css +1 -0
  8. package/dist/components/BackdropPortal/BackdropPortal.js +4 -4
  9. package/dist/components/Badge/Badge.d.ts +2 -2
  10. package/dist/components/Button/Button.d.ts +2 -1
  11. package/dist/components/Button/Button.js +27 -25
  12. package/dist/components/Button/ButtonBar.d.ts +0 -1
  13. package/dist/components/Button/LinkButton.js +13 -13
  14. package/dist/components/Flyout/Flyout.js +21 -21
  15. package/dist/components/Input/Input.js +1 -1
  16. package/dist/components/Input/RichInput.js +2 -2
  17. package/dist/components/InputDropzone/InputDropzone.d.ts +14 -0
  18. package/dist/components/InputDropzone/InputDropzone.js +1103 -0
  19. package/dist/components/InputDropzone/ItemPreview.d.ts +8 -0
  20. package/dist/components/InputDropzone/ItemPreview.js +24 -0
  21. package/dist/components/Layout/Scrollable/Rail.js +3 -3
  22. package/dist/components/Layout/Scrollable/Scrollable.js +2 -2
  23. package/dist/components/Layout/Scrollable/VirtualScrollable.js +3 -4
  24. package/dist/components/Modal/Modal.d.ts +0 -2
  25. package/dist/components/Modal/Modal.js +3 -3
  26. package/dist/components/NavList/NavList.js +5 -5
  27. package/dist/components/OnScreenSensor.js +6 -6
  28. package/dist/components/Overlay/Overlay.js +10 -10
  29. package/dist/components/Select/Select.js +652 -663
  30. package/dist/components/Shroud/Shroud.js +16 -16
  31. package/dist/components/Switch/Switch.js +1 -1
  32. package/dist/components/Table/Table.d.ts +17 -0
  33. package/dist/components/Table/Table.js +61 -0
  34. package/dist/components/Tabular/Tabular.d.ts +1 -1
  35. package/dist/components/Text/Text.types.d.ts +0 -1
  36. package/dist/components/Title/Title.js +2 -2
  37. package/dist/{extends-Dk_bSU3E.js → extends-hS2Bh-Yp.js} +1 -2
  38. package/dist/{index-C75OpfGQ.js → index-2hJuj4UN.js} +2018 -2526
  39. package/dist/index-DQMInta3.js +663 -0
  40. package/dist/index.esm-BkynlSN6.js +72 -0
  41. package/dist/main.d.ts +12 -22
  42. package/dist/main.js +143 -122
  43. package/dist/{medium-Dc7QRuE0.js → medium-JVtzoF2c.js} +3 -3
  44. package/dist/style-guide/Colours/DarkThemeSwatches.d.ts +2 -0
  45. package/dist/style-guide/Colours/DarkThemeSwatches.js +110 -0
  46. package/dist/style-guide/Colours/LightThemeSwatches.d.ts +2 -0
  47. package/dist/style-guide/Colours/LightThemeSwatches.js +105 -0
  48. package/dist/style-guide/Colours/Swatches.d.ts +6 -0
  49. package/dist/style-guide/Colours/Swatches.js +48 -0
  50. package/dist/style-guide/Icons/IconDisplayGrid.d.ts +2 -0
  51. package/dist/style-guide/Icons/IconDisplayGrid.js +42 -0
  52. package/dist/style-guide/Icons/Icons.js +7 -0
  53. package/dist/tslib.es6-CBKHJX9H.js +151 -0
  54. package/dist/utils/functional.js +19 -6
  55. package/dist/utils/hooks.d.ts +2 -0
  56. package/dist/utils/hooks.js +100 -10
  57. package/dist/utils/links.js +1128 -12
  58. package/dist/utils/math.js +8 -3
  59. package/dist/utils/mergeRefs.d.ts +1 -1
  60. package/dist/utils/mergeRefs.js +2 -2
  61. package/dist/utils/outlet.js +19 -4
  62. package/dist/utils/string.js +42 -7
  63. package/package.json +7 -13
  64. package/dist/Combination-Dj-a6dCZ.js +0 -1462
  65. package/dist/components/Icons.js +0 -6
  66. package/dist/functional-C0pE183N.js +0 -30
  67. package/dist/hooks-GAujvL7d.js +0 -86
  68. package/dist/links-CgOD-Vfj.js +0 -1142
  69. package/dist/math-i2ceybzU.js +0 -16
  70. package/dist/outlet-B11a3Kgw.js +0 -27
  71. package/dist/string-NVxCUbqk.js +0 -54
  72. package/dist/tslib.es6-Dd_EkEfR.js +0 -48
  73. /package/dist/{components → style-guide/Icons}/Icons.d.ts +0 -0
@@ -0,0 +1,48 @@
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ function n({
3
+ name: t,
4
+ colorValue: i
5
+ }) {
6
+ return /* @__PURE__ */ r(
7
+ "div",
8
+ {
9
+ style: {
10
+ display: "inline-block",
11
+ margin: "10px",
12
+ padding: "10px",
13
+ border: "1px solid #ccc"
14
+ },
15
+ children: [
16
+ /* @__PURE__ */ e(
17
+ "div",
18
+ {
19
+ style: {
20
+ width: "100px",
21
+ height: "100px",
22
+ backgroundColor: i,
23
+ border: "1px solid #000",
24
+ marginBottom: "5px"
25
+ }
26
+ }
27
+ ),
28
+ /* @__PURE__ */ r(
29
+ "div",
30
+ {
31
+ style: {
32
+ textAlign: "center",
33
+ fontFamily: "Arial, sans-serif"
34
+ },
35
+ children: [
36
+ t,
37
+ ": ",
38
+ i
39
+ ]
40
+ }
41
+ )
42
+ ]
43
+ }
44
+ );
45
+ }
46
+ export {
47
+ n as default
48
+ };
@@ -0,0 +1,2 @@
1
+ declare function IconDisplayGrid(): import("react/jsx-runtime").JSX.Element;
2
+ export default IconDisplayGrid;
@@ -0,0 +1,42 @@
1
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
2
+ import { I as s } from "../../Icons-BlBKvJD8.js";
3
+ function a() {
4
+ const i = Object.entries(s).map(([e, t]) => ({
5
+ name: e,
6
+ component: t
7
+ }));
8
+ return /* @__PURE__ */ n(
9
+ "div",
10
+ {
11
+ style: {
12
+ display: "grid",
13
+ gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))",
14
+ gap: "30px",
15
+ alignItems: "center",
16
+ justifyContent: "center"
17
+ },
18
+ children: i.map(({
19
+ name: e,
20
+ component: t
21
+ }) => /* @__PURE__ */ r(
22
+ "div",
23
+ {
24
+ style: {
25
+ display: "flex",
26
+ flexDirection: "column",
27
+ alignItems: "center",
28
+ justifyContent: "center"
29
+ },
30
+ children: [
31
+ t,
32
+ /* @__PURE__ */ n("span", { style: { marginTop: "10px" }, children: e })
33
+ ]
34
+ },
35
+ e
36
+ ))
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ a as default
42
+ };
@@ -0,0 +1,7 @@
1
+ import "react/jsx-runtime";
2
+ import { B as n, I as p } from "../../Icons-BlBKvJD8.js";
3
+ import "../../index.esm-BkynlSN6.js";
4
+ export {
5
+ n as BrandIcon,
6
+ p as Icons
7
+ };
@@ -0,0 +1,151 @@
1
+ var y = function(c, a) {
2
+ return y = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, e) {
3
+ r.__proto__ = e;
4
+ } || function(r, e) {
5
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (r[o] = e[o]);
6
+ }, y(c, a);
7
+ };
8
+ function h(c, a) {
9
+ if (typeof a != "function" && a !== null)
10
+ throw new TypeError("Class extends value " + String(a) + " is not a constructor or null");
11
+ y(c, a);
12
+ function r() {
13
+ this.constructor = c;
14
+ }
15
+ c.prototype = a === null ? Object.create(a) : (r.prototype = a.prototype, new r());
16
+ }
17
+ var p = function() {
18
+ return p = Object.assign || function(a) {
19
+ for (var r, e = 1, o = arguments.length; e < o; e++) {
20
+ r = arguments[e];
21
+ for (var t in r) Object.prototype.hasOwnProperty.call(r, t) && (a[t] = r[t]);
22
+ }
23
+ return a;
24
+ }, p.apply(this, arguments);
25
+ };
26
+ function _(c, a) {
27
+ var r = {};
28
+ for (var e in c) Object.prototype.hasOwnProperty.call(c, e) && a.indexOf(e) < 0 && (r[e] = c[e]);
29
+ if (c != null && typeof Object.getOwnPropertySymbols == "function")
30
+ for (var o = 0, e = Object.getOwnPropertySymbols(c); o < e.length; o++)
31
+ a.indexOf(e[o]) < 0 && Object.prototype.propertyIsEnumerable.call(c, e[o]) && (r[e[o]] = c[e[o]]);
32
+ return r;
33
+ }
34
+ function d(c, a, r, e) {
35
+ function o(t) {
36
+ return t instanceof r ? t : new r(function(l) {
37
+ l(t);
38
+ });
39
+ }
40
+ return new (r || (r = Promise))(function(t, l) {
41
+ function i(u) {
42
+ try {
43
+ n(e.next(u));
44
+ } catch (s) {
45
+ l(s);
46
+ }
47
+ }
48
+ function f(u) {
49
+ try {
50
+ n(e.throw(u));
51
+ } catch (s) {
52
+ l(s);
53
+ }
54
+ }
55
+ function n(u) {
56
+ u.done ? t(u.value) : o(u.value).then(i, f);
57
+ }
58
+ n((e = e.apply(c, a || [])).next());
59
+ });
60
+ }
61
+ function w(c, a) {
62
+ var r = { label: 0, sent: function() {
63
+ if (t[0] & 1) throw t[1];
64
+ return t[1];
65
+ }, trys: [], ops: [] }, e, o, t, l;
66
+ return l = { next: i(0), throw: i(1), return: i(2) }, typeof Symbol == "function" && (l[Symbol.iterator] = function() {
67
+ return this;
68
+ }), l;
69
+ function i(n) {
70
+ return function(u) {
71
+ return f([n, u]);
72
+ };
73
+ }
74
+ function f(n) {
75
+ if (e) throw new TypeError("Generator is already executing.");
76
+ for (; l && (l = 0, n[0] && (r = 0)), r; ) try {
77
+ if (e = 1, o && (t = n[0] & 2 ? o.return : n[0] ? o.throw || ((t = o.return) && t.call(o), 0) : o.next) && !(t = t.call(o, n[1])).done) return t;
78
+ switch (o = 0, t && (n = [n[0] & 2, t.value]), n[0]) {
79
+ case 0:
80
+ case 1:
81
+ t = n;
82
+ break;
83
+ case 4:
84
+ return r.label++, { value: n[1], done: !1 };
85
+ case 5:
86
+ r.label++, o = n[1], n = [0];
87
+ continue;
88
+ case 7:
89
+ n = r.ops.pop(), r.trys.pop();
90
+ continue;
91
+ default:
92
+ if (t = r.trys, !(t = t.length > 0 && t[t.length - 1]) && (n[0] === 6 || n[0] === 2)) {
93
+ r = 0;
94
+ continue;
95
+ }
96
+ if (n[0] === 3 && (!t || n[1] > t[0] && n[1] < t[3])) {
97
+ r.label = n[1];
98
+ break;
99
+ }
100
+ if (n[0] === 6 && r.label < t[1]) {
101
+ r.label = t[1], t = n;
102
+ break;
103
+ }
104
+ if (t && r.label < t[2]) {
105
+ r.label = t[2], r.ops.push(n);
106
+ break;
107
+ }
108
+ t[2] && r.ops.pop(), r.trys.pop();
109
+ continue;
110
+ }
111
+ n = a.call(c, r);
112
+ } catch (u) {
113
+ n = [6, u], o = 0;
114
+ } finally {
115
+ e = t = 0;
116
+ }
117
+ if (n[0] & 5) throw n[1];
118
+ return { value: n[0] ? n[1] : void 0, done: !0 };
119
+ }
120
+ }
121
+ function b(c, a) {
122
+ var r = typeof Symbol == "function" && c[Symbol.iterator];
123
+ if (!r) return c;
124
+ var e = r.call(c), o, t = [], l;
125
+ try {
126
+ for (; (a === void 0 || a-- > 0) && !(o = e.next()).done; ) t.push(o.value);
127
+ } catch (i) {
128
+ l = { error: i };
129
+ } finally {
130
+ try {
131
+ o && !o.done && (r = e.return) && r.call(e);
132
+ } finally {
133
+ if (l) throw l.error;
134
+ }
135
+ }
136
+ return t;
137
+ }
138
+ function v(c, a, r) {
139
+ if (r || arguments.length === 2) for (var e = 0, o = a.length, t; e < o; e++)
140
+ (t || !(e in a)) && (t || (t = Array.prototype.slice.call(a, 0, e)), t[e] = a[e]);
141
+ return c.concat(t || Array.prototype.slice.call(a));
142
+ }
143
+ export {
144
+ p as _,
145
+ d as a,
146
+ w as b,
147
+ v as c,
148
+ b as d,
149
+ h as e,
150
+ _ as f
151
+ };
@@ -1,8 +1,21 @@
1
- import { i as e, b as n, n as s, a as o, r as t } from "../functional-C0pE183N.js";
1
+ function t() {
2
+ }
3
+ function r() {
4
+ return !0;
5
+ }
6
+ function e() {
7
+ return !1;
8
+ }
9
+ function u(n) {
10
+ return n;
11
+ }
12
+ function o(n) {
13
+ n();
14
+ }
2
15
  export {
3
- e as identity,
4
- n as invoke,
5
- s as noop,
6
- o as returnFalse,
7
- t as returnTrue
16
+ u as identity,
17
+ o as invoke,
18
+ t as noop,
19
+ e as returnFalse,
20
+ r as returnTrue
8
21
  };
@@ -11,4 +11,6 @@ export declare namespace useKeyboardClose {
11
11
  var isCloseEvent: (event: KeyboardEvent) => boolean;
12
12
  }
13
13
  export declare function useWindowResize<T extends () => void>(callback: T): void;
14
+ export declare function useOutletAfter(id: string): React.FC<React.PropsWithChildren>;
15
+ export declare function useOutletBefore(id: string): React.FC<React.PropsWithChildren>;
14
16
  export declare function useOutlet(id: string): React.FC<React.PropsWithChildren>;
@@ -1,12 +1,102 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import "../index-C75OpfGQ.js";
4
- import { u, e as r, d as i, c as m, a as n, b } from "../hooks-GAujvL7d.js";
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import u from "react";
3
+ import { R as d } from "../index-2hJuj4UN.js";
4
+ const f = Symbol("Uninitialized");
5
+ function P(e, ...t) {
6
+ const n = u.useRef(f);
7
+ return n.current === f && (n.current = e(...t)), n.current;
8
+ }
9
+ function m(e) {
10
+ const t = u.useRef(e);
11
+ return t.current = e, t;
12
+ }
13
+ function i(e, t = "keydown", n) {
14
+ u.useEffect(() => {
15
+ const o = (r) => {
16
+ i.shouldProcessEvent(r) && e.current(r);
17
+ };
18
+ return window.addEventListener(t, o, n), () => {
19
+ window.removeEventListener(t, o, n);
20
+ };
21
+ }, [t, n]);
22
+ }
23
+ i.shouldProcessEvent = (e) => {
24
+ if (e.target instanceof Element) {
25
+ if (e.target.hasAttribute("contenteditable"))
26
+ return !1;
27
+ switch (e.target.tagName) {
28
+ case "INPUT":
29
+ case "SELECT":
30
+ case "TEXTAREA":
31
+ return !1;
32
+ default:
33
+ return !0;
34
+ }
35
+ }
36
+ return !0;
37
+ };
38
+ function E(e) {
39
+ const t = m((n) => {
40
+ E.isCloseEvent(n) && e();
41
+ });
42
+ i(t);
43
+ }
44
+ E.isCloseEvent = (e) => e.key === "Escape";
45
+ function v(e) {
46
+ const t = m(e);
47
+ u.useEffect(() => {
48
+ const n = () => t.current();
49
+ return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
50
+ }, []);
51
+ }
52
+ function a(e) {
53
+ const {
54
+ children: t
55
+ } = e;
56
+ return /* @__PURE__ */ y("div", { style: { display: "none" }, children: t });
57
+ }
58
+ function h(e) {
59
+ const [t, n] = u.useState(() => a);
60
+ return u.useEffect(() => {
61
+ const o = `${e}_after`;
62
+ let r = document.getElementById(o), c = document.getElementById(e);
63
+ c || (c = document.createElement("div"), c.id = e, document.body.appendChild(c)), r || (r = document.createElement("div"), r.id = o, c.after(r));
64
+ const s = ({
65
+ children: l
66
+ }) => d.createPortal(l, r);
67
+ n(() => s);
68
+ }, [e]), t;
69
+ }
70
+ function R(e) {
71
+ const [t, n] = u.useState(() => a);
72
+ return u.useEffect(() => {
73
+ const o = `${e}_before`;
74
+ let r = document.getElementById(o), c = document.getElementById(e);
75
+ c || (c = document.createElement("div"), c.id = e, document.body.appendChild(c)), r || (r = document.createElement("div"), r.id = o, document.body.insertBefore(r, c));
76
+ const s = ({
77
+ children: l
78
+ }) => d.createPortal(l, r);
79
+ n(() => s);
80
+ }, [e]), t;
81
+ }
82
+ function B(e) {
83
+ const [t, n] = u.useState(() => a);
84
+ return u.useEffect(() => {
85
+ let o = document.getElementById(e);
86
+ o || (o = document.createElement("div"), o.id = e, document.body.appendChild(o));
87
+ const r = ({
88
+ children: c
89
+ }) => d.createPortal(c, o);
90
+ n(() => r);
91
+ }, [e]), t;
92
+ }
5
93
  export {
6
- u as useDynamicRef,
7
- r as useGlobalKeyboardEvent,
8
- i as useInstance,
9
- m as useKeyboardClose,
10
- n as useOutlet,
11
- b as useWindowResize
94
+ m as useDynamicRef,
95
+ i as useGlobalKeyboardEvent,
96
+ P as useInstance,
97
+ E as useKeyboardClose,
98
+ B as useOutlet,
99
+ h as useOutletAfter,
100
+ R as useOutletBefore,
101
+ v as useWindowResize
12
102
  };