@nuxt/ui 2.18.3 → 2.18.4

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 (56) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/data/Table.vue.d.ts +1 -1
  4. package/dist/runtime/components/elements/Accordion.vue.d.ts +2 -3
  5. package/dist/runtime/components/elements/Alert.vue.d.ts +1 -1
  6. package/dist/runtime/components/elements/Avatar.vue.d.ts +1 -1
  7. package/dist/runtime/components/elements/AvatarGroup.d.ts +1 -1
  8. package/dist/runtime/components/elements/Badge.vue.d.ts +1 -1
  9. package/dist/runtime/components/elements/Button.vue.d.ts +1 -1
  10. package/dist/runtime/components/elements/ButtonGroup.d.ts +1 -1
  11. package/dist/runtime/components/elements/Carousel.vue.d.ts +1 -1
  12. package/dist/runtime/components/elements/Chip.vue.d.ts +1 -1
  13. package/dist/runtime/components/elements/Dropdown.vue.d.ts +1 -1
  14. package/dist/runtime/components/elements/Kbd.vue.d.ts +1 -1
  15. package/dist/runtime/components/elements/Meter.vue.d.ts +1 -1
  16. package/dist/runtime/components/elements/MeterGroup.d.ts +1 -1
  17. package/dist/runtime/components/elements/Progress.vue.d.ts +1 -1
  18. package/dist/runtime/components/forms/Checkbox.vue.d.ts +1 -1
  19. package/dist/runtime/components/forms/Form.vue +2 -5
  20. package/dist/runtime/components/forms/FormGroup.vue.d.ts +1 -1
  21. package/dist/runtime/components/forms/Input.vue.d.ts +1 -1
  22. package/dist/runtime/components/forms/InputMenu.vue.d.ts +1 -1
  23. package/dist/runtime/components/forms/Radio.vue.d.ts +1 -1
  24. package/dist/runtime/components/forms/RadioGroup.vue.d.ts +1 -1
  25. package/dist/runtime/components/forms/Range.vue.d.ts +1 -1
  26. package/dist/runtime/components/forms/Select.vue.d.ts +1 -1
  27. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +1 -1
  28. package/dist/runtime/components/forms/Textarea.vue.d.ts +1 -1
  29. package/dist/runtime/components/forms/Toggle.vue.d.ts +1 -1
  30. package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
  31. package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
  32. package/dist/runtime/components/layout/Divider.vue.d.ts +1 -1
  33. package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
  34. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
  35. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +1 -1
  36. package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +1 -1
  37. package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +1 -1
  38. package/dist/runtime/components/navigation/Pagination.vue.d.ts +1 -1
  39. package/dist/runtime/components/navigation/Tabs.vue +5 -2
  40. package/dist/runtime/components/navigation/Tabs.vue.d.ts +1 -1
  41. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
  42. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +1 -1
  43. package/dist/runtime/components/overlays/Modal.vue.d.ts +1 -1
  44. package/dist/runtime/components/overlays/Notification.vue.d.ts +1 -1
  45. package/dist/runtime/components/overlays/Notifications.vue.d.ts +5 -5
  46. package/dist/runtime/components/overlays/Popover.vue.d.ts +1 -1
  47. package/dist/runtime/components/overlays/Slideover.vue +1 -1
  48. package/dist/runtime/components/overlays/Slideover.vue.d.ts +1 -1
  49. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +1 -1
  50. package/dist/runtime/composables/useFormGroup.d.ts +1 -1
  51. package/dist/runtime/composables/useFormGroup.js +13 -17
  52. package/dist/runtime/composables/useUI.d.ts +1 -1
  53. package/dist/runtime/plugins/colors.js +3 -3
  54. package/dist/runtime/utils/colors.js +75 -67
  55. package/dist/runtime/utils/index.d.ts +1 -1
  56. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "2.18.3",
3
+ "version": "2.18.4",
4
4
  "configKey": "ui",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.10.0"
package/dist/module.mjs CHANGED
@@ -14,7 +14,7 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
14
14
  const __dirname = __cjs_path__.dirname(__filename);
15
15
  const require = __cjs_mod__.createRequire(import.meta.url);
16
16
  const name = "@nuxt/ui";
17
- const version = "2.18.3";
17
+ const version = "2.18.4";
18
18
 
19
19
  function createTemplates(nuxt = useNuxt()) {
20
20
  const template = addTemplate({
@@ -1,5 +1,5 @@
1
1
  import type { PropType, AriaAttributes } from 'vue';
2
- import type { Strategy, Button, ProgressColor, ProgressAnimation } from '../../types.js';
2
+ import type { Strategy, Button, ProgressColor, ProgressAnimation } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  base: string;
@@ -1,6 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import { omit } from '../../utils.js';
3
- import type { AccordionItem, Strategy } from '../../types.js';
2
+ import type { AccordionItem, Strategy } from '../../types/index.js';
4
3
  declare const config: {
5
4
  wrapper: string;
6
5
  container: string;
@@ -169,7 +168,7 @@ declare const _default: import("vue").DefineComponent<{
169
168
  close: (e: EventTarget) => {};
170
169
  }[]>;
171
170
  closeOthers: (currentIndex: number, e: Event) => void;
172
- omit: typeof omit;
171
+ omit: any;
173
172
  onEnter: (_el: Element, done: () => void) => void;
174
173
  onBeforeLeave: (_el: Element) => void;
175
174
  onAfterEnter: (_el: Element) => void;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Avatar, Button, AlertColor, AlertVariant, AlertAction, Strategy } from '../../types.js';
2
+ import type { Avatar, Button, AlertColor, AlertVariant, AlertAction, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  inner: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { AvatarSize, AvatarChipColor, AvatarChipPosition, Strategy } from '../../types.js';
2
+ import type { AvatarSize, AvatarChipColor, AvatarChipPosition, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  background: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { AvatarSize, Strategy } from '../../types.js';
2
+ import type { AvatarSize, Strategy } from '../../types/index.js';
3
3
  declare const avatarGroupConfig: {
4
4
  wrapper: string;
5
5
  ring: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { BadgeColor, BadgeSize, BadgeVariant, Strategy } from '../../types.js';
2
+ import type { BadgeColor, BadgeSize, BadgeVariant, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  base: string;
5
5
  rounded: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { ButtonColor, ButtonSize, ButtonVariant, Strategy } from '../../types.js';
2
+ import type { ButtonColor, ButtonSize, ButtonVariant, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  base: string;
5
5
  font: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { ButtonSize, Strategy } from '../../types.js';
2
+ import type { ButtonSize, Strategy } from '../../types/index.js';
3
3
  declare const buttonGroupConfig: {
4
4
  wrapper: {
5
5
  horizontal: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Strategy, Button } from '../../types.js';
2
+ import type { Strategy, Button } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  container: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { ChipSize, ChipColor, ChipPosition, Strategy } from '../../types.js';
2
+ import type { ChipSize, ChipColor, ChipPosition, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  base: string;
@@ -1,6 +1,6 @@
1
1
  import type { PropType } from 'vue';
2
2
  import { twJoin } from 'tailwind-merge';
3
- import type { DropdownItem, PopperOptions, Strategy } from '../../types.js';
3
+ import type { DropdownItem, PopperOptions, Strategy } from '../../types/index.js';
4
4
  declare const config: {
5
5
  wrapper: string;
6
6
  container: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { KbdSize, Strategy } from '../../types.js';
2
+ import type { KbdSize, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  base: string;
5
5
  padding: string;
@@ -1,5 +1,5 @@
1
1
  import type { SlotsType, PropType } from 'vue';
2
- import type { Strategy, MeterColor, MeterSize } from '../../types.js';
2
+ import type { Strategy, MeterColor, MeterSize } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  indicator: {
@@ -1,6 +1,6 @@
1
1
  import type { VNode, SlotsType, PropType } from 'vue';
2
2
  import Meter from './Meter.vue.js';
3
- import type { Strategy, MeterSize } from '../../types.js';
3
+ import type { Strategy, MeterSize } from '../../types/index.js';
4
4
  declare const meterGroupConfig: {
5
5
  wrapper: string;
6
6
  base: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Strategy, ProgressSize, ProgressAnimation, ProgressColor } from '../../types.js';
2
+ import type { Strategy, ProgressSize, ProgressAnimation, ProgressColor } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  indicator: {
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Strategy } from '../../types.js';
2
+ import type { Strategy } from '../../types/index.js';
3
3
  import colors from '#ui-colors';
4
4
  declare const config: {
5
5
  wrapper: string;
@@ -100,11 +100,8 @@ export default defineComponent({
100
100
  if (props.validateOn?.includes("submit")) {
101
101
  await validate();
102
102
  }
103
- const submitEvent = {
104
- ...event,
105
- data: props.state
106
- };
107
- emit("submit", submitEvent);
103
+ event.data = props.state;
104
+ emit("submit", event);
108
105
  } catch (error) {
109
106
  if (!(error instanceof FormException)) {
110
107
  throw error;
@@ -1,5 +1,5 @@
1
1
  import type { Ref, PropType } from 'vue';
2
- import type { FormGroupSize, Strategy } from '../../types.js';
2
+ import type { FormGroupSize, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  inner: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { InputSize, InputColor, InputVariant, Strategy } from '../../types.js';
2
+ import type { InputSize, InputColor, InputVariant, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  base: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { InputSize, InputColor, InputVariant, PopperOptions, Strategy } from '../../types.js';
2
+ import type { InputSize, InputColor, InputVariant, PopperOptions, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  base: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Strategy } from '../../types.js';
2
+ import type { Strategy } from '../../types/index.js';
3
3
  import colors from '#ui-colors';
4
4
  declare const config: {
5
5
  wrapper: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Strategy } from '../../types.js';
2
+ import type { Strategy } from '../../types/index.js';
3
3
  import colors from '#ui-colors';
4
4
  declare const config: {
5
5
  wrapper: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { RangeSize, RangeColor, Strategy } from '../../types.js';
2
+ import type { RangeSize, RangeColor, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  base: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType, ComputedRef } from 'vue';
2
- import type { SelectSize, SelectColor, SelectVariant, Strategy } from '../../types.js';
2
+ import type { SelectSize, SelectColor, SelectVariant, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  form: string;
5
5
  placeholder: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { SelectSize, SelectColor, SelectVariant, PopperOptions, Strategy } from '../../types.js';
2
+ import type { SelectSize, SelectColor, SelectVariant, PopperOptions, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  form: string;
5
5
  placeholder: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { TextareaSize, TextareaColor, TextareaVariant, Strategy } from '../../types.js';
2
+ import type { TextareaSize, TextareaColor, TextareaVariant, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  form: string;
5
5
  default: {
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { ToggleSize, ToggleColor, Strategy } from '../../types.js';
2
+ import type { ToggleSize, ToggleColor, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  base: string;
5
5
  rounded: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Strategy } from '../../types.js';
2
+ import type { Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  base: string;
5
5
  background: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Strategy } from '../../types.js';
2
+ import type { Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  base: string;
5
5
  padding: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Avatar, DividerSize, Strategy } from '../../types.js';
2
+ import type { Avatar, DividerSize, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: {
5
5
  base: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Strategy } from '../../types.js';
2
+ import type { Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  base: string;
5
5
  background: string;
@@ -1,6 +1,6 @@
1
1
  import type { PropType } from 'vue';
2
2
  import { twJoin } from 'tailwind-merge';
3
- import type { BreadcrumbLink, Strategy } from '../../types.js';
3
+ import type { BreadcrumbLink, Strategy } from '../../types/index.js';
4
4
  declare const config: {
5
5
  wrapper: string;
6
6
  ol: string;
@@ -1,6 +1,6 @@
1
1
  import type { ComputedRef, PropType, ComponentPublicInstance } from 'vue';
2
2
  import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
3
- import type { Group, Command, Button, Strategy } from '../../types.js';
3
+ import type { Group, Command, Button, Strategy } from '../../types/index.js';
4
4
  declare const config: {
5
5
  wrapper: string;
6
6
  container: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Command, Group } from '../../types.js';
2
+ import type { Command, Group } from '../../types/index.js';
3
3
  import { commandPalette } from '#ui/ui.config';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  group: {
@@ -1,6 +1,6 @@
1
1
  import type { PropType } from 'vue';
2
2
  import { twJoin } from 'tailwind-merge';
3
- import type { HorizontalNavigationLink, Strategy } from '../../types.js';
3
+ import type { HorizontalNavigationLink, Strategy } from '../../types/index.js';
4
4
  declare const config: {
5
5
  wrapper: string;
6
6
  container: string;
@@ -1,6 +1,6 @@
1
1
  import type { PropType } from 'vue';
2
2
  import type { RouteLocationRaw } from '#vue-router';
3
- import type { Button, ButtonSize, Strategy } from '../../types.js';
3
+ import type { Button, ButtonSize, Strategy } from '../../types/index.js';
4
4
  declare const config: {
5
5
  wrapper: string;
6
6
  base: string;
@@ -53,7 +53,7 @@
53
53
  </template>
54
54
 
55
55
  <script>
56
- import { toRef, ref, watch, onMounted, defineComponent } from "vue";
56
+ import { toRef, ref, watch, onMounted, defineComponent, nextTick } from "vue";
57
57
  import { TabGroup as HTabGroup, TabList as HTabList, Tab as HTab, TabPanels as HTabPanels, TabPanel as HTabPanel, provideUseId } from "@headlessui/vue";
58
58
  import { useResizeObserver } from "@vueuse/core";
59
59
  import UIcon from "../elements/Icon.vue";
@@ -143,7 +143,10 @@ export default defineComponent({
143
143
  selectedIndex.value = value;
144
144
  calcMarkerSize(selectedIndex.value);
145
145
  });
146
- onMounted(() => calcMarkerSize(selectedIndex.value));
146
+ onMounted(async () => {
147
+ await nextTick();
148
+ calcMarkerSize(selectedIndex.value);
149
+ });
147
150
  provideUseId(() => useId());
148
151
  return {
149
152
  // eslint-disable-next-line vue/no-dupe-keys
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { TabItem, Strategy } from '../../types.js';
2
+ import type { TabItem, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  container: string;
@@ -1,6 +1,6 @@
1
1
  import type { PropType } from 'vue';
2
2
  import { twJoin } from 'tailwind-merge';
3
- import type { VerticalNavigationLink, Strategy } from '../../types.js';
3
+ import type { VerticalNavigationLink, Strategy } from '../../types/index.js';
4
4
  declare const config: {
5
5
  wrapper: string;
6
6
  base: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType, Ref } from 'vue';
2
- import type { PopperOptions, Strategy } from '../../types.js';
2
+ import type { PopperOptions, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  container: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Strategy } from '../../types.js';
2
+ import type { Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  inner: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Avatar, Button, NotificationColor, NotificationAction, Strategy } from '../../types.js';
2
+ import type { Avatar, Button, NotificationColor, NotificationAction, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  container: string;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Notification, Strategy } from '../../types.js';
2
+ import type { Notification, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  position: string;
@@ -33,13 +33,13 @@ declare const _default: import("vue").DefineComponent<{
33
33
  title?: string;
34
34
  description?: string;
35
35
  icon?: string;
36
- avatar?: import("../../types").Avatar;
37
- closeButton?: import("../../types").Button;
36
+ avatar?: import("../../types/avatar").Avatar;
37
+ closeButton?: import("../../types/button").Button;
38
38
  timeout?: number;
39
- actions?: import("../../types").NotificationAction[];
39
+ actions?: import("../../types/notification").NotificationAction[];
40
40
  click?: (...args: any[]) => void;
41
41
  callback?: (...args: any[]) => void;
42
- color?: import("../../types").NotificationColor;
42
+ color?: import("../../types/notification").NotificationColor;
43
43
  ui?: any;
44
44
  };
45
45
  remove: (id: string) => void;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { PopperOptions, Strategy } from '../../types.js';
2
+ import type { PopperOptions, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  container: string;
@@ -149,4 +149,4 @@ export default defineComponent({
149
149
  };
150
150
  }
151
151
  });
152
- </script>
152
+ </script>
@@ -1,5 +1,5 @@
1
1
  import type { WritableComputedRef, PropType } from 'vue';
2
- import type { Strategy } from '../../types.js';
2
+ import type { Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  overlay: {
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { PopperOptions, Strategy } from '../../types.js';
2
+ import type { PopperOptions, Strategy } from '../../types/index.js';
3
3
  declare const config: {
4
4
  wrapper: string;
5
5
  container: string;
@@ -9,7 +9,7 @@ type InputProps = {
9
9
  export declare const useFormGroup: (inputProps?: InputProps, config?: any) => {
10
10
  inputId: import("vue").ComputedRef<string>;
11
11
  name: import("vue").ComputedRef<string>;
12
- size: import("vue").ComputedRef<string | number | symbol>;
12
+ size: import("vue").ComputedRef<any>;
13
13
  color: import("vue").ComputedRef<string>;
14
14
  emitFormBlur: () => void;
15
15
  emitFormInput: import("@vueuse/shared").PromisifyFn<() => void>;
@@ -1,19 +1,15 @@
1
1
  import { inject, ref, computed } from "vue";
2
2
  import { useDebounceFn } from "@vueuse/core";
3
- import { mergeConfig } from "../utils/index.js";
4
- import appConfig from "#build/app.config";
5
- import { formGroup } from "#ui/ui.config";
6
- const formGroupConfig = mergeConfig(appConfig.ui.strategy, appConfig.ui.formGroup, formGroup);
7
3
  export const useFormGroup = (inputProps, config) => {
8
4
  const formBus = inject("form-events", void 0);
9
- const formGroup2 = inject("form-group", void 0);
5
+ const formGroup = inject("form-group", void 0);
10
6
  const formInputs = inject("form-inputs", void 0);
11
- if (formGroup2) {
7
+ if (formGroup) {
12
8
  if (inputProps?.id) {
13
- formGroup2.inputId.value = inputProps?.id;
9
+ formGroup.inputId.value = inputProps?.id;
14
10
  }
15
11
  if (formInputs) {
16
- formInputs.value[formGroup2.name.value] = formGroup2.inputId.value;
12
+ formInputs.value[formGroup.name.value] = formGroup.inputId.value;
17
13
  }
18
14
  }
19
15
  const blurred = ref(false);
@@ -23,25 +19,25 @@ export const useFormGroup = (inputProps, config) => {
23
19
  }
24
20
  }
25
21
  function emitFormBlur() {
26
- emitFormEvent("blur", formGroup2?.name.value);
22
+ emitFormEvent("blur", formGroup?.name.value);
27
23
  blurred.value = true;
28
24
  }
29
25
  function emitFormChange() {
30
- emitFormEvent("change", formGroup2?.name.value);
26
+ emitFormEvent("change", formGroup?.name.value);
31
27
  }
32
28
  const emitFormInput = useDebounceFn(() => {
33
- if (blurred.value || formGroup2?.eagerValidation.value) {
34
- emitFormEvent("input", formGroup2?.name.value);
29
+ if (blurred.value || formGroup?.eagerValidation.value) {
30
+ emitFormEvent("input", formGroup?.name.value);
35
31
  }
36
32
  }, 300);
37
33
  return {
38
- inputId: computed(() => inputProps?.id ?? formGroup2?.inputId.value),
39
- name: computed(() => inputProps?.name ?? formGroup2?.name.value),
34
+ inputId: computed(() => inputProps?.id ?? formGroup?.inputId.value),
35
+ name: computed(() => inputProps?.name ?? formGroup?.name.value),
40
36
  size: computed(() => {
41
- const formGroupSize = config.size[formGroup2?.size.value] ? formGroup2?.size.value : null;
42
- return inputProps?.size ?? formGroupSize ?? formGroupConfig?.default?.size;
37
+ const formGroupSize = config.size[formGroup?.size.value] ? formGroup?.size.value : null;
38
+ return inputProps?.size ?? formGroupSize ?? config.default?.size;
43
39
  }),
44
- color: computed(() => formGroup2?.error?.value ? "red" : inputProps?.color),
40
+ color: computed(() => formGroup?.error?.value ? "red" : inputProps?.color),
45
41
  emitFormBlur,
46
42
  emitFormInput,
47
43
  emitFormChange
@@ -1,5 +1,5 @@
1
1
  import type { Ref } from 'vue';
2
- import type { Strategy } from '../types.js';
2
+ import type { Strategy } from '../types/index.js';
3
3
  export declare const useUI: <T>(key: any, $ui?: Ref<(Partial<T> & {
4
4
  strategy?: Strategy;
5
5
  }) | undefined>, $config?: Ref<T> | T, $wrapperClass?: Ref<string>, withAppConfig?: boolean) => {
@@ -1,13 +1,13 @@
1
1
  import { computed } from "vue";
2
- import { hexToRgb } from "../utils/index.js";
2
+ import { get, hexToRgb } from "../utils/index.js";
3
3
  import { defineNuxtPlugin, useAppConfig, useNuxtApp, useHead } from "#imports";
4
4
  import colors from "#tailwind-config/theme/colors";
5
5
  export default defineNuxtPlugin(() => {
6
6
  const appConfig = useAppConfig();
7
7
  const nuxtApp = useNuxtApp();
8
8
  const root = computed(() => {
9
- const primary = colors[appConfig.ui.primary];
10
- const gray = colors[appConfig.ui.gray];
9
+ const primary = get(colors, appConfig.ui.primary);
10
+ const gray = get(colors, appConfig.ui.gray);
11
11
  if (!primary) {
12
12
  console.warn(`[@nuxt/ui] Primary color '${appConfig.ui.primary}' not found in Tailwind config`);
13
13
  }
@@ -16,193 +16,193 @@ const colorsToExclude = [
16
16
  ];
17
17
  const safelistByComponent = {
18
18
  alert: (colorsAsRegex2) => [{
19
- pattern: new RegExp(`bg-(${colorsAsRegex2})-50`)
19
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-50$`)
20
20
  }, {
21
- pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
21
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
22
22
  variants: ["dark"]
23
23
  }, {
24
- pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
24
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
25
25
  }, {
26
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
26
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
27
27
  variants: ["dark"]
28
28
  }, {
29
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
29
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
30
30
  }, {
31
- pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
31
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
32
32
  variants: ["dark"]
33
33
  }, {
34
- pattern: new RegExp(`ring-(${colorsAsRegex2})-500`)
34
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`)
35
35
  }],
36
36
  avatar: (colorsAsRegex2) => [{
37
- pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
37
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
38
38
  variants: ["dark"]
39
39
  }, {
40
- pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
40
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
41
41
  }],
42
42
  badge: (colorsAsRegex2) => [{
43
- pattern: new RegExp(`bg-(${colorsAsRegex2})-50`)
43
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-50$`)
44
44
  }, {
45
- pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
45
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
46
46
  variants: ["dark"]
47
47
  }, {
48
- pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
48
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
49
49
  }, {
50
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
50
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
51
51
  variants: ["dark"]
52
52
  }, {
53
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
53
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
54
54
  }, {
55
- pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
55
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
56
56
  variants: ["dark"]
57
57
  }, {
58
- pattern: new RegExp(`ring-(${colorsAsRegex2})-500`)
58
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`)
59
59
  }],
60
60
  button: (colorsAsRegex2) => [{
61
- pattern: new RegExp(`bg-(${colorsAsRegex2})-50`),
61
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-50$`),
62
62
  variants: ["hover", "disabled"]
63
63
  }, {
64
- pattern: new RegExp(`bg-(${colorsAsRegex2})-100`),
64
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-100$`),
65
65
  variants: ["hover"]
66
66
  }, {
67
- pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
67
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
68
68
  variants: ["dark", "dark:disabled"]
69
69
  }, {
70
- pattern: new RegExp(`bg-(${colorsAsRegex2})-500`),
70
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`),
71
71
  variants: ["disabled", "dark:hover"]
72
72
  }, {
73
- pattern: new RegExp(`bg-(${colorsAsRegex2})-600`),
73
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-600$`),
74
74
  variants: ["hover"]
75
75
  }, {
76
- pattern: new RegExp(`bg-(${colorsAsRegex2})-900`),
76
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-900$`),
77
77
  variants: ["dark:hover"]
78
78
  }, {
79
- pattern: new RegExp(`bg-(${colorsAsRegex2})-950`),
79
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-950$`),
80
80
  variants: ["dark", "dark:hover", "dark:disabled"]
81
81
  }, {
82
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
82
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
83
83
  variants: ["dark", "dark:disabled"]
84
84
  }, {
85
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`),
85
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`),
86
86
  variants: ["dark:hover", "disabled"]
87
87
  }, {
88
- pattern: new RegExp(`text-(${colorsAsRegex2})-600`),
88
+ pattern: RegExp(`^text-(${colorsAsRegex2})-600$`),
89
89
  variants: ["hover"]
90
90
  }, {
91
- pattern: new RegExp(`outline-(${colorsAsRegex2})-400`),
91
+ pattern: RegExp(`^outline-(${colorsAsRegex2})-400$`),
92
92
  variants: ["dark:focus-visible"]
93
93
  }, {
94
- pattern: new RegExp(`outline-(${colorsAsRegex2})-500`),
94
+ pattern: RegExp(`^outline-(${colorsAsRegex2})-500$`),
95
95
  variants: ["focus-visible"]
96
96
  }, {
97
- pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
97
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
98
98
  variants: ["dark:focus-visible"]
99
99
  }, {
100
- pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
100
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
101
101
  variants: ["focus-visible"]
102
102
  }],
103
103
  input: (colorsAsRegex2) => [{
104
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
104
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
105
105
  variants: ["dark"]
106
106
  }, {
107
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
107
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
108
108
  }, {
109
- pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
109
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
110
110
  variants: ["dark", "dark:focus"]
111
111
  }, {
112
- pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
112
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
113
113
  variants: ["focus"]
114
114
  }],
115
115
  radio: (colorsAsRegex2) => [{
116
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
116
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
117
117
  variants: ["dark"]
118
118
  }, {
119
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
119
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
120
120
  }, {
121
- pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
121
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
122
122
  variants: ["dark:focus-visible"]
123
123
  }, {
124
- pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
124
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
125
125
  variants: ["focus-visible"]
126
126
  }],
127
127
  checkbox: (colorsAsRegex2) => [{
128
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
128
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
129
129
  variants: ["dark"]
130
130
  }, {
131
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
131
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
132
132
  }, {
133
- pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
133
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
134
134
  variants: ["dark:focus-visible"]
135
135
  }, {
136
- pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
136
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
137
137
  variants: ["focus-visible"]
138
138
  }],
139
139
  toggle: (colorsAsRegex2) => [{
140
- pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
140
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
141
141
  variants: ["dark"]
142
142
  }, {
143
- pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
143
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
144
144
  }, {
145
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
145
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
146
146
  variants: ["dark"]
147
147
  }, {
148
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
148
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
149
149
  }, {
150
- pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
150
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
151
151
  variants: ["dark:focus-visible"]
152
152
  }, {
153
- pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
153
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
154
154
  variants: ["focus-visible"]
155
155
  }],
156
156
  range: (colorsAsRegex2) => [{
157
- pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
157
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
158
158
  variants: ["dark"]
159
159
  }, {
160
- pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
160
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
161
161
  }, {
162
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
162
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
163
163
  variants: ["dark"]
164
164
  }, {
165
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
165
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
166
166
  }, {
167
- pattern: new RegExp(`ring-(${colorsAsRegex2})-400`),
167
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
168
168
  variants: ["dark:focus-visible"]
169
169
  }, {
170
- pattern: new RegExp(`ring-(${colorsAsRegex2})-500`),
170
+ pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
171
171
  variants: ["focus-visible"]
172
172
  }],
173
173
  progress: (colorsAsRegex2) => [{
174
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
174
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
175
175
  variants: ["dark"]
176
176
  }, {
177
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
177
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
178
178
  }],
179
179
  meter: (colorsAsRegex2) => [{
180
- pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
180
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
181
181
  variants: ["dark"]
182
182
  }, {
183
- pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
183
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
184
184
  }, {
185
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
185
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
186
186
  variants: ["dark"]
187
187
  }, {
188
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
188
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
189
189
  }],
190
190
  notification: (colorsAsRegex2) => [{
191
- pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
191
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
192
192
  variants: ["dark"]
193
193
  }, {
194
- pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
194
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
195
195
  }, {
196
- pattern: new RegExp(`text-(${colorsAsRegex2})-400`),
196
+ pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
197
197
  variants: ["dark"]
198
198
  }, {
199
- pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
199
+ pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
200
200
  }],
201
201
  chip: (colorsAsRegex2) => [{
202
- pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
202
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
203
203
  variants: ["dark"]
204
204
  }, {
205
- pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
205
+ pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
206
206
  }]
207
207
  };
208
208
  const safelistComponentAliasesMap = {
@@ -289,7 +289,15 @@ export const customSafelistExtractor = (prefix, content, colors, safelistColors)
289
289
  const matches2 = group.pattern.source.match(/\(([^)]+)\)/g);
290
290
  return matches2.map((match2) => {
291
291
  const colorOptions = match2.substring(1, match2.length - 1).split("|");
292
- return colorOptions.map((color2) => `${variant ? variant + ":" : ""}` + group.pattern.source.replace(match2, color2));
292
+ return colorOptions.map(
293
+ (color2) => {
294
+ const classesExtracted = group.pattern.source.replace(match2, color2).replace("^", "").replace("$", "");
295
+ if (variant) {
296
+ return `${variant}:${classesExtracted}`;
297
+ }
298
+ return classesExtracted;
299
+ }
300
+ );
293
301
  }).flat();
294
302
  });
295
303
  });
@@ -1,4 +1,4 @@
1
- import type { Strategy } from '../types.js';
1
+ import type { Strategy } from '../types/index.js';
2
2
  export declare function mergeConfig<T>(strategy: Strategy, ...configs: any[]): T;
3
3
  export declare function hexToRgb(hex: string): string;
4
4
  export declare function getSlotsChildren(slots: any): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "2.18.3",
3
+ "version": "2.18.4",
4
4
  "packageManager": "pnpm@9.6.0",
5
5
  "repository": "nuxt/ui",
6
6
  "homepage": "https://ui.nuxt.com",