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

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 (172) hide show
  1. package/.nuxt/ui/alert.ts +75 -58
  2. package/.nuxt/ui/avatar-group.ts +13 -1
  3. package/.nuxt/ui/avatar.ts +13 -1
  4. package/.nuxt/ui/badge.ts +102 -65
  5. package/.nuxt/ui/button-group.ts +13 -0
  6. package/.nuxt/ui/button.ts +124 -92
  7. package/.nuxt/ui/calendar.ts +20 -2
  8. package/.nuxt/ui/carousel.ts +5 -3
  9. package/.nuxt/ui/checkbox.ts +27 -9
  10. package/.nuxt/ui/chip.ts +36 -7
  11. package/.nuxt/ui/color-picker.ts +9 -1
  12. package/.nuxt/ui/context-menu.ts +32 -14
  13. package/.nuxt/ui/drawer.ts +11 -4
  14. package/.nuxt/ui/dropdown-menu.ts +32 -14
  15. package/.nuxt/ui/form-field.ts +9 -1
  16. package/.nuxt/ui/input-menu.ts +110 -75
  17. package/.nuxt/ui/input-number.ts +82 -51
  18. package/.nuxt/ui/input.ts +88 -53
  19. package/.nuxt/ui/kbd.ts +14 -2
  20. package/.nuxt/ui/navigation-menu.ts +114 -68
  21. package/.nuxt/ui/pin-input.ts +57 -31
  22. package/.nuxt/ui/popover.ts +1 -1
  23. package/.nuxt/ui/progress.ts +93 -54
  24. package/.nuxt/ui/radio-group.ts +25 -2
  25. package/.nuxt/ui/select-menu.ts +89 -54
  26. package/.nuxt/ui/select.ts +89 -54
  27. package/.nuxt/ui/separator.ts +52 -23
  28. package/.nuxt/ui/slideover.ts +11 -4
  29. package/.nuxt/ui/slider.ts +45 -22
  30. package/.nuxt/ui/stepper.ts +45 -23
  31. package/.nuxt/ui/switch.ts +20 -2
  32. package/.nuxt/ui/table.ts +30 -13
  33. package/.nuxt/ui/tabs.ts +67 -39
  34. package/.nuxt/ui/textarea.ts +88 -53
  35. package/.nuxt/ui/toast.ts +11 -1
  36. package/.nuxt/ui/toaster.ts +27 -11
  37. package/.nuxt/ui/tooltip.ts +1 -1
  38. package/README.md +8 -1
  39. package/cli/commands/make/component.mjs +12 -0
  40. package/cli/package.json +2 -2
  41. package/cli/templates.mjs +17 -12
  42. package/dist/client/devtools/200.html +1 -1
  43. package/dist/client/devtools/404.html +1 -1
  44. package/dist/client/devtools/_nuxt/CQ-XZFu7.js +54 -0
  45. package/dist/client/devtools/_nuxt/DNZFyo26.js +1 -0
  46. package/dist/client/devtools/_nuxt/Dtz-o9GB.js +1 -0
  47. package/dist/client/devtools/_nuxt/builds/latest.json +1 -1
  48. package/dist/client/devtools/_nuxt/builds/meta/1f5fbd7b-9d97-480e-9ae4-e02b4ff7018b.json +1 -0
  49. package/dist/client/devtools/_nuxt/entry.qOdop8tq.css +1 -0
  50. package/dist/client/devtools/_nuxt/error-404.D-rS9BDk.css +1 -0
  51. package/dist/client/devtools/_nuxt/error-500.CfcCHs91.css +1 -0
  52. package/dist/client/devtools/index.html +1 -1
  53. package/dist/module.cjs +1 -1
  54. package/dist/module.json +1 -1
  55. package/dist/module.mjs +1 -1
  56. package/dist/runtime/components/Accordion.vue +2 -1
  57. package/dist/runtime/components/Alert.vue +3 -2
  58. package/dist/runtime/components/Avatar.vue +5 -4
  59. package/dist/runtime/components/AvatarGroup.vue +2 -1
  60. package/dist/runtime/components/Badge.vue +2 -1
  61. package/dist/runtime/components/Breadcrumb.vue +1 -1
  62. package/dist/runtime/components/Button.vue +2 -1
  63. package/dist/runtime/components/ButtonGroup.vue +2 -1
  64. package/dist/runtime/components/Calendar.vue +2 -1
  65. package/dist/runtime/components/Card.vue +1 -1
  66. package/dist/runtime/components/Carousel.vue +2 -1
  67. package/dist/runtime/components/Checkbox.vue +2 -1
  68. package/dist/runtime/components/Chip.vue +3 -2
  69. package/dist/runtime/components/Collapsible.vue +4 -2
  70. package/dist/runtime/components/ColorPicker.vue +2 -1
  71. package/dist/runtime/components/CommandPalette.vue +12 -5
  72. package/dist/runtime/components/Container.vue +1 -1
  73. package/dist/runtime/components/ContextMenu.vue +2 -1
  74. package/dist/runtime/components/ContextMenuContent.vue +3 -3
  75. package/dist/runtime/components/Drawer.vue +7 -2
  76. package/dist/runtime/components/DropdownMenu.vue +2 -1
  77. package/dist/runtime/components/DropdownMenuContent.vue +3 -3
  78. package/dist/runtime/components/Form.vue +15 -14
  79. package/dist/runtime/components/FormField.vue +2 -1
  80. package/dist/runtime/components/Input.vue +3 -2
  81. package/dist/runtime/components/InputMenu.vue +13 -2
  82. package/dist/runtime/components/InputNumber.vue +2 -1
  83. package/dist/runtime/components/Kbd.vue +2 -1
  84. package/dist/runtime/components/Link.vue +1 -1
  85. package/dist/runtime/components/Modal.vue +8 -13
  86. package/dist/runtime/components/NavigationMenu.vue +14 -9
  87. package/dist/runtime/components/Pagination.vue +1 -1
  88. package/dist/runtime/components/PinInput.vue +4 -3
  89. package/dist/runtime/components/Popover.vue +7 -6
  90. package/dist/runtime/components/Progress.vue +4 -3
  91. package/dist/runtime/components/RadioGroup.vue +2 -1
  92. package/dist/runtime/components/Select.vue +3 -2
  93. package/dist/runtime/components/SelectMenu.vue +20 -4
  94. package/dist/runtime/components/Separator.vue +2 -1
  95. package/dist/runtime/components/Skeleton.vue +1 -1
  96. package/dist/runtime/components/Slideover.vue +8 -12
  97. package/dist/runtime/components/Slider.vue +2 -1
  98. package/dist/runtime/components/Stepper.vue +6 -4
  99. package/dist/runtime/components/Switch.vue +2 -1
  100. package/dist/runtime/components/Table.vue +2 -1
  101. package/dist/runtime/components/Tabs.vue +3 -1
  102. package/dist/runtime/components/Textarea.vue +3 -2
  103. package/dist/runtime/components/Toast.vue +2 -1
  104. package/dist/runtime/components/Toaster.vue +2 -1
  105. package/dist/runtime/components/Tooltip.vue +1 -1
  106. package/dist/runtime/composables/defineShortcuts.js +1 -1
  107. package/dist/runtime/composables/useFormField.d.ts +1 -1
  108. package/dist/runtime/composables/useFormField.js +6 -3
  109. package/dist/runtime/locale/ar.js +3 -1
  110. package/dist/runtime/locale/cs.js +3 -1
  111. package/dist/runtime/locale/da.d.ts +2 -0
  112. package/dist/runtime/locale/da.js +54 -0
  113. package/dist/runtime/locale/de.js +3 -1
  114. package/dist/runtime/locale/el.d.ts +2 -0
  115. package/dist/runtime/locale/el.js +54 -0
  116. package/dist/runtime/locale/en.js +3 -1
  117. package/dist/runtime/locale/es.js +3 -1
  118. package/dist/runtime/locale/et.d.ts +2 -0
  119. package/dist/runtime/locale/et.js +54 -0
  120. package/dist/runtime/locale/fa_ir.js +3 -1
  121. package/dist/runtime/locale/fi.d.ts +2 -0
  122. package/dist/runtime/locale/fi.js +54 -0
  123. package/dist/runtime/locale/fr.js +3 -1
  124. package/dist/runtime/locale/id.d.ts +2 -0
  125. package/dist/runtime/locale/id.js +54 -0
  126. package/dist/runtime/locale/index.d.ts +9 -0
  127. package/dist/runtime/locale/index.js +9 -0
  128. package/dist/runtime/locale/it.js +3 -1
  129. package/dist/runtime/locale/ja.js +3 -1
  130. package/dist/runtime/locale/ko.js +3 -1
  131. package/dist/runtime/locale/nl.js +3 -1
  132. package/dist/runtime/locale/pl.js +3 -1
  133. package/dist/runtime/locale/pt.js +3 -1
  134. package/dist/runtime/locale/pt_br.js +3 -1
  135. package/dist/runtime/locale/ru.js +3 -1
  136. package/dist/runtime/locale/sk.js +3 -1
  137. package/dist/runtime/locale/sv.d.ts +2 -0
  138. package/dist/runtime/locale/sv.js +54 -0
  139. package/dist/runtime/locale/th.d.ts +2 -0
  140. package/dist/runtime/locale/th.js +54 -0
  141. package/dist/runtime/locale/tr.js +3 -1
  142. package/dist/runtime/locale/uk.d.ts +2 -0
  143. package/dist/runtime/locale/uk.js +54 -0
  144. package/dist/runtime/locale/vi.d.ts +2 -0
  145. package/dist/runtime/locale/vi.js +54 -0
  146. package/dist/runtime/locale/zh_hans.js +3 -1
  147. package/dist/runtime/locale/zh_hant.js +11 -9
  148. package/dist/runtime/types/form.d.ts +2 -2
  149. package/dist/runtime/types/form.js +2 -2
  150. package/dist/runtime/types/locale.d.ts +2 -0
  151. package/dist/runtime/utils/form.d.ts +2 -2
  152. package/dist/runtime/utils/form.js +3 -3
  153. package/dist/runtime/utils/tv.d.ts +1 -0
  154. package/dist/runtime/utils/tv.js +4 -0
  155. package/dist/runtime/vue/components/Icon.vue +2 -2
  156. package/dist/runtime/vue/plugins/head.d.ts +1 -1
  157. package/dist/runtime/vue/plugins/head.js +3 -3
  158. package/dist/shared/{ui.D_93iuwH.mjs → ui.BKsd22-Q.mjs} +63 -36
  159. package/dist/shared/{ui.CwmIkD_Y.cjs → ui.DCjJwb6l.cjs} +63 -36
  160. package/dist/unplugin.cjs +5 -5
  161. package/dist/unplugin.mjs +5 -5
  162. package/dist/vite.cjs +1 -1
  163. package/dist/vite.mjs +1 -1
  164. package/package.json +49 -44
  165. package/dist/client/devtools/_nuxt/B1fTd_Rf.js +0 -1
  166. package/dist/client/devtools/_nuxt/CSUxkedg.js +0 -1
  167. package/dist/client/devtools/_nuxt/CbRTGpb7.js +0 -1
  168. package/dist/client/devtools/_nuxt/YQTlxbcT.js +0 -53
  169. package/dist/client/devtools/_nuxt/builds/meta/b3465abc-0a92-4ee7-ba6b-e5174891fcc0.json +0 -1
  170. package/dist/client/devtools/_nuxt/entry.DXXceQev.css +0 -1
  171. package/dist/client/devtools/_nuxt/error-404.BJpkZFyY.css +0 -1
  172. package/dist/client/devtools/_nuxt/error-500.D3i9VDlt.css +0 -1
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { SelectRootProps, SelectRootEmits, SelectContentProps, SelectArrowProps, AcceptableValue } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/select'
7
7
  import type { UseComponentIconsProps } from '../composables/useComponentIcons'
8
8
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
9
+ import { tv } from '../utils/tv'
9
10
  import type { AvatarProps, ChipProps, InputProps } from '../types'
10
11
  import type { PartialString, MaybeArrayOfArray, MaybeArrayOfArrayItem, SelectModelValue, SelectModelValueEmits, SelectItemKey } from '../types/utils'
11
12
 
@@ -158,7 +159,7 @@ function displayValue(value?: AcceptableValue | AcceptableValue[]): string | und
158
159
  return value.map(v => displayValue(v)).filter(Boolean).join(', ')
159
160
  }
160
161
 
161
- const item = items.value.find(item => compare(typeof item === 'object' ? get(item, props.valueKey as string) : item, value))
162
+ const item = items.value.find(item => compare(typeof item === 'object' ? get(item as Record<string, any>, props.valueKey as string) : item, value))
162
163
  return item && (typeof item === 'object' ? get(item, props.labelKey as string) : item)
163
164
  }
164
165
 
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxArrowProps, AcceptableValue } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/select-menu'
7
7
  import type { UseComponentIconsProps } from '../composables/useComponentIcons'
8
8
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
9
+ import { tv } from '../utils/tv'
9
10
  import type { AvatarProps, ChipProps, InputProps } from '../types'
10
11
  import type { PartialString, MaybeArrayOfArray, MaybeArrayOfArrayItem, SelectModelValue, SelectModelValueEmits, SelectItemKey } from '../types/utils'
11
12
 
@@ -150,7 +151,8 @@ import UInput from './Input.vue'
150
151
  const props = withDefaults(defineProps<SelectMenuProps<T, I, V, M>>(), {
151
152
  portal: true,
152
153
  searchInput: true,
153
- labelKey: 'label' as never
154
+ labelKey: 'label' as never,
155
+ resetSearchTermOnBlur: true
154
156
  })
155
157
  const emits = defineEmits<SelectMenuEmits<T, V, M>>()
156
158
  const slots = defineSlots<SelectMenuSlots<T, M>>()
@@ -164,7 +166,7 @@ const { contains } = useFilter({ sensitivity: 'base' })
164
166
  const rootProps = useForwardPropsEmits(reactivePick(props, 'modelValue', 'defaultValue', 'open', 'defaultOpen', 'multiple', 'resetSearchTermOnBlur', 'highlightOnHover'), emits)
165
167
  const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }) as ComboboxContentProps)
166
168
  const arrowProps = toRef(() => props.arrow as ComboboxArrowProps)
167
- const searchInputProps = toRef(() => defu(props.searchInput, { placeholder: 'Search...', variant: 'none' }) as InputProps)
169
+ const searchInputProps = toRef(() => defu(props.searchInput, { placeholder: t('selectMenu.search'), variant: 'none' }) as InputProps)
168
170
 
169
171
  const { emitFormBlur, emitFormInput, emitFormChange, size: formGroupSize, color, id, name, highlight, disabled } = useFormField<InputProps>(props)
170
172
  const { orientation, size: buttonGroupSize } = useButtonGroup<InputProps>(props)
@@ -194,7 +196,7 @@ function displayValue(value: T | T[]): string {
194
196
  return value && (typeof value === 'object' ? get(value, props.labelKey as string) : value)
195
197
  }
196
198
 
197
- const item = items.value.find(item => compare(typeof item === 'object' ? get(item, props.valueKey as string) : item, value))
199
+ const item = items.value.find(item => compare(typeof item === 'object' ? get(item as Record<string, any>, props.valueKey as string) : item, value))
198
200
  return item && (typeof item === 'object' ? get(item, props.labelKey as string) : item)
199
201
  }
200
202
 
@@ -250,13 +252,27 @@ function onUpdate(value: any) {
250
252
  }
251
253
 
252
254
  function onUpdateOpen(value: boolean) {
255
+ let timeoutId
256
+
253
257
  if (!value) {
254
258
  const event = new FocusEvent('blur')
259
+
255
260
  emits('blur', event)
256
261
  emitFormBlur()
262
+
263
+ // Since we use `displayValue` prop inside ComboboxInput we should reset searchTerm manually
264
+ // https://reka-ui.com/docs/components/combobox#api-reference
265
+ if (props.resetSearchTermOnBlur) {
266
+ const STATE_ANIMATION_DELAY_MS = 100
267
+
268
+ timeoutId = setTimeout(() => {
269
+ searchTerm.value = ''
270
+ }, STATE_ANIMATION_DELAY_MS)
271
+ }
257
272
  } else {
258
273
  const event = new FocusEvent('focus')
259
274
  emits('focus', event)
275
+ clearTimeout(timeoutId)
260
276
  }
261
277
  }
262
278
  </script>
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { SeparatorProps as _SeparatorProps } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/separator'
7
+ import { tv } from '../utils/tv'
7
8
  import type { AvatarProps } from '../types'
8
9
 
9
10
  const appConfig = _appConfig as AppConfig & { ui: { separator: Partial<typeof theme> } }
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">
2
- import { tv } from 'tailwind-variants'
3
2
  import type { AppConfig } from '@nuxt/schema'
4
3
  import _appConfig from '#build/app.config'
5
4
  import theme from '#build/ui/skeleton'
5
+ import { tv } from '../utils/tv'
6
6
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
7
7
 
8
8
  const appConfig = _appConfig as AppConfig & { ui: { skeleton: Partial<typeof theme> } }
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/slideover'
7
7
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
8
+ import { tv } from '../utils/tv'
8
9
  import type { ButtonProps } from '../types'
9
10
 
10
11
  const appConfig = _appConfig as AppConfig & { ui: { slideover: Partial<typeof theme> } }
@@ -46,10 +47,10 @@ export interface SlideoverProps extends DialogRootProps {
46
47
  */
47
48
  closeIcon?: string
48
49
  /**
49
- * When `true`, the slideover will not close when clicking outside.
50
- * @defaultValue false
50
+ * When `false`, the slideover will not close when clicking outside or pressing escape.
51
+ * @defaultValue true
51
52
  */
52
- preventClose?: boolean
53
+ dismissible?: boolean
53
54
  class?: any
54
55
  ui?: Partial<typeof slideover.slots>
55
56
  }
@@ -84,6 +85,7 @@ const props = withDefaults(defineProps<SlideoverProps>(), {
84
85
  overlay: true,
85
86
  transition: true,
86
87
  modal: true,
88
+ dismissible: true,
87
89
  side: 'right'
88
90
  })
89
91
  const emits = defineEmits<SlideoverEmits>()
@@ -95,7 +97,7 @@ const appConfig = useAppConfig()
95
97
  const rootProps = useForwardPropsEmits(reactivePick(props, 'open', 'defaultOpen', 'modal'), emits)
96
98
  const contentProps = toRef(() => props.content)
97
99
  const contentEvents = computed(() => {
98
- if (props.preventClose) {
100
+ if (!props.dismissible) {
99
101
  return {
100
102
  pointerDownOutside: (e: Event) => e.preventDefault(),
101
103
  interactOutside: (e: Event) => e.preventDefault(),
@@ -103,13 +105,7 @@ const contentEvents = computed(() => {
103
105
  }
104
106
  }
105
107
 
106
- return {
107
- interactOutside: (e: Event) => {
108
- if (e.target instanceof Element && e.target.closest('[data-sonner-toaster]')) {
109
- return e.preventDefault()
110
- }
111
- }
112
- }
108
+ return {}
113
109
  })
114
110
 
115
111
  const ui = computed(() => slideover({
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { SliderRootProps } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/slider'
7
+ import { tv } from '../utils/tv'
7
8
 
8
9
  const appConfig = _appConfig as AppConfig & { ui: { slider: Partial<typeof theme> } }
9
10
 
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { StepperRootProps, StepperRootEmits } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/stepper'
7
7
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
8
+ import { tv } from '../utils/tv'
8
9
  import type { DynamicSlots } from '../types/utils'
9
10
 
10
11
  const appConfig = _appConfig as AppConfig & { ui: { stepper: Partial<typeof theme> } }
@@ -15,7 +16,7 @@ type StepperVariants = VariantProps<typeof stepper>
15
16
 
16
17
  export interface StepperItem {
17
18
  slot?: string
18
- value?: string
19
+ value?: string | number
19
20
  title?: string
20
21
  description?: string
21
22
  icon?: string
@@ -66,6 +67,7 @@ import { reactivePick } from '@vueuse/core'
66
67
  import UIcon from './Icon.vue'
67
68
 
68
69
  const props = withDefaults(defineProps<StepperProps<T>>(), {
70
+ orientation: 'horizontal',
69
71
  linear: true
70
72
  })
71
73
  const emits = defineEmits<StepperEmits<T>>()
@@ -146,12 +148,12 @@ defineExpose({
146
148
 
147
149
  <div :class="ui.wrapper({ class: props.ui?.wrapper })">
148
150
  <StepperTitle :class="ui.title({ class: props.ui?.title })">
149
- <slot name="title" :item="currentStep">
151
+ <slot name="title" :item="item">
150
152
  {{ item.title }}
151
153
  </slot>
152
154
  </StepperTitle>
153
155
  <StepperDescription :class="ui.description({ class: props.ui?.description })">
154
- <slot name="description" :item="currentStep">
156
+ <slot name="description" :item="item">
155
157
  {{ item.description }}
156
158
  </slot>
157
159
  </StepperDescription>
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { SwitchRootProps } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/switch'
7
7
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
8
+ import { tv } from '../utils/tv'
8
9
  import type { PartialString } from '../types/utils'
9
10
 
10
11
  const appConfig = _appConfig as AppConfig & { ui: { switch: Partial<typeof theme> } }
@@ -1,7 +1,7 @@
1
1
  <!-- eslint-disable vue/block-tag-newline -->
2
2
  <script lang="ts">
3
3
  import type { Ref } from 'vue'
4
- import { tv, type VariantProps } from 'tailwind-variants'
4
+ import type { VariantProps } from 'tailwind-variants'
5
5
  import type { AppConfig } from '@nuxt/schema'
6
6
  import type { RowData } from '@tanstack/table-core'
7
7
  import type {
@@ -26,6 +26,7 @@ import type {
26
26
  } from '@tanstack/vue-table'
27
27
  import _appConfig from '#build/app.config'
28
28
  import theme from '#build/ui/table'
29
+ import { tv } from '../utils/tv'
29
30
 
30
31
  declare module '@tanstack/table-core' {
31
32
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { TabsRootProps, TabsRootEmits } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/tabs'
7
7
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
8
+ import { tv } from '../utils/tv'
8
9
  import type { AvatarProps } from '../types'
9
10
  import type { DynamicSlots, PartialString } from '../types/utils'
10
11
 
@@ -96,6 +97,7 @@ const props = withDefaults(defineProps<TabsProps<T>>(), {
96
97
  content: true,
97
98
  defaultValue: '0',
98
99
  orientation: 'horizontal',
100
+ unmountOnHide: true,
99
101
  labelKey: 'label'
100
102
  })
101
103
  const emits = defineEmits<TabsEmits>()
@@ -1,8 +1,9 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { AppConfig } from '@nuxt/schema'
4
4
  import _appConfig from '#build/app.config'
5
5
  import theme from '#build/ui/textarea'
6
+ import { tv } from '../utils/tv'
6
7
 
7
8
  const appConfig = _appConfig as AppConfig & { ui: { textarea: Partial<typeof theme> } }
8
9
 
@@ -65,7 +66,7 @@ const emits = defineEmits<TextareaEmits>()
65
66
 
66
67
  const [modelValue, modelModifiers] = defineModel<string | number>()
67
68
 
68
- const { emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled } = useFormField<TextareaProps>(props)
69
+ const { emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled } = useFormField<TextareaProps>(props, { deferInputValidation: true })
69
70
 
70
71
  const ui = computed(() => textarea({
71
72
  color: color.value,
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { ToastRootProps, ToastRootEmits } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/toast'
7
7
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
8
+ import { tv } from '../utils/tv'
8
9
  import type { AvatarProps, ButtonProps } from '../types'
9
10
 
10
11
  const appConfig = _appConfig as AppConfig & { ui: { toast: Partial<typeof theme> } }
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
- import { tv, type VariantProps } from 'tailwind-variants'
2
+ import type { VariantProps } from 'tailwind-variants'
3
3
  import type { ToastProviderProps } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/toaster'
7
7
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
8
+ import { tv } from '../utils/tv'
8
9
 
9
10
  const appConfig = _appConfig as AppConfig & { ui: { toaster: Partial<typeof theme> } }
10
11
 
@@ -1,10 +1,10 @@
1
1
  <script lang="ts">
2
- import { tv } from 'tailwind-variants'
3
2
  import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipArrowProps } from 'reka-ui'
4
3
  import type { AppConfig } from '@nuxt/schema'
5
4
  import _appConfig from '#build/app.config'
6
5
  import theme from '#build/ui/tooltip'
7
6
  import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
7
+ import { tv } from '../utils/tv'
8
8
  import type { KbdProps } from '../types'
9
9
 
10
10
  const appConfig = _appConfig as AppConfig & { ui: { tooltip: Partial<typeof theme> } }
@@ -6,7 +6,7 @@ export function extractShortcuts(items) {
6
6
  const shortcuts = {};
7
7
  function traverse(items2) {
8
8
  items2.forEach((item) => {
9
- if (item.kbds?.length && (item.select || item.click)) {
9
+ if (item.kbds?.length && (item.onSelect || item.onClick)) {
10
10
  const shortcutKey = item.kbds.join("_");
11
11
  shortcuts[shortcutKey] = item.onSelect || item.onClick;
12
12
  }
@@ -8,7 +8,6 @@ type Props<T> = {
8
8
  name?: string;
9
9
  size?: GetObjectField<T, 'size'>;
10
10
  color?: GetObjectField<T, 'color'>;
11
- eagerValidation?: boolean;
12
11
  legend?: string;
13
12
  highlight?: boolean;
14
13
  disabled?: boolean;
@@ -24,6 +23,7 @@ export declare const formInputsInjectionKey: InjectionKey<Ref<Record<string, {
24
23
  export declare const formLoadingInjectionKey: InjectionKey<Readonly<Ref<boolean>>>;
25
24
  export declare function useFormField<T>(props?: Props<T>, opts?: {
26
25
  bind?: boolean;
26
+ deferInputValidation?: boolean;
27
27
  }): {
28
28
  id: ComputedRef<string | undefined>;
29
29
  name: ComputedRef<string | undefined>;
@@ -22,22 +22,25 @@ 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 blurred = ref(false);
25
+ const touched = ref(false);
26
26
  function emitFormEvent(type, name) {
27
27
  if (formBus && formField && name) {
28
28
  formBus.emit({ type, name });
29
29
  }
30
30
  }
31
31
  function emitFormBlur() {
32
+ touched.value = true;
32
33
  emitFormEvent("blur", formField?.value.name);
33
- blurred.value = true;
34
34
  }
35
35
  function emitFormChange() {
36
+ touched.value = true;
36
37
  emitFormEvent("change", formField?.value.name);
37
38
  }
38
39
  const emitFormInput = useDebounceFn(
39
40
  () => {
40
- emitFormEvent("input", formField?.value.name);
41
+ if (!opts?.deferInputValidation || touched.value || formField?.value.eagerValidation) {
42
+ emitFormEvent("input", formField?.value.name);
43
+ }
41
44
  },
42
45
  formField?.value.validateOnInputDelay ?? formOptions?.value.validateOnInputDelay ?? 0
43
46
  );
@@ -20,6 +20,7 @@ export default defineLocale({
20
20
  decrement: "\u062A\u0642\u0644\u064A\u0644"
21
21
  },
22
22
  commandPalette: {
23
+ placeholder: "\u0627\u0643\u062A\u0628 \u0623\u0645\u0631\u064B\u0627 \u0623\u0648 \u0627\u0628\u062D\u062B...",
23
24
  noMatch: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C \u0645\u0637\u0627\u0628\u0642\u0629",
24
25
  noData: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0628\u064A\u0627\u0646\u0627\u062A",
25
26
  close: "\u0625\u063A\u0644\u0627\u0642"
@@ -27,7 +28,8 @@ export default defineLocale({
27
28
  selectMenu: {
28
29
  noMatch: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C \u0645\u0637\u0627\u0628\u0642\u0629",
29
30
  noData: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0628\u064A\u0627\u0646\u0627\u062A",
30
- create: '\u0625\u0646\u0634\u0627\u0621 "{label}"'
31
+ create: '\u0625\u0646\u0634\u0627\u0621 "{label}"',
32
+ search: "\u0628\u062D\u062B..."
31
33
  },
32
34
  toast: {
33
35
  close: "\u0625\u063A\u0644\u0627\u0642"
@@ -19,6 +19,7 @@ export default defineLocale({
19
19
  decrement: "Sn\xED\u017Eit"
20
20
  },
21
21
  commandPalette: {
22
+ placeholder: "Zadejte p\u0159\xEDkaz nebo hledejte...",
22
23
  noMatch: "\u017D\xE1dn\xE1 shoda",
23
24
  noData: "\u017D\xE1dn\xE1 data",
24
25
  close: "Zav\u0159\xEDt"
@@ -26,7 +27,8 @@ export default defineLocale({
26
27
  selectMenu: {
27
28
  noMatch: "\u017D\xE1dn\xE1 shoda",
28
29
  noData: "\u017D\xE1dn\xE1 data",
29
- create: 'Vytvo\u0159it "{label}"'
30
+ create: 'Vytvo\u0159it "{label}"',
31
+ search: "Hledat..."
30
32
  },
31
33
  toast: {
32
34
  close: "Zav\u0159\xEDt"
@@ -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: "Danish",
4
+ code: "da",
5
+ messages: {
6
+ inputMenu: {
7
+ noMatch: "Ingen matchende data",
8
+ noData: "Ingen data",
9
+ create: 'Opret "{label}"'
10
+ },
11
+ calendar: {
12
+ prevYear: "Forrige \xE5r",
13
+ nextYear: "N\xE6ste \xE5r",
14
+ prevMonth: "Forrige m\xE5ned",
15
+ nextMonth: "N\xE6ste m\xE5ned"
16
+ },
17
+ inputNumber: {
18
+ increment: "\xD8g",
19
+ decrement: "Reducer"
20
+ },
21
+ commandPalette: {
22
+ placeholder: "Skriv en kommando eller s\xF8g...",
23
+ noMatch: "Ingen matchende data",
24
+ noData: "Ingen data",
25
+ close: "Luk"
26
+ },
27
+ selectMenu: {
28
+ noMatch: "Ingen matchende data",
29
+ noData: "Ingen data",
30
+ create: 'Opret "{label}"',
31
+ search: "S\xF8g..."
32
+ },
33
+ toast: {
34
+ close: "Luk"
35
+ },
36
+ carousel: {
37
+ prev: "Forrige",
38
+ next: "N\xE6ste",
39
+ goto: "G\xE5 til slide {slide}"
40
+ },
41
+ modal: {
42
+ close: "Luk"
43
+ },
44
+ slideover: {
45
+ close: "Luk"
46
+ },
47
+ alert: {
48
+ close: "Luk"
49
+ },
50
+ table: {
51
+ noData: "Ingen data"
52
+ }
53
+ }
54
+ });
@@ -19,6 +19,7 @@ export default defineLocale({
19
19
  decrement: "Verringern"
20
20
  },
21
21
  commandPalette: {
22
+ placeholder: "Geben Sie einen Befehl ein oder suchen Sie...",
22
23
  noMatch: "Nichts gefunden",
23
24
  noData: "Keine Daten",
24
25
  close: "Schlie\xDFen"
@@ -26,7 +27,8 @@ export default defineLocale({
26
27
  selectMenu: {
27
28
  noMatch: "Nichts gefunden",
28
29
  noData: "Keine Daten",
29
- create: '"{label}" erstellen'
30
+ create: '"{label}" erstellen',
31
+ search: "Suchen..."
30
32
  },
31
33
  toast: {
32
34
  close: "Schlie\xDFen"
@@ -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: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",
4
+ code: "el",
5
+ messages: {
6
+ inputMenu: {
7
+ noMatch: "\u0394\u03B5\u03BD \u03B2\u03C1\u03AD\u03B8\u03B7\u03BA\u03B1\u03BD \u03B4\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03B1",
8
+ noData: "\u0394\u03B5\u03BD \u03C5\u03C0\u03AC\u03C1\u03C7\u03BF\u03C5\u03BD \u03B4\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03B1",
9
+ create: '\u0394\u03B7\u03BC\u03B9\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 "{label}"'
10
+ },
11
+ calendar: {
12
+ prevYear: "\u03A0\u03C1\u03BF\u03B7\u03B3\u03BF\u03CD\u03BC\u03B5\u03BD\u03BF \u03AD\u03C4\u03BF\u03C2",
13
+ nextYear: "\u0395\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF \u03AD\u03C4\u03BF\u03C2",
14
+ prevMonth: "\u03A0\u03C1\u03BF\u03B7\u03B3\u03BF\u03CD\u03BC\u03B5\u03BD\u03BF\u03C2 \u03BC\u03AE\u03BD\u03B1\u03C2",
15
+ nextMonth: "\u0395\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF\u03C2 \u03BC\u03AE\u03BD\u03B1\u03C2"
16
+ },
17
+ inputNumber: {
18
+ increment: "\u0391\u03CD\u03BE\u03B7\u03C3\u03B7",
19
+ decrement: "\u039C\u03B5\u03AF\u03C9\u03C3\u03B7"
20
+ },
21
+ commandPalette: {
22
+ placeholder: "\u03A0\u03BB\u03B7\u03BA\u03C4\u03C1\u03BF\u03BB\u03BF\u03B3\u03AE\u03C3\u03C4\u03B5 \u03BC\u03B9\u03B1 \u03B5\u03BD\u03C4\u03BF\u03BB\u03AE \u03AE \u03B1\u03BD\u03B1\u03B6\u03B7\u03C4\u03AE\u03C3\u03C4\u03B5...",
23
+ noMatch: "\u0394\u03B5\u03BD \u03B2\u03C1\u03AD\u03B8\u03B7\u03BA\u03B1\u03BD \u03B4\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03B1",
24
+ noData: "\u0394\u03B5\u03BD \u03C5\u03C0\u03AC\u03C1\u03C7\u03BF\u03C5\u03BD \u03B4\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03B1",
25
+ close: "\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF"
26
+ },
27
+ selectMenu: {
28
+ noMatch: "\u0394\u03B5\u03BD \u03B2\u03C1\u03AD\u03B8\u03B7\u03BA\u03B1\u03BD \u03B4\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03B1",
29
+ noData: "\u0394\u03B5\u03BD \u03C5\u03C0\u03AC\u03C1\u03C7\u03BF\u03C5\u03BD \u03B4\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03B1",
30
+ create: '\u0394\u03B7\u03BC\u03B9\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 "{label}"',
31
+ search: "\u0391\u03BD\u03B1\u03B6\u03AE\u03C4\u03B7\u03C3\u03B7..."
32
+ },
33
+ toast: {
34
+ close: "\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF"
35
+ },
36
+ carousel: {
37
+ prev: "\u03A0\u03C1\u03BF\u03B7\u03B3\u03BF\u03CD\u03BC\u03B5\u03BD\u03BF",
38
+ next: "\u0395\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF",
39
+ goto: "\u039C\u03B5\u03C4\u03AC\u03B2\u03B1\u03C3\u03B7 \u03C3\u03C4\u03B7 \u03B4\u03B9\u03B1\u03C6\u03AC\u03BD\u03B5\u03B9\u03B1 {slide}"
40
+ },
41
+ modal: {
42
+ close: "\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF"
43
+ },
44
+ slideover: {
45
+ close: "\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF"
46
+ },
47
+ alert: {
48
+ close: "\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF"
49
+ },
50
+ table: {
51
+ noData: "\u0394\u03B5\u03BD \u03C5\u03C0\u03AC\u03C1\u03C7\u03BF\u03C5\u03BD \u03B4\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03B1"
52
+ }
53
+ }
54
+ });
@@ -19,6 +19,7 @@ export default defineLocale({
19
19
  decrement: "Decrement"
20
20
  },
21
21
  commandPalette: {
22
+ placeholder: "Type a command or search...",
22
23
  noMatch: "No matching data",
23
24
  noData: "No data",
24
25
  close: "Close"
@@ -26,7 +27,8 @@ export default defineLocale({
26
27
  selectMenu: {
27
28
  noMatch: "No matching data",
28
29
  noData: "No data",
29
- create: 'Create "{label}"'
30
+ create: 'Create "{label}"',
31
+ search: "Search..."
30
32
  },
31
33
  toast: {
32
34
  close: "Close"
@@ -19,6 +19,7 @@ export default defineLocale({
19
19
  decrement: "Decremento"
20
20
  },
21
21
  commandPalette: {
22
+ placeholder: "Escribe un comando o busca...",
22
23
  noMatch: "No hay datos coincidentes",
23
24
  noData: "Sin datos",
24
25
  close: "Cerrar"
@@ -26,7 +27,8 @@ export default defineLocale({
26
27
  selectMenu: {
27
28
  noMatch: "No hay datos coincidentes",
28
29
  noData: "Sin datos",
29
- create: 'Crear "{label}"'
30
+ create: 'Crear "{label}"',
31
+ search: "Buscar..."
30
32
  },
31
33
  toast: {
32
34
  close: "Cerrar"
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../types").Locale;
2
+ export default _default;