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

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 (170) 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.json +3 -3
  63. package/dist/module.mjs +7 -55
  64. package/dist/runtime/components/Accordion.vue +49 -6
  65. package/dist/runtime/components/Alert.vue +58 -6
  66. package/dist/runtime/components/App.vue +12 -2
  67. package/dist/runtime/components/Avatar.vue +27 -6
  68. package/dist/runtime/components/AvatarGroup.vue +30 -6
  69. package/dist/runtime/components/Badge.vue +28 -6
  70. package/dist/runtime/components/Breadcrumb.vue +44 -6
  71. package/dist/runtime/components/Button.vue +33 -6
  72. package/dist/runtime/components/ButtonGroup.vue +30 -6
  73. package/dist/runtime/components/Card.vue +25 -6
  74. package/dist/runtime/components/Checkbox.vue +45 -6
  75. package/dist/runtime/components/Chip.vue +39 -6
  76. package/dist/runtime/components/Collapsible.vue +27 -6
  77. package/dist/runtime/components/CommandPalette.vue +99 -6
  78. package/dist/runtime/components/Container.vue +22 -6
  79. package/dist/runtime/components/ContextMenu.vue +58 -6
  80. package/dist/runtime/components/ContextMenuContent.vue +18 -4
  81. package/dist/runtime/components/Drawer.vue +48 -6
  82. package/dist/runtime/components/DropdownMenu.vue +66 -6
  83. package/dist/runtime/components/DropdownMenuContent.vue +22 -4
  84. package/dist/runtime/components/Form.vue +34 -13
  85. package/dist/runtime/components/FormField.vue +41 -16
  86. package/dist/runtime/components/Icon.vue +12 -2
  87. package/dist/runtime/components/Input.vue +46 -6
  88. package/dist/runtime/components/InputMenu.vue +113 -6
  89. package/dist/runtime/components/Kbd.vue +28 -6
  90. package/dist/runtime/components/Link.vue +81 -17
  91. package/dist/runtime/components/LinkBase.vue +12 -2
  92. package/dist/runtime/components/Modal.vue +69 -6
  93. package/dist/runtime/components/NavigationMenu.vue +76 -6
  94. package/dist/runtime/components/Pagination.vue +99 -6
  95. package/dist/runtime/components/Popover.vue +42 -6
  96. package/dist/runtime/components/Progress.vue +44 -6
  97. package/dist/runtime/components/RadioGroup.vue +55 -7
  98. package/dist/runtime/components/Select.vue +88 -6
  99. package/dist/runtime/components/SelectMenu.vue +104 -6
  100. package/dist/runtime/components/Separator.vue +41 -6
  101. package/dist/runtime/components/Skeleton.vue +18 -6
  102. package/dist/runtime/components/Slideover.vue +67 -6
  103. package/dist/runtime/components/Slider.vue +36 -6
  104. package/dist/runtime/components/Switch.vue +50 -6
  105. package/dist/runtime/components/Tabs.vue +59 -6
  106. package/dist/runtime/components/Textarea.vue +46 -6
  107. package/dist/runtime/components/Toast.vue +55 -6
  108. package/dist/runtime/components/Toaster.vue +27 -6
  109. package/dist/runtime/components/Tooltip.vue +42 -6
  110. package/dist/runtime/composables/useAvatarGroup.d.ts +2 -2
  111. package/dist/runtime/composables/useButtonGroup.d.ts +3 -3
  112. package/dist/runtime/composables/useFormField.d.ts +6 -3
  113. package/dist/runtime/composables/useFormField.js +11 -7
  114. package/dist/runtime/composables/useModal.d.ts +1 -1
  115. package/dist/runtime/composables/useSlideover.d.ts +1 -1
  116. package/dist/runtime/composables/useToast.d.ts +1 -1
  117. package/dist/runtime/index.css +1 -0
  118. package/dist/runtime/plugins/colors.d.ts +2 -0
  119. package/dist/runtime/plugins/modal.d.ts +2 -0
  120. package/dist/runtime/plugins/slideover.d.ts +2 -0
  121. package/dist/runtime/types/form.d.ts +1 -2
  122. package/dist/runtime/utils/link.d.ts +23 -55
  123. package/package.json +13 -14
  124. package/dist/runtime/assets/css/animations.css +0 -1
  125. package/dist/runtime/components/Accordion.vue.d.ts +0 -492
  126. package/dist/runtime/components/Alert.vue.d.ts +0 -548
  127. package/dist/runtime/components/App.vue.d.ts +0 -25
  128. package/dist/runtime/components/Avatar.vue.d.ts +0 -384
  129. package/dist/runtime/components/AvatarGroup.vue.d.ts +0 -381
  130. package/dist/runtime/components/Badge.vue.d.ts +0 -422
  131. package/dist/runtime/components/Breadcrumb.vue.d.ts +0 -307
  132. package/dist/runtime/components/Button.vue.d.ts +0 -949
  133. package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -182
  134. package/dist/runtime/components/Card.vue.d.ts +0 -191
  135. package/dist/runtime/components/Checkbox.vue.d.ts +0 -819
  136. package/dist/runtime/components/Chip.vue.d.ts +0 -590
  137. package/dist/runtime/components/Collapsible.vue.d.ts +0 -159
  138. package/dist/runtime/components/CommandPalette.vue.d.ts +0 -684
  139. package/dist/runtime/components/Container.vue.d.ts +0 -27
  140. package/dist/runtime/components/ContextMenu.vue.d.ts +0 -796
  141. package/dist/runtime/components/ContextMenuContent.vue.d.ts +0 -0
  142. package/dist/runtime/components/Drawer.vue.d.ts +0 -343
  143. package/dist/runtime/components/DropdownMenu.vue.d.ts +0 -815
  144. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +0 -0
  145. package/dist/runtime/components/Form.vue.d.ts +0 -39
  146. package/dist/runtime/components/FormField.vue.d.ts +0 -356
  147. package/dist/runtime/components/Icon.vue.d.ts +0 -17
  148. package/dist/runtime/components/Input.vue.d.ts +0 -1137
  149. package/dist/runtime/components/InputMenu.vue.d.ts +0 -2121
  150. package/dist/runtime/components/Kbd.vue.d.ts +0 -169
  151. package/dist/runtime/components/Link.vue.d.ts +0 -76
  152. package/dist/runtime/components/LinkBase.vue.d.ts +0 -49
  153. package/dist/runtime/components/Modal.vue.d.ts +0 -319
  154. package/dist/runtime/components/NavigationMenu.vue.d.ts +0 -1789
  155. package/dist/runtime/components/Pagination.vue.d.ts +0 -295
  156. package/dist/runtime/components/Popover.vue.d.ts +0 -197
  157. package/dist/runtime/components/Progress.vue.d.ts +0 -1781
  158. package/dist/runtime/components/RadioGroup.vue.d.ts +0 -1715
  159. package/dist/runtime/components/Select.vue.d.ts +0 -1569
  160. package/dist/runtime/components/SelectMenu.vue.d.ts +0 -1661
  161. package/dist/runtime/components/Separator.vue.d.ts +0 -0
  162. package/dist/runtime/components/Skeleton.vue.d.ts +0 -26
  163. package/dist/runtime/components/Slideover.vue.d.ts +0 -375
  164. package/dist/runtime/components/Slider.vue.d.ts +0 -0
  165. package/dist/runtime/components/Switch.vue.d.ts +0 -1676
  166. package/dist/runtime/components/Tabs.vue.d.ts +0 -934
  167. package/dist/runtime/components/Textarea.vue.d.ts +0 -1133
  168. package/dist/runtime/components/Toast.vue.d.ts +0 -0
  169. package/dist/runtime/components/Toaster.vue.d.ts +0 -362
  170. package/dist/runtime/components/Tooltip.vue.d.ts +0 -248
package/dist/module.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defuFn, defu } from 'defu';
2
- import { addTemplate, hasNuxtModule, addTypeTemplate, defineNuxtModule, createResolver, addVitePlugin, installModule, addPlugin, addComponentsDir, addImportsDir } from '@nuxt/kit';
2
+ import { addTemplate, addTypeTemplate, defineNuxtModule, createResolver, addVitePlugin, installModule, addPlugin, addComponentsDir, addImportsDir } from '@nuxt/kit';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { kebabCase } from 'scule';
5
5
 
@@ -1309,8 +1309,8 @@ const navigationMenu = (options) => ({
1309
1309
  active: false,
1310
1310
  variant: "pill",
1311
1311
  class: {
1312
- link: ["hover:text-gray-900 dark:hover:text-white hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50", options.transitions && "transition-colors before:transition-colors"],
1313
- linkLeadingIcon: ["group-hover:text-gray-700 dark:group-hover:text-gray-200", options.transitions && "transition-colors"]
1312
+ link: ["hover:text-gray-900 dark:hover:text-white hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50 data-[state=open]:text-gray-900 dark:data-[state=open]:text-white data-[state=open]:before:bg-gray-50 dark:data-[state=open]:before:bg-gray-800/50", options.transitions && "transition-colors before:transition-colors"],
1313
+ linkLeadingIcon: ["group-hover:text-gray-700 dark:group-hover:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200", options.transitions && "transition-colors"]
1314
1314
  }
1315
1315
  }, ...options.colors.map((color) => ({
1316
1316
  color,
@@ -1347,8 +1347,8 @@ const navigationMenu = (options) => ({
1347
1347
  active: false,
1348
1348
  variant: "link",
1349
1349
  class: {
1350
- link: ["hover:text-gray-900 dark:hover:text-white", options.transitions && "transition-colors"],
1351
- linkLeadingIcon: ["group-hover:text-gray-700 dark:group-hover:text-gray-200", options.transitions && "transition-colors"]
1350
+ link: ["hover:text-gray-900 dark:hover:text-white data-[state=open]:text-gray-900 dark:data-[state=open]:text-white", options.transitions && "transition-colors"],
1351
+ linkLeadingIcon: ["group-hover:text-gray-700 dark:group-hover:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200", options.transitions && "transition-colors"]
1352
1352
  }
1353
1353
  }, ...options.colors.map((color) => ({
1354
1354
  color,
@@ -2471,49 +2471,6 @@ const theme = {
2471
2471
  };
2472
2472
 
2473
2473
  function addTemplates(options, nuxt) {
2474
- const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
2475
- if (!nuxt.options.css.find((path) => path.endsWith("tailwind.css"))) {
2476
- const template = addTemplate({
2477
- filename: "tailwind.css",
2478
- write: true,
2479
- getContents: () => `@import "tailwindcss";
2480
- @import "./ui.css";
2481
- ${hasNuxtModule("@nuxt/content") ? '@source "../content/**/*.md";' : ""}
2482
- `
2483
- });
2484
- nuxt.options.css.unshift(template.dst);
2485
- }
2486
- addTemplate({
2487
- filename: "ui.css",
2488
- write: true,
2489
- getContents: () => `@layer base {
2490
- :root {
2491
- color-scheme: light dark;
2492
- }
2493
- }
2494
-
2495
- @theme {
2496
- --color-gray-*: initial;
2497
- --color-cool-50: #f9fafb;
2498
- --color-cool-100: #f3f4f6;
2499
- --color-cool-200: #e5e7eb;
2500
- --color-cool-300: #d1d5db;
2501
- --color-cool-400: #9ca3af;
2502
- --color-cool-500: #6b7280;
2503
- --color-cool-600: #4b5563;
2504
- --color-cool-700: #374151;
2505
- --color-cool-800: #1f2937;
2506
- --color-cool-900: #111827;
2507
- --color-cool-950: #030712;
2508
-
2509
- --spacing-4_5: 1.125rem;
2510
-
2511
- ${shades.map((shade) => `--color-primary-${shade}: var(--color-primary-${shade});`).join("\n ")}
2512
- ${shades.map((shade) => `--color-error-${shade}: var(--color-error-${shade});`).join("\n ")}
2513
- ${shades.map((shade) => `--color-gray-${shade}: var(--color-gray-${shade});`).join("\n ")}
2514
- }
2515
- `
2516
- });
2517
2474
  for (const component in theme) {
2518
2475
  addTemplate({
2519
2476
  filename: `ui/${kebabCase(component)}.ts`,
@@ -2564,16 +2521,12 @@ type AppConfigUI = {
2564
2521
  icons?: Partial<typeof icons>
2565
2522
  } & DeepPartial<typeof ui, string>
2566
2523
 
2567
- declare module 'nuxt/schema' {
2568
- interface AppConfigInput {
2569
- ui?: AppConfigUI
2570
- }
2571
- }
2572
2524
  declare module '@nuxt/schema' {
2573
2525
  interface AppConfigInput {
2574
2526
  ui?: AppConfigUI
2575
2527
  }
2576
2528
  }
2529
+
2577
2530
  export {}
2578
2531
  `
2579
2532
  });
@@ -2599,7 +2552,7 @@ const module = defineNuxtModule({
2599
2552
  name: "ui",
2600
2553
  configKey: "ui",
2601
2554
  compatibility: {
2602
- nuxt: ">=3.10.0"
2555
+ nuxt: ">=3.13.1"
2603
2556
  }
2604
2557
  },
2605
2558
  defaults: {
@@ -2622,7 +2575,6 @@ const module = defineNuxtModule({
2622
2575
  });
2623
2576
  nuxt.options.app.rootAttrs = nuxt.options.app.rootAttrs || {};
2624
2577
  nuxt.options.app.rootAttrs.class = [nuxt.options.app.rootAttrs.class, "isolate"].filter(Boolean).join(" ");
2625
- nuxt.options.css.push(resolve("./runtime/assets/css/animations.css"));
2626
2578
  if (nuxt.options.builder === "@nuxt/vite-builder") {
2627
2579
  const plugin = await import('@tailwindcss/vite').then((r) => r.default);
2628
2580
  addVitePlugin(plugin());
@@ -1,9 +1,52 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/accordion";
5
- const appConfig = _appConfig;
6
- const accordion = tv({ extend: tv(theme), ...appConfig.ui?.accordion || {} });
1
+ <script lang="ts">
2
+ import { tv } from 'tailwind-variants'
3
+ import type { AccordionRootProps, AccordionRootEmits, AccordionItemProps } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/accordion'
7
+ import type { DynamicSlots } from '../types/utils'
8
+
9
+ const appConfig = _appConfig as AppConfig & { ui: { accordion: Partial<typeof theme> } }
10
+
11
+ const accordion = tv({ extend: tv(theme), ...(appConfig.ui?.accordion || {}) })
12
+
13
+ export interface AccordionItem extends Pick<AccordionItemProps, 'disabled'> {
14
+ label?: string
15
+ icon?: string
16
+ trailingIcon?: string
17
+ slot?: string
18
+ content?: string
19
+ /** A unique value for the accordion item. Defaults to the index. */
20
+ value?: string
21
+ }
22
+
23
+ export interface AccordionProps<T> extends Pick<AccordionRootProps, 'collapsible' | 'defaultValue' | 'modelValue' | 'type' | 'disabled'> {
24
+ /**
25
+ * The element or component this component should render as.
26
+ * @defaultValue 'div'
27
+ */
28
+ as?: any
29
+ items?: T[]
30
+ /**
31
+ * The icon displayed on the right side of the trigger.
32
+ * @defaultValue appConfig.ui.icons.chevronDown
33
+ */
34
+ trailingIcon?: string
35
+ class?: any
36
+ ui?: Partial<typeof accordion.slots>
37
+ }
38
+
39
+ export interface AccordionEmits extends AccordionRootEmits {}
40
+
41
+ type SlotProps<T> = (props: { item: T, index: number, open: boolean }) => any
42
+
43
+ export type AccordionSlots<T extends { slot?: string }> = {
44
+ leading: SlotProps<T>
45
+ default: SlotProps<T>
46
+ trailing: SlotProps<T>
47
+ content: SlotProps<T>
48
+ body: SlotProps<T>
49
+ } & DynamicSlots<T, SlotProps<T>>
7
50
  </script>
8
51
 
9
52
  <script setup lang="ts" generic="T extends AccordionItem">
@@ -1,9 +1,61 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/alert";
5
- const appConfig = _appConfig;
6
- const alert = tv({ extend: tv(theme), ...appConfig.ui?.alert || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { AppConfig } from '@nuxt/schema'
4
+ import _appConfig from '#build/app.config'
5
+ import theme from '#build/ui/alert'
6
+ import type { AvatarProps, ButtonProps } from '../types'
7
+
8
+ const appConfig = _appConfig as AppConfig & { ui: { alert: Partial<typeof theme> } }
9
+
10
+ const alert = tv({ extend: tv(theme), ...(appConfig.ui?.alert || {}) })
11
+
12
+ type AlertVariants = VariantProps<typeof alert>
13
+
14
+ export interface AlertProps {
15
+ /**
16
+ * The element or component this component should render as.
17
+ * @defaultValue 'div'
18
+ */
19
+ as?: any
20
+ title?: string
21
+ description?: string
22
+ icon?: string
23
+ avatar?: AvatarProps
24
+ color?: AlertVariants['color']
25
+ variant?: AlertVariants['variant']
26
+ /**
27
+ * Display a list of actions:
28
+ * - under the title and description if multiline
29
+ * - next to the close button if not multiline
30
+ */
31
+ actions?: ButtonProps[]
32
+ /**
33
+ * Display a close button to dismiss the alert.
34
+ * `{ size: 'md', color: 'gray', variant: 'link' }`{lang="ts-type"}
35
+ * @emits `close`
36
+ * @defaultValue false
37
+ */
38
+ close?: ButtonProps | boolean
39
+ /**
40
+ * The icon displayed in the close button.
41
+ * @defaultValue appConfig.ui.icons.close
42
+ */
43
+ closeIcon?: string
44
+ class?: any
45
+ ui?: Partial<typeof alert.slots>
46
+ }
47
+
48
+ export interface AlertEmits {
49
+ (e: 'close'): void
50
+ }
51
+
52
+ export interface AlertSlots {
53
+ leading(props?: {}): any
54
+ title(props?: {}): any
55
+ description(props?: {}): any
56
+ actions(props?: {}): any
57
+ close(props: { ui: any }): any
58
+ }
7
59
  </script>
8
60
 
9
61
  <script setup lang="ts">
@@ -1,5 +1,15 @@
1
- <script>
1
+ <script lang="ts">
2
+ import type { ConfigProviderProps, TooltipProviderProps } from 'radix-vue'
3
+ import type { ToasterProps } from '../types'
2
4
 
5
+ export interface AppProps extends Omit<ConfigProviderProps, 'useId'> {
6
+ tooltip?: TooltipProviderProps
7
+ toaster?: ToasterProps | null
8
+ }
9
+
10
+ export interface AppSlots {
11
+ default(props?: {}): any
12
+ }
3
13
  </script>
4
14
 
5
15
  <script setup lang="ts">
@@ -19,7 +29,7 @@ const toasterProps = toRef(() => props.toaster)
19
29
  </script>
20
30
 
21
31
  <template>
22
- <ConfigProvider :use-id="() => useId() as string" v-bind="configProviderProps">
32
+ <ConfigProvider :use-id="() => (useId() as string)" v-bind="configProviderProps">
23
33
  <TooltipProvider v-bind="tooltipProps">
24
34
  <UToaster v-if="toaster !== null" v-bind="toasterProps">
25
35
  <slot />
@@ -1,9 +1,30 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/avatar";
5
- const appConfig = _appConfig;
6
- const avatar = tv({ extend: tv(theme), ...appConfig.ui?.avatar || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { AvatarFallbackProps } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/avatar'
7
+
8
+ const appConfig = _appConfig as AppConfig & { ui: { avatar: Partial<typeof theme> } }
9
+
10
+ const avatar = tv({ extend: tv(theme), ...(appConfig.ui?.avatar || {}) })
11
+
12
+ type AvatarVariants = VariantProps<typeof avatar>
13
+
14
+ export interface AvatarProps extends Pick<AvatarFallbackProps, 'delayMs'> {
15
+ /**
16
+ * The element or component this component should render as.
17
+ * @defaultValue 'img'
18
+ */
19
+ as?: string | object
20
+ src?: string
21
+ alt?: string
22
+ icon?: string
23
+ text?: string
24
+ size?: AvatarVariants['size']
25
+ class?: any
26
+ ui?: Partial<typeof avatar.slots>
27
+ }
7
28
  </script>
8
29
 
9
30
  <script setup lang="ts">
@@ -1,9 +1,33 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/avatar-group";
5
- const appConfig = _appConfig;
6
- const avatarGroup = tv({ extend: tv(theme), ...appConfig.ui?.avatarGroup || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { AppConfig } from '@nuxt/schema'
4
+ import _appConfig from '#build/app.config'
5
+ import theme from '#build/ui/avatar-group'
6
+
7
+ const appConfig = _appConfig as AppConfig & { ui: { avatarGroup: Partial<typeof theme> } }
8
+
9
+ const avatarGroup = tv({ extend: tv(theme), ...(appConfig.ui?.avatarGroup || {}) })
10
+
11
+ type AvatarGroupVariants = VariantProps<typeof avatarGroup>
12
+
13
+ export interface AvatarGroupProps {
14
+ /**
15
+ * The element or component this component should render as.
16
+ * @defaultValue 'div'
17
+ */
18
+ as?: any
19
+ size?: AvatarGroupVariants['size']
20
+ /**
21
+ * The maximum number of avatars to display.
22
+ */
23
+ max?: number | string
24
+ class?: any
25
+ ui?: Partial<typeof avatarGroup.slots>
26
+ }
27
+
28
+ export interface AvatarGroupSlots {
29
+ default(props?: {}): any
30
+ }
7
31
  </script>
8
32
 
9
33
  <script setup lang="ts">
@@ -1,9 +1,31 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/badge";
5
- const appConfig = _appConfig;
6
- const badge = tv({ extend: tv(theme), ...appConfig.ui?.badge || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { AppConfig } from '@nuxt/schema'
4
+ import _appConfig from '#build/app.config'
5
+ import theme from '#build/ui/badge'
6
+
7
+ const appConfig = _appConfig as AppConfig & { ui: { badge: Partial<typeof theme> } }
8
+
9
+ const badge = tv({ extend: tv(theme), ...(appConfig.ui?.badge || {}) })
10
+
11
+ type BadgeVariants = VariantProps<typeof badge>
12
+
13
+ export interface BadgeProps {
14
+ /**
15
+ * The element or component this component should render as.
16
+ * @defaultValue 'span'
17
+ */
18
+ as?: any
19
+ label?: string | number
20
+ color?: BadgeVariants['color']
21
+ variant?: BadgeVariants['variant']
22
+ size?: BadgeVariants['size']
23
+ class?: any
24
+ }
25
+
26
+ export interface BadgeSlots {
27
+ default(props?: {}): any
28
+ }
7
29
  </script>
8
30
 
9
31
  <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/breadcrumb";
5
- const appConfig = _appConfig;
6
- const breadcrumb = tv({ extend: tv(theme), ...appConfig.ui?.breadcrumb || {} });
1
+ <script lang="ts">
2
+ import { tv } from 'tailwind-variants'
3
+ import type { AppConfig } from '@nuxt/schema'
4
+ import _appConfig from '#build/app.config'
5
+ import theme from '#build/ui/breadcrumb'
6
+ import type { AvatarProps, LinkProps } from '../types'
7
+ import type { DynamicSlots } from '../types/utils'
8
+
9
+ const appConfig = _appConfig as AppConfig & { ui: { breadcrumb: Partial<typeof theme> } }
10
+
11
+ const breadcrumb = tv({ extend: tv(theme), ...(appConfig.ui?.breadcrumb || {}) })
12
+
13
+ export interface BreadcrumbItem extends Omit<LinkProps, 'raw' | 'custom'> {
14
+ label?: string
15
+ icon?: string
16
+ avatar?: AvatarProps
17
+ slot?: string
18
+ }
19
+
20
+ export interface BreadcrumbProps<T> {
21
+ /**
22
+ * The element or component this component should render as.
23
+ * @defaultValue 'div'
24
+ */
25
+ as?: any
26
+ items?: T[]
27
+ /**
28
+ * The icon to use as a separator.
29
+ * @defaultValue appConfig.ui.icons.chevronRight
30
+ */
31
+ separatorIcon?: string
32
+ class?: any
33
+ ui?: Partial<typeof breadcrumb.slots>
34
+ }
35
+
36
+ type SlotProps<T> = (props: { item: T, index: number, active?: boolean }) => any
37
+
38
+ export type BreadcrumbSlots<T extends { slot?: string }> = {
39
+ 'item': SlotProps<T>
40
+ 'item-leading': SlotProps<T>
41
+ 'item-label': SlotProps<T>
42
+ 'item-trailing': SlotProps<T>
43
+ 'separator'(props?: {}): any
44
+ } & DynamicSlots<T, SlotProps<T>>
7
45
  </script>
8
46
 
9
47
  <script setup lang="ts" generic="T extends BreadcrumbItem">
@@ -1,9 +1,36 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/button";
5
- const appConfig = _appConfig;
6
- const button = tv({ extend: tv(theme), ...appConfig.ui?.button || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { AppConfig } from '@nuxt/schema'
4
+ import _appConfig from '#build/app.config'
5
+ import theme from '#build/ui/button'
6
+ import type { LinkProps } from './Link.vue'
7
+ import type { UseComponentIconsProps } from '../composables/useComponentIcons'
8
+ import type { PartialString } from '../types/utils'
9
+
10
+ const appConfig = _appConfig as AppConfig & { ui: { button: Partial<typeof theme> } }
11
+
12
+ const button = tv({ extend: tv(theme), ...(appConfig.ui?.button || {}) })
13
+
14
+ type ButtonVariants = VariantProps<typeof button>
15
+
16
+ export interface ButtonProps extends UseComponentIconsProps, Omit<LinkProps, 'raw' | 'custom'> {
17
+ label?: string
18
+ color?: ButtonVariants['color']
19
+ variant?: ButtonVariants['variant']
20
+ size?: ButtonVariants['size']
21
+ /** Render the button with equal padding on all sides. */
22
+ square?: boolean
23
+ /** Render the button full width. */
24
+ block?: boolean
25
+ class?: any
26
+ ui?: PartialString<typeof button.slots>
27
+ }
28
+
29
+ export interface ButtonSlots {
30
+ leading(props?: {}): any
31
+ default(props?: {}): any
32
+ trailing(props?: {}): any
33
+ }
7
34
  </script>
8
35
 
9
36
  <script setup lang="ts">
@@ -1,9 +1,33 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/button-group";
5
- const appConfig = _appConfig;
6
- const buttonGroup = tv({ extend: tv(theme), ...appConfig.ui?.buttonGroup });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { AppConfig } from '@nuxt/schema'
4
+ import _appConfig from '#build/app.config'
5
+ import theme from '#build/ui/button-group'
6
+
7
+ const appConfig = _appConfig as AppConfig & { ui: { buttonGroup: Partial<typeof theme> } }
8
+
9
+ const buttonGroup = tv({ extend: tv(theme), ...(appConfig.ui?.buttonGroup) })
10
+
11
+ type ButtonGroupVariants = VariantProps<typeof buttonGroup>
12
+
13
+ export interface ButtonGroupProps {
14
+ /**
15
+ * The element or component this component should render as.
16
+ * @defaultValue 'div'
17
+ */
18
+ as?: any
19
+ size?: ButtonGroupVariants['size']
20
+ /**
21
+ * The orientation the buttons are laid out.
22
+ * @defaultValue 'horizontal'
23
+ */
24
+ orientation?: ButtonGroupVariants['orientation']
25
+ class?: any
26
+ }
27
+
28
+ export interface ButtonGroupSlots {
29
+ default(props?: {}): any
30
+ }
7
31
  </script>
8
32
 
9
33
  <script setup lang="ts">
@@ -1,9 +1,28 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/card";
5
- const appConfig = _appConfig;
6
- const card = tv({ extend: tv(theme), ...appConfig.ui?.card || {} });
1
+ <script lang="ts">
2
+ import { tv } from 'tailwind-variants'
3
+ import type { AppConfig } from '@nuxt/schema'
4
+ import _appConfig from '#build/app.config'
5
+ import theme from '#build/ui/card'
6
+
7
+ const appConfig = _appConfig as AppConfig & { ui: { card: Partial<typeof theme> } }
8
+
9
+ const card = tv({ extend: tv(theme), ...(appConfig.ui?.card || {}) })
10
+
11
+ export interface CardProps {
12
+ /**
13
+ * The element or component this component should render as.
14
+ * @defaultValue 'div'
15
+ */
16
+ as?: any
17
+ class?: any
18
+ ui?: Partial<typeof card.slots>
19
+ }
20
+
21
+ export interface CardSlots {
22
+ header(props?: {}): any
23
+ default(props?: {}): any
24
+ footer(props?: {}): any
25
+ }
7
26
  </script>
8
27
 
9
28
  <script setup lang="ts">
@@ -1,9 +1,48 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/checkbox";
5
- const appConfig = _appConfig;
6
- const checkbox = tv({ extend: tv(theme), ...appConfig.ui?.checkbox || {} });
1
+ <script lang="ts">
2
+ import type { InputHTMLAttributes } from 'vue'
3
+ import { tv, type VariantProps } from 'tailwind-variants'
4
+ import type { CheckboxRootProps } from 'radix-vue'
5
+ import type { AppConfig } from '@nuxt/schema'
6
+ import _appConfig from '#build/app.config'
7
+ import theme from '#build/ui/checkbox'
8
+
9
+ const appConfig = _appConfig as AppConfig & { ui: { checkbox: Partial<typeof theme> } }
10
+
11
+ const checkbox = tv({ extend: tv(theme), ...(appConfig.ui?.checkbox || {}) })
12
+
13
+ type CheckboxVariants = VariantProps<typeof checkbox>
14
+
15
+ export interface CheckboxProps extends Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id'> {
16
+ label?: string
17
+ description?: string
18
+ color?: CheckboxVariants['color']
19
+ size?: CheckboxVariants['size']
20
+ /**
21
+ * The icon displayed when checked.
22
+ * @defaultValue appConfig.ui.icons.check
23
+ */
24
+ icon?: string
25
+ indeterminate?: InputHTMLAttributes['indeterminate']
26
+ /**
27
+ * The icon displayed when the checkbox is indeterminate.
28
+ * @defaultValue appConfig.ui.icons.minus
29
+ */
30
+ indeterminateIcon?: string
31
+ /** The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state. */
32
+ defaultValue?: boolean
33
+ class?: any
34
+ ui?: Partial<typeof checkbox.slots>
35
+ }
36
+
37
+ export interface CheckboxEmits {
38
+ (e: 'update:modelValue', payload: boolean): void
39
+ (e: 'change', payload: Event): void
40
+ }
41
+
42
+ export interface CheckboxSlots {
43
+ label(props: { label?: string }): any
44
+ description(props: { description?: string }): any
45
+ }
7
46
  </script>
8
47
 
9
48
  <script setup lang="ts">
@@ -1,9 +1,42 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/chip";
5
- const appConfig = _appConfig;
6
- const chip = tv({ extend: tv(theme), ...appConfig.ui?.chip || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { AppConfig } from '@nuxt/schema'
4
+ import _appConfig from '#build/app.config'
5
+ import theme from '#build/ui/chip'
6
+
7
+ const appConfig = _appConfig as AppConfig & { ui: { chip: Partial<typeof theme> } }
8
+
9
+ const chip = tv({ extend: tv(theme), ...(appConfig.ui?.chip || {}) })
10
+
11
+ type ChipVariants = VariantProps<typeof chip>
12
+
13
+ export interface ChipProps {
14
+ /**
15
+ * The element or component this component should render as.
16
+ * @defaultValue 'div'
17
+ */
18
+ as?: any
19
+ /** Display some text inside the chip. */
20
+ text?: string | number
21
+ color?: ChipVariants['color']
22
+ size?: ChipVariants['size']
23
+ position?: ChipVariants['position']
24
+ /** When `true`, translate the chip at the edge for non rounded elements. */
25
+ inset?: boolean
26
+ /** When `true`, render the chip relatively to the parent. */
27
+ standalone?: boolean
28
+ class?: any
29
+ ui?: Partial<typeof chip.slots>
30
+ }
31
+
32
+ export interface ChipEmits {
33
+ (e: 'update:show', payload: boolean): void
34
+ }
35
+
36
+ export interface ChipSlots {
37
+ default(props?: {}): any
38
+ content(props?: {}): any
39
+ }
7
40
  </script>
8
41
 
9
42
  <script setup lang="ts">