@companix/uikit 0.0.27 → 0.0.29
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/Input/Input.d.ts +1 -0
- package/dist/ThemeProvider/helpers.d.ts +4 -0
- package/dist/ThemeProvider/index.d.ts +12 -0
- package/dist/ThemeProvider/script.d.ts +7 -0
- package/dist/ThemeProvider/types.d.ts +2 -0
- package/dist/bundle.es.js +28 -25
- 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 +1 -1
- 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.es32.js +37 -9
- package/dist/bundle.es33.js +10 -24
- package/dist/bundle.es34.js +17 -31
- package/dist/bundle.es35.js +36 -48
- package/dist/bundle.es36.js +49 -41
- package/dist/bundle.es37.js +42 -8
- package/dist/bundle.es38.js +8 -23
- package/dist/bundle.es39.js +24 -87
- package/dist/bundle.es40.js +87 -18
- package/dist/bundle.es41.js +16 -18
- package/dist/bundle.es42.js +20 -24
- package/dist/bundle.es43.js +20 -35
- package/dist/bundle.es44.js +39 -3
- package/dist/bundle.es45.js +3 -5
- package/dist/bundle.es46.js +5 -14
- package/dist/bundle.es47.js +13 -13
- package/dist/bundle.es48.js +14 -3
- package/dist/bundle.es49.js +3 -3
- package/dist/bundle.es50.js +3 -70
- package/dist/bundle.es51.js +68 -66
- package/dist/bundle.es52.js +67 -69
- package/dist/bundle.es53.js +69 -11
- package/dist/bundle.es54.js +11 -42
- package/dist/bundle.es55.js +43 -32
- package/dist/bundle.es56.js +15 -70
- package/dist/bundle.es57.js +24 -20
- package/dist/bundle.es58.js +32 -2
- package/dist/bundle.es59.js +69 -13
- package/dist/bundle.es60.js +13 -75
- package/dist/bundle.es61.js +20 -49
- package/dist/bundle.es62.js +2 -20
- package/dist/bundle.es63.js +76 -2
- package/dist/bundle.es64.js +49 -21
- package/dist/bundle.es65.js +20 -2
- package/dist/bundle.es66.js +2 -20
- package/dist/bundle.es67.js +21 -2
- package/dist/bundle.es68.js +2 -14
- package/dist/bundle.es69.js +20 -3
- package/dist/bundle.es70.js +2 -3
- package/dist/bundle.es71.js +14 -20
- package/dist/bundle.es72.js +3 -2
- package/dist/bundle.es73.js +3 -20
- package/dist/bundle.es74.js +20 -2
- package/dist/bundle.es75.js +4 -0
- package/dist/bundle.es76.js +22 -0
- package/dist/bundle.es77.js +4 -0
- package/dist/bundle.es8.js +4 -4
- package/dist/bundle.es9.js +22 -21
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/Input/Input.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export interface InputProps extends Omit<InputContainerProps, 'inputRef' | 'chil
|
|
|
9
9
|
inputClassName?: string;
|
|
10
10
|
mask?: string;
|
|
11
11
|
maskChar?: string;
|
|
12
|
+
type?: React.HTMLInputTypeAttribute;
|
|
12
13
|
}
|
|
13
14
|
export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ColorSchemeExtendedType } from './types';
|
|
2
|
+
export declare const getColorScheme: (key: string, defaultColorScheme: ColorSchemeExtendedType) => ColorSchemeExtendedType;
|
|
3
|
+
export declare const getSystemColorScheme: (e?: MediaQueryList | MediaQueryListEvent) => "dark" | "light";
|
|
4
|
+
export declare const updateDOM: (colorScheme: ColorSchemeExtendedType) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ColorSchemeExtendedType, ColorSchemeType } from './types';
|
|
2
|
+
export interface UseColorSchemeProps {
|
|
3
|
+
setColorScheme: (scheme: ColorSchemeExtendedType) => void;
|
|
4
|
+
colorScheme?: ColorSchemeExtendedType;
|
|
5
|
+
resolvedColorScheme?: ColorSchemeType;
|
|
6
|
+
}
|
|
7
|
+
export declare const useTheme: () => UseColorSchemeProps;
|
|
8
|
+
export interface ThemeProviderProps extends React.PropsWithChildren {
|
|
9
|
+
storageKey?: string;
|
|
10
|
+
defaultColorScheme?: ColorSchemeExtendedType;
|
|
11
|
+
}
|
|
12
|
+
export declare const ThemeProvider: (props: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ColorSchemeExtendedType } from './types';
|
|
2
|
+
interface ColorSchemeScriptProps {
|
|
3
|
+
storageKey: string;
|
|
4
|
+
defaultColorScheme: ColorSchemeExtendedType;
|
|
5
|
+
}
|
|
6
|
+
export declare const ColorSchemeScript: import('react').MemoExoticComponent<({ storageKey, defaultColorScheme }: ColorSchemeScriptProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export {};
|
package/dist/bundle.es.js
CHANGED
|
@@ -5,13 +5,13 @@ import { ImitateScroll as a } from "./bundle.es5.js";
|
|
|
5
5
|
import { Popover as l } from "./bundle.es6.js";
|
|
6
6
|
import { Tooltip as n } from "./bundle.es7.js";
|
|
7
7
|
import { Select as u } from "./bundle.es8.js";
|
|
8
|
-
import { Input as
|
|
9
|
-
import { OptionItem as
|
|
8
|
+
import { Input as T } from "./bundle.es9.js";
|
|
9
|
+
import { OptionItem as D } from "./bundle.es10.js";
|
|
10
10
|
import { NumberInput as P } from "./bundle.es11.js";
|
|
11
|
-
import { OptionsList as
|
|
12
|
-
import { ButtonGroup as
|
|
13
|
-
import { Checkbox as
|
|
14
|
-
import { Switch as
|
|
11
|
+
import { OptionsList as h } from "./bundle.es12.js";
|
|
12
|
+
import { ButtonGroup as v } from "./bundle.es13.js";
|
|
13
|
+
import { Checkbox as B } from "./bundle.es14.js";
|
|
14
|
+
import { Switch as k } from "./bundle.es15.js";
|
|
15
15
|
import { Radio as y, RadioGroup as G } from "./bundle.es16.js";
|
|
16
16
|
import { Drawer as O } from "./bundle.es17.js";
|
|
17
17
|
import { Dialog as F } from "./bundle.es18.js";
|
|
@@ -28,32 +28,33 @@ import { FormGroup as ro } from "./bundle.es28.js";
|
|
|
28
28
|
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
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
31
|
+
import { ThemeProvider as io, useTheme as lo } from "./bundle.es32.js";
|
|
32
|
+
import { useLocalStorage as no } from "./bundle.es33.js";
|
|
33
|
+
import { createAlertAgent as uo } from "./bundle.es34.js";
|
|
34
|
+
import { createToaster as To } from "./bundle.es35.js";
|
|
35
|
+
import { Toast as Do } from "./bundle.es36.js";
|
|
36
|
+
import { DialogShell as Po, createDialogsRegistry as ho } from "./bundle.es37.js";
|
|
37
|
+
import { createPopoversRegistry as vo } from "./bundle.es38.js";
|
|
37
38
|
export {
|
|
38
39
|
j as AlertDialog,
|
|
39
40
|
e as Button,
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
v as ButtonGroup,
|
|
42
|
+
B as Checkbox,
|
|
42
43
|
K as Countdown,
|
|
43
44
|
Z as DateInput,
|
|
44
45
|
X as DatePicker,
|
|
45
46
|
F as Dialog,
|
|
46
|
-
|
|
47
|
+
Po as DialogShell,
|
|
47
48
|
O as Drawer,
|
|
48
49
|
$ as FileOverlay,
|
|
49
50
|
ro as FormGroup,
|
|
50
51
|
mo as Icon,
|
|
51
52
|
a as ImitateScroll,
|
|
52
|
-
|
|
53
|
+
T as Input,
|
|
53
54
|
z as LoadButton,
|
|
54
55
|
P as NumberInput,
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
D as OptionItem,
|
|
57
|
+
h as OptionsList,
|
|
57
58
|
l as Popover,
|
|
58
59
|
fo as ProgressBar,
|
|
59
60
|
y as Radio,
|
|
@@ -62,15 +63,17 @@ export {
|
|
|
62
63
|
u as Select,
|
|
63
64
|
V as SelectTags,
|
|
64
65
|
p as Spinner,
|
|
65
|
-
|
|
66
|
+
k as Switch,
|
|
66
67
|
H as Tabs,
|
|
67
68
|
Q as TextArea,
|
|
69
|
+
io as ThemeProvider,
|
|
68
70
|
to as TimePicker,
|
|
69
|
-
|
|
71
|
+
Do as Toast,
|
|
70
72
|
n as Tooltip,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
uo as createAlertAgent,
|
|
74
|
+
ho as createDialogsRegistry,
|
|
75
|
+
vo as createPopoversRegistry,
|
|
76
|
+
To as createToaster,
|
|
77
|
+
no as useLocalStorage,
|
|
78
|
+
lo as useTheme
|
|
76
79
|
};
|
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.es45.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.es44.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.es45.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
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
|
2
2
|
import f from "classnames";
|
|
3
3
|
import * as o from "@radix-ui/react-dialog";
|
|
4
4
|
import { VisuallyHidden as a } from "@radix-ui/react-visually-hidden";
|
|
5
|
-
import { RemoveListener as v } from "./bundle.
|
|
5
|
+
import { RemoveListener as v } from "./bundle.es46.js";
|
|
6
6
|
const g = (l) => {
|
|
7
7
|
const { size: n = "s", open: r, onOpenChange: s, children: c, onClosed: t, disableEsc: p, className: d } = l, m = (h) => {
|
|
8
8
|
p && h.preventDefault();
|
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.es46.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.es47.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.es48.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.es39.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.es49.js";
|
|
9
|
+
import { f as Q } from "./bundle.es50.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.es51.js";
|
|
6
|
+
import { useDayDisableCheker as N } from "./bundle.es52.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.es53.js";
|
|
9
|
+
import { SelectRightElements as Y } from "./bundle.es54.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.es53.js";
|
|
5
|
+
import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es55.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.es53.js";
|
|
5
|
+
import { SelectRightElements as w } from "./bundle.es54.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.es32.js
CHANGED
|
@@ -1,13 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsxs as h, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useEffect as c, createContext as S, useContext as w } from "react";
|
|
3
|
+
import { getColorScheme as v, updateDOM as i } from "./bundle.es56.js";
|
|
4
|
+
import { ColorSchemeScript as C } from "./bundle.es57.js";
|
|
5
|
+
const a = S({
|
|
6
|
+
setColorScheme: () => {
|
|
7
|
+
}
|
|
8
|
+
}), E = () => w(a), L = (d) => {
|
|
9
|
+
const { defaultColorScheme: o = "system", storageKey: n = "theme", children: l } = d, [r, m] = f(() => v(n, o)), s = (e) => {
|
|
10
|
+
m(e), localStorage.setItem(n, e);
|
|
11
|
+
};
|
|
7
12
|
return c(() => {
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
const e = window ? window.matchMedia("(prefers-color-scheme: dark)") : void 0;
|
|
14
|
+
if (!e)
|
|
15
|
+
return;
|
|
16
|
+
const t = () => {
|
|
17
|
+
r === "system" && i("system");
|
|
18
|
+
};
|
|
19
|
+
return e.addEventListener?.("change", t), t(), () => {
|
|
20
|
+
e.removeEventListener?.("change", t);
|
|
21
|
+
};
|
|
22
|
+
}, [r]), c(() => {
|
|
23
|
+
if (!window)
|
|
24
|
+
return;
|
|
25
|
+
const e = (t) => {
|
|
26
|
+
t.key === n && (t.newValue ? m(t.newValue) : s(o));
|
|
27
|
+
};
|
|
28
|
+
return window.addEventListener("storage", e), () => {
|
|
29
|
+
window.removeEventListener("storage", e);
|
|
30
|
+
};
|
|
31
|
+
}, [s, o]), c(() => {
|
|
32
|
+
i(r);
|
|
33
|
+
}, [r]), /* @__PURE__ */ h(a.Provider, { value: { colorScheme: r, setColorScheme: s }, children: [
|
|
34
|
+
/* @__PURE__ */ u(C, { storageKey: n, defaultColorScheme: o }),
|
|
35
|
+
l
|
|
36
|
+
] });
|
|
10
37
|
};
|
|
11
38
|
export {
|
|
12
|
-
|
|
39
|
+
L as ThemeProvider,
|
|
40
|
+
E as useTheme
|
|
13
41
|
};
|
package/dist/bundle.es33.js
CHANGED
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
return {
|
|
12
|
-
show: (r) => {
|
|
13
|
-
e.emit({ ...r, id: m() });
|
|
14
|
-
},
|
|
15
|
-
Viewport: () => {
|
|
16
|
-
const r = n(null);
|
|
17
|
-
return s(() => {
|
|
18
|
-
e.emit = (o) => {
|
|
19
|
-
r.current && r.current.showAlert(o);
|
|
20
|
-
};
|
|
21
|
-
}, []), /* @__PURE__ */ i(u, { ref: r, ...t });
|
|
22
|
-
}
|
|
23
|
-
};
|
|
1
|
+
import { useState as s, useEffect as c } from "react";
|
|
2
|
+
const l = (e, a) => {
|
|
3
|
+
const [t, o] = s(() => {
|
|
4
|
+
const r = localStorage.getItem(e);
|
|
5
|
+
return r ? JSON.parse(r) : a;
|
|
6
|
+
});
|
|
7
|
+
return c(() => {
|
|
8
|
+
localStorage.setItem(e, JSON.stringify(t));
|
|
9
|
+
}, [t]), [t, o];
|
|
24
10
|
};
|
|
25
11
|
export {
|
|
26
|
-
|
|
12
|
+
l as useLocalStorage
|
|
27
13
|
};
|
package/dist/bundle.es34.js
CHANGED
|
@@ -1,41 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { hash as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
console.error("uninitialized",
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { hash as m } from "@companix/utils-js";
|
|
3
|
+
import { useRef as n, useMemo as s } from "react";
|
|
4
|
+
import { Viewport as u } from "./bundle.es58.js";
|
|
5
|
+
const h = (t = {}) => {
|
|
6
|
+
const e = {
|
|
7
|
+
emit: (r) => {
|
|
8
|
+
console.error("uninitialized", r);
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
return {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const n = e.id ?? r();
|
|
15
|
-
return o.showToast({ ...e, id: n }), n;
|
|
16
|
-
}
|
|
12
|
+
show: (r) => {
|
|
13
|
+
e.emit({ ...r, id: m() });
|
|
17
14
|
},
|
|
18
|
-
Viewport: (
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
Viewport: () => {
|
|
16
|
+
const r = n(null);
|
|
17
|
+
return s(() => {
|
|
18
|
+
e.emit = (o) => {
|
|
19
|
+
r.current && r.current.showAlert(o);
|
|
23
20
|
};
|
|
24
|
-
}, []), /* @__PURE__ */ t
|
|
25
|
-
a,
|
|
26
|
-
{
|
|
27
|
-
ref: n,
|
|
28
|
-
align: e.align ?? i.align,
|
|
29
|
-
closeIcon: e.closeIcon ?? i.closeIcon,
|
|
30
|
-
duration: e.duration ?? i.duration,
|
|
31
|
-
gap: e.gap ?? i.gap,
|
|
32
|
-
side: e.side ?? i.side,
|
|
33
|
-
swipeThreshold: e.swipeThreshold ?? i.swipeThreshold
|
|
34
|
-
}
|
|
35
|
-
);
|
|
21
|
+
}, []), /* @__PURE__ */ i(u, { ref: r, ...t });
|
|
36
22
|
}
|
|
37
23
|
};
|
|
38
24
|
};
|
|
39
25
|
export {
|
|
40
|
-
|
|
26
|
+
h as createAlertAgent
|
|
41
27
|
};
|
package/dist/bundle.es35.js
CHANGED
|
@@ -1,53 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
title: n,
|
|
11
|
-
description: c,
|
|
12
|
-
duration: L,
|
|
13
|
-
closeIcon: h,
|
|
14
|
-
onClosing: v,
|
|
15
|
-
onClosed: N,
|
|
16
|
-
closable: x = !0,
|
|
17
|
-
onInitialized: g
|
|
18
|
-
} = o;
|
|
19
|
-
j(() => {
|
|
20
|
-
f(!0);
|
|
21
|
-
}, []), E(() => {
|
|
22
|
-
s.current && g(s.current);
|
|
23
|
-
}, []);
|
|
24
|
-
const R = (i) => {
|
|
25
|
-
i || v(), u(i);
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { hash as r } from "@companix/utils-js";
|
|
3
|
+
import { Viewport as a } from "./bundle.es59.js";
|
|
4
|
+
import { useRef as c, useMemo as h } from "react";
|
|
5
|
+
const m = (i = {}) => {
|
|
6
|
+
const o = {
|
|
7
|
+
showToast: (e) => {
|
|
8
|
+
console.error("uninitialized", e);
|
|
9
|
+
}
|
|
26
10
|
};
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
11
|
+
return {
|
|
12
|
+
api: {
|
|
13
|
+
show: (e) => {
|
|
14
|
+
const n = e.id ?? r();
|
|
15
|
+
return o.showToast({ ...e, id: n }), n;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
Viewport: (e = {}) => {
|
|
19
|
+
const n = c(null);
|
|
20
|
+
return h(() => {
|
|
21
|
+
o.showToast = (s) => {
|
|
22
|
+
n.current && n.current.showToast(s);
|
|
23
|
+
};
|
|
24
|
+
}, []), /* @__PURE__ */ t(
|
|
25
|
+
a,
|
|
26
|
+
{
|
|
27
|
+
ref: n,
|
|
28
|
+
align: e.align ?? i.align,
|
|
29
|
+
closeIcon: e.closeIcon ?? i.closeIcon,
|
|
30
|
+
duration: e.duration ?? i.duration,
|
|
31
|
+
gap: e.gap ?? i.gap,
|
|
32
|
+
side: e.side ?? i.side,
|
|
33
|
+
swipeThreshold: e.swipeThreshold ?? i.swipeThreshold
|
|
34
|
+
}
|
|
35
|
+
);
|
|
47
36
|
}
|
|
48
|
-
|
|
37
|
+
};
|
|
49
38
|
};
|
|
50
|
-
m.Close = ({ closeIcon: o, className: r } = {}) => /* @__PURE__ */ e(t.Close, { className: r, children: o ?? /* @__PURE__ */ e("svg", { viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2.96967 2.96967C3.26256 2.67678 3.73744 2.67678 4.03033 2.96967L8 6.939L11.9697 2.96967C12.2626 2.67678 12.7374 2.67678 13.0303 2.96967C13.3232 3.26256 13.3232 3.73744 13.0303 4.03033L9.061 8L13.0303 11.9697C13.2966 12.2359 13.3208 12.6526 13.1029 12.9462L13.0303 13.0303C12.7374 13.3232 12.2626 13.3232 11.9697 13.0303L8 9.061L4.03033 13.0303C3.73744 13.3232 3.26256 13.3232 2.96967 13.0303C2.67678 12.7374 2.67678 12.2626 2.96967 11.9697L6.939 8L2.96967 4.03033C2.7034 3.76406 2.6792 3.3474 2.89705 3.05379L2.96967 2.96967Z" }) }) });
|
|
51
39
|
export {
|
|
52
|
-
m as
|
|
40
|
+
m as createToaster
|
|
53
41
|
};
|
package/dist/bundle.es36.js
CHANGED
|
@@ -1,45 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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();
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "@radix-ui/react-toast";
|
|
3
|
+
import { attr as T } from "@companix/utils-browser";
|
|
4
|
+
import { useState as d, useRef as b, useEffect as j, useLayoutEffect as E } from "react";
|
|
5
|
+
import { RemoveListener as I } from "./bundle.es46.js";
|
|
6
|
+
const m = (o) => {
|
|
7
|
+
const [r, u] = d(!0), [p, f] = d(!1), s = b(null), {
|
|
8
|
+
appearance: C = "neutral",
|
|
9
|
+
icon: a,
|
|
10
|
+
title: n,
|
|
11
|
+
description: c,
|
|
12
|
+
duration: L,
|
|
13
|
+
closeIcon: h,
|
|
14
|
+
onClosing: v,
|
|
15
|
+
onClosed: N,
|
|
16
|
+
closable: x = !0,
|
|
17
|
+
onInitialized: g
|
|
18
|
+
} = o;
|
|
19
|
+
j(() => {
|
|
20
|
+
f(!0);
|
|
21
|
+
}, []), E(() => {
|
|
22
|
+
s.current && g(s.current);
|
|
31
23
|
}, []);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
const R = (i) => {
|
|
25
|
+
i || v(), u(i);
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ l(
|
|
28
|
+
t.Root,
|
|
29
|
+
{
|
|
30
|
+
ref: s,
|
|
31
|
+
"data-expanded": !0,
|
|
32
|
+
"data-appearance": C,
|
|
33
|
+
"data-mounted": T(p),
|
|
34
|
+
className: "toaster",
|
|
35
|
+
open: r,
|
|
36
|
+
onOpenChange: R,
|
|
37
|
+
duration: L,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ e(I, { callback: N }),
|
|
40
|
+
a && /* @__PURE__ */ e("div", { className: "toaster-icon", children: a }),
|
|
41
|
+
/* @__PURE__ */ l("div", { className: "toaster-content", children: [
|
|
42
|
+
n && /* @__PURE__ */ e(t.Title, { className: "toaster-title", children: n }),
|
|
43
|
+
c && /* @__PURE__ */ e(t.Description, { className: "toaster-description", children: c })
|
|
44
|
+
] }),
|
|
45
|
+
x && /* @__PURE__ */ e(m.Close, { className: "toaster-close toaster-close-placement", closeIcon: h })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
41
49
|
};
|
|
50
|
+
m.Close = ({ closeIcon: o, className: r } = {}) => /* @__PURE__ */ e(t.Close, { className: r, children: o ?? /* @__PURE__ */ e("svg", { viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2.96967 2.96967C3.26256 2.67678 3.73744 2.67678 4.03033 2.96967L8 6.939L11.9697 2.96967C12.2626 2.67678 12.7374 2.67678 13.0303 2.96967C13.3232 3.26256 13.3232 3.73744 13.0303 4.03033L9.061 8L13.0303 11.9697C13.2966 12.2359 13.3208 12.6526 13.1029 12.9462L13.0303 13.0303C12.7374 13.3232 12.2626 13.3232 11.9697 13.0303L8 9.061L4.03033 13.0303C3.73744 13.3232 3.26256 13.3232 2.96967 13.0303C2.67678 12.7374 2.67678 12.2626 2.96967 11.9697L6.939 8L2.96967 4.03033C2.7034 3.76406 2.6792 3.3474 2.89705 3.05379L2.96967 2.96967Z" }) }) });
|
|
42
51
|
export {
|
|
43
|
-
|
|
44
|
-
$ as createDialogsRegistry
|
|
52
|
+
m as Toast
|
|
45
53
|
};
|