@enigmax/primitives 0.21.0 → 0.23.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 (83) hide show
  1. package/dist/chunk-3BQVOOAM.js +388 -0
  2. package/dist/{chunk-QQFNAKMY.js → chunk-45UHLZYT.js} +1 -1
  3. package/dist/chunk-4VUHQFAT.js +130 -0
  4. package/dist/{chunk-D5A2ZMAG.js → chunk-4ZPMP47J.js} +6 -1
  5. package/dist/chunk-DSBYVA7V.js +713 -0
  6. package/dist/{chunk-FWVWX67R.js → chunk-FGBIZDV2.js} +3 -3
  7. package/dist/{chunk-R4ZAEE7V.js → chunk-KEVZ5XQV.js} +1 -1
  8. package/dist/chunk-N6PDHMAX.js +213 -0
  9. package/dist/chunk-NONGREXC.js +248 -0
  10. package/dist/chunk-VKL3DEIQ.js +804 -0
  11. package/dist/chunk-WPTBURIC.js +1627 -0
  12. package/dist/chunk-WSQC3PCC.js +466 -0
  13. package/dist/context-menu-D3FtTn7v.d.ts +174 -0
  14. package/dist/{index-dTdAbOWl.d.ts → index-DQNnohoo.d.ts} +1 -1
  15. package/dist/index.d.ts +5 -1
  16. package/dist/index.js +8 -4
  17. package/dist/keys-D2zJs1uB.d.ts +100 -0
  18. package/dist/next/index.d.ts +12 -5
  19. package/dist/next/index.js +21 -14
  20. package/dist/react/button.d.ts +2 -2
  21. package/dist/react/context-menu.d.ts +202 -0
  22. package/dist/react/context-menu.js +6 -0
  23. package/dist/react/index.d.ts +11 -4
  24. package/dist/react/index.js +20 -13
  25. package/dist/react/input.d.ts +2 -2
  26. package/dist/react/input.js +1 -1
  27. package/dist/react/palette.d.ts +1 -1
  28. package/dist/react/palette.js +3 -3
  29. package/dist/react/search.d.ts +1 -1
  30. package/dist/react/search.js +2 -2
  31. package/dist/react/select.d.ts +217 -0
  32. package/dist/react/select.js +7 -0
  33. package/dist/react/selection.d.ts +104 -0
  34. package/dist/react/selection.js +4 -0
  35. package/dist/react/slot.d.ts +2 -2
  36. package/dist/react/toast.d.ts +165 -32
  37. package/dist/react/toast.js +1 -1
  38. package/dist/react-router/index.d.ts +12 -5
  39. package/dist/react-router/index.js +21 -14
  40. package/dist/search/index.d.ts +2 -2
  41. package/dist/search/index.js +1 -1
  42. package/dist/{search-DXxY8SEH.d.ts → search-DYgqRp37.d.ts} +20 -3
  43. package/dist/{search-UQEXAPQB.js → search-PBZORZ7P.js} +1 -1
  44. package/dist/select-ClSy-J1f.d.ts +100 -0
  45. package/dist/selection-B_pmzHpy.d.ts +150 -0
  46. package/package.json +21 -2
  47. package/recipes/context-menu/styles.css +177 -0
  48. package/recipes/input/styles.css +9 -0
  49. package/recipes/palette/styles.css +3 -0
  50. package/recipes/search/tailwind.tsx +3 -2
  51. package/recipes/select/styles.css +230 -0
  52. package/recipes/toast/styles.css +688 -192
  53. package/registry.json +434 -29
  54. package/src/core/context-menu.ts +694 -0
  55. package/src/core/keys.ts +264 -0
  56. package/src/core/search.ts +25 -1
  57. package/src/core/select.ts +404 -0
  58. package/src/core/selection.ts +648 -0
  59. package/src/index.ts +60 -1
  60. package/src/react/context-menu/context.ts +57 -0
  61. package/src/react/context-menu/index.tsx +94 -0
  62. package/src/react/context-menu/root.tsx +846 -0
  63. package/src/react/context-menu/styles.ts +186 -0
  64. package/src/react/index.ts +70 -2
  65. package/src/react/palette/root.tsx +2 -2
  66. package/src/react/select/context.ts +56 -0
  67. package/src/react/select/index.tsx +96 -0
  68. package/src/react/select/root.tsx +839 -0
  69. package/src/react/select/styles.ts +238 -0
  70. package/src/react/selection/index.tsx +115 -0
  71. package/src/react/selection/use-selection.ts +260 -0
  72. package/src/react/toast/NOTICE +20 -0
  73. package/src/react/toast/assets.tsx +85 -0
  74. package/src/react/toast/cn.ts +10 -0
  75. package/src/react/toast/hooks.ts +13 -0
  76. package/src/react/toast/index.tsx +736 -0
  77. package/src/react/toast/state.ts +207 -0
  78. package/src/react/toast/styles.ts +738 -0
  79. package/src/react/toast/types.ts +193 -0
  80. package/src/react/toaster.tsx +76 -341
  81. package/dist/chunk-JCCL7XKC.js +0 -465
  82. package/src/react/toast-styles.ts +0 -247
  83. /package/dist/{chunk-U3V4EHOB.js → chunk-3HDEZ2E7.js} +0 -0
package/registry.json CHANGED
@@ -454,6 +454,13 @@
454
454
  "react"
455
455
  ]
456
456
  },
457
+ {
458
+ "path": "src/react/slot.tsx",
459
+ "dest": "button/slot.tsx",
460
+ "targets": [
461
+ "react"
462
+ ]
463
+ },
457
464
  {
458
465
  "path": "src/react/button.tsx",
459
466
  "dest": "button/index.tsx",
@@ -464,7 +471,8 @@
464
471
  "rewrite": {
465
472
  "@/core/button": "./button",
466
473
  "@/react/use-button": "./use-button",
467
- "@/react/link": "./link"
474
+ "@/react/link": "./link",
475
+ "@/react/slot": "./slot"
468
476
  }
469
477
  }
470
478
  ],
@@ -585,6 +593,355 @@
585
593
  "css"
586
594
  ]
587
595
  },
596
+ {
597
+ "name": "select",
598
+ "title": "Select",
599
+ "description": "A listbox that replaces the native select: icons and a second line on an option, rows that cannot be chosen, one value or many with removable tags, groups, a filter that appears on its own once the list is long enough (fuzzy with Fuse.js, plain without it), typeahead and the full keyboard, a hidden field so a plain form still posts it, and a long list rendered a window at a time. It brings its own theme - an unstyled popup is transparent text over the page rather than a plain-looking control.",
600
+ "targets": [
601
+ "react"
602
+ ],
603
+ "entry": {
604
+ "react": "@enigmax/primitives/react/select"
605
+ },
606
+ "exports": {
607
+ "react": [
608
+ "Select",
609
+ "useSelectContext",
610
+ "createSelect"
611
+ ]
612
+ },
613
+ "files": [
614
+ {
615
+ "path": "src/core/search.ts",
616
+ "dest": "select/search-core.ts",
617
+ "targets": [
618
+ "react"
619
+ ]
620
+ },
621
+ {
622
+ "path": "src/core/palette.ts",
623
+ "dest": "select/rows.ts",
624
+ "targets": [
625
+ "react"
626
+ ]
627
+ },
628
+ {
629
+ "path": "src/core/keys.ts",
630
+ "dest": "select/keys.ts",
631
+ "targets": [
632
+ "react"
633
+ ]
634
+ },
635
+ {
636
+ "path": "src/core/select.ts",
637
+ "dest": "select/select.ts",
638
+ "targets": [
639
+ "react"
640
+ ],
641
+ "rewrite": {
642
+ "@/core/search": "./search-core",
643
+ "@/core/keys": "./keys"
644
+ }
645
+ },
646
+ {
647
+ "path": "src/react/slot.tsx",
648
+ "dest": "select/slot.tsx",
649
+ "targets": [
650
+ "react"
651
+ ]
652
+ },
653
+ {
654
+ "path": "src/react/select/styles.ts",
655
+ "dest": "select/styles.ts",
656
+ "targets": [
657
+ "react"
658
+ ]
659
+ },
660
+ {
661
+ "path": "recipes/select/styles.css",
662
+ "dest": "select/styles.css",
663
+ "targets": [
664
+ "react"
665
+ ],
666
+ "style": "css"
667
+ },
668
+ {
669
+ "path": "src/react/select/context.ts",
670
+ "dest": "select/context.ts",
671
+ "targets": [
672
+ "react"
673
+ ],
674
+ "rewrite": {
675
+ "@/core/select": "./select"
676
+ }
677
+ },
678
+ {
679
+ "path": "src/react/select/root.tsx",
680
+ "dest": "select/root.tsx",
681
+ "targets": [
682
+ "react"
683
+ ],
684
+ "rewrite": {
685
+ "@/core/select": "./select",
686
+ "@/core/palette": "./rows",
687
+ "@/core/search": "./search-core",
688
+ "@/react/slot": "./slot",
689
+ "@/react/select/styles": "./styles",
690
+ "@/react/select/context": "./context"
691
+ }
692
+ },
693
+ {
694
+ "path": "src/react/select/index.tsx",
695
+ "dest": "select/index.tsx",
696
+ "main": true,
697
+ "targets": [
698
+ "react"
699
+ ],
700
+ "rewrite": {
701
+ "@/react/select/root": "./root",
702
+ "@/react/select/context": "./context",
703
+ "@/react/select/styles": "./styles",
704
+ "@/core/select": "./select"
705
+ }
706
+ }
707
+ ],
708
+ "styles": true,
709
+ "themeHooks": [
710
+ "[data-enigma-select-root]",
711
+ "[data-enigma-select-trigger]",
712
+ "[data-enigma-select-trigger][data-open]",
713
+ "[data-enigma-select-value][data-placeholder]",
714
+ "[data-enigma-select-tag]",
715
+ "[data-enigma-select-tag-remove]",
716
+ "[data-enigma-select-indicator]",
717
+ "[data-enigma-select-caret]",
718
+ "[data-enigma-select-clear]",
719
+ "[data-enigma-select-content]",
720
+ "[data-enigma-select-content][data-side=top]",
721
+ "[data-enigma-select-search]",
722
+ "[data-enigma-select-list]",
723
+ "[data-enigma-select-group-label]",
724
+ "[data-enigma-select-option]",
725
+ "[data-enigma-select-option][data-active]",
726
+ "[data-enigma-select-option][data-selected]",
727
+ "[data-enigma-select-option][data-disabled]",
728
+ "[data-enigma-select-option-label]",
729
+ "[data-enigma-select-option-description]",
730
+ "[data-enigma-select-icon]",
731
+ "[data-enigma-select-check]",
732
+ "[data-enigma-select-empty]"
733
+ ],
734
+ "docs": "docs/notes/primitives.md#select",
735
+ "recipes": [
736
+ "css"
737
+ ]
738
+ },
739
+ {
740
+ "name": "context-menu",
741
+ "title": "Context menu",
742
+ "description": "A right-click menu with the desktop's behaviour: submenus that open on a beat of hovering and survive a diagonal pointer, icons, a second line, shortcuts printed on the right, checkable and radio rows, separators and captions, destructive rows in red, an optional heading naming what it acts on, a filter once a level is long, a long level rendered a window at a time, and a submenu fetched on demand and cached. Opens at the pointer, on a long press, and on Shift+F10. A menu with no rows does not open at all. It brings its own theme - an unstyled popup is transparent text over the page rather than a plain-looking control.",
743
+ "targets": [
744
+ "react"
745
+ ],
746
+ "entry": {
747
+ "react": "@enigmax/primitives/react/context-menu"
748
+ },
749
+ "exports": {
750
+ "react": [
751
+ "ContextMenu",
752
+ "useContextMenuContext",
753
+ "createContextMenu"
754
+ ]
755
+ },
756
+ "files": [
757
+ {
758
+ "path": "src/core/search.ts",
759
+ "dest": "context-menu/search-core.ts",
760
+ "targets": [
761
+ "react"
762
+ ]
763
+ },
764
+ {
765
+ "path": "src/core/keys.ts",
766
+ "dest": "context-menu/keys.ts",
767
+ "targets": [
768
+ "react"
769
+ ]
770
+ },
771
+ {
772
+ "path": "src/core/context-menu.ts",
773
+ "dest": "context-menu/context-menu.ts",
774
+ "targets": [
775
+ "react"
776
+ ],
777
+ "rewrite": {
778
+ "@/core/search": "./search-core",
779
+ "@/core/keys": "./keys"
780
+ }
781
+ },
782
+ {
783
+ "path": "src/react/slot.tsx",
784
+ "dest": "context-menu/slot.tsx",
785
+ "targets": [
786
+ "react"
787
+ ]
788
+ },
789
+ {
790
+ "path": "src/react/context-menu/styles.ts",
791
+ "dest": "context-menu/styles.ts",
792
+ "targets": [
793
+ "react"
794
+ ]
795
+ },
796
+ {
797
+ "path": "recipes/context-menu/styles.css",
798
+ "dest": "context-menu/styles.css",
799
+ "targets": [
800
+ "react"
801
+ ],
802
+ "style": "css"
803
+ },
804
+ {
805
+ "path": "src/react/context-menu/context.ts",
806
+ "dest": "context-menu/context.ts",
807
+ "targets": [
808
+ "react"
809
+ ],
810
+ "rewrite": {
811
+ "@/core/context-menu": "./context-menu"
812
+ }
813
+ },
814
+ {
815
+ "path": "src/react/context-menu/root.tsx",
816
+ "dest": "context-menu/root.tsx",
817
+ "targets": [
818
+ "react"
819
+ ],
820
+ "rewrite": {
821
+ "@/core/context-menu": "./context-menu",
822
+ "@/core/search": "./search-core",
823
+ "@/core/keys": "./keys",
824
+ "@/react/slot": "./slot",
825
+ "@/react/context-menu/styles": "./styles",
826
+ "@/react/context-menu/context": "./context"
827
+ }
828
+ },
829
+ {
830
+ "path": "src/react/context-menu/index.tsx",
831
+ "dest": "context-menu/index.tsx",
832
+ "main": true,
833
+ "targets": [
834
+ "react"
835
+ ],
836
+ "rewrite": {
837
+ "@/react/context-menu/root": "./root",
838
+ "@/react/context-menu/context": "./context",
839
+ "@/react/context-menu/styles": "./styles",
840
+ "@/core/context-menu": "./context-menu",
841
+ "@/core/keys": "./keys"
842
+ }
843
+ }
844
+ ],
845
+ "styles": true,
846
+ "themeHooks": [
847
+ "[data-enigma-menu-trigger]",
848
+ "[data-enigma-menu-panel]",
849
+ "[data-enigma-menu-panel][data-placed]",
850
+ "[data-enigma-menu-title]",
851
+ "[data-enigma-menu-search]",
852
+ "[data-enigma-menu-list]",
853
+ "[data-enigma-menu-item]",
854
+ "[data-enigma-menu-item][data-active]",
855
+ "[data-enigma-menu-item][data-disabled]",
856
+ "[data-enigma-menu-item][data-destructive]",
857
+ "[data-enigma-menu-item][data-submenu]",
858
+ "[data-enigma-menu-item-label]",
859
+ "[data-enigma-menu-item-description]",
860
+ "[data-enigma-menu-icon]",
861
+ "[data-enigma-menu-shortcut]",
862
+ "[data-enigma-menu-arrow]",
863
+ "[data-enigma-menu-check]",
864
+ "[data-enigma-menu-separator]",
865
+ "[data-enigma-menu-label]",
866
+ "[data-enigma-menu-status]",
867
+ "[data-enigma-menu-status][data-error]"
868
+ ],
869
+ "docs": "docs/notes/primitives.md#context-menu",
870
+ "recipes": [
871
+ "css"
872
+ ]
873
+ },
874
+ {
875
+ "name": "selection",
876
+ "title": "Selection list",
877
+ "description": "The file-manager selection model as a headless list: a plain click replaces, Ctrl toggles, Shift takes the range from the anchor, Ctrl+Shift adds that range, Ctrl+A takes everything and Escape drops it, with a rubber band over empty space and arrow keys that move a cursor and extend with Shift. Delete, F2, Enter, copy, cut and paste are reported as commands rather than performed. Every binding can be rebound, removed one at a time, or turned off altogether, and a binding of your own is matched and reported the same way. Ships no styles: state arrives as data attributes.",
878
+ "targets": [
879
+ "react"
880
+ ],
881
+ "entry": {
882
+ "react": "@enigmax/primitives/react/selection"
883
+ },
884
+ "exports": {
885
+ "react": [
886
+ "SelectionList",
887
+ "useSelection",
888
+ "createSelection"
889
+ ]
890
+ },
891
+ "files": [
892
+ {
893
+ "path": "src/core/keys.ts",
894
+ "dest": "selection/keys.ts",
895
+ "targets": [
896
+ "react"
897
+ ]
898
+ },
899
+ {
900
+ "path": "src/core/selection.ts",
901
+ "dest": "selection/selection.ts",
902
+ "targets": [
903
+ "react"
904
+ ],
905
+ "rewrite": {
906
+ "@/core/keys": "./keys"
907
+ }
908
+ },
909
+ {
910
+ "path": "src/react/selection/use-selection.ts",
911
+ "dest": "selection/use-selection.ts",
912
+ "targets": [
913
+ "react"
914
+ ],
915
+ "rewrite": {
916
+ "@/core/selection": "./selection"
917
+ }
918
+ },
919
+ {
920
+ "path": "src/react/selection/index.tsx",
921
+ "dest": "selection/index.tsx",
922
+ "main": true,
923
+ "targets": [
924
+ "react"
925
+ ],
926
+ "rewrite": {
927
+ "@/react/selection/use-selection": "./use-selection",
928
+ "@/core/selection": "./selection",
929
+ "@/core/keys": "./keys"
930
+ }
931
+ }
932
+ ],
933
+ "styles": false,
934
+ "themeHooks": [
935
+ "[data-enigma-selection-list]",
936
+ "[data-enigma-selection-item]",
937
+ "[data-enigma-selection-item][data-selected]",
938
+ "[data-enigma-selection-item][data-cursor]",
939
+ "[data-enigma-selection-item][data-disabled]",
940
+ "[data-enigma-selection-marquee]",
941
+ "[data-enigma-selection-empty]"
942
+ ],
943
+ "docs": "docs/notes/primitives.md#selection"
944
+ },
588
945
  {
589
946
  "name": "flags",
590
947
  "title": "Country flags",
@@ -721,6 +1078,7 @@
721
1078
  "exports": {
722
1079
  "react": [
723
1080
  "Toaster",
1081
+ "toast",
724
1082
  "useNotifications"
725
1083
  ]
726
1084
  },
@@ -743,16 +1101,60 @@
743
1101
  }
744
1102
  },
745
1103
  {
746
- "path": "src/react/toaster.tsx",
747
- "dest": "toast/index.tsx",
748
- "main": true,
1104
+ "path": "src/react/toast/types.ts",
1105
+ "dest": "toast/vendor/types.ts",
749
1106
  "targets": [
750
1107
  "react"
751
- ],
752
- "rewrite": {
753
- "@/core/notifications": "./notifications",
754
- "@/react/use-notifications": "./use-notifications"
755
- }
1108
+ ]
1109
+ },
1110
+ {
1111
+ "path": "src/react/toast/hooks.ts",
1112
+ "dest": "toast/vendor/hooks.ts",
1113
+ "targets": [
1114
+ "react"
1115
+ ]
1116
+ },
1117
+ {
1118
+ "path": "src/react/toast/cn.ts",
1119
+ "dest": "toast/vendor/cn.ts",
1120
+ "targets": [
1121
+ "react"
1122
+ ]
1123
+ },
1124
+ {
1125
+ "path": "src/react/toast/assets.tsx",
1126
+ "dest": "toast/vendor/assets.tsx",
1127
+ "targets": [
1128
+ "react"
1129
+ ]
1130
+ },
1131
+ {
1132
+ "path": "src/react/toast/state.ts",
1133
+ "dest": "toast/vendor/state.ts",
1134
+ "targets": [
1135
+ "react"
1136
+ ]
1137
+ },
1138
+ {
1139
+ "path": "src/react/toast/styles.ts",
1140
+ "dest": "toast/vendor/styles.ts",
1141
+ "targets": [
1142
+ "react"
1143
+ ]
1144
+ },
1145
+ {
1146
+ "path": "src/react/toast/index.tsx",
1147
+ "dest": "toast/vendor/index.tsx",
1148
+ "targets": [
1149
+ "react"
1150
+ ]
1151
+ },
1152
+ {
1153
+ "path": "src/react/toast/NOTICE",
1154
+ "dest": "toast/vendor/NOTICE",
1155
+ "targets": [
1156
+ "react"
1157
+ ]
756
1158
  },
757
1159
  {
758
1160
  "path": "recipes/toast/styles.css",
@@ -763,35 +1165,38 @@
763
1165
  "style": "css"
764
1166
  },
765
1167
  {
766
- "path": "recipes/toast/tailwind.tsx",
767
- "dest": "toast/AppToaster.tsx",
1168
+ "path": "src/react/toaster.tsx",
1169
+ "dest": "toast/index.tsx",
1170
+ "main": true,
768
1171
  "targets": [
769
1172
  "react"
770
1173
  ],
771
- "style": "tailwind",
772
1174
  "rewrite": {
773
- "@enigmax/utils/react": "./index"
1175
+ "@/react/toast/styles": "./vendor/styles",
1176
+ "@/react/toast/state": "./vendor/state",
1177
+ "@/react/toast/index": "./vendor/index",
1178
+ "@/react/toast/types": "./vendor/types",
1179
+ "@/react/use-notifications": "./use-notifications",
1180
+ "@/core/notifications": "./notifications"
774
1181
  }
775
1182
  }
776
1183
  ],
777
1184
  "styles": true,
778
1185
  "themeHooks": [
779
- "[data-enigma-toaster]",
780
- "[data-enigma-toaster][data-position]",
781
- "[data-enigma-toaster][data-expanded]",
782
- "[data-enigma-toast]",
783
- "[data-enigma-toast][data-tone=error]",
784
- "[data-enigma-toast][data-front]",
785
- "[data-enigma-toast][data-mounted]",
786
- "[data-enigma-toast][data-state=leaving]",
787
- "[data-enigma-toast][data-swiping]",
788
- "[data-enigma-toast][data-hidden]",
789
- "[data-enigma-toast-icon]",
790
- "[data-enigma-toast-content]",
791
- "[data-enigma-toast-title]",
792
- "[data-enigma-toast-body]",
793
- "[data-enigma-toast-action]",
794
- "[data-enigma-toast-close]"
1186
+ "[data-toastcmp-toaster]",
1187
+ "[data-toastcmp-toaster][data-theme]",
1188
+ "[data-toastcmp-toaster][data-lifted]",
1189
+ "[data-toastcmp-toast]",
1190
+ "[data-toastcmp-toast][data-type=error]",
1191
+ "[data-toastcmp-toast][data-front]",
1192
+ "[data-toastcmp-toast][data-mounted]",
1193
+ "[data-toastcmp-toast][data-removed]",
1194
+ "[data-toastcmp-toast][data-swiping]",
1195
+ "[data-title]",
1196
+ "[data-description]",
1197
+ "[data-button]",
1198
+ "[data-close-button]",
1199
+ "[data-icon]"
795
1200
  ],
796
1201
  "docs": "docs/notes/primitives.md#toast",
797
1202
  "recipes": [