@snap-rail/ui 0.1.1 → 0.2.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/lib/charts.js +5 -4
- package/lib/contract.js +118 -61
- package/lib/fallback.js +11 -0
- package/lib/index.js +3948 -154
- package/lib/runtime.js +151 -28
- package/lib/settings.js +67 -23
- package/lib/types/charts.d.ts +1 -1
- package/lib/types/charts.js +5 -5
- package/lib/types/components/alert.d.ts +57 -0
- package/lib/types/components/alert.js +46 -0
- package/lib/types/components/controls.d.ts +74 -11
- package/lib/types/components/controls.js +60 -17
- package/lib/types/components/form-rhf.d.ts +56 -0
- package/lib/types/components/form-rhf.js +74 -0
- package/lib/types/components/form.d.ts +33 -5
- package/lib/types/components/form.js +22 -6
- package/lib/types/components/index.d.ts +7 -0
- package/lib/types/components/index.js +7 -0
- package/lib/types/components/input.d.ts +11 -5
- package/lib/types/components/input.js +34 -7
- package/lib/types/components/layout.d.ts +28 -6
- package/lib/types/components/layout.js +86 -13
- package/lib/types/components/overlay.d.ts +95 -0
- package/lib/types/components/overlay.js +138 -0
- package/lib/types/components/schema-form.d.ts +3 -1
- package/lib/types/components/schema-form.js +46 -40
- package/lib/types/components/slider.d.ts +18 -0
- package/lib/types/components/slider.js +15 -0
- package/lib/types/contract.d.ts +49 -29
- package/lib/types/contract.js +49 -29
- package/lib/types/runtime.js +3 -2
- package/lib/types/settings-pages/appearance.js +2 -2
- package/lib/types/settings-pages/plugins.js +2 -2
- package/package.json +13 -6
- package/src/styles/base.css +243 -5
- package/src/styles/default.css +184 -6
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Coarse value adjustment for touch operation: a Radix slider with the
|
|
4
|
+
* semantic anatomy (`slider.root/track/range/thumb`). Thumb size rides the
|
|
5
|
+
* skin's control tokens so gloved operation keeps a real target.
|
|
6
|
+
*
|
|
7
|
+
* @module @snap-rail/ui/components/slider
|
|
8
|
+
*/
|
|
9
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
10
|
+
import { cn, part } from "../utils.js";
|
|
11
|
+
/** A ranged control with a large touch target and keyboard stepping. */
|
|
12
|
+
export function Slider({ label, className, children, ...props }) {
|
|
13
|
+
return (_jsxs(SliderPrimitive.Root, { ...part('slider', 'root'), className: cn('snap-slider', className), "aria-label": label, ...props, children: [_jsx(SliderPrimitive.Track, { ...part('slider', 'track'), className: "snap-slider-track", children: _jsx(SliderPrimitive.Range, { ...part('slider', 'range'), className: "snap-slider-range" }) }), _jsx(SliderPrimitive.Thumb, { ...part('slider', 'thumb'), className: "snap-slider-thumb", "aria-label": label }), children] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=slider.js.map
|
package/lib/types/contract.d.ts
CHANGED
|
@@ -188,11 +188,11 @@ export declare const UI_COMPONENTS: {
|
|
|
188
188
|
readonly input: {
|
|
189
189
|
readonly parts: readonly ["input.root", "input.field", "input.prefix", "input.suffix", "input.clear"];
|
|
190
190
|
readonly slots: readonly ["prefix", "suffix"];
|
|
191
|
-
readonly props: readonly ["size", "invalid", "disabled"];
|
|
191
|
+
readonly props: readonly ["size", "invalid", "disabled", "fieldClassName"];
|
|
192
192
|
};
|
|
193
193
|
readonly textarea: {
|
|
194
194
|
readonly parts: readonly ["textarea.root", "textarea.field"];
|
|
195
|
-
readonly props: readonly ["size", "invalid", "disabled"];
|
|
195
|
+
readonly props: readonly ["size", "invalid", "disabled", "fieldClassName"];
|
|
196
196
|
};
|
|
197
197
|
readonly 'number-input': {
|
|
198
198
|
readonly parts: readonly ["number-input.root", "number-input.field", "number-input.step-up", "number-input.step-down"];
|
|
@@ -200,31 +200,31 @@ export declare const UI_COMPONENTS: {
|
|
|
200
200
|
};
|
|
201
201
|
readonly select: {
|
|
202
202
|
readonly parts: readonly ["select.root", "select.trigger", "select.value", "select.chevron", "select.content", "select.item", "select.item-indicator", "select.empty"];
|
|
203
|
-
readonly slots: readonly ["empty"];
|
|
204
|
-
readonly props: readonly ["size", "invalid", "disabled", "
|
|
203
|
+
readonly slots: readonly ["empty", "children"];
|
|
204
|
+
readonly props: readonly ["size", "invalid", "disabled", "defaultValue", "side", "align"];
|
|
205
205
|
};
|
|
206
206
|
readonly 'touch-select': {
|
|
207
207
|
readonly parts: readonly ["touch-select.root", "touch-select.trigger", "touch-select.sheet", "touch-select.option"];
|
|
208
208
|
readonly props: readonly ["invalid", "disabled"];
|
|
209
209
|
};
|
|
210
210
|
readonly checkbox: {
|
|
211
|
-
readonly parts: readonly ["checkbox.root", "checkbox.
|
|
212
|
-
readonly slots: readonly ["label"];
|
|
213
|
-
readonly props: readonly ["checked", "invalid", "disabled"];
|
|
211
|
+
readonly parts: readonly ["checkbox.root", "checkbox.indicator", "checkbox.label", "checkbox.field", "checkbox.description"];
|
|
212
|
+
readonly slots: readonly ["label", "description"];
|
|
213
|
+
readonly props: readonly ["checked", "invalid", "disabled", "labelPosition"];
|
|
214
214
|
};
|
|
215
215
|
readonly switch: {
|
|
216
|
-
readonly parts: readonly ["switch.root", "switch.thumb", "switch.label"];
|
|
217
|
-
readonly slots: readonly ["label"];
|
|
218
|
-
readonly props: readonly ["checked", "disabled"];
|
|
216
|
+
readonly parts: readonly ["switch.root", "switch.thumb", "switch.label", "switch.field", "switch.description"];
|
|
217
|
+
readonly slots: readonly ["label", "description"];
|
|
218
|
+
readonly props: readonly ["checked", "disabled", "labelPosition"];
|
|
219
219
|
};
|
|
220
220
|
readonly 'radio-group': {
|
|
221
|
-
readonly parts: readonly ["radio-group.root", "radio-group.item", "radio-group.indicator", "radio-group.label"];
|
|
222
|
-
readonly props: readonly ["value", "disabled"];
|
|
221
|
+
readonly parts: readonly ["radio-group.root", "radio-group.item", "radio-group.indicator", "radio-group.label", "radio-group.block", "radio-group.description"];
|
|
222
|
+
readonly props: readonly ["value", "disabled", "label", "description"];
|
|
223
223
|
};
|
|
224
224
|
readonly tabs: {
|
|
225
225
|
readonly parts: readonly ["tabs.root", "tabs.list", "tabs.trigger", "tabs.content"];
|
|
226
226
|
readonly slots: readonly ["list", "content"];
|
|
227
|
-
readonly props: readonly ["value"
|
|
227
|
+
readonly props: readonly ["value"];
|
|
228
228
|
};
|
|
229
229
|
readonly table: {
|
|
230
230
|
readonly parts: readonly ["table.root", "table.header", "table.body", "table.row", "table.head", "table.cell", "table.empty"];
|
|
@@ -239,29 +239,29 @@ export declare const UI_COMPONENTS: {
|
|
|
239
239
|
readonly slots: readonly ["header", "title", "body", "footer"];
|
|
240
240
|
};
|
|
241
241
|
readonly dialog: {
|
|
242
|
-
readonly parts: readonly ["dialog.
|
|
242
|
+
readonly parts: readonly ["dialog.overlay", "dialog.panel", "dialog.header", "dialog.title", "dialog.description", "dialog.body", "dialog.footer", "dialog.close"];
|
|
243
243
|
readonly slots: readonly ["header", "title", "description", "body", "footer"];
|
|
244
244
|
readonly props: readonly ["open", "presentation", "size"];
|
|
245
245
|
};
|
|
246
246
|
readonly sheet: {
|
|
247
|
-
readonly parts: readonly ["
|
|
247
|
+
readonly parts: readonly ["dialog.overlay", "dialog.panel", "dialog.header", "dialog.title", "dialog.description", "dialog.body", "dialog.footer"];
|
|
248
248
|
readonly slots: readonly ["header", "body", "footer"];
|
|
249
249
|
readonly props: readonly ["open", "presentation"];
|
|
250
250
|
};
|
|
251
251
|
readonly popover: {
|
|
252
|
-
readonly parts: readonly ["popover.
|
|
252
|
+
readonly parts: readonly ["popover.trigger", "popover.content"];
|
|
253
253
|
readonly slots: readonly ["trigger", "content"];
|
|
254
254
|
};
|
|
255
255
|
readonly tooltip: {
|
|
256
|
-
readonly parts: readonly ["tooltip.
|
|
256
|
+
readonly parts: readonly ["tooltip.trigger", "tooltip.content"];
|
|
257
257
|
readonly slots: readonly ["trigger", "content"];
|
|
258
258
|
};
|
|
259
259
|
readonly menu: {
|
|
260
|
-
readonly parts: readonly ["menu.
|
|
260
|
+
readonly parts: readonly ["menu.trigger", "menu.content", "menu.item", "menu.checkbox-item", "menu.item-indicator", "menu.separator"];
|
|
261
261
|
readonly slots: readonly ["trigger", "content"];
|
|
262
262
|
};
|
|
263
263
|
readonly toast: {
|
|
264
|
-
readonly parts: readonly ["toast.root", "toast.title", "toast.description", "toast.action", "toast.close"];
|
|
264
|
+
readonly parts: readonly ["toast.root", "toast.title", "toast.description", "toast.action", "toast.close", "toast.viewport"];
|
|
265
265
|
readonly slots: readonly ["action"];
|
|
266
266
|
};
|
|
267
267
|
readonly progress: {
|
|
@@ -274,6 +274,28 @@ export declare const UI_COMPONENTS: {
|
|
|
274
274
|
readonly parts: readonly ["led.root", "led.halo"];
|
|
275
275
|
readonly props: readonly ["tone"];
|
|
276
276
|
};
|
|
277
|
+
readonly alert: {
|
|
278
|
+
readonly parts: readonly ["alert.root", "alert.title", "alert.description"];
|
|
279
|
+
readonly slots: readonly ["title", "description"];
|
|
280
|
+
readonly props: readonly ["intent"];
|
|
281
|
+
};
|
|
282
|
+
readonly separator: {
|
|
283
|
+
readonly parts: readonly ["separator.root"];
|
|
284
|
+
readonly props: readonly ["orientation"];
|
|
285
|
+
};
|
|
286
|
+
readonly skeleton: {
|
|
287
|
+
readonly parts: readonly ["skeleton.root"];
|
|
288
|
+
readonly props: readonly ["variant"];
|
|
289
|
+
};
|
|
290
|
+
readonly list: {
|
|
291
|
+
readonly parts: readonly ["list.root", "list.item", "list.leading", "list.content", "list.trailing"];
|
|
292
|
+
readonly slots: readonly ["leading", "trailing"];
|
|
293
|
+
readonly props: readonly ["divided", "selected", "disabled"];
|
|
294
|
+
};
|
|
295
|
+
readonly slider: {
|
|
296
|
+
readonly parts: readonly ["slider.root", "slider.track", "slider.range", "slider.thumb"];
|
|
297
|
+
readonly props: readonly ["value", "min", "max", "step"];
|
|
298
|
+
};
|
|
277
299
|
readonly spinner: {
|
|
278
300
|
readonly parts: readonly ["spinner.root"];
|
|
279
301
|
};
|
|
@@ -284,15 +306,17 @@ export declare const UI_COMPONENTS: {
|
|
|
284
306
|
readonly form: {
|
|
285
307
|
readonly parts: readonly ["form.root", "form.fields", "form.actions"];
|
|
286
308
|
readonly slots: readonly ["fields", "actions"];
|
|
309
|
+
readonly props: readonly ["orientation", "gap", "columns", "form"];
|
|
287
310
|
};
|
|
288
311
|
readonly field: {
|
|
289
312
|
readonly parts: readonly ["field.root", "field.label", "field.control", "field.help", "field.error"];
|
|
290
313
|
readonly slots: readonly ["label", "control", "help", "error"];
|
|
291
|
-
readonly props: readonly ["invalid", "required", "
|
|
314
|
+
readonly props: readonly ["invalid", "required", "orientation", "labelWidth", "labelAlign"];
|
|
292
315
|
};
|
|
293
316
|
readonly 'schema-form': {
|
|
294
317
|
readonly parts: readonly ["schema-form.root", "schema-form.field"];
|
|
295
318
|
readonly slots: readonly ["fields"];
|
|
319
|
+
readonly props: readonly ["columns"];
|
|
296
320
|
};
|
|
297
321
|
readonly 'app-shell': {
|
|
298
322
|
readonly parts: readonly ["app-shell.root", "app-shell.header", "app-shell.sidebar", "app-shell.main", "app-shell.footer"];
|
|
@@ -307,7 +331,7 @@ export declare const UI_COMPONENTS: {
|
|
|
307
331
|
readonly slots: readonly ["header", "title", "actions", "body"];
|
|
308
332
|
};
|
|
309
333
|
readonly toolbar: {
|
|
310
|
-
readonly parts: readonly ["toolbar.root", "toolbar.start", "toolbar.end"];
|
|
334
|
+
readonly parts: readonly ["toolbar.root", "toolbar.start", "toolbar.center", "toolbar.end"];
|
|
311
335
|
readonly slots: readonly ["start", "end"];
|
|
312
336
|
};
|
|
313
337
|
readonly stack: {
|
|
@@ -327,19 +351,15 @@ export declare const UI_COMPONENTS: {
|
|
|
327
351
|
readonly slots: readonly ["start", "end"];
|
|
328
352
|
};
|
|
329
353
|
readonly 'scroll-area': {
|
|
330
|
-
readonly parts: readonly ["scroll-area.root", "scroll-area.viewport", "scroll-area.scrollbar"];
|
|
354
|
+
readonly parts: readonly ["scroll-area.root", "scroll-area.viewport", "scroll-area.scrollbar", "scroll-area.thumb"];
|
|
331
355
|
};
|
|
332
356
|
readonly 'drag-scroll': {
|
|
333
357
|
readonly parts: readonly ["drag-scroll.root", "drag-scroll.viewport"];
|
|
334
358
|
};
|
|
335
|
-
readonly visualization: {
|
|
336
|
-
readonly parts: readonly ["visualization.root", "visualization.header", "visualization.title", "visualization.actions", "visualization.body", "visualization.empty", "visualization.error", "visualization.loading"];
|
|
337
|
-
readonly slots: readonly ["header", "title", "actions", "body", "empty", "error", "loading"];
|
|
338
|
-
readonly props: readonly ["state"];
|
|
339
|
-
};
|
|
340
359
|
readonly 'chart-frame': {
|
|
341
|
-
readonly parts: readonly ["chart-frame.root", "chart-frame.header", "chart-frame.title", "chart-frame.actions", "chart-frame.body"];
|
|
342
|
-
readonly slots: readonly ["header", "title", "actions", "body"];
|
|
360
|
+
readonly parts: readonly ["chart-frame.root", "chart-frame.header", "chart-frame.title", "chart-frame.description", "chart-frame.actions", "chart-frame.body", "chart-frame.loading", "chart-frame.empty", "chart-frame.error"];
|
|
361
|
+
readonly slots: readonly ["header", "title", "description", "actions", "body", "empty", "error", "loading"];
|
|
362
|
+
readonly props: readonly ["state"];
|
|
343
363
|
};
|
|
344
364
|
readonly settings: {
|
|
345
365
|
readonly parts: readonly ["settings.root", "settings.header", "settings.title", "settings.body", "settings.nav", "settings.nav-item", "settings.nav-icon", "settings.group", "settings.group-title", "settings.content"];
|
package/lib/types/contract.js
CHANGED
|
@@ -76,11 +76,11 @@ export const UI_COMPONENTS = {
|
|
|
76
76
|
input: {
|
|
77
77
|
parts: ['input.root', 'input.field', 'input.prefix', 'input.suffix', 'input.clear'],
|
|
78
78
|
slots: ['prefix', 'suffix'],
|
|
79
|
-
props: ['size', 'invalid', 'disabled'],
|
|
79
|
+
props: ['size', 'invalid', 'disabled', 'fieldClassName'],
|
|
80
80
|
},
|
|
81
81
|
textarea: {
|
|
82
82
|
parts: ['textarea.root', 'textarea.field'],
|
|
83
|
-
props: ['size', 'invalid', 'disabled'],
|
|
83
|
+
props: ['size', 'invalid', 'disabled', 'fieldClassName'],
|
|
84
84
|
},
|
|
85
85
|
'number-input': {
|
|
86
86
|
parts: ['number-input.root', 'number-input.field', 'number-input.step-up', 'number-input.step-down'],
|
|
@@ -88,31 +88,31 @@ export const UI_COMPONENTS = {
|
|
|
88
88
|
},
|
|
89
89
|
select: {
|
|
90
90
|
parts: ['select.root', 'select.trigger', 'select.value', 'select.chevron', 'select.content', 'select.item', 'select.item-indicator', 'select.empty'],
|
|
91
|
-
slots: ['empty'],
|
|
92
|
-
props: ['size', 'invalid', 'disabled', '
|
|
91
|
+
slots: ['empty', 'children'],
|
|
92
|
+
props: ['size', 'invalid', 'disabled', 'defaultValue', 'side', 'align'],
|
|
93
93
|
},
|
|
94
94
|
'touch-select': {
|
|
95
95
|
parts: ['touch-select.root', 'touch-select.trigger', 'touch-select.sheet', 'touch-select.option'],
|
|
96
96
|
props: ['invalid', 'disabled'],
|
|
97
97
|
},
|
|
98
98
|
checkbox: {
|
|
99
|
-
parts: ['checkbox.root', 'checkbox.
|
|
100
|
-
slots: ['label'],
|
|
101
|
-
props: ['checked', 'invalid', 'disabled'],
|
|
99
|
+
parts: ['checkbox.root', 'checkbox.indicator', 'checkbox.label', 'checkbox.field', 'checkbox.description'],
|
|
100
|
+
slots: ['label', 'description'],
|
|
101
|
+
props: ['checked', 'invalid', 'disabled', 'labelPosition'],
|
|
102
102
|
},
|
|
103
103
|
switch: {
|
|
104
|
-
parts: ['switch.root', 'switch.thumb', 'switch.label'],
|
|
105
|
-
slots: ['label'],
|
|
106
|
-
props: ['checked', 'disabled'],
|
|
104
|
+
parts: ['switch.root', 'switch.thumb', 'switch.label', 'switch.field', 'switch.description'],
|
|
105
|
+
slots: ['label', 'description'],
|
|
106
|
+
props: ['checked', 'disabled', 'labelPosition'],
|
|
107
107
|
},
|
|
108
108
|
'radio-group': {
|
|
109
|
-
parts: ['radio-group.root', 'radio-group.item', 'radio-group.indicator', 'radio-group.label'],
|
|
110
|
-
props: ['value', 'disabled'],
|
|
109
|
+
parts: ['radio-group.root', 'radio-group.item', 'radio-group.indicator', 'radio-group.label', 'radio-group.block', 'radio-group.description'],
|
|
110
|
+
props: ['value', 'disabled', 'label', 'description'],
|
|
111
111
|
},
|
|
112
112
|
tabs: {
|
|
113
113
|
parts: ['tabs.root', 'tabs.list', 'tabs.trigger', 'tabs.content'],
|
|
114
114
|
slots: ['list', 'content'],
|
|
115
|
-
props: ['value'
|
|
115
|
+
props: ['value'],
|
|
116
116
|
},
|
|
117
117
|
table: {
|
|
118
118
|
parts: ['table.root', 'table.header', 'table.body', 'table.row', 'table.head', 'table.cell', 'table.empty'],
|
|
@@ -127,29 +127,29 @@ export const UI_COMPONENTS = {
|
|
|
127
127
|
slots: ['header', 'title', 'body', 'footer'],
|
|
128
128
|
},
|
|
129
129
|
dialog: {
|
|
130
|
-
parts: ['dialog.
|
|
130
|
+
parts: ['dialog.overlay', 'dialog.panel', 'dialog.header', 'dialog.title', 'dialog.description', 'dialog.body', 'dialog.footer', 'dialog.close'],
|
|
131
131
|
slots: ['header', 'title', 'description', 'body', 'footer'],
|
|
132
132
|
props: ['open', 'presentation', 'size'],
|
|
133
133
|
},
|
|
134
134
|
sheet: {
|
|
135
|
-
parts: ['
|
|
135
|
+
parts: ['dialog.overlay', 'dialog.panel', 'dialog.header', 'dialog.title', 'dialog.description', 'dialog.body', 'dialog.footer'],
|
|
136
136
|
slots: ['header', 'body', 'footer'],
|
|
137
137
|
props: ['open', 'presentation'],
|
|
138
138
|
},
|
|
139
139
|
popover: {
|
|
140
|
-
parts: ['popover.
|
|
140
|
+
parts: ['popover.trigger', 'popover.content'],
|
|
141
141
|
slots: ['trigger', 'content'],
|
|
142
142
|
},
|
|
143
143
|
tooltip: {
|
|
144
|
-
parts: ['tooltip.
|
|
144
|
+
parts: ['tooltip.trigger', 'tooltip.content'],
|
|
145
145
|
slots: ['trigger', 'content'],
|
|
146
146
|
},
|
|
147
147
|
menu: {
|
|
148
|
-
parts: ['menu.
|
|
148
|
+
parts: ['menu.trigger', 'menu.content', 'menu.item', 'menu.checkbox-item', 'menu.item-indicator', 'menu.separator'],
|
|
149
149
|
slots: ['trigger', 'content'],
|
|
150
150
|
},
|
|
151
151
|
toast: {
|
|
152
|
-
parts: ['toast.root', 'toast.title', 'toast.description', 'toast.action', 'toast.close'],
|
|
152
|
+
parts: ['toast.root', 'toast.title', 'toast.description', 'toast.action', 'toast.close', 'toast.viewport'],
|
|
153
153
|
slots: ['action'],
|
|
154
154
|
},
|
|
155
155
|
progress: {
|
|
@@ -162,6 +162,28 @@ export const UI_COMPONENTS = {
|
|
|
162
162
|
parts: ['led.root', 'led.halo'],
|
|
163
163
|
props: ['tone'],
|
|
164
164
|
},
|
|
165
|
+
alert: {
|
|
166
|
+
parts: ['alert.root', 'alert.title', 'alert.description'],
|
|
167
|
+
slots: ['title', 'description'],
|
|
168
|
+
props: ['intent'],
|
|
169
|
+
},
|
|
170
|
+
separator: {
|
|
171
|
+
parts: ['separator.root'],
|
|
172
|
+
props: ['orientation'],
|
|
173
|
+
},
|
|
174
|
+
skeleton: {
|
|
175
|
+
parts: ['skeleton.root'],
|
|
176
|
+
props: ['variant'],
|
|
177
|
+
},
|
|
178
|
+
list: {
|
|
179
|
+
parts: ['list.root', 'list.item', 'list.leading', 'list.content', 'list.trailing'],
|
|
180
|
+
slots: ['leading', 'trailing'],
|
|
181
|
+
props: ['divided', 'selected', 'disabled'],
|
|
182
|
+
},
|
|
183
|
+
slider: {
|
|
184
|
+
parts: ['slider.root', 'slider.track', 'slider.range', 'slider.thumb'],
|
|
185
|
+
props: ['value', 'min', 'max', 'step'],
|
|
186
|
+
},
|
|
165
187
|
spinner: {
|
|
166
188
|
parts: ['spinner.root'],
|
|
167
189
|
},
|
|
@@ -172,15 +194,17 @@ export const UI_COMPONENTS = {
|
|
|
172
194
|
form: {
|
|
173
195
|
parts: ['form.root', 'form.fields', 'form.actions'],
|
|
174
196
|
slots: ['fields', 'actions'],
|
|
197
|
+
props: ['orientation', 'gap', 'columns', 'form'],
|
|
175
198
|
},
|
|
176
199
|
field: {
|
|
177
200
|
parts: ['field.root', 'field.label', 'field.control', 'field.help', 'field.error'],
|
|
178
201
|
slots: ['label', 'control', 'help', 'error'],
|
|
179
|
-
props: ['invalid', 'required', '
|
|
202
|
+
props: ['invalid', 'required', 'orientation', 'labelWidth', 'labelAlign'],
|
|
180
203
|
},
|
|
181
204
|
'schema-form': {
|
|
182
205
|
parts: ['schema-form.root', 'schema-form.field'],
|
|
183
206
|
slots: ['fields'],
|
|
207
|
+
props: ['columns'],
|
|
184
208
|
},
|
|
185
209
|
'app-shell': {
|
|
186
210
|
parts: ['app-shell.root', 'app-shell.header', 'app-shell.sidebar', 'app-shell.main', 'app-shell.footer'],
|
|
@@ -195,23 +219,19 @@ export const UI_COMPONENTS = {
|
|
|
195
219
|
slots: ['header', 'title', 'actions', 'body'],
|
|
196
220
|
},
|
|
197
221
|
toolbar: {
|
|
198
|
-
parts: ['toolbar.root', 'toolbar.start', 'toolbar.end'],
|
|
222
|
+
parts: ['toolbar.root', 'toolbar.start', 'toolbar.center', 'toolbar.end'],
|
|
199
223
|
slots: ['start', 'end'],
|
|
200
224
|
},
|
|
201
225
|
stack: { parts: ['stack.root'], props: ['gap', 'padding', 'align'] },
|
|
202
226
|
row: { parts: ['row.root'], props: ['gap', 'padding', 'align', 'justify'] },
|
|
203
227
|
grid: { parts: ['grid.root'], props: ['gap', 'columns', 'padding'] },
|
|
204
228
|
split: { parts: ['split.root', 'split.start', 'split.end'], slots: ['start', 'end'] },
|
|
205
|
-
'scroll-area': { parts: ['scroll-area.root', 'scroll-area.viewport', 'scroll-area.scrollbar'] },
|
|
229
|
+
'scroll-area': { parts: ['scroll-area.root', 'scroll-area.viewport', 'scroll-area.scrollbar', 'scroll-area.thumb'] },
|
|
206
230
|
'drag-scroll': { parts: ['drag-scroll.root', 'drag-scroll.viewport'] },
|
|
207
|
-
visualization: {
|
|
208
|
-
parts: ['visualization.root', 'visualization.header', 'visualization.title', 'visualization.actions', 'visualization.body', 'visualization.empty', 'visualization.error', 'visualization.loading'],
|
|
209
|
-
slots: ['header', 'title', 'actions', 'body', 'empty', 'error', 'loading'],
|
|
210
|
-
props: ['state'],
|
|
211
|
-
},
|
|
212
231
|
'chart-frame': {
|
|
213
|
-
parts: ['chart-frame.root', 'chart-frame.header', 'chart-frame.title', 'chart-frame.actions', 'chart-frame.body'],
|
|
214
|
-
slots: ['header', 'title', 'actions', 'body'],
|
|
232
|
+
parts: ['chart-frame.root', 'chart-frame.header', 'chart-frame.title', 'chart-frame.description', 'chart-frame.actions', 'chart-frame.body', 'chart-frame.loading', 'chart-frame.empty', 'chart-frame.error'],
|
|
233
|
+
slots: ['header', 'title', 'description', 'actions', 'body', 'empty', 'error', 'loading'],
|
|
234
|
+
props: ['state'],
|
|
215
235
|
},
|
|
216
236
|
settings: {
|
|
217
237
|
parts: [
|
package/lib/types/runtime.js
CHANGED
|
@@ -17,6 +17,7 @@ import { shellContract } from '@snap-rail/shell/contract';
|
|
|
17
17
|
import { createContext, useContext, useEffect, useRef, useSyncExternalStore } from 'react';
|
|
18
18
|
import { createRoot } from 'react-dom/client';
|
|
19
19
|
import fallbackPlugin from "./fallback.js";
|
|
20
|
+
import { Toaster, TooltipProvider } from "./components/overlay.js";
|
|
20
21
|
import pagesPlugin from "./pages.js";
|
|
21
22
|
import settingsPlugin from "./settings.js";
|
|
22
23
|
import { UI_SLOT_IDS } from "./contract.js";
|
|
@@ -101,7 +102,7 @@ function SettingsFallbackHost(props) {
|
|
|
101
102
|
/** The operator-window root. */
|
|
102
103
|
function MainRoot(props) {
|
|
103
104
|
const layout = useActiveLayout();
|
|
104
|
-
return (
|
|
105
|
+
return (_jsx(_Fragment, { children: _jsxs(TooltipProvider, { children: [_jsx(StageProfiles, { ctx: props.ctx, layout: layout }), layout === undefined ? _jsx("div", { style: { padding: 24 }, children: "\u6CA1\u6709\u5DF2\u52A0\u8F7D\u7684\u5E03\u5C40\u63D2\u4EF6\u3002" }) : layout.render(), _jsx(OverlayHost, { ctx: props.ctx }), _jsx(SettingsFallbackHost, { ctx: props.ctx }), _jsx(Toaster, {})] }) }));
|
|
105
106
|
}
|
|
106
107
|
/**
|
|
107
108
|
* The fallback ball face used when no plugin occupies `shell.ball`: a themed
|
|
@@ -130,7 +131,7 @@ function BallRoot(props) {
|
|
|
130
131
|
});
|
|
131
132
|
}, [hasOccupant, link]);
|
|
132
133
|
if (occupant !== undefined) {
|
|
133
|
-
return _jsx("div", { style: { width: '100%', height: '100%' }, children: occupant.render({ surface: 'ball' }) });
|
|
134
|
+
return (_jsxs(TooltipProvider, { children: [_jsx("div", { style: { width: '100%', height: '100%' }, children: occupant.render({ surface: 'ball' }) }), _jsx(Toaster, {})] }));
|
|
134
135
|
}
|
|
135
136
|
return (_jsx("div", { ref: rootRef, "data-snap-part": "ball.root", style: {
|
|
136
137
|
display: 'flex',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { rpcErrorText } from '@snap-rail/connection';
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
|
-
import { Button, Page, Row, Section, Stack, Switch, Tabs, TabsList, TabsTrigger } from "../components/index.js";
|
|
4
|
+
import { Alert, Button, Page, Row, Section, Stack, Switch, Tabs, TabsList, TabsTrigger } from "../components/index.js";
|
|
5
5
|
import { useSkinId, useSkins } from "../skins.js";
|
|
6
6
|
import { useClient } from "../runtime.js";
|
|
7
7
|
const THEME_KEY = 'ui.theme';
|
|
@@ -118,7 +118,7 @@ export function AppearancePage() {
|
|
|
118
118
|
.catch(cause => { setError(cause instanceof Error ? cause.message : String(cause)); })
|
|
119
119
|
.finally(() => { setBusy(false); });
|
|
120
120
|
};
|
|
121
|
-
return (_jsx(Page, { title: "\u5916\u89C2\u4E0E\u663E\u793A", description: "\u4E3B\u9898\u3001\u4E3B\u7A97\u53E3\u5C3A\u5BF8\u548C\u60AC\u6D6E\u7403\u5916\u89C2\u3002", children: _jsxs(Stack, { gap: "lg", children: [error !== undefined && _jsx(
|
|
121
|
+
return (_jsx(Page, { title: "\u5916\u89C2\u4E0E\u663E\u793A", description: "\u4E3B\u9898\u3001\u4E3B\u7A97\u53E3\u5C3A\u5BF8\u548C\u60AC\u6D6E\u7403\u5916\u89C2\u3002", children: _jsxs(Stack, { gap: "lg", children: [error !== undefined && _jsx(Alert, { intent: "danger", children: error }), _jsx(Section, { title: "\u4E3B\u9898", children: _jsx(Tabs, { value: activeId, onValueChange: value => {
|
|
122
122
|
const tab = tabs.find(item => item.id === value);
|
|
123
123
|
if (tab !== undefined)
|
|
124
124
|
selectTheme(tab);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { rpcErrorText } from '@snap-rail/connection';
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
|
-
import { Badge, Button, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, EmptyState, IconButton, Input, Page, Stack, Switch, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../components/index.js";
|
|
4
|
+
import { Alert, Badge, Button, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, EmptyState, IconButton, Input, Page, Stack, Switch, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../components/index.js";
|
|
5
5
|
/** The preload's zip→path bridge (`webUtils.getPathForFile`); null outside
|
|
6
6
|
* Electron or in tests. Inlined rather than imported from the app-internal
|
|
7
7
|
* kernel package: it never ships in the installer, and the packaged-app gate
|
|
@@ -294,7 +294,7 @@ export function PluginsPage({ ctx }) {
|
|
|
294
294
|
spans.set(index, end - index);
|
|
295
295
|
index = end;
|
|
296
296
|
}
|
|
297
|
-
return (_jsxs(Page, { title: "\u63D2\u4EF6\u7BA1\u7406", titleExtra: _jsx(IconButton, { icon: _jsx(PlusIcon, {}), label: "\u5B89\u88C5\u63D2\u4EF6", onClick: openInstall }), actions: restartNeeded ? _jsx(Button, { intent: "primary", onClick: restart, children: "\u91CD\u542F\u751F\u6548" }) : undefined, children: [_jsxs(Stack, { gap: "lg", children: [error !== undefined && _jsx(
|
|
297
|
+
return (_jsxs(Page, { title: "\u63D2\u4EF6\u7BA1\u7406", titleExtra: _jsx(IconButton, { icon: _jsx(PlusIcon, {}), label: "\u5B89\u88C5\u63D2\u4EF6", onClick: openInstall }), actions: restartNeeded ? _jsx(Button, { intent: "primary", onClick: restart, children: "\u91CD\u542F\u751F\u6548" }) : undefined, children: [_jsxs(Stack, { gap: "lg", children: [error !== undefined && _jsx(Alert, { intent: "danger", children: error }), rows.length === 0
|
|
298
298
|
? (_jsx(EmptyState, { title: "\u8FD8\u6CA1\u6709\u5B89\u88C5\u63D2\u4EF6", action: _jsx(Button, { intent: "primary", onClick: openInstall, children: "\u5B89\u88C5\u63D2\u4EF6" }) }))
|
|
299
299
|
: (_jsxs(Table, { "data-plugins-table": true, children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { style: { width: '6em' }, children: "\u5206\u7C7B" }), _jsx(TableHead, { children: "\u540D\u79F0" }), _jsx(TableHead, { children: "\u7C7B\u578B" }), _jsx(TableHead, { children: "\u7248\u672C" }), _jsx(TableHead, { children: "\u72B6\u6001" }), _jsx(TableHead, { children: "\u64CD\u4F5C" })] }) }), _jsx(TableBody, { children: rows.map((row, index) => {
|
|
300
300
|
const update = updates.get(row.packageName);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snap-rail/ui",
|
|
3
3
|
"description": "The built-in UI substrate: semantic components, typed region slots, skins, settings and renderer runtime",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -62,16 +62,23 @@
|
|
|
62
62
|
],
|
|
63
63
|
"license": "Apache-2.0",
|
|
64
64
|
"dependencies": {
|
|
65
|
+
"@hookform/resolvers": "^7.0.2",
|
|
65
66
|
"@radix-ui/react-checkbox": "^1.1.3",
|
|
66
67
|
"@radix-ui/react-dialog": "^1.1.6",
|
|
68
|
+
"@radix-ui/react-dropdown-menu": "^2.2.1",
|
|
67
69
|
"@radix-ui/react-label": "^2.1.2",
|
|
70
|
+
"@radix-ui/react-popover": "^1.3.1",
|
|
68
71
|
"@radix-ui/react-radio-group": "^1.2.3",
|
|
69
72
|
"@radix-ui/react-scroll-area": "^1.2.18",
|
|
70
73
|
"@radix-ui/react-select": "^2.2.6",
|
|
74
|
+
"@radix-ui/react-separator": "^1.2.0",
|
|
75
|
+
"@radix-ui/react-slider": "^1.6.1",
|
|
71
76
|
"@radix-ui/react-slot": "^1.3.3",
|
|
72
77
|
"@radix-ui/react-switch": "^1.3.7",
|
|
73
78
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
74
|
-
"@radix-ui/react-
|
|
79
|
+
"@radix-ui/react-toast": "^1.3.1",
|
|
80
|
+
"@radix-ui/react-tooltip": "^1.2.16",
|
|
81
|
+
"react-hook-form": "^7.91.0"
|
|
75
82
|
},
|
|
76
83
|
"peerDependencies": {
|
|
77
84
|
"react": ">=19",
|
|
@@ -92,14 +99,14 @@
|
|
|
92
99
|
"typescript": "^6.0.3",
|
|
93
100
|
"vitest": "^4.1.8",
|
|
94
101
|
"zod": "^4.4.3",
|
|
95
|
-
"@snap-rail/app-boot": "^0.1.3",
|
|
96
102
|
"@snap-rail/connection": "^0.1.0",
|
|
97
|
-
"@snap-rail/client-kernel": "^0.1.2",
|
|
98
103
|
"@snap-rail/cordis": "^4.0.3",
|
|
104
|
+
"@snap-rail/app-boot": "^0.1.3",
|
|
99
105
|
"@snap-rail/cordis-plugin-timer": "^1.1.3",
|
|
106
|
+
"@snap-rail/client-kernel": "^0.1.2",
|
|
100
107
|
"@snap-rail/protocol": "^0.1.3",
|
|
101
|
-
"@snap-rail/
|
|
102
|
-
"@snap-rail/
|
|
108
|
+
"@snap-rail/station-rpc": "^0.1.0",
|
|
109
|
+
"@snap-rail/shell": "^0.2.3"
|
|
103
110
|
},
|
|
104
111
|
"snapRail": {
|
|
105
112
|
"layer": "base",
|