@aquera/nile-elements 0.0.50 → 0.0.51
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/demo/variables.css +1 -0
- package/demo/variables_v2.css +5 -4
- package/dist/index.iife.js +479 -225
- 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 +340 -100
- package/dist/nile-button/nile-button.esm.js +11 -4
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +15 -9
- package/dist/nile-calendar/nile-calendar.esm.js +4 -4
- package/dist/nile-card/nile-card.css.cjs.js +1 -1
- package/dist/nile-card/nile-card.css.cjs.js.map +1 -1
- package/dist/nile-card/nile-card.css.esm.js +2 -1
- package/dist/src/nile-button/nile-button.css.js +338 -98
- package/dist/src/nile-button/nile-button.css.js.map +1 -1
- package/dist/src/nile-button/nile-button.d.ts +2 -1
- package/dist/src/nile-button/nile-button.js +22 -4
- package/dist/src/nile-button/nile-button.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.css.js +15 -9
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.js +6 -3
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-card/nile-card.css.js +2 -1
- package/dist/src/nile-card/nile-card.css.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-button/nile-button.css.ts +338 -98
- package/src/nile-button/nile-button.ts +52 -11
- package/src/nile-calendar/nile-calendar.css.ts +15 -9
- package/src/nile-calendar/nile-calendar.ts +10 -5
- package/src/nile-card/nile-card.css.ts +2 -1
package/package.json
CHANGED
@@ -73,70 +73,86 @@ export const styles = css`
|
|
73
73
|
/* vertical-align: -2px; */
|
74
74
|
}
|
75
75
|
|
76
|
-
.button--standard.button--secondary {
|
77
|
-
background-color: var(--nile-colors-button-secondary);
|
78
|
-
border-color: var(--nile-colors-button-secondary-border);
|
79
|
-
color: var(--nile-colors-button-secondary-text);
|
80
|
-
}
|
81
|
-
|
82
|
-
.button--standard.button--secondary:hover:not(.button--disabled) {
|
83
|
-
background-color: var(--nile-colors-button-secondary-hover);
|
84
|
-
border-color: var(--nile-colors-button-secondary-border);
|
85
|
-
color: var(--nile-colors-button-secondary-text);
|
86
|
-
}
|
87
|
-
|
88
|
-
.button--standard.button--secondary:active:not(.button--disabled) {
|
89
|
-
background-color: var(--nile-colors-button-secondary-pressed);
|
90
|
-
border-color: var(--nile-colors-button-secondary-pressed-border);
|
91
|
-
color: var(--nile-colors-button-secondary-text);
|
92
|
-
}
|
93
|
-
|
94
|
-
.button--standard.button--secondary.button--disabled {
|
95
|
-
background-color: var(--nile-colors-button-secondary-disabled);
|
96
|
-
border-color: var(--nile-colors-button-secondary-disabled-border);
|
97
|
-
color: var(--nile-colors-button-secondary-disabled-text);
|
98
|
-
cursor: not-allowed;
|
99
|
-
}
|
100
|
-
|
101
|
-
.button--standard.button--secondary.button--disabled:hover,
|
102
|
-
.button--standard.button--secondary.button--disabled:active {
|
103
|
-
background-color: var(--nile-colors-button-secondary-disabled);
|
104
|
-
border-color: var(--nile-colors-button-secondary-disabled-border);
|
105
|
-
color: var(--nile-colors-button-secondary-disabled-text);
|
106
|
-
cursor: not-allowed;
|
107
|
-
}
|
108
|
-
|
109
76
|
/* Primary */
|
110
77
|
.button--standard.button--primary {
|
111
78
|
background-color: var(--nile-colors-button-primary);
|
79
|
+
background-color: #005ea6; /*for v2 */
|
112
80
|
border-color: var(--nile-colors-button-primary-border);
|
81
|
+
border-color: #005ea6; /*for v2 */
|
113
82
|
color: var(--nile-colors-button-primary-text);
|
83
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05); /*for v2 */
|
114
84
|
}
|
115
85
|
|
116
86
|
.button--standard.button--primary:hover:not(.button--disabled) {
|
117
87
|
background-color: var(--nile-colors-button-primary-hover);
|
88
|
+
background-color: #005291; /*for v2 */
|
118
89
|
border-color: var(--nile-colors-button-primary-hover);
|
90
|
+
border-color: #005291; /*for v2 */
|
119
91
|
color: var(--nile-colors-button-primary-text);
|
120
92
|
}
|
121
93
|
|
122
94
|
.button--standard.button--primary:active:not(.button--disabled) {
|
123
95
|
background-color: var(--nile-colors-button-primary-pressed);
|
96
|
+
background-color: #005ea6; /*for v2 */
|
124
97
|
border-color: var(--nile-colors-button-primary-pressed-border);
|
98
|
+
border-color: #005ea6; /*for v2 */
|
125
99
|
color: var(--nile-colors-button-primary-text);
|
100
|
+
box-shadow: 0px 1px 2px 0px rgba(0, 82, 145, 0.1),
|
101
|
+
0px 0px 0px 4px rgba(0, 94, 166, 0.15); /*for v2 */
|
126
102
|
}
|
127
103
|
|
128
104
|
.button--standard.button--primary.button--disabled {
|
129
105
|
background-color: var(--nile-colors-button-primary-disabled);
|
106
|
+
background-color: #f2f4f7; /*for v2 */
|
130
107
|
border-color: var(--nile-colors-button-primary-disabled);
|
108
|
+
border-color: #eaecf0; /*for v2 */
|
131
109
|
color: var(--nile-colors-button-primary-disabled-text);
|
110
|
+
color: #98a2b3; /*for v2 */
|
132
111
|
cursor: not-allowed;
|
133
112
|
}
|
134
113
|
|
135
114
|
.button--standard.button--primary.button--disabled:hover,
|
136
115
|
.button--standard.button--primary.button--disabled:active {
|
137
116
|
background-color: var(--nile-colors-button-primary-disabled);
|
117
|
+
background-color: #f2f4f7; /*for v2 */
|
138
118
|
border-color: var(--nile-colors-button-primary-disabled);
|
119
|
+
border-color: #eaecf0; /*for v2 */
|
139
120
|
color: var(--nile-colors-button-primary-disabled-text);
|
121
|
+
color: #98a2b3; /*for v2 */
|
122
|
+
cursor: not-allowed;
|
123
|
+
}
|
124
|
+
|
125
|
+
/* Secondary */
|
126
|
+
.button--standard.button--secondary {
|
127
|
+
background-color: var(--nile-colors-button-secondary);
|
128
|
+
border-color: var(--nile-colors-button-secondary-border);
|
129
|
+
color: var(--nile-colors-button-secondary-text);
|
130
|
+
}
|
131
|
+
|
132
|
+
.button--standard.button--secondary:hover:not(.button--disabled) {
|
133
|
+
background-color: var(--nile-colors-button-secondary-hover);
|
134
|
+
border-color: var(--nile-colors-button-secondary-border);
|
135
|
+
color: var(--nile-colors-button-secondary-text);
|
136
|
+
}
|
137
|
+
|
138
|
+
.button--standard.button--secondary:active:not(.button--disabled) {
|
139
|
+
background-color: var(--nile-colors-button-secondary-pressed);
|
140
|
+
border-color: var(--nile-colors-button-secondary-pressed-border);
|
141
|
+
color: var(--nile-colors-button-secondary-text);
|
142
|
+
}
|
143
|
+
|
144
|
+
.button--standard.button--secondary.button--disabled {
|
145
|
+
background-color: var(--nile-colors-button-secondary-disabled);
|
146
|
+
border-color: var(--nile-colors-button-secondary-disabled-border);
|
147
|
+
color: var(--nile-colors-button-secondary-disabled-text);
|
148
|
+
cursor: not-allowed;
|
149
|
+
}
|
150
|
+
|
151
|
+
.button--standard.button--secondary.button--disabled:hover,
|
152
|
+
.button--standard.button--secondary.button--disabled:active {
|
153
|
+
background-color: var(--nile-colors-button-secondary-disabled);
|
154
|
+
border-color: var(--nile-colors-button-secondary-disabled-border);
|
155
|
+
color: var(--nile-colors-button-secondary-disabled-text);
|
140
156
|
cursor: not-allowed;
|
141
157
|
}
|
142
158
|
|
@@ -170,7 +186,7 @@ export const styles = css`
|
|
170
186
|
}
|
171
187
|
|
172
188
|
/* ghost */
|
173
|
-
.button--standard.button--ghost{
|
189
|
+
.button--standard.button--ghost {
|
174
190
|
background-color: var(--nile-colors-button-tertiary);
|
175
191
|
border-color: transparent;
|
176
192
|
color: var(--nile-colors-button-tertiary-text);
|
@@ -184,14 +200,14 @@ export const styles = css`
|
|
184
200
|
|
185
201
|
.button--standard.button--ghost:active:not(.button--disabled) {
|
186
202
|
background-color: var(--nile-colors-button-tertiary-pressed);
|
187
|
-
border-color:transparent;
|
203
|
+
border-color: transparent;
|
188
204
|
color: var(--nile-colors-button-tertiary-text);
|
189
205
|
}
|
190
206
|
|
191
207
|
.button--standard.button--ghost.button--disabled,
|
192
208
|
.button--standard.button--ghost.button--disabled:hover,
|
193
209
|
.button--standard.button--ghost.button--disabled:active {
|
194
|
-
border-color:transparent;
|
210
|
+
border-color: transparent;
|
195
211
|
background-color: var(--nile-colors-button-tertiary-disabled);
|
196
212
|
color: var(--nile-colors-button-tertiary-disabled-text);
|
197
213
|
cursor: not-allowed;
|
@@ -225,68 +241,217 @@ export const styles = css`
|
|
225
241
|
color: var(--nile-colors-button-caution-disabled-text);
|
226
242
|
}
|
227
243
|
|
244
|
+
/* destructive */
|
245
|
+
.button--standard.button--destructive {
|
246
|
+
background-color: #d92d20;
|
247
|
+
border-color: #d92d20;
|
248
|
+
color: #fff;
|
249
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
250
|
+
}
|
228
251
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
252
|
+
.button--standard.button--destructive:hover:not(.button--disabled) {
|
253
|
+
background-color: #b42318;
|
254
|
+
border-color: #b42318;
|
255
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
256
|
+
}
|
257
|
+
|
258
|
+
.button--standard.button--destructive:active:not(.button--disabled) {
|
259
|
+
background-color: #d92d20;
|
260
|
+
border-color: #d92d20;
|
261
|
+
color: #fff;
|
262
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05),
|
263
|
+
0px 0px 0px 4px rgba(240, 68, 56, 0.24);
|
264
|
+
}
|
265
|
+
.button--standard.button--destructive:focus-visible:not(.button--disabled) {
|
266
|
+
background-color: #d92d20;
|
267
|
+
border-color: #d92d20;
|
268
|
+
color: #fff;
|
269
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05),
|
270
|
+
0px 0px 0px 4px rgba(240, 68, 56, 0.24);
|
271
|
+
}
|
272
|
+
|
273
|
+
.button--standard.button--destructive.button--disabled {
|
274
|
+
background-color: #f2f4f7;
|
275
|
+
border-color: #eaecf0;
|
276
|
+
color: #98a2b3;
|
277
|
+
cursor: not-allowed;
|
278
|
+
}
|
279
|
+
|
280
|
+
.button--standard.button--destructive.button--disabled:hover,
|
281
|
+
.button--standard.button--destructive.button--disabled:active {
|
282
|
+
background-color: #f2f4f7;
|
283
|
+
border-color: #eaecf0;
|
284
|
+
color: #98a2b3;
|
285
|
+
cursor: not-allowed;
|
286
|
+
}
|
287
|
+
|
288
|
+
/* secondary-Grey */
|
289
|
+
.button--standard.button--secondary-grey {
|
290
|
+
background-color: #fff;
|
291
|
+
border-color: #d0d5dd;
|
292
|
+
color: #344054;
|
293
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
294
|
+
}
|
295
|
+
|
296
|
+
.button--standard.button--secondary-grey:hover:not(.button--disabled) {
|
297
|
+
background-color: #f9fafb;
|
298
|
+
border-color: #d0d5dd;
|
299
|
+
color: #182230;
|
300
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
301
|
+
}
|
302
|
+
|
303
|
+
.button--standard.button--secondary-grey:active:not(.button--disabled) {
|
304
|
+
background-color: #fff;
|
305
|
+
border-color: #d0d5dd;
|
306
|
+
color: #344054;
|
307
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05),
|
308
|
+
0px 0px 0px 4px rgba(152, 162, 179, 0.14);
|
309
|
+
}
|
310
|
+
|
311
|
+
.button--standard.button--secondary-grey.button--disabled {
|
312
|
+
background-color: #eaecf0;
|
313
|
+
border-color: var(--nile-colors-button-primary-disabled);
|
314
|
+
color: #98a2b3;
|
315
|
+
cursor: not-allowed;
|
316
|
+
}
|
317
|
+
|
318
|
+
.button--standard.button--secondary-grey.button--disabled:hover,
|
319
|
+
.button--standard.button--secondary-grey.button--disabled:active {
|
320
|
+
background-color: #eaecf0;
|
321
|
+
border-color: var(--nile-colors-button-primary-disabled);
|
322
|
+
color: #98a2b3;
|
323
|
+
cursor: not-allowed;
|
324
|
+
}
|
325
|
+
|
326
|
+
/* secondary-blue */
|
327
|
+
.button--standard.button--secondary-blue {
|
328
|
+
background-color: #fff;
|
329
|
+
border-color: #85aad1;
|
330
|
+
color: #005291;
|
331
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
332
|
+
}
|
333
|
+
|
334
|
+
.button--standard.button--secondary-blue:hover:not(.button--disabled) {
|
335
|
+
background-color: #eaf0f8;
|
336
|
+
border-color: #85aad1;
|
337
|
+
color: #004678;
|
338
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
339
|
+
}
|
340
|
+
|
341
|
+
.button--standard.button--secondary-blue:active:not(.button--disabled) {
|
342
|
+
background-color: #fff;
|
343
|
+
border-color: #85aad1;
|
344
|
+
color: #005291;
|
345
|
+
box-shadow: 0px 1px 2px 0px rgba(0, 82, 145, 0.1),
|
346
|
+
0px 0px 0px 4px rgba(0, 94, 166, 0.15);
|
347
|
+
}
|
348
|
+
|
349
|
+
.button--standard.button--secondary-blue.button--disabled {
|
350
|
+
background-color: #fff;
|
351
|
+
border-color: #eaecf0;
|
352
|
+
color: #98a2b3;
|
353
|
+
cursor: not-allowed;
|
354
|
+
}
|
355
|
+
|
356
|
+
.button--standard.button--secondary-blue.button--disabled:hover,
|
357
|
+
.button--standard.button--secondary-blue.button--disabled:active {
|
358
|
+
background-color: #fff;
|
359
|
+
border-color: #eaecf0;
|
360
|
+
color: #98a2b3;
|
361
|
+
cursor: not-allowed;
|
362
|
+
}
|
363
|
+
|
364
|
+
/* Primary Variant - Nile Icon Fill */
|
365
|
+
.button--standard.button--primary ::slotted(nile-icon) {
|
366
|
+
--nile-svg-fill: var(--nile-colors-button-primary-text) !important;
|
367
|
+
}
|
368
|
+
.button--standard.button--primary:hover:not(.button--disabled)
|
369
|
+
::slotted(nile-icon),
|
370
|
+
.button--standard.button--primary:active:not(.button--disabled)
|
371
|
+
::slotted(nile-icon) {
|
372
|
+
--nile-svg-fill: var(--nile-colors-button-primary-text) !important;
|
373
|
+
}
|
374
|
+
.button--standard.button--primary.button--disabled ::slotted(nile-icon) {
|
375
|
+
--nile-svg-fill: var(--nile-colors-button-primary-disabled-text) !important;
|
376
|
+
}
|
377
|
+
|
378
|
+
/* Secondary Variant */
|
379
|
+
.button--standard.button--secondary ::slotted(nile-icon) {
|
380
|
+
--nile-svg-fill: var(--nile-colors-button-secondary-text) !important;
|
381
|
+
}
|
382
|
+
.button--standard.button--secondary:hover:not(.button--disabled)
|
383
|
+
::slotted(nile-icon),
|
384
|
+
.button--standard.button--secondary:active:not(.button--disabled)
|
385
|
+
::slotted(nile-icon) {
|
386
|
+
--nile-svg-fill: var(--nile-colors-button-secondary-text) !important;
|
387
|
+
}
|
388
|
+
.button--standard.button--secondary.button--disabled ::slotted(nile-icon) {
|
389
|
+
--nile-svg-fill: var(
|
390
|
+
--nile-colors-button-secondary-disabled-text
|
391
|
+
) !important;
|
392
|
+
}
|
393
|
+
|
394
|
+
/* Tertiary Variant */
|
395
|
+
.button--standard.button--tertiary ::slotted(nile-icon) {
|
396
|
+
--nile-svg-fill: var(--nile-colors-button-tertiary-text) !important;
|
397
|
+
}
|
398
|
+
.button--standard.button--tertiary:hover:not(.button--disabled)
|
399
|
+
::slotted(nile-icon),
|
400
|
+
.button--standard.button--tertiary:active:not(.button--disabled)
|
401
|
+
::slotted(nile-icon) {
|
402
|
+
--nile-svg-fill: var(--nile-colors-button-tertiary-text) !important;
|
403
|
+
}
|
404
|
+
.button--standard.button--tertiary.button--disabled ::slotted(nile-icon) {
|
405
|
+
--nile-svg-fill: var(
|
406
|
+
--nile-colors-button-tertiary-disabled-text
|
407
|
+
) !important;
|
408
|
+
}
|
409
|
+
|
410
|
+
/* Ghost Variant */
|
411
|
+
.button--standard.button--ghost ::slotted(nile-icon) {
|
412
|
+
--nile-svg-fill: var(--nile-colors-button-tertiary-text) !important;
|
413
|
+
}
|
414
|
+
.button--standard.button--ghost:hover:not(.button--disabled)
|
415
|
+
::slotted(nile-icon),
|
416
|
+
.button--standard.button--ghost:active:not(.button--disabled)
|
417
|
+
::slotted(nile-icon) {
|
418
|
+
--nile-svg-fill: var(--nile-colors-button-tertiary-text) !important;
|
419
|
+
}
|
420
|
+
.button--standard.button--ghost ::slotted(nile-icon) {
|
421
|
+
--nile-svg-fill: var(
|
422
|
+
--nile-colors-button-tertiary-disabled-text
|
423
|
+
) !important;
|
424
|
+
}
|
425
|
+
|
426
|
+
/* Caution Variant */
|
427
|
+
.button--standard.button--caution ::slotted(nile-icon) {
|
428
|
+
--nile-svg-fill: var(--nile-colors-button-caution-text) !important;
|
429
|
+
}
|
430
|
+
.button--standard.button--caution:hover:not(.button--disabled)
|
431
|
+
::slotted(nile-icon),
|
432
|
+
.button--standard.button--caution:active:not(.button--disabled)
|
433
|
+
::slotted(nile-icon) {
|
434
|
+
--nile-svg-fill: var(--nile-colors-button-caution-text) !important;
|
435
|
+
}
|
436
|
+
.button--standard.button--caution.button--disabled ::slotted(nile-icon) {
|
437
|
+
--nile-svg-fill: var(--nile-colors-button-caution-disabled-text) !important;
|
438
|
+
}
|
439
|
+
|
440
|
+
/* destructive */
|
441
|
+
.button--standard.button--destructive ::slotted(nile-icon) {
|
442
|
+
--nile-svg-fill: #fff !important;
|
443
|
+
}
|
444
|
+
.button--standard.button--destructive:hover:not(.button--disabled)
|
445
|
+
::slotted(nile-icon),
|
446
|
+
.button--standard.button--caution:active:not(.button--disabled)
|
447
|
+
::slotted(nile-icon) {
|
448
|
+
--nile-svg-fill: #fff !important;
|
449
|
+
}
|
450
|
+
.button--standard.button--destructive.button--disabled ::slotted(nile-icon) {
|
451
|
+
--nile-svg-fill: #fff !important;
|
452
|
+
}
|
453
|
+
|
454
|
+
/*
|
290
455
|
* Outline buttons
|
291
456
|
*/
|
292
457
|
|
@@ -388,12 +553,83 @@ export const styles = css`
|
|
388
553
|
color: var(--nile-colors-white-base);
|
389
554
|
}
|
390
555
|
|
391
|
-
|
556
|
+
.button--outline.button--danger:active:not(.button--disabled) {
|
392
557
|
border-color: var(--nile-colors-red-700);
|
393
558
|
background-color: var(--nile-colors-red-700);
|
394
559
|
color: var(--nile-colors-white-base);
|
395
560
|
}
|
396
561
|
|
562
|
+
/* destructive */
|
563
|
+
.button--outline.button--destructive {
|
564
|
+
border-color: #fda29b;
|
565
|
+
color: #b42318;
|
566
|
+
box-shadow: 0px;
|
567
|
+
}
|
568
|
+
|
569
|
+
.button--outline.button--destructive:hover:not(.button--disabled),
|
570
|
+
.button--outline.button--destructive.button--checked:not(.button--disabled) {
|
571
|
+
border-color: #fda29b;
|
572
|
+
color: #912018;
|
573
|
+
background-color: #fef3f2;
|
574
|
+
}
|
575
|
+
|
576
|
+
.button--outline.button--destructive:active:not(.button--disabled) {
|
577
|
+
border-color: #fda29b;
|
578
|
+
color: #b42318;
|
579
|
+
background-color: #fff;
|
580
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05),
|
581
|
+
0px 0px 0px 4px rgba(240, 68, 56, 0.24);
|
582
|
+
}
|
583
|
+
|
584
|
+
/* destructive - focus-visible */
|
585
|
+
.button--outline.button--destructive:focus-visible:not(.button--disabled) {
|
586
|
+
border-color: #fda29b;
|
587
|
+
color: #b42318;
|
588
|
+
background-color: #fff;
|
589
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05),
|
590
|
+
0px 0px 0px 4px rgba(240, 68, 56, 0.24);
|
591
|
+
}
|
592
|
+
|
593
|
+
/* secondary-grey */
|
594
|
+
.button--outline.button--secondary-grey {
|
595
|
+
box-shadow: 0px;
|
596
|
+
}
|
597
|
+
|
598
|
+
.button--outline.button--secondary-grey:hover:not(.button--disabled),
|
599
|
+
.button--outline.button--secondary-grey.button--checked:not(
|
600
|
+
.button--disabled
|
601
|
+
) {
|
602
|
+
color: #344054;
|
603
|
+
background-color: #f9fafb;
|
604
|
+
}
|
605
|
+
|
606
|
+
.button--outline.button--secondary-grey:active:not(.button--disabled) {
|
607
|
+
box-shadow: 0px;
|
608
|
+
}
|
609
|
+
|
610
|
+
.button--outline.button--secondary-grey:focus-visible:not(.button--disabled) {
|
611
|
+
box-shadow: 0px;
|
612
|
+
}
|
613
|
+
|
614
|
+
/* secondary-blue */
|
615
|
+
.button--outline.button--secondary-blue {
|
616
|
+
box-shadow: 0px;
|
617
|
+
}
|
618
|
+
|
619
|
+
.button--outline.button--secondary-blue:hover:not(.button--disabled),
|
620
|
+
.button--outline.button--secondary-blue.button--checked:not(.button--disabled) {
|
621
|
+
color: #004678;
|
622
|
+
background-color: #EAF0F8;
|
623
|
+
}
|
624
|
+
|
625
|
+
.button--outline.button--secondary-blue:active:not(.button--disabled) {
|
626
|
+
box-shadow: 0px;
|
627
|
+
}
|
628
|
+
|
629
|
+
.button--outline.button--secondary-blue:focus-visible:not(.button--disabled) {
|
630
|
+
box-shadow: 0px;
|
631
|
+
}
|
632
|
+
|
397
633
|
@media (forced-colors: active) {
|
398
634
|
.button.button--outline.button--checked:not(.button--disabled) {
|
399
635
|
outline: solid 2px transparent;
|
@@ -486,4 +722,8 @@ export const styles = css`
|
|
486
722
|
pointer-events: none;
|
487
723
|
}
|
488
724
|
|
725
|
+
/* outline with no border */
|
726
|
+
.button--outline.button--hideborder {
|
727
|
+
border: 0px;
|
728
|
+
}
|
489
729
|
`;
|
@@ -51,9 +51,14 @@ export class NileButton extends NileElement implements NileFormControl {
|
|
51
51
|
// Fall back to the closest containing form
|
52
52
|
return input.closest('form');
|
53
53
|
},
|
54
|
-
assumeInteractionOn: ['click']
|
54
|
+
assumeInteractionOn: ['click'],
|
55
55
|
});
|
56
|
-
private readonly hasSlotController = new HasSlotController(
|
56
|
+
private readonly hasSlotController = new HasSlotController(
|
57
|
+
this,
|
58
|
+
'[default]',
|
59
|
+
'prefix',
|
60
|
+
'suffix'
|
61
|
+
);
|
57
62
|
|
58
63
|
@query('.button') button: HTMLButtonElement | HTMLLinkElement;
|
59
64
|
|
@@ -62,10 +67,18 @@ export class NileButton extends NileElement implements NileFormControl {
|
|
62
67
|
@property() title = ''; // make reactive to pass through
|
63
68
|
|
64
69
|
/** The button's theme variant. */
|
65
|
-
@property({ reflect: true }) variant:
|
70
|
+
@property({ reflect: true }) variant:
|
71
|
+
| 'primary'
|
72
|
+
| 'secondary'
|
73
|
+
| 'tertiary'
|
74
|
+
| 'caution'
|
75
|
+
| 'ghost'
|
76
|
+
| 'destructive'
|
77
|
+
| 'secondary-grey'
|
78
|
+
| 'secondary-blue' = 'primary';
|
66
79
|
|
67
80
|
/** The button's size. */
|
68
|
-
@property({ reflect: true }) size:
|
81
|
+
@property({ reflect: true }) size: 'medium' = 'medium';
|
69
82
|
|
70
83
|
/** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */
|
71
84
|
@property({ type: Boolean, reflect: true }) caret = false;
|
@@ -134,16 +147,28 @@ export class NileButton extends NileElement implements NileFormControl {
|
|
134
147
|
|
135
148
|
/** Used to override the form owner's `enctype` attribute. */
|
136
149
|
@property({ attribute: 'formenctype' })
|
137
|
-
formEnctype:
|
150
|
+
formEnctype:
|
151
|
+
| 'application/x-www-form-urlencoded'
|
152
|
+
| 'multipart/form-data'
|
153
|
+
| 'text/plain';
|
138
154
|
|
139
155
|
/** Used to override the form owner's `method` attribute. */
|
140
156
|
@property({ attribute: 'formmethod' }) formMethod: 'post' | 'get';
|
141
157
|
|
142
158
|
/** Used to override the form owner's `novalidate` attribute. */
|
143
|
-
@property({ attribute: 'formnovalidate', type: Boolean })
|
159
|
+
@property({ attribute: 'formnovalidate', type: Boolean })
|
160
|
+
formNoValidate: boolean;
|
144
161
|
|
145
162
|
/** Used to override the form owner's `target` attribute. */
|
146
|
-
@property({ attribute: 'formtarget' }) formTarget:
|
163
|
+
@property({ attribute: 'formtarget' }) formTarget:
|
164
|
+
| '_self'
|
165
|
+
| '_blank'
|
166
|
+
| '_parent'
|
167
|
+
| '_top'
|
168
|
+
| string;
|
169
|
+
|
170
|
+
@property({ type: Boolean, reflect: true, attribute: 'hide-border' })
|
171
|
+
hideBorder = false;
|
147
172
|
|
148
173
|
/** Gets the validity state object */
|
149
174
|
get validity() {
|
@@ -293,6 +318,10 @@ export class NileButton extends NileElement implements NileFormControl {
|
|
293
318
|
'button--tertiary': this.variant === 'tertiary',
|
294
319
|
'button--caution': this.variant === 'caution',
|
295
320
|
'button--ghost': this.variant === 'ghost',
|
321
|
+
'button--destructive': this.variant === 'destructive',
|
322
|
+
'button--secondary-grey': this.variant === 'secondary-grey',
|
323
|
+
'button--secondary-blue': this.variant === 'secondary-blue',
|
324
|
+
'button--hideborder': this.hideBorder,
|
296
325
|
'button--medium': this.size === 'medium',
|
297
326
|
'button--caret': this.caret,
|
298
327
|
'button--circle': this.circle,
|
@@ -304,11 +333,14 @@ export class NileButton extends NileElement implements NileFormControl {
|
|
304
333
|
'button--pill': this.pill,
|
305
334
|
'button--has-label': this.hasSlotController.test('[default]'),
|
306
335
|
'button--has-prefix': this.hasSlotController.test('prefix'),
|
307
|
-
'button--has-suffix': this.hasSlotController.test('suffix')
|
336
|
+
'button--has-suffix': this.hasSlotController.test('suffix'),
|
308
337
|
})}
|
309
338
|
?disabled=${ifDefined(isLink ? undefined : this.disabled)}
|
310
339
|
type=${ifDefined(isLink ? undefined : this.type)}
|
311
|
-
title=${
|
340
|
+
title=${
|
341
|
+
this
|
342
|
+
.title /* An empty title prevents browser validation tooltips from appearing on hover */
|
343
|
+
}
|
312
344
|
name=${ifDefined(isLink ? undefined : this.name)}
|
313
345
|
value=${ifDefined(isLink ? undefined : this.value)}
|
314
346
|
href=${ifDefined(isLink ? this.href : undefined)}
|
@@ -327,7 +359,16 @@ export class NileButton extends NileElement implements NileFormControl {
|
|
327
359
|
<slot part="label" class="button__label"></slot>
|
328
360
|
<slot name="suffix" part="suffix" class="button__suffix"></slot>
|
329
361
|
${
|
330
|
-
this.caret
|
362
|
+
this.caret
|
363
|
+
? html`
|
364
|
+
<nile-icon
|
365
|
+
part="caret"
|
366
|
+
class="button__caret"
|
367
|
+
color="white"
|
368
|
+
name="arrowdown"
|
369
|
+
></nile-icon>
|
370
|
+
`
|
371
|
+
: ''
|
331
372
|
}
|
332
373
|
${this.loading ? html`<nile-spinner></nile-spinner>` : ''}
|
333
374
|
</${tag}>
|
@@ -338,7 +379,7 @@ export class NileButton extends NileElement implements NileFormControl {
|
|
338
379
|
export default NileButton;
|
339
380
|
|
340
381
|
declare global {
|
341
|
-
|
382
|
+
interface HTMLElementTagNameMap {
|
342
383
|
'nile-button': NileButton;
|
343
384
|
}
|
344
385
|
}
|