@companix/uikit 0.0.2 → 0.0.3
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/bundle.es.js +61 -0
- package/dist/bundle.es10.js +87 -0
- package/dist/bundle.es11.js +75 -0
- package/dist/bundle.es12.js +38 -0
- package/dist/bundle.es13.js +33 -0
- package/dist/bundle.es14.js +18 -0
- package/dist/bundle.es15.js +11 -0
- package/dist/bundle.es16.js +35 -0
- package/dist/bundle.es17.js +27 -0
- package/dist/bundle.es18.js +23 -0
- package/dist/bundle.es19.js +24 -0
- package/dist/bundle.es20.js +15 -0
- package/dist/bundle.es21.js +41 -0
- package/dist/bundle.es22.js +18 -0
- package/dist/bundle.es23.js +36 -0
- package/dist/bundle.es24.js +23 -0
- package/dist/bundle.es25.js +42 -0
- package/dist/bundle.es26.js +114 -0
- package/dist/bundle.es27.js +115 -0
- package/dist/bundle.es28.js +38 -0
- package/dist/bundle.es29.js +13 -0
- package/dist/bundle.es3.js +45 -0
- package/dist/bundle.es30.js +27 -0
- package/dist/bundle.es31.js +38 -0
- package/dist/bundle.es35.js +43 -0
- package/dist/bundle.es36.js +442 -0
- package/dist/bundle.es37.js +24 -0
- package/dist/bundle.es38.js +26 -0
- package/dist/bundle.es39.js +83 -0
- package/dist/bundle.es4.js +14 -0
- package/dist/bundle.es40.js +20 -0
- package/dist/bundle.es41.js +16 -0
- package/dist/bundle.es43.js +7 -0
- package/dist/bundle.es44.js +23 -0
- package/dist/bundle.es45.js +16 -0
- package/dist/bundle.es46.js +72 -0
- package/dist/bundle.es47.js +70 -0
- package/dist/bundle.es48.js +34 -0
- package/dist/bundle.es49.js +70 -0
- package/dist/bundle.es5.js +88 -0
- package/dist/bundle.es50.js +33 -0
- package/dist/bundle.es51.js +78 -0
- package/dist/bundle.es52.js +51 -0
- package/dist/bundle.es53.js +45 -0
- package/dist/bundle.es54.js +40 -0
- package/dist/bundle.es55.js +36 -0
- package/dist/bundle.es56.js +9 -0
- package/dist/bundle.es57.js +9 -0
- package/dist/bundle.es58.js +7 -0
- package/dist/bundle.es59.js +9 -0
- package/dist/bundle.es6.js +87 -0
- package/dist/bundle.es60.js +8 -0
- package/dist/bundle.es61.js +19 -0
- package/dist/bundle.es62.js +15 -0
- package/dist/bundle.es63.js +22 -0
- package/dist/bundle.es64.js +45 -0
- package/dist/bundle.es65.js +28 -0
- package/dist/bundle.es66.js +34 -0
- package/dist/bundle.es67.js +6 -0
- package/dist/bundle.es68.js +12 -0
- package/dist/bundle.es69.js +47 -0
- package/dist/bundle.es7.js +80 -0
- package/dist/bundle.es70.js +11 -0
- package/dist/bundle.es71.js +18 -0
- package/dist/bundle.es72.js +32 -0
- package/dist/bundle.es73.js +35 -0
- package/dist/bundle.es74.js +6 -0
- package/dist/bundle.es75.js +7 -0
- package/dist/bundle.es76.js +7 -0
- package/dist/bundle.es77.js +11 -0
- package/dist/bundle.es78.js +17 -0
- package/dist/bundle.es79.js +7 -0
- package/dist/bundle.es8.js +29 -0
- package/dist/bundle.es80.js +17 -0
- package/dist/bundle.es81.js +25 -0
- package/dist/bundle.es9.js +47 -0
- package/dist/types/Button/index.d.ts +20 -0
- package/dist/types/ButtonGroup/index.d.ts +7 -0
- package/dist/types/Checkbox/index.d.ts +10 -0
- package/dist/types/Countdown/index.d.ts +7 -0
- package/dist/types/DateInput/index.d.ts +13 -0
- package/dist/types/DatePicker/Calendar.d.ts +14 -0
- package/dist/types/DatePicker/CalendarHeader.d.ts +10 -0
- package/dist/types/DatePicker/index.d.ts +12 -0
- package/dist/types/Dialog/index.d.ts +12 -0
- package/dist/types/DialogAlert/Alert.d.ts +19 -0
- package/dist/types/DialogAlert/Viewport.d.ts +8 -0
- package/dist/types/DialogAlert/index.d.ts +11 -0
- package/dist/types/Drawer/index.d.ts +13 -0
- package/dist/types/File/index.d.ts +10 -0
- package/dist/types/Form/index.d.ts +17 -0
- package/dist/types/Icon/index.d.ts +7 -0
- package/dist/types/LoadButton/index.d.ts +5 -0
- package/dist/types/NumberInput/index.d.ts +6 -0
- package/dist/types/OptionItem/OptionItem.d.ts +7 -0
- package/dist/types/OptionItem/OptionsList.d.ts +8 -0
- package/dist/types/Popover/index.d.ts +26 -0
- package/dist/types/Radio/index.d.ts +20 -0
- package/dist/types/Scrollable/ImitateScroll.d.ts +10 -0
- package/dist/types/Scrollable/index.d.ts +33 -0
- package/dist/types/Select/SelectInput.d.ts +14 -0
- package/dist/types/Select/index.d.ts +15 -0
- package/dist/types/SelectTags/index.d.ts +15 -0
- package/dist/types/Spinner/index.d.ts +8 -0
- package/dist/types/Stepper/index.d.ts +8 -0
- package/dist/types/Switch/index.d.ts +10 -0
- package/dist/types/Tabs/index.d.ts +13 -0
- package/dist/types/TextArea/index.d.ts +7 -0
- package/dist/types/Toaster/RemoveListener.d.ts +3 -0
- package/dist/types/Toaster/Toast.d.ts +9 -0
- package/dist/types/Toaster/Viewport.d.ts +13 -0
- package/dist/types/Toaster/index.d.ts +15 -0
- package/dist/types/Tooltip/index.d.ts +8 -0
- package/dist/types/__hooks/use-frooze-closing.d.ts +5 -0
- package/dist/types/__hooks/use-loading.d.ts +8 -0
- package/dist/types/__hooks/use-local-storage.d.ts +1 -0
- package/dist/types/__hooks/use-popover-position.d.ts +8 -0
- package/dist/types/__hooks/use-previos.d.ts +2 -0
- package/dist/types/__hooks/use-resize.d.ts +3 -0
- package/dist/types/__hooks/use-scrollbox.d.ts +7 -0
- package/dist/types/__hooks/use-stepper-input.d.ts +13 -0
- package/dist/types/__hooks/use-update.d.ts +1 -0
- package/dist/types/__hooks/useCalendar.d.ts +17 -0
- package/dist/types/__hooks/useCalendarOptions-copy.d.ts +22 -0
- package/dist/types/__hooks/useCalendarOptions.d.ts +31 -0
- package/dist/types/__libs/calendar.d.ts +25 -0
- package/dist/types/__utils/utils.d.ts +25 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/types.d.ts +13 -0
- package/dist/uikit.css +1 -0
- package/package.json +10 -6
- package/.eslintrc +0 -54
- package/declaration.d.ts +0 -4
- package/index.html +0 -12
- package/playground/App.tsx +0 -166
- package/playground/Example.tsx +0 -14
- package/playground/Test.tsx +0 -44
- package/playground/animation-test-1/index.scss +0 -20
- package/playground/animation-test-1/index.tsx +0 -17
- package/playground/animation-test-2/index.scss +0 -62
- package/playground/animation-test-2/index.tsx +0 -32
- package/playground/bootstrap.tsx +0 -19
- package/playground/buttons/index.tsx +0 -132
- package/playground/checkbox/index.tsx +0 -64
- package/playground/date-input/index.tsx +0 -45
- package/playground/date-picker/index.tsx +0 -41
- package/playground/dialog/index.tsx +0 -92
- package/playground/dialog-alert/index.tsx +0 -47
- package/playground/drawer/index.tsx +0 -55
- package/playground/index.css +0 -33
- package/playground/index.scss +0 -270
- package/playground/input/index.tsx +0 -112
- package/playground/number-inputs/index.tsx +0 -50
- package/playground/popovers/index.tsx +0 -70
- package/playground/radio-group/index.tsx +0 -69
- package/playground/select/index.tsx +0 -72
- package/playground/select-tags/index.tsx +0 -36
- package/playground/styles.scss +0 -2
- package/playground/switch/index.tsx +0 -44
- package/playground/tabs/index.tsx +0 -16
- package/playground/test.scss +0 -0
- package/playground/text-area/index.tsx +0 -17
- package/playground/text-input/index.tsx +0 -12
- package/playground/toaster/index.tsx +0 -156
- package/playground/tooltip/index.tsx +0 -26
- package/src/Button/Button.scss +0 -128
- package/src/Button/index.tsx +0 -72
- package/src/ButtonGroup/ButtonGroup.scss +0 -18
- package/src/ButtonGroup/index.tsx +0 -20
- package/src/Checkbox/Checkbox.scss +0 -115
- package/src/Checkbox/index.tsx +0 -46
- package/src/Countdown/index.tsx +0 -54
- package/src/DateInput/DateInput.scss +0 -11
- package/src/DateInput/index.tsx +0 -96
- package/src/DatePicker/Calendar.scss +0 -125
- package/src/DatePicker/Calendar.tsx +0 -157
- package/src/DatePicker/CalendarHeader.tsx +0 -139
- package/src/DatePicker/DatePicker.scss +0 -0
- package/src/DatePicker/index.tsx +0 -177
- package/src/Dialog/Dialog.scss +0 -25
- package/src/Dialog/Popup.scss +0 -55
- package/src/Dialog/index.tsx +0 -31
- package/src/DialogAlert/Alert.scss +0 -52
- package/src/DialogAlert/Alert.tsx +0 -78
- package/src/DialogAlert/Viewport.tsx +0 -52
- package/src/DialogAlert/index.tsx +0 -37
- package/src/Drawer/Drawer.scss +0 -112
- package/src/Drawer/index.tsx +0 -46
- package/src/File/index.tsx +0 -60
- package/src/Form/Form.scss +0 -70
- package/src/Form/Input.scss +0 -24
- package/src/Form/index.tsx +0 -131
- package/src/Icon/icon.scss +0 -18
- package/src/Icon/index.tsx +0 -43
- package/src/LoadButton/index.tsx +0 -17
- package/src/NumberInput/index.tsx +0 -74
- package/src/OptionItem/Option.scss +0 -89
- package/src/OptionItem/OptionItem.tsx +0 -49
- package/src/OptionItem/OptionsList.tsx +0 -26
- package/src/Popover/Popover.scss +0 -80
- package/src/Popover/index.tsx +0 -117
- package/src/Radio/Radio.scss +0 -148
- package/src/Radio/index.tsx +0 -68
- package/src/Scrollable/ImitateScroll.tsx +0 -141
- package/src/Scrollable/Scrollable.scss +0 -50
- package/src/Scrollable/index.tsx +0 -141
- package/src/Select/Select.scss +0 -80
- package/src/Select/SelectInput.tsx +0 -131
- package/src/Select/index.tsx +0 -134
- package/src/SelectTags/SelectTags.scss +0 -66
- package/src/SelectTags/index.tsx +0 -192
- package/src/Spinner/Spinner.scss +0 -14
- package/src/Spinner/index.tsx +0 -19
- package/src/Stepper/StepperInput.scss +0 -35
- package/src/Stepper/index.tsx +0 -76
- package/src/Switch/Switch.scss +0 -102
- package/src/Switch/index.tsx +0 -49
- package/src/Tabs/Tabs.scss +0 -58
- package/src/Tabs/index.tsx +0 -89
- package/src/TextArea/TextArea.scss +0 -34
- package/src/TextArea/index.tsx +0 -51
- package/src/Toaster/RemoveListener.tsx +0 -11
- package/src/Toaster/Toast.tsx +0 -69
- package/src/Toaster/Toaster.scss +0 -151
- package/src/Toaster/Viewport.tsx +0 -117
- package/src/Toaster/index.tsx +0 -52
- package/src/Tooltip/Tooltip.scss +0 -28
- package/src/Tooltip/index.tsx +0 -33
- package/src/__hooks/use-frooze-closing.ts +0 -51
- package/src/__hooks/use-loading.ts +0 -34
- package/src/__hooks/use-local-storage.ts +0 -19
- package/src/__hooks/use-popover-position.ts +0 -24
- package/src/__hooks/use-previos.ts +0 -25
- package/src/__hooks/use-resize.ts +0 -41
- package/src/__hooks/use-scrollbox.ts +0 -45
- package/src/__hooks/use-stepper-input.ts +0 -82
- package/src/__hooks/use-update.ts +0 -19
- package/src/__hooks/useCalendar.ts +0 -104
- package/src/__hooks/useCalendarOptions-copy.ts +0 -87
- package/src/__hooks/useCalendarOptions.ts +0 -68
- package/src/__libs/calendar.ts +0 -175
- package/src/__utils/utils.ts +0 -137
- package/src/css.scss +0 -120
- package/src/index.scss +0 -22
- package/src/index.ts +0 -36
- package/src/mixins.scss +0 -99
- package/src/theme.scss +0 -103
- package/src/types.ts +0 -14
- package/tailwind.config.js +0 -91
- package/themes/classic/animations.scss +0 -179
- package/themes/classic/classic.scss +0 -493
- package/tsconfig.json +0 -27
- package/vite.build.ts +0 -35
- package/vite.config.ts +0 -33
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs as x, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import L from "classnames";
|
|
3
|
+
import { useRef as d, useMemo as f, useCallback as n, useEffect as T, useLayoutEffect as H } from "react";
|
|
4
|
+
import { getContainers as p, pc as h, px as v } from "@companix/utils-browser";
|
|
5
|
+
const C = ({
|
|
6
|
+
children: b,
|
|
7
|
+
thumbClassName: y,
|
|
8
|
+
scrollableClassName: g,
|
|
9
|
+
thumbMargin: R = 0,
|
|
10
|
+
trackWidth: w = 20
|
|
11
|
+
}) => {
|
|
12
|
+
const l = d(null), t = d(null), r = f(() => ({ positons: { top: 0, y: 0 }, scrollRatio: 0 }), []), i = f(() => ({
|
|
13
|
+
start() {
|
|
14
|
+
document.addEventListener("mousemove", a), document.addEventListener("mouseup", m);
|
|
15
|
+
},
|
|
16
|
+
clear() {
|
|
17
|
+
document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", m);
|
|
18
|
+
}
|
|
19
|
+
}), []);
|
|
20
|
+
T(() => {
|
|
21
|
+
const o = new ResizeObserver(u);
|
|
22
|
+
return t.current && p(t.current, (e) => {
|
|
23
|
+
o.observe(e);
|
|
24
|
+
}), () => {
|
|
25
|
+
t.current && p(t.current, (e) => {
|
|
26
|
+
o.unobserve(e);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}, []), H(() => {
|
|
30
|
+
u();
|
|
31
|
+
}, []);
|
|
32
|
+
const u = n(() => {
|
|
33
|
+
const { current: o } = t, { current: e } = l;
|
|
34
|
+
if (e && o) {
|
|
35
|
+
const s = o.clientHeight / o.scrollHeight;
|
|
36
|
+
e.style.height = h(s * 100), e.style.display = s === 1 ? "none" : "block", r.scrollRatio = s;
|
|
37
|
+
}
|
|
38
|
+
}, []), a = n(({ clientY: o }) => {
|
|
39
|
+
const { current: e } = t;
|
|
40
|
+
if (e) {
|
|
41
|
+
const s = o - r.positons.y;
|
|
42
|
+
e.scrollTop = r.positons.top + s / r.scrollRatio;
|
|
43
|
+
}
|
|
44
|
+
}, []), m = n(() => {
|
|
45
|
+
i.clear();
|
|
46
|
+
}, []), E = n(({ clientY: o }) => {
|
|
47
|
+
const { current: e } = t;
|
|
48
|
+
e && (r.positons = {
|
|
49
|
+
top: e.scrollTop,
|
|
50
|
+
y: o
|
|
51
|
+
}), i.start();
|
|
52
|
+
}, []), M = () => {
|
|
53
|
+
requestAnimationFrame(() => {
|
|
54
|
+
const { current: o } = t, { current: e } = l;
|
|
55
|
+
e && o && (e.style.top = h(o.scrollTop * 100 / o.scrollHeight));
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ x("div", { className: "relative h-full overflow-hidden", children: [
|
|
59
|
+
/* @__PURE__ */ c(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: L("hidden-scroll h-full overflow-y-scroll", g),
|
|
63
|
+
onScroll: M,
|
|
64
|
+
ref: t,
|
|
65
|
+
children: b
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ c(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: "absolute right-0 top-0 box-border h-full",
|
|
72
|
+
style: { width: v(w), padding: v(R) },
|
|
73
|
+
children: /* @__PURE__ */ c(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
onMouseDown: E,
|
|
77
|
+
className: `${y} relative w-full rounded-full`,
|
|
78
|
+
ref: l
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] });
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
C as ImitateScroll
|
|
87
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isShadowRoot as r } from "./bundle.es62.js";
|
|
2
|
+
import { shadowDOM as a } from "./bundle.es79.js";
|
|
3
|
+
function i(t, f) {
|
|
4
|
+
if (!a()) return f && t ? t.contains(f) : !1;
|
|
5
|
+
if (!t || !f) return !1;
|
|
6
|
+
let e = f;
|
|
7
|
+
for (; e !== null; ) {
|
|
8
|
+
if (e === t) return !0;
|
|
9
|
+
e.tagName === "SLOT" && e.assignedSlot ? e = e.assignedSlot.parentNode : r(e) ? e = e.host : e = e.parentNode;
|
|
10
|
+
}
|
|
11
|
+
return !1;
|
|
12
|
+
}
|
|
13
|
+
function n(t) {
|
|
14
|
+
return a() && t.target.shadowRoot && t.composedPath ? t.composedPath()[0] : t.target;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
n as getEventTarget,
|
|
18
|
+
i as nodeContains
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const t = (o) => {
|
|
2
|
+
var n;
|
|
3
|
+
return (n = o?.ownerDocument) !== null && n !== void 0 ? n : document;
|
|
4
|
+
}, e = (o) => o && "window" in o && o.window === o ? o : t(o).defaultView || window;
|
|
5
|
+
function d(o) {
|
|
6
|
+
return o !== null && typeof o == "object" && "nodeType" in o && typeof o.nodeType == "number";
|
|
7
|
+
}
|
|
8
|
+
function c(o) {
|
|
9
|
+
return d(o) && o.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in o;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
t as getOwnerDocument,
|
|
13
|
+
e as getOwnerWindow,
|
|
14
|
+
c as isShadowRoot
|
|
15
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { chain as n } from "./bundle.es60.js";
|
|
2
|
+
import { mergeIds as s } from "./bundle.es78.js";
|
|
3
|
+
import { clsx as l } from "./bundle.es80.js";
|
|
4
|
+
function a(...r) {
|
|
5
|
+
let o = {
|
|
6
|
+
...r[0]
|
|
7
|
+
};
|
|
8
|
+
for (let c = 1; c < r.length; c++) {
|
|
9
|
+
let i = r[c];
|
|
10
|
+
for (let e in i) {
|
|
11
|
+
let f = o[e], t = i[e];
|
|
12
|
+
typeof f == "function" && typeof t == "function" && // This is a lot faster than a regex.
|
|
13
|
+
e[0] === "o" && e[1] === "n" && e.charCodeAt(2) >= /* 'A' */
|
|
14
|
+
65 && e.charCodeAt(2) <= /* 'Z' */
|
|
15
|
+
90 ? o[e] = n(f, t) : (e === "className" || e === "UNSAFE_className") && typeof f == "string" && typeof t == "string" ? o[e] = l(f, t) : e === "id" && f && t ? o.id = s(f, t) : o[e] = t !== void 0 ? t : f;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return o;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
a as mergeProps
|
|
22
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
function f(l) {
|
|
2
|
+
if (c()) l.focus({
|
|
3
|
+
preventScroll: !0
|
|
4
|
+
});
|
|
5
|
+
else {
|
|
6
|
+
let e = n(l);
|
|
7
|
+
l.focus(), s(e);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
let r = null;
|
|
11
|
+
function c() {
|
|
12
|
+
if (r == null) {
|
|
13
|
+
r = !1;
|
|
14
|
+
try {
|
|
15
|
+
document.createElement("div").focus({
|
|
16
|
+
get preventScroll() {
|
|
17
|
+
return r = !0, !0;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
} catch {
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return r;
|
|
24
|
+
}
|
|
25
|
+
function n(l) {
|
|
26
|
+
let e = l.parentNode, o = [], t = document.scrollingElement || document.documentElement;
|
|
27
|
+
for (; e instanceof HTMLElement && e !== t; )
|
|
28
|
+
(e.offsetHeight < e.scrollHeight || e.offsetWidth < e.scrollWidth) && o.push({
|
|
29
|
+
element: e,
|
|
30
|
+
scrollTop: e.scrollTop,
|
|
31
|
+
scrollLeft: e.scrollLeft
|
|
32
|
+
}), e = e.parentNode;
|
|
33
|
+
return t instanceof HTMLElement && o.push({
|
|
34
|
+
element: t,
|
|
35
|
+
scrollTop: t.scrollTop,
|
|
36
|
+
scrollLeft: t.scrollLeft
|
|
37
|
+
}), o;
|
|
38
|
+
}
|
|
39
|
+
function s(l) {
|
|
40
|
+
for (let { element: e, scrollTop: o, scrollLeft: t } of l)
|
|
41
|
+
e.scrollTop = o, e.scrollLeft = t;
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
f as focusWithoutScrolling
|
|
45
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { focusWithoutScrolling as f } from "./bundle.es64.js";
|
|
2
|
+
import { isFirefox as p, isWebKit as K, isMac as l, isIPad as $ } from "./bundle.es69.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function o(e, c, d = !0) {
|
|
5
|
+
var t, a;
|
|
6
|
+
let { metaKey: i, ctrlKey: n, altKey: s, shiftKey: r } = c;
|
|
7
|
+
p() && (!((a = window.event) === null || a === void 0 || (t = a.type) === null || t === void 0) && t.startsWith("key")) && e.target === "_blank" && (l() ? i = !0 : n = !0);
|
|
8
|
+
let y = K() && l() && !$() && process.env.NODE_ENV !== "test" ? new KeyboardEvent("keydown", {
|
|
9
|
+
keyIdentifier: "Enter",
|
|
10
|
+
metaKey: i,
|
|
11
|
+
ctrlKey: n,
|
|
12
|
+
altKey: s,
|
|
13
|
+
shiftKey: r
|
|
14
|
+
}) : new MouseEvent("click", {
|
|
15
|
+
metaKey: i,
|
|
16
|
+
ctrlKey: n,
|
|
17
|
+
altKey: s,
|
|
18
|
+
shiftKey: r,
|
|
19
|
+
detail: 1,
|
|
20
|
+
bubbles: !0,
|
|
21
|
+
cancelable: !0
|
|
22
|
+
});
|
|
23
|
+
o.isOpening = d, f(e), e.dispatchEvent(y), o.isOpening = !1;
|
|
24
|
+
}
|
|
25
|
+
o.isOpening = !1;
|
|
26
|
+
export {
|
|
27
|
+
o as openLink
|
|
28
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useRef as c, useCallback as f, useEffect as b } from "react";
|
|
2
|
+
function L() {
|
|
3
|
+
let o = c(/* @__PURE__ */ new Map()), u = f((e, l, r, t) => {
|
|
4
|
+
let n = t?.once ? (...d) => {
|
|
5
|
+
o.current.delete(r), r(...d);
|
|
6
|
+
} : r;
|
|
7
|
+
o.current.set(r, {
|
|
8
|
+
type: l,
|
|
9
|
+
eventTarget: e,
|
|
10
|
+
fn: n,
|
|
11
|
+
options: t
|
|
12
|
+
}), e.addEventListener(l, n, t);
|
|
13
|
+
}, []), a = f((e, l, r, t) => {
|
|
14
|
+
var n;
|
|
15
|
+
let d = ((n = o.current.get(r)) === null || n === void 0 ? void 0 : n.fn) || r;
|
|
16
|
+
e.removeEventListener(l, d, t), o.current.delete(r);
|
|
17
|
+
}, []), s = f(() => {
|
|
18
|
+
o.current.forEach((e, l) => {
|
|
19
|
+
a(e.eventTarget, e.type, l, e.options);
|
|
20
|
+
});
|
|
21
|
+
}, [
|
|
22
|
+
a
|
|
23
|
+
]);
|
|
24
|
+
return b(() => s, [
|
|
25
|
+
s
|
|
26
|
+
]), {
|
|
27
|
+
addGlobalListener: u,
|
|
28
|
+
removeGlobalListener: a,
|
|
29
|
+
removeAllGlobalListeners: s
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
L as useGlobalListeners
|
|
34
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
function a(t) {
|
|
2
|
+
var n;
|
|
3
|
+
if (typeof window > "u" || window.navigator == null) return !1;
|
|
4
|
+
let o = (n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.brands;
|
|
5
|
+
return Array.isArray(o) && o.some((s) => t.test(s.brand)) || t.test(window.navigator.userAgent);
|
|
6
|
+
}
|
|
7
|
+
function r(t) {
|
|
8
|
+
var n;
|
|
9
|
+
return typeof window < "u" && window.navigator != null ? t.test(((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.platform) || window.navigator.platform) : !1;
|
|
10
|
+
}
|
|
11
|
+
function e(t) {
|
|
12
|
+
if (process.env.NODE_ENV === "test") return t;
|
|
13
|
+
let n = null;
|
|
14
|
+
return () => (n == null && (n = t()), n);
|
|
15
|
+
}
|
|
16
|
+
const i = e(function() {
|
|
17
|
+
return r(/^Mac/i);
|
|
18
|
+
}), c = e(function() {
|
|
19
|
+
return r(/^iPhone/i);
|
|
20
|
+
}), u = e(function() {
|
|
21
|
+
return r(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
22
|
+
i() && navigator.maxTouchPoints > 1;
|
|
23
|
+
}), d = e(function() {
|
|
24
|
+
return c() || u();
|
|
25
|
+
});
|
|
26
|
+
e(function() {
|
|
27
|
+
return i() || d();
|
|
28
|
+
});
|
|
29
|
+
const f = e(function() {
|
|
30
|
+
return a(/AppleWebKit/i) && !$();
|
|
31
|
+
}), $ = e(function() {
|
|
32
|
+
return a(/Chrome/i);
|
|
33
|
+
}), l = e(function() {
|
|
34
|
+
return a(/Android/i);
|
|
35
|
+
}), w = e(function() {
|
|
36
|
+
return a(/Firefox/i);
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
l as isAndroid,
|
|
40
|
+
$ as isChrome,
|
|
41
|
+
w as isFirefox,
|
|
42
|
+
d as isIOS,
|
|
43
|
+
u as isIPad,
|
|
44
|
+
c as isIPhone,
|
|
45
|
+
i as isMac,
|
|
46
|
+
f as isWebKit
|
|
47
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-popover";
|
|
3
|
+
import { attr as y } from "@companix/utils-browser";
|
|
4
|
+
import B from "classnames";
|
|
5
|
+
import { forwardRef as M, useRef as j } from "react";
|
|
6
|
+
const D = M((a, i) => {
|
|
7
|
+
const {
|
|
8
|
+
children: n,
|
|
9
|
+
sideOffset: s,
|
|
10
|
+
matchTarget: l,
|
|
11
|
+
onAnimationEnd: c,
|
|
12
|
+
onAnimationStart: m,
|
|
13
|
+
onOpenAutoFocus: d,
|
|
14
|
+
onCloseAutoFocus: f,
|
|
15
|
+
triggerRef: p,
|
|
16
|
+
triggerProps: h,
|
|
17
|
+
open: g,
|
|
18
|
+
content: u,
|
|
19
|
+
onOpenChange: v,
|
|
20
|
+
align: C,
|
|
21
|
+
disabled: w,
|
|
22
|
+
minimal: x,
|
|
23
|
+
className: L,
|
|
24
|
+
fitMaxHeight: N = !0,
|
|
25
|
+
side: O,
|
|
26
|
+
showArrows: A
|
|
27
|
+
} = a, e = j(null), P = () => {
|
|
28
|
+
e.current && e.current.click();
|
|
29
|
+
}, b = (R) => {
|
|
30
|
+
w && R.preventDefault();
|
|
31
|
+
};
|
|
32
|
+
return /* @__PURE__ */ t(o.Root, { open: g, onOpenChange: v, children: [
|
|
33
|
+
/* @__PURE__ */ r(o.Trigger, { ref: p, ...h, onClick: b, asChild: !0, children: n }),
|
|
34
|
+
/* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ t(
|
|
35
|
+
o.Content,
|
|
36
|
+
{
|
|
37
|
+
ref: i,
|
|
38
|
+
className: B("popover", L),
|
|
39
|
+
side: O,
|
|
40
|
+
align: C,
|
|
41
|
+
"data-appearance": x ? "minimal" : "default",
|
|
42
|
+
"data-match-target": l,
|
|
43
|
+
sideOffset: s ?? 6,
|
|
44
|
+
avoidCollisions: !0,
|
|
45
|
+
arrowPadding: 10,
|
|
46
|
+
onAnimationStart: m,
|
|
47
|
+
onAnimationEnd: c,
|
|
48
|
+
onOpenAutoFocus: d,
|
|
49
|
+
onCloseAutoFocus: f,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ r(o.Close, { ref: e, style: { display: "none" } }),
|
|
52
|
+
A && /* @__PURE__ */ r(o.Arrow, { width: 30, height: 11, asChild: !0, children: /* @__PURE__ */ r("div", { className: "popover-arrow", children: /* @__PURE__ */ t("svg", { className: "popover-arrow-icon", viewBox: "0 0 30 11", width: 30, height: 11, children: [
|
|
53
|
+
/* @__PURE__ */ r(
|
|
54
|
+
"path",
|
|
55
|
+
{
|
|
56
|
+
className: "popover-arrow-border",
|
|
57
|
+
d: "M 18.112 -2.704 C 19.127 -3.64 19.999 -5.626 19.999 -7.001 L 19.999 18.999 C 19.999 17.621 19.131 15.642 18.111 14.702 L 10.927 8.084 C 9.69 6.944 9.694 5.05 10.927 3.914 L 18.112 -2.704 Z",
|
|
58
|
+
style: { transformBox: "fill-box", transformOrigin: "50% 50%" },
|
|
59
|
+
transform: "matrix(0, -1, 1, 0, 0.000001, 0)"
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ r(
|
|
63
|
+
"path",
|
|
64
|
+
{
|
|
65
|
+
className: "popover-arrow-fill",
|
|
66
|
+
d: "M 17.789 -2.965 C 19.009 -4.09 19.999 -6.341 19.999 -7.995 L 19.999 -10.001 L 19.999 19.999 L 19.999 17.994 C 19.999 16.34 19.016 14.094 17.789 12.964 L 10.606 6.348 C 9.796 5.602 9.804 4.388 10.606 3.648 L 17.789 -2.966 L 17.789 -2.965 Z",
|
|
67
|
+
style: { transformBox: "fill-box", transformOrigin: "50% 50%" },
|
|
68
|
+
transform: "matrix(0, -1, 1, 0, 0, 0)"
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }) }) }),
|
|
72
|
+
/* @__PURE__ */ r("div", { className: "popover-content", "data-fit-max-height": y(N), children: u({ close: P }) })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
) })
|
|
76
|
+
] });
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
D as Popover
|
|
80
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isAndroid as i } from "./bundle.es69.js";
|
|
2
|
+
function o(r) {
|
|
3
|
+
return r.pointerType === "" && r.isTrusted ? !0 : i() && r.pointerType ? r.type === "click" && r.buttons === 1 : r.detail === 0 && !r.pointerType;
|
|
4
|
+
}
|
|
5
|
+
function p(r) {
|
|
6
|
+
return !i() && r.width === 0 && r.height === 0 || r.width === 1 && r.height === 1 && r.pressure === 0 && r.detail === 0 && r.pointerType === "mouse";
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
o as isVirtualClick,
|
|
10
|
+
p as isVirtualPointerEvent
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useLayoutEffect as f } from "./bundle.es67.js";
|
|
2
|
+
import o, { useRef as n, useCallback as u } from "react";
|
|
3
|
+
var c;
|
|
4
|
+
const s = (c = o.useInsertionEffect) !== null && c !== void 0 ? c : f;
|
|
5
|
+
function i(a) {
|
|
6
|
+
const t = n(null);
|
|
7
|
+
return s(() => {
|
|
8
|
+
t.current = a;
|
|
9
|
+
}, [
|
|
10
|
+
a
|
|
11
|
+
]), u((...r) => {
|
|
12
|
+
const e = t.current;
|
|
13
|
+
return e?.(...r);
|
|
14
|
+
}, []);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
i as useEffectEvent
|
|
18
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { isElementVisible as b } from "./bundle.es81.js";
|
|
2
|
+
const n = [
|
|
3
|
+
"input:not([disabled]):not([type=hidden])",
|
|
4
|
+
"select:not([disabled])",
|
|
5
|
+
"textarea:not([disabled])",
|
|
6
|
+
"button:not([disabled])",
|
|
7
|
+
"a[href]",
|
|
8
|
+
"area[href]",
|
|
9
|
+
"summary",
|
|
10
|
+
"iframe",
|
|
11
|
+
"object",
|
|
12
|
+
"embed",
|
|
13
|
+
"audio[controls]",
|
|
14
|
+
"video[controls]",
|
|
15
|
+
'[contenteditable]:not([contenteditable^="false"])',
|
|
16
|
+
"permission"
|
|
17
|
+
], a = n.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
|
|
18
|
+
n.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
|
19
|
+
function d(t) {
|
|
20
|
+
return t.matches(a) && b(t) && !o(t);
|
|
21
|
+
}
|
|
22
|
+
function o(t) {
|
|
23
|
+
let e = t;
|
|
24
|
+
for (; e != null; ) {
|
|
25
|
+
if (e instanceof e.ownerDocument.defaultView.HTMLElement && e.inert) return !0;
|
|
26
|
+
e = e.parentElement;
|
|
27
|
+
}
|
|
28
|
+
return !1;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
d as isFocusable
|
|
32
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
let r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
2
|
+
function o() {
|
|
3
|
+
if (typeof window > "u") return;
|
|
4
|
+
function t(e) {
|
|
5
|
+
return "propertyName" in e;
|
|
6
|
+
}
|
|
7
|
+
let d = (e) => {
|
|
8
|
+
if (!t(e) || !e.target) return;
|
|
9
|
+
let n = r.get(e.target);
|
|
10
|
+
n || (n = /* @__PURE__ */ new Set(), r.set(e.target, n), e.target.addEventListener("transitioncancel", i, {
|
|
11
|
+
once: !0
|
|
12
|
+
})), n.add(e.propertyName);
|
|
13
|
+
}, i = (e) => {
|
|
14
|
+
if (!t(e) || !e.target) return;
|
|
15
|
+
let n = r.get(e.target);
|
|
16
|
+
if (n && (n.delete(e.propertyName), n.size === 0 && (e.target.removeEventListener("transitioncancel", i), r.delete(e.target)), r.size === 0)) {
|
|
17
|
+
for (let s of a) s();
|
|
18
|
+
a.clear();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
document.body.addEventListener("transitionrun", d), document.body.addEventListener("transitionend", i);
|
|
22
|
+
}
|
|
23
|
+
typeof document < "u" && (document.readyState !== "loading" ? o() : document.addEventListener("DOMContentLoaded", o));
|
|
24
|
+
function c() {
|
|
25
|
+
for (const [t] of r)
|
|
26
|
+
"isConnected" in t && !t.isConnected && r.delete(t);
|
|
27
|
+
}
|
|
28
|
+
function f(t) {
|
|
29
|
+
requestAnimationFrame(() => {
|
|
30
|
+
c(), r.size === 0 ? t() : a.add(t);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
f as runAfterTransition
|
|
35
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
let n = /* @__PURE__ */ new Map();
|
|
3
|
+
typeof FinalizationRegistry < "u" && new FinalizationRegistry((e) => {
|
|
4
|
+
n.delete(e);
|
|
5
|
+
});
|
|
6
|
+
function o(e, t) {
|
|
7
|
+
if (e === t) return e;
|
|
8
|
+
let f = n.get(e);
|
|
9
|
+
if (f)
|
|
10
|
+
return f.forEach((r) => r.current = t), t;
|
|
11
|
+
let a = n.get(t);
|
|
12
|
+
return a ? (a.forEach((r) => r.current = e), e) : t;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
n as idsUpdaterMap,
|
|
16
|
+
o as mergeIds
|
|
17
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as n } from "react";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { Popover as m } from "./bundle.es7.js";
|
|
5
|
+
const l = ({ children: e, content: t, side: r }) => {
|
|
6
|
+
const [s, o] = n(!1);
|
|
7
|
+
return /* @__PURE__ */ p(
|
|
8
|
+
m,
|
|
9
|
+
{
|
|
10
|
+
showArrows: !0,
|
|
11
|
+
className: "tooltip",
|
|
12
|
+
open: s,
|
|
13
|
+
side: r,
|
|
14
|
+
content: () => t,
|
|
15
|
+
triggerProps: {
|
|
16
|
+
onMouseEnter: () => {
|
|
17
|
+
o(!0);
|
|
18
|
+
},
|
|
19
|
+
onMouseLeave: () => {
|
|
20
|
+
o(!1);
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
children: e
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
l as Tooltip
|
|
29
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function a(r) {
|
|
2
|
+
var n, f, t = "";
|
|
3
|
+
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
5
|
+
var o = r.length;
|
|
6
|
+
for (n = 0; n < o; n++) r[n] && (f = a(r[n])) && (t && (t += " "), t += f);
|
|
7
|
+
} else for (f in r) r[f] && (t && (t += " "), t += f);
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
function i() {
|
|
11
|
+
for (var r, n, f = 0, t = "", o = arguments.length; f < o; f++) (r = arguments[f]) && (n = a(r)) && (t && (t += " "), t += n);
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
i as clsx,
|
|
16
|
+
i as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getOwnerWindow as d } from "./bundle.es62.js";
|
|
2
|
+
const c = typeof Element < "u" && "checkVisibility" in Element.prototype;
|
|
3
|
+
function p(i) {
|
|
4
|
+
const t = d(i);
|
|
5
|
+
if (!(i instanceof t.HTMLElement) && !(i instanceof t.SVGElement)) return !1;
|
|
6
|
+
let { display: o, visibility: e } = i.style, a = o !== "none" && e !== "hidden" && e !== "collapse";
|
|
7
|
+
if (a) {
|
|
8
|
+
const { getComputedStyle: r } = i.ownerDocument.defaultView;
|
|
9
|
+
let { display: n, visibility: s } = r(i);
|
|
10
|
+
a = n !== "none" && s !== "hidden" && s !== "collapse";
|
|
11
|
+
}
|
|
12
|
+
return a;
|
|
13
|
+
}
|
|
14
|
+
function u(i, t) {
|
|
15
|
+
return !i.hasAttribute("hidden") && // Ignore HiddenSelect when tree walking.
|
|
16
|
+
!i.hasAttribute("data-react-aria-prevent-focus") && (i.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? i.hasAttribute("open") : !0);
|
|
17
|
+
}
|
|
18
|
+
function f(i, t) {
|
|
19
|
+
return c ? i.checkVisibility({
|
|
20
|
+
visibilityProperty: !0
|
|
21
|
+
}) && !i.closest("[data-react-aria-prevent-focus]") : i.nodeName !== "#comment" && p(i) && u(i, t) && (!i.parentElement || f(i.parentElement, i));
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
f as isElementVisible
|
|
25
|
+
};
|