triafly-ui-kit 1.0.14 → 1.0.15

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 CHANGED
@@ -1,93 +1,93 @@
1
- # ui-kit
2
-
3
-
4
-
5
- ## Getting started
6
-
7
- To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8
-
9
- Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10
-
11
- ## Add your files
12
-
13
- - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14
- - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
15
-
16
- ```
17
- cd existing_repo
18
- git remote add origin https://git.3afly.ru/triafly-data-platform/ui-kit.git
19
- git branch -M main
20
- git push -uf origin main
21
- ```
22
-
23
- ## Integrate with your tools
24
-
25
- - [ ] [Set up project integrations](https://git.3afly.ru/triafly-data-platform/ui-kit/-/settings/integrations)
26
-
27
- ## Collaborate with your team
28
-
29
- - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30
- - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31
- - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32
- - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33
- - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
34
-
35
- ## Test and Deploy
36
-
37
- Use the built-in continuous integration in GitLab.
38
-
39
- - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
40
- - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41
- - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42
- - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43
- - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44
-
45
- ***
46
-
47
- # Editing this README
48
-
49
- When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
50
-
51
- ## Suggestions for a good README
52
-
53
- Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
54
-
55
- ## Name
56
- Choose a self-explaining name for your project.
57
-
58
- ## Description
59
- Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
60
-
61
- ## Badges
62
- On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
63
-
64
- ## Visuals
65
- Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
66
-
67
- ## Installation
68
- Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
69
-
70
- ## Usage
71
- Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
72
-
73
- ## Support
74
- Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
75
-
76
- ## Roadmap
77
- If you have ideas for releases in the future, it is a good idea to list them in the README.
78
-
79
- ## Contributing
80
- State if you are open to contributions and what your requirements are for accepting them.
81
-
82
- For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
83
-
84
- You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
85
-
86
- ## Authors and acknowledgment
87
- Show your appreciation to those who have contributed to the project.
88
-
89
- ## License
90
- For open source projects, say how it is licensed.
91
-
92
- ## Project status
93
- If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
1
+ # ui-kit
2
+
3
+
4
+
5
+ ## Getting started
6
+
7
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8
+
9
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10
+
11
+ ## Add your files
12
+
13
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
15
+
16
+ ```
17
+ cd existing_repo
18
+ git remote add origin https://git.3afly.ru/triafly-data-platform/ui-kit.git
19
+ git branch -M main
20
+ git push -uf origin main
21
+ ```
22
+
23
+ ## Integrate with your tools
24
+
25
+ - [ ] [Set up project integrations](https://git.3afly.ru/triafly-data-platform/ui-kit/-/settings/integrations)
26
+
27
+ ## Collaborate with your team
28
+
29
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33
+ - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
34
+
35
+ ## Test and Deploy
36
+
37
+ Use the built-in continuous integration in GitLab.
38
+
39
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
40
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44
+
45
+ ***
46
+
47
+ # Editing this README
48
+
49
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
50
+
51
+ ## Suggestions for a good README
52
+
53
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
54
+
55
+ ## Name
56
+ Choose a self-explaining name for your project.
57
+
58
+ ## Description
59
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
60
+
61
+ ## Badges
62
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
63
+
64
+ ## Visuals
65
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
66
+
67
+ ## Installation
68
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
69
+
70
+ ## Usage
71
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
72
+
73
+ ## Support
74
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
75
+
76
+ ## Roadmap
77
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
78
+
79
+ ## Contributing
80
+ State if you are open to contributions and what your requirements are for accepting them.
81
+
82
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
83
+
84
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
85
+
86
+ ## Authors and acknowledgment
87
+ Show your appreciation to those who have contributed to the project.
88
+
89
+ ## License
90
+ For open source projects, say how it is licensed.
91
+
92
+ ## Project status
93
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -0,0 +1,113 @@
1
+ import { jsxs as b, jsx as e, Fragment as $ } from "react/jsx-runtime";
2
+ import { memo as w, useCallback as u } from "react";
3
+ import { IconCaretDown as D, IconCaretRight as O, IconFolderSimple as R, IconFile as q } from "./components/Ui/Icons/Icons.js";
4
+ import { Loader as z } from "./components/Ui/Loader/Loader.js";
5
+ import { c as v } from "./index-2QXL0WYc.js";
6
+ import './assets/TreeList.css';const A = "_selected_1oo5t_114", r = {
7
+ "tree-item": "_tree-item_1oo5t_76",
8
+ "tree-item-toggle": "_tree-item-toggle_1oo5t_83",
9
+ "tree-item-toggle-placeholder": "_tree-item-toggle-placeholder_1oo5t_86",
10
+ "tree-item-loader": "_tree-item-loader_1oo5t_89",
11
+ "tree-item-toggle-icon-folder": "_tree-item-toggle-icon-folder_1oo5t_97",
12
+ "tree-item-content": "_tree-item-content_1oo5t_103",
13
+ selected: A,
14
+ "tree-item-lebal": "_tree-item-lebal_1oo5t_118"
15
+ }, B = ({
16
+ node: o,
17
+ onSelect: l,
18
+ level: h = 0,
19
+ childrenKey: m = "children",
20
+ idKey: c = "id",
21
+ nameKey: g = "name",
22
+ typeKey: s = "type",
23
+ expandedKeys: d = [],
24
+ onExpand: i,
25
+ selectedKey: a,
26
+ isFetching: _ = !1,
27
+ TreeItemClassName: p = "",
28
+ TreeItemContentClassName: f = ""
29
+ }) => {
30
+ var T;
31
+ const n = o[c], k = o[g], L = o[s], N = d.includes(n), I = ((T = o[m]) == null ? void 0 : T.filter((t) => t[s] === "directory").length) > 0, j = a === n, C = a === n && _, F = u(
32
+ (t) => {
33
+ t.stopPropagation(), i == null || i(n);
34
+ },
35
+ [n, i]
36
+ ), P = u(
37
+ (t) => {
38
+ t.stopPropagation(), l == null || l(o);
39
+ },
40
+ [o, l]
41
+ );
42
+ return /* @__PURE__ */ b("div", { className: v(r["tree-item"], p), children: [
43
+ /* @__PURE__ */ b(
44
+ "div",
45
+ {
46
+ className: v(
47
+ r["tree-item-content"],
48
+ j ? r.selected : "",
49
+ f
50
+ ),
51
+ onClick: P,
52
+ children: [
53
+ C && /* @__PURE__ */ e("div", { className: r["tree-item-loader"], children: /* @__PURE__ */ e(z, {}) }),
54
+ I && !C ? /* @__PURE__ */ e("span", { onClick: F, className: r["tree-item-toggle"], children: N ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(O, {}) }) : /* @__PURE__ */ e("span", { className: r["tree-item-toggle-placeholder"] }),
55
+ /* @__PURE__ */ e("span", { className: r["tree-item-toggle-icon-folder"], children: L === "directory" ? /* @__PURE__ */ e(R, { color: "gray" }) : /* @__PURE__ */ e(q, {}) }),
56
+ /* @__PURE__ */ e("span", { className: `${r["tree-item-lebal"]}`, children: k })
57
+ ]
58
+ }
59
+ ),
60
+ N && I && /* @__PURE__ */ e($, { children: o[m].filter((t) => t[s] === "directory").map((t) => /* @__PURE__ */ e(
61
+ H,
62
+ {
63
+ node: t,
64
+ isFetching: _,
65
+ level: h + 1,
66
+ onSelect: l,
67
+ selectedKey: a,
68
+ childrenKey: m,
69
+ idKey: c,
70
+ nameKey: g,
71
+ typeKey: s,
72
+ expandedKeys: d,
73
+ onExpand: i
74
+ },
75
+ t[c]
76
+ )) })
77
+ ] });
78
+ }, G = w(B), H = ({
79
+ node: o,
80
+ onSelect: l,
81
+ childrenKey: h = "children",
82
+ expandedKeys: m = [],
83
+ onExpand: c,
84
+ level: g = 0,
85
+ selectedKey: s,
86
+ idKey: d = "id",
87
+ nameKey: i = "name",
88
+ typeKey: a = "type",
89
+ isFetching: _,
90
+ TreeItemClassName: p = "",
91
+ TreeItemContentClassName: f = ""
92
+ }) => /* @__PURE__ */ e(
93
+ G,
94
+ {
95
+ node: o,
96
+ isFetching: _,
97
+ level: g,
98
+ onSelect: l,
99
+ selectedKey: s,
100
+ childrenKey: h,
101
+ expandedKeys: m,
102
+ onExpand: c,
103
+ idKey: d,
104
+ nameKey: i,
105
+ typeKey: a,
106
+ TreeItemClassName: p,
107
+ TreeItemContentClassName: f
108
+ }
109
+ );
110
+ export {
111
+ H as T,
112
+ G as a
113
+ };
@@ -1 +1 @@
1
- ._container_193w2_1{position:relative;width:100%;height:100vh;padding:20px;display:flex;flex-wrap:wrap;justify-content:space-between;align-content:space-between;border:1px dashed #ccc;box-sizing:border-box}._trigger_193w2_14{padding:8px 16px;background-color:#1976d2;color:#fff;border-radius:4px;font-size:14px;cursor:pointer;transition:background-color .2s;text-align:center}._trigger_193w2_14:hover{background-color:#1565c0}._clickTrigger_193w2_29{background-color:#388e3c}._clickTrigger_193w2_29:hover{background-color:#2e7d32}._positionsContainer_193w2_38{padding:20px}._positionGroup_193w2_42{display:flex;gap:20px;margin-bottom:30px;justify-content:center;flex-wrap:wrap}
1
+ ._container_x4z3a_1{position:relative;width:100%;height:100vh;padding:20px;display:flex;flex-wrap:wrap;justify-content:space-between;align-content:space-between;border:1px dashed #ccc;box-sizing:border-box}._trigger_x4z3a_27{padding:8px 16px;background-color:#1976d2;color:#fff;border-radius:4px;font-size:14px;cursor:pointer;transition:background-color .2s;text-align:center}._trigger_x4z3a_27:hover{background-color:#1565c0}._clickTrigger_x4z3a_57{background-color:#388e3c}._clickTrigger_x4z3a_57:hover{background-color:#2e7d32}._positionsContainer_x4z3a_75{padding:20px}._positionGroup_x4z3a_83{display:flex;gap:20px;margin-bottom:30px;justify-content:center;flex-wrap:wrap}
@@ -0,0 +1 @@
1
+ ._tree-wrapper_1yvw0_1{max-height:100%;width:100%;overflow-y:auto}
@@ -0,0 +1 @@
1
+ @font-face{font-family:Roboto Slab;src:url(../assets/fonts/RobotoSlab-SemiBold.ttf) format("truetype");font-weight:600}@font-face{font-family:Manrope;src:url(../assets/fonts/Manrope-Regular.ttf) format("truetype");font-weight:400}@font-face{font-family:Manrope;src:url(../assets/fonts/Manrope-Semibold.ttf) format("truetype");font-weight:600}@font-face{font-family:Manrope;src:url(../assets/fonts/Manrope-Bold.ttf) format("truetype");font-weight:700}@font-face{font-family:Fira Code;src:url(../assets/fonts/FiraCode-Regular.ttf) format("truetype");font-weight:400}*{font-family:Manrope,sans-serif;font-size:14px;line-height:1.2em;letter-spacing:.02em;font-weight:400;color:var(--color-text-primary-default)}h1,h2,h3,h4,h5,h6{margin:0}a{color:var(--color-text-brand-default);text-decoration:none}a:hover{color:var(--color-text-brand-hover)}a[href=""]{opacity:40%;cursor:default;pointer-events:none}p:not(:last-child){margin:0 0 8px}._tree-item_1oo5t_76{padding:4px;border-radius:4px;cursor:pointer;margin-left:10px;width:100%}._tree-item_1oo5t_76 ._tree-item-toggle_1oo5t_83{cursor:pointer}._tree-item_1oo5t_76 ._tree-item-toggle-placeholder_1oo5t_86{background-color:red}._tree-item_1oo5t_76 ._tree-item-loader_1oo5t_89{width:20px;height:20px;display:flex;align-items:center;justify-content:flex-end;position:relative}._tree-item_1oo5t_76 ._tree-item-toggle-icon-folder_1oo5t_97{color:var(--color-icon-secondary-default)}._tree-item_1oo5t_76 ._test_1oo5t_100{fill:var(--color-icon-secondary-default)}._tree-item_1oo5t_76 ._tree-item-content_1oo5t_103{display:flex;gap:8px;align-items:center;cursor:pointer;padding:9.5px 16px}._tree-item_1oo5t_76 ._tree-item-content_1oo5t_103 span{font-size:14px;font-weight:400}._tree-item_1oo5t_76 ._tree-item-content_1oo5t_103._selected_1oo5t_114{background-color:var(--color-bg-island-selected);border-radius:4px}._tree-item_1oo5t_76 ._tree-item-lebal_1oo5t_118{word-wrap:break-word;overflow-wrap:break-word;white-space:normal;-webkit-hyphens:auto;hyphens:auto;max-width:100px}
@@ -1,6 +1,6 @@
1
1
  import { jsxs as e, jsx as i } from "react/jsx-runtime";
2
2
  import { Tooltip as o } from "./Tooltip.js";
3
- import '../../../assets/Tooltip.css';const c = "_container_193w2_1", r = "_trigger_193w2_14", n = "_clickTrigger_193w2_29 _trigger_193w2_14", l = "_positionsContainer_193w2_38", s = "_positionGroup_193w2_42", t = {
3
+ import '../../../assets/Tooltip.css';const c = "_container_x4z3a_1", r = "_trigger_x4z3a_27", n = "_clickTrigger_x4z3a_57 _trigger_x4z3a_27", l = "_positionsContainer_x4z3a_75", s = "_positionGroup_x4z3a_83", t = {
4
4
  container: c,
5
5
  trigger: r,
6
6
  clickTrigger: n,
@@ -0,0 +1,241 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Tree as i } from "./TreeEl/Tree.js";
3
+ const m = {
4
+ title: "Components/Tree",
5
+ component: i,
6
+ parameters: {
7
+ layout: "centered"
8
+ },
9
+ argTypes: {
10
+ data: { control: "object" },
11
+ onSelect: { action: "selected" },
12
+ defaultExpandedKeys: { control: "object" },
13
+ selectedKey: { control: "text" },
14
+ autoExpandParent: { control: "boolean" },
15
+ idKey: { control: "text" },
16
+ nameKey: { control: "text" },
17
+ typeKey: { control: "text" },
18
+ childrenKey: { control: "text" }
19
+ }
20
+ }, o = (d) => /* @__PURE__ */ t(i, { ...d }), a = o.bind({});
21
+ a.args = {
22
+ data: [
23
+ {
24
+ id: "1",
25
+ name: "Работа",
26
+ type: "folder",
27
+ modifiedAt: "05-02-2025 12:00",
28
+ size: "-",
29
+ branches: [
30
+ {
31
+ id: "1-1",
32
+ name: "Документы",
33
+ type: "folder",
34
+ modifiedAt: "05-02-2025 12:10",
35
+ size: "-",
36
+ branches: [
37
+ ...Array.from({ length: 50 }, (d, e) => ({
38
+ id: `1-1-${e}`,
39
+ name: `Файл ${e + 1}.docx`,
40
+ type: "file",
41
+ modifiedAt: "05-02-2025 13:00",
42
+ size: `${(Math.random() * 2 + 0.5).toFixed(2)} MB`,
43
+ fileType: "docx"
44
+ })),
45
+ {
46
+ id: "1-1-51",
47
+ name: "Проекты",
48
+ type: "folder",
49
+ modifiedAt: "05-02-2025 13:10",
50
+ size: "-",
51
+ branches: Array.from({ length: 20 }, (d, e) => ({
52
+ id: `1-1-51-${e}`,
53
+ name: `Проект_${e + 1}.pptx`,
54
+ type: "file",
55
+ modifiedAt: "05-02-2025 14:00",
56
+ size: `${(Math.random() * 5 + 1).toFixed(2)} MB`,
57
+ fileType: "pptx"
58
+ }))
59
+ },
60
+ {
61
+ id: "1-1-52",
62
+ name: "Исследования",
63
+ type: "folder",
64
+ modifiedAt: "05-02-2025 14:20",
65
+ size: "-",
66
+ branches: [
67
+ {
68
+ id: "1-1-52-1",
69
+ name: "2023",
70
+ type: "folder",
71
+ modifiedAt: "05-02-2025 14:30",
72
+ size: "-",
73
+ branches: Array.from({ length: 15 }, (d, e) => ({
74
+ id: `1-1-52-1-${e}`,
75
+ name: `Отчет_2023_${e + 1}.pdf`,
76
+ type: "file",
77
+ modifiedAt: "05-02-2025 15:00",
78
+ size: `${(Math.random() * 3 + 1).toFixed(2)} MB`,
79
+ fileType: "pdf"
80
+ }))
81
+ },
82
+ {
83
+ id: "1-1-52-2",
84
+ name: "2024",
85
+ type: "folder",
86
+ modifiedAt: "05-02-2025 15:10",
87
+ size: "-",
88
+ branches: Array.from({ length: 15 }, (d, e) => ({
89
+ id: `1-1-52-2-${e}`,
90
+ name: `Отчет_2024_${e + 1}.pdf`,
91
+ type: "file",
92
+ modifiedAt: "05-02-2025 15:20",
93
+ size: `${(Math.random() * 3 + 1).toFixed(2)} MB`,
94
+ fileType: "pdf"
95
+ }))
96
+ }
97
+ ]
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ id: "1-2",
103
+ name: "Продажи",
104
+ type: "folder",
105
+ modifiedAt: "05-02-2025 12:20",
106
+ size: "-",
107
+ branches: [
108
+ ...Array.from({ length: 30 }, (d, e) => ({
109
+ id: `1-2-${e}`,
110
+ name: `Отчет_${e + 1}.xlsx`,
111
+ type: "file",
112
+ modifiedAt: "05-02-2025 13:40",
113
+ size: `${(Math.random() * 1.5 + 0.2).toFixed(2)} MB`,
114
+ fileType: "xlsx"
115
+ })),
116
+ {
117
+ id: "1-2-31",
118
+ name: "Контракты",
119
+ type: "folder",
120
+ modifiedAt: "05-02-2025 14:40",
121
+ size: "-",
122
+ branches: Array.from({ length: 10 }, (d, e) => ({
123
+ id: `1-2-31-${e}`,
124
+ name: `Контракт_${e + 1}.pdf`,
125
+ type: "file",
126
+ modifiedAt: "05-02-2025 15:50",
127
+ size: `${(Math.random() * 4 + 1).toFixed(2)} MB`,
128
+ fileType: "pdf"
129
+ }))
130
+ }
131
+ ]
132
+ }
133
+ ]
134
+ },
135
+ {
136
+ id: "2",
137
+ name: "Личное",
138
+ type: "folder",
139
+ modifiedAt: "05-02-2025 11:00",
140
+ size: "-",
141
+ branches: [
142
+ {
143
+ id: "2-1",
144
+ name: "Фото",
145
+ type: "folder",
146
+ modifiedAt: "05-02-2025 11:20",
147
+ size: "-",
148
+ branches: [
149
+ ...Array.from({ length: 20 }, (d, e) => ({
150
+ id: `2-1-${e}`,
151
+ name: `Фото_${e + 1}.jpg`,
152
+ type: "file",
153
+ modifiedAt: "05-02-2025 12:30",
154
+ size: `${(Math.random() * 5 + 1).toFixed(2)} MB`,
155
+ fileType: "jpg"
156
+ })),
157
+ {
158
+ id: "2-1-21",
159
+ name: "Путешествия",
160
+ type: "folder",
161
+ modifiedAt: "05-02-2025 13:50",
162
+ size: "-",
163
+ branches: [
164
+ {
165
+ id: "2-1-21-1",
166
+ name: "Италия",
167
+ type: "folder",
168
+ modifiedAt: "05-02-2025 14:00",
169
+ size: "-",
170
+ branches: Array.from({ length: 10 }, (d, e) => ({
171
+ id: `2-1-21-1-${e}`,
172
+ name: `Италия_${e + 1}.jpg`,
173
+ type: "file",
174
+ modifiedAt: "05-02-2025 14:10",
175
+ size: `${(Math.random() * 5 + 1).toFixed(2)} MB`,
176
+ fileType: "jpg"
177
+ }))
178
+ },
179
+ {
180
+ id: "2-1-21-2",
181
+ name: "Япония",
182
+ type: "folder",
183
+ modifiedAt: "05-02-2025 14:20",
184
+ size: "-",
185
+ branches: Array.from({ length: 10 }, (d, e) => ({
186
+ id: `2-1-21-2-${e}`,
187
+ name: `Япония_${e + 1}.jpg`,
188
+ type: "file",
189
+ modifiedAt: "05-02-2025 14:30",
190
+ size: `${(Math.random() * 5 + 1).toFixed(2)} MB`,
191
+ fileType: "jpg"
192
+ }))
193
+ }
194
+ ]
195
+ }
196
+ ]
197
+ },
198
+ {
199
+ id: "2-2",
200
+ name: "Видео",
201
+ type: "folder",
202
+ modifiedAt: "05-02-2025 12:40",
203
+ size: "-",
204
+ branches: [
205
+ ...Array.from({ length: 15 }, (d, e) => ({
206
+ id: `2-2-${e}`,
207
+ name: `Видео_${e + 1}.mp4`,
208
+ type: "file",
209
+ modifiedAt: "05-02-2025 14:50",
210
+ size: `${(Math.random() * 100 + 10).toFixed(2)} MB`,
211
+ fileType: "mp4"
212
+ })),
213
+ {
214
+ id: "2-2-16",
215
+ name: "Семейные Видео",
216
+ type: "folder",
217
+ modifiedAt: "05-02-2025 15:00",
218
+ size: "-",
219
+ branches: Array.from({ length: 10 }, (d, e) => ({
220
+ id: `2-2-16-${e}`,
221
+ name: `Семья_${e + 1}.mp4`,
222
+ type: "file",
223
+ modifiedAt: "05-02-2025 15:10",
224
+ size: `${(Math.random() * 50 + 5).toFixed(2)} MB`,
225
+ fileType: "mp4"
226
+ }))
227
+ }
228
+ ]
229
+ }
230
+ ]
231
+ }
232
+ ],
233
+ idKey: "id",
234
+ nameKey: "name",
235
+ typeKey: "type",
236
+ childrenKey: "branches"
237
+ };
238
+ export {
239
+ a as WithCustomKeys,
240
+ m as default
241
+ };
@@ -0,0 +1,76 @@
1
+ import { jsx as I } from "react/jsx-runtime";
2
+ import { useState as T, useEffect as _, useCallback as x } from "react";
3
+ import { T as H } from "../../../../TreeList-Z1F3eQH6.js";
4
+ import { c as J } from "../../../../index-2QXL0WYc.js";
5
+ import '../../../../assets/Tree.css';const M = {
6
+ "tree-wrapper": "_tree-wrapper_1yvw0_1"
7
+ }, U = ({
8
+ data: n = [],
9
+ childrenKey: p = "children",
10
+ idKey: t = "id",
11
+ // ключ по умолчанию
12
+ nameKey: i = "name",
13
+ // ключ по умолчанию
14
+ typeKey: f = "type",
15
+ // ключ по умолчанию
16
+ onSelect: r,
17
+ defaultExpandedKeys: N = [],
18
+ // открытые элементы
19
+ autoExpandParent: b = !1,
20
+ // Автоматически раскрывать родительские элементы
21
+ expandedKeys: o,
22
+ // Управление извне
23
+ onExpandedKeysChange: u,
24
+ // Колбэк для изменения expandedKeys
25
+ selectedKey: a,
26
+ isFetching: j,
27
+ isAllExpanded: w = !1,
28
+ wrapperTreeClassName: l = "",
29
+ TreeItemClassName: D = "",
30
+ TreeItemContentClassName: L = ""
31
+ }) => {
32
+ const [q, c] = T(N), [z, e] = T(null), m = o !== void 0 ? o : q, B = a !== void 0 ? a : z;
33
+ _(() => {
34
+ a !== void 0 && e(a);
35
+ }, [a]), _(() => {
36
+ if (!w) return;
37
+ const s = A(n, t, f, p);
38
+ u ? u(s) : c(s);
39
+ }, [w]);
40
+ const E = x(
41
+ (s) => {
42
+ const v = m.includes(s) ? m.filter((G) => G !== s) : [...m, s];
43
+ u ? u(v) : c(v);
44
+ },
45
+ [m, u]
46
+ ), F = x(
47
+ (s) => {
48
+ const v = s[t];
49
+ a === void 0 && e(v), r == null || r(s);
50
+ },
51
+ [a, r, t]
52
+ );
53
+ return /* @__PURE__ */ I("div", { className: J(M["tree-wrapper"], l), children: n.map((s) => /* @__PURE__ */ I(
54
+ H,
55
+ {
56
+ node: s,
57
+ level: 0,
58
+ isFetching: j,
59
+ onSelect: F,
60
+ selectedKey: B,
61
+ childrenKey: p,
62
+ idKey: t,
63
+ nameKey: i,
64
+ typeKey: f,
65
+ expandedKeys: m,
66
+ onExpand: E,
67
+ autoExpandParent: b,
68
+ TreeItemClassName: D,
69
+ TreeItemContentClassName: L
70
+ },
71
+ s[t]
72
+ )) });
73
+ }, A = (n, p, t, i) => n.reduce((f, r) => (r[t] === "directory" && (f.push(r[p]), r[i] && Array.isArray(r[i]) && f.push(...A(r[i], p, t, i))), f), []);
74
+ export {
75
+ U as Tree
76
+ };
@@ -0,0 +1,4 @@
1
+ import { Tree as o } from "./Tree.js";
2
+ export {
3
+ o as Tree
4
+ };
@@ -0,0 +1,9 @@
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "../../Icons/Icons.js";
4
+ import { a as e } from "../../../../TreeList-Z1F3eQH6.js";
5
+ import "../../Loader/Loader.js";
6
+ import "../../../../index-2QXL0WYc.js";
7
+ export {
8
+ e as default
9
+ };
@@ -0,0 +1,5 @@
1
+ import "react/jsx-runtime";
2
+ import { T as a } from "../../../../TreeList-Z1F3eQH6.js";
3
+ export {
4
+ a as default
5
+ };
@@ -0,0 +1,4 @@
1
+ import { Tree as o } from "./TreeEl/Tree.js";
2
+ export {
3
+ o as Tree
4
+ };
package/dist/main.d.ts CHANGED
@@ -1047,13 +1047,6 @@ declare type SwitchProps = {
1047
1047
  name?: string;
1048
1048
  };
1049
1049
 
1050
- export declare interface TabItem {
1051
- key: string;
1052
- label: string;
1053
- children: ReactNode;
1054
- disabled?: boolean;
1055
- }
1056
-
1057
1050
  export declare const Table: <T extends object>(props: TablesProps<T>) => JSX.Element;
1058
1051
 
1059
1052
  declare type TablesProps<T extends object = Record<string, unknown>> = {
@@ -1080,14 +1073,6 @@ declare type TablesProps<T extends object = Record<string, unknown>> = {
1080
1073
  loading?: boolean;
1081
1074
  };
1082
1075
 
1083
- export declare const Tabs: React.FC<TabsProps>;
1084
-
1085
- export declare interface TabsProps {
1086
- items: TabItem[];
1087
- defaultActiveKey?: string;
1088
- onChange?: (activeKey: string) => void;
1089
- }
1090
-
1091
1076
  export declare const TextareaInput: ForwardRefExoticComponent<TextareaInputProps & RefAttributes<HTMLTextAreaElement>>;
1092
1077
 
1093
1078
  declare type TextareaInputProps = {
@@ -1146,6 +1131,30 @@ declare interface TooltipProps {
1146
1131
  className?: string;
1147
1132
  }
1148
1133
 
1134
+ export declare const Tree: <T extends TreeNodeBase>({ data, childrenKey, idKey, nameKey, typeKey, onSelect, defaultExpandedKeys, autoExpandParent, expandedKeys: externalExpandedKeys, onExpandedKeysChange, selectedKey: controlledSelectedKey, isFetching, isAllExpanded, wrapperTreeClassName, TreeItemClassName, TreeItemContentClassName, }: TreeProps<T>) => JSX.Element;
1135
+
1136
+ declare type TreeNodeBase = Record<string, unknown>;
1137
+
1138
+ declare type TreeProps<T extends TreeNodeBase> = {
1139
+ data: T[];
1140
+ childrenKey?: keyof T | string;
1141
+ idKey?: keyof T | string;
1142
+ nameKey?: keyof T | string;
1143
+ typeKey?: keyof T | string;
1144
+ onSelect?: (node: T) => void;
1145
+ defaultExpandedKeys?: (string | number)[];
1146
+ expandedKeys?: (string | number)[];
1147
+ onExpandedKeysChange?: (keys: (string | number)[]) => void;
1148
+ autoExpandParent?: boolean;
1149
+ selectedKey?: string | number | null;
1150
+ setSectedKey?: (value: string | number | null) => void;
1151
+ isFetching?: boolean;
1152
+ isAllExpanded?: boolean;
1153
+ wrapperTreeClassName?: string;
1154
+ TreeItemClassName?: string;
1155
+ TreeItemContentClassName?: string;
1156
+ };
1157
+
1149
1158
  export declare const TriaflyContext: Context<TriaflyContextType | undefined>;
1150
1159
 
1151
1160
  declare interface TriaflyContextType {
package/dist/main.js CHANGED
@@ -22,7 +22,7 @@ import { Table as E } from "./components/Ui/Table/Table.js";
22
22
  import { TextInput as V } from "./components/Ui/TextInput/TextInput.js";
23
23
  import { TextareaInput as z } from "./components/Ui/TextareaInput/TextareaInput.js";
24
24
  import { Tooltip as Y } from "./components/Ui/Tooltip/Tooltip.js";
25
- import { Tabs as q } from "./components/Ui/Tabs/Tabs.js";
25
+ import { Tree as q } from "./components/Ui/Tree/TreeEl/Tree.js";
26
26
  import { IconArrowBendUpRight as Z, IconArrowClockwise as _, IconArrowDown as $, IconArrowLeft as oo, IconArrowLineDown as no, IconArrowLineLeft as ro, IconArrowLineRight as eo, IconArrowLineUp as co, IconArrowRight as Io, IconArrowUp as to, IconArrowsOut as io, IconArticle as ao, IconAt as po, IconBellSimple as lo, IconBookOpenText as fo, IconCalendarBlank as mo, IconCaretDown as xo, IconCaretLeft as so, IconCaretRight as uo, IconCaretUp as Co, IconCaretUpDown as ho, IconChartPieSlice as wo, IconChatText as So, IconCheck as To, IconCheckCircle as go, IconChecks as Ao, IconCircleNotch as Lo, IconCopy as ko, IconCornersOut as Do, IconCsv as Po, IconCube as Uo, IconDatabase as yo, IconDotsNine as Fo, IconDotsThreeVertical as Bo, IconExport as vo, IconEye as Mo, IconEyeSlash as Ro, IconFile as Xo, IconFiles as bo, IconFloppyDisk as Ho, IconFolderSimple as No, IconFolderSimpleX as Oo, IconFunnel as Qo, IconGauge as Eo, IconGear as Go, IconGoogleDrive as Vo, IconHand as Wo, IconHeadCircuit as zo, IconHouse as Jo, IconIcon as Yo, IconInfo as jo, IconJoin as qo, IconLanguage as Ko, IconLink as Zo, IconList as _o, IconLock as $o, IconLockOpen as on, IconMariaDB as nn, IconMinus as rn, IconMongoDB as en, IconMoon as cn, IconMySQL as In, IconNavigationArrow as tn, IconNotePencil as an, IconPassword as pn, IconPen as ln, IconPlay as fn, IconPlugsX as mn, IconPlus as xn, IconPorsgteSQL as sn, IconPresentationChart as un, IconQuestion as Cn, IconQuestionFullfilled as dn, IconRedo as hn, IconRoleX as wn, IconSearch as Sn, IconSearchX as Tn, IconSelection as gn, IconServer as An, IconSlidersHorizontal as Ln, IconSticker as kn, IconSun as Dn, IconThreeDot as Pn, IconTrash as Un, IconTriangleDown as yn, IconTriangleUp as Fn, IconUndo as Bn, IconUploadSimple as vn, IconUser as Mn, IconUserX as Rn, IconWarningCircle as Xn, IconWrench as bn, IconX as Hn, IconYandexDisk as Nn } from "./components/Ui/Icons/Icons.js";
27
27
  import { ToastProvider as Qn } from "./context/ToastContext/ToastContext.js";
28
28
  import { TriaflyContext as Gn, TriaflyProvider as Vn, useTriafly as Wn } from "./context/TriaflyContext/TriaflyProvider.js";
@@ -143,11 +143,11 @@ export {
143
143
  H as Skeleton,
144
144
  O as Switch,
145
145
  E as Table,
146
- q as Tabs,
147
146
  V as TextInput,
148
147
  z as TextareaInput,
149
148
  Qn as ToastProvider,
150
149
  Y as Tooltip,
150
+ q as Tree,
151
151
  Gn as TriaflyContext,
152
152
  Vn as TriaflyProvider,
153
153
  Jn as useBreakpointValueTriafly,
package/package.json CHANGED
@@ -1,106 +1,106 @@
1
- {
2
- "name": "triafly-ui-kit",
3
- "version": "1.0.14",
4
- "description": "UI Kit from Triafly",
5
- "main": "./dist/main.js",
6
- "module": "./dist/main.js",
7
- "types": "./dist/main.d.ts",
8
- "type": "module",
9
- "exports": {
10
- ".": {
11
- "import": "./dist/main.js",
12
- "types": "./dist/main.d.ts"
13
- },
14
- "./dist/*": {
15
- "types": "./dist/*.d.ts"
16
- }
17
- },
18
- "files": [
19
- "dist"
20
- ],
21
- "scripts": {
22
- "build": "npm run build:types && vite build",
23
- "build:types": "tsc --build tsconfig.build.json",
24
- "dev": "vite",
25
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
26
- "preview": "vite preview",
27
- "prepare": "husky install",
28
- "precommit": "npm run lint-staged",
29
- "lint-staged": "lint-staged",
30
- "storybook": "storybook dev -p 6006",
31
- "build-storybook": "storybook build",
32
- "prepublish": "npm run build",
33
- "release-patch": "npm run build && npm version patch && git push && npm publish"
34
- },
35
- "browserslist": [
36
- "cover 99.5%"
37
- ],
38
- "peerDependencies": {
39
- "classnames": "^2.5.1",
40
- "react": "^18.0.0",
41
- "react-dom": "^18.0.0",
42
- "react-router-dom": "6.26.1"
43
- },
44
- "dependencies": {
45
- "fast-deep-equal": "^3.1.3",
46
- "papaparse": "^5.4.1",
47
- "react-paginate": "^8.2.0"
48
- },
49
- "devDependencies": {
50
- "storybook": "^8.6.14",
51
- "vite-plugin-lib-inject-css": "^2.2.2",
52
- "@chromatic-com/storybook": "^3.2.3",
53
- "@eslint/js": "^9.25.0",
54
- "@storybook/addon-backgrounds": "^8.5.2",
55
- "@storybook/addon-essentials": "^8.4.7",
56
- "@storybook/addon-interactions": "^8.4.7",
57
- "@storybook/addon-onboarding": "^8.4.7",
58
- "@storybook/blocks": "^8.4.7",
59
- "@storybook/react": "^8.4.7",
60
- "@storybook/react-vite": "^8.4.7",
61
- "@storybook/test": "^8.4.7",
62
- "@types/eslint-plugin-jsx-a11y": "^6.10.0",
63
- "@types/eslint-plugin-prettier": "^3.1.3",
64
- "@types/node": "^22.15.21",
65
- "@types/papaparse": "^5.3.16",
66
- "@types/react": "^18.2.25",
67
- "@types/react-dom": "^18.2.25",
68
- "@typescript-eslint/eslint-plugin": "^6.21.0",
69
- "@typescript-eslint/parser": "^6.21.0",
70
- "@vitejs/plugin-react-swc": "^3.9.0",
71
- "autoprefixer": "^10.4.21",
72
- "eslint": "^8.57.0",
73
- "eslint-config-airbnb-typescript": "^17.1.0",
74
- "eslint-config-prettier": "^9.1.0",
75
- "eslint-import-resolver-typescript": "^4.4.1",
76
- "eslint-plugin-import": "^2.29.1",
77
- "eslint-plugin-jsx-a11y": "^6.8.0",
78
- "eslint-plugin-prettier": "^5.2.1",
79
- "eslint-plugin-react": "^7.34.1",
80
- "eslint-plugin-react-hooks": "^4.6.0",
81
- "eslint-plugin-react-refresh": "^0.4.19",
82
- "glob": "^11.0.2",
83
- "globals": "^16.0.0",
84
- "husky": "^9.1.7",
85
- "lint-staged": "^16.0.0",
86
- "react": "18.2.0",
87
- "react-dom": "18.2.0",
88
- "react-router-dom": "6.26.1",
89
- "sass": "^1.89.0",
90
- "typescript": "~5.8.3",
91
- "typescript-eslint": "^8.30.1",
92
- "vite": "^6.3.5",
93
- "vite-plugin-dts": "^4.5.4",
94
- "vite-plugin-static-copy": "^3.0.0",
95
- "vite-plugin-svgr": "^4.3.0"
96
- },
97
- "publishConfig": {
98
- "access": "public"
99
- },
100
- "lint-staged": {
101
- "src/**/*.{ts,tsx}": [
102
- "eslint --fix",
103
- "prettier --write --ignore-unknown"
104
- ]
105
- }
106
- }
1
+ {
2
+ "name": "triafly-ui-kit",
3
+ "version": "1.0.15",
4
+ "description": "UI Kit from Triafly",
5
+ "main": "./dist/main.js",
6
+ "module": "./dist/main.js",
7
+ "types": "./dist/main.d.ts",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/main.js",
12
+ "types": "./dist/main.d.ts"
13
+ },
14
+ "./dist/*": {
15
+ "types": "./dist/*.d.ts"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "build": "npm run build:types && vite build",
23
+ "build:types": "tsc --build tsconfig.build.json",
24
+ "dev": "vite",
25
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
26
+ "preview": "vite preview",
27
+ "prepare": "husky install",
28
+ "precommit": "npm run lint-staged",
29
+ "lint-staged": "lint-staged",
30
+ "storybook": "storybook dev -p 6006",
31
+ "build-storybook": "storybook build",
32
+ "prepublish": "npm run build",
33
+ "release-patch": "npm run build && npm version patch && git push && npm publish"
34
+ },
35
+ "browserslist": [
36
+ "cover 99.5%"
37
+ ],
38
+ "peerDependencies": {
39
+ "classnames": "^2.5.1",
40
+ "react": "^18.0.0",
41
+ "react-dom": "^18.0.0",
42
+ "react-router-dom": "6.26.1"
43
+ },
44
+ "dependencies": {
45
+ "fast-deep-equal": "^3.1.3",
46
+ "papaparse": "^5.4.1",
47
+ "react-paginate": "^8.2.0"
48
+ },
49
+ "devDependencies": {
50
+ "storybook": "^8.6.14",
51
+ "vite-plugin-lib-inject-css": "^2.2.2",
52
+ "@chromatic-com/storybook": "^3.2.3",
53
+ "@eslint/js": "^9.25.0",
54
+ "@storybook/addon-backgrounds": "^8.5.2",
55
+ "@storybook/addon-essentials": "^8.4.7",
56
+ "@storybook/addon-interactions": "^8.4.7",
57
+ "@storybook/addon-onboarding": "^8.4.7",
58
+ "@storybook/blocks": "^8.4.7",
59
+ "@storybook/react": "^8.4.7",
60
+ "@storybook/react-vite": "^8.4.7",
61
+ "@storybook/test": "^8.4.7",
62
+ "@types/eslint-plugin-jsx-a11y": "^6.10.0",
63
+ "@types/eslint-plugin-prettier": "^3.1.3",
64
+ "@types/node": "^22.15.21",
65
+ "@types/papaparse": "^5.3.16",
66
+ "@types/react": "^18.2.25",
67
+ "@types/react-dom": "^18.2.25",
68
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
69
+ "@typescript-eslint/parser": "^6.21.0",
70
+ "@vitejs/plugin-react-swc": "^3.9.0",
71
+ "autoprefixer": "^10.4.21",
72
+ "eslint": "^8.57.0",
73
+ "eslint-config-airbnb-typescript": "^17.1.0",
74
+ "eslint-config-prettier": "^9.1.0",
75
+ "eslint-import-resolver-typescript": "^4.4.1",
76
+ "eslint-plugin-import": "^2.29.1",
77
+ "eslint-plugin-jsx-a11y": "^6.8.0",
78
+ "eslint-plugin-prettier": "^5.2.1",
79
+ "eslint-plugin-react": "^7.34.1",
80
+ "eslint-plugin-react-hooks": "^4.6.0",
81
+ "eslint-plugin-react-refresh": "^0.4.19",
82
+ "glob": "^11.0.2",
83
+ "globals": "^16.0.0",
84
+ "husky": "^9.1.7",
85
+ "lint-staged": "^16.0.0",
86
+ "react": "18.2.0",
87
+ "react-dom": "18.2.0",
88
+ "react-router-dom": "6.26.1",
89
+ "sass": "^1.89.0",
90
+ "typescript": "~5.8.3",
91
+ "typescript-eslint": "^8.30.1",
92
+ "vite": "^6.3.5",
93
+ "vite-plugin-dts": "^4.5.4",
94
+ "vite-plugin-static-copy": "^3.0.0",
95
+ "vite-plugin-svgr": "^4.3.0"
96
+ },
97
+ "publishConfig": {
98
+ "access": "public"
99
+ },
100
+ "lint-staged": {
101
+ "src/**/*.{ts,tsx}": [
102
+ "eslint --fix",
103
+ "prettier --write --ignore-unknown"
104
+ ]
105
+ }
106
+ }
@@ -1 +0,0 @@
1
- .tabs .tabs-bar{display:flex}.tabs .tab-button{height:44px;padding:0 12px;display:flex;justify-content:center;align-items:center;border:1px solid var(--color-border-primary-default);background-color:var(--color-bg-neutral-basic-default);cursor:pointer}.tabs .tab-button:not(:last-of-type){border-right:0 solid}.tabs .tab-button:first-of-type{border-radius:8px 0 0 8px}.tabs .tab-button:last-of-type{border-radius:0 8px 8px 0}.tabs .tab-button:hover{background:#ddd}.tabs .tab-button.active{background:var(--color-bg-neutral-light-default);font-weight:600}.tabs .tab-button.disabled{pointer-events:none}
@@ -1,24 +0,0 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { useState as v } from "react";
3
- import '../../../assets/Tabs.css';const f = ({ items: s, defaultActiveKey: t, onChange: d }) => {
4
- var c, b;
5
- const [l, i] = v(t || ((c = s[0]) == null ? void 0 : c.key)), n = (a) => {
6
- s.some((r) => r.key === a && !r.disabled) && (i(a), d == null || d(a));
7
- };
8
- return /* @__PURE__ */ o("div", { className: "tabs", children: [
9
- /* @__PURE__ */ e("div", { className: "tabs-bar", children: s.map((a) => /* @__PURE__ */ e(
10
- "button",
11
- {
12
- onClick: () => !a.disabled && n(a.key),
13
- className: `tab-button ${l === a.key ? "active" : ""} ${a.disabled ? "disabled" : ""}`,
14
- disabled: a.disabled,
15
- children: a.label
16
- },
17
- a.key
18
- )) }),
19
- /* @__PURE__ */ e("div", { className: "tabs-content", children: (b = s.find((a) => a.key === l)) == null ? void 0 : b.children })
20
- ] });
21
- };
22
- export {
23
- f as Tabs
24
- };
@@ -1,67 +0,0 @@
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
- };
@@ -1,4 +0,0 @@
1
- import { Tabs as a } from "./Tabs.js";
2
- export {
3
- a as Tabs
4
- };