@nuxt/ui 3.0.0-alpha.0 → 3.0.0-alpha.2

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 (173) hide show
  1. package/README.md +1 -1
  2. package/cli/node_modules/.ignored/citty/LICENSE +36 -0
  3. package/cli/node_modules/.ignored/citty/README.md +134 -0
  4. package/cli/node_modules/.ignored/citty/dist/index.cjs +475 -0
  5. package/cli/node_modules/.ignored/citty/dist/index.d.cts +80 -0
  6. package/cli/node_modules/.ignored/citty/dist/index.d.mts +80 -0
  7. package/cli/node_modules/.ignored/citty/dist/index.d.ts +80 -0
  8. package/cli/node_modules/.ignored/citty/dist/index.mjs +463 -0
  9. package/cli/node_modules/.ignored/citty/package.json +49 -0
  10. package/cli/node_modules/.ignored/consola/LICENSE +47 -0
  11. package/cli/node_modules/.ignored/consola/README.md +318 -0
  12. package/cli/node_modules/.ignored/consola/core.d.ts +1 -0
  13. package/cli/node_modules/.ignored/consola/dist/basic.cjs +32 -0
  14. package/cli/node_modules/.ignored/consola/dist/basic.d.ts +9 -0
  15. package/cli/node_modules/.ignored/consola/dist/basic.mjs +24 -0
  16. package/cli/node_modules/.ignored/consola/dist/browser.cjs +80 -0
  17. package/cli/node_modules/.ignored/consola/dist/browser.d.ts +7 -0
  18. package/cli/node_modules/.ignored/consola/dist/browser.mjs +72 -0
  19. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.cjs +436 -0
  20. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.mjs +429 -0
  21. package/cli/node_modules/.ignored/consola/dist/core.cjs +415 -0
  22. package/cli/node_modules/.ignored/consola/dist/core.d.ts +124 -0
  23. package/cli/node_modules/.ignored/consola/dist/core.mjs +410 -0
  24. package/cli/node_modules/.ignored/consola/dist/index.cjs +21 -0
  25. package/cli/node_modules/.ignored/consola/dist/index.d.ts +9 -0
  26. package/cli/node_modules/.ignored/consola/dist/index.mjs +8 -0
  27. package/cli/node_modules/.ignored/consola/dist/shared/consola.06ad8a64.mjs +62 -0
  28. package/cli/node_modules/.ignored/consola/dist/shared/consola.36c0034f.mjs +636 -0
  29. package/cli/node_modules/.ignored/consola/dist/shared/consola.4bbae468.cjs +645 -0
  30. package/cli/node_modules/.ignored/consola/dist/shared/consola.deac7d5a.cjs +65 -0
  31. package/cli/node_modules/.ignored/consola/dist/utils.cjs +308 -0
  32. package/cli/node_modules/.ignored/consola/dist/utils.d.ts +169 -0
  33. package/cli/node_modules/.ignored/consola/dist/utils.mjs +284 -0
  34. package/cli/node_modules/.ignored/consola/lib/index.cjs +9 -0
  35. package/cli/node_modules/.ignored/consola/package.json +101 -0
  36. package/cli/node_modules/.ignored/consola/utils.d.ts +1 -0
  37. package/cli/node_modules/.ignored/pathe/LICENSE +44 -0
  38. package/cli/node_modules/.ignored/pathe/README.md +69 -0
  39. package/cli/node_modules/.ignored/pathe/dist/index.cjs +23 -0
  40. package/cli/node_modules/.ignored/pathe/dist/index.d.cts +36 -0
  41. package/cli/node_modules/.ignored/pathe/dist/index.d.mts +36 -0
  42. package/cli/node_modules/.ignored/pathe/dist/index.d.ts +36 -0
  43. package/cli/node_modules/.ignored/pathe/dist/index.mjs +1 -0
  44. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.1f0a373c.cjs +238 -0
  45. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.ff20891b.mjs +221 -0
  46. package/cli/node_modules/.ignored/pathe/dist/utils.cjs +58 -0
  47. package/cli/node_modules/.ignored/pathe/dist/utils.d.cts +5 -0
  48. package/cli/node_modules/.ignored/pathe/dist/utils.d.mts +5 -0
  49. package/cli/node_modules/.ignored/pathe/dist/utils.d.ts +5 -0
  50. package/cli/node_modules/.ignored/pathe/dist/utils.mjs +54 -0
  51. package/cli/node_modules/.ignored/pathe/package.json +48 -0
  52. package/cli/node_modules/.ignored/pathe/utils.d.ts +1 -0
  53. package/cli/node_modules/.ignored/scule/LICENSE +21 -0
  54. package/cli/node_modules/.ignored/scule/README.md +149 -0
  55. package/cli/node_modules/.ignored/scule/dist/index.cjs +92 -0
  56. package/cli/node_modules/.ignored/scule/dist/index.d.cts +57 -0
  57. package/cli/node_modules/.ignored/scule/dist/index.d.mts +57 -0
  58. package/cli/node_modules/.ignored/scule/dist/index.d.ts +57 -0
  59. package/cli/node_modules/.ignored/scule/dist/index.mjs +80 -0
  60. package/cli/node_modules/.ignored/scule/package.json +43 -0
  61. package/cli/node_modules/.package-lock.json +33 -0
  62. package/dist/module.d.mts +9 -2
  63. package/dist/module.d.ts +9 -2
  64. package/dist/module.json +3 -3
  65. package/dist/module.mjs +62 -103
  66. package/dist/runtime/components/Accordion.vue +49 -6
  67. package/dist/runtime/components/Alert.vue +58 -6
  68. package/dist/runtime/components/App.vue +12 -2
  69. package/dist/runtime/components/Avatar.vue +27 -6
  70. package/dist/runtime/components/AvatarGroup.vue +30 -6
  71. package/dist/runtime/components/Badge.vue +28 -6
  72. package/dist/runtime/components/Breadcrumb.vue +44 -6
  73. package/dist/runtime/components/Button.vue +68 -10
  74. package/dist/runtime/components/ButtonGroup.vue +30 -6
  75. package/dist/runtime/components/Card.vue +25 -6
  76. package/dist/runtime/components/Checkbox.vue +45 -6
  77. package/dist/runtime/components/Chip.vue +39 -6
  78. package/dist/runtime/components/Collapsible.vue +27 -6
  79. package/dist/runtime/components/CommandPalette.vue +100 -7
  80. package/dist/runtime/components/Container.vue +22 -6
  81. package/dist/runtime/components/ContextMenu.vue +58 -6
  82. package/dist/runtime/components/ContextMenuContent.vue +18 -4
  83. package/dist/runtime/components/Drawer.vue +48 -6
  84. package/dist/runtime/components/DropdownMenu.vue +66 -6
  85. package/dist/runtime/components/DropdownMenuContent.vue +22 -4
  86. package/dist/runtime/components/Form.vue +58 -26
  87. package/dist/runtime/components/FormField.vue +41 -16
  88. package/dist/runtime/components/Icon.vue +12 -2
  89. package/dist/runtime/components/Input.vue +46 -6
  90. package/dist/runtime/components/InputMenu.vue +113 -6
  91. package/dist/runtime/components/Kbd.vue +28 -6
  92. package/dist/runtime/components/Link.vue +81 -17
  93. package/dist/runtime/components/LinkBase.vue +18 -7
  94. package/dist/runtime/components/Modal.vue +69 -6
  95. package/dist/runtime/components/NavigationMenu.vue +76 -6
  96. package/dist/runtime/components/Pagination.vue +99 -6
  97. package/dist/runtime/components/Popover.vue +42 -6
  98. package/dist/runtime/components/Progress.vue +44 -6
  99. package/dist/runtime/components/RadioGroup.vue +55 -7
  100. package/dist/runtime/components/Select.vue +89 -7
  101. package/dist/runtime/components/SelectMenu.vue +105 -7
  102. package/dist/runtime/components/Separator.vue +41 -6
  103. package/dist/runtime/components/Skeleton.vue +18 -6
  104. package/dist/runtime/components/Slideover.vue +67 -6
  105. package/dist/runtime/components/Slider.vue +36 -6
  106. package/dist/runtime/components/Switch.vue +50 -6
  107. package/dist/runtime/components/Tabs.vue +59 -6
  108. package/dist/runtime/components/Textarea.vue +46 -6
  109. package/dist/runtime/components/Toast.vue +55 -6
  110. package/dist/runtime/components/Toaster.vue +28 -7
  111. package/dist/runtime/components/Tooltip.vue +42 -6
  112. package/dist/runtime/composables/useAvatarGroup.d.ts +2 -2
  113. package/dist/runtime/composables/useButtonGroup.d.ts +3 -3
  114. package/dist/runtime/composables/useFormField.d.ts +7 -3
  115. package/dist/runtime/composables/useFormField.js +12 -7
  116. package/dist/runtime/composables/useModal.d.ts +1 -1
  117. package/dist/runtime/composables/useSlideover.d.ts +1 -1
  118. package/dist/runtime/composables/useToast.d.ts +2 -2
  119. package/dist/runtime/index.css +1 -0
  120. package/dist/runtime/plugins/colors.d.ts +2 -0
  121. package/dist/runtime/plugins/modal.d.ts +2 -0
  122. package/dist/runtime/plugins/slideover.d.ts +2 -0
  123. package/dist/runtime/types/form.d.ts +1 -2
  124. package/dist/runtime/utils/index.d.ts +1 -1
  125. package/dist/runtime/utils/link.d.ts +23 -55
  126. package/package.json +26 -25
  127. package/dist/runtime/assets/css/animations.css +0 -1
  128. package/dist/runtime/components/Accordion.vue.d.ts +0 -492
  129. package/dist/runtime/components/Alert.vue.d.ts +0 -548
  130. package/dist/runtime/components/App.vue.d.ts +0 -25
  131. package/dist/runtime/components/Avatar.vue.d.ts +0 -384
  132. package/dist/runtime/components/AvatarGroup.vue.d.ts +0 -381
  133. package/dist/runtime/components/Badge.vue.d.ts +0 -422
  134. package/dist/runtime/components/Breadcrumb.vue.d.ts +0 -307
  135. package/dist/runtime/components/Button.vue.d.ts +0 -949
  136. package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -182
  137. package/dist/runtime/components/Card.vue.d.ts +0 -191
  138. package/dist/runtime/components/Checkbox.vue.d.ts +0 -819
  139. package/dist/runtime/components/Chip.vue.d.ts +0 -590
  140. package/dist/runtime/components/Collapsible.vue.d.ts +0 -159
  141. package/dist/runtime/components/CommandPalette.vue.d.ts +0 -684
  142. package/dist/runtime/components/Container.vue.d.ts +0 -27
  143. package/dist/runtime/components/ContextMenu.vue.d.ts +0 -796
  144. package/dist/runtime/components/ContextMenuContent.vue.d.ts +0 -0
  145. package/dist/runtime/components/Drawer.vue.d.ts +0 -343
  146. package/dist/runtime/components/DropdownMenu.vue.d.ts +0 -815
  147. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +0 -0
  148. package/dist/runtime/components/Form.vue.d.ts +0 -39
  149. package/dist/runtime/components/FormField.vue.d.ts +0 -356
  150. package/dist/runtime/components/Icon.vue.d.ts +0 -17
  151. package/dist/runtime/components/Input.vue.d.ts +0 -1137
  152. package/dist/runtime/components/InputMenu.vue.d.ts +0 -2121
  153. package/dist/runtime/components/Kbd.vue.d.ts +0 -169
  154. package/dist/runtime/components/Link.vue.d.ts +0 -76
  155. package/dist/runtime/components/LinkBase.vue.d.ts +0 -49
  156. package/dist/runtime/components/Modal.vue.d.ts +0 -319
  157. package/dist/runtime/components/NavigationMenu.vue.d.ts +0 -1789
  158. package/dist/runtime/components/Pagination.vue.d.ts +0 -295
  159. package/dist/runtime/components/Popover.vue.d.ts +0 -197
  160. package/dist/runtime/components/Progress.vue.d.ts +0 -1781
  161. package/dist/runtime/components/RadioGroup.vue.d.ts +0 -1715
  162. package/dist/runtime/components/Select.vue.d.ts +0 -1569
  163. package/dist/runtime/components/SelectMenu.vue.d.ts +0 -1661
  164. package/dist/runtime/components/Separator.vue.d.ts +0 -0
  165. package/dist/runtime/components/Skeleton.vue.d.ts +0 -26
  166. package/dist/runtime/components/Slideover.vue.d.ts +0 -375
  167. package/dist/runtime/components/Slider.vue.d.ts +0 -0
  168. package/dist/runtime/components/Switch.vue.d.ts +0 -1676
  169. package/dist/runtime/components/Tabs.vue.d.ts +0 -934
  170. package/dist/runtime/components/Textarea.vue.d.ts +0 -1133
  171. package/dist/runtime/components/Toast.vue.d.ts +0 -0
  172. package/dist/runtime/components/Toaster.vue.d.ts +0 -362
  173. package/dist/runtime/components/Tooltip.vue.d.ts +0 -248
@@ -1,9 +1,46 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/link";
5
- const appConfig = _appConfig;
6
- const link = tv({ extend: tv(theme), ...appConfig.ui?.link || {} });
1
+ <script lang="ts">
2
+ import type { ButtonHTMLAttributes } from 'vue'
3
+ import { tv } from 'tailwind-variants'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/link'
7
+ import type { NuxtLinkProps } from '#app'
8
+
9
+ const appConfig = _appConfig as AppConfig & { ui: { link: Partial<typeof theme> } }
10
+
11
+ const link = tv({ extend: tv(theme), ...(appConfig.ui?.link || {}) })
12
+
13
+ export interface LinkProps extends NuxtLinkProps {
14
+ /**
15
+ * The element or component this component should render as when not a link.
16
+ * @defaultValue 'button'
17
+ */
18
+ as?: any
19
+ /**
20
+ * The type of the button when not a link.
21
+ * @defaultValue 'button'
22
+ */
23
+ type?: ButtonHTMLAttributes['type']
24
+ disabled?: boolean
25
+ /** Force the link to be active independent of the current route. */
26
+ active?: boolean
27
+ /** Will only be active if the current route is an exact match. */
28
+ exact?: boolean
29
+ /** Will only be active if the current route query is an exact match. */
30
+ exactQuery?: boolean
31
+ /** Will only be active if the current route hash is an exact match. */
32
+ exactHash?: boolean
33
+ /** The class to apply when the link is inactive. */
34
+ inactiveClass?: string
35
+ custom?: boolean
36
+ /** When `true`, only styles from `class`, `activeClass`, and `inactiveClass` will be applied. */
37
+ raw?: boolean
38
+ class?: any
39
+ }
40
+
41
+ export interface LinkSlots {
42
+ default(props: { active: boolean }): any
43
+ }
7
44
  </script>
8
45
 
9
46
  <script setup lang="ts">
@@ -37,31 +74,31 @@ const ui = computed(() => tv({
37
74
  }
38
75
  }))
39
76
 
40
- function isLinkActive(slotProps: any) {
77
+ function isLinkActive({ route: linkRoute, isActive, isExactActive }: any) {
41
78
  if (props.active !== undefined) {
42
79
  return props.active
43
80
  }
44
81
 
45
- if (props.exactQuery && !isEqual(slotProps.route.query, route.query)) {
82
+ if (props.exactQuery && !isEqual(linkRoute.query, route.query)) {
46
83
  return false
47
84
  }
48
- if (props.exactHash && slotProps.route.hash !== route.hash) {
85
+ if (props.exactHash && linkRoute.hash !== route.hash) {
49
86
  return false
50
87
  }
51
88
 
52
- if (props.exact && slotProps.isExactActive) {
89
+ if (props.exact && isExactActive) {
53
90
  return true
54
91
  }
55
92
 
56
- if (!props.exact && slotProps.isActive) {
93
+ if (!props.exact && isActive) {
57
94
  return true
58
95
  }
59
96
 
60
97
  return false
61
98
  }
62
99
 
63
- function resolveLinkClass(slotProps: any) {
64
- const active = isLinkActive(slotProps)
100
+ function resolveLinkClass({ route, isActive, isExactActive }: any) {
101
+ const active = isLinkActive({ route, isActive, isExactActive })
65
102
 
66
103
  if (props.raw) {
67
104
  return [props.class, active ? props.activeClass : props.inactiveClass]
@@ -72,12 +109,39 @@ function resolveLinkClass(slotProps: any) {
72
109
  </script>
73
110
 
74
111
  <template>
75
- <NuxtLink v-slot="slotProps" v-bind="nuxtLinkProps" custom>
112
+ <NuxtLink v-slot="{ href, navigate, route: linkRoute, rel, target, isExternal, isActive, isExactActive }" v-bind="nuxtLinkProps" custom>
76
113
  <template v-if="custom">
77
- <slot v-bind="{ ...$attrs, ...slotProps, as, type, disabled, active: isLinkActive(slotProps) }" />
114
+ <slot
115
+ v-bind="{
116
+ ...$attrs,
117
+ as,
118
+ type,
119
+ disabled,
120
+ href,
121
+ navigate,
122
+ rel,
123
+ target,
124
+ isExternal,
125
+ active: isLinkActive({ route: linkRoute, isActive, isExactActive })
126
+ }"
127
+ />
78
128
  </template>
79
- <ULinkBase v-else v-bind="{ ...$attrs, ...slotProps, as, type, disabled }" :class="resolveLinkClass(slotProps)">
80
- <slot v-bind="{ ...slotProps, as, type, disabled, active: isLinkActive(slotProps) }" />
129
+ <ULinkBase
130
+ v-else
131
+ v-bind="{
132
+ ...$attrs,
133
+ as,
134
+ type,
135
+ disabled,
136
+ href,
137
+ navigate,
138
+ rel,
139
+ target,
140
+ isExternal
141
+ }"
142
+ :class="resolveLinkClass({ route: linkRoute, isActive, isExactActive })"
143
+ >
144
+ <slot :active="isLinkActive({ route: linkRoute, isActive, isExactActive })" />
81
145
  </ULinkBase>
82
146
  </NuxtLink>
83
147
  </template>
@@ -1,5 +1,15 @@
1
- <script>
2
-
1
+ <script lang="ts">
2
+ export interface LinkBaseProps {
3
+ as?: string
4
+ type?: string
5
+ disabled?: boolean
6
+ onClick?: (e: MouseEvent) => void | Promise<void>
7
+ href?: string
8
+ navigate?: (e: MouseEvent) => void
9
+ rel?: string
10
+ target?: string
11
+ isExternal?: boolean
12
+ }
3
13
  </script>
4
14
 
5
15
  <script setup lang="ts">
@@ -10,15 +20,15 @@ const props = withDefaults(defineProps<LinkBaseProps>(), {
10
20
  type: 'button'
11
21
  })
12
22
 
13
- function onClick(e: MouseEvent) {
23
+ function onClickWrapper(e: MouseEvent) {
14
24
  if (props.disabled) {
15
25
  e.stopPropagation()
16
26
  e.preventDefault()
17
27
  return
18
28
  }
19
29
 
20
- if (props.click) {
21
- props.click(e)
30
+ if (props.onClick) {
31
+ props.onClick(e)
22
32
  }
23
33
 
24
34
  if (props.href && props.navigate && !props.isExternal) {
@@ -33,7 +43,8 @@ function onClick(e: MouseEvent) {
33
43
  'as': 'a',
34
44
  'href': disabled ? undefined : href,
35
45
  'aria-disabled': disabled ? 'true' : undefined,
36
- 'role': disabled ? 'link' : undefined
46
+ 'role': disabled ? 'link' : undefined,
47
+ 'tabindex': disabled ? -1 : undefined
37
48
  } : as === 'button' ? {
38
49
  as,
39
50
  type,
@@ -43,7 +54,7 @@ function onClick(e: MouseEvent) {
43
54
  }"
44
55
  :rel="rel"
45
56
  :target="target"
46
- @click="onClick"
57
+ @click="onClickWrapper"
47
58
  >
48
59
  <slot />
49
60
  </Primitive>
@@ -1,9 +1,72 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/modal";
5
- const appConfig = _appConfig;
6
- const modal = tv({ extend: tv(theme), ...appConfig.ui?.modal || {} });
1
+ <script lang="ts">
2
+ import { tv } from 'tailwind-variants'
3
+ import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/modal'
7
+ import type { ButtonProps } from '../types'
8
+
9
+ const appConfig = _appConfig as AppConfig & { ui: { modal: Partial<typeof theme> } }
10
+
11
+ const modal = tv({ extend: tv(theme), ...(appConfig.ui?.modal || {}) })
12
+
13
+ export interface ModalProps extends DialogRootProps {
14
+ title?: string
15
+ description?: string
16
+ /** The content of the modal. */
17
+ content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
18
+ /**
19
+ * Render an overlay behind the modal.
20
+ * @defaultValue true
21
+ */
22
+ overlay?: boolean
23
+ /**
24
+ * Animate the modal when opening or closing.
25
+ * @defaultValue true
26
+ */
27
+ transition?: boolean
28
+ /**
29
+ * When `true`, the modal will take up the full screen.
30
+ * @defaultValue false
31
+ */
32
+ fullscreen?: boolean
33
+ /**
34
+ * Render the modal in a portal.
35
+ * @defaultValue true
36
+ */
37
+ portal?: boolean
38
+ /**
39
+ * Display a close button to dismiss the modal.
40
+ * `{ size: 'md', color: 'gray', variant: 'ghost' }`{lang="ts-type"}
41
+ * @defaultValue true
42
+ */
43
+ close?: ButtonProps | boolean
44
+ /**
45
+ * The icon displayed in the close button.
46
+ * @defaultValue appConfig.ui.icons.close
47
+ */
48
+ closeIcon?: string
49
+ /**
50
+ * When `true`, the modal will not close when clicking outside.
51
+ * @defaultValue false
52
+ */
53
+ preventClose?: boolean
54
+ class?: any
55
+ ui?: Partial<typeof modal.slots>
56
+ }
57
+
58
+ export interface ModalEmits extends DialogRootEmits {}
59
+
60
+ export interface ModalSlots {
61
+ default(props: { open: boolean }): any
62
+ content(props?: {}): any
63
+ header(props?: {}): any
64
+ title(props?: {}): any
65
+ description(props?: {}): any
66
+ close(props: { ui: any }): any
67
+ body(props?: {}): any
68
+ footer(props?: {}): any
69
+ }
7
70
  </script>
8
71
 
9
72
  <script setup lang="ts">
@@ -1,9 +1,79 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/navigation-menu";
5
- const appConfig = _appConfig;
6
- const navigationMenu = tv({ extend: tv(theme), ...appConfig.ui?.navigationMenu || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuItemProps, NavigationMenuContentProps } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/navigation-menu'
7
+ import type { AvatarProps, BadgeProps, LinkProps } from '../types'
8
+ import type { DynamicSlots } from '../types/utils'
9
+
10
+ const appConfig = _appConfig as AppConfig & { ui: { navigationMenu: Partial<typeof theme> } }
11
+
12
+ const navigationMenu = tv({ extend: tv(theme), ...(appConfig.ui?.navigationMenu || {}) })
13
+
14
+ export interface NavigationMenuChildItem extends Omit<LinkProps, 'raw' | 'custom'> {
15
+ label: string
16
+ description?: string
17
+ icon?: string
18
+ select?(e: Event): void
19
+ }
20
+
21
+ export interface NavigationMenuItem extends Omit<LinkProps, 'raw' | 'custom'>, Pick<NavigationMenuItemProps, 'value'> {
22
+ label?: string
23
+ icon?: string
24
+ avatar?: AvatarProps
25
+ badge?: string | number | BadgeProps
26
+ trailingIcon?: string
27
+ slot?: string
28
+ children?: NavigationMenuChildItem[]
29
+ select?(e: Event): void
30
+ }
31
+
32
+ type NavigationMenuVariants = VariantProps<typeof navigationMenu>
33
+
34
+ export interface NavigationMenuProps<T> extends Pick<NavigationMenuRootProps, 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'modelValue' | 'skipDelayDuration'> {
35
+ /**
36
+ * The element or component this component should render as.
37
+ * @defaultValue `div`
38
+ */
39
+ as?: any
40
+ /**
41
+ * The icon displayed to open the menu.
42
+ * @defaultValue appConfig.ui.icons.chevronDown
43
+ */
44
+ trailingIcon?: string
45
+ items?: T[] | T[][]
46
+ color?: NavigationMenuVariants['color']
47
+ variant?: NavigationMenuVariants['variant']
48
+ /**
49
+ * The orientation of the menu.
50
+ * @defaultValue 'horizontal'
51
+ */
52
+ orientation?: NavigationMenuRootProps['orientation']
53
+ /** Display a line next to the active item. */
54
+ highlight?: boolean
55
+ highlightColor?: NavigationMenuVariants['highlightColor']
56
+ /** The content of the menu. */
57
+ content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'>
58
+ /**
59
+ * Display an arrow alongside the menu.
60
+ * @defaultValue false
61
+ */
62
+ arrow?: boolean
63
+ class?: any
64
+ ui?: Partial<typeof navigationMenu.slots>
65
+ }
66
+
67
+ export interface NavigationMenuEmits extends NavigationMenuRootEmits {}
68
+
69
+ type SlotProps<T> = (props: { item: T, index: number, active?: boolean }) => any
70
+
71
+ export type NavigationMenuSlots<T extends { slot?: string }> = {
72
+ 'item': SlotProps<T>
73
+ 'item-leading': SlotProps<T>
74
+ 'item-label': SlotProps<T>
75
+ 'item-trailing': SlotProps<T>
76
+ } & DynamicSlots<T, SlotProps<T>>
7
77
  </script>
8
78
 
9
79
  <script setup lang="ts" generic="T extends NavigationMenuItem">
@@ -1,9 +1,102 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/pagination";
5
- const appConfig = _appConfig;
6
- const pagination = tv({ extend: tv(theme), ...appConfig.ui?.pagination || {} });
1
+ <script lang="ts">
2
+ import { tv } from 'tailwind-variants'
3
+ import type { PaginationRootProps, PaginationRootEmits } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import type { RouteLocationRaw } from '#vue-router'
6
+ import _appConfig from '#build/app.config'
7
+ import theme from '#build/ui/pagination'
8
+ import type { ButtonProps } from '../types'
9
+
10
+ const appConfig = _appConfig as AppConfig & { ui: { pagination: Partial<typeof theme> } }
11
+
12
+ const pagination = tv({ extend: tv(theme), ...(appConfig.ui?.pagination || {}) })
13
+
14
+ export interface PaginationProps extends Pick<PaginationRootProps, 'defaultPage' | 'disabled' | 'itemsPerPage' | 'page' | 'showEdges' | 'siblingCount' | 'total'> {
15
+ /**
16
+ * The element or component this component should render as.
17
+ * @defaultValue `div`
18
+ */
19
+ as?: any
20
+ /**
21
+ * The icon to use for the first page control.
22
+ * @defaultValue appConfig.ui.icons.chevronDoubleLeft
23
+ */
24
+ firstIcon?: string
25
+ /**
26
+ * The icon to use for the previous page control.
27
+ * @defaultValue appConfig.ui.icons.chevronLeft
28
+ */
29
+ prevIcon?: string
30
+ /**
31
+ * The icon to use for the next page control.
32
+ * @defaultValue appConfig.ui.icons.chevronRight
33
+ */
34
+ nextIcon?: string
35
+ /**
36
+ * The icon to use for the last page control.
37
+ * @defaultValue appConfig.ui.icons.chevronDoubleRight
38
+ */
39
+ lastIcon?: string
40
+ /**
41
+ * The icon to use for the ellipsis control.
42
+ * @defaultValue appConfig.ui.icons.ellipsis
43
+ */
44
+ ellipsisIcon?: string
45
+ /**
46
+ * The color of the pagination controls.
47
+ * @defaultValue 'white'
48
+ */
49
+ color?: ButtonProps['color']
50
+ /**
51
+ * The variant of the pagination controls.
52
+ * @defaultValue 'solid'
53
+ */
54
+ variant?: ButtonProps['variant']
55
+ /**
56
+ * The color of the active pagination control.
57
+ * @defaultValue 'black'
58
+ */
59
+ activeColor?: ButtonProps['color']
60
+ /**
61
+ * The variant of the active pagination control.
62
+ * @defaultValue 'solid'
63
+ */
64
+ activeVariant?: ButtonProps['variant']
65
+ /**
66
+ * Whether to show the first, previous, next, and last controls.
67
+ * @defaultValue true
68
+ */
69
+ showControls?: boolean
70
+ size?: ButtonProps['size']
71
+ /**
72
+ * A function to render page controls as links.
73
+ * @param page The page number to navigate to.
74
+ */
75
+ to?: (page: number) => RouteLocationRaw
76
+ class?: any
77
+ ui?: Partial<typeof pagination.slots>
78
+ }
79
+
80
+ export interface PaginationEmits extends PaginationRootEmits {}
81
+
82
+ export interface PaginationSlots {
83
+ first(props?: {}): any
84
+ prev(props?: {}): any
85
+ next(props?: {}): any
86
+ last(props?: {}): any
87
+ ellipsis(props?: {}): any
88
+ item(props: {
89
+ page: number
90
+ pageCount: number
91
+ item: {
92
+ type: 'ellipsis'
93
+ } | {
94
+ type: 'page'
95
+ value: number
96
+ }
97
+ index: number
98
+ }): any
99
+ }
7
100
  </script>
8
101
 
9
102
  <script setup lang="ts">
@@ -1,9 +1,45 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/popover";
5
- const appConfig = _appConfig;
6
- const popover = tv({ extend: tv(theme), ...appConfig.ui?.popover || {} });
1
+ <script lang="ts">
2
+ import { tv } from 'tailwind-variants'
3
+ import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverArrowProps } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/popover'
7
+
8
+ const appConfig = _appConfig as AppConfig & { ui: { popover: Partial<typeof theme> } }
9
+
10
+ const popover = tv({ extend: tv(theme), ...(appConfig.ui?.popover || {}) })
11
+
12
+ export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps, 'openDelay' | 'closeDelay'> {
13
+ /**
14
+ * The display mode of the popover.
15
+ * @defaultValue 'click'
16
+ */
17
+ mode?: 'click' | 'hover'
18
+ /**
19
+ * The content of the popover.
20
+ * @defaultValue { side: 'bottom', sideOffset: 8 }
21
+ */
22
+ content?: Omit<PopoverContentProps, 'as' | 'asChild' | 'forceMount'>
23
+ /**
24
+ * Display an arrow alongside the popover.
25
+ * @defaultValue false
26
+ */
27
+ arrow?: boolean | Omit<PopoverArrowProps, 'as' | 'asChild'>
28
+ /**
29
+ * Render the popover in a portal.
30
+ * @defaultValue true
31
+ */
32
+ portal?: boolean
33
+ class?: any
34
+ ui?: Partial<typeof popover.slots>
35
+ }
36
+
37
+ export interface PopoverEmits extends PopoverRootEmits {}
38
+
39
+ export interface PopoverSlots {
40
+ default(props: { open: boolean }): any
41
+ content(props?: {}): any
42
+ }
7
43
  </script>
8
44
 
9
45
  <script setup lang="ts">
@@ -1,9 +1,47 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/progress";
5
- const appConfig = _appConfig;
6
- const progress = tv({ extend: tv(theme), ...appConfig.ui?.progress || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { ProgressRootProps, ProgressRootEmits } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/progress'
7
+
8
+ const appConfig = _appConfig as AppConfig & { ui: { progress: Partial<typeof theme> } }
9
+
10
+ const progress = tv({ extend: tv(theme), ...(appConfig.ui?.progress || {}) })
11
+
12
+ type ProgressVariants = VariantProps<typeof progress>
13
+
14
+ export interface ProgressProps extends Pick<ProgressRootProps, 'getValueLabel' | 'modelValue'> {
15
+ /**
16
+ * The element or component this component should render as.
17
+ * @defaultValue `div`
18
+ */
19
+ as?: any
20
+ /** The maximum progress value. */
21
+ max?: number | Array<any>
22
+ /** Display the current progress value. */
23
+ status?: boolean
24
+ /** Whether the progress is visually inverted. */
25
+ inverted?: boolean
26
+ size?: ProgressVariants['size']
27
+ color?: ProgressVariants['color']
28
+ /**
29
+ * The orientation of the progress bar.
30
+ * @defaultValue 'horizontal'
31
+ */
32
+ orientation?: ProgressVariants['orientation']
33
+ animation?: ProgressVariants['animation']
34
+ class?: any
35
+ ui?: Partial<typeof progress.slots>
36
+ }
37
+
38
+ export interface ProgressEmits extends ProgressRootEmits {}
39
+
40
+ export type ProgressSlots = {
41
+ status(props: { percent?: number }): any
42
+ } & {
43
+ [key: string]: (props: { step: number }) => any
44
+ }
7
45
  </script>
8
46
 
9
47
  <script setup lang="ts">
@@ -1,9 +1,57 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/radio-group";
5
- const appConfig = _appConfig;
6
- const radioGroup = tv({ extend: tv(theme), ...appConfig.ui?.radioGroup || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { RadioGroupRootProps, RadioGroupRootEmits, RadioGroupItemProps } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/radio-group'
7
+ import type { AcceptableValue } from '../types/utils'
8
+
9
+ const appConfig = _appConfig as AppConfig & { ui: { radioGroup: Partial<typeof theme> } }
10
+
11
+ const radioGroup = tv({ extend: tv(theme), ...(appConfig.ui?.radioGroup || {}) })
12
+
13
+ type RadioGroupVariants = VariantProps<typeof radioGroup>
14
+
15
+ export interface RadioGroupItem extends Pick<RadioGroupItemProps, 'disabled' | 'value'> {
16
+ label?: string
17
+ description?: string
18
+ }
19
+
20
+ export interface RadioGroupProps<T> extends Pick<RadioGroupRootProps, 'defaultValue' | 'disabled' | 'loop' | 'modelValue' | 'name' | 'required'> {
21
+ /**
22
+ * The element or component this component should render as.
23
+ * @defaultValue `div`
24
+ */
25
+ as?: any
26
+ legend?: string
27
+ /**
28
+ * When `items` is an array of objects, select the field to use as the value.
29
+ * @defaultValue 'value'
30
+ */
31
+ valueKey?: string
32
+ items?: T[]
33
+ size?: RadioGroupVariants['size']
34
+ color?: RadioGroupVariants['color']
35
+ /**
36
+ * The orientation the radio buttons are laid out.
37
+ * @defaultValue 'vertical'
38
+ */
39
+ orientation?: RadioGroupRootProps['orientation']
40
+ class?: any
41
+ ui?: Partial<typeof radioGroup.slots>
42
+ }
43
+
44
+ export type RadioGroupEmits = RadioGroupRootEmits & {
45
+ change: [payload: Event]
46
+ }
47
+
48
+ type SlotProps<T> = (props: { item: T, modelValue?: string }) => any
49
+
50
+ export interface RadioGroupSlots<T> {
51
+ legend(props?: {}): any
52
+ label: SlotProps<T>
53
+ description: SlotProps<T>
54
+ }
7
55
  </script>
8
56
 
9
57
  <script setup lang="ts" generic="T extends RadioGroupItem | AcceptableValue">
@@ -21,7 +69,7 @@ const slots = defineSlots<RadioGroupSlots<T>>()
21
69
 
22
70
  const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'orientation', 'loop', 'required'), emits)
23
71
 
24
- const { emitFormChange, emitFormInput, color, name, size, id: _id, disabled } = useFormField<RadioGroupProps<T>>(props)
72
+ const { emitFormChange, emitFormInput, color, name, size, id: _id, disabled } = useFormField<RadioGroupProps<T>>(props, { bind: false })
25
73
  const id = _id.value ?? useId()
26
74
 
27
75
  const ui = computed(() => radioGroup({