triafly-ui-kit 1.0.22 → 1.0.23

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.
Files changed (153) hide show
  1. package/README.md +93 -93
  2. package/package.json +106 -106
  3. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  4. package/dist/assets/Accordeon.css +0 -1
  5. package/dist/assets/Alert.css +0 -1
  6. package/dist/assets/Avatar.css +0 -1
  7. package/dist/assets/Badge.css +0 -1
  8. package/dist/assets/Button.css +0 -1
  9. package/dist/assets/ButtonsArray.css +0 -1
  10. package/dist/assets/Checkbox.css +0 -1
  11. package/dist/assets/CliTextareaInput.css +0 -1
  12. package/dist/assets/CustomLink.css +0 -1
  13. package/dist/assets/DropdownInput.css +0 -1
  14. package/dist/assets/DropdownMenu.css +0 -1
  15. package/dist/assets/FileUpload.css +0 -1
  16. package/dist/assets/FormRoot.css +0 -1
  17. package/dist/assets/Loader.css +0 -1
  18. package/dist/assets/ModalWindow.css +0 -1
  19. package/dist/assets/Pagination.css +0 -1
  20. package/dist/assets/Radio.css +0 -1
  21. package/dist/assets/SearchInput.css +0 -1
  22. package/dist/assets/Skeleton.css +0 -1
  23. package/dist/assets/Switch.css +0 -1
  24. package/dist/assets/Table.css +0 -1
  25. package/dist/assets/Tabs.css +0 -1
  26. package/dist/assets/TextInput.css +0 -1
  27. package/dist/assets/TextareaInput.css +0 -1
  28. package/dist/assets/ToastContext.css +0 -1
  29. package/dist/assets/Tooltip.css +0 -1
  30. package/dist/assets/Tooltip2.css +0 -1
  31. package/dist/assets/fonts/FiraCode-Regular.ttf +0 -0
  32. package/dist/assets/fonts/Manrope-Bold.ttf +0 -0
  33. package/dist/assets/fonts/Manrope-Regular.ttf +0 -0
  34. package/dist/assets/fonts/Manrope-SemiBold.ttf +0 -0
  35. package/dist/assets/fonts/RobotoSlab-SemiBold.ttf +0 -0
  36. package/dist/components/Ui/Accordeon/Accordeon.js +0 -33
  37. package/dist/components/Ui/Accordeon/Accordeon.stories.js +0 -72
  38. package/dist/components/Ui/Accordeon/index.js +0 -4
  39. package/dist/components/Ui/Alert/Alert.js +0 -14
  40. package/dist/components/Ui/Alert/index.js +0 -4
  41. package/dist/components/Ui/Avatar/Avatar.js +0 -10
  42. package/dist/components/Ui/Avatar/index.js +0 -4
  43. package/dist/components/Ui/Badge/Badge.js +0 -43
  44. package/dist/components/Ui/Badge/index.js +0 -4
  45. package/dist/components/Ui/Button/Button.js +0 -49
  46. package/dist/components/Ui/Button/index.js +0 -4
  47. package/dist/components/Ui/ButtonsArray/ButtonsArray.js +0 -28
  48. package/dist/components/Ui/ButtonsArray/ButtonsArray.stories.js +0 -78
  49. package/dist/components/Ui/ButtonsArray/index.js +0 -4
  50. package/dist/components/Ui/Checkbox/Checkbox.js +0 -39
  51. package/dist/components/Ui/Checkbox/Checkbox.stories.js +0 -120
  52. package/dist/components/Ui/Checkbox/index.js +0 -4
  53. package/dist/components/Ui/CliTextareaInput/CliTextareaInput.js +0 -121
  54. package/dist/components/Ui/CliTextareaInput/index.js +0 -23
  55. package/dist/components/Ui/CliTextareaInput/utils/escapeHtml/escapeHtml.js +0 -4
  56. package/dist/components/Ui/CliTextareaInput/utils/fixJson/fixJson.js +0 -12
  57. package/dist/components/Ui/CliTextareaInput/utils/highlightSyntax/highlightSyntax.js +0 -20
  58. package/dist/components/Ui/CliTextareaInput/utils/highlightSyntax/index.js +0 -4
  59. package/dist/components/Ui/CliTextareaInput/utils/hooks/index.js +0 -17
  60. package/dist/components/Ui/CliTextareaInput/utils/hooks/useFixFormat/index.js +0 -4
  61. package/dist/components/Ui/CliTextareaInput/utils/hooks/useFixFormat/useFixFormat.js +0 -29
  62. package/dist/components/Ui/CliTextareaInput/utils/hooks/useHistoryNavigation/index.js +0 -4
  63. package/dist/components/Ui/CliTextareaInput/utils/hooks/useHistoryNavigation/useHistoryNavigation.js +0 -34
  64. package/dist/components/Ui/CliTextareaInput/utils/hooks/useKeyHandlers/index.js +0 -4
  65. package/dist/components/Ui/CliTextareaInput/utils/hooks/useKeyHandlers/useKeyHandlers.js +0 -45
  66. package/dist/components/Ui/CliTextareaInput/utils/hooks/useLineNumbers/index.js +0 -5
  67. package/dist/components/Ui/CliTextareaInput/utils/hooks/useLineNumbers/useLineNumbers.js +0 -17
  68. package/dist/components/Ui/CliTextareaInput/utils/hooks/useScrollSync/index.js +0 -4
  69. package/dist/components/Ui/CliTextareaInput/utils/hooks/useScrollSync/useScrollSync.js +0 -13
  70. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextActions/index.js +0 -4
  71. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextActions/useTextActions.js +0 -37
  72. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextCoursore/index.js +0 -4
  73. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextCoursore/useTextCoursore.js +0 -14
  74. package/dist/components/Ui/CliTextareaInput/utils/index.js +0 -21
  75. package/dist/components/Ui/CliTextareaInput/utils/processJson/index.js +0 -4
  76. package/dist/components/Ui/CliTextareaInput/utils/processJson/processJson.js +0 -11
  77. package/dist/components/Ui/CliTextareaInput/utils/processXml/processXml.js +0 -8
  78. package/dist/components/Ui/CliTextareaInput/utils/processYml/processYml.js +0 -27
  79. package/dist/components/Ui/CliTextareaInput/utils/types.js +0 -1
  80. package/dist/components/Ui/CustomLink/CustomLink.js +0 -49
  81. package/dist/components/Ui/CustomLink/index.js +0 -4
  82. package/dist/components/Ui/DropdownInput/DropdownInput.js +0 -91
  83. package/dist/components/Ui/DropdownInput/DropdownInput.stories.js +0 -77
  84. package/dist/components/Ui/DropdownInput/index.js +0 -4
  85. package/dist/components/Ui/DropdownMenu/DropdownMenu.js +0 -83
  86. package/dist/components/Ui/DropdownMenu/DropdownMenu.stories.js +0 -50
  87. package/dist/components/Ui/DropdownMenu/index.js +0 -4
  88. package/dist/components/Ui/FileUpload/FileUpload.js +0 -615
  89. package/dist/components/Ui/FileUpload/fn.js +0 -10
  90. package/dist/components/Ui/FileUpload/index.js +0 -4
  91. package/dist/components/Ui/FileUpload/types.js +0 -1
  92. package/dist/components/Ui/Form/FormContext/FormContext.js +0 -5
  93. package/dist/components/Ui/Form/FormItem/FormItem.js +0 -107
  94. package/dist/components/Ui/Form/FormItem/fn.js +0 -25
  95. package/dist/components/Ui/Form/FormItem/types.js +0 -1
  96. package/dist/components/Ui/Form/FormRoot/FormRoot.js +0 -25
  97. package/dist/components/Ui/Form/FormRoot/index.js +0 -4
  98. package/dist/components/Ui/Form/FormRoot/types.js +0 -1
  99. package/dist/components/Ui/Form/index.js +0 -6
  100. package/dist/components/Ui/Form/useForm/index.js +0 -4
  101. package/dist/components/Ui/Form/useForm/useForm.js +0 -111
  102. package/dist/components/Ui/Form/utils/fn.js +0 -31
  103. package/dist/components/Ui/Form/utils/types.js +0 -1
  104. package/dist/components/Ui/Icons/Icons.js +0 -577
  105. package/dist/components/Ui/Icons/index.js +0 -97
  106. package/dist/components/Ui/Icons/utils/CreateIcon.js +0 -23
  107. package/dist/components/Ui/Loader/Loader.js +0 -6
  108. package/dist/components/Ui/Loader/index.js +0 -4
  109. package/dist/components/Ui/ModalWindow/ModalWindow.js +0 -50
  110. package/dist/components/Ui/ModalWindow/index.js +0 -4
  111. package/dist/components/Ui/Pagination/Pagination.js +0 -294
  112. package/dist/components/Ui/Pagination/index.js +0 -4
  113. package/dist/components/Ui/Radio/Radio.js +0 -30
  114. package/dist/components/Ui/Radio/Radio.stories.js +0 -42
  115. package/dist/components/Ui/Radio/index.js +0 -4
  116. package/dist/components/Ui/SearchInput/SearchData.js +0 -30
  117. package/dist/components/Ui/SearchInput/SearchInput.js +0 -109
  118. package/dist/components/Ui/Skeleton/Skeleton.js +0 -28
  119. package/dist/components/Ui/Skeleton/index.js +0 -4
  120. package/dist/components/Ui/Switch/Switch.js +0 -25
  121. package/dist/components/Ui/Switch/index.js +0 -4
  122. package/dist/components/Ui/Table/MemoizedRow/MemoizedRow.js +0 -79
  123. package/dist/components/Ui/Table/Table.js +0 -160
  124. package/dist/components/Ui/Table/TableTypes.js +0 -1
  125. package/dist/components/Ui/Table/index.js +0 -4
  126. package/dist/components/Ui/Tabs/Tabs.js +0 -24
  127. package/dist/components/Ui/Tabs/Tabs.stories.js +0 -67
  128. package/dist/components/Ui/Tabs/index.js +0 -4
  129. package/dist/components/Ui/TextInput/TextInput.js +0 -85
  130. package/dist/components/Ui/TextInput/TextInput.stories.js +0 -225
  131. package/dist/components/Ui/TextInput/index.js +0 -4
  132. package/dist/components/Ui/TextareaInput/TextareaInput.js +0 -68
  133. package/dist/components/Ui/TextareaInput/TextareaInput.stories.js +0 -19
  134. package/dist/components/Ui/TextareaInput/index.js +0 -4
  135. package/dist/components/Ui/Tooltip/Tooltip.js +0 -92
  136. package/dist/components/Ui/Tooltip/Tooltip.stories.js +0 -92
  137. package/dist/components/Ui/Tooltip/index.js +0 -4
  138. package/dist/context/ToastContext/ToastContext.js +0 -40
  139. package/dist/context/ToastContext/index.js +0 -5
  140. package/dist/context/TriaflyContext/TriaflyContext.types.js +0 -1
  141. package/dist/context/TriaflyContext/TriaflyProvider.js +0 -27
  142. package/dist/context/TriaflyContext/hooks/index.js +0 -8
  143. package/dist/context/TriaflyContext/hooks/useBreakpointValue/index.js +0 -4
  144. package/dist/context/TriaflyContext/hooks/useBreakpointValue/useBreakpointValue.js +0 -11
  145. package/dist/context/TriaflyContext/hooks/useModal/index.js +0 -4
  146. package/dist/context/TriaflyContext/hooks/useModal/useModal.js +0 -16
  147. package/dist/context/TriaflyContext/hooks/useTheme/index.js +0 -4
  148. package/dist/context/TriaflyContext/hooks/useTheme/useTheme.js +0 -17
  149. package/dist/context/TriaflyContext/index.js +0 -12
  150. package/dist/index-2QXL0WYc.js +0 -45
  151. package/dist/main.d.ts +0 -1229
  152. package/dist/main.js +0 -162
  153. package/dist/vite-env.d.js +0 -1
@@ -1,91 +0,0 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
- import { useState as m, useRef as O, useEffect as g } from "react";
3
- import { IconCaretUpDown as E, IconWarningCircle as P } from "../Icons/Icons.js";
4
- import '../../../assets/DropdownInput.css';const j = ({
5
- label: v,
6
- options: i,
7
- value: o,
8
- onChange: f,
9
- name: C = "DropdownInput",
10
- placeholder: r,
11
- errorMessage: d = !1,
12
- isDisabled: h = !1,
13
- className: k = ""
14
- }) => {
15
- var w;
16
- const [u, p] = m(!1), [s, N] = m(o || ""), [I, x] = m(!1), t = O(null);
17
- g(() => {
18
- const e = (l) => {
19
- t.current && !t.current.contains(l.target) && p(!1);
20
- };
21
- return document.addEventListener("click", e), () => {
22
- document.removeEventListener("click", e);
23
- };
24
- }, []), g(() => {
25
- N(o || "");
26
- }, [o]);
27
- const b = (e) => {
28
- N(e), p(!1), f && f(e);
29
- }, $ = (e) => {
30
- var l;
31
- if (e.stopPropagation(), !u) {
32
- const a = (l = t.current) == null ? void 0 : l.getBoundingClientRect(), D = window.innerHeight - ((a == null ? void 0 : a.bottom) || 0);
33
- x(D < 304);
34
- }
35
- p((a) => !a);
36
- };
37
- return /* @__PURE__ */ c("div", { className: `dropdown-input ${k}`, ref: t, children: [
38
- /* @__PURE__ */ c(
39
- "select",
40
- {
41
- name: C,
42
- value: s,
43
- onChange: (e) => b(e.target.value),
44
- className: "dropdown-input__native",
45
- disabled: h,
46
- children: [
47
- /* @__PURE__ */ n("option", { value: "", disabled: !0, children: r }),
48
- i.map((e) => /* @__PURE__ */ n("option", { value: e.value, children: e.label }, e.value))
49
- ]
50
- }
51
- ),
52
- v && /* @__PURE__ */ n("label", { children: v }),
53
- /* @__PURE__ */ c(
54
- "div",
55
- {
56
- className: `input-box
57
- ${u ? "opened" : ""}
58
- ${h ? "disabled" : ""}
59
- ${d ? "invalid" : ""}`,
60
- onClick: $,
61
- children: [
62
- /* @__PURE__ */ n("span", { className: "input-value", children: s === void 0 ? (
63
- // Если значение не передано
64
- /* @__PURE__ */ n("span", { className: "placeholder", children: r })
65
- ) : ((w = i.find((e) => e.value === s)) == null ? void 0 : w.label) || /* @__PURE__ */ n("span", { className: "placeholder", children: r }) }),
66
- /* @__PURE__ */ n(E, { className: "caret" }),
67
- u && /* @__PURE__ */ n("ul", { className: `options ${I ? "above" : ""}`, children: i.map((e) => /* @__PURE__ */ n(
68
- "li",
69
- {
70
- onClick: (l) => {
71
- l.stopPropagation(), b(e.value);
72
- },
73
- className: s === e.value ? "option--selected" : "",
74
- children: e.label
75
- },
76
- e.value
77
- )) })
78
- ]
79
- }
80
- ),
81
- d && /* @__PURE__ */ c("span", { className: "helper-text error", children: [
82
- /* @__PURE__ */ n(P, { className: "icon", size: 12 }),
83
- d
84
- ] })
85
- ] });
86
- };
87
- j.displayName = "DropdownInput";
88
- export {
89
- j as DropdownInput,
90
- j as default
91
- };
@@ -1,77 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import s from "react";
3
- import { DropdownInput as a } from "./DropdownInput.js";
4
- const h = {
5
- title: "UIKit/DropdownInput",
6
- component: a,
7
- parameters: { layout: "centered" },
8
- argTypes: {
9
- label: { control: "text" },
10
- name: { control: "text" },
11
- options: { control: "object" },
12
- placeholder: { control: "text" },
13
- value: { control: "text" },
14
- errorMessage: { control: "text" },
15
- isDisabled: { control: "boolean" }
16
- }
17
- }, e = (l) => {
18
- const [o, t] = s.useState(l.value || "");
19
- return /* @__PURE__ */ r(a, { ...l, value: o, onChange: (n) => {
20
- t(n);
21
- } });
22
- }, d = e.bind({});
23
- d.args = {
24
- label: "Выберите опцию",
25
- name: "dropdown",
26
- options: [
27
- { value: "1", label: "Опция 1" },
28
- { value: "2", label: "Опция 2" },
29
- { value: "3", label: "Опция 3" }
30
- ],
31
- placeholder: "Выберите..."
32
- };
33
- const c = e.bind({});
34
- c.args = {
35
- label: "Выберите опцию",
36
- name: "dropdown",
37
- options: [
38
- { value: "1", label: "Опция 1" },
39
- { value: "2", label: "Опция 2" },
40
- { value: "3", label: "Опция 3" }
41
- ],
42
- placeholder: "Выберите...",
43
- value: "2"
44
- // Предустановленное значение
45
- };
46
- const u = e.bind({});
47
- u.args = {
48
- label: "Выберите опцию",
49
- name: "dropdown",
50
- options: [
51
- { value: "1", label: "Опция 1" },
52
- { value: "2", label: "Опция 2" },
53
- { value: "3", label: "Опция 3" }
54
- ],
55
- placeholder: "Выберите...",
56
- isDisabled: !0
57
- // Отключаем селект
58
- };
59
- const b = e.bind({});
60
- b.args = {
61
- label: "Выберите опцию",
62
- name: "dropdown",
63
- options: [
64
- { value: "1", label: "Опция 1" },
65
- { value: "2", label: "Опция 2" },
66
- { value: "3", label: "Опция 3" }
67
- ],
68
- placeholder: "Выберите...",
69
- errorMessage: "Пожалуйста, выберите опцию."
70
- };
71
- export {
72
- d as Default,
73
- u as Disabled,
74
- b as WithErrorMessage,
75
- c as WithSelectedValue,
76
- h as default
77
- };
@@ -1,4 +0,0 @@
1
- import { DropdownInput as r } from "./DropdownInput.js";
2
- export {
3
- r as DropdownInput
4
- };
@@ -1,83 +0,0 @@
1
- import { jsxs as R, jsx as h } from "react/jsx-runtime";
2
- import { useState as a, useRef as b, useLayoutEffect as C } from "react";
3
- import '../../../assets/DropdownMenu.css';const O = ({
4
- content: m,
5
- horizontalPosition: s = "right",
6
- verticalPosition: c = "bottom",
7
- iconTrigger: N
8
- }) => {
9
- const [d, o] = a(!1), [j, n] = a(s), [H, l] = a(c), f = b(null), u = b(null);
10
- C(() => {
11
- if (d && f.current && u.current) {
12
- const e = u.current.getBoundingClientRect(), t = f.current.getBoundingClientRect(), r = window.innerHeight, i = window.innerWidth;
13
- if (c === "bottom" && e.bottom + t.height > r ? l("top") : c === "top" && e.top - t.height < 0 ? l("bottom") : l(c), s === "left" && e.left + t.width > i)
14
- n("right");
15
- else if (s === "right" && e.right - t.width < 0)
16
- n("left");
17
- else if (s === "center") {
18
- const g = e.left + e.width / 2 - t.width / 2;
19
- g < 0 ? n("left") : g + t.width > i ? n("right") : n("center");
20
- } else
21
- n(s);
22
- }
23
- }, [d, s, c]), C(() => {
24
- const e = (t) => {
25
- f.current && !f.current.contains(t.target) && u.current && !u.current.contains(t.target) && o(!1);
26
- };
27
- return d && document.addEventListener("click", e), () => {
28
- document.removeEventListener("click", e);
29
- };
30
- }, [d]);
31
- const k = () => {
32
- var e, t;
33
- if (!d) {
34
- const r = (e = u.current) == null ? void 0 : e.getBoundingClientRect(), i = (t = f.current) == null ? void 0 : t.getBoundingClientRect();
35
- if (r && i) {
36
- const g = window.innerHeight, w = window.innerWidth;
37
- if (c === "bottom" && r.bottom + i.height > g ? l("top") : c === "top" && r.top - i.height < 0 ? l("bottom") : l(c), s === "left" && r.left + i.width > w)
38
- n("right");
39
- else if (s === "right" && r.right - i.width < 0)
40
- n("left");
41
- else if (s === "center") {
42
- const p = r.left + r.width / 2 - i.width / 2;
43
- p < 0 ? n("left") : p + i.width > w ? n("right") : n("center");
44
- } else
45
- n(s);
46
- }
47
- }
48
- o(!d);
49
- }, x = (e) => {
50
- e && e(), o(!1);
51
- };
52
- return /* @__PURE__ */ R("div", { className: `dropdowm-menu ${d ? "open" : ""}`, children: [
53
- /* @__PURE__ */ h("div", { className: "menu-trigger", onClick: k, ref: u, children: N || /* @__PURE__ */ h("div", { className: "dots" }) }),
54
- /* @__PURE__ */ h("div", { className: "fader" }),
55
- /* @__PURE__ */ h(
56
- "ul",
57
- {
58
- className: "menu-list",
59
- "data-x-fit": j,
60
- "data-y-fit": H,
61
- ref: f,
62
- children: m == null ? void 0 : m.map(({ icon: e, isDanger: t, title: r, onClick: i }, g) => /* @__PURE__ */ R(
63
- "li",
64
- {
65
- onClick: () => {
66
- i && x(i);
67
- },
68
- className: `menu-item ${t ? "danger" : ""}`,
69
- children: [
70
- e,
71
- /* @__PURE__ */ h("span", { className: "label", children: r })
72
- ]
73
- },
74
- g
75
- ))
76
- }
77
- )
78
- ] });
79
- };
80
- export {
81
- O as DropdownMenu,
82
- O as default
83
- };
@@ -1,50 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { IconEye as t, IconRoleX as n, IconTrash as i } from "../Icons/Icons.js";
3
- import { DropdownMenu as e } from "./DropdownMenu.js";
4
- const l = {
5
- title: "UIKit/DropdownMenu",
6
- component: e,
7
- tags: ["autodocs"],
8
- // Автоматическая генерация документации
9
- argTypes: {
10
- content: {
11
- control: "object",
12
- // Позволяет редактировать content в интерфейсе Storybook
13
- description: "Массив элементов меню"
14
- },
15
- horizontalPosition: {
16
- control: "select",
17
- options: ["left", "center", "right"],
18
- description: "Позиционирование меню относительно триггера"
19
- },
20
- verticalPosition: {
21
- control: "select",
22
- options: ["top", "bottom"],
23
- description: "Позиционирование меню относительно триггера"
24
- }
25
- }
26
- }, a = {
27
- args: {
28
- content: [
29
- {
30
- icon: /* @__PURE__ */ o(t, {}),
31
- title: "Просмотр"
32
- },
33
- {
34
- icon: /* @__PURE__ */ o(n, {}),
35
- title: "Назначить другую роль"
36
- },
37
- {
38
- icon: /* @__PURE__ */ o(i, {}),
39
- title: "Удалить",
40
- isDanger: !0
41
- }
42
- ],
43
- horizontalPosition: "left",
44
- verticalPosition: "bottom"
45
- }
46
- };
47
- export {
48
- a as Default,
49
- l as default
50
- };
@@ -1,4 +0,0 @@
1
- import { DropdownMenu as e } from "./DropdownMenu.js";
2
- export {
3
- e as DropdownMenu
4
- };