dialkit 0.2.1 → 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.
- package/README.md +39 -6
- package/dist/index.cjs +565 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -6
- package/dist/index.d.ts +37 -6
- package/dist/index.js +546 -155
- package/dist/index.js.map +1 -1
- package/dist/solid/index.cjs +2569 -0
- package/dist/solid/index.cjs.map +1 -0
- package/dist/solid/index.d.cts +225 -0
- package/dist/solid/index.d.ts +225 -0
- package/dist/solid/index.js +2530 -0
- package/dist/solid/index.js.map +1 -0
- package/dist/styles.css +9 -8
- package/package.json +31 -9
package/README.md
CHANGED
|
@@ -72,12 +72,24 @@ Returns a fully typed object matching your config shape with live values. Updati
|
|
|
72
72
|
|
|
73
73
|
### Slider
|
|
74
74
|
|
|
75
|
+
Numbers create sliders. There are three ways to define them:
|
|
76
|
+
|
|
77
|
+
**Explicit range** — `[default, min, max]`:
|
|
78
|
+
```tsx
|
|
79
|
+
blur: [24, 0, 100]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Explicit range + step** — `[default, min, max, step]`:
|
|
75
83
|
```tsx
|
|
76
|
-
blur: [24, 0, 100]
|
|
77
|
-
scale: 1.2 // auto-infers range from value
|
|
84
|
+
blur: [24, 0, 100, 5] // snaps in increments of 5
|
|
78
85
|
```
|
|
86
|
+
When `step` is omitted, it's inferred from the range (see table below).
|
|
79
87
|
|
|
80
|
-
|
|
88
|
+
**Auto-inferred** — bare number:
|
|
89
|
+
```tsx
|
|
90
|
+
scale: 1.2
|
|
91
|
+
```
|
|
92
|
+
A single number auto-infers a reasonable min, max, and step:
|
|
81
93
|
|
|
82
94
|
| Value range | Inferred min/max | Step |
|
|
83
95
|
|-------------|-----------------|------|
|
|
@@ -194,22 +206,42 @@ const p = useDialKit('Controls', {
|
|
|
194
206
|
```
|
|
195
207
|
|
|
196
208
|
Action buttons trigger callbacks without storing any value. The `label` defaults to the formatted key name (camelCase becomes Title Case). Multiple adjacent actions are grouped vertically.
|
|
209
|
+
Action buttons can be placed at the root or nested inside folders.
|
|
197
210
|
|
|
198
211
|
### Folder
|
|
199
212
|
|
|
213
|
+
Any nested plain object becomes a collapsible folder. Folders can nest arbitrarily deep.
|
|
214
|
+
|
|
200
215
|
```tsx
|
|
201
216
|
shadow: {
|
|
202
217
|
blur: [10, 0, 50],
|
|
203
218
|
opacity: [0.25, 0, 1],
|
|
204
219
|
color: '#000000',
|
|
205
220
|
}
|
|
221
|
+
|
|
222
|
+
// Access nested values:
|
|
223
|
+
params.shadow.blur // number
|
|
224
|
+
params.shadow.color // string
|
|
206
225
|
```
|
|
207
226
|
|
|
208
|
-
|
|
227
|
+
Folders are open by default. Add `_collapsed: true` to start a folder closed. This is a reserved metadata key — it controls the UI only and won't appear in your returned values.
|
|
209
228
|
|
|
210
229
|
```tsx
|
|
211
|
-
|
|
212
|
-
|
|
230
|
+
shadow: {
|
|
231
|
+
_collapsed: true, // folder starts closed
|
|
232
|
+
blur: [10, 0, 50],
|
|
233
|
+
opacity: [0.25, 0, 1],
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
DialKit also supports dynamic config updates. If your config shape, defaults, options, or labels change over time, the panel updates while preserving current values where paths still exist.
|
|
238
|
+
|
|
239
|
+
Dynamic configs work with both inline objects and memoized configs — no special consumer action needed:
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
const values = useDialKit('Controls', {
|
|
243
|
+
style: { type: 'select', options: dynamicOptions },
|
|
244
|
+
});
|
|
213
245
|
```
|
|
214
246
|
|
|
215
247
|
---
|
|
@@ -223,6 +255,7 @@ params.shadow.color // string
|
|
|
223
255
|
| Prop | Type | Default |
|
|
224
256
|
|------|------|---------|
|
|
225
257
|
| `position` | `'top-right' \| 'top-left' \| 'bottom-right' \| 'bottom-left'` | `'top-right'` |
|
|
258
|
+
| `defaultOpen` | `boolean` | `true` |
|
|
226
259
|
|
|
227
260
|
Mount once at your app root. The panel renders via a portal on `document.body`. It collapses to a small icon button and expands to 280px wide on click.
|
|
228
261
|
|