@cfx-dev/ui-components 0.0.5
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/LICENSE +21 -0
- package/README.md +17 -0
- package/dist/Button.module-Z6njvP9Z.js +17 -0
- package/dist/Combination-AG9vHdSx.js +1478 -0
- package/dist/Icons-B26SczGZ.js +162 -0
- package/dist/Rail-DoYzqKk4.js +89 -0
- package/dist/assets/Avatar.css +1 -0
- package/dist/assets/Badge.css +1 -0
- package/dist/assets/Box.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Center.css +1 -0
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/ControlBox.css +1 -0
- package/dist/assets/CountryFlag.css +1 -0
- package/dist/assets/Decorate.css +1 -0
- package/dist/assets/Dot.css +1 -0
- package/dist/assets/Flex.css +1 -0
- package/dist/assets/FlexRestricter.css +1 -0
- package/dist/assets/Flyout.css +1 -0
- package/dist/assets/Icon.css +1 -0
- package/dist/assets/Indicator.css +1 -0
- package/dist/assets/InfoPanel.css +1 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/Interactive.css +1 -0
- package/dist/assets/Island.css +1 -0
- package/dist/assets/Loaf.css +1 -0
- package/dist/assets/Modal.css +1 -0
- package/dist/assets/NavList.css +1 -0
- package/dist/assets/Overlay.css +1 -0
- package/dist/assets/Pad.css +1 -0
- package/dist/assets/Page.css +1 -0
- package/dist/assets/Popover.css +1 -0
- package/dist/assets/PremiumBadge.css +1 -0
- package/dist/assets/Prose.css +1 -0
- package/dist/assets/Radio.css +1 -0
- package/dist/assets/Rail.css +1 -0
- package/dist/assets/RichInput.css +1 -0
- package/dist/assets/Select.css +1 -0
- package/dist/assets/Separator.css +1 -0
- package/dist/assets/Shroud.css +1 -0
- package/dist/assets/Spacer.css +1 -0
- package/dist/assets/Switch.css +1 -0
- package/dist/assets/Tabular.css +1 -0
- package/dist/assets/Text.css +1 -0
- package/dist/assets/Textarea.css +1 -0
- package/dist/assets/Title.css +1 -0
- package/dist/assets/global.css +1 -0
- package/dist/assets/themes.css +1 -0
- package/dist/components/Avatar/Avatar.d.ts +8 -0
- package/dist/components/Avatar/Avatar.js +22 -0
- package/dist/components/BackdropPortal/BackdropPortal.d.ts +6 -0
- package/dist/components/BackdropPortal/BackdropPortal.js +11 -0
- package/dist/components/Badge/Badge.d.ts +9 -0
- package/dist/components/Badge/Badge.js +18 -0
- package/dist/components/Button/Button.d.ts +22 -0
- package/dist/components/Button/Button.js +56 -0
- package/dist/components/Button/ButtonBar.d.ts +6 -0
- package/dist/components/Button/ButtonBar.js +13 -0
- package/dist/components/Checkbox/Checkbox.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.js +42 -0
- package/dist/components/ControlBox/ControlBox.d.ts +9 -0
- package/dist/components/ControlBox/ControlBox.js +19 -0
- package/dist/components/CountryFlag/CountryFlag.d.ts +9 -0
- package/dist/components/CountryFlag/CountryFlag.js +21 -0
- package/dist/components/Decorate/Decorate.d.ts +9 -0
- package/dist/components/Decorate/Decorate.js +20 -0
- package/dist/components/Dot/Dot.d.ts +6 -0
- package/dist/components/Dot/Dot.js +14 -0
- package/dist/components/Flyout/Flyout.d.ts +17 -0
- package/dist/components/Flyout/Flyout.js +60 -0
- package/dist/components/Icon/Icon.d.ts +11 -0
- package/dist/components/Icon/Icon.js +24 -0
- package/dist/components/Icons.d.ts +38 -0
- package/dist/components/Icons.js +6 -0
- package/dist/components/Indicator/Indicator.d.ts +6 -0
- package/dist/components/Indicator/Indicator.js +19 -0
- package/dist/components/InfoPanel/InfoPanel.d.ts +13 -0
- package/dist/components/InfoPanel/InfoPanel.js +34 -0
- package/dist/components/Input/Input.d.ts +37 -0
- package/dist/components/Input/Input.js +96 -0
- package/dist/components/Input/RichInput.d.ts +18 -0
- package/dist/components/Input/RichInput.js +63 -0
- package/dist/components/Interactive/Interactive.d.ts +6 -0
- package/dist/components/Interactive/Interactive.js +18 -0
- package/dist/components/Island/Island.d.ts +26 -0
- package/dist/components/Island/Island.js +34 -0
- package/dist/components/Layout/Box/Box.d.ts +21 -0
- package/dist/components/Layout/Box/Box.js +38 -0
- package/dist/components/Layout/Center/Center.d.ts +9 -0
- package/dist/components/Layout/Center/Center.js +22 -0
- package/dist/components/Layout/Flex/Flex.d.ts +26 -0
- package/dist/components/Layout/Flex/Flex.js +75 -0
- package/dist/components/Layout/Flex/FlexRestricter.d.ts +12 -0
- package/dist/components/Layout/Flex/FlexRestricter.js +20 -0
- package/dist/components/Layout/Pad/Pad.d.ts +15 -0
- package/dist/components/Layout/Pad/Pad.js +36 -0
- package/dist/components/Layout/Page/Page.d.ts +8 -0
- package/dist/components/Layout/Page/Page.js +21 -0
- package/dist/components/Layout/Scrollable/Rail.d.ts +13 -0
- package/dist/components/Layout/Scrollable/Rail.js +10 -0
- package/dist/components/Layout/Scrollable/Scrollable.d.ts +14 -0
- package/dist/components/Layout/Scrollable/Scrollable.js +89 -0
- package/dist/components/Layout/Scrollable/VirtualScrollable.d.ts +11 -0
- package/dist/components/Layout/Scrollable/VirtualScrollable.js +426 -0
- package/dist/components/Loaf/Loaf.d.ts +12 -0
- package/dist/components/Loaf/Loaf.js +27 -0
- package/dist/components/Modal/Modal.d.ts +18 -0
- package/dist/components/Modal/Modal.js +42 -0
- package/dist/components/NavList/NavList.d.ts +14 -0
- package/dist/components/NavList/NavList.js +33 -0
- package/dist/components/OnScreenSensor.d.ts +5 -0
- package/dist/components/OnScreenSensor.js +26 -0
- package/dist/components/Overlay/Overlay.d.ts +20 -0
- package/dist/components/Overlay/Overlay.js +28 -0
- package/dist/components/Popover/Popover.d.ts +12 -0
- package/dist/components/Popover/Popover.js +40 -0
- package/dist/components/PremiumBadge/PremiumBadge.d.ts +15 -0
- package/dist/components/PremiumBadge/PremiumBadge.js +38 -0
- package/dist/components/Prose/Prose.d.ts +6 -0
- package/dist/components/Prose/Prose.js +12 -0
- package/dist/components/Radio/Radio.d.ts +12 -0
- package/dist/components/Radio/Radio.js +45 -0
- package/dist/components/Select/Select.d.ts +16 -0
- package/dist/components/Select/Select.js +3293 -0
- package/dist/components/Separator/Separator.d.ts +8 -0
- package/dist/components/Separator/Separator.js +29 -0
- package/dist/components/Shroud/Shroud.d.ts +6 -0
- package/dist/components/Shroud/Shroud.js +41 -0
- package/dist/components/Spacer/Spacer.d.ts +5 -0
- package/dist/components/Spacer/Spacer.js +26 -0
- package/dist/components/Style/Style.d.ts +12 -0
- package/dist/components/Style/Style.js +23 -0
- package/dist/components/Switch/Switch.d.ts +17 -0
- package/dist/components/Switch/Switch.js +65 -0
- package/dist/components/Symbols.d.ts +5 -0
- package/dist/components/Symbols.js +7 -0
- package/dist/components/Tabular/Tabular.d.ts +30 -0
- package/dist/components/Tabular/Tabular.js +64 -0
- package/dist/components/Text/Text.d.ts +8 -0
- package/dist/components/Text/Text.js +61 -0
- package/dist/components/Text/Text.types.d.ts +33 -0
- package/dist/components/Text/Text.types.js +1 -0
- package/dist/components/Textarea/Textarea.d.ts +15 -0
- package/dist/components/Textarea/Textarea.js +57 -0
- package/dist/components/Title/Title.d.ts +13 -0
- package/dist/components/Title/Title.js +113 -0
- package/dist/components/outlets.d.ts +10 -0
- package/dist/components/outlets.js +7 -0
- package/dist/components/ui.d.ts +28 -0
- package/dist/components/ui.js +29 -0
- package/dist/functional-C0pE183N.js +30 -0
- package/dist/hooks-Bv1kQUpO.js +65 -0
- package/dist/index-C75OpfGQ.js +19577 -0
- package/dist/links-CgOD-Vfj.js +1142 -0
- package/dist/main.d.ts +68 -0
- package/dist/main.js +118 -0
- package/dist/math-i2ceybzU.js +16 -0
- package/dist/medium-Dc7QRuE0.js +118 -0
- package/dist/outlet-C4wpavcH.js +25 -0
- package/dist/outlets-BsMV5obW.js +13 -0
- package/dist/string-NVxCUbqk.js +54 -0
- package/dist/styles-scss/_colors.scss +211 -0
- package/dist/styles-scss/_ui.scss +195 -0
- package/dist/styles-scss/global.scss +71 -0
- package/dist/styles-scss/themes/dark.scss +24 -0
- package/dist/styles-scss/themes/light.scss +54 -0
- package/dist/styles-scss/themes.scss +2 -0
- package/dist/styles-scss/tokens.scss +274 -0
- package/dist/tslib.es6-Dd_EkEfR.js +48 -0
- package/dist/utils/clsx.d.ts +7 -0
- package/dist/utils/clsx.js +14 -0
- package/dist/utils/functional.d.ts +5 -0
- package/dist/utils/functional.js +8 -0
- package/dist/utils/getValue.d.ts +2 -0
- package/dist/utils/getValue.js +6 -0
- package/dist/utils/hooks.d.ts +13 -0
- package/dist/utils/hooks.js +9 -0
- package/dist/utils/links.d.ts +27 -0
- package/dist/utils/links.js +14 -0
- package/dist/utils/math.d.ts +2 -0
- package/dist/utils/math.js +5 -0
- package/dist/utils/mergeRefs.d.ts +3 -0
- package/dist/utils/mergeRefs.js +10 -0
- package/dist/utils/outlet.d.ts +4 -0
- package/dist/utils/outlet.js +6 -0
- package/dist/utils/string.d.ts +6 -0
- package/dist/utils/string.js +9 -0
- package/package.json +82 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TextProps } from './Text/Text.types';
|
|
2
|
+
|
|
3
|
+
export declare namespace ui {
|
|
4
|
+
/**
|
|
5
|
+
* Returns CSS value of quant value with applied multiplier
|
|
6
|
+
*/
|
|
7
|
+
function q(multiplier?: number): string;
|
|
8
|
+
function offset(size?: 'none' | 'xsmall' | 'small' | 'normal' | 'large' | 'xlarge' | 'safezone'): string;
|
|
9
|
+
function fontSize(size?: TextProps['size']): string;
|
|
10
|
+
function borderRadius(size?: 'xsmall' | 'small' | 'normal'): string;
|
|
11
|
+
function color(name: string, variantRaw?: string | number, alpha?: number): string;
|
|
12
|
+
namespace cls {
|
|
13
|
+
const fullWidth = "util-full-width";
|
|
14
|
+
const fullHeight = "util-full-height";
|
|
15
|
+
const flexGrow = "util-flex-grow";
|
|
16
|
+
const flexNoShrink = "util-flex-no-shrink";
|
|
17
|
+
const userSelectableText = "util-text-selectable";
|
|
18
|
+
const zIndex9000 = "util-z-index-9000";
|
|
19
|
+
}
|
|
20
|
+
const pc: (x: number | string) => string;
|
|
21
|
+
const px: (x: number | string) => string;
|
|
22
|
+
const ch: (x: number | string) => string;
|
|
23
|
+
const em: (x: number | string) => string;
|
|
24
|
+
const rem: (x: number | string) => string;
|
|
25
|
+
const vh: (x: number | string) => string;
|
|
26
|
+
const vw: (x: number | string) => string;
|
|
27
|
+
const url: (u: unknown) => string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var l;
|
|
2
|
+
((e) => {
|
|
3
|
+
function n(r = 1) {
|
|
4
|
+
return `calc(var(--quant) * ${r})`;
|
|
5
|
+
}
|
|
6
|
+
e.q = n;
|
|
7
|
+
function o(r = "normal") {
|
|
8
|
+
return `var(--offset-${r})`;
|
|
9
|
+
}
|
|
10
|
+
e.offset = o;
|
|
11
|
+
function f(r = "normal") {
|
|
12
|
+
return `var(--font-size-${r})`;
|
|
13
|
+
}
|
|
14
|
+
e.fontSize = f;
|
|
15
|
+
function a(r = "normal") {
|
|
16
|
+
return `var(--border-radius-${r})`;
|
|
17
|
+
}
|
|
18
|
+
e.borderRadius = a;
|
|
19
|
+
function $(r, u, i = 1) {
|
|
20
|
+
let t = u;
|
|
21
|
+
return t === "pure" && (t = ""), typeof t == "number" && (t = `${t}`), `rgba(var(--color-${r}${t ? `-${t}` : ""}), ${i})`;
|
|
22
|
+
}
|
|
23
|
+
e.color = $, ((r) => {
|
|
24
|
+
r.fullWidth = "util-full-width", r.fullHeight = "util-full-height", r.flexGrow = "util-flex-grow", r.flexNoShrink = "util-flex-no-shrink", r.userSelectableText = "util-text-selectable", r.zIndex9000 = "util-z-index-9000";
|
|
25
|
+
})(e.cls || (e.cls = {})), e.pc = (r) => `${r}%`, e.px = (r) => `${r}px`, e.ch = (r) => `${r}ch`, e.em = (r) => `${r}em`, e.rem = (r) => `${r}rem`, e.vh = (r) => `${r}vh`, e.vw = (r) => `${r}vw`, e.url = (r) => `url(${r})`;
|
|
26
|
+
})(l || (l = {}));
|
|
27
|
+
export {
|
|
28
|
+
l as ui
|
|
29
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function e() {
|
|
2
|
+
}
|
|
3
|
+
function t() {
|
|
4
|
+
return !0;
|
|
5
|
+
}
|
|
6
|
+
function r() {
|
|
7
|
+
return !1;
|
|
8
|
+
}
|
|
9
|
+
function o(n) {
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
function u(n) {
|
|
13
|
+
n();
|
|
14
|
+
}
|
|
15
|
+
const a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
16
|
+
__proto__: null,
|
|
17
|
+
identity: o,
|
|
18
|
+
invoke: u,
|
|
19
|
+
noop: e,
|
|
20
|
+
returnFalse: r,
|
|
21
|
+
returnTrue: t
|
|
22
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
23
|
+
export {
|
|
24
|
+
r as a,
|
|
25
|
+
u as b,
|
|
26
|
+
a as f,
|
|
27
|
+
o as i,
|
|
28
|
+
e as n,
|
|
29
|
+
t as r
|
|
30
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import r from "react";
|
|
2
|
+
const a = Symbol("Uninitialized");
|
|
3
|
+
function f(e, ...t) {
|
|
4
|
+
const n = r.useRef(a);
|
|
5
|
+
return n.current === a && (n.current = e(...t)), n.current;
|
|
6
|
+
}
|
|
7
|
+
function o(e) {
|
|
8
|
+
const t = r.useRef(e);
|
|
9
|
+
return t.current = e, t;
|
|
10
|
+
}
|
|
11
|
+
function s(e, t = "keydown", n) {
|
|
12
|
+
r.useEffect(() => {
|
|
13
|
+
const i = (u) => {
|
|
14
|
+
s.shouldProcessEvent(u) && e.current(u);
|
|
15
|
+
};
|
|
16
|
+
return window.addEventListener(t, i, n), () => {
|
|
17
|
+
window.removeEventListener(t, i, n);
|
|
18
|
+
};
|
|
19
|
+
}, [t, n]);
|
|
20
|
+
}
|
|
21
|
+
s.shouldProcessEvent = (e) => {
|
|
22
|
+
if (e.target instanceof Element) {
|
|
23
|
+
if (e.target.hasAttribute("contenteditable"))
|
|
24
|
+
return !1;
|
|
25
|
+
switch (e.target.tagName) {
|
|
26
|
+
case "INPUT":
|
|
27
|
+
case "SELECT":
|
|
28
|
+
case "TEXTAREA":
|
|
29
|
+
return !1;
|
|
30
|
+
default:
|
|
31
|
+
return !0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return !0;
|
|
35
|
+
};
|
|
36
|
+
function c(e) {
|
|
37
|
+
const t = o((n) => {
|
|
38
|
+
c.isCloseEvent(n) && e();
|
|
39
|
+
});
|
|
40
|
+
s(t);
|
|
41
|
+
}
|
|
42
|
+
c.isCloseEvent = (e) => e.key === "Escape";
|
|
43
|
+
function l(e) {
|
|
44
|
+
const t = o(e);
|
|
45
|
+
r.useEffect(() => {
|
|
46
|
+
const n = () => t.current();
|
|
47
|
+
return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
48
|
+
}, []);
|
|
49
|
+
}
|
|
50
|
+
const E = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
51
|
+
__proto__: null,
|
|
52
|
+
useDynamicRef: o,
|
|
53
|
+
useGlobalKeyboardEvent: s,
|
|
54
|
+
useInstance: f,
|
|
55
|
+
useKeyboardClose: c,
|
|
56
|
+
useWindowResize: l
|
|
57
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
58
|
+
export {
|
|
59
|
+
l as a,
|
|
60
|
+
c as b,
|
|
61
|
+
f as c,
|
|
62
|
+
s as d,
|
|
63
|
+
E as h,
|
|
64
|
+
o as u
|
|
65
|
+
};
|