@nuxt/ui 3.0.0-alpha.11 → 3.0.0-alpha.13

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 (174) hide show
  1. package/.nuxt/ui/accordion.ts +2 -2
  2. package/.nuxt/ui/alert.ts +47 -37
  3. package/.nuxt/ui/avatar-group.ts +1 -1
  4. package/.nuxt/ui/avatar.ts +4 -4
  5. package/.nuxt/ui/badge.ts +37 -28
  6. package/.nuxt/ui/breadcrumb.ts +5 -5
  7. package/.nuxt/ui/button.ts +42 -43
  8. package/.nuxt/ui/calendar.ts +15 -15
  9. package/.nuxt/ui/card.ts +27 -1
  10. package/.nuxt/ui/carousel.ts +2 -2
  11. package/.nuxt/ui/checkbox.ts +18 -18
  12. package/.nuxt/ui/chip.ts +8 -8
  13. package/.nuxt/ui/color-picker.ts +2 -2
  14. package/.nuxt/ui/command-palette.ts +12 -12
  15. package/.nuxt/ui/container.ts +1 -1
  16. package/.nuxt/ui/context-menu.ts +32 -32
  17. package/.nuxt/ui/drawer.ts +72 -11
  18. package/.nuxt/ui/dropdown-menu.ts +33 -33
  19. package/.nuxt/ui/form-field.ts +6 -6
  20. package/.nuxt/ui/input-menu.ts +41 -41
  21. package/.nuxt/ui/input-number.ts +20 -20
  22. package/.nuxt/ui/input.ts +23 -23
  23. package/.nuxt/ui/kbd.ts +4 -4
  24. package/.nuxt/ui/link.ts +3 -3
  25. package/.nuxt/ui/modal.ts +5 -5
  26. package/.nuxt/ui/navigation-menu.ts +144 -77
  27. package/.nuxt/ui/pin-input.ts +20 -20
  28. package/.nuxt/ui/popover.ts +2 -2
  29. package/.nuxt/ui/progress.ts +17 -17
  30. package/.nuxt/ui/radio-group.ts +20 -20
  31. package/.nuxt/ui/select-menu.ts +33 -32
  32. package/.nuxt/ui/select.ts +31 -31
  33. package/.nuxt/ui/separator.ts +8 -8
  34. package/.nuxt/ui/skeleton.ts +1 -1
  35. package/.nuxt/ui/slideover.ts +4 -4
  36. package/.nuxt/ui/slider.ts +16 -16
  37. package/.nuxt/ui/stepper.ts +18 -18
  38. package/.nuxt/ui/switch.ts +20 -20
  39. package/.nuxt/ui/table.ts +16 -16
  40. package/.nuxt/ui/tabs.ts +33 -33
  41. package/.nuxt/ui/textarea.ts +23 -23
  42. package/.nuxt/ui/toast.ts +42 -32
  43. package/.nuxt/ui/toaster.ts +4 -4
  44. package/.nuxt/ui/tooltip.ts +2 -2
  45. package/.nuxt/ui.css +90 -0
  46. package/README.md +2 -2
  47. package/cli/package.json +2 -2
  48. package/cli/templates.mjs +7 -7
  49. package/dist/chunks/component-meta.cjs +2590 -2511
  50. package/dist/chunks/component-meta.mjs +2590 -2511
  51. package/dist/client/devtools/200.html +1 -1
  52. package/dist/client/devtools/404.html +1 -1
  53. package/dist/client/devtools/_nuxt/CG6Dc4jp.js +1 -0
  54. package/dist/client/devtools/_nuxt/{Dtz-o9GB.js → DrNJgD08.js} +1 -1
  55. package/dist/client/devtools/_nuxt/{DNZFyo26.js → ElqrUh1r.js} +1 -1
  56. package/dist/client/devtools/_nuxt/builds/latest.json +1 -1
  57. package/dist/client/devtools/_nuxt/builds/meta/255c8d0b-7281-4d74-b4b6-ec96e6721aa0.json +1 -0
  58. package/dist/client/devtools/_nuxt/entry.Hn8drx4g.css +1 -0
  59. package/dist/client/devtools/_nuxt/error-404.Dew7w9Ee.css +1 -0
  60. package/dist/client/devtools/_nuxt/error-500.Dep59i31.css +1 -0
  61. package/dist/client/devtools/_nuxt/mC2e7kOs.js +57 -0
  62. package/dist/client/devtools/index.html +1 -1
  63. package/dist/devtools/runtime/examples/CardExample.vue +3 -3
  64. package/dist/devtools/runtime/examples/CollapsibleExample.vue +1 -1
  65. package/dist/devtools/runtime/examples/ContainerExample.vue +1 -1
  66. package/dist/devtools/runtime/examples/ContextMenuExample.vue +1 -1
  67. package/dist/devtools/runtime/examples/PopoverExample.vue +1 -1
  68. package/dist/devtools/runtime/examples/TooltipExample.vue +1 -1
  69. package/dist/module.cjs +2 -1
  70. package/dist/module.json +1 -1
  71. package/dist/module.mjs +2 -1
  72. package/dist/runtime/components/Accordion.vue +2 -2
  73. package/dist/runtime/components/Alert.vue +15 -12
  74. package/dist/runtime/components/App.vue +3 -3
  75. package/dist/runtime/components/Avatar.vue +31 -10
  76. package/dist/runtime/components/AvatarGroup.vue +2 -2
  77. package/dist/runtime/components/Badge.vue +7 -3
  78. package/dist/runtime/components/Breadcrumb.vue +2 -2
  79. package/dist/runtime/components/Button.vue +2 -2
  80. package/dist/runtime/components/ButtonGroup.vue +2 -2
  81. package/dist/runtime/components/Calendar.vue +6 -3
  82. package/dist/runtime/components/Card.vue +8 -4
  83. package/dist/runtime/components/Carousel.vue +2 -2
  84. package/dist/runtime/components/Checkbox.vue +4 -4
  85. package/dist/runtime/components/Chip.vue +2 -2
  86. package/dist/runtime/components/Collapsible.vue +2 -2
  87. package/dist/runtime/components/ColorPicker.vue +46 -15
  88. package/dist/runtime/components/CommandPalette.vue +48 -41
  89. package/dist/runtime/components/Container.vue +2 -2
  90. package/dist/runtime/components/ContextMenu.vue +10 -2
  91. package/dist/runtime/components/ContextMenuContent.vue +4 -2
  92. package/dist/runtime/components/Drawer.vue +9 -3
  93. package/dist/runtime/components/DropdownMenu.vue +10 -2
  94. package/dist/runtime/components/DropdownMenuContent.vue +4 -2
  95. package/dist/runtime/components/Form.vue +46 -17
  96. package/dist/runtime/components/FormField.vue +12 -6
  97. package/dist/runtime/components/Input.vue +5 -4
  98. package/dist/runtime/components/InputMenu.vue +6 -5
  99. package/dist/runtime/components/InputNumber.vue +10 -6
  100. package/dist/runtime/components/Kbd.vue +2 -2
  101. package/dist/runtime/components/Link.vue +2 -2
  102. package/dist/runtime/components/Modal.vue +17 -3
  103. package/dist/runtime/components/NavigationMenu.vue +110 -67
  104. package/dist/runtime/components/Pagination.vue +2 -2
  105. package/dist/runtime/components/PinInput.vue +5 -4
  106. package/dist/runtime/components/Popover.vue +2 -2
  107. package/dist/runtime/components/Progress.vue +2 -2
  108. package/dist/runtime/components/RadioGroup.vue +4 -4
  109. package/dist/runtime/components/Select.vue +9 -7
  110. package/dist/runtime/components/SelectMenu.vue +67 -64
  111. package/dist/runtime/components/Separator.vue +2 -2
  112. package/dist/runtime/components/Skeleton.vue +2 -2
  113. package/dist/runtime/components/Slideover.vue +17 -3
  114. package/dist/runtime/components/Slider.vue +4 -4
  115. package/dist/runtime/components/Stepper.vue +3 -3
  116. package/dist/runtime/components/Switch.vue +4 -4
  117. package/dist/runtime/components/Table.vue +96 -18
  118. package/dist/runtime/components/Tabs.vue +2 -2
  119. package/dist/runtime/components/Textarea.vue +7 -5
  120. package/dist/runtime/components/Toast.vue +28 -16
  121. package/dist/runtime/components/Toaster.vue +4 -4
  122. package/dist/runtime/components/Tooltip.vue +2 -2
  123. package/dist/runtime/composables/useFormField.d.ts +6 -2
  124. package/dist/runtime/composables/useFormField.js +18 -11
  125. package/dist/runtime/composables/useToast.d.ts +4 -3
  126. package/dist/runtime/composables/useToast.js +20 -6
  127. package/dist/runtime/index.css +1 -1
  128. package/dist/runtime/locale/az.js +54 -0
  129. package/dist/runtime/locale/bn.js +54 -0
  130. package/dist/runtime/locale/es.js +2 -2
  131. package/dist/runtime/locale/he.d.ts +2 -0
  132. package/dist/runtime/locale/he.js +53 -0
  133. package/dist/runtime/locale/hi.d.ts +2 -0
  134. package/dist/runtime/locale/hi.js +54 -0
  135. package/dist/runtime/locale/hu.d.ts +2 -0
  136. package/dist/runtime/locale/hu.js +54 -0
  137. package/dist/runtime/locale/index.d.ts +8 -2
  138. package/dist/runtime/locale/index.js +8 -2
  139. package/dist/runtime/locale/km.d.ts +2 -0
  140. package/dist/runtime/locale/km.js +54 -0
  141. package/dist/runtime/locale/nb_no.d.ts +2 -0
  142. package/dist/runtime/locale/nb_no.js +54 -0
  143. package/dist/runtime/locale/zh_cn.d.ts +2 -0
  144. package/dist/runtime/locale/{zh_hans.js → zh_cn.js} +1 -1
  145. package/dist/runtime/locale/zh_tw.d.ts +2 -0
  146. package/dist/runtime/locale/{zh_hant.js → zh_tw.js} +1 -1
  147. package/dist/runtime/plugins/colors.js +8 -5
  148. package/dist/runtime/types/form.d.ts +21 -12
  149. package/dist/runtime/types/index.d.ts +1 -0
  150. package/dist/runtime/types/index.js +1 -0
  151. package/dist/runtime/types/utils.d.ts +5 -0
  152. package/dist/runtime/utils/form.js +3 -5
  153. package/dist/runtime/utils/tv.js +2 -2
  154. package/dist/runtime/vue/components/Link.vue +77 -18
  155. package/dist/shared/{ui.DCjJwb6l.cjs → ui.C5FzRWM5.cjs} +529 -366
  156. package/dist/shared/{ui.BKsd22-Q.mjs → ui.DCZM2pl8.mjs} +525 -366
  157. package/dist/unplugin.cjs +44 -20
  158. package/dist/unplugin.d.cts +10 -0
  159. package/dist/unplugin.d.mts +10 -0
  160. package/dist/unplugin.d.ts +10 -0
  161. package/dist/unplugin.mjs +43 -19
  162. package/dist/vite.cjs +3 -2
  163. package/dist/vite.d.cts +2 -0
  164. package/dist/vite.d.mts +2 -0
  165. package/dist/vite.d.ts +2 -0
  166. package/dist/vite.mjs +3 -2
  167. package/package.json +67 -41
  168. package/dist/client/devtools/_nuxt/CQ-XZFu7.js +0 -54
  169. package/dist/client/devtools/_nuxt/builds/meta/1f5fbd7b-9d97-480e-9ae4-e02b4ff7018b.json +0 -1
  170. package/dist/client/devtools/_nuxt/entry.qOdop8tq.css +0 -1
  171. package/dist/client/devtools/_nuxt/error-404.D-rS9BDk.css +0 -1
  172. package/dist/client/devtools/_nuxt/error-500.CfcCHs91.css +0 -1
  173. /package/dist/runtime/locale/{zh_hans.d.ts → az.d.ts} +0 -0
  174. /package/dist/runtime/locale/{zh_hant.d.ts → bn.d.ts} +0 -0
@@ -4,10 +4,11 @@ import type { AppConfig } from '@nuxt/schema'
4
4
  import _appConfig from '#build/app.config'
5
5
  import theme from '#build/ui/textarea'
6
6
  import { tv } from '../utils/tv'
7
+ import type { PartialString } from '../types/utils'
7
8
 
8
- const appConfig = _appConfig as AppConfig & { ui: { textarea: Partial<typeof theme> } }
9
+ const appConfigTextarea = _appConfig as AppConfig & { ui: { textarea: Partial<typeof theme> } }
9
10
 
10
- const textarea = tv({ extend: tv(theme), ...(appConfig.ui?.textarea || {}) })
11
+ const textarea = tv({ extend: tv(theme), ...(appConfigTextarea.ui?.textarea || {}) })
11
12
 
12
13
  type TextareaVariants = VariantProps<typeof textarea>
13
14
 
@@ -34,7 +35,7 @@ export interface TextareaProps {
34
35
  autoresize?: boolean
35
36
  /** Highlight the ring color like a focus state. */
36
37
  highlight?: boolean
37
- ui?: Partial<typeof textarea.slots>
38
+ ui?: PartialString<typeof textarea.slots>
38
39
  }
39
40
 
40
41
  export interface TextareaEmits {
@@ -66,7 +67,7 @@ const emits = defineEmits<TextareaEmits>()
66
67
 
67
68
  const [modelValue, modelModifiers] = defineModel<string | number>()
68
69
 
69
- const { emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled } = useFormField<TextareaProps>(props, { deferInputValidation: true })
70
+ const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField<TextareaProps>(props, { deferInputValidation: true })
70
71
 
71
72
  const ui = computed(() => textarea({
72
73
  color: color.value,
@@ -185,10 +186,11 @@ onMounted(() => {
185
186
  :class="ui.base({ class: props.ui?.base })"
186
187
  :disabled="disabled"
187
188
  :required="required"
188
- v-bind="$attrs"
189
+ v-bind="{ ...$attrs, ...ariaAttrs }"
189
190
  @input="onInput"
190
191
  @blur="onBlur"
191
192
  @change="onChange"
193
+ @focus="emitFormFocus"
192
194
  />
193
195
 
194
196
  <slot />
@@ -7,10 +7,11 @@ import theme from '#build/ui/toast'
7
7
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
8
8
  import { tv } from '../utils/tv'
9
9
  import type { AvatarProps, ButtonProps } from '../types'
10
+ import type { StringOrVNode } from '../types/utils'
10
11
 
11
- const appConfig = _appConfig as AppConfig & { ui: { toast: Partial<typeof theme> } }
12
+ const appConfigToast = _appConfig as AppConfig & { ui: { toast: Partial<typeof theme> } }
12
13
 
13
- const toast = tv({ extend: tv(theme), ...(appConfig.ui?.toast || {}) })
14
+ const toast = tv({ extend: tv(theme), ...(appConfigToast.ui?.toast || {}) })
14
15
 
15
16
  type ToastVariants = VariantProps<typeof toast>
16
17
 
@@ -20,15 +21,16 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
20
21
  * @defaultValue 'li'
21
22
  */
22
23
  as?: any
23
- title?: string
24
- description?: string
24
+ title?: StringOrVNode
25
+ description?: StringOrVNode
25
26
  icon?: string
26
27
  avatar?: AvatarProps
27
28
  color?: ToastVariants['color']
29
+ orientation?: ToastVariants['orientation']
28
30
  /**
29
31
  * Display a list of actions:
30
- * - under the title and description if multiline
31
- * - next to the close button if not multiline
32
+ * - under the title and description when orientation is `vertical`
33
+ * - next to the close button when orientation is `horizontal`
32
34
  * `{ size: 'xs' }`{lang="ts-type"}
33
35
  */
34
36
  actions?: ButtonProps[]
@@ -71,7 +73,8 @@ import UAvatar from './Avatar.vue'
71
73
  import UButton from './Button.vue'
72
74
 
73
75
  const props = withDefaults(defineProps<ToastProps>(), {
74
- close: true
76
+ close: true,
77
+ orientation: 'vertical'
75
78
  })
76
79
  const emits = defineEmits<ToastEmits>()
77
80
  const slots = defineSlots<ToastSlots>()
@@ -81,10 +84,10 @@ const appConfig = useAppConfig()
81
84
 
82
85
  const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'defaultOpen', 'open', 'duration', 'type'), emits)
83
86
 
84
- const multiline = computed(() => !!props.title && !!props.description)
85
-
86
87
  const ui = computed(() => toast({
87
- color: props.color
88
+ color: props.color,
89
+ orientation: props.orientation,
90
+ title: !!props.title || !!slots.title
88
91
  }))
89
92
 
90
93
  const el = ref()
@@ -110,7 +113,8 @@ defineExpose({
110
113
  ref="el"
111
114
  v-slot="{ remaining, duration }"
112
115
  v-bind="rootProps"
113
- :class="ui.root({ class: [props.class, props.ui?.root], multiline })"
116
+ :data-orientation="orientation"
117
+ :class="ui.root({ class: [props.class, props.ui?.root] })"
114
118
  :style="{ '--height': height }"
115
119
  >
116
120
  <slot name="leading">
@@ -121,16 +125,24 @@ defineExpose({
121
125
  <div :class="ui.wrapper({ class: props.ui?.wrapper })">
122
126
  <ToastTitle v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
123
127
  <slot name="title">
124
- {{ title }}
128
+ <component :is="title()" v-if="typeof title === 'function'" />
129
+ <component :is="title" v-else-if="typeof title === 'object'" />
130
+ <template v-else>
131
+ {{ title }}
132
+ </template>
125
133
  </slot>
126
134
  </ToastTitle>
127
135
  <ToastDescription v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
128
136
  <slot name="description">
129
- {{ description }}
137
+ <component :is="description()" v-if="typeof description === 'function'" />
138
+ <component :is="description" v-else-if="typeof description === 'object'" />
139
+ <template v-else>
140
+ {{ description }}
141
+ </template>
130
142
  </slot>
131
143
  </ToastDescription>
132
144
 
133
- <div v-if="multiline && actions?.length" :class="ui.actions({ class: props.ui?.actions, multiline: true })">
145
+ <div v-if="orientation === 'vertical' && actions?.length" :class="ui.actions({ class: props.ui?.actions })">
134
146
  <slot name="actions">
135
147
  <ToastAction v-for="(action, index) in actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
136
148
  <UButton size="xs" :color="color" v-bind="action" />
@@ -139,8 +151,8 @@ defineExpose({
139
151
  </div>
140
152
  </div>
141
153
 
142
- <div v-if="(!multiline && actions?.length) || close !== null" :class="ui.actions({ class: props.ui?.actions, multiline: false })">
143
- <template v-if="!multiline">
154
+ <div v-if="(orientation === 'horizontal' && actions?.length) || close" :class="ui.actions({ class: props.ui?.actions, orientation: 'horizontal' })">
155
+ <template v-if="orientation === 'horizontal' && actions?.length">
144
156
  <slot name="actions">
145
157
  <ToastAction v-for="(action, index) in actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
146
158
  <UButton size="xs" :color="color" v-bind="action" />
@@ -7,9 +7,9 @@ import theme from '#build/ui/toaster'
7
7
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
8
8
  import { tv } from '../utils/tv'
9
9
 
10
- const appConfig = _appConfig as AppConfig & { ui: { toaster: Partial<typeof theme> } }
10
+ const appConfigToaster = _appConfig as AppConfig & { ui: { toaster: Partial<typeof theme> } }
11
11
 
12
- const toaster = tv({ extend: tv(theme), ...(appConfig.ui?.toaster || {}) })
12
+ const toaster = tv({ extend: tv(theme), ...(appConfigToaster.ui?.toaster || {}) })
13
13
 
14
14
  type ToasterVariants = VariantProps<typeof toaster>
15
15
 
@@ -121,10 +121,10 @@ function getOffset(index: number) {
121
121
  '--transform': 'translateY(var(--translate)) scale(var(--scale))'
122
122
  }"
123
123
  :class="[ui.base(), {
124
- 'cursor-pointer': !!toast.click
124
+ 'cursor-pointer': !!toast.onClick
125
125
  }]"
126
126
  @update:open="onUpdateOpen($event, toast.id)"
127
- @click="toast.click && toast.click(toast)"
127
+ @click="toast.onClick && toast.onClick(toast)"
128
128
  />
129
129
 
130
130
  <ToastPortal :disabled="!portal">
@@ -7,9 +7,9 @@ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
7
7
  import { tv } from '../utils/tv'
8
8
  import type { KbdProps } from '../types'
9
9
 
10
- const appConfig = _appConfig as AppConfig & { ui: { tooltip: Partial<typeof theme> } }
10
+ const appConfigTooltip = _appConfig as AppConfig & { ui: { tooltip: Partial<typeof theme> } }
11
11
 
12
- const tooltip = tv({ extend: tv(theme), ...(appConfig.ui?.tooltip || {}) })
12
+ const tooltip = tv({ extend: tv(theme), ...(appConfigTooltip.ui?.tooltip || {}) })
13
13
 
14
14
  export interface TooltipProps extends TooltipRootProps {
15
15
  /** The text content of the tooltip. */
@@ -8,12 +8,11 @@ type Props<T> = {
8
8
  name?: string;
9
9
  size?: GetObjectField<T, 'size'>;
10
10
  color?: GetObjectField<T, 'color'>;
11
- legend?: string;
12
11
  highlight?: boolean;
13
12
  disabled?: boolean;
14
13
  };
15
14
  export declare const formOptionsInjectionKey: InjectionKey<ComputedRef<FormInjectedOptions>>;
16
- export declare const formBusInjectionKey: InjectionKey<UseEventBusReturn<FormEvent, string>>;
15
+ export declare const formBusInjectionKey: InjectionKey<UseEventBusReturn<FormEvent<any>, string>>;
17
16
  export declare const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>>>;
18
17
  export declare const inputIdInjectionKey: InjectionKey<Ref<string | undefined>>;
19
18
  export declare const formInputsInjectionKey: InjectionKey<Ref<Record<string, {
@@ -34,5 +33,10 @@ export declare function useFormField<T>(props?: Props<T>, opts?: {
34
33
  emitFormBlur: () => void;
35
34
  emitFormInput: import("@vueuse/core").PromisifyFn<() => void>;
36
35
  emitFormChange: () => void;
36
+ emitFormFocus: () => void;
37
+ ariaAttrs: ComputedRef<{
38
+ 'aria-describedby': string;
39
+ 'aria-invalid': boolean;
40
+ } | undefined>;
37
41
  };
38
42
  export {};
@@ -1,4 +1,4 @@
1
- import { inject, ref, computed } from "vue";
1
+ import { inject, computed } 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");
@@ -13,7 +13,7 @@ export function useFormField(props, opts) {
13
13
  const formInputs = inject(formInputsInjectionKey, void 0);
14
14
  const inputId = inject(inputIdInjectionKey, void 0);
15
15
  if (formField && inputId) {
16
- if (opts?.bind === false || props?.legend) {
16
+ if (opts?.bind === false) {
17
17
  inputId.value = void 0;
18
18
  } else if (props?.id) {
19
19
  inputId.value = props?.id;
@@ -22,25 +22,23 @@ export function useFormField(props, opts) {
22
22
  formInputs.value[formField.value.name] = { id: inputId.value, pattern: formField.value.errorPattern };
23
23
  }
24
24
  }
25
- const touched = ref(false);
26
- function emitFormEvent(type, name) {
25
+ function emitFormEvent(type, name, eager) {
27
26
  if (formBus && formField && name) {
28
- formBus.emit({ type, name });
27
+ formBus.emit({ type, name, eager });
29
28
  }
30
29
  }
31
30
  function emitFormBlur() {
32
- touched.value = true;
33
31
  emitFormEvent("blur", formField?.value.name);
34
32
  }
33
+ function emitFormFocus() {
34
+ emitFormEvent("focus", formField?.value.name);
35
+ }
35
36
  function emitFormChange() {
36
- touched.value = true;
37
37
  emitFormEvent("change", formField?.value.name);
38
38
  }
39
39
  const emitFormInput = useDebounceFn(
40
40
  () => {
41
- if (!opts?.deferInputValidation || touched.value || formField?.value.eagerValidation) {
42
- emitFormEvent("input", formField?.value.name);
43
- }
41
+ emitFormEvent("input", formField?.value.name, !opts?.deferInputValidation || formField?.value.eagerValidation);
44
42
  },
45
43
  formField?.value.validateOnInputDelay ?? formOptions?.value.validateOnInputDelay ?? 0
46
44
  );
@@ -53,6 +51,15 @@ export function useFormField(props, opts) {
53
51
  disabled: computed(() => formOptions?.value.disabled || props?.disabled),
54
52
  emitFormBlur,
55
53
  emitFormInput,
56
- emitFormChange
54
+ emitFormChange,
55
+ emitFormFocus,
56
+ ariaAttrs: computed(() => {
57
+ if (!formField?.value) return;
58
+ const descriptiveAttrs = ["error", "hint", "description"].filter((type) => formField?.value?.[type]).map((type) => `${formField?.value.ariaId}-${type}`) || [];
59
+ return {
60
+ "aria-describedby": descriptiveAttrs.join(" "),
61
+ "aria-invalid": !!formField?.value.error
62
+ };
63
+ })
57
64
  };
58
65
  }
@@ -1,7 +1,8 @@
1
- import type { ToastProps } from '../types';
2
- export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
1
+ import type { ToastProps, ToastEmits } from '../types';
2
+ import type { EmitsToProps } from '../types/utils';
3
+ export interface Toast extends Omit<ToastProps, 'defaultOpen'>, EmitsToProps<ToastEmits> {
3
4
  id: string | number;
4
- click?: (toast: Toast) => void;
5
+ onClick?: (toast: Toast) => void;
5
6
  }
6
7
  export declare function useToast(): {
7
8
  toasts: import("vue").Ref<Toast[], Toast[]>;
@@ -1,17 +1,31 @@
1
+ import { ref, nextTick } from "vue";
1
2
  import { useState } from "#imports";
2
3
  export function useToast() {
3
4
  const toasts = useState("toasts", () => []);
5
+ const maxToasts = 5;
6
+ const running = ref(false);
7
+ const queue = [];
8
+ const generateId = () => `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
9
+ async function processQueue() {
10
+ if (running.value || queue.length === 0) {
11
+ return;
12
+ }
13
+ running.value = true;
14
+ while (queue.length > 0) {
15
+ const toast = queue.shift();
16
+ await nextTick();
17
+ toasts.value = [...toasts.value, toast].slice(-maxToasts);
18
+ }
19
+ running.value = false;
20
+ }
4
21
  function add(toast) {
5
22
  const body = {
6
- id: (/* @__PURE__ */ new Date()).getTime().toString(),
23
+ id: generateId(),
7
24
  open: true,
8
25
  ...toast
9
26
  };
10
- const index = toasts.value.findIndex((t) => t.id === body.id);
11
- if (index === -1) {
12
- toasts.value.push(body);
13
- }
14
- toasts.value = toasts.value.slice(-5);
27
+ queue.push(body);
28
+ processQueue();
15
29
  return body;
16
30
  }
17
31
  function update(id, toast) {
@@ -1 +1 @@
1
- @import "./keyframes.css";@variant dark (&:where(.dark, .dark *));@layer base{body{@apply antialiased text-[var(--ui-text)] bg-[var(--ui-bg)] scheme-light dark:scheme-dark}:root{--ui-text-dimmed:var(--ui-color-neutral-400);--ui-text-muted:var(--ui-color-neutral-500);--ui-text-toned:var(--ui-color-neutral-600);--ui-text:var(--ui-color-neutral-700);--ui-text-highlighted:var(--ui-color-neutral-900);--ui-bg:var(--color-white);--ui-bg-muted:var(--ui-color-neutral-50);--ui-bg-elevated:var(--ui-color-neutral-100);--ui-bg-accented:var(--ui-color-neutral-200);--ui-bg-inverted:var(--ui-color-neutral-900);--ui-border:var(--ui-color-neutral-200);--ui-border-muted:var(--ui-color-neutral-200);--ui-border-accented:var(--ui-color-neutral-300);--ui-border-inverted:var(--ui-color-neutral-900);--ui-radius:var(--radius-sm);--ui-container:var(--container-7xl)}.dark{--ui-text-dimmed:var(--ui-color-neutral-500);--ui-text-muted:var(--ui-color-neutral-400);--ui-text-toned:var(--ui-color-neutral-300);--ui-text:var(--ui-color-neutral-200);--ui-text-highlighted:var(--color-white);--ui-bg:var(--ui-color-neutral-900);--ui-bg-muted:var(--ui-color-neutral-800);--ui-bg-elevated:var(--ui-color-neutral-800);--ui-bg-accented:var(--ui-color-neutral-700);--ui-bg-inverted:var(--color-white);--ui-border:var(--ui-color-neutral-800);--ui-border-muted:var(--ui-color-neutral-700);--ui-border-accented:var(--ui-color-neutral-700);--ui-border-inverted:var(--color-white)}}
1
+ @import "#build/ui.css";@import "./keyframes.css";@variant light (&:where(.light, .light *));@variant dark (&:where(.dark, .dark *));@layer base{body{@apply antialiased text-(--ui-text) bg-(--ui-bg) scheme-light dark:scheme-dark}.light,:root{--ui-text-dimmed:var(--ui-color-neutral-400);--ui-text-muted:var(--ui-color-neutral-500);--ui-text-toned:var(--ui-color-neutral-600);--ui-text:var(--ui-color-neutral-700);--ui-text-highlighted:var(--ui-color-neutral-900);--ui-bg:var(--color-white);--ui-bg-muted:var(--ui-color-neutral-50);--ui-bg-elevated:var(--ui-color-neutral-100);--ui-bg-accented:var(--ui-color-neutral-200);--ui-bg-inverted:var(--ui-color-neutral-900);--ui-border:var(--ui-color-neutral-200);--ui-border-muted:var(--ui-color-neutral-200);--ui-border-accented:var(--ui-color-neutral-300);--ui-border-inverted:var(--ui-color-neutral-900);--ui-radius:var(--radius-sm);--ui-container:var(--container-7xl)}.dark{--ui-text-dimmed:var(--ui-color-neutral-500);--ui-text-muted:var(--ui-color-neutral-400);--ui-text-toned:var(--ui-color-neutral-300);--ui-text:var(--ui-color-neutral-200);--ui-text-highlighted:var(--color-white);--ui-bg:var(--ui-color-neutral-900);--ui-bg-muted:var(--ui-color-neutral-800);--ui-bg-elevated:var(--ui-color-neutral-800);--ui-bg-accented:var(--ui-color-neutral-700);--ui-bg-inverted:var(--color-white);--ui-border:var(--ui-color-neutral-800);--ui-border-muted:var(--ui-color-neutral-700);--ui-border-accented:var(--ui-color-neutral-700);--ui-border-inverted:var(--color-white)}}
@@ -0,0 +1,54 @@
1
+ import { defineLocale } from "../composables/defineLocale.js";
2
+ export default defineLocale({
3
+ name: "Az\u0259rbaycanca",
4
+ code: "az",
5
+ messages: {
6
+ inputMenu: {
7
+ noMatch: "Uy\u011Fun m\u0259lumat tap\u0131lmad\u0131",
8
+ noData: "M\u0259lumat yoxdur",
9
+ create: '"{label}" yarat'
10
+ },
11
+ calendar: {
12
+ prevYear: "\u018Fvv\u0259lki il",
13
+ nextYear: "N\xF6vb\u0259ti il",
14
+ prevMonth: "\u018Fvv\u0259lki ay",
15
+ nextMonth: "N\xF6vb\u0259ti ay"
16
+ },
17
+ inputNumber: {
18
+ increment: "Art\u0131r",
19
+ decrement: "Azalt"
20
+ },
21
+ commandPalette: {
22
+ placeholder: "\u018Fmr daxil edin v\u0259 ya axtar\u0131n...",
23
+ noMatch: "Uy\u011Fun m\u0259lumat tap\u0131lmad\u0131",
24
+ noData: "M\u0259lumat yoxdur",
25
+ close: "Ba\u011Fla"
26
+ },
27
+ selectMenu: {
28
+ noMatch: "Uy\u011Fun m\u0259lumat tap\u0131lmad\u0131",
29
+ noData: "M\u0259lumat yoxdur",
30
+ create: '"{label}" yarat',
31
+ search: "Axtar..."
32
+ },
33
+ toast: {
34
+ close: "Ba\u011Fla"
35
+ },
36
+ carousel: {
37
+ prev: "\u018Fvv\u0259lki",
38
+ next: "N\xF6vb\u0259ti",
39
+ goto: "Slayd {slide} ke\xE7"
40
+ },
41
+ modal: {
42
+ close: "Ba\u011Fla"
43
+ },
44
+ slideover: {
45
+ close: "Ba\u011Fla"
46
+ },
47
+ alert: {
48
+ close: "Ba\u011Fla"
49
+ },
50
+ table: {
51
+ noData: "M\u0259lumat yoxdur"
52
+ }
53
+ }
54
+ });
@@ -0,0 +1,54 @@
1
+ import { defineLocale } from "../composables/defineLocale.js";
2
+ export default defineLocale({
3
+ name: "\u09AC\u09BE\u0982\u09B2\u09BE",
4
+ code: "bn",
5
+ messages: {
6
+ inputMenu: {
7
+ noMatch: "\u0995\u09CB\u09A8 \u09AE\u09BF\u09B2 \u09AA\u09BE\u0993\u09AF\u09BC\u09BE \u09AF\u09BE\u09AF\u09BC\u09A8\u09BF",
8
+ noData: "\u0995\u09CB\u09A8 \u09A4\u09A5\u09CD\u09AF \u09A8\u09C7\u0987",
9
+ create: '"{label}" \u09A4\u09C8\u09B0\u09BF \u0995\u09B0\u09C1\u09A8'
10
+ },
11
+ calendar: {
12
+ prevYear: "\u09AA\u09C2\u09B0\u09CD\u09AC\u09AC\u09B0\u09CD\u09A4\u09C0 \u09AC\u099B\u09B0",
13
+ nextYear: "\u09AA\u09B0\u09AC\u09B0\u09CD\u09A4\u09C0 \u09AC\u099B\u09B0",
14
+ prevMonth: "\u09AA\u09C2\u09B0\u09CD\u09AC\u09AC\u09B0\u09CD\u09A4\u09C0 \u09AE\u09BE\u09B8",
15
+ nextMonth: "\u09AA\u09B0\u09AC\u09B0\u09CD\u09A4\u09C0 \u09AE\u09BE\u09B8"
16
+ },
17
+ inputNumber: {
18
+ increment: "\u09AC\u09C3\u09A6\u09CD\u09A7\u09BF \u0995\u09B0\u09C1\u09A8",
19
+ decrement: "\u09B9\u09CD\u09B0\u09BE\u09B8 \u0995\u09B0\u09C1\u09A8"
20
+ },
21
+ commandPalette: {
22
+ placeholder: "\u0995\u09AE\u09BE\u09A8\u09CD\u09A1 \u099F\u09BE\u0987\u09AA \u0995\u09B0\u09C1\u09A8 \u09AC\u09BE \u0985\u09A8\u09C1\u09B8\u09A8\u09CD\u09A7\u09BE\u09A8 \u0995\u09B0\u09C1\u09A8...",
23
+ noMatch: "\u0995\u09CB\u09A8 \u09AE\u09BF\u09B2 \u09AA\u09BE\u0993\u09AF\u09BC\u09BE \u09AF\u09BE\u09AF\u09BC\u09A8\u09BF",
24
+ noData: "\u0995\u09CB\u09A8 \u09A4\u09A5\u09CD\u09AF \u09A8\u09C7\u0987",
25
+ close: "\u09AC\u09A8\u09CD\u09A7 \u0995\u09B0\u09C1\u09A8"
26
+ },
27
+ selectMenu: {
28
+ noMatch: "\u0995\u09CB\u09A8 \u09AE\u09BF\u09B2 \u09AA\u09BE\u0993\u09AF\u09BC\u09BE \u09AF\u09BE\u09AF\u09BC\u09A8\u09BF",
29
+ noData: "\u0995\u09CB\u09A8 \u09A4\u09A5\u09CD\u09AF \u09A8\u09C7\u0987",
30
+ create: '"{label}" \u09A4\u09C8\u09B0\u09BF \u0995\u09B0\u09C1\u09A8',
31
+ search: "\u0985\u09A8\u09C1\u09B8\u09A8\u09CD\u09A7\u09BE\u09A8 \u0995\u09B0\u09C1\u09A8..."
32
+ },
33
+ toast: {
34
+ close: "\u09AC\u09A8\u09CD\u09A7 \u0995\u09B0\u09C1\u09A8"
35
+ },
36
+ carousel: {
37
+ prev: "\u09AA\u09C2\u09B0\u09CD\u09AC\u09AC\u09B0\u09CD\u09A4\u09C0",
38
+ next: "\u09AA\u09B0\u09AC\u09B0\u09CD\u09A4\u09C0",
39
+ goto: "\u09B8\u09CD\u09B2\u09BE\u0987\u09A1 {slide} \u098F \u09AF\u09BE\u09A8"
40
+ },
41
+ modal: {
42
+ close: "\u09AC\u09A8\u09CD\u09A7 \u0995\u09B0\u09C1\u09A8"
43
+ },
44
+ slideover: {
45
+ close: "\u09AC\u09A8\u09CD\u09A7 \u0995\u09B0\u09C1\u09A8"
46
+ },
47
+ alert: {
48
+ close: "\u09AC\u09A8\u09CD\u09A7 \u0995\u09B0\u09C1\u09A8"
49
+ },
50
+ table: {
51
+ noData: "\u0995\u09CB\u09A8 \u09A4\u09A5\u09CD\u09AF \u09A8\u09C7\u0987"
52
+ }
53
+ }
54
+ });
@@ -9,8 +9,8 @@ export default defineLocale({
9
9
  create: 'Crear "{label}"'
10
10
  },
11
11
  calendar: {
12
- prevYear: "A o anterior",
13
- nextYear: "A o siguiente",
12
+ prevYear: "A\xF1o anterior",
13
+ nextYear: "A\xF1o siguiente",
14
14
  prevMonth: "Mes anterior",
15
15
  nextMonth: "Mes siguiente"
16
16
  },
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../types").Locale;
2
+ export default _default;
@@ -0,0 +1,53 @@
1
+ import { defineLocale } from "../composables/defineLocale.js";
2
+ export default defineLocale({
3
+ name: "Hebrew",
4
+ code: "he",
5
+ dir: "rtl",
6
+ messages: {
7
+ inputMenu: {
8
+ noMatch: "\u05D0\u05D9\u05DF \u05D4\u05EA\u05D0\u05DE\u05D4",
9
+ noData: "\u05D0\u05D9\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD",
10
+ create: '\u05E6\u05D5\u05E8 "{label}"'
11
+ },
12
+ calendar: {
13
+ prevYear: "\u05E9\u05E0\u05D4 \u05E7\u05D5\u05D3\u05DE\u05EA",
14
+ nextYear: "\u05E9\u05E0\u05D4 \u05D4\u05D1\u05D0\u05D4",
15
+ prevMonth: "\u05D7\u05D5\u05D3\u05E9 \u05E7\u05D5\u05D3\u05DD",
16
+ nextMonth: "\u05D7\u05D5\u05D3\u05E9 \u05D4\u05D1\u05D0"
17
+ },
18
+ inputNumber: {
19
+ increment: "\u05D4\u05D5\u05E1\u05E3",
20
+ decrement: "\u05D4\u05E4\u05D7\u05EA"
21
+ },
22
+ commandPalette: {
23
+ placeholder: "\u05D4\u05E7\u05DC\u05D3 \u05E4\u05E7\u05D5\u05D3\u05D4...",
24
+ noMatch: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D4 \u05D4\u05EA\u05D0\u05DE\u05D4",
25
+ noData: "\u05D0\u05D9\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD",
26
+ close: "\u05E1\u05D2\u05D5\u05E8"
27
+ },
28
+ selectMenu: {
29
+ noMatch: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D4 \u05D4\u05EA\u05D0\u05DE\u05D4",
30
+ noData: "\u05D0\u05D9\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD",
31
+ create: '\u05E6\u05D5\u05E8 "{label}"',
32
+ search: "\u05D7\u05E4\u05E9..."
33
+ },
34
+ toast: { close: "\u05E1\u05D2\u05D5\u05E8" },
35
+ carousel: {
36
+ prev: "\u05D4\u05E7\u05D5\u05D3\u05DD",
37
+ next: "\u05D4\u05D1\u05D0",
38
+ goto: "\u05DE\u05E2\u05D1\u05E8 \u05DC {slide}"
39
+ },
40
+ modal: {
41
+ close: "\u05E1\u05D2\u05D5\u05E8"
42
+ },
43
+ slideover: {
44
+ close: "\u05E1\u05D2\u05D5\u05E8"
45
+ },
46
+ alert: {
47
+ close: "\u05E1\u05D2\u05D5\u05E8"
48
+ },
49
+ table: {
50
+ noData: "\u05D0\u05D9\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05DC\u05D4\u05E6\u05D2\u05D4"
51
+ }
52
+ }
53
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../types").Locale;
2
+ export default _default;
@@ -0,0 +1,54 @@
1
+ import { defineLocale } from "../composables/defineLocale.js";
2
+ export default defineLocale({
3
+ name: "Hindi",
4
+ code: "hi",
5
+ messages: {
6
+ inputMenu: {
7
+ noMatch: "\u0915\u094B\u0908 \u092E\u0947\u0932 \u0916\u093E\u0924\u093E \u0921\u0947\u091F\u093E \u0928\u0939\u0940\u0902",
8
+ noData: "\u0915\u094B\u0908 \u0921\u0947\u091F\u093E \u0928\u0939\u0940\u0902",
9
+ create: '"{label}" \u092C\u0928\u093E\u090F\u0901'
10
+ },
11
+ calendar: {
12
+ prevYear: "\u092A\u093F\u091B\u0932\u093E \u0935\u0930\u094D\u0937",
13
+ nextYear: "\u0905\u0917\u0932\u093E \u0935\u0930\u094D\u0937",
14
+ prevMonth: "\u092A\u093F\u091B\u0932\u093E \u092E\u0939\u0940\u0928\u093E",
15
+ nextMonth: "\u0905\u0917\u0932\u093E \u092E\u0939\u0940\u0928\u093E"
16
+ },
17
+ inputNumber: {
18
+ increment: "\u092C\u0922\u093C\u093E\u0928\u093E",
19
+ decrement: "\u0918\u091F\u093E\u0928\u093E"
20
+ },
21
+ commandPalette: {
22
+ placeholder: "\u090F\u0915 \u0906\u0926\u0947\u0936 \u092F\u093E \u0916\u094B\u091C \u091F\u093E\u0907\u092A \u0915\u0930\u0947\u0902...",
23
+ noMatch: "\u0915\u094B\u0908 \u092E\u0947\u0932 \u0916\u093E\u0924\u093E \u0921\u0947\u091F\u093E \u0928\u0939\u0940\u0902",
24
+ noData: "\u0915\u094B\u0908 \u0921\u0947\u091F\u093E \u0928\u0939\u0940\u0902",
25
+ close: "\u092C\u0902\u0926 \u0915\u0930\u0947\u0902"
26
+ },
27
+ selectMenu: {
28
+ noMatch: "\u0915\u094B\u0908 \u092E\u0947\u0932 \u0916\u093E\u0924\u093E \u0921\u0947\u091F\u093E \u0928\u0939\u0940\u0902",
29
+ noData: "\u0915\u094B\u0908 \u0921\u0947\u091F\u093E \u0928\u0939\u0940\u0902",
30
+ create: '"{label}" \u092C\u0928\u093E\u090F\u0901',
31
+ search: "\u0916\u094B\u091C\u0947\u0902..."
32
+ },
33
+ toast: {
34
+ close: "\u092C\u0902\u0926 \u0915\u0930\u0947\u0902"
35
+ },
36
+ carousel: {
37
+ prev: "\u092A\u093F\u091B\u0932\u093E",
38
+ next: "\u0905\u0917\u0932\u093E",
39
+ goto: "\u0938\u094D\u0932\u093E\u0907\u0921 {slide} \u092A\u0930 \u091C\u093E\u090F\u0901"
40
+ },
41
+ modal: {
42
+ close: "\u092C\u0902\u0926 \u0915\u0930\u0947\u0902"
43
+ },
44
+ slideover: {
45
+ close: "\u092C\u0902\u0926 \u0915\u0930\u0947\u0902"
46
+ },
47
+ alert: {
48
+ close: "\u092C\u0902\u0926 \u0915\u0930\u0947\u0902"
49
+ },
50
+ table: {
51
+ noData: "\u0915\u094B\u0908 \u0921\u0947\u091F\u093E \u0928\u0939\u0940\u0902"
52
+ }
53
+ }
54
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../types").Locale;
2
+ export default _default;
@@ -0,0 +1,54 @@
1
+ import { defineLocale } from "../composables/defineLocale.js";
2
+ export default defineLocale({
3
+ name: "Magyar",
4
+ code: "hu",
5
+ messages: {
6
+ inputMenu: {
7
+ noMatch: "Nincs tal\xE1lat",
8
+ noData: "Nincs adat",
9
+ create: '"{label}" l\xE9trehoz\xE1sa'
10
+ },
11
+ calendar: {
12
+ prevYear: "El\u0151z\u0151 \xE9v",
13
+ nextYear: "K\xF6vetkez\u0151 \xE9v",
14
+ prevMonth: "El\u0151z\u0151 h\xF3nap",
15
+ nextMonth: "K\xF6vetkez\u0151 h\xF3nap"
16
+ },
17
+ inputNumber: {
18
+ increment: "N\xF6vel",
19
+ decrement: "Cs\xF6kkent"
20
+ },
21
+ commandPalette: {
22
+ placeholder: "\xCDrjon be egy parancsot vagy keressen...",
23
+ noMatch: "Nincs tal\xE1lat",
24
+ noData: "Nincs adat",
25
+ close: "Bez\xE1r\xE1s"
26
+ },
27
+ selectMenu: {
28
+ noMatch: "Nincs tal\xE1lat",
29
+ noData: "Nincs adat",
30
+ create: '"{label}" l\xE9trehoz\xE1sa',
31
+ search: "Keres\xE9s..."
32
+ },
33
+ toast: {
34
+ close: "Bez\xE1r\xE1s"
35
+ },
36
+ carousel: {
37
+ prev: "El\u0151z\u0151",
38
+ next: "K\xF6vetkez\u0151",
39
+ goto: "Ugr\xE1s ide {slide}"
40
+ },
41
+ modal: {
42
+ close: "Bez\xE1r\xE1s"
43
+ },
44
+ slideover: {
45
+ close: "Bez\xE1r\xE1s"
46
+ },
47
+ alert: {
48
+ close: "Bez\xE1r\xE1s"
49
+ },
50
+ table: {
51
+ noData: "Nincs adat"
52
+ }
53
+ }
54
+ });