nexa-ui-kit 0.11.6 → 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.
Files changed (95) hide show
  1. package/dist/components/NAlert.js +2 -14
  2. package/dist/components/NAlert.nexa +3 -14
  3. package/dist/components/NAutocomplete.js +1 -1
  4. package/dist/components/NAutocomplete.nexa +2 -1
  5. package/dist/components/NAvatar.js +0 -5
  6. package/dist/components/NAvatar.nexa +1 -5
  7. package/dist/components/NBadge.js +0 -6
  8. package/dist/components/NBadge.nexa +1 -6
  9. package/dist/components/NBottomSheet.js +0 -5
  10. package/dist/components/NBottomSheet.nexa +1 -5
  11. package/dist/components/NButton.js +202 -296
  12. package/dist/components/NButton.nexa +224 -320
  13. package/dist/components/NCard.js +39 -82
  14. package/dist/components/NCard.nexa +27 -71
  15. package/dist/components/NCheckbox.js +74 -63
  16. package/dist/components/NCheckbox.nexa +64 -44
  17. package/dist/components/NChips.nexa +1 -0
  18. package/dist/components/NDataTable.js +1 -313
  19. package/dist/components/NDataTable.nexa +2 -314
  20. package/dist/components/NDatepicker.js +4 -25
  21. package/dist/components/NDatepicker.nexa +5 -25
  22. package/dist/components/NForm.nexa +1 -0
  23. package/dist/components/NFormField.js +0 -5
  24. package/dist/components/NFormField.nexa +1 -5
  25. package/dist/components/NImage.js +1 -6
  26. package/dist/components/NImage.nexa +2 -6
  27. package/dist/components/NInput.js +96 -263
  28. package/dist/components/NInput.nexa +89 -259
  29. package/dist/components/NInputNumber.nexa +1 -1
  30. package/dist/components/NModal.js +1 -118
  31. package/dist/components/NModal.nexa +2 -119
  32. package/dist/components/NMultiSelect.js +1 -1
  33. package/dist/components/NMultiSelect.nexa +2 -1
  34. package/dist/components/NPaginator.js +1 -11
  35. package/dist/components/NPaginator.nexa +2 -11
  36. package/dist/components/NPassword.nexa +1 -0
  37. package/dist/components/NProgressBar.js +0 -11
  38. package/dist/components/NProgressBar.nexa +1 -11
  39. package/dist/components/NRadio.js +1 -8
  40. package/dist/components/NRadio.nexa +2 -8
  41. package/dist/components/NScrollView.js +0 -6
  42. package/dist/components/NScrollView.nexa +1 -6
  43. package/dist/components/NSelect.js +7 -35
  44. package/dist/components/NSelect.nexa +8 -35
  45. package/dist/components/NSkeleton.js +3 -9
  46. package/dist/components/NSkeleton.nexa +4 -9
  47. package/dist/components/NSwitch.js +0 -6
  48. package/dist/components/NSwitch.nexa +1 -6
  49. package/dist/components/NTabs.js +0 -11
  50. package/dist/components/NTabs.nexa +1 -11
  51. package/dist/components/NTag.js +1 -11
  52. package/dist/components/NTag.nexa +2 -11
  53. package/dist/components/NToastContainer.js +3 -27
  54. package/dist/components/NToastContainer.nexa +4 -27
  55. package/dist/components/NTooltip.js +0 -13
  56. package/dist/components/NTooltip.nexa +1 -13
  57. package/dist/components/NTreeMenu.js +1 -21
  58. package/dist/components/NTreeMenu.nexa +2 -21
  59. package/dist/components/NVirtualList.js +0 -2
  60. package/dist/components/NVirtualList.nexa +1 -2
  61. package/dist/styles/tokens.css +82 -173
  62. package/package.json +4 -4
  63. package/src/components/NAlert.nexa +3 -14
  64. package/src/components/NAutocomplete.nexa +2 -1
  65. package/src/components/NAvatar.nexa +1 -5
  66. package/src/components/NBadge.nexa +1 -6
  67. package/src/components/NBottomSheet.nexa +1 -5
  68. package/src/components/NButton.nexa +224 -320
  69. package/src/components/NCard.nexa +27 -71
  70. package/src/components/NCheckbox.nexa +64 -44
  71. package/src/components/NChips.nexa +1 -0
  72. package/src/components/NDataTable.nexa +2 -314
  73. package/src/components/NDatepicker.nexa +5 -25
  74. package/src/components/NForm.nexa +1 -0
  75. package/src/components/NFormField.nexa +1 -5
  76. package/src/components/NImage.nexa +2 -6
  77. package/src/components/NInput.nexa +89 -259
  78. package/src/components/NInputNumber.nexa +1 -1
  79. package/src/components/NModal.nexa +2 -119
  80. package/src/components/NMultiSelect.nexa +2 -1
  81. package/src/components/NPaginator.nexa +2 -11
  82. package/src/components/NPassword.nexa +1 -0
  83. package/src/components/NProgressBar.nexa +1 -11
  84. package/src/components/NRadio.nexa +2 -8
  85. package/src/components/NScrollView.nexa +1 -6
  86. package/src/components/NSelect.nexa +8 -35
  87. package/src/components/NSkeleton.nexa +4 -9
  88. package/src/components/NSwitch.nexa +1 -6
  89. package/src/components/NTabs.nexa +1 -11
  90. package/src/components/NTag.nexa +2 -11
  91. package/src/components/NToastContainer.nexa +4 -27
  92. package/src/components/NTooltip.nexa +1 -13
  93. package/src/components/NTreeMenu.nexa +2 -21
  94. package/src/components/NVirtualList.nexa +1 -2
  95. 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
- padding: { type: Boolean, default: true },
6
- compact: { type: Boolean, default: false },
5
+ elevated: { type: Boolean, default: true },
7
6
  hoverable: { type: Boolean, default: false },
8
- variant: { type: String, default: 'elevated' },
9
- image: { type: String, default: '' }
7
+ bordered: { type: Boolean, default: false }
10
8
  })
11
9
  </script>
12
10
 
13
11
  <template>
14
- <div :class="['n-card', `is-${variant}`, hoverable ? 'is-hoverable' : '', compact ? 'is-compact' : '']">
15
- <img v-if="image" :src="image" class="n-card-image" />
16
- <div v-if="title || $slots.header" class="n-card-header">
17
- <slot name="header">
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 :class="['n-card-body', padding ? 'has-padding' : '']">
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
- display: flex;
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
- .n-card.is-hoverable:hover {
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: var(--n-space-6);
75
- border-bottom: 1px solid var(--n-color-border);
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
- margin: 0;
88
- font-size: var(--n-text-xl);
89
- font-weight: var(--n-weight-bold);
46
+ font-size: 1.25rem;
47
+ font-weight: 700;
90
48
  color: var(--n-color-text);
91
- letter-spacing: var(--n-tracking-tight);
49
+ margin: 0 0 0.25rem 0;
50
+ letter-spacing: -0.01em;
92
51
  }
93
-
94
52
  .n-card-subtitle {
95
- margin: var(--n-space-1) 0 0 0;
96
- font-size: var(--n-text-sm);
97
- color: var(--n-color-text-secondary);
53
+ font-size: 0.875rem;
54
+ color: var(--n-color-text-muted);
55
+ margin: 0;
98
56
  }
99
-
100
- .n-card-body.has-padding {
101
- padding: var(--n-space-6);
57
+ .n-card-body {
58
+ padding: 1.5rem;
102
59
  }
103
-
104
60
  .n-card-footer {
105
- padding: var(--n-space-4) var(--n-space-6);
106
- background: var(--n-color-glass);
107
- border-top: 1px solid var(--n-color-border);
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="toggle">
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>
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>
@@ -35,70 +46,79 @@ const toggle = () => {
35
46
  gap: 0.75rem;
36
47
  cursor: pointer;
37
48
  user-select: none;
38
- padding: 0.375rem 0.5rem;
39
- border-radius: 6px;
40
- transition: background 0.15s;
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);
41
52
  }
42
-
43
53
  .n-checkbox:hover:not(.is-disabled) {
44
54
  background: rgba(99, 102, 241, 0.08);
55
+ transform: translateX(2px);
45
56
  }
46
-
47
57
  .n-checkbox-box {
48
- width: 20px;
49
- height: 20px;
50
- border-radius: 6px;
51
- border: 2px solid #475569;
58
+ width: 24px;
59
+ height: 24px;
60
+ border-radius: var(--n-radius-md);
61
+ border: 1px solid var(--n-color-border);
52
62
  display: flex;
53
63
  align-items: center;
54
64
  justify-content: center;
55
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
56
- background: #0f172a;
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);
57
67
  flex-shrink: 0;
68
+ position: relative;
58
69
  }
59
-
60
70
  .is-checked .n-checkbox-box,
61
71
  .is-indeterminate .n-checkbox-box {
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);
72
+ background-color: var(--n-color-primary);
73
+ border-color: var(--n-color-primary);
65
74
  }
66
-
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);
75
+ .is-animating .n-checkbox-box {
72
76
  }
73
-
74
- @keyframes n-check {
75
- 0% { transform: scale(0); opacity: 0; }
76
- 50% { transform: scale(1.2); }
77
- 100% { transform: scale(1); opacity: 1; }
77
+ .n-checkbox-icon {
78
+ width: 16px;
79
+ height: 16px;
80
+ color: white;
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));
83
+ }
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
+ }
78
96
  }
79
-
80
97
  .n-checkbox-label {
81
98
  font-size: 0.875rem;
82
- color: #e2e8f0;
99
+ color: var(--n-color-text);
83
100
  font-weight: 500;
84
101
  line-height: 1.5;
102
+ transition: color 0.2s;
103
+ }
104
+ .is-checked .n-checkbox-label {
105
+ color: var(--n-color-text);
85
106
  }
86
-
87
107
  .is-disabled {
88
108
  opacity: 0.4;
89
109
  cursor: not-allowed;
90
110
  }
91
-
92
111
  .is-disabled .n-checkbox-box {
93
- background: #1e293b;
94
- border-color: #334155;
112
+ background-color: var(--n-color-surface);
113
+ border-color: var(--n-color-primary);
114
+ box-shadow: none;
95
115
  }
96
-
97
116
  .n-checkbox:hover:not(.is-disabled) .n-checkbox-box {
98
- border-color: #6366f1;
117
+ border-color: var(--n-color-primary);
99
118
  }
100
-
101
- .is-checked .n-checkbox-box:active {
102
- transform: scale(0.9);
119
+ .is-checked .n-checkbox-box:active,
120
+ .is-indeterminate .n-checkbox-box:active {
121
+ transform: scale(0.92);
103
122
  }
123
+
104
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>