noph-ui 0.26.1 → 0.26.3

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.
@@ -40,8 +40,9 @@
40
40
  errorRaw && 'error',
41
41
  disabled && 'disabled',
42
42
  required && !noAsterisk && 'asterisk',
43
- (value === undefined || value === '' || value === null) && 'is-empty',
44
- animateLabel && 'label-animate',
43
+ !value && 'is-empty',
44
+ animateLabel && 'animate-label',
45
+ attributes.class,
45
46
  ]}
46
47
  aria-disabled={disabled}
47
48
  >
@@ -63,12 +64,14 @@
63
64
  </div>
64
65
  <div class="np-select-state-layer"></div>
65
66
  {/if}
66
- <svg class="arrow" height="5" viewBox="7 10 10 5" focusable="false">
67
+ <svg class="arrow" height="6" viewBox="7 10 10 5" focusable="false">
67
68
  <polygon stroke="none" fill-rule="evenodd" points="7 10 12 15 17 10"></polygon>
68
69
  </svg>
69
70
  <select
70
- onchange={(event) => {
71
- animateLabel = true
71
+ oninput={(event) => {
72
+ if ((!value && event.currentTarget.value) || (value && !event.currentTarget.value)) {
73
+ animateLabel = true
74
+ }
72
75
  onchange?.(event)
73
76
  }}
74
77
  oninvalid={(event) => {
@@ -86,6 +89,7 @@
86
89
  aria-invalid={error}
87
90
  bind:value
88
91
  {...attributes}
92
+ class="np-select"
89
93
  >
90
94
  {@render children?.()}
91
95
  </select>
@@ -103,11 +107,10 @@
103
107
  position: relative;
104
108
  font-size: 1rem;
105
109
  display: inline-block;
106
- min-width: 200px;
107
110
  color: var(--np-color-on-surface-variant);
108
111
  }
109
112
 
110
- select {
113
+ .np-select {
111
114
  all: unset;
112
115
  &,
113
116
  &::picker(select) {
@@ -145,13 +148,15 @@
145
148
  }
146
149
 
147
150
  .outlined select {
148
- padding: 1rem;
151
+ padding-inline-start: 1rem;
152
+ padding-block: 1rem;
153
+ padding-inline-end: 3.25rem;
149
154
  }
150
155
 
151
156
  .filled select {
152
- padding-inline: 1rem;
157
+ padding-inline-start: 1rem;
153
158
  padding-block-start: 1.5rem;
154
- padding-block-end: 0.5rem;
159
+ padding-inline-end: 3.25rem;
155
160
  }
156
161
 
157
162
  .np-select-outline {
@@ -197,11 +202,13 @@
197
202
  }
198
203
 
199
204
  .arrow {
205
+ padding-inline: 0.375rem;
206
+ padding-block: 0.5625rem;
200
207
  fill: currentColor;
201
208
  position: absolute;
202
209
  pointer-events: none;
203
210
  inset-inline-end: 0.75rem;
204
- inset-block-start: calc(1.75rem - 3px);
211
+ inset-block-start: 1rem;
205
212
  transition: rotate var(--easing-fast);
206
213
  }
207
214
 
@@ -294,7 +301,7 @@
294
301
  transform: translateY(0.5rem);
295
302
  }
296
303
 
297
- .label-animate label {
304
+ .animate-label label {
298
305
  transition-property: font-size;
299
306
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
300
307
  transition-duration: 150ms;
@@ -304,7 +311,7 @@
304
311
  color: var(--np-color-primary);
305
312
  }
306
313
 
307
- .label-animate:not(.is-empty) .np-select-outline label {
314
+ .animate-label:not(.is-empty) .np-select-outline label {
308
315
  animation: slideUpOutline 150ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
309
316
  }
310
317
 
@@ -317,7 +324,7 @@
317
324
  }
318
325
  }
319
326
 
320
- .label-animate:not(.is-empty) .np-select-filled label {
327
+ .animate-label:not(.is-empty) .np-select-filled label {
321
328
  animation: slideUpFilled 150ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
322
329
  }
323
330
 
@@ -337,7 +344,7 @@
337
344
  position: absolute;
338
345
  }
339
346
 
340
- .is-empty.label-animate .np-select-outline label {
347
+ .is-empty.animate-label .np-select-outline label {
341
348
  animation: slideDownOutline 150ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
342
349
  }
343
350
 
@@ -355,7 +362,7 @@
355
362
  transform: translateY(1.25rem);
356
363
  }
357
364
 
358
- .is-empty.label-animate .np-select-filled label {
365
+ .is-empty.animate-label .np-select-filled label {
359
366
  animation: slideDownFilled 150ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
360
367
  }
361
368
 
@@ -25,7 +25,6 @@
25
25
  <style>
26
26
  option {
27
27
  all: unset;
28
- cursor: pointer;
29
28
  position: relative;
30
29
  display: flex;
31
30
  padding: 0.5rem 1rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.26.1",
3
+ "version": "0.26.3",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {