@formio/uswds 2.8.1 → 2.8.2

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.
@@ -5,7 +5,11 @@ const SelectComponent = js_1.Components.components.select;
5
5
  class USWDSSelectComponent extends SelectComponent {
6
6
  choicesOptions() {
7
7
  const choicesOptions = super.choicesOptions();
8
- choicesOptions.classNames.containerInner = [...choicesOptions.classNames.containerInner, 'usa-select', 'maxw-full'];
8
+ choicesOptions.classNames.containerInner = [
9
+ ...choicesOptions.classNames.containerInner,
10
+ 'usa-select',
11
+ 'maxw-full',
12
+ ];
9
13
  return choicesOptions;
10
14
  }
11
15
  }
@@ -10,5 +10,5 @@ exports.default = {
10
10
  radio: Radio_1.default,
11
11
  button: Button_1.default,
12
12
  checkbox: Checkbox_1.default,
13
- selectboxes: SelectBoxes_1.default
13
+ selectboxes: SelectBoxes_1.default,
14
14
  };
@@ -5,6 +5,7 @@ const Radio_form_1 = require("./Radio.form");
5
5
  const RadioComponent = js_1.Components.components.radio;
6
6
  RadioComponent.editForm = Radio_form_1.default;
7
7
  const render = RadioComponent.prototype.render;
8
+ // GOTCHA(G-US02)
8
9
  RadioComponent.prototype.render = function () {
9
10
  this.noField = true;
10
11
  return render.call(this);
@@ -77,7 +77,8 @@ span[role=link]:hover {
77
77
  border: 0;
78
78
  }
79
79
 
80
- .dropdown-item:hover, .dropdown-item:focus {
80
+ .dropdown-item:hover,
81
+ .dropdown-item:focus {
81
82
  color: #1e2125;
82
83
  background-color: #e9ecef;
83
84
  }
@@ -101,7 +102,7 @@ span[role=link]:hover {
101
102
  }
102
103
 
103
104
  .flatpickr-day.selected {
104
- background: #0073EC !important;
105
+ background: #0073ec !important;
105
106
  }
106
107
 
107
108
  .flatpickr-day:hover,
@@ -152,7 +153,8 @@ span[role=link]:hover {
152
153
  line-height: 24px;
153
154
  color: #8a8a8a;
154
155
  }
155
- .formio-dialog.formio-dialog-theme-default .formio-dialog-content .formio-dialog-close:hover:before, .formio-dialog.formio-dialog-theme-default .formio-dialog-content .formio-dialog-close :active:before {
156
+ .formio-dialog.formio-dialog-theme-default .formio-dialog-content .formio-dialog-close:hover:before,
157
+ .formio-dialog.formio-dialog-theme-default .formio-dialog-content .formio-dialog-close :active:before {
156
158
  color: #6b6b6b;
157
159
  }
158
160
 
@@ -243,7 +245,8 @@ span[role=link]:hover {
243
245
  width: 100%;
244
246
  margin-top: 0.5rem;
245
247
  }
246
- .input-group .usa-input, .input-group .usa-textarea {
248
+ .input-group .usa-input,
249
+ .input-group .usa-textarea {
247
250
  position: relative;
248
251
  z-index: 1;
249
252
  width: 1%;
@@ -406,7 +409,8 @@ span[role=link]:hover {
406
409
  }
407
410
 
408
411
  /* USWDS overrides */
409
- b, strong {
412
+ b,
413
+ strong {
410
414
  font-weight: bold !important;
411
415
  }
412
416
 
@@ -426,7 +430,8 @@ ul.usa-sidenav {
426
430
  border-top: 0px;
427
431
  }
428
432
 
429
- .usa-input--error.usa-select, .usa-input--success.usa-select {
433
+ .usa-input--error.usa-select,
434
+ .usa-input--success.usa-select {
430
435
  height: auto;
431
436
  }
432
437
 
@@ -469,7 +474,8 @@ ul.usa-sidenav {
469
474
  max-width: 100% !important;
470
475
  }
471
476
 
472
- .usa-button + .has-error, .usa-button + .has-success {
477
+ .usa-button + .has-error,
478
+ .usa-button + .has-success {
473
479
  display: none;
474
480
  }
475
481
 
@@ -478,7 +484,8 @@ ul.usa-sidenav {
478
484
  box-shadow: 0 0 0 2px #c9c9c9, inset 0 0 0 3px #fff;
479
485
  }
480
486
 
481
- .usa-radio, .usa-checkbox {
487
+ .usa-radio,
488
+ .usa-checkbox {
482
489
  background: none !important;
483
490
  }
484
491
 
@@ -15,7 +15,7 @@ $color-lightest: #fff;
15
15
  $color-dark: #000;
16
16
  $color-tooltip: #1b1b1b;
17
17
 
18
- span[role="link"] {
18
+ span[role='link'] {
19
19
  &:hover {
20
20
  text-decoration: underline;
21
21
  cursor: pointer;
@@ -103,7 +103,8 @@ span[role="link"] {
103
103
  border: 0;
104
104
  }
105
105
 
106
- .dropdown-item:hover, .dropdown-item:focus {
106
+ .dropdown-item:hover,
107
+ .dropdown-item:focus {
107
108
  color: #1e2125;
108
109
  background-color: #e9ecef;
109
110
  }
@@ -127,7 +128,7 @@ span[role="link"] {
127
128
  }
128
129
 
129
130
  .flatpickr-day.selected {
130
- background: #0073EC !important;
131
+ background: #0073ec !important;
131
132
  }
132
133
 
133
134
  .flatpickr-day:hover,
@@ -184,7 +185,8 @@ span[role="link"] {
184
185
  color: #8a8a8a;
185
186
  }
186
187
 
187
- &:hover:before, :active:before {
188
+ &:hover:before,
189
+ :active:before {
188
190
  color: #6b6b6b;
189
191
  }
190
192
  }
@@ -236,7 +238,7 @@ span[role="link"] {
236
238
  word-wrap: break-word;
237
239
  background-clip: border-box;
238
240
  border: 1px solid $color-dark;
239
- border-radius: .25rem;
241
+ border-radius: 0.25rem;
240
242
  }
241
243
 
242
244
  .formio-usa-card-body {
@@ -249,11 +251,11 @@ span[role="link"] {
249
251
  .formio-usa-card-header {
250
252
  position: relative;
251
253
  display: flex;
252
- padding: .5rem;
254
+ padding: 0.5rem;
253
255
  margin-bottom: 0;
254
256
  margin-top: 1px;
255
257
  border-bottom: 1px solid $color-dark;
256
- border-radius: .25rem .25rem 0 0;
258
+ border-radius: 0.25rem 0.25rem 0 0;
257
259
  background-color: $color-lighter;
258
260
  }
259
261
 
@@ -276,7 +278,8 @@ span[role="link"] {
276
278
  align-items: stretch;
277
279
  width: 100%;
278
280
  margin-top: 0.5rem;
279
- & .usa-input, .usa-textarea {
281
+ & .usa-input,
282
+ .usa-textarea {
280
283
  position: relative;
281
284
  z-index: 1;
282
285
  width: 1%;
@@ -351,9 +354,9 @@ span[role="link"] {
351
354
  display: flex;
352
355
  height: 1rem;
353
356
  overflow: hidden;
354
- font-size: .75rem;
357
+ font-size: 0.75rem;
355
358
  background-color: #e9ecef;
356
- border-radius: .25rem;
359
+ border-radius: 0.25rem;
357
360
  .progress-bar {
358
361
  display: -webkit-box;
359
362
  display: -ms-flexbox;
@@ -368,7 +371,7 @@ span[role="link"] {
368
371
  color: #fff;
369
372
  text-align: center;
370
373
  background-color: #007bff;
371
- transition: width .6s ease;
374
+ transition: width 0.6s ease;
372
375
  }
373
376
  }
374
377
 
@@ -445,7 +448,8 @@ span[role="link"] {
445
448
 
446
449
  /* USWDS overrides */
447
450
 
448
- b, strong {
451
+ b,
452
+ strong {
449
453
  font-weight: bold !important;
450
454
  }
451
455
 
@@ -465,19 +469,20 @@ ul.usa-sidenav {
465
469
  border-top: 0px;
466
470
  }
467
471
 
468
- .usa-input--error.usa-select, .usa-input--success.usa-select {
472
+ .usa-input--error.usa-select,
473
+ .usa-input--success.usa-select {
469
474
  height: auto;
470
475
  }
471
476
 
472
477
  .usa-accordion__button {
473
- &.non-collapsible-panel--button {
474
- background-image: none;
478
+ &.non-collapsible-panel--button {
479
+ background-image: none;
475
480
 
476
- &:hover {
481
+ &:hover {
477
482
  background-color: $color-lighter;
478
483
  cursor: auto;
479
- }
480
- }
484
+ }
485
+ }
481
486
  }
482
487
 
483
488
  .usa-table {
@@ -511,16 +516,22 @@ ul.usa-sidenav {
511
516
  max-width: 100% !important;
512
517
  }
513
518
 
514
- .usa-button + .has-error, .usa-button + .has-success {
519
+ .usa-button + .has-error,
520
+ .usa-button + .has-success {
515
521
  display: none;
516
522
  }
517
523
 
518
524
  .usa-radio__input:disabled:checked + .usa-radio__label::before {
519
- -webkit-box-shadow: 0 0 0 2px $color-light, inset 0 0 0 3px $color-lightest;
520
- box-shadow: 0 0 0 2px $color-light, inset 0 0 0 3px $color-lightest;
525
+ -webkit-box-shadow:
526
+ 0 0 0 2px $color-light,
527
+ inset 0 0 0 3px $color-lightest;
528
+ box-shadow:
529
+ 0 0 0 2px $color-light,
530
+ inset 0 0 0 3px $color-lightest;
521
531
  }
522
532
 
523
- .usa-radio, .usa-checkbox {
533
+ .usa-radio,
534
+ .usa-checkbox {
524
535
  background: none !important;
525
536
  }
526
537
 
@@ -538,100 +549,104 @@ ul.usa-sidenav {
538
549
  }
539
550
  }
540
551
 
541
- div[ref="modalContents"] .usa-form-group--error {
552
+ div[ref='modalContents'] .usa-form-group--error {
542
553
  margin-top: 0;
543
554
  }
544
555
 
545
556
  @media print {
546
- div[class*=":grid-col-1"] {
547
- -webkit-box-flex:0;
548
- -ms-flex:0 0 auto;
549
- flex:0 0 auto;
550
- width:8.3333333333%;
557
+ div[class*=':grid-col-1'] {
558
+ -webkit-box-flex: 0;
559
+ -ms-flex: 0 0 auto;
560
+ flex: 0 0 auto;
561
+ width: 8.3333333333%;
551
562
  }
552
563
 
553
- div[class*=":grid-col-2"] {
554
- -webkit-box-flex:0;
555
- -ms-flex:0 0 auto;
556
- flex:0 0 auto;
557
- width:16.6666666667%;
564
+ div[class*=':grid-col-2'] {
565
+ -webkit-box-flex: 0;
566
+ -ms-flex: 0 0 auto;
567
+ flex: 0 0 auto;
568
+ width: 16.6666666667%;
558
569
  }
559
570
 
560
- div[class*=":grid-col-3"] {
561
- -webkit-box-flex:0;
562
- -ms-flex:0 0 auto;
563
- flex:0 0 auto;
564
- width:25%;
571
+ div[class*=':grid-col-3'] {
572
+ -webkit-box-flex: 0;
573
+ -ms-flex: 0 0 auto;
574
+ flex: 0 0 auto;
575
+ width: 25%;
565
576
  }
566
577
 
567
- div[class*=":grid-col-4"] {
568
- -webkit-box-flex:0;
569
- -ms-flex:0 0 auto;
570
- flex:0 0 auto;
571
- width:33.3333333333%;
578
+ div[class*=':grid-col-4'] {
579
+ -webkit-box-flex: 0;
580
+ -ms-flex: 0 0 auto;
581
+ flex: 0 0 auto;
582
+ width: 33.3333333333%;
572
583
  }
573
584
 
574
- div[class*=":grid-col-5"] {
575
- -webkit-box-flex:0;
576
- -ms-flex:0 0 auto;
577
- flex:0 0 auto;
578
- width:41.6666666667%;
585
+ div[class*=':grid-col-5'] {
586
+ -webkit-box-flex: 0;
587
+ -ms-flex: 0 0 auto;
588
+ flex: 0 0 auto;
589
+ width: 41.6666666667%;
579
590
  }
580
591
 
581
- div[class*=":grid-col-6"] {
582
- -webkit-box-flex:0;
583
- -ms-flex:0 0 auto;
584
- flex:0 0 auto;
585
- width:50%;
592
+ div[class*=':grid-col-6'] {
593
+ -webkit-box-flex: 0;
594
+ -ms-flex: 0 0 auto;
595
+ flex: 0 0 auto;
596
+ width: 50%;
586
597
  }
587
598
 
588
- div[class*=":grid-col-7"] {
589
- -webkit-box-flex:0;
590
- -ms-flex:0 0 auto;
591
- flex:0 0 auto;
592
- width:58.3333333333%;
599
+ div[class*=':grid-col-7'] {
600
+ -webkit-box-flex: 0;
601
+ -ms-flex: 0 0 auto;
602
+ flex: 0 0 auto;
603
+ width: 58.3333333333%;
593
604
  }
594
605
 
595
- div[class*=":grid-col-8"] {
596
- -webkit-box-flex:0;
597
- -ms-flex:0 0 auto;
598
- flex:0 0 auto;
599
- width:66.6666666667%;
606
+ div[class*=':grid-col-8'] {
607
+ -webkit-box-flex: 0;
608
+ -ms-flex: 0 0 auto;
609
+ flex: 0 0 auto;
610
+ width: 66.6666666667%;
600
611
  }
601
612
 
602
- div[class*=":grid-col-9"] {
603
- -webkit-box-flex:0;
604
- -ms-flex:0 0 auto;
605
- flex:0 0 auto;
606
- width:75%;
613
+ div[class*=':grid-col-9'] {
614
+ -webkit-box-flex: 0;
615
+ -ms-flex: 0 0 auto;
616
+ flex: 0 0 auto;
617
+ width: 75%;
607
618
  }
608
619
 
609
- div[class*=":grid-col-10"] {
610
- -webkit-box-flex:0;
611
- -ms-flex:0 0 auto;
612
- flex:0 0 auto;
613
- width:83.3333333333%;
620
+ div[class*=':grid-col-10'] {
621
+ -webkit-box-flex: 0;
622
+ -ms-flex: 0 0 auto;
623
+ flex: 0 0 auto;
624
+ width: 83.3333333333%;
614
625
  }
615
626
 
616
- div[class*=":grid-col-11"] {
617
- -webkit-box-flex:0;
618
- -ms-flex:0 0 auto;
619
- flex:0 0 auto;
620
- width:91.6666666667%;
627
+ div[class*=':grid-col-11'] {
628
+ -webkit-box-flex: 0;
629
+ -ms-flex: 0 0 auto;
630
+ flex: 0 0 auto;
631
+ width: 91.6666666667%;
621
632
  }
622
633
 
623
- div[class*=":grid-col-12"] {
624
- -webkit-box-flex:0;
625
- -ms-flex:0 0 auto;
626
- flex:0 0 auto;
627
- width:100%;
634
+ div[class*=':grid-col-12'] {
635
+ -webkit-box-flex: 0;
636
+ -ms-flex: 0 0 auto;
637
+ flex: 0 0 auto;
638
+ width: 100%;
628
639
  }
629
640
 
630
641
  .usa-checkbox__input:checked:disabled + .usa-checkbox__label::before {
631
642
  background-image: none;
632
643
  background-color: $color-light;
633
- -webkit-box-shadow: 0 0 0 2px $color-light, inset 0 0 0 3px $color-lightest;
634
- box-shadow: 0 0 0 2px $color-light, inset 0 0 0 3px $color-lightest;
644
+ -webkit-box-shadow:
645
+ 0 0 0 2px $color-light,
646
+ inset 0 0 0 3px $color-lightest;
647
+ box-shadow:
648
+ 0 0 0 2px $color-light,
649
+ inset 0 0 0 3px $color-lightest;
635
650
  -webkit-print-color-adjust: exact;
636
651
  text-indent: 0;
637
652
  }
@@ -647,4 +662,4 @@ div[ref="modalContents"] .usa-form-group--error {
647
662
 
648
663
  .formio-choices .choices__list--dropdown .choices__list {
649
664
  width: 100%;
650
- }
665
+ }
@@ -6,6 +6,8 @@ var __t, __p = '', __j = Array.prototype.join;
6
6
  function print() { __p += __j.call(arguments, '') }
7
7
  __p += '<fieldset class="usa-fieldset">\n ';
8
8
  if (ctx.component.legend) { ;
9
+ __p += '\n ';
10
+ /* GOTCHA(G-US03) */ ;
9
11
  __p += '\n <legend ref="header" id="l-' +
10
12
  ((__t = (ctx.instance.id)) == null ? '' : __t) +
11
13
  '-legend" class="usa-sr-only">\n ' +
@@ -62,7 +62,9 @@ exports.default = {
62
62
  }
63
63
  switch (type) {
64
64
  case 'class':
65
- return this.cssClasses.hasOwnProperty(text.toString()) ? this.cssClasses[text.toString()] : text;
65
+ return this.cssClasses.hasOwnProperty(text.toString())
66
+ ? this.cssClasses[text.toString()]
67
+ : text;
66
68
  }
67
69
  return text;
68
70
  },
@@ -120,6 +122,7 @@ exports.default = {
120
122
  wizardNav: wizardNav_1.default,
121
123
  size: size_1.default,
122
124
  cssClasses: cssClasses_1.default,
125
+ // GOTCHA(G-US01)
123
126
  iconClass: iconClass_js_1.default,
124
127
  defaultIconset: 'fa',
125
128
  };
@@ -2,10 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = (size) => {
4
4
  switch (size) {
5
- case 'xs': return '';
6
- case 'sm': return 'mobile-lg';
7
- case 'md': return 'tablet';
8
- case 'lg': return 'desktop';
9
- default: return 'tablet';
5
+ case 'xs':
6
+ return '';
7
+ case 'sm':
8
+ return 'mobile-lg';
9
+ case 'md':
10
+ return 'tablet';
11
+ case 'lg':
12
+ return 'desktop';
13
+ default:
14
+ return 'tablet';
10
15
  }
11
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/uswds",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "description": "US Web Design System templates for form.io",
5
5
  "main": "lib/index.js",
6
6
  "pre-commit": [
@@ -23,7 +23,7 @@
23
23
  "Standards"
24
24
  ],
25
25
  "peerDependencies": {
26
- "@formio/js": "^5.4.1"
26
+ "@formio/js": "^5.4.2"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/chai": "^4.2.22",
@@ -51,7 +51,7 @@
51
51
  "typescript": "^4.4.3",
52
52
  "webpack": "5.38.1",
53
53
  "webpack-cli": "^4.8.0",
54
- "@formio/js": "^5.4.1"
54
+ "@formio/js": "^5.4.2"
55
55
  },
56
56
  "author": "Form.io Developers <support@form.io>",
57
57
  "license": "OSLv3",
@@ -70,6 +70,8 @@
70
70
  "bundle:dev": "NODE_OPTIONS=--openssl-legacy-provider webpack",
71
71
  "bundle:prod": "NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack.prod.js",
72
72
  "build": "gulp build && tsc && npm run bundle:prod && npm run bundle:dev",
73
- "lint": "tslint -p ."
73
+ "lint": "tslint -p .",
74
+ "check-types": "tsc --noEmit",
75
+ "lint:fix": "tslint -p . --fix"
74
76
  }
75
77
  }
package/Readme.md DELETED
@@ -1,66 +0,0 @@
1
- # Form.io United States Web Design System Templates
2
-
3
- This repository will change the rendering of forms in formio.js so that it uses html and classes compatible with the [United States Web Design System](https://designsystem.digital.gov/) framework.
4
-
5
- ## Usage
6
-
7
- ```javascript
8
- import uswds from '@formio/uswds';
9
- import { Formio } from '@formio/js';
10
- Formio.use(uswds);
11
- ```
12
-
13
- Or if you would like to embed directly within your website, you can use the following.
14
-
15
- ```html
16
- <html>
17
- <head>
18
- <meta charset="UTF-8">
19
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
20
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uswds/3.1.0/css/uswds.min.css">
21
- <link rel="stylesheet" href="https://cdn.form.io/js/formio.form.min.css">
22
- <link rel="stylesheet" href="https://cdn.form.io/uswds/uswds.min.css">
23
- <script src="https://cdnjs.cloudflare.com/ajax/libs/uswds/3.1.0/js/uswds.min.js"></script>
24
- <script src="https://cdn.form.io/js/formio.form.min.js"></script>
25
- <script src="https://cdn.form.io/uswds/uswds.min.js"></script>
26
- </head>
27
- <body>
28
- <div id="formio"></div>
29
- <script type="text/javascript">
30
- Formio.use(uswds);
31
- Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/example');
32
- </script>
33
- </body>
34
- </html>
35
- ```
36
-
37
- You can try out this by going to the following JSFiddle - https://jsfiddle.net/travistidwell/yrwp9m24/1/
38
-
39
- ## Form Builder
40
- In addition to being a Form Renderer, you can also use this library to embed the Form.io Form Builder within your own application using the following.
41
-
42
- ```html
43
- <html>
44
- <head>
45
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
46
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uswds/3.1.0/css/uswds.min.css">
47
- <link rel="stylesheet" href="https://cdn.form.io/js/formio.full.min.css">
48
- <link rel="stylesheet" href="https://cdn.form.io/uswds/uswds.min.css">
49
- <script src="https://cdnjs.cloudflare.com/ajax/libs/uswds/3.1.0/js/uswds.min.js"></script>
50
- <script src="https://cdn.form.io/js/formio.full.min.js"></script>
51
- <script src="https://cdn.form.io/uswds/uswds.min.js"></script>
52
- </head>
53
- <body>
54
- <div id="builder"></div>
55
- <script type="text/javascript">
56
- Formio.use(uswds);
57
- Formio.builder(document.getElementById('builder'));
58
- </script>
59
- </body>
60
- </html>
61
- ```
62
-
63
- ## Example Application
64
- For an example of how this platform works, please see the following application.
65
-
66
- [https://formio.github.io/uswds](https://formio.github.io/uswds)