@companix/uikit 0.0.26 → 0.0.27
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/Dialog/index.d.ts +6 -2
- package/dist/Popover/index.d.ts +3 -3
- package/dist/__helpers/createDialogRegistry.d.ts +26 -0
- package/dist/__helpers/createPopoversRegistry.d.ts +19 -0
- package/dist/bundle.es.js +36 -31
- package/dist/bundle.es10.js +1 -1
- package/dist/bundle.es11.js +1 -1
- package/dist/bundle.es14.js +1 -1
- package/dist/bundle.es18.js +28 -12
- package/dist/bundle.es19.js +1 -1
- package/dist/bundle.es20.js +1 -1
- package/dist/bundle.es23.js +1 -1
- package/dist/bundle.es24.js +3 -3
- package/dist/bundle.es25.js +4 -4
- package/dist/bundle.es26.js +2 -2
- package/dist/bundle.es29.js +2 -2
- package/dist/bundle.es33.js +1 -1
- package/dist/bundle.es34.js +1 -1
- package/dist/bundle.es35.js +1 -1
- package/dist/bundle.es36.js +40 -21
- package/dist/bundle.es37.js +9 -87
- package/dist/bundle.es38.js +23 -17
- package/dist/bundle.es39.js +87 -20
- package/dist/bundle.es40.js +18 -24
- package/dist/bundle.es41.js +20 -39
- package/dist/bundle.es42.js +24 -3
- package/dist/bundle.es43.js +39 -5
- package/dist/bundle.es44.js +3 -14
- package/dist/bundle.es45.js +5 -14
- package/dist/bundle.es46.js +14 -3
- package/dist/bundle.es47.js +14 -3
- package/dist/bundle.es48.js +3 -70
- package/dist/bundle.es49.js +3 -68
- package/dist/bundle.es50.js +69 -69
- package/dist/bundle.es51.js +67 -11
- package/dist/bundle.es52.js +69 -42
- package/dist/bundle.es53.js +12 -32
- package/dist/bundle.es54.js +42 -69
- package/dist/bundle.es55.js +31 -75
- package/dist/bundle.es56.js +68 -47
- package/dist/bundle.es60.js +76 -20
- package/dist/bundle.es61.js +49 -2
- package/dist/bundle.es62.js +17 -18
- package/dist/bundle.es63.js +2 -2
- package/dist/bundle.es64.js +18 -17
- package/dist/bundle.es66.js +20 -3
- package/dist/bundle.es67.js +2 -3
- package/dist/bundle.es69.js +3 -20
- package/dist/bundle.es70.js +3 -2
- package/dist/bundle.es71.js +13 -13
- package/dist/bundle.es72.js +2 -2
- package/dist/bundle.es73.js +22 -0
- package/dist/bundle.es74.js +4 -0
- package/dist/bundle.es8.js +4 -4
- package/dist/bundle.es9.js +2 -2
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
- /package/dist/{Toaster → __utils}/RemoveListener.d.ts +0 -0
package/dist/Dialog/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
export type DialogSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'full';
|
|
2
3
|
export interface DialogProps {
|
|
3
4
|
open: boolean;
|
|
4
5
|
onOpenChange: (value: boolean) => void;
|
|
6
|
+
defaultOpen?: boolean;
|
|
5
7
|
children: React.ReactNode;
|
|
6
|
-
size?:
|
|
8
|
+
size?: DialogSize;
|
|
7
9
|
className?: string;
|
|
10
|
+
disableEsc?: boolean;
|
|
11
|
+
onClosed?: () => void;
|
|
8
12
|
}
|
|
9
13
|
export declare const Dialog: {
|
|
10
|
-
(
|
|
14
|
+
(props: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
Close: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
12
16
|
};
|
package/dist/Popover/index.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ export type Align = 'start' | 'center' | 'end';
|
|
|
2
2
|
export type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
3
3
|
export interface PopoverProps {
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
+
content: ({ close }: {
|
|
6
|
+
close: () => void;
|
|
7
|
+
}) => React.ReactNode;
|
|
5
8
|
open?: boolean;
|
|
6
9
|
triggerRef?: React.Ref<HTMLButtonElement>;
|
|
7
10
|
triggerProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
8
11
|
onOpenChange?: (open: boolean) => void;
|
|
9
|
-
content: ({ close }: {
|
|
10
|
-
close: () => void;
|
|
11
|
-
}) => React.ReactNode;
|
|
12
12
|
onAnimationEnd?: () => void;
|
|
13
13
|
onAnimationStart?: () => void;
|
|
14
14
|
onOpenAutoFocus?: (event: Event) => void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DialogProps } from '../Dialog';
|
|
2
|
+
export interface PopupProps<T> {
|
|
3
|
+
data: T;
|
|
4
|
+
close: () => void;
|
|
5
|
+
}
|
|
6
|
+
type PopupSignature = (options: PopupProps<any>) => JSX.Element;
|
|
7
|
+
type Store = {
|
|
8
|
+
[name: string]: PopupSignature;
|
|
9
|
+
};
|
|
10
|
+
type UnwrapProps<T extends PopupSignature> = Parameters<T>[0] extends PopupProps<infer Q> ? Q : never;
|
|
11
|
+
type OpenAgent<T extends Store> = {
|
|
12
|
+
[P in keyof T]: (data: UnwrapProps<T[P]>) => void;
|
|
13
|
+
};
|
|
14
|
+
type CloseAgent<T extends Store> = {
|
|
15
|
+
[key in keyof T]: () => void;
|
|
16
|
+
};
|
|
17
|
+
type PopupsRegistry<T extends Store> = {
|
|
18
|
+
Overlay: () => JSX.Element;
|
|
19
|
+
Close: CloseAgent<T>;
|
|
20
|
+
Open: OpenAgent<T>;
|
|
21
|
+
};
|
|
22
|
+
export declare const createDialogsRegistry: <T extends Store>(mapping: T) => PopupsRegistry<T>;
|
|
23
|
+
interface PopupLayer extends Omit<DialogProps, 'open' | 'onOpenChange' | 'onClosed'> {
|
|
24
|
+
}
|
|
25
|
+
export declare const DialogShell: ({ children, ...props }: PopupLayer) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PopoverProps } from '../Popover';
|
|
2
|
+
export type PopoverContentProps<T> = {
|
|
3
|
+
data: T;
|
|
4
|
+
close: () => void;
|
|
5
|
+
};
|
|
6
|
+
type PopoverSignature = (options: PopoverContentProps<any>) => JSX.Element;
|
|
7
|
+
type Store = {
|
|
8
|
+
[name: string]: PopoverSignature;
|
|
9
|
+
};
|
|
10
|
+
type UnwrapProps<T extends PopoverSignature> = Parameters<T>[0] extends PopoverContentProps<infer Q> ? Q : never;
|
|
11
|
+
type PopoversStore<T extends Store> = {
|
|
12
|
+
[P in keyof T]: (props: Omit<PopoverProps, 'content'> & (UnwrapProps<T[P]> extends never ? {
|
|
13
|
+
data?: unknown;
|
|
14
|
+
} : {
|
|
15
|
+
data: UnwrapProps<T[P]>;
|
|
16
|
+
})) => JSX.Element;
|
|
17
|
+
};
|
|
18
|
+
export declare const createPopoversRegistry: <T extends Store>(mapping: T) => PopoversStore<T>;
|
|
19
|
+
export {};
|
package/dist/bundle.es.js
CHANGED
|
@@ -3,18 +3,18 @@ import { Spinner as p } from "./bundle.es3.js";
|
|
|
3
3
|
import { Scrollable as x } from "./bundle.es4.js";
|
|
4
4
|
import { ImitateScroll as a } from "./bundle.es5.js";
|
|
5
5
|
import { Popover as l } from "./bundle.es6.js";
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { Select as
|
|
8
|
-
import { Input as
|
|
9
|
-
import { OptionItem as
|
|
10
|
-
import { NumberInput as
|
|
11
|
-
import { OptionsList as
|
|
12
|
-
import { ButtonGroup as
|
|
13
|
-
import { Checkbox as
|
|
14
|
-
import { Switch as
|
|
15
|
-
import { Radio as
|
|
16
|
-
import { Drawer as
|
|
17
|
-
import { Dialog as
|
|
6
|
+
import { Tooltip as n } from "./bundle.es7.js";
|
|
7
|
+
import { Select as u } from "./bundle.es8.js";
|
|
8
|
+
import { Input as S } from "./bundle.es9.js";
|
|
9
|
+
import { OptionItem as T } from "./bundle.es10.js";
|
|
10
|
+
import { NumberInput as P } from "./bundle.es11.js";
|
|
11
|
+
import { OptionsList as d } from "./bundle.es12.js";
|
|
12
|
+
import { ButtonGroup as B } from "./bundle.es13.js";
|
|
13
|
+
import { Checkbox as h } from "./bundle.es14.js";
|
|
14
|
+
import { Switch as v } from "./bundle.es15.js";
|
|
15
|
+
import { Radio as y, RadioGroup as G } from "./bundle.es16.js";
|
|
16
|
+
import { Drawer as O } from "./bundle.es17.js";
|
|
17
|
+
import { Dialog as F } from "./bundle.es18.js";
|
|
18
18
|
import { AlertDialog as j } from "./bundle.es19.js";
|
|
19
19
|
import { LoadButton as z } from "./bundle.es20.js";
|
|
20
20
|
import { Tabs as H } from "./bundle.es21.js";
|
|
@@ -29,43 +29,48 @@ import { TimePicker as to } from "./bundle.es29.js";
|
|
|
29
29
|
import { Icon as mo } from "./bundle.es30.js";
|
|
30
30
|
import { ProgressBar as fo } from "./bundle.es31.js";
|
|
31
31
|
import { useLocalStorage as io } from "./bundle.es32.js";
|
|
32
|
-
import { createAlertAgent as
|
|
33
|
-
import { createToaster as
|
|
34
|
-
import { Toast as
|
|
32
|
+
import { createAlertAgent as co } from "./bundle.es33.js";
|
|
33
|
+
import { createToaster as so } from "./bundle.es34.js";
|
|
34
|
+
import { Toast as go } from "./bundle.es35.js";
|
|
35
|
+
import { DialogShell as Do, createDialogsRegistry as To } from "./bundle.es36.js";
|
|
36
|
+
import { createPopoversRegistry as Po } from "./bundle.es37.js";
|
|
35
37
|
export {
|
|
36
38
|
j as AlertDialog,
|
|
37
39
|
e as Button,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
B as ButtonGroup,
|
|
41
|
+
h as Checkbox,
|
|
40
42
|
K as Countdown,
|
|
41
43
|
Z as DateInput,
|
|
42
44
|
X as DatePicker,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
F as Dialog,
|
|
46
|
+
Do as DialogShell,
|
|
47
|
+
O as Drawer,
|
|
45
48
|
$ as FileOverlay,
|
|
46
49
|
ro as FormGroup,
|
|
47
50
|
mo as Icon,
|
|
48
51
|
a as ImitateScroll,
|
|
49
|
-
|
|
52
|
+
S as Input,
|
|
50
53
|
z as LoadButton,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
P as NumberInput,
|
|
55
|
+
T as OptionItem,
|
|
56
|
+
d as OptionsList,
|
|
54
57
|
l as Popover,
|
|
55
58
|
fo as ProgressBar,
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
y as Radio,
|
|
60
|
+
G as RadioGroup,
|
|
58
61
|
x as Scrollable,
|
|
59
|
-
|
|
62
|
+
u as Select,
|
|
60
63
|
V as SelectTags,
|
|
61
64
|
p as Spinner,
|
|
62
|
-
|
|
65
|
+
v as Switch,
|
|
63
66
|
H as Tabs,
|
|
64
67
|
Q as TextArea,
|
|
65
68
|
to as TimePicker,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
go as Toast,
|
|
70
|
+
n as Tooltip,
|
|
71
|
+
co as createAlertAgent,
|
|
72
|
+
To as createDialogsRegistry,
|
|
73
|
+
Po as createPopoversRegistry,
|
|
74
|
+
so as createToaster,
|
|
70
75
|
io as useLocalStorage
|
|
71
76
|
};
|
package/dist/bundle.es10.js
CHANGED
|
@@ -3,7 +3,7 @@ import N from "classnames";
|
|
|
3
3
|
import { Icon as v } from "./bundle.es30.js";
|
|
4
4
|
import { attr as t } from "@companix/utils-browser";
|
|
5
5
|
import { forwardRef as k } from "react";
|
|
6
|
-
import { f as x } from "./bundle.
|
|
6
|
+
import { f as x } from "./bundle.es44.js";
|
|
7
7
|
const E = k(
|
|
8
8
|
({ title: s, icon: c, active: e, label: n, disabled: a, minimal: r, onClick: d, className: l, ...m }, p) => {
|
|
9
9
|
const f = (h) => {
|
package/dist/bundle.es11.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import C from "classnames";
|
|
3
3
|
import { forwardRef as j, useRef as w } from "react";
|
|
4
4
|
import { mergeRefs as y } from "react-merge-refs";
|
|
5
|
-
import { InputContainer as F } from "./bundle.
|
|
5
|
+
import { InputContainer as F } from "./bundle.es43.js";
|
|
6
6
|
import { NumericFormat as V } from "react-number-format";
|
|
7
7
|
const D = j(
|
|
8
8
|
({
|
package/dist/bundle.es14.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "@radix-ui/react-checkbox";
|
|
3
3
|
import { Icon as h } from "./bundle.es30.js";
|
|
4
|
-
import { f as l } from "./bundle.
|
|
4
|
+
import { f as l } from "./bundle.es44.js";
|
|
5
5
|
import { useId as n } from "react";
|
|
6
6
|
import { attr as c } from "@companix/utils-browser";
|
|
7
7
|
const N = ({ checked: a, required: s, disabled: r, onCheckedChange: m, size: x, label: e }) => {
|
package/dist/bundle.es18.js
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import f from "classnames";
|
|
3
3
|
import * as o from "@radix-ui/react-dialog";
|
|
4
|
-
import { VisuallyHidden as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
import { VisuallyHidden as a } from "@radix-ui/react-visually-hidden";
|
|
5
|
+
import { RemoveListener as v } from "./bundle.es45.js";
|
|
6
|
+
const g = (l) => {
|
|
7
|
+
const { size: n = "s", open: r, onOpenChange: s, children: c, onClosed: t, disableEsc: p, className: d } = l, m = (h) => {
|
|
8
|
+
p && h.preventDefault();
|
|
9
|
+
};
|
|
10
|
+
return /* @__PURE__ */ e(o.Root, { open: r, onOpenChange: s, children: /* @__PURE__ */ i(o.Portal, { children: [
|
|
11
|
+
/* @__PURE__ */ e(o.Overlay, { className: "popup-overlay dialog-overlay" }),
|
|
12
|
+
/* @__PURE__ */ e(
|
|
13
|
+
o.Content,
|
|
14
|
+
{
|
|
15
|
+
className: "popup-container dialog-container",
|
|
16
|
+
"data-size": n,
|
|
17
|
+
onEscapeKeyDown: m,
|
|
18
|
+
children: /* @__PURE__ */ i("div", { className: f("popup dialog", d), children: [
|
|
19
|
+
/* @__PURE__ */ e(v, { callback: t }),
|
|
20
|
+
/* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(o.Title, {}) }),
|
|
21
|
+
/* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(o.Description, {}) }),
|
|
22
|
+
c
|
|
23
|
+
] })
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] }) });
|
|
27
|
+
};
|
|
28
|
+
g.Close = o.Close;
|
|
13
29
|
export {
|
|
14
|
-
|
|
30
|
+
g as Dialog
|
|
15
31
|
};
|
package/dist/bundle.es19.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "@radix-ui/react-alert-dialog";
|
|
3
3
|
import { Button as c } from "./bundle.es2.js";
|
|
4
|
-
import { RemoveListener as N } from "./bundle.
|
|
4
|
+
import { RemoveListener as N } from "./bundle.es45.js";
|
|
5
5
|
import { VisuallyHidden as u } from "@radix-ui/react-visually-hidden";
|
|
6
6
|
const C = ({
|
|
7
7
|
open: d,
|
package/dist/bundle.es20.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Button as m } from "./bundle.es2.js";
|
|
3
|
-
import { useLoading as p } from "./bundle.
|
|
3
|
+
import { useLoading as p } from "./bundle.es46.js";
|
|
4
4
|
const g = ({ onClick: o, appearance: r = "primary", ...i }) => {
|
|
5
5
|
const { isLoading: n, isError: t, handleClick: a } = p({ onClick: o });
|
|
6
6
|
return /* @__PURE__ */ e(
|
package/dist/bundle.es23.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { useResizeTextarea as x } from "./bundle.
|
|
2
|
+
import { useResizeTextarea as x } from "./bundle.es47.js";
|
|
3
3
|
import { attr as e, callMultiple as u } from "@companix/utils-browser";
|
|
4
4
|
import { useEffect as z } from "react";
|
|
5
5
|
import { mergeRefs as R } from "react-merge-refs";
|
package/dist/bundle.es24.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import { useFroozeClosing as M } from "./bundle.
|
|
2
|
+
import { useFroozeClosing as M } from "./bundle.es38.js";
|
|
3
3
|
import { Popover as j } from "./bundle.es6.js";
|
|
4
4
|
import { OptionItem as q } from "./bundle.es10.js";
|
|
5
5
|
import { OptionsList as V } from "./bundle.es12.js";
|
|
6
6
|
import { Icon as d } from "./bundle.es30.js";
|
|
7
7
|
import { useState as B, useRef as h, useMemo as g } from "react";
|
|
8
|
-
import { f as H } from "./bundle.
|
|
9
|
-
import { f as Q } from "./bundle.
|
|
8
|
+
import { f as H } from "./bundle.es48.js";
|
|
9
|
+
import { f as Q } from "./bundle.es49.js";
|
|
10
10
|
import { attr as x, getActiveElementByAnotherElement as G, contains as J } from "@companix/utils-browser";
|
|
11
11
|
import { mergeRefs as K } from "react-merge-refs";
|
|
12
12
|
const se = (C) => {
|
package/dist/bundle.es25.js
CHANGED
|
@@ -2,11 +2,11 @@ import { jsx as u } from "react/jsx-runtime";
|
|
|
2
2
|
import { Popover as x } from "./bundle.es6.js";
|
|
3
3
|
import { Input as A } from "./bundle.es9.js";
|
|
4
4
|
import { useState as M, useRef as j } from "react";
|
|
5
|
-
import { Calendar as E } from "./bundle.
|
|
6
|
-
import { useDayDisableCheker as N } from "./bundle.
|
|
5
|
+
import { Calendar as E } from "./bundle.es50.js";
|
|
6
|
+
import { useDayDisableCheker as N } from "./bundle.es51.js";
|
|
7
7
|
import { getNum as f, formatTime as v } from "@companix/utils-js";
|
|
8
|
-
import { removeDigits as O } from "./bundle.
|
|
9
|
-
import { SelectRightElements as Y } from "./bundle.
|
|
8
|
+
import { removeDigits as O } from "./bundle.es52.js";
|
|
9
|
+
import { SelectRightElements as Y } from "./bundle.es53.js";
|
|
10
10
|
const i = {
|
|
11
11
|
char: "-",
|
|
12
12
|
toString: (e) => {
|
package/dist/bundle.es26.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as D, jsx as h } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as M, useEffect as C } from "react";
|
|
3
3
|
import { Select as c } from "./bundle.es8.js";
|
|
4
|
-
import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.
|
|
5
|
-
import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.
|
|
4
|
+
import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es52.js";
|
|
5
|
+
import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es54.js";
|
|
6
6
|
const B = ({
|
|
7
7
|
min: o = j,
|
|
8
8
|
max: e = N,
|
package/dist/bundle.es29.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as g } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as _, useMemo as b, useState as P, useEffect as j } from "react";
|
|
3
3
|
import { getNum as v } from "@companix/utils-js";
|
|
4
|
-
import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.
|
|
5
|
-
import { SelectRightElements as w } from "./bundle.
|
|
4
|
+
import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.es52.js";
|
|
5
|
+
import { SelectRightElements as w } from "./bundle.es53.js";
|
|
6
6
|
import { Select as y } from "./bundle.es8.js";
|
|
7
7
|
import { Input as z } from "./bundle.es9.js";
|
|
8
8
|
const r = {
|
package/dist/bundle.es33.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { hash as m } from "@companix/utils-js";
|
|
3
3
|
import { useRef as n, useMemo as s } from "react";
|
|
4
|
-
import { Viewport as u } from "./bundle.
|
|
4
|
+
import { Viewport as u } from "./bundle.es55.js";
|
|
5
5
|
const h = (t = {}) => {
|
|
6
6
|
const e = {
|
|
7
7
|
emit: (r) => {
|
package/dist/bundle.es34.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { hash as r } from "@companix/utils-js";
|
|
3
|
-
import { Viewport as a } from "./bundle.
|
|
3
|
+
import { Viewport as a } from "./bundle.es56.js";
|
|
4
4
|
import { useRef as c, useMemo as h } from "react";
|
|
5
5
|
const m = (i = {}) => {
|
|
6
6
|
const o = {
|
package/dist/bundle.es35.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import * as t from "@radix-ui/react-toast";
|
|
3
3
|
import { attr as T } from "@companix/utils-browser";
|
|
4
4
|
import { useState as d, useRef as b, useEffect as j, useLayoutEffect as E } from "react";
|
|
5
|
-
import { RemoveListener as I } from "./bundle.
|
|
5
|
+
import { RemoveListener as I } from "./bundle.es45.js";
|
|
6
6
|
const m = (o) => {
|
|
7
7
|
const [r, u] = d(!0), [p, f] = d(!1), s = b(null), {
|
|
8
8
|
appearance: C = "neutral",
|
package/dist/bundle.es36.js
CHANGED
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
}, []);
|
|
1
|
+
import { jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as C, createContext as g, useState as h, useEffect as x, useCallback as u } from "react";
|
|
3
|
+
import { Dialog as D } from "./bundle.es18.js";
|
|
4
|
+
import { hash as v } from "@companix/utils-js";
|
|
5
|
+
const $ = (t) => {
|
|
6
|
+
const e = {}, n = {}, l = [], c = v();
|
|
7
|
+
for (const o in t)
|
|
8
|
+
e[o] = () => {
|
|
9
|
+
}, n[o] = () => {
|
|
10
|
+
}, l.push(() => /* @__PURE__ */ r(O, { Open: e, Close: n, name: o, Content: t[o] }));
|
|
18
11
|
return {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
Open: e,
|
|
13
|
+
Close: n,
|
|
14
|
+
Overlay: () => /* @__PURE__ */ r(m, { children: l.map((o, s) => /* @__PURE__ */ r(o, {}, `popup-${c}-${s}`)) })
|
|
22
15
|
};
|
|
16
|
+
}, O = ({ name: t, Open: e, Close: n, Content: l }) => {
|
|
17
|
+
const [{ data: c, open: o }, s] = h({ data: null, open: !1 });
|
|
18
|
+
x(() => {
|
|
19
|
+
e[t] = (a) => {
|
|
20
|
+
s({ data: a, open: !0 });
|
|
21
|
+
}, n[t] = () => {
|
|
22
|
+
o && p();
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
const p = u(() => {
|
|
26
|
+
s(({ data: a }) => ({ data: a, open: !1 }));
|
|
27
|
+
}, []), f = u(() => {
|
|
28
|
+
s({ data: null, open: !1 });
|
|
29
|
+
}, []), d = u((a) => {
|
|
30
|
+
a || p();
|
|
31
|
+
}, []);
|
|
32
|
+
return c ? /* @__PURE__ */ r(i.Provider, { value: { open: o, onOpenChange: d, onClosed: f }, children: /* @__PURE__ */ r(l, { data: c, close: p }) }) : null;
|
|
33
|
+
}, i = g(null), S = () => {
|
|
34
|
+
const t = C(i);
|
|
35
|
+
if (!t)
|
|
36
|
+
throw new Error("Dialog context not provided");
|
|
37
|
+
return t;
|
|
38
|
+
}, b = ({ children: t, ...e }) => {
|
|
39
|
+
const n = S();
|
|
40
|
+
return /* @__PURE__ */ r(D, { ...n, ...e, children: t });
|
|
23
41
|
};
|
|
24
42
|
export {
|
|
25
|
-
|
|
43
|
+
b as DialogShell,
|
|
44
|
+
$ as createDialogsRegistry
|
|
26
45
|
};
|
package/dist/bundle.es37.js
CHANGED
|
@@ -1,89 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
({
|
|
10
|
-
required: a,
|
|
11
|
-
size: u,
|
|
12
|
-
fill: d,
|
|
13
|
-
leftElement: s,
|
|
14
|
-
className: m,
|
|
15
|
-
value: n,
|
|
16
|
-
clearButton: f,
|
|
17
|
-
placeholder: p,
|
|
18
|
-
clearButtonIcon: h,
|
|
19
|
-
disabled: r,
|
|
20
|
-
onClear: C,
|
|
21
|
-
inputRef: I,
|
|
22
|
-
...i
|
|
23
|
-
}, k) => {
|
|
24
|
-
const e = S(null), N = T(
|
|
25
|
-
(t) => {
|
|
26
|
-
if (!e.current || !document)
|
|
27
|
-
return;
|
|
28
|
-
t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
|
|
29
|
-
},
|
|
30
|
-
[e]
|
|
31
|
-
), v = (t) => {
|
|
32
|
-
document && document.activeElement === e.current && t.preventDefault();
|
|
33
|
-
}, F = (t) => {
|
|
34
|
-
r || N(t);
|
|
35
|
-
}, g = (t) => {
|
|
36
|
-
v(t);
|
|
37
|
-
}, R = (t) => {
|
|
38
|
-
e.current && e.current.focus(), C?.(t);
|
|
39
|
-
};
|
|
40
|
-
return /* @__PURE__ */ o(
|
|
41
|
-
"div",
|
|
42
|
-
{
|
|
43
|
-
ref: k,
|
|
44
|
-
className: A("form select", m),
|
|
45
|
-
"data-size": u ?? "md",
|
|
46
|
-
"data-fill": l(d),
|
|
47
|
-
"data-required": l(a),
|
|
48
|
-
"data-disabled": l(r),
|
|
49
|
-
onMouseDown: g,
|
|
50
|
-
...i,
|
|
51
|
-
onClick: F,
|
|
52
|
-
children: [
|
|
53
|
-
/* @__PURE__ */ o("div", { className: "select-layout form-input", children: [
|
|
54
|
-
s && /* @__PURE__ */ c("div", { className: "select-element", children: s }),
|
|
55
|
-
/* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ o("div", { className: "select-content-text", "aria-disabled": r, children: [
|
|
56
|
-
!n && /* @__PURE__ */ c("span", { className: "select-placeholder", children: p }),
|
|
57
|
-
n
|
|
58
|
-
] }) }),
|
|
59
|
-
/* @__PURE__ */ c("div", { className: "select-element", children: /* @__PURE__ */ c(
|
|
60
|
-
z,
|
|
61
|
-
{
|
|
62
|
-
clearButton: f,
|
|
63
|
-
value: !!n,
|
|
64
|
-
clearButtonIcon: h,
|
|
65
|
-
onClear: R
|
|
66
|
-
}
|
|
67
|
-
) })
|
|
68
|
-
] }),
|
|
69
|
-
/* @__PURE__ */ c(j, { asChild: !0, children: /* @__PURE__ */ c(
|
|
70
|
-
"input",
|
|
71
|
-
{
|
|
72
|
-
ref: w([I, e]),
|
|
73
|
-
autoComplete: "off",
|
|
74
|
-
autoCapitalize: "none",
|
|
75
|
-
autoCorrect: "off",
|
|
76
|
-
spellCheck: "false",
|
|
77
|
-
"aria-autocomplete": "none",
|
|
78
|
-
onClick: i.onClick,
|
|
79
|
-
readOnly: !0
|
|
80
|
-
}
|
|
81
|
-
) })
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
);
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { Popover as m } from "./bundle.es6.js";
|
|
3
|
+
const i = (o) => {
|
|
4
|
+
const r = {};
|
|
5
|
+
for (const t in o)
|
|
6
|
+
r[t] = ({ data: e, ...n }) => /* @__PURE__ */ c(m, { content: ({ close: s }) => o[t]({ data: e, close: s }), ...n });
|
|
7
|
+
return r;
|
|
8
|
+
};
|
|
87
9
|
export {
|
|
88
|
-
|
|
10
|
+
i as createPopoversRegistry
|
|
89
11
|
};
|
package/dist/bundle.es38.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
};
|
|
17
23
|
};
|
|
18
24
|
export {
|
|
19
|
-
|
|
25
|
+
p as useFroozeClosing
|
|
20
26
|
};
|