@nuxt/devtools-ui-kit 0.3.2 → 0.4.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.
@@ -11,4 +11,3 @@ html.dark {
11
11
  background-color: #151515;
12
12
  color: white;
13
13
  }
14
-
@@ -14,7 +14,7 @@ defineProps<{
14
14
  :is="to ? NuxtLink : 'button'"
15
15
  :to="to"
16
16
  v-bind="$attrs"
17
- class="n-transition n-button n-button-base hover:n-button-hover active:n-button-active focus-visible:n-focus-base n-disabled:n-disabled"
17
+ class="n-button n-button-base active:n-button-active focus-visible:n-focus-base n-transition hover:n-button-hover n-disabled:n-disabled"
18
18
  >
19
19
  <slot name="icon">
20
20
  <NIcon v-if="icon" :icon="icon" class="n-button-icon" />
@@ -16,19 +16,19 @@ const checked = useVModel(props, 'modelValue', emit, { passive: true })
16
16
 
17
17
  <template>
18
18
  <label
19
- class="items-center select-none n-disabled:n-disabled n-checkbox hover:n-checkbox-hover"
19
+ class="hover:n-checkbox-hover n-checkbox select-none items-center n-disabled:n-disabled"
20
20
  :checked="checked || null"
21
21
  :disabled="disabled || null"
22
22
  >
23
23
  <input
24
24
  v-model="checked"
25
25
  type="checkbox"
26
- class="absolute op0 peer"
26
+ class="peer absolute op0"
27
27
  :disabled="disabled"
28
28
  @keypress.enter="checked = !checked"
29
29
  >
30
- <span class="n-transition n-checkbox-box n-checked:n-checkbox-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base">
31
- <NIcon class="n-transition op0 n-checkbox-icon transform scale-0 n-checked:op100 n-checked:scale-100" />
30
+ <span class="n-checkbox-box n-checked:n-checkbox-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base n-transition">
31
+ <NIcon class="n-checkbox-icon scale-0 transform op0 n-transition n-checked:scale-100 n-checked:op100" />
32
32
  </span>
33
33
  <span :class="checked ? '' : 'op50'" class="n-transition"><slot /></span>
34
34
  </label>
@@ -27,8 +27,7 @@ const rendered = computed(() => devToolsClient.value?.devtools.renderCodeHighlig
27
27
  <pre
28
28
  class="n-code-block"
29
29
  :class="lines ? 'n-code-block-lines' : ''"
30
- v-text="code"
31
- />
30
+ ><pre class="shiki"><code><template v-for="line, _idx in code.split('\n')" :key="_idx"><span class="line" v-text="line" /><br></template></code></pre></pre>
32
31
  </template>
33
32
  </template>
34
33
 
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
  import { useToggle } from '@vueuse/core'
4
+
4
5
  // @ts-expect-error auto imported from @nuxtjs/color-mode
5
6
  import { useColorMode } from '#imports'
6
7
 
@@ -47,13 +47,13 @@ export default {
47
47
  <template>
48
48
  <Teleport v-if="show" to="body">
49
49
  <div
50
- class="n-transition fixed flex items-center justify-center z-100 n-dialog inset-0"
50
+ class="n-dialog fixed inset-0 z-100 flex items-center justify-center n-transition"
51
51
  :class="[
52
52
  show ? '' : 'op0 pointer-events-none visibility-none',
53
53
  ]"
54
54
  >
55
55
  <div
56
- class="inset-0 absolute -z-1"
56
+ class="absolute inset-0 -z-1"
57
57
  :class="[
58
58
  dim ? 'bg-black/50' : '',
59
59
  ]"
@@ -22,7 +22,7 @@ onClickOutside(el, () => {
22
22
  </slot>
23
23
 
24
24
  <div
25
- class="absolute n-transition n-bg-base rounded border z-10 n-border-base shadow"
25
+ class="absolute z-10 border n-border-base rounded shadow n-transition n-bg-base"
26
26
  :class="[enabled ? 'op-100' : 'op0 pointer-events-none -translate-y-1']"
27
27
  >
28
28
  <slot />
@@ -6,7 +6,7 @@ defineProps<{
6
6
  </script>
7
7
 
8
8
  <template>
9
- <div class="items-center flex flex-gap2">
9
+ <div flex="~ gap-3" items-center>
10
10
  <div v-if="icon" :class="icon" />
11
11
  <slot>
12
12
  <div>{{ text }}</div>
@@ -14,7 +14,7 @@ defineProps<{
14
14
  <Component
15
15
  :is="(href || target) ? 'a' : NuxtLink"
16
16
  v-bind="$props"
17
- class="n-transition n-link n-link-base hover:n-link-hover"
17
+ class="n-link hover:n-link-hover n-transition n-link-base"
18
18
  >
19
19
  <slot />
20
20
  </Component>
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <div class="n-loading">
3
- <div class="flex flex-col items-center text-lg animate-pulse">
4
- <div class="text-4xl op50 i-carbon-circle-dash animate-spin" />
2
+ <div class="n-loading n-panel-grids-center">
3
+ <div class="flex flex-col animate-pulse items-center text-lg">
4
+ <div class="i-carbon-circle-dash animate-spin text-4xl op50" />
5
5
  <slot>
6
6
  Loading...
7
7
  </slot>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="n-panel-grids-center">
3
+ <slot />
4
+ </div>
5
+ </template>
@@ -19,21 +19,21 @@ const model = useVModel(props, 'modelValue', emit, { passive: true })
19
19
 
20
20
  <template>
21
21
  <label
22
- class="n-disabled:n-disabled items-center select-none inline-flex n-radio hover:n-radio-hover"
22
+ class="n-radio hover:n-radio-hover inline-flex select-none items-center n-disabled:n-disabled"
23
23
  :checked="model === value || null"
24
24
  :disabled="disabled || null"
25
25
  >
26
26
  <input
27
27
  v-model="model"
28
28
  type="radio"
29
- class="absolute op0 peer"
29
+ class="peer absolute op0"
30
30
  :disabled="disabled"
31
31
  :name="name"
32
32
  :value="value"
33
33
  @keypress.enter="model = value!"
34
34
  >
35
- <span class="n-transition peer-active:n-active-base peer-focus-visible:n-focus-base n-radio-box n-checked:n-radio-box-checked">
36
- <div class="n-transition n-radio-inner n-checked:n-radio-inner-checked" />
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
37
  </span>
38
38
  <span><slot /></span>
39
39
  </label>
@@ -26,13 +26,15 @@ function onToggle(e: any) {
26
26
 
27
27
  <template>
28
28
  <details :open="open" @toggle="onToggle">
29
- <summary class="select-none cursor-pointer p4 hover:bg-active" :class="collapse ? '' : 'pointer-events-none'">
30
- <NIconTitle :icon="icon" :text="text" class="text-xl op75">
29
+ <summary class="cursor-pointer select-none hover:bg-active p4" :class="collapse ? '' : 'pointer-events-none'">
30
+ <NIconTitle :icon="icon" :text="text" text-xl transition :class="open ? 'op100' : 'op60'">
31
31
  <div>
32
- <slot name="text">
33
- {{ text }}
34
- </slot>
35
- <div v-if="description || $slots.description" class="op50 text-sm">
32
+ <div text-base>
33
+ <slot name="text">
34
+ {{ text }}
35
+ </slot>
36
+ </div>
37
+ <div v-if="description || $slots.description" text-sm op50>
36
38
  <slot name="description">
37
39
  {{ description }}
38
40
  </slot>
@@ -43,11 +45,16 @@ function onToggle(e: any) {
43
45
  <NIcon
44
46
  v-if="collapse"
45
47
  icon="carbon-chevron-down"
46
- class="op50 cursor-pointer text-base transition duration-500 place-self-start chevron"
48
+ class="chevron"
49
+ cursor-pointer place-self-start text-base op75 transition duration-500
47
50
  />
48
51
  </NIconTitle>
49
52
  </summary>
50
- <div v-lazy-if="open" class="flex flex-col flex-gap2 pt2 pb6" :class="typeof padding === 'string' ? padding : padding ? 'px8' : ''">
53
+ <div
54
+ v-lazy-show="open"
55
+ class="flex flex-col flex-gap2 pb6 pt2"
56
+ :class="typeof padding === 'string' ? padding : padding ? 'px4' : ''"
57
+ >
51
58
  <slot name="details" />
52
59
  <div :class="containerClass" class="mt1">
53
60
  <slot />
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { useVModel } from '@vueuse/core'
3
+
3
4
  const props = withDefaults(
4
5
  defineProps<{
5
6
  modelValue?: any
@@ -20,12 +21,12 @@ const input = useVModel(props, 'modelValue', emit, { passive: true })
20
21
 
21
22
  <template>
22
23
  <div
23
- class="flex items-center flex n-bg-base rounded py-1 border n-border-base px-2 n-text-input focus-within:n-focus-base focus-within:border-context"
24
+ class="n-text-input flex flex items-center border n-border-base rounded px-2 py-1 focus-within:n-focus-base focus-within:border-context n-bg-base"
24
25
  >
25
26
  <slot name="icon">
26
- <NIcon v-if="icon" :icon="icon" class="op50 mr-0.4em text-1.1em" />
27
+ <NIcon v-if="icon" :icon="icon" class="mr-0.4em text-1.1em op50" />
27
28
  </slot>
28
- <select v-model="input" :disabled="disabled" class="n-bg-base flex-auto w-full !outline-none">
29
+ <select v-model="input" :disabled="disabled" class="w-full flex-auto n-bg-base !outline-none">
29
30
  <option v-if="placeholder" value="" disabled hidden>
30
31
  {{ placeholder }}
31
32
  </option>
@@ -16,19 +16,19 @@ const checked = useVModel(props, 'modelValue', emit, { passive: true })
16
16
 
17
17
  <template>
18
18
  <label
19
- class="n-disabled:n-disabled n-switch n-switch-base"
19
+ class="n-switch n-switch-base n-disabled:n-disabled"
20
20
  :checked="checked || null"
21
21
  :disabled="disabled || null"
22
22
  >
23
23
  <input
24
24
  v-model="checked"
25
25
  type="checkbox"
26
- class="absolute op0 peer"
26
+ class="peer absolute op0"
27
27
  :disabled="disabled"
28
28
  @keypress.enter="checked = !checked"
29
29
  >
30
- <div class="n-transition peer-active:n-active-base peer-focus-visible:n-focus-base n-switch-slider n-checked:n-switch-slider-checked">
31
- <div class="n-transition n-switch-thumb n-checked:n-switch-thumb-checked" />
30
+ <div class="n-switch-slider n-checked:n-switch-slider-checked peer-active:n-active-base peer-focus-visible:n-focus-base n-transition">
31
+ <div class="n-checked:n-switch-thumb-checked n-switch-thumb n-transition" />
32
32
  </div>
33
33
  <slot />
34
34
  </label>
@@ -4,14 +4,13 @@ import { useVModel } from '@vueuse/core'
4
4
  const props = withDefaults(
5
5
  defineProps<{
6
6
  modelValue?: string | number
7
- placeholder?: string
8
7
  icon?: string
8
+ placeholder?: string
9
9
  disabled?: boolean
10
10
  type?: string
11
11
  }>(),
12
12
  {
13
13
  modelValue: '',
14
- disabled: false,
15
14
  type: 'text',
16
15
  },
17
16
  )
@@ -20,16 +19,14 @@ const input = useVModel(props, 'modelValue', emit, { passive: true })
20
19
  </script>
21
20
 
22
21
  <template>
23
- <div class="n-bg-base rounded py-1 border n-border-base flex items-center flex n-text-input focus-within:n-focus-base focus-within:border-context px-2">
22
+ <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">
24
23
  <slot name="icon">
25
- <NIcon v-if="icon" :icon="icon" class="op50 mr-0.4em text-1.1em" />
24
+ <NIcon v-if="icon" :icon="icon" class="ml-0.3em mr-0.1em text-1.1em op50" />
26
25
  </slot>
27
26
  <input
28
27
  v-model="input"
29
- class="flex-auto n-bg-base w-full !outline-none"
30
- :type="type"
31
- :disabled="disabled"
32
- :placeholder="placeholder"
28
+ v-bind="$props"
29
+ class="ml-0.4em w-full flex-auto n-bg-base !outline-none"
33
30
  >
34
31
  </div>
35
32
  </template>
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "devtools-ui-kit",
3
3
  "configKey": "devtoolsUIKit",
4
- "version": "0.3.2"
4
+ "version": "0.4.1"
5
5
  }
@@ -1 +1 @@
1
- export declare const devToolsClient: import("vue").Ref<import("@nuxt/devtools-kit/dist/client-api-30cc2320").c | undefined>;
1
+ export declare const devToolsClient: import("vue").Ref<import("@nuxt/devtools-kit/dist/client-api-65bbbf73").c | undefined>;
package/dist/unocss.mjs CHANGED
@@ -34,6 +34,21 @@ function unocssPreset() {
34
34
  "opacity": 0.4,
35
35
  "pointer-events": "none",
36
36
  "filter": "saturate(0)"
37
+ }],
38
+ /**
39
+ * Credit to Nanda Syahrasyad (https://github.com/narendrasss)
40
+ *
41
+ * - https://github.com/narendrasss/NotANumber
42
+ * - https://www.nan.fyi/grid.svg
43
+ * - https://www.nan.fyi/grid-dark.svg
44
+ */
45
+ ["n-panel-grids-light", {
46
+ "background-image": `url("data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' transform='scale(3)'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cpath d='M 10,-2.55e-7 V 20 Z M -1.1677362e-8,10 H 20 Z' stroke-width='0.2' stroke='hsla(0, 0%25, 98%25, 1)' fill='none'/%3E%3C/svg%3E")`,
47
+ "background-size": "40px 40px"
48
+ }],
49
+ ["n-panel-grids-dark", {
50
+ "background-image": `url("data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' transform='scale(3)'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='hsl(0, 0%25, 8.5%25)'/%3E%3Cpath d='M 10,-2.55e-7 V 20 Z M -1.1677362e-8,10 H 20 Z' stroke-width='0.2' stroke='hsl(0, 0%25, 11.0%25)' fill='none'/%3E%3C/svg%3E");`,
51
+ "background-size": "40px 40px"
37
52
  }]
38
53
  ],
39
54
  variants: [
@@ -65,7 +80,7 @@ function unocssPreset() {
65
80
  "n-transition": "transition-all duration-200",
66
81
  "n-focus-base": "ring-2 ring-context/50",
67
82
  "n-active-base": "ring-3 ring-context/10",
68
- "n-borderless": "!border-none !shadow-none",
83
+ "n-borderless": "!border-transparent !shadow-none",
69
84
  // link
70
85
  "n-link-base": "underline underline-offset-2 underline-black/20 dark:underline-white/40",
71
86
  "n-link-hover": "decoration-dotted text-context underline-context",
@@ -103,7 +118,9 @@ function unocssPreset() {
103
118
  // icon-button
104
119
  "n-icon-button": "aspect-1/1 w-1.6em h-1.6em flex items-center justify-center rounded op50 hover:op100 hover:n-bg-active",
105
120
  // loading
106
- "n-loading": "flex h-full w-full justify-center items-center"
121
+ "n-loading": "flex h-full w-full justify-center items-center",
122
+ "n-panel-grids": "n-panel-grids-light dark:n-panel-grids-dark",
123
+ "n-panel-grids-center": "n-panel-grids flex flex-col h-full gap-2 items-center justify-center"
107
124
  }
108
125
  };
109
126
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/devtools-ui-kit",
3
3
  "type": "module",
4
- "version": "0.3.2",
4
+ "version": "0.4.1",
5
5
  "license": "MIT",
6
6
  "repository": "nuxt/devtools",
7
7
  "exports": {
@@ -23,30 +23,30 @@
23
23
  "*.cjs"
24
24
  ],
25
25
  "peerDependencies": {
26
- "@nuxt/devtools": "0.3.2"
26
+ "@nuxt/devtools": "0.4.1"
27
27
  },
28
28
  "dependencies": {
29
29
  "@iconify-json/carbon": "^1.1.16",
30
- "@nuxt/kit": "^3.3.2",
30
+ "@nuxt/kit": "^3.4.1",
31
31
  "@nuxtjs/color-mode": "^3.2.0",
32
- "@unocss/core": "^0.50.6",
33
- "@unocss/nuxt": "^0.50.6",
34
- "@unocss/preset-attributify": "^0.50.6",
35
- "@unocss/preset-icons": "^0.50.6",
36
- "@unocss/preset-mini": "^0.50.6",
37
- "@unocss/reset": "^0.50.6",
38
- "@vueuse/core": "^9.13.0",
39
- "@vueuse/integrations": "^9.13.0",
40
- "@vueuse/nuxt": "^9.13.0",
32
+ "@unocss/core": "^0.51.4",
33
+ "@unocss/nuxt": "^0.51.4",
34
+ "@unocss/preset-attributify": "^0.51.4",
35
+ "@unocss/preset-icons": "^0.51.4",
36
+ "@unocss/preset-mini": "^0.51.4",
37
+ "@unocss/reset": "^0.51.4",
38
+ "@vueuse/core": "^10.0.2",
39
+ "@vueuse/integrations": "^10.0.2",
40
+ "@vueuse/nuxt": "^10.0.2",
41
41
  "defu": "^6.1.2",
42
42
  "focus-trap": "^7.4.0",
43
- "unocss": "^0.50.6",
44
- "v-lazy-show": "^0.2.1",
45
- "@nuxt/devtools": "0.3.2",
46
- "@nuxt/devtools-kit": "0.3.2"
43
+ "unocss": "^0.51.4",
44
+ "v-lazy-show": "^0.2.2",
45
+ "@nuxt/devtools": "0.4.1",
46
+ "@nuxt/devtools-kit": "0.4.1"
47
47
  },
48
48
  "devDependencies": {
49
- "nuxt": "^3.3.2"
49
+ "nuxt": "^3.4.1"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"