@bpmn-io/form-js-carbon-styles 0.15.0-alpha.0 → 1.0.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/package.json +8 -6
- package/src/carbon-styles.js +235 -137
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpmn-io/form-js-carbon-styles",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
4
|
"description": "Custom carbon styles for form-js",
|
|
5
5
|
"main": "src/carbon-styles.js",
|
|
6
6
|
"types": "src/types/carbon-styles.d.ts",
|
|
@@ -19,16 +19,18 @@
|
|
|
19
19
|
"name": "bpmn.io contributors",
|
|
20
20
|
"url": "https://github.com/bpmn-io"
|
|
21
21
|
},
|
|
22
|
-
"
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@bpmn-io/form-js-viewer": "^1.0.0-alpha.0",
|
|
23
24
|
"@carbon/elements": "^11.19.1",
|
|
25
|
+
"@types/styled-components": "^5.1.26",
|
|
24
26
|
"styled-components": "^5.3.6"
|
|
25
27
|
},
|
|
26
|
-
"
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@carbon/elements": ">=11",
|
|
30
|
+
"styled-components": ">=5"
|
|
29
31
|
},
|
|
30
32
|
"files": [
|
|
31
33
|
"src"
|
|
32
34
|
],
|
|
33
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "992b8f130b82f8e739af7b3794e42a3ec054523d"
|
|
34
36
|
}
|
package/src/carbon-styles.js
CHANGED
|
@@ -57,110 +57,108 @@ const getSelectArrowStyles = ({
|
|
|
57
57
|
`;
|
|
58
58
|
|
|
59
59
|
const MARKDOWN_STYLES = css`
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
60
|
+
.fjs-container .fjs-form-field.fjs-form-field-text .markup {
|
|
61
|
+
& {
|
|
62
|
+
font-size: var(--cds-body-long-01-font-size);
|
|
63
|
+
font-weight: var(--cds-body-long-01-font-weight);
|
|
64
|
+
line-height: var(--cds-body-long-01-line-height);
|
|
65
|
+
letter-spacing: var(--cds-body-long-01-letter-spacing);
|
|
66
|
+
}
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
& h1 {
|
|
69
|
+
font-size: var(--cds-productive-heading-06-font-size);
|
|
70
|
+
font-weight: var(--cds-productive-heading-06-font-weight);
|
|
71
|
+
line-height: var(--cds-productive-heading-06-line-height);
|
|
72
|
+
letter-spacing: var(--cds-productive-heading-06-letter-spacing);
|
|
73
|
+
}
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
& h2 {
|
|
76
|
+
font-size: var(--cds-productive-heading-05-font-size);
|
|
77
|
+
font-weight: var(--cds-productive-heading-05-font-weight);
|
|
78
|
+
line-height: var(--cds-productive-heading-05-line-height);
|
|
79
|
+
letter-spacing: var(--cds-productive-heading-05-letter-spacing);
|
|
80
|
+
}
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
82
|
+
& h3 {
|
|
83
|
+
font-size: var(--cds-productive-heading-04-font-size);
|
|
84
|
+
font-weight: var(--cds-productive-heading-04-font-weight);
|
|
85
|
+
line-height: var(--cds-productive-heading-04-line-height);
|
|
86
|
+
letter-spacing: var(--cds-productive-heading-04-letter-spacing);
|
|
87
|
+
}
|
|
88
|
+
& h4 {
|
|
89
|
+
font-size: var(--cds-productive-heading-03-font-size);
|
|
90
|
+
font-weight: var(--cds-productive-heading-03-font-weight);
|
|
91
|
+
line-height: var(--cds-productive-heading-03-line-height);
|
|
92
|
+
letter-spacing: var(--cds-productive-heading-03-letter-spacing);
|
|
93
|
+
}
|
|
94
|
+
& h5 {
|
|
95
|
+
font-size: var(--cds-productive-heading-02-font-size);
|
|
96
|
+
font-weight: var(--cds-productive-heading-02-font-weight);
|
|
97
|
+
line-height: var(--cds-productive-heading-02-line-height);
|
|
98
|
+
letter-spacing: var(--cds-productive-heading-02-letter-spacing);
|
|
99
|
+
}
|
|
100
|
+
& h6 {
|
|
101
|
+
font-size: var(--cds-productive-heading-01-font-size);
|
|
102
|
+
font-weight: var(--cds-productive-heading-01-font-weight);
|
|
103
|
+
line-height: var(--cds-productive-heading-01-line-height);
|
|
104
|
+
letter-spacing: var(--cds-productive-heading-01-letter-spacing);
|
|
105
|
+
}
|
|
107
106
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
& code {
|
|
108
|
+
font-family: var(--cds-code-02-font-family);
|
|
109
|
+
font-size: var(--cds-code-02-font-size);
|
|
110
|
+
font-weight: var(--cds-code-02-font-weight);
|
|
111
|
+
line-height: var(--cds-code-02-line-height);
|
|
112
|
+
letter-spacing: var(--cds-code-02-letter-spacing);
|
|
113
|
+
white-space: pre-wrap;
|
|
114
|
+
}
|
|
116
115
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
& blockquote {
|
|
117
|
+
font-family: var(--cds-quotation-02-font-family);
|
|
118
|
+
font-size: var(--cds-quotation-02-font-size);
|
|
119
|
+
font-weight: var(--cds-quotation-02-font-weight);
|
|
120
|
+
line-height: var(--cds-quotation-02-line-height);
|
|
121
|
+
letter-spacing: var(--cds-quotation-02-letter-spacing);
|
|
122
|
+
}
|
|
124
123
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
124
|
+
& ul,
|
|
125
|
+
& ol {
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
padding: 0;
|
|
128
|
+
border: 0;
|
|
129
|
+
margin: 0;
|
|
130
|
+
list-style: none;
|
|
131
|
+
}
|
|
133
132
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
& ul {
|
|
134
|
+
margin-left: var(--cds-spacing-05);
|
|
135
|
+
}
|
|
137
136
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
& ol {
|
|
138
|
+
margin-left: var(--cds-spacing-05);
|
|
139
|
+
}
|
|
141
140
|
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
& ul li {
|
|
142
|
+
position: relative;
|
|
144
143
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
144
|
+
&:before {
|
|
145
|
+
position: absolute;
|
|
146
|
+
left: calc(-1 * var(--cds-spacing-05));
|
|
147
|
+
content: '–';
|
|
150
148
|
}
|
|
149
|
+
}
|
|
151
150
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
& ol li {
|
|
152
|
+
position: relative;
|
|
153
|
+
counter-increment: item;
|
|
155
154
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
155
|
+
&:before {
|
|
156
|
+
position: absolute;
|
|
157
|
+
left: calc(-1 * var(--cds-spacing-05));
|
|
158
|
+
content: counter(item) '.';
|
|
161
159
|
}
|
|
162
160
|
}
|
|
163
|
-
|
|
161
|
+
}
|
|
164
162
|
`;
|
|
165
163
|
|
|
166
164
|
const ANCHOR_STYLES = css`
|
|
@@ -199,6 +197,108 @@ const ANCHOR_STYLES = css`
|
|
|
199
197
|
}
|
|
200
198
|
`;
|
|
201
199
|
|
|
200
|
+
const READONLY_STYLES = css`
|
|
201
|
+
${({ theme }) => css`
|
|
202
|
+
.fjs-container {
|
|
203
|
+
.fjs-readonly {
|
|
204
|
+
|
|
205
|
+
.fjs-input:read-only:not(:disabled),
|
|
206
|
+
.fjs-textarea:read-only:not(:disabled),
|
|
207
|
+
.fjs-select:read-only:not(:disabled),
|
|
208
|
+
&.fjs-taglist,
|
|
209
|
+
.fjs-input-group {
|
|
210
|
+
background-color: transparent;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&.fjs-form-field-number {
|
|
214
|
+
.fjs-input-group .fjs-number-arrow-container {
|
|
215
|
+
background-color: transparent;
|
|
216
|
+
|
|
217
|
+
.fjs-number-arrow-up,
|
|
218
|
+
.fjs-number-arrow-down {
|
|
219
|
+
background-color: transparent;
|
|
220
|
+
pointer-events: none;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&.fjs-form-field:not(.fjs-form-field-datetime) {
|
|
226
|
+
.fjs-input-group .fjs-input-adornment {
|
|
227
|
+
background: transparent;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&.fjs-form-field-select {
|
|
232
|
+
.fjs-input-group {
|
|
233
|
+
cursor: unset;
|
|
234
|
+
background-image: ${getSelectArrowSvg(theme.iconDisabled)};
|
|
235
|
+
background-color: transparent;
|
|
236
|
+
border-bottom: 1px solid var(--cds-border-strong);
|
|
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
|
+
|
|
202
302
|
const DISABLED_STYLES = css`
|
|
203
303
|
.fjs-container {
|
|
204
304
|
.fjs-disabled {
|
|
@@ -271,11 +371,11 @@ const DISABLED_STYLES = css`
|
|
|
271
371
|
}
|
|
272
372
|
|
|
273
373
|
.fjs-taglist.fjs-disabled .fjs-taglist-tag {
|
|
274
|
-
background-color: var(--cds-
|
|
275
|
-
opacity: 0.7;
|
|
374
|
+
background-color: var(--cds-layer-01);
|
|
276
375
|
|
|
277
376
|
.fjs-taglist-tag-label {
|
|
278
377
|
padding: 2px 0px;
|
|
378
|
+
opacity: 0.7;
|
|
279
379
|
color: var(--cds-text-on-color-disabled);
|
|
280
380
|
}
|
|
281
381
|
}
|
|
@@ -283,57 +383,55 @@ const DISABLED_STYLES = css`
|
|
|
283
383
|
`;
|
|
284
384
|
|
|
285
385
|
const LABEL_DESCRIPTION_ERROR_STYLES = css`
|
|
286
|
-
|
|
287
|
-
.fjs-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
386
|
+
.fjs-container {
|
|
387
|
+
.fjs-form-field-label {
|
|
388
|
+
font-size: var(--cds-label-01-font-size);
|
|
389
|
+
font-weight: var(--cds-label-01-font-weight);
|
|
390
|
+
line-height: var(--cds-label-01-line-height);
|
|
391
|
+
letter-spacing: var(--cds-label-01-letter-spacing);
|
|
392
|
+
}
|
|
294
393
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
394
|
+
.fjs-form-field:not(.fjs-form-field-checkbox)
|
|
395
|
+
.fjs-form-field-label:first-child {
|
|
396
|
+
margin: 0;
|
|
397
|
+
margin-bottom: var(--cds-spacing-03);
|
|
398
|
+
}
|
|
300
399
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
400
|
+
.fjs-form-field.fjs-form-field-radio
|
|
401
|
+
.fjs-form-field-label:not(:first-of-type),
|
|
402
|
+
.fjs-form-field.fjs-form-field-checklist
|
|
403
|
+
.fjs-form-field-label:not(:first-of-type) {
|
|
404
|
+
margin: 0;
|
|
405
|
+
margin-bottom: 0.1875rem;
|
|
406
|
+
}
|
|
308
407
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
408
|
+
.fjs-form-field.fjs-form-field-radio
|
|
409
|
+
.fjs-form-field-label:not(:first-of-type) {
|
|
410
|
+
min-height: ${rem(27)};
|
|
411
|
+
}
|
|
313
412
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
413
|
+
.fjs-form-field-description {
|
|
414
|
+
margin: 0;
|
|
415
|
+
margin-top: var(--cds-spacing-02);
|
|
416
|
+
font-size: var(--cds-helper-text-01-font-size);
|
|
417
|
+
font-weight: var(--cds-helper-text-01-font-weight);
|
|
418
|
+
line-height: var(--cds-helper-text-01-line-height);
|
|
419
|
+
letter-spacing: var(--cds-helper-text-01-letter-spacing);
|
|
420
|
+
}
|
|
322
421
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
422
|
+
.fjs-form-field-error {
|
|
423
|
+
margin: 0;
|
|
424
|
+
margin-top: var(--cds-spacing-02);
|
|
425
|
+
font-size: var(--cds-label-01-font-size);
|
|
426
|
+
font-weight: var(--cds-label-01-font-weight);
|
|
427
|
+
line-height: var(--cds-label-01-line-height);
|
|
428
|
+
letter-spacing: var(--cds-label-01-letter-spacing);
|
|
429
|
+
}
|
|
331
430
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
431
|
+
.fjs-has-errors .fjs-form-field-description {
|
|
432
|
+
display: none;
|
|
335
433
|
}
|
|
336
|
-
|
|
434
|
+
}
|
|
337
435
|
`;
|
|
338
436
|
|
|
339
437
|
const CHECKBOX_STYLES = css`
|
|
@@ -1033,6 +1131,7 @@ const ADORNMENTS_STYLES = css`
|
|
|
1033
1131
|
const CARBON_STYLES = css`
|
|
1034
1132
|
${MARKDOWN_STYLES}
|
|
1035
1133
|
${ANCHOR_STYLES}
|
|
1134
|
+
${READONLY_STYLES}
|
|
1036
1135
|
${DISABLED_STYLES}
|
|
1037
1136
|
${LABEL_DESCRIPTION_ERROR_STYLES}
|
|
1038
1137
|
${CHECKBOX_STYLES}
|
|
@@ -1049,7 +1148,6 @@ const CARBON_STYLES = css`
|
|
|
1049
1148
|
.fjs-container {
|
|
1050
1149
|
width: 100%;
|
|
1051
1150
|
height: min-content;
|
|
1052
|
-
--carbon-breakpoint-lg-width: 66rem;
|
|
1053
1151
|
|
|
1054
1152
|
.cds--grid {
|
|
1055
1153
|
padding: 0;
|
|
@@ -1069,7 +1167,7 @@ const CARBON_STYLES = css`
|
|
|
1069
1167
|
margin-right: 0;
|
|
1070
1168
|
}
|
|
1071
1169
|
|
|
1072
|
-
@media (width <
|
|
1170
|
+
@media (width < 66rem) { // Carbon lg width breakpoint
|
|
1073
1171
|
.fjs-layout-column .fjs-form-field {
|
|
1074
1172
|
margin-left: 0;
|
|
1075
1173
|
margin-right: 0;
|