@bpmn-io/form-js-carbon-styles 0.15.0-alpha.0

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