@aquera/nile-elements 0.0.1-beta.12 → 0.0.1-beta.14

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 (39) hide show
  1. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-button/nile-button.css.js +24 -162
  2. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-button/nile-button.css.js.map +1 -1
  3. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-button/nile-button.d.ts +1 -1
  4. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-button/nile-button.js +0 -2
  5. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-button/nile-button.js.map +1 -1
  6. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-input/nile-input.css.js +19 -25
  7. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-input/nile-input.css.js.map +1 -1
  8. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-input/nile-input.d.ts +2 -0
  9. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-input/nile-input.js +15 -0
  10. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
  11. package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  12. package/dist/nile-button/nile-button.cjs.js +1 -1
  13. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  14. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  15. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  16. package/dist/nile-button/nile-button.css.esm.js +26 -164
  17. package/dist/nile-button/nile-button.esm.js +1 -1
  18. package/dist/nile-input/nile-input.cjs.js +1 -1
  19. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  20. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  21. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  22. package/dist/nile-input/nile-input.css.esm.js +19 -25
  23. package/dist/nile-input/nile-input.esm.js +14 -5
  24. package/dist/src/nile-button/nile-button.css.js +24 -162
  25. package/dist/src/nile-button/nile-button.css.js.map +1 -1
  26. package/dist/src/nile-button/nile-button.d.ts +1 -1
  27. package/dist/src/nile-button/nile-button.js +0 -2
  28. package/dist/src/nile-button/nile-button.js.map +1 -1
  29. package/dist/src/nile-input/nile-input.css.js +19 -25
  30. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  31. package/dist/src/nile-input/nile-input.d.ts +2 -0
  32. package/dist/src/nile-input/nile-input.js +15 -0
  33. package/dist/src/nile-input/nile-input.js.map +1 -1
  34. package/dist/tsconfig.tsbuildinfo +1 -1
  35. package/package.json +1 -1
  36. package/src/nile-button/nile-button.css.ts +24 -162
  37. package/src/nile-button/nile-button.ts +1 -3
  38. package/src/nile-input/nile-input.css.ts +19 -25
  39. package/src/nile-input/nile-input.ts +13 -0
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent nile-elements following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "nile-elements",
6
- "version": "0.0.1-beta.12",
6
+ "version": "0.0.1-beta.14",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -20,27 +20,31 @@ export const styles = css`
20
20
 
21
21
  .button {
22
22
  display: inline-flex;
23
- align-items: stretch;
23
+ align-items: center;
24
24
  justify-content: center;
25
- width: 100%;
26
25
  border-style: solid;
27
26
  border-width: 1px;
28
27
  font-style: normal;
29
28
  font-weight: 400;
30
- font-size: var(--nile-font-size-base);
31
- line-height: var(--nile-font-size-base);
29
+ font-family: var(--nile-font-family-serif);
30
+ font-size: 14px;
32
31
  text-align: center;
33
32
  letter-spacing: 0.2px;
34
33
  text-decoration: none;
35
34
  user-select: none;
36
35
  white-space: nowrap;
37
36
  vertical-align: middle;
38
- padding: var(--nile-spacing-one-half-x);
39
37
  transition: var(--nile-transition-duration-default) background-color,
40
38
  var(--nile-transition-duration-default) color,
41
39
  var(--nile-transition-duration-default) border,
42
40
  var(--nile-transition-duration-default) box-shadow;
43
41
  cursor: inherit;
42
+ padding: 12px;
43
+ gap: 12px;
44
+ border-radius: var(--nile-radius-base-standard);
45
+ line-height: 14px;
46
+ box-sizing: border-box;
47
+ height: 38px;
44
48
  }
45
49
 
46
50
  .button::-moz-focus-inner {
@@ -65,38 +69,27 @@ export const styles = css`
65
69
  pointer-events: none;
66
70
  }
67
71
 
68
- .button__prefix,
69
- .button__suffix {
70
- flex: 0 0 auto;
71
- display: flex;
72
- align-items: center;
73
- pointer-events: none;
74
- }
75
- .button__label {
76
- display: inline-block;
77
- }
78
-
79
72
  .button__label::slotted(nile-icon) {
80
- vertical-align: -2px;
73
+ /* vertical-align: -2px; */
81
74
  }
82
75
 
83
76
  .button--standard.button--secondary {
84
77
  background-color: var(--nile-colors-neutral-400);
85
78
  border-color: var(--nile-colors-neutral-400);
86
- color: var(--nile-colors-neutral-700);
79
+ color: var(--nile-colors-neutral-900);
87
80
  }
88
81
 
89
82
  .button--standard.button--secondary:hover:not(.button--disabled) {
90
83
  background-color: var(--nile-colors-neutral-500);
91
- border-color: var(--nile-colors-neutral-500);
84
+ border : none;
92
85
  box-shadow: 0px 4px 8px var(--nile-colors-dark-200);
93
- color: var(--nile-colors-neutral-700);
86
+ color: var(--nile-colors-neutral-900);
94
87
  }
95
88
 
96
89
  .button--standard.button--secondary:active:not(.button--disabled) {
97
90
  background-color: var(--nile-colors-neutral-500);
98
91
  border-color: var(--nile-colors-neutral-700);
99
- color: var(--nile-colors-neutral-700);
92
+ color: var(--nile-colors-neutral-900);
100
93
  }
101
94
 
102
95
  .button--standard.button--secondary.button--disabled {
@@ -135,17 +128,17 @@ export const styles = css`
135
128
  }
136
129
 
137
130
  .button--standard.button--primary.button--disabled {
138
- background-color: var(--nile-colors-primary-600);
139
- border-color: var(--nile-colors-primary-600);
140
- color: var(--nile-colors-neutral-700);
131
+ background-color: #777d82;
132
+ border-color: #777d82;
133
+ color: #fff;
141
134
  cursor: not-allowed;
142
135
  }
143
136
 
144
137
  .button--standard.button--primary.button--disabled:hover,
145
138
  .button--standard.button--primary.button--disabled:active {
146
- background-color: var(--nile-colors-primary-600);
147
- border-color: var(--nile-colors-primary-600);
148
- color: var(--nile-colors-neutral-700);
139
+ background-color: #777d82;
140
+ border-color: #777d82;
141
+ color: #fff;
149
142
  box-shadow: none;
150
143
  }
151
144
 
@@ -170,8 +163,8 @@ export const styles = css`
170
163
  color: var(--nile-colors-neutral-700);
171
164
  }
172
165
  .button--standard.button--tertiary.button--disabled {
173
- background-color: var(--nile-colors-white-base);
174
- border-color: var(--nile-colors-neutral-400);
166
+ border-color: #e5e9eb;
167
+ background-color: #fff;
175
168
  color: var(--nile-colors-neutral-700);
176
169
  cursor: not-allowed;
177
170
  box-shadow: none;
@@ -179,8 +172,8 @@ export const styles = css`
179
172
 
180
173
  .button--standard.button--tertiary.button--disabled:hover,
181
174
  .button--standard.button--tertiary.button--disabled:active {
182
- background-color: var(--nile-colors-white-base);
183
- border-color: var(--nile-colors-neutral-400);
175
+ border-color: #e5e9eb;
176
+ background-color: #fff;
184
177
  color: var(--nile-colors-neutral-700);
185
178
  box-shadow: none;
186
179
  }
@@ -203,51 +196,6 @@ export const styles = css`
203
196
  color: var(--nile-colors-white-base);
204
197
  }
205
198
 
206
- .button--standard.button--tertiary.button--disabled {
207
- background-color: var(--nile-colors-neutral-100);
208
- border-color: var(--nile-colors-neutral-100);
209
- color: var(--nile-colors-neutral-400);
210
- cursor: not-allowed;
211
- box-shadow: none;
212
- }
213
-
214
- .button--standard.button--tertiary.button--disabled:hover,
215
- .button--standard.button--tertiary.button--disabled:active {
216
- background-color: var(--nile-colors-neutral-100);
217
- border-color: var(--nile-colors-neutral-100);
218
- color: var(--nile-colors-neutral-400);
219
- box-shadow: none;
220
- }
221
-
222
- /*
223
- * Size modifiers
224
- */
225
-
226
- .button--small {
227
- height: auto;
228
- min-height: 24px;
229
- font-size: 0.875rem;
230
- line-height: calc(24px - var(--nile-spacing-one-half-x) * 2);
231
- border-radius: var(--nile-radius-base-standard);
232
- }
233
-
234
- .button--medium {
235
- height: auto;
236
- min-height: 38px;
237
- font-size: 0.875rem;
238
- line-height: calc(38px - var(--nile-spacing-one-half-x) * 2);
239
- font-size: var(--nile-font-size-base);
240
- border-radius: var(--nile-radius-base-standard);
241
- }
242
-
243
- .button--large {
244
- height: auto;
245
- min-height: 40px;
246
- font-size: 1rem;
247
- line-height: calc(40px - var(--nile-spacing-one-half-x) * 2);
248
- border-radius: 6px;
249
- }
250
-
251
199
  /*
252
200
  * Pill modifier
253
201
  */
@@ -260,10 +208,6 @@ export const styles = css`
260
208
  border-radius: 32px;
261
209
  }
262
210
 
263
- .button--pill.button--large {
264
- border-radius: 40px;
265
- }
266
-
267
211
  /*
268
212
  * Circle modifier
269
213
  */
@@ -285,12 +229,6 @@ export const styles = css`
285
229
  border-radius: 50%;
286
230
  }
287
231
 
288
- .button--circle.button--large {
289
- width: 40px;
290
- height: 40px;
291
- border-radius: 50%;
292
- }
293
-
294
232
  .button--circle .button__prefix,
295
233
  .button--circle .button__suffix,
296
234
  .button--circle .button__caret {
@@ -343,80 +281,4 @@ export const styles = css`
343
281
  translate: 50% -50%;
344
282
  pointer-events: none;
345
283
  }
346
-
347
- .button--rtl ::slotted(nile-badge) {
348
- right: auto;
349
- left: 0;
350
- translate: -50% -50%;
351
- }
352
-
353
- /*
354
- * Button spacing
355
- */
356
-
357
- .button--has-label.button--small .button__label {
358
- padding: 0 var(--nile-spacing-one-half-x);
359
- }
360
-
361
- .button--has-label.button--medium .button__label {
362
- padding: 0 var(--nile-spacing-2-x);
363
- }
364
-
365
- .button--has-label.button--large .button__label {
366
- padding: 0 var(--nile-spacing-3-x);
367
- }
368
-
369
- .button--has-prefix.button--small {
370
- padding-inline-start: var(--nile-spacing-one-half-x);
371
- }
372
-
373
- .button--has-prefix.button--small .button__label {
374
- padding-inline-start: var(--nile-spacing-one-half-x);
375
- }
376
-
377
- .button--has-prefix.button--medium {
378
- padding-inline-start: var(--nile-spacing-2-x);
379
- }
380
-
381
- .button--has-prefix.button--medium .button__label {
382
- padding-inline-start: var(--nile-spacing-2-x);
383
- }
384
-
385
- .button--has-prefix.button--large {
386
- padding-inline-start: var(--nile-spacing-2-x);
387
- }
388
-
389
- .button--has-prefix.button--large .button__label {
390
- padding-inline-start: var(--nile-spacing-2-x);
391
- }
392
-
393
- .button--has-suffix.button--small,
394
- .button--caret.button--small {
395
- padding-inline-end: var(--nile-spacing-one-half-x);
396
- }
397
-
398
- .button--has-suffix.button--small .button__label,
399
- .button--caret.button--small .button__label {
400
- padding-inline-end: var(--nile-spacing-one-half-x);
401
- }
402
-
403
- .button--has-suffix.button--medium,
404
- .button--caret.button--medium {
405
- padding-inline-end: var(--nile-spacing-2-x);
406
- }
407
-
408
- .button--has-suffix.button--medium .button__label,
409
- .button--caret.button--medium .button__label {
410
- padding-inline-end: var(--nile-spacing-2-x);
411
- }
412
-
413
- .button--has-suffix.button--large,
414
- .button--caret.button--large {
415
- padding-inline-end: var(--nile-spacing-2-x);
416
- }
417
-
418
- .button--has-suffix.button--large .button__label,
419
- .button--caret.button--large .button__label {
420
- padding-inline-end: var(--nile-spacing-2-x);
421
- }
422
284
  `;
@@ -65,7 +65,7 @@ export class NileButton extends NileElement implements NileFormControl {
65
65
  @property({ reflect: true }) variant: 'primary' | 'secondary' | 'tertiary' | 'caution' = 'primary';
66
66
 
67
67
  /** The button's size. */
68
- @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';
68
+ @property({ reflect: true }) size: 'medium' = 'medium';
69
69
 
70
70
  /** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */
71
71
  @property({ type: Boolean, reflect: true }) caret = false;
@@ -290,9 +290,7 @@ export class NileButton extends NileElement implements NileFormControl {
290
290
  'button--secondary': this.variant === 'secondary',
291
291
  'button--tertiary': this.variant === 'tertiary',
292
292
  'button--caution': this.variant === 'caution',
293
- 'button--small': this.size === 'small',
294
293
  'button--medium': this.size === 'medium',
295
- 'button--large': this.size === 'large',
296
294
  'button--caret': this.caret,
297
295
  'button--circle': this.circle,
298
296
  'button--disabled': this.disabled,
@@ -27,19 +27,11 @@ export const styles = css`
27
27
  .form-control--has-label .form-control__label {
28
28
  display: inline-block;
29
29
  color: inherit;
30
- margin-bottom: 0.125rem;
31
- }
32
-
33
- .form-control--has-label.form-control--small .form-control__label {
34
- font-size: 0.875rem;
30
+ margin-bottom: 12px;
35
31
  }
36
32
 
37
33
  .form-control--has-label.form-control--medium .form-control__label {
38
- font-size: 1rem;
39
- }
40
-
41
- .form-control--has-label.form-control--large .form-control__label {
42
- font-size: 1.25rem;
34
+ font-size: 14px;
43
35
  }
44
36
 
45
37
  :host([required]) .form-control--has-label .form-control__label::after {
@@ -51,20 +43,23 @@ export const styles = css`
51
43
  /* Help text */
52
44
  .form-control--has-help-text .form-control__help-text {
53
45
  display: block;
54
- color: hsl(240 3.8% 46.1%);
55
- margin-top: 0.125rem;
46
+ color: #7F7F7F;
47
+ margin-top: 6px;
56
48
  }
57
49
 
58
- .form-control--has-help-text.form-control--small .form-control__help-text {
59
- font-size: 0.75rem;
50
+ /* Error message */
51
+ .form-control__error-message {
52
+ display: block;
53
+ color: #A4121C;
54
+ margin-top: 12px;
55
+ font-size: 12px;
56
+ font-style: normal;
57
+ line-height: 12px;
58
+ letter-spacing: 0.2px;
60
59
  }
61
60
 
62
61
  .form-control--has-help-text.form-control--medium .form-control__help-text {
63
- font-size: 0.875rem;
64
- }
65
-
66
- .form-control--has-help-text.form-control--large .form-control__help-text {
67
- font-size: 1rem;
62
+ font-size: 10.24px;
68
63
  }
69
64
 
70
65
  .form-control--has-help-text.form-control--radio-group
@@ -97,13 +92,12 @@ export const styles = css`
97
92
 
98
93
  .input--standard:hover:not(.input--disabled) {
99
94
  background-color: hsl(0, 0%, 100%);
100
- border-color: #000000;
95
+ border-color: #000;
101
96
  }
102
97
 
103
98
  .input--standard.input--focused:not(.input--disabled) {
104
99
  background-color: hsl(0, 0%, 100%);
105
100
  border-color: #005ea6;
106
- box-shadow: 0 0 0 3px hsl(198.6 88.7% 48.4% / 40%);
107
101
  }
108
102
 
109
103
  .input--standard.input--focused:not(.input--disabled) .input__control {
@@ -111,8 +105,8 @@ export const styles = css`
111
105
  }
112
106
 
113
107
  .input--standard.input--disabled {
114
- background-color: hsl(240 4.8% 95.9%);
115
- border-color: hsl(240 4.9% 83.9%);
108
+ background-color: #fff;
109
+ border-color: #c7ced4;
116
110
  opacity: 0.5;
117
111
  cursor: not-allowed;
118
112
  }
@@ -304,11 +298,11 @@ export const styles = css`
304
298
  }
305
299
 
306
300
  .input--medium .input__prefix::slotted(*) {
307
- margin-inline-start: 1rem;
301
+ margin-inline-start: 12px;
308
302
  }
309
303
 
310
304
  .input--medium .input__suffix::slotted(*) {
311
- margin-inline-end: 1rem;
305
+ margin-inline-end: 12px;
312
306
  }
313
307
 
314
308
  .input--large {
@@ -91,6 +91,9 @@ export class NileInput extends NileElement implements NileFormControl {
91
91
  /** The input's help text. If you need to display HTML, use the `help-text` slot instead. */
92
92
  @property({ attribute: 'help-text' }) helpText = '';
93
93
 
94
+ /** The input's error message. If you need to display HTML, use the `error-message` slot instead. */
95
+ @property({ attribute: 'error-message' }) errorMessage = '';
96
+
94
97
  /** Adds a clear button when the input is not empty. */
95
98
  @property({ type: Boolean }) clearable = false;
96
99
 
@@ -395,6 +398,7 @@ export class NileInput extends NileElement implements NileFormControl {
395
398
  const hasHelpTextSlot = this.hasSlotController.test('help-text');
396
399
  const hasLabel = this.label ? true : !!hasLabelSlot;
397
400
  const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
401
+ const hasErrorMessage = this.errorMessage ? true : false;
398
402
  const hasClearIcon =
399
403
  this.clearable && !this.disabled && !this.readonly && (typeof this.value === 'number' || this.value.length > 0);
400
404
 
@@ -536,6 +540,15 @@ export class NileInput extends NileElement implements NileFormControl {
536
540
  >
537
541
  ${this.helpText}
538
542
  </slot>
543
+ <slot
544
+ name="error-message"
545
+ part="form-control-error-message"
546
+ id="error-message"
547
+ class="form-control__error-message"
548
+ aria-hidden=${hasErrorMessage ? 'false' : 'true'}
549
+ >
550
+ ${this.errorMessage}
551
+ </slot>
539
552
  </div>
540
553
  </div>
541
554
  `;