tsquare 0.3.2 → 0.4.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.1
4
+
5
+ ```tsquare
6
+ image map height=200 "Pickup" # a map placeholder: roads and a pin, instead of the X
7
+ accordion "How long does shipping take?" open
8
+ text "Orders arrive in 3–5 business days."
9
+ accordion "Can I return an item?" # closed: only the title row
10
+ toast "Message sent" action="Undo" icon=check # pinned to the bottom (above a tab bar), or position=top
11
+ ```
12
+
13
+ - **Toast** is an overlay like Modal and Drawer: a direct child of a Screen, listed last.
14
+ - **Measured:** three new requests (a ride map, an FAQ, a "saved" message), two runs per model. All 12 outputs were valid and used the new pieces, except one Haiku run that drew a plain image labeled "Map". The prompt grew by about 195 tokens.
15
+ - **Breadcrumbs** don't need a component: `text "Home / Settings / Profile" sm muted`. The Text docs page now shows this.
16
+
17
+ ## 0.4.0
18
+
19
+ ### New components
20
+
21
+ ```tsquare
22
+ chart line "Revenue" # line | bar | area | pie | donut, a placeholder shape
23
+ calendar "October 2026" range=[12, 18] marked=[3, 9]
24
+ input "Check-in" type=date value="Oct 14, 2026" # calendar icon
25
+ input "Verification code" type=code value="4821" # one box per digit (digits=6)
26
+ slider "Price" range=[50, 400] # any amounts; the track scales
27
+ progress "Uploading" value=40 # also: progress circle, progress steps=4 step=2
28
+ pagination pages=12 current=3
29
+ bullets items=[Fast setup, No credit card] # also: numbered, icon=check
30
+ bullets icon=check items=[Boards, {label="SSO" icon=x muted}]
31
+ ```
32
+
33
+ - **Charts are placeholders:** they show the kind of chart, not data.
34
+ - **The calendar draws the real month** from its title ("October 2026" starts on a Thursday).
35
+ - **Bullets** take any Lucide icon. One item can be an object that changes its icon or greys it out (`muted`).
36
+ - **Inside `{…}`:**
37
+ - a bare word turns an option on (`{label="SSO" muted}`);
38
+ - an unquoted value can contain spaces (`{label=Custom domain icon=x}`).
39
+ - **Clear errors for values that contradict each other:** a step past the last step, a page past the last page, a day that isn't in the month, a range written backwards.
40
+ - **The accent color** also fills sliders, progress, completed steps, and the selected day and page. Charts stay gray.
41
+ - **The prompt** grew by about 480 tokens (2,670 → 3,150).
42
+
43
+ ### Measured
44
+
45
+ - **The new components:** 7 requests that describe a screen without naming components, two runs each.
46
+ - Sonnet: valid 14 of 14, and picked the right components every time (32 of 32 checks).
47
+ - Haiku: valid 12 of 14, 30 of 32 checks.
48
+ - **The original 20 requests, with the new prompt:** Sonnet 100%, Haiku 65%, within its usual range. None of Haiku's failures involve the new components.
49
+
3
50
  ## 0.3.2
4
51
 
5
52
  - **`grow` on Select**, like Input: `select "State" grow` fills the rest of a row. Sonnet wrote it in 5 of 9 eval runs, its only remaining mistake; with it, every stored Sonnet text output is valid.
package/dist/catalog.d.ts CHANGED
@@ -134,6 +134,18 @@ export declare const componentDefinitions: {
134
134
  variant: string;
135
135
  };
136
136
  };
137
+ Accordion: {
138
+ props: z.ZodObject<{
139
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
140
+ open: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
141
+ }, z.core.$strip>;
142
+ slots: string[];
143
+ description: string;
144
+ example: {
145
+ title: string;
146
+ open: boolean;
147
+ };
148
+ };
137
149
  Divider: {
138
150
  props: z.ZodObject<{
139
151
  vertical: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -192,12 +204,32 @@ export declare const componentDefinitions: {
192
204
  lines: number;
193
205
  };
194
206
  };
207
+ Bullets: {
208
+ props: z.ZodObject<{
209
+ items: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
210
+ label: z.ZodString;
211
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
212
+ muted: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
213
+ }, z.core.$strict>]>>;
214
+ numbered: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
215
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
216
+ }, z.core.$strip>;
217
+ slots: never[];
218
+ description: string;
219
+ example: {
220
+ items: string[];
221
+ };
222
+ };
195
223
  Image: {
196
224
  props: z.ZodObject<{
197
225
  height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
198
226
  width: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
199
227
  label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
200
228
  rounded: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
229
+ kind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
230
+ map: "map";
231
+ photo: "photo";
232
+ }>>>;
201
233
  }, z.core.$strip>;
202
234
  slots: never[];
203
235
  description: string;
@@ -206,6 +238,26 @@ export declare const componentDefinitions: {
206
238
  label: string;
207
239
  };
208
240
  };
241
+ Chart: {
242
+ props: z.ZodObject<{
243
+ kind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
244
+ area: "area";
245
+ bar: "bar";
246
+ donut: "donut";
247
+ line: "line";
248
+ pie: "pie";
249
+ }>>>;
250
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
251
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
252
+ width: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
253
+ }, z.core.$strip>;
254
+ slots: never[];
255
+ description: string;
256
+ example: {
257
+ kind: string;
258
+ title: string;
259
+ };
260
+ };
209
261
  Icon: {
210
262
  props: z.ZodObject<{
211
263
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -282,11 +334,14 @@ export declare const componentDefinitions: {
282
334
  placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
283
335
  value: z.ZodOptional<z.ZodNullable<z.ZodString>>;
284
336
  type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
337
+ code: "code";
338
+ date: "date";
285
339
  email: "email";
286
340
  password: "password";
287
341
  search: "search";
288
342
  text: "text";
289
343
  }>>>;
344
+ digits: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
290
345
  multiline: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
291
346
  helper: z.ZodOptional<z.ZodNullable<z.ZodString>>;
292
347
  error: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -351,6 +406,51 @@ export declare const componentDefinitions: {
351
406
  value: string;
352
407
  };
353
408
  };
409
+ Slider: {
410
+ props: z.ZodObject<{
411
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
412
+ value: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
413
+ range: z.ZodOptional<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
414
+ }, z.core.$strip>;
415
+ slots: never[];
416
+ description: string;
417
+ example: {
418
+ label: string;
419
+ value: number;
420
+ };
421
+ };
422
+ Progress: {
423
+ props: z.ZodObject<{
424
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
425
+ value: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
426
+ shape: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
427
+ bar: "bar";
428
+ circle: "circle";
429
+ }>>>;
430
+ steps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
431
+ step: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
432
+ }, z.core.$strip>;
433
+ slots: never[];
434
+ description: string;
435
+ example: {
436
+ label: string;
437
+ value: number;
438
+ };
439
+ };
440
+ Calendar: {
441
+ props: z.ZodObject<{
442
+ month: z.ZodOptional<z.ZodNullable<z.ZodString>>;
443
+ selected: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
444
+ range: z.ZodOptional<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
445
+ marked: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
446
+ }, z.core.$strip>;
447
+ slots: never[];
448
+ description: string;
449
+ example: {
450
+ month: string;
451
+ selected: number;
452
+ };
453
+ };
354
454
  NavBar: {
355
455
  props: z.ZodObject<{
356
456
  title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -405,6 +505,18 @@ export declare const componentDefinitions: {
405
505
  active: number;
406
506
  };
407
507
  };
508
+ Pagination: {
509
+ props: z.ZodObject<{
510
+ pages: z.ZodNumber;
511
+ current: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
512
+ }, z.core.$strip>;
513
+ slots: never[];
514
+ description: string;
515
+ example: {
516
+ pages: number;
517
+ current: number;
518
+ };
519
+ };
408
520
  List: {
409
521
  props: z.ZodObject<{
410
522
  dividers: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -494,6 +606,23 @@ export declare const componentDefinitions: {
494
606
  size: number;
495
607
  };
496
608
  };
609
+ Toast: {
610
+ props: z.ZodObject<{
611
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
612
+ action: z.ZodOptional<z.ZodNullable<z.ZodString>>;
613
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
614
+ position: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
615
+ bottom: "bottom";
616
+ top: "top";
617
+ }>>>;
618
+ }, z.core.$strip>;
619
+ slots: never[];
620
+ description: string;
621
+ example: {
622
+ text: string;
623
+ action: string;
624
+ };
625
+ };
497
626
  };
498
627
  export declare const catalog: import("@json-render/core").Catalog<{
499
628
  spec: import("@json-render/core").SchemaType<"object", {
@@ -658,6 +787,18 @@ export declare const catalog: import("@json-render/core").Catalog<{
658
787
  variant: string;
659
788
  };
660
789
  };
790
+ Accordion: {
791
+ props: z.ZodObject<{
792
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
793
+ open: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
794
+ }, z.core.$strip>;
795
+ slots: string[];
796
+ description: string;
797
+ example: {
798
+ title: string;
799
+ open: boolean;
800
+ };
801
+ };
661
802
  Divider: {
662
803
  props: z.ZodObject<{
663
804
  vertical: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -716,12 +857,32 @@ export declare const catalog: import("@json-render/core").Catalog<{
716
857
  lines: number;
717
858
  };
718
859
  };
860
+ Bullets: {
861
+ props: z.ZodObject<{
862
+ items: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
863
+ label: z.ZodString;
864
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
865
+ muted: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
866
+ }, z.core.$strict>]>>;
867
+ numbered: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
868
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
869
+ }, z.core.$strip>;
870
+ slots: never[];
871
+ description: string;
872
+ example: {
873
+ items: string[];
874
+ };
875
+ };
719
876
  Image: {
720
877
  props: z.ZodObject<{
721
878
  height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
722
879
  width: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
723
880
  label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
724
881
  rounded: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
882
+ kind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
883
+ map: "map";
884
+ photo: "photo";
885
+ }>>>;
725
886
  }, z.core.$strip>;
726
887
  slots: never[];
727
888
  description: string;
@@ -730,6 +891,26 @@ export declare const catalog: import("@json-render/core").Catalog<{
730
891
  label: string;
731
892
  };
732
893
  };
894
+ Chart: {
895
+ props: z.ZodObject<{
896
+ kind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
897
+ area: "area";
898
+ bar: "bar";
899
+ donut: "donut";
900
+ line: "line";
901
+ pie: "pie";
902
+ }>>>;
903
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
904
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
905
+ width: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
906
+ }, z.core.$strip>;
907
+ slots: never[];
908
+ description: string;
909
+ example: {
910
+ kind: string;
911
+ title: string;
912
+ };
913
+ };
733
914
  Icon: {
734
915
  props: z.ZodObject<{
735
916
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -806,11 +987,14 @@ export declare const catalog: import("@json-render/core").Catalog<{
806
987
  placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
807
988
  value: z.ZodOptional<z.ZodNullable<z.ZodString>>;
808
989
  type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
990
+ code: "code";
991
+ date: "date";
809
992
  email: "email";
810
993
  password: "password";
811
994
  search: "search";
812
995
  text: "text";
813
996
  }>>>;
997
+ digits: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
814
998
  multiline: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
815
999
  helper: z.ZodOptional<z.ZodNullable<z.ZodString>>;
816
1000
  error: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -875,6 +1059,51 @@ export declare const catalog: import("@json-render/core").Catalog<{
875
1059
  value: string;
876
1060
  };
877
1061
  };
1062
+ Slider: {
1063
+ props: z.ZodObject<{
1064
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1065
+ value: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1066
+ range: z.ZodOptional<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
1067
+ }, z.core.$strip>;
1068
+ slots: never[];
1069
+ description: string;
1070
+ example: {
1071
+ label: string;
1072
+ value: number;
1073
+ };
1074
+ };
1075
+ Progress: {
1076
+ props: z.ZodObject<{
1077
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1078
+ value: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1079
+ shape: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1080
+ bar: "bar";
1081
+ circle: "circle";
1082
+ }>>>;
1083
+ steps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1084
+ step: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1085
+ }, z.core.$strip>;
1086
+ slots: never[];
1087
+ description: string;
1088
+ example: {
1089
+ label: string;
1090
+ value: number;
1091
+ };
1092
+ };
1093
+ Calendar: {
1094
+ props: z.ZodObject<{
1095
+ month: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1096
+ selected: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1097
+ range: z.ZodOptional<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
1098
+ marked: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
1099
+ }, z.core.$strip>;
1100
+ slots: never[];
1101
+ description: string;
1102
+ example: {
1103
+ month: string;
1104
+ selected: number;
1105
+ };
1106
+ };
878
1107
  NavBar: {
879
1108
  props: z.ZodObject<{
880
1109
  title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -929,6 +1158,18 @@ export declare const catalog: import("@json-render/core").Catalog<{
929
1158
  active: number;
930
1159
  };
931
1160
  };
1161
+ Pagination: {
1162
+ props: z.ZodObject<{
1163
+ pages: z.ZodNumber;
1164
+ current: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1165
+ }, z.core.$strip>;
1166
+ slots: never[];
1167
+ description: string;
1168
+ example: {
1169
+ pages: number;
1170
+ current: number;
1171
+ };
1172
+ };
932
1173
  List: {
933
1174
  props: z.ZodObject<{
934
1175
  dividers: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -1018,6 +1259,23 @@ export declare const catalog: import("@json-render/core").Catalog<{
1018
1259
  size: number;
1019
1260
  };
1020
1261
  };
1262
+ Toast: {
1263
+ props: z.ZodObject<{
1264
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1265
+ action: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1266
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1267
+ position: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1268
+ bottom: "bottom";
1269
+ top: "top";
1270
+ }>>>;
1271
+ }, z.core.$strip>;
1272
+ slots: never[];
1273
+ description: string;
1274
+ example: {
1275
+ text: string;
1276
+ action: string;
1277
+ };
1278
+ };
1021
1279
  };
1022
1280
  }>;
1023
1281
  export type ComponentName = keyof typeof componentDefinitions;