panelui-native 0.46.0 → 0.51.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.
Files changed (87) hide show
  1. package/README.md +12 -1
  2. package/lib/module/components/accordion/index.js +32 -4
  3. package/lib/module/components/accordion/index.js.map +1 -1
  4. package/lib/module/components/button/index.js +83 -15
  5. package/lib/module/components/button/index.js.map +1 -1
  6. package/lib/module/components/button-group/index.js +186 -0
  7. package/lib/module/components/button-group/index.js.map +1 -0
  8. package/lib/module/components/color-picker/index.js +110 -1
  9. package/lib/module/components/color-picker/index.js.map +1 -1
  10. package/lib/module/components/date-time-picker/index.js +23 -5
  11. package/lib/module/components/date-time-picker/index.js.map +1 -1
  12. package/lib/module/components/fab/index.js +514 -0
  13. package/lib/module/components/fab/index.js.map +1 -0
  14. package/lib/module/components/markdown-editor/index.js +406 -0
  15. package/lib/module/components/markdown-editor/index.js.map +1 -0
  16. package/lib/module/components/markdown-editor/markdown-transforms.js +243 -0
  17. package/lib/module/components/markdown-editor/markdown-transforms.js.map +1 -0
  18. package/lib/module/components/questionnaire/index.js +1312 -0
  19. package/lib/module/components/questionnaire/index.js.map +1 -0
  20. package/lib/module/components/sortable/index.js +806 -0
  21. package/lib/module/components/sortable/index.js.map +1 -0
  22. package/lib/module/components/swipe/index.js +140 -5
  23. package/lib/module/components/swipe/index.js.map +1 -1
  24. package/lib/module/components/tabs/index.js +94 -18
  25. package/lib/module/components/tabs/index.js.map +1 -1
  26. package/lib/module/components/time-picker/index.js +34 -6
  27. package/lib/module/components/time-picker/index.js.map +1 -1
  28. package/lib/module/components/tree/index.js +500 -0
  29. package/lib/module/components/tree/index.js.map +1 -0
  30. package/lib/module/icons/index.js +246 -0
  31. package/lib/module/icons/index.js.map +1 -1
  32. package/lib/module/index.js +8 -2
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/utils/haptics.js +19 -0
  35. package/lib/module/utils/haptics.js.map +1 -1
  36. package/lib/typescript/src/components/accordion/index.d.ts +21 -0
  37. package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
  38. package/lib/typescript/src/components/button/index.d.ts +21 -0
  39. package/lib/typescript/src/components/button/index.d.ts.map +1 -1
  40. package/lib/typescript/src/components/button-group/index.d.ts +212 -0
  41. package/lib/typescript/src/components/button-group/index.d.ts.map +1 -0
  42. package/lib/typescript/src/components/color-picker/index.d.ts +82 -1
  43. package/lib/typescript/src/components/color-picker/index.d.ts.map +1 -1
  44. package/lib/typescript/src/components/date-time-picker/index.d.ts +7 -1
  45. package/lib/typescript/src/components/date-time-picker/index.d.ts.map +1 -1
  46. package/lib/typescript/src/components/fab/index.d.ts +285 -0
  47. package/lib/typescript/src/components/fab/index.d.ts.map +1 -0
  48. package/lib/typescript/src/components/markdown-editor/index.d.ts +102 -0
  49. package/lib/typescript/src/components/markdown-editor/index.d.ts.map +1 -0
  50. package/lib/typescript/src/components/markdown-editor/markdown-transforms.d.ts +76 -0
  51. package/lib/typescript/src/components/markdown-editor/markdown-transforms.d.ts.map +1 -0
  52. package/lib/typescript/src/components/questionnaire/index.d.ts +336 -0
  53. package/lib/typescript/src/components/questionnaire/index.d.ts.map +1 -0
  54. package/lib/typescript/src/components/sortable/index.d.ts +238 -0
  55. package/lib/typescript/src/components/sortable/index.d.ts.map +1 -0
  56. package/lib/typescript/src/components/swipe/index.d.ts +35 -0
  57. package/lib/typescript/src/components/swipe/index.d.ts.map +1 -1
  58. package/lib/typescript/src/components/tabs/index.d.ts +9 -0
  59. package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
  60. package/lib/typescript/src/components/time-picker/index.d.ts +19 -1
  61. package/lib/typescript/src/components/time-picker/index.d.ts.map +1 -1
  62. package/lib/typescript/src/components/tree/index.d.ts +125 -0
  63. package/lib/typescript/src/components/tree/index.d.ts.map +1 -0
  64. package/lib/typescript/src/icons/index.d.ts +30 -0
  65. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  66. package/lib/typescript/src/index.d.ts +10 -4
  67. package/lib/typescript/src/index.d.ts.map +1 -1
  68. package/lib/typescript/src/utils/haptics.d.ts +14 -0
  69. package/lib/typescript/src/utils/haptics.d.ts.map +1 -1
  70. package/package.json +1 -1
  71. package/src/components/accordion/index.tsx +48 -6
  72. package/src/components/button/index.tsx +97 -15
  73. package/src/components/button-group/index.tsx +199 -0
  74. package/src/components/color-picker/index.tsx +140 -3
  75. package/src/components/date-time-picker/index.tsx +39 -3
  76. package/src/components/fab/index.tsx +583 -0
  77. package/src/components/markdown-editor/index.tsx +526 -0
  78. package/src/components/markdown-editor/markdown-transforms.ts +228 -0
  79. package/src/components/questionnaire/index.tsx +1615 -0
  80. package/src/components/sortable/index.tsx +1080 -0
  81. package/src/components/swipe/index.tsx +165 -3
  82. package/src/components/tabs/index.tsx +100 -28
  83. package/src/components/time-picker/index.tsx +42 -6
  84. package/src/components/tree/index.tsx +564 -0
  85. package/src/icons/index.tsx +176 -0
  86. package/src/index.ts +89 -1
  87. package/src/utils/haptics.ts +21 -0
@@ -665,6 +665,160 @@ export function FileIcon({ size = 16, color, ...props }: IconProps) {
665
665
  );
666
666
  }
667
667
 
668
+ /* ------------------------------------------------------------------ *
669
+ * Text formatting. Drawn as the letterforms and marks an editor's
670
+ * toolbar uses, rather than as pictures of them — a B that is a bold B
671
+ * is read before it is recognised.
672
+ * ------------------------------------------------------------------ */
673
+
674
+ /** Bold — the two-bowled B. */
675
+ export function BoldIcon({ size = 16, color, ...props }: IconProps) {
676
+ const resolved = useResolvedColor(color, '#737373');
677
+ return (
678
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
679
+ <Path
680
+ d="M6 4h8a4 4 0 0 1 0 8H6zM6 12h9a4 4 0 0 1 0 8H6z"
681
+ stroke={resolved}
682
+ strokeWidth={2}
683
+ strokeLinecap="round"
684
+ strokeLinejoin="round"
685
+ />
686
+ </Svg>
687
+ );
688
+ }
689
+
690
+ /** Italic — a slanted stroke between its serifs. */
691
+ export function ItalicIcon({ size = 16, color, ...props }: IconProps) {
692
+ const resolved = useResolvedColor(color, '#737373');
693
+ return (
694
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
695
+ <Path
696
+ d="M19 4h-9M14 20H5M15 4 9 20"
697
+ stroke={resolved}
698
+ strokeWidth={2}
699
+ strokeLinecap="round"
700
+ strokeLinejoin="round"
701
+ />
702
+ </Svg>
703
+ );
704
+ }
705
+
706
+ /** Heading — the crossbar H. */
707
+ export function HeadingIcon({ size = 16, color, ...props }: IconProps) {
708
+ const resolved = useResolvedColor(color, '#737373');
709
+ return (
710
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
711
+ <Path
712
+ d="M6 12h12M6 20V4M18 20V4"
713
+ stroke={resolved}
714
+ strokeWidth={2}
715
+ strokeLinecap="round"
716
+ strokeLinejoin="round"
717
+ />
718
+ </Svg>
719
+ );
720
+ }
721
+
722
+ /** Bulleted list — three rules, each behind a dot. */
723
+ export function ListIcon({ size = 16, color, ...props }: IconProps) {
724
+ const resolved = useResolvedColor(color, '#737373');
725
+ return (
726
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
727
+ <Path
728
+ d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"
729
+ stroke={resolved}
730
+ strokeWidth={2}
731
+ strokeLinecap="round"
732
+ strokeLinejoin="round"
733
+ />
734
+ </Svg>
735
+ );
736
+ }
737
+
738
+ /** Numbered list — the same rules, counted. */
739
+ export function ListOrderedIcon({ size = 16, color, ...props }: IconProps) {
740
+ const resolved = useResolvedColor(color, '#737373');
741
+ return (
742
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
743
+ <Path
744
+ d="M10 6h11M10 12h11M10 18h11M4 4h1v4M4 8h2M6 15a1.5 1.5 0 1 0-2-1.4M4 17l2-2M4 17h2"
745
+ stroke={resolved}
746
+ strokeWidth={2}
747
+ strokeLinecap="round"
748
+ strokeLinejoin="round"
749
+ />
750
+ </Svg>
751
+ );
752
+ }
753
+
754
+ /** Block quote — the rule a quoted passage is set behind. */
755
+ export function QuoteIcon({ size = 16, color, ...props }: IconProps) {
756
+ const resolved = useResolvedColor(color, '#737373');
757
+ return (
758
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
759
+ <Path
760
+ d="M4 5v14M9 7h11M9 12h11M9 17h7"
761
+ stroke={resolved}
762
+ strokeWidth={2}
763
+ strokeLinecap="round"
764
+ strokeLinejoin="round"
765
+ />
766
+ </Svg>
767
+ );
768
+ }
769
+
770
+ /** Code — the pair of angle brackets. */
771
+ export function CodeIcon({ size = 16, color, ...props }: IconProps) {
772
+ const resolved = useResolvedColor(color, '#737373');
773
+ return (
774
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
775
+ <Path
776
+ d="m8 18-6-6 6-6M16 6l6 6-6 6"
777
+ stroke={resolved}
778
+ strokeWidth={2}
779
+ strokeLinecap="round"
780
+ strokeLinejoin="round"
781
+ />
782
+ </Svg>
783
+ );
784
+ }
785
+
786
+ /** Closed folder with a tab — a branch nobody has opened yet. */
787
+ export function FolderIcon({ size = 16, color, ...props }: IconProps) {
788
+ const resolved = useResolvedColor(color, '#737373');
789
+ return (
790
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
791
+ <Path
792
+ d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z"
793
+ stroke={resolved}
794
+ strokeWidth={2}
795
+ strokeLinecap="round"
796
+ strokeLinejoin="round"
797
+ />
798
+ </Svg>
799
+ );
800
+ }
801
+
802
+ /**
803
+ * Folder tipped open, its front face sheared to the side — the same branch
804
+ * once it is expanded. Drawn as a separate glyph rather than a rotation of
805
+ * `FolderIcon`, because a folder that opens by spinning reads as a mistake.
806
+ */
807
+ export function FolderOpenIcon({ size = 16, color, ...props }: IconProps) {
808
+ const resolved = useResolvedColor(color, '#737373');
809
+ return (
810
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
811
+ <Path
812
+ d="M6 14l1.45-2.9A2 2 0 0 1 9.24 10H22a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H18a2 2 0 0 1 2 2v2"
813
+ stroke={resolved}
814
+ strokeWidth={2}
815
+ strokeLinecap="round"
816
+ strokeLinejoin="round"
817
+ />
818
+ </Svg>
819
+ );
820
+ }
821
+
668
822
  /** Framed picture with a sun and a corner peak — an image attachment. */
669
823
  export function ImageIcon({ size = 16, color, ...props }: IconProps) {
670
824
  const resolved = useResolvedColor(color, '#737373');
@@ -837,6 +991,28 @@ export function TrashIcon({ size = 16, color, ...props }: IconProps) {
837
991
  );
838
992
  }
839
993
 
994
+ /**
995
+ * Two columns of dots — the grip on a row that can be dragged somewhere else.
996
+ *
997
+ * Dots rather than the stacked rules of a menu glyph, and two columns rather
998
+ * than one: the pattern has to read as a surface to take hold of from either
999
+ * side, and a single column reads as a divider instead.
1000
+ */
1001
+ export function GripVerticalIcon({ size = 16, color, ...props }: IconProps) {
1002
+ const resolved = useResolvedColor(color, '#737373');
1003
+ return (
1004
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
1005
+ <Path
1006
+ d="M9 5h.01M9 12h.01M9 19h.01M15 5h.01M15 12h.01M15 19h.01"
1007
+ stroke={resolved}
1008
+ strokeWidth={2.5}
1009
+ strokeLinecap="round"
1010
+ strokeLinejoin="round"
1011
+ />
1012
+ </Svg>
1013
+ );
1014
+ }
1015
+
840
1016
  /** An arrow into a tray — save the thing to a file. */
841
1017
  export function DownloadIcon({ size = 16, color, ...props }: IconProps) {
842
1018
  const resolved = useResolvedColor(color, '#737373');
package/src/index.ts CHANGED
@@ -124,7 +124,17 @@ export {
124
124
  type BreadcrumbSeparatorProps,
125
125
  type BreadcrumbEllipsisProps,
126
126
  } from './components/breadcrumb';
127
- export { Button, type ButtonProps } from './components/button';
127
+ export {
128
+ Button,
129
+ type ButtonProps,
130
+ type ButtonVariant,
131
+ type ButtonSize,
132
+ } from './components/button';
133
+ export {
134
+ ButtonGroup,
135
+ type ButtonGroupProps,
136
+ type ButtonGroupOrientation,
137
+ } from './components/button-group';
128
138
  export {
129
139
  ToggleButton,
130
140
  ToggleButtonGroup,
@@ -164,6 +174,15 @@ export {
164
174
  type DirectionProps,
165
175
  type DirectionValue,
166
176
  } from './components/direction';
177
+ export {
178
+ Fab,
179
+ type FabProps,
180
+ type FabGroupProps,
181
+ type FabActionProps,
182
+ type FabPlacement,
183
+ type FabSize,
184
+ type FabVariant,
185
+ } from './components/fab';
167
186
  export {
168
187
  Flow,
169
188
  type FlowProps,
@@ -339,6 +358,8 @@ export {
339
358
  export {
340
359
  ColorPicker,
341
360
  type ColorPickerProps,
361
+ type ColorPickerTriggerProps,
362
+ type ColorPickerContentProps,
342
363
  type ColorPickerFieldProps,
343
364
  type ColorPickerAreaProps,
344
365
  type ColorPickerWheelProps,
@@ -350,6 +371,7 @@ export {
350
371
  type ColorPickerPreviewProps,
351
372
  type ColorPickerSwatchesProps,
352
373
  type ColorPickerSize,
374
+ type ColorPickerPresentation,
353
375
  } from './components/color-picker';
354
376
  export {
355
377
  Combobox,
@@ -526,6 +548,17 @@ export {
526
548
  type LoaderVariant,
527
549
  type LoaderSize,
528
550
  } from './components/loader';
551
+ export {
552
+ MarkdownEditor,
553
+ type MarkdownEditorProps,
554
+ type MarkdownEditorToolbarProps,
555
+ type MarkdownEditorInputProps,
556
+ type MarkdownEditorPreviewProps,
557
+ type MarkdownEditorMode,
558
+ type MarkdownEditorAction,
559
+ type EditorSelection,
560
+ type EditResult,
561
+ } from './components/markdown-editor';
529
562
  export {
530
563
  Marker,
531
564
  type MarkerProps,
@@ -600,6 +633,28 @@ export {
600
633
  type PostVote,
601
634
  } from './components/post';
602
635
  export { Progress, type ProgressProps } from './components/progress';
636
+ export {
637
+ Questionnaire,
638
+ type QuestionnaireProps,
639
+ type QuestionnaireTitleProps,
640
+ type QuestionnaireProgressProps,
641
+ type QuestionnaireProgressState,
642
+ type QuestionnaireProgressVariant,
643
+ type QuestionnaireItemProps,
644
+ type QuestionnaireQuestionProps,
645
+ type QuestionnaireDescriptionProps,
646
+ type QuestionnaireChoicesProps,
647
+ type QuestionnaireChoiceProps,
648
+ type QuestionnaireInputProps,
649
+ type QuestionnaireErrorProps,
650
+ type QuestionnaireFooterProps,
651
+ type QuestionnaireActionProps,
652
+ type QuestionnaireActionState,
653
+ type QuestionnaireAnswers,
654
+ type QuestionnaireItemDefinition,
655
+ type QuestionnaireItemStatus,
656
+ type QuestionnaireShortcutMode,
657
+ } from './components/questionnaire';
603
658
  export {
604
659
  RadioGroup,
605
660
  type RadioGroupProps,
@@ -741,6 +796,16 @@ export {
741
796
  } from './components/thinking-orb';
742
797
  export { Skeleton, type SkeletonProps } from './components/skeleton';
743
798
  export { Slider, type SliderProps } from './components/slider';
799
+ export {
800
+ Sortable,
801
+ reorderItems,
802
+ useSortableItem,
803
+ type SortableProps,
804
+ type SortableItemProps,
805
+ type SortableHandleProps,
806
+ type SortableActivation,
807
+ type SortableReorderDetails,
808
+ } from './components/sortable';
744
809
  export { Spinner, type SpinnerProps } from './components/spinner';
745
810
  export {
746
811
  Steps,
@@ -755,7 +820,9 @@ export {
755
820
  export { Surface, type SurfaceProps } from './components/surface';
756
821
  export {
757
822
  Swipe,
823
+ useSwipeGroup,
758
824
  type SwipeProps,
825
+ type SwipeGroupProps,
759
826
  type SwipePanelProps,
760
827
  type SwipeActionProps,
761
828
  type SwipeActionColor,
@@ -792,6 +859,18 @@ export {
792
859
  type ToastIndicatorProps,
793
860
  type ToastCloseProps,
794
861
  } from './components/toast';
862
+ export {
863
+ Tree,
864
+ type TreeProps,
865
+ type TreeItemProps,
866
+ type TreeTriggerProps,
867
+ type TreeIndicatorProps,
868
+ type TreeIconProps,
869
+ type TreeActionsProps,
870
+ type TreeGroupProps,
871
+ type TreeSize,
872
+ type TreeSelectionMode,
873
+ } from './components/tree';
795
874
  export {
796
875
  Tooltip,
797
876
  type TooltipProps,
@@ -824,6 +903,7 @@ export {
824
903
  BadgeCheckIcon,
825
904
  BellIcon,
826
905
  BookmarkIcon,
906
+ BoldIcon,
827
907
  CalendarIcon,
828
908
  CardIcon,
829
909
  CheckCircleIcon,
@@ -833,6 +913,7 @@ export {
833
913
  ChevronRightIcon,
834
914
  ChevronUpIcon,
835
915
  CircleIcon,
916
+ CodeIcon,
836
917
  ClockIcon,
837
918
  CompassIcon,
838
919
  CopyIcon,
@@ -842,14 +923,20 @@ export {
842
923
  EyeIcon,
843
924
  FacebookIcon,
844
925
  FileIcon,
926
+ FolderIcon,
927
+ FolderOpenIcon,
845
928
  GoogleIcon,
846
929
  HeartIcon,
930
+ HeadingIcon,
847
931
  IconColorProvider,
848
932
  InfoIcon,
933
+ ItalicIcon,
849
934
  ImageIcon,
850
935
  KeyboardIcon,
851
936
  LinkIcon,
937
+ ListIcon,
852
938
  ListChecksIcon,
939
+ ListOrderedIcon,
853
940
  LockIcon,
854
941
  MaximizeIcon,
855
942
  MenuIcon,
@@ -864,6 +951,7 @@ export {
864
951
  PlayIcon,
865
952
  PlusIcon,
866
953
  PlusSquareIcon,
954
+ QuoteIcon,
867
955
  ReceiptIcon,
868
956
  RepeatIcon,
869
957
  RotateCcwIcon,
@@ -61,3 +61,24 @@ export function hasHaptics(): boolean {
61
61
  export function selectionTick(): void {
62
62
  void getHaptics()?.selectionAsync().catch(() => {});
63
63
  }
64
+
65
+ /**
66
+ * The knock for a thing coming loose or landing — a row lifted out of a list,
67
+ * a card dropped into place.
68
+ *
69
+ * An impact rather than a selection because it marks a change of state rather
70
+ * than a change of value: the finger is now holding something it was not
71
+ * holding a moment ago, and the lightest feedback is not enough to say so.
72
+ * `medium` is the one that reads as picking something up without reading as an
73
+ * error.
74
+ *
75
+ * Falls back to a selection tick where the style constants are missing, and to
76
+ * nothing at all where the package is.
77
+ */
78
+ export function impactKnock(): void {
79
+ const haptics = getHaptics();
80
+ if (!haptics) return;
81
+ void haptics
82
+ .impactAsync(haptics.ImpactFeedbackStyle?.Medium)
83
+ .catch(() => {});
84
+ }