UNPKG

digitalmarketplace-frontend

Version:

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

197 lines (196 loc) 10.9 kB
{ "component": "question-text", "fixtures": [ { "name": "default", "options": { "question": { "id": "example", "question": "Here is the service question" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question\n </label>\n <input class=\"govuk-input\" id=\"input-example\" name=\"example\" type=\"text\">\n</div>" }, { "name": "with hint", "options": { "question": { "id": "example", "question": "Here is the service question", "hint": "This is a hint for the question" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question\n </label>\n <div id=\"input-example-hint\" class=\"govuk-hint\">\n This is a hint for the question\n </div>\n <input class=\"govuk-input\" id=\"input-example\" name=\"example\" type=\"text\" aria-describedby=\"input-example-hint\">\n</div>" }, { "name": "with question advice", "options": { "question": { "id": "example", "question": "Here is the service question", "question_advice": "Here is the question advice" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question\n </label>\n <div id=\"input-example-hint\" class=\"govuk-hint\">\n <div class=\"govuk-body\">\n Here is the question advice\n </div>\n </div>\n <input class=\"govuk-input\" id=\"input-example\" name=\"example\" type=\"text\" aria-describedby=\"input-example-hint\">\n</div>" }, { "name": "with question advice and hint", "options": { "question": { "id": "example", "question": "Here is the service question", "question_advice": "<p class=\"govuk-body-l\">Here is the question advice</p>\n", "hint": "<div class=\"hint-in-html\">This is a hint for the question</div>\n" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question\n </label>\n <div id=\"input-example-hint\" class=\"govuk-hint\">\n <div class=\"govuk-body\">\n <p class=\"govuk-body-l\">Here is the question advice</p>\n \n </div>\n <div class=\"hint-in-html\">This is a hint for the question</div>\n </div>\n <input class=\"govuk-input\" id=\"input-example\" name=\"example\" type=\"text\" aria-describedby=\"input-example-hint\">\n</div>" }, { "name": "with optional", "options": { "question": { "id": "example", "question": "Here is the service question", "optional": true } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question (optional)\n </label>\n <input class=\"govuk-input\" id=\"input-example\" name=\"example\" type=\"text\">\n</div>" }, { "name": "with optional text", "options": { "question": { "id": "example", "question": "Here is the service question", "optional": true, "optional_text": "if applicable" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question (if applicable)\n </label>\n <input class=\"govuk-input\" id=\"input-example\" name=\"example\" type=\"text\">\n</div>" }, { "name": "with data", "options": { "question": { "id": "example", "question": "Here is the service question" }, "data": { "example": "Here is the value" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question\n </label>\n <input class=\"govuk-input\" id=\"input-example\" name=\"example\" type=\"text\" value=\"Here is the value\">\n</div>" }, { "name": "with error message", "options": { "question": { "id": "example", "question": "Here is the service question" }, "errors": { "example": { "message": "You must enter into the text field" } } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group govuk-form-group--error\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question\n </label>\n <p id=\"input-example-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> You must enter into the text field\n </p>\n <input class=\"govuk-input govuk-input--error\" id=\"input-example\" name=\"example\" type=\"text\" aria-describedby=\"input-example-error\">\n</div>" }, { "name": "with hint and error message", "options": { "question": { "id": "example", "question": "Here is the service question", "hint": "This is a hint for the question" }, "errors": { "example": { "message": "You must enter into the text field" } } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group govuk-form-group--error\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question\n </label>\n <div id=\"input-example-hint\" class=\"govuk-hint\">\n This is a hint for the question\n </div>\n <p id=\"input-example-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> You must enter into the text field\n </p>\n <input class=\"govuk-input govuk-input--error\" id=\"input-example\" name=\"example\" type=\"text\" aria-describedby=\"input-example-hint input-example-error\">\n</div>" }, { "name": "with previous framework", "options": { "question": { "id": "example", "question": "Here is the service question" }, "data": { "example": "Here is the value" }, "frameworkReusedFrom": "G-Cloud 12" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group govuk-form-group--error dm-form-group--declaration-reuse\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question\n </label>\n <p id=\"input-example-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Notice:</span> This answer is from your G-Cloud 12 declaration\n </p>\n <input class=\"govuk-input govuk-input--error\" id=\"input-example\" name=\"example\" type=\"text\" value=\"Here is the value\" aria-describedby=\"input-example-error\">\n</div>" }, { "name": "with previous framework without data", "options": { "question": { "id": "example", "question": "Here is the service question" }, "frameworkReusedFrom": "G-Cloud 12" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question\n </label>\n <input class=\"govuk-input\" id=\"input-example\" name=\"example\" type=\"text\">\n</div>" }, { "name": "with previous framework and error message", "options": { "question": { "id": "example", "question": "Here is the service question" }, "data": { "example": "Here is the value" }, "errors": { "example": { "message": "You must enter into the text field" } }, "frameworkReusedFrom": "G-Cloud 12" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "<div class=\"govuk-form-group govuk-form-group--error\">\n <label class=\"govuk-label govuk-label--m\" for=\"input-example\">\n Here is the service question\n </label>\n <p id=\"input-example-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> You must enter into the text field\n </p>\n <input class=\"govuk-input govuk-input--error\" id=\"input-example\" name=\"example\" type=\"text\" value=\"Here is the value\" aria-describedby=\"input-example-error\">\n</div>" } ] }