@nuxt/ui 2.8.1 → 2.9.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 (103) hide show
  1. package/README.md +1 -0
  2. package/dist/module.d.mts +1147 -1096
  3. package/dist/module.d.ts +1147 -1096
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +35 -10
  6. package/dist/runtime/components/data/Table.vue +42 -29
  7. package/dist/runtime/components/data/Table.vue.d.ts +20 -13
  8. package/dist/runtime/components/elements/Accordion.vue +25 -22
  9. package/dist/runtime/components/elements/Accordion.vue.d.ts +21 -17
  10. package/dist/runtime/components/elements/Alert.vue +22 -18
  11. package/dist/runtime/components/elements/Alert.vue.d.ts +26 -19
  12. package/dist/runtime/components/elements/Avatar.vue +22 -16
  13. package/dist/runtime/components/elements/Avatar.vue.d.ts +28 -19
  14. package/dist/runtime/components/elements/AvatarGroup.d.ts +17 -8
  15. package/dist/runtime/components/elements/AvatarGroup.mjs +18 -13
  16. package/dist/runtime/components/elements/Badge.vue +21 -17
  17. package/dist/runtime/components/elements/Badge.vue.d.ts +28 -19
  18. package/dist/runtime/components/elements/Button.vue +22 -18
  19. package/dist/runtime/components/elements/Button.vue.d.ts +26 -17
  20. package/dist/runtime/components/elements/ButtonGroup.d.ts +17 -8
  21. package/dist/runtime/components/elements/ButtonGroup.mjs +22 -15
  22. package/dist/runtime/components/elements/Dropdown.vue +15 -13
  23. package/dist/runtime/components/elements/Dropdown.vue.d.ts +20 -17
  24. package/dist/runtime/components/elements/Kbd.vue +16 -12
  25. package/dist/runtime/components/elements/Kbd.vue.d.ts +20 -12
  26. package/dist/runtime/components/elements/Link.vue +18 -5
  27. package/dist/runtime/components/forms/Checkbox.vue +27 -17
  28. package/dist/runtime/components/forms/Checkbox.vue.d.ts +33 -15
  29. package/dist/runtime/components/forms/Form.vue +2 -2
  30. package/dist/runtime/components/forms/FormGroup.vue +51 -27
  31. package/dist/runtime/components/forms/FormGroup.vue.d.ts +23 -15
  32. package/dist/runtime/components/forms/Input.vue +36 -28
  33. package/dist/runtime/components/forms/Input.vue.d.ts +41 -23
  34. package/dist/runtime/components/forms/Radio.vue +27 -17
  35. package/dist/runtime/components/forms/Radio.vue.d.ts +35 -17
  36. package/dist/runtime/components/forms/Range.vue +26 -16
  37. package/dist/runtime/components/forms/Range.vue.d.ts +36 -17
  38. package/dist/runtime/components/forms/Select.vue +34 -26
  39. package/dist/runtime/components/forms/Select.vue.d.ts +42 -24
  40. package/dist/runtime/components/forms/SelectMenu.vue +43 -33
  41. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +49 -30
  42. package/dist/runtime/components/forms/Textarea.vue +38 -30
  43. package/dist/runtime/components/forms/Textarea.vue.d.ts +41 -23
  44. package/dist/runtime/components/forms/Toggle.vue +26 -15
  45. package/dist/runtime/components/forms/Toggle.vue.d.ts +31 -12
  46. package/dist/runtime/components/layout/Card.vue +15 -10
  47. package/dist/runtime/components/layout/Card.vue.d.ts +17 -9
  48. package/dist/runtime/components/layout/Container.vue +15 -10
  49. package/dist/runtime/components/layout/Container.vue.d.ts +17 -9
  50. package/dist/runtime/components/layout/Skeleton.vue +15 -10
  51. package/dist/runtime/components/layout/Skeleton.vue.d.ts +17 -9
  52. package/dist/runtime/components/navigation/CommandPalette.vue +50 -38
  53. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +23 -22
  54. package/dist/runtime/components/navigation/CommandPaletteGroup.vue +1 -1
  55. package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +3 -4
  56. package/dist/runtime/components/navigation/Pagination.vue +64 -55
  57. package/dist/runtime/components/navigation/Pagination.vue.d.ts +29 -22
  58. package/dist/runtime/components/navigation/Tabs.vue +16 -13
  59. package/dist/runtime/components/navigation/Tabs.vue.d.ts +18 -11
  60. package/dist/runtime/components/navigation/VerticalNavigation.vue +15 -13
  61. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +20 -16
  62. package/dist/runtime/components/overlays/ContextMenu.vue +14 -9
  63. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +18 -10
  64. package/dist/runtime/components/overlays/Modal.vue +15 -13
  65. package/dist/runtime/components/overlays/Modal.vue.d.ts +17 -10
  66. package/dist/runtime/components/overlays/Notification.vue +18 -14
  67. package/dist/runtime/components/overlays/Notification.vue.d.ts +25 -19
  68. package/dist/runtime/components/overlays/Notifications.vue +18 -12
  69. package/dist/runtime/components/overlays/Notifications.vue.d.ts +22 -14
  70. package/dist/runtime/components/overlays/Popover.vue +18 -16
  71. package/dist/runtime/components/overlays/Popover.vue.d.ts +18 -11
  72. package/dist/runtime/components/overlays/Slideover.vue +15 -13
  73. package/dist/runtime/components/overlays/Slideover.vue.d.ts +17 -10
  74. package/dist/runtime/components/overlays/Tooltip.vue +15 -13
  75. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +18 -11
  76. package/dist/runtime/composables/useFormGroup.d.ts +12 -2
  77. package/dist/runtime/composables/useFormGroup.mjs +10 -4
  78. package/dist/runtime/composables/usePopper.mjs +40 -30
  79. package/dist/runtime/composables/useToast.d.ts +3 -3
  80. package/dist/runtime/composables/useUI.d.ts +10 -0
  81. package/dist/runtime/composables/useUI.mjs +24 -0
  82. package/dist/runtime/types/avatar.d.ts +10 -4
  83. package/dist/runtime/types/badge.d.ts +14 -0
  84. package/dist/runtime/types/button.d.ts +10 -3
  85. package/dist/runtime/types/command-palette.d.ts +2 -1
  86. package/dist/runtime/types/form.d.ts +8 -1
  87. package/dist/runtime/types/index.d.ts +2 -0
  88. package/dist/runtime/types/link.d.ts +1 -0
  89. package/dist/runtime/types/notification.d.ts +5 -3
  90. package/dist/runtime/types/tabs.d.ts +1 -0
  91. package/dist/runtime/types/utils.d.ts +11 -0
  92. package/dist/runtime/ui.config.d.ts +1207 -0
  93. package/dist/runtime/{app.config.mjs → ui.config.mjs} +52 -80
  94. package/dist/runtime/utils/index.d.ts +5 -11
  95. package/dist/runtime/utils/index.mjs +21 -9
  96. package/dist/runtime/utils/lodash.d.ts +2 -0
  97. package/dist/runtime/utils/lodash.mjs +23 -0
  98. package/dist/runtime/utils/uid.d.ts +1 -0
  99. package/dist/runtime/utils/uid.mjs +4 -0
  100. package/dist/types.d.mts +1 -1
  101. package/dist/types.d.ts +1 -1
  102. package/package.json +19 -21
  103. package/dist/runtime/app.config.d.ts +0 -1203
@@ -1,4 +1,4 @@
1
- const table = {
1
+ export const table = {
2
2
  wrapper: "relative overflow-x-auto",
3
3
  base: "min-w-full table-fixed",
4
4
  divide: "divide-y divide-gray-300 dark:divide-gray-700",
@@ -23,6 +23,9 @@ const table = {
23
23
  font: "",
24
24
  size: "text-sm"
25
25
  },
26
+ checkbox: {
27
+ padding: "ps-4"
28
+ },
26
29
  loadingState: {
27
30
  wrapper: "flex flex-col items-center justify-center flex-1 px-6 py-14 sm:px-14",
28
31
  label: "text-sm text-center text-gray-900 dark:text-white",
@@ -54,7 +57,7 @@ const table = {
54
57
  }
55
58
  }
56
59
  };
57
- const avatar = {
60
+ export const avatar = {
58
61
  wrapper: "relative inline-flex items-center justify-center flex-shrink-0",
59
62
  background: "bg-gray-100 dark:bg-gray-800",
60
63
  rounded: "rounded-full",
@@ -113,12 +116,12 @@ const avatar = {
113
116
  chipPosition: "top-right"
114
117
  }
115
118
  };
116
- const avatarGroup = {
117
- wrapper: "flex flex-row-reverse justify-end",
119
+ export const avatarGroup = {
120
+ wrapper: "inline-flex flex-row-reverse justify-end",
118
121
  ring: "ring-2 ring-white dark:ring-gray-900",
119
122
  margin: "-me-1.5 first:me-0"
120
123
  };
121
- const badge = {
124
+ export const badge = {
122
125
  base: "inline-flex items-center",
123
126
  rounded: "rounded-md",
124
127
  font: "font-medium",
@@ -151,7 +154,7 @@ const badge = {
151
154
  color: "primary"
152
155
  }
153
156
  };
154
- const button = {
157
+ export const button = {
155
158
  base: "focus:outline-none focus-visible:outline-0 disabled:cursor-not-allowed disabled:opacity-75 flex-shrink-0",
156
159
  font: "font-medium",
157
160
  rounded: "rounded-md",
@@ -227,12 +230,15 @@ const button = {
227
230
  loadingIcon: "i-heroicons-arrow-path-20-solid"
228
231
  }
229
232
  };
230
- const buttonGroup = {
231
- wrapper: "inline-flex -space-x-px",
233
+ export const buttonGroup = {
234
+ wrapper: {
235
+ horizontal: "inline-flex -space-x-px",
236
+ vertical: "inline-flex flex-col -space-y-px"
237
+ },
232
238
  rounded: "rounded-md",
233
239
  shadow: "shadow-sm"
234
240
  };
235
- const dropdown = {
241
+ export const dropdown = {
236
242
  wrapper: "relative inline-flex text-left rtl:text-right",
237
243
  container: "z-20",
238
244
  width: "w-48",
@@ -277,7 +283,7 @@ const dropdown = {
277
283
  strategy: "fixed"
278
284
  }
279
285
  };
280
- const accordion = {
286
+ export const accordion = {
281
287
  wrapper: "w-full flex flex-col",
282
288
  item: {
283
289
  base: "",
@@ -297,7 +303,7 @@ const accordion = {
297
303
  variant: "soft"
298
304
  }
299
305
  };
300
- const alert = {
306
+ export const alert = {
301
307
  wrapper: "w-full relative overflow-hidden",
302
308
  title: "text-sm font-medium",
303
309
  description: "mt-1 text-sm leading-4 opacity-90",
@@ -334,7 +340,7 @@ const alert = {
334
340
  }
335
341
  }
336
342
  };
337
- const kbd = {
343
+ export const kbd = {
338
344
  base: "inline-flex items-center justify-center text-gray-900 dark:text-white",
339
345
  padding: "px-1",
340
346
  size: {
@@ -350,7 +356,7 @@ const kbd = {
350
356
  size: "sm"
351
357
  }
352
358
  };
353
- const input = {
359
+ export const input = {
354
360
  wrapper: "relative",
355
361
  base: "relative block w-full disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none border-0",
356
362
  rounded: "rounded-md",
@@ -454,7 +460,7 @@ const input = {
454
460
  loadingIcon: "i-heroicons-arrow-path-20-solid"
455
461
  }
456
462
  };
457
- const formGroup = {
463
+ export const formGroup = {
458
464
  wrapper: "",
459
465
  label: {
460
466
  wrapper: "flex content-center items-center justify-between",
@@ -474,9 +480,12 @@ const formGroup = {
474
480
  description: "text-gray-500 dark:text-gray-400",
475
481
  hint: "text-gray-500 dark:text-gray-400",
476
482
  help: "mt-2 text-gray-500 dark:text-gray-400",
477
- error: "mt-2 text-red-500 dark:text-red-400"
483
+ error: "mt-2 text-red-500 dark:text-red-400",
484
+ default: {
485
+ size: "sm"
486
+ }
478
487
  };
479
- const textarea = {
488
+ export const textarea = {
480
489
  ...input,
481
490
  default: {
482
491
  size: "sm",
@@ -484,7 +493,7 @@ const textarea = {
484
493
  variant: "outline"
485
494
  }
486
495
  };
487
- const select = {
496
+ export const select = {
488
497
  ...input,
489
498
  placeholder: "text-gray-900 dark:text-white",
490
499
  default: {
@@ -495,7 +504,7 @@ const select = {
495
504
  trailingIcon: "i-heroicons-chevron-down-20-solid"
496
505
  }
497
506
  };
498
- const selectMenu = {
507
+ export const selectMenu = {
499
508
  container: "z-20",
500
509
  width: "w-full",
501
510
  height: "max-h-60",
@@ -549,7 +558,7 @@ const selectMenu = {
549
558
  selectedIcon: "i-heroicons-check-20-solid"
550
559
  }
551
560
  };
552
- const radio = {
561
+ export const radio = {
553
562
  wrapper: "relative flex items-start",
554
563
  base: "h-4 w-4 dark:checked:bg-current dark:checked:border-transparent disabled:opacity-50 disabled:cursor-not-allowed focus:ring-0 focus:ring-transparent focus:ring-offset-transparent",
555
564
  color: "text-{color}-500 dark:text-{color}-400",
@@ -563,7 +572,7 @@ const radio = {
563
572
  color: "primary"
564
573
  }
565
574
  };
566
- const checkbox = {
575
+ export const checkbox = {
567
576
  wrapper: "relative flex items-start",
568
577
  base: "h-4 w-4 dark:checked:bg-current dark:checked:border-transparent dark:indeterminate:bg-current dark:indeterminate:border-transparent disabled:opacity-50 disabled:cursor-not-allowed focus:ring-0 focus:ring-transparent focus:ring-offset-transparent",
569
578
  rounded: "rounded",
@@ -578,7 +587,7 @@ const checkbox = {
578
587
  color: "primary"
579
588
  }
580
589
  };
581
- const toggle = {
590
+ export const toggle = {
582
591
  base: "relative inline-flex h-5 w-9 flex-shrink-0 border-2 border-transparent disabled:cursor-not-allowed disabled:opacity-50 focus:outline-none",
583
592
  rounded: "rounded-full",
584
593
  ring: "focus-visible:ring-2 focus-visible:ring-{color}-500 dark:focus-visible:ring-{color}-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900",
@@ -602,7 +611,7 @@ const toggle = {
602
611
  color: "primary"
603
612
  }
604
613
  };
605
- const range = {
614
+ export const range = {
606
615
  wrapper: "relative w-full flex items-center",
607
616
  base: "w-full absolute appearance-none cursor-pointer disabled:cursor-not-allowed disabled:bg-opacity-50 focus:outline-none peer group",
608
617
  rounded: "rounded-lg",
@@ -630,13 +639,13 @@ const range = {
630
639
  }
631
640
  },
632
641
  track: {
633
- base: "[&::-webkit-slider-runnable-track]:group-disabled:bg-opacity-50 [&::-moz-slider-runnable-track]:group-disabled:bg-opacity-50",
634
- background: "[&::-webkit-slider-runnable-track]:bg-gray-200 [&::-moz-slider-runnable-track]:bg-gray-200 [&::-webkit-slider-runnable-track]:dark:bg-gray-700 [&::-moz-slider-runnable-track]:dark:bg-gray-700",
635
- rounded: "[&::-webkit-slider-runnable-track]:rounded-lg [&::-moz-slider-runnable-track]:rounded-lg",
642
+ base: "[&::-webkit-slider-runnable-track]:group-disabled:bg-opacity-50 [&::-moz-range-track]:group-disabled:bg-opacity-50",
643
+ background: "[&::-webkit-slider-runnable-track]:bg-gray-200 [&::-moz-range-track]:bg-gray-200 [&::-webkit-slider-runnable-track]:dark:bg-gray-700 [&::-moz-range-track]:dark:bg-gray-700",
644
+ rounded: "[&::-webkit-slider-runnable-track]:rounded-lg [&::-moz-range-track]:rounded-lg",
636
645
  size: {
637
- sm: "[&::-webkit-slider-runnable-track]:h-1 [&::-moz-slider-runnable-track]:h-1",
638
- md: "[&::-webkit-slider-runnable-track]:h-2 [&::-moz-slider-runnable-track]:h-2",
639
- lg: "[&::-webkit-slider-runnable-track]:h-3 [&::-moz-slider-runnable-track]:h-3"
646
+ sm: "[&::-webkit-slider-runnable-track]:h-1 [&::-moz-range-track]:h-1",
647
+ md: "[&::-webkit-slider-runnable-track]:h-2 [&::-moz-range-track]:h-2",
648
+ lg: "[&::-webkit-slider-runnable-track]:h-3 [&::-moz-range-track]:h-3"
640
649
  }
641
650
  },
642
651
  size: {
@@ -649,7 +658,7 @@ const range = {
649
658
  color: "primary"
650
659
  }
651
660
  };
652
- const card = {
661
+ export const card = {
653
662
  base: "overflow-hidden",
654
663
  background: "bg-white dark:bg-gray-900",
655
664
  divide: "divide-y divide-gray-200 dark:divide-gray-800",
@@ -672,17 +681,17 @@ const card = {
672
681
  padding: "px-4 py-4 sm:px-6"
673
682
  }
674
683
  };
675
- const container = {
684
+ export const container = {
676
685
  base: "mx-auto",
677
686
  padding: "px-4 sm:px-6 lg:px-8",
678
687
  constrained: "max-w-7xl"
679
688
  };
680
- const skeleton = {
689
+ export const skeleton = {
681
690
  base: "animate-pulse",
682
691
  background: "bg-gray-100 dark:bg-gray-800",
683
692
  rounded: "rounded-md"
684
693
  };
685
- const verticalNavigation = {
694
+ export const verticalNavigation = {
686
695
  wrapper: "relative",
687
696
  base: "group relative flex items-center gap-2 focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-1 focus-visible:before:ring-primary-500 dark:focus-visible:before:ring-primary-400 before:absolute before:inset-px before:rounded-md disabled:cursor-not-allowed disabled:opacity-75",
688
697
  ring: "focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400",
@@ -709,7 +718,7 @@ const verticalNavigation = {
709
718
  inactive: "bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white group-hover:bg-white dark:group-hover:bg-gray-900"
710
719
  }
711
720
  };
712
- const commandPalette = {
721
+ export const commandPalette = {
713
722
  wrapper: "flex flex-col flex-1 min-h-0 divide-y divide-gray-100 dark:divide-gray-800",
714
723
  container: "relative flex-1 overflow-y-auto divide-y divide-gray-100 dark:divide-gray-800 scroll-py-2",
715
724
  input: {
@@ -776,7 +785,7 @@ const commandPalette = {
776
785
  selectedIcon: "i-heroicons-check-20-solid"
777
786
  }
778
787
  };
779
- const pagination = {
788
+ export const pagination = {
780
789
  wrapper: "flex items-center -space-x-px",
781
790
  base: "",
782
791
  rounded: "first:rounded-s-md last:rounded-e-md",
@@ -800,7 +809,7 @@ const pagination = {
800
809
  }
801
810
  }
802
811
  };
803
- const tabs = {
812
+ export const tabs = {
804
813
  wrapper: "relative space-y-2",
805
814
  container: "relative w-full",
806
815
  base: "focus:outline-none",
@@ -820,7 +829,7 @@ const tabs = {
820
829
  shadow: "shadow-sm"
821
830
  },
822
831
  tab: {
823
- base: "relative inline-flex items-center justify-center flex-shrink-0 w-full whitespace-nowrap focus:outline-none disabled:cursor-not-allowed disabled:opacity-75 transition-colors duration-200 ease-out",
832
+ base: "relative inline-flex items-center justify-center flex-shrink-0 w-full whitespace-nowrap ui-focus-visible:outline-0 ui-focus-visible:ring-2 ui-focus-visible:ring-primary-500 dark:ui-focus-visible:ring-primary-400 ui-not-focus-visible:outline-none focus:outline-none disabled:cursor-not-allowed disabled:opacity-75 transition-colors duration-200 ease-out",
824
833
  background: "",
825
834
  active: "text-gray-900 dark:text-white",
826
835
  inactive: "text-gray-500 dark:text-gray-400",
@@ -833,7 +842,7 @@ const tabs = {
833
842
  }
834
843
  }
835
844
  };
836
- const modal = {
845
+ export const modal = {
837
846
  wrapper: "relative z-50",
838
847
  inner: "fixed inset-0 overflow-y-auto",
839
848
  container: "flex min-h-full items-end sm:items-center justify-center text-center",
@@ -869,7 +878,7 @@ const modal = {
869
878
  leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
870
879
  }
871
880
  };
872
- const slideover = {
881
+ export const slideover = {
873
882
  wrapper: "fixed inset-0 flex z-50",
874
883
  overlay: {
875
884
  base: "fixed inset-0 transition-opacity",
@@ -897,7 +906,7 @@ const slideover = {
897
906
  leave: "transform transition ease-in-out duration-200"
898
907
  }
899
908
  };
900
- const tooltip = {
909
+ export const tooltip = {
901
910
  wrapper: "relative inline-flex",
902
911
  container: "z-20",
903
912
  width: "max-w-xs",
@@ -921,7 +930,7 @@ const tooltip = {
921
930
  strategy: "fixed"
922
931
  }
923
932
  };
924
- const popover = {
933
+ export const popover = {
925
934
  wrapper: "relative",
926
935
  container: "z-20",
927
936
  width: "",
@@ -943,7 +952,7 @@ const popover = {
943
952
  strategy: "fixed"
944
953
  }
945
954
  };
946
- const contextMenu = {
955
+ export const contextMenu = {
947
956
  wrapper: "relative",
948
957
  container: "z-20",
949
958
  width: "",
@@ -966,7 +975,7 @@ const contextMenu = {
966
975
  scroll: false
967
976
  }
968
977
  };
969
- const notification = {
978
+ export const notification = {
970
979
  wrapper: "w-full pointer-events-auto",
971
980
  container: "relative overflow-hidden",
972
981
  title: "text-sm font-medium text-gray-900 dark:text-white",
@@ -1012,46 +1021,9 @@ const notification = {
1012
1021
  }
1013
1022
  }
1014
1023
  };
1015
- const notifications = {
1024
+ export const notifications = {
1016
1025
  wrapper: "fixed flex flex-col justify-end z-[55]",
1017
1026
  position: "bottom-0 end-0",
1018
1027
  width: "w-full sm:w-96",
1019
1028
  container: "px-4 sm:px-6 py-6 space-y-3 overflow-y-auto"
1020
1029
  };
1021
- export default {
1022
- ui: {
1023
- table,
1024
- avatar,
1025
- avatarGroup,
1026
- badge,
1027
- button,
1028
- buttonGroup,
1029
- dropdown,
1030
- kbd,
1031
- accordion,
1032
- alert,
1033
- input,
1034
- formGroup,
1035
- textarea,
1036
- select,
1037
- selectMenu,
1038
- checkbox,
1039
- radio,
1040
- toggle,
1041
- range,
1042
- card,
1043
- container,
1044
- skeleton,
1045
- verticalNavigation,
1046
- commandPalette,
1047
- pagination,
1048
- tabs,
1049
- modal,
1050
- slideover,
1051
- popover,
1052
- tooltip,
1053
- contextMenu,
1054
- notification,
1055
- notifications
1056
- }
1057
- };
@@ -1,11 +1,5 @@
1
- export declare const defuTwMerge: <Source extends {
2
- [x: string]: any;
3
- [x: number]: any;
4
- [x: symbol]: any;
5
- }, Defaults extends ({
6
- [x: string]: any;
7
- [x: number]: any;
8
- [x: symbol]: any;
9
- } | (number | boolean | any[] | Record<never, any> | null | undefined))[]>(source: Source, ...defaults: Defaults) => import("defu").Defu<Source, Defaults>;
10
- export declare const hexToRgb: (hex: string) => string | null;
11
- export declare const getSlotsChildren: (slots: any) => any;
1
+ import type { Strategy } from '../types';
2
+ export declare function mergeConfig<T>(strategy: Strategy, ...configs: any[]): T;
3
+ export declare function hexToRgb(hex: string): string | null;
4
+ export declare function getSlotsChildren(slots: any): any;
5
+ export * from './lodash';
@@ -1,20 +1,31 @@
1
- import { createDefu } from "defu";
2
- import { twMerge } from "tailwind-merge";
3
- export const defuTwMerge = createDefu((obj, key, value) => {
4
- if (typeof obj[key] === "string" && typeof value === "string" && obj[key] && value) {
5
- obj[key] = twMerge(obj[key], value);
1
+ import { defu, createDefu } from "defu";
2
+ import { extendTailwindMerge } from "tailwind-merge";
3
+ const customTwMerge = extendTailwindMerge({
4
+ classGroups: {
5
+ icons: [(classPart) => /^i-/.test(classPart)]
6
+ }
7
+ });
8
+ const defuTwMerge = createDefu((obj, key, value, namespace) => {
9
+ if (namespace !== "default" && typeof obj[key] === "string" && typeof value === "string" && obj[key] && value) {
10
+ obj[key] = customTwMerge(obj[key], value);
6
11
  return true;
7
12
  }
8
13
  });
9
- export const hexToRgb = (hex) => {
14
+ export function mergeConfig(strategy, ...configs) {
15
+ if (strategy === "override") {
16
+ return defu({}, ...configs);
17
+ }
18
+ return defuTwMerge({}, ...configs);
19
+ }
20
+ export function hexToRgb(hex) {
10
21
  const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
11
22
  hex = hex.replace(shorthandRegex, function(_, r, g, b) {
12
23
  return r + r + g + g + b + b;
13
24
  });
14
25
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
15
26
  return result ? `${parseInt(result[1], 16)} ${parseInt(result[2], 16)} ${parseInt(result[3], 16)}` : null;
16
- };
17
- export const getSlotsChildren = (slots) => {
27
+ }
28
+ export function getSlotsChildren(slots) {
18
29
  let children = slots.default?.();
19
30
  if (children.length) {
20
31
  children = children.flatMap((c) => {
@@ -30,4 +41,5 @@ export const getSlotsChildren = (slots) => {
30
41
  }).filter(Boolean);
31
42
  }
32
43
  return children;
33
- };
44
+ }
45
+ export * from "./lodash.mjs";
@@ -0,0 +1,2 @@
1
+ export declare function omit<T extends Record<string, any>, K extends keyof T>(object: T, keysToOmit: K[] | any[]): Pick<T, Exclude<keyof T, K>>;
2
+ export declare function get(object: Record<string, any>, path: (string | number)[] | string, defaultValue?: any): any;
@@ -0,0 +1,23 @@
1
+ export function omit(object, keysToOmit) {
2
+ const result = { ...object };
3
+ for (const key of keysToOmit) {
4
+ delete result[key];
5
+ }
6
+ return result;
7
+ }
8
+ export function get(object, path, defaultValue) {
9
+ if (typeof path === "string") {
10
+ path = path.split(".").map((key) => {
11
+ const numKey = Number(key);
12
+ return isNaN(numKey) ? key : numKey;
13
+ });
14
+ }
15
+ let result = object;
16
+ for (const key of path) {
17
+ if (result === void 0 || result === null) {
18
+ return defaultValue;
19
+ }
20
+ result = result[key];
21
+ }
22
+ return result !== void 0 ? result : defaultValue;
23
+ }
@@ -0,0 +1 @@
1
+ export declare function uid(): string;
@@ -0,0 +1,4 @@
1
+ let _id = 0;
2
+ export function uid() {
3
+ return `nuid-${_id++}`;
4
+ }
package/dist/types.d.mts CHANGED
@@ -12,4 +12,4 @@ declare module 'nuxt/schema' {
12
12
  }
13
13
 
14
14
 
15
- export { ModuleOptions, default } from './module'
15
+ export { accordion, alert, avatar, avatarGroup, badge, button, buttonGroup, card, checkbox, commandPalette, container, contextMenu, dropdown, formGroup, input, kbd, modal, notification, notifications, pagination, popover, radio, range, select, selectMenu, skeleton, slideover, table, tabs, textarea, toggle, tooltip, verticalNavigation } from './module'
package/dist/types.d.ts CHANGED
@@ -12,4 +12,4 @@ declare module 'nuxt/schema' {
12
12
  }
13
13
 
14
14
 
15
- export { ModuleOptions, default } from './module'
15
+ export { accordion, alert, avatar, avatarGroup, badge, button, buttonGroup, card, checkbox, commandPalette, container, contextMenu, dropdown, formGroup, input, kbd, modal, notification, notifications, pagination, popover, radio, range, select, selectMenu, skeleton, slideover, table, tabs, textarea, toggle, tooltip, verticalNavigation } from './module'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "2.8.1",
3
+ "version": "2.9.0",
4
4
  "repository": "https://github.com/nuxt/ui",
5
5
  "license": "MIT",
6
6
  "exports": {
@@ -25,15 +25,16 @@
25
25
  "build:docs": "nuxi generate docs",
26
26
  "lint": "eslint .",
27
27
  "lint:fix": "eslint . --fix",
28
- "typecheck": "nuxi typecheck",
29
- "prepare": "nuxi prepare docs",
28
+ "typecheck": "vue-tsc --noEmit && nuxi typecheck docs",
29
+ "dev:prepare": "nuxt-module-build --stub && nuxt-module-build prepare && nuxi prepare docs",
30
30
  "release": "release-it"
31
31
  },
32
32
  "dependencies": {
33
- "@egoist/tailwindcss-icons": "^1.1.0",
33
+ "@egoist/tailwindcss-icons": "^1.2.0",
34
+ "@headlessui/tailwindcss": "^0.2.0",
34
35
  "@headlessui/vue": "^1.7.16",
35
36
  "@iconify-json/heroicons": "^1.1.12",
36
- "@nuxt/kit": "^3.7.1",
37
+ "@nuxt/kit": "^3.7.4",
37
38
  "@nuxtjs/color-mode": "^3.3.0",
38
39
  "@nuxtjs/tailwindcss": "^6.8.0",
39
40
  "@popperjs/core": "^2.11.8",
@@ -46,28 +47,25 @@
46
47
  "@vueuse/math": "^10.4.1",
47
48
  "defu": "^6.1.2",
48
49
  "fuse.js": "^6.6.2",
49
- "lodash-es": "^4.17.21",
50
+ "ohash": "^1.1.3",
51
+ "pathe": "^1.1.1",
52
+ "scule": "^1.0.0",
50
53
  "tailwind-merge": "^1.14.0",
51
54
  "tailwindcss": "^3.3.3"
52
55
  },
53
56
  "devDependencies": {
54
57
  "@nuxt/eslint-config": "^0.2.0",
55
- "@nuxt/module-builder": "^0.5.1",
56
- "@release-it/conventional-changelog": "^7.0.1",
57
- "eslint": "^8.48.0",
58
- "joi": "^17.10.1",
59
- "nuxt": "^3.7.1",
60
- "release-it": "^16.1.5",
58
+ "@nuxt/module-builder": "^0.5.2",
59
+ "@release-it/conventional-changelog": "^7.0.2",
60
+ "eslint": "^8.50.0",
61
+ "joi": "^17.10.2",
62
+ "nuxt": "^3.7.4",
63
+ "release-it": "^16.2.1",
61
64
  "typescript": "^5.2.2",
62
65
  "unbuild": "^2.0.0",
63
- "vue-tsc": "^1.8.10",
64
- "yup": "^1.2.0",
65
- "zod": "^3.22.2",
66
- "valibot": "^0.13.1"
67
- },
68
- "pnpm": {
69
- "patchedDependencies": {
70
- "nuxt-component-meta@0.5.3": "patches/nuxt-component-meta@0.5.3.patch"
71
- }
66
+ "valibot": "^0.17.1",
67
+ "vue-tsc": "^1.8.15",
68
+ "yup": "^1.3.1",
69
+ "zod": "^3.22.2"
72
70
  }
73
71
  }