@dust-tt/sparkle 0.2.210-rc → 0.2.210

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 (135) hide show
  1. package/dist/cjs/_index.d.ts +4 -4
  2. package/dist/cjs/components/Checkbox.d.ts +3 -3
  3. package/dist/cjs/components/DataTable.d.ts +3 -3
  4. package/dist/cjs/components/Tree.d.ts +6 -9
  5. package/dist/cjs/icons/solid/index.d.ts +0 -13
  6. package/dist/cjs/icons/stroke/index.d.ts +0 -13
  7. package/dist/cjs/index.js +31 -179
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/stories/Checkbox.stories.d.ts +0 -2
  10. package/dist/cjs/stories/Tree.stories.d.ts +1 -0
  11. package/dist/esm/_index.d.ts +4 -4
  12. package/dist/esm/components/Checkbox.d.ts +3 -3
  13. package/dist/esm/components/DataTable.d.ts +3 -3
  14. package/dist/esm/components/Tree.d.ts +6 -9
  15. package/dist/esm/icons/solid/index.d.ts +0 -13
  16. package/dist/esm/icons/stroke/index.d.ts +0 -13
  17. package/dist/esm/index.js +32 -154
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/esm/stories/Checkbox.stories.d.ts +0 -2
  20. package/dist/esm/stories/Tree.stories.d.ts +1 -0
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +1 -1
  23. package/src/_index.ts +0 -52
  24. package/src/components/Checkbox.tsx +12 -42
  25. package/src/components/DataTable.tsx +4 -4
  26. package/src/components/Tree.tsx +66 -71
  27. package/src/icons/solid/index.ts +0 -14
  28. package/src/icons/stroke/index.ts +0 -13
  29. package/src/stories/Checkbox.stories.tsx +2 -63
  30. package/src/stories/Tree.stories.tsx +189 -152
  31. package/dist/cjs/icons/solid/ArrowDownS.d.ts +0 -4
  32. package/dist/cjs/icons/solid/ArrowLeftS.d.ts +0 -4
  33. package/dist/cjs/icons/solid/ArrowRightS.d.ts +0 -4
  34. package/dist/cjs/icons/solid/ArrowUpS.d.ts +0 -4
  35. package/dist/cjs/icons/solid/ChevronDoubleLeft.d.ts +0 -4
  36. package/dist/cjs/icons/solid/ChevronDoubleRight.d.ts +0 -4
  37. package/dist/cjs/icons/solid/Company.d.ts +0 -4
  38. package/dist/cjs/icons/solid/Filter.d.ts +0 -4
  39. package/dist/cjs/icons/solid/Heart.d.ts +0 -4
  40. package/dist/cjs/icons/solid/History.d.ts +0 -4
  41. package/dist/cjs/icons/solid/Home.d.ts +0 -4
  42. package/dist/cjs/icons/solid/MarkPen.d.ts +0 -4
  43. package/dist/cjs/icons/solid/Translate.d.ts +0 -4
  44. package/dist/cjs/icons/stroke/ArrowDownS.d.ts +0 -4
  45. package/dist/cjs/icons/stroke/ArrowLeftS.d.ts +0 -4
  46. package/dist/cjs/icons/stroke/ArrowRightS.d.ts +0 -4
  47. package/dist/cjs/icons/stroke/ArrowUpS.d.ts +0 -4
  48. package/dist/cjs/icons/stroke/ChevronDoubleLeft.d.ts +0 -4
  49. package/dist/cjs/icons/stroke/ChevronDoubleRight.d.ts +0 -4
  50. package/dist/cjs/icons/stroke/Company.d.ts +0 -4
  51. package/dist/cjs/icons/stroke/Filter.d.ts +0 -4
  52. package/dist/cjs/icons/stroke/Heart.d.ts +0 -4
  53. package/dist/cjs/icons/stroke/History.d.ts +0 -4
  54. package/dist/cjs/icons/stroke/Home.d.ts +0 -4
  55. package/dist/cjs/icons/stroke/MarkPen.d.ts +0 -4
  56. package/dist/cjs/icons/stroke/Translate.d.ts +0 -4
  57. package/dist/esm/icons/solid/ArrowDownS.d.ts +0 -4
  58. package/dist/esm/icons/solid/ArrowLeftS.d.ts +0 -4
  59. package/dist/esm/icons/solid/ArrowRightS.d.ts +0 -4
  60. package/dist/esm/icons/solid/ArrowUpS.d.ts +0 -4
  61. package/dist/esm/icons/solid/ChevronDoubleLeft.d.ts +0 -4
  62. package/dist/esm/icons/solid/ChevronDoubleRight.d.ts +0 -4
  63. package/dist/esm/icons/solid/Company.d.ts +0 -4
  64. package/dist/esm/icons/solid/Filter.d.ts +0 -4
  65. package/dist/esm/icons/solid/Heart.d.ts +0 -4
  66. package/dist/esm/icons/solid/History.d.ts +0 -4
  67. package/dist/esm/icons/solid/Home.d.ts +0 -4
  68. package/dist/esm/icons/solid/MarkPen.d.ts +0 -4
  69. package/dist/esm/icons/solid/Translate.d.ts +0 -4
  70. package/dist/esm/icons/stroke/ArrowDownS.d.ts +0 -4
  71. package/dist/esm/icons/stroke/ArrowLeftS.d.ts +0 -4
  72. package/dist/esm/icons/stroke/ArrowRightS.d.ts +0 -4
  73. package/dist/esm/icons/stroke/ArrowUpS.d.ts +0 -4
  74. package/dist/esm/icons/stroke/ChevronDoubleLeft.d.ts +0 -4
  75. package/dist/esm/icons/stroke/ChevronDoubleRight.d.ts +0 -4
  76. package/dist/esm/icons/stroke/Company.d.ts +0 -4
  77. package/dist/esm/icons/stroke/Filter.d.ts +0 -4
  78. package/dist/esm/icons/stroke/Heart.d.ts +0 -4
  79. package/dist/esm/icons/stroke/History.d.ts +0 -4
  80. package/dist/esm/icons/stroke/Home.d.ts +0 -4
  81. package/dist/esm/icons/stroke/MarkPen.d.ts +0 -4
  82. package/dist/esm/icons/stroke/Translate.d.ts +0 -4
  83. package/src/icons/solid/ArrowDownS.tsx +0 -15
  84. package/src/icons/solid/ArrowLeftS.tsx +0 -15
  85. package/src/icons/solid/ArrowRightS.tsx +0 -15
  86. package/src/icons/solid/ArrowUpS.tsx +0 -15
  87. package/src/icons/solid/ChevronDoubleLeft.tsx +0 -22
  88. package/src/icons/solid/ChevronDoubleRight.tsx +0 -22
  89. package/src/icons/solid/Company.tsx +0 -20
  90. package/src/icons/solid/Filter.tsx +0 -18
  91. package/src/icons/solid/Heart.tsx +0 -18
  92. package/src/icons/solid/History.tsx +0 -18
  93. package/src/icons/solid/Home.tsx +0 -20
  94. package/src/icons/solid/MarkPen.tsx +0 -18
  95. package/src/icons/solid/Translate.tsx +0 -18
  96. package/src/icons/src/solid/arrow-down-s.svg +0 -3
  97. package/src/icons/src/solid/arrow-left-s.svg +0 -3
  98. package/src/icons/src/solid/arrow-right-s.svg +0 -3
  99. package/src/icons/src/solid/arrow-up-s.svg +0 -3
  100. package/src/icons/src/solid/chevron-double-left.svg +0 -4
  101. package/src/icons/src/solid/chevron-double-right.svg +0 -4
  102. package/src/icons/src/solid/company.svg +0 -3
  103. package/src/icons/src/solid/filter.svg +0 -3
  104. package/src/icons/src/solid/heart.svg +0 -3
  105. package/src/icons/src/solid/history.svg +0 -3
  106. package/src/icons/src/solid/home.svg +0 -3
  107. package/src/icons/src/solid/mark-pen.svg +0 -3
  108. package/src/icons/src/solid/translate.svg +0 -3
  109. package/src/icons/src/stroke/arrow-down-s.svg +0 -3
  110. package/src/icons/src/stroke/arrow-left-s.svg +0 -3
  111. package/src/icons/src/stroke/arrow-right-s.svg +0 -3
  112. package/src/icons/src/stroke/arrow-up-s.svg +0 -3
  113. package/src/icons/src/stroke/chevron-double-left.svg +0 -4
  114. package/src/icons/src/stroke/chevron-double-right.svg +0 -4
  115. package/src/icons/src/stroke/company.svg +0 -9
  116. package/src/icons/src/stroke/filter.svg +0 -3
  117. package/src/icons/src/stroke/heart.svg +0 -3
  118. package/src/icons/src/stroke/history.svg +0 -3
  119. package/src/icons/src/stroke/home.svg +0 -3
  120. package/src/icons/src/stroke/mark-pen.svg +0 -3
  121. package/src/icons/src/stroke/translate.svg +0 -3
  122. package/src/icons/stroke/ArrowDownS.tsx +0 -15
  123. package/src/icons/stroke/ArrowLeftS.tsx +0 -15
  124. package/src/icons/stroke/ArrowRightS.tsx +0 -15
  125. package/src/icons/stroke/ArrowUpS.tsx +0 -15
  126. package/src/icons/stroke/ChevronDoubleLeft.tsx +0 -16
  127. package/src/icons/stroke/ChevronDoubleRight.tsx +0 -16
  128. package/src/icons/stroke/Company.tsx +0 -24
  129. package/src/icons/stroke/Filter.tsx +0 -15
  130. package/src/icons/stroke/Heart.tsx +0 -20
  131. package/src/icons/stroke/History.tsx +0 -18
  132. package/src/icons/stroke/Home.tsx +0 -20
  133. package/src/icons/stroke/MarkPen.tsx +0 -18
  134. package/src/icons/stroke/Translate.tsx +0 -18
  135. package/src/logo/src/platforms/Zendesk.svg +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dust-tt/sparkle",
3
- "version": "0.2.210-rc",
3
+ "version": "0.2.210",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && rollup -c",
6
6
  "build:with-tw-base": "rollup -c --environment INCLUDE_TW_BASE:true",
package/src/_index.ts CHANGED
@@ -252,15 +252,11 @@ import {
252
252
  ArrowDown as ArrowDownIcon,
253
253
  ArrowDownCircle as ArrowDownCircleIcon,
254
254
  ArrowDownOnSquare as ArrowDownOnSquareIcon,
255
- ArrowDownS as ArrowDownSIcon,
256
255
  ArrowLeft as ArrowLeftIcon,
257
- ArrowLeftS as ArrowLeftSIcon,
258
256
  ArrowPath as ArrowPathIcon,
259
257
  ArrowRight as ArrowRightIcon,
260
- ArrowRightS as ArrowRightSIcon,
261
258
  ArrowUp as ArrowUpIcon,
262
259
  ArrowUpOnSquare as ArrowUpOnSquareIcon,
263
- ArrowUpS as ArrowUpSIcon,
264
260
  Attachment as AttachmentIcon,
265
261
  Backspace as BackspaceIcon,
266
262
  Bookmark as BookmarkIcon,
@@ -273,8 +269,6 @@ ArrowUpS as ArrowUpSIcon,
273
269
  ChatBubbleThought as ChatBubbleThoughtIcon,
274
270
  Check as CheckIcon,
275
271
  CheckCircle as CheckCircleIcon,
276
- ChevronDoubleLeft as ChevronDoubleLeftIcon,
277
- ChevronDoubleRight as ChevronDoubleRightIcon,
278
272
  ChevronDown as ChevronDownIcon,
279
273
  ChevronLeft as ChevronLeftIcon,
280
274
  ChevronRight as ChevronRightIcon,
@@ -291,7 +285,6 @@ ChevronDoubleRight as ChevronDoubleRightIcon,
291
285
  Cog6Tooth as Cog6ToothIcon,
292
286
  Command as CommandIcon,
293
287
  CommandLine as CommandLineIcon,
294
- Company as CompanyIcon,
295
288
  Cube as CubeIcon,
296
289
  Dash as DashIcon,
297
290
  Document as DocumentIcon,
@@ -306,7 +299,6 @@ Company as CompanyIcon,
306
299
  ExternalLink as ExternalLinkIcon,
307
300
  Eye as EyeIcon,
308
301
  EyeSlash as EyeSlashIcon,
309
- Filter as FilterIcon,
310
302
  Fire as FireIcon,
311
303
  Flag as FlagIcon,
312
304
  Folder as FolderIcon,
@@ -317,11 +309,8 @@ Filter as FilterIcon,
317
309
  Grab as GrabIcon,
318
310
  HandThumbDown as HandThumbDownIcon,
319
311
  HandThumbUp as HandThumbUpIcon,
320
- Heart as HeartIcon,
321
312
  HeartAlt as HeartAltIcon,
322
313
  Hexagon as HexagonIcon,
323
- History as HistoryIcon,
324
- Home as HomeIcon,
325
314
  Image as ImageIcon,
326
315
  InformationCircle as InformationCircleIcon,
327
316
  Key as KeyIcon,
@@ -336,7 +325,6 @@ Home as HomeIcon,
336
325
  Logout as LogoutIcon,
337
326
  Magic as MagicIcon,
338
327
  MagnifyingGlass as MagnifyingGlassIcon,
339
- MarkPen as MarkPenIcon,
340
328
  Menu as MenuIcon,
341
329
  More as MoreIcon,
342
330
  MovingMail as MovingMailIcon,
@@ -369,7 +357,6 @@ MarkPen as MarkPenIcon,
369
357
  Template as TemplateIcon,
370
358
  TestTube as TestTubeIcon,
371
359
  Time as TimeIcon,
372
- Translate as TranslateIcon,
373
360
  Trash as TrashIcon,
374
361
  Triangle as TriangleIcon,
375
362
  User as UserIcon,
@@ -385,15 +372,11 @@ export {
385
372
  ArrowDownCircleIcon,
386
373
  ArrowDownIcon,
387
374
  ArrowDownOnSquareIcon,
388
- ArrowDownSIcon,
389
375
  ArrowLeftIcon,
390
- ArrowLeftSIcon,
391
376
  ArrowPathIcon,
392
377
  ArrowRightIcon,
393
- ArrowRightSIcon,
394
378
  ArrowUpIcon,
395
379
  ArrowUpOnSquareIcon,
396
- ArrowUpSIcon,
397
380
  AttachmentIcon,
398
381
  BackspaceIcon,
399
382
  BookmarkIcon,
@@ -406,8 +389,6 @@ ArrowUpSIcon,
406
389
  ChatBubbleThoughtIcon,
407
390
  CheckCircleIcon,
408
391
  CheckIcon,
409
- ChevronDoubleLeftIcon,
410
- ChevronDoubleRightIcon,
411
392
  ChevronDownIcon,
412
393
  ChevronLeftIcon,
413
394
  ChevronRightIcon,
@@ -424,7 +405,6 @@ ChevronDoubleRightIcon,
424
405
  Cog6ToothIcon,
425
406
  CommandIcon,
426
407
  CommandLineIcon,
427
- CompanyIcon,
428
408
  CubeIcon,
429
409
  DashIcon,
430
410
  DocumentDuplicateIcon,
@@ -439,7 +419,6 @@ CompanyIcon,
439
419
  ExternalLinkIcon,
440
420
  EyeIcon,
441
421
  EyeSlashIcon,
442
- FilterIcon,
443
422
  FireIcon,
444
423
  FlagIcon,
445
424
  FolderIcon,
@@ -451,10 +430,7 @@ FilterIcon,
451
430
  HandThumbDownIcon,
452
431
  HandThumbUpIcon,
453
432
  HeartAltIcon,
454
- HeartIcon,
455
433
  HexagonIcon,
456
- HistoryIcon,
457
- HomeIcon,
458
434
  ImageIcon,
459
435
  InformationCircleIcon,
460
436
  KeyIcon,
@@ -469,7 +445,6 @@ HomeIcon,
469
445
  LogoutIcon,
470
446
  MagicIcon,
471
447
  MagnifyingGlassIcon,
472
- MarkPenIcon,
473
448
  MenuIcon,
474
449
  MoreIcon,
475
450
  MovingMailIcon,
@@ -502,7 +477,6 @@ MarkPenIcon,
502
477
  TemplateIcon,
503
478
  TestTubeIcon,
504
479
  TimeIcon,
505
- TranslateIcon,
506
480
  TrashIcon,
507
481
  TriangleIcon,
508
482
  UserArrowIcon,
@@ -518,15 +492,11 @@ import {
518
492
  ArrowDown as ArrowDownStrokeIcon,
519
493
  ArrowDownCircle as ArrowDownCircleStrokeIcon,
520
494
  ArrowDownOnSquare as ArrowDownOnSquareStrokeIcon,
521
- ArrowDownS as ArrowDownSStrokeIcon,
522
495
  ArrowLeft as ArrowLeftStrokeIcon,
523
- ArrowLeftS as ArrowLeftSStrokeIcon,
524
496
  ArrowPath as ArrowPathStrokeIcon,
525
497
  ArrowRight as ArrowRightStrokeIcon,
526
- ArrowRightS as ArrowRightSStrokeIcon,
527
498
  ArrowUp as ArrowUpStrokeIcon,
528
499
  ArrowUpOnSquare as ArrowUpOnSquareStrokeIcon,
529
- ArrowUpS as ArrowUpSStrokeIcon,
530
500
  Attachment as AttachmentStrokeIcon,
531
501
  Backspace as BackspaceStrokeIcon,
532
502
  Bookmark as BookmarkStrokeIcon,
@@ -539,8 +509,6 @@ ArrowUpS as ArrowUpSStrokeIcon,
539
509
  ChatBubbleThought as ChatBubbleThoughtStrokeIcon,
540
510
  Check as CheckStrokeIcon,
541
511
  CheckCircle as CheckCircleStrokeIcon,
542
- ChevronDoubleLeft as ChevronDoubleLeftStrokeIcon,
543
- ChevronDoubleRight as ChevronDoubleRightStrokeIcon,
544
512
  ChevronDown as ChevronDownStrokeIcon,
545
513
  ChevronLeft as ChevronLeftStrokeIcon,
546
514
  ChevronRight as ChevronRightStrokeIcon,
@@ -557,7 +525,6 @@ ChevronDoubleRight as ChevronDoubleRightStrokeIcon,
557
525
  Cog6Tooth as Cog6ToothStrokeIcon,
558
526
  Command as CommandStrokeIcon,
559
527
  CommandLine as CommandLineStrokeIcon,
560
- Company as CompanyStrokeIcon,
561
528
  Cube as CubeStrokeIcon,
562
529
  Dash as DashStrokeIcon,
563
530
  Document as DocumentStrokeIcon,
@@ -572,7 +539,6 @@ Company as CompanyStrokeIcon,
572
539
  ExternalLink as ExternalLinkStrokeIcon,
573
540
  Eye as EyeStrokeIcon,
574
541
  EyeSlash as EyeSlashStrokeIcon,
575
- Filter as FilterStrokeIcon,
576
542
  Fire as FireStrokeIcon,
577
543
  Flag as FlagStrokeIcon,
578
544
  Folder as FolderStrokeIcon,
@@ -583,11 +549,8 @@ Filter as FilterStrokeIcon,
583
549
  Grab as GrabStrokeIcon,
584
550
  HandThumbDown as HandThumbDownStrokeIcon,
585
551
  HandThumbUp as HandThumbUpStrokeIcon,
586
- Heart as HeartStrokeIcon,
587
552
  HeartAlt as HeartAltStrokeIcon,
588
553
  Hexagon as HexagonStrokeIcon,
589
- History as HistoryStrokeIcon,
590
- Home as HomeStrokeIcon,
591
554
  Image as ImageStrokeIcon,
592
555
  InformationCircle as InformationCircleStrokeIcon,
593
556
  Key as KeyStrokeIcon,
@@ -602,7 +565,6 @@ Home as HomeStrokeIcon,
602
565
  Logout as LogoutStrokeIcon,
603
566
  Magic as MagicStrokeIcon,
604
567
  MagnifyingGlass as MagnifyingGlassStrokeIcon,
605
- MarkPen as MarkPenStrokeIcon,
606
568
  Menu as MenuStrokeIcon,
607
569
  More as MoreStrokeIcon,
608
570
  MovingMail as MovingMailStrokeIcon,
@@ -635,7 +597,6 @@ MarkPen as MarkPenStrokeIcon,
635
597
  Template as TemplateStrokeIcon,
636
598
  TestTube as TestTubeStrokeIcon,
637
599
  Time as TimeStrokeIcon,
638
- Translate as TranslateStrokeIcon,
639
600
  Trash as TrashStrokeIcon,
640
601
  Triangle as TriangleStrokeIcon,
641
602
  User as UserStrokeIcon,
@@ -650,15 +611,11 @@ Translate as TranslateStrokeIcon,
650
611
  export {
651
612
  ArrowDownCircleStrokeIcon,
652
613
  ArrowDownOnSquareStrokeIcon,
653
- ArrowDownSStrokeIcon,
654
614
  ArrowDownStrokeIcon,
655
- ArrowLeftSStrokeIcon,
656
615
  ArrowLeftStrokeIcon,
657
616
  ArrowPathStrokeIcon,
658
- ArrowRightSStrokeIcon,
659
617
  ArrowRightStrokeIcon,
660
618
  ArrowUpOnSquareStrokeIcon,
661
- ArrowUpSStrokeIcon,
662
619
  ArrowUpStrokeIcon,
663
620
  AttachmentStrokeIcon,
664
621
  BackspaceStrokeIcon,
@@ -672,8 +629,6 @@ ArrowUpSStrokeIcon,
672
629
  ChatBubbleThoughtStrokeIcon,
673
630
  CheckCircleStrokeIcon,
674
631
  CheckStrokeIcon,
675
- ChevronDoubleLeftStrokeIcon,
676
- ChevronDoubleRightStrokeIcon,
677
632
  ChevronDownStrokeIcon,
678
633
  ChevronLeftStrokeIcon,
679
634
  ChevronRightStrokeIcon,
@@ -690,7 +645,6 @@ ChevronDoubleRightStrokeIcon,
690
645
  Cog6ToothStrokeIcon,
691
646
  CommandLineStrokeIcon,
692
647
  CommandStrokeIcon,
693
- CompanyStrokeIcon,
694
648
  CubeStrokeIcon,
695
649
  DashStrokeIcon,
696
650
  DocumentDuplicateStrokeIcon,
@@ -705,7 +659,6 @@ CompanyStrokeIcon,
705
659
  ExternalLinkStrokeIcon,
706
660
  EyeSlashStrokeIcon,
707
661
  EyeStrokeIcon,
708
- FilterStrokeIcon,
709
662
  FireStrokeIcon,
710
663
  FlagStrokeIcon,
711
664
  FolderOpenStrokeIcon,
@@ -717,10 +670,7 @@ FilterStrokeIcon,
717
670
  HandThumbDownStrokeIcon,
718
671
  HandThumbUpStrokeIcon,
719
672
  HeartAltStrokeIcon,
720
- HeartStrokeIcon,
721
673
  HexagonStrokeIcon,
722
- HistoryStrokeIcon,
723
- HomeStrokeIcon,
724
674
  ImageStrokeIcon,
725
675
  InformationCircleStrokeIcon,
726
676
  KeyStrokeIcon,
@@ -735,7 +685,6 @@ HomeStrokeIcon,
735
685
  LogoutStrokeIcon,
736
686
  MagicStrokeIcon,
737
687
  MagnifyingGlassStrokeIcon,
738
- MarkPenStrokeIcon,
739
688
  MenuStrokeIcon,
740
689
  MoreStrokeIcon,
741
690
  MovingMailStrokeIcon,
@@ -768,7 +717,6 @@ MarkPenStrokeIcon,
768
717
  TemplateStrokeIcon,
769
718
  TestTubeStrokeIcon,
770
719
  TimeStrokeIcon,
771
- TranslateStrokeIcon,
772
720
  TrashStrokeIcon,
773
721
  TriangleStrokeIcon,
774
722
  UserArrowStrokeIcon,
@@ -7,42 +7,23 @@ import { Icon } from "./Icon";
7
7
 
8
8
  export interface CheckboxProps {
9
9
  variant?: "selectable" | "checkable";
10
- size?: "xs" | "sm";
11
- checked?: true | false | "partial";
10
+ checked: boolean;
12
11
  disabled?: boolean;
12
+ partialChecked?: boolean;
13
13
  onChange: (checked: boolean) => void;
14
14
  className?: string;
15
15
  }
16
16
 
17
17
  export function Checkbox({
18
18
  variant = "selectable",
19
- checked = false,
20
- size = "sm",
19
+ checked,
21
20
  onChange,
22
21
  className = "",
23
22
  disabled,
23
+ partialChecked,
24
24
  }: CheckboxProps) {
25
- let isChecked: boolean;
26
- let isPartialChecked: boolean;
27
- switch (checked) {
28
- case true:
29
- isChecked = true;
30
- isPartialChecked = false;
31
- break;
32
- case false:
33
- isChecked = false;
34
- isPartialChecked = false;
35
- break;
36
- case "partial":
37
- isChecked = true;
38
- isPartialChecked = true;
39
- break;
40
- default:
41
- throw new Error("Invalid checked prop");
42
- }
43
-
44
25
  const baseStyleClasses = {
45
- base: "s-border s-justify-center s-flex s-items-center s-transition-colors s-duration-300 s-ease-out",
26
+ base: "s-border s-justify-center s-w-5 s-h-5 s-rounded-md s-flex s-items-center s-transition-colors s-duration-300 s-ease-out",
46
27
  idle: "s-bg-structure-50 s-border-element-600 s-cursor-pointer",
47
28
  hover:
48
29
  "hover:s-border-action-500 hover:s-bg-action-200 hover:s-text-white/100",
@@ -56,11 +37,6 @@ export function Checkbox({
56
37
  },
57
38
  };
58
39
 
59
- const baseSizeClasses = {
60
- xs: "s-w-4 s-h-4 s-rounded",
61
- sm: "s-w-5 s-h-5 s-rounded-md",
62
- };
63
-
64
40
  const checkedIndicatorClasses = {
65
41
  base: "s-transition s-duration-300 s-ease-in-out",
66
42
  selected: "s-opacity-100 s-bg-action-500 dark:s-bg-action-500-dark",
@@ -69,15 +45,9 @@ export function Checkbox({
69
45
  disabled: "s-opacity-100 s-bg-element-500 dark:s-bg-element-500-dark",
70
46
  };
71
47
 
72
- const sizeStyles = {
73
- xs: { width: "12px", height: "12px", borderRadius: "2px" },
74
- sm: { width: "14px", height: "14px", borderRadius: "3px" },
75
- };
76
-
77
48
  const combinedBaseClasses = classNames(
78
49
  baseStyleClasses.base,
79
- baseSizeClasses[size],
80
- isChecked || isPartialChecked ? "s-text-white" : "s-text-white/0",
50
+ checked || partialChecked ? "s-text-white" : "s-text-white/0",
81
51
  disabled ? baseStyleClasses.disabled : baseStyleClasses.idle,
82
52
  !disabled ? baseStyleClasses.hover : "",
83
53
  disabled ? baseStyleClasses.dark.disabled : baseStyleClasses.dark.base,
@@ -88,18 +58,18 @@ export function Checkbox({
88
58
  const combinedCheckedIndicatorClasses = classNames(
89
59
  checkedIndicatorClasses.base,
90
60
  disabled ? checkedIndicatorClasses.disabled : "",
91
- isChecked && !isPartialChecked && !disabled
61
+ checked && !partialChecked && !disabled
92
62
  ? checkedIndicatorClasses.selected
93
63
  : "",
94
- isPartialChecked && !disabled ? checkedIndicatorClasses.partialChecked : "",
95
- !isChecked && !disabled ? checkedIndicatorClasses.unselected : ""
64
+ partialChecked && !disabled ? checkedIndicatorClasses.partialChecked : "",
65
+ !checked && !disabled ? checkedIndicatorClasses.unselected : ""
96
66
  );
97
67
 
98
68
  return (
99
69
  <label>
100
70
  <input
101
71
  type="checkbox"
102
- checked={isChecked}
72
+ checked={checked}
103
73
  onChange={(e) => onChange && onChange(e.target.checked)}
104
74
  className="s-hidden"
105
75
  disabled={disabled}
@@ -107,11 +77,11 @@ export function Checkbox({
107
77
  <div className={classNames(combinedBaseClasses, "s-relative")}>
108
78
  <div
109
79
  className={combinedCheckedIndicatorClasses}
110
- style={sizeStyles[size]}
80
+ style={{ width: "14px", height: "14px", borderRadius: "3px" }}
111
81
  />
112
82
  {variant === "checkable" && (
113
83
  <div className="s-absolute">
114
- <Icon visual={isPartialChecked ? Dash : Check} size="xs" />
84
+ <Icon visual={partialChecked ? Dash : Check} size="xs" />
115
85
  </div>
116
86
  )}
117
87
  </div>
@@ -27,9 +27,9 @@ interface ColumnBreakpoint {
27
27
  [columnId: string]: "xs" | "sm" | "md" | "lg" | "xl";
28
28
  }
29
29
 
30
- interface DataTableProps<TData extends TBaseData, TValue> {
30
+ interface DataTableProps<TData extends TBaseData> {
31
31
  data: TData[];
32
- columns: ColumnDef<TData, TValue>[];
32
+ columns: ColumnDef<TData, any>[]; // eslint-disable-line @typescript-eslint/no-explicit-any
33
33
  className?: string;
34
34
  filter?: string;
35
35
  filterColumn?: string;
@@ -47,7 +47,7 @@ function shouldRenderColumn(
47
47
  return windowWidth >= breakpoints[breakpoint];
48
48
  }
49
49
 
50
- export function DataTable<TData extends TBaseData, TValue>({
50
+ export function DataTable<TData extends TBaseData>({
51
51
  data,
52
52
  columns,
53
53
  className,
@@ -55,7 +55,7 @@ export function DataTable<TData extends TBaseData, TValue>({
55
55
  filterColumn,
56
56
  initialColumnOrder,
57
57
  columnsBreakpoints = {},
58
- }: DataTableProps<TData, TValue>) {
58
+ }: DataTableProps<TData>) {
59
59
  const windowSize = useWindowSize();
60
60
  const [sorting, setSorting] = useState<SortingState>(
61
61
  initialColumnOrder ?? []
@@ -1,6 +1,12 @@
1
- import React, { ComponentType, ReactNode, useState } from "react";
2
-
3
- import { ArrowDownSIcon, ArrowRightSIcon, Spinner } from "@sparkle/index";
1
+ import React, { useState } from "react";
2
+
3
+ import {
4
+ ChatBubbleBottomCenterText,
5
+ DocumentText,
6
+ Folder,
7
+ Square3Stack3D,
8
+ } from "@sparkle/icons/stroke";
9
+ import { ChevronDownIcon, ChevronRightIcon, Spinner } from "@sparkle/index";
4
10
  import { classNames } from "@sparkle/lib/utils";
5
11
 
6
12
  import { Checkbox, CheckboxProps } from "./Checkbox";
@@ -8,25 +14,12 @@ import { Icon } from "./Icon";
8
14
  import { IconButton } from "./IconButton";
9
15
 
10
16
  export interface TreeProps {
11
- children?: ReactNode;
17
+ children?: React.ReactNode;
12
18
  isBoxed?: boolean;
13
19
  isLoading?: boolean;
14
- variant?: "navigator" | "finder";
15
20
  }
16
21
 
17
- export function Tree({
18
- children,
19
- isLoading,
20
- isBoxed = false,
21
- variant = "finder",
22
- }: TreeProps) {
23
- const modifiedChildren = React.Children.map(children, (child) => {
24
- if (React.isValidElement<TreeItemProps>(child) && variant === "navigator") {
25
- return React.cloneElement(child, { isNavigatable: true });
26
- }
27
- return child;
28
- });
29
-
22
+ export function Tree({ children, isLoading, isBoxed = false }: TreeProps) {
30
23
  return isLoading ? (
31
24
  <div className="s-py-2 s-pl-4">
32
25
  <Spinner size="xs" variant="dark" />
@@ -40,16 +33,24 @@ export function Tree({
40
33
  : ""
41
34
  )}
42
35
  >
43
- {modifiedChildren}
36
+ {children}
44
37
  </div>
45
38
  );
46
39
  }
47
40
 
41
+ const visualTable = {
42
+ file: DocumentText,
43
+ folder: Folder,
44
+ database: Square3Stack3D,
45
+ channel: ChatBubbleBottomCenterText,
46
+ };
47
+
48
48
  interface TreeItemProps {
49
49
  label?: string;
50
50
  type?: "node" | "item" | "leaf";
51
+ variant?: "file" | "folder" | "database" | "channel";
51
52
  size?: "sm" | "md";
52
- visual?: ComponentType<{ className?: string }>;
53
+ visual?: React.ReactNode;
53
54
  checkbox?: CheckboxProps;
54
55
  onChevronClick?: () => void;
55
56
  collapsed?: boolean;
@@ -57,7 +58,6 @@ interface TreeItemProps {
57
58
  className?: string;
58
59
  actions?: React.ReactNode;
59
60
  areActionsFading?: boolean;
60
- isNavigatable?: boolean;
61
61
  isSelected?: boolean;
62
62
  onItemClick?: () => void;
63
63
  }
@@ -76,6 +76,7 @@ Tree.Item = function ({
76
76
  label,
77
77
  type = "node",
78
78
  className = "",
79
+ variant = "file",
79
80
  size = "sm",
80
81
  visual,
81
82
  checkbox,
@@ -86,7 +87,6 @@ Tree.Item = function ({
86
87
  areActionsFading = true,
87
88
  renderTreeItems,
88
89
  children,
89
- isNavigatable = false,
90
90
  isSelected = false,
91
91
  onItemClick,
92
92
  }: TreeItemPropsWithChildren | TreeItemPropsWithRender) {
@@ -111,34 +111,16 @@ Tree.Item = function ({
111
111
 
112
112
  const childrenToRender = getChildren();
113
113
 
114
- const treeItemStyleClasses = {
115
- base: "s-group s-flex s-cursor-default s-flex-row s-items-center",
116
- isNavigatableBase:
117
- "s-border s-transition-colors s-duration-300 s-ease-out s-cursor-pointer",
118
- isNavigatableUnselected:
119
- "s-border-structure-200/0 s-bg-white/0 hover:s-border-structure-200 hover:s-bg-white",
120
- isNavigatableSelected: "s-border-structure-200 s-bg-white",
121
- };
122
-
123
114
  return (
124
115
  <>
125
116
  <div
126
117
  className={classNames(
127
118
  className ? className : "",
128
- treeItemStyleClasses.base,
119
+ "s-group s-flex s-cursor-default s-flex-row s-items-center s-gap-4",
120
+ size === "sm" ? "s-py-1" : "s-py-2",
129
121
  onItemClick ? "s-cursor-pointer" : "",
130
- isNavigatable ? treeItemStyleClasses.isNavigatableBase : "",
131
- isNavigatable
132
- ? size === "sm"
133
- ? "s-gap-1 s-rounded-lg s-py-1 s-pl-1.5 s-pr-3"
134
- : "s-gap-2 s-rounded-lg s-py-2 s-pl-2.5 s-pr-4"
135
- : size === "sm"
136
- ? "s-gap-1 s-py-1"
137
- : "s-gap-2 s-py-2",
138
- isNavigatable
139
- ? isSelected
140
- ? treeItemStyleClasses.isNavigatableSelected
141
- : treeItemStyleClasses.isNavigatableUnselected
122
+ isSelected
123
+ ? "s-rounded-md s-border s-border-neutral-200 s-bg-white"
142
124
  : ""
143
125
  )}
144
126
  onClick={onItemClick ? onItemClick : undefined}
@@ -147,10 +129,10 @@ Tree.Item = function ({
147
129
  <IconButton
148
130
  icon={
149
131
  childrenToRender && !effectiveCollapsed
150
- ? ArrowDownSIcon
151
- : ArrowRightSIcon
132
+ ? ChevronDownIcon
133
+ : ChevronRightIcon
152
134
  }
153
- size="xs"
135
+ size="sm"
154
136
  variant="secondary"
155
137
  onClick={(e) => {
156
138
  e.stopPropagation();
@@ -161,37 +143,50 @@ Tree.Item = function ({
161
143
  />
162
144
  )}
163
145
  {type === "leaf" && <div className="s-w-5"></div>}
164
- {checkbox && <Checkbox {...checkbox} size="xs" />}
165
- <Icon
166
- visual={visual}
167
- size={size === "sm" ? "sm" : "md"}
168
- className="s-flex-shrink-0 s-text-element-600"
169
- />
170
-
171
- <div
172
- className={classNames(
173
- "s-truncate s-font-medium s-text-element-900",
174
- size === "sm" ? "s-ml-1 s-text-sm" : "s-ml-1 s-text-base"
175
- )}
176
- >
177
- {label}
178
- </div>
179
- <div className="s-grow" />
180
- {actions && (
146
+ {checkbox && <Checkbox {...checkbox} />}
147
+
148
+ <div className="s-flex s-w-full s-items-center">
181
149
  <div
182
150
  className={classNames(
183
- "s-flex s-gap-2 s-pl-4",
184
- areActionsFading
185
- ? "s-transform s-opacity-0 s-duration-300 group-hover:s-opacity-100"
186
- : ""
151
+ "s-grid s-w-full s-grid-cols-[auto,1fr,auto] s-items-center",
152
+ size === "sm" ? "s-gap-1.5" : "s-gap-2"
187
153
  )}
188
154
  >
189
- {actions}
155
+ {visual ? (
156
+ visual
157
+ ) : (
158
+ <Icon
159
+ visual={visualTable[variant]}
160
+ size="sm"
161
+ className="s-flex-shrink-0 s-text-element-700"
162
+ />
163
+ )}
164
+
165
+ <div
166
+ className={classNames(
167
+ "s-truncate s-font-medium s-text-element-900",
168
+ size === "sm" ? "s-text-sm" : "s-text-base"
169
+ )}
170
+ >
171
+ {label}
172
+ </div>
173
+ {actions && (
174
+ <div
175
+ className={classNames(
176
+ "s-inline-block s-pl-5",
177
+ areActionsFading
178
+ ? "s-transform s-opacity-0 s-duration-300 group-hover:s-opacity-100"
179
+ : ""
180
+ )}
181
+ >
182
+ {actions}
183
+ </div>
184
+ )}
190
185
  </div>
191
- )}
186
+ </div>
192
187
  </div>
193
188
  {React.Children.count(childrenToRender) > 0 && (
194
- <div className="s-pl-2.5">{childrenToRender}</div>
189
+ <div className="s-pl-5">{childrenToRender}</div>
195
190
  )}
196
191
  </>
197
192
  );