@bpmn-io/form-js-carbon-styles 1.6.3 → 1.6.4

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.
@@ -1,1179 +1,1179 @@
1
- /**
2
- * DEPRECATED: This file is deprecated and will be removed with one of the next releases.
3
- */
4
-
5
- import { css, createGlobalStyle } from 'styled-components';
6
- import { rem } from '@carbon/elements';
7
-
8
- function getSelectArrowSvg(color) {
9
- return `url('data:image/svg+xml;base64,${window.btoa(
10
- `<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="${color}" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg>`,
11
- )}')`;
12
- }
13
-
14
- function getNumberInputMinusSvg(color) {
15
- return `url('data:image/svg+xml;base64,${window.btoa(
16
- `<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="${color}" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true"><path d="M8 15H24V17H8z" /></svg>`,
17
- )}')`;
18
- }
19
-
20
- function getNumberInputPlusSvg(color) {
21
- return `url('data:image/svg+xml;base64,${window.btoa(
22
- `<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="${color}" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true"><path d="M17 15L17 8 15 8 15 15 8 15 8 17 15 17 15 24 17 24 17 17 24 17 24 15z" /></svg>`,
23
- )}')`;
24
- }
25
-
26
- const getBaseInputStyles = ({ height }) => css`
27
- color: var(--cds-text-primary);
28
- border-radius: 0;
29
- border: none;
30
- border-bottom: 1px solid var(--cds-border-strong);
31
- height: ${height};
32
- font-size: var(--cds-body-short-01-font-size);
33
- font-weight: var(--cds-body-short-01-font-weight);
34
- line-height: var(--cds-body-short-01-line-height);
35
- letter-spacing: var(--cds-body-short-01-letter-spacing);
36
-
37
- &:focus {
38
- outline: 2px solid var(--cds-focus);
39
- outline-offset: -2px;
40
- }
41
-
42
- &::placeholder {
43
- color: var(--cds-text-placeholder);
44
- }
45
- `;
46
-
47
- const getSelectArrowStyles = ({ arrowRightPosition, color }) => css`
48
- color: var(--cds-text-primary);
49
- background-color: var(--cds-field);
50
- cursor: pointer;
51
- appearance: none;
52
- background-image: ${getSelectArrowSvg(color)};
53
- background-repeat: no-repeat;
54
- background-position: right ${arrowRightPosition} bottom 50%;
55
- `;
56
-
57
- const MARKDOWN_STYLES = css`
58
- .fjs-container .fjs-form-field.fjs-form-field-text .markup {
59
- & {
60
- font-size: var(--cds-body-long-01-font-size);
61
- font-weight: var(--cds-body-long-01-font-weight);
62
- line-height: var(--cds-body-long-01-line-height);
63
- letter-spacing: var(--cds-body-long-01-letter-spacing);
64
- }
65
-
66
- & h1 {
67
- font-size: var(--cds-productive-heading-06-font-size);
68
- font-weight: var(--cds-productive-heading-06-font-weight);
69
- line-height: var(--cds-productive-heading-06-line-height);
70
- letter-spacing: var(--cds-productive-heading-06-letter-spacing);
71
- }
72
-
73
- & h2 {
74
- font-size: var(--cds-productive-heading-05-font-size);
75
- font-weight: var(--cds-productive-heading-05-font-weight);
76
- line-height: var(--cds-productive-heading-05-line-height);
77
- letter-spacing: var(--cds-productive-heading-05-letter-spacing);
78
- }
79
-
80
- & h3 {
81
- font-size: var(--cds-productive-heading-04-font-size);
82
- font-weight: var(--cds-productive-heading-04-font-weight);
83
- line-height: var(--cds-productive-heading-04-line-height);
84
- letter-spacing: var(--cds-productive-heading-04-letter-spacing);
85
- }
86
- & h4 {
87
- font-size: var(--cds-productive-heading-03-font-size);
88
- font-weight: var(--cds-productive-heading-03-font-weight);
89
- line-height: var(--cds-productive-heading-03-line-height);
90
- letter-spacing: var(--cds-productive-heading-03-letter-spacing);
91
- }
92
- & h5 {
93
- font-size: var(--cds-productive-heading-02-font-size);
94
- font-weight: var(--cds-productive-heading-02-font-weight);
95
- line-height: var(--cds-productive-heading-02-line-height);
96
- letter-spacing: var(--cds-productive-heading-02-letter-spacing);
97
- }
98
- & h6 {
99
- font-size: var(--cds-productive-heading-01-font-size);
100
- font-weight: var(--cds-productive-heading-01-font-weight);
101
- line-height: var(--cds-productive-heading-01-line-height);
102
- letter-spacing: var(--cds-productive-heading-01-letter-spacing);
103
- }
104
-
105
- & code {
106
- font-family: var(--cds-code-02-font-family);
107
- font-size: var(--cds-code-02-font-size);
108
- font-weight: var(--cds-code-02-font-weight);
109
- line-height: var(--cds-code-02-line-height);
110
- letter-spacing: var(--cds-code-02-letter-spacing);
111
- white-space: pre-wrap;
112
- }
113
-
114
- & blockquote {
115
- font-family: var(--cds-quotation-02-font-family);
116
- font-size: var(--cds-quotation-02-font-size);
117
- font-weight: var(--cds-quotation-02-font-weight);
118
- line-height: var(--cds-quotation-02-line-height);
119
- letter-spacing: var(--cds-quotation-02-letter-spacing);
120
- }
121
-
122
- & ul,
123
- & ol {
124
- box-sizing: border-box;
125
- padding: 0;
126
- border: 0;
127
- margin: 0;
128
- list-style: none;
129
- }
130
-
131
- & ul {
132
- margin-left: var(--cds-spacing-05);
133
- }
134
-
135
- & ol {
136
- margin-left: var(--cds-spacing-05);
137
- }
138
-
139
- & ul li {
140
- position: relative;
141
-
142
- &:before {
143
- position: absolute;
144
- left: calc(-1 * var(--cds-spacing-05));
145
- content: '–';
146
- }
147
- }
148
-
149
- & ol li {
150
- position: relative;
151
- counter-increment: item;
152
-
153
- &:before {
154
- position: absolute;
155
- left: calc(-1 * var(--cds-spacing-05));
156
- content: counter(item) '.';
157
- }
158
- }
159
- }
160
- `;
161
-
162
- const ANCHOR_STYLES = css`
163
- .fjs-container .fjs-form-field-text a {
164
- color: var(--cds-link-primary);
165
- outline: none;
166
- text-decoration: underline;
167
- font-size: inherit;
168
- font-weight: inherit;
169
- line-height: var(--cds-body-compact-01-line-height);
170
- letter-spacing: var(--cds-body-compact-01-letter-spacing);
171
-
172
- &:hover {
173
- color: var(--cds-link-primary-hover);
174
- }
175
-
176
- &:focus {
177
- outline: 1px solid var(--cds-focus);
178
- }
179
-
180
- &:active,
181
- &:active:visited,
182
- &:active:visited:hover {
183
- color: var(--cds-text-primary);
184
- }
185
-
186
- &:visited {
187
- color: var(--cds-link-primary);
188
- }
189
-
190
- &:visited:hover {
191
- color: var(--cds-link-primary-hover);
192
- }
193
- }
194
- `;
195
-
196
- const READONLY_STYLES = css`
197
- ${({ theme }) => css`
198
- .fjs-container {
199
- .fjs-readonly {
200
- .fjs-input:read-only:not(:disabled),
201
- .fjs-textarea:read-only:not(:disabled),
202
- .fjs-select:read-only:not(:disabled),
203
- &.fjs-taglist,
204
- .fjs-input-group {
205
- background-color: transparent;
206
- }
207
-
208
- &.fjs-form-field {
209
- .fjs-input-group {
210
- border-bottom: 1px solid var(--cds-border-subtle);
211
- }
212
- }
213
-
214
- &.fjs-form-field-number {
215
- .fjs-input-group .fjs-number-arrow-container {
216
- background-color: transparent;
217
-
218
- .fjs-number-arrow-up,
219
- .fjs-number-arrow-down {
220
- background-color: transparent;
221
- pointer-events: none;
222
- }
223
- }
224
- }
225
-
226
- &.fjs-form-field:not(.fjs-form-field-datetime) {
227
- .fjs-input-group .fjs-input-adornment {
228
- background: transparent;
229
- }
230
- }
231
-
232
- &.fjs-form-field-select {
233
- .fjs-input-group {
234
- cursor: unset;
235
- background-image: ${getSelectArrowSvg(theme.iconDisabled)};
236
- background-color: transparent;
237
-
238
- .fjs-input:read-only:not(:disabled) {
239
- border-color: transparent;
240
- }
241
-
242
- .fjs-select-display {
243
- color: var(--cds-text-primary);
244
- }
245
- }
246
- }
247
-
248
- &.fjs-form-field-datetime {
249
- .fjs-input-group {
250
- cursor: unset;
251
-
252
- .fjs-input-adornment {
253
- background-color: transparent;
254
- }
255
-
256
- .flatpickr-input {
257
- cursor: unset;
258
- }
259
-
260
- .fjs-input-adornment svg {
261
- cursor: unset;
262
- }
263
- }
264
- }
265
-
266
- &.fjs-form-field-checkbox,
267
- &.fjs-form-field-radio,
268
- &.fjs-form-field-checklist {
269
- .fjs-input:read-only {
270
- opacity: 1;
271
- background-color: transparent;
272
-
273
- &:before {
274
- border-color: var(--cds-icon-disabled);
275
- }
276
- }
277
-
278
- &.fjs-checked .fjs-input[type='checkbox'],
279
- .fjs-form-field-label.fjs-checked .fjs-input[type='checkbox'] {
280
- &:before {
281
- border: 1px solid var(--cds-icon-disabled);
282
- background: transparent;
283
- }
284
-
285
- &:after {
286
- border-bottom: 2px solid var(--cds-icon-primary);
287
- border-left: 2px solid var(--cds-icon-primary);
288
- }
289
- }
290
- }
291
-
292
- &.fjs-taglist .fjs-taglist-tag {
293
- .fjs-taglist-tag-label {
294
- padding: 2px 0px;
295
- }
296
- }
297
- }
298
- }
299
- `}
300
- `;
301
-
302
- const DISABLED_STYLES = css`
303
- .fjs-container {
304
- .fjs-disabled {
305
- &.fjs-form-field-textfield .fjs-input,
306
- &.fjs-form-field-datetime .fjs-input,
307
- & .fjs-textarea:disabled,
308
- & .fjs-taglist.fjs-disabled,
309
- & .fjs-taglist.fjs-disabled .fjs-taglist-input,
310
- &.fjs-form-field-select .fjs-input-group.disabled,
311
- &.fjs-form-field-select .fjs-input-group.disabled .fjs-select-display,
312
- &.fjs-form-field-select .fjs-input-group.disabled .fjs-input,
313
- &.fjs-form-field .fjs-form-field-label,
314
- &.fjs-form-field.fjs-form-field-radio .fjs-form-field-label,
315
- &.fjs-form-field.fjs-form-field-checklist .fjs-form-field-label,
316
- & .fjs-form-field-description {
317
- /* todo(pinussilvestrus): mitigate https://github.com/carbon-design-system/carbon/issues/13286 */
318
- color: var(--cds-text-disabled);
319
- cursor: var(--cursor-disabled, not-allowed);
320
- }
321
-
322
- &.fjs-form-field-textfield .fjs-input-group,
323
- &.fjs-form-field-datetime .fjs-input-group,
324
- & .fjs-textarea:disabled,
325
- & .fjs-taglist.fjs-disabled,
326
- & .fjs-taglist.fjs-disabled .fjs-taglist-input,
327
- &.fjs-form-field-select .fjs-input-group.disabled,
328
- &.fjs-form-field-select .fjs-input-group.disabled .fjs-select-display,
329
- &.fjs-form-field-select .fjs-input-group.disabled .fjs-input {
330
- border: none;
331
- }
332
- }
333
-
334
- .fjs-disabled.fjs-form-field-number .fjs-input-group {
335
- border: none;
336
- cursor: var(--cursor-disabled, not-allowed);
337
- }
338
-
339
- .fjs-disabled.fjs-form-field-number .fjs-input-group .fjs-input {
340
- cursor: var(--cursor-disabled, not-allowed);
341
- }
342
-
343
- .fjs-form-field.fjs-disabled.fjs-checked .fjs-input[type='checkbox'] {
344
- cursor: var(--cursor-disabled, not-allowed);
345
- &:before {
346
- border-color: var(--cds-icon-disabled);
347
- background-color: var(--cds-icon-disabled);
348
- cursor: var(--cursor-disabled, not-allowed);
349
- }
350
-
351
- &:after {
352
- cursor: var(--cursor-disabled, not-allowed);
353
- }
354
- }
355
-
356
- .fjs-form-field.fjs-disabled .fjs-input[type='checkbox'] {
357
- cursor: var(--cursor-disabled, not-allowed);
358
- &:before {
359
- border-color: var(--cds-icon-disabled);
360
- cursor: var(--cursor-disabled, not-allowed);
361
- }
362
- }
363
-
364
- .fjs-form-field-datetime.fjs-disabled
365
- .fjs-input-group
366
- .fjs-input-adornment
367
- svg {
368
- color: var(--cds-icon-disabled);
369
- cursor: var(--cursor-disabled, not-allowed);
370
- }
371
-
372
- .fjs-taglist.fjs-disabled .fjs-taglist-tag {
373
- background-color: var(--cds-layer-01);
374
-
375
- .fjs-taglist-tag-label {
376
- padding: 2px 0px;
377
- opacity: 0.7;
378
- color: var(--cds-text-on-color-disabled);
379
- }
380
- }
381
- }
382
- `;
383
-
384
- const LABEL_DESCRIPTION_ERROR_STYLES = css`
385
- .fjs-container {
386
- .fjs-form-field-label {
387
- font-size: var(--cds-label-01-font-size);
388
- font-weight: var(--cds-label-01-font-weight);
389
- line-height: var(--cds-label-01-line-height);
390
- letter-spacing: var(--cds-label-01-letter-spacing);
391
- }
392
-
393
- .fjs-form-field:not(.fjs-form-field-checkbox, .fjs-form-field-grouplike)
394
- .fjs-form-field-label:first-child {
395
- margin: 0;
396
- margin-bottom: var(--cds-spacing-03);
397
- }
398
-
399
- .fjs-form-field.fjs-form-field-radio
400
- .fjs-form-field-label:not(:first-of-type),
401
- .fjs-form-field.fjs-form-field-checklist
402
- .fjs-form-field-label:not(:first-of-type) {
403
- margin: 0;
404
- margin-bottom: 0.1875rem;
405
- }
406
-
407
- .fjs-form-field.fjs-form-field-radio
408
- .fjs-form-field-label:not(:first-of-type) {
409
- min-height: ${rem(27)};
410
- }
411
-
412
- .fjs-form-field-description {
413
- margin: 0;
414
- margin-top: var(--cds-spacing-02);
415
- font-size: var(--cds-helper-text-01-font-size);
416
- font-weight: var(--cds-helper-text-01-font-weight);
417
- line-height: var(--cds-helper-text-01-line-height);
418
- letter-spacing: var(--cds-helper-text-01-letter-spacing);
419
- }
420
-
421
- .fjs-form-field-error {
422
- margin: 0;
423
- margin-top: var(--cds-spacing-02);
424
- font-size: var(--cds-label-01-font-size);
425
- font-weight: var(--cds-label-01-font-weight);
426
- line-height: var(--cds-label-01-line-height);
427
- letter-spacing: var(--cds-label-01-letter-spacing);
428
- }
429
-
430
- .fjs-has-errors .fjs-form-field-description {
431
- display: none;
432
- }
433
- }
434
- `;
435
-
436
- const CHECKBOX_STYLES = css`
437
- .fjs-container {
438
- .fjs-input[type='checkbox'],
439
- .fjs-input[type='checkbox']:focus {
440
- all: unset;
441
- width: ${rem(6)};
442
- }
443
-
444
- .fjs-form-field .fjs-input[type='checkbox'] {
445
- position: relative;
446
- display: flex;
447
- min-height: ${rem(24)};
448
- padding-top: ${rem(3)};
449
- padding-left: ${rem(20)};
450
- cursor: pointer;
451
- user-select: none;
452
- font-size: var(--cds-body-short-01-font-size);
453
- font-weight: var(--cds-body-short-01-font-weight);
454
- line-height: var(--cds-body-short-01-line-height);
455
- letter-spacing: var(--cds-body-short-01-letter-spacing);
456
-
457
- &:before,
458
- &:after {
459
- box-sizing: border-box;
460
- }
461
-
462
- &:before {
463
- position: absolute;
464
- top: ${rem(3)};
465
- left: 0;
466
- width: ${rem(16)};
467
- height: ${rem(16)};
468
- border: 1px solid var(--cds-icon-primary);
469
- margin: ${rem(2)} ${rem(2)} ${rem(2)} ${rem(3)};
470
- background-color: transparent;
471
- border-radius: 1px;
472
- content: '';
473
- }
474
-
475
- &:after {
476
- position: absolute;
477
- top: ${rem(9)};
478
- left: ${rem(7)};
479
- width: ${rem(9)};
480
- height: ${rem(5)};
481
- border-bottom: 2px solid var(--cds-icon-inverse);
482
- border-left: 2px solid var(--cds-icon-inverse);
483
- margin-top: ${rem(-3)};
484
- background: 0 0;
485
- content: '';
486
- transform: scale(0) rotate(-45deg);
487
- transform-origin: bottom right;
488
- }
489
- }
490
-
491
- .fjs-form-field .fjs-input[type='checkbox']:focus {
492
- &:before {
493
- outline: 2px solid var(--cds-focus);
494
- outline-offset: 1px;
495
- }
496
- }
497
-
498
- .fjs-form-field.fjs-checked .fjs-input[type='checkbox'],
499
- .fjs-form-field
500
- .fjs-form-field-label.fjs-checked
501
- .fjs-input[type='checkbox'] {
502
- &:before {
503
- border: none;
504
- border-width: 1px;
505
- background-color: var(--cds-icon-primary);
506
- }
507
-
508
- &:after {
509
- transform: scale(1) rotate(-45deg);
510
- }
511
- }
512
-
513
- .fjs-form-field-checklist .fjs-form-field-label:not(:first-of-type) {
514
- font-size: var(--cds-body-short-01-font-size);
515
- font-weight: var(--cds-body-short-01-font-weight);
516
- line-height: var(--cds-body-short-01-line-height);
517
- letter-spacing: var(--cds-body-short-01-letter-spacing);
518
- color: var(--cds-text-primary);
519
- }
520
-
521
- .fjs-form-field-checkbox .fjs-form-field-label {
522
- font-size: var(--cds-body-short-01-font-size);
523
- font-weight: var(--cds-body-short-01-font-weight);
524
- line-height: var(--cds-body-short-01-line-height);
525
- letter-spacing: var(--cds-body-short-01-letter-spacing);
526
- color: var(--cds-text-primary);
527
- }
528
- }
529
- `;
530
-
531
- const TAGLIST_STYLES = css`
532
- .fjs-container {
533
- .fjs-taglist {
534
- display: flex;
535
- align-items: center;
536
- min-height: 2.5rem;
537
- height: unset !important;
538
- }
539
-
540
- .fjs-taglist:focus-within {
541
- outline: 2px solid var(--cds-focus);
542
- outline-offset: -2px;
543
- }
544
-
545
- .fjs-taglist .fjs-taglist-input {
546
- &,
547
- &::placeholder {
548
- color: var(--cds-text-primary);
549
- }
550
- }
551
-
552
- .fjs-taglist .fjs-taglist-tag {
553
- font-size: var(--cds-label-01-font-size);
554
- font-weight: var(--cds-label-01-font-weight);
555
- line-height: var(--cds-label-01-line-height);
556
- letter-spacing: var(--cds-label-01-letter-spacing);
557
- max-width: 100%;
558
- padding: 0 0.5rem;
559
- border-radius: 0.9375rem;
560
- word-break: break-word;
561
- min-width: auto;
562
- display: inline-flex;
563
- align-items: center;
564
- justify-content: center;
565
-
566
- & .fjs-taglist-tag-label {
567
- padding: 0;
568
- max-width: 100%;
569
- text-overflow: ellipsis;
570
- white-space: nowrap;
571
- }
572
-
573
- & .fjs-taglist-tag-remove {
574
- all: unset;
575
- width: 1.5rem;
576
- height: 1.5rem;
577
- border-radius: 50%;
578
- display: flex;
579
- flex-shrink: 0;
580
- align-items: center;
581
- justify-content: center;
582
- padding: 0;
583
- border: 0;
584
- margin: 0 ${rem(-8)} 0 0.125rem;
585
- cursor: pointer;
586
- }
587
-
588
- & .fjs-taglist-tag-remove svg {
589
- all: unset;
590
- color: var(--cds-icon-inverse);
591
- }
592
-
593
- & .fjs-taglist-tag-remove:focus {
594
- background-color: transparent;
595
- outline: 1px solid var(--cds-focus-inverse);
596
- }
597
- }
598
- }
599
- `;
600
-
601
- const RADIO_STYLES = css`
602
- .fjs-container .fjs-form-field-radio {
603
- .fjs-input {
604
- appearance: none;
605
- width: 0;
606
- margin: 0;
607
- margin-right: calc(${rem(18)} + var(--cds-spacing-03));
608
- position: relative;
609
- height: ${rem(18)};
610
- outline: none;
611
-
612
- &:focus:before {
613
- outline: 2px solid var(--cds-focus);
614
- outline-offset: 1.5px;
615
- }
616
-
617
- &:before {
618
- position: absolute;
619
- top: 0;
620
- left: 0;
621
- width: ${rem(18)};
622
- height: ${rem(18)};
623
- border: 1px solid var(--cds-icon-primary);
624
- background-color: transparent;
625
- border-radius: 50%;
626
- content: '';
627
- }
628
- }
629
-
630
- .fjs-checked .fjs-input:after {
631
- position: relative;
632
- top: 0;
633
- left: 0;
634
- display: inline-block;
635
- width: ${rem(18)};
636
- height: ${rem(18)};
637
- background-color: var(--cds-icon-primary);
638
- border-radius: 50%;
639
- content: '';
640
- transform: scale(0.5);
641
- }
642
-
643
- &.fjs-disabled .fjs-input:before {
644
- border-color: var(--cds-icon-disabled);
645
- }
646
-
647
- &.fjs-disabled .fjs-checked .fjs-input:after {
648
- background-color: var(--cds-icon-disabled);
649
- }
650
-
651
- .fjs-form-field-label:not(:first-of-type) {
652
- font-size: var(--cds-body-short-01-font-size);
653
- font-weight: var(--cds-body-short-01-font-weight);
654
- line-height: var(--cds-body-short-01-line-height);
655
- letter-spacing: var(--cds-body-short-01-letter-spacing);
656
- color: var(--cds-text-primary);
657
- }
658
- }
659
- `;
660
-
661
- const BUTTON_STYLES = css`
662
- .fjs-container {
663
- .fjs-form-field.fjs-form-field-button .fjs-button {
664
- font-size: var(--cds-body-short-01-font-size);
665
- font-weight: var(--cds-body-short-01-font-weight);
666
- line-height: var(--cds-body-short-01-line-height);
667
- letter-spacing: var(--cds-body-short-01-letter-spacing);
668
- min-height: ${rem(32)};
669
- padding: calc(0.375rem - 3px) 60px calc(0.375rem - 3px) 12px;
670
- text-align: left;
671
- color: var(--cds-button-tertiary);
672
- border: 1px solid var(--cds-button-tertiary);
673
- border-radius: 0;
674
- background-color: transparent;
675
- cursor: pointer;
676
- }
677
-
678
- .fjs-form-field.fjs-form-field-button .fjs-button:hover {
679
- color: var(--cds-text-inverse);
680
- background-color: var(--cds-button-tertiary-hover);
681
- }
682
-
683
- .fjs-form-field.fjs-form-field-button .fjs-button:focus {
684
- border-color: var(--cds-focus);
685
- box-shadow: inset 0 0 0 1px var(--cds-focus),
686
- inset 0 0 0 2px var(--cds-background);
687
- color: var(--cds-text-inverse);
688
- background-color: var(--cds-button-tertiary);
689
- }
690
-
691
- .fjs-form-field.fjs-form-field-button .fjs-button:active {
692
- border-color: transparent;
693
- background-color: var(--cds-button-tertiary-active);
694
- color: var(--cds-text-inverse);
695
- }
696
-
697
- .fjs-form-field.fjs-form-field-button .fjs-button:disabled {
698
- border: 1px solid var(--cds-button-disabled);
699
- background: transparent;
700
- box-shadow: none;
701
- color: var(--cds-text-on-color-disabled);
702
- cursor: var(--cursor-disabled, not-allowed);
703
- outline: none;
704
- }
705
-
706
- .fjs-form-field.fjs-form-field-button .fjs-button[type='submit'] {
707
- background-color: var(--cds-button-primary);
708
- border: 1px solid transparent;
709
- color: var(--cds-text-on-color);
710
- }
711
-
712
- .fjs-form-field.fjs-form-field-button .fjs-button[type='submit']:disabled {
713
- background: var(--cds-button-disabled);
714
- }
715
- }
716
- `;
717
-
718
- const NUMBER_INPUTS = css`
719
- ${({ theme }) => css`
720
- .fjs-container .fjs-form-field-number .fjs-input-group {
721
- border-radius: 0;
722
- border: none;
723
- border-bottom: 1px solid var(--cds-border-strong);
724
- height: 2.5rem;
725
- box-sizing: border-box;
726
-
727
- &:focus-within {
728
- outline: 2px solid var(--cds-focus);
729
- outline-offset: -2px;
730
- }
731
-
732
- & .fjs-input {
733
- border-radius: 0;
734
- border: none;
735
- font-size: var(--cds-body-short-01-font-size);
736
- font-weight: var(--cds-body-short-01-font-weight);
737
- line-height: var(--cds-body-short-01-line-height);
738
- letter-spacing: var(--cds-body-short-01-letter-spacing);
739
- }
740
-
741
- & .fjs-number-arrow-container {
742
- all: unset;
743
- border: none;
744
- border-radius: 0;
745
- display: flex;
746
- flex-direction: row-reverse;
747
- align-items: center;
748
- background-color: var(--cds-field);
749
- }
750
-
751
- & .fjs-number-arrow-container .fjs-number-arrow-up,
752
- & .fjs-number-arrow-container .fjs-number-arrow-down {
753
- width: 40px;
754
- height: calc(40px - 1px);
755
- background-color: var(--cds-field);
756
- color: transparent;
757
-
758
- &:hover {
759
- background-color: var(--cds-field-hover);
760
- cursor: pointer;
761
- }
762
- }
763
-
764
- &.fjs-disabled .fjs-number-arrow-container .fjs-number-arrow-up:hover,
765
- &.fjs-disabled .fjs-number-arrow-container .fjs-number-arrow-down:hover {
766
- background-color: var(--cds-field);
767
- cursor: not-allowed;
768
- }
769
-
770
- & .fjs-number-arrow-container .fjs-number-arrow-separator {
771
- width: 0.0625rem;
772
- height: 1rem;
773
- background-color: var(--cds-border-subtle);
774
- }
775
-
776
- & .fjs-number-arrow-container .fjs-number-arrow-down {
777
- background-image: ${getNumberInputMinusSvg(theme.iconPrimary)};
778
- background-repeat: no-repeat;
779
- background-position: right 50% bottom 50%;
780
- }
781
-
782
- & .fjs-number-arrow-container .fjs-number-arrow-up {
783
- background-image: ${getNumberInputPlusSvg(theme.iconPrimary)};
784
- background-repeat: no-repeat;
785
- background-position: right 50% bottom 50%;
786
- }
787
-
788
- &.fjs-disabled .fjs-number-arrow-container .fjs-number-arrow-up {
789
- background-image: ${getNumberInputPlusSvg(theme.iconDisabled)};
790
- }
791
-
792
- &.fjs-disabled .fjs-number-arrow-container .fjs-number-arrow-down {
793
- background-image: ${getNumberInputMinusSvg(theme.iconDisabled)};
794
- }
795
- }
796
- `}
797
- `;
798
-
799
- const DATETIME_INPUTS = css`
800
- ${({ theme }) => css`
801
- .fjs-container {
802
- .fjs-form-field-datetime {
803
- .fjs-input.flatpickr-input {
804
- width: 100%;
805
- height: 100%;
806
- border: none;
807
- border-radius: 0;
808
-
809
- &,
810
- &::placeholder {
811
- color: var(--cds-text-primary);
812
- }
813
- }
814
-
815
- .fjs-input.flatpickr-input:disabled {
816
- color: var(--cds-text-disabled);
817
- }
818
-
819
- .fjs-input.flatpickr-input:disabled::placeholder {
820
- color: var(--cds-text-disabled);
821
- }
822
-
823
- .fjs-input.flatpickr-input:disabled::placeholder {
824
- color: var(--cds-text-disabled);
825
- }
826
-
827
- select {
828
- ${getBaseInputStyles({ height: '1.5rem' })};
829
- ${getSelectArrowStyles({
830
- arrowRightPosition: 'var(--cds-spacing-03)',
831
- color: theme.iconPrimary,
832
- })};
833
- border-bottom: none;
834
- padding-right: 2rem;
835
- }
836
-
837
- .fjs-input-group {
838
- display: flex;
839
- flex-direction: row-reverse;
840
- position: relative;
841
- }
842
-
843
- .fjs-input-group .fjs-input-adornment {
844
- border: none;
845
- border-radius: 0;
846
- background-color: var(--cds-field);
847
- display: flex;
848
- padding-right: var(--cds-spacing-05);
849
- }
850
-
851
- .fjs-input-group .fjs-input-adornment svg {
852
- color: var(--cds-icon-primary);
853
- cursor: pointer;
854
- }
855
-
856
- .flatpickr-wrapper {
857
- height: 100%;
858
- position: initial;
859
- }
860
-
861
- .fjs-timepicker.fjs-timepicker-anchor {
862
- position: unset;
863
- }
864
-
865
- .flatpickr-calendar.static {
866
- top: calc(100% + 3px);
867
- }
868
-
869
- .flatpickr-calendar .flatpickr-prev-month svg,
870
- .flatpickr-calendar .flatpickr-next-month svg {
871
- height: 16px;
872
- }
873
-
874
- .flatpickr-day.today {
875
- position: relative;
876
- color: var(--cds-link-primary);
877
- font-weight: 600;
878
- border-color: transparent;
879
- }
880
-
881
- .flatpickr-day.selected,
882
- .flatpickr-day.today.selected,
883
- .flatpickr-day.selected:hover,
884
- .flatpickr-day.today.selected:hover {
885
- background-color: var(--cds-button-primary);
886
- color: var(--cds-text-on-color);
887
- }
888
-
889
- .flatpickr-day:focus {
890
- outline: 2px solid var(--cds-focus);
891
- outline-offset: -2px;
892
- }
893
-
894
- .flatpickr-day.selected:focus {
895
- outline: 0.0625rem solid var(--cds-focus);
896
- outline-offset: -0.1875rem;
897
- }
898
-
899
- .flatpickr-day:hover {
900
- background: var(--cds-layer-hover);
901
- }
902
-
903
- .flatpickr-days,
904
- .flatpickr-weekdays {
905
- padding: unset;
906
- width: unset;
907
- }
908
- }
909
- }
910
- `}
911
- `;
912
-
913
- const SELECT_STYLES = css`
914
- ${({ theme }) => css`
915
- .fjs-container {
916
- .fjs-form-field-select .fjs-input-group {
917
- ${getBaseInputStyles({ height: '2.5rem' })}
918
- ${getSelectArrowStyles({
919
- arrowRightPosition: 'var(--cds-spacing-05)',
920
- color: theme.iconPrimary,
921
- })}
922
-
923
- .fjs-select-display {
924
- display: flex;
925
- align-items: center;
926
- }
927
-
928
- .fjs-select-arrow {
929
- color: transparent;
930
- }
931
-
932
- .fjs-select-cross {
933
- display: flex;
934
- align-items: center;
935
- justify-content: center;
936
- margin-right: var(--cds-spacing-04);
937
- width: 2.5rem;
938
- height: calc(2.5rem - 1px);
939
-
940
- &:hover {
941
- background-color: var(--cds-layer-hover);
942
- }
943
-
944
- svg {
945
- color: var(--cds-icon-primary);
946
- }
947
- }
948
-
949
- .fjs-input {
950
- color: var(--cds-text-primary);
951
- background-color: var(--cds-field);
952
- border-radius: 0;
953
- border: none;
954
- border-bottom: 1px solid var(--cds-border-strong);
955
- height: 2.5rem;
956
- font-size: var(--cds-body-short-01-font-size);
957
- font-weight: var(--cds-body-short-01-font-weight);
958
- line-height: var(--cds-body-short-01-line-height);
959
- letter-spacing: var(--cds-body-short-01-letter-spacing);
960
- }
961
- }
962
-
963
- .fjs-form-field-select .fjs-select-anchor .fjs-dropdownlist {
964
- position: absolute;
965
- top: -4px;
966
- }
967
-
968
- .fjs-form-field-select .fjs-input-group:focus-within {
969
- outline: 2px solid var(--cds-focus);
970
- outline-offset: -2px;
971
- }
972
-
973
- .fjs-form-field-select.fjs-disabled .fjs-input-group {
974
- ${getSelectArrowStyles({
975
- arrowRightPosition: 'var(--cds-spacing-05)',
976
- color: theme.iconDisabled,
977
- })}
978
- }
979
-
980
- .fjs-has-errors.fjs-form-field-select .fjs-input-group:focus-within {
981
- outline: 2px solid var(--cds-focus);
982
- outline-offset: -2px;
983
- }
984
-
985
- .fjs-has-errors.fjs-form-field-select .fjs-input-group {
986
- outline: 2px solid var(--cds-text-error);
987
- outline-offset: -2px;
988
- }
989
- }
990
- `}
991
- `;
992
-
993
- const REMAINING_INPUTS = css`
994
- .fjs-container {
995
- .fjs-form-field-textfield .fjs-input-group,
996
- .fjs-form-field-datetime .fjs-input-group,
997
- .fjs-textarea,
998
- .fjs-taglist,
999
- .fjs-form-field-select.fjs-disabled .fjs-input-group {
1000
- ${getBaseInputStyles({ height: '2.5rem' })}
1001
- }
1002
-
1003
- .fjs-form-field-textfield .fjs-input-group,
1004
- .fjs-form-field-datetime .fjs-input-group {
1005
- &:focus-within {
1006
- outline: 2px solid var(--cds-focus);
1007
- outline-offset: -2px;
1008
- }
1009
- }
1010
- .fjs-form-field-textfield .fjs-input,
1011
- .fjs-form-field-datetime .fjs-input {
1012
- background-color: var(--cds-field);
1013
- color: var(--cds-text-primary);
1014
- border-radius: 0;
1015
- }
1016
-
1017
- .fjs-has-errors.fjs-form-field-number .fjs-input-group:focus-within,
1018
- .fjs-has-errors.fjs-form-field-textarea .fjs-textarea:focus,
1019
- .fjs-form-field-textfield.fjs-has-errors .fjs-input-group:focus-within,
1020
- .fjs-form-field-textfield.fjs-has-errors .fjs-input-group:focus,
1021
- .fjs-form-field-datetime.fjs-has-errors .fjs-input-group:focus-within,
1022
- .fjs-form-field-datetime.fjs-has-errors .fjs-input-group:focus {
1023
- outline: 2px solid var(--cds-focus);
1024
- outline-offset: -2px;
1025
- }
1026
-
1027
- .fjs-has-errors.fjs-form-field-number .fjs-input-group,
1028
- .fjs-has-errors.fjs-form-field-textarea .fjs-textarea,
1029
- .fjs-form-field-textfield.fjs-has-errors .fjs-input-group,
1030
- .fjs-form-field-textfield.fjs-has-errors .fjs-input-group,
1031
- .fjs-form-field-datetime.fjs-has-errors .fjs-input-group,
1032
- .fjs-form-field-datetime.fjs-has-errors .fjs-input-group {
1033
- outline: 2px solid var(--cds-text-error);
1034
- outline-offset: -2px;
1035
- }
1036
- }
1037
- `;
1038
-
1039
- const DROPDOWN_STYLES = css`
1040
- .fjs-container {
1041
- .fjs-form-field-taglist .fjs-taglist-anchor .fjs-dropdownlist,
1042
- .fjs-form-field-datetime .fjs-timepicker-anchor .fjs-dropdownlist,
1043
- .fjs-form-field-select .fjs-select-anchor .fjs-dropdownlist {
1044
- margin: 0;
1045
- max-height: ${rem(264)};
1046
- border: none;
1047
- background-color: var(--cds-layer);
1048
- overflow-y: auto;
1049
- cursor: pointer;
1050
- border-radius: 0;
1051
- box-shadow: 0 2px 6px var(--cds-shadow);
1052
-
1053
- & .fjs-dropdownlist-item {
1054
- border: none;
1055
- box-sizing: border-box;
1056
- padding: 0;
1057
- margin: 0 var(--cds-spacing-05);
1058
- }
1059
-
1060
- & .fjs-dropdownlist-item:not(:first-of-type):not(:hover) {
1061
- border-top: 1px solid var(--cds-border-subtle);
1062
- }
1063
-
1064
- & .fjs-dropdownlist-item,
1065
- & .fjs-dropdownlist-empty {
1066
- font-size: var(--cds-body-short-01-font-size);
1067
- font-weight: var(--cds-body-short-01-font-weight);
1068
- line-height: var(--cds-body-short-01-line-height);
1069
- letter-spacing: var(--cds-body-short-01-letter-spacing);
1070
- height: ${rem(40)};
1071
- color: var(--cds-text-secondary);
1072
- cursor: pointer;
1073
- user-select: none;
1074
- display: flex;
1075
- align-items: center;
1076
- background-color: transparent;
1077
- }
1078
-
1079
- & .fjs-dropdownlist-empty {
1080
- color: var(--cds-text-disabled);
1081
- cursor: default;
1082
- }
1083
-
1084
- & .fjs-dropdownlist-item:hover,
1085
- & .fjs-dropdownlist-item.focused {
1086
- background-color: var(--cds-layer-hover);
1087
- color: var(--cds-text-primary);
1088
- margin: 0;
1089
- padding: 0 var(--cds-spacing-05);
1090
- }
1091
-
1092
- & .fjs-dropdownlist-item:not(:first-of-type):hover {
1093
- padding-top: 1px;
1094
- }
1095
-
1096
- & .fjs-dropdownlist-item.focused + .fjs-dropdownlist-item {
1097
- border: none;
1098
- padding-top: 1px;
1099
- }
1100
- }
1101
- }
1102
- `;
1103
-
1104
- const ADORNMENTS_STYLES = css`
1105
- .fjs-container .fjs-form-field:not(.fjs-form-field-datetime) {
1106
- .fjs-input-group .fjs-input-adornment {
1107
- all: unset;
1108
- display: flex;
1109
- align-items: center;
1110
- background-color: var(--cds-field);
1111
- color: var(--cds-text-secondary);
1112
- padding: 0 var(--cds-spacing-04);
1113
- cursor: default;
1114
-
1115
- &.border-right {
1116
- padding-right: 0;
1117
- }
1118
-
1119
- &.border-left {
1120
- padding-left: 0;
1121
- }
1122
- }
1123
-
1124
- &.fjs-disabled .fjs-input-group .fjs-input-adornment {
1125
- color: var(--cds-text-disabled);
1126
- }
1127
- }
1128
- `;
1129
-
1130
- const CARBON_STYLES = css`
1131
- ${MARKDOWN_STYLES}
1132
- ${ANCHOR_STYLES}
1133
- ${READONLY_STYLES}
1134
- ${DISABLED_STYLES}
1135
- ${LABEL_DESCRIPTION_ERROR_STYLES}
1136
- ${CHECKBOX_STYLES}
1137
- ${TAGLIST_STYLES}
1138
- ${RADIO_STYLES}
1139
- ${BUTTON_STYLES}
1140
- ${NUMBER_INPUTS}
1141
- ${DATETIME_INPUTS}
1142
- ${REMAINING_INPUTS}
1143
- ${ADORNMENTS_STYLES}
1144
- ${DROPDOWN_STYLES}
1145
- ${SELECT_STYLES}
1146
-
1147
- .fjs-container {
1148
- width: 100%;
1149
- height: min-content;
1150
-
1151
- .cds--grid {
1152
- padding: 0;
1153
- }
1154
-
1155
- .fjs-form {
1156
- background-color: transparent;
1157
- color: var(--cds-text-primary);
1158
- padding: 0;
1159
- }
1160
-
1161
- @media (width < 66rem) {
1162
- // Carbon lg width breakpoint
1163
- .fjs-layout-column .fjs-form-field {
1164
- margin-left: 0;
1165
- margin-right: 0;
1166
- }
1167
- }
1168
-
1169
- .fjs-input-group {
1170
- margin: 0;
1171
- }
1172
- }
1173
- `;
1174
-
1175
- const GlobalFormStyling = createGlobalStyle`
1176
- ${CARBON_STYLES}
1177
- `;
1178
-
1179
- export { CARBON_STYLES, GlobalFormStyling };
1
+ /**
2
+ * DEPRECATED: This file is deprecated and will be removed with one of the next releases.
3
+ */
4
+
5
+ import { css, createGlobalStyle } from 'styled-components';
6
+ import { rem } from '@carbon/elements';
7
+
8
+ function getSelectArrowSvg(color) {
9
+ return `url('data:image/svg+xml;base64,${window.btoa(
10
+ `<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="${color}" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg>`,
11
+ )}')`;
12
+ }
13
+
14
+ function getNumberInputMinusSvg(color) {
15
+ return `url('data:image/svg+xml;base64,${window.btoa(
16
+ `<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="${color}" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true"><path d="M8 15H24V17H8z" /></svg>`,
17
+ )}')`;
18
+ }
19
+
20
+ function getNumberInputPlusSvg(color) {
21
+ return `url('data:image/svg+xml;base64,${window.btoa(
22
+ `<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="${color}" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true"><path d="M17 15L17 8 15 8 15 15 8 15 8 17 15 17 15 24 17 24 17 17 24 17 24 15z" /></svg>`,
23
+ )}')`;
24
+ }
25
+
26
+ const getBaseInputStyles = ({ height }) => css`
27
+ color: var(--cds-text-primary);
28
+ border-radius: 0;
29
+ border: none;
30
+ border-bottom: 1px solid var(--cds-border-strong);
31
+ height: ${height};
32
+ font-size: var(--cds-body-short-01-font-size);
33
+ font-weight: var(--cds-body-short-01-font-weight);
34
+ line-height: var(--cds-body-short-01-line-height);
35
+ letter-spacing: var(--cds-body-short-01-letter-spacing);
36
+
37
+ &:focus {
38
+ outline: 2px solid var(--cds-focus);
39
+ outline-offset: -2px;
40
+ }
41
+
42
+ &::placeholder {
43
+ color: var(--cds-text-placeholder);
44
+ }
45
+ `;
46
+
47
+ const getSelectArrowStyles = ({ arrowRightPosition, color }) => css`
48
+ color: var(--cds-text-primary);
49
+ background-color: var(--cds-field);
50
+ cursor: pointer;
51
+ appearance: none;
52
+ background-image: ${getSelectArrowSvg(color)};
53
+ background-repeat: no-repeat;
54
+ background-position: right ${arrowRightPosition} bottom 50%;
55
+ `;
56
+
57
+ const MARKDOWN_STYLES = css`
58
+ .fjs-container .fjs-form-field.fjs-form-field-text .markup {
59
+ & {
60
+ font-size: var(--cds-body-long-01-font-size);
61
+ font-weight: var(--cds-body-long-01-font-weight);
62
+ line-height: var(--cds-body-long-01-line-height);
63
+ letter-spacing: var(--cds-body-long-01-letter-spacing);
64
+ }
65
+
66
+ & h1 {
67
+ font-size: var(--cds-productive-heading-06-font-size);
68
+ font-weight: var(--cds-productive-heading-06-font-weight);
69
+ line-height: var(--cds-productive-heading-06-line-height);
70
+ letter-spacing: var(--cds-productive-heading-06-letter-spacing);
71
+ }
72
+
73
+ & h2 {
74
+ font-size: var(--cds-productive-heading-05-font-size);
75
+ font-weight: var(--cds-productive-heading-05-font-weight);
76
+ line-height: var(--cds-productive-heading-05-line-height);
77
+ letter-spacing: var(--cds-productive-heading-05-letter-spacing);
78
+ }
79
+
80
+ & h3 {
81
+ font-size: var(--cds-productive-heading-04-font-size);
82
+ font-weight: var(--cds-productive-heading-04-font-weight);
83
+ line-height: var(--cds-productive-heading-04-line-height);
84
+ letter-spacing: var(--cds-productive-heading-04-letter-spacing);
85
+ }
86
+ & h4 {
87
+ font-size: var(--cds-productive-heading-03-font-size);
88
+ font-weight: var(--cds-productive-heading-03-font-weight);
89
+ line-height: var(--cds-productive-heading-03-line-height);
90
+ letter-spacing: var(--cds-productive-heading-03-letter-spacing);
91
+ }
92
+ & h5 {
93
+ font-size: var(--cds-productive-heading-02-font-size);
94
+ font-weight: var(--cds-productive-heading-02-font-weight);
95
+ line-height: var(--cds-productive-heading-02-line-height);
96
+ letter-spacing: var(--cds-productive-heading-02-letter-spacing);
97
+ }
98
+ & h6 {
99
+ font-size: var(--cds-productive-heading-01-font-size);
100
+ font-weight: var(--cds-productive-heading-01-font-weight);
101
+ line-height: var(--cds-productive-heading-01-line-height);
102
+ letter-spacing: var(--cds-productive-heading-01-letter-spacing);
103
+ }
104
+
105
+ & code {
106
+ font-family: var(--cds-code-02-font-family);
107
+ font-size: var(--cds-code-02-font-size);
108
+ font-weight: var(--cds-code-02-font-weight);
109
+ line-height: var(--cds-code-02-line-height);
110
+ letter-spacing: var(--cds-code-02-letter-spacing);
111
+ white-space: pre-wrap;
112
+ }
113
+
114
+ & blockquote {
115
+ font-family: var(--cds-quotation-02-font-family);
116
+ font-size: var(--cds-quotation-02-font-size);
117
+ font-weight: var(--cds-quotation-02-font-weight);
118
+ line-height: var(--cds-quotation-02-line-height);
119
+ letter-spacing: var(--cds-quotation-02-letter-spacing);
120
+ }
121
+
122
+ & ul,
123
+ & ol {
124
+ box-sizing: border-box;
125
+ padding: 0;
126
+ border: 0;
127
+ margin: 0;
128
+ list-style: none;
129
+ }
130
+
131
+ & ul {
132
+ margin-left: var(--cds-spacing-05);
133
+ }
134
+
135
+ & ol {
136
+ margin-left: var(--cds-spacing-05);
137
+ }
138
+
139
+ & ul li {
140
+ position: relative;
141
+
142
+ &:before {
143
+ position: absolute;
144
+ left: calc(-1 * var(--cds-spacing-05));
145
+ content: '–';
146
+ }
147
+ }
148
+
149
+ & ol li {
150
+ position: relative;
151
+ counter-increment: item;
152
+
153
+ &:before {
154
+ position: absolute;
155
+ left: calc(-1 * var(--cds-spacing-05));
156
+ content: counter(item) '.';
157
+ }
158
+ }
159
+ }
160
+ `;
161
+
162
+ const ANCHOR_STYLES = css`
163
+ .fjs-container .fjs-form-field-text a {
164
+ color: var(--cds-link-primary);
165
+ outline: none;
166
+ text-decoration: underline;
167
+ font-size: inherit;
168
+ font-weight: inherit;
169
+ line-height: var(--cds-body-compact-01-line-height);
170
+ letter-spacing: var(--cds-body-compact-01-letter-spacing);
171
+
172
+ &:hover {
173
+ color: var(--cds-link-primary-hover);
174
+ }
175
+
176
+ &:focus {
177
+ outline: 1px solid var(--cds-focus);
178
+ }
179
+
180
+ &:active,
181
+ &:active:visited,
182
+ &:active:visited:hover {
183
+ color: var(--cds-text-primary);
184
+ }
185
+
186
+ &:visited {
187
+ color: var(--cds-link-primary);
188
+ }
189
+
190
+ &:visited:hover {
191
+ color: var(--cds-link-primary-hover);
192
+ }
193
+ }
194
+ `;
195
+
196
+ const READONLY_STYLES = css`
197
+ ${({ theme }) => css`
198
+ .fjs-container {
199
+ .fjs-readonly {
200
+ .fjs-input:read-only:not(:disabled),
201
+ .fjs-textarea:read-only:not(:disabled),
202
+ .fjs-select:read-only:not(:disabled),
203
+ &.fjs-taglist,
204
+ .fjs-input-group {
205
+ background-color: transparent;
206
+ }
207
+
208
+ &.fjs-form-field {
209
+ .fjs-input-group {
210
+ border-bottom: 1px solid var(--cds-border-subtle);
211
+ }
212
+ }
213
+
214
+ &.fjs-form-field-number {
215
+ .fjs-input-group .fjs-number-arrow-container {
216
+ background-color: transparent;
217
+
218
+ .fjs-number-arrow-up,
219
+ .fjs-number-arrow-down {
220
+ background-color: transparent;
221
+ pointer-events: none;
222
+ }
223
+ }
224
+ }
225
+
226
+ &.fjs-form-field:not(.fjs-form-field-datetime) {
227
+ .fjs-input-group .fjs-input-adornment {
228
+ background: transparent;
229
+ }
230
+ }
231
+
232
+ &.fjs-form-field-select {
233
+ .fjs-input-group {
234
+ cursor: unset;
235
+ background-image: ${getSelectArrowSvg(theme.iconDisabled)};
236
+ background-color: transparent;
237
+
238
+ .fjs-input:read-only:not(:disabled) {
239
+ border-color: transparent;
240
+ }
241
+
242
+ .fjs-select-display {
243
+ color: var(--cds-text-primary);
244
+ }
245
+ }
246
+ }
247
+
248
+ &.fjs-form-field-datetime {
249
+ .fjs-input-group {
250
+ cursor: unset;
251
+
252
+ .fjs-input-adornment {
253
+ background-color: transparent;
254
+ }
255
+
256
+ .flatpickr-input {
257
+ cursor: unset;
258
+ }
259
+
260
+ .fjs-input-adornment svg {
261
+ cursor: unset;
262
+ }
263
+ }
264
+ }
265
+
266
+ &.fjs-form-field-checkbox,
267
+ &.fjs-form-field-radio,
268
+ &.fjs-form-field-checklist {
269
+ .fjs-input:read-only {
270
+ opacity: 1;
271
+ background-color: transparent;
272
+
273
+ &:before {
274
+ border-color: var(--cds-icon-disabled);
275
+ }
276
+ }
277
+
278
+ &.fjs-checked .fjs-input[type='checkbox'],
279
+ .fjs-form-field-label.fjs-checked .fjs-input[type='checkbox'] {
280
+ &:before {
281
+ border: 1px solid var(--cds-icon-disabled);
282
+ background: transparent;
283
+ }
284
+
285
+ &:after {
286
+ border-bottom: 2px solid var(--cds-icon-primary);
287
+ border-left: 2px solid var(--cds-icon-primary);
288
+ }
289
+ }
290
+ }
291
+
292
+ &.fjs-taglist .fjs-taglist-tag {
293
+ .fjs-taglist-tag-label {
294
+ padding: 2px 0px;
295
+ }
296
+ }
297
+ }
298
+ }
299
+ `}
300
+ `;
301
+
302
+ const DISABLED_STYLES = css`
303
+ .fjs-container {
304
+ .fjs-disabled {
305
+ &.fjs-form-field-textfield .fjs-input,
306
+ &.fjs-form-field-datetime .fjs-input,
307
+ & .fjs-textarea:disabled,
308
+ & .fjs-taglist.fjs-disabled,
309
+ & .fjs-taglist.fjs-disabled .fjs-taglist-input,
310
+ &.fjs-form-field-select .fjs-input-group.disabled,
311
+ &.fjs-form-field-select .fjs-input-group.disabled .fjs-select-display,
312
+ &.fjs-form-field-select .fjs-input-group.disabled .fjs-input,
313
+ &.fjs-form-field .fjs-form-field-label,
314
+ &.fjs-form-field.fjs-form-field-radio .fjs-form-field-label,
315
+ &.fjs-form-field.fjs-form-field-checklist .fjs-form-field-label,
316
+ & .fjs-form-field-description {
317
+ /* todo(pinussilvestrus): mitigate https://github.com/carbon-design-system/carbon/issues/13286 */
318
+ color: var(--cds-text-disabled);
319
+ cursor: var(--cursor-disabled, not-allowed);
320
+ }
321
+
322
+ &.fjs-form-field-textfield .fjs-input-group,
323
+ &.fjs-form-field-datetime .fjs-input-group,
324
+ & .fjs-textarea:disabled,
325
+ & .fjs-taglist.fjs-disabled,
326
+ & .fjs-taglist.fjs-disabled .fjs-taglist-input,
327
+ &.fjs-form-field-select .fjs-input-group.disabled,
328
+ &.fjs-form-field-select .fjs-input-group.disabled .fjs-select-display,
329
+ &.fjs-form-field-select .fjs-input-group.disabled .fjs-input {
330
+ border: none;
331
+ }
332
+ }
333
+
334
+ .fjs-disabled.fjs-form-field-number .fjs-input-group {
335
+ border: none;
336
+ cursor: var(--cursor-disabled, not-allowed);
337
+ }
338
+
339
+ .fjs-disabled.fjs-form-field-number .fjs-input-group .fjs-input {
340
+ cursor: var(--cursor-disabled, not-allowed);
341
+ }
342
+
343
+ .fjs-form-field.fjs-disabled.fjs-checked .fjs-input[type='checkbox'] {
344
+ cursor: var(--cursor-disabled, not-allowed);
345
+ &:before {
346
+ border-color: var(--cds-icon-disabled);
347
+ background-color: var(--cds-icon-disabled);
348
+ cursor: var(--cursor-disabled, not-allowed);
349
+ }
350
+
351
+ &:after {
352
+ cursor: var(--cursor-disabled, not-allowed);
353
+ }
354
+ }
355
+
356
+ .fjs-form-field.fjs-disabled .fjs-input[type='checkbox'] {
357
+ cursor: var(--cursor-disabled, not-allowed);
358
+ &:before {
359
+ border-color: var(--cds-icon-disabled);
360
+ cursor: var(--cursor-disabled, not-allowed);
361
+ }
362
+ }
363
+
364
+ .fjs-form-field-datetime.fjs-disabled
365
+ .fjs-input-group
366
+ .fjs-input-adornment
367
+ svg {
368
+ color: var(--cds-icon-disabled);
369
+ cursor: var(--cursor-disabled, not-allowed);
370
+ }
371
+
372
+ .fjs-taglist.fjs-disabled .fjs-taglist-tag {
373
+ background-color: var(--cds-layer-01);
374
+
375
+ .fjs-taglist-tag-label {
376
+ padding: 2px 0px;
377
+ opacity: 0.7;
378
+ color: var(--cds-text-on-color-disabled);
379
+ }
380
+ }
381
+ }
382
+ `;
383
+
384
+ const LABEL_DESCRIPTION_ERROR_STYLES = css`
385
+ .fjs-container {
386
+ .fjs-form-field-label {
387
+ font-size: var(--cds-label-01-font-size);
388
+ font-weight: var(--cds-label-01-font-weight);
389
+ line-height: var(--cds-label-01-line-height);
390
+ letter-spacing: var(--cds-label-01-letter-spacing);
391
+ }
392
+
393
+ .fjs-form-field:not(.fjs-form-field-checkbox, .fjs-form-field-grouplike)
394
+ .fjs-form-field-label:first-child {
395
+ margin: 0;
396
+ margin-bottom: var(--cds-spacing-03);
397
+ }
398
+
399
+ .fjs-form-field.fjs-form-field-radio
400
+ .fjs-form-field-label:not(:first-of-type),
401
+ .fjs-form-field.fjs-form-field-checklist
402
+ .fjs-form-field-label:not(:first-of-type) {
403
+ margin: 0;
404
+ margin-bottom: 0.1875rem;
405
+ }
406
+
407
+ .fjs-form-field.fjs-form-field-radio
408
+ .fjs-form-field-label:not(:first-of-type) {
409
+ min-height: ${rem(27)};
410
+ }
411
+
412
+ .fjs-form-field-description {
413
+ margin: 0;
414
+ margin-top: var(--cds-spacing-02);
415
+ font-size: var(--cds-helper-text-01-font-size);
416
+ font-weight: var(--cds-helper-text-01-font-weight);
417
+ line-height: var(--cds-helper-text-01-line-height);
418
+ letter-spacing: var(--cds-helper-text-01-letter-spacing);
419
+ }
420
+
421
+ .fjs-form-field-error {
422
+ margin: 0;
423
+ margin-top: var(--cds-spacing-02);
424
+ font-size: var(--cds-label-01-font-size);
425
+ font-weight: var(--cds-label-01-font-weight);
426
+ line-height: var(--cds-label-01-line-height);
427
+ letter-spacing: var(--cds-label-01-letter-spacing);
428
+ }
429
+
430
+ .fjs-has-errors .fjs-form-field-description {
431
+ display: none;
432
+ }
433
+ }
434
+ `;
435
+
436
+ const CHECKBOX_STYLES = css`
437
+ .fjs-container {
438
+ .fjs-input[type='checkbox'],
439
+ .fjs-input[type='checkbox']:focus {
440
+ all: unset;
441
+ width: ${rem(6)};
442
+ }
443
+
444
+ .fjs-form-field .fjs-input[type='checkbox'] {
445
+ position: relative;
446
+ display: flex;
447
+ min-height: ${rem(24)};
448
+ padding-top: ${rem(3)};
449
+ padding-left: ${rem(20)};
450
+ cursor: pointer;
451
+ user-select: none;
452
+ font-size: var(--cds-body-short-01-font-size);
453
+ font-weight: var(--cds-body-short-01-font-weight);
454
+ line-height: var(--cds-body-short-01-line-height);
455
+ letter-spacing: var(--cds-body-short-01-letter-spacing);
456
+
457
+ &:before,
458
+ &:after {
459
+ box-sizing: border-box;
460
+ }
461
+
462
+ &:before {
463
+ position: absolute;
464
+ top: ${rem(3)};
465
+ left: 0;
466
+ width: ${rem(16)};
467
+ height: ${rem(16)};
468
+ border: 1px solid var(--cds-icon-primary);
469
+ margin: ${rem(2)} ${rem(2)} ${rem(2)} ${rem(3)};
470
+ background-color: transparent;
471
+ border-radius: 1px;
472
+ content: '';
473
+ }
474
+
475
+ &:after {
476
+ position: absolute;
477
+ top: ${rem(9)};
478
+ left: ${rem(7)};
479
+ width: ${rem(9)};
480
+ height: ${rem(5)};
481
+ border-bottom: 2px solid var(--cds-icon-inverse);
482
+ border-left: 2px solid var(--cds-icon-inverse);
483
+ margin-top: ${rem(-3)};
484
+ background: 0 0;
485
+ content: '';
486
+ transform: scale(0) rotate(-45deg);
487
+ transform-origin: bottom right;
488
+ }
489
+ }
490
+
491
+ .fjs-form-field .fjs-input[type='checkbox']:focus {
492
+ &:before {
493
+ outline: 2px solid var(--cds-focus);
494
+ outline-offset: 1px;
495
+ }
496
+ }
497
+
498
+ .fjs-form-field.fjs-checked .fjs-input[type='checkbox'],
499
+ .fjs-form-field
500
+ .fjs-form-field-label.fjs-checked
501
+ .fjs-input[type='checkbox'] {
502
+ &:before {
503
+ border: none;
504
+ border-width: 1px;
505
+ background-color: var(--cds-icon-primary);
506
+ }
507
+
508
+ &:after {
509
+ transform: scale(1) rotate(-45deg);
510
+ }
511
+ }
512
+
513
+ .fjs-form-field-checklist .fjs-form-field-label:not(:first-of-type) {
514
+ font-size: var(--cds-body-short-01-font-size);
515
+ font-weight: var(--cds-body-short-01-font-weight);
516
+ line-height: var(--cds-body-short-01-line-height);
517
+ letter-spacing: var(--cds-body-short-01-letter-spacing);
518
+ color: var(--cds-text-primary);
519
+ }
520
+
521
+ .fjs-form-field-checkbox .fjs-form-field-label {
522
+ font-size: var(--cds-body-short-01-font-size);
523
+ font-weight: var(--cds-body-short-01-font-weight);
524
+ line-height: var(--cds-body-short-01-line-height);
525
+ letter-spacing: var(--cds-body-short-01-letter-spacing);
526
+ color: var(--cds-text-primary);
527
+ }
528
+ }
529
+ `;
530
+
531
+ const TAGLIST_STYLES = css`
532
+ .fjs-container {
533
+ .fjs-taglist {
534
+ display: flex;
535
+ align-items: center;
536
+ min-height: 2.5rem;
537
+ height: unset !important;
538
+ }
539
+
540
+ .fjs-taglist:focus-within {
541
+ outline: 2px solid var(--cds-focus);
542
+ outline-offset: -2px;
543
+ }
544
+
545
+ .fjs-taglist .fjs-taglist-input {
546
+ &,
547
+ &::placeholder {
548
+ color: var(--cds-text-primary);
549
+ }
550
+ }
551
+
552
+ .fjs-taglist .fjs-taglist-tag {
553
+ font-size: var(--cds-label-01-font-size);
554
+ font-weight: var(--cds-label-01-font-weight);
555
+ line-height: var(--cds-label-01-line-height);
556
+ letter-spacing: var(--cds-label-01-letter-spacing);
557
+ max-width: 100%;
558
+ padding: 0 0.5rem;
559
+ border-radius: 0.9375rem;
560
+ word-break: break-word;
561
+ min-width: auto;
562
+ display: inline-flex;
563
+ align-items: center;
564
+ justify-content: center;
565
+
566
+ & .fjs-taglist-tag-label {
567
+ padding: 0;
568
+ max-width: 100%;
569
+ text-overflow: ellipsis;
570
+ white-space: nowrap;
571
+ }
572
+
573
+ & .fjs-taglist-tag-remove {
574
+ all: unset;
575
+ width: 1.5rem;
576
+ height: 1.5rem;
577
+ border-radius: 50%;
578
+ display: flex;
579
+ flex-shrink: 0;
580
+ align-items: center;
581
+ justify-content: center;
582
+ padding: 0;
583
+ border: 0;
584
+ margin: 0 ${rem(-8)} 0 0.125rem;
585
+ cursor: pointer;
586
+ }
587
+
588
+ & .fjs-taglist-tag-remove svg {
589
+ all: unset;
590
+ color: var(--cds-icon-inverse);
591
+ }
592
+
593
+ & .fjs-taglist-tag-remove:focus {
594
+ background-color: transparent;
595
+ outline: 1px solid var(--cds-focus-inverse);
596
+ }
597
+ }
598
+ }
599
+ `;
600
+
601
+ const RADIO_STYLES = css`
602
+ .fjs-container .fjs-form-field-radio {
603
+ .fjs-input {
604
+ appearance: none;
605
+ width: 0;
606
+ margin: 0;
607
+ margin-right: calc(${rem(18)} + var(--cds-spacing-03));
608
+ position: relative;
609
+ height: ${rem(18)};
610
+ outline: none;
611
+
612
+ &:focus:before {
613
+ outline: 2px solid var(--cds-focus);
614
+ outline-offset: 1.5px;
615
+ }
616
+
617
+ &:before {
618
+ position: absolute;
619
+ top: 0;
620
+ left: 0;
621
+ width: ${rem(18)};
622
+ height: ${rem(18)};
623
+ border: 1px solid var(--cds-icon-primary);
624
+ background-color: transparent;
625
+ border-radius: 50%;
626
+ content: '';
627
+ }
628
+ }
629
+
630
+ .fjs-checked .fjs-input:after {
631
+ position: relative;
632
+ top: 0;
633
+ left: 0;
634
+ display: inline-block;
635
+ width: ${rem(18)};
636
+ height: ${rem(18)};
637
+ background-color: var(--cds-icon-primary);
638
+ border-radius: 50%;
639
+ content: '';
640
+ transform: scale(0.5);
641
+ }
642
+
643
+ &.fjs-disabled .fjs-input:before {
644
+ border-color: var(--cds-icon-disabled);
645
+ }
646
+
647
+ &.fjs-disabled .fjs-checked .fjs-input:after {
648
+ background-color: var(--cds-icon-disabled);
649
+ }
650
+
651
+ .fjs-form-field-label:not(:first-of-type) {
652
+ font-size: var(--cds-body-short-01-font-size);
653
+ font-weight: var(--cds-body-short-01-font-weight);
654
+ line-height: var(--cds-body-short-01-line-height);
655
+ letter-spacing: var(--cds-body-short-01-letter-spacing);
656
+ color: var(--cds-text-primary);
657
+ }
658
+ }
659
+ `;
660
+
661
+ const BUTTON_STYLES = css`
662
+ .fjs-container {
663
+ .fjs-form-field.fjs-form-field-button .fjs-button {
664
+ font-size: var(--cds-body-short-01-font-size);
665
+ font-weight: var(--cds-body-short-01-font-weight);
666
+ line-height: var(--cds-body-short-01-line-height);
667
+ letter-spacing: var(--cds-body-short-01-letter-spacing);
668
+ min-height: ${rem(32)};
669
+ padding: calc(0.375rem - 3px) 60px calc(0.375rem - 3px) 12px;
670
+ text-align: left;
671
+ color: var(--cds-button-tertiary);
672
+ border: 1px solid var(--cds-button-tertiary);
673
+ border-radius: 0;
674
+ background-color: transparent;
675
+ cursor: pointer;
676
+ }
677
+
678
+ .fjs-form-field.fjs-form-field-button .fjs-button:hover {
679
+ color: var(--cds-text-inverse);
680
+ background-color: var(--cds-button-tertiary-hover);
681
+ }
682
+
683
+ .fjs-form-field.fjs-form-field-button .fjs-button:focus {
684
+ border-color: var(--cds-focus);
685
+ box-shadow: inset 0 0 0 1px var(--cds-focus),
686
+ inset 0 0 0 2px var(--cds-background);
687
+ color: var(--cds-text-inverse);
688
+ background-color: var(--cds-button-tertiary);
689
+ }
690
+
691
+ .fjs-form-field.fjs-form-field-button .fjs-button:active {
692
+ border-color: transparent;
693
+ background-color: var(--cds-button-tertiary-active);
694
+ color: var(--cds-text-inverse);
695
+ }
696
+
697
+ .fjs-form-field.fjs-form-field-button .fjs-button:disabled {
698
+ border: 1px solid var(--cds-button-disabled);
699
+ background: transparent;
700
+ box-shadow: none;
701
+ color: var(--cds-text-on-color-disabled);
702
+ cursor: var(--cursor-disabled, not-allowed);
703
+ outline: none;
704
+ }
705
+
706
+ .fjs-form-field.fjs-form-field-button .fjs-button[type='submit'] {
707
+ background-color: var(--cds-button-primary);
708
+ border: 1px solid transparent;
709
+ color: var(--cds-text-on-color);
710
+ }
711
+
712
+ .fjs-form-field.fjs-form-field-button .fjs-button[type='submit']:disabled {
713
+ background: var(--cds-button-disabled);
714
+ }
715
+ }
716
+ `;
717
+
718
+ const NUMBER_INPUTS = css`
719
+ ${({ theme }) => css`
720
+ .fjs-container .fjs-form-field-number .fjs-input-group {
721
+ border-radius: 0;
722
+ border: none;
723
+ border-bottom: 1px solid var(--cds-border-strong);
724
+ height: 2.5rem;
725
+ box-sizing: border-box;
726
+
727
+ &:focus-within {
728
+ outline: 2px solid var(--cds-focus);
729
+ outline-offset: -2px;
730
+ }
731
+
732
+ & .fjs-input {
733
+ border-radius: 0;
734
+ border: none;
735
+ font-size: var(--cds-body-short-01-font-size);
736
+ font-weight: var(--cds-body-short-01-font-weight);
737
+ line-height: var(--cds-body-short-01-line-height);
738
+ letter-spacing: var(--cds-body-short-01-letter-spacing);
739
+ }
740
+
741
+ & .fjs-number-arrow-container {
742
+ all: unset;
743
+ border: none;
744
+ border-radius: 0;
745
+ display: flex;
746
+ flex-direction: row-reverse;
747
+ align-items: center;
748
+ background-color: var(--cds-field);
749
+ }
750
+
751
+ & .fjs-number-arrow-container .fjs-number-arrow-up,
752
+ & .fjs-number-arrow-container .fjs-number-arrow-down {
753
+ width: 40px;
754
+ height: calc(40px - 1px);
755
+ background-color: var(--cds-field);
756
+ color: transparent;
757
+
758
+ &:hover {
759
+ background-color: var(--cds-field-hover);
760
+ cursor: pointer;
761
+ }
762
+ }
763
+
764
+ &.fjs-disabled .fjs-number-arrow-container .fjs-number-arrow-up:hover,
765
+ &.fjs-disabled .fjs-number-arrow-container .fjs-number-arrow-down:hover {
766
+ background-color: var(--cds-field);
767
+ cursor: not-allowed;
768
+ }
769
+
770
+ & .fjs-number-arrow-container .fjs-number-arrow-separator {
771
+ width: 0.0625rem;
772
+ height: 1rem;
773
+ background-color: var(--cds-border-subtle);
774
+ }
775
+
776
+ & .fjs-number-arrow-container .fjs-number-arrow-down {
777
+ background-image: ${getNumberInputMinusSvg(theme.iconPrimary)};
778
+ background-repeat: no-repeat;
779
+ background-position: right 50% bottom 50%;
780
+ }
781
+
782
+ & .fjs-number-arrow-container .fjs-number-arrow-up {
783
+ background-image: ${getNumberInputPlusSvg(theme.iconPrimary)};
784
+ background-repeat: no-repeat;
785
+ background-position: right 50% bottom 50%;
786
+ }
787
+
788
+ &.fjs-disabled .fjs-number-arrow-container .fjs-number-arrow-up {
789
+ background-image: ${getNumberInputPlusSvg(theme.iconDisabled)};
790
+ }
791
+
792
+ &.fjs-disabled .fjs-number-arrow-container .fjs-number-arrow-down {
793
+ background-image: ${getNumberInputMinusSvg(theme.iconDisabled)};
794
+ }
795
+ }
796
+ `}
797
+ `;
798
+
799
+ const DATETIME_INPUTS = css`
800
+ ${({ theme }) => css`
801
+ .fjs-container {
802
+ .fjs-form-field-datetime {
803
+ .fjs-input.flatpickr-input {
804
+ width: 100%;
805
+ height: 100%;
806
+ border: none;
807
+ border-radius: 0;
808
+
809
+ &,
810
+ &::placeholder {
811
+ color: var(--cds-text-primary);
812
+ }
813
+ }
814
+
815
+ .fjs-input.flatpickr-input:disabled {
816
+ color: var(--cds-text-disabled);
817
+ }
818
+
819
+ .fjs-input.flatpickr-input:disabled::placeholder {
820
+ color: var(--cds-text-disabled);
821
+ }
822
+
823
+ .fjs-input.flatpickr-input:disabled::placeholder {
824
+ color: var(--cds-text-disabled);
825
+ }
826
+
827
+ select {
828
+ ${getBaseInputStyles({ height: '1.5rem' })};
829
+ ${getSelectArrowStyles({
830
+ arrowRightPosition: 'var(--cds-spacing-03)',
831
+ color: theme.iconPrimary,
832
+ })};
833
+ border-bottom: none;
834
+ padding-right: 2rem;
835
+ }
836
+
837
+ .fjs-input-group {
838
+ display: flex;
839
+ flex-direction: row-reverse;
840
+ position: relative;
841
+ }
842
+
843
+ .fjs-input-group .fjs-input-adornment {
844
+ border: none;
845
+ border-radius: 0;
846
+ background-color: var(--cds-field);
847
+ display: flex;
848
+ padding-right: var(--cds-spacing-05);
849
+ }
850
+
851
+ .fjs-input-group .fjs-input-adornment svg {
852
+ color: var(--cds-icon-primary);
853
+ cursor: pointer;
854
+ }
855
+
856
+ .flatpickr-wrapper {
857
+ height: 100%;
858
+ position: initial;
859
+ }
860
+
861
+ .fjs-timepicker.fjs-timepicker-anchor {
862
+ position: unset;
863
+ }
864
+
865
+ .flatpickr-calendar.static {
866
+ top: calc(100% + 3px);
867
+ }
868
+
869
+ .flatpickr-calendar .flatpickr-prev-month svg,
870
+ .flatpickr-calendar .flatpickr-next-month svg {
871
+ height: 16px;
872
+ }
873
+
874
+ .flatpickr-day.today {
875
+ position: relative;
876
+ color: var(--cds-link-primary);
877
+ font-weight: 600;
878
+ border-color: transparent;
879
+ }
880
+
881
+ .flatpickr-day.selected,
882
+ .flatpickr-day.today.selected,
883
+ .flatpickr-day.selected:hover,
884
+ .flatpickr-day.today.selected:hover {
885
+ background-color: var(--cds-button-primary);
886
+ color: var(--cds-text-on-color);
887
+ }
888
+
889
+ .flatpickr-day:focus {
890
+ outline: 2px solid var(--cds-focus);
891
+ outline-offset: -2px;
892
+ }
893
+
894
+ .flatpickr-day.selected:focus {
895
+ outline: 0.0625rem solid var(--cds-focus);
896
+ outline-offset: -0.1875rem;
897
+ }
898
+
899
+ .flatpickr-day:hover {
900
+ background: var(--cds-layer-hover);
901
+ }
902
+
903
+ .flatpickr-days,
904
+ .flatpickr-weekdays {
905
+ padding: unset;
906
+ width: unset;
907
+ }
908
+ }
909
+ }
910
+ `}
911
+ `;
912
+
913
+ const SELECT_STYLES = css`
914
+ ${({ theme }) => css`
915
+ .fjs-container {
916
+ .fjs-form-field-select .fjs-input-group {
917
+ ${getBaseInputStyles({ height: '2.5rem' })}
918
+ ${getSelectArrowStyles({
919
+ arrowRightPosition: 'var(--cds-spacing-05)',
920
+ color: theme.iconPrimary,
921
+ })}
922
+
923
+ .fjs-select-display {
924
+ display: flex;
925
+ align-items: center;
926
+ }
927
+
928
+ .fjs-select-arrow {
929
+ color: transparent;
930
+ }
931
+
932
+ .fjs-select-cross {
933
+ display: flex;
934
+ align-items: center;
935
+ justify-content: center;
936
+ margin-right: var(--cds-spacing-04);
937
+ width: 2.5rem;
938
+ height: calc(2.5rem - 1px);
939
+
940
+ &:hover {
941
+ background-color: var(--cds-layer-hover);
942
+ }
943
+
944
+ svg {
945
+ color: var(--cds-icon-primary);
946
+ }
947
+ }
948
+
949
+ .fjs-input {
950
+ color: var(--cds-text-primary);
951
+ background-color: var(--cds-field);
952
+ border-radius: 0;
953
+ border: none;
954
+ border-bottom: 1px solid var(--cds-border-strong);
955
+ height: 2.5rem;
956
+ font-size: var(--cds-body-short-01-font-size);
957
+ font-weight: var(--cds-body-short-01-font-weight);
958
+ line-height: var(--cds-body-short-01-line-height);
959
+ letter-spacing: var(--cds-body-short-01-letter-spacing);
960
+ }
961
+ }
962
+
963
+ .fjs-form-field-select .fjs-select-anchor .fjs-dropdownlist {
964
+ position: absolute;
965
+ top: -4px;
966
+ }
967
+
968
+ .fjs-form-field-select .fjs-input-group:focus-within {
969
+ outline: 2px solid var(--cds-focus);
970
+ outline-offset: -2px;
971
+ }
972
+
973
+ .fjs-form-field-select.fjs-disabled .fjs-input-group {
974
+ ${getSelectArrowStyles({
975
+ arrowRightPosition: 'var(--cds-spacing-05)',
976
+ color: theme.iconDisabled,
977
+ })}
978
+ }
979
+
980
+ .fjs-has-errors.fjs-form-field-select .fjs-input-group:focus-within {
981
+ outline: 2px solid var(--cds-focus);
982
+ outline-offset: -2px;
983
+ }
984
+
985
+ .fjs-has-errors.fjs-form-field-select .fjs-input-group {
986
+ outline: 2px solid var(--cds-text-error);
987
+ outline-offset: -2px;
988
+ }
989
+ }
990
+ `}
991
+ `;
992
+
993
+ const REMAINING_INPUTS = css`
994
+ .fjs-container {
995
+ .fjs-form-field-textfield .fjs-input-group,
996
+ .fjs-form-field-datetime .fjs-input-group,
997
+ .fjs-textarea,
998
+ .fjs-taglist,
999
+ .fjs-form-field-select.fjs-disabled .fjs-input-group {
1000
+ ${getBaseInputStyles({ height: '2.5rem' })}
1001
+ }
1002
+
1003
+ .fjs-form-field-textfield .fjs-input-group,
1004
+ .fjs-form-field-datetime .fjs-input-group {
1005
+ &:focus-within {
1006
+ outline: 2px solid var(--cds-focus);
1007
+ outline-offset: -2px;
1008
+ }
1009
+ }
1010
+ .fjs-form-field-textfield .fjs-input,
1011
+ .fjs-form-field-datetime .fjs-input {
1012
+ background-color: var(--cds-field);
1013
+ color: var(--cds-text-primary);
1014
+ border-radius: 0;
1015
+ }
1016
+
1017
+ .fjs-has-errors.fjs-form-field-number .fjs-input-group:focus-within,
1018
+ .fjs-has-errors.fjs-form-field-textarea .fjs-textarea:focus,
1019
+ .fjs-form-field-textfield.fjs-has-errors .fjs-input-group:focus-within,
1020
+ .fjs-form-field-textfield.fjs-has-errors .fjs-input-group:focus,
1021
+ .fjs-form-field-datetime.fjs-has-errors .fjs-input-group:focus-within,
1022
+ .fjs-form-field-datetime.fjs-has-errors .fjs-input-group:focus {
1023
+ outline: 2px solid var(--cds-focus);
1024
+ outline-offset: -2px;
1025
+ }
1026
+
1027
+ .fjs-has-errors.fjs-form-field-number .fjs-input-group,
1028
+ .fjs-has-errors.fjs-form-field-textarea .fjs-textarea,
1029
+ .fjs-form-field-textfield.fjs-has-errors .fjs-input-group,
1030
+ .fjs-form-field-textfield.fjs-has-errors .fjs-input-group,
1031
+ .fjs-form-field-datetime.fjs-has-errors .fjs-input-group,
1032
+ .fjs-form-field-datetime.fjs-has-errors .fjs-input-group {
1033
+ outline: 2px solid var(--cds-text-error);
1034
+ outline-offset: -2px;
1035
+ }
1036
+ }
1037
+ `;
1038
+
1039
+ const DROPDOWN_STYLES = css`
1040
+ .fjs-container {
1041
+ .fjs-form-field-taglist .fjs-taglist-anchor .fjs-dropdownlist,
1042
+ .fjs-form-field-datetime .fjs-timepicker-anchor .fjs-dropdownlist,
1043
+ .fjs-form-field-select .fjs-select-anchor .fjs-dropdownlist {
1044
+ margin: 0;
1045
+ max-height: ${rem(264)};
1046
+ border: none;
1047
+ background-color: var(--cds-layer);
1048
+ overflow-y: auto;
1049
+ cursor: pointer;
1050
+ border-radius: 0;
1051
+ box-shadow: 0 2px 6px var(--cds-shadow);
1052
+
1053
+ & .fjs-dropdownlist-item {
1054
+ border: none;
1055
+ box-sizing: border-box;
1056
+ padding: 0;
1057
+ margin: 0 var(--cds-spacing-05);
1058
+ }
1059
+
1060
+ & .fjs-dropdownlist-item:not(:first-of-type):not(:hover) {
1061
+ border-top: 1px solid var(--cds-border-subtle);
1062
+ }
1063
+
1064
+ & .fjs-dropdownlist-item,
1065
+ & .fjs-dropdownlist-empty {
1066
+ font-size: var(--cds-body-short-01-font-size);
1067
+ font-weight: var(--cds-body-short-01-font-weight);
1068
+ line-height: var(--cds-body-short-01-line-height);
1069
+ letter-spacing: var(--cds-body-short-01-letter-spacing);
1070
+ height: ${rem(40)};
1071
+ color: var(--cds-text-secondary);
1072
+ cursor: pointer;
1073
+ user-select: none;
1074
+ display: flex;
1075
+ align-items: center;
1076
+ background-color: transparent;
1077
+ }
1078
+
1079
+ & .fjs-dropdownlist-empty {
1080
+ color: var(--cds-text-disabled);
1081
+ cursor: default;
1082
+ }
1083
+
1084
+ & .fjs-dropdownlist-item:hover,
1085
+ & .fjs-dropdownlist-item.focused {
1086
+ background-color: var(--cds-layer-hover);
1087
+ color: var(--cds-text-primary);
1088
+ margin: 0;
1089
+ padding: 0 var(--cds-spacing-05);
1090
+ }
1091
+
1092
+ & .fjs-dropdownlist-item:not(:first-of-type):hover {
1093
+ padding-top: 1px;
1094
+ }
1095
+
1096
+ & .fjs-dropdownlist-item.focused + .fjs-dropdownlist-item {
1097
+ border: none;
1098
+ padding-top: 1px;
1099
+ }
1100
+ }
1101
+ }
1102
+ `;
1103
+
1104
+ const ADORNMENTS_STYLES = css`
1105
+ .fjs-container .fjs-form-field:not(.fjs-form-field-datetime) {
1106
+ .fjs-input-group .fjs-input-adornment {
1107
+ all: unset;
1108
+ display: flex;
1109
+ align-items: center;
1110
+ background-color: var(--cds-field);
1111
+ color: var(--cds-text-secondary);
1112
+ padding: 0 var(--cds-spacing-04);
1113
+ cursor: default;
1114
+
1115
+ &.border-right {
1116
+ padding-right: 0;
1117
+ }
1118
+
1119
+ &.border-left {
1120
+ padding-left: 0;
1121
+ }
1122
+ }
1123
+
1124
+ &.fjs-disabled .fjs-input-group .fjs-input-adornment {
1125
+ color: var(--cds-text-disabled);
1126
+ }
1127
+ }
1128
+ `;
1129
+
1130
+ const CARBON_STYLES = css`
1131
+ ${MARKDOWN_STYLES}
1132
+ ${ANCHOR_STYLES}
1133
+ ${READONLY_STYLES}
1134
+ ${DISABLED_STYLES}
1135
+ ${LABEL_DESCRIPTION_ERROR_STYLES}
1136
+ ${CHECKBOX_STYLES}
1137
+ ${TAGLIST_STYLES}
1138
+ ${RADIO_STYLES}
1139
+ ${BUTTON_STYLES}
1140
+ ${NUMBER_INPUTS}
1141
+ ${DATETIME_INPUTS}
1142
+ ${REMAINING_INPUTS}
1143
+ ${ADORNMENTS_STYLES}
1144
+ ${DROPDOWN_STYLES}
1145
+ ${SELECT_STYLES}
1146
+
1147
+ .fjs-container {
1148
+ width: 100%;
1149
+ height: min-content;
1150
+
1151
+ .cds--grid {
1152
+ padding: 0;
1153
+ }
1154
+
1155
+ .fjs-form {
1156
+ background-color: transparent;
1157
+ color: var(--cds-text-primary);
1158
+ padding: 0;
1159
+ }
1160
+
1161
+ @media (width < 66rem) {
1162
+ // Carbon lg width breakpoint
1163
+ .fjs-layout-column .fjs-form-field {
1164
+ margin-left: 0;
1165
+ margin-right: 0;
1166
+ }
1167
+ }
1168
+
1169
+ .fjs-input-group {
1170
+ margin: 0;
1171
+ }
1172
+ }
1173
+ `;
1174
+
1175
+ const GlobalFormStyling = createGlobalStyle`
1176
+ ${CARBON_STYLES}
1177
+ `;
1178
+
1179
+ export { CARBON_STYLES, GlobalFormStyling };