@nuxt/ui 0.4.1 → 2.8.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 (143) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +63 -50
  3. package/dist/module.cjs +5 -0
  4. package/dist/module.d.mts +1234 -0
  5. package/dist/module.d.ts +1234 -0
  6. package/dist/module.json +8 -0
  7. package/dist/module.mjs +407 -0
  8. package/dist/runtime/app.config.d.ts +1203 -0
  9. package/dist/runtime/app.config.mjs +1057 -0
  10. package/dist/runtime/components/data/Table.vue +251 -0
  11. package/dist/runtime/components/data/Table.vue.d.ts +215 -0
  12. package/dist/runtime/components/elements/Accordion.vue +138 -0
  13. package/dist/runtime/components/elements/Accordion.vue.d.ts +80 -0
  14. package/dist/runtime/components/elements/Alert.vue +120 -0
  15. package/dist/runtime/components/elements/Alert.vue.d.ts +107 -0
  16. package/dist/runtime/components/elements/Avatar.vue +149 -0
  17. package/dist/runtime/components/elements/Avatar.vue.d.ts +115 -0
  18. package/dist/runtime/components/elements/AvatarGroup.d.ts +37 -0
  19. package/dist/runtime/components/elements/AvatarGroup.mjs +53 -0
  20. package/dist/runtime/components/elements/Badge.vue +69 -0
  21. package/dist/runtime/components/elements/Badge.vue.d.ts +63 -0
  22. package/dist/runtime/components/elements/Button.vue +182 -0
  23. package/dist/runtime/components/elements/Button.vue.d.ts +187 -0
  24. package/dist/runtime/components/elements/ButtonGroup.d.ts +39 -0
  25. package/dist/runtime/components/elements/ButtonGroup.mjs +70 -0
  26. package/dist/runtime/components/elements/Dropdown.vue +172 -0
  27. package/dist/runtime/components/elements/Dropdown.vue.d.ts +96 -0
  28. package/dist/runtime/components/elements/Icon.vue +15 -0
  29. package/dist/runtime/components/elements/Icon.vue.d.ts +12 -0
  30. package/dist/runtime/components/elements/Kbd.vue +55 -0
  31. package/dist/runtime/components/elements/Kbd.vue.d.ts +42 -0
  32. package/dist/runtime/components/elements/Link.vue +80 -0
  33. package/dist/runtime/components/elements/Link.vue.d.ts +9 -0
  34. package/dist/runtime/components/forms/Checkbox.vue +136 -0
  35. package/dist/runtime/components/forms/Checkbox.vue.d.ts +129 -0
  36. package/dist/runtime/components/forms/Form.vue +185 -0
  37. package/dist/runtime/components/forms/Form.vue.d.ts +50 -0
  38. package/dist/runtime/components/forms/FormGroup.vue +97 -0
  39. package/dist/runtime/components/forms/FormGroup.vue.d.ts +98 -0
  40. package/dist/runtime/components/forms/Input.vue +250 -0
  41. package/dist/runtime/components/forms/Input.vue.d.ts +214 -0
  42. package/dist/runtime/components/forms/Radio.vue +122 -0
  43. package/dist/runtime/components/forms/Radio.vue.d.ts +109 -0
  44. package/dist/runtime/components/forms/Range.vue +163 -0
  45. package/dist/runtime/components/forms/Range.vue.d.ts +119 -0
  46. package/dist/runtime/components/forms/Select.vue +307 -0
  47. package/dist/runtime/components/forms/Select.vue.d.ts +229 -0
  48. package/dist/runtime/components/forms/SelectMenu.vue +429 -0
  49. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +330 -0
  50. package/dist/runtime/components/forms/Textarea.vue +184 -0
  51. package/dist/runtime/components/forms/Textarea.vue.d.ts +161 -0
  52. package/dist/runtime/components/forms/Toggle.vue +113 -0
  53. package/dist/runtime/components/forms/Toggle.vue.d.ts +83 -0
  54. package/dist/runtime/components/layout/Card.vue +58 -0
  55. package/dist/runtime/components/layout/Card.vue.d.ts +31 -0
  56. package/dist/runtime/components/layout/Container.vue +43 -0
  57. package/dist/runtime/components/layout/Container.vue.d.ts +31 -0
  58. package/dist/runtime/components/layout/Skeleton.vue +37 -0
  59. package/dist/runtime/components/layout/Skeleton.vue.d.ts +22 -0
  60. package/dist/runtime/components/navigation/CommandPalette.vue +304 -0
  61. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +224 -0
  62. package/dist/runtime/components/navigation/CommandPaletteGroup.vue +152 -0
  63. package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +63 -0
  64. package/dist/runtime/components/navigation/Pagination.vue +197 -0
  65. package/dist/runtime/components/navigation/Pagination.vue.d.ts +125 -0
  66. package/dist/runtime/components/navigation/Tabs.vue +138 -0
  67. package/dist/runtime/components/navigation/Tabs.vue.d.ts +69 -0
  68. package/dist/runtime/components/navigation/VerticalNavigation.vue +79 -0
  69. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +37 -0
  70. package/dist/runtime/components/overlays/ContextMenu.vue +74 -0
  71. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +54 -0
  72. package/dist/runtime/components/overlays/Modal.vue +113 -0
  73. package/dist/runtime/components/overlays/Modal.vue.d.ts +82 -0
  74. package/dist/runtime/components/overlays/Notification.vue +197 -0
  75. package/dist/runtime/components/overlays/Notification.vue.d.ts +126 -0
  76. package/dist/runtime/components/overlays/Notifications.vue +61 -0
  77. package/dist/runtime/components/overlays/Notifications.vue.d.ts +41 -0
  78. package/dist/runtime/components/overlays/Popover.vue +139 -0
  79. package/dist/runtime/components/overlays/Popover.vue.d.ts +82 -0
  80. package/dist/runtime/components/overlays/Slideover.vue +103 -0
  81. package/dist/runtime/components/overlays/Slideover.vue.d.ts +84 -0
  82. package/dist/runtime/components/overlays/Tooltip.vue +118 -0
  83. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +82 -0
  84. package/dist/runtime/composables/defineShortcuts.d.ts +13 -0
  85. package/dist/runtime/composables/defineShortcuts.mjs +108 -0
  86. package/dist/runtime/composables/useCopyToClipboard.d.ts +10 -0
  87. package/dist/runtime/composables/useCopyToClipboard.mjs +26 -0
  88. package/dist/runtime/composables/useFormGroup.d.ts +6 -0
  89. package/dist/runtime/composables/useFormGroup.mjs +30 -0
  90. package/dist/runtime/composables/usePopper.d.ts +232 -0
  91. package/dist/runtime/composables/usePopper.mjs +78 -0
  92. package/dist/runtime/composables/useShortcuts.d.ts +12 -0
  93. package/dist/runtime/composables/useShortcuts.mjs +24 -0
  94. package/dist/runtime/composables/useTimer.d.ts +8 -0
  95. package/dist/runtime/composables/useTimer.mjs +51 -0
  96. package/dist/runtime/composables/useToast.d.ts +18 -0
  97. package/dist/runtime/composables/useToast.mjs +22 -0
  98. package/dist/runtime/plugins/colors.d.ts +2 -0
  99. package/dist/runtime/plugins/colors.mjs +46 -0
  100. package/dist/runtime/types/accordion.d.ts +9 -0
  101. package/dist/runtime/types/avatar.d.ts +9 -0
  102. package/dist/runtime/types/button.d.ts +23 -0
  103. package/dist/runtime/types/clipboard.d.ts +3 -0
  104. package/dist/runtime/types/command-palette.d.ts +26 -0
  105. package/dist/runtime/types/dropdown.d.ts +13 -0
  106. package/dist/runtime/types/form.d.ts +21 -0
  107. package/dist/runtime/types/index.d.ts +12 -0
  108. package/dist/runtime/types/link.d.ts +8 -0
  109. package/dist/runtime/types/notification.d.ts +22 -0
  110. package/dist/runtime/types/popper.d.ts +14 -0
  111. package/dist/runtime/types/tabs.d.ts +6 -0
  112. package/dist/runtime/types/vertical-navigation.d.ts +11 -0
  113. package/dist/runtime/ui.css +13 -0
  114. package/dist/runtime/utils/StateEmitter.d.ts +17 -0
  115. package/dist/runtime/utils/StateEmitter.mjs +21 -0
  116. package/dist/runtime/utils/index.d.ts +11 -0
  117. package/dist/runtime/utils/index.mjs +33 -0
  118. package/dist/types.d.mts +15 -0
  119. package/dist/types.d.ts +15 -0
  120. package/package.json +56 -39
  121. package/LICENSE +0 -21
  122. package/dist/assets/styles.css +0 -14
  123. package/dist/components/NButton.vue +0 -22
  124. package/dist/components/NCard.vue +0 -5
  125. package/dist/components/NCheckbox.vue +0 -35
  126. package/dist/components/NDarkToggle.vue +0 -28
  127. package/dist/components/NDialog.vue +0 -59
  128. package/dist/components/NDropdown.vue +0 -31
  129. package/dist/components/NIcon.vue +0 -9
  130. package/dist/components/NLink.vue +0 -20
  131. package/dist/components/NRadio.vue +0 -40
  132. package/dist/components/NSwitch.vue +0 -37
  133. package/dist/components/NTextInput.vue +0 -34
  134. package/dist/components/NTip.vue +0 -16
  135. package/dist/components/NuxtContentLogo.vue +0 -7
  136. package/dist/components/NuxtExampleLayout.vue +0 -82
  137. package/dist/components/NuxtLogo.vue +0 -20
  138. package/dist/components/nuxt/NDarkToggle.vue +0 -28
  139. package/dist/nuxt.d.ts +0 -16
  140. package/dist/nuxt.mjs +0 -36
  141. package/dist/unocss.d.ts +0 -7
  142. package/dist/unocss.mjs +0 -127
  143. package/nuxt.cjs +0 -7
@@ -1,35 +0,0 @@
1
- <template>
2
- <label
3
- class="n-checkbox inline-flex items-center select-none hover:n-checkbox-hover n-disabled:n-disabled"
4
- :checked="checked || null"
5
- :disabled="disabled || null"
6
- >
7
- <input
8
- v-model="checked"
9
- type="checkbox"
10
- class="absolute op0 peer"
11
- :disabled="disabled"
12
- @keypress.enter="checked = !checked"
13
- >
14
- <span class="n-transition n-checkbox-box n-checked:n-checkbox-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base">
15
- <NIcon class="n-transition n-checkbox-icon transform scale-0 op0 n-checked:op100 n-checked:scale-100" />
16
- </span>
17
- <span><slot /></span>
18
- </label>
19
- </template>
20
-
21
- <script setup lang="ts">
22
- import { useVModel } from '@vueuse/core'
23
-
24
- const props = withDefaults(
25
- defineProps<{
26
- modelValue?: boolean
27
- disabled?: boolean }>(),
28
- {
29
- modelValue: false,
30
- disabled: false
31
- }
32
- )
33
- const emit = defineEmits<{(...args: any): void}>()
34
- const checked = useVModel(props, 'modelValue', emit, { passive: true })
35
- </script>
@@ -1,28 +0,0 @@
1
- <script setup lang="ts">
2
- /* eslint-disable vue/no-multiple-template-root */
3
- import { useColorMode, useToggle } from '@vueuse/core'
4
- import { computed } from 'vue'
5
-
6
- const mode = useColorMode()
7
-
8
- const isDark = computed<boolean>({
9
- get () {
10
- return mode.value === 'dark'
11
- },
12
- set (v) {
13
- mode.value = v ? 'dark' : 'light'
14
- }
15
- })
16
-
17
- const toggle = useToggle(isDark)
18
-
19
- const context = {
20
- mode,
21
- isDark,
22
- toggle
23
- }
24
- </script>
25
-
26
- <template>
27
- <slot v-bind="context" />
28
- </template>
@@ -1,59 +0,0 @@
1
- <template>
2
- <div
3
- class="n-dialog n-transition fixed inset-0 flex items-center justify-center z-100"
4
- :class="[
5
- show ? '' : 'op0 pointer-events-none',
6
- ]"
7
- >
8
- <div
9
- class="absolute inset-0 -z-1"
10
- :class="[
11
- dim ? 'bg-black/50' : ''
12
- ]"
13
- @click="close"
14
- />
15
- <NCard v-bind="$attrs" ref="card">
16
- <slot />
17
- </NCard>
18
- </div>
19
- </template>
20
-
21
- <script setup lang="ts">
22
- import { ref, watch, onMounted } from 'vue'
23
- import { useVModel } from '@vueuse/core'
24
- import { useFocusTrap } from '@vueuse/integrations/useFocusTrap'
25
-
26
- const props = withDefaults(
27
- defineProps<{
28
- modelValue?: boolean
29
- dim?: boolean
30
- }>(),
31
- {
32
- modelValue: false,
33
- dim: true
34
- }
35
- )
36
- const emit = defineEmits<{(...args: any): void }>()
37
-
38
- const show = useVModel(props, 'modelValue', emit, { passive: true })
39
- const card = ref(null)
40
-
41
- const { activate, deactivate } = useFocusTrap(card, { immediate: false })
42
-
43
- onMounted(() => {
44
- watch(show, (v) => {
45
- if (v) { activate() } else { deactivate() }
46
- }, { immediate: true })
47
- })
48
-
49
- function close () {
50
- show.value = false
51
- emit('close')
52
- }
53
- </script>
54
-
55
- <script lang="ts">
56
- export default {
57
- inheritAttrs: false
58
- }
59
- </script>
@@ -1,31 +0,0 @@
1
- <script setup lang="ts">
2
- import { ref } from 'vue'
3
- import { onClickOutside, useVModel } from '@vueuse/core'
4
-
5
- const props = defineProps<{ modelValue?: boolean }>()
6
- const emit = defineEmits<{(...args: any): void }>()
7
-
8
- const enabled = useVModel(props, 'modelValue', emit, { passive: true })
9
- const el = ref<HTMLDivElement>()
10
-
11
- onClickOutside(el, () => {
12
- enabled.value = false
13
- })
14
- </script>
15
-
16
- <template>
17
- <div ref="el" class="relative">
18
- <slot name="trigger" :enabled="enabled" @click="enabled = !enabled">
19
- <NButton @click="enabled = !enabled">
20
- Dropdown
21
- </NButton>
22
- </slot>
23
-
24
- <div
25
- class="absolute z-10 n-transition n-bg-base border n-border-base rounded shadow"
26
- :class="[enabled ? 'op-100' : 'op0 pointer-events-none -translate-y-1']"
27
- >
28
- <slot />
29
- </div>
30
- </div>
31
- </template>
@@ -1,9 +0,0 @@
1
- <template>
2
- <div class="n-icon" :class="icon" />
3
- </template>
4
-
5
- <script setup lang="ts">
6
- defineProps<{
7
- icon?: string
8
- }>()
9
- </script>
@@ -1,20 +0,0 @@
1
-
2
- <script setup lang="ts">
3
- import { NuxtLink } from '#components'
4
-
5
- defineProps<{
6
- to?: string
7
- href?: string
8
- target?: string
9
- }>()
10
- </script>
11
-
12
- <template>
13
- <Component
14
- :is="(href || target) ? 'a' : NuxtLink"
15
- v-bind="$props"
16
- class="n-link n-link-base hover:n-link-hover n-transition"
17
- >
18
- <slot />
19
- </Component>
20
- </template>
@@ -1,40 +0,0 @@
1
- <template>
2
- <label
3
- class="n-radio inline-flex items-center select-none hover:n-radio-hover n-disabled:n-disabled"
4
- :checked="model === value || null"
5
- :disabled="disabled || null"
6
- >
7
- <input
8
- v-model="model"
9
- type="radio"
10
- class="absolute op0 peer"
11
- :disabled="disabled"
12
- :name="name"
13
- :value="value"
14
- @keypress.enter="model = value"
15
- >
16
- <span class="n-transition n-radio-box n-checked:n-radio-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base">
17
- <div class="n-transition n-radio-inner n-checked:n-radio-inner-checked" />
18
- </span>
19
- <span><slot /></span>
20
- </label>
21
- </template>
22
-
23
- <script setup lang="ts">
24
- import { useVModel } from '@vueuse/core'
25
-
26
- const props = withDefaults(
27
- defineProps<{
28
- modelValue?: string
29
- disabled?: boolean
30
- name?: string
31
- value?: string
32
- }>(),
33
- {
34
- modelValue: '',
35
- disabled: false
36
- }
37
- )
38
- const emit = defineEmits<{(...args: any): void}>()
39
- const model = useVModel(props, 'modelValue', emit, { passive: true })
40
- </script>
@@ -1,37 +0,0 @@
1
- <template>
2
- <label
3
- class="n-switch n-switch-base n-disabled:n-disabled"
4
- :checked="checked || null"
5
- :disabled="disabled || null"
6
- >
7
- <input
8
- v-model="checked"
9
- type="checkbox"
10
- class="absolute op0 peer"
11
- :disabled="disabled"
12
- @keypress.enter="checked = !checked"
13
- >
14
- <div class="n-transition n-switch-slider n-checked:n-switch-slider-checked peer-active:n-active-base peer-focus-visible:n-focus-base">
15
- <div
16
- class="n-transition n-switch-thumb n-checked:n-switch-thumb-checked"
17
- />
18
- </div>
19
- <span><slot /></span>
20
- </label>
21
- </template>
22
-
23
- <script setup lang="ts">
24
- import { useVModel } from '@vueuse/core'
25
-
26
- const props = withDefaults(
27
- defineProps<{
28
- modelValue?: boolean
29
- disabled?: boolean }>(),
30
- {
31
- modelValue: false,
32
- disabled: false
33
- }
34
- )
35
- const emit = defineEmits<{(...args: any): void}>()
36
- const checked = useVModel(props, 'modelValue', emit, { passive: true })
37
- </script>
@@ -1,34 +0,0 @@
1
- <template>
2
- <div class="n-text-input n-bg-base focus-within:n-focus-base focus-within:border-context rounded px-2 py-1 border n-border-base flex items-center flex">
3
- <slot name="icon">
4
- <NIcon v-if="icon" :icon="icon" class="mr-0.4em text-1.1em op50" />
5
- </slot>
6
- <input
7
- v-model="input"
8
- class="!outline-none flex-auto n-bg-base w-full"
9
- :type="type"
10
- :placeholder="placeholder"
11
- >
12
- </div>
13
- </template>
14
-
15
- <script setup lang="ts">
16
- import { useVModel } from '@vueuse/core'
17
-
18
- const props = withDefaults(
19
- defineProps<{
20
- modelValue?: string
21
- placeholder?: string
22
- icon?: string
23
- disabled?: boolean
24
- type?: string
25
- }>(),
26
- {
27
- modelValue: '',
28
- disabled: false,
29
- type: 'text'
30
- }
31
- )
32
- const emit = defineEmits<{(...args: any): void}>()
33
- const input = useVModel(props, 'modelValue', emit, { passive: true })
34
- </script>
@@ -1,16 +0,0 @@
1
- <template>
2
- <div class="n-tip n-tip-base">
3
- <slot name="icon">
4
- <NIcon v-if="icon" :icon="icon" class="n-tip-icon" />
5
- </slot>
6
- <div>
7
- <slot />
8
- </div>
9
- </div>
10
- </template>
11
-
12
- <script setup lang="ts">
13
- defineProps<{
14
- icon?: string
15
- }>()
16
- </script>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg viewBox="0 0 236 65" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M29.3445 12.5176c-1.8181-3.10288-6.3636-3.10288-8.1819 0L1.34708 46.334c-1.8182 3.1029.45453 6.9814 4.09096 6.9814H20.9071c-1.5538-1.3478-2.1292-3.6793-.9532-5.68l15.0073-25.5327-5.6167-9.5851Z" fill="#80EEC0" />
4
- <path d="M41.9001 19.9353c1.5048-2.5387 5.2665-2.5387 6.7712 0l16.3991 27.6679c1.5048 2.5387-.3762 5.7122-3.3855 5.7122H28.8867c-3.0093 0-4.8904-3.1735-3.3857-5.7122l16.3991-27.6679Z" fill="#00DC82" />
5
- <path d="M93.247 53.206c7.271 0 12.682-4.1739 13.273-10.2874h-5.579c-.508 3.2042-3.6358 5.4388-7.694 5.4388-5.1572 0-9.0462-3.5415-9.0462-10.2451 0-6.7037 3.889-10.2875 9.0462-10.2875 3.9735 0 7.102 2.2345 7.524 5.4811h5.834c-.803-6.1135-6.214-10.2875-13.358-10.2875-7.7358 0-14.6684 5.0593-14.6684 15.0939 0 10.0344 6.8059 15.0937 14.6684 15.0937Zm26.866 0c6.468 0 11.118-4.6378 11.118-10.962 0-6.3242-4.65-10.962-11.118-10.962-6.51 0-11.159 4.6378-11.159 10.962 0 6.3242 4.649 10.962 11.159 10.962Zm0-4.4692c-3.55 0-5.918-2.6562-5.918-6.4928 0-3.8368 2.368-6.4927 5.918-6.4927 3.509 0 5.877 2.6559 5.877 6.4927 0 3.8366-2.368 6.4928-5.877 6.4928Zm19.826 4.1319V41.2743c0-3.12 2.029-5.3967 4.946-5.3967 2.663 0 4.439 2.0239 4.439 4.933v12.0581h5.199V39.7143c0-4.975-3.128-8.4323-7.947-8.4323-3.044 0-5.453 1.3071-6.637 3.6259v-3.2886h-5.199v21.2494h5.199Zm21.158-21.2494h-4.185v4.3427h4.185v9.4864c0 4.722 3.044 7.4203 7.694 7.4203h3.424v-4.3849h-2.833c-1.943 0-3.085-1.0961-3.085-3.2464V35.962h5.918v-4.3427h-5.918v-6.4085h-5.2v6.4085Zm28.684 14.1662c-.55 2.0237-2.283 3.12-4.946 3.12-3.297 0-5.495-2.1924-5.876-5.6074h15.725c.043-.4217.085-1.0541.085-1.7709 0-5.0593-3.211-10.2452-10.357-10.2452-6.974 0-10.441 5.2703-10.441 10.8776 0 5.5654 3.89 11.0464 10.864 11.0464 5.243 0 9.215-2.9092 10.018-7.4205h-5.072Zm-5.369-10.6245c3.086 0 4.947 2.0237 5.158 4.722h-10.483c.549-3.2044 2.408-4.722 5.325-4.722Zm19.141 17.7077V41.2743c0-3.12 2.029-5.3967 4.947-5.3967 2.663 0 4.439 2.0239 4.439 4.933v12.0581h5.199V39.7143c0-4.975-3.128-8.4323-7.947-8.4323-3.044 0-5.453 1.3071-6.638 3.6259v-3.2886h-5.199v21.2494h5.199Zm21.159-21.2494h-4.185v4.3427h4.185v9.4864c0 4.722 3.043 7.4203 7.693 7.4203h3.425v-4.3849h-2.833c-1.945 0-3.086-1.0961-3.086-3.2464V35.962h5.919v-4.3427h-5.919v-6.4085h-5.199v6.4085Z" fill="currentColor" />
6
- </svg>
7
- </template>
@@ -1,82 +0,0 @@
1
- <script setup lang="ts">
2
- import NIcon from './NIcon.vue'
3
- import NuxtLogo from './NuxtLogo.vue'
4
- import NuxtContentLogo from './NuxtContentLogo.vue'
5
-
6
- interface Props {
7
- example?: string
8
- showTips?: boolean
9
- class?: string // eslint-disable-line vue/no-reserved-props
10
- openPath?: string,
11
- repo?: string
12
- }
13
- const props = withDefaults(defineProps<Props>(), {
14
- repo: 'nuxt/framework'
15
- })
16
-
17
- const openInEditor = () => {
18
- fetch(`/__open-in-editor?file=${encodeURIComponent(props.openPath || 'app.vue')}`)
19
- }
20
- </script>
21
-
22
- <template>
23
- <div class="relative font-sans" n="green6">
24
- <div class="container max-w-200 mx-auto py-10 px-4">
25
- <div class="flex flex-wrap items-end gap-3 mb-4 relative">
26
- <slot name="logo">
27
- <NuxtContentLogo v-if="repo === 'nuxt/content'" class="h-10" />
28
- <NuxtLogo v-else class="h-10" />
29
- </slot>
30
- <div class="text-xl flex">
31
- <div class="op-50">
32
- examples/
33
- </div>
34
- <slot name="name">
35
- <NLink :href="`https://github.com/${repo}/tree/main/examples/${example}`" target="_blank">
36
- {{ example }}
37
- </NLink>
38
- </slot>
39
- </div>
40
- <div flex-auto />
41
- <div class="op20 hover:op-100 n-transition -mb-2 -mr-1">
42
- <NButton
43
- n="borderless lg"
44
- class="p-2 op50"
45
- :to="`https://github.com/${repo}/tree/main/examples/${example}`"
46
- target="_blank"
47
- >
48
- <NIcon icon="carbon-code" />
49
- </NButton>
50
- <NDarkToggle>
51
- <template #default="{ toggle }">
52
- <NButton n="borderless lg" p-2 op50 @click="toggle">
53
- <NIcon icon="dark:carbon-moon carbon-sun" />
54
- </NButton>
55
- </template>
56
- </NDarkToggle>
57
- </div>
58
- </div>
59
-
60
- <slot name="subtitle" />
61
- <slot name="nav" />
62
-
63
- <NCard class="p-6 flex flex-col gap-2 text-center" :class="$props.class">
64
- <slot />
65
- </NCard>
66
-
67
- <div
68
- v-if="$slots.tips"
69
- :class="showTips ? 'opacity-100' : 'opacity-0'"
70
- class="transition py-5 flex items-center gap-2 text-gray-400"
71
- >
72
- <NIcon icon="carbon-idea" class="text-xl flex-none" />
73
- <slot name="tips" />
74
- <NButton icon="carbon-edit" class="flex-none" @click="openInEditor">
75
- Open in Editor
76
- </NButton>
77
- </div>
78
-
79
- <slot name="footer" />
80
- </div>
81
- </div>
82
- </template>
@@ -1,20 +0,0 @@
1
- <template>
2
- <svg viewBox="0 0 221 65" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <g clip-path="url(#a)">
4
- <path
5
- fill="currentColor"
6
- d="M82.562 18.57h7.302l15.474 24.742V18.571h6.741v35.057h-7.252l-15.525-24.69v24.69h-6.74V18.57Zm59.645 35.058h-6.282v-3.916c-1.429 2.756-4.339 4.308-8.015 4.308-5.822 0-9.603-4.107-9.603-10.018V28.385h6.282V42.71c0 3.456 2.146 5.859 5.362 5.859 3.524 0 5.974-2.704 5.974-6.41V28.385h6.282v25.243Zm21.857-.4-6.026-8.413-6.027 8.414h-6.69l9.296-13.172-8.58-12.071h6.843l5.158 7.264 5.106-7.264h6.895l-8.632 12.07 9.295 13.173h-6.638Zm19.405-32.455v7.611h7.149v5.16h-7.149v12.53c0 .421.17.825.473 1.123.303.298.715.465 1.144.466h5.532v5.955h-4.137c-5.617 0-9.293-3.206-9.293-8.811V33.548h-5.056v-5.164h3.172c1.479 0 2.34-.864 2.34-2.293v-5.318h5.825Z"
7
- />
8
- <path
9
- fill-rule="evenodd"
10
- clip-rule="evenodd"
11
- d="M30.119 11.546c-1.886-3.242-6.6-3.242-8.484 0L1.087 46.875c-1.885 3.241.472 7.293 4.242 7.293h16.04c-1.61-1.408-2.207-3.844-.988-5.934L35.942 21.56l-5.824-10.013Z"
12
- fill="#80EEC0"
13
- />
14
- <path
15
- d="M43.137 19.295c1.56-2.652 5.461-2.652 7.022 0l17.004 28.906c1.56 2.652-.39 5.968-3.51 5.968h-34.01c-3.12 0-5.07-3.316-3.51-5.968l17.004-28.906ZM209.174 53.8h-10.691c0-1.85.067-3.452 0-6.02h10.641c1.868 0 3.353.1 4.354-.935 1-1.034 1.501-2.335 1.501-3.903 0-1.834-.667-3.219-2.002-4.153-1.301-.967-2.985-1.451-5.054-1.451h-2.601v-5.254h2.652c1.701 0 3.119-.4 4.253-1.2 1.134-.801 1.701-1.986 1.701-3.553 0-1.301-.434-2.336-1.301-3.103-.834-.8-2.001-1.2-3.503-1.2-1.634 0-2.918.483-3.853 1.45-.9.968-1.401 2.152-1.501 3.553h-6.254c.133-3.236 1.251-5.788 3.352-7.656 2.135-1.868 4.887-2.802 8.256-2.802 2.402 0 4.42.434 6.055 1.301 1.668.834 2.919 1.952 3.753 3.353.867 1.4 1.301 2.952 1.301 4.653 0 1.968-.551 3.636-1.651 5.004-1.068 1.334-2.402 2.235-4.004 2.702 1.969.4 3.57 1.368 4.804 2.902 1.234 1.501 1.852 3.403 1.852 5.705 0 1.934-.468 3.702-1.402 5.304-.934 1.6-2.301 2.885-4.103 3.852-1.768.968-3.953 1.452-6.555 1.452Z"
16
- fill="#00DC82"
17
- />
18
- </g>
19
- </svg>
20
- </template>
@@ -1,28 +0,0 @@
1
- <script setup lang="ts">
2
- /* eslint-disable vue/no-multiple-template-root */
3
- import { computed } from 'vue'
4
- import { useToggle } from '@vueuse/core'
5
- import { useColorMode } from '#imports'
6
-
7
- const mode = useColorMode() // Auto imported from @nuxtjs/color-mode
8
- const isDark = computed<boolean>({
9
- get () {
10
- return mode.value === 'dark'
11
- },
12
- set () {
13
- mode.preference = isDark.value ? 'light' : 'dark'
14
- }
15
- })
16
- const toggle = useToggle(isDark)
17
- const context = {
18
- mode,
19
- isDark,
20
- toggle
21
- }
22
- </script>
23
-
24
- <template>
25
- <ColorScheme tag="span">
26
- <slot v-bind="context" />
27
- </ColorScheme>
28
- </template>
package/dist/nuxt.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
-
3
- declare const _default: _nuxt_schema.NuxtModule<{
4
- preset: string;
5
- dev: boolean;
6
- }>;
7
-
8
- declare module '@nuxt/schema' {
9
- interface NuxtConfig {
10
- nui?: {
11
- dev?: boolean;
12
- };
13
- }
14
- }
15
-
16
- export { _default as default };
package/dist/nuxt.mjs DELETED
@@ -1,36 +0,0 @@
1
- import { fileURLToPath } from 'url';
2
- import { defineNuxtModule, addComponentsDir, createResolver, installModule } from '@nuxt/kit';
3
- import defu from 'defu';
4
- import { extendUnocssOptions } from './unocss.mjs';
5
- import '@unocss/preset-mini/utils';
6
- import '@unocss/preset-mini';
7
- import '@unocss/preset-mini/rules';
8
- import 'unocss';
9
-
10
- const rPath = (p) => fileURLToPath(new URL(p, import.meta.url).toString());
11
- const nuxt = defineNuxtModule({
12
- meta: {
13
- name: "nui",
14
- configKey: "nui"
15
- },
16
- defaults: {
17
- preset: rPath("./preset"),
18
- dev: false
19
- },
20
- async setup(options, nuxt) {
21
- addComponentsDir({ path: rPath("./components/nuxt") });
22
- addComponentsDir({ path: rPath("./components") });
23
- nuxt.options.css.unshift(rPath("assets/styles.css"));
24
- if (!options.dev) {
25
- nuxt.options.unocss = extendUnocssOptions(nuxt.options.unocss);
26
- }
27
- nuxt.options.vueuse = nuxt.options.vueuse || {};
28
- nuxt.options.colorMode = defu(nuxt.options.colorMode, { classSuffix: "" });
29
- const resolver = createResolver(import.meta.url);
30
- await installModule(await resolver.resolvePath("@unocss/nuxt"));
31
- await installModule(await resolver.resolvePath("@vueuse/nuxt"));
32
- await installModule(await resolver.resolvePath("@nuxtjs/color-mode"));
33
- }
34
- });
35
-
36
- export { nuxt as default };
package/dist/unocss.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { Preset } from '@unocss/core';
2
- import { UnocssNuxtOptions } from '@unocss/nuxt';
3
-
4
- declare const NuxtUIPreset: () => Preset;
5
- declare function extendUnocssOptions(user?: UnocssNuxtOptions): UnocssNuxtOptions;
6
-
7
- export { NuxtUIPreset, extendUnocssOptions };
package/dist/unocss.mjs DELETED
@@ -1,127 +0,0 @@
1
- import { parseColor } from '@unocss/preset-mini/utils';
2
- import { theme } from '@unocss/preset-mini';
3
- import { fonts } from '@unocss/preset-mini/rules';
4
- import { mergeDeep, presetUno, presetAttributify, presetTypography, presetIcons, transformerDirectives, transformerVariantGroup } from 'unocss';
5
-
6
- const NuxtUIPreset = () => ({
7
- name: "nuxt-ui",
8
- theme: mergeDeep(theme, {
9
- colors: {
10
- context: "rgba(var(--nui-c-context),%alpha)"
11
- },
12
- fontFamily: {
13
- sans: "Avenir, Helvetica, Arial, sans-serif"
14
- }
15
- }),
16
- rules: [
17
- [/^n-(.*)$/, ([, body], { theme }) => {
18
- const color = parseColor(body, theme);
19
- if (color?.cssColor?.type === "rgb" && color.cssColor.components) {
20
- return {
21
- "--nui-c-context": `${color.cssColor.components.join(",")}`
22
- };
23
- }
24
- }],
25
- [/^n-(.*)$/, fonts[1][1]],
26
- ["n-dashed", { "border-style": "dashed" }],
27
- ["n-solid", {
28
- "background-color": "rgba(var(--nui-c-context), 1) !important",
29
- "border-color": "rgba(var(--nui-c-context), 1)",
30
- color: "white !important"
31
- }],
32
- ["n-disabled", {
33
- opacity: 0.4,
34
- "pointer-events": "none",
35
- filter: "saturate(0)"
36
- }]
37
- ],
38
- variants: [
39
- (input) => {
40
- const prefix = "n-disabled:";
41
- if (input.startsWith(prefix)) {
42
- return {
43
- matcher: input.slice(prefix.length),
44
- selector: (input2) => `[disabled] ${input2}, ${input2}[disabled]`
45
- };
46
- }
47
- },
48
- (input) => {
49
- const prefix = "n-checked:";
50
- if (input.startsWith(prefix)) {
51
- return {
52
- matcher: input.slice(prefix.length),
53
- selector: (input2) => `[checked] ${input2}, ${input2}[checked]`
54
- };
55
- }
56
- }
57
- ],
58
- shortcuts: {
59
- // general
60
- "n-bg-base": "bg-white dark:bg-[#222]",
61
- "n-border-base": "border-gray-400/50",
62
- "n-border-300": "border-gray-400/40",
63
- "n-border-200": "border-gray-400/25",
64
- "n-transition": "transition-all duration-200",
65
- "n-focus-base": "ring-2 ring-context/50",
66
- "n-active-base": "ring-3 ring-context/10",
67
- "n-borderless": "!border-none !shadow-none",
68
- // link
69
- "n-link-base": "underline underline-offset-2 underline-black/20 dark:underline-white/40",
70
- "n-link-hover": "decoration-dotted text-context underline-context",
71
- // card
72
- "n-card-base": "border n-border-200 rounded n-bg-base shadow-sm",
73
- // header
74
- "n-header-upper": "text-sm uppercase mb-2 leading-1.2em tracking-wide op50",
75
- // button
76
- "n-button-base": "border n-border-base rounded shadow-sm px-1em py-0.25em inline-flex items-center gap-1 op80 !outline-none touch-manipulation",
77
- "n-button-hover": "op100 !border-context text-context",
78
- "n-button-active": "n-active-base bg-context/5",
79
- "n-button-icon": "-ml-0.2em mr-0.2em text-1.1em",
80
- // checkbox
81
- "n-checkbox-box": "border n-border-base w-1.1em h-1.1em mr-1 text-white flex flex-none items-center rounded-sm overflow-visible",
82
- "n-checkbox-box-checked": "bg-context border-context",
83
- "n-checkbox-icon": "carbon-checkmark",
84
- // radio
85
- "n-radio-box": "border n-border-base w-1.2em h-1.2em mr-1 text-white flex flex-none rounded-full overflow-visible",
86
- "n-radio-box-checked": "border-context",
87
- "n-radio-inner": "bg-context rounded-1/2 w-0 h-0 m-auto",
88
- "n-radio-inner-checked": "w-0.8em h-0.8em",
89
- // switch
90
- "n-switch-base": "inline-flex items-center select-none",
91
- "n-switch-slider": "mr-1 rounded-full border n-border-base relative p-2px",
92
- "n-switch-slider-checked": "border-context/20 bg-context/10",
93
- "n-switch-thumb": "h-1em w-1em rounded-1/2 border n-border-base ml-0 mr-0.8em",
94
- "n-switch-thumb-checked": "bg-context border-context ml-0.8em mr-0",
95
- // tip
96
- "n-tip-base": "bg-context/8 text-context px-1em py-0.4em rounded flex items-center dark:bg-context/12",
97
- "n-tip-icon": "-ml-0.2em mr-0.4em text-1.1em"
98
- }
99
- });
100
- function extendUnocssOptions(user = {}) {
101
- return {
102
- ...user,
103
- preflight: true,
104
- presets: [
105
- presetUno(),
106
- presetAttributify(),
107
- presetTypography(),
108
- presetIcons({
109
- prefix: ["i-", ""],
110
- scale: 1.2,
111
- extraProperties: {
112
- display: "inline-block",
113
- "vertical-align": "middle"
114
- }
115
- // ...(user?.icons || {})
116
- }),
117
- NuxtUIPreset(),
118
- ...user.presets || []
119
- ],
120
- transformers: [
121
- transformerDirectives(),
122
- transformerVariantGroup()
123
- ]
124
- };
125
- }
126
-
127
- export { NuxtUIPreset, extendUnocssOptions };
package/nuxt.cjs DELETED
@@ -1,7 +0,0 @@
1
- // CommonJS proxy to bypass jiti transforms from nuxt 2 and using native ESM
2
- module.exports = function (...args) {
3
- return import('./dist/nuxt.mjs').then(m => m.default.call(this, ...args))
4
- }
5
-
6
- // eslint-disable-next-line
7
- module.exports.meta = require('./package.json')