@una-ui/nuxt 0.52.1 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/module.d.mts +2 -1
  2. package/dist/module.d.ts +2 -1
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +1 -1
  5. package/dist/runtime/components/alert-dialog/AlertDialog.vue +131 -0
  6. package/dist/runtime/components/alert-dialog/AlertDialogAction.vue +24 -0
  7. package/dist/runtime/components/alert-dialog/AlertDialogCancel.vue +29 -0
  8. package/dist/runtime/components/alert-dialog/AlertDialogContent.vue +62 -0
  9. package/dist/runtime/components/alert-dialog/AlertDialogDescription.vue +24 -0
  10. package/dist/runtime/components/alert-dialog/AlertDialogFooter.vue +21 -0
  11. package/dist/runtime/components/alert-dialog/AlertDialogHeader.vue +19 -0
  12. package/dist/runtime/components/alert-dialog/AlertDialogOverlay.vue +21 -0
  13. package/dist/runtime/components/alert-dialog/AlertDialogTitle.vue +24 -0
  14. package/dist/runtime/components/alert-dialog/AlertDialogTrigger.vue +15 -0
  15. package/dist/runtime/components/combobox/Combobox.vue +21 -6
  16. package/dist/runtime/components/combobox/ComboboxInput.vue +1 -3
  17. package/dist/runtime/components/combobox/ComboboxItem.vue +3 -1
  18. package/dist/runtime/components/combobox/ComboboxTrigger.vue +2 -1
  19. package/dist/runtime/components/elements/Label.vue +1 -0
  20. package/dist/runtime/components/elements/Progress.vue +4 -3
  21. package/dist/runtime/components/forms/Checkbox.vue +3 -2
  22. package/dist/runtime/components/forms/Input.vue +3 -2
  23. package/dist/runtime/components/forms/Slider.vue +4 -6
  24. package/dist/runtime/components/forms/radio-group/RadioGroup.vue +2 -1
  25. package/dist/runtime/components/resizable/ResizableHandle.vue +61 -0
  26. package/dist/runtime/components/resizable/ResizablePanel.vue +29 -0
  27. package/dist/runtime/components/resizable/ResizablePanelGroup.vue +29 -0
  28. package/dist/runtime/types/alert-dialog.d.ts +98 -0
  29. package/dist/runtime/types/alert-dialog.js +0 -0
  30. package/dist/runtime/types/index.d.ts +2 -0
  31. package/dist/runtime/types/index.js +2 -0
  32. package/dist/runtime/types/input.d.ts +1 -0
  33. package/dist/runtime/types/resizable.d.ts +46 -0
  34. package/dist/runtime/types/resizable.js +0 -0
  35. package/dist/types.d.mts +7 -1
  36. package/dist/types.d.ts +7 -1
  37. package/package.json +3 -3
package/dist/module.d.mts CHANGED
@@ -33,4 +33,5 @@ interface ModuleOptions {
33
33
  }
34
34
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
35
35
 
36
- export { type ModuleOptions, _default as default };
36
+ export { _default as default };
37
+ export type { ModuleOptions };
package/dist/module.d.ts CHANGED
@@ -33,4 +33,5 @@ interface ModuleOptions {
33
33
  }
34
34
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
35
35
 
36
- export { type ModuleOptions, _default as default };
36
+ export { _default as default };
37
+ export type { ModuleOptions };
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "configKey": "una",
4
- "version": "0.52.1",
4
+ "version": "0.54.0",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.0.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -8,7 +8,7 @@ import 'unocss';
8
8
  import 'unocss-preset-animations';
9
9
 
10
10
  const name = "@una-ui/nuxt";
11
- const version = "0.52.1";
11
+ const version = "0.54.0";
12
12
 
13
13
  const module = defineNuxtModule({
14
14
  meta: {
@@ -0,0 +1,131 @@
1
+ <script setup lang="ts">
2
+ import type { AlertDialogEmits } from 'reka-ui'
3
+ import type { NAlertDialogProps } from '../../types'
4
+ import { reactivePick } from '@vueuse/core'
5
+ import { AlertDialogRoot, useForwardPropsEmits, VisuallyHidden } from 'reka-ui'
6
+ import { computed } from 'vue'
7
+ import { randomId } from '../../utils'
8
+ import AlertDialogAction from './AlertDialogAction.vue'
9
+ import AlertDialogCancel from './AlertDialogCancel.vue'
10
+ import AlertDialogContent from './AlertDialogContent.vue'
11
+ import AlertDialogDescription from './AlertDialogDescription.vue'
12
+ import AlertDialogFooter from './AlertDialogFooter.vue'
13
+ import AlertDialogHeader from './AlertDialogHeader.vue'
14
+ import AlertDialogTitle from './AlertDialogTitle.vue'
15
+ import AlertDialogTrigger from './AlertDialogTrigger.vue'
16
+
17
+ defineOptions({
18
+ inheritAttrs: false,
19
+ })
20
+
21
+ const props = withDefaults(defineProps<NAlertDialogProps>(), {
22
+ overlay: true,
23
+ })
24
+ const emits = defineEmits<AlertDialogEmits & {
25
+ cancel: [Event]
26
+ action: [Event]
27
+ }>()
28
+ const DEFAULT_TITLE = randomId('alert-dialog-title')
29
+ const DEFAULT_DESCRIPTION = randomId('alert-dialog-description')
30
+
31
+ const title = computed(() => props.title ?? DEFAULT_TITLE)
32
+ const description = computed(() => props.description ?? DEFAULT_DESCRIPTION)
33
+
34
+ const rootProps = reactivePick(props, [
35
+ 'open',
36
+ 'defaultOpen',
37
+ ])
38
+
39
+ const forwarded = useForwardPropsEmits(rootProps, emits)
40
+ </script>
41
+
42
+ <template>
43
+ <AlertDialogRoot
44
+ v-slot="{ open }"
45
+ data-slot="alert-dialog"
46
+ v-bind="forwarded"
47
+ >
48
+ <slot>
49
+ <AlertDialogTrigger
50
+ v-bind="_alertDialogTrigger"
51
+ as-child
52
+ >
53
+ <slot name="trigger" :open />
54
+ </AlertDialogTrigger>
55
+
56
+ <AlertDialogContent
57
+ v-bind="_alertDialogContent"
58
+ :_alert-dialog-overlay
59
+ :prevent-close
60
+ :una
61
+ >
62
+ <VisuallyHidden v-if="(title === DEFAULT_TITLE || !!$slots.title) || (description === DEFAULT_DESCRIPTION || !!$slots.description)">
63
+ <AlertDialogTitle v-if="title === DEFAULT_TITLE || !!$slots.title">
64
+ {{ title }}
65
+ </AlertDialogTitle>
66
+
67
+ <AlertDialogDescription v-if="description === DEFAULT_DESCRIPTION || !!$slots.description">
68
+ {{ description }}
69
+ </AlertDialogDescription>
70
+ </VisuallyHidden>
71
+
72
+ <slot name="content">
73
+ <!-- Header -->
74
+ <AlertDialogHeader
75
+ v-if="!!$slots.header || (title !== DEFAULT_TITLE || !!$slots.title) || (description !== DEFAULT_DESCRIPTION || !!$slots.description)"
76
+ v-bind="_alertDialogHeader"
77
+ :una
78
+ >
79
+ <slot name="header">
80
+ <AlertDialogTitle
81
+ v-if="title !== DEFAULT_TITLE || !!$slots.title"
82
+ v-bind="_alertDialogTitle"
83
+ :una
84
+ >
85
+ <slot name="title">
86
+ {{ title }}
87
+ </slot>
88
+ </AlertDialogTitle>
89
+
90
+ <AlertDialogDescription
91
+ v-if="description !== DEFAULT_DESCRIPTION || !!$slots.description"
92
+ v-bind="_alertDialogDescription"
93
+ :una
94
+ >
95
+ <slot name="description">
96
+ {{ description }}
97
+ </slot>
98
+ </AlertDialogDescription>
99
+ </slot>
100
+ </AlertDialogHeader>
101
+
102
+ <!-- Footer -->
103
+ <AlertDialogFooter
104
+ v-bind="_alertDialogFooter"
105
+ :una
106
+ >
107
+ <slot name="footer">
108
+ <slot name="cancel-wrapper">
109
+ <AlertDialogCancel
110
+ v-bind="_alertDialogCancel"
111
+ @click="emits('cancel', $event)"
112
+ >
113
+ <slot name="cancel" />
114
+ </AlertDialogCancel>
115
+ </slot>
116
+
117
+ <slot name="action-wrapper">
118
+ <AlertDialogAction
119
+ v-bind="_alertDialogAction"
120
+ @click="emits('action', $event)"
121
+ >
122
+ <slot name="action" />
123
+ </AlertDialogAction>
124
+ </slot>
125
+ </slot>
126
+ </AlertDialogFooter>
127
+ </slot>
128
+ </AlertDialogContent>
129
+ </slot>
130
+ </AlertDialogRoot>
131
+ </template>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import type { NAlertDialogActionProps } from '../../types'
3
+ import { AlertDialogAction } from 'reka-ui'
4
+ import Button from '../elements/Button.vue'
5
+
6
+ const props = withDefaults(defineProps<NAlertDialogActionProps>(), {
7
+ btn: 'solid-primary',
8
+ label: 'Continue',
9
+ })
10
+ </script>
11
+
12
+ <template>
13
+ <AlertDialogAction
14
+ as-child
15
+ >
16
+ <Button
17
+ v-bind="props"
18
+ >
19
+ <template v-for="(_, name) in $slots" #[name]="slotData">
20
+ <slot :name="name" v-bind="slotData" />
21
+ </template>
22
+ </Button>
23
+ </AlertDialogAction>
24
+ </template>
@@ -0,0 +1,29 @@
1
+ <script setup lang="ts">
2
+ import type { NAlertDialogCancelProps } from '../../types'
3
+ import { AlertDialogCancel } from 'reka-ui'
4
+ import { cn } from '../../utils'
5
+ import Button from '../elements/Button.vue'
6
+
7
+ const props = withDefaults(defineProps<NAlertDialogCancelProps>(), {
8
+ btn: 'solid-gray',
9
+ label: 'Cancel',
10
+ })
11
+ </script>
12
+
13
+ <template>
14
+ <AlertDialogCancel
15
+ as-child
16
+ >
17
+ <Button
18
+ v-bind="props"
19
+ :class="cn(
20
+ 'alert-dialog-cancel',
21
+ props.class,
22
+ )"
23
+ >
24
+ <template v-for="(_, name) in $slots" #[name]="slotData">
25
+ <slot :name="name" v-bind="slotData" />
26
+ </template>
27
+ </Button>
28
+ </AlertDialogCancel>
29
+ </template>
@@ -0,0 +1,62 @@
1
+ <script setup lang="ts">
2
+ import type { AlertDialogContentEmits } from 'reka-ui'
3
+ import type { NAlertDialogContentProps } from '../../types'
4
+ import { reactiveOmit } from '@vueuse/core'
5
+ import {
6
+ AlertDialogContent,
7
+ AlertDialogPortal,
8
+ useForwardPropsEmits,
9
+ } from 'reka-ui'
10
+ import { computed } from 'vue'
11
+ import { cn } from '../../utils'
12
+ import AlertDialogOverlay from './AlertDialogOverlay.vue'
13
+
14
+ defineOptions({
15
+ inheritAttrs: false,
16
+ })
17
+
18
+ const props = withDefaults(defineProps<NAlertDialogContentProps>(), {
19
+ overlay: true,
20
+ })
21
+ const emits = defineEmits<AlertDialogContentEmits>()
22
+ const delegatedProps = reactiveOmit(props, ['class', 'una', '_alertDialogOverlay'])
23
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
24
+ const contentEvents = computed(() => {
25
+ if (props.preventClose) {
26
+ return {
27
+ pointerDownOutside: (e: Event) => e.preventDefault(),
28
+ interactOutside: (e: Event) => e.preventDefault(),
29
+ escapeKeyDown: (e: Event) => e.preventDefault(),
30
+ closeAutoFocus: (e: Event) => e.preventDefault(),
31
+ }
32
+ }
33
+
34
+ return {
35
+ closeAutoFocus: (e: Event) => e.preventDefault(),
36
+ }
37
+ })
38
+ </script>
39
+
40
+ <template>
41
+ <AlertDialogPortal>
42
+ <AlertDialogOverlay
43
+ v-if="overlay"
44
+ v-bind="_alertDialogOverlay"
45
+ :una
46
+ />
47
+
48
+ <AlertDialogContent
49
+ data-slot="alert-dialog-content"
50
+ v-bind="{ ...forwarded, ...$attrs }"
51
+ :class="cn(
52
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-48% data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-48%',
53
+ 'alert-dialog-content',
54
+ props.una?.alertDialogContent,
55
+ props.class,
56
+ )"
57
+ v-on="contentEvents"
58
+ >
59
+ <slot />
60
+ </AlertDialogContent>
61
+ </AlertDialogPortal>
62
+ </template>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import type { NAlertDialogDescriptionProps } from '../../types'
3
+ import { reactiveOmit } from '@vueuse/core'
4
+ import { AlertDialogDescription } from 'reka-ui'
5
+ import { cn } from '../../utils'
6
+
7
+ const props = defineProps<NAlertDialogDescriptionProps>()
8
+
9
+ const delegatedProps = reactiveOmit(props, 'class', 'una')
10
+ </script>
11
+
12
+ <template>
13
+ <AlertDialogDescription
14
+ data-slot="alert-dialog-description"
15
+ v-bind="delegatedProps"
16
+ :class="cn(
17
+ 'alert-dialog-description',
18
+ props.una?.alertDialogDescription,
19
+ props.class,
20
+ )"
21
+ >
22
+ <slot />
23
+ </AlertDialogDescription>
24
+ </template>
@@ -0,0 +1,21 @@
1
+ <script setup lang="ts">
2
+ import type { NAlertDialogFooterProps } from '../../types'
3
+ import { cn } from '../../utils'
4
+
5
+ const props = defineProps<NAlertDialogFooterProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <div
10
+ data-slot="alert-dialog-footer"
11
+ :class="
12
+ cn(
13
+ 'alert-dialog-footer',
14
+ props.una?.alertDialogFooter,
15
+ props.class,
16
+ )
17
+ "
18
+ >
19
+ <slot />
20
+ </div>
21
+ </template>
@@ -0,0 +1,19 @@
1
+ <script setup lang="ts">
2
+ import type { NAlertDialogHeaderProps } from '../../types'
3
+ import { cn } from '../../utils'
4
+
5
+ const props = defineProps<NAlertDialogHeaderProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <div
10
+ data-slot="alert-dialog-header"
11
+ :class="cn(
12
+ 'alert-dialog-header',
13
+ props.una?.alertDialogHeader,
14
+ props.class,
15
+ )"
16
+ >
17
+ <slot />
18
+ </div>
19
+ </template>
@@ -0,0 +1,21 @@
1
+ <script lang="ts" setup>
2
+ import type { NAlertDialogOverlayProps } from '../../types'
3
+ import { DialogOverlay } from 'reka-ui'
4
+ import { cn } from '../../utils'
5
+
6
+ const props = defineProps<NAlertDialogOverlayProps>()
7
+ </script>
8
+
9
+ <template>
10
+ <DialogOverlay
11
+ data-slot="alert-dialog-overlay"
12
+ :class="cn(
13
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ',
14
+ 'alert-dialog-overlay',
15
+ props.una?.alertDialogOverlay,
16
+ props.class,
17
+ )"
18
+ >
19
+ <slot />
20
+ </DialogOverlay>
21
+ </template>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import type { NAlertDialogTitleProps } from '../../types'
3
+ import { reactiveOmit } from '@vueuse/core'
4
+ import { AlertDialogTitle } from 'reka-ui'
5
+ import { cn } from '../../utils'
6
+
7
+ const props = defineProps<NAlertDialogTitleProps>()
8
+
9
+ const delegatedProps = reactiveOmit(props, 'class', 'una')
10
+ </script>
11
+
12
+ <template>
13
+ <AlertDialogTitle
14
+ data-slot="alert-dialog-title"
15
+ v-bind="delegatedProps"
16
+ :class="cn(
17
+ 'alert-dialog-title',
18
+ props.una?.alertDialogTitle,
19
+ props.class,
20
+ )"
21
+ >
22
+ <slot />
23
+ </AlertDialogTitle>
24
+ </template>
@@ -0,0 +1,15 @@
1
+ <script setup lang="ts">
2
+ import type { NAlertDialogTriggerProps } from '../../types'
3
+ import { AlertDialogTrigger } from 'reka-ui'
4
+
5
+ const props = defineProps<NAlertDialogTriggerProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <AlertDialogTrigger
10
+ data-slot="alert-dialog-trigger"
11
+ v-bind="props"
12
+ >
13
+ <slot />
14
+ </AlertDialogTrigger>
15
+ </template>
@@ -2,6 +2,7 @@
2
2
  import type { AcceptableValue, ComboboxRootEmits } from 'reka-ui'
3
3
  import type { ExtractItemType, NComboboxGroupProps, NComboboxProps } from '../../types'
4
4
  import { reactiveOmit } from '@vueuse/core'
5
+ import { defu } from 'defu'
5
6
  import { ComboboxRoot, useForwardPropsEmits } from 'reka-ui'
6
7
  import { cn } from '../../utils'
7
8
  </script>
@@ -21,7 +22,7 @@ import ComboboxViewport from './ComboboxViewport.vue'
21
22
 
22
23
  const props = withDefaults(defineProps<NComboboxProps<T>>(), {
23
24
  textEmpty: 'No items found.',
24
- size: 'md',
25
+ size: 'sm',
25
26
  })
26
27
  const emits = defineEmits<ComboboxRootEmits<ExtractItemType<T>>>()
27
28
 
@@ -162,7 +163,6 @@ function isItemSelected(item: ExtractItemType<T> | null | undefined): boolean {
162
163
  :id
163
164
  :status
164
165
  :class="cn(
165
- 'text-0.875em',
166
166
  props._comboboxTrigger?.class,
167
167
  )"
168
168
  :size
@@ -179,6 +179,15 @@ function isItemSelected(item: ExtractItemType<T> | null | undefined): boolean {
179
179
  :display-value="(val: unknown) => getDisplayValue(val)"
180
180
  name="frameworks"
181
181
  :status
182
+ :class="cn(
183
+ 'text-1em',
184
+ props._comboboxInput?.class,
185
+ )"
186
+ :una="defu(props._comboboxInput?.una, {
187
+ inputLeading: 'text-1.1428571428571428em',
188
+ inputTrailing: 'text-1.1428571428571428em',
189
+ inputStatusIconBase: 'text-1.1428571428571428em',
190
+ })"
182
191
  :size
183
192
  v-bind="props._comboboxInput"
184
193
  />
@@ -197,11 +206,16 @@ function isItemSelected(item: ExtractItemType<T> | null | undefined): boolean {
197
206
  <slot name="input-wrapper" :model-value :open>
198
207
  <ComboboxInput
199
208
  v-if="$slots.trigger || $slots.triggerRoot"
200
- :size
201
209
  :class="cn(
202
- 'border-0 border-b-1 rounded-none focus-visible:ring-0',
210
+ 'border-0 border-b-1 rounded-none text-1em focus-visible:ring-0',
203
211
  props._comboboxInput?.class,
204
212
  )"
213
+ :una="defu(props._comboboxInput?.una, {
214
+ inputLeading: 'text-1.1428571428571428em',
215
+ inputTrailing: 'text-1.1428571428571428em',
216
+ inputStatusIconBase: 'text-1.1428571428571428em',
217
+ })"
218
+ :size
205
219
  v-bind="props._comboboxInput"
206
220
  />
207
221
  </slot>
@@ -215,6 +229,9 @@ function isItemSelected(item: ExtractItemType<T> | null | undefined): boolean {
215
229
  >
216
230
  <ComboboxEmpty
217
231
  v-bind="props._comboboxEmpty"
232
+ :class="cn(
233
+ props._comboboxEmpty?.class,
234
+ )"
218
235
  :una
219
236
  >
220
237
  <slot name="empty">
@@ -237,7 +254,6 @@ function isItemSelected(item: ExtractItemType<T> | null | undefined): boolean {
237
254
  :size
238
255
  v-bind="props._comboboxItem"
239
256
  :class="cn(
240
- 'text-0.875em',
241
257
  props._comboboxItem?.class,
242
258
  )"
243
259
  :una
@@ -284,7 +300,6 @@ function isItemSelected(item: ExtractItemType<T> | null | undefined): boolean {
284
300
  :size
285
301
  v-bind="{ ...props._comboboxItem, ...group._comboboxItem }"
286
302
  :class="cn(
287
- 'text-0.875em',
288
303
  props._comboboxItem?.class,
289
304
  )"
290
305
  :una
@@ -10,9 +10,7 @@ defineOptions({
10
10
  inheritAttrs: false,
11
11
  })
12
12
 
13
- const props = withDefaults(defineProps<NComboboxInputProps>(), {
14
- leading: 'combobox-input-leading-icon',
15
- })
13
+ const props = defineProps<NComboboxInputProps>()
16
14
 
17
15
  const emits = defineEmits<ComboboxInputEmits>()
18
16
 
@@ -5,7 +5,9 @@ import { ComboboxItem, useForwardPropsEmits } from 'reka-ui'
5
5
  import { computed } from 'vue'
6
6
  import { cn } from '../../utils'
7
7
 
8
- const props = defineProps<NComboboxItemProps<T>>()
8
+ const props = withDefaults(defineProps<NComboboxItemProps<T>>(), {
9
+ size: 'sm',
10
+ })
9
11
  const emits = defineEmits<ComboboxItemEmits>()
10
12
 
11
13
  const delegatedProps = computed(() => {
@@ -45,7 +45,7 @@ const status = computed(() => props.status ?? 'default')
45
45
  v-bind="forwardedProps"
46
46
  as-child
47
47
  >
48
- <slot name="root">
48
+ <slot name="wrapper">
49
49
  <Button
50
50
  :id
51
51
  :btn="statusClassVariants.btn ? undefined : props.btn"
@@ -56,6 +56,7 @@ const status = computed(() => props.status ?? 'default')
56
56
  props.class,
57
57
  )"
58
58
  tabindex="0"
59
+ :size
59
60
  :una="{
60
61
  ...props.una,
61
62
  btn: props.una?.comboboxTrigger,
@@ -11,6 +11,7 @@ const rootProps = reactiveOmit(props, ['label', 'class'])
11
11
 
12
12
  <template>
13
13
  <Label
14
+ data-slot="label"
14
15
  v-bind="rootProps"
15
16
  :class="
16
17
  cn(
@@ -24,6 +24,7 @@ const delegatedProps = computed(() => {
24
24
 
25
25
  <template>
26
26
  <ProgressRoot
27
+ v-slot="{ modelValue }"
27
28
  v-bind="delegatedProps"
28
29
  :class="
29
30
  cn(
@@ -35,14 +36,14 @@ const delegatedProps = computed(() => {
35
36
  :rounded
36
37
  :progress
37
38
  >
38
- <slot>
39
+ <slot :model-value>
39
40
  <ProgressIndicator
40
- v-if="props.modelValue !== undefined || props.modelValue === null"
41
+ v-if="modelValue !== undefined || modelValue === null"
41
42
  :class="cn(
42
43
  'progress-indicator',
43
44
  props.una?.progressIndicator,
44
45
  )"
45
- :style="`transform: translateX(-${100 - (props.modelValue ?? 0)}%);`"
46
+ :style="`transform: translateX(-${100 - (modelValue ?? 0)}%);`"
46
47
  />
47
48
  <template
48
49
  v-else
@@ -42,6 +42,7 @@ const id = computed(() => props.id ?? randomId('checkbox'))
42
42
  <CheckboxRoot
43
43
  v-bind="{ ...forwarded, ...$attrs }"
44
44
  :id="id"
45
+ v-slot="{ ...slotProps }"
45
46
  :class="
46
47
  cn(
47
48
  'peer checkbox',
@@ -58,9 +59,9 @@ const id = computed(() => props.id ?? randomId('checkbox'))
58
59
  >
59
60
  <slot name="icon">
60
61
  <Icon
61
- :name="props.modelValue === 'indeterminate'
62
+ :name="slotProps.modelValue === 'indeterminate'
62
63
  ? props.una?.checkboxIndeterminateIcon ?? 'checkbox-indeterminate-icon'
63
- : props.modelValue
64
+ : slotProps.modelValue
64
65
  ? props.una?.checkboxCheckedIcon ?? 'checkbox-checked-icon'
65
66
  : props.una?.checkboxUncheckedIcon ?? 'checkbox-unchecked-icon'"
66
67
  :class="cn('checkbox-icon-base', una?.checkboxIconBase)"
@@ -130,11 +130,11 @@ defineExpose({
130
130
  >
131
131
  <div
132
132
  v-if="isLeading"
133
- :class="[
133
+ :class="cn(
134
134
  una?.inputLeadingWrapper,
135
135
  reverseClassVariants.leadingWrapper,
136
136
  statusClassVariants.text,
137
- ]"
137
+ )"
138
138
  >
139
139
  <slot name="leading">
140
140
  <NIcon
@@ -192,6 +192,7 @@ defineExpose({
192
192
  :name="statusClassVariants.icon"
193
193
  :class="cn(
194
194
  'input-status-icon-base',
195
+ una?.inputStatusIconBase,
195
196
  )"
196
197
  />
197
198
 
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import type { SliderRootEmits } from 'reka-ui'
3
3
  import type { NSliderProps } from '../../types'
4
+ import { reactiveOmit } from '@vueuse/core'
4
5
  import { SliderRange, SliderRoot, SliderThumb, SliderTrack, useForwardPropsEmits } from 'reka-ui'
5
6
  import { computed } from 'vue'
6
7
  import { cn } from '../../utils'
@@ -9,17 +10,14 @@ const props = withDefaults(defineProps<NSliderProps>(), {
9
10
  slider: 'primary',
10
11
  })
11
12
  const emits = defineEmits<SliderRootEmits>()
12
- const delegatedProps = computed(() => {
13
- const { class: _, ...delegated } = props
14
-
15
- return delegated
16
- })
17
- const forwarded = useForwardPropsEmits(delegatedProps, emits)
13
+ const rootProps = reactiveOmit(props, ['class', 'una', 'slider', 'una'])
14
+ const forwarded = useForwardPropsEmits(rootProps, emits)
18
15
  const isVertical = computed(() => props.orientation === 'vertical')
19
16
  </script>
20
17
 
21
18
  <template>
22
19
  <SliderRoot
20
+ v-slot="{ modelValue }"
23
21
  :class="cn(
24
22
  'slider-root',
25
23
  isVertical && 'slider-root-vertical',
@@ -67,6 +67,7 @@ function getItemDescription(item: NonNullable<T | NRadioGroupItemProps>): string
67
67
 
68
68
  <template>
69
69
  <RadioGroupRoot
70
+ v-slot="{ modelValue }"
70
71
  :class="cn(
71
72
  'radio-group',
72
73
  orientation === 'horizontal' ? 'radio-group-orientation-horizontal' : 'radio-group-orientation-vertical',
@@ -75,7 +76,7 @@ function getItemDescription(item: NonNullable<T | NRadioGroupItemProps>): string
75
76
  )"
76
77
  v-bind="forwarded"
77
78
  >
78
- <slot>
79
+ <slot :model-value>
79
80
  <template v-if="items?.length">
80
81
  <RadioGroupItem
81
82
  v-for="item in items"
@@ -0,0 +1,61 @@
1
+ <script setup lang="ts">
2
+ import type { SplitterResizeHandleEmits } from 'reka-ui'
3
+ import type { NResizableHandleProps } from '../../types'
4
+ import { reactiveOmit } from '@vueuse/core'
5
+ import { SplitterResizeHandle, useForwardPropsEmits } from 'reka-ui'
6
+ import { computed } from 'vue'
7
+ import { cn } from '../../utils'
8
+ import Icon from '../elements/Icon.vue'
9
+
10
+ const props = withDefaults(defineProps<NResizableHandleProps>(), {
11
+ resizableHandle: 'solid-gray',
12
+ })
13
+ const emits = defineEmits<SplitterResizeHandleEmits>()
14
+
15
+ const delegatedProps = reactiveOmit(props, ['class', 'una', 'icon'])
16
+
17
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
18
+
19
+ const icon = computed(() =>
20
+ typeof props.icon === 'string'
21
+ ? props.icon
22
+ : props.icon === true
23
+ ? 'resizable-handle-icon-name'
24
+ : false,
25
+ )
26
+ </script>
27
+
28
+ <template>
29
+ <SplitterResizeHandle
30
+ v-bind="forwarded"
31
+ data-slot="resizable-handle"
32
+ :resizable-handle
33
+ :class="
34
+ cn(
35
+ 'resizable-handle',
36
+ props.una?.resizableHandle,
37
+ props.class,
38
+ )"
39
+ >
40
+ <slot>
41
+ <template v-if="icon">
42
+ <div
43
+ :class="cn(
44
+ 'resizable-handle-icon-wrapper',
45
+ props.una?.resizableHandleIconWrapper,
46
+ )"
47
+ >
48
+ <slot name="icon">
49
+ <Icon
50
+ :name="icon"
51
+ :class="cn(
52
+ 'resizable-handle-icon',
53
+ props.una?.resizableHandleIcon,
54
+ )"
55
+ />
56
+ </slot>
57
+ </div>
58
+ </template>
59
+ </slot>
60
+ </SplitterResizeHandle>
61
+ </template>
@@ -0,0 +1,29 @@
1
+ <script setup lang="ts">
2
+ import type { SplitterPanelEmits } from 'reka-ui'
3
+ import type { NResizablePanelProps } from '../../types'
4
+ import { reactiveOmit } from '@vueuse/core'
5
+ import { SplitterPanel, useForwardPropsEmits } from 'reka-ui'
6
+ import { cn } from '../../utils'
7
+
8
+ const props = defineProps<NResizablePanelProps>()
9
+ const emits = defineEmits<SplitterPanelEmits>()
10
+
11
+ const delegatedProps = reactiveOmit(props, ['class', 'una'])
12
+
13
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
14
+ </script>
15
+
16
+ <template>
17
+ <SplitterPanel
18
+ v-slot="{ ...slotProps }"
19
+ data-slot="resizable-panel"
20
+ v-bind="forwarded"
21
+ :class="cn(
22
+ 'resizable-panel',
23
+ props.una?.resizablePanel,
24
+ props.class,
25
+ )"
26
+ >
27
+ <slot v-bind="slotProps" />
28
+ </SplitterPanel>
29
+ </template>
@@ -0,0 +1,29 @@
1
+ <script setup lang="ts">
2
+ import type { SplitterGroupEmits } from 'reka-ui'
3
+ import type { NResizablePanelGroupProps } from '../../types'
4
+ import { reactiveOmit } from '@vueuse/core'
5
+ import { SplitterGroup, useForwardPropsEmits } from 'reka-ui'
6
+ import { cn } from '../../utils'
7
+
8
+ const props = defineProps<NResizablePanelGroupProps>()
9
+ const emits = defineEmits<SplitterGroupEmits>()
10
+
11
+ const delegatedProps = reactiveOmit(props, ['class', 'una'])
12
+
13
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
14
+ </script>
15
+
16
+ <template>
17
+ <SplitterGroup
18
+ v-slot="{ ...slotProps }"
19
+ data-slot="resizable-panel-group"
20
+ v-bind="forwarded"
21
+ :class="cn(
22
+ 'resizable-panel-group',
23
+ props.una?.resizablePanelGroup,
24
+ props.class,
25
+ )"
26
+ >
27
+ <slot v-bind="slotProps" />
28
+ </SplitterGroup>
29
+ </template>
@@ -0,0 +1,98 @@
1
+ import type { AlertDialogActionProps, AlertDialogCancelProps, AlertDialogContentProps, AlertDialogDescriptionProps, AlertDialogOverlayProps, AlertDialogProps, AlertDialogTitleProps, AlertDialogTriggerProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ import type { NButtonProps } from './button.js';
4
+ export interface NAlertDialogProps extends AlertDialogProps, Pick<NAlertDialogContentProps, 'preventClose' | 'overlay' | '_alertDialogCancel' | '_alertDialogAction' | '_alertDialogOverlay'> {
5
+ /**
6
+ * The title of the dialog.
7
+ */
8
+ title?: string;
9
+ /**
10
+ * The description of the dialog.
11
+ */
12
+ description?: string;
13
+ _alertDialogTitle?: NAlertDialogTitleProps;
14
+ _alertDialogDescription?: NAlertDialogDescriptionProps;
15
+ _alertDialogContent?: NAlertDialogContentProps;
16
+ _alertDialogTrigger?: NAlertDialogTriggerProps;
17
+ _alertDialogHeader?: NAlertDialogHeaderProps;
18
+ _alertDialogFooter?: NAlertDialogFooterProps;
19
+ /**
20
+ * `UnaUI` preset configuration
21
+ *
22
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/alert-dialog.ts
23
+ */
24
+ una?: NAlertDialogUnaProps;
25
+ }
26
+ interface BaseExtensions {
27
+ class?: HTMLAttributes['class'];
28
+ }
29
+ export interface NAlertDialogTitleProps extends AlertDialogTitleProps, BaseExtensions {
30
+ una?: Pick<NAlertDialogUnaProps, 'alertDialogTitle'>;
31
+ }
32
+ export interface NAlertDialogDescriptionProps extends AlertDialogDescriptionProps, BaseExtensions {
33
+ una?: Pick<NAlertDialogUnaProps, 'alertDialogDescription'>;
34
+ }
35
+ export interface NAlertDialogTriggerProps extends AlertDialogTriggerProps {
36
+ }
37
+ export interface NAlertDialogContentProps extends AlertDialogContentProps, BaseExtensions {
38
+ /**
39
+ * Prevent close.
40
+ *
41
+ * @default true
42
+ */
43
+ preventClose?: boolean;
44
+ /**
45
+ * Show overlay.
46
+ *
47
+ * @default true
48
+ */
49
+ overlay?: boolean;
50
+ /**
51
+ * The cancel button props.
52
+ */
53
+ _alertDialogCancel?: NAlertDialogCancelProps;
54
+ /**
55
+ * The action button props.
56
+ */
57
+ _alertDialogAction?: NAlertDialogActionProps;
58
+ /**
59
+ * The overlay props.
60
+ */
61
+ _alertDialogOverlay?: NAlertDialogOverlayProps;
62
+ /**
63
+ * `UnaUI` preset configuration
64
+ *
65
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/alert-dialog.ts
66
+ */
67
+ una?: Pick<NAlertDialogUnaProps, 'alertDialogContent' | 'alertDialogOverlay'>;
68
+ }
69
+ export interface NAlertDialogOverlayProps extends BaseExtensions, AlertDialogOverlayProps {
70
+ una?: Pick<NAlertDialogUnaProps, 'alertDialogOverlay'>;
71
+ }
72
+ export interface NAlertDialogCancelProps extends AlertDialogCancelProps, NButtonProps {
73
+ /**
74
+ * The cancel callback, triggered when the cancel button is clicked.
75
+ */
76
+ onClick?: (e: Event) => void;
77
+ }
78
+ export interface NAlertDialogActionProps extends AlertDialogActionProps, NButtonProps {
79
+ /**
80
+ * The action callback, triggered when the action button is clicked.
81
+ */
82
+ onClick?: (e: Event) => void;
83
+ }
84
+ export interface NAlertDialogHeaderProps extends BaseExtensions {
85
+ una?: Pick<NAlertDialogUnaProps, 'alertDialogHeader'>;
86
+ }
87
+ export interface NAlertDialogFooterProps extends BaseExtensions {
88
+ una?: Pick<NAlertDialogUnaProps, 'alertDialogFooter'>;
89
+ }
90
+ export interface NAlertDialogUnaProps {
91
+ alertDialogTitle?: HTMLAttributes['class'];
92
+ alertDialogDescription?: HTMLAttributes['class'];
93
+ alertDialogOverlay?: HTMLAttributes['class'];
94
+ alertDialogContent?: HTMLAttributes['class'];
95
+ alertDialogHeader?: HTMLAttributes['class'];
96
+ alertDialogFooter?: HTMLAttributes['class'];
97
+ }
98
+ export {};
File without changes
@@ -1,5 +1,6 @@
1
1
  export * from './accordion.js';
2
2
  export * from './alert.js';
3
+ export * from './alert-dialog.js';
3
4
  export * from './aspect-ratio.js';
4
5
  export * from './avatar.js';
5
6
  export * from './avatar-group.js';
@@ -25,6 +26,7 @@ export * from './pagination.js';
25
26
  export * from './popover.js';
26
27
  export * from './progress.js';
27
28
  export * from './radio-group.js';
29
+ export * from './resizable.js';
28
30
  export * from './scroll-area.js';
29
31
  export * from './select.js';
30
32
  export * from './separator.js';
@@ -1,5 +1,6 @@
1
1
  export * from "./accordion.js";
2
2
  export * from "./alert.js";
3
+ export * from "./alert-dialog.js";
3
4
  export * from "./aspect-ratio.js";
4
5
  export * from "./avatar.js";
5
6
  export * from "./avatar-group.js";
@@ -25,6 +26,7 @@ export * from "./pagination.js";
25
26
  export * from "./popover.js";
26
27
  export * from "./progress.js";
27
28
  export * from "./radio-group.js";
29
+ export * from "./resizable.js";
28
30
  export * from "./scroll-area.js";
29
31
  export * from "./select.js";
30
32
  export * from "./separator.js";
@@ -106,6 +106,7 @@ export interface NInputProps {
106
106
  una?: {
107
107
  input?: string;
108
108
  inputLoading?: string;
109
+ inputStatusIconBase?: string;
109
110
  inputTrailing?: string;
110
111
  inputLeading?: string;
111
112
  inputWrapper?: string;
@@ -0,0 +1,46 @@
1
+ import type { SplitterGroupProps, SplitterPanelProps, SplitterResizeHandleProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ interface BaseExtension {
4
+ /** CSS class for the component */
5
+ class?: HTMLAttributes['class'];
6
+ }
7
+ export interface NResizablePanelGroupProps extends SplitterGroupProps, BaseExtension {
8
+ /** Additional properties for the una component */
9
+ una?: Pick<NResizableUnaProps, 'resizablePanelGroup'>;
10
+ }
11
+ export interface NResizablePanelProps extends SplitterPanelProps, BaseExtension {
12
+ /** Additional properties for the una component */
13
+ una?: Pick<NResizableUnaProps, 'resizablePanel'>;
14
+ }
15
+ export interface NResizableHandleProps extends SplitterResizeHandleProps, BaseExtension {
16
+ /**
17
+ * Allows you to add `UnaUI` resizable handle preset properties,
18
+ * Think of it as a shortcut for adding options or variants to the preset if available.
19
+ *
20
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/resizable.ts
21
+ * @example
22
+ * resizable-handle="outline-yellow"
23
+ */
24
+ resizableHandle?: string;
25
+ /**
26
+ * Custom handle icon
27
+ * @example
28
+ * icon="i-lucide-grip-vertical"
29
+ */
30
+ icon?: boolean | HTMLAttributes['class'];
31
+ /** Additional properties for the una component */
32
+ una?: Pick<NResizableUnaProps, 'resizableHandle' | 'resizableHandleIconWrapper' | 'resizableHandleIcon'>;
33
+ }
34
+ interface NResizableUnaProps {
35
+ /** CSS class for the resizable panel */
36
+ resizablePanel?: HTMLAttributes['class'];
37
+ /** CSS class for the resizable panel group */
38
+ resizablePanelGroup?: HTMLAttributes['class'];
39
+ /** CSS class for the resizable handle */
40
+ resizableHandle?: HTMLAttributes['class'];
41
+ /** CSS class for the resizable handle icon wrapper */
42
+ resizableHandleIconWrapper?: HTMLAttributes['class'];
43
+ /** CSS class for the resizable handle icon */
44
+ resizableHandleIcon?: HTMLAttributes['class'];
45
+ }
46
+ export {};
File without changes
package/dist/types.d.mts CHANGED
@@ -1 +1,7 @@
1
- export { type ModuleOptions, default } from './module.js'
1
+ import type { NuxtModule } from '@nuxt/schema'
2
+
3
+ import type { default as Module } from './module.js'
4
+
5
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
+
7
+ export { default } from './module.js'
package/dist/types.d.ts CHANGED
@@ -1 +1,7 @@
1
- export { type ModuleOptions, default } from './module'
1
+ import type { NuxtModule } from '@nuxt/schema'
2
+
3
+ import type { default as Module } from './module'
4
+
5
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
+
7
+ export { default } from './module'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "type": "module",
4
- "version": "0.52.1",
4
+ "version": "0.54.0",
5
5
  "description": "Nuxt module for @una-ui",
6
6
  "author": "Phojie Rengel <phojrengel@gmail.com>",
7
7
  "license": "MIT",
@@ -59,8 +59,8 @@
59
59
  "typescript": "5.6.3",
60
60
  "unocss": "^66.0.0",
61
61
  "unocss-preset-animations": "^1.2.1",
62
- "@una-ui/extractor-vue-script": "^0.52.1",
63
- "@una-ui/preset": "^0.52.1"
62
+ "@una-ui/extractor-vue-script": "^0.54.0",
63
+ "@una-ui/preset": "^0.54.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@iconify-json/lucide": "^1.2.39",