@formio/uswds 2.3.9-rc.2 → 2.4.0-rc.3

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.
@@ -79,8 +79,8 @@ span[role=link]:hover {
79
79
  margin: 0.5em 0 0.3em;
80
80
  }
81
81
 
82
- .formio-dialog.formio-dialog-theme-default .formio-dialog-content {
83
- padding: 1.5em 1em 1em !important;
82
+ .formio-dialog.formio-dialog-theme-default .component-edit-container {
83
+ padding: 0.6em;
84
84
  }
85
85
  .formio-dialog.formio-dialog-theme-default .formio-dialog-content .formio-dialog-close {
86
86
  right: 4px;
@@ -95,7 +95,16 @@ span[role=link]:hover {
95
95
  color: #6b6b6b;
96
96
  }
97
97
 
98
+ .formio-dialog-content .usa-label {
99
+ padding-right: 30px;
100
+ }
101
+ .formio-dialog-content .usa-label label {
102
+ padding-right: 0;
103
+ }
104
+
98
105
  .formio-dialog-buttons {
106
+ display: flex;
107
+ justify-content: flex-end;
99
108
  margin: 0 -0.5rem;
100
109
  }
101
110
 
@@ -176,7 +185,7 @@ span[role=link]:hover {
176
185
  .input-group .usa-input, .input-group .usa-textarea {
177
186
  position: relative;
178
187
  z-index: 1;
179
- width: auto;
188
+ width: 1%;
180
189
  min-width: 50px;
181
190
  flex-grow: 1;
182
191
  margin-top: 0;
@@ -267,11 +276,11 @@ span[role=link]:hover {
267
276
  transition: width 0.6s ease;
268
277
  }
269
278
 
270
- .tooltip__trigger {
279
+ .formio-tooltip__trigger {
271
280
  cursor: pointer;
272
281
  }
273
282
 
274
- .tooltip__body {
283
+ .formio-tooltip__body {
275
284
  background-color: #1b1b1b;
276
285
  border-radius: 0.25rem;
277
286
  bottom: 0;
@@ -286,32 +295,32 @@ span[role=link]:hover {
286
295
  white-space: pre;
287
296
  z-index: 1000;
288
297
  }
289
- .tooltip__body.is-set {
298
+ .formio-tooltip__body.formio-tooltip--is-set {
290
299
  display: block;
291
300
  }
292
- .tooltip__body--whitespace {
301
+ .formio-tooltip__body--whitespace {
293
302
  white-space: normal;
294
303
  width: 250px;
295
304
  }
296
- .tooltip__body--right {
305
+ .formio-tooltip__body--right {
297
306
  top: auto;
298
307
  transform: translateX(0);
299
308
  }
300
- .tooltip__body--left {
309
+ .formio-tooltip__body--left {
301
310
  top: auto;
302
311
  left: 0;
303
312
  right: auto;
304
313
  transform: translateX(0);
305
314
  }
306
- .tooltip__body--bottom {
315
+ .formio-tooltip__body--bottom {
307
316
  bottom: auto;
308
317
  top: 0;
309
318
  }
310
319
 
311
- .tooltip__wrapper {
320
+ .formio-tooltip__wrapper {
312
321
  position: relative;
313
322
  }
314
- .tooltip__wrapper > span {
323
+ .formio-tooltip__wrapper > span {
315
324
  font-weight: normal;
316
325
  }
317
326
 
package/lib/index.d.ts CHANGED
@@ -2,6 +2,7 @@ declare const _default: {
2
2
  framework: string;
3
3
  templates: {
4
4
  uswds: {
5
+ transform(type: any, text: any): any;
5
6
  address: {
6
7
  form: string;
7
8
  };
@@ -171,6 +172,17 @@ declare const _default: {
171
172
  'formio-tab-panel-active': string;
172
173
  'formio-tab-link-active': string;
173
174
  'formio-tab-link-container-active': string;
175
+ 'sr-only': string;
176
+ 'formio-form-error': string;
177
+ 'formio-label-error': string;
178
+ 'formio-input-success': string;
179
+ 'formio-input-error': string;
180
+ 'formio-modal-save': string;
181
+ 'formio-alert-danger': string;
182
+ 'formio-alert-success': string;
183
+ 'formio-modal-cancel-button': string;
184
+ 'formio-modal-confirm-button': string;
185
+ 'form-control ui fluid selection dropdown': string;
174
186
  };
175
187
  };
176
188
  };
@@ -106,9 +106,11 @@ span[role="link"] {
106
106
  }
107
107
 
108
108
  .formio-dialog.formio-dialog-theme-default {
109
- & .formio-dialog-content {
110
- padding: 1.5em 1em 1em !important;
109
+ & .component-edit-container {
110
+ padding: 0.6em;
111
+ }
111
112
 
113
+ & .formio-dialog-content {
112
114
  & .formio-dialog-close {
113
115
  right: 4px;
114
116
  top: 4px;
@@ -126,7 +128,16 @@ span[role="link"] {
126
128
  }
127
129
  }
128
130
 
131
+ .formio-dialog-content .usa-label {
132
+ padding-right: 30px;
133
+ label {
134
+ padding-right: 0;
135
+ }
136
+ }
137
+
129
138
  .formio-dialog-buttons {
139
+ display: flex;
140
+ justify-content: flex-end;
130
141
  margin: 0 -0.5rem;
131
142
  }
132
143
 
@@ -205,7 +216,7 @@ span[role="link"] {
205
216
  & .usa-input, .usa-textarea {
206
217
  position: relative;
207
218
  z-index: 1;
208
- width: auto;
219
+ width: 1%;
209
220
  min-width: 50px;
210
221
  flex-grow: 1;
211
222
  margin-top: 0;
@@ -298,11 +309,11 @@ span[role="link"] {
298
309
  }
299
310
  }
300
311
 
301
- .tooltip__trigger {
312
+ .formio-tooltip__trigger {
302
313
  cursor: pointer;
303
314
  }
304
315
 
305
- .tooltip__body {
316
+ .formio-tooltip__body {
306
317
  background-color: $color-tooltip;
307
318
  border-radius: 0.25rem;
308
319
  bottom: 0;
@@ -317,7 +328,7 @@ span[role="link"] {
317
328
  white-space: pre;
318
329
  z-index: 1000;
319
330
 
320
- &.is-set {
331
+ &.formio-tooltip--is-set {
321
332
  display: block;
322
333
  }
323
334
 
@@ -344,7 +355,7 @@ span[role="link"] {
344
355
  }
345
356
  }
346
357
 
347
- .tooltip__wrapper {
358
+ .formio-tooltip__wrapper {
348
359
  position: relative;
349
360
  & > span {
350
361
  font-weight: normal;
@@ -1,5 +1,6 @@
1
1
  declare const _default: {
2
2
  uswds: {
3
+ transform(type: any, text: any): any;
3
4
  address: {
4
5
  form: string;
5
6
  };
@@ -169,6 +170,17 @@ declare const _default: {
169
170
  'formio-tab-panel-active': string;
170
171
  'formio-tab-link-active': string;
171
172
  'formio-tab-link-container-active': string;
173
+ 'sr-only': string;
174
+ 'formio-form-error': string;
175
+ 'formio-label-error': string;
176
+ 'formio-input-success': string;
177
+ 'formio-input-error': string;
178
+ 'formio-modal-save': string;
179
+ 'formio-alert-danger': string;
180
+ 'formio-alert-success': string;
181
+ 'formio-modal-cancel-button': string;
182
+ 'formio-modal-confirm-button': string;
183
+ 'form-control ui fluid selection dropdown': string;
172
184
  };
173
185
  };
174
186
  };
@@ -28,7 +28,7 @@ __p += '\n ' +
28
28
  ((__t = (ctx.children)) == null ? '' : __t) +
29
29
  '\n ';
30
30
  } ;
31
- __p += '\n <div class="formio-dialog-buttons float-right">\n <button class="usa-button usa-button--secondary" ref="modalClose" aria-label="Cancel button. Click to cancel the changes and get back to the form.">' +
31
+ __p += '\n <div class="formio-dialog-buttons">\n <button class="usa-button usa-button--secondary" ref="modalClose" aria-label="Cancel button. Click to cancel the changes and get back to the form.">' +
32
32
  ((__t = (ctx.t('Cancel'))) == null ? '' : __t) +
33
33
  '</button>\n <button class="usa-button" ref="modalSave" aria-label="Save button. Click to save the changes and get back to the form.">' +
34
34
  ((__t = (ctx.t('Save'))) == null ? '' : __t) +
@@ -2,5 +2,16 @@ declare const _default: {
2
2
  'formio-tab-panel-active': string;
3
3
  'formio-tab-link-active': string;
4
4
  'formio-tab-link-container-active': string;
5
+ 'sr-only': string;
6
+ 'formio-form-error': string;
7
+ 'formio-label-error': string;
8
+ 'formio-input-success': string;
9
+ 'formio-input-error': string;
10
+ 'formio-modal-save': string;
11
+ 'formio-alert-danger': string;
12
+ 'formio-alert-success': string;
13
+ 'formio-modal-cancel-button': string;
14
+ 'formio-modal-confirm-button': string;
15
+ 'form-control ui fluid selection dropdown': string;
5
16
  };
6
17
  export default _default;
@@ -3,5 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  'formio-tab-panel-active': 'usa-current',
5
5
  'formio-tab-link-active': 'usa-current',
6
- 'formio-tab-link-container-active': 'usa-current'
6
+ 'formio-tab-link-container-active': 'usa-current',
7
+ 'sr-only': 'usa-sr-only',
8
+ 'formio-form-error': 'usa-form-group--error',
9
+ 'formio-label-error': 'usa-label--error',
10
+ 'formio-input-success': 'usa-input--success',
11
+ 'formio-input-error': 'usa-input--error',
12
+ 'formio-modal-save': 'usa-error',
13
+ 'formio-alert-danger': 'usa-alert usa-alert--error usa-alert--no-icon',
14
+ 'formio-alert-success': 'usa-alert usa-alert--success usa-alert--no-icon',
15
+ 'formio-modal-cancel-button': 'usa-button usa-button--secondary',
16
+ 'formio-modal-confirm-button': 'usa-button',
17
+ 'form-control ui fluid selection dropdown': 'usa-select maxw-full',
7
18
  };
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ transform(type: any, text: any): any;
2
3
  address: {
3
4
  form: string;
4
5
  };
@@ -168,6 +169,17 @@ declare const _default: {
168
169
  'formio-tab-panel-active': string;
169
170
  'formio-tab-link-active': string;
170
171
  'formio-tab-link-container-active': string;
172
+ 'sr-only': string;
173
+ 'formio-form-error': string;
174
+ 'formio-label-error': string;
175
+ 'formio-input-success': string;
176
+ 'formio-input-error': string;
177
+ 'formio-modal-save': string;
178
+ 'formio-alert-danger': string;
179
+ 'formio-alert-success': string;
180
+ 'formio-modal-cancel-button': string;
181
+ 'formio-modal-confirm-button': string;
182
+ 'form-control ui fluid selection dropdown': string;
171
183
  };
172
184
  };
173
185
  export default _default;
@@ -54,6 +54,16 @@ var wizardNav_1 = require("./wizardNav");
54
54
  var size_1 = require("./size");
55
55
  var cssClasses_1 = require("./cssClasses");
56
56
  exports.default = {
57
+ transform: function (type, text) {
58
+ if (!text) {
59
+ return text;
60
+ }
61
+ switch (type) {
62
+ case 'class':
63
+ return this.cssClasses.hasOwnProperty(text.toString()) ? this.cssClasses[text.toString()] : text;
64
+ }
65
+ return text;
66
+ },
57
67
  address: address_1.default,
58
68
  alert: alert_1.default,
59
69
  builder: builder_1.default,
@@ -90,8 +90,18 @@ __p += '\n';
90
90
  __p += '\n</div>\n';
91
91
  } ;
92
92
  __p += '\n';
93
+ if (ctx.component.showCharCount || ctx.component.showWordCount) { ;
94
+ __p += '\n<div class="' +
95
+ ((__t = (ctx.component.description ? 'pull-right' : 'text-right')) == null ? '' : __t) +
96
+ '">\n ';
93
97
  if (ctx.component.showCharCount) { ;
94
- __p += '\n<span aria-live="polite" class="text-base float-right" ref="charcount"></span>\n';
98
+ __p += '\n <span aria-live="polite" class="text-muted" ref="charcount"></span>\n ';
99
+ } ;
100
+ __p += '\n ';
101
+ if (ctx.component.showWordCount) { ;
102
+ __p += '\n <span aria-live="polite" class="text-muted" ref="wordcount"></span>\n ';
103
+ } ;
104
+ __p += '\n</div>\n';
95
105
  } ;
96
106
  __p += '\n';
97
107
  return __p
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  exports.default=function(ctx) {
5
5
  var __t, __p = '', __j = Array.prototype.join;
6
6
  function print() { __p += __j.call(arguments, '') }
7
- __p += '<fieldset\n class="usa-fieldset"\n ref="fieldset"\n aria-labelledby="l-' +
7
+ __p += '<fieldset\n class="usa-fieldset"\n ref="radioGroup"\n aria-labelledby="l-' +
8
8
  ((__t = (ctx.instance.id)) == null ? '' : __t) +
9
9
  '-' +
10
10
  ((__t = (ctx.component.key)) == null ? '' : __t) +
@@ -60,7 +60,7 @@ __p += '\n value="' +
60
60
  __p += '\n checked=true\n ';
61
61
  } ;
62
62
  __p += '\n id="' +
63
- ((__t = (ctx.instance.root?.id)) == null ? '' : __t) +
63
+ ((__t = (ctx.instance.root && ctx.instance.root.id)) == null ? '' : __t) +
64
64
  '-' +
65
65
  ((__t = (ctx.id)) == null ? '' : __t) +
66
66
  '-' +
@@ -72,7 +72,7 @@ __p += '\n id="' +
72
72
  '"\n >\n <label class="' +
73
73
  ((__t = (ctx.component.type === "selectboxes" ? "usa-checkbox__label" : "usa-radio__label")) == null ? '' : __t) +
74
74
  '" for="' +
75
- ((__t = (ctx.instance.root?.id)) == null ? '' : __t) +
75
+ ((__t = (ctx.instance.root && ctx.instance.root.id)) == null ? '' : __t) +
76
76
  '-' +
77
77
  ((__t = (ctx.id)) == null ? '' : __t) +
78
78
  '-' +
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  exports.default=function(ctx) {
5
5
  var __t, __p = '', __j = Array.prototype.join;
6
6
  function print() { __p += __j.call(arguments, '') }
7
- __p += '<div class="formio-usa-card">\n <ul role="navigation" class="usa-sidenav">\n ';
7
+ __p += '<div class="formio-usa-card">\n <ul role="tablist" class="usa-sidenav">\n ';
8
8
  ctx.component.components.forEach(function(tab, index) { ;
9
- __p += '\n <li class="usa-sidenav__item ' +
9
+ __p += '\n <li role="tab" class="usa-sidenav__item ' +
10
10
  ((__t = (ctx.currentTab === index ? 'usa-current' : '')) == null ? '' : __t) +
11
- ' border-top-0" role="presentation" ref="' +
11
+ ' border-top-0" ref="' +
12
12
  ((__t = (ctx.tabLikey)) == null ? '' : __t) +
13
13
  '">\n <a href="#' +
14
14
  ((__t = (tab.key)) == null ? '' : __t) +
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  exports.default=function(ctx) {
5
5
  var __t, __p = '', __j = Array.prototype.join;
6
6
  function print() { __p += __j.call(arguments, '') }
7
- __p += '<div class="usa-step-indicator usa-step-indicator--no-labels" aria-label="Wizard" id="' +
7
+ __p += '<div class="usa-step-indicator usa-step-indicator--no-labels" ref="' +
8
+ ((__t = ( ctx.wizardKey )) == null ? '' : __t) +
9
+ '-header" aria-label="Wizard" id="' +
8
10
  ((__t = ( ctx.wizardKey )) == null ? '' : __t) +
9
11
  '-header">\n <ol class="usa-step-indicator__segments" tabindex="0" aria-label="Progress bar, Step ' +
10
12
  ((__t = (ctx.currentPage + 1)) == null ? '' : __t) +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/uswds",
3
- "version": "2.3.9-rc.2",
3
+ "version": "2.4.0-rc.3",
4
4
  "description": "US Web Design System templates for form.io",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -34,21 +34,21 @@
34
34
  "@types/chai": "^4.2.22",
35
35
  "@types/ejs": "^3.1.0",
36
36
  "@types/mocha": "^9.0.0",
37
- "@types/node": "^16.9.4",
38
- "@types/sinon": "^10.0.3",
37
+ "@types/node": "^16.10.2",
38
+ "@types/sinon": "^10.0.4",
39
39
  "chai": "^4.3.4",
40
40
  "del": "^6.0.0",
41
- "formiojs": "^4.13.6",
41
+ "formiojs": "^4.14.0-rc.26",
42
42
  "gulp": "^4.0.2",
43
43
  "gulp-clean-css": "^4.3.0",
44
44
  "gulp-insert": "^0.5.0",
45
45
  "gulp-rename": "^2.0.0",
46
46
  "gulp-sass": "^5.0.0",
47
47
  "gulp-template": "^5.0.0",
48
- "mocha": "^9.1.1",
48
+ "mocha": "^9.1.2",
49
49
  "nyc": "^15.1.0",
50
50
  "pre-commit": "^1.2.2",
51
- "sass": "^1.42.0",
51
+ "sass": "^1.42.1",
52
52
  "sinon": "^11.1.2",
53
53
  "ts-node": "^10.2.1",
54
54
  "ts-sinon": "^2.0.2",