vue-pane 0.0.0 → 0.5.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 (3) hide show
  1. package/README.md +11 -373
  2. package/package.json +10 -10
  3. package/src/vite-env.d.ts +1 -0
package/README.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  Compact debug panel components for Vue 3. A spiritual replacement for [Tweakpane](https://tweakpane.github.io/docs/) — same visual style, Vue-native API.
4
4
 
5
+ **[Documentation](https://unstoppablecarl.github.io/vue-pane/)**
6
+
5
7
  ## Features
6
8
 
7
9
  - Inputs: text, number (drag-to-change), slider, checkbox, select, color picker, 2D point
8
10
  - Display: single-line monitor, multi-line monitor, graph/sparkline
9
11
  - Layout: collapsible pane, collapsible folders, tabs, separator
10
- - Folder state persisted to `localStorage` via a `name` prop
11
- - BEM CSS class names (`vp-pane`, `vp-folder__title`, etc.) — fully themeable via CSS custom properties
12
- - TypeScript throughout
12
+ - Pane and folder state persisted to `localStorage` via the `id` prop
13
13
 
14
14
  ## Installation
15
15
 
@@ -25,10 +25,10 @@ import 'vue-pane/dist/vue-pane.css'
25
25
 
26
26
  ### Nuxt / source-first bundlers
27
27
 
28
- The package exposes a `"source"` export condition pointing at the raw `.vue` and `.scss` files. Bundlers that understand this condition (Nuxt, Vite with explicit `resolve.conditions: ['source']`) will process the source directly — no CSS import needed, and templates are compiled once by your own build.
28
+ The package exposes a `"source"` export condition pointing at the raw `.vue` and `.scss` files. Bundlers that understand this condition (Nuxt, Vite with explicit `resolve.conditions: ['source']`) will process the source directly — no CSS import needed.
29
29
 
30
30
  ```ts
31
- // vite.config.ts — opt in explicitly if needed
31
+ // vite.config.ts
32
32
  export default defineConfig({
33
33
  resolve: { conditions: ['source'] },
34
34
  })
@@ -37,9 +37,9 @@ export default defineConfig({
37
37
  ## Quick start
38
38
 
39
39
  ```vue
40
- <script setup lang="ts">
40
+ <script setup>
41
41
  import { ref } from 'vue'
42
- import { VPane, VPFolder, VPNumber, VPCheckbox, VPButton } from 'vue-pane'
42
+ import { VPane, PNumber, PCheckbox, PMonitor } from 'vue-pane'
43
43
 
44
44
  const speed = ref(1)
45
45
  const enabled = ref(true)
@@ -47,376 +47,14 @@ const enabled = ref(true)
47
47
 
48
48
  <template>
49
49
  <VPane title="Controls" style="width: 280px">
50
- <VPNumber v-model="speed" label="Speed" :min="0" :max="10" :step="0.1" />
51
- <VPCheckbox v-model="enabled" label="Enabled" />
52
- <VPButton label="Reset" @click="speed = 1; enabled = true" />
53
-
54
- <VPFolder title="Advanced" name="advanced">
55
- <VPNumber v-model="speed" label="Fine" :step="0.01" />
56
- </VPFolder>
50
+ <PNumber v-model="speed" label="Speed" :min="0" :max="10" :step="0.1" />
51
+ <PCheckbox v-model="enabled" label="Enabled" />
52
+ <PMonitor :value="speed" label="Speed" />
57
53
  </VPane>
58
54
  </template>
59
55
  ```
60
56
 
61
- ---
62
-
63
- ## Component reference
64
-
65
- ### `VPane`
66
-
67
- Root container. Applies theming (font, colors, shadow, border-radius) to all children.
68
-
69
- ```vue
70
- <VPane title="My Panel" :expanded="true" style="width: 300px">
71
- <!-- components -->
72
- </VPane>
73
- ```
74
-
75
- | Prop | Type | Default | Description |
76
- |---|---|---|---|
77
- | `title` | `string` | — | Title text. If omitted the header button is hidden and the pane is always open. |
78
- | `expanded` | `boolean` | `true` | Initial open/closed state. Only applies when `title` is set. |
79
- | `disabled` | `boolean` | — | Applies `vp--disabled` — disables pointer events. |
80
- | `hidden` | `boolean` | — | Applies `vp--hidden` — `display: none`. |
81
-
82
- ---
83
-
84
- ### `VPFolder`
85
-
86
- Collapsible folder. Expanded state is saved to `localStorage` when `name` is provided.
87
-
88
- ```vue
89
- <VPFolder title="Transform" name="transform">
90
- <!-- components -->
91
- </VPFolder>
92
- ```
93
-
94
- | Prop | Type | Default | Description |
95
- |---|---|---|---|
96
- | `title` | `string` | **required** | Folder title. |
97
- | `name` | `string` | — | localStorage key (`vp-folder-{name}`). Without it, state is not persisted. |
98
- | `expanded` | `boolean` | `true` | Initial open/closed state (overridden by localStorage when `name` is set). |
99
- | `disabled` | `boolean` | — | Disables pointer events on the folder. |
100
- | `hidden` | `boolean` | — | Hides the folder. |
101
-
102
- ---
103
-
104
- ### `VPText`
105
-
106
- Plain text input.
107
-
108
- ```vue
109
- <VPText v-model="name" label="Name" />
110
- ```
111
-
112
- | Prop | Type | Description |
113
- |---|---|---|
114
- | `modelValue` | `string` | **required** |
115
- | `label` | `string` | Label text. Omit for full-width input. |
116
-
117
- ---
118
-
119
- ### `VPNumber`
120
-
121
- Number input with a drag-to-change knob on the left edge. Keyboard: `↑`/`↓` steps by `step`; `Shift+↑`/`↓` steps by `step × 10`.
122
-
123
- ```vue
124
- <VPNumber v-model="count" label="Count" :min="0" :max="100" :step="1" />
125
- ```
126
-
127
- | Prop | Type | Default | Description |
128
- |---|---|---|---|
129
- | `modelValue` | `number` | **required** | |
130
- | `label` | `string` | — | |
131
- | `min` | `number` | — | Clamp minimum. |
132
- | `max` | `number` | — | Clamp maximum. |
133
- | `step` | `number` | `1` | Drag and arrow key increment. |
134
-
135
- ---
136
-
137
- ### `VPSlider`
138
-
139
- Horizontal track-and-knob slider.
140
-
141
- ```vue
142
- <VPSlider v-model="opacity" label="Opacity" :min="0" :max="1" :step="0.01" />
143
- ```
144
-
145
- | Prop | Type | Default | Description |
146
- |---|---|---|---|
147
- | `modelValue` | `number` | **required** | |
148
- | `label` | `string` | — | |
149
- | `min` | `number` | `0` | |
150
- | `max` | `number` | `1` | |
151
- | `step` | `number` | `0.01` | |
152
-
153
- ---
154
-
155
- ### `VPCheckbox`
156
-
157
- Boolean toggle.
158
-
159
- ```vue
160
- <VPCheckbox v-model="visible" label="Visible" />
161
- ```
162
-
163
- | Prop | Type | Description |
164
- |---|---|---|
165
- | `modelValue` | `boolean` | **required** |
166
- | `label` | `string` | |
167
-
168
- ---
169
-
170
- ### `VPSelect`
171
-
172
- Dropdown list.
173
-
174
- ```vue
175
- <VPSelect v-model="mode" :options="options" label="Mode" />
176
- ```
177
-
178
- ```ts
179
- const options = [
180
- { value: 'linear', label: 'Linear' },
181
- { value: 'ease', label: 'Ease' },
182
- ]
183
- ```
184
-
185
- | Prop | Type | Description |
186
- |---|---|---|
187
- | `modelValue` | `string \| number` | **required** |
188
- | `options` | `{ value: string \| number; label: string }[]` | **required** |
189
- | `label` | `string` | |
190
-
191
- ---
192
-
193
- ### `VPColor`
194
-
195
- Color picker. Clicking the swatch opens an inline HSV palette with a hue slider and RGB inputs.
196
-
197
- ```vue
198
- <VPColor v-model="fill" label="Fill" />
199
- ```
200
-
201
- | Prop | Type | Default | Description |
202
- |---|---|---|---|
203
- | `modelValue` | `string` | **required** | Hex color string, e.g. `#ff5500`. |
204
- | `label` | `string` | — | |
205
- | `alpha` | `boolean` | `false` | Show alpha channel controls. |
206
-
207
- ---
208
-
209
- ### `VPPoint2d`
210
-
211
- Two-axis coordinate input. Click the crosshair button to open an interactive 2D canvas picker.
212
-
213
- ```vue
214
- <VPPoint2d v-model="position" label="Position" :min="-1" :max="1" />
215
- ```
216
-
217
- | Prop | Type | Default | Description |
218
- |---|---|---|---|
219
- | `modelValue` | `{ x: number; y: number }` | **required** | |
220
- | `label` | `string` | — | |
221
- | `min` | `number` | `-1` | Range minimum for both axes. |
222
- | `max` | `number` | `1` | Range maximum for both axes. |
223
-
224
- ---
225
-
226
- ### `VPButton`
227
-
228
- Clickable action button.
229
-
230
- ```vue
231
- <VPButton label="Apply" @click="apply" />
232
- ```
233
-
234
- | Prop | Type | Description |
235
- |---|---|---|
236
- | `label` | `string` | **required** |
237
-
238
- | Event | Description |
239
- |---|---|
240
- | `click` | Emitted on button press. |
241
-
242
- ---
243
-
244
- ### `VPSeparator`
245
-
246
- Horizontal rule for visual grouping.
247
-
248
- ```vue
249
- <VPSeparator />
250
- ```
251
-
252
- ---
253
-
254
- ### `VPTab`
255
-
256
- Tab container with named slots per tab. Slot names match the strings in the `tabs` array.
257
-
258
- ```vue
259
- <VPTab :tabs="['Settings', 'Info']" v-model="activeTab">
260
- <template #Settings>
261
- <VPNumber v-model="speed" label="Speed" />
262
- </template>
263
- <template #Info>
264
- <VPMonitor :value="speed" label="Speed" />
265
- </template>
266
- </VPTab>
267
- ```
268
-
269
- | Prop | Type | Default | Description |
270
- |---|---|---|---|
271
- | `tabs` | `string[]` | **required** | Tab labels (also the slot names). |
272
- | `modelValue` | `number` | `0` | Active tab index. |
273
-
274
- ---
275
-
276
- ### `VPMonitor`
277
-
278
- Read-only single-line display.
279
-
280
- ```vue
281
- <VPMonitor :value="fps" label="FPS" />
282
- ```
283
-
284
- | Prop | Type | Description |
285
- |---|---|---|
286
- | `value` | `unknown` | **required** — rendered with `{{ value }}`. |
287
- | `label` | `string` | |
288
-
289
- ---
290
-
291
- ### `VPMonitorMulti`
292
-
293
- Read-only multi-line display (3 rows).
294
-
295
- ```vue
296
- <VPMonitorMulti :value="`x: ${pos.x}\ny: ${pos.y}`" label="Position" />
297
- ```
298
-
299
- | Prop | Type | Description |
300
- |---|---|---|
301
- | `value` | `unknown` | Rendered verbatim. Use `\n` for line breaks. |
302
- | `label` | `string` | |
303
-
304
- ---
305
-
306
- ### `VPGraph`
307
-
308
- Sparkline chart. Pass a rolling array of numbers; the component normalises the range automatically.
309
-
310
- ```vue
311
- <VPGraph :values="history" label="FPS" />
312
- ```
313
-
314
- | Prop | Type | Description |
315
- |---|---|---|
316
- | `values` | `number[]` | **required** |
317
- | `label` | `string` | |
318
- | `min` | `number` | Auto from data. |
319
- | `max` | `number` | Auto from data. |
320
-
321
- ---
322
-
323
- ### `VPLabel`
324
-
325
- Layout primitive that pairs a label with any arbitrary content. Used internally by all inputs — available for custom components.
326
-
327
- ```vue
328
- <VPLabel label="Custom">
329
- <MyWidget />
330
- </VPLabel>
331
- ```
332
-
333
- | Prop | Type | Description |
334
- |---|---|---|
335
- | `label` | `string` | Omit for full-width (no-label) layout. |
336
-
337
- ---
338
-
339
- ## Theming
340
-
341
- Override the default dark theme by setting CSS custom properties on any ancestor element (or `:root`).
342
-
343
- ```css
344
- .my-app {
345
- --vp-base-background-color: #1e1e2e;
346
- --vp-container-foreground-color: #cdd6f4;
347
- --vp-input-background-color: rgba(205, 214, 244, 0.06);
348
- --vp-blade-value-width: 180px;
349
- --vp-container-unit-size: 22px;
350
- }
351
- ```
352
-
353
- ### Full variable reference
354
-
355
- | Variable | Default | Description |
356
- |---|---|---|
357
- | `--vp-base-background-color` | `#28292e` | Pane background |
358
- | `--vp-base-border-radius` | `6px` | Pane corner radius |
359
- | `--vp-base-font-family` | `Roboto Mono, monospace` | Font stack |
360
- | `--vp-base-shadow-color` | `rgba(0,0,0,0.2)` | Drop shadow |
361
- | `--vp-blade-border-radius` | `2px` | Input element corner radius |
362
- | `--vp-blade-horizontal-padding` | `4px` | Input horizontal padding |
363
- | `--vp-blade-value-width` | `160px` | Width of the value column |
364
- | `--vp-button-background-color` | `#adafb8` | Button fill |
365
- | `--vp-button-foreground-color` | `#28292e` | Button text |
366
- | `--vp-container-background-color` | `rgba(...)` | Folder/tab header fill |
367
- | `--vp-container-foreground-color` | `#bbbcc4` | Folder/tab header text |
368
- | `--vp-container-unit-size` | `20px` | Row height |
369
- | `--vp-container-unit-spacing` | `4px` | Gap between rows |
370
- | `--vp-container-vertical-padding` | `4px` | Folder content top/bottom padding |
371
- | `--vp-input-background-color` | `rgba(...)` | Input fill |
372
- | `--vp-input-foreground-color` | `#bbbcc4` | Input text |
373
- | `--vp-label-foreground-color` | `rgba(...)` | Label text (slightly dimmed) |
374
- | `--vp-monitor-background-color` | `rgba(...)` | Monitor/display fill |
375
- | `--vp-monitor-foreground-color` | `rgba(...)` | Monitor text |
376
- | `--vp-groove-foreground-color` | `rgba(...)` | Separator line colour |
377
-
378
- ---
379
-
380
- ## TypeScript
381
-
382
- All components are typed. Named exports only — import what you need:
383
-
384
- ```ts
385
- import type { } from 'vue-pane' // no public types beyond the components themselves
386
- import { VPane, VPNumber, VPColor } from 'vue-pane'
387
- ```
388
-
389
- ---
390
-
391
- ## CSS class names
392
-
393
- Classes follow BEM with a `vp-` prefix. Useful for targeted overrides:
394
-
395
- ```css
396
- /* make all labels uppercase */
397
- .vp-label__text { text-transform: uppercase; }
398
-
399
- /* widen value column in one pane only */
400
- #my-pane { --vp-blade-value-width: 200px; }
401
- ```
402
-
403
- Global state classes applied automatically:
404
-
405
- | Class | Description |
406
- |---|---|
407
- | `vp--disabled` | Pointer events off, element dimmed |
408
- | `vp--hidden` | `display: none` |
409
- | `vp--first` | First visible child in a container |
410
- | `vp--last` | Last visible child |
411
-
412
- ---
413
-
414
- ## Monorepo
415
-
416
- ```
417
- packages/vue-pane/ ← npm package
418
- apps/example/ ← development example app
419
- ```
57
+ ## Development
420
58
 
421
59
  ```sh
422
60
  pnpm dev # start the example app (resolves vue-pane from source, no build needed)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-pane",
3
- "version": "0.0.0",
3
+ "version": "0.5.0",
4
4
  "description": "A Vue 3 debug/inspector pane component library inspired by Tweakpane.",
5
5
  "type": "module",
6
6
  "main": "./dist/vue-pane.umd.cjs",
@@ -18,14 +18,6 @@
18
18
  "dist",
19
19
  "src"
20
20
  ],
21
- "scripts": {
22
- "build": "vue-tsc -b && vite build",
23
- "build:watch": "vite build --watch",
24
- "typecheck": "vue-tsc -b --noEmit",
25
- "dev": "pnpm --prefix example dev",
26
- "lint": "eslint src",
27
- "lint:fix": "eslint src --fix"
28
- },
29
21
  "peerDependencies": {
30
22
  "vue": "^3.5.0"
31
23
  },
@@ -75,5 +67,13 @@
75
67
  "dependencies": {
76
68
  "@floating-ui/vue": "^1.1.11",
77
69
  "vue-color": "^3.3.3"
70
+ },
71
+ "scripts": {
72
+ "build": "vue-tsc -b && vite build",
73
+ "build:watch": "vite build --watch",
74
+ "typecheck": "vue-tsc -b --noEmit",
75
+ "dev": "pnpm --prefix example dev",
76
+ "lint": "eslint src",
77
+ "lint:fix": "eslint src --fix"
78
78
  }
79
- }
79
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />