@pinfold/react 0.0.0-stage → 0.1.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 (41) hide show
  1. package/README.md +58 -2
  2. package/accordion/lazy/package.json +6 -0
  3. package/accordion/package.json +6 -0
  4. package/dist/accordion/client.cjs +474 -0
  5. package/dist/accordion/client.d.cts +31 -0
  6. package/dist/accordion/client.d.ts +31 -0
  7. package/dist/accordion/client.js +473 -0
  8. package/dist/accordion/index.cjs +48 -0
  9. package/dist/accordion/index.d.cts +52 -0
  10. package/dist/accordion/index.d.ts +52 -0
  11. package/dist/accordion/index.js +13 -0
  12. package/dist/accordion/lazy.cjs +17 -0
  13. package/dist/accordion/lazy.d.cts +15 -0
  14. package/dist/accordion/lazy.d.ts +15 -0
  15. package/dist/accordion/lazy.js +16 -0
  16. package/dist/chunk-5ZMK623A.js +61 -0
  17. package/dist/chunk-BPPCPHHU.js +70 -0
  18. package/dist/chunk-DQWSDHRY.cjs +71 -0
  19. package/dist/chunk-Q232PTPW.js +115 -0
  20. package/dist/chunk-RJPT3NTP.cjs +62 -0
  21. package/dist/chunk-VPKVOJHA.cjs +116 -0
  22. package/dist/client.cjs +30 -0
  23. package/dist/client.d.cts +121 -0
  24. package/dist/client.d.ts +121 -0
  25. package/dist/client.js +29 -0
  26. package/dist/index.cjs +52 -0
  27. package/dist/index.d.cts +123 -0
  28. package/dist/index.d.ts +123 -0
  29. package/dist/index.js +10 -0
  30. package/dist/types-BZqk8btE.d.cts +278 -0
  31. package/dist/types-BZqk8btE.d.ts +278 -0
  32. package/dist/types-x01Q5sqz.d.cts +278 -0
  33. package/dist/types-x01Q5sqz.d.ts +278 -0
  34. package/dist/validate-D3GJ2276.js +37 -0
  35. package/dist/validate-ELH6OKK3.cjs +38 -0
  36. package/llms-full.txt +133 -0
  37. package/llms.txt +26 -0
  38. package/package.json +92 -4
  39. package/registry/accordion.json +20 -0
  40. package/registry/registry.json +25 -0
  41. package/schema/accordion.json +800 -0
@@ -0,0 +1,800 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://pinfold.indranildev.in/schema/accordion.json",
4
+ "title": "AccordionConfig",
5
+ "description": "A vertically stacked set of headings that each reveal a section of content. Config in, accessible accordion out.",
6
+ "type": "object",
7
+ "properties": {
8
+ "items": {
9
+ "description": "The rows. The only required option.",
10
+ "type": "array",
11
+ "items": {
12
+ "type": "object",
13
+ "properties": {
14
+ "id": {
15
+ "description": "Stable key. Falls back to the array index.",
16
+ "type": "string"
17
+ },
18
+ "title": {
19
+ "description": "The row heading. A node or `(state) => node`."
20
+ },
21
+ "content": {
22
+ "description": "The panel body."
23
+ },
24
+ "description": {
25
+ "description": "A secondary line under the title."
26
+ },
27
+ "icon": {
28
+ "description": "A leading visual."
29
+ },
30
+ "badge": {
31
+ "description": "A trailing chip before the indicator."
32
+ },
33
+ "indicator": {
34
+ "description": "Overrides the accordion-wide indicator for this row.",
35
+ "anyOf": [
36
+ {
37
+ "enum": [
38
+ "chevron",
39
+ "plus",
40
+ "caret",
41
+ "arrow",
42
+ "none"
43
+ ]
44
+ },
45
+ {}
46
+ ]
47
+ },
48
+ "disabled": {
49
+ "description": "Blocks toggling. The row stays focusable.",
50
+ "type": "boolean"
51
+ },
52
+ "defaultOpen": {
53
+ "description": "Open on first render (uncontrolled only).",
54
+ "type": "boolean"
55
+ },
56
+ "classNames": {
57
+ "description": "Per-row classes, by slot.",
58
+ "type": "object",
59
+ "properties": {
60
+ "root": {
61
+ "description": "The `root` slot.",
62
+ "type": "string"
63
+ },
64
+ "item": {
65
+ "description": "The `item` slot.",
66
+ "type": "string"
67
+ },
68
+ "header": {
69
+ "description": "The `header` slot.",
70
+ "type": "string"
71
+ },
72
+ "trigger": {
73
+ "description": "The `trigger` slot.",
74
+ "type": "string"
75
+ },
76
+ "icon": {
77
+ "description": "The `icon` slot.",
78
+ "type": "string"
79
+ },
80
+ "label": {
81
+ "description": "The `label` slot.",
82
+ "type": "string"
83
+ },
84
+ "title": {
85
+ "description": "The `title` slot.",
86
+ "type": "string"
87
+ },
88
+ "description": {
89
+ "description": "The `description` slot.",
90
+ "type": "string"
91
+ },
92
+ "badge": {
93
+ "description": "The `badge` slot.",
94
+ "type": "string"
95
+ },
96
+ "indicator": {
97
+ "description": "The `indicator` slot.",
98
+ "type": "string"
99
+ },
100
+ "panel": {
101
+ "description": "The `panel` slot.",
102
+ "type": "string"
103
+ },
104
+ "content": {
105
+ "description": "The `content` slot.",
106
+ "type": "string"
107
+ }
108
+ },
109
+ "additionalProperties": false
110
+ },
111
+ "styles": {
112
+ "description": "Per-row inline styles, by slot.",
113
+ "type": "object",
114
+ "properties": {
115
+ "root": {
116
+ "description": "The `root` slot.",
117
+ "type": "object"
118
+ },
119
+ "item": {
120
+ "description": "The `item` slot.",
121
+ "type": "object"
122
+ },
123
+ "header": {
124
+ "description": "The `header` slot.",
125
+ "type": "object"
126
+ },
127
+ "trigger": {
128
+ "description": "The `trigger` slot.",
129
+ "type": "object"
130
+ },
131
+ "icon": {
132
+ "description": "The `icon` slot.",
133
+ "type": "object"
134
+ },
135
+ "label": {
136
+ "description": "The `label` slot.",
137
+ "type": "object"
138
+ },
139
+ "title": {
140
+ "description": "The `title` slot.",
141
+ "type": "object"
142
+ },
143
+ "description": {
144
+ "description": "The `description` slot.",
145
+ "type": "object"
146
+ },
147
+ "badge": {
148
+ "description": "The `badge` slot.",
149
+ "type": "object"
150
+ },
151
+ "indicator": {
152
+ "description": "The `indicator` slot.",
153
+ "type": "object"
154
+ },
155
+ "panel": {
156
+ "description": "The `panel` slot.",
157
+ "type": "object"
158
+ },
159
+ "content": {
160
+ "description": "The `content` slot.",
161
+ "type": "object"
162
+ }
163
+ },
164
+ "additionalProperties": false
165
+ }
166
+ },
167
+ "required": [
168
+ "title"
169
+ ],
170
+ "additionalProperties": true
171
+ }
172
+ },
173
+ "fields": {
174
+ "description": "Map raw records onto rows: `{ id: 'slug', title: 'question', content: 'answer' }`.",
175
+ "type": "object",
176
+ "properties": {
177
+ "id": {
178
+ "description": "Source field for `id`.",
179
+ "type": "string"
180
+ },
181
+ "title": {
182
+ "description": "Source field for `title`.",
183
+ "type": "string"
184
+ },
185
+ "content": {
186
+ "description": "Source field for `content`.",
187
+ "type": "string"
188
+ },
189
+ "description": {
190
+ "description": "Source field for `description`.",
191
+ "type": "string"
192
+ },
193
+ "icon": {
194
+ "description": "Source field for `icon`.",
195
+ "type": "string"
196
+ },
197
+ "badge": {
198
+ "description": "Source field for `badge`.",
199
+ "type": "string"
200
+ },
201
+ "disabled": {
202
+ "description": "Source field for `disabled`.",
203
+ "type": "string"
204
+ },
205
+ "defaultOpen": {
206
+ "description": "Source field for `defaultOpen`.",
207
+ "type": "string"
208
+ }
209
+ },
210
+ "additionalProperties": false
211
+ },
212
+ "mode": {
213
+ "description": "`single` closes the other rows when one opens.",
214
+ "default": "single",
215
+ "enum": [
216
+ "single",
217
+ "multiple"
218
+ ]
219
+ },
220
+ "collapsible": {
221
+ "description": "In single mode, lets the user close the open row.",
222
+ "default": true,
223
+ "type": "boolean"
224
+ },
225
+ "value": {
226
+ "description": "Controlled open ids. Pair with `onValueChange`.",
227
+ "type": "array",
228
+ "items": {
229
+ "type": "string"
230
+ }
231
+ },
232
+ "defaultValue": {
233
+ "description": "Initially open ids (uncontrolled).",
234
+ "type": "array",
235
+ "items": {
236
+ "type": "string"
237
+ }
238
+ },
239
+ "disabled": {
240
+ "description": "Disables every row.",
241
+ "default": false,
242
+ "type": "boolean"
243
+ },
244
+ "orientation": {
245
+ "description": "Arrow-key axis between headers.",
246
+ "default": "vertical",
247
+ "enum": [
248
+ "vertical",
249
+ "horizontal"
250
+ ]
251
+ },
252
+ "dir": {
253
+ "description": "Text direction. Defaults to the provider.",
254
+ "enum": [
255
+ "ltr",
256
+ "rtl"
257
+ ]
258
+ },
259
+ "loop": {
260
+ "description": "Focus wraps around at the ends.",
261
+ "default": true,
262
+ "type": "boolean"
263
+ },
264
+ "id": {
265
+ "description": "Id prefix. Defaults to `useId()`, which is SSR-safe.",
266
+ "type": "string"
267
+ },
268
+ "hiddenUntilFound": {
269
+ "description": "Closed panels use `hidden=\"until-found\"`, so the browser’s find-in-page opens them.",
270
+ "default": true,
271
+ "type": "boolean"
272
+ },
273
+ "mountPanels": {
274
+ "description": "When panel content is in the DOM. `always` keeps it searchable and indexable.",
275
+ "default": "always",
276
+ "enum": [
277
+ "always",
278
+ "open",
279
+ "first-open"
280
+ ]
281
+ },
282
+ "unmountClosed": {
283
+ "description": "Deprecated alias of `mountPanels: \"open\"`.",
284
+ "deprecated": true,
285
+ "type": "boolean"
286
+ },
287
+ "syncWithHash": {
288
+ "description": "A `#id` in the URL opens that row and scrolls to it; opening a row updates the hash.",
289
+ "default": false,
290
+ "type": "boolean"
291
+ },
292
+ "lazy": {
293
+ "description": "When the code loads, for the `/lazy` entry. The accordion is light, so `auto` is eager.",
294
+ "default": "auto",
295
+ "enum": [
296
+ "auto",
297
+ "eager",
298
+ "visible",
299
+ "idle"
300
+ ]
301
+ },
302
+ "variant": {
303
+ "description": "Visual style.",
304
+ "default": "solid",
305
+ "enum": [
306
+ "solid",
307
+ "outline",
308
+ "separated",
309
+ "filled",
310
+ "ghost"
311
+ ]
312
+ },
313
+ "size": {
314
+ "description": "Size preset.",
315
+ "default": "md",
316
+ "enum": [
317
+ "sm",
318
+ "md",
319
+ "lg"
320
+ ]
321
+ },
322
+ "tone": {
323
+ "description": "Accent colour role.",
324
+ "default": "primary",
325
+ "enum": [
326
+ "primary",
327
+ "neutral",
328
+ "success",
329
+ "warning",
330
+ "danger",
331
+ "info"
332
+ ]
333
+ },
334
+ "radius": {
335
+ "description": "Corner radius preset.",
336
+ "default": "md",
337
+ "enum": [
338
+ "none",
339
+ "sm",
340
+ "md",
341
+ "lg",
342
+ "full"
343
+ ]
344
+ },
345
+ "indicator": {
346
+ "description": "A built-in glyph, your own node, or `(state) => node`.",
347
+ "default": "chevron",
348
+ "anyOf": [
349
+ {
350
+ "enum": [
351
+ "chevron",
352
+ "plus",
353
+ "caret",
354
+ "arrow",
355
+ "none"
356
+ ]
357
+ },
358
+ {}
359
+ ]
360
+ },
361
+ "indicatorPosition": {
362
+ "description": "Which edge the indicator sits on.",
363
+ "default": "end",
364
+ "enum": [
365
+ "start",
366
+ "end"
367
+ ]
368
+ },
369
+ "headingLevel": {
370
+ "description": "Heading level around each trigger.",
371
+ "default": 3,
372
+ "enum": [
373
+ 1,
374
+ 2,
375
+ 3,
376
+ 4,
377
+ 5,
378
+ 6
379
+ ]
380
+ },
381
+ "animate": {
382
+ "description": "Animate open and close. `prefers-reduced-motion` always wins.",
383
+ "default": true,
384
+ "type": "boolean"
385
+ },
386
+ "dividers": {
387
+ "description": "Lines between rows.",
388
+ "default": true,
389
+ "type": "boolean"
390
+ },
391
+ "overflow": {
392
+ "description": "Text overflow per slot. Default: title wraps, description clamps to 2 lines.",
393
+ "type": "object",
394
+ "properties": {
395
+ "title": {
396
+ "description": "`'wrap'`, `'truncate'` (one line with an ellipsis) or `{ lines: n }` (clamp to n lines).",
397
+ "anyOf": [
398
+ {
399
+ "enum": [
400
+ "wrap",
401
+ "truncate"
402
+ ]
403
+ },
404
+ {}
405
+ ]
406
+ },
407
+ "description": {
408
+ "description": "`'wrap'`, `'truncate'` (one line with an ellipsis) or `{ lines: n }` (clamp to n lines).",
409
+ "anyOf": [
410
+ {
411
+ "enum": [
412
+ "wrap",
413
+ "truncate"
414
+ ]
415
+ },
416
+ {}
417
+ ]
418
+ }
419
+ },
420
+ "additionalProperties": false
421
+ },
422
+ "dimensions": {
423
+ "description": "Explicit sizes. Numbers are px. Each key overrides the size preset.",
424
+ "type": "object",
425
+ "properties": {
426
+ "width": {
427
+ "description": "Default 100% of the parent.",
428
+ "type": [
429
+ "number",
430
+ "string"
431
+ ]
432
+ },
433
+ "minWidth": {
434
+ "description": "Minimum width.",
435
+ "type": [
436
+ "number",
437
+ "string"
438
+ ]
439
+ },
440
+ "maxWidth": {
441
+ "description": "Maximum width.",
442
+ "type": [
443
+ "number",
444
+ "string"
445
+ ]
446
+ },
447
+ "height": {
448
+ "description": "Fixed height.",
449
+ "type": [
450
+ "number",
451
+ "string"
452
+ ]
453
+ },
454
+ "maxHeight": {
455
+ "description": "Caps the root; rows scroll.",
456
+ "type": [
457
+ "number",
458
+ "string"
459
+ ]
460
+ },
461
+ "gap": {
462
+ "description": "Space between rows.",
463
+ "type": [
464
+ "number",
465
+ "string"
466
+ ]
467
+ },
468
+ "paddingX": {
469
+ "description": "Trigger horizontal padding.",
470
+ "type": [
471
+ "number",
472
+ "string"
473
+ ]
474
+ },
475
+ "paddingY": {
476
+ "description": "Trigger vertical padding.",
477
+ "type": [
478
+ "number",
479
+ "string"
480
+ ]
481
+ },
482
+ "panelPaddingX": {
483
+ "description": "Panel horizontal padding.",
484
+ "type": [
485
+ "number",
486
+ "string"
487
+ ]
488
+ },
489
+ "panelPaddingY": {
490
+ "description": "Panel vertical padding.",
491
+ "type": [
492
+ "number",
493
+ "string"
494
+ ]
495
+ },
496
+ "panelMaxHeight": {
497
+ "description": "Caps an open panel; it scrolls.",
498
+ "type": [
499
+ "number",
500
+ "string"
501
+ ]
502
+ },
503
+ "fontSize": {
504
+ "description": "Base font size.",
505
+ "type": [
506
+ "number",
507
+ "string"
508
+ ]
509
+ },
510
+ "titleSize": {
511
+ "description": "Title font size.",
512
+ "type": [
513
+ "number",
514
+ "string"
515
+ ]
516
+ },
517
+ "descriptionSize": {
518
+ "description": "Description font size.",
519
+ "type": [
520
+ "number",
521
+ "string"
522
+ ]
523
+ },
524
+ "iconSize": {
525
+ "description": "Icon box size.",
526
+ "type": [
527
+ "number",
528
+ "string"
529
+ ]
530
+ },
531
+ "indicatorSize": {
532
+ "description": "Indicator size.",
533
+ "type": [
534
+ "number",
535
+ "string"
536
+ ]
537
+ },
538
+ "borderWidth": {
539
+ "description": "Border width.",
540
+ "type": [
541
+ "number",
542
+ "string"
543
+ ]
544
+ },
545
+ "radius": {
546
+ "description": "Corner radius as a length.",
547
+ "type": [
548
+ "number",
549
+ "string"
550
+ ]
551
+ },
552
+ "duration": {
553
+ "description": "Transition duration, e.g. '320ms'.",
554
+ "type": [
555
+ "number",
556
+ "string"
557
+ ]
558
+ }
559
+ },
560
+ "additionalProperties": false
561
+ },
562
+ "unstyled": {
563
+ "description": "Drops every Pinfold class; ARIA and `data-*` stay. For Tailwind or your own CSS.",
564
+ "default": false,
565
+ "type": "boolean"
566
+ },
567
+ "className": {
568
+ "description": "Class on the root.",
569
+ "type": "string"
570
+ },
571
+ "style": {
572
+ "description": "Inline style on the root.",
573
+ "type": "object"
574
+ },
575
+ "classNames": {
576
+ "description": "Classes per slot.",
577
+ "type": "object",
578
+ "properties": {
579
+ "root": {
580
+ "description": "The `root` slot.",
581
+ "type": "string"
582
+ },
583
+ "item": {
584
+ "description": "The `item` slot.",
585
+ "type": "string"
586
+ },
587
+ "header": {
588
+ "description": "The `header` slot.",
589
+ "type": "string"
590
+ },
591
+ "trigger": {
592
+ "description": "The `trigger` slot.",
593
+ "type": "string"
594
+ },
595
+ "icon": {
596
+ "description": "The `icon` slot.",
597
+ "type": "string"
598
+ },
599
+ "label": {
600
+ "description": "The `label` slot.",
601
+ "type": "string"
602
+ },
603
+ "title": {
604
+ "description": "The `title` slot.",
605
+ "type": "string"
606
+ },
607
+ "description": {
608
+ "description": "The `description` slot.",
609
+ "type": "string"
610
+ },
611
+ "badge": {
612
+ "description": "The `badge` slot.",
613
+ "type": "string"
614
+ },
615
+ "indicator": {
616
+ "description": "The `indicator` slot.",
617
+ "type": "string"
618
+ },
619
+ "panel": {
620
+ "description": "The `panel` slot.",
621
+ "type": "string"
622
+ },
623
+ "content": {
624
+ "description": "The `content` slot.",
625
+ "type": "string"
626
+ }
627
+ },
628
+ "additionalProperties": false
629
+ },
630
+ "styles": {
631
+ "description": "Inline styles per slot.",
632
+ "type": "object",
633
+ "properties": {
634
+ "root": {
635
+ "description": "The `root` slot.",
636
+ "type": "object"
637
+ },
638
+ "item": {
639
+ "description": "The `item` slot.",
640
+ "type": "object"
641
+ },
642
+ "header": {
643
+ "description": "The `header` slot.",
644
+ "type": "object"
645
+ },
646
+ "trigger": {
647
+ "description": "The `trigger` slot.",
648
+ "type": "object"
649
+ },
650
+ "icon": {
651
+ "description": "The `icon` slot.",
652
+ "type": "object"
653
+ },
654
+ "label": {
655
+ "description": "The `label` slot.",
656
+ "type": "object"
657
+ },
658
+ "title": {
659
+ "description": "The `title` slot.",
660
+ "type": "object"
661
+ },
662
+ "description": {
663
+ "description": "The `description` slot.",
664
+ "type": "object"
665
+ },
666
+ "badge": {
667
+ "description": "The `badge` slot.",
668
+ "type": "object"
669
+ },
670
+ "indicator": {
671
+ "description": "The `indicator` slot.",
672
+ "type": "object"
673
+ },
674
+ "panel": {
675
+ "description": "The `panel` slot.",
676
+ "type": "object"
677
+ },
678
+ "content": {
679
+ "description": "The `content` slot.",
680
+ "type": "object"
681
+ }
682
+ },
683
+ "additionalProperties": false
684
+ },
685
+ "slotProps": {
686
+ "description": "Any DOM props per slot. Handlers chain.",
687
+ "type": "object",
688
+ "properties": {
689
+ "root": {
690
+ "description": "The `root` slot.",
691
+ "type": "object"
692
+ },
693
+ "item": {
694
+ "description": "The `item` slot.",
695
+ "type": "object"
696
+ },
697
+ "header": {
698
+ "description": "The `header` slot.",
699
+ "type": "object"
700
+ },
701
+ "trigger": {
702
+ "description": "The `trigger` slot.",
703
+ "type": "object"
704
+ },
705
+ "icon": {
706
+ "description": "The `icon` slot.",
707
+ "type": "object"
708
+ },
709
+ "label": {
710
+ "description": "The `label` slot.",
711
+ "type": "object"
712
+ },
713
+ "title": {
714
+ "description": "The `title` slot.",
715
+ "type": "object"
716
+ },
717
+ "description": {
718
+ "description": "The `description` slot.",
719
+ "type": "object"
720
+ },
721
+ "badge": {
722
+ "description": "The `badge` slot.",
723
+ "type": "object"
724
+ },
725
+ "indicator": {
726
+ "description": "The `indicator` slot.",
727
+ "type": "object"
728
+ },
729
+ "panel": {
730
+ "description": "The `panel` slot.",
731
+ "type": "object"
732
+ },
733
+ "content": {
734
+ "description": "The `content` slot.",
735
+ "type": "object"
736
+ }
737
+ },
738
+ "additionalProperties": false
739
+ },
740
+ "render": {
741
+ "description": "Replace a slot element: `({ props, state, children }) => node`.",
742
+ "type": "object",
743
+ "properties": {
744
+ "root": {
745
+ "description": "The `root` slot."
746
+ },
747
+ "item": {
748
+ "description": "The `item` slot."
749
+ },
750
+ "header": {
751
+ "description": "The `header` slot."
752
+ },
753
+ "trigger": {
754
+ "description": "The `trigger` slot."
755
+ },
756
+ "icon": {
757
+ "description": "The `icon` slot."
758
+ },
759
+ "label": {
760
+ "description": "The `label` slot."
761
+ },
762
+ "title": {
763
+ "description": "The `title` slot."
764
+ },
765
+ "description": {
766
+ "description": "The `description` slot."
767
+ },
768
+ "badge": {
769
+ "description": "The `badge` slot."
770
+ },
771
+ "indicator": {
772
+ "description": "The `indicator` slot."
773
+ },
774
+ "panel": {
775
+ "description": "The `panel` slot."
776
+ },
777
+ "content": {
778
+ "description": "The `content` slot."
779
+ }
780
+ },
781
+ "additionalProperties": false
782
+ },
783
+ "renderItem": {
784
+ "description": "Replace a whole row: `({ state, props, header, panel }) => node`."
785
+ },
786
+ "onValueChange": {
787
+ "description": "`(ids, details)`. `details: { id, open, reason: 'click' | 'keyboard' | 'api' | 'find-in-page' | 'hash', event }`."
788
+ },
789
+ "onBeforeChange": {
790
+ "description": "`(details) => boolean | void`. Return `false` to block the change."
791
+ },
792
+ "onItemToggle": {
793
+ "description": "`(id, open)`, after `onValueChange`."
794
+ }
795
+ },
796
+ "required": [
797
+ "items"
798
+ ],
799
+ "additionalProperties": false
800
+ }