nexa-ui-kit 0.11.4 → 0.11.6
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 +20 -5
- package/dist/components/NAlert.nexa +20 -5
- package/dist/components/NAvatar.js +2 -0
- package/dist/components/NAvatar.nexa +2 -0
- package/dist/components/NBadge.js +5 -4
- package/dist/components/NBadge.nexa +5 -4
- package/dist/components/NBottomSheet.js +24 -22
- package/dist/components/NBottomSheet.nexa +9 -7
- package/dist/components/NButton.js +63 -18
- package/dist/components/NButton.nexa +63 -18
- package/dist/components/NCard.js +6 -5
- package/dist/components/NCard.nexa +6 -5
- package/dist/components/NCheckbox.js +62 -47
- package/dist/components/NCheckbox.nexa +46 -33
- package/dist/components/NDataTable.js +124 -100
- package/dist/components/NDataTable.nexa +39 -15
- package/dist/components/NInput.js +27 -6
- package/dist/components/NInput.nexa +27 -6
- package/dist/components/NModal.js +22 -9
- package/dist/components/NModal.nexa +22 -9
- package/dist/components/NMultiSelect.js +1 -1
- package/dist/components/NMultiSelect.nexa +1 -1
- package/dist/components/NPaginator.js +83 -1
- package/dist/components/NPaginator.nexa +83 -1
- package/dist/components/NProgressBar.js +11 -9
- package/dist/components/NProgressBar.nexa +11 -9
- package/dist/components/NRadio.js +24 -24
- package/dist/components/NRadio.nexa +11 -10
- package/dist/components/NSelect.js +38 -12
- package/dist/components/NSelect.nexa +38 -12
- package/dist/components/NSwitch.js +5 -3
- package/dist/components/NSwitch.nexa +5 -3
- package/dist/components/NTabs.js +14 -6
- package/dist/components/NTabs.nexa +14 -6
- package/dist/components/NTag.js +14 -5
- package/dist/components/NTag.nexa +14 -5
- package/dist/components/NToastContainer.js +11 -4
- package/dist/components/NToastContainer.nexa +11 -4
- package/dist/components/NTooltip.js +5 -4
- package/dist/components/NTooltip.nexa +5 -4
- package/dist/components/NTreeMenu.js +77 -34
- package/dist/components/NTreeMenu.nexa +55 -12
- package/dist/styles/theme.js +69 -55
- package/dist/styles/tokens.css +90 -74
- package/package.json +4 -4
- package/src/components/NAlert.nexa +20 -5
- package/src/components/NAvatar.nexa +2 -0
- package/src/components/NBadge.nexa +5 -4
- package/src/components/NBottomSheet.nexa +9 -7
- package/src/components/NButton.nexa +63 -18
- package/src/components/NCard.nexa +6 -5
- package/src/components/NCheckbox.nexa +46 -33
- package/src/components/NDataTable.nexa +39 -15
- package/src/components/NInput.nexa +27 -6
- package/src/components/NModal.nexa +22 -9
- package/src/components/NMultiSelect.nexa +1 -1
- package/src/components/NPaginator.nexa +83 -1
- package/src/components/NProgressBar.nexa +11 -9
- package/src/components/NRadio.nexa +11 -10
- package/src/components/NSelect.nexa +38 -12
- package/src/components/NSwitch.nexa +5 -3
- package/src/components/NTabs.nexa +14 -6
- package/src/components/NTag.nexa +14 -5
- package/src/components/NToastContainer.nexa +11 -4
- package/src/components/NTooltip.nexa +5 -4
- package/src/components/NTreeMenu.nexa +55 -12
- package/src/styles/theme.ts +69 -55
- package/src/styles/tokens.css +90 -74
|
@@ -67,9 +67,10 @@ const btnClass = computed(() => {
|
|
|
67
67
|
gap: var(--n-space-2);
|
|
68
68
|
font-family: var(--n-font-sans);
|
|
69
69
|
font-weight: var(--n-weight-semibold);
|
|
70
|
+
letter-spacing: 0.01em;
|
|
70
71
|
border-radius: var(--n-radius-md);
|
|
71
72
|
cursor: pointer;
|
|
72
|
-
transition: all
|
|
73
|
+
transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
|
|
73
74
|
border: 1px solid transparent;
|
|
74
75
|
outline: none;
|
|
75
76
|
white-space: nowrap;
|
|
@@ -78,16 +79,18 @@ const btnClass = computed(() => {
|
|
|
78
79
|
text-decoration: none;
|
|
79
80
|
line-height: var(--n-leading-normal, 1.5);
|
|
80
81
|
min-width: fit-content;
|
|
82
|
+
will-change: transform;
|
|
83
|
+
-webkit-tap-highlight-color: transparent;
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
.n-btn:focus-visible {
|
|
84
|
-
box-shadow: 0 0 0 3px var(--n-color-primary-light);
|
|
87
|
+
box-shadow: 0 0 0 3px var(--n-color-primary-light), 0 0 0 1px var(--n-color-primary);
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
/* Sizes */
|
|
88
|
-
.n-btn-sm { padding: 0.5rem 1.
|
|
89
|
-
.n-btn-md { padding: 0.
|
|
90
|
-
.n-btn-lg { padding:
|
|
91
|
+
.n-btn-sm { padding: 0.5rem 1.5rem; font-size: var(--n-text-sm); gap: var(--n-space-1); border-radius: var(--n-radius-sm); min-height: 36px; }
|
|
92
|
+
.n-btn-md { padding: 0.75rem 2rem; font-size: var(--n-text-base); min-height: 44px; }
|
|
93
|
+
.n-btn-lg { padding: 1rem 2.75rem; font-size: var(--n-text-lg); border-radius: var(--n-radius-lg); min-height: 52px; }
|
|
91
94
|
|
|
92
95
|
/* Block */
|
|
93
96
|
.is-block { width: 100%; }
|
|
@@ -95,18 +98,25 @@ const btnClass = computed(() => {
|
|
|
95
98
|
/* Rounded */
|
|
96
99
|
.is-rounded { border-radius: var(--n-radius-full); }
|
|
97
100
|
|
|
101
|
+
/* Active/Press */
|
|
102
|
+
.n-btn:active:not(:disabled) {
|
|
103
|
+
transform: scale(0.97);
|
|
104
|
+
}
|
|
105
|
+
|
|
98
106
|
/* Variant: Primary */
|
|
99
107
|
.n-btn-primary {
|
|
100
|
-
background: linear-gradient(135deg,
|
|
108
|
+
background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
|
|
101
109
|
color: white;
|
|
102
|
-
box-shadow:
|
|
110
|
+
box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.3);
|
|
111
|
+
text-shadow: 0 1px 2px rgba(0,0,0,0.2);
|
|
103
112
|
}
|
|
104
113
|
.n-btn-primary:hover:not(:disabled) {
|
|
105
|
-
transform: translateY(-
|
|
106
|
-
box-shadow: 0 8px
|
|
114
|
+
transform: translateY(-3px) scale(1.02);
|
|
115
|
+
box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.4), 0 0 40px rgba(99, 102, 241, 0.15);
|
|
107
116
|
}
|
|
108
117
|
.n-btn-primary:active:not(:disabled) {
|
|
109
|
-
transform: translateY(
|
|
118
|
+
transform: translateY(-1px) scale(0.98);
|
|
119
|
+
box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4), inset 0 2px 4px rgba(0,0,0,0.15);
|
|
110
120
|
}
|
|
111
121
|
|
|
112
122
|
/* Variant: Secondary */
|
|
@@ -118,6 +128,10 @@ const btnClass = computed(() => {
|
|
|
118
128
|
.n-btn-secondary:hover:not(:disabled) {
|
|
119
129
|
background: var(--n-color-surface-hover);
|
|
120
130
|
border-color: var(--n-color-border-hover);
|
|
131
|
+
transform: translateY(-1px);
|
|
132
|
+
}
|
|
133
|
+
.n-btn-secondary:active:not(:disabled) {
|
|
134
|
+
box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
|
|
121
135
|
}
|
|
122
136
|
|
|
123
137
|
/* Variant: Success */
|
|
@@ -131,7 +145,7 @@ const btnClass = computed(() => {
|
|
|
131
145
|
box-shadow: var(--n-shadow-glow-success);
|
|
132
146
|
}
|
|
133
147
|
.n-btn-success:active:not(:disabled) {
|
|
134
|
-
|
|
148
|
+
box-shadow: var(--n-shadow-glow-success), inset 0 1px 3px rgba(0,0,0,0.15);
|
|
135
149
|
}
|
|
136
150
|
|
|
137
151
|
/* Variant: Warning */
|
|
@@ -145,7 +159,7 @@ const btnClass = computed(() => {
|
|
|
145
159
|
box-shadow: var(--n-shadow-glow-warning);
|
|
146
160
|
}
|
|
147
161
|
.n-btn-warning:active:not(:disabled) {
|
|
148
|
-
|
|
162
|
+
box-shadow: var(--n-shadow-glow-warning), inset 0 1px 3px rgba(0,0,0,0.15);
|
|
149
163
|
}
|
|
150
164
|
|
|
151
165
|
/* Variant: Info */
|
|
@@ -159,7 +173,7 @@ const btnClass = computed(() => {
|
|
|
159
173
|
box-shadow: var(--n-shadow-glow-info);
|
|
160
174
|
}
|
|
161
175
|
.n-btn-info:active:not(:disabled) {
|
|
162
|
-
|
|
176
|
+
box-shadow: var(--n-shadow-glow-info), inset 0 1px 3px rgba(0,0,0,0.15);
|
|
163
177
|
}
|
|
164
178
|
|
|
165
179
|
/* Variant: Danger */
|
|
@@ -173,28 +187,46 @@ const btnClass = computed(() => {
|
|
|
173
187
|
box-shadow: var(--n-shadow-glow-danger);
|
|
174
188
|
}
|
|
175
189
|
.n-btn-danger:active:not(:disabled) {
|
|
176
|
-
|
|
190
|
+
box-shadow: var(--n-shadow-glow-danger), inset 0 1px 3px rgba(0,0,0,0.15);
|
|
177
191
|
}
|
|
178
192
|
|
|
179
193
|
/* Variant: Ghost */
|
|
180
194
|
.n-btn-ghost {
|
|
181
195
|
background: transparent;
|
|
196
|
+
backdrop-filter: blur(12px);
|
|
197
|
+
-webkit-backdrop-filter: blur(12px);
|
|
182
198
|
color: var(--n-color-text-secondary);
|
|
199
|
+
border-color: transparent;
|
|
183
200
|
}
|
|
184
201
|
.n-btn-ghost:hover:not(:disabled) {
|
|
185
202
|
background: var(--n-color-glass);
|
|
203
|
+
backdrop-filter: blur(12px);
|
|
204
|
+
-webkit-backdrop-filter: blur(12px);
|
|
186
205
|
color: var(--n-color-text);
|
|
206
|
+
border-color: var(--n-color-glass-border);
|
|
207
|
+
}
|
|
208
|
+
.n-btn-ghost:active:not(:disabled) {
|
|
209
|
+
background: var(--n-color-glass-hover);
|
|
210
|
+
box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
|
|
187
211
|
}
|
|
188
212
|
|
|
189
213
|
/* Variant: Outline */
|
|
190
214
|
.n-btn-outline {
|
|
191
215
|
background: transparent;
|
|
192
216
|
color: var(--n-color-primary);
|
|
193
|
-
border
|
|
217
|
+
border: 1.5px solid transparent;
|
|
218
|
+
background-image: linear-gradient(transparent, transparent), linear-gradient(135deg, var(--n-color-primary), var(--n-color-primary-hover));
|
|
219
|
+
background-origin: padding-box, border-box;
|
|
220
|
+
background-clip: padding-box, border-box;
|
|
194
221
|
}
|
|
195
222
|
.n-btn-outline:hover:not(:disabled) {
|
|
196
|
-
background: var(--n-color-primary-light);
|
|
197
|
-
|
|
223
|
+
background-image: linear-gradient(var(--n-color-primary-light), var(--n-color-primary-light)), linear-gradient(135deg, var(--n-color-primary-hover), var(--n-color-primary));
|
|
224
|
+
background-origin: padding-box, border-box;
|
|
225
|
+
background-clip: padding-box, border-box;
|
|
226
|
+
color: var(--n-color-primary-hover);
|
|
227
|
+
}
|
|
228
|
+
.n-btn-outline:active:not(:disabled) {
|
|
229
|
+
box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
|
|
198
230
|
}
|
|
199
231
|
|
|
200
232
|
/* Variant: Glass */
|
|
@@ -208,13 +240,26 @@ const btnClass = computed(() => {
|
|
|
208
240
|
background: var(--n-color-glass-hover);
|
|
209
241
|
border-color: var(--n-color-border-hover);
|
|
210
242
|
}
|
|
243
|
+
.n-btn-glass:active:not(:disabled) {
|
|
244
|
+
box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
|
|
245
|
+
}
|
|
211
246
|
|
|
212
247
|
/* Disabled */
|
|
213
248
|
.n-btn:disabled {
|
|
214
|
-
opacity: 0.45;
|
|
215
249
|
cursor: not-allowed;
|
|
216
250
|
transform: none !important;
|
|
217
251
|
box-shadow: none !important;
|
|
252
|
+
pointer-events: none;
|
|
253
|
+
opacity: 0.55;
|
|
254
|
+
}
|
|
255
|
+
.n-btn:disabled::after {
|
|
256
|
+
content: '';
|
|
257
|
+
position: absolute;
|
|
258
|
+
inset: 0;
|
|
259
|
+
border-radius: inherit;
|
|
260
|
+
background: var(--n-color-surface, #fff);
|
|
261
|
+
opacity: 0.3;
|
|
262
|
+
pointer-events: none;
|
|
218
263
|
}
|
|
219
264
|
|
|
220
265
|
/* Loader */
|
package/dist/components/NCard.js
CHANGED
|
@@ -53,16 +53,17 @@ export default _sfc_main
|
|
|
53
53
|
const __style = `.n-card[data-v-28bb4c76]{
|
|
54
54
|
background: var(--n-color-surface);
|
|
55
55
|
border: 1px solid var(--n-color-border);
|
|
56
|
-
border-radius: var(--n-radius-
|
|
56
|
+
border-radius: var(--n-radius-lg);
|
|
57
57
|
overflow: hidden;
|
|
58
|
-
transition: all
|
|
58
|
+
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
59
59
|
display: flex;
|
|
60
60
|
flex-direction: column;
|
|
61
|
+
will-change: transform, box-shadow;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
.is-elevated[data-v-28bb4c76]{
|
|
64
65
|
background: var(--n-color-surface-elevated);
|
|
65
|
-
box-shadow: var(--n-shadow-
|
|
66
|
+
box-shadow: var(--n-shadow-md);
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
.is-outlined[data-v-28bb4c76]{
|
|
@@ -78,9 +79,9 @@ const __style = `.n-card[data-v-28bb4c76]{
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
.n-card.is-hoverable[data-v-28bb4c76]:hover{
|
|
81
|
-
transform: translateY(-
|
|
82
|
+
transform: translateY(-2px);
|
|
82
83
|
border-color: var(--n-color-border-hover);
|
|
83
|
-
box-shadow: var(--n-shadow-
|
|
84
|
+
box-shadow: var(--n-shadow-lg);
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
.n-card-image[data-v-28bb4c76]{
|
|
@@ -32,16 +32,17 @@ const props = defineProps({
|
|
|
32
32
|
.n-card {
|
|
33
33
|
background: var(--n-color-surface);
|
|
34
34
|
border: 1px solid var(--n-color-border);
|
|
35
|
-
border-radius: var(--n-radius-
|
|
35
|
+
border-radius: var(--n-radius-lg);
|
|
36
36
|
overflow: hidden;
|
|
37
|
-
transition: all
|
|
37
|
+
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-direction: column;
|
|
40
|
+
will-change: transform, box-shadow;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
.is-elevated {
|
|
43
44
|
background: var(--n-color-surface-elevated);
|
|
44
|
-
box-shadow: var(--n-shadow-
|
|
45
|
+
box-shadow: var(--n-shadow-md);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
.is-outlined {
|
|
@@ -57,9 +58,9 @@ const props = defineProps({
|
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
.n-card.is-hoverable:hover {
|
|
60
|
-
transform: translateY(-
|
|
61
|
+
transform: translateY(-2px);
|
|
61
62
|
border-color: var(--n-color-border-hover);
|
|
62
|
-
box-shadow: var(--n-shadow-
|
|
63
|
+
box-shadow: var(--n-shadow-lg);
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
.n-card-image {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, hText, effect, defineComponent, registerComponent, reloadComponent, injectStyle } from 'nexa-framework'
|
|
2
2
|
|
|
3
3
|
const _sfc_main = defineComponent({
|
|
4
|
-
__scopeId: 'data-v-
|
|
4
|
+
__scopeId: 'data-v-50293982',
|
|
5
5
|
__hmrId: 'NCheckbox_nexa',
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: { type: Boolean, default: false },
|
|
@@ -22,91 +22,106 @@ const _sfc_main = defineComponent({
|
|
|
22
22
|
// Injected render function
|
|
23
23
|
_sfc_main.render = function(ctx) {
|
|
24
24
|
let { toggle, $slots, emit, modelValue, label, disabled, indeterminate, Fragment: _ntc_Fragment } = ctx
|
|
25
|
-
return h('label', { class: ["n-checkbox", { 'is-checked': modelValue && !indeterminate, 'is-indeterminate': indeterminate, 'is-disabled': disabled }], "data-v-
|
|
25
|
+
return h('label', { class: ["n-checkbox", { 'is-checked': modelValue && !indeterminate, 'is-indeterminate': indeterminate, 'is-disabled': disabled }], "data-v-50293982": "" }, [
|
|
26
26
|
"\n ",
|
|
27
|
-
h('div', { class: "n-checkbox-box", onClick: toggle, "data-v-
|
|
27
|
+
h('div', { class: "n-checkbox-box", onClick: toggle, "data-v-50293982": "" }, [
|
|
28
28
|
"\n ",
|
|
29
|
-
h('
|
|
29
|
+
(modelValue && !indeterminate) ? h('div', { class: "n-checkbox-check", "data-v-50293982": "" }, [
|
|
30
30
|
"\n ",
|
|
31
|
-
|
|
32
|
-
h('
|
|
33
|
-
])
|
|
34
|
-
h('path', { d: "M20 6L9 17l-5-5", "data-v-1e350f9a": "" })
|
|
35
|
-
]) : null,
|
|
31
|
+
h('svg', { viewBox: "0 0 24 24", width: "12", height: "12", fill: "none", stroke: "white", "stroke-width": "3", "stroke-linecap": "round", "stroke-linejoin": "round", focusable: "false", "data-v-50293982": "" }, [
|
|
32
|
+
h('path', { d: "M5 12l5 5L20 7", "data-v-50293982": "" })
|
|
33
|
+
]),
|
|
36
34
|
"\n "
|
|
35
|
+
]) : null,
|
|
36
|
+
(indeterminate) ? h('div', { class: "n-checkbox-check", "data-v-50293982": "" }, [
|
|
37
|
+
"\n ",
|
|
38
|
+
h('svg', { viewBox: "0 0 24 24", width: "12", height: "12", fill: "none", stroke: "white", "stroke-width": "3", "stroke-linecap": "round", focusable: "false", "data-v-50293982": "" }, [
|
|
39
|
+
h('line', { x1: "5", y1: "12", x2: "19", y2: "12", "data-v-50293982": "" })
|
|
37
40
|
]),
|
|
38
|
-
"\n
|
|
41
|
+
"\n "
|
|
42
|
+
]) : null
|
|
39
43
|
]),
|
|
40
44
|
"\n ",
|
|
41
|
-
(label) ? h('span', { class: "n-checkbox-label", "data-v-
|
|
45
|
+
(label) ? h('span', { class: "n-checkbox-label", "data-v-50293982": "" }, [
|
|
42
46
|
label
|
|
43
47
|
]) : null
|
|
44
48
|
])
|
|
45
49
|
}
|
|
46
|
-
_sfc_main.__scopeId = 'data-v-
|
|
50
|
+
_sfc_main.__scopeId = 'data-v-50293982'
|
|
47
51
|
_sfc_main.__hmrId = 'NCheckbox_nexa'
|
|
48
52
|
|
|
49
53
|
export default _sfc_main
|
|
50
54
|
|
|
51
|
-
const __style = `.n-checkbox[data-v-
|
|
55
|
+
const __style = `.n-checkbox[data-v-50293982]{
|
|
52
56
|
display: inline-flex;
|
|
53
57
|
align-items: center;
|
|
54
|
-
gap:
|
|
58
|
+
gap: 0.75rem;
|
|
55
59
|
cursor: pointer;
|
|
56
60
|
user-select: none;
|
|
61
|
+
padding: 0.375rem 0.5rem;
|
|
62
|
+
border-radius: 6px;
|
|
63
|
+
transition: background 0.15s;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.n-checkbox[data-v-50293982]:hover:not(.is-disabled){
|
|
67
|
+
background: rgba(99, 102, 241, 0.08);
|
|
57
68
|
}
|
|
58
69
|
|
|
59
|
-
.n-checkbox-box[data-v-
|
|
70
|
+
.n-checkbox-box[data-v-50293982]{
|
|
60
71
|
width: 20px;
|
|
61
72
|
height: 20px;
|
|
62
|
-
border:
|
|
63
|
-
border
|
|
73
|
+
border-radius: 6px;
|
|
74
|
+
border: 2px solid #475569;
|
|
64
75
|
display: flex;
|
|
65
76
|
align-items: center;
|
|
66
77
|
justify-content: center;
|
|
67
|
-
transition: all
|
|
78
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
79
|
+
background: #0f172a;
|
|
68
80
|
flex-shrink: 0;
|
|
69
|
-
background: transparent;
|
|
70
81
|
}
|
|
71
82
|
|
|
72
|
-
.is-checked .n-checkbox-box[data-v-
|
|
73
|
-
|
|
74
|
-
|
|
83
|
+
.is-checked .n-checkbox-box[data-v-50293982],
|
|
84
|
+
.is-indeterminate .n-checkbox-box[data-v-50293982]{
|
|
85
|
+
background: #6366f1;
|
|
86
|
+
border-color: #6366f1;
|
|
87
|
+
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 4px 12px rgba(99, 102, 241, 0.4);
|
|
75
88
|
}
|
|
76
89
|
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
|
|
90
|
+
.n-checkbox-check[data-v-50293982]{
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
animation: n-check 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
80
95
|
}
|
|
81
96
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
line-height: 1;
|
|
87
|
-
opacity: 0;
|
|
88
|
-
transform: scale(0);
|
|
89
|
-
transition: all var(--n-transition-fast);
|
|
97
|
+
@keyframes n-check {
|
|
98
|
+
0%[data-v-50293982]{ transform: scale(0); opacity: 0; }
|
|
99
|
+
50%[data-v-50293982]{ transform: scale(1.2); }
|
|
100
|
+
100%[data-v-50293982]{ transform: scale(1); opacity: 1; }
|
|
90
101
|
}
|
|
91
102
|
|
|
92
|
-
.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
103
|
+
.n-checkbox-label[data-v-50293982]{
|
|
104
|
+
font-size: 0.875rem;
|
|
105
|
+
color: #e2e8f0;
|
|
106
|
+
font-weight: 500;
|
|
107
|
+
line-height: 1.5;
|
|
96
108
|
}
|
|
97
109
|
|
|
98
|
-
.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
font-weight: var(--n-weight-medium);
|
|
110
|
+
.is-disabled[data-v-50293982]{
|
|
111
|
+
opacity: 0.4;
|
|
112
|
+
cursor: not-allowed;
|
|
102
113
|
}
|
|
103
114
|
|
|
104
|
-
.is-disabled[data-v-
|
|
105
|
-
|
|
106
|
-
|
|
115
|
+
.is-disabled .n-checkbox-box[data-v-50293982]{
|
|
116
|
+
background: #1e293b;
|
|
117
|
+
border-color: #334155;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.n-checkbox[data-v-50293982]:hover:not(.is-disabled) .n-checkbox-box{
|
|
121
|
+
border-color: #6366f1;
|
|
107
122
|
}
|
|
108
123
|
|
|
109
|
-
.n-checkbox[data-v-
|
|
110
|
-
|
|
124
|
+
.is-checked .n-checkbox-box[data-v-50293982]:active{
|
|
125
|
+
transform: scale(0.9);
|
|
111
126
|
}`
|
|
112
|
-
injectStyle('data-v-
|
|
127
|
+
injectStyle('data-v-50293982', __style)
|
|
@@ -17,10 +17,12 @@ const toggle = () => {
|
|
|
17
17
|
<template>
|
|
18
18
|
<label class="n-checkbox" :class="{ 'is-checked': modelValue && !indeterminate, 'is-indeterminate': indeterminate, 'is-disabled': disabled }">
|
|
19
19
|
<div class="n-checkbox-box" @click="toggle">
|
|
20
|
-
<
|
|
21
|
-
<svg
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
<div v-if="modelValue && !indeterminate" class="n-checkbox-check">
|
|
21
|
+
<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" focusable="false"><path d="M5 12l5 5L20 7"/></svg>
|
|
22
|
+
</div>
|
|
23
|
+
<div v-if="indeterminate" class="n-checkbox-check">
|
|
24
|
+
<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" focusable="false"><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
|
25
|
+
</div>
|
|
24
26
|
</div>
|
|
25
27
|
<span v-if="label" class="n-checkbox-label">{{ label }}</span>
|
|
26
28
|
</label>
|
|
@@ -30,62 +32,73 @@ const toggle = () => {
|
|
|
30
32
|
.n-checkbox {
|
|
31
33
|
display: inline-flex;
|
|
32
34
|
align-items: center;
|
|
33
|
-
gap:
|
|
35
|
+
gap: 0.75rem;
|
|
34
36
|
cursor: pointer;
|
|
35
37
|
user-select: none;
|
|
38
|
+
padding: 0.375rem 0.5rem;
|
|
39
|
+
border-radius: 6px;
|
|
40
|
+
transition: background 0.15s;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.n-checkbox:hover:not(.is-disabled) {
|
|
44
|
+
background: rgba(99, 102, 241, 0.08);
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
.n-checkbox-box {
|
|
39
48
|
width: 20px;
|
|
40
49
|
height: 20px;
|
|
41
|
-
border:
|
|
42
|
-
border
|
|
50
|
+
border-radius: 6px;
|
|
51
|
+
border: 2px solid #475569;
|
|
43
52
|
display: flex;
|
|
44
53
|
align-items: center;
|
|
45
54
|
justify-content: center;
|
|
46
|
-
transition: all
|
|
55
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
56
|
+
background: #0f172a;
|
|
47
57
|
flex-shrink: 0;
|
|
48
|
-
background: transparent;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.is-checked .n-checkbox-box {
|
|
52
|
-
background: var(--n-color-primary);
|
|
53
|
-
border-color: var(--n-color-primary);
|
|
54
58
|
}
|
|
55
59
|
|
|
60
|
+
.is-checked .n-checkbox-box,
|
|
56
61
|
.is-indeterminate .n-checkbox-box {
|
|
57
|
-
background:
|
|
58
|
-
border-color:
|
|
62
|
+
background: #6366f1;
|
|
63
|
+
border-color: #6366f1;
|
|
64
|
+
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 4px 12px rgba(99, 102, 241, 0.4);
|
|
59
65
|
}
|
|
60
66
|
|
|
61
|
-
.n-checkbox-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
opacity: 0;
|
|
67
|
-
transform: scale(0);
|
|
68
|
-
transition: all var(--n-transition-fast);
|
|
67
|
+
.n-checkbox-check {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
animation: n-check 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
transform: scale(1);
|
|
74
|
+
@keyframes n-check {
|
|
75
|
+
0% { transform: scale(0); opacity: 0; }
|
|
76
|
+
50% { transform: scale(1.2); }
|
|
77
|
+
100% { transform: scale(1); opacity: 1; }
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
.n-checkbox-label {
|
|
78
|
-
font-size:
|
|
79
|
-
color:
|
|
80
|
-
font-weight:
|
|
81
|
+
font-size: 0.875rem;
|
|
82
|
+
color: #e2e8f0;
|
|
83
|
+
font-weight: 500;
|
|
84
|
+
line-height: 1.5;
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
.is-disabled {
|
|
84
|
-
opacity: 0.
|
|
88
|
+
opacity: 0.4;
|
|
85
89
|
cursor: not-allowed;
|
|
86
90
|
}
|
|
87
91
|
|
|
92
|
+
.is-disabled .n-checkbox-box {
|
|
93
|
+
background: #1e293b;
|
|
94
|
+
border-color: #334155;
|
|
95
|
+
}
|
|
96
|
+
|
|
88
97
|
.n-checkbox:hover:not(.is-disabled) .n-checkbox-box {
|
|
89
|
-
border-color:
|
|
98
|
+
border-color: #6366f1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.is-checked .n-checkbox-box:active {
|
|
102
|
+
transform: scale(0.9);
|
|
90
103
|
}
|
|
91
104
|
</style>
|