@companix/uikit 0.1.1 → 0.1.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/Table/index.d.ts +11 -0
- package/dist/bundle.es.js +134 -128
- package/dist/bundle.es10.js +24 -80
- package/dist/bundle.es11.js +81 -26
- package/dist/bundle.es12.js +21 -91
- package/dist/bundle.es13.js +76 -103
- package/dist/bundle.es14.js +123 -41
- package/dist/bundle.es15.js +37 -32
- package/dist/bundle.es16.js +32 -52
- package/dist/bundle.es17.js +54 -19
- package/dist/bundle.es18.js +21 -34
- package/dist/bundle.es19.js +33 -24
- package/dist/bundle.es2.js +1 -1
- package/dist/bundle.es20.js +24 -44
- package/dist/bundle.es21.js +45 -19
- package/dist/bundle.es22.js +16 -11
- package/dist/bundle.es23.js +14 -21
- package/dist/bundle.es24.js +20 -37
- package/dist/bundle.es25.js +38 -21
- package/dist/bundle.es26.js +20 -18
- package/dist/bundle.es27.js +18 -20
- package/dist/bundle.es28.js +20 -43
- package/dist/bundle.es29.js +37 -114
- package/dist/bundle.es30.js +119 -72
- package/dist/bundle.es31.js +68 -27
- package/dist/bundle.es32.js +31 -10
- package/dist/bundle.es33.js +11 -85
- package/dist/bundle.es34.js +85 -19
- package/dist/bundle.es35.js +20 -7
- package/dist/bundle.es36.js +7 -3
- package/dist/bundle.es37.js +3 -23
- package/dist/bundle.es38.js +16 -45
- package/dist/bundle.es39.js +50 -99
- package/dist/bundle.es4.js +35 -48
- package/dist/bundle.es40.js +100 -80
- package/dist/bundle.es41.js +80 -34
- package/dist/bundle.es42.js +7 -22
- package/dist/bundle.es43.js +33 -9
- package/dist/bundle.es44.js +21 -11
- package/dist/bundle.es45.js +10 -13
- package/dist/bundle.es46.js +11 -13
- package/dist/bundle.es47.js +12 -29
- package/dist/bundle.es48.js +13 -26
- package/dist/bundle.es49.js +29 -37
- package/dist/bundle.es5.js +47 -7
- package/dist/bundle.es50.js +24 -48
- package/dist/bundle.es51.js +36 -49
- package/dist/bundle.es52.js +50 -8
- package/dist/bundle.es53.js +51 -26
- package/dist/bundle.es54.js +9 -5
- package/dist/bundle.es55.js +26 -65
- package/dist/bundle.es56.js +5 -25
- package/dist/bundle.es57.js +66 -23
- package/dist/bundle.es58.js +22 -23
- package/dist/bundle.es59.js +24 -88
- package/dist/bundle.es6.js +7 -10
- package/dist/bundle.es60.js +88 -18
- package/dist/bundle.es61.js +17 -92
- package/dist/bundle.es62.js +92 -73
- package/dist/bundle.es63.js +73 -23
- package/dist/bundle.es64.js +20 -35
- package/dist/bundle.es65.js +37 -68
- package/dist/bundle.es66.js +68 -9
- package/dist/bundle.es67.js +10 -42
- package/dist/bundle.es68.js +42 -14
- package/dist/bundle.es69.js +15 -32
- package/dist/bundle.es7.js +11 -86
- package/dist/bundle.es70.js +23 -61
- package/dist/bundle.es71.js +70 -75
- package/dist/bundle.es72.js +13 -48
- package/dist/bundle.es73.js +74 -13
- package/dist/bundle.es74.js +48 -13
- package/dist/bundle.es75.js +16 -0
- package/dist/bundle.es8.js +83 -82
- package/dist/bundle.es9.js +82 -22
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TableProps<T> {
|
|
2
|
+
header: {
|
|
3
|
+
content: React.ReactNode;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
}[];
|
|
6
|
+
items: T[];
|
|
7
|
+
getItemLayout: (item: T) => React.ReactNode[];
|
|
8
|
+
onRowClick?: (item: T) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const Table: <T>({ header, items, getItemLayout, className, onRowClick }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/bundle.es.js
CHANGED
|
@@ -1,132 +1,138 @@
|
|
|
1
|
-
import { Avatar as
|
|
1
|
+
import { Avatar as o } from "./bundle.es2.js";
|
|
2
2
|
import { avatarSizes as p } from "./bundle.es3.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
3
|
+
import { getBadgeIconSizeByImageBaseSize as a, getFallbackIconSizeByImageBaseSize as x, getInitialsFontSize as f } from "./bundle.es4.js";
|
|
4
|
+
import { Button as s } from "./bundle.es5.js";
|
|
5
|
+
import { ButtonGroup as l } from "./bundle.es6.js";
|
|
6
|
+
import { Spinner as S } from "./bundle.es7.js";
|
|
7
|
+
import { Scrollable as g } from "./bundle.es8.js";
|
|
8
|
+
import { ImitateScroll as d } from "./bundle.es9.js";
|
|
9
|
+
import { Segments as B } from "./bundle.es10.js";
|
|
10
|
+
import { Popover as y } from "./bundle.es11.js";
|
|
11
|
+
import { Tooltip as T } from "./bundle.es12.js";
|
|
12
|
+
import { Select as b } from "./bundle.es13.js";
|
|
13
|
+
import { SelectTags as A } from "./bundle.es14.js";
|
|
14
|
+
import { Input as R } from "./bundle.es15.js";
|
|
15
|
+
import { OptionItem as w } from "./bundle.es16.js";
|
|
16
|
+
import { NumberInput as L } from "./bundle.es17.js";
|
|
17
|
+
import { OptionsList as F } from "./bundle.es18.js";
|
|
18
|
+
import { Checkbox as G } from "./bundle.es19.js";
|
|
19
|
+
import { Switch as Y } from "./bundle.es20.js";
|
|
20
|
+
import { Radio as j, RadioGroup as q } from "./bundle.es21.js";
|
|
21
|
+
import { Drawer as J } from "./bundle.es22.js";
|
|
22
|
+
import { Dialog as Q } from "./bundle.es23.js";
|
|
23
|
+
import { PopupLayout as V } from "./bundle.es24.js";
|
|
24
|
+
import { AlertDialog as Z } from "./bundle.es25.js";
|
|
25
|
+
import { LoadingButton as $ } from "./bundle.es26.js";
|
|
26
|
+
import { Tabs as re } from "./bundle.es27.js";
|
|
27
|
+
import { Countdown as te } from "./bundle.es28.js";
|
|
28
|
+
import { TextArea as me } from "./bundle.es29.js";
|
|
29
|
+
import { DatePicker as xe } from "./bundle.es30.js";
|
|
30
|
+
import { DateInput as ie } from "./bundle.es31.js";
|
|
31
|
+
import { FileOverlay as ne } from "./bundle.es32.js";
|
|
32
|
+
import { FormGroup as ce } from "./bundle.es33.js";
|
|
33
|
+
import { TimePicker as ue } from "./bundle.es34.js";
|
|
34
|
+
import { Icon as De } from "./bundle.es35.js";
|
|
35
|
+
import { ProgressBar as he } from "./bundle.es36.js";
|
|
36
|
+
import { Skeleton as Pe } from "./bundle.es37.js";
|
|
37
|
+
import { Blank as Ie } from "./bundle.es38.js";
|
|
38
|
+
import { ProgressRing as ke } from "./bundle.es39.js";
|
|
39
|
+
import { WriteBar as ve } from "./bundle.es40.js";
|
|
40
|
+
import { DropArea as Oe, DropAreaProvider as Re, useDragEnter as ze } from "./bundle.es41.js";
|
|
41
|
+
import { Table as Ce } from "./bundle.es42.js";
|
|
42
|
+
import { ThemeProvider as Me, useTheme as Fe } from "./bundle.es43.js";
|
|
43
|
+
import { ColorSchemeScript as Ge, colorSchemeScript as We } from "./bundle.es44.js";
|
|
44
|
+
import { useLocalStorage as Ee } from "./bundle.es45.js";
|
|
45
|
+
import { useBooleanState as qe } from "./bundle.es46.js";
|
|
46
|
+
import { useResizeTextarea as Je } from "./bundle.es47.js";
|
|
47
|
+
import { useLoading as Qe } from "./bundle.es48.js";
|
|
48
|
+
import { NowContextProvider as Ve, useNow as Xe } from "./bundle.es49.js";
|
|
49
|
+
import { createAlertAgent as _e } from "./bundle.es50.js";
|
|
50
|
+
import { createToaster as er } from "./bundle.es51.js";
|
|
51
|
+
import { Toast as or } from "./bundle.es52.js";
|
|
52
|
+
import { DialogShell as pr, DrawerShell as mr, createPopupRegistry as ar, usePopup as xr } from "./bundle.es53.js";
|
|
53
|
+
import { createPopoversRegistry as ir } from "./bundle.es54.js";
|
|
54
|
+
import { createScope as nr, createStaticScope as lr } from "./bundle.es55.js";
|
|
55
|
+
import { RemoveListener as Sr } from "./bundle.es56.js";
|
|
56
|
+
import { MONDAY as gr, addMonths as Dr, createDayDisableChecker as dr, endOfDay as hr, endOfWeek as Br, isDayMinMaxRestricted as Pr, isSameDate as yr, setMonth as Ir, setYear as Tr, startOfDay as kr, startOfWeek as br, subMonths as vr, useDayDisableCheker as Ar } from "./bundle.es57.js";
|
|
55
57
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
58
|
+
Z as AlertDialog,
|
|
59
|
+
o as Avatar,
|
|
60
|
+
Ie as Blank,
|
|
61
|
+
s as Button,
|
|
62
|
+
l as ButtonGroup,
|
|
63
|
+
G as Checkbox,
|
|
64
|
+
Ge as ColorSchemeScript,
|
|
65
|
+
te as Countdown,
|
|
66
|
+
ie as DateInput,
|
|
67
|
+
xe as DatePicker,
|
|
68
|
+
Q as Dialog,
|
|
69
|
+
pr as DialogShell,
|
|
70
|
+
J as Drawer,
|
|
71
|
+
mr as DrawerShell,
|
|
72
|
+
Oe as DropArea,
|
|
73
|
+
Re as DropAreaProvider,
|
|
74
|
+
ne as FileOverlay,
|
|
75
|
+
ce as FormGroup,
|
|
76
|
+
De as Icon,
|
|
77
|
+
d as ImitateScroll,
|
|
78
|
+
R as Input,
|
|
79
|
+
$ as LoadingButton,
|
|
80
|
+
gr as MONDAY,
|
|
81
|
+
Ve as NowContextProvider,
|
|
82
|
+
L as NumberInput,
|
|
83
|
+
w as OptionItem,
|
|
84
|
+
F as OptionsList,
|
|
85
|
+
y as Popover,
|
|
86
|
+
V as PopupLayout,
|
|
87
|
+
he as ProgressBar,
|
|
88
|
+
ke as ProgressRing,
|
|
89
|
+
j as Radio,
|
|
90
|
+
q as RadioGroup,
|
|
91
|
+
Sr as RemoveListener,
|
|
92
|
+
g as Scrollable,
|
|
93
|
+
B as Segments,
|
|
94
|
+
b as Select,
|
|
95
|
+
A as SelectTags,
|
|
96
|
+
Pe as Skeleton,
|
|
97
|
+
S as Spinner,
|
|
98
|
+
Y as Switch,
|
|
99
|
+
Ce as Table,
|
|
100
|
+
re as Tabs,
|
|
101
|
+
me as TextArea,
|
|
102
|
+
Me as ThemeProvider,
|
|
103
|
+
ue as TimePicker,
|
|
104
|
+
or as Toast,
|
|
105
|
+
T as Tooltip,
|
|
106
|
+
ve as WriteBar,
|
|
107
|
+
Dr as addMonths,
|
|
105
108
|
p as avatarSizes,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
109
|
+
We as colorSchemeScript,
|
|
110
|
+
_e as createAlertAgent,
|
|
111
|
+
dr as createDayDisableChecker,
|
|
112
|
+
ir as createPopoversRegistry,
|
|
113
|
+
ar as createPopupRegistry,
|
|
114
|
+
nr as createScope,
|
|
115
|
+
lr as createStaticScope,
|
|
116
|
+
er as createToaster,
|
|
117
|
+
hr as endOfDay,
|
|
118
|
+
Br as endOfWeek,
|
|
119
|
+
a as getBadgeIconSizeByImageBaseSize,
|
|
120
|
+
x as getFallbackIconSizeByImageBaseSize,
|
|
121
|
+
f as getInitialsFontSize,
|
|
122
|
+
Pr as isDayMinMaxRestricted,
|
|
123
|
+
yr as isSameDate,
|
|
124
|
+
Ir as setMonth,
|
|
125
|
+
Tr as setYear,
|
|
126
|
+
kr as startOfDay,
|
|
127
|
+
br as startOfWeek,
|
|
128
|
+
vr as subMonths,
|
|
129
|
+
qe as useBooleanState,
|
|
130
|
+
Ar as useDayDisableCheker,
|
|
131
|
+
ze as useDragEnter,
|
|
132
|
+
Qe as useLoading,
|
|
133
|
+
Ee as useLocalStorage,
|
|
134
|
+
Xe as useNow,
|
|
135
|
+
xr as usePopup,
|
|
136
|
+
Je as useResizeTextarea,
|
|
137
|
+
Fe as useTheme
|
|
132
138
|
};
|
package/dist/bundle.es10.js
CHANGED
|
@@ -1,83 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { attr as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onAnimationEnd: m,
|
|
12
|
-
onAnimationStart: d,
|
|
13
|
-
onOpenAutoFocus: p,
|
|
14
|
-
onCloseAutoFocus: f,
|
|
15
|
-
triggerRef: h,
|
|
16
|
-
triggerProps: g,
|
|
17
|
-
open: u,
|
|
18
|
-
content: v,
|
|
19
|
-
onOpenChange: C,
|
|
20
|
-
align: x,
|
|
21
|
-
disabled: w,
|
|
22
|
-
minimal: L,
|
|
23
|
-
className: N,
|
|
24
|
-
fitMaxHeight: O = !0,
|
|
25
|
-
zIndex: P = 9999,
|
|
26
|
-
side: A,
|
|
27
|
-
showArrows: b
|
|
28
|
-
} = i, e = k(null), y = () => {
|
|
29
|
-
e.current && e.current.click();
|
|
30
|
-
}, R = (t) => {
|
|
31
|
-
w && t.preventDefault();
|
|
32
|
-
};
|
|
33
|
-
return /* @__PURE__ */ a(o.Root, { open: u, onOpenChange: C, children: [
|
|
34
|
-
/* @__PURE__ */ r(o.Trigger, { ref: h, ...g, onClick: R, asChild: !0, children: s }),
|
|
35
|
-
/* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ a(
|
|
36
|
-
o.Content,
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { makeTabId as c, useTabSlider as i } from "./bundle.es58.js";
|
|
3
|
+
import { attr as o } from "@companix/utils-browser";
|
|
4
|
+
import { useRef as u, useId as f } from "react";
|
|
5
|
+
const h = ({ value: s, onChange: t, options: a }) => {
|
|
6
|
+
const n = u(null), d = a.findIndex((e) => e.value === s), l = f().replaceAll(":", "");
|
|
7
|
+
return /* @__PURE__ */ r("div", { className: "segments-container", children: /* @__PURE__ */ m("div", { role: "radiogroup", className: "segments", ref: n, children: [
|
|
8
|
+
d > -1 && /* @__PURE__ */ r(g, { containerRef: n, baseId: l, value: s }),
|
|
9
|
+
a.map((e) => /* @__PURE__ */ r(
|
|
10
|
+
"div",
|
|
37
11
|
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
onCloseAutoFocus: f,
|
|
52
|
-
onWheel: (t) => t.stopPropagation(),
|
|
53
|
-
children: [
|
|
54
|
-
/* @__PURE__ */ r(o.Close, { ref: e, style: { display: "none" } }),
|
|
55
|
-
b && /* @__PURE__ */ r(o.Arrow, { width: 30, height: 11, asChild: !0, children: /* @__PURE__ */ r("div", { className: "popover-arrow", children: /* @__PURE__ */ a("svg", { className: "popover-arrow-icon", viewBox: "0 0 30 11", width: 30, height: 11, children: [
|
|
56
|
-
/* @__PURE__ */ r(
|
|
57
|
-
"path",
|
|
58
|
-
{
|
|
59
|
-
className: "popover-arrow-border",
|
|
60
|
-
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",
|
|
61
|
-
style: { transformBox: "fill-box", transformOrigin: "50% 50%" },
|
|
62
|
-
transform: "matrix(0, -1, 1, 0, 0.000001, 0)"
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
/* @__PURE__ */ r(
|
|
66
|
-
"path",
|
|
67
|
-
{
|
|
68
|
-
className: "popover-arrow-fill",
|
|
69
|
-
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",
|
|
70
|
-
style: { transformBox: "fill-box", transformOrigin: "50% 50%" },
|
|
71
|
-
transform: "matrix(0, -1, 1, 0, 0, 0)"
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
] }) }) }),
|
|
75
|
-
/* @__PURE__ */ r("div", { className: "popover-content", "data-fit-max-height": B(O), children: v({ close: y }) })
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
) })
|
|
79
|
-
] });
|
|
80
|
-
});
|
|
12
|
+
id: c(l, e.value),
|
|
13
|
+
onClick: () => t(e.value),
|
|
14
|
+
className: "segments-option",
|
|
15
|
+
"data-selected": o(e.value === s),
|
|
16
|
+
children: e.label
|
|
17
|
+
},
|
|
18
|
+
`segment-${e.value}`
|
|
19
|
+
))
|
|
20
|
+
] }) });
|
|
21
|
+
}, g = (s) => {
|
|
22
|
+
const t = i(s);
|
|
23
|
+
return /* @__PURE__ */ r("div", { "aria-hidden": !0, className: "segments-slider", style: t });
|
|
24
|
+
};
|
|
81
25
|
export {
|
|
82
|
-
|
|
26
|
+
h as Segments
|
|
83
27
|
};
|
package/dist/bundle.es11.js
CHANGED
|
@@ -1,28 +1,83 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-popover";
|
|
3
|
+
import { attr as B } from "@companix/utils-browser";
|
|
4
|
+
import M from "classnames";
|
|
5
|
+
import { forwardRef as j, useRef as k } from "react";
|
|
6
|
+
const D = j((i, n) => {
|
|
7
|
+
const {
|
|
8
|
+
children: s,
|
|
9
|
+
sideOffset: l,
|
|
10
|
+
matchTarget: c,
|
|
11
|
+
onAnimationEnd: m,
|
|
12
|
+
onAnimationStart: d,
|
|
13
|
+
onOpenAutoFocus: p,
|
|
14
|
+
onCloseAutoFocus: f,
|
|
15
|
+
triggerRef: h,
|
|
16
|
+
triggerProps: g,
|
|
17
|
+
open: u,
|
|
18
|
+
content: v,
|
|
19
|
+
onOpenChange: C,
|
|
20
|
+
align: x,
|
|
21
|
+
disabled: w,
|
|
22
|
+
minimal: L,
|
|
23
|
+
className: N,
|
|
24
|
+
fitMaxHeight: O = !0,
|
|
25
|
+
zIndex: P = 9999,
|
|
26
|
+
side: A,
|
|
27
|
+
showArrows: b
|
|
28
|
+
} = i, e = k(null), y = () => {
|
|
29
|
+
e.current && e.current.click();
|
|
30
|
+
}, R = (t) => {
|
|
31
|
+
w && t.preventDefault();
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ a(o.Root, { open: u, onOpenChange: C, children: [
|
|
34
|
+
/* @__PURE__ */ r(o.Trigger, { ref: h, ...g, onClick: R, asChild: !0, children: s }),
|
|
35
|
+
/* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ a(
|
|
36
|
+
o.Content,
|
|
37
|
+
{
|
|
38
|
+
ref: n,
|
|
39
|
+
className: M("popover", N),
|
|
40
|
+
side: A,
|
|
41
|
+
align: x,
|
|
42
|
+
"data-appearance": L ? "minimal" : "default",
|
|
43
|
+
"data-match-target": c,
|
|
44
|
+
sideOffset: l ?? 6,
|
|
45
|
+
avoidCollisions: !0,
|
|
46
|
+
arrowPadding: 10,
|
|
47
|
+
style: { zIndex: P },
|
|
48
|
+
onAnimationStart: d,
|
|
49
|
+
onAnimationEnd: m,
|
|
50
|
+
onOpenAutoFocus: p,
|
|
51
|
+
onCloseAutoFocus: f,
|
|
52
|
+
onWheel: (t) => t.stopPropagation(),
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ r(o.Close, { ref: e, style: { display: "none" } }),
|
|
55
|
+
b && /* @__PURE__ */ r(o.Arrow, { width: 30, height: 11, asChild: !0, children: /* @__PURE__ */ r("div", { className: "popover-arrow", children: /* @__PURE__ */ a("svg", { className: "popover-arrow-icon", viewBox: "0 0 30 11", width: 30, height: 11, children: [
|
|
56
|
+
/* @__PURE__ */ r(
|
|
57
|
+
"path",
|
|
58
|
+
{
|
|
59
|
+
className: "popover-arrow-border",
|
|
60
|
+
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",
|
|
61
|
+
style: { transformBox: "fill-box", transformOrigin: "50% 50%" },
|
|
62
|
+
transform: "matrix(0, -1, 1, 0, 0.000001, 0)"
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ r(
|
|
66
|
+
"path",
|
|
67
|
+
{
|
|
68
|
+
className: "popover-arrow-fill",
|
|
69
|
+
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",
|
|
70
|
+
style: { transformBox: "fill-box", transformOrigin: "50% 50%" },
|
|
71
|
+
transform: "matrix(0, -1, 1, 0, 0, 0)"
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] }) }) }),
|
|
75
|
+
/* @__PURE__ */ r("div", { className: "popover-content", "data-fit-max-height": B(O), children: v({ close: y }) })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
) })
|
|
79
|
+
] });
|
|
80
|
+
});
|
|
26
81
|
export {
|
|
27
|
-
|
|
82
|
+
D as Popover
|
|
28
83
|
};
|
package/dist/bundle.es12.js
CHANGED
|
@@ -1,98 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { Popover as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { mergeRefs as W } from "react-merge-refs";
|
|
9
|
-
const Z = (t) => {
|
|
10
|
-
const {
|
|
11
|
-
onChange: i,
|
|
12
|
-
value: n,
|
|
13
|
-
matchTarget: u = "width",
|
|
14
|
-
children: f,
|
|
15
|
-
scrollRef: m,
|
|
16
|
-
popoverRef: d,
|
|
17
|
-
clearButton: s,
|
|
18
|
-
// select props
|
|
19
|
-
disabled: a,
|
|
20
|
-
required: v,
|
|
21
|
-
className: h,
|
|
22
|
-
clearButtonIcon: O,
|
|
23
|
-
leftElement: R,
|
|
24
|
-
inputRef: C,
|
|
25
|
-
onClear: y,
|
|
26
|
-
fill: P,
|
|
27
|
-
size: g,
|
|
28
|
-
placeholder: E,
|
|
29
|
-
onClick: A,
|
|
30
|
-
// options popover
|
|
31
|
-
...S
|
|
32
|
-
} = t, r = L({});
|
|
33
|
-
j(() => {
|
|
34
|
-
(t.options ?? t.defaultOptions ?? []).forEach((e) => {
|
|
35
|
-
r.current[e.value] = e;
|
|
36
|
-
});
|
|
37
|
-
}, [t.options, t.defaultOptions]);
|
|
38
|
-
const x = n === null ? null : r.current[n] ?? null, { popoverRef: z, froozePopoverPosition: B, handleAnimationEnd: F } = w(), { scrollToElement: p, optionsWrapperRef: I, scrollBoxRef: T } = M();
|
|
39
|
-
k(m, () => ({
|
|
40
|
-
scrollTo: (o) => p(o, "top")
|
|
41
|
-
}));
|
|
42
|
-
const b = (o, e) => {
|
|
43
|
-
B(), i(o), e();
|
|
44
|
-
}, D = (o) => {
|
|
45
|
-
o.stopPropagation(), s && i(null);
|
|
46
|
-
};
|
|
47
|
-
return /* @__PURE__ */ l(
|
|
48
|
-
q,
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p } from "react";
|
|
3
|
+
import { Popover as m } from "./bundle.es11.js";
|
|
4
|
+
const f = ({ children: e, content: t, side: r }) => {
|
|
5
|
+
const [s, o] = p(!1);
|
|
6
|
+
return /* @__PURE__ */ n(
|
|
7
|
+
m,
|
|
49
8
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
...S,
|
|
62
|
-
close: o,
|
|
63
|
-
isActive: (e) => e === n,
|
|
64
|
-
onSelect: (e) => b(e, o),
|
|
65
|
-
scrollboxRef: T,
|
|
66
|
-
optionsWrapperRef: I,
|
|
67
|
-
onOpened: (e) => p(e, "center"),
|
|
68
|
-
onOptionsLoaded: (e) => {
|
|
69
|
-
e.forEach((c) => {
|
|
70
|
-
r.current[c.value] = c;
|
|
71
|
-
});
|
|
72
|
-
}
|
|
9
|
+
showArrows: !0,
|
|
10
|
+
className: "tooltip",
|
|
11
|
+
open: s,
|
|
12
|
+
side: r,
|
|
13
|
+
content: () => t,
|
|
14
|
+
triggerProps: {
|
|
15
|
+
onMouseEnter: () => {
|
|
16
|
+
o(!0);
|
|
17
|
+
},
|
|
18
|
+
onMouseLeave: () => {
|
|
19
|
+
o(!1);
|
|
73
20
|
}
|
|
74
|
-
|
|
75
|
-
children:
|
|
76
|
-
H,
|
|
77
|
-
{
|
|
78
|
-
required: v,
|
|
79
|
-
className: h,
|
|
80
|
-
leftElement: R,
|
|
81
|
-
inputRef: C,
|
|
82
|
-
onClear: D,
|
|
83
|
-
fill: P,
|
|
84
|
-
size: g,
|
|
85
|
-
placeholder: E,
|
|
86
|
-
onClick: A,
|
|
87
|
-
disabled: a,
|
|
88
|
-
clearButton: s,
|
|
89
|
-
clearButtonIcon: O,
|
|
90
|
-
value: x?.title ?? ""
|
|
91
|
-
}
|
|
92
|
-
)
|
|
21
|
+
},
|
|
22
|
+
children: e
|
|
93
23
|
}
|
|
94
24
|
);
|
|
95
25
|
};
|
|
96
26
|
export {
|
|
97
|
-
|
|
27
|
+
f as Tooltip
|
|
98
28
|
};
|