@abgov/jsonforms-components 1.41.0 → 1.41.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.
Files changed (2) hide show
  1. package/index.esm.js +48 -39
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -4431,23 +4431,17 @@ let _$7 = t => t,
4431
4431
  _t2$4,
4432
4432
  _t3$4,
4433
4433
  _t4$2;
4434
- styled.div(_t$7 || (_t$7 = _$7`
4435
- text-overflow: ellipsis;
4436
- overflow: hidden;
4437
- min-height: 43px;
4438
- box-sizing: border-box;
4439
- width: 100%;
4440
- padding: 8px;
4441
- padding-right: 8px;
4442
- border-radius: 4px;
4443
- border: 1px solid #666;
4444
- font-size: 18px;
4445
- font-weight: 400;
4446
- -webkit-appearance: none;
4447
- -moz-appearance: none;
4448
- appearance: none;
4434
+ const GoADropdownTextbox = styled.div(_t$7 || (_t$7 = _$7`
4435
+ border-radius: var(--goa-space-2xs);
4449
4436
  box-shadow: ${0};
4450
- `), p => p.isOpen ? `0 0 0 3px #feba35` : '');
4437
+ &:hover {
4438
+ cursor: pointer;
4439
+ }
4440
+
4441
+ .inputStyle {
4442
+ box-shadow: ${0};
4443
+ }
4444
+ `), p => p.isOpen ? `0 0 0 3px var(--goa-color-interactive-focus)` : '', p => p.isOpen ? `0 0 0 3px var(--goa-color-interactive-focus) !important` : '');
4451
4445
  const GoADropdownListContainerWrapper = styled.div(_t2$4 || (_t2$4 = _$7`
4452
4446
  position: relative;
4453
4447
  display: ${0};
@@ -4681,27 +4675,27 @@ const Dropdown = props => {
4681
4675
  };
4682
4676
  return jsxs("div", {
4683
4677
  "data-testid": id,
4684
- children: [jsx(GoAInput, {
4685
- onTrailingIconClick: () => {
4686
- setIsOpen(!isOpen);
4687
- },
4688
- disabled: !enabled,
4689
- name: `dropdown-${label}`,
4690
- width: "100%",
4691
- value: inputText,
4692
- testId: `${id}-input`,
4693
- id: `${id}-input`,
4694
- readonly: !isAutoCompletion,
4695
- onChange: (name, value) => {
4696
- if (isAutoCompletion) {
4697
- setInputText(value);
4698
- const selectedItems = props.items.filter(item => {
4699
- return item.label.includes(value);
4700
- });
4701
- setItems(selectedItems);
4702
- }
4703
- },
4704
- trailingIcon: trailingIcon
4678
+ children: [jsx(GoADropdownTextbox, {
4679
+ isOpen: isOpen,
4680
+ children: jsx(GoAInput, {
4681
+ disabled: !enabled,
4682
+ name: `dropdown-${label}`,
4683
+ width: "100%",
4684
+ value: inputText,
4685
+ testId: `${id}-input`,
4686
+ id: `${id}-input`,
4687
+ readonly: !isAutoCompletion,
4688
+ onChange: (name, value) => {
4689
+ if (isAutoCompletion) {
4690
+ setInputText(value);
4691
+ const selectedItems = props.items.filter(item => {
4692
+ return item.label.includes(value);
4693
+ });
4694
+ setItems(selectedItems);
4695
+ }
4696
+ },
4697
+ trailingIcon: trailingIcon
4698
+ })
4705
4699
  }), jsx(GoADropdownListContainerWrapper, {
4706
4700
  isOpen: isOpen,
4707
4701
  id: `${PREFIX}-dropDownListContainerWrapper-${label}`,
@@ -5146,6 +5140,11 @@ const Anchor = styled.div(_t5$1 || (_t5$1 = _$5`
5146
5140
  text-decoration: underline;
5147
5141
  outline: none;
5148
5142
  cursor: pointer;
5143
+
5144
+ &:focus {
5145
+ outline: 2px solid #0070c4;
5146
+ background-color: #e6f7ff;
5147
+ }
5149
5148
  `));
5150
5149
  styled.div(_t6$1 || (_t6$1 = _$5`
5151
5150
  margin-left: var(--goa-space-m);
@@ -5739,8 +5738,15 @@ const FormStepper = props => {
5739
5738
  children: [jsx(ReviewItemTitle, {
5740
5739
  children: categoryLabel
5741
5740
  }), jsx(Anchor, {
5741
+ tabIndex: readOnly ? -1 : 0,
5742
5742
  onClick: () => setPage(index + 1),
5743
5743
  "data-testid": testId,
5744
+ onKeyDown: e => {
5745
+ if (!readOnly && (e.key === ' ' || e.key === 'Enter')) {
5746
+ e.preventDefault();
5747
+ setPage(index + 1);
5748
+ }
5749
+ },
5744
5750
  children: readOnly ? 'View' : 'Edit'
5745
5751
  })]
5746
5752
  }), jsx(GoAGrid, {
@@ -8112,7 +8118,7 @@ const AddressViews = ({
8112
8118
  data,
8113
8119
  isAlbertaAddress
8114
8120
  }) => {
8115
- var _a;
8121
+ var _a, _b, _c, _d;
8116
8122
  const provinces = [{
8117
8123
  value: 'AB',
8118
8124
  label: 'Alberta'
@@ -8158,6 +8164,7 @@ const AddressViews = ({
8158
8164
  minChildWidth: "0",
8159
8165
  gap: "s",
8160
8166
  children: [jsx(GoAFormItem, {
8167
+ error: ((_a = data === null || data === void 0 ? void 0 : data.addressLine1) === null || _a === void 0 ? void 0 : _a.length) === 0 ? 'addressLine1 is required' : '',
8161
8168
  label: `${isAlbertaAddress ? 'Alberta p' : 'P'}ostal address`,
8162
8169
  children: jsx("p", {
8163
8170
  children: data === null || data === void 0 ? void 0 : data.addressLine1
@@ -8172,11 +8179,13 @@ const AddressViews = ({
8172
8179
  minChildWidth: "0ch",
8173
8180
  gap: "s",
8174
8181
  children: [jsx(GoAFormItem, {
8182
+ error: ((_b = data === null || data === void 0 ? void 0 : data.municipality) === null || _b === void 0 ? void 0 : _b.length) === 0 ? 'city is required' : '',
8175
8183
  label: "City",
8176
8184
  children: jsx("p", {
8177
8185
  children: data === null || data === void 0 ? void 0 : data.city
8178
8186
  })
8179
8187
  }), jsx(GoAFormItem, {
8188
+ error: ((_c = data === null || data === void 0 ? void 0 : data.postalCode) === null || _c === void 0 ? void 0 : _c.length) === 0 ? 'postalCode is required' : '',
8180
8189
  label: "Postal Code",
8181
8190
  children: jsx("p", {
8182
8191
  children: data === null || data === void 0 ? void 0 : data.postalCode
@@ -8192,7 +8201,7 @@ const AddressViews = ({
8192
8201
  children: "Alberta"
8193
8202
  }), !isAlbertaAddress && jsx("div", {
8194
8203
  "data-testid": "address-form-province-view",
8195
- children: (_a = provinces.find(p => p.value === (data === null || data === void 0 ? void 0 : data.province))) === null || _a === void 0 ? void 0 : _a.label
8204
+ children: (_d = provinces.find(p => p.value === (data === null || data === void 0 ? void 0 : data.province))) === null || _d === void 0 ? void 0 : _d.label
8196
8205
  })]
8197
8206
  }), jsx(GoAFormItem, {
8198
8207
  label: "Country",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.41.0",
3
+ "version": "1.41.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
6
6
  "repository": "https://github.com/GovAlta/adsp-monorepo",