@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,29 @@
|
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as i } from "../../utils/clsx.js";
|
|
3
|
+
import '../../assets/Separator.css';const l = "_root_1omks_1", _ = "_separator_1omks_4", m = "_content_1omks_9", v = "_thin_1omks_12", p = "_vertical_1omks_18", d = "_text_1omks_32", t = {
|
|
4
|
+
root: l,
|
|
5
|
+
separator: _,
|
|
6
|
+
content: m,
|
|
7
|
+
thin: v,
|
|
8
|
+
vertical: p,
|
|
9
|
+
text: d
|
|
10
|
+
};
|
|
11
|
+
function N(r) {
|
|
12
|
+
const {
|
|
13
|
+
content: s,
|
|
14
|
+
thin: a = !1,
|
|
15
|
+
vertical: n = !1
|
|
16
|
+
} = r, e = i(t.root, {
|
|
17
|
+
[t.text]: !!s,
|
|
18
|
+
[t.thin]: a,
|
|
19
|
+
[t.vertical]: n
|
|
20
|
+
});
|
|
21
|
+
return s ? /* @__PURE__ */ c("div", { className: e, children: [
|
|
22
|
+
/* @__PURE__ */ o("div", { className: t.separator }),
|
|
23
|
+
/* @__PURE__ */ o("div", { className: t.content, children: s }),
|
|
24
|
+
/* @__PURE__ */ o("div", { className: t.separator })
|
|
25
|
+
] }) : /* @__PURE__ */ o("div", { className: e, children: /* @__PURE__ */ o("div", { className: t.separator }) });
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
N as Separator
|
|
29
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import s from "react";
|
|
3
|
+
import { a as h } from "../../hooks-Bv1kQUpO.js";
|
|
4
|
+
import { P as p } from "../../outlets-BsMV5obW.js";
|
|
5
|
+
import { ui as v } from "../ui.js";
|
|
6
|
+
import '../../assets/Shroud.css';const x = "_root_7v6x1_1", _ = "_tile_7v6x1_6", e = {
|
|
7
|
+
root: x,
|
|
8
|
+
tile: _
|
|
9
|
+
}, S = s.forwardRef(function(c, n) {
|
|
10
|
+
const {
|
|
11
|
+
forRef: r
|
|
12
|
+
} = c, [d, u] = s.useState({}), i = s.useCallback(() => {
|
|
13
|
+
if (!r.current)
|
|
14
|
+
return;
|
|
15
|
+
const o = r.current.getBoundingClientRect(), f = {
|
|
16
|
+
x: o.x,
|
|
17
|
+
y: o.y,
|
|
18
|
+
w: o.width,
|
|
19
|
+
h: o.height,
|
|
20
|
+
sw: globalThis.screen.availWidth,
|
|
21
|
+
sh: globalThis.screen.availHeight
|
|
22
|
+
};
|
|
23
|
+
u(
|
|
24
|
+
Object.fromEntries(
|
|
25
|
+
Object.entries(f).flatMap(([a, l]) => [
|
|
26
|
+
[`--${a}`, v.px(l)],
|
|
27
|
+
[`--${a}-raw`, l]
|
|
28
|
+
])
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
}, []);
|
|
32
|
+
return s.useEffect(i, []), h(i), /* @__PURE__ */ t(p, { children: /* @__PURE__ */ m("div", { ref: n, className: e.root, style: d, children: [
|
|
33
|
+
/* @__PURE__ */ t("div", { className: e.tile, "data-top": !0 }),
|
|
34
|
+
/* @__PURE__ */ t("div", { className: e.tile, "data-left": !0 }),
|
|
35
|
+
/* @__PURE__ */ t("div", { className: e.tile, "data-right": !0 }),
|
|
36
|
+
/* @__PURE__ */ t("div", { className: e.tile, "data-bottom": !0 })
|
|
37
|
+
] }) });
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
S as Shroud
|
|
41
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as l } from "../../utils/clsx.js";
|
|
3
|
+
import '../../assets/Spacer.css';const a = "_root_19yue_1", t = "_horizontal_19yue_1", e = {
|
|
4
|
+
root: a,
|
|
5
|
+
horizontal: t,
|
|
6
|
+
"size-none": "_size-none_19yue_4",
|
|
7
|
+
"size-thin": "_size-thin_19yue_7",
|
|
8
|
+
"size-xsmall": "_size-xsmall_19yue_10",
|
|
9
|
+
"size-small": "_size-small_19yue_13",
|
|
10
|
+
"size-normal": "_size-normal_19yue_16",
|
|
11
|
+
"size-large": "_size-large_19yue_19",
|
|
12
|
+
"size-xlarge": "_size-xlarge_19yue_22"
|
|
13
|
+
};
|
|
14
|
+
function m(s) {
|
|
15
|
+
const {
|
|
16
|
+
size: i = "normal",
|
|
17
|
+
vertical: o = !1
|
|
18
|
+
} = s, _ = l(e.root, e[`size-${i}`], {
|
|
19
|
+
[e.horizontal]: !o,
|
|
20
|
+
[e.vertical]: o
|
|
21
|
+
});
|
|
22
|
+
return /* @__PURE__ */ r("div", { className: _ });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
m as Spacer
|
|
26
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare function useContextualStyle(): React.CSSProperties;
|
|
4
|
+
export type StyleProps = React.CSSProperties & {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function Style(props: StyleProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare namespace Style {
|
|
9
|
+
var Reset: ({ children, }: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
3
|
+
const e = r.createContext({});
|
|
4
|
+
function a() {
|
|
5
|
+
return r.useContext(e);
|
|
6
|
+
}
|
|
7
|
+
function l(n) {
|
|
8
|
+
const {
|
|
9
|
+
children: t,
|
|
10
|
+
...u
|
|
11
|
+
} = n;
|
|
12
|
+
return /* @__PURE__ */ o(e.Provider, { value: u, children: t });
|
|
13
|
+
}
|
|
14
|
+
const c = {};
|
|
15
|
+
l.Reset = function({
|
|
16
|
+
children: t
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ o(e.Provider, { value: c, children: t });
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
l as Style,
|
|
22
|
+
a as useContextualStyle
|
|
23
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SwitchOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SwitchProps {
|
|
10
|
+
value: string;
|
|
11
|
+
options: SwitchOption[];
|
|
12
|
+
onChange: <T extends string>(value: T) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
multiline?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const Switch: React.NamedExoticComponent<SwitchProps>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs as r, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import { clsx as _ } from "../../utils/clsx.js";
|
|
4
|
+
import { Interactive as S } from "../Interactive/Interactive.js";
|
|
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
|
+
root: g,
|
|
7
|
+
disabled: j,
|
|
8
|
+
descripted: k,
|
|
9
|
+
multiline: w,
|
|
10
|
+
options: E,
|
|
11
|
+
option: L,
|
|
12
|
+
description: O,
|
|
13
|
+
active: I
|
|
14
|
+
}, m = (l, i) => {
|
|
15
|
+
var o;
|
|
16
|
+
return ((o = i.find((t) => t.value === l)) == null ? void 0 : o.description) || "";
|
|
17
|
+
}, A = d.memo(function(i) {
|
|
18
|
+
const {
|
|
19
|
+
value: o,
|
|
20
|
+
options: t,
|
|
21
|
+
onChange: a,
|
|
22
|
+
className: u = "",
|
|
23
|
+
disabled: v = !1,
|
|
24
|
+
multiline: f = !1
|
|
25
|
+
} = i, [n, c] = d.useState(m(o, t)), h = d.useMemo(
|
|
26
|
+
() => t.map((s, b) => {
|
|
27
|
+
const C = () => {
|
|
28
|
+
a(s.value);
|
|
29
|
+
}, M = () => {
|
|
30
|
+
c(s.description || "");
|
|
31
|
+
}, x = () => {
|
|
32
|
+
c(m(o, t));
|
|
33
|
+
}, D = _(e.option, {
|
|
34
|
+
[e.active]: s.value === o
|
|
35
|
+
});
|
|
36
|
+
return /* @__PURE__ */ r(
|
|
37
|
+
S,
|
|
38
|
+
{
|
|
39
|
+
className: D,
|
|
40
|
+
tabIndex: b,
|
|
41
|
+
onClick: C,
|
|
42
|
+
onMouseEnter: M,
|
|
43
|
+
onMouseLeave: x,
|
|
44
|
+
children: [
|
|
45
|
+
s.icon || null,
|
|
46
|
+
s.label
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
s.value
|
|
50
|
+
);
|
|
51
|
+
}),
|
|
52
|
+
[o, t, a, c]
|
|
53
|
+
), N = _(e.root, u, {
|
|
54
|
+
[e.disabled]: v,
|
|
55
|
+
[e.descripted]: n,
|
|
56
|
+
[e.multiline]: f
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ r("div", { className: N, children: [
|
|
59
|
+
/* @__PURE__ */ p("div", { className: e.options, children: h }),
|
|
60
|
+
n && /* @__PURE__ */ p("div", { className: e.description, children: n })
|
|
61
|
+
] });
|
|
62
|
+
});
|
|
63
|
+
export {
|
|
64
|
+
A as Switch
|
|
65
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TabularItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface TabularProps {
|
|
10
|
+
items: TabularItem[];
|
|
11
|
+
activeItem: string;
|
|
12
|
+
onActivate(id: string): void;
|
|
13
|
+
}
|
|
14
|
+
export declare function Tabular(props: TabularProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace Tabular {
|
|
16
|
+
var Root: (props: TabularRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
var Item: React.ForwardRefExoticComponent<Pick<TabularItem, "label" | "disabled" | "icon"> & {
|
|
18
|
+
active?: boolean | undefined;
|
|
19
|
+
onClick?(): void;
|
|
20
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
}
|
|
22
|
+
export type TabularRootProps = {
|
|
23
|
+
size?: 'normal' | 'large';
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
export type TabularItemProps = Pick<TabularItem, 'icon' | 'label' | 'disabled'> & {
|
|
28
|
+
active?: boolean;
|
|
29
|
+
onClick?(): void;
|
|
30
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsxs as _, jsx as c, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import { Interactive as u } from "../Interactive/Interactive.js";
|
|
4
|
+
import { clsx as d } from "../../utils/clsx.js";
|
|
5
|
+
import '../../assets/Tabular.css';const w = "_root_6vp2w_1", N = "_item_6vp2w_6", h = "_content_6vp2w_7", I = "_iconOnly_6vp2w_25", R = "_icon_6vp2w_25", x = "_label_6vp2w_41", y = "_decorator_6vp2w_47", z = "_active_6vp2w_63", o = {
|
|
6
|
+
root: w,
|
|
7
|
+
"size-large": "_size-large_6vp2w_6",
|
|
8
|
+
item: N,
|
|
9
|
+
content: h,
|
|
10
|
+
iconOnly: I,
|
|
11
|
+
icon: R,
|
|
12
|
+
label: x,
|
|
13
|
+
decorator: y,
|
|
14
|
+
active: z
|
|
15
|
+
};
|
|
16
|
+
function s(l) {
|
|
17
|
+
const {
|
|
18
|
+
items: a,
|
|
19
|
+
activeItem: i,
|
|
20
|
+
onActivate: n
|
|
21
|
+
} = l, e = a.map((t) => /* @__PURE__ */ c(
|
|
22
|
+
s.Item,
|
|
23
|
+
{
|
|
24
|
+
icon: t.icon,
|
|
25
|
+
label: t.label,
|
|
26
|
+
active: t.id === i,
|
|
27
|
+
onClick: () => n(t.id)
|
|
28
|
+
},
|
|
29
|
+
t.id
|
|
30
|
+
));
|
|
31
|
+
return /* @__PURE__ */ c(s.Root, { children: e });
|
|
32
|
+
}
|
|
33
|
+
s.Root = function(a) {
|
|
34
|
+
const {
|
|
35
|
+
children: i,
|
|
36
|
+
size: n = "normal",
|
|
37
|
+
className: e
|
|
38
|
+
} = a, t = d(o.root, o[`size-${n}`], e);
|
|
39
|
+
return /* @__PURE__ */ c("div", { className: t, children: i });
|
|
40
|
+
};
|
|
41
|
+
s.Item = f.forwardRef(function(a, i) {
|
|
42
|
+
const {
|
|
43
|
+
icon: n,
|
|
44
|
+
label: e,
|
|
45
|
+
onClick: t,
|
|
46
|
+
active: m = !1,
|
|
47
|
+
disabled: v = !1
|
|
48
|
+
} = a, p = d(o.item, {
|
|
49
|
+
[o.active]: m,
|
|
50
|
+
[o.disabled]: v,
|
|
51
|
+
[o.iconOnly]: !e
|
|
52
|
+
}), r = /* @__PURE__ */ _(b, { children: [
|
|
53
|
+
!!n && /* @__PURE__ */ c("div", { className: o.icon, children: n }),
|
|
54
|
+
!!e && /* @__PURE__ */ c("div", { className: o.label, children: e })
|
|
55
|
+
] });
|
|
56
|
+
return /* @__PURE__ */ _(u, { ref: i, onClick: t, className: p, children: [
|
|
57
|
+
r,
|
|
58
|
+
/* @__PURE__ */ c("div", { className: o.content, children: r }),
|
|
59
|
+
/* @__PURE__ */ c("div", { className: o.decorator })
|
|
60
|
+
] });
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
s as Tabular
|
|
64
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TextOpacity, TextProps } from './Text.types';
|
|
3
|
+
|
|
4
|
+
export declare const TEXT_OPACITY_MAP: Record<TextOpacity, number | string>;
|
|
5
|
+
export declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLDivElement | HTMLSpanElement>>;
|
|
6
|
+
export declare const TextBlock: React.ForwardRefExoticComponent<(TextProps & {
|
|
7
|
+
asDiv?: undefined;
|
|
8
|
+
}) & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import p from "react";
|
|
3
|
+
import { ui as g } from "../ui.js";
|
|
4
|
+
import { clsx as h } from "../../utils/clsx.js";
|
|
5
|
+
import '../../assets/Text.css';const $ = "_root_lfxjz_1", k = "_centered_lfxjz_1", z = "_truncated_lfxjz_4", b = "_typographic_lfxjz_12", j = "_block_lfxjz_23", r = {
|
|
6
|
+
root: $,
|
|
7
|
+
centered: k,
|
|
8
|
+
truncated: z,
|
|
9
|
+
typographic: b,
|
|
10
|
+
block: j
|
|
11
|
+
}, i = {
|
|
12
|
+
0: 0,
|
|
13
|
+
25: "var(--text-opacity-25)",
|
|
14
|
+
50: "var(--text-opacity-50)",
|
|
15
|
+
75: "var(--text-opacity-75)",
|
|
16
|
+
100: 1
|
|
17
|
+
};
|
|
18
|
+
function C(o) {
|
|
19
|
+
if ("colorToken" in o)
|
|
20
|
+
return `var(--color-${o.colorToken})`;
|
|
21
|
+
const {
|
|
22
|
+
color: t = "main",
|
|
23
|
+
opacity: e = 1
|
|
24
|
+
} = o, c = t === "main" ? "950" : "pure", a = c === "pure" ? `--color-${t}` : `--color-${t}-${c}`, n = i[e] || i[100];
|
|
25
|
+
return `rgba(var(${a}), ${n})`;
|
|
26
|
+
}
|
|
27
|
+
const w = p.forwardRef(function(t, e) {
|
|
28
|
+
const {
|
|
29
|
+
family: c = "primary",
|
|
30
|
+
size: a = "normal",
|
|
31
|
+
weight: n = "normal",
|
|
32
|
+
asDiv: l = !1,
|
|
33
|
+
centered: m = !1,
|
|
34
|
+
truncated: u = !1,
|
|
35
|
+
typographic: _ = !1,
|
|
36
|
+
uppercase: x = !1,
|
|
37
|
+
userSelectable: d = !1,
|
|
38
|
+
children: y,
|
|
39
|
+
className: v
|
|
40
|
+
} = t, T = h(r.root, v, {
|
|
41
|
+
[r.block]: l,
|
|
42
|
+
[r.centered]: m,
|
|
43
|
+
[r.truncated]: u,
|
|
44
|
+
[r.typographic]: _,
|
|
45
|
+
[g.cls.userSelectableText]: d
|
|
46
|
+
}), s = {
|
|
47
|
+
color: C(t),
|
|
48
|
+
fontFamily: `var(--font-family-${c})`,
|
|
49
|
+
fontSize: `var(--font-size-${a})`,
|
|
50
|
+
fontWeight: `var(--font-weight-${n})`
|
|
51
|
+
};
|
|
52
|
+
return x && (s.textTransform = "uppercase"), // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
/* @__PURE__ */ f(l ? "div" : "span", { ref: e, dir: "auto", className: T, style: s, children: y });
|
|
54
|
+
}), D = p.forwardRef(function(t, e) {
|
|
55
|
+
return /* @__PURE__ */ f(w, { ref: e, ...t, asDiv: !0 });
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
i as TEXT_OPACITY_MAP,
|
|
59
|
+
w as Text,
|
|
60
|
+
D as TextBlock
|
|
61
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type TextColor = 'inherit' | 'main' | 'primary' | 'teal' | 'success' | 'warning' | 'error';
|
|
3
|
+
export type TextSize = 'xsmall' | 'small' | 'normal' | 'large' | 'xlarge' | 'xxlarge';
|
|
4
|
+
export type TextWeight = 'thin' | 'normal' | 'bold' | 'bolder';
|
|
5
|
+
export type TextOpacity = '0' | '25' | '50' | '75' | '100';
|
|
6
|
+
interface TextPropsBase {
|
|
7
|
+
asDiv?: boolean;
|
|
8
|
+
centered?: boolean;
|
|
9
|
+
truncated?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* If it'll be a multiline text, use this to add extra spacing between lines
|
|
12
|
+
*/
|
|
13
|
+
typographic?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Allow users to select text
|
|
16
|
+
*/
|
|
17
|
+
userSelectable?: boolean;
|
|
18
|
+
uppercase?: boolean;
|
|
19
|
+
size?: TextSize;
|
|
20
|
+
weight?: TextWeight;
|
|
21
|
+
family?: 'primary' | 'secondary' | 'monospace';
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
interface TextPropsFullControl extends TextPropsBase {
|
|
26
|
+
color?: TextColor;
|
|
27
|
+
opacity?: TextOpacity;
|
|
28
|
+
}
|
|
29
|
+
interface TextPropsColorToken extends TextPropsBase {
|
|
30
|
+
colorToken: string;
|
|
31
|
+
}
|
|
32
|
+
export type TextProps = TextPropsFullControl | TextPropsColorToken;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TextareaProps {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
rows?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
resize?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
11
|
+
autofocus?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
backdropBlur?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function Textarea(props: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as t, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import _ from "react";
|
|
3
|
+
import { clsx as p } from "../../utils/clsx.js";
|
|
4
|
+
import '../../assets/Textarea.css';const k = "_root_1gmfx_1", v = "_small_1gmfx_7", C = "_large_1gmfx_11", N = "_error_1gmfx_15", w = "_disabled_1gmfx_19", e = {
|
|
5
|
+
root: k,
|
|
6
|
+
"full-width": "_full-width_1gmfx_4",
|
|
7
|
+
small: v,
|
|
8
|
+
large: C,
|
|
9
|
+
error: N,
|
|
10
|
+
disabled: w,
|
|
11
|
+
"resize-none": "_resize-none_1gmfx_57",
|
|
12
|
+
"resize-vertical": "_resize-vertical_1gmfx_60",
|
|
13
|
+
"resize-horizontal": "_resize-horizontal_1gmfx_63",
|
|
14
|
+
"resize-both": "_resize-both_1gmfx_66",
|
|
15
|
+
"backdrop-blur": "_backdrop-blur_1gmfx_83"
|
|
16
|
+
};
|
|
17
|
+
function B(n) {
|
|
18
|
+
const {
|
|
19
|
+
value: c,
|
|
20
|
+
onChange: r,
|
|
21
|
+
label: o,
|
|
22
|
+
placeholder: i,
|
|
23
|
+
rows: d,
|
|
24
|
+
resize: m = "none",
|
|
25
|
+
disabled: a = !1,
|
|
26
|
+
autofocus: f,
|
|
27
|
+
className: g,
|
|
28
|
+
backdropBlur: x = !1
|
|
29
|
+
} = n, b = _.useCallback(
|
|
30
|
+
(h) => {
|
|
31
|
+
r(h.target.value);
|
|
32
|
+
},
|
|
33
|
+
[r]
|
|
34
|
+
), l = _.useId(), s = /* @__PURE__ */ t(
|
|
35
|
+
"textarea",
|
|
36
|
+
{
|
|
37
|
+
autoFocus: f,
|
|
38
|
+
id: l,
|
|
39
|
+
className: e[`resize-${m}`],
|
|
40
|
+
rows: d,
|
|
41
|
+
value: c,
|
|
42
|
+
disabled: a,
|
|
43
|
+
onChange: b,
|
|
44
|
+
placeholder: i
|
|
45
|
+
}
|
|
46
|
+
), u = p(e.root, g, {
|
|
47
|
+
[e.disabled]: a,
|
|
48
|
+
[e["backdrop-blur"]]: x
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ t("div", { className: u, children: o ? /* @__PURE__ */ z("label", { htmlFor: l, children: [
|
|
51
|
+
o,
|
|
52
|
+
s
|
|
53
|
+
] }) : s });
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
B as Textarea
|
|
57
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
type FixedOn = 'top' | 'top-left' | 'right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left';
|
|
4
|
+
type TitleChildren = ((ref: React.RefObject<any>) => React.ReactNode) | React.ReactElement;
|
|
5
|
+
export interface TitleProps {
|
|
6
|
+
title?: React.ReactNode;
|
|
7
|
+
delay?: number;
|
|
8
|
+
animated?: boolean;
|
|
9
|
+
fixedOn?: FixedOn;
|
|
10
|
+
children: TitleChildren;
|
|
11
|
+
}
|
|
12
|
+
export declare function Title(props: TitleProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsxs as w, Fragment as L, jsx as _ } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import { T as k } from "../../outlets-BsMV5obW.js";
|
|
4
|
+
import { clsx as y } from "../../utils/clsx.js";
|
|
5
|
+
import C from "../../utils/mergeRefs.js";
|
|
6
|
+
import '../../assets/Title.css';const O = "_wrapper_1l1sn_1", R = "_appearance_1l1sn_1", T = "_animated_1l1sn_26", $ = "_root_1l1sn_71", M = "_shortcut_1l1sn_84", d = {
|
|
7
|
+
wrapper: O,
|
|
8
|
+
appearance: R,
|
|
9
|
+
animated: T,
|
|
10
|
+
"fixed-on-top": "_fixed-on-top_1l1sn_29",
|
|
11
|
+
"fixed-on-top-left": "_fixed-on-top-left_1l1sn_35",
|
|
12
|
+
"fixed-on-bottom": "_fixed-on-bottom_1l1sn_41",
|
|
13
|
+
"fixed-on-bottom-left": "_fixed-on-bottom-left_1l1sn_47",
|
|
14
|
+
"fixed-on-bottom-right": "_fixed-on-bottom-right_1l1sn_53",
|
|
15
|
+
"fixed-on-left": "_fixed-on-left_1l1sn_59",
|
|
16
|
+
"fixed-on-right": "_fixed-on-right_1l1sn_65",
|
|
17
|
+
root: $,
|
|
18
|
+
shortcut: M
|
|
19
|
+
}, c = 10;
|
|
20
|
+
function N(i, a, [t, o]) {
|
|
21
|
+
const r = i ? o : o - 20, s = i ? t : t + 16;
|
|
22
|
+
return {
|
|
23
|
+
// Prefer top and left for element to snap to the pixel grid
|
|
24
|
+
// as when using transform it will become blurry in most of the cases as top and left values are floats
|
|
25
|
+
top: `${r}px`,
|
|
26
|
+
left: `${s}px`,
|
|
27
|
+
// transform: `translate(${left}px, ${top}px)`,
|
|
28
|
+
maxWidth: `calc(100vw - ${s}px - 10px)`,
|
|
29
|
+
animationDelay: `${a}ms`
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function S(i, a) {
|
|
33
|
+
const {
|
|
34
|
+
x: t,
|
|
35
|
+
y: o,
|
|
36
|
+
width: r,
|
|
37
|
+
height: s
|
|
38
|
+
} = i.getBoundingClientRect();
|
|
39
|
+
let n = 0, e = 0;
|
|
40
|
+
switch (a) {
|
|
41
|
+
case "top": {
|
|
42
|
+
n = t + r / 2, e = o - c;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
case "top-left": {
|
|
46
|
+
n = t, e = o - c;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
case "bottom": {
|
|
50
|
+
n = t + r / 2, e = o + s + c;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case "bottom-left": {
|
|
54
|
+
n = t, e = o + s + c;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
case "bottom-right": {
|
|
58
|
+
n = t + r, e = o + s + c;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case "left": {
|
|
62
|
+
n = t - c, e = o + s / 2;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case "right": {
|
|
66
|
+
n = t + r + c, e = o + s / 2;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return [n, e];
|
|
71
|
+
}
|
|
72
|
+
function B(i) {
|
|
73
|
+
const {
|
|
74
|
+
title: a,
|
|
75
|
+
children: t,
|
|
76
|
+
animated: o = !0,
|
|
77
|
+
fixedOn: r = "bottom",
|
|
78
|
+
delay: s = 0
|
|
79
|
+
} = i, n = l.useRef(r);
|
|
80
|
+
n.current = r;
|
|
81
|
+
const e = l.useRef(null), [b, p] = l.useState(!1), [g, m] = l.useState([0, 0]);
|
|
82
|
+
l.useEffect(() => {
|
|
83
|
+
if (!e.current)
|
|
84
|
+
return;
|
|
85
|
+
const u = (f) => {
|
|
86
|
+
n.current && e.current ? m(S(e.current, n.current)) : m([f.clientX, f.clientY]), p(!0);
|
|
87
|
+
}, h = () => {
|
|
88
|
+
p(!1);
|
|
89
|
+
}, v = (f) => {
|
|
90
|
+
n.current || m([f.clientX, f.clientY]);
|
|
91
|
+
};
|
|
92
|
+
return e.current.addEventListener("mouseenter", u), e.current.addEventListener("mouseleave", h), e.current.addEventListener("mousemove", v), () => {
|
|
93
|
+
e.current && (e.current.removeEventListener("mouseenter", u), e.current.removeEventListener("mouseleave", h), e.current.removeEventListener("mousemove", v));
|
|
94
|
+
};
|
|
95
|
+
}, []);
|
|
96
|
+
let x = null;
|
|
97
|
+
if (b && a) {
|
|
98
|
+
const u = y(d.wrapper, d[`fixed-on-${r}`], {
|
|
99
|
+
[d.animated]: o
|
|
100
|
+
});
|
|
101
|
+
x = /* @__PURE__ */ _(k, { children: /* @__PURE__ */ _("div", { className: u, style: N(!!r, s, g), children: /* @__PURE__ */ _("div", { className: d.root, children: a }) }) });
|
|
102
|
+
}
|
|
103
|
+
const E = typeof t == "function" ? t(e) : l.cloneElement(t, {
|
|
104
|
+
ref: C(e, t.props.ref)
|
|
105
|
+
});
|
|
106
|
+
return /* @__PURE__ */ w(L, { children: [
|
|
107
|
+
E,
|
|
108
|
+
x
|
|
109
|
+
] });
|
|
110
|
+
}
|
|
111
|
+
export {
|
|
112
|
+
B as Title
|
|
113
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const PreTitleOutlet: import('react').FC<{
|
|
3
|
+
children?: import('react').ReactNode;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const TitleOutlet: import('react').FC<{
|
|
6
|
+
children?: import('react').ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const AfterTitleOutlet: import('react').FC<{
|
|
9
|
+
children?: import('react').ReactNode;
|
|
10
|
+
}>;
|