@knymbus/voxel-ui 1.0.14 → 1.0.17

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.
@@ -1,4 +1,5 @@
1
1
  import type { StorybookConfig } from '@storybook/react-vite';
2
+ import { mergeConfig } from 'vite';
2
3
 
3
4
  const config: StorybookConfig = {
4
5
  "stories": [
@@ -12,6 +13,14 @@ const config: StorybookConfig = {
12
13
  "@storybook/addon-docs",
13
14
  "@storybook/addon-mcp"
14
15
  ],
15
- "framework": "@storybook/react-vite"
16
+ "framework": "@storybook/react-vite",
17
+ async viteFinal(config) {
18
+ // Dynamically import Tailwind to avoid any execution in the main app
19
+ const { default: tailwindcss } = await import('@tailwindcss/vite');
20
+
21
+ return mergeConfig(config, {
22
+ plugins: [tailwindcss()],
23
+ });
24
+ },
16
25
  };
17
26
  export default config;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="vite/client" />
2
2
  import type { Preview } from '@storybook/react-vite'
3
- import '../src/index.css';
3
+ import './tailwind.css';
4
4
 
5
5
  const preview: Preview = {
6
6
  parameters: {
@@ -0,0 +1,34 @@
1
+ @import "tailwindcss";
2
+
3
+ /* 🎛️ Tailwind v4 Theme Extension Configuration Panel */
4
+ @theme {
5
+ --color-vsc-bg: #ffffff;
6
+ --color-vsc-sidebar: #f3f3f3;
7
+ --color-vsc-border: #e4e4e7;
8
+ --color-vsc-accent: #007acc;
9
+ --color-vsc-accent-hover: #0062a3;
10
+ --color-vsc-hover: #e8e8e8;
11
+ --color-vsc-text: #333333;
12
+
13
+ --color-vsc-button-text: #ffffff;
14
+ --color-vsc-muted: #6a737d;
15
+ --color-vsc-bg-input: #f6f8fa;
16
+ }
17
+
18
+ /* ==========================================================================
19
+ DARK MODE OVERRIDES (Triggers when parent layout has the ".dark" class)
20
+ ========================================================================== */
21
+ @layer base {
22
+ .dark {
23
+ --color-vsc-bg: #1e1e1e;
24
+ --color-vsc-sidebar: #252526;
25
+ --color-vsc-border: #3c3c3c;
26
+ --color-vsc-accent: #007acc;
27
+ --color-vsc-accent-hover: #0062a3;
28
+ --color-vsc-hover: #2a2d2e;
29
+ --color-vsc-text: #cccccc;
30
+
31
+ --color-vsc-muted: #8b949e;
32
+ --color-vsc-bg-input: #1f1f1f;
33
+ }
34
+ }
@@ -186,28 +186,7 @@ function u({ variant: e = "simple", value: u, onChange: d, onClear: f, placehold
186
186
  boxSizing: "border-box"
187
187
  };
188
188
  if (e === "simple") {
189
- let e = m > 0 && u.length > 0, i = b || /* @__PURE__ */ (0, c.jsxs)("p", {
190
- style: {
191
- margin: 0,
192
- fontSize: "10px",
193
- fontFamily: s.typography.mono,
194
- color: s.colors.muted,
195
- whiteSpace: "nowrap",
196
- overflow: "hidden",
197
- textOverflow: "ellipsis"
198
- },
199
- children: [
200
- "Showing ",
201
- /* @__PURE__ */ (0, c.jsx)("span", {
202
- style: {
203
- color: s.colors.borderAccent,
204
- fontWeight: "bold"
205
- },
206
- children: m
207
- }),
208
- " matching database metrics records"
209
- ]
210
- });
189
+ let e = u.length > 0, i = m > 0;
211
190
  return /* @__PURE__ */ (0, c.jsxs)("div", {
212
191
  style: N,
213
192
  className: v,
@@ -261,23 +240,60 @@ function u({ variant: e = "simple", value: u, onChange: d, onClear: f, placehold
261
240
  right: 0,
262
241
  top: "32px",
263
242
  zIndex: 10,
264
- overflow: "hidden",
265
243
  transition: s.transitions.smooth,
266
- height: e ? "24px" : "0px",
244
+ height: e ? "auto" : "0px",
267
245
  opacity: +!!e,
268
- transform: e ? "translateY(0px)" : "translateY(-4px)",
246
+ transform: e ? "translateY(4px)" : "translateY(-4px)",
269
247
  pointerEvents: "none"
270
248
  },
271
249
  children: /* @__PURE__ */ (0, c.jsx)("div", {
272
250
  style: {
273
251
  backgroundColor: s.colors.sidebarBg,
274
- border: `1px solid ${s.colors.border}`,
252
+ border: `0px solid ${s.colors.border}`,
275
253
  borderTop: "none",
276
254
  padding: "4px 6px",
277
- borderRadius: "0 0 6px 6px",
255
+ borderRadius: "6px",
278
256
  boxShadow: "0 4px 6px -1px rgba(0,0,0,0.1)"
279
257
  },
280
- children: i
258
+ children: e && b ? b : e && !b && i ? /* @__PURE__ */ (0, c.jsxs)("p", {
259
+ style: {
260
+ margin: 0,
261
+ fontSize: "10px",
262
+ fontFamily: s.typography.mono,
263
+ color: s.colors.muted,
264
+ whiteSpace: "nowrap",
265
+ overflow: "hidden",
266
+ textOverflow: "ellipsis"
267
+ },
268
+ children: [
269
+ "Showing ",
270
+ /* @__PURE__ */ (0, c.jsx)("span", {
271
+ style: {
272
+ color: s.colors.borderAccent,
273
+ fontWeight: "bold"
274
+ },
275
+ children: m
276
+ }),
277
+ " matching database metrics records"
278
+ ]
279
+ }) : e && !b && !i ? /* @__PURE__ */ (0, c.jsxs)("p", {
280
+ style: {
281
+ margin: 0,
282
+ fontSize: "10px",
283
+ fontFamily: s.typography.mono,
284
+ color: s.colors.borderAccent,
285
+ whiteSpace: "nowrap",
286
+ overflow: "hidden",
287
+ textOverflow: "ellipsis"
288
+ },
289
+ children: ["No matching records found for your query: ", /* @__PURE__ */ (0, c.jsx)("span", {
290
+ style: {
291
+ color: s.colors.text,
292
+ fontWeight: "bold"
293
+ },
294
+ children: u
295
+ })]
296
+ }) : null
281
297
  })
282
298
  })]
283
299
  });
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../../chunks/search-CIhA-ti4.js";
1
+ import { n as e, t } from "../../chunks/search-WFmasN49.js";
2
2
  export { t as SearchInput, e as searchTokens };
package/dist/index.js CHANGED
@@ -3,5 +3,5 @@ import { i as t, n, r, t as i } from "./chunks/tabs-MaVN00hJ.js";
3
3
  import { t as a } from "./chunks/Button-BgQwvn3C.js";
4
4
  import { n as o, t as s } from "./chunks/button-dHcpTNIG.js";
5
5
  import { C as c, E as l, S as u, T as d, _ as f, a as p, b as m, c as h, d as g, f as _, g as v, h as y, i as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, u as k, v as A, w as j, x as M, y as N } from "./chunks/icons-BpfDVwCQ.js";
6
- import { n as P, t as F } from "./chunks/search-CIhA-ti4.js";
6
+ import { n as P, t as F } from "./chunks/search-WFmasN49.js";
7
7
  export { A as Add, S as BlankDoc, a as Button, o as ButtonGroup, _ as Chat, N as ChevronDown, l as Close, x as Comment, k as DeleteChat, j as Document, v as Expand, c as Folder, C as Group, y as Minimize, f as Minus, w as More, D as OpenFolder, b as Person, g as PlusChat, h as PlusComment, T as PlusDoc, O as PlusDocBadge, E as PlusPerson, M as Refresh, e as ResizablePanel, u as Search, F as SearchInput, s as SplitActionButton, i as TabButton, n as TabPanel, r as TabPanelList, d as Terminal, m as Trash, p as Truck, P as searchTokens, t as useTab };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knymbus/voxel-ui",
3
- "version": "1.0.14",
3
+ "version": "1.0.17",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import { useState } from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
3
  import SearchInput from './SearchInput';
4
4
  import { SearchResultItem } from './types';
@@ -45,10 +45,10 @@ const MultiSearchWorkspace = () => {
45
45
  }
46
46
 
47
47
  return (
48
- <div className="p-8 bg-vsc-sidebar border border-vsc-border rounded-md space-y-8 min-w-112.5 text-vsc-text">
48
+ <div className="p-8 bg-vsc-sidebar border border-vsc-border rounded-md space-y-8 min-w-112.5 text-vsc-text" >
49
49
 
50
50
  {/* 1. Simple Variant Bracket */}
51
- <div className="space-y-1.5">
51
+ <div className="space-y-1.5" >
52
52
  <p className="text-[10px] font-bold text-vsc-muted uppercase tracking-wider">1. Simple Matrix Variant with Count Log</p>
53
53
  <SearchInput
54
54
  variant="simple"
@@ -56,7 +56,7 @@ const MultiSearchWorkspace = () => {
56
56
  onChange={setSimpleQuery}
57
57
  resultsCount={filteredSimpleResults.length}
58
58
  placeholder="Type track ID to evaluate records count..."
59
- resultIndicatorPanel={<ResultPanel />}
59
+ peekContent={<ResultPanel />}
60
60
  />
61
61
  </div>
62
62
 
@@ -69,7 +69,7 @@ const MultiSearchWorkspace = () => {
69
69
  onChange={setSimpleFloatQuery}
70
70
  placeholder="Expandable terminal search..."
71
71
  showFloatPeek
72
- resultIndicatorPanel={<ResultPanel />}
72
+ peekContent={<ResultPanel />}
73
73
  />
74
74
  </div>
75
75
 
@@ -93,14 +93,35 @@ export default function SearchInput({
93
93
 
94
94
  // --- 1. SIMPLE VARIANT ---
95
95
  if (variant === 'simple') {
96
- const hasResults = resultsCount > 0 && value.length > 0;
96
+ const hasQuery = value.length > 0;
97
+ const hasResults = resultsCount > 0;
97
98
 
98
99
  // ⚡ Fallback logic: check if the dev supplied a custom peek content block component
99
- const renderedPeek = peekContent || (
100
- <p style={{ margin: 0, fontSize: '10px', fontFamily: searchTokens.typography.mono, color: searchTokens.colors.muted, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
101
- Showing <span style={{ color: searchTokens.colors.borderAccent, fontWeight: 'bold' }}>{resultsCount}</span> matching database metrics records
102
- </p>
103
- );
100
+ const renderedPeek = () => {
101
+
102
+ if (hasQuery && peekContent) {
103
+ return peekContent;
104
+ }
105
+
106
+ if (hasQuery && !peekContent && hasResults) {
107
+ return (
108
+ <p style={{ margin: 0, fontSize: '10px', fontFamily: searchTokens.typography.mono, color: searchTokens.colors.muted, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
109
+ Showing <span style={{ color: searchTokens.colors.borderAccent, fontWeight: 'bold' }}>{resultsCount}</span> matching database metrics records
110
+ </p>
111
+ )
112
+ }
113
+
114
+ if (hasQuery && !peekContent && !hasResults) {
115
+ return (
116
+ <p style={{ margin: 0, fontSize: '10px', fontFamily: searchTokens.typography.mono, color: searchTokens.colors.borderAccent, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
117
+ No matching records found for your query: <span style={{ color: searchTokens.colors.text, fontWeight: 'bold' }}>{value}</span>
118
+ </p>
119
+ )
120
+ }
121
+
122
+ return null;
123
+
124
+ }
104
125
 
105
126
  return (
106
127
  <div style={baseWrapperStyles} className={className}>
@@ -136,16 +157,16 @@ export default function SearchInput({
136
157
  right: 0,
137
158
  top: '32px',
138
159
  zIndex: 10,
139
- overflow: 'hidden',
160
+ // overflow: 'hidden',
140
161
  transition: searchTokens.transitions.smooth,
141
- height: hasResults ? '24px' : '0px',
142
- opacity: hasResults ? 1 : 0,
143
- transform: hasResults ? 'translateY(0px)' : 'translateY(-4px)',
162
+ height: hasQuery ? 'auto' : '0px',
163
+ opacity: hasQuery ? 1 : 0,
164
+ transform: hasQuery ? 'translateY(4px)' : 'translateY(-4px)',
144
165
  pointerEvents: 'none'
145
166
  }}
146
167
  >
147
- <div style={{ backgroundColor: searchTokens.colors.sidebarBg, border: `1px solid ${searchTokens.colors.border}`, borderTop: 'none', padding: '4px 6px', borderRadius: '0 0 6px 6px', boxShadow: '0 4px 6px -1px rgba(0,0,0,0.1)' }}>
148
- {renderedPeek}
168
+ <div style={{ backgroundColor: searchTokens.colors.sidebarBg, border: `0px solid ${searchTokens.colors.border}`, borderTop: 'none', padding: '4px 6px', borderRadius: '6px', boxShadow: '0 4px 6px -1px rgba(0,0,0,0.1)' }}>
169
+ {renderedPeek()}
149
170
  </div>
150
171
  </div>
151
172
  </div>
package/src/index.css CHANGED
@@ -36,4 +36,12 @@
36
36
  --color-vsc-muted: #8b949e;
37
37
  --color-vsc-bg-input: #1f1f1f;
38
38
  }
39
+ }
40
+
41
+ .p-8{
42
+ padding:32px;
43
+ }
44
+
45
+ .voxel:bg-amber-500{
46
+ background-color:var(--color-vsc-accent);
39
47
  }
package/vite.config.mts CHANGED
@@ -8,12 +8,11 @@ import { fileURLToPath } from 'node:url';
8
8
  import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
9
9
  import { playwright } from '@vitest/browser-playwright';
10
10
  const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
11
- import tailwindcss from '@tailwindcss/vite';
11
+
12
12
 
13
13
  // More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
14
14
  export default defineConfig({
15
15
  plugins: [
16
- tailwindcss(),
17
16
  react(),
18
17
  // Auto-generates independent TypeScript type declaration files (.d.ts) matching paths
19
18
  dts({