triafly-ui-kit 1.0.24 → 1.0.26
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/README.md +93 -93
- package/dist/{_commonjsHelpers-C6fGbg64.js → _virtual/_commonjsHelpers.js} +1 -1
- package/dist/_virtual/index.js +7 -0
- package/dist/_virtual/index2.js +7 -0
- package/dist/_virtual/index3.js +4 -0
- package/dist/_virtual/papaparse.min.js +7 -0
- package/dist/_virtual/papaparse.min2.js +4 -0
- package/dist/_virtual/react-paginate.js +7 -0
- package/dist/_virtual/react-paginate2.js +4 -0
- package/dist/assets/src/components/Ui/Tooltip/Tooltip.stories.module.css +1 -0
- package/dist/components/Ui/Accordeon/Accordeon.js +11 -10
- package/dist/components/Ui/Alert/Alert.js +9 -8
- package/dist/components/Ui/Avatar/Avatar.js +4 -3
- package/dist/components/Ui/Badge/Badge.js +19 -32
- package/dist/components/Ui/Button/Button.js +16 -15
- package/dist/components/Ui/ButtonsArray/ButtonsArray.js +8 -7
- package/dist/components/Ui/Checkbox/Checkbox.js +17 -16
- package/dist/components/Ui/CliTextareaInput/CliTextareaInput.js +16 -15
- package/dist/components/Ui/CustomLink/CustomLink.js +15 -14
- package/dist/components/Ui/DatePicker/DatePicker.js +16 -8
- package/dist/components/Ui/DatePicker/DatePicker.stories.js +39 -33
- package/dist/components/Ui/DropdownInput/DropdownInput.js +15 -14
- package/dist/components/Ui/DropdownMenu/DropdownMenu.js +4 -3
- package/dist/components/Ui/FileUpload/FileUpload.js +126 -544
- package/dist/components/Ui/Form/FormRoot/FormRoot.js +2 -1
- package/dist/components/Ui/Loader/Loader.js +5 -4
- package/dist/components/Ui/ModalWindow/ModalWindow.js +13 -12
- package/dist/components/Ui/Pagination/Pagination.js +20 -275
- package/dist/components/Ui/Radio/Radio.js +2 -1
- package/dist/components/Ui/SearchInput/SearchInput.js +13 -12
- package/dist/components/Ui/Skeleton/Skeleton.js +16 -18
- package/dist/components/Ui/Switch/Switch.js +10 -9
- package/dist/components/Ui/Table/MemoizedRow/MemoizedRow.js +30 -59
- package/dist/components/Ui/Table/Table.js +5 -4
- package/dist/components/Ui/Tabs/Tabs.js +6 -5
- package/dist/components/Ui/TextInput/TextInput.js +11 -10
- package/dist/components/Ui/TextareaInput/TextareaInput.js +18 -17
- package/dist/components/Ui/Tooltip/Tooltip.js +3 -2
- package/dist/components/Ui/Tooltip/Tooltip.stories.js +9 -14
- package/dist/context/ToastContext/ToastContext.js +22 -24
- package/dist/main.d.ts +0 -14
- package/dist/main.js +147 -149
- package/dist/node_modules/classnames/index.js +42 -0
- package/dist/node_modules/fast-deep-equal/index.js +31 -0
- package/dist/node_modules/papaparse/papaparse.min.js +421 -0
- package/dist/node_modules/react-paginate/dist/react-paginate.js +259 -0
- package/dist/src/components/Ui/Badge/Badge.module.scss.js +30 -0
- package/dist/src/components/Ui/Skeleton/Skeleton.module.scss.js +9 -0
- package/dist/src/components/Ui/Tooltip/Tooltip.stories.module.css.js +15 -0
- package/dist/src/context/ToastContext/ToastContext.module.scss.js +9 -0
- package/dist/styles/_mixins.scss +22 -0
- package/dist/styles/fix.scss +4 -0
- package/dist/styles/main.scss +27 -0
- package/dist/styles/reset.scss +106 -0
- package/dist/styles/typography.scss +102 -0
- package/dist/styles/variables.scss +278 -0
- package/package.json +110 -106
- package/src/styles/_mixins.scss +22 -0
- package/src/styles/fix.scss +4 -0
- package/src/styles/main.scss +27 -0
- package/src/styles/reset.scss +106 -0
- package/src/styles/typography.scss +102 -0
- package/src/styles/variables.scss +273 -0
- package/dist/assets/Tooltip.css +0 -1
- package/dist/components/Ui/DatePicker/index.js +0 -4
- package/dist/index-2QXL0WYc.js +0 -45
- /package/dist/assets/{Accordeon.css → src/components/Ui/Accordeon/Accordeon.css} +0 -0
- /package/dist/assets/{Alert.css → src/components/Ui/Alert/Alert.css} +0 -0
- /package/dist/assets/{Avatar.css → src/components/Ui/Avatar/Avatar.css} +0 -0
- /package/dist/assets/{Badge.css → src/components/Ui/Badge/Badge.module.css} +0 -0
- /package/dist/assets/{Button.css → src/components/Ui/Button/Button.css} +0 -0
- /package/dist/assets/{ButtonsArray.css → src/components/Ui/ButtonsArray/ButtonsArray.css} +0 -0
- /package/dist/assets/{Checkbox.css → src/components/Ui/Checkbox/Checkbox.css} +0 -0
- /package/dist/assets/{CliTextareaInput.css → src/components/Ui/CliTextareaInput/CliTextareaInput.css} +0 -0
- /package/dist/assets/{CustomLink.css → src/components/Ui/CustomLink/CustomLink.css} +0 -0
- /package/dist/assets/{DatePicker.css → src/components/Ui/DatePicker/DatePicker.css} +0 -0
- /package/dist/assets/{DropdownInput.css → src/components/Ui/DropdownInput/DropdownInput.css} +0 -0
- /package/dist/assets/{DropdownMenu.css → src/components/Ui/DropdownMenu/DropdownMenu.css} +0 -0
- /package/dist/assets/{FileUpload.css → src/components/Ui/FileUpload/FileUpload.css} +0 -0
- /package/dist/assets/{FormRoot.css → src/components/Ui/Form/FormRoot/Form.css} +0 -0
- /package/dist/assets/{Loader.css → src/components/Ui/Loader/Loader.css} +0 -0
- /package/dist/assets/{ModalWindow.css → src/components/Ui/ModalWindow/ModalWindow.css} +0 -0
- /package/dist/assets/{Pagination.css → src/components/Ui/Pagination/Pagination.css} +0 -0
- /package/dist/assets/{Radio.css → src/components/Ui/Radio/Radio.css} +0 -0
- /package/dist/assets/{SearchInput.css → src/components/Ui/SearchInput/SearchInput.css} +0 -0
- /package/dist/assets/{Skeleton.css → src/components/Ui/Skeleton/Skeleton.module.css} +0 -0
- /package/dist/assets/{Switch.css → src/components/Ui/Switch/Switch.css} +0 -0
- /package/dist/assets/{Table.css → src/components/Ui/Table/Table.css} +0 -0
- /package/dist/assets/{Tabs.css → src/components/Ui/Tabs/Tabs.css} +0 -0
- /package/dist/assets/{TextInput.css → src/components/Ui/TextInput/TextInput.css} +0 -0
- /package/dist/assets/{TextareaInput.css → src/components/Ui/TextareaInput/TextareaInput.css} +0 -0
- /package/dist/assets/{Tooltip2.css → src/components/Ui/Tooltip/Tooltip.css} +0 -0
- /package/dist/assets/{ToastContext.css → src/context/ToastContext/ToastContext.module.css} +0 -0
@@ -1,79 +1,50 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
|
6
|
-
function y() {
|
7
|
-
return c || (c = 1, p = function r(t, e) {
|
8
|
-
if (t === e) return !0;
|
9
|
-
if (t && e && typeof t == "object" && typeof e == "object") {
|
10
|
-
if (t.constructor !== e.constructor) return !1;
|
11
|
-
var o, n, u;
|
12
|
-
if (Array.isArray(t)) {
|
13
|
-
if (o = t.length, o != e.length) return !1;
|
14
|
-
for (n = o; n-- !== 0; )
|
15
|
-
if (!r(t[n], e[n])) return !1;
|
16
|
-
return !0;
|
17
|
-
}
|
18
|
-
if (t.constructor === RegExp) return t.source === e.source && t.flags === e.flags;
|
19
|
-
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === e.valueOf();
|
20
|
-
if (t.toString !== Object.prototype.toString) return t.toString() === e.toString();
|
21
|
-
if (u = Object.keys(t), o = u.length, o !== Object.keys(e).length) return !1;
|
22
|
-
for (n = o; n-- !== 0; )
|
23
|
-
if (!Object.prototype.hasOwnProperty.call(e, u[n])) return !1;
|
24
|
-
for (n = o; n-- !== 0; ) {
|
25
|
-
var f = u[n];
|
26
|
-
if (!r(t[f], e[f])) return !1;
|
27
|
-
}
|
28
|
-
return !0;
|
29
|
-
}
|
30
|
-
return t !== t && e !== e;
|
31
|
-
}), p;
|
32
|
-
}
|
33
|
-
var O = y();
|
34
|
-
const i = /* @__PURE__ */ g(O), S = b.memo(
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
2
|
+
import c from "react";
|
3
|
+
import m from "../../../../_virtual/index2.js";
|
4
|
+
import d from "../../../../_virtual/index.js";
|
5
|
+
const h = c.memo(
|
35
6
|
({
|
36
|
-
record:
|
37
|
-
columns:
|
38
|
-
rowKey:
|
39
|
-
rowClassName:
|
40
|
-
index:
|
41
|
-
stickyLeft:
|
42
|
-
onClickTr:
|
43
|
-
bordered:
|
7
|
+
record: t,
|
8
|
+
columns: _,
|
9
|
+
rowKey: a,
|
10
|
+
rowClassName: n,
|
11
|
+
index: l,
|
12
|
+
stickyLeft: r,
|
13
|
+
onClickTr: b,
|
14
|
+
bordered: i
|
44
15
|
}) => {
|
45
|
-
const
|
46
|
-
!
|
16
|
+
const s = (e) => {
|
17
|
+
!e.target.closest("[data-no-bubble]") && b && b(t);
|
47
18
|
};
|
48
|
-
return /* @__PURE__ */
|
19
|
+
return /* @__PURE__ */ p(
|
49
20
|
"tr",
|
50
21
|
{
|
51
|
-
className:
|
22
|
+
className: d(
|
52
23
|
"table-component__wrapper__table__tbody__tr",
|
53
|
-
|
24
|
+
n == null ? void 0 : n(t, l),
|
54
25
|
{
|
55
|
-
"table-component__wrapper__table__tbody__tr--hoverable": !!
|
26
|
+
"table-component__wrapper__table__tbody__tr--hoverable": !!b
|
56
27
|
}
|
57
28
|
),
|
58
|
-
onClick:
|
59
|
-
children:
|
29
|
+
onClick: s,
|
30
|
+
children: _.map((e, o) => /* @__PURE__ */ p(
|
60
31
|
"td",
|
61
32
|
{
|
62
|
-
className:
|
63
|
-
"table-component__wrapper__table__tbody__td--bordered":
|
64
|
-
"table-component__wrapper__table__tbody__td--sticky-left":
|
33
|
+
className: d("table-component__wrapper__table__tbody__td", e.className, {
|
34
|
+
"table-component__wrapper__table__tbody__td--bordered": i,
|
35
|
+
"table-component__wrapper__table__tbody__td--sticky-left": r && o === 0
|
65
36
|
}),
|
66
|
-
align:
|
67
|
-
children:
|
37
|
+
align: e.align,
|
38
|
+
children: e.render ? e.render(t[e.dataIndex], t) : String(t[e.dataIndex] ?? "")
|
68
39
|
},
|
69
|
-
`${
|
40
|
+
`${e.key}-${o}`
|
70
41
|
))
|
71
42
|
},
|
72
|
-
typeof
|
43
|
+
typeof a == "function" ? a(t) : String(t[a])
|
73
44
|
);
|
74
45
|
},
|
75
|
-
(
|
46
|
+
(t, _) => m(t.columns, _.columns) && m(t.record, _.record)
|
76
47
|
);
|
77
48
|
export {
|
78
|
-
|
49
|
+
h as MemoizedRow
|
79
50
|
};
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { jsx as t, jsxs as _ } from "react/jsx-runtime";
|
2
2
|
import U, { useState as N, useEffect as q, useCallback as d } from "react";
|
3
|
-
import
|
3
|
+
import o from "../../../_virtual/index.js";
|
4
|
+
import '../../../assets/src/components/Ui/Table/Table.css';/* empty css */
|
4
5
|
import { IconCaretDown as w, IconCaretUp as F } from "../Icons/Icons.js";
|
5
6
|
import { MemoizedRow as G } from "./MemoizedRow/MemoizedRow.js";
|
6
7
|
import { Loader as H } from "../Loader/Loader.js";
|
7
|
-
|
8
|
+
const y = {
|
8
9
|
asc: /* @__PURE__ */ t(w, { viewBox: "0 -6 24 24", "aria-hidden": "true" }),
|
9
10
|
desc: /* @__PURE__ */ t(F, { viewBox: "0 -4 24 24", "aria-hidden": "true" }),
|
10
11
|
default: /* @__PURE__ */ t(w, { viewBox: "0 -6 24 24", "aria-hidden": "true" })
|
@@ -154,7 +155,7 @@ function J({
|
|
154
155
|
}
|
155
156
|
) });
|
156
157
|
}
|
157
|
-
const
|
158
|
+
const K = U.memo(J);
|
158
159
|
export {
|
159
|
-
|
160
|
+
K as Table
|
160
161
|
};
|
@@ -1,15 +1,16 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
2
2
|
import { useState as v } from "react";
|
3
|
-
import '../../../assets/Tabs.css'
|
3
|
+
import '../../../assets/src/components/Ui/Tabs/Tabs.css';/* empty css */
|
4
|
+
const f = ({ items: s, defaultActiveKey: t, onChange: d }) => {
|
4
5
|
var c, b;
|
5
|
-
const [l, i] = v(t || ((c = s[0]) == null ? void 0 : c.key)),
|
6
|
+
const [l, i] = v(t || ((c = s[0]) == null ? void 0 : c.key)), o = (a) => {
|
6
7
|
s.some((r) => r.key === a && !r.disabled) && (i(a), d == null || d(a));
|
7
8
|
};
|
8
|
-
return /* @__PURE__ */
|
9
|
+
return /* @__PURE__ */ n("div", { className: "tabs", children: [
|
9
10
|
/* @__PURE__ */ e("div", { className: "tabs-bar", children: s.map((a) => /* @__PURE__ */ e(
|
10
11
|
"button",
|
11
12
|
{
|
12
|
-
onClick: () => !a.disabled &&
|
13
|
+
onClick: () => !a.disabled && o(a.key),
|
13
14
|
className: `tab-button ${l === a.key ? "active" : ""} ${a.disabled ? "disabled" : ""}`,
|
14
15
|
disabled: a.disabled,
|
15
16
|
children: a.label
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as d, jsx as e, Fragment as b } from "react/jsx-runtime";
|
2
2
|
import { forwardRef as g, useState as A } from "react";
|
3
|
+
import '../../../assets/src/components/Ui/TextInput/TextInput.css';/* empty css */
|
3
4
|
import { IconX as F, IconCheck as R, IconSearch as T, IconLock as X, IconAt as q } from "../Icons/Icons.js";
|
4
5
|
import { Loader as B } from "../Loader/Loader.js";
|
5
|
-
|
6
|
+
const D = g(
|
6
7
|
({
|
7
|
-
label:
|
8
|
+
label: s,
|
8
9
|
placeholder: h = "",
|
9
10
|
value: n,
|
10
11
|
// Значение из пропсов
|
@@ -24,11 +25,11 @@ import '../../../assets/TextInput.css';const D = g(
|
|
24
25
|
onKeyDown: z,
|
25
26
|
onBlur: $
|
26
27
|
}, w) => {
|
27
|
-
const [C, o] = A(""),
|
28
|
-
const V =
|
29
|
-
|
28
|
+
const [C, o] = A(""), t = n !== void 0, u = t ? n : C, j = (m) => {
|
29
|
+
const V = m.target.value;
|
30
|
+
t || o(V), a && a(m);
|
30
31
|
}, L = () => {
|
31
|
-
|
32
|
+
t && a ? a({ target: { value: "" } }) : o("");
|
32
33
|
}, S = () => {
|
33
34
|
switch (c) {
|
34
35
|
case "email":
|
@@ -43,7 +44,7 @@ import '../../../assets/TextInput.css';const D = g(
|
|
43
44
|
return /* @__PURE__ */ e(b, {});
|
44
45
|
}
|
45
46
|
};
|
46
|
-
return /* @__PURE__ */
|
47
|
+
return /* @__PURE__ */ d(
|
47
48
|
"div",
|
48
49
|
{
|
49
50
|
className: `text-input
|
@@ -51,8 +52,8 @@ import '../../../assets/TextInput.css';const D = g(
|
|
51
52
|
${N && "invalid"}
|
52
53
|
${r && "clearable"}`,
|
53
54
|
children: [
|
54
|
-
|
55
|
-
/* @__PURE__ */
|
55
|
+
s && /* @__PURE__ */ e("label", { children: s }),
|
56
|
+
/* @__PURE__ */ d("div", { className: `input-container ${c ? `has-icon icon-${c}` : ""}`, children: [
|
56
57
|
/* @__PURE__ */ e(
|
57
58
|
"input",
|
58
59
|
{
|
@@ -1,12 +1,13 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
2
2
|
import { forwardRef as C, useState as V } from "react";
|
3
|
-
import
|
3
|
+
import '../../../assets/src/components/Ui/TextareaInput/TextareaInput.css';/* empty css */
|
4
|
+
import $ from "../../../_virtual/index.js";
|
4
5
|
import { IconX as b } from "../Icons/Icons.js";
|
5
|
-
|
6
|
+
const g = C(
|
6
7
|
({
|
7
8
|
label: c,
|
8
|
-
name:
|
9
|
-
placeholder:
|
9
|
+
name: p = "TextareaInput",
|
10
|
+
placeholder: f,
|
10
11
|
errorMessage: i,
|
11
12
|
hasError: u = !1,
|
12
13
|
isDisabled: x,
|
@@ -18,15 +19,15 @@ import '../../../assets/TextareaInput.css';const g = C(
|
|
18
19
|
isClearable: d,
|
19
20
|
spellCheck: N = !1
|
20
21
|
}, h) => {
|
21
|
-
const [I, m] = V(""),
|
22
|
-
const
|
23
|
-
(!a ||
|
22
|
+
const [I, m] = V(""), t = o !== void 0, s = t ? o : I, w = (z) => {
|
23
|
+
const r = z.target.value;
|
24
|
+
(!a || r.length <= a) && (t || m(r), l && l(r));
|
24
25
|
}, T = () => {
|
25
|
-
|
26
|
+
t && l ? l("") : m("");
|
26
27
|
}, j = $({
|
27
28
|
"no-resize": !v
|
28
29
|
});
|
29
|
-
return /* @__PURE__ */
|
30
|
+
return /* @__PURE__ */ n(
|
30
31
|
"div",
|
31
32
|
{
|
32
33
|
className: `textarea-input
|
@@ -34,24 +35,24 @@ import '../../../assets/TextareaInput.css';const g = C(
|
|
34
35
|
${d && "clearable"}`,
|
35
36
|
children: [
|
36
37
|
c && /* @__PURE__ */ e("label", { children: c }),
|
37
|
-
/* @__PURE__ */
|
38
|
+
/* @__PURE__ */ n("div", { className: "textarea-wrapper", children: [
|
38
39
|
/* @__PURE__ */ e(
|
39
40
|
"textarea",
|
40
41
|
{
|
41
42
|
ref: h,
|
42
43
|
className: j,
|
43
|
-
value:
|
44
|
+
value: s,
|
44
45
|
onChange: w,
|
45
|
-
name:
|
46
|
-
placeholder:
|
46
|
+
name: p,
|
47
|
+
placeholder: f,
|
47
48
|
disabled: x,
|
48
49
|
spellCheck: N
|
49
50
|
}
|
50
51
|
),
|
51
|
-
d &&
|
52
|
+
d && s && /* @__PURE__ */ e("div", { className: "clear-value", onClick: T, children: /* @__PURE__ */ e(b, { size: 20 }) })
|
52
53
|
] }),
|
53
|
-
a && /* @__PURE__ */
|
54
|
-
|
54
|
+
a && /* @__PURE__ */ n("p", { className: "char-limit", children: [
|
55
|
+
s.length,
|
55
56
|
"/",
|
56
57
|
a
|
57
58
|
] }),
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { jsxs as I, jsx as O } from "react/jsx-runtime";
|
2
2
|
import { useState as g, useRef as C, useCallback as u, useEffect as m } from "react";
|
3
|
-
import '../../../assets/
|
3
|
+
import '../../../assets/src/components/Ui/Tooltip/Tooltip.css';/* empty css */
|
4
|
+
const W = ({
|
4
5
|
content: E,
|
5
6
|
children: y,
|
6
7
|
position: n = "top",
|
@@ -88,5 +89,5 @@ import '../../../assets/Tooltip2.css';const V = ({
|
|
88
89
|
] });
|
89
90
|
};
|
90
91
|
export {
|
91
|
-
|
92
|
+
W as Tooltip
|
92
93
|
};
|
@@ -1,12 +1,7 @@
|
|
1
1
|
import { jsxs as e, jsx as i } from "react/jsx-runtime";
|
2
|
+
import t from "../../../src/components/Ui/Tooltip/Tooltip.stories.module.css.js";
|
2
3
|
import { Tooltip as o } from "./Tooltip.js";
|
3
|
-
|
4
|
-
container: c,
|
5
|
-
trigger: r,
|
6
|
-
clickTrigger: n,
|
7
|
-
positionsContainer: l,
|
8
|
-
positionGroup: s
|
9
|
-
}, d = {
|
4
|
+
const n = {
|
10
5
|
title: "UIKit/Tooltip",
|
11
6
|
component: o,
|
12
7
|
tags: ["autodocs"],
|
@@ -24,7 +19,7 @@ import '../../../assets/Tooltip.css';const c = "_container_193w2_1", r = "_trigg
|
|
24
19
|
options: ["toggle", "show", "hide"]
|
25
20
|
}
|
26
21
|
}
|
27
|
-
},
|
22
|
+
}, s = {
|
28
23
|
render: () => /* @__PURE__ */ e("div", { className: t.container, children: [
|
29
24
|
/* @__PURE__ */ i(o, { content: "Top-left tooltip", className: "white", position: "top", children: /* @__PURE__ */ i("div", { className: t.trigger, children: "Top-left (hover)" }) }),
|
30
25
|
/* @__PURE__ */ i(o, { content: "Top-right tooltip", position: "top", trigger: "click", clickBehavior: "toggle", children: /* @__PURE__ */ i("div", { className: t.clickTrigger, children: "Top-right (click toggle)" }) }),
|
@@ -32,7 +27,7 @@ import '../../../assets/Tooltip.css';const c = "_container_193w2_1", r = "_trigg
|
|
32
27
|
/* @__PURE__ */ i(o, { content: "Bottom-left tooltip", position: "left", trigger: "click", clickBehavior: "show", children: /* @__PURE__ */ i("div", { className: t.clickTrigger, children: "Bottom-left (click show)" }) }),
|
33
28
|
/* @__PURE__ */ i(o, { content: "Bottom-right tooltip", position: "right", trigger: "mixed", clickBehavior: "hide", children: /* @__PURE__ */ i("div", { className: t.mixedTrigger, children: "Bottom-right (hover + click hide)" }) })
|
34
29
|
] })
|
35
|
-
},
|
30
|
+
}, h = {
|
36
31
|
render: () => /* @__PURE__ */ e("div", { className: t.positionsContainer, children: [
|
37
32
|
/* @__PURE__ */ i("h3", { children: "Hover Triggers" }),
|
38
33
|
/* @__PURE__ */ e("div", { className: t.positionGroup, children: [
|
@@ -76,7 +71,7 @@ import '../../../assets/Tooltip.css';const c = "_container_193w2_1", r = "_trigg
|
|
76
71
|
)
|
77
72
|
] })
|
78
73
|
] })
|
79
|
-
},
|
74
|
+
}, g = {
|
80
75
|
args: {
|
81
76
|
content: "Interactive tooltip content",
|
82
77
|
children: /* @__PURE__ */ i("button", { style: { padding: "8px 16px" }, type: "button", children: "Hover or click me" }),
|
@@ -85,8 +80,8 @@ import '../../../assets/Tooltip.css';const c = "_container_193w2_1", r = "_trigg
|
|
85
80
|
}
|
86
81
|
};
|
87
82
|
export {
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
83
|
+
h as AllPositions,
|
84
|
+
s as EdgeCases,
|
85
|
+
g as InteractiveExample,
|
86
|
+
n as default
|
92
87
|
};
|
@@ -1,40 +1,38 @@
|
|
1
1
|
import { jsxs as v, jsx as d } from "react/jsx-runtime";
|
2
|
-
import { createContext as f, useState as h, useCallback as u, useMemo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
const o = w(T);
|
9
|
-
if (!o)
|
2
|
+
import { createContext as f, useState as h, useCallback as u, useMemo as w, useContext as C } from "react";
|
3
|
+
import P from "react-dom";
|
4
|
+
import m from "../../src/context/ToastContext/ToastContext.module.scss.js";
|
5
|
+
const l = f(void 0), y = () => {
|
6
|
+
const e = C(l);
|
7
|
+
if (!e)
|
10
8
|
throw new Error("useToast must be used within a ToastProvider");
|
11
|
-
return
|
12
|
-
},
|
13
|
-
const [
|
14
|
-
|
9
|
+
return e;
|
10
|
+
}, M = ({ children: e }) => {
|
11
|
+
const [T, a] = h([]), p = 3, n = 4e3, c = u((t) => {
|
12
|
+
a((o) => o.filter((s) => s.id !== t));
|
15
13
|
}, []), i = u(
|
16
14
|
(t) => {
|
17
|
-
const
|
15
|
+
const o = {
|
18
16
|
id: Date.now(),
|
19
17
|
message: t,
|
20
18
|
duration: n
|
21
19
|
};
|
22
|
-
|
23
|
-
const
|
24
|
-
return
|
25
|
-
}), setTimeout(() => c(
|
20
|
+
a((s) => {
|
21
|
+
const r = [...s, o];
|
22
|
+
return r.length > p ? r.slice(1) : r;
|
23
|
+
}), setTimeout(() => c(o.id), n);
|
26
24
|
},
|
27
25
|
[c]
|
28
|
-
), x =
|
29
|
-
return /* @__PURE__ */ v(
|
30
|
-
|
31
|
-
|
32
|
-
/* @__PURE__ */ d("div", { className: m.Wrapper, children:
|
26
|
+
), x = w(() => ({ addToast: i }), [i]);
|
27
|
+
return /* @__PURE__ */ v(l.Provider, { value: x, children: [
|
28
|
+
e,
|
29
|
+
P.createPortal(
|
30
|
+
/* @__PURE__ */ d("div", { className: m.Wrapper, children: T.map((t) => /* @__PURE__ */ d("div", { className: m.Toast, children: t.message }, t.id)) }),
|
33
31
|
document.body
|
34
32
|
)
|
35
33
|
] });
|
36
34
|
};
|
37
35
|
export {
|
38
|
-
|
39
|
-
|
36
|
+
M as ToastProvider,
|
37
|
+
y as useToast
|
40
38
|
};
|
package/dist/main.d.ts
CHANGED
@@ -132,20 +132,6 @@ export declare type Column<T extends object = Record<string, unknown>> = {
|
|
132
132
|
|
133
133
|
export declare const CustomLink: default_2.FC<LinkProps>;
|
134
134
|
|
135
|
-
export declare const DatePicker: default_2.FC<DatePickerProps>;
|
136
|
-
|
137
|
-
declare interface DatePickerProps {
|
138
|
-
name?: string;
|
139
|
-
value?: Date | null;
|
140
|
-
onChange?: (date: Date | null) => void;
|
141
|
-
placeholder?: string;
|
142
|
-
className?: string;
|
143
|
-
inputClassName?: string;
|
144
|
-
calendarClassName?: string;
|
145
|
-
minDate?: Date;
|
146
|
-
maxDate?: Date;
|
147
|
-
}
|
148
|
-
|
149
135
|
export declare const DropdownInput: default_2.FC<DropdownInputProps>;
|
150
136
|
|
151
137
|
declare type DropdownInputProps = {
|