@companix/uikit 0.0.1 → 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,442 @@
|
|
|
1
|
+
import { setEventTarget as me, createSyntheticEvent as be, preventFocus as te } from "./bundle.es54.js";
|
|
2
|
+
import { restoreTextSelection as z, disableTextSelection as re } from "./bundle.es55.js";
|
|
3
|
+
import { PressResponderContext as Se } from "./bundle.es56.js";
|
|
4
|
+
import { _ as xe } from "./bundle.es57.js";
|
|
5
|
+
import { _ as Ke } from "./bundle.es58.js";
|
|
6
|
+
import { _ as ne } from "./bundle.es59.js";
|
|
7
|
+
import { chain as ke } from "./bundle.es60.js";
|
|
8
|
+
import { nodeContains as c, getEventTarget as u } from "./bundle.es61.js";
|
|
9
|
+
import { getOwnerDocument as y, getOwnerWindow as N } from "./bundle.es62.js";
|
|
10
|
+
import { mergeProps as ge } from "./bundle.es63.js";
|
|
11
|
+
import { focusWithoutScrolling as Oe } from "./bundle.es64.js";
|
|
12
|
+
import { openLink as ie } from "./bundle.es65.js";
|
|
13
|
+
import { useGlobalListeners as Me } from "./bundle.es66.js";
|
|
14
|
+
import { useLayoutEffect as se } from "./bundle.es67.js";
|
|
15
|
+
import { useSyncRef as Ce } from "./bundle.es68.js";
|
|
16
|
+
import { isMac as Ie } from "./bundle.es69.js";
|
|
17
|
+
import { isVirtualPointerEvent as we, isVirtualClick as ae } from "./bundle.es70.js";
|
|
18
|
+
import { useEffectEvent as X } from "./bundle.es71.js";
|
|
19
|
+
import { flushSync as Le } from "react-dom";
|
|
20
|
+
import { useState as j, useRef as De, useCallback as O, useMemo as _e, useEffect as oe, useContext as Ue } from "react";
|
|
21
|
+
function Ye(n) {
|
|
22
|
+
let s = Ue(Se);
|
|
23
|
+
if (s) {
|
|
24
|
+
let { register: o, ...f } = s;
|
|
25
|
+
n = ge(f, n), o();
|
|
26
|
+
}
|
|
27
|
+
return Ce(s, n.ref), n;
|
|
28
|
+
}
|
|
29
|
+
var R = /* @__PURE__ */ new WeakMap();
|
|
30
|
+
class F {
|
|
31
|
+
continuePropagation() {
|
|
32
|
+
ne(this, R, !1);
|
|
33
|
+
}
|
|
34
|
+
get shouldStopPropagation() {
|
|
35
|
+
return xe(this, R);
|
|
36
|
+
}
|
|
37
|
+
constructor(s, o, f, p) {
|
|
38
|
+
Ke(this, R, {
|
|
39
|
+
writable: !0,
|
|
40
|
+
value: void 0
|
|
41
|
+
}), ne(this, R, !0);
|
|
42
|
+
var P;
|
|
43
|
+
let v = (P = p?.target) !== null && P !== void 0 ? P : f.currentTarget;
|
|
44
|
+
const d = v?.getBoundingClientRect();
|
|
45
|
+
let w, S = 0, C, g = null;
|
|
46
|
+
f.clientX != null && f.clientY != null && (C = f.clientX, g = f.clientY), d && (C != null && g != null ? (w = C - d.left, S = g - d.top) : (w = d.width / 2, S = d.height / 2)), this.type = s, this.pointerType = o, this.target = f.currentTarget, this.shiftKey = f.shiftKey, this.metaKey = f.metaKey, this.ctrlKey = f.ctrlKey, this.altKey = f.altKey, this.x = w, this.y = S;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const le = /* @__PURE__ */ Symbol("linkClicked"), fe = "react-aria-pressable-style", ue = "data-react-aria-pressable";
|
|
50
|
+
function ft(n) {
|
|
51
|
+
let { onPress: s, onPressChange: o, onPressStart: f, onPressEnd: p, onPressUp: P, onClick: v, isDisabled: d, isPressed: w, preventFocusOnPress: S, shouldCancelOnPointerExit: C, allowTextSelectionOnPress: g, ref: A, ...Te } = Ye(n), [Pe, Q] = j(!1), E = De({
|
|
52
|
+
isPressed: !1,
|
|
53
|
+
ignoreEmulatedMouseEvents: !1,
|
|
54
|
+
didFirePressStart: !1,
|
|
55
|
+
isTriggeringEvent: !1,
|
|
56
|
+
activePointerId: null,
|
|
57
|
+
target: null,
|
|
58
|
+
isOverTarget: !1,
|
|
59
|
+
pointerType: null,
|
|
60
|
+
disposables: []
|
|
61
|
+
}), { addGlobalListener: h, removeAllGlobalListeners: I, removeGlobalListener: x } = Me(), $ = O((e, r) => {
|
|
62
|
+
let t = E.current;
|
|
63
|
+
if (d || t.didFirePressStart) return !1;
|
|
64
|
+
let i = !0;
|
|
65
|
+
if (t.isTriggeringEvent = !0, f) {
|
|
66
|
+
let a = new F("pressstart", r, e);
|
|
67
|
+
f(a), i = a.shouldStopPropagation;
|
|
68
|
+
}
|
|
69
|
+
return o && o(!0), t.isTriggeringEvent = !1, t.didFirePressStart = !0, Q(!0), i;
|
|
70
|
+
}, [
|
|
71
|
+
d,
|
|
72
|
+
f,
|
|
73
|
+
o
|
|
74
|
+
]), T = O((e, r, t = !0) => {
|
|
75
|
+
let i = E.current;
|
|
76
|
+
if (!i.didFirePressStart) return !1;
|
|
77
|
+
i.didFirePressStart = !1, i.isTriggeringEvent = !0;
|
|
78
|
+
let a = !0;
|
|
79
|
+
if (p) {
|
|
80
|
+
let l = new F("pressend", r, e);
|
|
81
|
+
p(l), a = l.shouldStopPropagation;
|
|
82
|
+
}
|
|
83
|
+
if (o && o(!1), Q(!1), s && t && !d) {
|
|
84
|
+
let l = new F("press", r, e);
|
|
85
|
+
s(l), a && (a = l.shouldStopPropagation);
|
|
86
|
+
}
|
|
87
|
+
return i.isTriggeringEvent = !1, a;
|
|
88
|
+
}, [
|
|
89
|
+
d,
|
|
90
|
+
p,
|
|
91
|
+
o,
|
|
92
|
+
s
|
|
93
|
+
]), $e = X(T), K = O((e, r) => {
|
|
94
|
+
let t = E.current;
|
|
95
|
+
if (d) return !1;
|
|
96
|
+
if (P) {
|
|
97
|
+
t.isTriggeringEvent = !0;
|
|
98
|
+
let i = new F("pressup", r, e);
|
|
99
|
+
return P(i), t.isTriggeringEvent = !1, i.shouldStopPropagation;
|
|
100
|
+
}
|
|
101
|
+
return !0;
|
|
102
|
+
}, [
|
|
103
|
+
d,
|
|
104
|
+
P
|
|
105
|
+
]), ye = X(K), m = O((e) => {
|
|
106
|
+
let r = E.current;
|
|
107
|
+
if (r.isPressed && r.target) {
|
|
108
|
+
r.didFirePressStart && r.pointerType != null && T(M(r.target, e), r.pointerType, !1), r.isPressed = !1, D(null), r.isOverTarget = !1, r.activePointerId = null, r.pointerType = null, I(), g || z(r.target);
|
|
109
|
+
for (let t of r.disposables) t();
|
|
110
|
+
r.disposables = [];
|
|
111
|
+
}
|
|
112
|
+
}, [
|
|
113
|
+
g,
|
|
114
|
+
I,
|
|
115
|
+
T
|
|
116
|
+
]), L = X(m), _ = O((e) => {
|
|
117
|
+
C && m(e);
|
|
118
|
+
}, [
|
|
119
|
+
C,
|
|
120
|
+
m
|
|
121
|
+
]), V = O((e) => {
|
|
122
|
+
d || v?.(e);
|
|
123
|
+
}, [
|
|
124
|
+
d,
|
|
125
|
+
v
|
|
126
|
+
]), B = O((e, r) => {
|
|
127
|
+
if (!d && v) {
|
|
128
|
+
let t = new MouseEvent("click", e);
|
|
129
|
+
me(t, r), v(be(t));
|
|
130
|
+
}
|
|
131
|
+
}, [
|
|
132
|
+
d,
|
|
133
|
+
v
|
|
134
|
+
]), Ee = X(B), [Z, ee] = j(!1);
|
|
135
|
+
se(() => {
|
|
136
|
+
let e = E.current;
|
|
137
|
+
if (Z) {
|
|
138
|
+
let r = (l) => {
|
|
139
|
+
var k;
|
|
140
|
+
if (e.isPressed && e.target && q(l, e.target)) {
|
|
141
|
+
var G;
|
|
142
|
+
de(u(l), l.key) && l.preventDefault();
|
|
143
|
+
let W = u(l), Y = c(e.target, u(l));
|
|
144
|
+
$e(M(e.target, l), "keyboard", Y), Y && Ee(l, e.target), I(), l.key !== "Enter" && J(e.target) && c(e.target, W) && !l[le] && (l[le] = !0, ie(e.target, l, !1)), e.isPressed = !1, ee(!1), (G = e.metaKeyEvents) === null || G === void 0 || G.delete(l.key);
|
|
145
|
+
} else if (l.key === "Meta" && (!((k = e.metaKeyEvents) === null || k === void 0) && k.size)) {
|
|
146
|
+
var H;
|
|
147
|
+
let W = e.metaKeyEvents;
|
|
148
|
+
e.metaKeyEvents = void 0;
|
|
149
|
+
for (let Y of W.values()) (H = e.target) === null || H === void 0 || H.dispatchEvent(new KeyboardEvent("keyup", Y));
|
|
150
|
+
}
|
|
151
|
+
}, t = e.target, a = ke((l) => {
|
|
152
|
+
t && q(l, t) && !l.repeat && c(t, u(l)) && e.target && ye(M(e.target, l), "keyboard");
|
|
153
|
+
}, r);
|
|
154
|
+
return h(y(e.target), "keyup", a, !0), () => {
|
|
155
|
+
x(y(e.target), "keyup", a, !0);
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}, [
|
|
159
|
+
Z,
|
|
160
|
+
h,
|
|
161
|
+
I,
|
|
162
|
+
x
|
|
163
|
+
]);
|
|
164
|
+
let [U, D] = j(null);
|
|
165
|
+
se(() => {
|
|
166
|
+
let e = E.current;
|
|
167
|
+
if (U === "pointer") {
|
|
168
|
+
let r = (i) => {
|
|
169
|
+
if (i.pointerId === e.activePointerId && e.isPressed && i.button === 0 && e.target) {
|
|
170
|
+
if (c(e.target, u(i)) && e.pointerType != null) {
|
|
171
|
+
let a = !1, l = setTimeout(() => {
|
|
172
|
+
e.isPressed && e.target instanceof HTMLElement && (a ? L(i) : (Oe(e.target), e.target.click()));
|
|
173
|
+
}, 80);
|
|
174
|
+
h(i.currentTarget, "click", () => a = !0, !0), e.disposables.push(() => clearTimeout(l));
|
|
175
|
+
} else L(i);
|
|
176
|
+
e.isOverTarget = !1;
|
|
177
|
+
}
|
|
178
|
+
}, t = (i) => {
|
|
179
|
+
L(i);
|
|
180
|
+
};
|
|
181
|
+
return h(y(e.target), "pointerup", r, !1), h(y(e.target), "pointercancel", t, !1), () => {
|
|
182
|
+
x(y(e.target), "pointerup", r, !1), x(y(e.target), "pointercancel", t, !1);
|
|
183
|
+
};
|
|
184
|
+
} else if (U === "mouse" && process.env.NODE_ENV === "test") {
|
|
185
|
+
let r = (t) => {
|
|
186
|
+
if (t.button === 0) {
|
|
187
|
+
if (e.ignoreEmulatedMouseEvents) {
|
|
188
|
+
e.ignoreEmulatedMouseEvents = !1;
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
e.target && e.target.contains(t.target) && e.pointerType != null || L(t), e.isOverTarget = !1;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
return h(y(e.target), "mouseup", r, !1), () => {
|
|
195
|
+
x(y(e.target), "mouseup", r, !1);
|
|
196
|
+
};
|
|
197
|
+
} else if (U === "touch" && process.env.NODE_ENV === "test") {
|
|
198
|
+
let r = (t) => {
|
|
199
|
+
e.isPressed && c(u(t), e.target) && L({
|
|
200
|
+
currentTarget: e.target,
|
|
201
|
+
shiftKey: !1,
|
|
202
|
+
ctrlKey: !1,
|
|
203
|
+
metaKey: !1,
|
|
204
|
+
altKey: !1
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
return h(N(e.target), "scroll", r, !0), () => {
|
|
208
|
+
x(N(e.target), "scroll", r, !0);
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}, [
|
|
212
|
+
U,
|
|
213
|
+
h,
|
|
214
|
+
x
|
|
215
|
+
]);
|
|
216
|
+
let he = _e(() => {
|
|
217
|
+
let e = E.current, r = {
|
|
218
|
+
onKeyDown(t) {
|
|
219
|
+
if (q(t.nativeEvent, t.currentTarget) && c(t.currentTarget, u(t.nativeEvent))) {
|
|
220
|
+
var i;
|
|
221
|
+
de(u(t.nativeEvent), t.key) && t.preventDefault();
|
|
222
|
+
let a = !0;
|
|
223
|
+
!e.isPressed && !t.repeat && (e.target = t.currentTarget, e.isPressed = !0, ee(!0), e.pointerType = "keyboard", a = $(t, "keyboard")), a && t.stopPropagation(), t.metaKey && Ie() && ((i = e.metaKeyEvents) === null || i === void 0 || i.set(t.key, t.nativeEvent));
|
|
224
|
+
} else t.key === "Meta" && (e.metaKeyEvents = /* @__PURE__ */ new Map());
|
|
225
|
+
},
|
|
226
|
+
onClick(t) {
|
|
227
|
+
if (!(t && !c(t.currentTarget, u(t.nativeEvent))) && t && t.button === 0 && !e.isTriggeringEvent && !ie.isOpening) {
|
|
228
|
+
let i = !0;
|
|
229
|
+
if (d && t.preventDefault(), !e.ignoreEmulatedMouseEvents && !e.isPressed && (e.pointerType === "virtual" || ae(t.nativeEvent))) {
|
|
230
|
+
let a = $(t, "virtual"), l = K(t, "virtual"), k = T(t, "virtual");
|
|
231
|
+
V(t), i = a && l && k;
|
|
232
|
+
} else if (e.isPressed && e.pointerType !== "keyboard") {
|
|
233
|
+
let a = e.pointerType || t.nativeEvent.pointerType || "virtual", l = K(M(t.currentTarget, t), a), k = T(M(t.currentTarget, t), a, !0);
|
|
234
|
+
i = l && k, e.isOverTarget = !1, V(t), m(t);
|
|
235
|
+
}
|
|
236
|
+
e.ignoreEmulatedMouseEvents = !1, i && t.stopPropagation();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
return typeof PointerEvent < "u" ? (r.onPointerDown = (t) => {
|
|
241
|
+
if (t.button !== 0 || !c(t.currentTarget, u(t.nativeEvent))) return;
|
|
242
|
+
if (we(t.nativeEvent)) {
|
|
243
|
+
e.pointerType = "virtual";
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
e.pointerType = t.pointerType;
|
|
247
|
+
let i = !0;
|
|
248
|
+
if (!e.isPressed) {
|
|
249
|
+
e.isPressed = !0, D("pointer"), e.isOverTarget = !0, e.activePointerId = t.pointerId, e.target = t.currentTarget, g || re(e.target), i = $(t, e.pointerType);
|
|
250
|
+
let a = u(t.nativeEvent);
|
|
251
|
+
"releasePointerCapture" in a && a.releasePointerCapture(t.pointerId);
|
|
252
|
+
}
|
|
253
|
+
i && t.stopPropagation();
|
|
254
|
+
}, r.onMouseDown = (t) => {
|
|
255
|
+
if (c(t.currentTarget, u(t.nativeEvent)) && t.button === 0) {
|
|
256
|
+
if (S) {
|
|
257
|
+
let i = te(t.target);
|
|
258
|
+
i && e.disposables.push(i);
|
|
259
|
+
}
|
|
260
|
+
t.stopPropagation();
|
|
261
|
+
}
|
|
262
|
+
}, r.onPointerUp = (t) => {
|
|
263
|
+
!c(t.currentTarget, u(t.nativeEvent)) || e.pointerType === "virtual" || t.button === 0 && !e.isPressed && K(t, e.pointerType || t.pointerType);
|
|
264
|
+
}, r.onPointerEnter = (t) => {
|
|
265
|
+
t.pointerId === e.activePointerId && e.target && !e.isOverTarget && e.pointerType != null && (e.isOverTarget = !0, $(M(e.target, t), e.pointerType));
|
|
266
|
+
}, r.onPointerLeave = (t) => {
|
|
267
|
+
t.pointerId === e.activePointerId && e.target && e.isOverTarget && e.pointerType != null && (e.isOverTarget = !1, T(M(e.target, t), e.pointerType, !1), _(t));
|
|
268
|
+
}, r.onDragStart = (t) => {
|
|
269
|
+
c(t.currentTarget, u(t.nativeEvent)) && m(t);
|
|
270
|
+
}) : process.env.NODE_ENV === "test" && (r.onMouseDown = (t) => {
|
|
271
|
+
if (t.button !== 0 || !c(t.currentTarget, u(t.nativeEvent))) return;
|
|
272
|
+
if (e.ignoreEmulatedMouseEvents) {
|
|
273
|
+
t.stopPropagation();
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (e.isPressed = !0, D("mouse"), e.isOverTarget = !0, e.target = t.currentTarget, e.pointerType = ae(t.nativeEvent) ? "virtual" : "mouse", Le(() => $(t, e.pointerType)) && t.stopPropagation(), S) {
|
|
277
|
+
let a = te(t.target);
|
|
278
|
+
a && e.disposables.push(a);
|
|
279
|
+
}
|
|
280
|
+
}, r.onMouseEnter = (t) => {
|
|
281
|
+
if (!c(t.currentTarget, u(t.nativeEvent))) return;
|
|
282
|
+
let i = !0;
|
|
283
|
+
e.isPressed && !e.ignoreEmulatedMouseEvents && e.pointerType != null && (e.isOverTarget = !0, i = $(t, e.pointerType)), i && t.stopPropagation();
|
|
284
|
+
}, r.onMouseLeave = (t) => {
|
|
285
|
+
if (!c(t.currentTarget, u(t.nativeEvent))) return;
|
|
286
|
+
let i = !0;
|
|
287
|
+
e.isPressed && !e.ignoreEmulatedMouseEvents && e.pointerType != null && (e.isOverTarget = !1, i = T(t, e.pointerType, !1), _(t)), i && t.stopPropagation();
|
|
288
|
+
}, r.onMouseUp = (t) => {
|
|
289
|
+
c(t.currentTarget, u(t.nativeEvent)) && !e.ignoreEmulatedMouseEvents && t.button === 0 && !e.isPressed && K(t, e.pointerType || "mouse");
|
|
290
|
+
}, r.onTouchStart = (t) => {
|
|
291
|
+
if (!c(t.currentTarget, u(t.nativeEvent))) return;
|
|
292
|
+
let i = Xe(t.nativeEvent);
|
|
293
|
+
if (!i) return;
|
|
294
|
+
e.activePointerId = i.identifier, e.ignoreEmulatedMouseEvents = !0, e.isOverTarget = !0, e.isPressed = !0, D("touch"), e.target = t.currentTarget, e.pointerType = "touch", g || re(e.target), $(b(e.target, t), e.pointerType) && t.stopPropagation();
|
|
295
|
+
}, r.onTouchMove = (t) => {
|
|
296
|
+
if (!c(t.currentTarget, u(t.nativeEvent))) return;
|
|
297
|
+
if (!e.isPressed) {
|
|
298
|
+
t.stopPropagation();
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
let i = ce(t.nativeEvent, e.activePointerId), a = !0;
|
|
302
|
+
i && pe(i, t.currentTarget) ? !e.isOverTarget && e.pointerType != null && (e.isOverTarget = !0, a = $(b(e.target, t), e.pointerType)) : e.isOverTarget && e.pointerType != null && (e.isOverTarget = !1, a = T(b(e.target, t), e.pointerType, !1), _(b(e.target, t))), a && t.stopPropagation();
|
|
303
|
+
}, r.onTouchEnd = (t) => {
|
|
304
|
+
if (!c(t.currentTarget, u(t.nativeEvent))) return;
|
|
305
|
+
if (!e.isPressed) {
|
|
306
|
+
t.stopPropagation();
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
let i = ce(t.nativeEvent, e.activePointerId), a = !0;
|
|
310
|
+
i && pe(i, t.currentTarget) && e.pointerType != null ? (K(b(e.target, t), e.pointerType), a = T(b(e.target, t), e.pointerType), B(t.nativeEvent, e.target)) : e.isOverTarget && e.pointerType != null && (a = T(b(e.target, t), e.pointerType, !1)), a && t.stopPropagation(), e.isPressed = !1, D(null), e.activePointerId = null, e.isOverTarget = !1, e.ignoreEmulatedMouseEvents = !0, e.target && !g && z(e.target), I();
|
|
311
|
+
}, r.onTouchCancel = (t) => {
|
|
312
|
+
c(t.currentTarget, u(t.nativeEvent)) && (t.stopPropagation(), e.isPressed && m(b(e.target, t)));
|
|
313
|
+
}, r.onDragStart = (t) => {
|
|
314
|
+
c(t.currentTarget, u(t.nativeEvent)) && m(t);
|
|
315
|
+
}), r;
|
|
316
|
+
}, [
|
|
317
|
+
d,
|
|
318
|
+
S,
|
|
319
|
+
I,
|
|
320
|
+
g,
|
|
321
|
+
m,
|
|
322
|
+
_,
|
|
323
|
+
T,
|
|
324
|
+
$,
|
|
325
|
+
K,
|
|
326
|
+
V,
|
|
327
|
+
B
|
|
328
|
+
]);
|
|
329
|
+
return oe(() => {
|
|
330
|
+
if (!A || process.env.NODE_ENV === "test") return;
|
|
331
|
+
const e = y(A.current);
|
|
332
|
+
if (!e || !e.head || e.getElementById(fe)) return;
|
|
333
|
+
const r = e.createElement("style");
|
|
334
|
+
r.id = fe, r.textContent = `
|
|
335
|
+
@layer {
|
|
336
|
+
[${ue}] {
|
|
337
|
+
touch-action: pan-x pan-y pinch-zoom;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
`.trim(), e.head.prepend(r);
|
|
341
|
+
}, [
|
|
342
|
+
A
|
|
343
|
+
]), oe(() => {
|
|
344
|
+
let e = E.current;
|
|
345
|
+
return () => {
|
|
346
|
+
var r;
|
|
347
|
+
g || z((r = e.target) !== null && r !== void 0 ? r : void 0);
|
|
348
|
+
for (let t of e.disposables) t();
|
|
349
|
+
e.disposables = [];
|
|
350
|
+
};
|
|
351
|
+
}, [
|
|
352
|
+
g
|
|
353
|
+
]), {
|
|
354
|
+
isPressed: w || Pe,
|
|
355
|
+
pressProps: ge(Te, he, {
|
|
356
|
+
[ue]: !0
|
|
357
|
+
})
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
function J(n) {
|
|
361
|
+
return n.tagName === "A" && n.hasAttribute("href");
|
|
362
|
+
}
|
|
363
|
+
function q(n, s) {
|
|
364
|
+
const { key: o, code: f } = n, p = s, P = p.getAttribute("role");
|
|
365
|
+
return (o === "Enter" || o === " " || o === "Spacebar" || f === "Space") && !(p instanceof N(p).HTMLInputElement && !ve(p, o) || p instanceof N(p).HTMLTextAreaElement || p.isContentEditable) && // Links should only trigger with Enter key
|
|
366
|
+
!((P === "link" || !P && J(p)) && o !== "Enter");
|
|
367
|
+
}
|
|
368
|
+
function Xe(n) {
|
|
369
|
+
const { targetTouches: s } = n;
|
|
370
|
+
return s.length > 0 ? s[0] : null;
|
|
371
|
+
}
|
|
372
|
+
function ce(n, s) {
|
|
373
|
+
const o = n.changedTouches;
|
|
374
|
+
for (let f = 0; f < o.length; f++) {
|
|
375
|
+
const p = o[f];
|
|
376
|
+
if (p.identifier === s) return p;
|
|
377
|
+
}
|
|
378
|
+
return null;
|
|
379
|
+
}
|
|
380
|
+
function b(n, s) {
|
|
381
|
+
let o = 0, f = 0;
|
|
382
|
+
return s.targetTouches && s.targetTouches.length === 1 && (o = s.targetTouches[0].clientX, f = s.targetTouches[0].clientY), {
|
|
383
|
+
currentTarget: n,
|
|
384
|
+
shiftKey: s.shiftKey,
|
|
385
|
+
ctrlKey: s.ctrlKey,
|
|
386
|
+
metaKey: s.metaKey,
|
|
387
|
+
altKey: s.altKey,
|
|
388
|
+
clientX: o,
|
|
389
|
+
clientY: f
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function M(n, s) {
|
|
393
|
+
let o = s.clientX, f = s.clientY;
|
|
394
|
+
return {
|
|
395
|
+
currentTarget: n,
|
|
396
|
+
shiftKey: s.shiftKey,
|
|
397
|
+
ctrlKey: s.ctrlKey,
|
|
398
|
+
metaKey: s.metaKey,
|
|
399
|
+
altKey: s.altKey,
|
|
400
|
+
clientX: o,
|
|
401
|
+
clientY: f
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
function Re(n) {
|
|
405
|
+
let s = 0, o = 0;
|
|
406
|
+
return n.width !== void 0 ? s = n.width / 2 : n.radiusX !== void 0 && (s = n.radiusX), n.height !== void 0 ? o = n.height / 2 : n.radiusY !== void 0 && (o = n.radiusY), {
|
|
407
|
+
top: n.clientY - o,
|
|
408
|
+
right: n.clientX + s,
|
|
409
|
+
bottom: n.clientY + o,
|
|
410
|
+
left: n.clientX - s
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
function Fe(n, s) {
|
|
414
|
+
return !(n.left > s.right || s.left > n.right || n.top > s.bottom || s.top > n.bottom);
|
|
415
|
+
}
|
|
416
|
+
function pe(n, s) {
|
|
417
|
+
let o = s.getBoundingClientRect(), f = Re(n);
|
|
418
|
+
return Fe(o, f);
|
|
419
|
+
}
|
|
420
|
+
function Ne(n) {
|
|
421
|
+
return n instanceof HTMLInputElement ? !1 : n instanceof HTMLButtonElement ? n.type !== "submit" && n.type !== "reset" : !J(n);
|
|
422
|
+
}
|
|
423
|
+
function de(n, s) {
|
|
424
|
+
return n instanceof HTMLInputElement ? !ve(n, s) : Ne(n);
|
|
425
|
+
}
|
|
426
|
+
const Ae = /* @__PURE__ */ new Set([
|
|
427
|
+
"checkbox",
|
|
428
|
+
"radio",
|
|
429
|
+
"range",
|
|
430
|
+
"color",
|
|
431
|
+
"file",
|
|
432
|
+
"image",
|
|
433
|
+
"button",
|
|
434
|
+
"submit",
|
|
435
|
+
"reset"
|
|
436
|
+
]);
|
|
437
|
+
function ve(n, s) {
|
|
438
|
+
return n.type === "checkbox" || n.type === "radio" ? s === " " : Ae.has(n.type);
|
|
439
|
+
}
|
|
440
|
+
export {
|
|
441
|
+
ft as usePress
|
|
442
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import f from "classnames";
|
|
3
|
+
import { forwardRef as l } from "react";
|
|
4
|
+
const g = l(
|
|
5
|
+
({ icon: r, className: t, size: i = "m", ...e }, a) => {
|
|
6
|
+
const [n, c, , , m] = r.icon;
|
|
7
|
+
return /* @__PURE__ */ o(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
ref: a,
|
|
11
|
+
"data-prefix": r.prefix,
|
|
12
|
+
"data-icon": r.iconName,
|
|
13
|
+
viewBox: `0 0 ${n} ${c}`,
|
|
14
|
+
className: f(`icon icon-size-${i}`, t),
|
|
15
|
+
...e,
|
|
16
|
+
role: "img",
|
|
17
|
+
children: /* @__PURE__ */ o(s, { paths: m })
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
), s = ({ paths: r }) => Array.isArray(r) ? /* @__PURE__ */ o("g", { children: r.map((t, i) => /* @__PURE__ */ o("path", { fill: "currentColor", d: t }, `-d-${i}`)) }) : /* @__PURE__ */ o("path", { fill: "currentColor", d: r });
|
|
22
|
+
export {
|
|
23
|
+
g as Icon
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useRef as s, useCallback as c } from "react";
|
|
2
|
+
const p = () => {
|
|
3
|
+
const t = s(null), r = s({ cb: null }), i = c(() => {
|
|
4
|
+
if (t.current && t.current.parentElement) {
|
|
5
|
+
const e = t.current.parentElement, u = e.style.getPropertyValue("--radix-popper-anchor-width"), n = e.style.getPropertyValue("transform"), o = new MutationObserver(() => {
|
|
6
|
+
e.style.transform !== n && e.style.setProperty("transform", n);
|
|
7
|
+
});
|
|
8
|
+
o.observe(e, {
|
|
9
|
+
attributes: !0,
|
|
10
|
+
attributeFilter: ["style"]
|
|
11
|
+
}), r.current.cb = () => {
|
|
12
|
+
o.disconnect();
|
|
13
|
+
}, t.current.style.setProperty("--radix-popover-trigger-width", u);
|
|
14
|
+
}
|
|
15
|
+
}, []), l = c(() => {
|
|
16
|
+
r.current.cb && (r.current.cb(), r.current.cb = null);
|
|
17
|
+
}, []);
|
|
18
|
+
return {
|
|
19
|
+
popoverRef: t,
|
|
20
|
+
handleAnimationEnd: l,
|
|
21
|
+
froozePopoverPosition: i
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
p as useFroozeClosing
|
|
26
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsxs as n, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import b from "classnames";
|
|
3
|
+
import { attr as r } from "@companix/utils-browser";
|
|
4
|
+
import { forwardRef as g, useRef as w, useCallback as y } from "react";
|
|
5
|
+
import { Icon as a } from "./bundle.es37.js";
|
|
6
|
+
import { faClose as D, faChevronDown as R } from "@fortawesome/free-solid-svg-icons";
|
|
7
|
+
import { VisuallyHidden as T } from "@radix-ui/react-visually-hidden";
|
|
8
|
+
const V = g(
|
|
9
|
+
({
|
|
10
|
+
required: u,
|
|
11
|
+
size: d,
|
|
12
|
+
fill: m,
|
|
13
|
+
leftElement: l,
|
|
14
|
+
className: p,
|
|
15
|
+
value: o,
|
|
16
|
+
clearButton: f,
|
|
17
|
+
placeholder: C,
|
|
18
|
+
clearButtonIcon: h,
|
|
19
|
+
disabled: s,
|
|
20
|
+
onClear: I,
|
|
21
|
+
...i
|
|
22
|
+
}, N) => {
|
|
23
|
+
const e = w(null), k = y(
|
|
24
|
+
(t) => {
|
|
25
|
+
if (!e.current || !document)
|
|
26
|
+
return;
|
|
27
|
+
t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
|
|
28
|
+
},
|
|
29
|
+
[e]
|
|
30
|
+
), x = (t) => {
|
|
31
|
+
document && document.activeElement === e.current && t.preventDefault();
|
|
32
|
+
}, v = (t) => {
|
|
33
|
+
s || k(t);
|
|
34
|
+
}, F = (t) => {
|
|
35
|
+
x(t);
|
|
36
|
+
}, z = (t) => {
|
|
37
|
+
e.current && e.current.focus(), I?.(t);
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ n(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
ref: N,
|
|
43
|
+
className: b("form select", p),
|
|
44
|
+
"data-size": d ?? "md",
|
|
45
|
+
"data-fill": r(m),
|
|
46
|
+
"data-required": r(u),
|
|
47
|
+
"data-disabled": r(s),
|
|
48
|
+
onMouseDown: F,
|
|
49
|
+
...i,
|
|
50
|
+
onClick: v,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ n("div", { className: "select-layout form-input", children: [
|
|
53
|
+
l && /* @__PURE__ */ c("div", { className: "select-element", children: l }),
|
|
54
|
+
/* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ n("div", { className: "select-content-text", "aria-disabled": s, children: [
|
|
55
|
+
!o && /* @__PURE__ */ c("span", { className: "select-placeholder", children: C }),
|
|
56
|
+
o
|
|
57
|
+
] }) }),
|
|
58
|
+
/* @__PURE__ */ n("div", { className: "select-element", children: [
|
|
59
|
+
f && o && /* @__PURE__ */ c("button", { className: "select-close-button", onClick: z, children: h ?? /* @__PURE__ */ c(a, { className: "select-close-icon", icon: D, size: "xxxs" }) }),
|
|
60
|
+
/* @__PURE__ */ c(a, { className: "expand-icon select-expand", icon: R, size: "xxxs" })
|
|
61
|
+
] })
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ c(T, { asChild: !0, children: /* @__PURE__ */ c(
|
|
64
|
+
"input",
|
|
65
|
+
{
|
|
66
|
+
ref: e,
|
|
67
|
+
autoComplete: "off",
|
|
68
|
+
autoCapitalize: "none",
|
|
69
|
+
autoCorrect: "off",
|
|
70
|
+
spellCheck: "false",
|
|
71
|
+
"aria-autocomplete": "none",
|
|
72
|
+
onClick: i.onClick,
|
|
73
|
+
readOnly: !0
|
|
74
|
+
}
|
|
75
|
+
) })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
export {
|
|
82
|
+
V as SelectInput
|
|
83
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import p from "classnames";
|
|
4
|
+
const d = ({ size: r = 40, className: t, width: e = 4, color: i = "inherit" }) => /* @__PURE__ */ o(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
style: { width: `${r}px`, height: `${r}px`, color: i, borderWidth: `${e}px` },
|
|
8
|
+
className: p("spinner-border", t),
|
|
9
|
+
role: "status"
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
export {
|
|
13
|
+
d as Spinner
|
|
14
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useRef as i, useCallback as T } from "react";
|
|
2
|
+
const a = () => {
|
|
3
|
+
const t = i(null), l = i(null);
|
|
4
|
+
return { scrollToElement: T(
|
|
5
|
+
(r, u = !1) => {
|
|
6
|
+
const o = t.current, s = l.current;
|
|
7
|
+
if (!o || !s || r < 0 || r > s.children.length)
|
|
8
|
+
return;
|
|
9
|
+
const n = s.children[r];
|
|
10
|
+
if (!n)
|
|
11
|
+
return;
|
|
12
|
+
const c = o.offsetHeight, f = o.scrollTop, e = n.offsetTop, p = n.offsetHeight;
|
|
13
|
+
u ? o.scrollTop = e - c / 2 + p / 2 : e + p > c + f ? o.scrollTop = e - c + p : e < f && (o.scrollTop = e);
|
|
14
|
+
},
|
|
15
|
+
[l, t]
|
|
16
|
+
), scrollBoxRef: t, optionsWrapperRef: l };
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
a as useScrollListController
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useRef as u, useLayoutEffect as f, useEffect as s } from "react";
|
|
2
|
+
const o = (t, r) => {
|
|
3
|
+
const e = u(!1);
|
|
4
|
+
f(() => {
|
|
5
|
+
e.current = !0, t();
|
|
6
|
+
}, []), s(() => {
|
|
7
|
+
if (e.current) {
|
|
8
|
+
e.current = !1;
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
t();
|
|
12
|
+
}, r);
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
o as useLayoutAndUpdate
|
|
16
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useState as a } from "react";
|
|
2
|
+
const l = ({ onClick: i }) => {
|
|
3
|
+
const [e, s] = a({ isLoading: !1, isError: !1 });
|
|
4
|
+
return {
|
|
5
|
+
...e,
|
|
6
|
+
handleClick: (o) => {
|
|
7
|
+
e.isLoading || i(() => s({ isLoading: !0, isError: !1 }), o).then(() => {
|
|
8
|
+
s({
|
|
9
|
+
isLoading: !1,
|
|
10
|
+
isError: !1
|
|
11
|
+
});
|
|
12
|
+
}).catch((r) => {
|
|
13
|
+
console.log(r), s({
|
|
14
|
+
isLoading: !1,
|
|
15
|
+
isError: !0
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
l as useLoading
|
|
23
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useRef as i, useCallback as o } from "react";
|
|
2
|
+
const f = (e, s) => {
|
|
3
|
+
const r = i(null), c = i(void 0), n = o(
|
|
4
|
+
(t) => {
|
|
5
|
+
s && t.offsetParent && (t.style.height = "", t.style.height = `${t.scrollHeight}px`, t.scrollHeight !== c.current && e && (e(t), c.current = t.scrollHeight));
|
|
6
|
+
},
|
|
7
|
+
[s, e]
|
|
8
|
+
), l = o(() => {
|
|
9
|
+
const t = r.current;
|
|
10
|
+
t && n(t);
|
|
11
|
+
}, [r, n]);
|
|
12
|
+
return [r, l];
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
f as useResizeTextarea
|
|
16
|
+
};
|