@nuxt/devtools-ui-kit 3.4.1 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/components/NBadge.d.vue.ts +13 -5
  2. package/dist/components/NBadge.vue +5 -0
  3. package/dist/components/NBadgeHashed.d.vue.ts +16 -21
  4. package/dist/components/NBadgeHashed.vue +19 -0
  5. package/dist/components/NCard.d.vue.ts +13 -5
  6. package/dist/components/NCard.vue +5 -0
  7. package/dist/components/NCheckbox.d.vue.ts +24 -36
  8. package/dist/components/NCheckbox.vue +29 -0
  9. package/dist/components/NCodeBlock.d.vue.ts +18 -64
  10. package/dist/components/NCodeBlock.vue +38 -0
  11. package/dist/components/NDarkToggle.d.vue.ts +18 -74
  12. package/dist/components/NDarkToggle.vue +60 -0
  13. package/dist/components/NDialog.d.vue.ts +28 -80
  14. package/dist/components/NDialog.vue +63 -0
  15. package/dist/components/NDrawer.d.vue.ts +26 -77
  16. package/dist/components/NDrawer.vue +64 -0
  17. package/dist/components/NDropdown.d.vue.ts +28 -36
  18. package/dist/components/NDropdown.vue +31 -0
  19. package/dist/components/NIcon.d.vue.ts +6 -9
  20. package/dist/components/NIcon.vue +9 -0
  21. package/dist/components/NIconTitle.d.vue.ts +17 -15
  22. package/dist/components/NIconTitle.vue +15 -0
  23. package/dist/components/NLink.d.vue.ts +19 -29
  24. package/dist/components/NLink.vue +27 -0
  25. package/dist/components/NLoading.d.vue.ts +13 -10
  26. package/dist/components/NLoading.vue +10 -0
  27. package/dist/components/NMarkdown.d.vue.ts +7 -19
  28. package/dist/components/NMarkdown.vue +16 -0
  29. package/dist/components/NNavbar.d.vue.ts +25 -34
  30. package/dist/components/NNavbar.vue +30 -0
  31. package/dist/components/NNotification.d.vue.ts +3 -48
  32. package/dist/components/NNotification.vue +44 -0
  33. package/dist/components/NPanelGrids.d.vue.ts +13 -5
  34. package/dist/components/NPanelGrids.vue +5 -0
  35. package/dist/components/NRadio.d.vue.ts +26 -40
  36. package/dist/components/NRadio.vue +33 -0
  37. package/dist/components/NSectionBlock.d.vue.ts +38 -97
  38. package/dist/components/NSectionBlock.vue +67 -0
  39. package/dist/components/NSelect.d.vue.ts +30 -37
  40. package/dist/components/NSelect.vue +28 -0
  41. package/dist/components/NSelectTabs.d.vue.ts +18 -49
  42. package/dist/components/NSelectTabs.vue +42 -0
  43. package/dist/components/NSplitPane.d.vue.ts +28 -82
  44. package/dist/components/NSplitPane.vue +37 -0
  45. package/dist/components/NSwitch.d.vue.ts +27 -34
  46. package/dist/components/NSwitch.vue +29 -0
  47. package/dist/components/NTextInput.d.vue.ts +34 -40
  48. package/dist/components/NTextInput.vue +28 -0
  49. package/dist/components/NTip.d.vue.ts +18 -16
  50. package/dist/components/NTip.vue +16 -0
  51. package/dist/module.json +1 -1
  52. package/package.json +4 -4
@@ -1,77 +1,26 @@
1
- <script setup lang="ts">
2
- import { onClickOutside, useElementSize } from '@vueuse/core'
3
- import { ref } from 'vue'
4
-
5
- const props = withDefaults(defineProps<{
6
- modelValue?: boolean
7
- top?: HTMLElement | string
8
- left?: HTMLElement | string
9
- autoClose?: boolean
10
- transition?: 'right' | 'bottom' | 'top'
11
- }>(), {
12
- transition: 'right',
13
- })
14
-
15
- const emit = defineEmits<{
16
- (e: 'close'): void
17
- }>()
18
-
19
- const el = ref<HTMLElement>()
20
-
21
- const { height } = useElementSize(() => props.top as HTMLElement, undefined, { box: 'border-box' })
22
-
23
- const width = typeof props.left === 'string' && props.left.startsWith('#')
24
- ? document.querySelector(props.left)?.getBoundingClientRect().width
25
- : useElementSize(() => props.left as HTMLElement, undefined, { box: 'border-box' }).width
26
-
27
- onClickOutside(el, () => {
28
- if (props.modelValue && props.autoClose)
29
- emit('close')
30
- }, {
31
- ignore: ['a', 'button', 'summary', '[role="dialog"]'],
32
- })
33
-
34
- const transitionType = {
35
- right: {
36
- 'enter-from-class': 'transform translate-x-1/1',
37
- 'leave-to-class': 'transform translate-x-1/1',
38
- },
39
- top: {
40
- 'enter-from-class': 'transform translate-y--1/1',
41
- 'leave-to-class': 'transform translate-y--1/1',
42
- },
43
- bottom: {
44
- 'enter-from-class': 'transform translate-y-1/1',
45
- 'leave-to-class': 'transform translate-y-1/1',
46
- },
47
- }
48
- </script>
49
-
50
- <template>
51
- <Transition
52
- v-bind="transitionType[transition]"
53
- enter-active-class="duration-200 ease-in"
54
- enter-to-class="opacity-100"
55
- leave-active-class="duration-200 ease-out"
56
- leave-from-class="opacity-100"
57
- >
58
- <div
59
- v-if="modelValue"
60
- ref="el"
61
- :border="`${transition === 'right' ? 'l' : transition === 'bottom' ? 't' : 'b'} base`"
62
- flex="~ col gap-1"
63
- :class="{ 'right-0': transition === 'right' || transition === 'bottom' }"
64
- absolute bottom-0 z-10 z-20 of-auto n-glass-effect text-sm
65
- :style="{
66
- top: transition === 'bottom' ? 'auto' : `${height}px`,
67
- left: transition === 'right' && !width ? 'auto' : `${width}px`,
68
- }"
69
- v-bind="$attrs"
70
- >
71
- <NButton absolute right-2 top-2 z-20 text-xl icon="carbon-close" :border="false" @click="$emit('close')" />
72
- <div relative h-full w-full of-auto>
73
- <slot />
74
- </div>
75
- </div>
76
- </Transition>
77
- </template>
1
+ type __VLS_Props = {
2
+ modelValue?: boolean;
3
+ top?: HTMLElement | string;
4
+ left?: HTMLElement | string;
5
+ autoClose?: boolean;
6
+ transition?: 'right' | 'bottom' | 'top';
7
+ };
8
+ declare var __VLS_14: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_14) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
+ close: () => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ onClose?: (() => any) | undefined;
16
+ }>, {
17
+ transition: "right" | "bottom" | "top";
18
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
22
+ type __VLS_WithSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
@@ -0,0 +1,64 @@
1
+ <script setup>
2
+ import { onClickOutside, useElementSize } from "@vueuse/core";
3
+ import { ref } from "vue";
4
+ const props = defineProps({
5
+ modelValue: { type: Boolean, required: false },
6
+ top: { type: null, required: false },
7
+ left: { type: null, required: false },
8
+ autoClose: { type: Boolean, required: false },
9
+ transition: { type: String, required: false, default: "right" }
10
+ });
11
+ const emit = defineEmits(["close"]);
12
+ const el = ref();
13
+ const { height } = useElementSize(() => props.top, void 0, { box: "border-box" });
14
+ const width = typeof props.left === "string" && props.left.startsWith("#") ? document.querySelector(props.left)?.getBoundingClientRect().width : useElementSize(() => props.left, void 0, { box: "border-box" }).width;
15
+ onClickOutside(el, () => {
16
+ if (props.modelValue && props.autoClose)
17
+ emit("close");
18
+ }, {
19
+ ignore: ["a", "button", "summary", '[role="dialog"]']
20
+ });
21
+ const transitionType = {
22
+ right: {
23
+ "enter-from-class": "transform translate-x-1/1",
24
+ "leave-to-class": "transform translate-x-1/1"
25
+ },
26
+ top: {
27
+ "enter-from-class": "transform translate-y--1/1",
28
+ "leave-to-class": "transform translate-y--1/1"
29
+ },
30
+ bottom: {
31
+ "enter-from-class": "transform translate-y-1/1",
32
+ "leave-to-class": "transform translate-y-1/1"
33
+ }
34
+ };
35
+ </script>
36
+
37
+ <template>
38
+ <Transition
39
+ v-bind="transitionType[transition]"
40
+ enter-active-class="duration-200 ease-in"
41
+ enter-to-class="opacity-100"
42
+ leave-active-class="duration-200 ease-out"
43
+ leave-from-class="opacity-100"
44
+ >
45
+ <div
46
+ v-if="modelValue"
47
+ ref="el"
48
+ :border="`${transition === 'right' ? 'l' : transition === 'bottom' ? 't' : 'b'} base`"
49
+ flex="~ col gap-1"
50
+ :class="{ 'right-0': transition === 'right' || transition === 'bottom' }"
51
+ absolute bottom-0 z-10 z-20 of-auto n-glass-effect text-sm
52
+ :style="{
53
+ top: transition === 'bottom' ? 'auto' : `${height}px`,
54
+ left: transition === 'right' && !width ? 'auto' : `${width}px`
55
+ }"
56
+ v-bind="$attrs"
57
+ >
58
+ <NButton absolute right-2 top-2 z-20 text-xl icon="carbon-close" :border="false" @click="$emit('close')" />
59
+ <div relative h-full w-full of-auto>
60
+ <slot />
61
+ </div>
62
+ </div>
63
+ </Transition>
64
+ </template>
@@ -1,36 +1,28 @@
1
- <script setup lang="ts">
2
- import { onClickOutside, useVModel } from '@vueuse/core'
3
- import { ref } from 'vue'
4
-
5
- const props = withDefaults(defineProps<{
6
- modelValue?: boolean
7
- direction?: 'start' | 'end'
8
- }>(), {
9
- direction: 'start',
10
- })
11
- const emit = defineEmits<{ (...args: any): void }>()
12
-
13
- const enabled = useVModel(props, 'modelValue', emit, { passive: true })
14
- const el = ref<HTMLDivElement>()
15
-
16
- onClickOutside(el, () => {
17
- enabled.value = false
18
- })
19
- </script>
20
-
21
- <template>
22
- <div ref="el" class="relative">
23
- <slot name="trigger" :enabled="enabled" :click="() => enabled = !enabled">
24
- <NButton @click="enabled = !enabled">
25
- Dropdown
26
- </NButton>
27
- </slot>
28
-
29
- <div
30
- class="absolute z-10 border n-border-base rounded n-bg-base shadow n-transition"
31
- :class="[enabled ? 'op-100' : 'op0 pointer-events-none -translate-y-1', direction === 'end' ? 'right-0' : 'left-0']"
32
- >
33
- <slot />
34
- </div>
35
- </div>
36
- </template>
1
+ type __VLS_Props = {
2
+ modelValue?: boolean;
3
+ direction?: 'start' | 'end';
4
+ };
5
+ declare var __VLS_1: {
6
+ enabled: boolean;
7
+ click: () => boolean;
8
+ }, __VLS_11: {};
9
+ type __VLS_Slots = {} & {
10
+ trigger?: (props: typeof __VLS_1) => any;
11
+ } & {
12
+ default?: (props: typeof __VLS_11) => any;
13
+ };
14
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
15
+ [x: string]: never;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
+ [x: `on${Capitalize<any>}`]: ((...args: unknown[]) => any) | undefined;
18
+ }>, {
19
+ direction: "start" | "end";
20
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
24
+ type __VLS_WithSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -0,0 +1,31 @@
1
+ <script setup>
2
+ import { onClickOutside, useVModel } from "@vueuse/core";
3
+ import { ref } from "vue";
4
+ const props = defineProps({
5
+ modelValue: { type: Boolean, required: false },
6
+ direction: { type: String, required: false, default: "start" }
7
+ });
8
+ const emit = defineEmits([]);
9
+ const enabled = useVModel(props, "modelValue", emit, { passive: true });
10
+ const el = ref();
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 border n-border-base rounded n-bg-base shadow n-transition"
26
+ :class="[enabled ? 'op-100' : 'op0 pointer-events-none -translate-y-1', direction === 'end' ? 'right-0' : 'left-0']"
27
+ >
28
+ <slot />
29
+ </div>
30
+ </div>
31
+ </template>
@@ -1,9 +1,6 @@
1
- <script setup lang="ts">
2
- defineProps<{
3
- icon?: string
4
- }>()
5
- </script>
6
-
7
- <template>
8
- <div class="n-icon" :class="icon" />
9
- </template>
1
+ type __VLS_Props = {
2
+ icon?: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,9 @@
1
+ <script setup>
2
+ defineProps({
3
+ icon: { type: String, required: false }
4
+ });
5
+ </script>
6
+
7
+ <template>
8
+ <div class="n-icon" :class="icon" />
9
+ </template>
@@ -1,15 +1,17 @@
1
- <script setup lang="ts">
2
- defineProps<{
3
- icon?: string
4
- text?: string
5
- }>()
6
- </script>
7
-
8
- <template>
9
- <div flex="~ gap-3" items-center>
10
- <div v-if="icon" :class="icon" />
11
- <slot>
12
- <div>{{ text }}</div>
13
- </slot>
14
- </div>
15
- </template>
1
+ type __VLS_Props = {
2
+ icon?: string;
3
+ text?: string;
4
+ };
5
+ declare var __VLS_1: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_1) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,15 @@
1
+ <script setup>
2
+ defineProps({
3
+ icon: { type: String, required: false },
4
+ text: { type: String, required: false }
5
+ });
6
+ </script>
7
+
8
+ <template>
9
+ <div flex="~ gap-3" items-center>
10
+ <div v-if="icon" :class="icon" />
11
+ <slot>
12
+ <div>{{ text }}</div>
13
+ </slot>
14
+ </div>
15
+ </template>
@@ -1,29 +1,19 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- const props = defineProps<{
5
- to?: string
6
- href?: string
7
- target?: string
8
- underline?: boolean
9
- }>()
10
-
11
- const link = computed(() => props.href || props.to)
12
- </script>
13
-
14
- <template>
15
- <NuxtLink
16
- v-bind="link ? {
17
- href: link,
18
- target,
19
- rel: target === '_blank' ? 'noopener noreferrer' : undefined,
20
- } : {}"
21
- :class="{ 'n-link n-transition hover:n-link-hover n-link-base': link || underline }"
22
- >
23
- <slot />
24
- <div
25
- v-if="link && target === '_blank'"
26
- i-carbon:arrow-up-right translate-y--1 text-xs op50
27
- />
28
- </NuxtLink>
29
- </template>
1
+ type __VLS_Props = {
2
+ to?: string;
3
+ href?: string;
4
+ target?: string;
5
+ underline?: boolean;
6
+ };
7
+ declare var __VLS_8: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_8) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,27 @@
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ const props = defineProps({
4
+ to: { type: String, required: false },
5
+ href: { type: String, required: false },
6
+ target: { type: String, required: false },
7
+ underline: { type: Boolean, required: false }
8
+ });
9
+ const link = computed(() => props.href || props.to);
10
+ </script>
11
+
12
+ <template>
13
+ <NuxtLink
14
+ v-bind="link ? {
15
+ href: link,
16
+ target,
17
+ rel: target === '_blank' ? 'noopener noreferrer' : void 0
18
+ } : {}"
19
+ :class="{ 'n-link n-transition hover:n-link-hover n-link-base': link || underline }"
20
+ >
21
+ <slot />
22
+ <div
23
+ v-if="link && target === '_blank'"
24
+ i-carbon:arrow-up-right translate-y--1 text-xs op50
25
+ />
26
+ </NuxtLink>
27
+ </template>
@@ -1,10 +1,13 @@
1
- <template>
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
- <slot>
6
- Loading...
7
- </slot>
8
- </div>
9
- </div>
10
- </template>
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,10 @@
1
+ <template>
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
+ <slot>
6
+ Loading...
7
+ </slot>
8
+ </div>
9
+ </div>
10
+ </template>
@@ -1,19 +1,7 @@
1
- <script setup lang="ts">
2
- // This components requires to run in DevTools to render correctly
3
-
4
- import { devToolsClient } from '../runtime/client'
5
-
6
- defineProps<{
7
- markdown: string
8
- tag?: string
9
- }>()
10
- </script>
11
-
12
- <template>
13
- <template v-if="markdown && devToolsClient?.devtools?.renderMarkdown">
14
- <component :is="tag || 'span'" class="n-markdown" v-html="devToolsClient.devtools.renderMarkdown(markdown)" />
15
- </template>
16
- <template v-else>
17
- <component :is="tag || 'span'" class="n-markdown" v-text="markdown" />
18
- </template>
19
- </template>
1
+ type __VLS_Props = {
2
+ markdown: string;
3
+ tag?: string;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,16 @@
1
+ <script setup>
2
+ import { devToolsClient } from "../runtime/client";
3
+ defineProps({
4
+ markdown: { type: String, required: true },
5
+ tag: { type: String, required: false }
6
+ });
7
+ </script>
8
+
9
+ <template>
10
+ <template v-if="markdown && devToolsClient?.devtools?.renderMarkdown">
11
+ <component :is="tag || 'span'" class="n-markdown" v-html="devToolsClient.devtools.renderMarkdown(markdown)" />
12
+ </template>
13
+ <template v-else>
14
+ <component :is="tag || 'span'" class="n-markdown" v-text="markdown" />
15
+ </template>
16
+ </template>
@@ -1,34 +1,25 @@
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" n-navbar-glass flex-1 :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>
1
+ type __VLS_Props = {
2
+ search?: string;
3
+ noPadding?: boolean;
4
+ };
5
+ declare var __VLS_1: {}, __VLS_10: {}, __VLS_12: {};
6
+ type __VLS_Slots = {} & {
7
+ search?: (props: typeof __VLS_1) => any;
8
+ } & {
9
+ actions?: (props: typeof __VLS_10) => any;
10
+ } & {
11
+ default?: (props: typeof __VLS_12) => any;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
+ "update:search": (value: string) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ "onUpdate:search"?: ((value: string) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,30 @@
1
+ <script setup>
2
+ defineProps({
3
+ search: { type: String, required: false },
4
+ noPadding: { type: Boolean, required: false }
5
+ });
6
+ const emit = defineEmits(["update:search"]);
7
+ function update(event) {
8
+ emit("update:search", event.target.value);
9
+ }
10
+ </script>
11
+
12
+ <template>
13
+ <div flex="~ col gap2 wrap" border="b base" n-navbar-glass flex-1 :class="[{ p4: !noPadding }]">
14
+ <div flex="~ gap4 wrap" items-center>
15
+ <slot name="search">
16
+ <NTextInput
17
+ v-if="search !== void 0"
18
+ placeholder="Search..."
19
+ icon="carbon-search"
20
+ n="primary" flex-auto
21
+ :class="{ 'px-3 py-2': !noPadding }"
22
+ :value="search"
23
+ @input="update"
24
+ />
25
+ </slot>
26
+ <slot name="actions" />
27
+ </div>
28
+ <slot />
29
+ </div>
30
+ </template>
@@ -1,48 +1,3 @@
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 bg-base px-4 py-1 transition-all duration-300
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>
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;