@aquera/nile-elements 0.0.1-beta.12 → 0.0.1-beta.13
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/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-button/nile-button.css.js +24 -162
- package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-button/nile-button.css.js.map +1 -1
- package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-button/nile-button.d.ts +1 -1
- package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-button/nile-button.js +0 -2
- package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-button/nile-button.js.map +1 -1
- package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-input/nile-input.css.js +2 -2
- package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/.rollup.cache/Users/ravisankar/repos/design-system/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/nile-button/nile-button.cjs.js +1 -1
- package/dist/nile-button/nile-button.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.css.cjs.js +1 -1
- package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.css.esm.js +26 -164
- package/dist/nile-button/nile-button.esm.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.esm.js +2 -2
- package/dist/src/nile-button/nile-button.css.js +24 -162
- package/dist/src/nile-button/nile-button.css.js.map +1 -1
- package/dist/src/nile-button/nile-button.d.ts +1 -1
- package/dist/src/nile-button/nile-button.js +0 -2
- package/dist/src/nile-button/nile-button.js.map +1 -1
- package/dist/src/nile-input/nile-input.css.js +2 -2
- package/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-button/nile-button.css.ts +24 -162
- package/src/nile-button/nile-button.ts +1 -3
- package/src/nile-input/nile-input.css.ts +2 -2
@@ -18,27 +18,31 @@ export const styles = css `
|
|
18
18
|
|
19
19
|
.button {
|
20
20
|
display: inline-flex;
|
21
|
-
align-items:
|
21
|
+
align-items: center;
|
22
22
|
justify-content: center;
|
23
|
-
width: 100%;
|
24
23
|
border-style: solid;
|
25
24
|
border-width: 1px;
|
26
25
|
font-style: normal;
|
27
26
|
font-weight: 400;
|
28
|
-
font-
|
29
|
-
|
27
|
+
font-family: var(--nile-font-family-serif);
|
28
|
+
font-size: 14px;
|
30
29
|
text-align: center;
|
31
30
|
letter-spacing: 0.2px;
|
32
31
|
text-decoration: none;
|
33
32
|
user-select: none;
|
34
33
|
white-space: nowrap;
|
35
34
|
vertical-align: middle;
|
36
|
-
padding: var(--nile-spacing-one-half-x);
|
37
35
|
transition: var(--nile-transition-duration-default) background-color,
|
38
36
|
var(--nile-transition-duration-default) color,
|
39
37
|
var(--nile-transition-duration-default) border,
|
40
38
|
var(--nile-transition-duration-default) box-shadow;
|
41
39
|
cursor: inherit;
|
40
|
+
padding: 12px;
|
41
|
+
gap: 12px;
|
42
|
+
border-radius: var(--nile-radius-base-standard);
|
43
|
+
line-height: 14px;
|
44
|
+
box-sizing: border-box;
|
45
|
+
height: 38px;
|
42
46
|
}
|
43
47
|
|
44
48
|
.button::-moz-focus-inner {
|
@@ -63,38 +67,27 @@ export const styles = css `
|
|
63
67
|
pointer-events: none;
|
64
68
|
}
|
65
69
|
|
66
|
-
.button__prefix,
|
67
|
-
.button__suffix {
|
68
|
-
flex: 0 0 auto;
|
69
|
-
display: flex;
|
70
|
-
align-items: center;
|
71
|
-
pointer-events: none;
|
72
|
-
}
|
73
|
-
.button__label {
|
74
|
-
display: inline-block;
|
75
|
-
}
|
76
|
-
|
77
70
|
.button__label::slotted(nile-icon) {
|
78
|
-
vertical-align: -2px;
|
71
|
+
/* vertical-align: -2px; */
|
79
72
|
}
|
80
73
|
|
81
74
|
.button--standard.button--secondary {
|
82
75
|
background-color: var(--nile-colors-neutral-400);
|
83
76
|
border-color: var(--nile-colors-neutral-400);
|
84
|
-
color: var(--nile-colors-neutral-
|
77
|
+
color: var(--nile-colors-neutral-900);
|
85
78
|
}
|
86
79
|
|
87
80
|
.button--standard.button--secondary:hover:not(.button--disabled) {
|
88
81
|
background-color: var(--nile-colors-neutral-500);
|
89
|
-
border
|
82
|
+
border : none;
|
90
83
|
box-shadow: 0px 4px 8px var(--nile-colors-dark-200);
|
91
|
-
color: var(--nile-colors-neutral-
|
84
|
+
color: var(--nile-colors-neutral-900);
|
92
85
|
}
|
93
86
|
|
94
87
|
.button--standard.button--secondary:active:not(.button--disabled) {
|
95
88
|
background-color: var(--nile-colors-neutral-500);
|
96
89
|
border-color: var(--nile-colors-neutral-700);
|
97
|
-
color: var(--nile-colors-neutral-
|
90
|
+
color: var(--nile-colors-neutral-900);
|
98
91
|
}
|
99
92
|
|
100
93
|
.button--standard.button--secondary.button--disabled {
|
@@ -133,17 +126,17 @@ export const styles = css `
|
|
133
126
|
}
|
134
127
|
|
135
128
|
.button--standard.button--primary.button--disabled {
|
136
|
-
background-color:
|
137
|
-
border-color:
|
138
|
-
color:
|
129
|
+
background-color: #777d82;
|
130
|
+
border-color: #777d82;
|
131
|
+
color: #fff;
|
139
132
|
cursor: not-allowed;
|
140
133
|
}
|
141
134
|
|
142
135
|
.button--standard.button--primary.button--disabled:hover,
|
143
136
|
.button--standard.button--primary.button--disabled:active {
|
144
|
-
background-color:
|
145
|
-
border-color:
|
146
|
-
color:
|
137
|
+
background-color: #777d82;
|
138
|
+
border-color: #777d82;
|
139
|
+
color: #fff;
|
147
140
|
box-shadow: none;
|
148
141
|
}
|
149
142
|
|
@@ -168,8 +161,8 @@ export const styles = css `
|
|
168
161
|
color: var(--nile-colors-neutral-700);
|
169
162
|
}
|
170
163
|
.button--standard.button--tertiary.button--disabled {
|
171
|
-
|
172
|
-
|
164
|
+
border-color: #e5e9eb;
|
165
|
+
background-color: #fff;
|
173
166
|
color: var(--nile-colors-neutral-700);
|
174
167
|
cursor: not-allowed;
|
175
168
|
box-shadow: none;
|
@@ -177,8 +170,8 @@ export const styles = css `
|
|
177
170
|
|
178
171
|
.button--standard.button--tertiary.button--disabled:hover,
|
179
172
|
.button--standard.button--tertiary.button--disabled:active {
|
180
|
-
|
181
|
-
|
173
|
+
border-color: #e5e9eb;
|
174
|
+
background-color: #fff;
|
182
175
|
color: var(--nile-colors-neutral-700);
|
183
176
|
box-shadow: none;
|
184
177
|
}
|
@@ -201,51 +194,6 @@ export const styles = css `
|
|
201
194
|
color: var(--nile-colors-white-base);
|
202
195
|
}
|
203
196
|
|
204
|
-
.button--standard.button--tertiary.button--disabled {
|
205
|
-
background-color: var(--nile-colors-neutral-100);
|
206
|
-
border-color: var(--nile-colors-neutral-100);
|
207
|
-
color: var(--nile-colors-neutral-400);
|
208
|
-
cursor: not-allowed;
|
209
|
-
box-shadow: none;
|
210
|
-
}
|
211
|
-
|
212
|
-
.button--standard.button--tertiary.button--disabled:hover,
|
213
|
-
.button--standard.button--tertiary.button--disabled:active {
|
214
|
-
background-color: var(--nile-colors-neutral-100);
|
215
|
-
border-color: var(--nile-colors-neutral-100);
|
216
|
-
color: var(--nile-colors-neutral-400);
|
217
|
-
box-shadow: none;
|
218
|
-
}
|
219
|
-
|
220
|
-
/*
|
221
|
-
* Size modifiers
|
222
|
-
*/
|
223
|
-
|
224
|
-
.button--small {
|
225
|
-
height: auto;
|
226
|
-
min-height: 24px;
|
227
|
-
font-size: 0.875rem;
|
228
|
-
line-height: calc(24px - var(--nile-spacing-one-half-x) * 2);
|
229
|
-
border-radius: var(--nile-radius-base-standard);
|
230
|
-
}
|
231
|
-
|
232
|
-
.button--medium {
|
233
|
-
height: auto;
|
234
|
-
min-height: 38px;
|
235
|
-
font-size: 0.875rem;
|
236
|
-
line-height: calc(38px - var(--nile-spacing-one-half-x) * 2);
|
237
|
-
font-size: var(--nile-font-size-base);
|
238
|
-
border-radius: var(--nile-radius-base-standard);
|
239
|
-
}
|
240
|
-
|
241
|
-
.button--large {
|
242
|
-
height: auto;
|
243
|
-
min-height: 40px;
|
244
|
-
font-size: 1rem;
|
245
|
-
line-height: calc(40px - var(--nile-spacing-one-half-x) * 2);
|
246
|
-
border-radius: 6px;
|
247
|
-
}
|
248
|
-
|
249
197
|
/*
|
250
198
|
* Pill modifier
|
251
199
|
*/
|
@@ -258,10 +206,6 @@ export const styles = css `
|
|
258
206
|
border-radius: 32px;
|
259
207
|
}
|
260
208
|
|
261
|
-
.button--pill.button--large {
|
262
|
-
border-radius: 40px;
|
263
|
-
}
|
264
|
-
|
265
209
|
/*
|
266
210
|
* Circle modifier
|
267
211
|
*/
|
@@ -283,12 +227,6 @@ export const styles = css `
|
|
283
227
|
border-radius: 50%;
|
284
228
|
}
|
285
229
|
|
286
|
-
.button--circle.button--large {
|
287
|
-
width: 40px;
|
288
|
-
height: 40px;
|
289
|
-
border-radius: 50%;
|
290
|
-
}
|
291
|
-
|
292
230
|
.button--circle .button__prefix,
|
293
231
|
.button--circle .button__suffix,
|
294
232
|
.button--circle .button__caret {
|
@@ -341,81 +279,5 @@ export const styles = css `
|
|
341
279
|
translate: 50% -50%;
|
342
280
|
pointer-events: none;
|
343
281
|
}
|
344
|
-
|
345
|
-
.button--rtl ::slotted(nile-badge) {
|
346
|
-
right: auto;
|
347
|
-
left: 0;
|
348
|
-
translate: -50% -50%;
|
349
|
-
}
|
350
|
-
|
351
|
-
/*
|
352
|
-
* Button spacing
|
353
|
-
*/
|
354
|
-
|
355
|
-
.button--has-label.button--small .button__label {
|
356
|
-
padding: 0 var(--nile-spacing-one-half-x);
|
357
|
-
}
|
358
|
-
|
359
|
-
.button--has-label.button--medium .button__label {
|
360
|
-
padding: 0 var(--nile-spacing-2-x);
|
361
|
-
}
|
362
|
-
|
363
|
-
.button--has-label.button--large .button__label {
|
364
|
-
padding: 0 var(--nile-spacing-3-x);
|
365
|
-
}
|
366
|
-
|
367
|
-
.button--has-prefix.button--small {
|
368
|
-
padding-inline-start: var(--nile-spacing-one-half-x);
|
369
|
-
}
|
370
|
-
|
371
|
-
.button--has-prefix.button--small .button__label {
|
372
|
-
padding-inline-start: var(--nile-spacing-one-half-x);
|
373
|
-
}
|
374
|
-
|
375
|
-
.button--has-prefix.button--medium {
|
376
|
-
padding-inline-start: var(--nile-spacing-2-x);
|
377
|
-
}
|
378
|
-
|
379
|
-
.button--has-prefix.button--medium .button__label {
|
380
|
-
padding-inline-start: var(--nile-spacing-2-x);
|
381
|
-
}
|
382
|
-
|
383
|
-
.button--has-prefix.button--large {
|
384
|
-
padding-inline-start: var(--nile-spacing-2-x);
|
385
|
-
}
|
386
|
-
|
387
|
-
.button--has-prefix.button--large .button__label {
|
388
|
-
padding-inline-start: var(--nile-spacing-2-x);
|
389
|
-
}
|
390
|
-
|
391
|
-
.button--has-suffix.button--small,
|
392
|
-
.button--caret.button--small {
|
393
|
-
padding-inline-end: var(--nile-spacing-one-half-x);
|
394
|
-
}
|
395
|
-
|
396
|
-
.button--has-suffix.button--small .button__label,
|
397
|
-
.button--caret.button--small .button__label {
|
398
|
-
padding-inline-end: var(--nile-spacing-one-half-x);
|
399
|
-
}
|
400
|
-
|
401
|
-
.button--has-suffix.button--medium,
|
402
|
-
.button--caret.button--medium {
|
403
|
-
padding-inline-end: var(--nile-spacing-2-x);
|
404
|
-
}
|
405
|
-
|
406
|
-
.button--has-suffix.button--medium .button__label,
|
407
|
-
.button--caret.button--medium .button__label {
|
408
|
-
padding-inline-end: var(--nile-spacing-2-x);
|
409
|
-
}
|
410
|
-
|
411
|
-
.button--has-suffix.button--large,
|
412
|
-
.button--caret.button--large {
|
413
|
-
padding-inline-end: var(--nile-spacing-2-x);
|
414
|
-
}
|
415
|
-
|
416
|
-
.button--has-suffix.button--large .button__label,
|
417
|
-
.button--caret.button--large .button__label {
|
418
|
-
padding-inline-end: var(--nile-spacing-2-x);
|
419
|
-
}
|
420
282
|
`;
|
421
283
|
//# sourceMappingURL=nile-button.css.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-button.css.js","sourceRoot":"","sources":["../../../src/nile-button/nile-button.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyZxB,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Button CSS\n */\nexport const styles = css`\n :host {\n display: inline-block;\n position: relative;\n width: auto;\n cursor: pointer;\n }\n\n .button {\n display: inline-flex;\n align-items: stretch;\n justify-content: center;\n width: 100%;\n border-style: solid;\n border-width: 1px;\n font-style: normal;\n font-weight: 400;\n font-size: var(--nile-font-size-base);\n line-height: var(--nile-font-size-base);\n text-align: center;\n letter-spacing: 0.2px;\n text-decoration: none;\n user-select: none;\n white-space: nowrap;\n vertical-align: middle;\n padding: var(--nile-spacing-one-half-x);\n transition: var(--nile-transition-duration-default) background-color,\n var(--nile-transition-duration-default) color,\n var(--nile-transition-duration-default) border,\n var(--nile-transition-duration-default) box-shadow;\n cursor: inherit;\n }\n\n .button::-moz-focus-inner {\n border: 0;\n }\n\n .button:focus {\n outline: none;\n }\n\n .button:focus-visible {\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: 2px;\n }\n\n .button--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .button--disabled * {\n pointer-events: none;\n }\n\n .button__prefix,\n .button__suffix {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n pointer-events: none;\n }\n .button__label {\n display: inline-block;\n }\n\n .button__label::slotted(nile-icon) {\n vertical-align: -2px;\n }\n\n .button--standard.button--secondary {\n background-color: var(--nile-colors-neutral-400);\n border-color: var(--nile-colors-neutral-400);\n color: var(--nile-colors-neutral-700);\n }\n\n .button--standard.button--secondary:hover:not(.button--disabled) {\n background-color: var(--nile-colors-neutral-500);\n border-color: var(--nile-colors-neutral-500);\n box-shadow: 0px 4px 8px var(--nile-colors-dark-200);\n color: var(--nile-colors-neutral-700);\n }\n\n .button--standard.button--secondary:active:not(.button--disabled) {\n background-color: var(--nile-colors-neutral-500);\n border-color: var(--nile-colors-neutral-700);\n color: var(--nile-colors-neutral-700);\n }\n\n .button--standard.button--secondary.button--disabled {\n background-color: var(--nile-colors-neutral-400);\n border-color: var(--nile-colors-neutral-400);\n color: var(--nile-colors-dark-500);\n cursor: not-allowed;\n }\n\n .button--standard.button--secondary.button--disabled:hover,\n .button--standard.button--secondary.button--disabled:active {\n background-color: var(--nile-colors-neutral-400);\n border-color: var(--nile-colors-neutral-400);\n color: var(--nile-colors-dark-500);\n box-shadow: none;\n }\n\n /* Primary */\n .button--standard.button--primary {\n background-color: var(--nile-colors-primary-600);\n border-color: var(--nile-colors-primary-600);\n color: var(--nile-colors-white-base);\n }\n\n .button--standard.button--primary:hover:not(.button--disabled) {\n background-color: var(--nile-colors-primary-700);\n border-color: var(--nile-colors-primary-700);\n box-shadow: 0px 4px 8px var(--nile-colors-dark-200);\n color: var(--nile-colors-white-base);\n }\n\n .button--standard.button--primary:active:not(.button--disabled) {\n background-color: var(--nile-colors-primary-700);\n border-color: var(--nile-colors-primary-900);\n color: var(--nile-colors-white-base);\n }\n\n .button--standard.button--primary.button--disabled {\n background-color: var(--nile-colors-primary-600);\n border-color: var(--nile-colors-primary-600);\n color: var(--nile-colors-neutral-700);\n cursor: not-allowed;\n }\n\n .button--standard.button--primary.button--disabled:hover,\n .button--standard.button--primary.button--disabled:active {\n background-color: var(--nile-colors-primary-600);\n border-color: var(--nile-colors-primary-600);\n color: var(--nile-colors-neutral-700);\n box-shadow: none;\n }\n\n /* Tertiary */\n .button--standard.button--tertiary {\n background-color: var(--nile-colors-white-base);\n border-color: var(--nile-colors-neutral-500);\n color: var(--nile-colors-neutral-700);\n box-shadow: 0px 2px 4px var(--nile-colors-dark-200);\n }\n\n .button--standard.button--tertiary:hover:not(.button--disabled) {\n background-color: var(--nile-colors-neutral-100);\n border-color: var(--nile-colors-neutral-500);\n box-shadow: 0px 4px 8px var(--nile-colors-dark-200);\n color: var(--nile-colors-neutral-700);\n }\n\n .button--standard.button--tertiary:active:not(.button--disabled) {\n background-color: var(--nile-colors-neutral-400);\n border-color: var(--nile-colors-neutral-700);\n color: var(--nile-colors-neutral-700);\n }\n .button--standard.button--tertiary.button--disabled {\n background-color: var(--nile-colors-white-base);\n border-color: var(--nile-colors-neutral-400);\n color: var(--nile-colors-neutral-700);\n cursor: not-allowed;\n box-shadow: none;\n }\n\n .button--standard.button--tertiary.button--disabled:hover,\n .button--standard.button--tertiary.button--disabled:active {\n background-color: var(--nile-colors-white-base);\n border-color: var(--nile-colors-neutral-400);\n color: var(--nile-colors-neutral-700);\n box-shadow: none;\n }\n\n /* caution */\n .button--standard.button--caution {\n background-color: var(--nile-colors-red-500);\n border-color: var(--nile-colors-red-500);\n color: var(--nile-colors-white-base);\n }\n .button--standard.button--caution:hover:not(.button--disabled) {\n background-color: var(--nile-colors-red-700);\n border-color: var(--nile-colors-red-700);\n color: var(--nile-colors-white-base);\n }\n\n .button--standard.button--caution:active:not(.button--disabled) {\n background-color: var(--nile-colors-red-700);\n border-color: var(--nile-colors-red-500);\n color: var(--nile-colors-white-base);\n }\n\n .button--standard.button--tertiary.button--disabled {\n background-color: var(--nile-colors-neutral-100);\n border-color: var(--nile-colors-neutral-100);\n color: var(--nile-colors-neutral-400);\n cursor: not-allowed;\n box-shadow: none;\n }\n\n .button--standard.button--tertiary.button--disabled:hover,\n .button--standard.button--tertiary.button--disabled:active {\n background-color: var(--nile-colors-neutral-100);\n border-color: var(--nile-colors-neutral-100);\n color: var(--nile-colors-neutral-400);\n box-shadow: none;\n }\n\n /*\n * Size modifiers\n */\n\n .button--small {\n height: auto;\n min-height: 24px;\n font-size: 0.875rem;\n line-height: calc(24px - var(--nile-spacing-one-half-x) * 2);\n border-radius: var(--nile-radius-base-standard);\n }\n\n .button--medium {\n height: auto;\n min-height: 38px;\n font-size: 0.875rem;\n line-height: calc(38px - var(--nile-spacing-one-half-x) * 2);\n font-size: var(--nile-font-size-base);\n border-radius: var(--nile-radius-base-standard);\n }\n\n .button--large {\n height: auto;\n min-height: 40px;\n font-size: 1rem;\n line-height: calc(40px - var(--nile-spacing-one-half-x) * 2);\n border-radius: 6px;\n }\n\n /*\n * Pill modifier\n */\n\n .button--pill.button--small {\n border-radius: 24px;\n }\n\n .button--pill.button--medium {\n border-radius: 32px;\n }\n\n .button--pill.button--large {\n border-radius: 40px;\n }\n\n /*\n * Circle modifier\n */\n\n .button--circle {\n padding-left: 0;\n padding-right: 0;\n }\n\n .button--circle.button--small {\n width: 24px;\n height: 24px;\n border-radius: 50%;\n }\n\n .button--circle.button--medium {\n width: 38px;\n height: 38px;\n border-radius: 50%;\n }\n\n .button--circle.button--large {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n }\n\n .button--circle .button__prefix,\n .button--circle .button__suffix,\n .button--circle .button__caret {\n display: none;\n }\n\n /* Caret modifier */\n\n .button--caret .button__suffix {\n display: none;\n }\n\n .button--caret .button__caret {\n height: auto;\n }\n\n /*\n * Loading modifier\n */\n\n .button--loading {\n position: relative;\n cursor: wait;\n }\n\n .button--loading .button__prefix,\n .button--loading .button__label,\n .button--loading .button__suffix,\n .button--loading .button__caret {\n visibility: hidden;\n }\n\n .button--loading nile-spinner {\n --indicator-color: currentColor;\n position: absolute;\n font-size: 1em;\n height: 1em;\n width: 1em;\n top: calc(50% - 0.5em);\n left: calc(50% - 0.5em);\n }\n /*\n * Badges\n */\n\n .button ::slotted(nile-badge) {\n position: absolute;\n top: 0;\n right: 0;\n translate: 50% -50%;\n pointer-events: none;\n }\n\n .button--rtl ::slotted(nile-badge) {\n right: auto;\n left: 0;\n translate: -50% -50%;\n }\n\n /*\n * Button spacing\n */\n\n .button--has-label.button--small .button__label {\n padding: 0 var(--nile-spacing-one-half-x);\n }\n\n .button--has-label.button--medium .button__label {\n padding: 0 var(--nile-spacing-2-x);\n }\n\n .button--has-label.button--large .button__label {\n padding: 0 var(--nile-spacing-3-x);\n }\n\n .button--has-prefix.button--small {\n padding-inline-start: var(--nile-spacing-one-half-x);\n }\n\n .button--has-prefix.button--small .button__label {\n padding-inline-start: var(--nile-spacing-one-half-x);\n }\n\n .button--has-prefix.button--medium {\n padding-inline-start: var(--nile-spacing-2-x);\n }\n\n .button--has-prefix.button--medium .button__label {\n padding-inline-start: var(--nile-spacing-2-x);\n }\n\n .button--has-prefix.button--large {\n padding-inline-start: var(--nile-spacing-2-x);\n }\n\n .button--has-prefix.button--large .button__label {\n padding-inline-start: var(--nile-spacing-2-x);\n }\n\n .button--has-suffix.button--small,\n .button--caret.button--small {\n padding-inline-end: var(--nile-spacing-one-half-x);\n }\n\n .button--has-suffix.button--small .button__label,\n .button--caret.button--small .button__label {\n padding-inline-end: var(--nile-spacing-one-half-x);\n }\n\n .button--has-suffix.button--medium,\n .button--caret.button--medium {\n padding-inline-end: var(--nile-spacing-2-x);\n }\n\n .button--has-suffix.button--medium .button__label,\n .button--caret.button--medium .button__label {\n padding-inline-end: var(--nile-spacing-2-x);\n }\n\n .button--has-suffix.button--large,\n .button--caret.button--large {\n padding-inline-end: var(--nile-spacing-2-x);\n }\n\n .button--has-suffix.button--large .button__label,\n .button--caret.button--large .button__label {\n padding-inline-end: var(--nile-spacing-2-x);\n }\n`;\n"]}
|
1
|
+
{"version":3,"file":"nile-button.css.js","sourceRoot":"","sources":["../../../src/nile-button/nile-button.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+QxB,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Button CSS\n */\nexport const styles = css`\n :host {\n display: inline-block;\n position: relative;\n width: auto;\n cursor: pointer;\n }\n\n .button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-style: solid;\n border-width: 1px;\n font-style: normal;\n font-weight: 400;\n font-family: var(--nile-font-family-serif);\n font-size: 14px;\n text-align: center;\n letter-spacing: 0.2px;\n text-decoration: none;\n user-select: none;\n white-space: nowrap;\n vertical-align: middle;\n transition: var(--nile-transition-duration-default) background-color,\n var(--nile-transition-duration-default) color,\n var(--nile-transition-duration-default) border,\n var(--nile-transition-duration-default) box-shadow;\n cursor: inherit;\n padding: 12px;\n gap: 12px;\n border-radius: var(--nile-radius-base-standard);\n line-height: 14px;\n box-sizing: border-box;\n height: 38px;\n }\n\n .button::-moz-focus-inner {\n border: 0;\n }\n\n .button:focus {\n outline: none;\n }\n\n .button:focus-visible {\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: 2px;\n }\n\n .button--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .button--disabled * {\n pointer-events: none;\n }\n\n .button__label::slotted(nile-icon) {\n /* vertical-align: -2px; */\n }\n\n .button--standard.button--secondary {\n background-color: var(--nile-colors-neutral-400);\n border-color: var(--nile-colors-neutral-400);\n color: var(--nile-colors-neutral-900);\n }\n\n .button--standard.button--secondary:hover:not(.button--disabled) {\n background-color: var(--nile-colors-neutral-500);\n border : none;\n box-shadow: 0px 4px 8px var(--nile-colors-dark-200);\n color: var(--nile-colors-neutral-900);\n }\n\n .button--standard.button--secondary:active:not(.button--disabled) {\n background-color: var(--nile-colors-neutral-500);\n border-color: var(--nile-colors-neutral-700);\n color: var(--nile-colors-neutral-900);\n }\n\n .button--standard.button--secondary.button--disabled {\n background-color: var(--nile-colors-neutral-400);\n border-color: var(--nile-colors-neutral-400);\n color: var(--nile-colors-dark-500);\n cursor: not-allowed;\n }\n\n .button--standard.button--secondary.button--disabled:hover,\n .button--standard.button--secondary.button--disabled:active {\n background-color: var(--nile-colors-neutral-400);\n border-color: var(--nile-colors-neutral-400);\n color: var(--nile-colors-dark-500);\n box-shadow: none;\n }\n\n /* Primary */\n .button--standard.button--primary {\n background-color: var(--nile-colors-primary-600);\n border-color: var(--nile-colors-primary-600);\n color: var(--nile-colors-white-base);\n }\n\n .button--standard.button--primary:hover:not(.button--disabled) {\n background-color: var(--nile-colors-primary-700);\n border-color: var(--nile-colors-primary-700);\n box-shadow: 0px 4px 8px var(--nile-colors-dark-200);\n color: var(--nile-colors-white-base);\n }\n\n .button--standard.button--primary:active:not(.button--disabled) {\n background-color: var(--nile-colors-primary-700);\n border-color: var(--nile-colors-primary-900);\n color: var(--nile-colors-white-base);\n }\n\n .button--standard.button--primary.button--disabled {\n background-color: #777d82;\n border-color: #777d82;\n color: #fff;\n cursor: not-allowed;\n }\n\n .button--standard.button--primary.button--disabled:hover,\n .button--standard.button--primary.button--disabled:active {\n background-color: #777d82;\n border-color: #777d82;\n color: #fff;\n box-shadow: none;\n }\n\n /* Tertiary */\n .button--standard.button--tertiary {\n background-color: var(--nile-colors-white-base);\n border-color: var(--nile-colors-neutral-500);\n color: var(--nile-colors-neutral-700);\n box-shadow: 0px 2px 4px var(--nile-colors-dark-200);\n }\n\n .button--standard.button--tertiary:hover:not(.button--disabled) {\n background-color: var(--nile-colors-neutral-100);\n border-color: var(--nile-colors-neutral-500);\n box-shadow: 0px 4px 8px var(--nile-colors-dark-200);\n color: var(--nile-colors-neutral-700);\n }\n\n .button--standard.button--tertiary:active:not(.button--disabled) {\n background-color: var(--nile-colors-neutral-400);\n border-color: var(--nile-colors-neutral-700);\n color: var(--nile-colors-neutral-700);\n }\n .button--standard.button--tertiary.button--disabled {\n border-color: #e5e9eb;\n background-color: #fff;\n color: var(--nile-colors-neutral-700);\n cursor: not-allowed;\n box-shadow: none;\n }\n\n .button--standard.button--tertiary.button--disabled:hover,\n .button--standard.button--tertiary.button--disabled:active {\n border-color: #e5e9eb;\n background-color: #fff;\n color: var(--nile-colors-neutral-700);\n box-shadow: none;\n }\n\n /* caution */\n .button--standard.button--caution {\n background-color: var(--nile-colors-red-500);\n border-color: var(--nile-colors-red-500);\n color: var(--nile-colors-white-base);\n }\n .button--standard.button--caution:hover:not(.button--disabled) {\n background-color: var(--nile-colors-red-700);\n border-color: var(--nile-colors-red-700);\n color: var(--nile-colors-white-base);\n }\n\n .button--standard.button--caution:active:not(.button--disabled) {\n background-color: var(--nile-colors-red-700);\n border-color: var(--nile-colors-red-500);\n color: var(--nile-colors-white-base);\n }\n\n /*\n * Pill modifier\n */\n\n .button--pill.button--small {\n border-radius: 24px;\n }\n\n .button--pill.button--medium {\n border-radius: 32px;\n }\n\n /*\n * Circle modifier\n */\n\n .button--circle {\n padding-left: 0;\n padding-right: 0;\n }\n\n .button--circle.button--small {\n width: 24px;\n height: 24px;\n border-radius: 50%;\n }\n\n .button--circle.button--medium {\n width: 38px;\n height: 38px;\n border-radius: 50%;\n }\n\n .button--circle .button__prefix,\n .button--circle .button__suffix,\n .button--circle .button__caret {\n display: none;\n }\n\n /* Caret modifier */\n\n .button--caret .button__suffix {\n display: none;\n }\n\n .button--caret .button__caret {\n height: auto;\n }\n\n /*\n * Loading modifier\n */\n\n .button--loading {\n position: relative;\n cursor: wait;\n }\n\n .button--loading .button__prefix,\n .button--loading .button__label,\n .button--loading .button__suffix,\n .button--loading .button__caret {\n visibility: hidden;\n }\n\n .button--loading nile-spinner {\n --indicator-color: currentColor;\n position: absolute;\n font-size: 1em;\n height: 1em;\n width: 1em;\n top: calc(50% - 0.5em);\n left: calc(50% - 0.5em);\n }\n /*\n * Badges\n */\n\n .button ::slotted(nile-badge) {\n position: absolute;\n top: 0;\n right: 0;\n translate: 50% -50%;\n pointer-events: none;\n }\n`;\n"]}
|
@@ -35,7 +35,7 @@ export declare class NileButton extends NileElement implements NileFormControl {
|
|
35
35
|
/** The button's theme variant. */
|
36
36
|
variant: 'primary' | 'secondary' | 'tertiary' | 'caution';
|
37
37
|
/** The button's size. */
|
38
|
-
size: '
|
38
|
+
size: 'medium';
|
39
39
|
/** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */
|
40
40
|
caret: boolean;
|
41
41
|
/** Disables the button. */
|
@@ -214,9 +214,7 @@ let NileButton = class NileButton extends NileElement {
|
|
214
214
|
'button--secondary': this.variant === 'secondary',
|
215
215
|
'button--tertiary': this.variant === 'tertiary',
|
216
216
|
'button--caution': this.variant === 'caution',
|
217
|
-
'button--small': this.size === 'small',
|
218
217
|
'button--medium': this.size === 'medium',
|
219
|
-
'button--large': this.size === 'large',
|
220
218
|
'button--caret': this.caret,
|
221
219
|
'button--circle': this.circle,
|
222
220
|
'button--disabled': this.disabled,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-button.js","sourceRoot":"","sources":["../../../src/nile-button/nile-button.ts"],"names":[],"mappings":";AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,WAAW;IAA3C;;QAGmB,0BAAqB,GAAG,IAAI,qBAAqB,CAAC,IAAI,EAAE;YACvE,IAAI,EAAE,KAAK,CAAC,EAAE;gBACZ,kHAAkH;gBAClH,2CAA2C;gBAC3C,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;oBAC9B,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,EAA2B,CAAC;oBACzD,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAE,CAAC;oBAC3C,OAAO,GAAG,CAAC,cAAc,CAAC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,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAgB;AAM/C;IAAX,QAAQ,EAAE;wCAAgD;AAM/C;IAAX,QAAQ,EAAE;wCAAW;AAMV;IAAX,QAAQ,EAAE;yCAAY;AAGX;IAAX,QAAQ,EAAE;wCAAW;AAGV;IAAX,QAAQ,EAAE;0CAAiD;AAQhD;IAAX,QAAQ,EAAE;uCAA6B;AAG5B;IAAX,QAAQ,EAAE;4CAAmB;AAMlB;IAAX,QAAQ,EAAE;wCAAc;AAGc;IAAtC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAAoB;AAI1D;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CACiD;AAGjD;IAAtC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAA4B;AAGR;IAAzD,QAAQ,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAyB;AAG3C;IAAtC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAA8D;AA+EpG;IADC,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;sDAMjD;AAhMU,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAyStB;SAzSY,UAAU;AA2SvB,eAAe,UAAU,CAAC","sourcesContent":["import '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { FormControlController, validValidityState } from '../internal/form';\nimport { HasSlotController } from '../internal/slot';\nimport { html, literal } from 'lit/static-html.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { watch } from '../internal/watch';\nimport { styles } from './nile-button.css';\nimport type { CSSResultGroup } from 'lit';\nimport type { NileFormControl } from '../internal/nile-element';\nimport NileElement from '../internal/nile-element';\n\n/**\n * @summary Buttons represent actions that are available to the user.\n * @status stable\n * @since 2.0\n *\n * @dependency nile-icon\n * @dependency nile-spinner\n *\n * @event nile-blur - Emitted when the button loses focus.\n * @event nile-focus - Emitted when the button gains focus.\n * @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @slot - The button's label.\n * @slot prefix - A presentational prefix icon or similar element.\n * @slot suffix - A presentational suffix icon or similar element.\n *\n * @csspart base - The component's base wrapper.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart label - The button's label.\n * @csspart suffix - The container that wraps the suffix.\n * @csspart caret - The button's caret icon, an `<nile-icon>` element.\n */\n\n@customElement('nile-button')\nexport class NileButton extends NileElement implements NileFormControl {\n static styles: CSSResultGroup = styles;\n\n private readonly formControlController = new FormControlController(this, {\n form: input => {\n // Buttons support a form attribute that points to an arbitrary form, so if this attribute is set we need to query\n // the form from the same root using its id\n if (input.hasAttribute('form')) {\n const doc = input.getRootNode() as Document | ShadowRoot;\n const formId = input.getAttribute('form')!;\n return doc.getElementById(formId) as HTMLFormElement;\n }\n\n // Fall back to the closest containing form\n return input.closest('form');\n },\n assumeInteractionOn: ['click']\n });\n private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');\n\n @query('.button') button: HTMLButtonElement | HTMLLinkElement;\n\n @state() private hasFocus = false;\n @state() invalid = false;\n @property() title = ''; // make reactive to pass through\n\n /** The button's theme variant. */\n @property({ reflect: true }) variant: 'primary' | 'secondary' | 'tertiary' | 'caution' = 'primary';\n\n /** The button's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */\n @property({ type: Boolean, reflect: true }) caret = false;\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the button in a loading state. */\n @property({ type: Boolean, reflect: true }) loading = false;\n\n /** Draws an outlined button. */\n @property({ type: Boolean, reflect: true }) outline = false;\n\n /** Draws a pill-style button with rounded edges. */\n @property({ type: Boolean, reflect: true }) pill = false;\n\n /**\n * Draws a circular icon button. When this attribute is present, the button expects a single `<nile-icon>` in the\n * default slot.\n */\n @property({ type: Boolean, reflect: true }) circle = false;\n\n /**\n * The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native\n * `<button>` elements behave. When the type is `submit`, the button will submit the surrounding form.\n */\n @property() type: 'button' | 'submit' | 'reset' = 'button';\n\n /**\n * The name of the button, submitted as a name/value pair with form data, but only when this button is the submitter.\n * This attribute is ignored when `href` is present.\n */\n @property() name = '';\n\n /**\n * The value of the button, submitted as a pair with the button's name as part of the form data, but only when this\n * button is the submitter. This attribute is ignored when `href` is present.\n */\n @property() value = '';\n\n /** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */\n @property() href = '';\n\n /** Tells the browser where to open the link. Only used when `href` is present. */\n @property() target: '_blank' | '_parent' | '_self' | '_top';\n\n /**\n * When using `href`, this attribute will map to the underlying link's `rel` attribute. Unlike regular links, the\n * default is `noreferrer noopener` to prevent security exploits. However, if you're using `target` to point to a\n * specific tab/window, this will prevent that from working correctly. You can remove or change the default value by\n * setting the attribute to an empty string or a value of your choice, respectively.\n */\n @property() rel = 'noreferrer noopener';\n\n /** Tells the browser to download the linked file as this filename. Only used when `href` is present. */\n @property() download?: string;\n\n /**\n * The \"form owner\" to associate the button with. If omitted, the closest containing form will be used instead. The\n * value of this attribute must be an id of a form in the same document or shadow root as the button.\n */\n @property() form: string;\n\n /** Used to override the form owner's `action` attribute. */\n @property({ attribute: 'formaction' }) formAction: string;\n\n /** Used to override the form owner's `enctype` attribute. */\n @property({ attribute: 'formenctype' })\n formEnctype: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';\n\n /** Used to override the form owner's `method` attribute. */\n @property({ attribute: 'formmethod' }) formMethod: 'post' | 'get';\n\n /** Used to override the form owner's `novalidate` attribute. */\n @property({ attribute: 'formnovalidate', type: Boolean }) formNoValidate: boolean;\n\n /** Used to override the form owner's `target` attribute. */\n @property({ attribute: 'formtarget' }) formTarget: '_self' | '_blank' | '_parent' | '_top' | string;\n\n /** Gets the validity state object */\n get validity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).validity;\n }\n\n return validValidityState;\n }\n\n /** Gets the validation message */\n get validationMessage() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).validationMessage;\n }\n\n return '';\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.handleHostClick = this.handleHostClick.bind(this);\n this.addEventListener('click', this.handleHostClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleHostClick);\n }\n\n firstUpdated() {\n if (this.isButton()) {\n this.formControlController.updateValidity();\n }\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n private handleClick() {\n if (this.type === 'submit') {\n this.formControlController.submit(this);\n }\n\n if (this.type === 'reset') {\n this.formControlController.reset(this);\n }\n }\n\n private handleHostClick(event: MouseEvent) {\n // Prevent the click event from being emitted when the button is disabled or loading\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n private handleInvalid(event: Event) {\n this.formControlController.setValidity(false);\n this.formControlController.emitInvalidEvent(event);\n }\n\n private isButton() {\n return this.href ? false : true;\n }\n\n private isLink() {\n return this.href ? true : false;\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n if (this.isButton()) {\n // Disabled form controls are always valid\n this.formControlController.setValidity(this.disabled);\n }\n }\n\n /** Simulates a click on the button. */\n click() {\n this.button.click();\n }\n\n /** Sets focus on the button. */\n focus(options?: FocusOptions) {\n this.button.focus(options);\n }\n\n /** Removes focus from the button. */\n blur() {\n this.button.blur();\n }\n\n /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */\n checkValidity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).checkValidity();\n }\n\n return true;\n }\n\n /** Gets the associated form, if one exists. */\n getForm(): HTMLFormElement | null {\n return this.formControlController.getForm();\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n reportValidity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).reportValidity();\n }\n\n return true;\n }\n\n /** Sets a custom validation message. Pass an empty string to restore validity. */\n setCustomValidity(message: string) {\n if (this.isButton()) {\n (this.button as HTMLButtonElement).setCustomValidity(message);\n this.formControlController.updateValidity();\n }\n }\n\n render() {\n const isLink = this.isLink();\n const tag = isLink ? literal`a` : literal`button`;\n\n /* eslint-disable lit/no-invalid-html */\n /* eslint-disable lit/binding-positions */\n return html`\n <${tag}\n part=\"base\"\n class=${classMap({\n button: true,\n 'button--primary': this.variant === 'primary',\n 'button--secondary': this.variant === 'secondary',\n 'button--tertiary': this.variant === 'tertiary',\n 'button--caution': this.variant === 'caution',\n 'button--small': this.size === 'small',\n 'button--medium': this.size === 'medium',\n 'button--large': this.size === 'large',\n 'button--caret': this.caret,\n 'button--circle': this.circle,\n 'button--disabled': this.disabled,\n 'button--focused': this.hasFocus,\n 'button--loading': this.loading,\n 'button--standard': !this.outline,\n 'button--outline': this.outline,\n 'button--pill': this.pill,\n 'button--has-label': this.hasSlotController.test('[default]'),\n 'button--has-prefix': this.hasSlotController.test('prefix'),\n 'button--has-suffix': this.hasSlotController.test('suffix')\n })}\n ?disabled=${ifDefined(isLink ? undefined : this.disabled)}\n type=${ifDefined(isLink ? undefined : this.type)}\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n name=${ifDefined(isLink ? undefined : this.name)}\n value=${ifDefined(isLink ? undefined : this.value)}\n href=${ifDefined(isLink ? this.href : undefined)}\n target=${ifDefined(isLink ? this.target : undefined)}\n download=${ifDefined(isLink ? this.download : undefined)}\n rel=${ifDefined(isLink ? this.rel : undefined)}\n role=${ifDefined(isLink ? undefined : 'button')}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @invalid=${this.isButton() ? this.handleInvalid : null}\n @click=${this.handleClick}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"button__prefix\"></slot>\n <slot part=\"label\" class=\"button__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"button__suffix\"></slot>\n ${\n this.caret ? html` <nile-icon part=\"caret\" class=\"button__caret\" name=\"caret\"></nile-icon> ` : ''\n }\n ${this.loading ? html`<nile-spinner></nile-spinner>` : ''}\n </${tag}>\n `;\n }\n}\n\nexport default NileButton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-button': NileButton;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"nile-button.js","sourceRoot":"","sources":["../../../src/nile-button/nile-button.ts"],"names":[],"mappings":";AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,WAAW;IAA3C;;QAGmB,0BAAqB,GAAG,IAAI,qBAAqB,CAAC,IAAI,EAAE;YACvE,IAAI,EAAE,KAAK,CAAC,EAAE;g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AAiB;AAGhB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAAc;AAMb;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAgB;AAM/C;IAAX,QAAQ,EAAE;wCAAgD;AAM/C;IAAX,QAAQ,EAAE;wCAAW;AAMV;IAAX,QAAQ,EAAE;yCAAY;AAGX;IAAX,QAAQ,EAAE;wCAAW;AAGV;IAAX,QAAQ,EAAE;0CAAiD;AAQhD;IAAX,QAAQ,EAAE;uCAA6B;AAG5B;IAAX,QAAQ,EAAE;4CAAmB;AAMlB;IAAX,QAAQ,EAAE;wCAAc;AAGc;IAAtC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAAoB;AAI1D;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CACiD;AAGjD;IAAtC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAA4B;AAGR;IAAzD,QAAQ,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAyB;AAG3C;IAAtC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAA8D;AA+EpG;IADC,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;sDAMjD;AAhMU,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAuStB;SAvSY,UAAU;AAySvB,eAAe,UAAU,CAAC","sourcesContent":["import '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { FormControlController, validValidityState } from '../internal/form';\nimport { HasSlotController } from '../internal/slot';\nimport { html, literal } from 'lit/static-html.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { watch } from '../internal/watch';\nimport { styles } from './nile-button.css';\nimport type { CSSResultGroup } from 'lit';\nimport type { NileFormControl } from '../internal/nile-element';\nimport NileElement from '../internal/nile-element';\n\n/**\n * @summary Buttons represent actions that are available to the user.\n * @status stable\n * @since 2.0\n *\n * @dependency nile-icon\n * @dependency nile-spinner\n *\n * @event nile-blur - Emitted when the button loses focus.\n * @event nile-focus - Emitted when the button gains focus.\n * @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @slot - The button's label.\n * @slot prefix - A presentational prefix icon or similar element.\n * @slot suffix - A presentational suffix icon or similar element.\n *\n * @csspart base - The component's base wrapper.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart label - The button's label.\n * @csspart suffix - The container that wraps the suffix.\n * @csspart caret - The button's caret icon, an `<nile-icon>` element.\n */\n\n@customElement('nile-button')\nexport class NileButton extends NileElement implements NileFormControl {\n static styles: CSSResultGroup = styles;\n\n private readonly formControlController = new FormControlController(this, {\n form: input => {\n // Buttons support a form attribute that points to an arbitrary form, so if this attribute is set we need to query\n // the form from the same root using its id\n if (input.hasAttribute('form')) {\n const doc = input.getRootNode() as Document | ShadowRoot;\n const formId = input.getAttribute('form')!;\n return doc.getElementById(formId) as HTMLFormElement;\n }\n\n // Fall back to the closest containing form\n return input.closest('form');\n },\n assumeInteractionOn: ['click']\n });\n private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');\n\n @query('.button') button: HTMLButtonElement | HTMLLinkElement;\n\n @state() private hasFocus = false;\n @state() invalid = false;\n @property() title = ''; // make reactive to pass through\n\n /** The button's theme variant. */\n @property({ reflect: true }) variant: 'primary' | 'secondary' | 'tertiary' | 'caution' = 'primary';\n\n /** The button's size. */\n @property({ reflect: true }) size: 'medium' = 'medium';\n\n /** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */\n @property({ type: Boolean, reflect: true }) caret = false;\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the button in a loading state. */\n @property({ type: Boolean, reflect: true }) loading = false;\n\n /** Draws an outlined button. */\n @property({ type: Boolean, reflect: true }) outline = false;\n\n /** Draws a pill-style button with rounded edges. */\n @property({ type: Boolean, reflect: true }) pill = false;\n\n /**\n * Draws a circular icon button. When this attribute is present, the button expects a single `<nile-icon>` in the\n * default slot.\n */\n @property({ type: Boolean, reflect: true }) circle = false;\n\n /**\n * The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native\n * `<button>` elements behave. When the type is `submit`, the button will submit the surrounding form.\n */\n @property() type: 'button' | 'submit' | 'reset' = 'button';\n\n /**\n * The name of the button, submitted as a name/value pair with form data, but only when this button is the submitter.\n * This attribute is ignored when `href` is present.\n */\n @property() name = '';\n\n /**\n * The value of the button, submitted as a pair with the button's name as part of the form data, but only when this\n * button is the submitter. This attribute is ignored when `href` is present.\n */\n @property() value = '';\n\n /** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */\n @property() href = '';\n\n /** Tells the browser where to open the link. Only used when `href` is present. */\n @property() target: '_blank' | '_parent' | '_self' | '_top';\n\n /**\n * When using `href`, this attribute will map to the underlying link's `rel` attribute. Unlike regular links, the\n * default is `noreferrer noopener` to prevent security exploits. However, if you're using `target` to point to a\n * specific tab/window, this will prevent that from working correctly. You can remove or change the default value by\n * setting the attribute to an empty string or a value of your choice, respectively.\n */\n @property() rel = 'noreferrer noopener';\n\n /** Tells the browser to download the linked file as this filename. Only used when `href` is present. */\n @property() download?: string;\n\n /**\n * The \"form owner\" to associate the button with. If omitted, the closest containing form will be used instead. The\n * value of this attribute must be an id of a form in the same document or shadow root as the button.\n */\n @property() form: string;\n\n /** Used to override the form owner's `action` attribute. */\n @property({ attribute: 'formaction' }) formAction: string;\n\n /** Used to override the form owner's `enctype` attribute. */\n @property({ attribute: 'formenctype' })\n formEnctype: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';\n\n /** Used to override the form owner's `method` attribute. */\n @property({ attribute: 'formmethod' }) formMethod: 'post' | 'get';\n\n /** Used to override the form owner's `novalidate` attribute. */\n @property({ attribute: 'formnovalidate', type: Boolean }) formNoValidate: boolean;\n\n /** Used to override the form owner's `target` attribute. */\n @property({ attribute: 'formtarget' }) formTarget: '_self' | '_blank' | '_parent' | '_top' | string;\n\n /** Gets the validity state object */\n get validity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).validity;\n }\n\n return validValidityState;\n }\n\n /** Gets the validation message */\n get validationMessage() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).validationMessage;\n }\n\n return '';\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.handleHostClick = this.handleHostClick.bind(this);\n this.addEventListener('click', this.handleHostClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleHostClick);\n }\n\n firstUpdated() {\n if (this.isButton()) {\n this.formControlController.updateValidity();\n }\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n private handleClick() {\n if (this.type === 'submit') {\n this.formControlController.submit(this);\n }\n\n if (this.type === 'reset') {\n this.formControlController.reset(this);\n }\n }\n\n private handleHostClick(event: MouseEvent) {\n // Prevent the click event from being emitted when the button is disabled or loading\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n private handleInvalid(event: Event) {\n this.formControlController.setValidity(false);\n this.formControlController.emitInvalidEvent(event);\n }\n\n private isButton() {\n return this.href ? false : true;\n }\n\n private isLink() {\n return this.href ? true : false;\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n if (this.isButton()) {\n // Disabled form controls are always valid\n this.formControlController.setValidity(this.disabled);\n }\n }\n\n /** Simulates a click on the button. */\n click() {\n this.button.click();\n }\n\n /** Sets focus on the button. */\n focus(options?: FocusOptions) {\n this.button.focus(options);\n }\n\n /** Removes focus from the button. */\n blur() {\n this.button.blur();\n }\n\n /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */\n checkValidity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).checkValidity();\n }\n\n return true;\n }\n\n /** Gets the associated form, if one exists. */\n getForm(): HTMLFormElement | null {\n return this.formControlController.getForm();\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n reportValidity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).reportValidity();\n }\n\n return true;\n }\n\n /** Sets a custom validation message. Pass an empty string to restore validity. */\n setCustomValidity(message: string) {\n if (this.isButton()) {\n (this.button as HTMLButtonElement).setCustomValidity(message);\n this.formControlController.updateValidity();\n }\n }\n\n render() {\n const isLink = this.isLink();\n const tag = isLink ? literal`a` : literal`button`;\n\n /* eslint-disable lit/no-invalid-html */\n /* eslint-disable lit/binding-positions */\n return html`\n <${tag}\n part=\"base\"\n class=${classMap({\n button: true,\n 'button--primary': this.variant === 'primary',\n 'button--secondary': this.variant === 'secondary',\n 'button--tertiary': this.variant === 'tertiary',\n 'button--caution': this.variant === 'caution',\n 'button--medium': this.size === 'medium',\n 'button--caret': this.caret,\n 'button--circle': this.circle,\n 'button--disabled': this.disabled,\n 'button--focused': this.hasFocus,\n 'button--loading': this.loading,\n 'button--standard': !this.outline,\n 'button--outline': this.outline,\n 'button--pill': this.pill,\n 'button--has-label': this.hasSlotController.test('[default]'),\n 'button--has-prefix': this.hasSlotController.test('prefix'),\n 'button--has-suffix': this.hasSlotController.test('suffix')\n })}\n ?disabled=${ifDefined(isLink ? undefined : this.disabled)}\n type=${ifDefined(isLink ? undefined : this.type)}\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n name=${ifDefined(isLink ? undefined : this.name)}\n value=${ifDefined(isLink ? undefined : this.value)}\n href=${ifDefined(isLink ? this.href : undefined)}\n target=${ifDefined(isLink ? this.target : undefined)}\n download=${ifDefined(isLink ? this.download : undefined)}\n rel=${ifDefined(isLink ? this.rel : undefined)}\n role=${ifDefined(isLink ? undefined : 'button')}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @invalid=${this.isButton() ? this.handleInvalid : null}\n @click=${this.handleClick}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"button__prefix\"></slot>\n <slot part=\"label\" class=\"button__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"button__suffix\"></slot>\n ${\n this.caret ? html` <nile-icon part=\"caret\" class=\"button__caret\" name=\"caret\"></nile-icon> ` : ''\n }\n ${this.loading ? html`<nile-spinner></nile-spinner>` : ''}\n </${tag}>\n `;\n }\n}\n\nexport default NileButton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-button': NileButton;\n }\n}\n"]}
|
@@ -25,11 +25,11 @@ export const styles = css `
|
|
25
25
|
.form-control--has-label .form-control__label {
|
26
26
|
display: inline-block;
|
27
27
|
color: inherit;
|
28
|
-
margin-bottom:
|
28
|
+
margin-bottom: 12px;
|
29
29
|
}
|
30
30
|
|
31
31
|
.form-control--has-label.form-control--small .form-control__label {
|
32
|
-
font-size:
|
32
|
+
font-size: 14px;
|
33
33
|
}
|
34
34
|
|
35
35
|
.form-control--has-label.form-control--medium .form-control__label {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-input.css.js","sourceRoot":"","sources":["../../../src/nile-input/nile-input.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0axB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Input CSS\n */\nexport const styles = css`\n :host {\n display: block;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: inherit;\n margin-bottom: 0.125rem;\n }\n\n .form-control--has-label.form-control--small .form-control__label {\n font-size: 0.875rem;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: 1rem;\n }\n\n .form-control--has-label.form-control--large .form-control__label {\n font-size: 1.25rem;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: undefined;\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: hsl(240 3.8% 46.1%);\n margin-top: 0.125rem;\n }\n\n .form-control--has-help-text.form-control--small .form-control__help-text {\n font-size: 0.75rem;\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: 0.875rem;\n }\n\n .form-control--has-help-text.form-control--large .form-control__help-text {\n font-size: 1rem;\n }\n\n .form-control--has-help-text.form-control--radio-group\n .form-control__help-text {\n margin-top: 0.25rem;\n }\n\n .input {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: inherit;\n font-weight: 400;\n letter-spacing: normal;\n vertical-align: middle;\n overflow: hidden;\n cursor: text;\n transition: 150ms color, 150ms border, 150ms box-shadow,\n 150ms background-color;\n }\n\n /* Standard inputs */\n .input--standard {\n background-color: hsl(0, 0%, 100%);\n border: solid 1px #c7ced4;\n }\n\n .input--standard:hover:not(.input--disabled) {\n background-color: hsl(0, 0%, 100%);\n border-color: #000000;\n }\n\n .input--standard.input--focused:not(.input--disabled) {\n background-color: hsl(0, 0%, 100%);\n border-color: #005ea6;\n box-shadow: 0 0 0 3px hsl(198.6 88.7% 48.4% / 40%);\n }\n\n .input--standard.input--focused:not(.input--disabled) .input__control {\n color: hsl(240 5.3% 26.1%);\n }\n\n .input--standard.input--disabled {\n background-color: hsl(240 4.8% 95.9%);\n border-color: hsl(240 4.9% 83.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .input--standard.input--disabled .input__control {\n color: hsl(240 5.9% 10%);\n }\n\n .input--standard.input--disabled .input__control::placeholder {\n color: hsl(240 5.2% 33.9%);\n }\n\n .input--standard.input--warning {\n border-color: #e5bf43;\n }\n\n .input--standard.input--error {\n border-color: #e5434d;\n }\n\n .input--standard.input--success {\n border-color: #43e5c0;\n }\n\n /* Filled inputs */\n .input--filled {\n border: none;\n background-color: hsl(240 4.8% 95.9%);\n color: hsl(240 5.3% 26.1%);\n }\n\n .input--filled:hover:not(.input--disabled) {\n background-color: hsl(240 4.8% 95.9%);\n }\n\n .input--filled.input--focused:not(.input--disabled) {\n background-color: hsl(240 4.8% 95.9%);\n outline: solid 3px hsl(200.4 98% 39.4%);\n outline-offset: 1px;\n }\n\n .input--filled.input--disabled {\n background-color: hsl(240 4.8% 95.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .input__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n min-width: 0;\n height: 100%;\n color: hsl(240 5.3% 26.1%);\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n }\n\n .input__control::-webkit-search-decoration,\n .input__control::-webkit-search-cancel-button,\n .input__control::-webkit-search-results-button,\n .input__control::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n .input__control:-webkit-autofill {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n -webkit-text-fill-color: hsl(198.6 88.7% 48.4%);\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:hover {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n -webkit-text-fill-color: hsl(198.6 88.7% 48.4%);\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:focus {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n -webkit-text-fill-color: hsl(198.6 88.7% 48.4%);\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:active {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n -webkit-text-fill-color: hsl(198.6 88.7% 48.4%);\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input--filled .input__control:-webkit-autofill {\n box-shadow: 0 0 0 3.125rem hsl(240 4.8% 95.9%) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:hover {\n box-shadow: 0 0 0 3.125rem hsl(240 4.8% 95.9%) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:focus {\n box-shadow: 0 0 0 3.125rem hsl(240 4.8% 95.9%) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:active {\n box-shadow: 0 0 0 3.125rem hsl(240 4.8% 95.9%) inset !important;\n }\n\n .input__control::placeholder {\n color: hsl(240 3.8% 46.1%);\n user-select: none;\n }\n\n .input:hover:not(.input--disabled) .input__control {\n color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:focus {\n outline: none;\n }\n\n .input__prefix,\n .input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n }\n\n .input__prefix::slotted(nile-icon) {\n color: hsl(240 3.8% 46.1%);\n }\n\n .input__suffix::slotted(nile-icon) {\n color: hsl(240 3.8% 46.1%);\n }\n\n /*\n * Size modifiers\n */\n\n .input--small {\n border-radius: 0.25rem;\n font-size: 0.875rem;\n height: 1.875rem;\n }\n\n .input--small .input__control {\n height: calc(1.875rem);\n padding: 0 0.75rem;\n }\n\n .input--small .input__clear {\n width: calc(1em + 0.75rem * 2);\n }\n\n .input--small .input__password-toggle {\n width: calc(1em + 0.75rem * 2);\n }\n\n .input--small .input__prefix::slotted(*) {\n margin-inline-start: 0.75rem;\n }\n\n .input--small .input__suffix::slotted(*) {\n margin-inline-end: 0.75rem;\n }\n\n .input--medium {\n border-radius: 0.25rem;\n font-size: 1rem;\n height: 38px;\n }\n\n .input--medium .input__control {\n height: calc(42px - 1px * 2);\n padding: 0 1rem;\n }\n\n .input--medium .input__clear {\n width: calc(1em + 1rem * 2);\n }\n\n .input--medium .input__password-toggle {\n width: calc(1em + 1rem * 2);\n }\n\n .input--medium .input__prefix::slotted(*) {\n margin-inline-start: 1rem;\n }\n\n .input--medium .input__suffix::slotted(*) {\n margin-inline-end: 1rem;\n }\n\n .input--large {\n border-radius: 0.25rem;\n font-size: 1.25rem;\n height: 3.125rem;\n }\n\n .input--large .input__control {\n height: calc(3.125rem - 1px * 2);\n padding: 0 1.25rem;\n }\n\n .input--large .input__clear {\n width: calc(1em + 1.25rem * 2);\n }\n\n .input--large .input__password-toggle {\n width: calc(1em + 1.25rem * 2);\n }\n\n .input--large .input__prefix::slotted(*) {\n margin-inline-start: 1.25rem;\n }\n\n .input--large .input__suffix::slotted(*) {\n margin-inline-end: 1.25rem;\n }\n\n /*\n * Pill modifier\n */\n\n .input--pill.input--small {\n border-radius: 1.875rem;\n }\n\n .input--pill.input--medium {\n border-radius: 2.5rem;\n }\n\n .input--pill.input--large {\n border-radius: 3.125rem;\n }\n\n /*\n * Clearable + Password Toggle\n */\n\n .input__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: inherit;\n color: hsl(240 3.8% 46.1%);\n border: none;\n background: none;\n padding: 0;\n transition: 150ms color;\n cursor: pointer;\n }\n\n .input__password-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: inherit;\n color: hsl(240 3.8% 46.1%);\n border: none;\n background: none;\n padding: 0;\n transition: 150ms color;\n cursor: pointer;\n }\n\n .input__clear:hover {\n color: hsl(240 5.2% 33.9%);\n }\n\n .input__password-toggle:hover {\n color: hsl(240 5.2% 33.9%);\n }\n\n .input__clear:focus,\n .input__password-toggle:focus {\n outline: none;\n }\n\n .input--empty .input__clear {\n visibility: hidden;\n }\n\n /* Don't show the browser's password toggle in Edge */\n ::-ms-reveal {\n display: none;\n }\n\n /* Hide the built-in number spinner */\n .input--no-spin-buttons input[type='number']::-webkit-outer-spin-button,\n .input--no-spin-buttons input[type='number']::-webkit-inner-spin-button {\n -webkit-appearance: none;\n display: none;\n }\n\n .input--no-spin-buttons input[type='number'] {\n -moz-appearance: textfield;\n }\n\n :host([no-border]) .input--standard {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard:hover:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard.input--focused:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard.input--focused:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n`;\n\nexport default [styles];\n"]}
|
1
|
+
{"version":3,"file":"nile-input.css.js","sourceRoot":"","sources":["../../../src/nile-input/nile-input.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0axB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Input CSS\n */\nexport const styles = css`\n :host {\n display: block;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: inherit;\n margin-bottom: 12px;\n }\n\n .form-control--has-label.form-control--small .form-control__label {\n font-size: 14px;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: 1rem;\n }\n\n .form-control--has-label.form-control--large .form-control__label {\n font-size: 1.25rem;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: undefined;\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: hsl(240 3.8% 46.1%);\n margin-top: 0.125rem;\n }\n\n .form-control--has-help-text.form-control--small .form-control__help-text {\n font-size: 0.75rem;\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: 0.875rem;\n }\n\n .form-control--has-help-text.form-control--large .form-control__help-text {\n font-size: 1rem;\n }\n\n .form-control--has-help-text.form-control--radio-group\n .form-control__help-text {\n margin-top: 0.25rem;\n }\n\n .input {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: inherit;\n font-weight: 400;\n letter-spacing: normal;\n vertical-align: middle;\n overflow: hidden;\n cursor: text;\n transition: 150ms color, 150ms border, 150ms box-shadow,\n 150ms background-color;\n }\n\n /* Standard inputs */\n .input--standard {\n background-color: hsl(0, 0%, 100%);\n border: solid 1px #c7ced4;\n }\n\n .input--standard:hover:not(.input--disabled) {\n background-color: hsl(0, 0%, 100%);\n border-color: #000000;\n }\n\n .input--standard.input--focused:not(.input--disabled) {\n background-color: hsl(0, 0%, 100%);\n border-color: #005ea6;\n box-shadow: 0 0 0 3px hsl(198.6 88.7% 48.4% / 40%);\n }\n\n .input--standard.input--focused:not(.input--disabled) .input__control {\n color: hsl(240 5.3% 26.1%);\n }\n\n .input--standard.input--disabled {\n background-color: hsl(240 4.8% 95.9%);\n border-color: hsl(240 4.9% 83.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .input--standard.input--disabled .input__control {\n color: hsl(240 5.9% 10%);\n }\n\n .input--standard.input--disabled .input__control::placeholder {\n color: hsl(240 5.2% 33.9%);\n }\n\n .input--standard.input--warning {\n border-color: #e5bf43;\n }\n\n .input--standard.input--error {\n border-color: #e5434d;\n }\n\n .input--standard.input--success {\n border-color: #43e5c0;\n }\n\n /* Filled inputs */\n .input--filled {\n border: none;\n background-color: hsl(240 4.8% 95.9%);\n color: hsl(240 5.3% 26.1%);\n }\n\n .input--filled:hover:not(.input--disabled) {\n background-color: hsl(240 4.8% 95.9%);\n }\n\n .input--filled.input--focused:not(.input--disabled) {\n background-color: hsl(240 4.8% 95.9%);\n outline: solid 3px hsl(200.4 98% 39.4%);\n outline-offset: 1px;\n }\n\n .input--filled.input--disabled {\n background-color: hsl(240 4.8% 95.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .input__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n min-width: 0;\n height: 100%;\n color: hsl(240 5.3% 26.1%);\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n }\n\n .input__control::-webkit-search-decoration,\n .input__control::-webkit-search-cancel-button,\n .input__control::-webkit-search-results-button,\n .input__control::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n .input__control:-webkit-autofill {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n -webkit-text-fill-color: hsl(198.6 88.7% 48.4%);\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:hover {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n -webkit-text-fill-color: hsl(198.6 88.7% 48.4%);\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:focus {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n -webkit-text-fill-color: hsl(198.6 88.7% 48.4%);\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:-webkit-autofill:active {\n box-shadow: 0 0 0 3.125rem hsl(0, 0%, 100%) inset !important;\n -webkit-text-fill-color: hsl(198.6 88.7% 48.4%);\n caret-color: hsl(240 5.3% 26.1%);\n }\n\n .input--filled .input__control:-webkit-autofill {\n box-shadow: 0 0 0 3.125rem hsl(240 4.8% 95.9%) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:hover {\n box-shadow: 0 0 0 3.125rem hsl(240 4.8% 95.9%) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:focus {\n box-shadow: 0 0 0 3.125rem hsl(240 4.8% 95.9%) inset !important;\n }\n\n .input--filled .input__control:-webkit-autofill:active {\n box-shadow: 0 0 0 3.125rem hsl(240 4.8% 95.9%) inset !important;\n }\n\n .input__control::placeholder {\n color: hsl(240 3.8% 46.1%);\n user-select: none;\n }\n\n .input:hover:not(.input--disabled) .input__control {\n color: hsl(240 5.3% 26.1%);\n }\n\n .input__control:focus {\n outline: none;\n }\n\n .input__prefix,\n .input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n }\n\n .input__prefix::slotted(nile-icon) {\n color: hsl(240 3.8% 46.1%);\n }\n\n .input__suffix::slotted(nile-icon) {\n color: hsl(240 3.8% 46.1%);\n }\n\n /*\n * Size modifiers\n */\n\n .input--small {\n border-radius: 0.25rem;\n font-size: 0.875rem;\n height: 1.875rem;\n }\n\n .input--small .input__control {\n height: calc(1.875rem);\n padding: 0 0.75rem;\n }\n\n .input--small .input__clear {\n width: calc(1em + 0.75rem * 2);\n }\n\n .input--small .input__password-toggle {\n width: calc(1em + 0.75rem * 2);\n }\n\n .input--small .input__prefix::slotted(*) {\n margin-inline-start: 0.75rem;\n }\n\n .input--small .input__suffix::slotted(*) {\n margin-inline-end: 0.75rem;\n }\n\n .input--medium {\n border-radius: 0.25rem;\n font-size: 1rem;\n height: 38px;\n }\n\n .input--medium .input__control {\n height: calc(42px - 1px * 2);\n padding: 0 1rem;\n }\n\n .input--medium .input__clear {\n width: calc(1em + 1rem * 2);\n }\n\n .input--medium .input__password-toggle {\n width: calc(1em + 1rem * 2);\n }\n\n .input--medium .input__prefix::slotted(*) {\n margin-inline-start: 1rem;\n }\n\n .input--medium .input__suffix::slotted(*) {\n margin-inline-end: 1rem;\n }\n\n .input--large {\n border-radius: 0.25rem;\n font-size: 1.25rem;\n height: 3.125rem;\n }\n\n .input--large .input__control {\n height: calc(3.125rem - 1px * 2);\n padding: 0 1.25rem;\n }\n\n .input--large .input__clear {\n width: calc(1em + 1.25rem * 2);\n }\n\n .input--large .input__password-toggle {\n width: calc(1em + 1.25rem * 2);\n }\n\n .input--large .input__prefix::slotted(*) {\n margin-inline-start: 1.25rem;\n }\n\n .input--large .input__suffix::slotted(*) {\n margin-inline-end: 1.25rem;\n }\n\n /*\n * Pill modifier\n */\n\n .input--pill.input--small {\n border-radius: 1.875rem;\n }\n\n .input--pill.input--medium {\n border-radius: 2.5rem;\n }\n\n .input--pill.input--large {\n border-radius: 3.125rem;\n }\n\n /*\n * Clearable + Password Toggle\n */\n\n .input__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: inherit;\n color: hsl(240 3.8% 46.1%);\n border: none;\n background: none;\n padding: 0;\n transition: 150ms color;\n cursor: pointer;\n }\n\n .input__password-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: inherit;\n color: hsl(240 3.8% 46.1%);\n border: none;\n background: none;\n padding: 0;\n transition: 150ms color;\n cursor: pointer;\n }\n\n .input__clear:hover {\n color: hsl(240 5.2% 33.9%);\n }\n\n .input__password-toggle:hover {\n color: hsl(240 5.2% 33.9%);\n }\n\n .input__clear:focus,\n .input__password-toggle:focus {\n outline: none;\n }\n\n .input--empty .input__clear {\n visibility: hidden;\n }\n\n /* Don't show the browser's password toggle in Edge */\n ::-ms-reveal {\n display: none;\n }\n\n /* Hide the built-in number spinner */\n .input--no-spin-buttons input[type='number']::-webkit-outer-spin-button,\n .input--no-spin-buttons input[type='number']::-webkit-inner-spin-button {\n -webkit-appearance: none;\n display: none;\n }\n\n .input--no-spin-buttons input[type='number'] {\n -moz-appearance: textfield;\n }\n\n :host([no-border]) .input--standard {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard:hover:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard.input--focused:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n\n :host([no-border]) .input--standard.input--focused:not(.input--disabled) {\n border: none;\n box-shadow: 0 0 0 0;\n }\n`;\n\nexport default [styles];\n"]}
|