@una-ui/nuxt 0.45.0 → 0.47.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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "configKey": "una",
4
- "version": "0.45.0",
4
+ "version": "0.47.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.45.0";
11
+ const version = "0.47.0";
12
12
 
13
13
  const module = defineNuxtModule({
14
14
  meta: {
@@ -7,6 +7,7 @@ import type {
7
7
  GroupingState,
8
8
  Header,
9
9
  PaginationState,
10
+ RowSelectionState,
10
11
  SortingState,
11
12
  VisibilityState,
12
13
  } from '@tanstack/vue-table'
@@ -47,7 +48,7 @@ const emit = defineEmits(['select', 'selectAll', 'expand'])
47
48
 
48
49
  const slots = defineSlots()
49
50
 
50
- const rowSelection = defineModel<Record<string, boolean>>('modelValue')
51
+ const rowSelection = defineModel<RowSelectionState>('rowSelection')
51
52
  const sorting = defineModel<SortingState>('sorting')
52
53
  const columnVisibility = defineModel<VisibilityState>('columnVisibility')
53
54
  const columnFilters = defineModel<ColumnFiltersState>('columnFilters')
@@ -20,7 +20,7 @@ const delegatedProps = computed(() => {
20
20
  <TableRow
21
21
  :class="cn(
22
22
  'table-loading-row',
23
- props.una?.tableRow,
23
+ props.una?.tableLoadingRow,
24
24
  )"
25
25
  data-loading="true"
26
26
  v-bind="delegatedProps._tableRow"
@@ -29,7 +29,7 @@ const delegatedProps = computed(() => {
29
29
  :class="
30
30
  cn(
31
31
  'table-loading-cell',
32
- props.una?.tableCell,
32
+ props.una?.tableLoadingCell,
33
33
  )
34
34
  "
35
35
  :colspan="0"
@@ -35,6 +35,8 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
35
35
  :toggle-on
36
36
  :as="Button"
37
37
  >
38
- <slot v-for="(slotContent, slotName) in $slots" :name="slotName" v-bind="slotContent" />
38
+ <template v-for="(_, name) in $slots" #[name]="slotData">
39
+ <slot :name="name" v-bind="slotData" />
40
+ </template>
39
41
  </Toggle>
40
42
  </template>
@@ -42,8 +42,11 @@ const forwardedProps = useForwardProps(delegatedProps)
42
42
  btnTrailing: cn('dropdown-menu-item-trailing', forwardedProps.una?.btnTrailing),
43
43
  ...forwardedProps.una,
44
44
  }"
45
+ @click="forwardedProps.onSelect"
45
46
  >
46
- <slot v-for="(slotContent, slotName) in $slots" :name="slotName" v-bind="slotContent" />
47
+ <template v-for="(_, name) in $slots" #[name]="slotData">
48
+ <slot :name="name" v-bind="slotData" />
49
+ </template>
47
50
 
48
51
  <template
49
52
  v-if="forwardedProps.shortcut"
@@ -41,7 +41,9 @@ const forwardedProps = useForwardProps(delegatedProps)
41
41
  }"
42
42
  trailing="dropdown-menu-sub-trigger-trailing-icon"
43
43
  >
44
- <slot v-for="(slotContent, slotName) in $slots" :name="slotName" v-bind="slotContent" />
44
+ <template v-for="(_, name) in $slots" #[name]="slotData">
45
+ <slot :name="name" v-bind="slotData" />
46
+ </template>
45
47
  </Button>
46
48
  </dropdownmenusubtrigger>
47
49
  </template>
@@ -38,7 +38,9 @@ const forwardedProps = useForwardProps(delegatedProps)
38
38
  props.class,
39
39
  )"
40
40
  >
41
- <slot v-for="(slotContent, slotName) in $slots" :name="slotName" v-bind="slotContent" />
41
+ <template v-for="(_, name) in $slots" #[name]="slotData">
42
+ <slot :name="name" v-bind="slotData" />
43
+ </template>
42
44
  </Button>
43
45
  </PaginationListItem>
44
46
  </template>
@@ -26,7 +26,9 @@ const { toasts } = useToast()
26
26
  :key="t.id"
27
27
  v-bind="{ ..._toast, ...$attrs, ...t }"
28
28
  >
29
- <slot v-for="(slotContent, slotName) in $slots" :name="slotName" v-bind="slotContent" />
29
+ <template v-for="(_, name) in $slots" #[name]="slotData">
30
+ <slot :name="name" v-bind="slotData" />
31
+ </template>
30
32
  </Toast>
31
33
 
32
34
  <ToastViewport v-bind="_toastViewport" />
@@ -31,7 +31,9 @@ const delegatedProps = computed(() => {
31
31
  :id="randomId('toast-action')"
32
32
  :class="cn('toast-action', props.class)"
33
33
  >
34
- <slot v-for="(slotContent, slotName) in $slots" :name="slotName" v-bind="slotContent" />
34
+ <template v-for="(_, name) in $slots" #[name]="slotData">
35
+ <slot :name="name" v-bind="slotData" />
36
+ </template>
35
37
  </Button>
36
38
  </ToastAction>
37
39
  </template>
@@ -1,5 +1,6 @@
1
- import type { DropdownMenuContentProps, DropdownMenuGroupProps, DropdownMenuLabelProps, DropdownMenuRootProps, DropdownMenuSeparatorProps, DropdownMenuSubContentProps, DropdownMenuSubTriggerProps, DropdownMenuTriggerProps } from 'reka-ui';
1
+ import type { DropdownMenuContentProps, DropdownMenuGroupProps, DropdownMenuItemProps, DropdownMenuLabelProps, DropdownMenuRootProps, DropdownMenuSeparatorProps, DropdownMenuSubContentProps, DropdownMenuSubTriggerProps, DropdownMenuTriggerProps } from 'reka-ui';
2
2
  import type { HTMLAttributes } from 'vue';
3
+ import type { FocusOutsideEvent, PointerDownOutsideEvent } from './/index.js';
3
4
  import type { NButtonProps } from './button.js';
4
5
  import type { NSeparatorProps } from './separator.js';
5
6
  /**
@@ -14,7 +15,7 @@ interface BaseExtensions {
14
15
  /**
15
16
  * Props for the NDropdownMenu component.
16
17
  */
17
- export interface NDropdownMenuProps extends Omit<NDropdownMenuRootProps, 'class' | 'size'>, Omit<NDropdownMenuTriggerProps, 'una'>, Pick<NDropdownMenuItemProps, 'shortcut' | 'dropdownMenuItem' | 'onClick'> {
18
+ export interface NDropdownMenuProps extends Omit<NDropdownMenuRootProps, 'class' | 'size'>, Omit<NDropdownMenuTriggerProps, 'una'>, Omit<NDropdownMenuItemProps, 'una'> {
18
19
  /** Label for the menu */
19
20
  menuLabel?: string;
20
21
  /** Items in the dropdown menu */
@@ -62,6 +63,16 @@ export interface NDropdownMenuTriggerProps extends NButtonProps, DropdownMenuTri
62
63
  * Props for the NDropdownMenuContent component.
63
64
  */
64
65
  export interface NDropdownMenuContentProps extends BaseExtensions, DropdownMenuContentProps {
66
+ /** Event handler called when auto-focusing on close. Can be prevented. */
67
+ onCloseAutoFocus?: (e: Event) => void;
68
+ /** Event handler called when the escape key is down. Can be prevented. */
69
+ onEscapeKeyDown?: (e: KeyboardEvent) => void;
70
+ /** Event handler called when the focus moves outside of the DismissableLayer. Can be prevented. */
71
+ onFocusOutside?: (e: FocusOutsideEvent) => void;
72
+ /** Event handler called when an interaction happens outside the DismissableLayer. Can be prevented. */
73
+ onInteractOutside?: (e: PointerDownOutsideEvent | FocusOutsideEvent) => void;
74
+ /** Event handler called when a pointerdown event happens outside of the DismissableLayer. Can be prevented. */
75
+ onPointerDownOutside?: (e: PointerDownOutsideEvent) => void;
65
76
  /** Additional properties for the una component */
66
77
  una?: NDropdownMenuUnaProps['dropdownMenuContent'];
67
78
  }
@@ -100,7 +111,7 @@ export interface NDropdownMenuSubContentProps extends BaseExtensions, DropdownMe
100
111
  /**
101
112
  * Props for the NDropdownMenuItem component.
102
113
  */
103
- export interface NDropdownMenuItemProps extends NButtonProps {
114
+ export interface NDropdownMenuItemProps extends DropdownMenuItemProps, NButtonProps {
104
115
  /** Dropdown menu item */
105
116
  dropdownMenuItem?: HTMLAttributes['class'];
106
117
  /** Whether the item is inset */
@@ -111,8 +122,8 @@ export interface NDropdownMenuItemProps extends NButtonProps {
111
122
  _dropdownMenuShortcut?: Partial<NDropdownMenuShortcutProps>;
112
123
  /** Additional properties for the una component */
113
124
  una?: NDropdownMenuUnaProps['dropdownMenuItem'] & NButtonProps['una'];
114
- /** Click event handler */
115
- onClick?: () => void;
125
+ /** Select event handler */
126
+ onSelect?: (e: Event) => void;
116
127
  }
117
128
  /**
118
129
  * Props for the NDropdownMenuSubTrigger component.
@@ -59,3 +59,8 @@ export interface UnaSettings {
59
59
  fontSize: number;
60
60
  radius: number;
61
61
  }
62
+ export type OutsideEvent<T extends Event> = CustomEvent<{
63
+ originalEvent: T;
64
+ }>;
65
+ export type PointerDownOutsideEvent = OutsideEvent<PointerEvent>;
66
+ export type FocusOutsideEvent = OutsideEvent<FocusEvent>;
@@ -163,7 +163,7 @@ export interface NTableLoadingProps {
163
163
  _tableCell?: NTableCellProps;
164
164
  _tableRow?: NTableRowProps;
165
165
  _tableProgress?: NProgressProps;
166
- una?: Pick<NTableUnaProps, 'tableLoading' | 'tableRow' | 'tableCell'>;
166
+ una?: Pick<NTableUnaProps, 'tableLoading' | 'tableLoadingCell' | 'tableLoadingRow'>;
167
167
  }
168
168
  export interface NTableCaptionProps {
169
169
  class?: HTMLAttributes['class'];
@@ -181,5 +181,7 @@ interface NTableUnaProps {
181
181
  tableCaption?: HTMLAttributes['class'];
182
182
  tableEmpty?: HTMLAttributes['class'];
183
183
  tableLoading?: HTMLAttributes['class'];
184
+ tableLoadingRow?: HTMLAttributes['class'];
185
+ tableLoadingCell?: HTMLAttributes['class'];
184
186
  }
185
187
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "type": "module",
4
- "version": "0.45.0",
4
+ "version": "0.47.0",
5
5
  "description": "Nuxt module for @una-ui",
6
6
  "author": "Phojie Rengel <phojrengel@gmail.com>",
7
7
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@headlessui/vue": "^1.7.23",
41
41
  "@iconify/utils": "^2.3.0",
42
- "@nuxt/kit": "^3.16.0",
42
+ "@nuxt/kit": "^3.16.1",
43
43
  "@nuxtjs/color-mode": "^3.5.2",
44
44
  "@tanstack/vue-table": "^8.21.2",
45
45
  "@unocss/core": "^66.0.0",
@@ -54,21 +54,21 @@
54
54
  "class-variance-authority": "^0.7.1",
55
55
  "clsx": "^2.1.1",
56
56
  "ohash": "^1.1.6",
57
- "reka-ui": "^2.1.0",
57
+ "reka-ui": "^2.1.1",
58
58
  "tailwind-merge": "^3.0.2",
59
59
  "typescript": "5.6.3",
60
60
  "unocss": "^66.0.0",
61
61
  "unocss-preset-animations": "^1.1.1",
62
- "@una-ui/preset": "^0.45.0",
63
- "@una-ui/extractor-vue-script": "^0.45.0"
62
+ "@una-ui/extractor-vue-script": "^0.47.0",
63
+ "@una-ui/preset": "^0.47.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@iconify-json/lucide": "^1.2.32",
67
67
  "@iconify-json/radix-icons": "^1.2.2",
68
68
  "@iconify-json/tabler": "^1.2.17",
69
69
  "@nuxt/module-builder": "^0.8.4",
70
- "@nuxt/schema": "^3.16.0",
71
- "nuxt": "^3.16.0",
70
+ "@nuxt/schema": "^3.16.1",
71
+ "nuxt": "^3.16.1",
72
72
  "zod": "^3.24.2"
73
73
  },
74
74
  "publishConfig": {