@knymbus/voxel-ui 1.0.0

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 (115) hide show
  1. package/.storybook/main.ts +17 -0
  2. package/.storybook/preview.ts +23 -0
  3. package/debug-storybook.log +40 -0
  4. package/dist/chunks/jsx-runtime-Boo2vksn.js +182 -0
  5. package/dist/chunks/resizable-ImB8dfG_.js +112 -0
  6. package/dist/chunks/tabs-MaVN00hJ.js +86 -0
  7. package/dist/components/button/Button.d.ts +31 -0
  8. package/dist/components/button/ButtonGroup.d.ts +12 -0
  9. package/dist/components/button/SplitActionButton.d.ts +2 -0
  10. package/dist/components/button/index.d.ts +5 -0
  11. package/dist/components/button/split-types.d.ts +16 -0
  12. package/dist/components/button/types.d.ts +9 -0
  13. package/dist/components/icons/AddIcon.d.ts +2 -0
  14. package/dist/components/icons/BlankDocIcon.d.ts +2 -0
  15. package/dist/components/icons/ChatIcon.d.ts +2 -0
  16. package/dist/components/icons/ChevronDownIcon.d.ts +2 -0
  17. package/dist/components/icons/CloseIcon.d.ts +2 -0
  18. package/dist/components/icons/CommentIcon.d.ts +2 -0
  19. package/dist/components/icons/DeleteChatIcon.d.ts +2 -0
  20. package/dist/components/icons/DocumentIcon.d.ts +2 -0
  21. package/dist/components/icons/ExpandIcon.d.ts +2 -0
  22. package/dist/components/icons/FolderIcon.d.ts +2 -0
  23. package/dist/components/icons/GroupIcon.d.ts +2 -0
  24. package/dist/components/icons/MinimizeIcon.d.ts +2 -0
  25. package/dist/components/icons/MinusIcon.d.ts +2 -0
  26. package/dist/components/icons/MoreIcon.d.ts +2 -0
  27. package/dist/components/icons/OpenFolderIcon.d.ts +2 -0
  28. package/dist/components/icons/PersonIcon.d.ts +2 -0
  29. package/dist/components/icons/PlusChatIcon.d.ts +2 -0
  30. package/dist/components/icons/PlusCommentIcon.d.ts +2 -0
  31. package/dist/components/icons/PlusDocBadgeIcon.d.ts +8 -0
  32. package/dist/components/icons/PlusDocIcon.d.ts +2 -0
  33. package/dist/components/icons/PlusPersonIcon.d.ts +2 -0
  34. package/dist/components/icons/RefreshIcon.d.ts +2 -0
  35. package/dist/components/icons/SearchIcon.d.ts +2 -0
  36. package/dist/components/icons/TerminalIcon.d.ts +2 -0
  37. package/dist/components/icons/TrashIcon.d.ts +2 -0
  38. package/dist/components/icons/TruckIcon.d.ts +2 -0
  39. package/dist/components/icons/index.d.ts +26 -0
  40. package/dist/components/icons/types.d.ts +5 -0
  41. package/dist/components/resizable/ResizablePanel.d.ts +10 -0
  42. package/dist/components/resizable/index.d.ts +1 -0
  43. package/dist/components/resizable/index.js +2 -0
  44. package/dist/components/search/SearchInput.d.ts +10 -0
  45. package/dist/components/search/index.d.ts +2 -0
  46. package/dist/components/search/types.d.ts +19 -0
  47. package/dist/components/tabs/TabButton.d.ts +12 -0
  48. package/dist/components/tabs/TabButtonGroup.d.ts +9 -0
  49. package/dist/components/tabs/TabPanel.d.ts +8 -0
  50. package/dist/components/tabs/TabPanelList.d.ts +11 -0
  51. package/dist/components/tabs/index.d.ts +5 -0
  52. package/dist/components/tabs/index.js +2 -0
  53. package/dist/components/tabs/types.d.ts +9 -0
  54. package/dist/components/tabs/useTab.d.ts +5 -0
  55. package/dist/index.d.ts +5 -0
  56. package/dist/index.js +1071 -0
  57. package/package.json +68 -0
  58. package/src/components/button/Button.stories.tsx +70 -0
  59. package/src/components/button/Button.tsx +108 -0
  60. package/src/components/button/ButtonGroup.stories.tsx +63 -0
  61. package/src/components/button/ButtonGroup.tsx +62 -0
  62. package/src/components/button/SplitActionButton.tsx +116 -0
  63. package/src/components/button/SplitButton.stories.tsx +55 -0
  64. package/src/components/button/index.ts +7 -0
  65. package/src/components/button/split-types.ts +18 -0
  66. package/src/components/button/types.ts +10 -0
  67. package/src/components/icons/AddIcon.tsx +10 -0
  68. package/src/components/icons/BlankDocIcon.tsx +10 -0
  69. package/src/components/icons/ChatIcon.tsx +9 -0
  70. package/src/components/icons/ChevronDownIcon.tsx +9 -0
  71. package/src/components/icons/CloseIcon.tsx +23 -0
  72. package/src/components/icons/CommentIcon.tsx +9 -0
  73. package/src/components/icons/DeleteChatIcon.tsx +10 -0
  74. package/src/components/icons/DocumentIcon.tsx +13 -0
  75. package/src/components/icons/ExpandIcon.tsx +12 -0
  76. package/src/components/icons/FolderIcon.tsx +9 -0
  77. package/src/components/icons/GroupIcon.tsx +12 -0
  78. package/src/components/icons/Icon.stories.tsx +122 -0
  79. package/src/components/icons/MinimizeIcon.tsx +12 -0
  80. package/src/components/icons/MinusIcon.tsx +9 -0
  81. package/src/components/icons/MoreIcon.tsx +11 -0
  82. package/src/components/icons/OpenFolderIcon.tsx +37 -0
  83. package/src/components/icons/PersonIcon.tsx +10 -0
  84. package/src/components/icons/PlusChatIcon.tsx +11 -0
  85. package/src/components/icons/PlusCommentIcon.tsx +11 -0
  86. package/src/components/icons/PlusDocBadgeIcon.tsx +74 -0
  87. package/src/components/icons/PlusDocIcon.tsx +12 -0
  88. package/src/components/icons/PlusPersonIcon.tsx +12 -0
  89. package/src/components/icons/RefreshIcon.tsx +9 -0
  90. package/src/components/icons/SearchIcon.tsx +10 -0
  91. package/src/components/icons/TerminalIcon.tsx +11 -0
  92. package/src/components/icons/TrashIcon.tsx +12 -0
  93. package/src/components/icons/TruckIcon.tsx +12 -0
  94. package/src/components/icons/index.ts +26 -0
  95. package/src/components/icons/types.ts +6 -0
  96. package/src/components/resizable/ResizablePanel.tsx +183 -0
  97. package/src/components/resizable/index.ts +1 -0
  98. package/src/components/search/SearchInput.stories.tsx +91 -0
  99. package/src/components/search/SearchInput.tsx +254 -0
  100. package/src/components/search/index.ts +2 -0
  101. package/src/components/search/types.ts +21 -0
  102. package/src/components/tabs/TabButton.tsx +56 -0
  103. package/src/components/tabs/TabButtonGroup.tsx +82 -0
  104. package/src/components/tabs/TabPanel.tsx +44 -0
  105. package/src/components/tabs/TabPanelList.tsx +31 -0
  106. package/src/components/tabs/Tabs.stories.tsx +71 -0
  107. package/src/components/tabs/index.ts +5 -0
  108. package/src/components/tabs/types.ts +10 -0
  109. package/src/components/tabs/useTab.ts +33 -0
  110. package/src/index.css +35 -0
  111. package/src/index.ts +5 -0
  112. package/src/vite-env.d.ts +5 -0
  113. package/tsconfig.json +47 -0
  114. package/vite.config.ts +64 -0
  115. package/vitest.shims.d.ts +1 -0
@@ -0,0 +1,17 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite';
2
+
3
+ const config: StorybookConfig = {
4
+ "stories": [
5
+ "../src/**/*.mdx",
6
+ "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
7
+ ],
8
+ "addons": [
9
+ "@chromatic-com/storybook",
10
+ "@storybook/addon-vitest",
11
+ "@storybook/addon-a11y",
12
+ "@storybook/addon-docs",
13
+ "@storybook/addon-mcp"
14
+ ],
15
+ "framework": "@storybook/react-vite"
16
+ };
17
+ export default config;
@@ -0,0 +1,23 @@
1
+ /// <reference types="vite/client" />
2
+ import type { Preview } from '@storybook/react-vite'
3
+ import '../src/index.css';
4
+
5
+ const preview: Preview = {
6
+ parameters: {
7
+ controls: {
8
+ matchers: {
9
+ color: /(background|color)$/i,
10
+ date: /Date$/i,
11
+ },
12
+ },
13
+
14
+ a11y: {
15
+ // 'todo' - show a11y violations in the test UI only
16
+ // 'error' - fail CI on a11y violations
17
+ // 'off' - skip a11y checks entirely
18
+ test: 'todo'
19
+ }
20
+ },
21
+ };
22
+
23
+ export default preview;
@@ -0,0 +1,40 @@
1
+ [14:13:34.127] [INFO] storybook v10.4.6
2
+ [14:13:37.466] [DEBUG] Command "pnpm.cmd" not found, trying next variation...
3
+ [14:13:37.596] [DEBUG] Command "pnpm.exe" not found, trying next variation...
4
+ [14:13:37.728] [DEBUG] Command "pnpm.ps1" not found, trying next variation...
5
+ [14:13:38.790] [DEBUG] Getting package.json info for C:/Users/Ovel/Desktop/knymbus/node-lib/@knymbus/voxel-ui/package.json...
6
+ [14:13:38.872] [WARN] Could not resolve addon "@chromatic-com/storybook", skipping. Is it installed?
7
+ [14:13:38.950] [WARN] Could not resolve addon "@storybook/addon-vitest", skipping. Is it installed?
8
+ [14:13:39.001] [WARN] Could not resolve addon "@storybook/addon-a11y", skipping. Is it installed?
9
+ [14:13:39.068] [WARN] Could not resolve addon "@storybook/addon-docs", skipping. Is it installed?
10
+ [14:13:39.113] [WARN] Could not resolve addon "@storybook/addon-mcp", skipping. Is it installed?
11
+ [14:13:40.213] [WARN] Could not resolve addon "@chromatic-com/storybook", skipping. Is it installed?
12
+ [14:13:40.215] [WARN] Could not resolve addon "@storybook/addon-vitest", skipping. Is it installed?
13
+ [14:13:40.218] [WARN] Could not resolve addon "@storybook/addon-a11y", skipping. Is it installed?
14
+ [14:13:40.221] [WARN] Could not resolve addon "@storybook/addon-docs", skipping. Is it installed?
15
+ [14:13:40.228] [WARN] Could not resolve addon "@storybook/addon-mcp", skipping. Is it installed?
16
+ [14:13:42.336] [INFO] Starting...
17
+ [14:13:43.879] [DEBUG] Starting preview..
18
+ [14:13:44.076] [ERROR] Failed to build the preview
19
+ [14:13:44.084] [ERROR] Error: Cannot find module '@vitejs/plugin-react'
20
+ Require stack:
21
+ - .\vite.config.ts
22
+ - .\node_modules\vite\dist\node\chunks\node.js
23
+ at Function._resolveFilename (node:internal/modules/cjs/loader:1249:15)
24
+ at Function._load (node:internal/modules/cjs/loader:1075:27)
25
+ at TracingChannel.traceSync (node:diagnostics_channel:322:14)
26
+ at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)
27
+ at Module.require (node:internal/modules/cjs/loader:1340:12)
28
+ at require (node:internal/modules/helpers:138:16)
29
+ at Object.<anonymous> (.\vite.config.ts:24:28)
30
+ at Module._compile (node:internal/modules/cjs/loader:1565:14)
31
+ at _require.extensions.<computed> [as .js] (file:///C:/Users/Ovel/Desktop/knymbus/node-lib/@knymbus/voxel-ui/node_modules/vite/dist/node/chunks/node.js:35677:42)
32
+ at Module.load (node:internal/modules/cjs/loader:1318:32)
33
+ [14:13:44.092] [WARN] Broken build, fix the error above.
34
+ You may need to refresh the browser.
35
+ [14:13:44.105] [WARN] Could not resolve addon "@chromatic-com/storybook", skipping. Is it installed?
36
+ [14:13:44.107] [WARN] Could not resolve addon "@storybook/addon-vitest", skipping. Is it installed?
37
+ [14:13:44.110] [WARN] Could not resolve addon "@storybook/addon-a11y", skipping. Is it installed?
38
+ [14:13:44.112] [WARN] Could not resolve addon "@storybook/addon-docs", skipping. Is it installed?
39
+ [14:13:44.114] [WARN] Could not resolve addon "@storybook/addon-mcp", skipping. Is it installed?
40
+ [14:13:50.518] [PROMPT] Would you like to send anonymous crash reports to improve Storybook and fix bugs faster? {"choice":false}
@@ -0,0 +1,182 @@
1
+ //#region \0rolldown/runtime.js
2
+ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), t = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
3
+ if (typeof require < "u") return require.apply(this, arguments);
4
+ throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
5
+ }), n = /* @__PURE__ */ e(((e) => {
6
+ var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
7
+ function r(e, n, r) {
8
+ var i = null;
9
+ if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
10
+ else r = n;
11
+ return n = r.ref, {
12
+ $$typeof: t,
13
+ type: e,
14
+ key: i,
15
+ ref: n === void 0 ? null : n,
16
+ props: r
17
+ };
18
+ }
19
+ e.Fragment = n, e.jsx = r, e.jsxs = r;
20
+ })), r = /* @__PURE__ */ e(((e) => {
21
+ process.env.NODE_ENV !== "production" && (function() {
22
+ function n(e) {
23
+ if (e == null) return null;
24
+ if (typeof e == "function") return e.$$typeof === k ? null : e.displayName || e.name || null;
25
+ if (typeof e == "string") return e;
26
+ switch (e) {
27
+ case v: return "Fragment";
28
+ case b: return "Profiler";
29
+ case y: return "StrictMode";
30
+ case w: return "Suspense";
31
+ case T: return "SuspenseList";
32
+ case O: return "Activity";
33
+ }
34
+ if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
35
+ case _: return "Portal";
36
+ case S: return e.displayName || "Context";
37
+ case x: return (e._context.displayName || "Context") + ".Consumer";
38
+ case C:
39
+ var t = e.render;
40
+ return e = e.displayName, e ||= (e = t.displayName || t.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
41
+ case E: return t = e.displayName || null, t === null ? n(e.type) || "Memo" : t;
42
+ case D:
43
+ t = e._payload, e = e._init;
44
+ try {
45
+ return n(e(t));
46
+ } catch {}
47
+ }
48
+ return null;
49
+ }
50
+ function r(e) {
51
+ return "" + e;
52
+ }
53
+ function i(e) {
54
+ try {
55
+ r(e);
56
+ var t = !1;
57
+ } catch {
58
+ t = !0;
59
+ }
60
+ if (t) {
61
+ t = console;
62
+ var n = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
63
+ return n.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), r(e);
64
+ }
65
+ }
66
+ function a(e) {
67
+ if (e === v) return "<>";
68
+ if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
69
+ try {
70
+ var t = n(e);
71
+ return t ? "<" + t + ">" : "<...>";
72
+ } catch {
73
+ return "<...>";
74
+ }
75
+ }
76
+ function o() {
77
+ var e = A.A;
78
+ return e === null ? null : e.getOwner();
79
+ }
80
+ function s() {
81
+ return Error("react-stack-top-frame");
82
+ }
83
+ function c(e) {
84
+ if (j.call(e, "key")) {
85
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
86
+ if (t && t.isReactWarning) return !1;
87
+ }
88
+ return e.key !== void 0;
89
+ }
90
+ function l(e, t) {
91
+ function n() {
92
+ P || (P = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
93
+ }
94
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
95
+ get: n,
96
+ configurable: !0
97
+ });
98
+ }
99
+ function u() {
100
+ var e = n(this.type);
101
+ return F[e] || (F[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
102
+ }
103
+ function d(e, t, n, r, i, a) {
104
+ var o = n.ref;
105
+ return e = {
106
+ $$typeof: g,
107
+ type: e,
108
+ key: t,
109
+ props: n,
110
+ _owner: r
111
+ }, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
112
+ enumerable: !1,
113
+ value: null
114
+ }) : Object.defineProperty(e, "ref", {
115
+ enumerable: !1,
116
+ get: u
117
+ }), e._store = {}, Object.defineProperty(e._store, "validated", {
118
+ configurable: !1,
119
+ enumerable: !1,
120
+ writable: !0,
121
+ value: 0
122
+ }), Object.defineProperty(e, "_debugInfo", {
123
+ configurable: !1,
124
+ enumerable: !1,
125
+ writable: !0,
126
+ value: null
127
+ }), Object.defineProperty(e, "_debugStack", {
128
+ configurable: !1,
129
+ enumerable: !1,
130
+ writable: !0,
131
+ value: i
132
+ }), Object.defineProperty(e, "_debugTask", {
133
+ configurable: !1,
134
+ enumerable: !1,
135
+ writable: !0,
136
+ value: a
137
+ }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
138
+ }
139
+ function f(e, t, r, a, s, u) {
140
+ var f = t.children;
141
+ if (f !== void 0) if (a) if (M(f)) {
142
+ for (a = 0; a < f.length; a++) p(f[a]);
143
+ Object.freeze && Object.freeze(f);
144
+ } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
145
+ else p(f);
146
+ if (j.call(t, "key")) {
147
+ f = n(e);
148
+ var m = Object.keys(t).filter(function(e) {
149
+ return e !== "key";
150
+ });
151
+ a = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", R[f + a] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", a, f, m, f), R[f + a] = !0);
152
+ }
153
+ if (f = null, r !== void 0 && (i(r), f = "" + r), c(t) && (i(t.key), f = "" + t.key), "key" in t) for (var h in r = {}, t) h !== "key" && (r[h] = t[h]);
154
+ else r = t;
155
+ return f && l(r, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, r, o(), s, u);
156
+ }
157
+ function p(e) {
158
+ m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
159
+ }
160
+ function m(e) {
161
+ return typeof e == "object" && !!e && e.$$typeof === g;
162
+ }
163
+ var h = t("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), A = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, M = Array.isArray, N = console.createTask ? console.createTask : function() {
164
+ return null;
165
+ };
166
+ h = { react_stack_bottom_frame: function(e) {
167
+ return e();
168
+ } };
169
+ var P, F = {}, I = h.react_stack_bottom_frame.bind(h, s)(), L = N(a(s)), R = {};
170
+ e.Fragment = v, e.jsx = function(e, t, n) {
171
+ var r = 1e4 > A.recentlyCreatedOwnerStacks++;
172
+ return f(e, t, n, !1, r ? Error("react-stack-top-frame") : I, r ? N(a(e)) : L);
173
+ }, e.jsxs = function(e, t, n) {
174
+ var r = 1e4 > A.recentlyCreatedOwnerStacks++;
175
+ return f(e, t, n, !0, r ? Error("react-stack-top-frame") : I, r ? N(a(e)) : L);
176
+ };
177
+ })();
178
+ })), i = /* @__PURE__ */ e(((e, t) => {
179
+ process.env.NODE_ENV === "production" ? t.exports = n() : t.exports = r();
180
+ }));
181
+ //#endregion
182
+ export { i as t };
@@ -0,0 +1,112 @@
1
+ import { t as e } from "./jsx-runtime-Boo2vksn.js";
2
+ import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
3
+ //#region src/components/resizable/ResizablePanel.tsx
4
+ var a = e();
5
+ function o({ children: e, placement: o = "right", defaultSize: s = 240, minSize: c = 150, maxSize: l }) {
6
+ let u = r(null), [d, f] = i(s), [p, m] = i(!1), [h, g] = i(!1), [_, v] = i(!1), y = o === "right" || o === "left", b = y ? "ew-resize" : "ns-resize", x = t((e) => {
7
+ e.preventDefault(), e.stopPropagation(), m(!0);
8
+ }, []), S = t(() => {
9
+ m(!1);
10
+ }, []), C = t((e) => {
11
+ e.preventDefault(), v(!1), f(s);
12
+ }, [s]), w = t((e) => {
13
+ if (!p || !u.current || !u.current.parentElement) return;
14
+ let t = u.current.parentElement.getBoundingClientRect(), n = t.width, r = t.height, i = s, a = y ? n : r, d = l === void 0 ? a : Math.min(l, a);
15
+ switch (o) {
16
+ case "right":
17
+ i = e.clientX - t.left;
18
+ break;
19
+ case "left":
20
+ i = t.right - e.clientX;
21
+ break;
22
+ case "bottom":
23
+ i = e.clientY - t.top;
24
+ break;
25
+ case "top":
26
+ i = t.bottom - e.clientY;
27
+ break;
28
+ }
29
+ if (i < 60) {
30
+ f(0), v(!0);
31
+ return;
32
+ }
33
+ if (i > d - 60) {
34
+ f(d), v(!1);
35
+ return;
36
+ }
37
+ v(!1), f(i < c ? c : i > d ? d : i);
38
+ }, [
39
+ p,
40
+ o,
41
+ c,
42
+ l,
43
+ s,
44
+ y
45
+ ]);
46
+ n(() => (p ? (window.addEventListener("mousemove", w), window.addEventListener("mouseup", S), document.body.style.cursor = b, document.body.style.userSelect = "none") : (document.body.style.cursor = "", document.body.style.userSelect = ""), () => {
47
+ window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", S), document.body.style.cursor = "", document.body.style.userSelect = "";
48
+ }), [
49
+ p,
50
+ w,
51
+ S,
52
+ b
53
+ ]);
54
+ let T = _ ? 0 : d, E = y ? { width: `${T}px` } : { height: `${T}px` }, D = () => {
55
+ let e = {
56
+ position: "absolute",
57
+ zIndex: 50,
58
+ cursor: b,
59
+ pointerEvents: "all",
60
+ backgroundColor: "transparent",
61
+ display: "flex",
62
+ alignItems: "center",
63
+ justifyContent: "center",
64
+ userSelect: "none"
65
+ };
66
+ return o === "right" ? {
67
+ ...e,
68
+ top: 0,
69
+ bottom: 0,
70
+ width: "12px",
71
+ left: `${T + -6}px`
72
+ } : o === "left" ? {
73
+ ...e,
74
+ top: 0,
75
+ bottom: 0,
76
+ width: "12px",
77
+ left: "-6px"
78
+ } : o === "bottom" ? {
79
+ ...e,
80
+ left: 0,
81
+ right: 0,
82
+ height: "12px",
83
+ top: `${T + -6}px`,
84
+ flexDirection: "column"
85
+ } : {
86
+ ...e,
87
+ left: 0,
88
+ right: 0,
89
+ height: "12px",
90
+ top: "-6px",
91
+ flexDirection: "column"
92
+ };
93
+ }, O = y ? `w-[2px] h-full ${p || h ? "bg-vsc-accent" : "bg-vsc-border"}` : `h-[2px] w-full ${p || h ? "bg-vsc-accent" : "bg-vsc-border"}`;
94
+ return /* @__PURE__ */ (0, a.jsxs)("div", {
95
+ ref: u,
96
+ className: "relative shrink-0",
97
+ style: E,
98
+ children: [!_ && /* @__PURE__ */ (0, a.jsx)("div", {
99
+ className: "w-full h-full overflow-hidden",
100
+ children: e
101
+ }), /* @__PURE__ */ (0, a.jsx)("div", {
102
+ onMouseDown: x,
103
+ onDoubleClick: C,
104
+ onMouseEnter: () => g(!0),
105
+ onMouseLeave: () => g(!1),
106
+ style: D(),
107
+ children: /* @__PURE__ */ (0, a.jsx)("div", { className: O })
108
+ })]
109
+ });
110
+ }
111
+ //#endregion
112
+ export { o as t };
@@ -0,0 +1,86 @@
1
+ import { t as e } from "./jsx-runtime-Boo2vksn.js";
2
+ import { createContext as t, useContext as n, useEffect as r, useState as i } from "react";
3
+ import { create as a } from "zustand";
4
+ //#region src/components/tabs/useTab.ts
5
+ var o = a((e) => ({
6
+ activeTabs: {},
7
+ setActiveTab: (t, n) => e((e) => ({ activeTabs: {
8
+ ...e.activeTabs,
9
+ [t]: n
10
+ } })),
11
+ initializeTab: (t, n) => e((e) => e.activeTabs[t] ? {} : { activeTabs: {
12
+ ...e.activeTabs,
13
+ [t]: n
14
+ } })
15
+ }));
16
+ function s(e) {
17
+ let t = o((t) => t.activeTabs[e]), n = o((e) => e.setActiveTab), r = o((e) => e.initializeTab);
18
+ return {
19
+ activeTab: t,
20
+ changeTab: (t) => n(e, t),
21
+ registerDefault: (t) => r(e, t)
22
+ };
23
+ }
24
+ //#endregion
25
+ //#region src/components/tabs/TabPanelList.tsx
26
+ var c = e(), l = t({ activeTabId: void 0 }), u = () => n(l);
27
+ function d({ children: e, targetScopeName: t, defaultValue: n }) {
28
+ let { activeTab: i, registerDefault: a } = s(t);
29
+ r(() => {
30
+ a(n);
31
+ }, [n, a]);
32
+ let o = i || n;
33
+ return /* @__PURE__ */ (0, c.jsx)(l.Provider, {
34
+ value: { activeTabId: o },
35
+ children: /* @__PURE__ */ (0, c.jsx)("div", {
36
+ className: "relative w-full h-full min-h-0 flex-1 overflow-hidden bg-vsc-bg",
37
+ children: e
38
+ })
39
+ });
40
+ }
41
+ //#endregion
42
+ //#region src/components/tabs/TabPanel.tsx
43
+ function f({ children: e, id: t, persist: n = !1 }) {
44
+ let { activeTabId: a } = u(), o = a === t, [s, l] = i(!1);
45
+ return r(() => {
46
+ o && !s && l(!0);
47
+ }, [o, s]), !s || !n && !o ? null : /* @__PURE__ */ (0, c.jsx)("div", {
48
+ className: `absolute inset-0 w-full h-full bg-vsc-bg transition-all duration-300 ease-in-out ${o ? "opacity-100 scale-100 z-10 pointer-events-auto visible" : "opacity-0 scale-[0.99] z-0 pointer-events-none invisible delay-75"}`,
49
+ children: /* @__PURE__ */ (0, c.jsx)("div", {
50
+ className: `w-full h-full transition-opacity duration-300 ${o ? "opacity-100" : "opacity-0"}`,
51
+ children: e
52
+ })
53
+ });
54
+ }
55
+ //#endregion
56
+ //#region src/components/tabs/TabButton.tsx
57
+ function p({ id: e, scopeName: t, children: n, variant: r = "underline", startIcon: i, endIcon: a }) {
58
+ let { activeTab: o, changeTab: l } = s(t), u = o === e;
59
+ return /* @__PURE__ */ (0, c.jsxs)("button", {
60
+ "data-id": e,
61
+ onClick: () => l(e),
62
+ className: `flex items-center justify-center gap-1.5 focus:outline-none border-none outline-none z-10 transition-colors select-none h-full ${{
63
+ underline: `pb-2 pt-1 px-3 text-xs font-semibold cursor-pointer border-b-2 ${u ? "border-vsc-accent text-vsc-text" : "border-transparent text-vsc-muted hover:text-vsc-text"}`,
64
+ "sliding-underline": `py-2 px-4 text-xs font-semibold cursor-pointer transition-colors duration-200 ${u ? "text-vsc-text font-bold" : "text-vsc-muted hover:text-vsc-text"}`,
65
+ pill: `px-3.5 py-1.5 text-xs font-bold rounded-full cursor-pointer scale-100 ${u ? "bg-vsc-accent text-vsc-button-text shadow-sm" : "bg-vsc-hover/40 text-vsc-muted hover:bg-vsc-hover"}`,
66
+ vscode: `px-4 text-xs font-medium border-r border-vsc-border cursor-pointer ${u ? "bg-vsc-bg text-vsc-text border-t-2 border-t-vsc-accent -mt-[1px]" : "bg-vsc-sidebar text-vsc-muted hover:bg-vsc-hover/50"}`,
67
+ ghost: `px-3 py-1.5 text-xs font-semibold rounded cursor-pointer ${u ? "bg-vsc-hover text-vsc-text font-bold" : "text-vsc-muted hover:bg-vsc-hover/30"}`
68
+ }[r]}`,
69
+ children: [
70
+ i && /* @__PURE__ */ (0, c.jsx)("span", {
71
+ className: "shrink-0 opacity-80",
72
+ children: i
73
+ }),
74
+ /* @__PURE__ */ (0, c.jsx)("span", {
75
+ className: "truncate",
76
+ children: n
77
+ }),
78
+ a && /* @__PURE__ */ (0, c.jsx)("span", {
79
+ className: "shrink-0 opacity-70",
80
+ children: a
81
+ })
82
+ ]
83
+ });
84
+ }
85
+ //#endregion
86
+ export { s as i, f as n, d as r, p as t };
@@ -0,0 +1,31 @@
1
+ import { default as React } from 'react';
2
+ export type LucideIcon = React.ComponentType<{
3
+ className?: string;
4
+ }>;
5
+ export type ButtonColor = "primary" | "secondary" | "ghost" | "danger" | "vsc";
6
+ export type ButtonSize = "xs" | "sm" | "md" | "lg";
7
+ export declare const buttonIconSizes: Record<ButtonSize, string>;
8
+ interface ButtonIconProps extends React.SVGProps<SVGSVGElement> {
9
+ icon: LucideIcon;
10
+ size?: ButtonSize;
11
+ }
12
+ export declare const ButtonIcon: ({ icon: Icon, size, className, ...props }: ButtonIconProps) => React.JSX.Element;
13
+ interface BaseButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
14
+ size?: ButtonSize;
15
+ color?: ButtonColor;
16
+ startIcon?: LucideIcon;
17
+ endIcon?: LucideIcon;
18
+ }
19
+ interface IconButtonProps extends BaseButtonProps {
20
+ iconOnly: true;
21
+ icon: LucideIcon;
22
+ children?: never;
23
+ }
24
+ interface StandardButtonProps extends BaseButtonProps {
25
+ iconOnly?: false;
26
+ icon?: never;
27
+ children: React.ReactNode;
28
+ }
29
+ export type ButtonProps = IconButtonProps | StandardButtonProps;
30
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
31
+ export default Button;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ export type GroupOrientation = 'horizontal' | 'vertical';
3
+ export type GroupVariant = 'default' | 'ghost';
4
+ interface ButtonGroupProps {
5
+ children: React.ReactNode;
6
+ orientation?: GroupOrientation;
7
+ variant?: GroupVariant;
8
+ gap?: number;
9
+ className?: string;
10
+ }
11
+ export default function ButtonGroup({ children, orientation, variant, gap, className }: ButtonGroupProps): React.JSX.Element;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ import { SplitActionButtonProps } from './split-types';
2
+ export default function SplitActionButton({ children, color, size, startIcon, onMainActionClick, menuItems, className }: SplitActionButtonProps): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export { default as Button } from './Button';
2
+ export { default as ButtonGroup } from './ButtonGroup';
3
+ export { default as SplitActionButton } from './SplitActionButton';
4
+ export * from './split-types';
5
+ export * from './types';
@@ -0,0 +1,16 @@
1
+ import { LucideIcon, ButtonColor, ButtonSize } from './Button';
2
+ export interface SplitActionMenuItem {
3
+ id: string;
4
+ label: string;
5
+ startIcon?: LucideIcon;
6
+ onClick: () => void;
7
+ }
8
+ export interface SplitActionButtonProps {
9
+ children: React.ReactNode;
10
+ color?: ButtonColor;
11
+ size?: ButtonSize;
12
+ startIcon?: LucideIcon;
13
+ onMainActionClick: () => void;
14
+ menuItems: SplitActionMenuItem[];
15
+ className?: string;
16
+ }
@@ -0,0 +1,9 @@
1
+ export type ButtonVariant = 'primary' | 'secondary' | 'accent' | 'ghost' | 'danger';
2
+ export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
3
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
+ variant?: ButtonVariant;
5
+ size?: ButtonSize;
6
+ startIcon?: React.ReactNode;
7
+ endIcon?: React.ReactNode;
8
+ fullWidth?: boolean;
9
+ }
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function AddIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function BlankDocIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function ChatIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function ChevronDownIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function CloseIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function CommentIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function DeleteChatIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function DocumentIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function ExpandIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function FolderIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function GroupIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function MinimizeIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function MinusIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function MoreIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function OpenFolderIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function PersonIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function PlusChatIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function PlusCommentIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { IconProps } from './types';
2
+ interface PlusDocBadgeIconProps extends IconProps {
3
+ circleBg?: string;
4
+ circleStroke?: string;
5
+ plusStroke?: string;
6
+ }
7
+ export default function PlusDocBadgeIcon({ size, className, circleBg, circleStroke, plusStroke, ...props }: PlusDocBadgeIconProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function PlusDocIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function PlusPersonIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function RefreshIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export default function SearchIcon({ size, className, ...props }: IconProps): import("react").JSX.Element;