@keemakr/ui-sdk 1.6.0-dev-20261029101536 → 1.6.0-dev-20261029102802
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/dist/conform.js +11 -0
- package/dist/schema.d.ts +15 -1
- package/dist/schema.js +11 -2
- package/package.json +1 -1
package/dist/conform.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// - `tone: 'info' | 'accent'` (badge cells, tags, board columns, calendar entries, progress
|
|
11
11
|
// bars; after 1.4.0) -> 'default', or the first tone that parse lists
|
|
12
12
|
// - a string `min`/`max` on a date or datetime field (after 1.4.0) -> dropped
|
|
13
|
+
// - a button's `variant: 'ghost'` (after 1.4.0) -> 'secondary', the same button with a border
|
|
13
14
|
// - an image's or video's portrait `aspect: '3:4' | '9:16'` (after 1.4.0)
|
|
14
15
|
// -> 'auto', so the picture keeps its own shape
|
|
15
16
|
// - a chart with more points than the parse takes (120 after 1.4.0, 50 before)
|
|
@@ -213,6 +214,16 @@ export function conformTree(tree, parser, options) {
|
|
|
213
214
|
fallbacks.push({ path: pathText(path), type: 'chartType', reason: 'parse', as: 'folded' });
|
|
214
215
|
return true;
|
|
215
216
|
}
|
|
217
|
+
if (key === 'variant' &&
|
|
218
|
+
issue.code === 'invalid_value' &&
|
|
219
|
+
isObject(holder) &&
|
|
220
|
+
holder.variant === 'ghost' &&
|
|
221
|
+
(issue.values ?? []).includes('secondary')) {
|
|
222
|
+
// A ghost button is a lighter secondary: the press and the label are the same.
|
|
223
|
+
holder.variant = 'secondary';
|
|
224
|
+
fallbacks.push({ path: pathText(path), type: 'variant', reason: 'parse', as: 'folded' });
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
216
227
|
if (key === 'aspect' &&
|
|
217
228
|
issue.code === 'invalid_value' &&
|
|
218
229
|
isObject(holder) &&
|
package/dist/schema.d.ts
CHANGED
|
@@ -27,7 +27,11 @@ export declare const NAVIGATE_OPENS: readonly ["drawer"];
|
|
|
27
27
|
* - a press in it with `open: 'drawer'`, and an action result's `navigate`, show that screen in
|
|
28
28
|
* the same drawer (a drawer never opens another drawer);
|
|
29
29
|
* - a press in it without `open` leaves the drawer and opens the screen as a page;
|
|
30
|
-
* -
|
|
30
|
+
* - an action run in it that succeeds closes it ("Approve", "Done": the item is dealt with),
|
|
31
|
+
* unless its result returns a `tree` (the drawer is drawn again as it now is) or a `navigate`
|
|
32
|
+
* (the drawer moves on). A failed action keeps it open, with the failure said;
|
|
33
|
+
* - `refresh` refreshes the drawer, not the screen underneath, for an action that keeps it open
|
|
34
|
+
* (a finished job's result follows the same rule);
|
|
31
35
|
* - closing it reads the screen underneath again when an action ran in it, so "Mark done" in
|
|
32
36
|
* the drawer shows on the list.
|
|
33
37
|
* The drawer is not in the address: a reload shows the screen underneath, and a link opens a
|
|
@@ -195,6 +199,7 @@ export declare const buttonSchema: z.ZodObject<{
|
|
|
195
199
|
destructive: "destructive";
|
|
196
200
|
secondary: "secondary";
|
|
197
201
|
primary: "primary";
|
|
202
|
+
ghost: "ghost";
|
|
198
203
|
}>>;
|
|
199
204
|
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
200
205
|
hint: z.ZodOptional<z.ZodString>;
|
|
@@ -551,6 +556,7 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
551
556
|
destructive: "destructive";
|
|
552
557
|
secondary: "secondary";
|
|
553
558
|
primary: "primary";
|
|
559
|
+
ghost: "ghost";
|
|
554
560
|
}>>;
|
|
555
561
|
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
556
562
|
hint: z.ZodOptional<z.ZodString>;
|
|
@@ -956,6 +962,7 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
956
962
|
destructive: "destructive";
|
|
957
963
|
secondary: "secondary";
|
|
958
964
|
primary: "primary";
|
|
965
|
+
ghost: "ghost";
|
|
959
966
|
}>>;
|
|
960
967
|
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
961
968
|
hint: z.ZodOptional<z.ZodString>;
|
|
@@ -1023,6 +1030,7 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1023
1030
|
destructive: "destructive";
|
|
1024
1031
|
secondary: "secondary";
|
|
1025
1032
|
primary: "primary";
|
|
1033
|
+
ghost: "ghost";
|
|
1026
1034
|
}>>;
|
|
1027
1035
|
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
1028
1036
|
hint: z.ZodOptional<z.ZodString>;
|
|
@@ -1343,6 +1351,7 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1343
1351
|
destructive: "destructive";
|
|
1344
1352
|
secondary: "secondary";
|
|
1345
1353
|
primary: "primary";
|
|
1354
|
+
ghost: "ghost";
|
|
1346
1355
|
}>>;
|
|
1347
1356
|
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
1348
1357
|
hint: z.ZodOptional<z.ZodString>;
|
|
@@ -1872,6 +1881,7 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1872
1881
|
destructive: "destructive";
|
|
1873
1882
|
secondary: "secondary";
|
|
1874
1883
|
primary: "primary";
|
|
1884
|
+
ghost: "ghost";
|
|
1875
1885
|
}>>;
|
|
1876
1886
|
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
1877
1887
|
hint: z.ZodOptional<z.ZodString>;
|
|
@@ -2301,6 +2311,7 @@ export declare const screenTreeSchema: z.ZodObject<{
|
|
|
2301
2311
|
destructive: "destructive";
|
|
2302
2312
|
secondary: "secondary";
|
|
2303
2313
|
primary: "primary";
|
|
2314
|
+
ghost: "ghost";
|
|
2304
2315
|
}>>;
|
|
2305
2316
|
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
2306
2317
|
hint: z.ZodOptional<z.ZodString>;
|
|
@@ -2546,6 +2557,7 @@ export declare const actionResultSchema: z.ZodObject<{
|
|
|
2546
2557
|
destructive: "destructive";
|
|
2547
2558
|
secondary: "secondary";
|
|
2548
2559
|
primary: "primary";
|
|
2560
|
+
ghost: "ghost";
|
|
2549
2561
|
}>>;
|
|
2550
2562
|
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
2551
2563
|
hint: z.ZodOptional<z.ZodString>;
|
|
@@ -2784,6 +2796,7 @@ export declare const jobStatusSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2784
2796
|
destructive: "destructive";
|
|
2785
2797
|
secondary: "secondary";
|
|
2786
2798
|
primary: "primary";
|
|
2799
|
+
ghost: "ghost";
|
|
2787
2800
|
}>>;
|
|
2788
2801
|
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
2789
2802
|
hint: z.ZodOptional<z.ZodString>;
|
|
@@ -3012,6 +3025,7 @@ export declare const screenLoadResponseSchema: z.ZodObject<{
|
|
|
3012
3025
|
destructive: "destructive";
|
|
3013
3026
|
secondary: "secondary";
|
|
3014
3027
|
primary: "primary";
|
|
3028
|
+
ghost: "ghost";
|
|
3015
3029
|
}>>;
|
|
3016
3030
|
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
3017
3031
|
hint: z.ZodOptional<z.ZodString>;
|
package/dist/schema.js
CHANGED
|
@@ -55,7 +55,11 @@ export const NAVIGATE_OPENS = ['drawer'];
|
|
|
55
55
|
* - a press in it with `open: 'drawer'`, and an action result's `navigate`, show that screen in
|
|
56
56
|
* the same drawer (a drawer never opens another drawer);
|
|
57
57
|
* - a press in it without `open` leaves the drawer and opens the screen as a page;
|
|
58
|
-
* -
|
|
58
|
+
* - an action run in it that succeeds closes it ("Approve", "Done": the item is dealt with),
|
|
59
|
+
* unless its result returns a `tree` (the drawer is drawn again as it now is) or a `navigate`
|
|
60
|
+
* (the drawer moves on). A failed action keeps it open, with the failure said;
|
|
61
|
+
* - `refresh` refreshes the drawer, not the screen underneath, for an action that keeps it open
|
|
62
|
+
* (a finished job's result follows the same rule);
|
|
59
63
|
* - closing it reads the screen underneath again when an action ran in it, so "Mark done" in
|
|
60
64
|
* the drawer shows on the list.
|
|
61
65
|
* The drawer is not in the address: a reload shows the screen underneath, and a link opens a
|
|
@@ -232,7 +236,12 @@ const buttonShape = z.object({
|
|
|
232
236
|
/** What the button does. Also the accessible name and the tooltip of an icon-only button. */
|
|
233
237
|
label: z.string().max(80),
|
|
234
238
|
onPress: pressSchema,
|
|
235
|
-
|
|
239
|
+
/**
|
|
240
|
+
* How much weight the button carries. `ghost` is lighter than `secondary`: no border, quiet
|
|
241
|
+
* text, for a way out beside the real actions (Ask Operator, Open account at the end of a
|
|
242
|
+
* drawer's row). An app whose parse predates `ghost` draws it as `secondary`.
|
|
243
|
+
*/
|
|
244
|
+
variant: z.enum(['primary', 'secondary', 'destructive', 'ghost']).default('secondary'),
|
|
236
245
|
/** Shown but not pressable — a Next button on the last page, an action not yet available. */
|
|
237
246
|
disabled: z.boolean().default(false),
|
|
238
247
|
/** A short explanation shown next to the button on hover or keyboard focus. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keemakr/ui-sdk",
|
|
3
|
-
"version": "1.6.0-dev-
|
|
3
|
+
"version": "1.6.0-dev-20261029102802",
|
|
4
4
|
"description": "Product screens for keemakr marketplace modules: a versioned, server-driven UI tree schema plus defineScreen() handlers. Module code never ships to the browser — keemakr-core validates the tree and renders it with platform components.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|