@companix/uikit 0.0.20 → 0.0.22
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.es11.js +13 -13
- package/dist/bundle.es38.js +1 -1
- package/dist/bundle.es40.js +1 -1
- package/dist/bundle.es46.js +2 -2
- package/dist/bundle.es52.js +1 -1
- package/dist/bundle.es53.js +14 -20
- package/dist/bundle.es54.js +20 -2
- package/dist/bundle.es55.js +2 -43
- package/dist/bundle.es61.js +75 -13
- package/dist/bundle.es62.js +45 -72
- package/dist/bundle.es63.js +41 -47
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/bundle.es11.js
CHANGED
|
@@ -8,17 +8,17 @@ const D = j(
|
|
|
8
8
|
({
|
|
9
9
|
onChange: m,
|
|
10
10
|
onValueChange: o,
|
|
11
|
-
readOnly:
|
|
12
|
-
inputClassName:
|
|
11
|
+
readOnly: f,
|
|
12
|
+
inputClassName: i,
|
|
13
13
|
value: n,
|
|
14
14
|
placeholder: u,
|
|
15
|
-
thousandSeparator:
|
|
16
|
-
decimalSeparator:
|
|
15
|
+
thousandSeparator: a,
|
|
16
|
+
decimalSeparator: p,
|
|
17
17
|
allowedDecimalSeparators: l,
|
|
18
|
-
thousandsGroupStyle:
|
|
19
|
-
decimalScale:
|
|
18
|
+
thousandsGroupStyle: s,
|
|
19
|
+
decimalScale: d,
|
|
20
20
|
fixedDecimalScale: b,
|
|
21
|
-
allowNegative: R,
|
|
21
|
+
allowNegative: R = !1,
|
|
22
22
|
allowLeadingZeros: c,
|
|
23
23
|
suffix: g,
|
|
24
24
|
prefix: x,
|
|
@@ -31,19 +31,19 @@ const D = j(
|
|
|
31
31
|
{
|
|
32
32
|
type: "text",
|
|
33
33
|
getInputRef: y([r, I]),
|
|
34
|
-
className: C("form-input form-input-base",
|
|
34
|
+
className: C("form-input form-input-base", i),
|
|
35
35
|
"aria-disabled": e.disabled,
|
|
36
36
|
onChange: m,
|
|
37
37
|
onValueChange: ({ floatValue: h }) => o?.(h ?? null),
|
|
38
38
|
value: n,
|
|
39
39
|
placeholder: u,
|
|
40
40
|
disabled: e.disabled,
|
|
41
|
-
readOnly:
|
|
42
|
-
thousandSeparator:
|
|
43
|
-
decimalSeparator:
|
|
41
|
+
readOnly: f,
|
|
42
|
+
thousandSeparator: a,
|
|
43
|
+
decimalSeparator: p,
|
|
44
44
|
allowedDecimalSeparators: l,
|
|
45
|
-
thousandsGroupStyle:
|
|
46
|
-
decimalScale:
|
|
45
|
+
thousandsGroupStyle: s,
|
|
46
|
+
decimalScale: d,
|
|
47
47
|
fixedDecimalScale: b,
|
|
48
48
|
allowNegative: R,
|
|
49
49
|
allowLeadingZeros: c,
|
package/dist/bundle.es38.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as b, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import h from "classnames";
|
|
3
3
|
import { attr as e } from "@companix/utils-browser";
|
|
4
4
|
import { forwardRef as x } from "react";
|
|
5
|
-
import { useInputPadding as N } from "./bundle.
|
|
5
|
+
import { useInputPadding as N } from "./bundle.es53.js";
|
|
6
6
|
const v = x(
|
|
7
7
|
({
|
|
8
8
|
required: s,
|
package/dist/bundle.es40.js
CHANGED
package/dist/bundle.es46.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as D, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { dateToFormat as $, weeks as g, createVoids as p, getDayIndex as b, getFirstDay as u, getMonthMaxDay as k } from "./bundle.es48.js";
|
|
3
|
-
import { CalendarHeader as F } from "./bundle.
|
|
4
|
-
import { useCalendar as j } from "./bundle.
|
|
3
|
+
import { CalendarHeader as F } from "./bundle.es61.js";
|
|
4
|
+
import { useCalendar as j } from "./bundle.es62.js";
|
|
5
5
|
import { attr as m } from "@companix/utils-browser";
|
|
6
6
|
import { isSameDate as f } from "./bundle.es47.js";
|
|
7
7
|
import { useLayoutEffect as I } from "react";
|
package/dist/bundle.es52.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as T, jsx as $ } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as b, useState as I, useMemo as P, useImperativeHandle as R, useCallback as j, createElement as k } from "react";
|
|
3
3
|
import * as c from "@radix-ui/react-toast";
|
|
4
4
|
import { varToStyle as w } from "@companix/utils-browser";
|
|
5
|
-
import { Toast as C } from "./bundle.
|
|
5
|
+
import { Toast as C } from "./bundle.es63.js";
|
|
6
6
|
var g = /* @__PURE__ */ ((e) => (e["top-center"] = "up", e["top-left"] = "left", e["top-right"] = "right", e["bottom-center"] = "down", e["bottom-left"] = "left", e["bottom-right"] = "right", e))(g || {});
|
|
7
7
|
const M = b((e, h) => {
|
|
8
8
|
const { side: f = "top", align: i = "center", gap: m = 14, duration: u, swipeThreshold: v, closeIcon: x } = e, [l, p] = I([]), o = P(() => ({}), []);
|
package/dist/bundle.es53.js
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
h,
|
|
15
|
-
u
|
|
16
|
-
]
|
|
17
|
-
}, a.faCheck = a.definition, a.prefix = c, a.iconName = n, a.width = r, a.height = f, a.ligatures = i, a.unicode = h, a.svgPathData = u, a.aliases = i;
|
|
18
|
-
})(e), e);
|
|
19
|
-
}
|
|
1
|
+
import { useRef as l, useCallback as p } from "react";
|
|
2
|
+
import { useEffectWithLayout as d } from "./bundle.es65.js";
|
|
3
|
+
const g = (r, f) => {
|
|
4
|
+
const c = l(null), i = l(null), o = { Right: c, Left: i }, u = p((t) => {
|
|
5
|
+
if (r.current) {
|
|
6
|
+
const n = r.current.style, e = o[t];
|
|
7
|
+
e.current && e.current.clientWidth ? n[`padding${t}`] !== `${e.current.clientWidth}px` && (n[`padding${t}`] = `${e.current.clientWidth}px`) : n[`padding${t}`] && (n[`padding${t}`] = "");
|
|
8
|
+
}
|
|
9
|
+
}, []);
|
|
10
|
+
return d(() => {
|
|
11
|
+
u("Left"), u("Right");
|
|
12
|
+
}, f), { rightRef: c, leftRef: i };
|
|
13
|
+
};
|
|
20
14
|
export {
|
|
21
|
-
|
|
15
|
+
g as useInputPadding
|
|
22
16
|
};
|
package/dist/bundle.es54.js
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import { __exports as e } from "./bundle.es55.js";
|
|
2
|
+
var v;
|
|
3
|
+
function d() {
|
|
4
|
+
return v ? e : (v = 1, (function(a) {
|
|
5
|
+
Object.defineProperty(a, "__esModule", { value: !0 });
|
|
6
|
+
var c = "fas", n = "check", r = 448, f = 512, i = [10003, 10004], h = "f00c", u = "M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z";
|
|
7
|
+
a.definition = {
|
|
8
|
+
prefix: c,
|
|
9
|
+
iconName: n,
|
|
10
|
+
icon: [
|
|
11
|
+
r,
|
|
12
|
+
f,
|
|
13
|
+
i,
|
|
14
|
+
h,
|
|
15
|
+
u
|
|
16
|
+
]
|
|
17
|
+
}, a.faCheck = a.definition, a.prefix = c, a.iconName = n, a.width = r, a.height = f, a.ligatures = i, a.unicode = h, a.svgPathData = u, a.aliases = i;
|
|
18
|
+
})(e), e);
|
|
19
|
+
}
|
|
2
20
|
export {
|
|
3
|
-
|
|
21
|
+
d as __require
|
|
4
22
|
};
|
package/dist/bundle.es55.js
CHANGED
|
@@ -1,45 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import * as t from "@radix-ui/react-toast";
|
|
3
|
-
import { attr as C } from "@companix/utils-browser";
|
|
4
|
-
import { useState as h, useRef as v, useEffect as N, useLayoutEffect as x } from "react";
|
|
5
|
-
import { RemoveListener as R } from "./bundle.es41.js";
|
|
6
|
-
const E = (i) => {
|
|
7
|
-
const [c, l] = h(!1), o = v(null), {
|
|
8
|
-
appearance: d = "neutral",
|
|
9
|
-
icon: r,
|
|
10
|
-
title: a,
|
|
11
|
-
description: s,
|
|
12
|
-
duration: m,
|
|
13
|
-
closeIcon: u,
|
|
14
|
-
onRemoving: p,
|
|
15
|
-
onRemoved: f,
|
|
16
|
-
onInitialized: L
|
|
17
|
-
} = i;
|
|
18
|
-
return N(() => {
|
|
19
|
-
l(!0);
|
|
20
|
-
}, []), x(() => {
|
|
21
|
-
o.current && L(o.current);
|
|
22
|
-
}, []), /* @__PURE__ */ n(
|
|
23
|
-
t.Root,
|
|
24
|
-
{
|
|
25
|
-
ref: o,
|
|
26
|
-
"data-expanded": !0,
|
|
27
|
-
"data-appearance": d,
|
|
28
|
-
"data-mounted": C(c),
|
|
29
|
-
className: "toaster",
|
|
30
|
-
duration: m,
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ e(R, { callback: f }),
|
|
33
|
-
r && /* @__PURE__ */ e("div", { className: "toaster-icon", children: r }),
|
|
34
|
-
/* @__PURE__ */ n("div", { className: "toaster-content", children: [
|
|
35
|
-
a && /* @__PURE__ */ e(t.Title, { className: "toaster-title", children: a }),
|
|
36
|
-
s && /* @__PURE__ */ e(t.Description, { className: "toaster-description", children: s })
|
|
37
|
-
] }),
|
|
38
|
-
/* @__PURE__ */ e(t.Close, { className: "toaster-close", onClick: p, children: u ?? /* @__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" }) }) })
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
};
|
|
1
|
+
var a = {};
|
|
43
2
|
export {
|
|
44
|
-
|
|
3
|
+
a as __exports
|
|
45
4
|
};
|
package/dist/bundle.es61.js
CHANGED
|
@@ -1,16 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as h, useMemo as d } from "react";
|
|
3
|
+
import { Select as p } from "./bundle.es8.js";
|
|
4
|
+
import { getMonths as Y, getYears as k, DEFAULT_MAX_YEAR as u, DEFAULT_MIN_YEAR as g } from "./bundle.es48.js";
|
|
5
|
+
import { Icon as C } from "./bundle.es39.js";
|
|
6
|
+
import { f as z } from "./bundle.es66.js";
|
|
7
|
+
import { f as L } from "./bundle.es67.js";
|
|
8
|
+
import { setMonth as R, setYear as T } from "./bundle.es47.js";
|
|
9
|
+
const S = ({
|
|
10
|
+
viewDate: n,
|
|
11
|
+
onChange: m,
|
|
12
|
+
isMonthDisabled: a,
|
|
13
|
+
isYearDisabled: c,
|
|
14
|
+
onNextMonth: v,
|
|
15
|
+
onPrevMonth: x
|
|
16
|
+
}) => {
|
|
17
|
+
const r = n.getFullYear(), e = n.getMonth(), i = "ru", N = h(
|
|
18
|
+
(t) => {
|
|
19
|
+
m(R(n, t));
|
|
20
|
+
},
|
|
21
|
+
[m, n]
|
|
22
|
+
), E = h(
|
|
23
|
+
(t) => {
|
|
24
|
+
m(T(n, t));
|
|
25
|
+
},
|
|
26
|
+
[m, n]
|
|
27
|
+
), M = d(() => Y(i).map((t) => ({
|
|
28
|
+
...t,
|
|
29
|
+
className: "capitalize",
|
|
30
|
+
disabled: a && a(t.value)
|
|
31
|
+
})), [i, a]), A = d(() => k(r, 100).map((t) => ({
|
|
32
|
+
...t,
|
|
33
|
+
disabled: c && c(t.value)
|
|
34
|
+
})), [r, c]);
|
|
35
|
+
let l = e === 11 && r === u;
|
|
36
|
+
a && !l && (l = a(
|
|
37
|
+
e === 11 ? 0 : e + 1,
|
|
38
|
+
e === 11 ? Math.min(r + 1, u) : r
|
|
39
|
+
));
|
|
40
|
+
let s = e === 0 && r === g;
|
|
41
|
+
return a && !s && (s = a(
|
|
42
|
+
e === 0 ? 11 : e - 1,
|
|
43
|
+
e === 0 ? Math.max(r - 1, g) : r
|
|
44
|
+
)), /* @__PURE__ */ f("div", { className: "calendar-header", children: [
|
|
45
|
+
!s && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: x, children: /* @__PURE__ */ o(C, { icon: L.faChevronLeft }) }),
|
|
46
|
+
/* @__PURE__ */ f("div", { className: "calendar-pickers", children: [
|
|
47
|
+
/* @__PURE__ */ o(
|
|
48
|
+
p,
|
|
49
|
+
{
|
|
50
|
+
fill: !0,
|
|
51
|
+
options: A,
|
|
52
|
+
size: "sm",
|
|
53
|
+
value: r,
|
|
54
|
+
minimalOptions: !0,
|
|
55
|
+
matchTarget: "min-width",
|
|
56
|
+
onChange: (t) => E(t)
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ o(
|
|
60
|
+
p,
|
|
61
|
+
{
|
|
62
|
+
fill: !0,
|
|
63
|
+
options: M,
|
|
64
|
+
size: "sm",
|
|
65
|
+
className: "capitalize",
|
|
66
|
+
value: e,
|
|
67
|
+
minimalOptions: !0,
|
|
68
|
+
matchTarget: "min-width",
|
|
69
|
+
onChange: (t) => N(t)
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] }),
|
|
73
|
+
!l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: v, children: /* @__PURE__ */ o(C, { icon: z.faChevronRight }) })
|
|
74
|
+
] });
|
|
13
75
|
};
|
|
14
76
|
export {
|
|
15
|
-
|
|
77
|
+
S as CalendarHeader
|
|
16
78
|
};
|
package/dist/bundle.es62.js
CHANGED
|
@@ -1,78 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onChange: m,
|
|
12
|
-
isMonthDisabled: a,
|
|
13
|
-
isYearDisabled: c,
|
|
14
|
-
onNextMonth: v,
|
|
15
|
-
onPrevMonth: x
|
|
1
|
+
import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es47.js";
|
|
2
|
+
import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es48.js";
|
|
3
|
+
import { useState as U, useCallback as M } from "react";
|
|
4
|
+
const X = ({
|
|
5
|
+
value: p,
|
|
6
|
+
disablePast: r,
|
|
7
|
+
disableFuture: c,
|
|
8
|
+
shouldDisableDate: E,
|
|
9
|
+
minDateTime: l,
|
|
10
|
+
maxDateTime: s
|
|
16
11
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
(
|
|
19
|
-
|
|
12
|
+
const [e, u] = U(p || /* @__PURE__ */ new Date()), _ = M(() => {
|
|
13
|
+
u(L(e));
|
|
14
|
+
}, [e]), C = M(() => {
|
|
15
|
+
u(N(e, 1));
|
|
16
|
+
}, [e]), D = R({
|
|
17
|
+
disableFuture: c,
|
|
18
|
+
disablePast: r,
|
|
19
|
+
shouldDisableDate: E,
|
|
20
|
+
minDateTime: l,
|
|
21
|
+
maxDateTime: s
|
|
22
|
+
}), k = M(
|
|
23
|
+
(o, t) => {
|
|
24
|
+
const n = /* @__PURE__ */ new Date();
|
|
25
|
+
t = t || e.getFullYear();
|
|
26
|
+
const h = l ? l.getMonth() : 0, Y = s ? s.getMonth() : 11, F = l?.getFullYear() || w, f = s?.getFullYear() || A;
|
|
27
|
+
let g = t >= F && t <= f ? t === F && h > o || t === f && o > Y : !0;
|
|
28
|
+
return c && (g = g || (t === n.getFullYear() ? o > n.getMonth() : t > n.getFullYear())), r && (g = g || (t === n.getFullYear() ? o < n.getMonth() : t < n.getFullYear())), g;
|
|
20
29
|
},
|
|
21
|
-
[
|
|
22
|
-
),
|
|
23
|
-
(
|
|
24
|
-
|
|
30
|
+
[c, r, e, l, s]
|
|
31
|
+
), v = M(
|
|
32
|
+
(o) => {
|
|
33
|
+
const t = /* @__PURE__ */ new Date(), n = l?.getFullYear() || w, h = s?.getFullYear() || A;
|
|
34
|
+
let Y = n > o || o > h;
|
|
35
|
+
return c && (Y = Y || o > t.getFullYear()), r && (Y = Y || o < t.getFullYear()), Y;
|
|
25
36
|
},
|
|
26
|
-
[
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
e === 11 ? 0 : e + 1,
|
|
38
|
-
e === 11 ? Math.min(r + 1, u) : r
|
|
39
|
-
));
|
|
40
|
-
let s = e === 0 && r === g;
|
|
41
|
-
return a && !s && (s = a(
|
|
42
|
-
e === 0 ? 11 : e - 1,
|
|
43
|
-
e === 0 ? Math.max(r - 1, g) : r
|
|
44
|
-
)), /* @__PURE__ */ f("div", { className: "calendar-header", children: [
|
|
45
|
-
!s && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: x, children: /* @__PURE__ */ o(C, { icon: L.faChevronLeft }) }),
|
|
46
|
-
/* @__PURE__ */ f("div", { className: "calendar-pickers", children: [
|
|
47
|
-
/* @__PURE__ */ o(
|
|
48
|
-
p,
|
|
49
|
-
{
|
|
50
|
-
fill: !0,
|
|
51
|
-
options: A,
|
|
52
|
-
size: "sm",
|
|
53
|
-
value: r,
|
|
54
|
-
minimalOptions: !0,
|
|
55
|
-
matchTarget: "min-width",
|
|
56
|
-
onChange: (t) => E(t)
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
/* @__PURE__ */ o(
|
|
60
|
-
p,
|
|
61
|
-
{
|
|
62
|
-
fill: !0,
|
|
63
|
-
options: M,
|
|
64
|
-
size: "sm",
|
|
65
|
-
className: "capitalize",
|
|
66
|
-
value: e,
|
|
67
|
-
minimalOptions: !0,
|
|
68
|
-
matchTarget: "min-width",
|
|
69
|
-
onChange: (t) => N(t)
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
] }),
|
|
73
|
-
!l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: v, children: /* @__PURE__ */ o(C, { icon: z.faChevronRight }) })
|
|
74
|
-
] });
|
|
37
|
+
[c, r, l, s]
|
|
38
|
+
);
|
|
39
|
+
return {
|
|
40
|
+
viewDate: e,
|
|
41
|
+
setViewDate: u,
|
|
42
|
+
setPrevMonth: _,
|
|
43
|
+
setNextMonth: C,
|
|
44
|
+
isDayDisabled: D,
|
|
45
|
+
isMonthDisabled: k,
|
|
46
|
+
isYearDisabled: v
|
|
47
|
+
};
|
|
75
48
|
};
|
|
76
49
|
export {
|
|
77
|
-
|
|
50
|
+
X as useCalendar
|
|
78
51
|
};
|
package/dist/bundle.es63.js
CHANGED
|
@@ -1,51 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
u
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "@radix-ui/react-toast";
|
|
3
|
+
import { attr as C } from "@companix/utils-browser";
|
|
4
|
+
import { useState as h, useRef as v, useEffect as N, useLayoutEffect as x } from "react";
|
|
5
|
+
import { RemoveListener as R } from "./bundle.es41.js";
|
|
6
|
+
const E = (i) => {
|
|
7
|
+
const [c, l] = h(!1), o = v(null), {
|
|
8
|
+
appearance: d = "neutral",
|
|
9
|
+
icon: r,
|
|
10
|
+
title: a,
|
|
11
|
+
description: s,
|
|
12
|
+
duration: m,
|
|
13
|
+
closeIcon: u,
|
|
14
|
+
onRemoving: p,
|
|
15
|
+
onRemoved: f,
|
|
16
|
+
onInitialized: L
|
|
17
|
+
} = i;
|
|
18
|
+
return N(() => {
|
|
19
|
+
l(!0);
|
|
20
|
+
}, []), x(() => {
|
|
21
|
+
o.current && L(o.current);
|
|
22
|
+
}, []), /* @__PURE__ */ n(
|
|
23
|
+
t.Root,
|
|
24
|
+
{
|
|
25
|
+
ref: o,
|
|
26
|
+
"data-expanded": !0,
|
|
27
|
+
"data-appearance": d,
|
|
28
|
+
"data-mounted": C(c),
|
|
29
|
+
className: "toaster",
|
|
30
|
+
duration: m,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ e(R, { callback: f }),
|
|
33
|
+
r && /* @__PURE__ */ e("div", { className: "toaster-icon", children: r }),
|
|
34
|
+
/* @__PURE__ */ n("div", { className: "toaster-content", children: [
|
|
35
|
+
a && /* @__PURE__ */ e(t.Title, { className: "toaster-title", children: a }),
|
|
36
|
+
s && /* @__PURE__ */ e(t.Description, { className: "toaster-description", children: s })
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ e(t.Close, { className: "toaster-close", onClick: p, children: u ?? /* @__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" }) }) })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
38
41
|
);
|
|
39
|
-
return {
|
|
40
|
-
viewDate: e,
|
|
41
|
-
setViewDate: u,
|
|
42
|
-
setPrevMonth: _,
|
|
43
|
-
setNextMonth: C,
|
|
44
|
-
isDayDisabled: D,
|
|
45
|
-
isMonthDisabled: k,
|
|
46
|
-
isYearDisabled: v
|
|
47
|
-
};
|
|
48
42
|
};
|
|
49
43
|
export {
|
|
50
|
-
|
|
44
|
+
E as Toast
|
|
51
45
|
};
|
package/dist/index.d.ts
CHANGED