@nuxt/ui 2.11.1 → 2.12.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 (63) hide show
  1. package/dist/module.d.mts +100 -28
  2. package/dist/module.d.ts +100 -28
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +2 -2
  5. package/dist/runtime/components/data/Table.vue +26 -18
  6. package/dist/runtime/components/data/Table.vue.d.ts +21 -12
  7. package/dist/runtime/components/elements/Accordion.vue +8 -4
  8. package/dist/runtime/components/elements/Accordion.vue.d.ts +4 -4
  9. package/dist/runtime/components/elements/Alert.vue +8 -2
  10. package/dist/runtime/components/elements/Alert.vue.d.ts +5 -10
  11. package/dist/runtime/components/elements/Button.vue.d.ts +1 -1
  12. package/dist/runtime/components/elements/Chip.vue.d.ts +2 -2
  13. package/dist/runtime/components/elements/Dropdown.vue +64 -15
  14. package/dist/runtime/components/elements/Dropdown.vue.d.ts +30 -2
  15. package/dist/runtime/components/elements/Link.vue +2 -2
  16. package/dist/runtime/components/forms/Form.vue +16 -7
  17. package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
  18. package/dist/runtime/components/forms/Input.vue +1 -1
  19. package/dist/runtime/components/forms/Input.vue.d.ts +1 -1
  20. package/dist/runtime/components/forms/InputMenu.vue +410 -0
  21. package/dist/runtime/components/forms/InputMenu.vue.d.ts +331 -0
  22. package/dist/runtime/components/forms/RadioGroup.vue +1 -1
  23. package/dist/runtime/components/forms/Select.vue +1 -1
  24. package/dist/runtime/components/forms/Select.vue.d.ts +1 -1
  25. package/dist/runtime/components/forms/SelectMenu.vue +52 -19
  26. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +28 -8
  27. package/dist/runtime/components/forms/Toggle.vue +1 -1
  28. package/dist/runtime/components/forms/Toggle.vue.d.ts +2 -1
  29. package/dist/runtime/components/navigation/Breadcrumb.vue +7 -4
  30. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +3 -0
  31. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +1 -1
  32. package/dist/runtime/components/navigation/Pagination.vue +9 -4
  33. package/dist/runtime/components/navigation/Pagination.vue.d.ts +9 -0
  34. package/dist/runtime/components/navigation/VerticalNavigation.vue +54 -37
  35. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +7 -3
  36. package/dist/runtime/components/overlays/Modal.vue.d.ts +1 -1
  37. package/dist/runtime/components/overlays/Popover.vue +49 -13
  38. package/dist/runtime/components/overlays/Popover.vue.d.ts +14 -4
  39. package/dist/runtime/components/overlays/Slideover.vue.d.ts +1 -1
  40. package/dist/runtime/composables/useShortcuts.mjs +3 -1
  41. package/dist/runtime/types/alert.d.ts +5 -0
  42. package/dist/runtime/types/breadcrumb.d.ts +1 -0
  43. package/dist/runtime/types/dropdown.d.ts +2 -0
  44. package/dist/runtime/types/form.d.ts +1 -0
  45. package/dist/runtime/types/vertical-navigation.d.ts +1 -0
  46. package/dist/runtime/ui.config/forms/input.mjs +12 -12
  47. package/dist/runtime/ui.config/forms/inputMenu.d.ts +64 -0
  48. package/dist/runtime/ui.config/forms/inputMenu.mjs +62 -0
  49. package/dist/runtime/ui.config/forms/selectMenu.d.ts +14 -12
  50. package/dist/runtime/ui.config/forms/selectMenu.mjs +7 -41
  51. package/dist/runtime/ui.config/index.d.ts +1 -0
  52. package/dist/runtime/ui.config/index.mjs +1 -0
  53. package/dist/runtime/ui.config/layout/card.mjs +1 -1
  54. package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +1 -0
  55. package/dist/runtime/ui.config/navigation/breadcrumb.mjs +1 -0
  56. package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +5 -0
  57. package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +5 -0
  58. package/dist/runtime/ui.config/popper.mjs +2 -1
  59. package/dist/runtime/utils/index.mjs +11 -3
  60. package/dist/runtime/utils/uid.mjs +2 -1
  61. package/dist/types.d.mts +2 -2
  62. package/dist/types.d.ts +1 -1
  63. package/package.json +27 -24
@@ -5,19 +5,19 @@
5
5
  <ULink
6
6
  as="span"
7
7
  :class="[ui.base, index === links.length - 1 ? ui.active : !!link.to ? ui.inactive : '']"
8
- v-bind="omit(link, ['label', 'icon', 'iconClass'])"
8
+ v-bind="omit(link, ['label', 'labelClass', 'icon', 'iconClass'])"
9
9
  :aria-current="index === links.length - 1 ? 'page' : undefined"
10
10
  >
11
11
  <slot name="icon" :link="link" :index="index" :is-active="index === links.length - 1">
12
12
  <UIcon
13
13
  v-if="link.icon"
14
14
  :name="link.icon"
15
- :class="[ui.icon.base, index === links.length - 1 ? ui.icon.active : !!link.to ? ui.icon.inactive : '', link.iconClass]"
15
+ :class="twMerge(twJoin(ui.icon.base, index === links.length - 1 ? ui.icon.active : !!link.to ? ui.icon.inactive : ''), link.iconClass)"
16
16
  />
17
17
  </slot>
18
18
 
19
19
  <slot :link="link" :index="index" :is-active="index === links.length - 1">
20
- {{ link.label }}
20
+ <span v-if="link.label" :class="twMerge(ui.label, link.labelClass)">{{ link.label }}</span>
21
21
  </slot>
22
22
  </ULink>
23
23
 
@@ -34,6 +34,7 @@
34
34
 
35
35
  <script>
36
36
  import { defineComponent, toRef } from "vue";
37
+ import { twMerge, twJoin } from "tailwind-merge";
37
38
  import UIcon from "../elements/Icon.vue";
38
39
  import ULink from "../elements/Link.vue";
39
40
  import { useUI } from "../../composables/useUI";
@@ -71,7 +72,9 @@ export default defineComponent({
71
72
  // eslint-disable-next-line vue/no-dupe-keys
72
73
  ui,
73
74
  attrs,
74
- omit
75
+ omit,
76
+ twMerge,
77
+ twJoin
75
78
  };
76
79
  }
77
80
  });
@@ -1,4 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
+ import { twJoin } from 'tailwind-merge';
2
3
  import { omit } from '../../utils';
3
4
  import type { BreadcrumbLink } from '../../types';
4
5
  declare const _default: import("vue").DefineComponent<{
@@ -24,6 +25,8 @@ declare const _default: import("vue").DefineComponent<{
24
25
  [x: string]: unknown;
25
26
  }, string>>;
26
27
  omit: typeof omit;
28
+ twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
29
+ twJoin: typeof twJoin;
27
30
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
28
31
  links: {
29
32
  type: PropType<BreadcrumbLink[]>;
@@ -220,8 +220,8 @@ declare const _default: import("vue").DefineComponent<{
220
220
  loadingIcon: string;
221
221
  nullable: boolean;
222
222
  selectedIcon: string;
223
- searchable: boolean;
224
223
  debounce: number;
224
+ searchable: boolean;
225
225
  groups: Group[];
226
226
  groupAttribute: string;
227
227
  commandAttribute: string;
@@ -4,7 +4,7 @@
4
4
  <UButton
5
5
  v-if="firstButton && showFirst"
6
6
  :size="size"
7
- :disabled="!canGoFirstOrPrev"
7
+ :disabled="!canGoFirstOrPrev || disabled"
8
8
  :class="[ui.base, ui.rounded]"
9
9
  v-bind="{ ...(ui.default.firstButton || {}), ...firstButton }"
10
10
  :ui="{ rounded: '' }"
@@ -17,7 +17,7 @@
17
17
  <UButton
18
18
  v-if="prevButton"
19
19
  :size="size"
20
- :disabled="!canGoFirstOrPrev"
20
+ :disabled="!canGoFirstOrPrev || disabled"
21
21
  :class="[ui.base, ui.rounded]"
22
22
  v-bind="{ ...(ui.default.prevButton || {}), ...prevButton }"
23
23
  :ui="{ rounded: '' }"
@@ -30,6 +30,7 @@
30
30
  v-for="(page, index) of displayedPages"
31
31
  :key="`${page}-${index}`"
32
32
  :size="size"
33
+ :disabled="disabled"
33
34
  :label="`${page}`"
34
35
  v-bind="page === currentPage ? { ...(ui.default.activeButton || {}), ...activeButton } : { ...(ui.default.inactiveButton || {}), ...inactiveButton }"
35
36
  :class="[{ 'pointer-events-none': typeof page === 'string', 'z-[1]': page === currentPage }, ui.base, ui.rounded]"
@@ -41,7 +42,7 @@
41
42
  <UButton
42
43
  v-if="nextButton"
43
44
  :size="size"
44
- :disabled="!canGoLastOrNext"
45
+ :disabled="!canGoLastOrNext || disabled"
45
46
  :class="[ui.base, ui.rounded]"
46
47
  v-bind="{ ...(ui.default.nextButton || {}), ...nextButton }"
47
48
  :ui="{ rounded: '' }"
@@ -54,7 +55,7 @@
54
55
  <UButton
55
56
  v-if="lastButton && showLast"
56
57
  :size="size"
57
- :disabled="!canGoLastOrNext"
58
+ :disabled="!canGoLastOrNext || disabled"
58
59
  :class="[ui.base, ui.rounded]"
59
60
  v-bind="{ ...(ui.default.lastButton || {}), ...lastButton }"
60
61
  :ui="{ rounded: '' }"
@@ -99,6 +100,10 @@ export default defineComponent({
99
100
  return value >= 5 && value < Number.MAX_VALUE;
100
101
  }
101
102
  },
103
+ disabled: {
104
+ type: Boolean,
105
+ default: false
106
+ },
102
107
  size: {
103
108
  type: String,
104
109
  default: () => config.default.size,
@@ -18,6 +18,10 @@ declare const _default: import("vue").DefineComponent<{
18
18
  default: number;
19
19
  validate(value: any): boolean;
20
20
  };
21
+ disabled: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
21
25
  size: {
22
26
  type: PropType<ButtonSize>;
23
27
  default: () => any;
@@ -100,6 +104,10 @@ declare const _default: import("vue").DefineComponent<{
100
104
  default: number;
101
105
  validate(value: any): boolean;
102
106
  };
107
+ disabled: {
108
+ type: BooleanConstructor;
109
+ default: boolean;
110
+ };
103
111
  size: {
104
112
  type: PropType<ButtonSize>;
105
113
  default: () => any;
@@ -155,6 +163,7 @@ declare const _default: import("vue").DefineComponent<{
155
163
  size: ButtonSize;
156
164
  ui: any;
157
165
  class: any;
166
+ disabled: boolean;
158
167
  max: number;
159
168
  divider: string;
160
169
  pageCount: number;
@@ -1,47 +1,57 @@
1
1
  <template>
2
2
  <nav :class="ui.wrapper" v-bind="attrs">
3
- <ULink
4
- v-for="(link, index) of links"
5
- v-slot="{ isActive }"
6
- :key="index"
7
- v-bind="omit(link, ['label', 'icon', 'iconClass', 'avatar', 'badge', 'click'])"
8
- :class="[ui.base, ui.padding, ui.width, ui.ring, ui.rounded, ui.font, ui.size]"
9
- :active-class="ui.active"
10
- :inactive-class="ui.inactive"
11
- @click="link.click"
12
- @keyup.enter="$event.target.blur()"
13
- >
14
- <slot name="avatar" :link="link" :is-active="isActive">
15
- <UAvatar
16
- v-if="link.avatar"
17
- v-bind="{ size: ui.avatar.size, ...link.avatar }"
18
- :class="[ui.avatar.base]"
19
- />
20
- </slot>
21
- <slot name="icon" :link="link" :is-active="isActive">
22
- <UIcon
23
- v-if="link.icon"
24
- :name="link.icon"
25
- :class="[ui.icon.base, isActive ? ui.icon.active : ui.icon.inactive, link.iconClass]"
26
- />
27
- </slot>
28
- <slot :link="link" :is-active="isActive">
29
- <span v-if="link.label" :class="ui.label">{{ link.label }}</span>
30
- </slot>
31
- <slot name="badge" :link="link" :is-active="isActive">
32
- <span v-if="link.badge" :class="[ui.badge.base, isActive ? ui.badge.active : ui.badge.inactive]">
33
- {{ link.badge }}
34
- </span>
35
- </slot>
36
- </ULink>
3
+ <ul v-for="(section, sectionIndex) of linkSections" :key="`linkSection${sectionIndex}`">
4
+ <li v-for="(link, index) of section" :key="`linkSection${sectionIndex}-${index}`">
5
+ <ULink
6
+ v-slot="{ isActive }"
7
+ v-bind="omit(link, ['label', 'labelClass', 'icon', 'iconClass', 'avatar', 'badge', 'click'])"
8
+ :class="[ui.base, ui.padding, ui.width, ui.ring, ui.rounded, ui.font, ui.size]"
9
+ :active-class="ui.active"
10
+ :inactive-class="ui.inactive"
11
+ @click="link.click"
12
+ @keyup.enter="$event.target.blur()"
13
+ >
14
+ <slot name="avatar" :link="link" :is-active="isActive">
15
+ <UAvatar
16
+ v-if="link.avatar"
17
+ v-bind="{ size: ui.avatar.size, ...link.avatar }"
18
+ :class="[ui.avatar.base]"
19
+ />
20
+ </slot>
21
+ <slot name="icon" :link="link" :is-active="isActive">
22
+ <UIcon
23
+ v-if="link.icon"
24
+ :name="link.icon"
25
+ :class="twMerge(twJoin(ui.icon.base, isActive ? ui.icon.active : ui.icon.inactive), link.iconClass)"
26
+ />
27
+ </slot>
28
+ <slot :link="link" :is-active="isActive">
29
+ <span v-if="link.label" :class="twMerge(ui.label, link.labelClass)">
30
+ <span v-if="isActive" class="sr-only">
31
+ Current page:
32
+ </span>
33
+ {{ link.label }}
34
+ </span>
35
+ </slot>
36
+ <slot name="badge" :link="link" :is-active="isActive">
37
+ <span v-if="link.badge" :class="[ui.badge.base, isActive ? ui.badge.active : ui.badge.inactive]">
38
+ {{ link.badge }}
39
+ </span>
40
+ </slot>
41
+ </ULink>
42
+ </li>
43
+ <UDivider v-if="sectionIndex < linkSections.length - 1" :ui="ui.divider" />
44
+ </ul>
37
45
  </nav>
38
46
  </template>
39
47
 
40
48
  <script>
41
- import { toRef, defineComponent } from "vue";
49
+ import { toRef, defineComponent, computed } from "vue";
50
+ import { twMerge, twJoin } from "tailwind-merge";
42
51
  import UIcon from "../elements/Icon.vue";
43
52
  import UAvatar from "../elements/Avatar.vue";
44
53
  import ULink from "../elements/Link.vue";
54
+ import UDivider from "../layout/Divider.vue";
45
55
  import { useUI } from "../../composables/useUI";
46
56
  import { mergeConfig, omit } from "../../utils";
47
57
  import appConfig from "#build/app.config";
@@ -51,7 +61,8 @@ export default defineComponent({
51
61
  components: {
52
62
  UIcon,
53
63
  UAvatar,
54
- ULink
64
+ ULink,
65
+ UDivider
55
66
  },
56
67
  inheritAttrs: false,
57
68
  props: {
@@ -70,11 +81,17 @@ export default defineComponent({
70
81
  },
71
82
  setup(props) {
72
83
  const { ui, attrs } = useUI("verticalNavigation", toRef(props, "ui"), config, toRef(props, "class"));
84
+ const linkSections = computed(() => {
85
+ return Array.isArray(props.links[0]) ? props.links : [props.links];
86
+ });
73
87
  return {
74
88
  // eslint-disable-next-line vue/no-dupe-keys
75
89
  ui,
76
90
  attrs,
77
- omit
91
+ omit,
92
+ linkSections,
93
+ twMerge,
94
+ twJoin
78
95
  };
79
96
  }
80
97
  });
@@ -1,9 +1,10 @@
1
1
  import type { PropType } from 'vue';
2
+ import { twJoin } from 'tailwind-merge';
2
3
  import { omit } from '../../utils';
3
4
  import type { VerticalNavigationLink } from '../../types';
4
5
  declare const _default: import("vue").DefineComponent<{
5
6
  links: {
6
- type: PropType<VerticalNavigationLink[]>;
7
+ type: PropType<VerticalNavigationLink[] | VerticalNavigationLink[][]>;
7
8
  default: () => never[];
8
9
  };
9
10
  class: {
@@ -20,9 +21,12 @@ declare const _default: import("vue").DefineComponent<{
20
21
  [x: string]: unknown;
21
22
  }, string>>;
22
23
  omit: typeof omit;
24
+ linkSections: import("vue").ComputedRef<VerticalNavigationLink[][]>;
25
+ twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
26
+ twJoin: typeof twJoin;
23
27
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
24
28
  links: {
25
- type: PropType<VerticalNavigationLink[]>;
29
+ type: PropType<VerticalNavigationLink[] | VerticalNavigationLink[][]>;
26
30
  default: () => never[];
27
31
  };
28
32
  class: {
@@ -36,6 +40,6 @@ declare const _default: import("vue").DefineComponent<{
36
40
  }>>, {
37
41
  ui: any;
38
42
  class: any;
39
- links: VerticalNavigationLink[];
43
+ links: VerticalNavigationLink[] | VerticalNavigationLink[][];
40
44
  }, {}>;
41
45
  export default _default;
@@ -78,11 +78,11 @@ declare const _default: import("vue").DefineComponent<{
78
78
  onClose?: ((...args: any[]) => any) | undefined;
79
79
  }, {
80
80
  ui: any;
81
+ transition: boolean;
81
82
  class: any;
82
83
  modelValue: boolean;
83
84
  appear: boolean;
84
85
  overlay: boolean;
85
- transition: boolean;
86
86
  preventClose: boolean;
87
87
  fullscreen: boolean;
88
88
  }, {}>;
@@ -1,5 +1,6 @@
1
1
  <template>
2
- <HPopover ref="popover" v-slot="{ open: headlessOpen, close }" :class="ui.wrapper" v-bind="attrs" @mouseleave="onMouseLeave">
2
+ <!-- eslint-disable-next-line vue/no-template-shadow -->
3
+ <HPopover ref="popover" v-slot="{ open, close }" :class="ui.wrapper" v-bind="attrs" @mouseleave="onMouseLeave">
3
4
  <HPopoverButton
4
5
  ref="trigger"
5
6
  as="div"
@@ -8,7 +9,7 @@
8
9
  role="button"
9
10
  @mouseover="onMouseOver"
10
11
  >
11
- <slot :open="(open !== undefined) ? open : headlessOpen" :close="close">
12
+ <slot :open="open" :close="close">
12
13
  <button :disabled="disabled">
13
14
  Open
14
15
  </button>
@@ -16,16 +17,16 @@
16
17
  </HPopoverButton>
17
18
 
18
19
  <Transition v-if="overlay" appear v-bind="ui.overlay.transition">
19
- <div v-if="(open !== undefined) ? open : headlessOpen" :class="[ui.overlay.base, ui.overlay.background]" @click="$emit('update:open')" />
20
+ <div v-if="open" :class="[ui.overlay.base, ui.overlay.background]" />
20
21
  </Transition>
21
22
 
22
- <div v-if="(open !== undefined) ? open : headlessOpen" ref="container" :class="[ui.container, ui.width]" :style="containerStyle" @mouseover="onMouseOver">
23
+ <div v-if="open" ref="container" :class="[ui.container, ui.width]" :style="containerStyle" @mouseover="onMouseOver">
23
24
  <Transition appear v-bind="ui.transition">
24
25
  <div>
25
26
  <div v-if="popper.arrow" data-popper-arrow :class="Object.values(ui.arrow)" />
26
27
 
27
28
  <HPopoverPanel :class="[ui.base, ui.background, ui.ring, ui.rounded, ui.shadow]" static>
28
- <slot name="panel" :open="(open !== undefined) ? open : headlessOpen" :close="close" />
29
+ <slot name="panel" :open="open" :close="close" />
29
30
  </HPopoverPanel>
30
31
  </div>
31
32
  </Transition>
@@ -34,7 +35,7 @@
34
35
  </template>
35
36
 
36
37
  <script>
37
- import { computed, ref, toRef, onMounted, defineComponent } from "vue";
38
+ import { computed, ref, toRef, onMounted, defineComponent, watch } from "vue";
38
39
  import { defu } from "defu";
39
40
  import { Popover as HPopover, PopoverButton as HPopoverButton, PopoverPanel as HPopoverPanel } from "@headlessui/vue";
40
41
  import { useUI } from "../../composables/useUI";
@@ -90,7 +91,7 @@ export default defineComponent({
90
91
  }
91
92
  },
92
93
  emits: ["update:open"],
93
- setup(props) {
94
+ setup(props, { emit }) {
94
95
  const { ui, attrs } = useUI("popover", toRef(props, "ui"), config, toRef(props, "class"));
95
96
  const popper = computed(() => defu(props.mode === "hover" ? { offsetDistance: 0 } : {}, props.popper, ui.value.popper));
96
97
  const [trigger, container] = usePopper(popper.value);
@@ -105,16 +106,35 @@ export default defineComponent({
105
106
  }
106
107
  const popoverProvidesSymbols = Object.getOwnPropertySymbols(popoverProvides);
107
108
  popoverApi.value = popoverProvidesSymbols.length && popoverProvides[popoverProvidesSymbols[0]];
109
+ if (props.open) {
110
+ popoverApi.value?.togglePopover();
111
+ }
108
112
  });
109
113
  const containerStyle = computed(() => {
114
+ if (props.mode !== "hover") {
115
+ return {};
116
+ }
110
117
  const offsetDistance = props.popper?.offsetDistance || ui.value.popper?.offsetDistance || 8;
118
+ const placement = popper.value.placement?.split("-")[0];
111
119
  const padding = `${offsetDistance}px`;
112
- return props.mode === "hover" ? {
113
- paddingTop: padding,
114
- paddingBottom: padding,
115
- paddingLeft: padding,
116
- paddingRight: padding
117
- } : {};
120
+ if (placement === "top" || placement === "bottom") {
121
+ return {
122
+ paddingTop: padding,
123
+ paddingBottom: padding
124
+ };
125
+ } else if (placement === "left" || placement === "right") {
126
+ return {
127
+ paddingLeft: padding,
128
+ paddingRight: padding
129
+ };
130
+ } else {
131
+ return {
132
+ paddingTop: padding,
133
+ paddingBottom: padding,
134
+ paddingLeft: padding,
135
+ paddingRight: padding
136
+ };
137
+ }
118
138
  });
119
139
  function onMouseOver() {
120
140
  if (props.mode !== "hover" || !popoverApi.value) {
@@ -148,6 +168,22 @@ export default defineComponent({
148
168
  closeTimeout = null;
149
169
  }, props.closeDelay);
150
170
  }
171
+ watch(() => props.open, (newValue, oldValue) => {
172
+ if (!popoverApi.value)
173
+ return;
174
+ if (oldValue === void 0 || newValue === oldValue)
175
+ return;
176
+ if (newValue) {
177
+ popoverApi.value.popoverState = 0;
178
+ } else {
179
+ popoverApi.value.closePopover();
180
+ }
181
+ });
182
+ watch(() => popoverApi.value?.popoverState, (newValue, oldValue) => {
183
+ if (oldValue === void 0 || newValue === oldValue)
184
+ return;
185
+ emit("update:open", newValue === 0);
186
+ });
151
187
  return {
152
188
  // eslint-disable-next-line vue/no-dupe-keys
153
189
  ui,
@@ -43,20 +43,30 @@ declare const _default: import("vue").DefineComponent<{
43
43
  attrs: import("vue").ComputedRef<Pick<{
44
44
  [x: string]: unknown;
45
45
  }, string>>;
46
- popover: any;
46
+ popover: import("vue").Ref<any>;
47
47
  popper: import("vue").ComputedRef<PopperOptions>;
48
48
  trigger: import("vue").Ref<import("@vueuse/core").MaybeElement>;
49
49
  container: import("vue").Ref<import("@vueuse/core").MaybeElement>;
50
50
  containerStyle: import("vue").ComputedRef<{
51
+ paddingTop?: undefined;
52
+ paddingBottom?: undefined;
53
+ paddingLeft?: undefined;
54
+ paddingRight?: undefined;
55
+ } | {
51
56
  paddingTop: string;
52
57
  paddingBottom: string;
58
+ paddingLeft?: undefined;
59
+ paddingRight?: undefined;
60
+ } | {
53
61
  paddingLeft: string;
54
62
  paddingRight: string;
55
- } | {
56
63
  paddingTop?: undefined;
57
64
  paddingBottom?: undefined;
58
- paddingLeft?: undefined;
59
- paddingRight?: undefined;
65
+ } | {
66
+ paddingTop: string;
67
+ paddingBottom: string;
68
+ paddingLeft: string;
69
+ paddingRight: string;
60
70
  }>;
61
71
  onMouseOver: () => void;
62
72
  onMouseLeave: () => void;
@@ -80,11 +80,11 @@ declare const _default: import("vue").DefineComponent<{
80
80
  onClose?: ((...args: any[]) => any) | undefined;
81
81
  }, {
82
82
  ui: any;
83
+ transition: boolean;
83
84
  class: any;
84
85
  modelValue: boolean;
85
86
  appear: boolean;
86
87
  overlay: boolean;
87
- transition: boolean;
88
88
  preventClose: boolean;
89
89
  side: "right" | "left";
90
90
  }, {}>;
@@ -5,7 +5,9 @@ export const _useShortcuts = () => {
5
5
  const metaSymbol = ref(" ");
6
6
  const activeElement = useActiveElement();
7
7
  const usingInput = computed(() => {
8
- const usingInput2 = !!(activeElement.value?.tagName === "INPUT" || activeElement.value?.tagName === "TEXTAREA" || activeElement.value?.contentEditable === "true");
8
+ const tagName = activeElement.value?.tagName;
9
+ const contentEditable = activeElement.value?.contentEditable;
10
+ const usingInput2 = !!(tagName === "INPUT" || tagName === "TEXTAREA" || contentEditable === "true" || contentEditable === "plaintext-only");
9
11
  if (usingInput2) {
10
12
  return activeElement.value?.name || true;
11
13
  }
@@ -1,7 +1,12 @@
1
1
  import { alert } from '../ui.config'
2
2
  import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
3
+ import type { Button } from './button'
3
4
  import colors from '#ui-colors'
4
5
  import type { AppConfig } from 'nuxt/schema'
5
6
 
6
7
  export type AlertColor = keyof typeof alert.color | ExtractDeepKey<AppConfig, ['ui', 'alert', 'color']> | typeof colors[number]
7
8
  export type AlertVariant = keyof typeof alert.variant | ExtractDeepKey<AppConfig, ['ui', 'alert', 'variant']> | NestedKeyOf<typeof alert.color> | NestedKeyOf<ExtractDeepObject<AppConfig, ['ui', 'alert', 'color']>>
9
+
10
+ export interface AlertAction extends Button {
11
+ click?: Function
12
+ }
@@ -2,6 +2,7 @@ import type { Link } from './link'
2
2
 
3
3
  export interface BreadcrumbLink extends Link {
4
4
  label: string
5
+ labelClass?: string
5
6
  icon?: string
6
7
  iconClass?: string
7
8
  // FIXME: This is a workaround for `link.to` not being resolved although it extends `NuxtLinkProps`
@@ -3,11 +3,13 @@ import type { Avatar } from './avatar'
3
3
 
4
4
  export interface DropdownItem extends NuxtLinkProps {
5
5
  label: string
6
+ labelClass?: string
6
7
  slot?: string
7
8
  icon?: string
8
9
  iconClass?: string
9
10
  avatar?: Avatar
10
11
  shortcuts?: string[]
11
12
  disabled?: boolean
13
+ class?: string
12
14
  click?: Function
13
15
  }
@@ -15,6 +15,7 @@ export interface Form<T> {
15
15
  errors: Ref<FormError[]>
16
16
  setErrors(errs: FormError[], path?: string): void
17
17
  getErrors(path?: string): FormError[]
18
+ submit(): Promise<void>
18
19
  }
19
20
 
20
21
  export type FormSubmitEvent<T> = SubmitEvent & { data: T }
@@ -3,6 +3,7 @@ import type { Avatar } from './avatar'
3
3
 
4
4
  export interface VerticalNavigationLink extends Link {
5
5
  label: string
6
+ labelClass?: string
6
7
  icon?: string
7
8
  iconClass?: string
8
9
  avatar?: Avatar
@@ -76,24 +76,24 @@ export default {
76
76
  wrapper: "absolute inset-y-0 start-0 flex items-center",
77
77
  pointer: "pointer-events-none",
78
78
  padding: {
79
- "2xs": "ps-2",
80
- xs: "ps-2.5",
81
- sm: "ps-2.5",
82
- md: "ps-3",
83
- lg: "ps-3.5",
84
- xl: "ps-3.5"
79
+ "2xs": "px-2",
80
+ xs: "px-2.5",
81
+ sm: "px-2.5",
82
+ md: "px-3",
83
+ lg: "px-3.5",
84
+ xl: "px-3.5"
85
85
  }
86
86
  },
87
87
  trailing: {
88
88
  wrapper: "absolute inset-y-0 end-0 flex items-center",
89
89
  pointer: "pointer-events-none",
90
90
  padding: {
91
- "2xs": "pe-2",
92
- xs: "pe-2.5",
93
- sm: "pe-2.5",
94
- md: "pe-3",
95
- lg: "pe-3.5",
96
- xl: "pe-3.5"
91
+ "2xs": "px-2",
92
+ xs: "px-2.5",
93
+ sm: "px-2.5",
94
+ md: "px-3",
95
+ lg: "px-3.5",
96
+ xl: "px-3.5"
97
97
  }
98
98
  }
99
99
  },
@@ -0,0 +1,64 @@
1
+ declare const _default: {
2
+ container: string;
3
+ trigger: string;
4
+ width: string;
5
+ height: string;
6
+ base: string;
7
+ background: string;
8
+ shadow: string;
9
+ rounded: string;
10
+ padding: string;
11
+ ring: string;
12
+ empty: string;
13
+ option: {
14
+ base: string;
15
+ rounded: string;
16
+ padding: string;
17
+ size: string;
18
+ color: string;
19
+ container: string;
20
+ active: string;
21
+ inactive: string;
22
+ selected: string;
23
+ disabled: string;
24
+ empty: string;
25
+ icon: {
26
+ base: string;
27
+ active: string;
28
+ inactive: string;
29
+ };
30
+ selectedIcon: {
31
+ wrapper: string;
32
+ padding: string;
33
+ base: string;
34
+ };
35
+ avatar: {
36
+ base: string;
37
+ size: "3xs";
38
+ };
39
+ chip: {
40
+ base: string;
41
+ };
42
+ };
43
+ transition: {
44
+ leaveActiveClass: string;
45
+ leaveFromClass: string;
46
+ leaveToClass: string;
47
+ };
48
+ popper: {
49
+ placement: string;
50
+ };
51
+ default: {
52
+ selectedIcon: string;
53
+ trailingIcon: string;
54
+ };
55
+ arrow: {
56
+ ring: string;
57
+ background: string;
58
+ base: string;
59
+ rounded: string;
60
+ shadow: string;
61
+ placement: string;
62
+ };
63
+ };
64
+ export default _default;