nexa-ui-kit 0.6.0
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.
- package/dist/NBadge.nexa +40 -0
- package/dist/NBottomSheet.nexa +124 -0
- package/dist/NButton.nexa +123 -0
- package/dist/NCard.nexa +74 -0
- package/dist/NInput.nexa +116 -0
- package/dist/NModal.nexa +165 -0
- package/dist/NSelect.nexa +169 -0
- package/dist/NToastContainer.nexa +86 -0
- package/dist/NTooltip.nexa +115 -0
- package/dist/components/NAlert.js +134 -0
- package/dist/components/NAlert.nexa +115 -0
- package/dist/components/NAutocomplete.js +94 -0
- package/dist/components/NAutocomplete.nexa +58 -0
- package/dist/components/NAvatar.js +75 -0
- package/dist/components/NAvatar.nexa +67 -0
- package/dist/components/NBadge.js +74 -0
- package/dist/components/NBadge.nexa +61 -0
- package/dist/components/NBottomSheet.js +149 -0
- package/dist/components/NBottomSheet.nexa +145 -0
- package/dist/components/NButton.js +284 -0
- package/dist/components/NButton.nexa +275 -0
- package/dist/components/NCard.js +117 -0
- package/dist/components/NCard.nexa +100 -0
- package/dist/components/NCheckbox.js +108 -0
- package/dist/components/NCheckbox.nexa +90 -0
- package/dist/components/NChips.js +72 -0
- package/dist/components/NChips.nexa +57 -0
- package/dist/components/NDataTable.js +252 -0
- package/dist/components/NDataTable.nexa +186 -0
- package/dist/components/NDatepicker.js +379 -0
- package/dist/components/NDatepicker.nexa +367 -0
- package/dist/components/NForm.js +132 -0
- package/dist/components/NForm.nexa +133 -0
- package/dist/components/NFormField.js +173 -0
- package/dist/components/NFormField.nexa +171 -0
- package/dist/components/NInput.js +311 -0
- package/dist/components/NInput.nexa +311 -0
- package/dist/components/NInputNumber.js +202 -0
- package/dist/components/NInputNumber.nexa +199 -0
- package/dist/components/NModal.js +221 -0
- package/dist/components/NModal.nexa +221 -0
- package/dist/components/NMultiSelect.js +156 -0
- package/dist/components/NMultiSelect.nexa +77 -0
- package/dist/components/NPaginator.js +117 -0
- package/dist/components/NPaginator.nexa +77 -0
- package/dist/components/NPassword.js +193 -0
- package/dist/components/NPassword.nexa +178 -0
- package/dist/components/NProgressBar.js +127 -0
- package/dist/components/NProgressBar.nexa +111 -0
- package/dist/components/NRadio.js +96 -0
- package/dist/components/NRadio.nexa +81 -0
- package/dist/components/NSelect.js +468 -0
- package/dist/components/NSelect.nexa +452 -0
- package/dist/components/NSkeleton.js +98 -0
- package/dist/components/NSkeleton.nexa +74 -0
- package/dist/components/NSwitch.js +92 -0
- package/dist/components/NSwitch.nexa +76 -0
- package/dist/components/NTabs.js +129 -0
- package/dist/components/NTabs.nexa +113 -0
- package/dist/components/NTag.js +108 -0
- package/dist/components/NTag.nexa +93 -0
- package/dist/components/NToastContainer.js +242 -0
- package/dist/components/NToastContainer.nexa +221 -0
- package/dist/components/NTooltip.js +163 -0
- package/dist/components/NTooltip.nexa +166 -0
- package/dist/components/NTreeMenu.js +151 -0
- package/dist/components/NTreeMenu.nexa +142 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +34 -0
- package/dist/services/FloatingOverlay.d.ts +27 -0
- package/dist/services/FloatingOverlay.js +98 -0
- package/dist/services/FormValidation.d.ts +8 -0
- package/dist/services/FormValidation.js +46 -0
- package/dist/services/ToastService.d.ts +16 -0
- package/dist/services/ToastService.js +26 -0
- package/dist/styles/theme.d.ts +1 -0
- package/dist/styles/theme.js +144 -0
- package/package.json +32 -0
- package/src/components/NAlert.nexa +115 -0
- package/src/components/NAutocomplete.nexa +58 -0
- package/src/components/NAvatar.nexa +67 -0
- package/src/components/NBadge.nexa +61 -0
- package/src/components/NBottomSheet.nexa +145 -0
- package/src/components/NButton.nexa +275 -0
- package/src/components/NCard.nexa +100 -0
- package/src/components/NCheckbox.nexa +90 -0
- package/src/components/NChips.nexa +57 -0
- package/src/components/NDataTable.nexa +186 -0
- package/src/components/NDatepicker.nexa +367 -0
- package/src/components/NForm.nexa +133 -0
- package/src/components/NFormField.nexa +171 -0
- package/src/components/NInput.nexa +311 -0
- package/src/components/NInputNumber.nexa +199 -0
- package/src/components/NModal.nexa +221 -0
- package/src/components/NMultiSelect.nexa +77 -0
- package/src/components/NPaginator.nexa +77 -0
- package/src/components/NPassword.nexa +178 -0
- package/src/components/NProgressBar.nexa +111 -0
- package/src/components/NRadio.nexa +81 -0
- package/src/components/NSelect.nexa +452 -0
- package/src/components/NSkeleton.nexa +74 -0
- package/src/components/NSwitch.nexa +76 -0
- package/src/components/NTabs.nexa +113 -0
- package/src/components/NTag.nexa +93 -0
- package/src/components/NToastContainer.nexa +221 -0
- package/src/components/NTooltip.nexa +166 -0
- package/src/components/NTreeMenu.nexa +142 -0
- package/src/index.ts +36 -0
- package/src/services/FloatingOverlay.ts +133 -0
- package/src/services/FormValidation.ts +44 -0
- package/src/services/ToastService.ts +41 -0
- package/src/shims.d.ts +5 -0
- package/src/styles/theme.ts +146 -0
- package/src/styles/tokens.css +170 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { h, hText, effect, defineComponent, registerComponent, reloadComponent, injectStyle } from 'nexa-framework'
|
|
2
|
+
|
|
3
|
+
const _sfc_main = defineComponent({
|
|
4
|
+
__scopeId: 'data-v-3cd56cb4',
|
|
5
|
+
__hmrId: 'NSwitch_nexa',
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: { type: Boolean, default: false },
|
|
8
|
+
disabled: { type: Boolean, default: false },
|
|
9
|
+
label: { type: String, default: '' }
|
|
10
|
+
},
|
|
11
|
+
emits: ['update:modelValue'],
|
|
12
|
+
setup(props, setupContext) {
|
|
13
|
+
const { emit, slots, slots: $slots } = setupContext
|
|
14
|
+
const toggle = () => {
|
|
15
|
+
if (props.disabled) return
|
|
16
|
+
emit('update:modelValue', !props.modelValue)
|
|
17
|
+
}
|
|
18
|
+
return { toggle, $slots, emit }
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
// Injected render function
|
|
22
|
+
_sfc_main.render = function(ctx) {
|
|
23
|
+
const { toggle, $slots, emit, modelValue, disabled, label, Fragment: _ntc_Fragment } = ctx
|
|
24
|
+
return h('label', { class: ["n-switch", { 'is-checked': modelValue, 'is-disabled': disabled }], "data-v-3cd56cb4": "" }, [
|
|
25
|
+
"\n ",
|
|
26
|
+
h('div', { class: "n-switch-track", onClick: toggle, "data-v-3cd56cb4": "" }, [
|
|
27
|
+
"\n ",
|
|
28
|
+
h('div', { class: "n-switch-thumb", "data-v-3cd56cb4": "" }),
|
|
29
|
+
"\n "
|
|
30
|
+
]),
|
|
31
|
+
"\n ",
|
|
32
|
+
(label) ? h('span', { class: "n-switch-label", "data-v-3cd56cb4": "" }, [
|
|
33
|
+
label
|
|
34
|
+
]) : null
|
|
35
|
+
])
|
|
36
|
+
}
|
|
37
|
+
_sfc_main.__scopeId = 'data-v-3cd56cb4'
|
|
38
|
+
_sfc_main.__hmrId = 'NSwitch_nexa'
|
|
39
|
+
|
|
40
|
+
export default _sfc_main
|
|
41
|
+
|
|
42
|
+
const __style = `.n-switch[data-v-3cd56cb4]{
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: var(--n-space-3);
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
user-select: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.n-switch-track[data-v-3cd56cb4]{
|
|
51
|
+
width: 44px;
|
|
52
|
+
height: 24px;
|
|
53
|
+
background: var(--n-color-surface-hover);
|
|
54
|
+
border-radius: var(--n-radius-full);
|
|
55
|
+
position: relative;
|
|
56
|
+
transition: all var(--n-transition-fast);
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.is-checked .n-switch-track[data-v-3cd56cb4]{
|
|
61
|
+
background: var(--n-color-primary);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.n-switch-thumb[data-v-3cd56cb4]{
|
|
65
|
+
width: 18px;
|
|
66
|
+
height: 18px;
|
|
67
|
+
background: var(--n-color-text);
|
|
68
|
+
border-radius: var(--n-radius-full);
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: 3px;
|
|
71
|
+
left: 3px;
|
|
72
|
+
transition: transform var(--n-transition-spring), background var(--n-transition-normal);
|
|
73
|
+
box-shadow: var(--n-shadow-sm);
|
|
74
|
+
will-change: transform;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.is-checked .n-switch-thumb[data-v-3cd56cb4]{
|
|
78
|
+
transform: translateX(20px);
|
|
79
|
+
background: white;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.n-switch-label[data-v-3cd56cb4]{
|
|
83
|
+
font-size: var(--n-text-sm);
|
|
84
|
+
color: var(--n-color-text);
|
|
85
|
+
font-weight: var(--n-weight-medium);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.is-disabled[data-v-3cd56cb4]{
|
|
89
|
+
opacity: 0.5;
|
|
90
|
+
cursor: not-allowed;
|
|
91
|
+
}`
|
|
92
|
+
injectStyle('data-v-3cd56cb4', __style)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
modelValue: { type: Boolean, default: false },
|
|
4
|
+
disabled: { type: Boolean, default: false },
|
|
5
|
+
label: { type: String, default: '' }
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
const emit = defineEmits(['update:modelValue'])
|
|
9
|
+
|
|
10
|
+
const toggle = () => {
|
|
11
|
+
if (props.disabled) return
|
|
12
|
+
emit('update:modelValue', !props.modelValue)
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<label class="n-switch" :class="{ 'is-checked': modelValue, 'is-disabled': disabled }">
|
|
18
|
+
<div class="n-switch-track" @click="toggle">
|
|
19
|
+
<div class="n-switch-thumb"></div>
|
|
20
|
+
</div>
|
|
21
|
+
<span v-if="label" class="n-switch-label">{{ label }}</span>
|
|
22
|
+
</label>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<style scoped>
|
|
26
|
+
.n-switch {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: var(--n-space-3);
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
user-select: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.n-switch-track {
|
|
35
|
+
width: 44px;
|
|
36
|
+
height: 24px;
|
|
37
|
+
background: var(--n-color-surface-hover);
|
|
38
|
+
border-radius: var(--n-radius-full);
|
|
39
|
+
position: relative;
|
|
40
|
+
transition: all var(--n-transition-fast);
|
|
41
|
+
flex-shrink: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.is-checked .n-switch-track {
|
|
45
|
+
background: var(--n-color-primary);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.n-switch-thumb {
|
|
49
|
+
width: 18px;
|
|
50
|
+
height: 18px;
|
|
51
|
+
background: var(--n-color-text);
|
|
52
|
+
border-radius: var(--n-radius-full);
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 3px;
|
|
55
|
+
left: 3px;
|
|
56
|
+
transition: transform var(--n-transition-spring), background var(--n-transition-normal);
|
|
57
|
+
box-shadow: var(--n-shadow-sm);
|
|
58
|
+
will-change: transform;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.is-checked .n-switch-thumb {
|
|
62
|
+
transform: translateX(20px);
|
|
63
|
+
background: white;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.n-switch-label {
|
|
67
|
+
font-size: var(--n-text-sm);
|
|
68
|
+
color: var(--n-color-text);
|
|
69
|
+
font-weight: var(--n-weight-medium);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.is-disabled {
|
|
73
|
+
opacity: 0.5;
|
|
74
|
+
cursor: not-allowed;
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { signal, computed, h, hText, effect, defineComponent, registerComponent, reloadComponent, injectStyle } from 'nexa-framework'
|
|
2
|
+
|
|
3
|
+
const _sfc_main = defineComponent({
|
|
4
|
+
__scopeId: 'data-v-339e5ee5',
|
|
5
|
+
__hmrId: 'NTabs_nexa',
|
|
6
|
+
props: {
|
|
7
|
+
tabs: { type: Array, default: () => [] },
|
|
8
|
+
modelValue: { type: [String, Number], default: '' }
|
|
9
|
+
},
|
|
10
|
+
emits: ['update:modelValue'],
|
|
11
|
+
setup(props, setupContext) {
|
|
12
|
+
const { emit, slots, slots: $slots } = setupContext
|
|
13
|
+
const activeKey = computed(() => props.modelValue || props.tabs[0]?.key)
|
|
14
|
+
const select = (key) => {
|
|
15
|
+
emit('update:modelValue', key)
|
|
16
|
+
}
|
|
17
|
+
const activeIndex = computed(() =>
|
|
18
|
+
props.tabs.findIndex(t => t.key === activeKey.value)
|
|
19
|
+
)
|
|
20
|
+
return { activeKey, select, activeIndex, $slots, emit }
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
// Injected render function
|
|
24
|
+
_sfc_main.render = function(ctx) {
|
|
25
|
+
const { activeKey, select, activeIndex, $slots, emit, tabs, modelValue, Fragment: _ntc_Fragment } = ctx
|
|
26
|
+
return h('div', { class: "n-tabs", "data-v-339e5ee5": "" }, [
|
|
27
|
+
"\n ",
|
|
28
|
+
h('div', { class: "n-tabs-header", "data-v-339e5ee5": "" }, [
|
|
29
|
+
"\n ",
|
|
30
|
+
tabs.map((tab, index) =>
|
|
31
|
+
h('div', { class: ["n-tab", { 'is-active': tab.key === activeKey.value, 'is-disabled': tab.disabled }], key: tab.key, onClick: ($event) => { select(tab.key) }, "data-v-339e5ee5": "" }, [
|
|
32
|
+
"\n ",
|
|
33
|
+
(tab.icon) ? h('span', { class: "n-tab-icon", "data-v-339e5ee5": "" }, [
|
|
34
|
+
tab.icon
|
|
35
|
+
]) : null,
|
|
36
|
+
h('span', { class: "n-tab-label", "data-v-339e5ee5": "" }, [
|
|
37
|
+
tab.label
|
|
38
|
+
]),
|
|
39
|
+
"\n ",
|
|
40
|
+
(tab.badge) ? h('span', { class: "n-tab-badge", "data-v-339e5ee5": "" }, [
|
|
41
|
+
tab.badge
|
|
42
|
+
]) : null
|
|
43
|
+
])
|
|
44
|
+
),
|
|
45
|
+
"\n ",
|
|
46
|
+
h('div', { class: "n-tabs-indicator", style: { left: `calc(${activeIndex.value * 100}% / ${tabs.length})`, width: `calc(100% / ${tabs.length})` }, "data-v-339e5ee5": "" }),
|
|
47
|
+
"\n "
|
|
48
|
+
]),
|
|
49
|
+
"\n ",
|
|
50
|
+
h('div', { class: "n-tabs-content", "data-v-339e5ee5": "" }, [
|
|
51
|
+
"\n ",
|
|
52
|
+
ctx.$slots['tab-' + activeKey.value] ? ctx.$slots['tab-' + activeKey.value]() : null,
|
|
53
|
+
"\n "
|
|
54
|
+
]),
|
|
55
|
+
"\n "
|
|
56
|
+
])
|
|
57
|
+
}
|
|
58
|
+
_sfc_main.__scopeId = 'data-v-339e5ee5'
|
|
59
|
+
_sfc_main.__hmrId = 'NTabs_nexa'
|
|
60
|
+
|
|
61
|
+
export default _sfc_main
|
|
62
|
+
|
|
63
|
+
const __style = `.n-tabs[data-v-339e5ee5]{
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: var(--n-space-6);
|
|
67
|
+
width: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.n-tabs-header[data-v-339e5ee5]{
|
|
71
|
+
display: flex;
|
|
72
|
+
position: relative;
|
|
73
|
+
border-bottom: 1px solid var(--n-color-border);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.n-tab[data-v-339e5ee5]{
|
|
77
|
+
flex: 1;
|
|
78
|
+
padding: var(--n-space-3) var(--n-space-5);
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
gap: var(--n-space-2);
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
color: var(--n-color-text-muted);
|
|
85
|
+
font-size: var(--n-text-sm);
|
|
86
|
+
font-weight: var(--n-weight-medium);
|
|
87
|
+
transition: all var(--n-transition-fast);
|
|
88
|
+
position: relative;
|
|
89
|
+
user-select: none;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.n-tab[data-v-339e5ee5]:hover{
|
|
94
|
+
color: var(--n-color-text-secondary);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.n-tab.is-active[data-v-339e5ee5]{
|
|
98
|
+
color: var(--n-color-primary);
|
|
99
|
+
font-weight: var(--n-weight-semibold);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.n-tab.is-disabled[data-v-339e5ee5]{
|
|
103
|
+
opacity: 0.4;
|
|
104
|
+
cursor: not-allowed;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.n-tab-icon[data-v-339e5ee5]{
|
|
108
|
+
font-size: var(--n-text-base);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.n-tab-badge[data-v-339e5ee5]{
|
|
112
|
+
background: var(--n-color-primary);
|
|
113
|
+
color: white;
|
|
114
|
+
font-size: 0.65rem;
|
|
115
|
+
font-weight: var(--n-weight-bold);
|
|
116
|
+
padding: 0.1rem 0.4rem;
|
|
117
|
+
border-radius: var(--n-radius-full);
|
|
118
|
+
line-height: 1.2;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.n-tabs-indicator[data-v-339e5ee5]{
|
|
122
|
+
position: absolute;
|
|
123
|
+
bottom: 0;
|
|
124
|
+
height: 2px;
|
|
125
|
+
background: var(--n-color-primary);
|
|
126
|
+
transition: all var(--n-transition-normal);
|
|
127
|
+
border-radius: var(--n-radius-full) var(--n-radius-full) 0 0;
|
|
128
|
+
}`
|
|
129
|
+
injectStyle('data-v-339e5ee5', __style)
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { signal, computed } from 'nexa-framework'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
tabs: { type: Array, default: () => [] },
|
|
6
|
+
modelValue: { type: [String, Number], default: '' }
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
const emit = defineEmits(['update:modelValue'])
|
|
10
|
+
|
|
11
|
+
const activeKey = computed(() => props.modelValue || props.tabs[0]?.key)
|
|
12
|
+
|
|
13
|
+
const select = (key) => {
|
|
14
|
+
emit('update:modelValue', key)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const activeIndex = computed(() =>
|
|
18
|
+
props.tabs.findIndex(t => t.key === activeKey.value)
|
|
19
|
+
)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="n-tabs">
|
|
24
|
+
<div class="n-tabs-header">
|
|
25
|
+
<div
|
|
26
|
+
v-for="tab in tabs"
|
|
27
|
+
:key="tab.key"
|
|
28
|
+
class="n-tab"
|
|
29
|
+
:class="{ 'is-active': tab.key === activeKey.value, 'is-disabled': tab.disabled }"
|
|
30
|
+
@click="select(tab.key)"
|
|
31
|
+
>
|
|
32
|
+
<span v-if="tab.icon" class="n-tab-icon">{{ tab.icon }}</span>
|
|
33
|
+
<span class="n-tab-label">{{ tab.label }}</span>
|
|
34
|
+
<span v-if="tab.badge" class="n-tab-badge">{{ tab.badge }}</span>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="n-tabs-indicator" :style="{ left: `calc(${activeIndex.value * 100}% / ${tabs.length})`, width: `calc(100% / ${tabs.length})` }"></div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="n-tabs-content">
|
|
39
|
+
<slot :name="'tab-' + activeKey.value">
|
|
40
|
+
<slot />
|
|
41
|
+
</slot>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<style scoped>
|
|
47
|
+
.n-tabs {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: var(--n-space-6);
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.n-tabs-header {
|
|
55
|
+
display: flex;
|
|
56
|
+
position: relative;
|
|
57
|
+
border-bottom: 1px solid var(--n-color-border);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.n-tab {
|
|
61
|
+
flex: 1;
|
|
62
|
+
padding: var(--n-space-3) var(--n-space-5);
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
gap: var(--n-space-2);
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
color: var(--n-color-text-muted);
|
|
69
|
+
font-size: var(--n-text-sm);
|
|
70
|
+
font-weight: var(--n-weight-medium);
|
|
71
|
+
transition: all var(--n-transition-fast);
|
|
72
|
+
position: relative;
|
|
73
|
+
user-select: none;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.n-tab:hover {
|
|
78
|
+
color: var(--n-color-text-secondary);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.n-tab.is-active {
|
|
82
|
+
color: var(--n-color-primary);
|
|
83
|
+
font-weight: var(--n-weight-semibold);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.n-tab.is-disabled {
|
|
87
|
+
opacity: 0.4;
|
|
88
|
+
cursor: not-allowed;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.n-tab-icon {
|
|
92
|
+
font-size: var(--n-text-base);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.n-tab-badge {
|
|
96
|
+
background: var(--n-color-primary);
|
|
97
|
+
color: white;
|
|
98
|
+
font-size: 0.65rem;
|
|
99
|
+
font-weight: var(--n-weight-bold);
|
|
100
|
+
padding: 0.1rem 0.4rem;
|
|
101
|
+
border-radius: var(--n-radius-full);
|
|
102
|
+
line-height: 1.2;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.n-tabs-indicator {
|
|
106
|
+
position: absolute;
|
|
107
|
+
bottom: 0;
|
|
108
|
+
height: 2px;
|
|
109
|
+
background: var(--n-color-primary);
|
|
110
|
+
transition: all var(--n-transition-normal);
|
|
111
|
+
border-radius: var(--n-radius-full) var(--n-radius-full) 0 0;
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { h, hText, effect, defineComponent, registerComponent, reloadComponent, injectStyle } from 'nexa-framework'
|
|
2
|
+
|
|
3
|
+
const _sfc_main = defineComponent({
|
|
4
|
+
__scopeId: 'data-v-4d63a958',
|
|
5
|
+
__hmrId: 'NTag_nexa',
|
|
6
|
+
props: {
|
|
7
|
+
variant: { type: String, default: 'primary' },
|
|
8
|
+
size: { type: String, default: 'md' },
|
|
9
|
+
closable: { type: Boolean, default: false },
|
|
10
|
+
rounded: { type: Boolean, default: false }
|
|
11
|
+
},
|
|
12
|
+
emits: ['close'],
|
|
13
|
+
setup(props, setupContext) {
|
|
14
|
+
const { emit, slots, slots: $slots } = setupContext
|
|
15
|
+
return { $slots, emit }
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
// Injected render function
|
|
19
|
+
_sfc_main.render = function(ctx) {
|
|
20
|
+
const { $slots, emit, variant, size, closable, rounded, Fragment: _ntc_Fragment } = ctx
|
|
21
|
+
return h('span', { class: ['n-tag', `n-tag-${variant}`, `n-tag-${size}`, rounded ? 'is-rounded' : ''], "data-v-4d63a958": "" }, [
|
|
22
|
+
"\n ",
|
|
23
|
+
ctx.$slots.default ? ctx.$slots.default() : null,
|
|
24
|
+
"\n ",
|
|
25
|
+
(closable) ? h('button', { class: "n-tag-close", onClick: ($event) => { emit('close') }, "data-v-4d63a958": "" }, [
|
|
26
|
+
"×"
|
|
27
|
+
]) : null
|
|
28
|
+
])
|
|
29
|
+
}
|
|
30
|
+
_sfc_main.__scopeId = 'data-v-4d63a958'
|
|
31
|
+
_sfc_main.__hmrId = 'NTag_nexa'
|
|
32
|
+
|
|
33
|
+
export default _sfc_main
|
|
34
|
+
|
|
35
|
+
const __style = `.n-tag[data-v-4d63a958]{
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: var(--n-space-1);
|
|
39
|
+
padding: 0.2rem 0.6rem;
|
|
40
|
+
font-size: var(--n-text-xs);
|
|
41
|
+
font-weight: var(--n-weight-semibold);
|
|
42
|
+
border-radius: var(--n-radius-sm);
|
|
43
|
+
line-height: 1.4;
|
|
44
|
+
font-family: var(--n-font-sans);
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
border: 1px solid transparent;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.n-tag.is-rounded[data-v-4d63a958]{
|
|
50
|
+
border-radius: var(--n-radius-full);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.n-tag-sm[data-v-4d63a958]{ padding: 0.1rem 0.4rem; font-size: 0.65rem; }
|
|
54
|
+
.n-tag-lg[data-v-4d63a958]{ padding: 0.35rem 0.8rem; font-size: var(--n-text-sm); }
|
|
55
|
+
|
|
56
|
+
.n-tag-primary[data-v-4d63a958]{
|
|
57
|
+
background: var(--n-color-primary-light);
|
|
58
|
+
border-color: rgba(59, 130, 246, 0.25);
|
|
59
|
+
color: var(--n-color-primary);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.n-tag-success[data-v-4d63a958]{
|
|
63
|
+
background: var(--n-color-success-light);
|
|
64
|
+
border-color: rgba(16, 185, 129, 0.25);
|
|
65
|
+
color: var(--n-color-success);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.n-tag-danger[data-v-4d63a958]{
|
|
69
|
+
background: var(--n-color-danger-light);
|
|
70
|
+
border-color: rgba(239, 68, 68, 0.25);
|
|
71
|
+
color: var(--n-color-danger);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.n-tag-warning[data-v-4d63a958]{
|
|
75
|
+
background: var(--n-color-warning-light);
|
|
76
|
+
border-color: rgba(245, 158, 11, 0.25);
|
|
77
|
+
color: var(--n-color-warning);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.n-tag-info[data-v-4d63a958]{
|
|
81
|
+
background: var(--n-color-info-light);
|
|
82
|
+
border-color: rgba(6, 182, 212, 0.25);
|
|
83
|
+
color: var(--n-color-info);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.n-tag-secondary[data-v-4d63a958]{
|
|
87
|
+
background: var(--n-color-surface-alt);
|
|
88
|
+
border-color: var(--n-color-border);
|
|
89
|
+
color: var(--n-color-text-secondary);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.n-tag-close[data-v-4d63a958]{
|
|
93
|
+
background: transparent;
|
|
94
|
+
border: none;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
font-size: inherit;
|
|
97
|
+
line-height: 1;
|
|
98
|
+
padding: 0;
|
|
99
|
+
margin-left: var(--n-space-1);
|
|
100
|
+
color: inherit;
|
|
101
|
+
opacity: 0.6;
|
|
102
|
+
transition: opacity var(--n-transition-fast);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.n-tag-close[data-v-4d63a958]:hover{
|
|
106
|
+
opacity: 1;
|
|
107
|
+
}`
|
|
108
|
+
injectStyle('data-v-4d63a958', __style)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
variant: { type: String, default: 'primary' },
|
|
4
|
+
size: { type: String, default: 'md' },
|
|
5
|
+
closable: { type: Boolean, default: false },
|
|
6
|
+
rounded: { type: Boolean, default: false }
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
const emit = defineEmits(['close'])
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<span :class="['n-tag', `n-tag-${variant}`, `n-tag-${size}`, rounded ? 'is-rounded' : '']">
|
|
14
|
+
<slot />
|
|
15
|
+
<button v-if="closable" class="n-tag-close" @click="emit('close')">×</button>
|
|
16
|
+
</span>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<style scoped>
|
|
20
|
+
.n-tag {
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: var(--n-space-1);
|
|
24
|
+
padding: 0.2rem 0.6rem;
|
|
25
|
+
font-size: var(--n-text-xs);
|
|
26
|
+
font-weight: var(--n-weight-semibold);
|
|
27
|
+
border-radius: var(--n-radius-sm);
|
|
28
|
+
line-height: 1.4;
|
|
29
|
+
font-family: var(--n-font-sans);
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
border: 1px solid transparent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.n-tag.is-rounded {
|
|
35
|
+
border-radius: var(--n-radius-full);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.n-tag-sm { padding: 0.1rem 0.4rem; font-size: 0.65rem; }
|
|
39
|
+
.n-tag-lg { padding: 0.35rem 0.8rem; font-size: var(--n-text-sm); }
|
|
40
|
+
|
|
41
|
+
.n-tag-primary {
|
|
42
|
+
background: var(--n-color-primary-light);
|
|
43
|
+
border-color: rgba(59, 130, 246, 0.25);
|
|
44
|
+
color: var(--n-color-primary);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.n-tag-success {
|
|
48
|
+
background: var(--n-color-success-light);
|
|
49
|
+
border-color: rgba(16, 185, 129, 0.25);
|
|
50
|
+
color: var(--n-color-success);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.n-tag-danger {
|
|
54
|
+
background: var(--n-color-danger-light);
|
|
55
|
+
border-color: rgba(239, 68, 68, 0.25);
|
|
56
|
+
color: var(--n-color-danger);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.n-tag-warning {
|
|
60
|
+
background: var(--n-color-warning-light);
|
|
61
|
+
border-color: rgba(245, 158, 11, 0.25);
|
|
62
|
+
color: var(--n-color-warning);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.n-tag-info {
|
|
66
|
+
background: var(--n-color-info-light);
|
|
67
|
+
border-color: rgba(6, 182, 212, 0.25);
|
|
68
|
+
color: var(--n-color-info);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.n-tag-secondary {
|
|
72
|
+
background: var(--n-color-surface-alt);
|
|
73
|
+
border-color: var(--n-color-border);
|
|
74
|
+
color: var(--n-color-text-secondary);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.n-tag-close {
|
|
78
|
+
background: transparent;
|
|
79
|
+
border: none;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
font-size: inherit;
|
|
82
|
+
line-height: 1;
|
|
83
|
+
padding: 0;
|
|
84
|
+
margin-left: var(--n-space-1);
|
|
85
|
+
color: inherit;
|
|
86
|
+
opacity: 0.6;
|
|
87
|
+
transition: opacity var(--n-transition-fast);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.n-tag-close:hover {
|
|
91
|
+
opacity: 1;
|
|
92
|
+
}
|
|
93
|
+
</style>
|