Skip to content

Commit

Permalink
Merge branch 'main' into refactor-summary-component-to-remove-extra-d…
Browse files Browse the repository at this point in the history
…iv-in-dl
  • Loading branch information
rmccar authored Oct 29, 2024
2 parents 5e2d10c + 25dcf1b commit 5c06975
Show file tree
Hide file tree
Showing 20 changed files with 239 additions and 24 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/components/autosuggest/autosuggest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,8 @@ describe('script: autosuggest', () => {
expect(resultsItemCount).toBe(1);
const warningText = await page.$eval('.ons-autosuggest__warning', (node) => node.textContent);
expect(warningText.trim()).toBe('!Sorry, there is a problem.');
const warningContainer = await page.$eval('.ons-autosuggest__warning', (node) => node.id);
expect(warningContainer).toBe('country-of-birth-listbox');
});

it('the list and results element should be removed from the page', async () => {
Expand Down Expand Up @@ -657,7 +659,7 @@ describe('script: autosuggest', () => {
await page.type('.ons-js-autosuggest-input', 'England', { delay: 20 });
await page.keyboard.press('ArrowUp');
await page.keyboard.press('Enter');
// Defocus the autosuggest input.
// Unfocus the autosuggest input
await page.keyboard.press('Tab');
await page.focus('.ons-js-autosuggest-input');

Expand Down
1 change: 1 addition & 0 deletions src/components/autosuggest/autosuggest.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ export default class AutosuggestUI {
const warningSpanElement = document.createElement('span');
const warningBodyElement = document.createElement('div');

warningContainer.id = this.listbox.getAttribute('id');
warningContainer.className = 'ons-autosuggest__warning';
warningElement.className = 'ons-panel ons-panel--warn ons-autosuggest__panel';

Expand Down
20 changes: 20 additions & 0 deletions src/components/checkboxes/_checkbox-macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@
"radios": params.other.radios
})
}}
{% elif otherType == "textarea" %}
{% from "components/textarea/_macro.njk" import onsTextarea %}
{{
onsTextarea({
"id": params.other.id,
"name": params.other.name,
"value": params.other.value,
"label": {
"id": params.other.id + "-label",
"text": params.other.label.text,
"description": params.other.label.description,
"classes": 'ons-u-fw-n'
},
"charCheckLimit": {
"limit": params.other.charCheckLimit.limit,
"charCountSingular": params.other.charCheckLimit.charCountSingular,
"charCountPlural": params.other.charCheckLimit.charCountPlural
}
})
}}
{% endif %}
</span>
{% endif %}
Expand Down
28 changes: 14 additions & 14 deletions src/components/checkboxes/_macro-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@

## Checkbox

| Name | Type | Required | Description |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id | string | true | The HTML `id` of the checkbox. Used for the label’s `for` attribute. |
| name | string | false | The HTML `name` attribute for the checkbox |
| value | string | false | The HTML `value` attribute for the checkbox to set a preset value for the input |
| classes | string | false | Classes to add to the checkbox |
| inputClasses | string | false | Classes to apply to the checkbox input |
| checked | boolean | false | Set to “true” to check the checkbox when the page loads |
| disabled | boolean | false | Sets checkbox state to disabled and changes style of checkbox and label |
| label | `Label` [_(ref)_](/components/label) | true | Settings for the checkbox label |
| hideLabel | boolean | false | Adds visually hidden class to the label if `true` |
| other | object`<OtherCheckbox>` with arrays if using `Select` [_(ref)_](/components/select), `Checkboxes` [_(ref)_](/components/checkboxes) or `Radios` [_(ref)_](/components/radios) | false | Settings for a nested [input](/components/input), [select](/components/select), [checkboxes](/components/checkboxes) or [radios](/components/radios) to provide [other information](#othercheckbox) in addition to the checkbox answer. Defaults to use input. |
| attributes | object | false | HTML attributes (for example, data attributes) to add to the checkbox input element |
| deselectMessage | string | false | For use with mutually exclusive checkboxes. The text the `aria-live` alert will read to warn that selecting the exclusive option will clear all other inputs. |
| Name | Type | Required | Description |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id | string | true | The HTML `id` of the checkbox. Used for the label’s `for` attribute. |
| name | string | false | The HTML `name` attribute for the checkbox |
| value | string | false | The HTML `value` attribute for the checkbox to set a preset value for the input |
| classes | string | false | Classes to add to the checkbox |
| inputClasses | string | false | Classes to apply to the checkbox input |
| checked | boolean | false | Set to “true” to check the checkbox when the page loads |
| disabled | boolean | false | Sets checkbox state to disabled and changes style of checkbox and label |
| label | `Label` [_(ref)_](/components/label) | true | Settings for the checkbox label |
| hideLabel | boolean | false | Adds visually hidden class to the label if `true` |
| other | object`<OtherCheckbox>` with arrays if using `Select` [_(ref)_](/components/select), `Checkboxes` [_(ref)_](/components/checkboxes) or `Radios` [_(ref)_](/components/radios) | false | Settings for a nested [input](/components/input), [select](/components/select), [checkboxes](/components/checkboxes) or [radios](/components/radios) to provide [other information](#othercheckbox) in addition to the checkbox answer or [textarea](/components/text-area) to provide additional information on selection. Defaults to use input. |
| attributes | object | false | HTML attributes (for example, data attributes) to add to the checkbox input element |
| deselectMessage | string | false | For use with mutually exclusive checkboxes. The text the `aria-live` alert will read to warn that selecting the exclusive option will clear all other inputs. |

## OtherCheckbox

Expand Down
5 changes: 5 additions & 0 deletions src/components/checkboxes/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
"label": {
"text": checkbox.other.label.text
},
"charCheckLimit": {
"limit": checkbox.other.charCheckLimit.limit,
"charCountSingular": checkbox.other.charCheckLimit.charCountSingular,
"charCountPlural": checkbox.other.charCheckLimit.charCountPlural
},
"legend": checkbox.other.legend,
"legendClasses": checkbox.other.legendClasses,
"value": checkbox.other.value,
Expand Down
Loading

0 comments on commit 5c06975

Please sign in to comment.