nexa-ui-kit 0.11.5 → 0.11.8
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/components/NAlert.js +2 -14
- package/dist/components/NAlert.nexa +3 -14
- package/dist/components/NAutocomplete.js +1 -1
- package/dist/components/NAutocomplete.nexa +2 -1
- package/dist/components/NAvatar.js +0 -5
- package/dist/components/NAvatar.nexa +1 -5
- package/dist/components/NBadge.js +0 -6
- package/dist/components/NBadge.nexa +1 -6
- package/dist/components/NBottomSheet.js +0 -5
- package/dist/components/NBottomSheet.nexa +1 -5
- package/dist/components/NButton.js +202 -294
- package/dist/components/NButton.nexa +224 -318
- package/dist/components/NCard.js +39 -82
- package/dist/components/NCard.nexa +27 -71
- package/dist/components/NCheckbox.js +77 -60
- package/dist/components/NCheckbox.nexa +71 -45
- package/dist/components/NChips.nexa +1 -0
- package/dist/components/NDataTable.js +1 -313
- package/dist/components/NDataTable.nexa +2 -314
- package/dist/components/NDatepicker.js +4 -25
- package/dist/components/NDatepicker.nexa +5 -25
- package/dist/components/NForm.nexa +1 -0
- package/dist/components/NFormField.js +0 -5
- package/dist/components/NFormField.nexa +1 -5
- package/dist/components/NImage.js +1 -6
- package/dist/components/NImage.nexa +2 -6
- package/dist/components/NInput.js +96 -263
- package/dist/components/NInput.nexa +89 -259
- package/dist/components/NInputNumber.nexa +1 -1
- package/dist/components/NModal.js +1 -118
- package/dist/components/NModal.nexa +2 -119
- package/dist/components/NMultiSelect.js +1 -1
- package/dist/components/NMultiSelect.nexa +2 -1
- package/dist/components/NPaginator.js +1 -11
- package/dist/components/NPaginator.nexa +2 -11
- package/dist/components/NPassword.nexa +1 -0
- package/dist/components/NProgressBar.js +0 -11
- package/dist/components/NProgressBar.nexa +1 -11
- package/dist/components/NRadio.js +1 -8
- package/dist/components/NRadio.nexa +2 -8
- package/dist/components/NScrollView.js +0 -6
- package/dist/components/NScrollView.nexa +1 -6
- package/dist/components/NSelect.js +7 -35
- package/dist/components/NSelect.nexa +8 -35
- package/dist/components/NSkeleton.js +3 -9
- package/dist/components/NSkeleton.nexa +4 -9
- package/dist/components/NSwitch.js +0 -6
- package/dist/components/NSwitch.nexa +1 -6
- package/dist/components/NTabs.js +0 -11
- package/dist/components/NTabs.nexa +1 -11
- package/dist/components/NTag.js +1 -11
- package/dist/components/NTag.nexa +2 -11
- package/dist/components/NToastContainer.js +3 -27
- package/dist/components/NToastContainer.nexa +4 -27
- package/dist/components/NTooltip.js +0 -13
- package/dist/components/NTooltip.nexa +1 -13
- package/dist/components/NTreeMenu.js +1 -21
- package/dist/components/NTreeMenu.nexa +2 -21
- package/dist/components/NVirtualList.js +0 -2
- package/dist/components/NVirtualList.nexa +1 -2
- package/dist/styles/tokens.css +82 -173
- package/package.json +4 -4
- package/src/components/NAlert.nexa +3 -14
- package/src/components/NAutocomplete.nexa +2 -1
- package/src/components/NAvatar.nexa +1 -5
- package/src/components/NBadge.nexa +1 -6
- package/src/components/NBottomSheet.nexa +1 -5
- package/src/components/NButton.nexa +224 -318
- package/src/components/NCard.nexa +27 -71
- package/src/components/NCheckbox.nexa +71 -45
- package/src/components/NChips.nexa +1 -0
- package/src/components/NDataTable.nexa +2 -314
- package/src/components/NDatepicker.nexa +5 -25
- package/src/components/NForm.nexa +1 -0
- package/src/components/NFormField.nexa +1 -5
- package/src/components/NImage.nexa +2 -6
- package/src/components/NInput.nexa +89 -259
- package/src/components/NInputNumber.nexa +1 -1
- package/src/components/NModal.nexa +2 -119
- package/src/components/NMultiSelect.nexa +2 -1
- package/src/components/NPaginator.nexa +2 -11
- package/src/components/NPassword.nexa +1 -0
- package/src/components/NProgressBar.nexa +1 -11
- package/src/components/NRadio.nexa +2 -8
- package/src/components/NScrollView.nexa +1 -6
- package/src/components/NSelect.nexa +8 -35
- package/src/components/NSkeleton.nexa +4 -9
- package/src/components/NSwitch.nexa +1 -6
- package/src/components/NTabs.nexa +1 -11
- package/src/components/NTag.nexa +2 -11
- package/src/components/NToastContainer.nexa +4 -27
- package/src/components/NTooltip.nexa +1 -13
- package/src/components/NTreeMenu.nexa +2 -21
- package/src/components/NVirtualList.nexa +1 -2
- package/src/styles/tokens.css +82 -173
|
@@ -2,24 +2,19 @@
|
|
|
2
2
|
const props = defineProps({
|
|
3
3
|
title: { type: String, default: '' },
|
|
4
4
|
subtitle: { type: String, default: '' },
|
|
5
|
-
|
|
6
|
-
compact: { type: Boolean, default: false },
|
|
5
|
+
elevated: { type: Boolean, default: true },
|
|
7
6
|
hoverable: { type: Boolean, default: false },
|
|
8
|
-
|
|
9
|
-
image: { type: String, default: '' }
|
|
7
|
+
bordered: { type: Boolean, default: false }
|
|
10
8
|
})
|
|
11
9
|
</script>
|
|
12
10
|
|
|
13
11
|
<template>
|
|
14
|
-
<div
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
<
|
|
18
|
-
<h3 v-if="title" class="n-card-title">{{ title }}</h3>
|
|
19
|
-
<p v-if="subtitle" class="n-card-subtitle">{{ subtitle }}</p>
|
|
20
|
-
</slot>
|
|
12
|
+
<div class="n-card" :class="{ 'is-elevated': elevated, 'is-hoverable': hoverable, 'is-bordered': bordered }">
|
|
13
|
+
<div v-if="title || subtitle" class="n-card-header">
|
|
14
|
+
<h3 v-if="title" class="n-card-title">{{ title }}</h3>
|
|
15
|
+
<p v-if="subtitle" class="n-card-subtitle">{{ subtitle }}</p>
|
|
21
16
|
</div>
|
|
22
|
-
<div
|
|
17
|
+
<div class="n-card-body">
|
|
23
18
|
<slot />
|
|
24
19
|
</div>
|
|
25
20
|
<div v-if="$slots.footer" class="n-card-footer">
|
|
@@ -30,81 +25,42 @@ const props = defineProps({
|
|
|
30
25
|
|
|
31
26
|
<style scoped>
|
|
32
27
|
.n-card {
|
|
33
|
-
background: var(--n-color-surface);
|
|
34
|
-
border: 1px solid var(--n-color-border);
|
|
28
|
+
background-color: var(--n-color-surface);
|
|
35
29
|
border-radius: var(--n-radius-lg);
|
|
36
30
|
overflow: hidden;
|
|
37
31
|
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
38
|
-
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
will-change: transform, box-shadow;
|
|
32
|
+
position: relative;
|
|
41
33
|
}
|
|
42
|
-
|
|
43
34
|
.is-elevated {
|
|
44
|
-
background: var(--n-color-surface-elevated);
|
|
45
|
-
box-shadow: var(--n-shadow-md);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.is-outlined {
|
|
49
|
-
background: transparent;
|
|
50
|
-
border-color: var(--n-color-border);
|
|
51
|
-
box-shadow: none;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.is-flat {
|
|
55
|
-
background: var(--n-color-surface-alt);
|
|
56
|
-
border: none;
|
|
57
|
-
box-shadow: none;
|
|
58
35
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
transform: translateY(-2px);
|
|
62
|
-
border-color: var(--n-color-border-hover);
|
|
63
|
-
box-shadow: var(--n-shadow-lg);
|
|
36
|
+
.is-bordered {
|
|
37
|
+
border: 1px solid #334155;
|
|
64
38
|
}
|
|
65
|
-
|
|
66
|
-
.n-card-image {
|
|
67
|
-
width: 100%;
|
|
68
|
-
height: 200px;
|
|
69
|
-
object-fit: cover;
|
|
70
|
-
display: block;
|
|
39
|
+
.is-hoverable:hover {
|
|
71
40
|
}
|
|
72
|
-
|
|
73
41
|
.n-card-header {
|
|
74
|
-
padding:
|
|
75
|
-
border-bottom: 1px solid
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.is-compact .n-card-header {
|
|
79
|
-
padding: var(--n-space-4);
|
|
42
|
+
padding: 1.5rem 1.5rem 1rem 1.5rem;
|
|
43
|
+
border-bottom: 1px solid #334155;
|
|
80
44
|
}
|
|
81
|
-
|
|
82
|
-
.is-compact .n-card-body.has-padding {
|
|
83
|
-
padding: var(--n-space-4);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
45
|
.n-card-title {
|
|
87
|
-
|
|
88
|
-
font-
|
|
89
|
-
font-weight: var(--n-weight-bold);
|
|
46
|
+
font-size: 1.25rem;
|
|
47
|
+
font-weight: 700;
|
|
90
48
|
color: var(--n-color-text);
|
|
91
|
-
|
|
49
|
+
margin: 0 0 0.25rem 0;
|
|
50
|
+
letter-spacing: -0.01em;
|
|
92
51
|
}
|
|
93
|
-
|
|
94
52
|
.n-card-subtitle {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
53
|
+
font-size: 0.875rem;
|
|
54
|
+
color: var(--n-color-text-muted);
|
|
55
|
+
margin: 0;
|
|
98
56
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
padding: var(--n-space-6);
|
|
57
|
+
.n-card-body {
|
|
58
|
+
padding: 1.5rem;
|
|
102
59
|
}
|
|
103
|
-
|
|
104
60
|
.n-card-footer {
|
|
105
|
-
padding:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
margin-top: auto;
|
|
61
|
+
padding: 1rem 1.5rem;
|
|
62
|
+
border-top: 1px solid #334155;
|
|
63
|
+
background: rgba(0, 0, 0, 0.1);
|
|
109
64
|
}
|
|
65
|
+
|
|
110
66
|
</style>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { signal, computed } from 'nexa-framework'
|
|
3
|
+
|
|
2
4
|
const props = defineProps({
|
|
3
5
|
modelValue: { type: Boolean, default: false },
|
|
4
6
|
label: { type: String, default: '' },
|
|
@@ -12,17 +14,26 @@ const toggle = () => {
|
|
|
12
14
|
if (props.disabled) return
|
|
13
15
|
emit('update:modelValue', !props.modelValue)
|
|
14
16
|
}
|
|
17
|
+
|
|
18
|
+
const isAnimating = signal(false)
|
|
19
|
+
|
|
20
|
+
const handleToggle = () => {
|
|
21
|
+
if (props.disabled) return
|
|
22
|
+
isAnimating.value = true
|
|
23
|
+
setTimeout(() => { isAnimating.value = false }, 300)
|
|
24
|
+
toggle()
|
|
25
|
+
}
|
|
15
26
|
</script>
|
|
16
27
|
|
|
17
28
|
<template>
|
|
18
29
|
<label class="n-checkbox" :class="{ 'is-checked': modelValue && !indeterminate, 'is-indeterminate': indeterminate, 'is-disabled': disabled }">
|
|
19
|
-
<div class="n-checkbox-box" @click="
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
</
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
</
|
|
30
|
+
<div class="n-checkbox-box" @click="handleToggle" :class="{ 'is-animating': isAnimating }">
|
|
31
|
+
<svg v-if="modelValue && !indeterminate" class="n-checkbox-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
|
|
32
|
+
<path d="M20 6L9 17l-5-5"/>
|
|
33
|
+
</svg>
|
|
34
|
+
<svg v-if="indeterminate" class="n-checkbox-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round">
|
|
35
|
+
<line x1="5" y1="12" x2="19" y2="12"/>
|
|
36
|
+
</svg>
|
|
26
37
|
</div>
|
|
27
38
|
<span v-if="label" class="n-checkbox-label">{{ label }}</span>
|
|
28
39
|
</label>
|
|
@@ -32,67 +43,82 @@ const toggle = () => {
|
|
|
32
43
|
.n-checkbox {
|
|
33
44
|
display: inline-flex;
|
|
34
45
|
align-items: center;
|
|
35
|
-
gap:
|
|
46
|
+
gap: 0.75rem;
|
|
36
47
|
cursor: pointer;
|
|
37
48
|
user-select: none;
|
|
49
|
+
padding: 0.5rem 0.75rem;
|
|
50
|
+
border-radius: var(--n-radius-md);
|
|
51
|
+
transition: color var(--n-transition-fast); cubic-bezier(0.16, 1, 0.3, 1);
|
|
52
|
+
}
|
|
53
|
+
.n-checkbox:hover:not(.is-disabled) {
|
|
54
|
+
background: rgba(99, 102, 241, 0.08);
|
|
55
|
+
transform: translateX(2px);
|
|
38
56
|
}
|
|
39
|
-
|
|
40
57
|
.n-checkbox-box {
|
|
41
|
-
width:
|
|
42
|
-
height:
|
|
43
|
-
border:
|
|
44
|
-
border
|
|
58
|
+
width: 24px;
|
|
59
|
+
height: 24px;
|
|
60
|
+
border-radius: var(--n-radius-md);
|
|
61
|
+
border: 1px solid var(--n-color-border);
|
|
45
62
|
display: flex;
|
|
46
63
|
align-items: center;
|
|
47
64
|
justify-content: center;
|
|
48
|
-
transition:
|
|
65
|
+
transition: background-color var(--n-transition-fast), border-color var(--n-transition-fast), color var(--n-transition-fast), box-shadow var(--n-transition-fast);
|
|
66
|
+
background-color: var(--n-color-surface);
|
|
49
67
|
flex-shrink: 0;
|
|
50
|
-
|
|
68
|
+
position: relative;
|
|
51
69
|
}
|
|
52
|
-
|
|
53
|
-
.is-checked .n-checkbox-box {
|
|
54
|
-
background: var(--n-color-primary);
|
|
55
|
-
border-color: var(--n-color-primary);
|
|
56
|
-
box-shadow: var(--n-shadow-glow-primary);
|
|
57
|
-
}
|
|
58
|
-
|
|
70
|
+
.is-checked .n-checkbox-box,
|
|
59
71
|
.is-indeterminate .n-checkbox-box {
|
|
60
|
-
background: var(--n-color-primary);
|
|
72
|
+
background-color: var(--n-color-primary);
|
|
61
73
|
border-color: var(--n-color-primary);
|
|
62
|
-
box-shadow: var(--n-shadow-glow-primary);
|
|
63
74
|
}
|
|
64
|
-
|
|
75
|
+
.is-animating .n-checkbox-box {
|
|
76
|
+
}
|
|
65
77
|
.n-checkbox-icon {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
justify-content: center;
|
|
78
|
+
width: 16px;
|
|
79
|
+
height: 16px;
|
|
69
80
|
color: white;
|
|
70
|
-
|
|
71
|
-
|
|
81
|
+
animation: n-check-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
82
|
+
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
|
|
72
83
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
@keyframes n-check-pop {
|
|
85
|
+
0% {
|
|
86
|
+
transform: scale(0) rotate(-45deg);
|
|
87
|
+
opacity: 0;
|
|
88
|
+
}
|
|
89
|
+
50% {
|
|
90
|
+
transform: scale(1.3) rotate(0deg);
|
|
91
|
+
}
|
|
92
|
+
100% {
|
|
93
|
+
transform: scale(1) rotate(0deg);
|
|
94
|
+
opacity: 1;
|
|
95
|
+
}
|
|
76
96
|
}
|
|
77
|
-
|
|
78
|
-
@keyframes n-checkbox-pop {
|
|
79
|
-
0% { transform: scale(0); opacity: 0; }
|
|
80
|
-
50% { transform: scale(1.15); }
|
|
81
|
-
100% { transform: scale(1); opacity: 1; }
|
|
82
|
-
}
|
|
83
|
-
|
|
84
97
|
.n-checkbox-label {
|
|
85
|
-
font-size:
|
|
98
|
+
font-size: 0.875rem;
|
|
99
|
+
color: var(--n-color-text);
|
|
100
|
+
font-weight: 500;
|
|
101
|
+
line-height: 1.5;
|
|
102
|
+
transition: color 0.2s;
|
|
103
|
+
}
|
|
104
|
+
.is-checked .n-checkbox-label {
|
|
86
105
|
color: var(--n-color-text);
|
|
87
|
-
font-weight: var(--n-weight-medium);
|
|
88
106
|
}
|
|
89
|
-
|
|
90
107
|
.is-disabled {
|
|
91
|
-
opacity: 0.
|
|
108
|
+
opacity: 0.4;
|
|
92
109
|
cursor: not-allowed;
|
|
93
110
|
}
|
|
94
|
-
|
|
111
|
+
.is-disabled .n-checkbox-box {
|
|
112
|
+
background-color: var(--n-color-surface);
|
|
113
|
+
border-color: var(--n-color-primary);
|
|
114
|
+
box-shadow: none;
|
|
115
|
+
}
|
|
95
116
|
.n-checkbox:hover:not(.is-disabled) .n-checkbox-box {
|
|
96
117
|
border-color: var(--n-color-primary);
|
|
97
118
|
}
|
|
119
|
+
.is-checked .n-checkbox-box:active,
|
|
120
|
+
.is-indeterminate .n-checkbox-box:active {
|
|
121
|
+
transform: scale(0.92);
|
|
122
|
+
}
|
|
123
|
+
|
|
98
124
|
</style>
|
|
@@ -54,4 +54,5 @@ const removeAt = (index) => {
|
|
|
54
54
|
|
|
55
55
|
<style scoped>
|
|
56
56
|
.n-chips{display:flex;flex-wrap:wrap;gap:var(--n-space-2);align-items:center}.n-chip{display:inline-flex;align-items:center;gap:0.35rem;padding:0.25rem 0.5rem;border-radius:999px;background:var(--n-color-glass);border:1px solid var(--n-color-border);color:var(--n-color-text);font-size:var(--n-text-xs);line-height:1}.n-chip-remove{background:transparent;border:none;color:var(--n-color-text-muted);cursor:pointer;padding:0;border-radius:var(--n-radius-sm);line-height:1;display:flex;align-items:center}.n-chip-remove:hover:not(:disabled){color:var(--n-color-text)}.n-chip-remove:disabled{opacity:0.5;cursor:not-allowed}.is-disabled{opacity:0.6}
|
|
57
|
+
|
|
57
58
|
</style>
|