triafly-ui-kit 1.0.23 → 1.0.25

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 (181) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/index.js +7 -0
  3. package/dist/_virtual/index2.js +7 -0
  4. package/dist/_virtual/index3.js +4 -0
  5. package/dist/_virtual/papaparse.min.js +7 -0
  6. package/dist/_virtual/papaparse.min2.js +4 -0
  7. package/dist/_virtual/react-paginate.js +7 -0
  8. package/dist/_virtual/react-paginate2.js +4 -0
  9. package/dist/assets/fonts/FiraCode-Regular.ttf +0 -0
  10. package/dist/assets/fonts/Manrope-Bold.ttf +0 -0
  11. package/dist/assets/fonts/Manrope-Regular.ttf +0 -0
  12. package/dist/assets/fonts/Manrope-SemiBold.ttf +0 -0
  13. package/dist/assets/fonts/RobotoSlab-SemiBold.ttf +0 -0
  14. package/dist/assets/src/components/Ui/Accordeon/Accordeon.css +1 -0
  15. package/dist/assets/src/components/Ui/Alert/Alert.css +1 -0
  16. package/dist/assets/src/components/Ui/Avatar/Avatar.css +1 -0
  17. package/dist/assets/src/components/Ui/Badge/Badge.module.css +1 -0
  18. package/dist/assets/src/components/Ui/Button/Button.css +1 -0
  19. package/dist/assets/src/components/Ui/ButtonsArray/ButtonsArray.css +1 -0
  20. package/dist/assets/src/components/Ui/Checkbox/Checkbox.css +1 -0
  21. package/dist/assets/src/components/Ui/CliTextareaInput/CliTextareaInput.css +1 -0
  22. package/dist/assets/src/components/Ui/CustomLink/CustomLink.css +1 -0
  23. package/dist/assets/src/components/Ui/DatePicker/DatePicker.css +1 -0
  24. package/dist/assets/src/components/Ui/DropdownInput/DropdownInput.css +1 -0
  25. package/dist/assets/src/components/Ui/DropdownMenu/DropdownMenu.css +1 -0
  26. package/dist/assets/src/components/Ui/FileUpload/FileUpload.css +1 -0
  27. package/dist/assets/src/components/Ui/Form/FormRoot/Form.css +1 -0
  28. package/dist/assets/src/components/Ui/Loader/Loader.css +1 -0
  29. package/dist/assets/src/components/Ui/ModalWindow/ModalWindow.css +1 -0
  30. package/dist/assets/src/components/Ui/Pagination/Pagination.css +1 -0
  31. package/dist/assets/src/components/Ui/Radio/Radio.css +1 -0
  32. package/dist/assets/src/components/Ui/SearchInput/SearchInput.css +1 -0
  33. package/dist/assets/src/components/Ui/Skeleton/Skeleton.module.css +1 -0
  34. package/dist/assets/src/components/Ui/Switch/Switch.css +1 -0
  35. package/dist/assets/src/components/Ui/Table/Table.css +1 -0
  36. package/dist/assets/src/components/Ui/Tabs/Tabs.css +1 -0
  37. package/dist/assets/src/components/Ui/TextInput/TextInput.css +1 -0
  38. package/dist/assets/src/components/Ui/TextareaInput/TextareaInput.css +1 -0
  39. package/dist/assets/src/components/Ui/Tooltip/Tooltip.css +1 -0
  40. package/dist/assets/src/components/Ui/Tooltip/Tooltip.stories.module.css +1 -0
  41. package/dist/assets/src/context/ToastContext/ToastContext.module.css +1 -0
  42. package/dist/components/Ui/Accordeon/Accordeon.js +34 -0
  43. package/dist/components/Ui/Accordeon/Accordeon.stories.js +72 -0
  44. package/dist/components/Ui/Accordeon/index.js +4 -0
  45. package/dist/components/Ui/Alert/Alert.js +15 -0
  46. package/dist/components/Ui/Alert/index.js +4 -0
  47. package/dist/components/Ui/Avatar/Avatar.js +11 -0
  48. package/dist/components/Ui/Avatar/index.js +4 -0
  49. package/dist/components/Ui/Badge/Badge.js +30 -0
  50. package/dist/components/Ui/Badge/index.js +4 -0
  51. package/dist/components/Ui/Button/Button.js +50 -0
  52. package/dist/components/Ui/Button/index.js +4 -0
  53. package/dist/components/Ui/ButtonsArray/ButtonsArray.js +29 -0
  54. package/dist/components/Ui/ButtonsArray/ButtonsArray.stories.js +78 -0
  55. package/dist/components/Ui/ButtonsArray/index.js +4 -0
  56. package/dist/components/Ui/Checkbox/Checkbox.js +40 -0
  57. package/dist/components/Ui/Checkbox/Checkbox.stories.js +120 -0
  58. package/dist/components/Ui/Checkbox/index.js +4 -0
  59. package/dist/components/Ui/CliTextareaInput/CliTextareaInput.js +122 -0
  60. package/dist/components/Ui/CliTextareaInput/index.js +23 -0
  61. package/dist/components/Ui/CliTextareaInput/utils/escapeHtml/escapeHtml.js +4 -0
  62. package/dist/components/Ui/CliTextareaInput/utils/fixJson/fixJson.js +12 -0
  63. package/dist/components/Ui/CliTextareaInput/utils/highlightSyntax/highlightSyntax.js +20 -0
  64. package/dist/components/Ui/CliTextareaInput/utils/highlightSyntax/index.js +4 -0
  65. package/dist/components/Ui/CliTextareaInput/utils/hooks/index.js +17 -0
  66. package/dist/components/Ui/CliTextareaInput/utils/hooks/useFixFormat/index.js +4 -0
  67. package/dist/components/Ui/CliTextareaInput/utils/hooks/useFixFormat/useFixFormat.js +29 -0
  68. package/dist/components/Ui/CliTextareaInput/utils/hooks/useHistoryNavigation/index.js +4 -0
  69. package/dist/components/Ui/CliTextareaInput/utils/hooks/useHistoryNavigation/useHistoryNavigation.js +34 -0
  70. package/dist/components/Ui/CliTextareaInput/utils/hooks/useKeyHandlers/index.js +4 -0
  71. package/dist/components/Ui/CliTextareaInput/utils/hooks/useKeyHandlers/useKeyHandlers.js +45 -0
  72. package/dist/components/Ui/CliTextareaInput/utils/hooks/useLineNumbers/index.js +5 -0
  73. package/dist/components/Ui/CliTextareaInput/utils/hooks/useLineNumbers/useLineNumbers.js +17 -0
  74. package/dist/components/Ui/CliTextareaInput/utils/hooks/useScrollSync/index.js +4 -0
  75. package/dist/components/Ui/CliTextareaInput/utils/hooks/useScrollSync/useScrollSync.js +13 -0
  76. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextActions/index.js +4 -0
  77. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextActions/useTextActions.js +37 -0
  78. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextCoursore/index.js +4 -0
  79. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextCoursore/useTextCoursore.js +14 -0
  80. package/dist/components/Ui/CliTextareaInput/utils/index.js +21 -0
  81. package/dist/components/Ui/CliTextareaInput/utils/processJson/index.js +4 -0
  82. package/dist/components/Ui/CliTextareaInput/utils/processJson/processJson.js +11 -0
  83. package/dist/components/Ui/CliTextareaInput/utils/processXml/processXml.js +8 -0
  84. package/dist/components/Ui/CliTextareaInput/utils/processYml/processYml.js +27 -0
  85. package/dist/components/Ui/CliTextareaInput/utils/types.js +1 -0
  86. package/dist/components/Ui/CustomLink/CustomLink.js +50 -0
  87. package/dist/components/Ui/CustomLink/index.js +4 -0
  88. package/dist/components/Ui/DatePicker/DatePicker.js +183 -0
  89. package/dist/components/Ui/DatePicker/DatePicker.stories.js +120 -0
  90. package/dist/components/Ui/DropdownInput/DropdownInput.js +92 -0
  91. package/dist/components/Ui/DropdownInput/DropdownInput.stories.js +77 -0
  92. package/dist/components/Ui/DropdownInput/index.js +4 -0
  93. package/dist/components/Ui/DropdownMenu/DropdownMenu.js +84 -0
  94. package/dist/components/Ui/DropdownMenu/DropdownMenu.stories.js +50 -0
  95. package/dist/components/Ui/DropdownMenu/index.js +4 -0
  96. package/dist/components/Ui/FileUpload/FileUpload.js +197 -0
  97. package/dist/components/Ui/FileUpload/fn.js +10 -0
  98. package/dist/components/Ui/FileUpload/index.js +4 -0
  99. package/dist/components/Ui/FileUpload/types.js +1 -0
  100. package/dist/components/Ui/Form/FormContext/FormContext.js +5 -0
  101. package/dist/components/Ui/Form/FormItem/FormItem.js +107 -0
  102. package/dist/components/Ui/Form/FormItem/fn.js +25 -0
  103. package/dist/components/Ui/Form/FormItem/types.js +1 -0
  104. package/dist/components/Ui/Form/FormRoot/FormRoot.js +26 -0
  105. package/dist/components/Ui/Form/FormRoot/index.js +4 -0
  106. package/dist/components/Ui/Form/FormRoot/types.js +1 -0
  107. package/dist/components/Ui/Form/index.js +6 -0
  108. package/dist/components/Ui/Form/useForm/index.js +4 -0
  109. package/dist/components/Ui/Form/useForm/useForm.js +111 -0
  110. package/dist/components/Ui/Form/utils/fn.js +31 -0
  111. package/dist/components/Ui/Form/utils/types.js +1 -0
  112. package/dist/components/Ui/Icons/Icons.js +577 -0
  113. package/dist/components/Ui/Icons/index.js +97 -0
  114. package/dist/components/Ui/Icons/utils/CreateIcon.js +23 -0
  115. package/dist/components/Ui/Loader/Loader.js +7 -0
  116. package/dist/components/Ui/Loader/index.js +4 -0
  117. package/dist/components/Ui/ModalWindow/ModalWindow.js +51 -0
  118. package/dist/components/Ui/ModalWindow/index.js +4 -0
  119. package/dist/components/Ui/Pagination/Pagination.js +39 -0
  120. package/dist/components/Ui/Pagination/index.js +4 -0
  121. package/dist/components/Ui/Radio/Radio.js +31 -0
  122. package/dist/components/Ui/Radio/Radio.stories.js +42 -0
  123. package/dist/components/Ui/Radio/index.js +4 -0
  124. package/dist/components/Ui/SearchInput/SearchData.js +30 -0
  125. package/dist/components/Ui/SearchInput/SearchInput.js +110 -0
  126. package/dist/components/Ui/Skeleton/Skeleton.js +26 -0
  127. package/dist/components/Ui/Skeleton/index.js +4 -0
  128. package/dist/components/Ui/Switch/Switch.js +26 -0
  129. package/dist/components/Ui/Switch/index.js +4 -0
  130. package/dist/components/Ui/Table/MemoizedRow/MemoizedRow.js +50 -0
  131. package/dist/components/Ui/Table/Table.js +161 -0
  132. package/dist/components/Ui/Table/TableTypes.js +1 -0
  133. package/dist/components/Ui/Table/index.js +4 -0
  134. package/dist/components/Ui/Tabs/Tabs.js +25 -0
  135. package/dist/components/Ui/Tabs/Tabs.stories.js +67 -0
  136. package/dist/components/Ui/Tabs/index.js +4 -0
  137. package/dist/components/Ui/TextInput/TextInput.js +86 -0
  138. package/dist/components/Ui/TextInput/TextInput.stories.js +225 -0
  139. package/dist/components/Ui/TextInput/index.js +4 -0
  140. package/dist/components/Ui/TextareaInput/TextareaInput.js +69 -0
  141. package/dist/components/Ui/TextareaInput/TextareaInput.stories.js +19 -0
  142. package/dist/components/Ui/TextareaInput/index.js +4 -0
  143. package/dist/components/Ui/Tooltip/Tooltip.js +93 -0
  144. package/dist/components/Ui/Tooltip/Tooltip.stories.js +87 -0
  145. package/dist/components/Ui/Tooltip/index.js +4 -0
  146. package/dist/context/ToastContext/ToastContext.js +38 -0
  147. package/dist/context/ToastContext/index.js +5 -0
  148. package/dist/context/TriaflyContext/TriaflyContext.types.js +1 -0
  149. package/dist/context/TriaflyContext/TriaflyProvider.js +27 -0
  150. package/dist/context/TriaflyContext/hooks/index.js +8 -0
  151. package/dist/context/TriaflyContext/hooks/useBreakpointValue/index.js +4 -0
  152. package/dist/context/TriaflyContext/hooks/useBreakpointValue/useBreakpointValue.js +11 -0
  153. package/dist/context/TriaflyContext/hooks/useModal/index.js +4 -0
  154. package/dist/context/TriaflyContext/hooks/useModal/useModal.js +16 -0
  155. package/dist/context/TriaflyContext/hooks/useTheme/index.js +4 -0
  156. package/dist/context/TriaflyContext/hooks/useTheme/useTheme.js +17 -0
  157. package/dist/context/TriaflyContext/index.js +12 -0
  158. package/dist/main.d.ts +1229 -0
  159. package/dist/main.js +162 -0
  160. package/dist/node_modules/classnames/index.js +42 -0
  161. package/dist/node_modules/fast-deep-equal/index.js +31 -0
  162. package/dist/node_modules/papaparse/papaparse.min.js +421 -0
  163. package/dist/node_modules/react-paginate/dist/react-paginate.js +259 -0
  164. package/dist/src/components/Ui/Badge/Badge.module.scss.js +30 -0
  165. package/dist/src/components/Ui/Skeleton/Skeleton.module.scss.js +9 -0
  166. package/dist/src/components/Ui/Tooltip/Tooltip.stories.module.css.js +15 -0
  167. package/dist/src/context/ToastContext/ToastContext.module.scss.js +9 -0
  168. package/dist/styles/_mixins.scss +22 -0
  169. package/dist/styles/fix.scss +4 -0
  170. package/dist/styles/main.scss +27 -0
  171. package/dist/styles/reset.scss +106 -0
  172. package/dist/styles/typography.scss +102 -0
  173. package/dist/styles/variables.scss +278 -0
  174. package/dist/vite-env.d.js +1 -0
  175. package/package.json +6 -2
  176. package/src/styles/_mixins.scss +22 -0
  177. package/src/styles/fix.scss +4 -0
  178. package/src/styles/main.scss +27 -0
  179. package/src/styles/reset.scss +106 -0
  180. package/src/styles/typography.scss +102 -0
  181. package/src/styles/variables.scss +278 -0
@@ -0,0 +1,161 @@
1
+ import { jsx as t, jsxs as _ } from "react/jsx-runtime";
2
+ import U, { useState as N, useEffect as q, useCallback as d } from "react";
3
+ import o from "../../../_virtual/index.js";
4
+ import '../../../assets/src/components/Ui/Table/Table.css';/* empty css */
5
+ import { IconCaretDown as w, IconCaretUp as F } from "../Icons/Icons.js";
6
+ import { MemoizedRow as G } from "./MemoizedRow/MemoizedRow.js";
7
+ import { Loader as H } from "../Loader/Loader.js";
8
+ const y = {
9
+ asc: /* @__PURE__ */ t(w, { viewBox: "0 -6 24 24", "aria-hidden": "true" }),
10
+ desc: /* @__PURE__ */ t(F, { viewBox: "0 -4 24 24", "aria-hidden": "true" }),
11
+ default: /* @__PURE__ */ t(w, { viewBox: "0 -6 24 24", "aria-hidden": "true" })
12
+ };
13
+ function J({
14
+ columns: f,
15
+ dataSource: c,
16
+ rowKey: i,
17
+ tableClassName: v,
18
+ theadClassName: k,
19
+ trTheadClassNames: x,
20
+ thTheadClassNames: D,
21
+ tbodyClassName: I,
22
+ wrapperClassName: A,
23
+ borderBottom: u = !1,
24
+ stickyHeader: C = !1,
25
+ stickyLeft: h = !1,
26
+ bordered: l = !1,
27
+ rowClassName: j,
28
+ defaultSort: B,
29
+ onClickTr: m,
30
+ onClickTrHeader: R,
31
+ loading: S = !1
32
+ }) {
33
+ const [T, b] = N(c), [n, z] = N(
34
+ B || null
35
+ );
36
+ q(() => {
37
+ b(c);
38
+ }, [c]);
39
+ const $ = d(
40
+ (e) => typeof i == "function" ? i(e) : typeof i == "string" && i in e ? String(e[i]) : "unknown",
41
+ [i]
42
+ ), g = d((e, a) => {
43
+ b((p) => [...p].sort((L, M) => {
44
+ const s = L[e], r = M[e];
45
+ return typeof s == "string" && typeof r == "string" ? a === "asc" ? s.localeCompare(r) : r.localeCompare(s) : typeof s == "number" && typeof r == "number" ? a === "asc" ? s - r : r - s : s instanceof Date && r instanceof Date ? a === "asc" ? s.getTime() - r.getTime() : r.getTime() - s.getTime() : 0;
46
+ })), z({ key: e, order: a });
47
+ }, []), E = d(
48
+ (e) => {
49
+ const p = (n == null ? void 0 : n.key) === e && n.order === "asc" ? "desc" : "asc";
50
+ g(e, p);
51
+ },
52
+ [n, g]
53
+ );
54
+ return /* @__PURE__ */ t("div", { className: o("table-component", A), children: /* @__PURE__ */ t(
55
+ "div",
56
+ {
57
+ className: o(
58
+ "table-component__wrapper",
59
+ {
60
+ bordered: l,
61
+ borderBottom: u
62
+ },
63
+ v
64
+ ),
65
+ children: /* @__PURE__ */ _(
66
+ "table",
67
+ {
68
+ className: o("table-component__wrapper__table", {
69
+ bordered: l,
70
+ borderBottom: u
71
+ }),
72
+ children: [
73
+ /* @__PURE__ */ t(
74
+ "thead",
75
+ {
76
+ className: o(
77
+ "table-component__wrapper__table__thead",
78
+ {
79
+ stickyHeader: C
80
+ },
81
+ k
82
+ ),
83
+ children: /* @__PURE__ */ t(
84
+ "tr",
85
+ {
86
+ className: o(
87
+ "table-component__wrapper__table__thead__tr",
88
+ x
89
+ ),
90
+ onClick: R,
91
+ children: f.map((e, a) => /* @__PURE__ */ t(
92
+ "th",
93
+ {
94
+ className: o(
95
+ "table-component__wrapper__table__thead__th",
96
+ {
97
+ bordered: l,
98
+ stickyLeft: h && a === 0
99
+ },
100
+ D
101
+ ),
102
+ style: {
103
+ ...e.width ? { width: e.width } : {},
104
+ ...e.align ? { textAlign: e.align } : {}
105
+ },
106
+ onClick: () => e.sorted && E(e.key),
107
+ children: /* @__PURE__ */ _("div", { className: "th-content", children: [
108
+ e.title,
109
+ e.sorted && /* @__PURE__ */ t("span", { className: "sort-icon", children: (n == null ? void 0 : n.key) === e.key ? y[n.order] : y.default })
110
+ ] })
111
+ },
112
+ `${e.key}-${a}`
113
+ ))
114
+ }
115
+ )
116
+ }
117
+ ),
118
+ /* @__PURE__ */ _("tbody", { className: o("table-component__wrapper__table__tbody", I), children: [
119
+ T.map((e, a) => /* @__PURE__ */ t(
120
+ G,
121
+ {
122
+ record: e,
123
+ onClickTr: () => m == null ? void 0 : m(e),
124
+ columns: f,
125
+ rowKey: i,
126
+ rowClassName: j,
127
+ index: a,
128
+ stickyLeft: h,
129
+ bordered: l
130
+ },
131
+ $(e)
132
+ )),
133
+ S ? /* @__PURE__ */ t(
134
+ "div",
135
+ {
136
+ style: {
137
+ position: "absolute",
138
+ top: 0,
139
+ left: 0,
140
+ right: 0,
141
+ bottom: 0,
142
+ display: "flex",
143
+ justifyContent: "center",
144
+ alignItems: "center",
145
+ backgroundColor: "rgba(255, 255, 255, 0.7)",
146
+ zIndex: 10
147
+ },
148
+ children: /* @__PURE__ */ t(H, { className: "centered" })
149
+ }
150
+ ) : null
151
+ ] })
152
+ ]
153
+ }
154
+ )
155
+ }
156
+ ) });
157
+ }
158
+ const K = U.memo(J);
159
+ export {
160
+ K as Table
161
+ };
@@ -0,0 +1,4 @@
1
+ import { Table as r } from "./Table.js";
2
+ export {
3
+ r as Table
4
+ };
@@ -0,0 +1,25 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { useState as v } from "react";
3
+ import '../../../assets/src/components/Ui/Tabs/Tabs.css';/* empty css */
4
+ const f = ({ items: s, defaultActiveKey: t, onChange: d }) => {
5
+ var c, b;
6
+ const [l, i] = v(t || ((c = s[0]) == null ? void 0 : c.key)), o = (a) => {
7
+ s.some((r) => r.key === a && !r.disabled) && (i(a), d == null || d(a));
8
+ };
9
+ return /* @__PURE__ */ n("div", { className: "tabs", children: [
10
+ /* @__PURE__ */ e("div", { className: "tabs-bar", children: s.map((a) => /* @__PURE__ */ e(
11
+ "button",
12
+ {
13
+ onClick: () => !a.disabled && o(a.key),
14
+ className: `tab-button ${l === a.key ? "active" : ""} ${a.disabled ? "disabled" : ""}`,
15
+ disabled: a.disabled,
16
+ children: a.label
17
+ },
18
+ a.key
19
+ )) }),
20
+ /* @__PURE__ */ e("div", { className: "tabs-content", children: (b = s.find((a) => a.key === l)) == null ? void 0 : b.children })
21
+ ] });
22
+ };
23
+ export {
24
+ f as Tabs
25
+ };
@@ -0,0 +1,67 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Tabs as t } from "./Tabs.js";
3
+ const n = {
4
+ title: "UIKit/Tabs",
5
+ component: t,
6
+ tags: ["autodocs"],
7
+ argTypes: {
8
+ items: {
9
+ control: "object",
10
+ description: "Массив объектов вкладок {label: string, content: ReactNode}"
11
+ }
12
+ }
13
+ }, s = {
14
+ args: {
15
+ items: [
16
+ {
17
+ key: "profile",
18
+ label: "Профиль",
19
+ children: /* @__PURE__ */ e("div", { children: "Информация о пользователе" })
20
+ },
21
+ {
22
+ key: "settings",
23
+ label: "Настройки",
24
+ children: /* @__PURE__ */ e("div", { children: "Параметры аккаунта" })
25
+ },
26
+ {
27
+ key: "notifications",
28
+ label: "Уведомления",
29
+ children: /* @__PURE__ */ e("div", { children: "Настройки уведомлений" })
30
+ }
31
+ ]
32
+ }
33
+ }, a = {
34
+ args: {
35
+ items: [
36
+ {
37
+ key: "favorites",
38
+ label: "Избранное",
39
+ children: /* @__PURE__ */ e("div", { children: "Ваши избранные элементы" })
40
+ },
41
+ {
42
+ key: "projects",
43
+ label: "Проекты",
44
+ children: /* @__PURE__ */ e("div", { children: "Список ваших проектов" })
45
+ }
46
+ ]
47
+ },
48
+ decorators: [
49
+ (i) => /* @__PURE__ */ e("div", { style: { maxWidth: "500px", margin: "0 auto" }, children: /* @__PURE__ */ e(i, {}) })
50
+ ]
51
+ }, c = {
52
+ args: {
53
+ items: [
54
+ {
55
+ key: "single",
56
+ label: "Единственная вкладка",
57
+ children: /* @__PURE__ */ e("div", { children: "Контент единственной вкладки" })
58
+ }
59
+ ]
60
+ }
61
+ };
62
+ export {
63
+ s as Basic,
64
+ c as SingleTab,
65
+ a as StyledTabs,
66
+ n as default
67
+ };
@@ -0,0 +1,4 @@
1
+ import { Tabs as a } from "./Tabs.js";
2
+ export {
3
+ a as Tabs
4
+ };
@@ -0,0 +1,86 @@
1
+ import { jsxs as d, jsx as e, Fragment as b } from "react/jsx-runtime";
2
+ import { forwardRef as g, useState as A } from "react";
3
+ import '../../../assets/src/components/Ui/TextInput/TextInput.css';/* empty css */
4
+ import { IconX as F, IconCheck as R, IconSearch as T, IconLock as X, IconAt as q } from "../Icons/Icons.js";
5
+ import { Loader as B } from "../Loader/Loader.js";
6
+ const D = g(
7
+ ({
8
+ label: s,
9
+ placeholder: h = "",
10
+ value: n,
11
+ // Значение из пропсов
12
+ type: f = "text",
13
+ name: I = "TextInput",
14
+ id: v,
15
+ isDisabled: x = !1,
16
+ iconType: c,
17
+ errorMessage: l = !1,
18
+ hasError: N = !1,
19
+ onChange: a,
20
+ // Обработчик из пропсов
21
+ className: p,
22
+ isClearable: r,
23
+ isLoading: i,
24
+ onFocus: k,
25
+ onKeyDown: z,
26
+ onBlur: $
27
+ }, w) => {
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);
31
+ }, L = () => {
32
+ t && a ? a({ target: { value: "" } }) : o("");
33
+ }, S = () => {
34
+ switch (c) {
35
+ case "email":
36
+ return /* @__PURE__ */ e(q, { className: "icon", size: 20 });
37
+ case "password":
38
+ return /* @__PURE__ */ e(X, { className: "icon", size: 20 });
39
+ case "search":
40
+ return /* @__PURE__ */ e(T, { className: "icon", size: 20 });
41
+ case "checkmark":
42
+ return /* @__PURE__ */ e(R, { className: "icon", size: 20 });
43
+ default:
44
+ return /* @__PURE__ */ e(b, {});
45
+ }
46
+ };
47
+ return /* @__PURE__ */ d(
48
+ "div",
49
+ {
50
+ className: `text-input
51
+ ${p}
52
+ ${N && "invalid"}
53
+ ${r && "clearable"}`,
54
+ children: [
55
+ s && /* @__PURE__ */ e("label", { children: s }),
56
+ /* @__PURE__ */ d("div", { className: `input-container ${c ? `has-icon icon-${c}` : ""}`, children: [
57
+ /* @__PURE__ */ e(
58
+ "input",
59
+ {
60
+ onBlur: $,
61
+ type: f,
62
+ value: u,
63
+ onChange: j,
64
+ placeholder: h,
65
+ name: I,
66
+ id: v,
67
+ disabled: x,
68
+ ref: w,
69
+ onFocus: k,
70
+ onKeyDown: z
71
+ }
72
+ ),
73
+ S(),
74
+ r && u && !i && /* @__PURE__ */ e("div", { className: "clear-value", onClick: L, children: /* @__PURE__ */ e(F, { size: 20 }) }),
75
+ i && /* @__PURE__ */ e(B, {})
76
+ ] }),
77
+ l && /* @__PURE__ */ e("span", { className: "helper-text", children: l })
78
+ ]
79
+ }
80
+ );
81
+ }
82
+ );
83
+ D.displayName = "TextInput";
84
+ export {
85
+ D as TextInput
86
+ };
@@ -0,0 +1,225 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import { useState as t } from "react";
3
+ import { TextInput as l } from "./TextInput.js";
4
+ const y = {
5
+ title: "UIKit/TextInput",
6
+ component: l,
7
+ tags: ["autodocs"],
8
+ argTypes: {
9
+ iconType: {
10
+ control: {
11
+ type: "select",
12
+ options: [void 0, "email", "password", "search", "checkmark"]
13
+ }
14
+ },
15
+ type: {
16
+ control: {
17
+ type: "select",
18
+ options: ["text", "password", "email", "search"]
19
+ }
20
+ },
21
+ className: {
22
+ control: {
23
+ type: "text",
24
+ description: "Комбинируйте классы: 'sm', 'rounded' через пробел"
25
+ }
26
+ }
27
+ }
28
+ }, f = {
29
+ args: {
30
+ placeholder: "Введите текст...",
31
+ label: "Текстовое поле"
32
+ }
33
+ }, v = {
34
+ args: {
35
+ placeholder: "Поиск...",
36
+ iconType: "search"
37
+ }
38
+ }, N = {
39
+ args: {
40
+ label: "Email",
41
+ placeholder: "Введите email",
42
+ hasError: !0,
43
+ errorMessage: "Неверный формат email",
44
+ iconType: "email"
45
+ }
46
+ }, k = {
47
+ args: {
48
+ label: "Заблокированное поле",
49
+ value: "Нельзя изменить",
50
+ isDisabled: !0
51
+ }
52
+ }, C = {
53
+ args: {
54
+ label: "Поле с очисткой",
55
+ placeholder: "Введите и очистите",
56
+ isClearable: !0,
57
+ value: "Пример текста"
58
+ }
59
+ }, T = {
60
+ args: {
61
+ label: "Поле с загрузкой",
62
+ isLoading: !0
63
+ }
64
+ }, I = {
65
+ args: {
66
+ placeholder: "Маленькое поле...",
67
+ label: "Текстовое поле (sm)",
68
+ className: "sm"
69
+ }
70
+ }, D = {
71
+ args: {
72
+ placeholder: "Маленькое и круглое...",
73
+ label: "Поле (sm + rounded)",
74
+ className: "sm rounded"
75
+ }
76
+ }, S = {
77
+ render: () => /* @__PURE__ */ a("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "24px" }, children: [
78
+ /* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: [
79
+ /* @__PURE__ */ e("h3", { children: "Обычный размер (44px)" }),
80
+ /* @__PURE__ */ e(l, { label: "Обычное поле", placeholder: "Просто текст" }),
81
+ /* @__PURE__ */ e(l, { label: "С иконкой", iconType: "email", placeholder: "email@example.com" }),
82
+ /* @__PURE__ */ e(
83
+ l,
84
+ {
85
+ label: "С ошибкой",
86
+ hasError: !0,
87
+ errorMessage: "Ошибка валидации",
88
+ value: "Неверное значение"
89
+ }
90
+ ),
91
+ /* @__PURE__ */ e(l, { label: "С очисткой", isClearable: !0, value: "Можно очистить" }),
92
+ /* @__PURE__ */ e(l, { label: "Загрузка", isLoading: !0 }),
93
+ /* @__PURE__ */ e(l, { label: "Закругленное", className: "rounded", placeholder: "rounded" })
94
+ ] }),
95
+ /* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: [
96
+ /* @__PURE__ */ e("h3", { children: "Маленький размер (36px)" }),
97
+ /* @__PURE__ */ e(l, { label: "Поле sm", className: "sm", placeholder: "Маленькое поле" }),
98
+ /* @__PURE__ */ e(l, { label: "С иконкой", className: "sm", iconType: "search", placeholder: "Поиск..." }),
99
+ /* @__PURE__ */ e(
100
+ l,
101
+ {
102
+ label: "С ошибкой",
103
+ className: "sm",
104
+ hasError: !0,
105
+ errorMessage: "Маленькая ошибка",
106
+ value: "Ошибка"
107
+ }
108
+ ),
109
+ /* @__PURE__ */ e(l, { label: "С очисткой", className: "sm", isClearable: !0, value: "Можно очистить" }),
110
+ /* @__PURE__ */ e(l, { label: "Загрузка", className: "sm", isLoading: !0 }),
111
+ /* @__PURE__ */ e(l, { label: "Закругленное sm", className: "sm rounded", placeholder: "sm + rounded" })
112
+ ] })
113
+ ] })
114
+ }, E = {
115
+ render: () => /* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: "8px", maxWidth: "400px" }, children: [
116
+ /* @__PURE__ */ e(l, { label: "Обычный размер (44px)", value: "Текст" }),
117
+ /* @__PURE__ */ e(l, { label: "Маленький (36px)", className: "sm", value: "Текст" }),
118
+ /* @__PURE__ */ e(l, { label: "Обычный + rounded", className: "rounded", value: "Текст" }),
119
+ /* @__PURE__ */ e(l, { label: "Маленький + rounded", className: "sm rounded", value: "Текст" }),
120
+ /* @__PURE__ */ e("div", { style: { marginTop: "16px", height: "1px", background: "#eee" } }),
121
+ /* @__PURE__ */ e(
122
+ l,
123
+ {
124
+ label: "Комбинированный пример",
125
+ className: "sm rounded",
126
+ iconType: "password",
127
+ type: "password",
128
+ isClearable: !0,
129
+ value: "password123"
130
+ }
131
+ )
132
+ ] })
133
+ }, w = {
134
+ render: function() {
135
+ const [i, p] = t(""), [r, m] = t(!1), [c, h] = t(!1), [o, n] = t(!1), d = [r ? "sm" : "", c ? "rounded" : ""].filter(Boolean).join(" ") || void 0;
136
+ return /* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: [
137
+ /* @__PURE__ */ e(
138
+ l,
139
+ {
140
+ label: "Интерактивная демонстрация",
141
+ placeholder: "Попробуйте ввести текст",
142
+ value: i,
143
+ onChange: (s) => {
144
+ p(s.target.value), n(s.target.value.length > 0 && s.target.value.length < 3);
145
+ },
146
+ className: d,
147
+ hasError: o,
148
+ errorMessage: o ? "Слишком короткое значение" : "",
149
+ isClearable: !0,
150
+ iconType: "search"
151
+ }
152
+ ),
153
+ /* @__PURE__ */ a("div", { style: { display: "flex", flexWrap: "wrap", gap: "16px" }, children: [
154
+ /* @__PURE__ */ a("label", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
155
+ /* @__PURE__ */ e(
156
+ "input",
157
+ {
158
+ type: "checkbox",
159
+ checked: r,
160
+ onChange: (s) => m(s.target.checked)
161
+ }
162
+ ),
163
+ "Маленький размер (sm)"
164
+ ] }),
165
+ /* @__PURE__ */ a("label", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
166
+ /* @__PURE__ */ e(
167
+ "input",
168
+ {
169
+ type: "checkbox",
170
+ checked: c,
171
+ onChange: (s) => h(s.target.checked)
172
+ }
173
+ ),
174
+ "Закругленные углы"
175
+ ] }),
176
+ /* @__PURE__ */ a("label", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
177
+ /* @__PURE__ */ e(
178
+ "input",
179
+ {
180
+ type: "checkbox",
181
+ checked: o,
182
+ onChange: (s) => n(s.target.checked)
183
+ }
184
+ ),
185
+ "Показать ошибку"
186
+ ] })
187
+ ] }),
188
+ /* @__PURE__ */ a("div", { style: { background: "#f5f5f5", padding: "12px", borderRadius: "4px" }, children: [
189
+ /* @__PURE__ */ e("h4", { children: "Текущие параметры:" }),
190
+ /* @__PURE__ */ a("ul", { children: [
191
+ /* @__PURE__ */ a("li", { children: [
192
+ "Классы: ",
193
+ /* @__PURE__ */ e("strong", { children: d || "default" })
194
+ ] }),
195
+ /* @__PURE__ */ a("li", { children: [
196
+ "Высота: ",
197
+ /* @__PURE__ */ e("strong", { children: r ? "36px" : "44px" })
198
+ ] }),
199
+ c && /* @__PURE__ */ a("li", { children: [
200
+ "Радиус: ",
201
+ /* @__PURE__ */ e("strong", { children: r ? "18px" : "22px" })
202
+ ] }),
203
+ /* @__PURE__ */ a("li", { children: [
204
+ "Состояние: ",
205
+ o ? "❌ Ошибка" : "✅ Нормальное"
206
+ ] })
207
+ ] })
208
+ ] })
209
+ ] });
210
+ }
211
+ };
212
+ export {
213
+ S as AllStates,
214
+ C as Clearable,
215
+ f as Default,
216
+ k as Disabled,
217
+ w as InteractiveDemo,
218
+ T as Loading,
219
+ E as SizeComparison,
220
+ D as SmallRounded,
221
+ I as SmallSize,
222
+ N as WithError,
223
+ v as WithIcon,
224
+ y as default
225
+ };
@@ -0,0 +1,4 @@
1
+ import { TextInput as o } from "./TextInput.js";
2
+ export {
3
+ o as TextInput
4
+ };
@@ -0,0 +1,69 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as C, useState as V } from "react";
3
+ import '../../../assets/src/components/Ui/TextareaInput/TextareaInput.css';/* empty css */
4
+ import $ from "../../../_virtual/index.js";
5
+ import { IconX as b } from "../Icons/Icons.js";
6
+ const g = C(
7
+ ({
8
+ label: c,
9
+ name: p = "TextareaInput",
10
+ placeholder: f,
11
+ errorMessage: i,
12
+ hasError: u = !1,
13
+ isDisabled: x,
14
+ charLimit: a,
15
+ onChange: l,
16
+ value: o,
17
+ // Значение из пропсов
18
+ resize: v = !1,
19
+ isClearable: d,
20
+ spellCheck: N = !1
21
+ }, h) => {
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));
25
+ }, T = () => {
26
+ t && l ? l("") : m("");
27
+ }, j = $({
28
+ "no-resize": !v
29
+ });
30
+ return /* @__PURE__ */ n(
31
+ "div",
32
+ {
33
+ className: `textarea-input
34
+ ${u && "invalid"}
35
+ ${d && "clearable"}`,
36
+ children: [
37
+ c && /* @__PURE__ */ e("label", { children: c }),
38
+ /* @__PURE__ */ n("div", { className: "textarea-wrapper", children: [
39
+ /* @__PURE__ */ e(
40
+ "textarea",
41
+ {
42
+ ref: h,
43
+ className: j,
44
+ value: s,
45
+ onChange: w,
46
+ name: p,
47
+ placeholder: f,
48
+ disabled: x,
49
+ spellCheck: N
50
+ }
51
+ ),
52
+ d && s && /* @__PURE__ */ e("div", { className: "clear-value", onClick: T, children: /* @__PURE__ */ e(b, { size: 20 }) })
53
+ ] }),
54
+ a && /* @__PURE__ */ n("p", { className: "char-limit", children: [
55
+ s.length,
56
+ "/",
57
+ a
58
+ ] }),
59
+ i && /* @__PURE__ */ e("span", { className: "helper-text", children: i })
60
+ ]
61
+ }
62
+ );
63
+ }
64
+ );
65
+ g.displayName = "TextareaInput";
66
+ export {
67
+ g as TextareaInput,
68
+ g as default
69
+ };
@@ -0,0 +1,19 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { TextareaInput as e } from "./TextareaInput.js";
3
+ const l = {
4
+ title: "UIKit/TextareaInput",
5
+ component: e
6
+ }, r = {
7
+ render: (t) => /* @__PURE__ */ a(e, { ...t })
8
+ }, m = {
9
+ ...r,
10
+ args: {
11
+ label: "Введите текст:",
12
+ name: "textarea",
13
+ placeholder: "Ваш текст"
14
+ }
15
+ };
16
+ export {
17
+ m as Default,
18
+ l as default
19
+ };
@@ -0,0 +1,4 @@
1
+ import { TextareaInput as t } from "./TextareaInput.js";
2
+ export {
3
+ t as TextareaInput
4
+ };