@nuxt/ui 3.1.1 → 3.1.3

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 (126) hide show
  1. package/.nuxt/ui/alert.ts +0 -5
  2. package/.nuxt/ui/badge.ts +30 -7
  3. package/.nuxt/ui/button-group.ts +0 -13
  4. package/.nuxt/ui/button.ts +2 -7
  5. package/.nuxt/ui/calendar.ts +1 -1
  6. package/.nuxt/ui/carousel.ts +0 -5
  7. package/.nuxt/ui/checkbox-group.ts +144 -1
  8. package/.nuxt/ui/color-picker.ts +2 -2
  9. package/.nuxt/ui/context-menu.ts +2 -1
  10. package/.nuxt/ui/dropdown-menu.ts +2 -1
  11. package/.nuxt/ui/input-menu.ts +4 -13
  12. package/.nuxt/ui/input-number.ts +10 -0
  13. package/.nuxt/ui/input.ts +2 -11
  14. package/.nuxt/ui/link.ts +12 -5
  15. package/.nuxt/ui/navigation-menu.ts +43 -34
  16. package/.nuxt/ui/radio-group.ts +1 -1
  17. package/.nuxt/ui/select-menu.ts +4 -13
  18. package/.nuxt/ui/select.ts +4 -13
  19. package/.nuxt/ui/tabs.ts +4 -3
  20. package/.nuxt/ui/textarea.ts +2 -11
  21. package/.nuxt/ui/toast.ts +0 -5
  22. package/.nuxt/ui/tooltip.ts +1 -1
  23. package/.nuxt/ui.css +4 -1
  24. package/cli/templates.mjs +2 -2
  25. package/dist/module.json +1 -1
  26. package/dist/module.mjs +14 -5
  27. package/dist/runtime/components/Accordion.vue +9 -9
  28. package/dist/runtime/components/Accordion.vue.d.ts +2 -0
  29. package/dist/runtime/components/Alert.vue +1 -1
  30. package/dist/runtime/components/Avatar.vue +2 -2
  31. package/dist/runtime/components/AvatarGroup.vue +1 -1
  32. package/dist/runtime/components/Badge.vue +5 -3
  33. package/dist/runtime/components/Badge.vue.d.ts +2 -0
  34. package/dist/runtime/components/Breadcrumb.vue +8 -8
  35. package/dist/runtime/components/Breadcrumb.vue.d.ts +2 -0
  36. package/dist/runtime/components/Button.vue +2 -3
  37. package/dist/runtime/components/Button.vue.d.ts +1 -1
  38. package/dist/runtime/components/Calendar.vue +2 -1
  39. package/dist/runtime/components/Card.vue +1 -1
  40. package/dist/runtime/components/Carousel.vue +5 -2
  41. package/dist/runtime/components/Carousel.vue.d.ts +6 -1
  42. package/dist/runtime/components/Checkbox.vue +2 -2
  43. package/dist/runtime/components/CheckboxGroup.vue +8 -5
  44. package/dist/runtime/components/CheckboxGroup.vue.d.ts +7 -1
  45. package/dist/runtime/components/Chip.vue +1 -1
  46. package/dist/runtime/components/Collapsible.vue +1 -1
  47. package/dist/runtime/components/ColorPicker.vue +1 -1
  48. package/dist/runtime/components/CommandPalette.vue +18 -18
  49. package/dist/runtime/components/CommandPalette.vue.d.ts +2 -0
  50. package/dist/runtime/components/ContextMenu.vue.d.ts +2 -0
  51. package/dist/runtime/components/ContextMenuContent.vue +69 -67
  52. package/dist/runtime/components/Drawer.vue +15 -1
  53. package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -0
  54. package/dist/runtime/components/DropdownMenuContent.vue +71 -69
  55. package/dist/runtime/components/FormField.vue +5 -5
  56. package/dist/runtime/components/Input.vue +3 -2
  57. package/dist/runtime/components/Input.vue.d.ts +30 -29
  58. package/dist/runtime/components/InputMenu.vue +20 -20
  59. package/dist/runtime/components/InputMenu.vue.d.ts +210 -0
  60. package/dist/runtime/components/InputNumber.vue +13 -7
  61. package/dist/runtime/components/InputNumber.vue.d.ts +78 -0
  62. package/dist/runtime/components/Link.vue +5 -14
  63. package/dist/runtime/components/Modal.vue +2 -2
  64. package/dist/runtime/components/Modal.vue.d.ts +3 -0
  65. package/dist/runtime/components/NavigationMenu.vue +106 -41
  66. package/dist/runtime/components/NavigationMenu.vue.d.ts +38 -7
  67. package/dist/runtime/components/Pagination.vue +1 -1
  68. package/dist/runtime/components/PinInput.vue +1 -1
  69. package/dist/runtime/components/Popover.vue +4 -0
  70. package/dist/runtime/components/Popover.vue.d.ts +1 -0
  71. package/dist/runtime/components/Progress.vue +1 -1
  72. package/dist/runtime/components/RadioGroup.vue +8 -8
  73. package/dist/runtime/components/RadioGroup.vue.d.ts +2 -0
  74. package/dist/runtime/components/Select.vue +15 -15
  75. package/dist/runtime/components/Select.vue.d.ts +3 -1
  76. package/dist/runtime/components/SelectMenu.vue +16 -16
  77. package/dist/runtime/components/SelectMenu.vue.d.ts +2 -0
  78. package/dist/runtime/components/Separator.vue +1 -1
  79. package/dist/runtime/components/Slideover.vue +9 -2
  80. package/dist/runtime/components/Slideover.vue.d.ts +3 -0
  81. package/dist/runtime/components/Slider.vue +16 -4
  82. package/dist/runtime/components/Slider.vue.d.ts +26 -20
  83. package/dist/runtime/components/Stepper.vue +10 -10
  84. package/dist/runtime/components/Stepper.vue.d.ts +2 -0
  85. package/dist/runtime/components/Switch.vue +1 -1
  86. package/dist/runtime/components/Table.vue +2 -2
  87. package/dist/runtime/components/Tabs.vue +6 -6
  88. package/dist/runtime/components/Tabs.vue.d.ts +2 -0
  89. package/dist/runtime/components/Textarea.vue +7 -4
  90. package/dist/runtime/components/Textarea.vue.d.ts +30 -31
  91. package/dist/runtime/components/Toast.vue +3 -2
  92. package/dist/runtime/components/Toast.vue.d.ts +6 -0
  93. package/dist/runtime/components/Toaster.vue +4 -4
  94. package/dist/runtime/components/Toaster.vue.d.ts +6 -0
  95. package/dist/runtime/components/Tree.vue +10 -10
  96. package/dist/runtime/components/Tree.vue.d.ts +2 -0
  97. package/dist/runtime/composables/useFormField.d.ts +1 -1
  98. package/dist/runtime/composables/useFormField.js +2 -1
  99. package/dist/runtime/inertia/components/Link.vue +46 -60
  100. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  101. package/dist/runtime/inertia/components/LinkBase.vue +68 -0
  102. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
  103. package/dist/runtime/inertia/stubs.d.ts +1 -1
  104. package/dist/runtime/inertia/stubs.js +1 -1
  105. package/dist/runtime/locale/index.d.ts +7 -2
  106. package/dist/runtime/locale/index.js +7 -2
  107. package/dist/runtime/locale/ky.d.ts +3 -0
  108. package/dist/runtime/locale/ky.js +54 -0
  109. package/dist/runtime/locale/lt.d.ts +3 -0
  110. package/dist/runtime/locale/lt.js +54 -0
  111. package/dist/runtime/locale/mn.d.ts +3 -0
  112. package/dist/runtime/locale/mn.js +54 -0
  113. package/dist/runtime/locale/ms.d.ts +3 -0
  114. package/dist/runtime/locale/ms.js +54 -0
  115. package/dist/runtime/locale/sl.d.ts +3 -0
  116. package/dist/runtime/locale/sl.js +54 -0
  117. package/dist/runtime/utils/link.d.ts +1 -0
  118. package/dist/runtime/utils/link.js +12 -0
  119. package/dist/runtime/vue/components/Link.vue +27 -40
  120. package/dist/runtime/vue/composables/useAppConfig.js +3 -1
  121. package/dist/runtime/vue/stubs.d.ts +1 -1
  122. package/dist/runtime/vue/stubs.js +1 -1
  123. package/dist/shared/{ui.CbtTMMzt.mjs → ui.Bix4DSU4.mjs} +153 -52
  124. package/dist/unplugin.mjs +1 -1
  125. package/dist/vite.mjs +1 -1
  126. package/package.json +28 -28
@@ -1,7 +1,7 @@
1
1
  import type { AppConfig } from '@nuxt/schema';
2
2
  import theme from '#build/ui/textarea';
3
3
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
4
- import type { ComponentConfig } from '../types/utils';
4
+ import type { AcceptableValue, ComponentConfig } from '../types/utils';
5
5
  type Textarea = ComponentConfig<typeof theme, AppConfig, 'textarea'>;
6
6
  export interface TextareaProps extends UseComponentIconsProps {
7
7
  /**
@@ -31,15 +31,21 @@ export interface TextareaProps extends UseComponentIconsProps {
31
31
  autoresize?: boolean;
32
32
  autoresizeDelay?: number;
33
33
  disabled?: boolean;
34
- class?: any;
35
34
  rows?: number;
36
35
  maxrows?: number;
37
36
  /** Highlight the ring color like a focus state. */
38
37
  highlight?: boolean;
38
+ modelModifiers?: {
39
+ string?: boolean;
40
+ trim?: boolean;
41
+ lazy?: boolean;
42
+ nullify?: boolean;
43
+ };
44
+ class?: any;
39
45
  ui?: Textarea['slots'];
40
46
  }
41
- export interface TextareaEmits {
42
- (e: 'update:modelValue', payload: string | number): void;
47
+ export interface TextareaEmits<T extends AcceptableValue = AcceptableValue> {
48
+ (e: 'update:modelValue', payload: T): void;
43
49
  (e: 'blur', event: FocusEvent): void;
44
50
  (e: 'change', event: Event): void;
45
51
  }
@@ -48,31 +54,24 @@ export interface TextareaSlots {
48
54
  default(props?: {}): any;
49
55
  trailing(props?: {}): any;
50
56
  }
51
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<TextareaProps & {
52
- modelValue?: string | number | null;
53
- }, {
54
- textareaRef: import("vue").Ref<HTMLTextAreaElement | null, HTMLTextAreaElement | null>;
55
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
56
- "update:modelValue": (value: string | number | null | undefined) => any;
57
- } & {
58
- blur: (event: FocusEvent) => any;
59
- change: (event: Event) => any;
60
- "update:modelValue": (payload: string | number) => any;
61
- }, string, import("vue").PublicProps, Readonly<TextareaProps & {
62
- modelValue?: string | number | null;
63
- }> & Readonly<{
64
- onBlur?: ((event: FocusEvent) => any) | undefined;
65
- onChange?: ((event: Event) => any) | undefined;
66
- "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
67
- }>, {
68
- autofocusDelay: number;
69
- autoresizeDelay: number;
70
- rows: number;
71
- maxrows: number;
72
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, TextareaSlots>;
73
- export default _default;
74
- type __VLS_WithSlots<T, S> = T & {
75
- new (): {
76
- $slots: S;
77
- };
57
+ declare const _default: <T extends AcceptableValue>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
58
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
59
+ readonly onBlur?: ((event: FocusEvent) => any) | undefined;
60
+ readonly onChange?: ((event: Event) => any) | undefined;
61
+ readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
62
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> & (TextareaProps & {
63
+ modelValue?: T;
64
+ }) & Partial<{}>> & import("vue").PublicProps;
65
+ expose(exposed: import("vue").ShallowUnwrapRef<{
66
+ textareaRef: import("vue").Ref<HTMLTextAreaElement | null, HTMLTextAreaElement | null>;
67
+ }>): void;
68
+ attrs: any;
69
+ slots: TextareaSlots;
70
+ emit: TextareaEmits<T> & ((evt: "update:modelValue", value: T | undefined) => void);
71
+ }>) => import("vue").VNode & {
72
+ __ctx?: Awaited<typeof __VLS_setup>;
78
73
  };
74
+ export default _default;
75
+ type __VLS_PrettifyLocal<T> = {
76
+ [K in keyof T]: T[K];
77
+ } & {};
@@ -20,6 +20,7 @@ const props = defineProps({
20
20
  avatar: { type: Object, required: false },
21
21
  color: { type: null, required: false },
22
22
  orientation: { type: null, required: false, default: "vertical" },
23
+ progress: { type: Boolean, required: false, default: true },
23
24
  actions: { type: Array, required: false },
24
25
  close: { type: [Boolean, Object], required: false, default: true },
25
26
  closeIcon: { type: String, required: false },
@@ -61,7 +62,7 @@ defineExpose({
61
62
  v-slot="{ remaining, duration }"
62
63
  v-bind="rootProps"
63
64
  :data-orientation="orientation"
64
- :class="ui.root({ class: [props.class, props.ui?.root] })"
65
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
65
66
  :style="{ '--height': height }"
66
67
  >
67
68
  <slot name="leading">
@@ -124,6 +125,6 @@ defineExpose({
124
125
  </ToastClose>
125
126
  </div>
126
127
 
127
- <div v-if="remaining > 0 && duration" :class="ui.progress({ class: props.ui?.progress })" :style="{ width: `${remaining / duration * 100}%` }" />
128
+ <div v-if="progress && remaining > 0 && duration" :class="ui.progress({ class: props.ui?.progress })" :style="{ width: `${remaining / duration * 100}%` }" />
128
129
  </ToastRoot>
129
130
  </template>
@@ -26,6 +26,11 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
26
26
  * @defaultValue 'vertical'
27
27
  */
28
28
  orientation?: Toast['variants']['orientation'];
29
+ /**
30
+ * Whether to show the progress bar.
31
+ * @defaultValue true
32
+ */
33
+ progress?: boolean;
29
34
  /**
30
35
  * Display a list of actions:
31
36
  * - under the title and description when orientation is `vertical`
@@ -147,6 +152,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToastProps
147
152
  }>, "currentTarget">) => any) | undefined;
148
153
  }>, {
149
154
  close: boolean | Partial<ButtonProps>;
155
+ progress: boolean;
150
156
  orientation: Toast["variants"]["orientation"];
151
157
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToastSlots>;
152
158
  export default _default;
@@ -18,6 +18,7 @@ import UToast from "./Toast.vue";
18
18
  const props = defineProps({
19
19
  position: { type: null, required: false },
20
20
  expand: { type: Boolean, required: false, default: true },
21
+ progress: { type: Boolean, required: false, default: true },
21
22
  portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
22
23
  class: { type: null, required: false },
23
24
  ui: { type: null, required: false },
@@ -73,6 +74,7 @@ function getOffset(index) {
73
74
  v-for="(toast, index) of toasts"
74
75
  :key="toast.id"
75
76
  ref="refs"
77
+ :progress="progress"
76
78
  v-bind="omit(toast, ['id', 'close'])"
77
79
  :close="toast.close"
78
80
  :data-expanded="expanded"
@@ -85,9 +87,7 @@ function getOffset(index) {
85
87
  '--translate': expanded ? 'calc(var(--offset) * var(--translate-factor))' : 'calc(var(--before) * var(--gap))',
86
88
  '--transform': 'translateY(var(--translate)) scale(var(--scale))'
87
89
  }"
88
- :class="[ui.base(), {
89
- 'cursor-pointer': !!toast.onClick
90
- }]"
90
+ :class="ui.base({ class: [props.ui?.base, toast.onClick ? 'cursor-pointer' : void 0] })"
91
91
  @update:open="onUpdateOpen($event, toast.id)"
92
92
  @click="toast.onClick && toast.onClick(toast)"
93
93
  />
@@ -95,7 +95,7 @@ function getOffset(index) {
95
95
  <ToastPortal v-bind="portalProps">
96
96
  <ToastViewport
97
97
  :data-expanded="expanded"
98
- :class="ui.viewport({ class: [props.class, props.ui?.viewport] })"
98
+ :class="ui.viewport({ class: [props.ui?.viewport, props.class] })"
99
99
  :style="{
100
100
  '--scale-factor': '0.05',
101
101
  '--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
@@ -14,6 +14,11 @@ export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'>
14
14
  * @defaultValue true
15
15
  */
16
16
  expand?: boolean;
17
+ /**
18
+ * Whether to show the progress bar on all toasts.
19
+ * @defaultValue true
20
+ */
21
+ progress?: boolean;
17
22
  /**
18
23
  * Render the toaster in a portal.
19
24
  * @defaultValue true
@@ -26,6 +31,7 @@ export interface ToasterSlots {
26
31
  default(props?: {}): any;
27
32
  }
28
33
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
34
+ progress: boolean;
29
35
  duration: number;
30
36
  expand: boolean;
31
37
  portal: boolean | string | HTMLElement;
@@ -61,7 +61,7 @@ const defaultExpanded = computed(
61
61
  <li
62
62
  v-for="(item, index) in items"
63
63
  :key="`${level}-${index}`"
64
- :class="level > 0 ? ui.itemWithChildren({ class: props.ui?.itemWithChildren }) : ui.item({ class: props.ui?.item })"
64
+ :class="level > 0 ? ui.itemWithChildren({ class: [props.ui?.itemWithChildren, item.ui?.itemWithChildren] }) : ui.item({ class: [props.ui?.item, item.ui?.item] })"
65
65
  >
66
66
  <TreeItem
67
67
  v-slot="{ isExpanded, isSelected }"
@@ -71,37 +71,37 @@ const defaultExpanded = computed(
71
71
  @toggle="item.onToggle"
72
72
  @select="item.onSelect"
73
73
  >
74
- <button :disabled="item.disabled || disabled" :class="ui.link({ class: props.ui?.link, selected: isSelected, disabled: item.disabled || disabled })">
74
+ <button :disabled="item.disabled || disabled" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], selected: isSelected, disabled: item.disabled || disabled })">
75
75
  <slot :name="item.slot || 'item'" v-bind="{ index, level, expanded: isExpanded, selected: isSelected }" :item="item">
76
76
  <slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" v-bind="{ index, level, expanded: isExpanded, selected: isSelected }" :item="item">
77
77
  <UIcon
78
78
  v-if="item.icon"
79
79
  :name="item.icon"
80
- :class="ui.linkLeadingIcon({ class: props.ui?.linkLeadingIcon })"
80
+ :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
81
81
  />
82
82
  <UIcon
83
83
  v-else-if="item.children?.length"
84
84
  :name="isExpanded ? expandedIcon ?? appConfig.ui.icons.folderOpen : collapsedIcon ?? appConfig.ui.icons.folder"
85
- :class="ui.linkLeadingIcon({ class: props.ui?.linkLeadingIcon })"
85
+ :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
86
86
  />
87
87
  </slot>
88
88
 
89
- <span v-if="getItemLabel(item) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.linkLabel({ class: props.ui?.linkLabel })">
89
+ <span v-if="getItemLabel(item) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })">
90
90
  <slot :name="item.slot ? `${item.slot}-label` : 'item-label'" v-bind="{ item, index, level, expanded: isExpanded, selected: isSelected }" :item="item">
91
91
  {{ getItemLabel(item) }}
92
92
  </slot>
93
93
  </span>
94
94
 
95
- <span v-if="item.trailingIcon || item.children?.length || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing']" :class="ui.linkTrailing({ class: props.ui?.linkTrailing })">
95
+ <span v-if="item.trailingIcon || item.children?.length || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing']" :class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })">
96
96
  <slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" v-bind="{ item, index, level, expanded: isExpanded, selected: isSelected }" :item="item">
97
- <UIcon v-if="item.trailingIcon" :name="item.trailingIcon" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon })" />
98
- <UIcon v-else-if="item.children?.length" :name="trailingIcon ?? appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon })" />
97
+ <UIcon v-if="item.trailingIcon" :name="item.trailingIcon" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon] })" />
98
+ <UIcon v-else-if="item.children?.length" :name="trailingIcon ?? appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon] })" />
99
99
  </slot>
100
100
  </span>
101
101
  </slot>
102
102
  </button>
103
103
 
104
- <ul v-if="item.children?.length && isExpanded" :class="ui.listWithChildren({ class: props.ui?.listWithChildren })">
104
+ <ul v-if="item.children?.length && isExpanded" :class="ui.listWithChildren({ class: [props.ui?.listWithChildren, item.ui?.listWithChildren] })">
105
105
  <ReuseTreeTemplate :items="item.children" :level="level + 1" />
106
106
  </ul>
107
107
  </TreeItem>
@@ -110,7 +110,7 @@ const defaultExpanded = computed(
110
110
 
111
111
  <TreeRoot
112
112
  v-bind="rootProps"
113
- :class="ui.root({ class: [props.class, props.ui?.root] })"
113
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
114
114
  :get-key="getItemValue"
115
115
  :default-expanded="defaultExpanded"
116
116
  :selection-behavior="selectionBehavior"
@@ -20,6 +20,8 @@ export type TreeItem = {
20
20
  children?: TreeItem[];
21
21
  onToggle?(e: Event): void;
22
22
  onSelect?(e?: Event): void;
23
+ class?: any;
24
+ ui?: Pick<Tree['slots'], 'item' | 'itemWithChildren' | 'link' | 'linkLeadingIcon' | 'linkLabel' | 'linkTrailing' | 'linkTrailingIcon' | 'listWithChildren'>;
23
25
  [key: string]: any;
24
26
  };
25
27
  export interface TreeProps<T extends TreeItem[] = TreeItem[], VK extends GetItemKeys<T> = 'value', M extends boolean = false> extends Pick<TreeRootProps<T>, 'expanded' | 'defaultExpanded' | 'selectionBehavior' | 'propagateSelect' | 'disabled'> {
@@ -13,7 +13,7 @@ type Props<T> = {
13
13
  };
14
14
  export declare const formOptionsInjectionKey: InjectionKey<ComputedRef<FormInjectedOptions>>;
15
15
  export declare const formBusInjectionKey: InjectionKey<UseEventBusReturn<FormEvent<any>, string>>;
16
- export declare const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>>>;
16
+ export declare const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>> | undefined>;
17
17
  export declare const inputIdInjectionKey: InjectionKey<Ref<string | undefined>>;
18
18
  export declare const formInputsInjectionKey: InjectionKey<Ref<Record<string, {
19
19
  id?: string;
@@ -1,4 +1,4 @@
1
- import { inject, computed } from "vue";
1
+ import { inject, computed, provide } from "vue";
2
2
  import { useDebounceFn } from "@vueuse/core";
3
3
  export const formOptionsInjectionKey = Symbol("nuxt-ui.form-options");
4
4
  export const formBusInjectionKey = Symbol("nuxt-ui.form-events");
@@ -12,6 +12,7 @@ export function useFormField(props, opts) {
12
12
  const formField = inject(formFieldInjectionKey, void 0);
13
13
  const formInputs = inject(formInputsInjectionKey, void 0);
14
14
  const inputId = inject(inputIdInjectionKey, void 0);
15
+ provide(formFieldInjectionKey, void 0);
15
16
  if (formField && inputId) {
16
17
  if (opts?.bind === false) {
17
18
  inputId.value = void 0;
@@ -7,10 +7,11 @@ import { computed } from "vue";
7
7
  import { defu } from "defu";
8
8
  import { useForwardProps } from "reka-ui";
9
9
  import { reactiveOmit } from "@vueuse/core";
10
- import { usePage, Link as InertiaLink } from "@inertiajs/vue3";
10
+ import { usePage } from "@inertiajs/vue3";
11
11
  import { hasProtocol } from "ufo";
12
12
  import { useAppConfig } from "#imports";
13
13
  import { tv } from "../../utils/tv";
14
+ import ULinkBase from "../../components/LinkBase.vue";
14
15
  defineOptions({ inheritAttrs: false });
15
16
  const props = defineProps({
16
17
  as: { type: null, required: false, default: "button" },
@@ -31,7 +32,6 @@ const props = defineProps({
31
32
  data: { type: Object, required: false },
32
33
  method: { type: String, required: false },
33
34
  headers: { type: Object, required: false },
34
- onClick: { type: Function, required: false },
35
35
  preserveScroll: { type: [Boolean, String, Function], required: false },
36
36
  preserveState: { type: [Boolean, String, Function], required: false },
37
37
  replace: { type: Boolean, required: false },
@@ -51,8 +51,9 @@ const props = defineProps({
51
51
  cacheFor: { type: [Number, String, Array], required: false }
52
52
  });
53
53
  defineSlots();
54
+ const page = usePage();
54
55
  const appConfig = useAppConfig();
55
- const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "activeClass", "inactiveClass", "to", "raw", "class"));
56
+ const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class"));
56
57
  const ui = computed(() => tv({
57
58
  extend: tv(theme),
58
59
  ...defu({
@@ -64,83 +65,68 @@ const ui = computed(() => tv({
64
65
  }
65
66
  }, appConfig.ui?.link || {})
66
67
  }));
68
+ const href = computed(() => props.to ?? props.href);
67
69
  const isExternal = computed(() => {
68
- if (!props.to) return false;
69
- return typeof props.to === "string" && hasProtocol(props.to, { acceptRelative: true });
70
+ if (props.external) {
71
+ return true;
72
+ }
73
+ if (!href.value) {
74
+ return false;
75
+ }
76
+ return typeof href.value === "string" && hasProtocol(href.value, { acceptRelative: true });
77
+ });
78
+ const isLinkActive = computed(() => {
79
+ if (props.active !== void 0) {
80
+ return props.active;
81
+ }
82
+ if (!href.value) {
83
+ return false;
84
+ }
85
+ if (props.exact && page.url === href.value) {
86
+ return true;
87
+ }
88
+ if (!props.exact && page.url.startsWith(href.value)) {
89
+ return true;
90
+ }
91
+ return false;
70
92
  });
71
93
  const linkClass = computed(() => {
72
- const active = isActive.value;
94
+ const active = isLinkActive.value;
73
95
  if (props.raw) {
74
96
  return [props.class, active ? props.activeClass : props.inactiveClass];
75
97
  }
76
98
  return ui.value({ class: props.class, active, disabled: props.disabled });
77
99
  });
78
- const page = usePage();
79
- const url = computed(() => props.to ?? props.href ?? "#");
80
- const isActive = computed(() => props.active || (props.exact ? url.value === props.href : page?.url.startsWith(url.value)));
81
100
  </script>
82
101
 
83
102
  <template>
84
- <template v-if="!isExternal">
85
- <InertiaLink v-bind="routerLinkProps" :href="url" custom>
86
- <template v-if="custom">
87
- <slot
88
- v-bind="{
89
- ...$attrs,
90
- as,
91
- type,
92
- disabled,
93
- href: url,
94
- active: isActive
95
- }"
96
- />
97
- </template>
98
- <ULinkBase
99
- v-else
100
- v-bind="{
103
+ <template v-if="custom">
104
+ <slot
105
+ v-bind="{
101
106
  ...$attrs,
107
+ ...routerLinkProps,
102
108
  as,
103
109
  type,
104
110
  disabled,
105
- href: url,
106
- active: isActive
111
+ href,
112
+ active: isLinkActive,
113
+ isExternal
107
114
  }"
108
- :class="linkClass"
109
- >
110
- <slot :active="isActive" />
111
- </ULinkBase>
112
- </InertiaLink>
115
+ />
113
116
  </template>
114
-
115
- <template v-else>
116
- <template v-if="custom">
117
- <slot
118
- v-bind="{
117
+ <ULinkBase
118
+ v-else
119
+ v-bind="{
119
120
  ...$attrs,
121
+ ...routerLinkProps,
120
122
  as,
121
123
  type,
122
124
  disabled,
123
- href: to,
124
- target: isExternal ? '_blank' : void 0,
125
- active: isActive
125
+ href,
126
+ isExternal
126
127
  }"
127
- />
128
- </template>
129
- <ULinkBase
130
- v-else
131
- v-bind="{
132
- ...$attrs,
133
- as,
134
- type,
135
- disabled,
136
- href: url,
137
- target: isExternal ? '_blank' : void 0,
138
- active: isActive
139
- }"
140
- :is-external="isExternal"
141
- :class="linkClass"
142
- >
143
- <slot :active="isActive" />
144
- </ULinkBase>
145
- </template>
128
+ :class="linkClass"
129
+ >
130
+ <slot :active="isLinkActive" />
131
+ </ULinkBase>
146
132
  </template>
@@ -1,6 +1,6 @@
1
1
  import type { ButtonHTMLAttributes } from 'vue';
2
2
  import type { InertiaLinkProps } from '@inertiajs/vue3';
3
- interface NuxtLinkProps extends Omit<InertiaLinkProps, 'href'> {
3
+ interface NuxtLinkProps extends Omit<InertiaLinkProps, 'href' | 'onClick'> {
4
4
  activeClass?: string;
5
5
  /**
6
6
  * Route Location the link should navigate to when clicked on.
@@ -0,0 +1,68 @@
1
+ <script>
2
+
3
+ </script>
4
+
5
+ <script setup>
6
+ import { Primitive } from "reka-ui";
7
+ import { Link as InertiaLink } from "@inertiajs/vue3";
8
+ defineOptions({ inheritAttrs: false });
9
+ const props = defineProps({
10
+ as: { type: String, required: false, default: "button" },
11
+ type: { type: String, required: false, default: "button" },
12
+ disabled: { type: Boolean, required: false },
13
+ onClick: { type: [Function, Array], required: false },
14
+ href: { type: String, required: false },
15
+ target: { type: [String, Object, null], required: false },
16
+ active: { type: Boolean, required: false },
17
+ isExternal: { type: Boolean, required: false }
18
+ });
19
+ function onClickWrapper(e) {
20
+ if (props.disabled) {
21
+ e.stopPropagation();
22
+ e.preventDefault();
23
+ return;
24
+ }
25
+ if (props.onClick) {
26
+ for (const onClick of Array.isArray(props.onClick) ? props.onClick : [props.onClick]) {
27
+ onClick(e);
28
+ }
29
+ }
30
+ }
31
+ </script>
32
+
33
+ <template>
34
+ <InertiaLink
35
+ v-if="!!href && !isExternal && !disabled"
36
+ :href="href"
37
+ v-bind="{
38
+ target: target || (isExternal ? '_blank' : void 0),
39
+ ...$attrs
40
+ }"
41
+ @click="onClickWrapper"
42
+ >
43
+ <slot />
44
+ </InertiaLink>
45
+ <Primitive
46
+ v-else
47
+ v-bind="href ? {
48
+ 'as': 'a',
49
+ 'href': disabled ? void 0 : href,
50
+ 'aria-disabled': disabled ? 'true' : void 0,
51
+ 'role': disabled ? 'link' : void 0,
52
+ 'tabindex': disabled ? -1 : void 0,
53
+ 'target': target || (isExternal ? '_blank' : void 0),
54
+ ...$attrs
55
+ } : as === 'button' ? {
56
+ as,
57
+ type,
58
+ disabled,
59
+ ...$attrs
60
+ } : {
61
+ as,
62
+ ...$attrs
63
+ }"
64
+ @click="onClickWrapper"
65
+ >
66
+ <slot />
67
+ </Primitive>
68
+ </template>
@@ -0,0 +1,25 @@
1
+ import type { LinkProps } from '../../types';
2
+ export interface LinkBaseProps {
3
+ as?: string;
4
+ type?: string;
5
+ disabled?: boolean;
6
+ onClick?: ((e: MouseEvent) => void | Promise<void>) | Array<((e: MouseEvent) => void | Promise<void>)>;
7
+ href?: string;
8
+ target?: LinkProps['target'];
9
+ active?: boolean;
10
+ isExternal?: boolean;
11
+ }
12
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<LinkBaseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkBaseProps> & Readonly<{}>, {
13
+ type: string;
14
+ as: string;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
16
+ default?: (props: {}) => any;
17
+ } & {
18
+ default?: (props: {}) => any;
19
+ }>;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -1,6 +1,7 @@
1
1
  import type { Ref } from 'vue';
2
2
  import type { NuxtApp } from '#app';
3
3
  export { useHead } from '@unhead/vue';
4
+ export { useAppConfig } from '../vue/composables/useAppConfig';
4
5
  export { defineShortcuts } from '../composables/defineShortcuts';
5
6
  export { defineLocale } from '../composables/defineLocale';
6
7
  export { useLocale } from '../composables/useLocale';
@@ -17,7 +18,6 @@ export declare const useColorMode: () => {
17
18
  readonly value: import("@vueuse/core").BasicColorMode;
18
19
  forced: boolean;
19
20
  };
20
- export declare const useAppConfig: () => any;
21
21
  export declare const useCookie: <T = string>(_name: string, _options?: Record<string, any>) => {
22
22
  value: Ref<T, T>;
23
23
  get: () => T;
@@ -4,6 +4,7 @@ import appConfig from "#build/app.config";
4
4
  import { useColorMode as useColorModeVueUse } from "@vueuse/core";
5
5
  import { usePage } from "@inertiajs/vue3";
6
6
  export { useHead } from "@unhead/vue";
7
+ export { useAppConfig } from "../vue/composables/useAppConfig.js";
7
8
  export { defineShortcuts } from "../composables/defineShortcuts.js";
8
9
  export { defineLocale } from "../composables/defineLocale.js";
9
10
  export { useLocale } from "../composables/useLocale.js";
@@ -35,7 +36,6 @@ export const useColorMode = () => {
35
36
  forced: false
36
37
  };
37
38
  };
38
- export const useAppConfig = () => appConfig;
39
39
  export const useCookie = (_name, _options = {}) => {
40
40
  const value = ref(null);
41
41
  return {
@@ -21,9 +21,13 @@ export { default as hy } from './hy';
21
21
  export { default as id } from './id';
22
22
  export { default as it } from './it';
23
23
  export { default as ja } from './ja';
24
- export { default as km } from './km';
25
24
  export { default as kk } from './kk';
25
+ export { default as km } from './km';
26
26
  export { default as ko } from './ko';
27
+ export { default as ky } from './ky';
28
+ export { default as lt } from './lt';
29
+ export { default as mn } from './mn';
30
+ export { default as ms } from './ms';
27
31
  export { default as nb_no } from './nb_no';
28
32
  export { default as nl } from './nl';
29
33
  export { default as pl } from './pl';
@@ -32,12 +36,13 @@ export { default as pt_br } from './pt_br';
32
36
  export { default as ro } from './ro';
33
37
  export { default as ru } from './ru';
34
38
  export { default as sk } from './sk';
39
+ export { default as sl } from './sl';
35
40
  export { default as sv } from './sv';
36
41
  export { default as th } from './th';
37
42
  export { default as tj } from './tj';
38
43
  export { default as tr } from './tr';
39
- export { default as uk } from './uk';
40
44
  export { default as ug_cn } from './ug_cn';
45
+ export { default as uk } from './uk';
41
46
  export { default as ur } from './ur';
42
47
  export { default as uz } from './uz';
43
48
  export { default as vi } from './vi';
@@ -21,9 +21,13 @@ export { default as hy } from "./hy.js";
21
21
  export { default as id } from "./id.js";
22
22
  export { default as it } from "./it.js";
23
23
  export { default as ja } from "./ja.js";
24
- export { default as km } from "./km.js";
25
24
  export { default as kk } from "./kk.js";
25
+ export { default as km } from "./km.js";
26
26
  export { default as ko } from "./ko.js";
27
+ export { default as ky } from "./ky.js";
28
+ export { default as lt } from "./lt.js";
29
+ export { default as mn } from "./mn.js";
30
+ export { default as ms } from "./ms.js";
27
31
  export { default as nb_no } from "./nb_no.js";
28
32
  export { default as nl } from "./nl.js";
29
33
  export { default as pl } from "./pl.js";
@@ -32,12 +36,13 @@ export { default as pt_br } from "./pt_br.js";
32
36
  export { default as ro } from "./ro.js";
33
37
  export { default as ru } from "./ru.js";
34
38
  export { default as sk } from "./sk.js";
39
+ export { default as sl } from "./sl.js";
35
40
  export { default as sv } from "./sv.js";
36
41
  export { default as th } from "./th.js";
37
42
  export { default as tj } from "./tj.js";
38
43
  export { default as tr } from "./tr.js";
39
- export { default as uk } from "./uk.js";
40
44
  export { default as ug_cn } from "./ug_cn.js";
45
+ export { default as uk } from "./uk.js";
41
46
  export { default as ur } from "./ur.js";
42
47
  export { default as uz } from "./uz.js";
43
48
  export { default as vi } from "./vi.js";
@@ -0,0 +1,3 @@
1
+ import type { Messages } from '../types';
2
+ declare const _default: import("../types").Locale<Messages>;
3
+ export default _default;