@enigmax/primitives 0.22.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 (67) 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-WSQC3PCC.js +466 -0
  12. package/dist/context-menu-D3FtTn7v.d.ts +174 -0
  13. package/dist/{index-BHpOZncw.d.ts → index-DQNnohoo.d.ts} +1 -1
  14. package/dist/index.d.ts +5 -1
  15. package/dist/index.js +8 -4
  16. package/dist/keys-D2zJs1uB.d.ts +100 -0
  17. package/dist/next/index.d.ts +9 -2
  18. package/dist/next/index.js +20 -13
  19. package/dist/react/context-menu.d.ts +202 -0
  20. package/dist/react/context-menu.js +6 -0
  21. package/dist/react/index.d.ts +10 -3
  22. package/dist/react/index.js +19 -12
  23. package/dist/react/input.d.ts +2 -2
  24. package/dist/react/input.js +1 -1
  25. package/dist/react/palette.d.ts +1 -1
  26. package/dist/react/palette.js +3 -3
  27. package/dist/react/search.d.ts +1 -1
  28. package/dist/react/search.js +2 -2
  29. package/dist/react/select.d.ts +217 -0
  30. package/dist/react/select.js +7 -0
  31. package/dist/react/selection.d.ts +104 -0
  32. package/dist/react/selection.js +4 -0
  33. package/dist/react-router/index.d.ts +9 -2
  34. package/dist/react-router/index.js +20 -13
  35. package/dist/search/index.d.ts +2 -2
  36. package/dist/search/index.js +1 -1
  37. package/dist/{search-BD9-5O5U.d.ts → search-DYgqRp37.d.ts} +13 -1
  38. package/dist/{search-UQEXAPQB.js → search-PBZORZ7P.js} +1 -1
  39. package/dist/select-ClSy-J1f.d.ts +100 -0
  40. package/dist/selection-B_pmzHpy.d.ts +150 -0
  41. package/package.json +21 -2
  42. package/recipes/context-menu/styles.css +177 -0
  43. package/recipes/input/styles.css +9 -0
  44. package/recipes/palette/styles.css +3 -0
  45. package/recipes/search/tailwind.tsx +3 -2
  46. package/recipes/select/styles.css +230 -0
  47. package/recipes/toast/styles.css +1 -1
  48. package/registry.json +358 -1
  49. package/src/core/context-menu.ts +694 -0
  50. package/src/core/keys.ts +264 -0
  51. package/src/core/search.ts +19 -0
  52. package/src/core/select.ts +404 -0
  53. package/src/core/selection.ts +648 -0
  54. package/src/index.ts +60 -1
  55. package/src/react/context-menu/context.ts +57 -0
  56. package/src/react/context-menu/index.tsx +94 -0
  57. package/src/react/context-menu/root.tsx +846 -0
  58. package/src/react/context-menu/styles.ts +186 -0
  59. package/src/react/index.ts +68 -1
  60. package/src/react/palette/root.tsx +2 -2
  61. package/src/react/select/context.ts +56 -0
  62. package/src/react/select/index.tsx +96 -0
  63. package/src/react/select/root.tsx +839 -0
  64. package/src/react/select/styles.ts +238 -0
  65. package/src/react/selection/index.tsx +115 -0
  66. package/src/react/selection/use-selection.ts +260 -0
  67. /package/dist/{chunk-U3V4EHOB.js → chunk-3HDEZ2E7.js} +0 -0
@@ -2,7 +2,7 @@
2
2
  * The toast stylesheet.
3
3
  *
4
4
  * GENERATED from src/react/toast/styles.ts by scripts/sync-recipes.mjs - edit that file, not
5
- * this one. It exists as a stylesheet as well as a string because <Toaster /> injects it,
5
+ * this one. It exists as a stylesheet as well as a string because the component injects it,
6
6
  * and this is the same sheet for anyone who would rather import it, copy it with
7
7
  * `enigma add toast --copy`, or fork it outright.
8
8
  */
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",