UNPKG

digitalmarketplace-frontend

Version:

Digital Marketplace Frontend contains assets and components used in Digital Marketplace projects

386 lines (385 loc) 30.5 kB
{ "component": "checkboxes-from-form", "fixtures": [ { "name": "default", "options": { "form": { "name": "example", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country" } ] } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n What is your nationality?\n </legend>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example\" name=\"example\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-2\" name=\"example\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-2\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-3\" name=\"example\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-3\">\n Citizen of another country\n </label>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "classes", "options": { "form": { "name": "example-classes", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country" } ] }, "classes": "app-checkboxes--custom-modifier" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n What is your nationality?\n </legend>\n <div class=\"govuk-checkboxes app-checkboxes--custom-modifier\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-classes\" name=\"example-classes\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-classes\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-classes-2\" name=\"example-classes\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-classes-2\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-classes-3\" name=\"example-classes\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-classes-3\">\n Citizen of another country\n </label>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "attributes", "options": { "form": { "name": "example-attributes", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country" } ] }, "attributes": { "hello": "there", "data-attribute": "Rex" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n What is your nationality?\n </legend>\n <div class=\"govuk-checkboxes\" hello=\"there\" data-attribute=\"Rex\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-attributes\" name=\"example-attributes\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-attributes\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-attributes-2\" name=\"example-attributes\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-attributes-2\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-attributes-3\" name=\"example-attributes\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-attributes-3\">\n Citizen of another country\n </label>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "with legend as page heading", "options": { "form": { "name": "example-inline", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country" } ] }, "fieldset": { "legend": { "classes": "govuk-fieldset__legend--l", "isPageHeading": true } } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--l\">\n <h1 class=\"govuk-fieldset__heading\">\n What is your nationality?\n </h1>\n </legend>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-inline\" name=\"example-inline\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-inline\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-inline-2\" name=\"example-inline\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-inline-2\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-inline-3\" name=\"example-inline\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-inline-3\">\n Citizen of another country\n </label>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "with hints on items", "options": { "form": { "name": "example-with-hint-on-item", "question": "How do you want to sign in?", "options": [ { "value": "british", "label": "British", "description": "Hint for british option here" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country", "description": "Hint for other option here" } ] } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n How do you want to sign in?\n </legend>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint-on-item\" name=\"example-with-hint-on-item\" type=\"checkbox\" value=\"british\" aria-describedby=\"input-example-with-hint-on-item-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint-on-item\">\n British\n </label>\n <div id=\"input-example-with-hint-on-item-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n Hint for british option here\n </div>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint-on-item-2\" name=\"example-with-hint-on-item\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint-on-item-2\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint-on-item-3\" name=\"example-with-hint-on-item\" type=\"checkbox\" value=\"other\" aria-describedby=\"input-example-with-hint-on-item-3-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint-on-item-3\">\n Citizen of another country\n </label>\n <div id=\"input-example-with-hint-on-item-3-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n Hint for other option here\n </div>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "with hint", "options": { "form": { "name": "example-with-hint", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country" } ], "hint": "This would be who you have a passport for" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"input-example-with-hint-hint\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n What is your nationality?\n </legend>\n <div id=\"input-example-with-hint-hint\" class=\"govuk-hint\">\n This would be who you have a passport for\n </div>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint\" name=\"example-with-hint\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint-2\" name=\"example-with-hint\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint-2\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint-3\" name=\"example-with-hint\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint-3\">\n Citizen of another country\n </label>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "with custom hint", "options": { "form": { "name": "example-with-hint", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country" } ], "hint": "This would be who you have a passport for" }, "hint": { "html": "<p>I am a custom hint</p>" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"input-example-with-hint-hint\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n What is your nationality?\n </legend>\n <div id=\"input-example-with-hint-hint\" class=\"govuk-hint\">\n <p>I am a custom hint</p>\n </div>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint\" name=\"example-with-hint\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint-2\" name=\"example-with-hint\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint-2\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint-3\" name=\"example-with-hint\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint-3\">\n Citizen of another country\n </label>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "with error message", "options": { "form": { "name": "example-with-error", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country" } ], "errors": [ "Please select at least one option" ] } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group govuk-form-group--error\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"input-example-with-error-error\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n What is your nationality?\n </legend>\n <p id=\"input-example-with-error-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please select at least one option\n </p>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-error\" name=\"example-with-error\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-error\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-error-2\" name=\"example-with-error\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-error-2\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-error-3\" name=\"example-with-error\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-error-3\">\n Citizen of another country\n </label>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "with hint and error message", "options": { "form": { "name": "example-with-hint-and-error", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country" } ], "hint": "This would be who you have a passport for", "errors": [ "Please select an option" ] } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group govuk-form-group--error\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"input-example-with-hint-and-error-hint input-example-with-hint-and-error-error\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n What is your nationality?\n </legend>\n <div id=\"input-example-with-hint-and-error-hint\" class=\"govuk-hint\">\n This would be who you have a passport for\n </div>\n <p id=\"input-example-with-hint-and-error-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please select an option\n </p>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint-and-error\" name=\"example-with-hint-and-error\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint-and-error\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint-and-error-2\" name=\"example-with-hint-and-error\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint-and-error-2\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-hint-and-error-3\" name=\"example-with-hint-and-error\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-hint-and-error-3\">\n Citizen of another country\n </label>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "with checked item", "options": { "form": { "name": "example-with-checked-itemd", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country" } ], "data": [ "british", "irish" ] } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n What is your nationality?\n </legend>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-checked-itemd\" name=\"example-with-checked-itemd\" type=\"checkbox\" value=\"british\" checked>\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-checked-itemd\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-checked-itemd-2\" name=\"example-with-checked-itemd\" type=\"checkbox\" value=\"irish\" checked>\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-checked-itemd-2\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-checked-itemd-3\" name=\"example-with-checked-itemd\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-checked-itemd-3\">\n Citizen of another country\n </label>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "with overwritten items", "options": { "form": { "name": "example-with-overwritten-items", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British" }, { "value": "irish", "label": "Irish" }, { "value": "other", "label": "Citizen of another country" } ] }, "items": [ { "value": "other", "text": "Citizen of another country" }, { "value": "british", "text": "British" }, { "value": "irish", "text": "Irish" } ] }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n What is your nationality?\n </legend>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-overwritten-items\" name=\"example-with-overwritten-items\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-overwritten-items\">\n Citizen of another country\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-overwritten-items-2\" name=\"example-with-overwritten-items\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-overwritten-items-2\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-with-overwritten-items-3\" name=\"example-with-overwritten-items\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-with-overwritten-items-3\">\n Irish\n </label>\n </div>\n </div>\n</fieldset>\n</div>" }, { "name": "with additionl item attributes", "options": { "form": { "name": "example", "question": "What is your nationality?", "options": [ { "value": "british", "label": "British", "id": "value-for-british", "attributes": { "data-test": "attribute for british" }, "behaviour": "exclusive" }, { "value": "irish", "label": "Irish", "id": "value-for-irish", "conditional": { "html": "Is that so" } }, { "divider": "or" }, { "value": "other", "label": "Citizen of another country", "disabled": true } ] } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n What is your nationality?\n </legend>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"value-for-british\" name=\"example\" type=\"checkbox\" value=\"british\" data-behaviour=\"exclusive\" data-test=\"attribute for british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"value-for-british\">\n British\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"value-for-irish\" name=\"example\" type=\"checkbox\" value=\"irish\" data-aria-controls=\"conditional-value-for-irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"value-for-irish\">\n Irish\n </label>\n </div>\n <div class=\"govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden\" id=\"conditional-value-for-irish\">\n Is that so\n </div>\n <div class=\"govuk-checkboxes__divider\">or</div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"input-example-4\" name=\"example\" type=\"checkbox\" value=\"other\" disabled>\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"input-example-4\">\n Citizen of another country\n </label>\n </div>\n </div>\n</fieldset>\n</div>" } ] }