@nuxt/devtools-ui-kit-nightly 2.0.0-28980754.13f6fd0

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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +129 -0
  3. package/dist/assets/styles.css +1 -0
  4. package/dist/components/NBadge.vue +5 -0
  5. package/dist/components/NButton.vue +34 -0
  6. package/dist/components/NCard.vue +5 -0
  7. package/dist/components/NCheckbox.vue +36 -0
  8. package/dist/components/NCodeBlock.vue +50 -0
  9. package/dist/components/NDarkToggle.vue +77 -0
  10. package/dist/components/NDialog.vue +80 -0
  11. package/dist/components/NDrawer.vue +77 -0
  12. package/dist/components/NDropdown.vue +36 -0
  13. package/dist/components/NIcon.vue +9 -0
  14. package/dist/components/NIconTitle.vue +15 -0
  15. package/dist/components/NLink.vue +29 -0
  16. package/dist/components/NLoading.vue +10 -0
  17. package/dist/components/NMarkdown.vue +19 -0
  18. package/dist/components/NNavbar.vue +34 -0
  19. package/dist/components/NNotification.vue +48 -0
  20. package/dist/components/NPanelGrids.vue +5 -0
  21. package/dist/components/NRadio.vue +40 -0
  22. package/dist/components/NSectionBlock.vue +77 -0
  23. package/dist/components/NSelect.vue +37 -0
  24. package/dist/components/NSelectTabs.vue +49 -0
  25. package/dist/components/NSplitPane.vue +47 -0
  26. package/dist/components/NSwitch.vue +34 -0
  27. package/dist/components/NTextInput.vue +40 -0
  28. package/dist/components/NTip.vue +16 -0
  29. package/dist/composables/notification.d.ts +9 -0
  30. package/dist/composables/notification.mjs +7 -0
  31. package/dist/module.cjs +5 -0
  32. package/dist/module.d.mts +12 -0
  33. package/dist/module.d.ts +12 -0
  34. package/dist/module.json +9 -0
  35. package/dist/module.mjs +38 -0
  36. package/dist/runtime/client.d.ts +1 -0
  37. package/dist/runtime/client.js +2 -0
  38. package/dist/runtime/client.mjs +2 -0
  39. package/dist/types.d.mts +1 -0
  40. package/dist/types.d.ts +1 -0
  41. package/dist/unocss.d.mts +7 -0
  42. package/dist/unocss.d.ts +7 -0
  43. package/dist/unocss.mjs +168 -0
  44. package/module.cjs +6 -0
  45. package/package.json +68 -0
@@ -0,0 +1,34 @@
1
+ <script setup lang="ts">
2
+ defineProps<{
3
+ search?: string
4
+ noPadding?: boolean
5
+ }>()
6
+
7
+ const emit = defineEmits<{
8
+ (event: 'update:search', value: string): void
9
+ }>()
10
+
11
+ function update(event: any) {
12
+ emit('update:search', event.target.value)
13
+ }
14
+ </script>
15
+
16
+ <template>
17
+ <div flex="~ col gap2 wrap" border="b base" flex-1 n-navbar-glass :class="[{ p4: !noPadding }]">
18
+ <div flex="~ gap4 wrap" items-center>
19
+ <slot name="search">
20
+ <NTextInput
21
+ v-if="search !== undefined"
22
+ placeholder="Search..."
23
+ icon="carbon-search"
24
+ n="primary" flex-auto
25
+ :class="{ 'px-3 py-2': !noPadding }"
26
+ :value="search"
27
+ @input="update"
28
+ />
29
+ </slot>
30
+ <slot name="actions" />
31
+ </div>
32
+ <slot />
33
+ </div>
34
+ </template>
@@ -0,0 +1,48 @@
1
+ <script setup lang='ts'>
2
+ import type { DevtoolsUiShowNotificationPosition } from '../composables/notification'
3
+
4
+ import { ref } from 'vue'
5
+ import { devtoolsUiProvideNotificationFn } from '../composables/notification'
6
+
7
+ const show = ref(false)
8
+ const icon = ref<string>()
9
+ const text = ref<string>()
10
+ const classes = ref<string>()
11
+ const position = ref<DevtoolsUiShowNotificationPosition>('top-center')
12
+
13
+ devtoolsUiProvideNotificationFn((data) => {
14
+ text.value = data.message
15
+ icon.value = data.icon
16
+ classes.value = data.classes ?? 'text-primary border-primary'
17
+ icon.value = data.icon
18
+ show.value = true
19
+ position.value = data.position ?? 'top-center'
20
+ setTimeout(() => {
21
+ show.value = false
22
+ }, data.duration ?? 1500)
23
+ })
24
+ </script>
25
+
26
+ <template>
27
+ <div
28
+ fixed left-0 right-0 z-999 text-center
29
+ :class="[
30
+ { 'pointer-events-none overflow-hidden': !show },
31
+ { 'top-0': position.startsWith('top') },
32
+ { 'bottom-0': position.startsWith('bottom') },
33
+ ]"
34
+ >
35
+ <div flex :style="{ justifyContent: position.includes('right') ? 'right' : position.includes('left') ? 'left' : 'center' }">
36
+ <div
37
+ border="~ base"
38
+ flex="~ inline gap2"
39
+ m-3 inline-block items-center rounded px-4 py-1 transition-all duration-300 bg-base
40
+ :style="show ? {} : { transform: `translateY(${position.startsWith('top') ? '-' : ''}300%)` }"
41
+ :class="[show ? 'shadow' : 'shadow-none', classes]"
42
+ >
43
+ <div v-if="icon" :class="icon" />
44
+ <div>{{ text }}</div>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="n-panel-grids-center">
3
+ <slot />
4
+ </div>
5
+ </template>
@@ -0,0 +1,40 @@
1
+ <script setup lang="ts">
2
+ import { useVModel } from '@vueuse/core'
3
+
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: string
7
+ disabled?: boolean
8
+ name?: string
9
+ value?: string
10
+ }>(),
11
+ {
12
+ modelValue: '',
13
+ disabled: false,
14
+ },
15
+ )
16
+ const emit = defineEmits<{ (...args: any): void }>()
17
+ const model = useVModel(props, 'modelValue', emit, { passive: true })
18
+ </script>
19
+
20
+ <template>
21
+ <label
22
+ class="n-radio inline-flex hover:n-radio-hover select-none items-center n-disabled:n-disabled"
23
+ :checked="model === value || null"
24
+ :disabled="disabled || null"
25
+ >
26
+ <input
27
+ v-model="model"
28
+ type="radio"
29
+ class="peer absolute op0"
30
+ :disabled="disabled"
31
+ :name="name"
32
+ :value="value"
33
+ @keypress.enter="model = value!"
34
+ >
35
+ <span class="n-radio-box n-checked:n-radio-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base n-transition">
36
+ <div class="n-radio-inner n-checked:n-radio-inner-checked n-transition" />
37
+ </span>
38
+ <span><slot /></span>
39
+ </label>
40
+ </template>
@@ -0,0 +1,77 @@
1
+ <script setup lang="ts">
2
+ import { useVModel } from '@vueuse/core'
3
+
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ icon?: string
7
+ text?: string
8
+ description?: string
9
+ containerClass?: string
10
+ headerClass?: string
11
+ collapse?: boolean
12
+ open?: boolean
13
+ padding?: boolean | string
14
+ }>(),
15
+ {
16
+ containerClass: '',
17
+ open: true,
18
+ padding: true,
19
+ collapse: true,
20
+ },
21
+ )
22
+
23
+ const open = useVModel(props, 'open', undefined, { passive: true })
24
+ function onToggle(e: any) {
25
+ open.value = e.target.open
26
+ }
27
+ </script>
28
+
29
+ <template>
30
+ <!-- TODO: Seems something wrong with the DOM type -->
31
+ <!-- @vue-ignore -->
32
+ <details :open="open" @toggle="(onToggle as any)">
33
+ <summary
34
+ class="cursor-pointer select-none hover:bg-active p4"
35
+ :class="collapse ? '' : 'pointer-events-none'"
36
+ >
37
+ <NIconTitle :icon="icon" :text="text" text-xl transition :class="[open ? 'op100' : 'op60', headerClass]">
38
+ <div>
39
+ <div text-base>
40
+ <slot name="text">
41
+ {{ text }}
42
+ </slot>
43
+ </div>
44
+ <div v-if="description || $slots.description" text-sm op50>
45
+ <slot name="description">
46
+ {{ description }}
47
+ </slot>
48
+ </div>
49
+ </div>
50
+ <div class="flex-auto" />
51
+ <slot name="actions" />
52
+ <NIcon
53
+ v-if="collapse"
54
+ icon="carbon-chevron-down"
55
+ class="chevron"
56
+ cursor-pointer place-self-start text-base op75 transition duration-500
57
+ />
58
+ </NIconTitle>
59
+ </summary>
60
+ <div
61
+ v-lazy-show="open"
62
+ class="flex flex-col flex-gap2 pb6 pt2"
63
+ :class="typeof padding === 'string' ? padding : padding ? 'px4' : ''"
64
+ >
65
+ <slot name="details" />
66
+ <div :class="containerClass" class="mt1">
67
+ <slot />
68
+ </div>
69
+ <slot name="footer" />
70
+ </div>
71
+ </details>
72
+ <div class="x-divider" />
73
+ </template>
74
+
75
+ <style scoped>
76
+ details,summary{--at-apply:border-none}summary{list-style:none}details[open] summary{--at-apply:border-none}details summary::-webkit-details-marker{display:none}details[open] .chevron{opacity:.75;transform:rotate(180deg)}
77
+ </style>
@@ -0,0 +1,37 @@
1
+ <script setup lang="ts">
2
+ import { useVModel } from '@vueuse/core'
3
+
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: any
7
+ placeholder?: string
8
+ icon?: string
9
+ disabled?: boolean
10
+ }>(),
11
+ {
12
+ modelValue: undefined,
13
+ placeholder: '',
14
+ disabled: false,
15
+ icon: '',
16
+ },
17
+ )
18
+ const emit = defineEmits<{ (...args: any): void }>()
19
+ const input = useVModel(props, 'modelValue', emit, { passive: true })
20
+ </script>
21
+
22
+ <template>
23
+ <div
24
+ class="n-select flex flex items-center border rounded px-2 py-1 focus-within:n-focus-base focus-within:border-context n-bg-base"
25
+ :class="disabled ? 'border-gray:10' : 'n-border-base'"
26
+ >
27
+ <slot name="icon">
28
+ <NIcon v-if="icon" :icon="icon" class="mr-0.4em text-1.1em op50" />
29
+ </slot>
30
+ <select v-model="input" :disabled="disabled" class="w-full flex-auto n-bg-base !outline-none" :class="disabled ? 'appearance-none' : ''">
31
+ <option v-if="placeholder" value="" disabled hidden>
32
+ {{ placeholder }}
33
+ </option>
34
+ <slot />
35
+ </select>
36
+ </div>
37
+ </template>
@@ -0,0 +1,49 @@
1
+ <script setup lang="ts">
2
+ import { useVModel } from '@vueuse/core'
3
+
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: any
7
+ disabled?: boolean
8
+ options: { value: any, label: string }[]
9
+ }>(),
10
+ {
11
+ modelValue: undefined,
12
+ disabled: false,
13
+ },
14
+ )
15
+ const emit = defineEmits<{ (...args: any): void }>()
16
+ const input = useVModel(props, 'modelValue', emit, { passive: true })
17
+ </script>
18
+
19
+ <template>
20
+ <fieldset
21
+ class="n-select-tabs flex flex-inline flex-wrap items-center border n-border-base rounded n-bg-base"
22
+ >
23
+ <label
24
+ v-for="i, idx of options"
25
+ :key="i.label"
26
+ :disabled="disabled"
27
+ class="relative n-border-base hover:n-bg-active px-0.5em py-0.1em"
28
+ :class="[
29
+ idx ? 'border-l n-border-base ml--1px' : '',
30
+ i.value === input ? 'n-bg-active' : '',
31
+ ]"
32
+ :title="i.label"
33
+ >
34
+ <div
35
+ :class="[
36
+ i.value === input ? '' : 'op35',
37
+ ]"
38
+ >{{ i.label }}</div>
39
+ <input
40
+ v-model="input"
41
+ type="radio"
42
+ :disabled="disabled"
43
+ :value="i.value"
44
+ :title="i.label"
45
+ class="absolute inset-0 op-0.1"
46
+ >
47
+ </label>
48
+ </fieldset>
49
+ </template>
@@ -0,0 +1,47 @@
1
+ <script setup lang="ts">
2
+ import { useLocalStorage } from '@vueuse/core'
3
+ import { Pane, Splitpanes } from 'splitpanes'
4
+ import { computed, ref } from 'vue'
5
+
6
+ import 'splitpanes/dist/splitpanes.css'
7
+
8
+ const props = withDefaults(defineProps<{
9
+ /**
10
+ * The key to use for storing the pane sizes in localStorage.
11
+ */
12
+ storageKey?: string
13
+ stateKey?: string
14
+ leftSize?: number
15
+ minSize?: number
16
+ horizontal?: boolean
17
+ }>(), {
18
+ stateKey: 'nuxt-devtools-panels-state',
19
+ })
20
+
21
+ const state = useLocalStorage<Record<string, number>>(props.stateKey, {} as any, { listenToStorageChanges: false })
22
+
23
+ const DEFAULT = 30
24
+
25
+ const key = props.storageKey
26
+ const size = key
27
+ ? computed({
28
+ get: () => state.value[key] || props.leftSize || DEFAULT,
29
+ set: (v) => { state.value[key] = v },
30
+ })
31
+ : ref(props.leftSize || DEFAULT)
32
+ </script>
33
+
34
+ <template>
35
+ <Splitpanes :horizontal="horizontal" h-full of-hidden @resize="size = $event[0].size">
36
+ <Pane h-full class="of-auto!" :size="size" :min-size="$slots.right ? (minSize || 10) : 100">
37
+ <slot name="left" />
38
+ </Pane>
39
+ <Pane v-if="$slots.right" relative h-full class="of-auto!" :min-size="minSize || 10">
40
+ <slot name="right" />
41
+ </Pane>
42
+ </Splitpanes>
43
+ </template>
44
+
45
+ <style>
46
+ .splitpanes__splitter{position:relative}.splitpanes__splitter:before{content:"";left:0;position:absolute;top:0;transition:.2s ease;transition:opacity .4s;z-index:1}.splitpanes__splitter:hover:before{background:#8881;opacity:1}.splitpanes--vertical>.splitpanes__splitter{min-width:0!important;width:0!important;--at-apply:border-r border-base}.splitpanes--horizontal>.splitpanes__splitter{height:0!important;min-height:0!important;--at-apply:border-t border-base}.splitpanes--vertical>.splitpanes__splitter:before{height:100%;left:-5px;right:-4px}.splitpanes--horizontal>.splitpanes__splitter:before{bottom:-4px;top:-5px;width:100%}
47
+ </style>
@@ -0,0 +1,34 @@
1
+ <script setup lang="ts">
2
+ withDefaults(
3
+ defineProps<{
4
+ disabled?: boolean
5
+ }>(),
6
+ {
7
+ disabled: false,
8
+ },
9
+ )
10
+ const checked = defineModel('modelValue', {
11
+ type: Boolean,
12
+ default: false,
13
+ })
14
+ </script>
15
+
16
+ <template>
17
+ <label
18
+ class="n-switch n-switch-base hover:n-switch-hover n-disabled:n-disabled"
19
+ :checked="checked || null"
20
+ :disabled="disabled || null"
21
+ >
22
+ <input
23
+ v-model="checked"
24
+ type="checkbox"
25
+ class="peer absolute op0"
26
+ :disabled="disabled"
27
+ @keypress.enter="checked = !checked"
28
+ >
29
+ <div class="n-switch-slider n-checked:n-switch-slider-checked peer-active:n-active-base peer-focus-visible:n-focus-base n-transition">
30
+ <div class="n-checked:n-switch-thumb-checked n-switch-thumb n-transition" />
31
+ </div>
32
+ <slot />
33
+ </label>
34
+ </template>
@@ -0,0 +1,40 @@
1
+ <script setup lang="ts">
2
+ import { useVModel } from '@vueuse/core'
3
+
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: string | number
7
+ icon?: string
8
+ placeholder?: string
9
+ disabled?: boolean
10
+ autofocus?: boolean
11
+ autocomplete?: string
12
+ readonly?: boolean
13
+ type?: string
14
+ }>(),
15
+ {
16
+ modelValue: '',
17
+ type: 'text',
18
+ },
19
+ )
20
+
21
+ const emit = defineEmits<{
22
+ (name: 'keydown', event: KeyboardEvent): void
23
+ (name: 'keyup', event: KeyboardEvent): void
24
+ (name: 'change', event: Event): void
25
+ }>()
26
+ const input = useVModel(props, 'modelValue', emit, { passive: true })
27
+ </script>
28
+
29
+ <template>
30
+ <div class="n-text-input flex flex items-center border n-border-base rounded py-1 pl-1 pr-2 focus-within:n-focus-base focus-within:border-context n-bg-base">
31
+ <slot name="icon">
32
+ <NIcon v-if="icon" :icon="icon" class="ml-0.3em mr-0.1em text-1.1em op50" />
33
+ </slot>
34
+ <input
35
+ v-model="input"
36
+ v-bind="$props as any"
37
+ class="ml-0.4em w-full flex-auto n-bg-base !outline-none"
38
+ >
39
+ </div>
40
+ </template>
@@ -0,0 +1,16 @@
1
+ <script setup lang="ts">
2
+ defineProps<{
3
+ icon?: string
4
+ }>()
5
+ </script>
6
+
7
+ <template>
8
+ <div class="n-tip n-tip-base">
9
+ <slot name="icon">
10
+ <NIcon v-if="icon" :icon="icon" class="n-tip-icon" />
11
+ </slot>
12
+ <div>
13
+ <slot />
14
+ </div>
15
+ </div>
16
+ </template>
@@ -0,0 +1,9 @@
1
+ export type DevtoolsUiShowNotificationPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
2
+ export declare function devtoolsUiShowNotification(data: {
3
+ message: string;
4
+ icon?: string;
5
+ classes?: string;
6
+ duration?: number;
7
+ position?: DevtoolsUiShowNotificationPosition;
8
+ }): void;
9
+ export declare function devtoolsUiProvideNotificationFn(fn: typeof devtoolsUiShowNotification): void;
@@ -0,0 +1,7 @@
1
+ let _devtoolsUiShowNotification;
2
+ export function devtoolsUiShowNotification(data) {
3
+ _devtoolsUiShowNotification?.(data);
4
+ }
5
+ export function devtoolsUiProvideNotificationFn(fn) {
6
+ _devtoolsUiShowNotification = fn;
7
+ }
@@ -0,0 +1,5 @@
1
+ module.exports = function(...args) {
2
+ return import('./module.mjs').then(m => m.default.call(this, ...args))
3
+ }
4
+ const _meta = module.exports.meta = require('./module.json')
5
+ module.exports.getMeta = () => Promise.resolve(_meta)
@@ -0,0 +1,12 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ export { unocssPreset } from './unocss.mjs';
3
+ import '@unocss/core';
4
+ import '@unocss/nuxt';
5
+
6
+ interface ModuleOptions {
7
+ dev?: boolean;
8
+ preset?: string;
9
+ }
10
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
11
+
12
+ export { type ModuleOptions, _default as default };
@@ -0,0 +1,12 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ export { unocssPreset } from './unocss.js';
3
+ import '@unocss/core';
4
+ import '@unocss/nuxt';
5
+
6
+ interface ModuleOptions {
7
+ dev?: boolean;
8
+ preset?: string;
9
+ }
10
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
11
+
12
+ export { type ModuleOptions, _default as default };
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "devtools-ui-kit",
3
+ "configKey": "devtoolsUIKit",
4
+ "version": "2.0.0-28980754.13f6fd0",
5
+ "builder": {
6
+ "@nuxt/module-builder": "0.8.4",
7
+ "unbuild": "3.3.1"
8
+ }
9
+ }
@@ -0,0 +1,38 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { defineNuxtModule, addImportsDir, addComponentsDir, createResolver, installModule } from '@nuxt/kit';
3
+ import defu from 'defu';
4
+ import { extendUnocssOptions } from './unocss.mjs';
5
+ export { unocssPreset } from './unocss.mjs';
6
+ import '@unocss/preset-mini';
7
+ import '@unocss/preset-mini/rules';
8
+ import '@unocss/preset-mini/utils';
9
+ import 'unocss';
10
+
11
+ function rPath(p) {
12
+ return fileURLToPath(new URL(p, import.meta.url).toString());
13
+ }
14
+ const module = defineNuxtModule({
15
+ meta: {
16
+ name: "devtools-ui-kit",
17
+ configKey: "devtoolsUIKit"
18
+ },
19
+ defaults: {
20
+ preset: rPath("./preset"),
21
+ dev: false
22
+ },
23
+ async setup(options, nuxt) {
24
+ addImportsDir(rPath("./composables"));
25
+ addComponentsDir({ path: rPath("./components") });
26
+ nuxt.options.css.unshift(rPath("assets/styles.css"));
27
+ if (!options.dev)
28
+ nuxt.options.unocss = extendUnocssOptions(nuxt.options.unocss);
29
+ nuxt.options.vueuse = nuxt.options.vueuse || {};
30
+ nuxt.options.colorMode = defu(nuxt.options.colorMode, { classSuffix: "" });
31
+ const resolver = createResolver(import.meta.url);
32
+ await installModule(await resolver.resolvePath("@unocss/nuxt"));
33
+ await installModule(await resolver.resolvePath("@vueuse/nuxt"));
34
+ await installModule(await resolver.resolvePath("v-lazy-show/nuxt"));
35
+ }
36
+ });
37
+
38
+ export { module as default };
@@ -0,0 +1 @@
1
+ export declare const devToolsClient: import("vue").Ref<any, any>;
@@ -0,0 +1,2 @@
1
+ import { useDevtoolsClient } from "@nuxt/devtools-kit/iframe-client";
2
+ export const devToolsClient = useDevtoolsClient();
@@ -0,0 +1,2 @@
1
+ import { useDevtoolsClient } from "@nuxt/devtools-kit/iframe-client";
2
+ export const devToolsClient = useDevtoolsClient();
@@ -0,0 +1 @@
1
+ export { type unocssPreset } from './module.js'
@@ -0,0 +1 @@
1
+ export { type unocssPreset } from './module'
@@ -0,0 +1,7 @@
1
+ import { Preset } from '@unocss/core';
2
+ import { UnocssNuxtOptions } from '@unocss/nuxt';
3
+
4
+ declare function unocssPreset(): Preset;
5
+ declare function extendUnocssOptions(user?: UnocssNuxtOptions): UnocssNuxtOptions;
6
+
7
+ export { extendUnocssOptions, unocssPreset };
@@ -0,0 +1,7 @@
1
+ import { Preset } from '@unocss/core';
2
+ import { UnocssNuxtOptions } from '@unocss/nuxt';
3
+
4
+ declare function unocssPreset(): Preset;
5
+ declare function extendUnocssOptions(user?: UnocssNuxtOptions): UnocssNuxtOptions;
6
+
7
+ export { extendUnocssOptions, unocssPreset };