govuk_publishing_components 55.0.1 → 55.1.0
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/file-upload.js +5 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +5 -2
- data/app/views/govuk_publishing_components/components/_file_upload.html.erb +13 -1
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/docs/file_upload.yml +6 -0
- data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +313 -47
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +312 -47
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.mjs +2 -1
- data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +21 -16
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +3 -0
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/{govuk-frontend-component.mjs → component.mjs} +5 -5
- data/node_modules/govuk-frontend/dist/govuk/component.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +27 -19
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +27 -19
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +27 -19
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +27 -19
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +2 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +28 -20
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +28 -20
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +16 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template.njk +5 -4
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +8 -5
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +8 -5
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +27 -19
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +27 -19
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +27 -19
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +27 -19
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +167 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +754 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +746 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +267 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +207 -16
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +52 -3
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-direct-media-capture.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-image-files-only.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-multiple-files.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-disabled.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-disabled.html +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-with-error-message-and-hint.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-translated.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +42 -5
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +14 -10
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +8 -5
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +8 -5
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +25 -12
- data/node_modules/govuk-frontend/dist/govuk/components/input/fixtures.json +16 -2
- data/node_modules/govuk-frontend/dist/govuk/components/input/macro-options.json +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-default.html +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/input/template.njk +5 -4
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +27 -19
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +27 -19
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/fixtures.json +16 -2
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro-options.json +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +27 -20
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +27 -20
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +1 -2
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-default.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template.njk +4 -2
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +8 -5
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +8 -5
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/fixtures.json +16 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/macro-options.json +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-id.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template.njk +6 -4
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +8 -5
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +8 -5
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +9 -6
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +9 -6
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +12 -21
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json +142 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-extreme.html +106 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +8 -5
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +8 -5
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/fixtures.json +15 -1
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro-options.json +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template.njk +6 -4
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/init.mjs +11 -11
- data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +18 -5
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss.map +1 -1
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
- data/node_modules/govuk-frontend/package.json +7 -7
- metadata +21 -5
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-value.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"skip-link.bundle.mjs","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/govuk-frontend-component.mjs","../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Get hash fragment from URL\n *\n * Extract the hash fragment (everything after the hash) from a URL,\n * but not including the hash symbol\n *\n * @private\n * @param {string} url - URL\n * @returns {string | undefined} Fragment from URL, without the hash\n */\nexport function getFragmentFromUrl(url) {\n if (!url.includes('#')) {\n return undefined\n }\n\n return url.split('#').pop()\n}\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-frontend-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if component is already initialised\n *\n * @internal\n * @param {Element} $root - HTML element to be checked\n * @param {string} moduleName - name of component module\n * @returns {boolean} Whether component is already initialised\n */\nexport function isInitialised($root, moduleName) {\n return (\n $root instanceof HTMLElement &&\n $root.hasAttribute(`data-${moduleName}-init`)\n )\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an object\n */\nexport function isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Format error message\n *\n * @internal\n * @param {ComponentWithModuleName} Component - Component that threw the error\n * @param {string} message - Error message\n * @returns {string} - Formatted error message\n */\nexport function formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`\n}\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\n/* eslint-enable jsdoc/valid-types */\n","import { formatErrorMessage } from '../common/index.mjs'\n\n/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @virtual\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n super(\n $scope\n ? supportMessage\n : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n )\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (typeof messageOrOptions === 'object') {\n const { component, identifier, element, expectedType } = messageOrOptions\n\n message = identifier\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n\n message = formatErrorMessage(component, message)\n }\n\n super(message)\n }\n}\n\n/**\n * Indicates that a component is already initialised\n */\nexport class InitError extends GOVUKFrontendError {\n name = 'InitError'\n\n /**\n * @internal\n * @param {ComponentWithModuleName | string} componentOrMessage - name of the component module\n */\n constructor(componentOrMessage) {\n const message =\n typeof componentOrMessage === 'string'\n ? componentOrMessage\n : formatErrorMessage(\n componentOrMessage,\n `Root element (\\`$root\\`) already initialised`\n )\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {Element | null} [element] - The element in error\n * @property {string} [expectedType] - The type that was expected for the identifier\n * @property {ComponentWithModuleName} component - Component throwing the error\n */\n\n/**\n * @typedef {import('../common/index.mjs').ComponentWithModuleName} ComponentWithModuleName\n */\n","import { isInitialised, isSupported } from './common/index.mjs'\nimport { ElementError, InitError, SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @virtual\n * @template {Element} [RootElementType=HTMLElement]\n */\nexport class GOVUKFrontendComponent {\n /**\n * @type {typeof Element}\n */\n static elementType = HTMLElement\n\n // allows Typescript user to work around the lack of types\n // in GOVUKFrontend package, Typescript is not aware of $root\n // in components that extend GOVUKFrontendComponent\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root\n }\n\n /**\n * @protected\n * @type {RootElementType}\n */\n _$root\n\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n * @param {Element | null} [$root] - HTML element to use for component\n */\n constructor($root) {\n const childConstructor = /** @type {ChildClassConstructor} */ (\n this.constructor\n )\n\n // TypeScript does not enforce that inheriting classes will define a `moduleName`\n // (even if we add a `@virtual` `static moduleName` property to this class).\n // While we trust users to do this correctly, we do a little check to provide them\n // a helpful error message.\n //\n // After this, we'll be sure that `childConstructor` has a `moduleName`\n // as expected of the `ChildClassConstructor` we've cast `this.constructor` to.\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`)\n }\n\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n })\n } else {\n this._$root = /** @type {RootElementType} */ ($root)\n }\n\n childConstructor.checkSupport()\n\n this.checkInitialised()\n\n const moduleName = childConstructor.moduleName\n\n this.$root.setAttribute(`data-${moduleName}-init`, '')\n }\n\n /**\n * Validates whether component is already initialised\n *\n * @private\n * @throws {InitError} when component is already initialised\n */\n checkInitialised() {\n const constructor = /** @type {ChildClassConstructor} */ (this.constructor)\n const moduleName = constructor.moduleName\n\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor)\n }\n }\n\n /**\n * Validates whether components are supported\n *\n * @throws {SupportError} when the components are not supported\n */\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof GOVUKFrontendComponent & ChildClass} ChildClassConstructor\n */\n","import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { ElementError } from '../../errors/index.mjs'\nimport { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n * @augments GOVUKFrontendComponent<HTMLAnchorElement>\n */\nexport class SkipLink extends GOVUKFrontendComponent {\n static elementType = HTMLAnchorElement\n\n /**\n * @param {Element | null} $root - HTML element to use for skip link\n * @throws {ElementError} when $root is not set or the wrong type\n * @throws {ElementError} when $root.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($root) {\n super($root)\n\n const hash = this.$root.hash\n const href = this.$root.getAttribute('href') ?? ''\n\n /** @type {URL | undefined} */\n let url\n\n /**\n * Check for valid link URL\n *\n * {@link https://caniuse.com/url}\n * {@link https://url.spec.whatwg.org}\n *\n */\n try {\n url = new window.URL(this.$root.href)\n } catch (error) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) is invalid`\n )\n }\n\n // Return early for external URLs or links to other pages\n if (\n url.origin !== window.location.origin ||\n url.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = getFragmentFromUrl(hash)\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n component: SkipLink,\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$root.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["getFragmentFromUrl","url","includes","undefined","split","pop","setFocus","$element","options","_options$onBeforeFocu","isFocusable","getAttribute","setAttribute","onFocus","addEventListener","onBlur","once","_options$onBlur","call","removeAttribute","onBeforeFocus","focus","isInitialised","$root","moduleName","HTMLElement","hasAttribute","isSupported","$scope","document","body","classList","contains","formatErrorMessage","Component","message","GOVUKFrontendError","Error","constructor","args","name","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","GOVUKFrontendComponent","_$root","childConstructor","elementType","checkSupport","checkInitialised","SkipLink","_this$$root$getAttrib","hash","href","window","URL","error","origin","location","pathname","linkedElementId","$linkedElement","getElementById","add","remove","HTMLAnchorElement"],"mappings":"AAkBO,SAASA,kBAAkBA,CAACC,GAAG,EAAE;AACtC,EAAA,IAAI,CAACA,GAAG,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,IAAA,OAAOC,SAAS,CAAA;AAClB,GAAA;EAEA,OAAOF,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,EAAE,CAAA;AAC7B,CAAA;AAoCO,SAASC,QAAQA,CAACC,QAAQ,EAAEC,OAAO,GAAG,EAAE,EAAE;AAAA,EAAA,IAAAC,qBAAA,CAAA;AAC/C,EAAA,MAAMC,WAAW,GAAGH,QAAQ,CAACI,YAAY,CAAC,UAAU,CAAC,CAAA;EAErD,IAAI,CAACD,WAAW,EAAE;AAChBH,IAAAA,QAAQ,CAACK,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACzC,GAAA;EAKA,SAASC,OAAOA,GAAG;AACjBN,IAAAA,QAAQ,CAACO,gBAAgB,CAAC,MAAM,EAAEC,MAAM,EAAE;AAAEC,MAAAA,IAAI,EAAE,IAAA;AAAK,KAAC,CAAC,CAAA;AAC3D,GAAA;EAKA,SAASD,MAAMA,GAAG;AAAA,IAAA,IAAAE,eAAA,CAAA;IAChB,CAAAA,eAAA,GAAAT,OAAO,CAACO,MAAM,KAAdE,IAAAA,IAAAA,eAAA,CAAgBC,IAAI,CAACX,QAAQ,CAAC,CAAA;IAE9B,IAAI,CAACG,WAAW,EAAE;AAChBH,MAAAA,QAAQ,CAACY,eAAe,CAAC,UAAU,CAAC,CAAA;AACtC,KAAA;AACF,GAAA;AAGAZ,EAAAA,QAAQ,CAACO,gBAAgB,CAAC,OAAO,EAAED,OAAO,EAAE;AAAEG,IAAAA,IAAI,EAAE,IAAA;AAAK,GAAC,CAAC,CAAA;EAG3D,CAAAP,qBAAA,GAAAD,OAAO,CAACY,aAAa,KAArBX,IAAAA,IA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,MAAM,IAAIxB,YAAY,CACpB,CAAmCiB,gCAAAA,EAAAA,IAAI,2BACzC,CAAC,CAAA;AACH,KAAA;AAEA,IAAA,MAAMQ,cAAc,GAAGzC,QAAQ,CAAC0C,cAAc,CAACF,eAAe,CAAC,CAAA;IAG/D,IAAI,CAACC,cAAc,EAAE;MACnB,MAAM,IAAIzB,YAAY,CAAC;AACrBE,QAAAA,SAAS,EAAEY,QAAQ;AACnBV,QAAAA,OAAO,EAAEqB,cAAc;QACvBtB,UAAU,EAAE,yBAAyBqB,eAAe,CAAA,IAAA,CAAA;AACtD,OAAC,CAAC,CAAA;AACJ,KAAA;IAQA,IAAI,CAAC9C,KAAK,CAACT,gBAAgB,CAAC,OAAO,EAAE,MACnCR,QAAQ,CAACgE,cAAc,EAAE;AACvBlD,MAAAA,aAAaA,GAAG;AACdkD,QAAAA,cAAc,CAACvC,SAAS,CAACyC,GAAG,CAAC,iCAAiC,CAAC,CAAA;OAChE;AACDzD,MAAAA,MAAMA,GAAG;AACPuD,QAAAA,cAAc,CAACvC,SAAS,CAAC0C,MAAM,CAAC,iCAAiC,CAAC,CAAA;AACpE,OAAA;AACF,KAAC,CACH,CAAC,CAAA;AACH,GAAA;AAMF,CAAA;AAnFad,QAAQ,CACZH,WAAW,GAAGkB,iBAAiB,CAAA;AAD3Bf,QAAQ,CAkFZnC,UAAU,GAAG,iBAAiB;;;;"}
|
1
|
+
{"version":3,"file":"skip-link.bundle.mjs","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/component.mjs","../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Get hash fragment from URL\n *\n * Extract the hash fragment (everything after the hash) from a URL,\n * but not including the hash symbol\n *\n * @private\n * @param {string} url - URL\n * @returns {string | undefined} Fragment from URL, without the hash\n */\nexport function getFragmentFromUrl(url) {\n if (!url.includes('#')) {\n return undefined\n }\n\n return url.split('#').pop()\n}\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-frontend-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if component is already initialised\n *\n * @internal\n * @param {Element} $root - HTML element to be checked\n * @param {string} moduleName - name of component module\n * @returns {boolean} Whether component is already initialised\n */\nexport function isInitialised($root, moduleName) {\n return (\n $root instanceof HTMLElement &&\n $root.hasAttribute(`data-${moduleName}-init`)\n )\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @template {Partial<Record<keyof ObjectType, unknown>>} [ObjectType=ObjectNested]\n * @param {unknown | ObjectType} option - Option to check\n * @returns {option is ObjectType} Whether the option is an object\n */\nexport function isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Format error message\n *\n * @internal\n * @param {ComponentWithModuleName} Component - Component that threw the error\n * @param {string} message - Error message\n * @returns {string} - Formatted error message\n */\nexport function formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`\n}\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * @import { ObjectNested } from './configuration.mjs'\n */\n","import { formatErrorMessage } from '../common/index.mjs'\n\n/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @virtual\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n super(\n $scope\n ? supportMessage\n : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n )\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (typeof messageOrOptions === 'object') {\n const { component, identifier, element, expectedType } = messageOrOptions\n\n message = identifier\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n\n message = formatErrorMessage(component, message)\n }\n\n super(message)\n }\n}\n\n/**\n * Indicates that a component is already initialised\n */\nexport class InitError extends GOVUKFrontendError {\n name = 'InitError'\n\n /**\n * @internal\n * @param {ComponentWithModuleName | string} componentOrMessage - name of the component module\n */\n constructor(componentOrMessage) {\n const message =\n typeof componentOrMessage === 'string'\n ? componentOrMessage\n : formatErrorMessage(\n componentOrMessage,\n `Root element (\\`$root\\`) already initialised`\n )\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {Element | null} [element] - The element in error\n * @property {string} [expectedType] - The type that was expected for the identifier\n * @property {ComponentWithModuleName} component - Component throwing the error\n */\n\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n","import { isInitialised, isSupported } from './common/index.mjs'\nimport { ElementError, InitError, SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @virtual\n * @template {Element} [RootElementType=HTMLElement]\n */\nexport class Component {\n /**\n * @type {typeof Element}\n */\n static elementType = HTMLElement\n\n // allows Typescript user to work around the lack of types\n // in GOVUKFrontend package, Typescript is not aware of $root\n // in components that extend GOVUKFrontendComponent\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root\n }\n\n /**\n * @protected\n * @type {RootElementType}\n */\n _$root\n\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n * @param {Element | null} [$root] - HTML element to use for component\n */\n constructor($root) {\n const childConstructor = /** @type {ChildClassConstructor} */ (\n this.constructor\n )\n\n // TypeScript does not enforce that inheriting classes will define a `moduleName`\n // (even if we add a `@virtual` `static moduleName` property to this class).\n // While we trust users to do this correctly, we do a little check to provide them\n // a helpful error message.\n //\n // After this, we'll be sure that `childConstructor` has a `moduleName`\n // as expected of the `ChildClassConstructor` we've cast `this.constructor` to.\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`)\n }\n\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n })\n } else {\n this._$root = /** @type {RootElementType} */ ($root)\n }\n\n childConstructor.checkSupport()\n\n this.checkInitialised()\n\n const moduleName = childConstructor.moduleName\n\n this.$root.setAttribute(`data-${moduleName}-init`, '')\n }\n\n /**\n * Validates whether component is already initialised\n *\n * @private\n * @throws {InitError} when component is already initialised\n */\n checkInitialised() {\n const constructor = /** @type {ChildClassConstructor} */ (this.constructor)\n const moduleName = constructor.moduleName\n\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor)\n }\n }\n\n /**\n * Validates whether components are supported\n *\n * @throws {SupportError} when the components are not supported\n */\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\n","import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n * @augments Component<HTMLAnchorElement>\n */\nexport class SkipLink extends Component {\n static elementType = HTMLAnchorElement\n\n /**\n * @param {Element | null} $root - HTML element to use for skip link\n * @throws {ElementError} when $root is not set or the wrong type\n * @throws {ElementError} when $root.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($root) {\n super($root)\n\n const hash = this.$root.hash\n const href = this.$root.getAttribute('href') ?? ''\n\n /** @type {URL | undefined} */\n let url\n\n /**\n * Check for valid link URL\n *\n * {@link https://caniuse.com/url}\n * {@link https://url.spec.whatwg.org}\n *\n */\n try {\n url = new window.URL(this.$root.href)\n } catch (error) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) is invalid`\n )\n }\n\n // Return early for external URLs or links to other pages\n if (\n url.origin !== window.location.origin ||\n url.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = getFragmentFromUrl(hash)\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n component: SkipLink,\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$root.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["getFragmentFromUrl","url","includes","undefined","split","pop","setFocus","$element","options","_options$onBeforeFocu","isFocusable","getAttribute","setAttribute","onFocus","addEventListener","onBlur","once","_options$onBlur","call","removeAttribute","onBeforeFocus","focus","isInitialised","$root","moduleName","HTMLElement","hasAttribute","isSupported","$scope","document","body","classList","contains","formatErrorMessage","Component","message","GOVUKFrontendError","Error","constructor","args","name","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","_$root","childConstructor","elementType","checkSupport","checkInitialised","SkipLink","_this$$root$getAttrib","hash","href","window","URL","error","origin","location","pathname","linkedElementId","$linkedElement","getElementById","add","remove","HTMLAnchorElement"],"mappings":"AAkBO,SAASA,kBAAkBA,CAACC,GAAG,EAAE;AACtC,EAAA,IAAI,CAACA,GAAG,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,IAAA,OAAOC,SAAS,CAAA;AAClB,GAAA;EAEA,OAAOF,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,EAAE,CAAA;AAC7B,CAAA;AAoCO,SAASC,QAAQA,CAACC,QAAQ,EAAEC,OAAO,GAAG,EAAE,EAAE;AAAA,EAAA,IAAAC,qBAAA,CAAA;AAC/C,EAAA,MAAMC,WAAW,GAAGH,QAAQ,CAACI,YAAY,CAAC,UAAU,CAAC,CAAA;EAEr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vBjD,MAAAA,aAAaA,GAAG;AACdiD,QAAAA,cAAc,CAACtC,SAAS,CAACwC,GAAG,CAAC,iCAAiC,CAAC,CAAA;OAChE;AACDxD,MAAAA,MAAMA,GAAG;AACPsD,QAAAA,cAAc,CAACtC,SAAS,CAACyC,MAAM,CAAC,iCAAiC,CAAC,CAAA;AACpE,OAAA;AACF,KAAC,CACH,CAAC,CAAA;AACH,GAAA;AAMF,CAAA;AAnFad,QAAQ,CACZH,WAAW,GAAGkB,iBAAiB,CAAA;AAD3Bf,QAAQ,CAkFZlC,UAAU,GAAG,iBAAiB;;;;"}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { getFragmentFromUrl, setFocus } from '../../common/index.mjs';
|
2
|
+
import { Component } from '../../component.mjs';
|
2
3
|
import { ElementError } from '../../errors/index.mjs';
|
3
|
-
import { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs';
|
4
4
|
|
5
5
|
/**
|
6
6
|
* Skip link component
|
7
7
|
*
|
8
8
|
* @preserve
|
9
|
-
* @augments
|
9
|
+
* @augments Component<HTMLAnchorElement>
|
10
10
|
*/
|
11
|
-
class SkipLink extends
|
11
|
+
class SkipLink extends Component {
|
12
12
|
/**
|
13
13
|
* @param {Element | null} $root - HTML element to use for skip link
|
14
14
|
* @throws {ElementError} when $root is not set or the wrong type
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"skip-link.mjs","sources":["../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport {
|
1
|
+
{"version":3,"file":"skip-link.mjs","sources":["../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n * @augments Component<HTMLAnchorElement>\n */\nexport class SkipLink extends Component {\n static elementType = HTMLAnchorElement\n\n /**\n * @param {Element | null} $root - HTML element to use for skip link\n * @throws {ElementError} when $root is not set or the wrong type\n * @throws {ElementError} when $root.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($root) {\n super($root)\n\n const hash = this.$root.hash\n const href = this.$root.getAttribute('href') ?? ''\n\n /** @type {URL | undefined} */\n let url\n\n /**\n * Check for valid link URL\n *\n * {@link https://caniuse.com/url}\n * {@link https://url.spec.whatwg.org}\n *\n */\n try {\n url = new window.URL(this.$root.href)\n } catch (error) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) is invalid`\n )\n }\n\n // Return early for external URLs or links to other pages\n if (\n url.origin !== window.location.origin ||\n url.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = getFragmentFromUrl(hash)\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n component: SkipLink,\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$root.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["SkipLink","Component","constructor","$root","_this$$root$getAttrib","hash","href","getAttribute","url","window","URL","error","ElementError","origin","location","pathname","linkedElementId","getFragmentFromUrl","$linkedElement","document","getElementById","component","element","identifier","addEventListener","setFocus","onBeforeFocus","classList","add","onBlur","remove","elementType","HTMLAnchorElement","moduleName"],"mappings":";;;;AA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A,OAAO,EAAEJ,cAAc;QACvBK,UAAU,EAAE,yBAAyBP,eAAe,CAAA,IAAA,CAAA;AACtD,OAAC,CAAC,CAAA;AACJ,KAAA;IAQA,IAAI,CAACb,KAAK,CAACqB,gBAAgB,CAAC,OAAO,EAAE,MACnCC,QAAQ,CAACP,cAAc,EAAE;AACvBQ,MAAAA,aAAaA,GAAG;AACdR,QAAAA,cAAc,CAACS,SAAS,CAACC,GAAG,CAAC,iCAAiC,CAAC,CAAA;OAChE;AACDC,MAAAA,MAAMA,GAAG;AACPX,QAAAA,cAAc,CAACS,SAAS,CAACG,MAAM,CAAC,iCAAiC,CAAC,CAAA;AACpE,OAAA;AACF,KAAC,CACH,CAAC,CAAA;AACH,GAAA;AAMF,CAAA;AAnFa9B,QAAQ,CACZ+B,WAAW,GAAGC,iBAAiB,CAAA;AAD3BhC,QAAQ,CAkFZiC,UAAU,GAAG,iBAAiB;;;;"}
|
@@ -96,18 +96,21 @@
|
|
96
96
|
padding: 0; // Reset default user agent styles
|
97
97
|
}
|
98
98
|
|
99
|
-
.govuk-summary-list__actions-list-item
|
99
|
+
.govuk-summary-list__actions-list-item,
|
100
|
+
.govuk-summary-card__action {
|
100
101
|
display: inline-block;
|
101
102
|
}
|
102
103
|
|
103
104
|
@include govuk-media-query($until: tablet) {
|
104
|
-
.govuk-summary-list__actions-list-item
|
105
|
+
.govuk-summary-list__actions-list-item,
|
106
|
+
.govuk-summary-card__action {
|
105
107
|
margin-right: govuk-spacing(2);
|
106
108
|
padding-right: govuk-spacing(2);
|
107
109
|
border-right: 1px solid $govuk-border-colour;
|
108
110
|
}
|
109
111
|
|
110
|
-
.govuk-summary-list__actions-list-item:last-child
|
112
|
+
.govuk-summary-list__actions-list-item:last-child,
|
113
|
+
.govuk-summary-card__action:last-child {
|
111
114
|
margin-right: 0;
|
112
115
|
padding-right: 0;
|
113
116
|
border: 0;
|
@@ -115,16 +118,19 @@
|
|
115
118
|
}
|
116
119
|
|
117
120
|
@include govuk-media-query($from: tablet) {
|
118
|
-
.govuk-summary-list__actions-list-item
|
121
|
+
.govuk-summary-list__actions-list-item,
|
122
|
+
.govuk-summary-card__action {
|
119
123
|
margin-left: govuk-spacing(2);
|
120
124
|
padding-left: govuk-spacing(2);
|
121
125
|
}
|
122
126
|
|
123
|
-
.govuk-summary-list__actions-list-item:not(:first-child)
|
127
|
+
.govuk-summary-list__actions-list-item:not(:first-child),
|
128
|
+
.govuk-summary-card__action:not(:first-child) {
|
124
129
|
border-left: 1px solid $govuk-border-colour;
|
125
130
|
}
|
126
131
|
|
127
|
-
.govuk-summary-list__actions-list-item:first-child
|
132
|
+
.govuk-summary-list__actions-list-item:first-child,
|
133
|
+
.govuk-summary-card__action:first-child {
|
128
134
|
margin-left: 0;
|
129
135
|
padding-left: 0;
|
130
136
|
border: 0;
|
@@ -220,13 +226,6 @@
|
|
220
226
|
|
221
227
|
.govuk-summary-card__action {
|
222
228
|
display: inline;
|
223
|
-
margin: 0 govuk-spacing(2) 0 0;
|
224
|
-
padding-right: govuk-spacing(2);
|
225
|
-
border-right: 1px solid $govuk-border-colour;
|
226
|
-
|
227
|
-
@include govuk-media-query($from: "tablet") {
|
228
|
-
margin-right: 0;
|
229
|
-
}
|
230
229
|
|
231
230
|
// We use the following media query to target IE11 and 10 only to add margin
|
232
231
|
// between actions.
|
@@ -243,14 +242,6 @@
|
|
243
242
|
}
|
244
243
|
|
245
244
|
.govuk-summary-card__action:last-child {
|
246
|
-
margin: 0;
|
247
|
-
padding-right: 0;
|
248
|
-
border-right: none;
|
249
|
-
|
250
|
-
@include govuk-media-query($from: "tablet") {
|
251
|
-
padding-left: govuk-spacing(2);
|
252
|
-
}
|
253
|
-
|
254
245
|
// See above comment for why this is here
|
255
246
|
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
256
247
|
margin-bottom: 0;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/govuk/components/summary-list/_index.scss"],"names":[],"mappings":"AAAA;EACE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kCAAkC;EAClC;IACE;MACE,SAAS;IACX;;IAEA,4DAA4D;IAC5D;MACE;;;QAGE,sCAAsC;MACxC;IACF;EACF;;EAEA,4BAA4B;EAC5B;IACE,SAAS;;IAET,4DAA4D;IAC5D;MACE;;;QAGE,sCAAsC;MACxC;IACF;EACF;;EAEA,uCAAuC;EACvC;IACE,6CAA6C;IAC7C,sCAAsC;EACxC;;EAEA;IACE,yBAAyB;;IAEzB,wEAAwE;IACxE,cAAc;IACd,oCAAoC;IACpC,4CAA4C;;IAE5C;MACE,aAAa;MACb,8BAA8B;MAC9B,iBAAiB;MACjB,0CAA0C;IAC5C;EACF;;EAEA;IACE,6CAA6C;IAC7C,0BAA0B;IAC1B,4DAA4D;;IAE5D;MACE,+BAA+B;IACjC;EACF;;EAEA;IACE,mCAAmC;IACnC,qCAAqC;IACrC,aAAa;IACb,eAAe;IACf,aAAa;IACb,0BAA0B;IAC1B,UAAU;IACV,gBAAgB;;IAEhB;MACE,sBAAsB;MACtB,iBAAiB;IACnB;EACF;;EAEA;IACE,eAAe;IACf,8BAA8B;IAC9B,+BAA+B;IAC/B,4CAA4C;;IAE5C;MACE,eAAe;IACjB;;IAEA,2EAA2E;IAC3E,kBAAkB;IAClB,CAAC;IACD,2EAA2E;IAC3E,6EAA6E;IAC7E,yEAAyE;IACzE,CAAC;IACD,yGAAyG;IACzG,sDAAsD;IACtD;MACE,+BAA+B;IACjC;EACF;;EAEA;IACE,SAAS;IACT,gBAAgB;IAChB,kBAAkB;;IAElB;MACE,8BAA8B;IAChC;;IAEA,wCAAwC;IACxC;MACE,gBAAgB;IAClB;EACF;;EAEA;IACE,4CAA4C;;IAE5C;MACE,0CAA0C;IAC5C;;IAEA;MACE,gBAAgB;IAClB;;IAEA;MACE,gBAAgB;MAChB,mBAAmB;IACrB;EACF;AACF","file":"_index.scss","sourcesContent":["@include govuk-exports(\"govuk/component/summary-list\") {\n .govuk-summary-list {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n @include govuk-media-query($from: tablet) {\n display: table;\n width: 100%;\n table-layout: fixed; // Required to allow us to wrap words that overflow.\n border-collapse: collapse;\n }\n margin: 0; // Reset default user agent styles\n @include govuk-responsive-margin(6, \"bottom\");\n }\n\n .govuk-summary-list__row {\n border-bottom: 1px solid $govuk-border-colour;\n\n @include govuk-media-query($until: tablet) {\n margin-bottom: govuk-spacing(3);\n }\n @include govuk-media-query($from: tablet) {\n display: table-row;\n }\n }\n\n // Remove right padding from the last column in the row\n .govuk-summary-list__row:not(.govuk-summary-list__row--no-actions) > :last-child {\n padding-right: 0;\n }\n\n // Provide an empty 'cell' for rows that don't have actions – otherwise the\n // bottom border is not drawn for that part of the row in some browsers.\n .govuk-summary-list__row--no-actions {\n @include govuk-media-query($from: tablet) {\n &::after {\n content: \"\";\n display: table-cell;\n width: 20%;\n }\n }\n }\n\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n margin: 0; // Reset default user agent styles\n\n @include govuk-media-query($from: tablet) {\n display: table-cell;\n padding-top: govuk-spacing(2);\n padding-right: govuk-spacing(4);\n padding-bottom: govuk-spacing(2);\n }\n }\n\n .govuk-summary-list__actions {\n margin-bottom: govuk-spacing(3);\n @include govuk-media-query($from: tablet) {\n width: 20%;\n text-align: right;\n }\n }\n\n .govuk-summary-list__key,\n .govuk-summary-list__value {\n // Automatic wrapping for unbreakable text (e.g. URLs)\n word-wrap: break-word; // Fallback for older browsers only\n overflow-wrap: break-word;\n }\n\n .govuk-summary-list__key {\n margin-bottom: govuk-spacing(1);\n @include govuk-typography-weight-bold;\n @include govuk-media-query($from: tablet) {\n width: 30%;\n }\n }\n\n .govuk-summary-list__value {\n @include govuk-media-query($until: tablet) {\n margin-bottom: govuk-spacing(3);\n }\n }\n\n .govuk-summary-list__value > p {\n margin-bottom: govuk-spacing(2);\n }\n\n .govuk-summary-list__value > :last-child {\n margin-bottom: 0;\n }\n\n .govuk-summary-list__actions-list {\n width: 100%;\n margin: 0; // Reset default user agent styles\n padding: 0; // Reset default user agent styles\n }\n\n .govuk-summary-list__actions-list-item {\n display: inline-block;\n }\n\n @include govuk-media-query($until: tablet) {\n .govuk-summary-list__actions-list-item {\n margin-right: govuk-spacing(2);\n padding-right: govuk-spacing(2);\n border-right: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-list__actions-list-item:last-child {\n margin-right: 0;\n padding-right: 0;\n border: 0;\n }\n }\n\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__actions-list-item {\n margin-left: govuk-spacing(2);\n padding-left: govuk-spacing(2);\n }\n\n .govuk-summary-list__actions-list-item:not(:first-child) {\n border-left: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-list__actions-list-item:first-child {\n margin-left: 0;\n padding-left: 0;\n border: 0;\n }\n }\n\n // Large groups of action links may wrap onto multiple lines. Because the link\n // focus styles are applied outside of the link's bounding box, there are\n // situations where the focus style on a link can be overlapped by subsequent\n // links. We don't want this, so let's create a new stacking context on focus\n // so the link always appears to be 'on top'.\n .govuk-summary-list__actions-list-item .govuk-link:focus {\n isolation: isolate;\n }\n\n // No border on entire summary list\n .govuk-summary-list--no-border {\n .govuk-summary-list__row {\n border: 0;\n }\n\n // Increase padding by 1px to compensate for 'missing' border\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n padding-bottom: govuk-spacing(2) + 1px;\n }\n }\n }\n\n // No border on specific rows\n .govuk-summary-list__row--no-border {\n border: 0;\n\n // Increase padding by 1px to compensate for 'missing' border\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n padding-bottom: govuk-spacing(2) + 1px;\n }\n }\n }\n\n // Additional block for the summary card\n .govuk-summary-card {\n @include govuk-responsive-margin(6, \"bottom\");\n border: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-card__title-wrapper {\n padding: govuk-spacing(3);\n\n // Ensures the card header appears separate to the summary list in forced\n // colours mode\n border-bottom: 1px solid transparent;\n background-color: govuk-colour(\"light-grey\");\n\n @include govuk-media-query($from: \"tablet\") {\n display: flex;\n justify-content: space-between;\n flex-wrap: nowrap;\n padding: govuk-spacing(3) govuk-spacing(4);\n }\n }\n\n .govuk-summary-card__title {\n @include govuk-font($size: 19, $weight: bold);\n @include govuk-text-colour;\n margin: govuk-spacing(1) govuk-spacing(4) govuk-spacing(2) 0;\n\n @include govuk-media-query($from: \"tablet\") {\n margin-bottom: govuk-spacing(1);\n }\n }\n\n .govuk-summary-card__actions {\n @include govuk-font-size($size: 19);\n @include govuk-typography-weight-bold;\n display: flex;\n flex-wrap: wrap;\n row-gap: 10px;\n margin: govuk-spacing(1) 0;\n padding: 0;\n list-style: none;\n\n @include govuk-media-query($from: \"tablet\") {\n justify-content: right;\n text-align: right;\n }\n }\n\n .govuk-summary-card__action {\n display: inline;\n margin: 0 govuk-spacing(2) 0 0;\n padding-right: govuk-spacing(2);\n border-right: 1px solid $govuk-border-colour;\n\n @include govuk-media-query($from: \"tablet\") {\n margin-right: 0;\n }\n\n // We use the following media query to target IE11 and 10 only to add margin\n // between actions.\n //\n // We do this because we're using row-gap to create space between actions on\n // more evergreen browsers which IE doesn't support. @supports currently isn't\n // a viable solution, see https://github.com/w3c/csswg-drafts/issues/3559.\n //\n // Solution taken from https://stackoverflow.com/questions/11173106/apply-style-only-on-ie#answer-36448860\n // which also includes an explanation of why this works\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n margin-bottom: govuk-spacing(1);\n }\n }\n\n .govuk-summary-card__action:last-child {\n margin: 0;\n padding-right: 0;\n border-right: none;\n\n @include govuk-media-query($from: \"tablet\") {\n padding-left: govuk-spacing(2);\n }\n\n // See above comment for why this is here\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n margin-bottom: 0;\n }\n }\n\n .govuk-summary-card__content {\n padding: govuk-spacing(3) govuk-spacing(3) 0;\n\n @include govuk-media-query($from: \"tablet\") {\n padding: govuk-spacing(3) govuk-spacing(4);\n }\n\n .govuk-summary-list {\n margin-bottom: 0;\n }\n\n .govuk-summary-list__row:last-of-type {\n margin-bottom: 0;\n border-bottom: none;\n }\n }\n}\n"]}
|
1
|
+
{"version":3,"sources":["../../../../src/govuk/components/summary-list/_index.scss"],"names":[],"mappings":"AAAA;EACE;IACE,8BAA8B;IAC9B,0BAA0B;IAC1B;MACE,cAAc;MACd,WAAW;MACX,mBAAmB,EAAE,mDAAmD;MACxE,yBAAyB;IAC3B;IACA,SAAS,EAAE,iCAAiC;IAC5C,6CAA6C;EAC/C;;EAEA;IACE,6CAA6C;;IAE7C;MACE,+BAA+B;IACjC;IACA;MACE,kBAAkB;IACpB;EACF;;EAEA,sDAAsD;EACtD;IACE,gBAAgB;EAClB;;EAEA,0EAA0E;EAC1E,uEAAuE;EACvE;IACE;MACE;QACE,WAAW;QACX,mBAAmB;QACnB,UAAU;MACZ;IACF;EACF;;EAEA;;;IAGE,SAAS,EAAE,iCAAiC;;IAE5C;MACE,mBAAmB;MACnB,6BAA6B;MAC7B,+BAA+B;MAC/B,gCAAgC;IAClC;EACF;;EAEA;IACE,+BAA+B;IAC/B;MACE,UAAU;MACV,iBAAiB;IACnB;EACF;;EAEA;;IAEE,qDAAqD;IACrD,qBAAqB,EAAE,kCAAkC;IACzD,yBAAyB;EAC3B;;EAEA;IACE,+BAA+B;IAC/B,qCAAqC;IACrC;MACE,UAAU;IACZ;EACF;;EAEA;IACE;MACE,+BAA+B;IACjC;EACF;;EAEA;IACE,+BAA+B;EACjC;;EAEA;IACE,gBAAgB;EAClB;;EAEA;IACE,WAAW;IACX,SAAS,EAAE,iCAAiC;IAC5C,UAAU,EAAE,iCAAiC;EAC/C;;EAEA;;IAEE,qBAAqB;EACvB;;EAEA;IACE;;MAEE,8BAA8B;MAC9B,+BAA+B;MAC/B,4CAA4C;IAC9C;;IAEA;;MAEE,eAAe;MACf,gBAAgB;MAChB,SAAS;IACX;EACF;;EAEA;IACE;;MAEE,6BAA6B;MAC7B,8BAA8B;IAChC;;IAEA;;MAEE,2CAA2C;IAC7C;;IAEA;;MAEE,cAAc;MACd,eAAe;MACf,SAAS;IACX;EACF;;EAEA,6EAA6E;EAC7E,wEAAwE;EACxE,4EAA4E;EAC5E,4EAA4E;EAC5E,4CAA4C;EAC5C;IACE,kBAAkB;EACpB;;EAEA,kCAAkC;EAClC;IACE;MACE,SAAS;IACX;;IAEA,4DAA4D;IAC5D;MACE;;;QAGE,sCAAsC;MACxC;IACF;EACF;;EAEA,4BAA4B;EAC5B;IACE,SAAS;;IAET,4DAA4D;IAC5D;MACE;;;QAGE,sCAAsC;MACxC;IACF;EACF;;EAEA,uCAAuC;EACvC;IACE,6CAA6C;IAC7C,sCAAsC;EACxC;;EAEA;IACE,yBAAyB;;IAEzB,wEAAwE;IACxE,cAAc;IACd,oCAAoC;IACpC,4CAA4C;;IAE5C;MACE,aAAa;MACb,8BAA8B;MAC9B,iBAAiB;MACjB,0CAA0C;IAC5C;EACF;;EAEA;IACE,6CAA6C;IAC7C,0BAA0B;IAC1B,4DAA4D;;IAE5D;MACE,+BAA+B;IACjC;EACF;;EAEA;IACE,mCAAmC;IACnC,qCAAqC;IACrC,aAAa;IACb,eAAe;IACf,aAAa;IACb,0BAA0B;IAC1B,UAAU;IACV,gBAAgB;;IAEhB;MACE,sBAAsB;MACtB,iBAAiB;IACnB;EACF;;EAEA;IACE,eAAe;;IAEf,2EAA2E;IAC3E,kBAAkB;IAClB,CAAC;IACD,2EAA2E;IAC3E,6EAA6E;IAC7E,yEAAyE;IACzE,CAAC;IACD,yGAAyG;IACzG,sDAAsD;IACtD;MACE,+BAA+B;IACjC;EACF;;EAEA;IACE,wCAAwC;IACxC;MACE,gBAAgB;IAClB;EACF;;EAEA;IACE,4CAA4C;;IAE5C;MACE,0CAA0C;IAC5C;;IAEA;MACE,gBAAgB;IAClB;;IAEA;MACE,gBAAgB;MAChB,mBAAmB;IACrB;EACF;AACF","file":"_index.scss","sourcesContent":["@include govuk-exports(\"govuk/component/summary-list\") {\n .govuk-summary-list {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n @include govuk-media-query($from: tablet) {\n display: table;\n width: 100%;\n table-layout: fixed; // Required to allow us to wrap words that overflow.\n border-collapse: collapse;\n }\n margin: 0; // Reset default user agent styles\n @include govuk-responsive-margin(6, \"bottom\");\n }\n\n .govuk-summary-list__row {\n border-bottom: 1px solid $govuk-border-colour;\n\n @include govuk-media-query($until: tablet) {\n margin-bottom: govuk-spacing(3);\n }\n @include govuk-media-query($from: tablet) {\n display: table-row;\n }\n }\n\n // Remove right padding from the last column in the row\n .govuk-summary-list__row:not(.govuk-summary-list__row--no-actions) > :last-child {\n padding-right: 0;\n }\n\n // Provide an empty 'cell' for rows that don't have actions – otherwise the\n // bottom border is not drawn for that part of the row in some browsers.\n .govuk-summary-list__row--no-actions {\n @include govuk-media-query($from: tablet) {\n &::after {\n content: \"\";\n display: table-cell;\n width: 20%;\n }\n }\n }\n\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n margin: 0; // Reset default user agent styles\n\n @include govuk-media-query($from: tablet) {\n display: table-cell;\n padding-top: govuk-spacing(2);\n padding-right: govuk-spacing(4);\n padding-bottom: govuk-spacing(2);\n }\n }\n\n .govuk-summary-list__actions {\n margin-bottom: govuk-spacing(3);\n @include govuk-media-query($from: tablet) {\n width: 20%;\n text-align: right;\n }\n }\n\n .govuk-summary-list__key,\n .govuk-summary-list__value {\n // Automatic wrapping for unbreakable text (e.g. URLs)\n word-wrap: break-word; // Fallback for older browsers only\n overflow-wrap: break-word;\n }\n\n .govuk-summary-list__key {\n margin-bottom: govuk-spacing(1);\n @include govuk-typography-weight-bold;\n @include govuk-media-query($from: tablet) {\n width: 30%;\n }\n }\n\n .govuk-summary-list__value {\n @include govuk-media-query($until: tablet) {\n margin-bottom: govuk-spacing(3);\n }\n }\n\n .govuk-summary-list__value > p {\n margin-bottom: govuk-spacing(2);\n }\n\n .govuk-summary-list__value > :last-child {\n margin-bottom: 0;\n }\n\n .govuk-summary-list__actions-list {\n width: 100%;\n margin: 0; // Reset default user agent styles\n padding: 0; // Reset default user agent styles\n }\n\n .govuk-summary-list__actions-list-item,\n .govuk-summary-card__action {\n display: inline-block;\n }\n\n @include govuk-media-query($until: tablet) {\n .govuk-summary-list__actions-list-item,\n .govuk-summary-card__action {\n margin-right: govuk-spacing(2);\n padding-right: govuk-spacing(2);\n border-right: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-list__actions-list-item:last-child,\n .govuk-summary-card__action:last-child {\n margin-right: 0;\n padding-right: 0;\n border: 0;\n }\n }\n\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__actions-list-item,\n .govuk-summary-card__action {\n margin-left: govuk-spacing(2);\n padding-left: govuk-spacing(2);\n }\n\n .govuk-summary-list__actions-list-item:not(:first-child),\n .govuk-summary-card__action:not(:first-child) {\n border-left: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-list__actions-list-item:first-child,\n .govuk-summary-card__action:first-child {\n margin-left: 0;\n padding-left: 0;\n border: 0;\n }\n }\n\n // Large groups of action links may wrap onto multiple lines. Because the link\n // focus styles are applied outside of the link's bounding box, there are\n // situations where the focus style on a link can be overlapped by subsequent\n // links. We don't want this, so let's create a new stacking context on focus\n // so the link always appears to be 'on top'.\n .govuk-summary-list__actions-list-item .govuk-link:focus {\n isolation: isolate;\n }\n\n // No border on entire summary list\n .govuk-summary-list--no-border {\n .govuk-summary-list__row {\n border: 0;\n }\n\n // Increase padding by 1px to compensate for 'missing' border\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n padding-bottom: govuk-spacing(2) + 1px;\n }\n }\n }\n\n // No border on specific rows\n .govuk-summary-list__row--no-border {\n border: 0;\n\n // Increase padding by 1px to compensate for 'missing' border\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n padding-bottom: govuk-spacing(2) + 1px;\n }\n }\n }\n\n // Additional block for the summary card\n .govuk-summary-card {\n @include govuk-responsive-margin(6, \"bottom\");\n border: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-card__title-wrapper {\n padding: govuk-spacing(3);\n\n // Ensures the card header appears separate to the summary list in forced\n // colours mode\n border-bottom: 1px solid transparent;\n background-color: govuk-colour(\"light-grey\");\n\n @include govuk-media-query($from: \"tablet\") {\n display: flex;\n justify-content: space-between;\n flex-wrap: nowrap;\n padding: govuk-spacing(3) govuk-spacing(4);\n }\n }\n\n .govuk-summary-card__title {\n @include govuk-font($size: 19, $weight: bold);\n @include govuk-text-colour;\n margin: govuk-spacing(1) govuk-spacing(4) govuk-spacing(2) 0;\n\n @include govuk-media-query($from: \"tablet\") {\n margin-bottom: govuk-spacing(1);\n }\n }\n\n .govuk-summary-card__actions {\n @include govuk-font-size($size: 19);\n @include govuk-typography-weight-bold;\n display: flex;\n flex-wrap: wrap;\n row-gap: 10px;\n margin: govuk-spacing(1) 0;\n padding: 0;\n list-style: none;\n\n @include govuk-media-query($from: \"tablet\") {\n justify-content: right;\n text-align: right;\n }\n }\n\n .govuk-summary-card__action {\n display: inline;\n\n // We use the following media query to target IE11 and 10 only to add margin\n // between actions.\n //\n // We do this because we're using row-gap to create space between actions on\n // more evergreen browsers which IE doesn't support. @supports currently isn't\n // a viable solution, see https://github.com/w3c/csswg-drafts/issues/3559.\n //\n // Solution taken from https://stackoverflow.com/questions/11173106/apply-style-only-on-ie#answer-36448860\n // which also includes an explanation of why this works\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n margin-bottom: govuk-spacing(1);\n }\n }\n\n .govuk-summary-card__action:last-child {\n // See above comment for why this is here\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n margin-bottom: 0;\n }\n }\n\n .govuk-summary-card__content {\n padding: govuk-spacing(3) govuk-spacing(3) 0;\n\n @include govuk-media-query($from: \"tablet\") {\n padding: govuk-spacing(3) govuk-spacing(4);\n }\n\n .govuk-summary-list {\n margin-bottom: 0;\n }\n\n .govuk-summary-list__row:last-of-type {\n margin-bottom: 0;\n border-bottom: none;\n }\n }\n}\n"]}
|
@@ -1178,6 +1178,148 @@
|
|
1178
1178
|
"screenshot": false,
|
1179
1179
|
"html": "<div class=\"govuk-summary-card\">\n <div class=\"govuk-summary-card__title-wrapper\">\n <h2 class=\"govuk-summary-card__title\">\n Undergraduate teaching assistant\n </h2>\n <ul class=\"govuk-summary-card__actions\">\n <li class=\"govuk-summary-card__action\">\n <a class=\"govuk-link\" href=\"#\">Delete job history<span class=\"govuk-visually-hidden\"> (Undergraduate teaching assistant)</span></a>\n </li>\n <li class=\"govuk-summary-card__action\">\n <a class=\"govuk-link\" href=\"#\">Withdraw job history<span class=\"govuk-visually-hidden\"> (Undergraduate teaching assistant)</span></a>\n </li>\n </ul>\n </div>\n\n <div class=\"govuk-summary-card__content\">\n <dl class=\"govuk-summary-list\">\n <div class=\"govuk-summary-list__row\">\n <dt class=\"govuk-summary-list__key\">\n Name\n </dt>\n <dd class=\"govuk-summary-list__value\">\n Firstname Lastname\n </dd>\n <dd class=\"govuk-summary-list__actions\">\n <ul class=\"govuk-summary-list__actions-list\">\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Edit<span class=\"govuk-visually-hidden\"> name (Undergraduate teaching assistant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Delete<span class=\"govuk-visually-hidden\"> name (Undergraduate teaching assistant)</span></a>\n </li>\n </ul>\n </dd>\n </div>\n <div class=\"govuk-summary-list__row\">\n <dt class=\"govuk-summary-list__key\">\n Date of birth\n </dt>\n <dd class=\"govuk-summary-list__value\">\n 13/08/1980\n </dd>\n <dd class=\"govuk-summary-list__actions\">\n <a class=\"govuk-link\" href=\"#\">Change<span class=\"govuk-visually-hidden\"> date of birth (Undergraduate teaching assistant)</span></a>\n </dd>\n </div>\n </dl>\n </div>\n</div>"
|
1180
1180
|
},
|
1181
|
+
{
|
1182
|
+
"name": "as a summary card extreme",
|
1183
|
+
"options": {
|
1184
|
+
"card": {
|
1185
|
+
"title": {
|
1186
|
+
"text": "Senior mid-level customer experience enhancement consultant"
|
1187
|
+
},
|
1188
|
+
"actions": {
|
1189
|
+
"items": [
|
1190
|
+
{
|
1191
|
+
"text": "Bop it",
|
1192
|
+
"href": "#"
|
1193
|
+
},
|
1194
|
+
{
|
1195
|
+
"text": "Twist it",
|
1196
|
+
"href": "#"
|
1197
|
+
},
|
1198
|
+
{
|
1199
|
+
"text": "Pull it",
|
1200
|
+
"href": "#"
|
1201
|
+
},
|
1202
|
+
{
|
1203
|
+
"text": "Flick it",
|
1204
|
+
"href": "#"
|
1205
|
+
},
|
1206
|
+
{
|
1207
|
+
"text": "Spin it",
|
1208
|
+
"href": "#"
|
1209
|
+
},
|
1210
|
+
{
|
1211
|
+
"text": "Shout it",
|
1212
|
+
"href": "#"
|
1213
|
+
},
|
1214
|
+
{
|
1215
|
+
"text": "Shake it",
|
1216
|
+
"href": "#"
|
1217
|
+
}
|
1218
|
+
]
|
1219
|
+
}
|
1220
|
+
},
|
1221
|
+
"rows": [
|
1222
|
+
{
|
1223
|
+
"key": {
|
1224
|
+
"text": "Name"
|
1225
|
+
},
|
1226
|
+
"value": {
|
1227
|
+
"text": "Barnaby Marmaduke Aloysius Benjy Cobweb Dartagnan Egbert Felix Gaspar Humbert Ignatius Jayden Kasper Leroy Maximilian Neddy Obiajulu Pepin Quilliam Rosencrantz Sexton Teddy Upwood Vivatma Wayland Xylon Yardley Zachary Usansky"
|
1228
|
+
},
|
1229
|
+
"actions": {
|
1230
|
+
"items": [
|
1231
|
+
{
|
1232
|
+
"href": "#",
|
1233
|
+
"text": "Buy"
|
1234
|
+
},
|
1235
|
+
{
|
1236
|
+
"href": "#",
|
1237
|
+
"text": "Use"
|
1238
|
+
},
|
1239
|
+
{
|
1240
|
+
"href": "#",
|
1241
|
+
"text": "Break"
|
1242
|
+
},
|
1243
|
+
{
|
1244
|
+
"href": "#",
|
1245
|
+
"text": "Fix"
|
1246
|
+
},
|
1247
|
+
{
|
1248
|
+
"href": "#",
|
1249
|
+
"text": "Trash"
|
1250
|
+
},
|
1251
|
+
{
|
1252
|
+
"href": "#",
|
1253
|
+
"text": "Change"
|
1254
|
+
},
|
1255
|
+
{
|
1256
|
+
"href": "#",
|
1257
|
+
"text": "Mail"
|
1258
|
+
},
|
1259
|
+
{
|
1260
|
+
"href": "#",
|
1261
|
+
"text": "Upgrade"
|
1262
|
+
},
|
1263
|
+
{
|
1264
|
+
"href": "#",
|
1265
|
+
"text": "Charge"
|
1266
|
+
},
|
1267
|
+
{
|
1268
|
+
"href": "#",
|
1269
|
+
"text": "Point"
|
1270
|
+
},
|
1271
|
+
{
|
1272
|
+
"href": "#",
|
1273
|
+
"text": "Zoom"
|
1274
|
+
},
|
1275
|
+
{
|
1276
|
+
"href": "#",
|
1277
|
+
"text": "Press"
|
1278
|
+
},
|
1279
|
+
{
|
1280
|
+
"href": "#",
|
1281
|
+
"text": "Snap"
|
1282
|
+
},
|
1283
|
+
{
|
1284
|
+
"href": "#",
|
1285
|
+
"text": "Work"
|
1286
|
+
},
|
1287
|
+
{
|
1288
|
+
"href": "#",
|
1289
|
+
"text": "Quick"
|
1290
|
+
},
|
1291
|
+
{
|
1292
|
+
"href": "#",
|
1293
|
+
"text": "Erase"
|
1294
|
+
}
|
1295
|
+
]
|
1296
|
+
}
|
1297
|
+
},
|
1298
|
+
{
|
1299
|
+
"key": {
|
1300
|
+
"text": "Long website address"
|
1301
|
+
},
|
1302
|
+
"value": {
|
1303
|
+
"html": "<a class=\"govuk-link\" href=\"https://cs.wikipedia.org/wiki/Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch\">https://cs.wikipedia.org/wiki/Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch</a>\n"
|
1304
|
+
},
|
1305
|
+
"actions": {
|
1306
|
+
"items": [
|
1307
|
+
{
|
1308
|
+
"href": "#",
|
1309
|
+
"text": "Change",
|
1310
|
+
"visuallyHiddenText": "long website address"
|
1311
|
+
}
|
1312
|
+
]
|
1313
|
+
}
|
1314
|
+
}
|
1315
|
+
]
|
1316
|
+
},
|
1317
|
+
"hidden": false,
|
1318
|
+
"description": "",
|
1319
|
+
"previewLayoutModifiers": [],
|
1320
|
+
"screenshot": false,
|
1321
|
+
"html": "<div class=\"govuk-summary-card\">\n <div class=\"govuk-summary-card__title-wrapper\">\n <h2 class=\"govuk-summary-card__title\">\n Senior mid-level customer experience enhancement consultant\n </h2>\n <ul class=\"govuk-summary-card__actions\">\n <li class=\"govuk-summary-card__action\">\n <a class=\"govuk-link\" href=\"#\">Bop it<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-card__action\">\n <a class=\"govuk-link\" href=\"#\">Twist it<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-card__action\">\n <a class=\"govuk-link\" href=\"#\">Pull it<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-card__action\">\n <a class=\"govuk-link\" href=\"#\">Flick it<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-card__action\">\n <a class=\"govuk-link\" href=\"#\">Spin it<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-card__action\">\n <a class=\"govuk-link\" href=\"#\">Shout it<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-card__action\">\n <a class=\"govuk-link\" href=\"#\">Shake it<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n </ul>\n </div>\n\n <div class=\"govuk-summary-card__content\">\n <dl class=\"govuk-summary-list\">\n <div class=\"govuk-summary-list__row\">\n <dt class=\"govuk-summary-list__key\">\n Name\n </dt>\n <dd class=\"govuk-summary-list__value\">\n Barnaby Marmaduke Aloysius Benjy Cobweb Dartagnan Egbert Felix Gaspar Humbert Ignatius Jayden Kasper Leroy Maximilian Neddy Obiajulu Pepin Quilliam Rosencrantz Sexton Teddy Upwood Vivatma Wayland Xylon Yardley Zachary Usansky\n </dd>\n <dd class=\"govuk-summary-list__actions\">\n <ul class=\"govuk-summary-list__actions-list\">\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Buy<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Use<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Break<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Fix<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Trash<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Change<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Mail<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Upgrade<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Charge<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Point<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Zoom<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Press<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Snap<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Work<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Quick<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n <li class=\"govuk-summary-list__actions-list-item\">\n <a class=\"govuk-link\" href=\"#\">Erase<span class=\"govuk-visually-hidden\"> (Senior mid-level customer experience enhancement consultant)</span></a>\n </li>\n </ul>\n </dd>\n </div>\n <div class=\"govuk-summary-list__row\">\n <dt class=\"govuk-summary-list__key\">\n Long website address\n </dt>\n <dd class=\"govuk-summary-list__value\">\n <a class=\"govuk-link\" href=\"https://cs.wikipedia.org/wiki/Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch\">https://cs.wikipedia.org/wiki/Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch</a>\n </dd>\n <dd class=\"govuk-summary-list__actions\">\n <a class=\"govuk-link\" href=\"#\">Change<span class=\"govuk-visually-hidden\"> long website address (Senior mid-level customer experience enhancement consultant)</span></a>\n </dd>\n </div>\n </dl>\n </div>\n</div>"
|
1322
|
+
},
|
1181
1323
|
{
|
1182
1324
|
"name": "attributes",
|
1183
1325
|
"options": {
|
@@ -0,0 +1,106 @@
|
|
1
|
+
<div class="govuk-summary-card">
|
2
|
+
<div class="govuk-summary-card__title-wrapper">
|
3
|
+
<h2 class="govuk-summary-card__title">
|
4
|
+
Senior mid-level customer experience enhancement consultant
|
5
|
+
</h2>
|
6
|
+
<ul class="govuk-summary-card__actions">
|
7
|
+
<li class="govuk-summary-card__action">
|
8
|
+
<a class="govuk-link" href="#">Bop it<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
9
|
+
</li>
|
10
|
+
<li class="govuk-summary-card__action">
|
11
|
+
<a class="govuk-link" href="#">Twist it<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
12
|
+
</li>
|
13
|
+
<li class="govuk-summary-card__action">
|
14
|
+
<a class="govuk-link" href="#">Pull it<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
15
|
+
</li>
|
16
|
+
<li class="govuk-summary-card__action">
|
17
|
+
<a class="govuk-link" href="#">Flick it<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
18
|
+
</li>
|
19
|
+
<li class="govuk-summary-card__action">
|
20
|
+
<a class="govuk-link" href="#">Spin it<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
21
|
+
</li>
|
22
|
+
<li class="govuk-summary-card__action">
|
23
|
+
<a class="govuk-link" href="#">Shout it<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
24
|
+
</li>
|
25
|
+
<li class="govuk-summary-card__action">
|
26
|
+
<a class="govuk-link" href="#">Shake it<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
27
|
+
</li>
|
28
|
+
</ul>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div class="govuk-summary-card__content">
|
32
|
+
<dl class="govuk-summary-list">
|
33
|
+
<div class="govuk-summary-list__row">
|
34
|
+
<dt class="govuk-summary-list__key">
|
35
|
+
Name
|
36
|
+
</dt>
|
37
|
+
<dd class="govuk-summary-list__value">
|
38
|
+
Barnaby Marmaduke Aloysius Benjy Cobweb Dartagnan Egbert Felix Gaspar Humbert Ignatius Jayden Kasper Leroy Maximilian Neddy Obiajulu Pepin Quilliam Rosencrantz Sexton Teddy Upwood Vivatma Wayland Xylon Yardley Zachary Usansky
|
39
|
+
</dd>
|
40
|
+
<dd class="govuk-summary-list__actions">
|
41
|
+
<ul class="govuk-summary-list__actions-list">
|
42
|
+
<li class="govuk-summary-list__actions-list-item">
|
43
|
+
<a class="govuk-link" href="#">Buy<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
44
|
+
</li>
|
45
|
+
<li class="govuk-summary-list__actions-list-item">
|
46
|
+
<a class="govuk-link" href="#">Use<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
47
|
+
</li>
|
48
|
+
<li class="govuk-summary-list__actions-list-item">
|
49
|
+
<a class="govuk-link" href="#">Break<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
50
|
+
</li>
|
51
|
+
<li class="govuk-summary-list__actions-list-item">
|
52
|
+
<a class="govuk-link" href="#">Fix<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
53
|
+
</li>
|
54
|
+
<li class="govuk-summary-list__actions-list-item">
|
55
|
+
<a class="govuk-link" href="#">Trash<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
56
|
+
</li>
|
57
|
+
<li class="govuk-summary-list__actions-list-item">
|
58
|
+
<a class="govuk-link" href="#">Change<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
59
|
+
</li>
|
60
|
+
<li class="govuk-summary-list__actions-list-item">
|
61
|
+
<a class="govuk-link" href="#">Mail<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
62
|
+
</li>
|
63
|
+
<li class="govuk-summary-list__actions-list-item">
|
64
|
+
<a class="govuk-link" href="#">Upgrade<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
65
|
+
</li>
|
66
|
+
<li class="govuk-summary-list__actions-list-item">
|
67
|
+
<a class="govuk-link" href="#">Charge<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
68
|
+
</li>
|
69
|
+
<li class="govuk-summary-list__actions-list-item">
|
70
|
+
<a class="govuk-link" href="#">Point<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
71
|
+
</li>
|
72
|
+
<li class="govuk-summary-list__actions-list-item">
|
73
|
+
<a class="govuk-link" href="#">Zoom<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
74
|
+
</li>
|
75
|
+
<li class="govuk-summary-list__actions-list-item">
|
76
|
+
<a class="govuk-link" href="#">Press<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
77
|
+
</li>
|
78
|
+
<li class="govuk-summary-list__actions-list-item">
|
79
|
+
<a class="govuk-link" href="#">Snap<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
80
|
+
</li>
|
81
|
+
<li class="govuk-summary-list__actions-list-item">
|
82
|
+
<a class="govuk-link" href="#">Work<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
83
|
+
</li>
|
84
|
+
<li class="govuk-summary-list__actions-list-item">
|
85
|
+
<a class="govuk-link" href="#">Quick<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
86
|
+
</li>
|
87
|
+
<li class="govuk-summary-list__actions-list-item">
|
88
|
+
<a class="govuk-link" href="#">Erase<span class="govuk-visually-hidden"> (Senior mid-level customer experience enhancement consultant)</span></a>
|
89
|
+
</li>
|
90
|
+
</ul>
|
91
|
+
</dd>
|
92
|
+
</div>
|
93
|
+
<div class="govuk-summary-list__row">
|
94
|
+
<dt class="govuk-summary-list__key">
|
95
|
+
Long website address
|
96
|
+
</dt>
|
97
|
+
<dd class="govuk-summary-list__value">
|
98
|
+
<a class="govuk-link" href="https://cs.wikipedia.org/wiki/Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch">https://cs.wikipedia.org/wiki/Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch</a>
|
99
|
+
</dd>
|
100
|
+
<dd class="govuk-summary-list__actions">
|
101
|
+
<a class="govuk-link" href="#">Change<span class="govuk-visually-hidden"> long website address (Senior mid-level customer experience enhancement consultant)</span></a>
|
102
|
+
</dd>
|
103
|
+
</div>
|
104
|
+
</dl>
|
105
|
+
</div>
|
106
|
+
</div>
|
@@ -44,6 +44,9 @@
|
|
44
44
|
* @typedef ComponentWithModuleName
|
45
45
|
* @property {string} moduleName - Name of the component
|
46
46
|
*/
|
47
|
+
/**
|
48
|
+
* @import { ObjectNested } from './configuration.mjs'
|
49
|
+
*/
|
47
50
|
|
48
51
|
class GOVUKFrontendError extends Error {
|
49
52
|
constructor(...args) {
|
@@ -89,10 +92,10 @@
|
|
89
92
|
}
|
90
93
|
}
|
91
94
|
/**
|
92
|
-
* @
|
95
|
+
* @import { ComponentWithModuleName } from '../common/index.mjs'
|
93
96
|
*/
|
94
97
|
|
95
|
-
class
|
98
|
+
class Component {
|
96
99
|
/**
|
97
100
|
* Returns the root element of the component
|
98
101
|
*
|
@@ -143,16 +146,16 @@
|
|
143
146
|
*/
|
144
147
|
|
145
148
|
/**
|
146
|
-
* @typedef {typeof
|
149
|
+
* @typedef {typeof Component & ChildClass} ChildClassConstructor
|
147
150
|
*/
|
148
|
-
|
151
|
+
Component.elementType = HTMLElement;
|
149
152
|
|
150
153
|
/**
|
151
154
|
* Tabs component
|
152
155
|
*
|
153
156
|
* @preserve
|
154
157
|
*/
|
155
|
-
class Tabs extends
|
158
|
+
class Tabs extends Component {
|
156
159
|
/**
|
157
160
|
* @param {Element | null} $root - HTML element to use for tabs
|
158
161
|
*/
|