@moduk/frontend 1.3.0 → 1.4.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.
- package/dist/nunjucks/moduk/components/footer/__examples__/with-customisation.njk +28 -0
- package/dist/nunjucks/moduk/components/phase-banner/__examples__/default.njk +0 -4
- package/dist/nunjucks/moduk/components/summary-list/__examples__/cards-with-single-action.njk +36 -0
- package/dist/nunjucks/moduk/components/summary-list/__examples__/with-multiple-actions.njk +28 -0
- package/nunjucks/moduk/components/footer/__examples__/with-customisation.njk +28 -0
- package/nunjucks/moduk/components/phase-banner/__examples__/default.njk +0 -4
- package/nunjucks/moduk/components/summary-list/__examples__/cards-with-single-action.njk +36 -0
- package/nunjucks/moduk/components/summary-list/__examples__/with-multiple-actions.njk +28 -0
- package/package.json +8 -7
- package/react/VisuallyHiddenText/VisuallyHiddenText.d.ts +10 -0
- package/react/VisuallyHiddenText/VisuallyHiddenText.d.ts.map +1 -0
- package/react/VisuallyHiddenText/index.d.ts +2 -0
- package/react/VisuallyHiddenText/index.d.ts.map +1 -0
- package/react/accordion/Accordion.d.ts +3 -4
- package/react/accordion/Accordion.d.ts.map +1 -1
- package/react/back-link/BackLink.d.ts +2 -3
- package/react/back-link/BackLink.d.ts.map +1 -1
- package/react/error-message/ErrorMessage.d.ts +13 -0
- package/react/error-message/ErrorMessage.d.ts.map +1 -0
- package/react/error-message/index.d.ts +2 -0
- package/react/error-message/index.d.ts.map +1 -0
- package/react/esm/VisuallyHiddenText/VisuallyHiddenText.js +10 -0
- package/react/esm/VisuallyHiddenText/index.js +1 -0
- package/react/esm/accordion/Accordion.js +8 -5
- package/react/esm/error-message/ErrorMessage.js +33 -0
- package/react/esm/error-message/index.js +1 -0
- package/react/esm/footer/Footer.js +84 -0
- package/react/esm/footer/FooterMeta.js +21 -0
- package/react/esm/footer/FooterMetaLink.js +32 -0
- package/react/esm/footer/FooterNavigation.js +14 -0
- package/react/esm/footer/FooterNavigationLink.js +28 -0
- package/react/esm/footer/FooterNavigationSection.js +20 -0
- package/react/esm/footer/index.js +6 -0
- package/react/esm/hint/Hint.js +28 -0
- package/react/esm/hint/index.js +1 -0
- package/react/esm/index.js +10 -1
- package/react/esm/input/Input.js +60 -0
- package/react/esm/input/InputPrefix.js +14 -0
- package/react/esm/input/InputSuffix.js +14 -0
- package/react/esm/input/index.js +3 -0
- package/react/esm/internal/FormGroup/FormGroup.js +21 -0
- package/react/esm/internal/FormGroup/FormGroupContext.js +4 -0
- package/react/esm/internal/FormGroup/index.js +2 -0
- package/react/esm/internal/PermissiveChild.js +1 -0
- package/react/esm/label/Label.js +38 -0
- package/react/esm/label/index.js +1 -0
- package/react/esm/phase-banner/PhaseBanner.js +32 -0
- package/react/esm/phase-banner/PhaseTag.js +24 -0
- package/react/esm/phase-banner/index.js +2 -0
- package/react/esm/summary-list/SummaryCardActions.js +24 -0
- package/react/esm/summary-list/SummaryCardTitle.js +12 -0
- package/react/esm/summary-list/SummaryList.js +76 -0
- package/react/esm/summary-list/SummaryListActionLink.js +25 -0
- package/react/esm/summary-list/SummaryListActions.js +22 -0
- package/react/esm/summary-list/SummaryListKey.js +10 -0
- package/react/esm/summary-list/SummaryListValue.js +10 -0
- package/react/esm/summary-list/index.js +7 -0
- package/react/esm/tag/Tag.js +27 -0
- package/react/esm/tag/index.js +1 -0
- package/react/footer/Footer.d.ts +44 -0
- package/react/footer/Footer.d.ts.map +1 -0
- package/react/footer/FooterMeta.d.ts +24 -0
- package/react/footer/FooterMeta.d.ts.map +1 -0
- package/react/footer/FooterMetaLink.d.ts +14 -0
- package/react/footer/FooterMetaLink.d.ts.map +1 -0
- package/react/footer/FooterNavigation.d.ts +15 -0
- package/react/footer/FooterNavigation.d.ts.map +1 -0
- package/react/footer/FooterNavigationLink.d.ts +14 -0
- package/react/footer/FooterNavigationLink.d.ts.map +1 -0
- package/react/footer/FooterNavigationSection.d.ts +30 -0
- package/react/footer/FooterNavigationSection.d.ts.map +1 -0
- package/react/footer/index.d.ts +7 -0
- package/react/footer/index.d.ts.map +1 -0
- package/react/hint/Hint.d.ts +11 -0
- package/react/hint/Hint.d.ts.map +1 -0
- package/react/hint/index.d.ts +2 -0
- package/react/hint/index.d.ts.map +1 -0
- package/react/index.d.ts +9 -0
- package/react/index.d.ts.map +1 -1
- package/react/index.js +1 -1
- package/react/index.js.map +1 -1
- package/react/input/Input.d.ts +50 -0
- package/react/input/Input.d.ts.map +1 -0
- package/react/input/InputPrefix.d.ts +9 -0
- package/react/input/InputPrefix.d.ts.map +1 -0
- package/react/input/InputSuffix.d.ts +9 -0
- package/react/input/InputSuffix.d.ts.map +1 -0
- package/react/input/index.d.ts +4 -0
- package/react/input/index.d.ts.map +1 -0
- package/react/internal/FormGroup/FormGroup.d.ts +9 -0
- package/react/internal/FormGroup/FormGroup.d.ts.map +1 -0
- package/react/internal/FormGroup/FormGroupContext.d.ts +5 -0
- package/react/internal/FormGroup/FormGroupContext.d.ts.map +1 -0
- package/react/internal/FormGroup/index.d.ts +3 -0
- package/react/internal/FormGroup/index.d.ts.map +1 -0
- package/react/internal/PermissiveChild.d.ts +3 -0
- package/react/internal/PermissiveChild.d.ts.map +1 -0
- package/react/label/Label.d.ts +15 -0
- package/react/label/Label.d.ts.map +1 -0
- package/react/label/index.d.ts +2 -0
- package/react/label/index.d.ts.map +1 -0
- package/react/phase-banner/PhaseBanner.d.ts +27 -0
- package/react/phase-banner/PhaseBanner.d.ts.map +1 -0
- package/react/phase-banner/PhaseTag.d.ts +10 -0
- package/react/phase-banner/PhaseTag.d.ts.map +1 -0
- package/react/phase-banner/index.d.ts +3 -0
- package/react/phase-banner/index.d.ts.map +1 -0
- package/react/summary-list/SummaryCardActions.d.ts +16 -0
- package/react/summary-list/SummaryCardActions.d.ts.map +1 -0
- package/react/summary-list/SummaryCardTitle.d.ts +22 -0
- package/react/summary-list/SummaryCardTitle.d.ts.map +1 -0
- package/react/summary-list/SummaryList.d.ts +89 -0
- package/react/summary-list/SummaryList.d.ts.map +1 -0
- package/react/summary-list/SummaryListActionLink.d.ts +11 -0
- package/react/summary-list/SummaryListActionLink.d.ts.map +1 -0
- package/react/summary-list/SummaryListActions.d.ts +16 -0
- package/react/summary-list/SummaryListActions.d.ts.map +1 -0
- package/react/summary-list/SummaryListKey.d.ts +12 -0
- package/react/summary-list/SummaryListKey.d.ts.map +1 -0
- package/react/summary-list/SummaryListValue.d.ts +12 -0
- package/react/summary-list/SummaryListValue.d.ts.map +1 -0
- package/react/summary-list/index.d.ts +8 -0
- package/react/summary-list/index.d.ts.map +1 -0
- package/react/tag/Tag.d.ts +17 -0
- package/react/tag/Tag.d.ts.map +1 -0
- package/react/tag/index.d.ts +2 -0
- package/react/tag/index.d.ts.map +1 -0
- package/src/react/error-message/__examples__/default.tsx +3 -0
- package/src/react/footer/__examples__/default.tsx +3 -0
- package/src/react/footer/__examples__/with-customisation.tsx +15 -0
- package/src/react/footer/__examples__/with-links.tsx +13 -0
- package/src/react/footer/__examples__/with-secondary-navigation-and-links.tsx +44 -0
- package/src/react/footer/__examples__/with-secondary-navigation.tsx +24 -0
- package/src/react/input/__examples__/default.tsx +12 -0
- package/src/react/input/__examples__/not-as-page-heading.tsx +8 -0
- package/src/react/input/__examples__/with-error.tsx +14 -0
- package/src/react/input/__examples__/with-fixed-width.tsx +36 -0
- package/src/react/input/__examples__/with-fluid-width.tsx +36 -0
- package/src/react/input/__examples__/with-hint.tsx +13 -0
- package/src/react/input/__examples__/with-numeric.tsx +16 -0
- package/src/react/input/__examples__/with-prefix-and-suffix-error.tsx +17 -0
- package/src/react/input/__examples__/with-prefix-and-suffix.tsx +16 -0
- package/src/react/input/__examples__/with-prefix.tsx +15 -0
- package/src/react/input/__examples__/with-suffix.tsx +15 -0
- package/src/react/phase-banner/__examples__/beta.tsx +7 -0
- package/src/react/phase-banner/__examples__/default.tsx +7 -0
- package/src/react/phase-banner/__examples__/with-tag-override.tsx +7 -0
- package/src/react/phase-banner/__examples__/with-text.tsx +7 -0
- package/src/react/summary-list/__examples__/cards-with-action.tsx +88 -0
- package/src/react/summary-list/__examples__/cards-with-single-action.tsx +46 -0
- package/src/react/summary-list/__examples__/cards.tsx +156 -0
- package/src/react/summary-list/__examples__/default.tsx +72 -0
- package/src/react/summary-list/__examples__/with-multiple-actions.tsx +29 -0
- package/src/react/summary-list/__examples__/with-no-actions.tsx +37 -0
- package/src/react/summary-list/__examples__/with-no-border.tsx +38 -0
- package/src/react/tag/__examples__/blue.tsx +3 -0
- package/src/react/tag/__examples__/default.tsx +3 -0
- package/src/react/tag/__examples__/green.tsx +3 -0
- package/src/react/tag/__examples__/grey.tsx +3 -0
- package/src/react/tag/__examples__/orange.tsx +3 -0
- package/src/react/tag/__examples__/pink.tsx +3 -0
- package/src/react/tag/__examples__/purple.tsx +3 -0
- package/src/react/tag/__examples__/red.tsx +3 -0
- package/src/react/tag/__examples__/turquoise.tsx +3 -0
- package/src/react/tag/__examples__/yellow.tsx +3 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export function FooterNavigationSection(_ref) {
|
|
5
|
+
var title = _ref.title,
|
|
6
|
+
_ref$width = _ref.width,
|
|
7
|
+
width = _ref$width === void 0 ? 'full' : _ref$width,
|
|
8
|
+
columns = _ref.columns,
|
|
9
|
+
children = _ref.children;
|
|
10
|
+
return _jsxs("div", {
|
|
11
|
+
className: clsx('govuk-footer__section', "govuk-grid-column-".concat(width)),
|
|
12
|
+
children: [_jsx("h2", {
|
|
13
|
+
className: "govuk-footer__heading govuk-heading-m",
|
|
14
|
+
children: title
|
|
15
|
+
}), _jsx("ul", {
|
|
16
|
+
className: clsx('govuk-footer__list', columns && "govuk-footer__list--columns-".concat(columns)),
|
|
17
|
+
children: children
|
|
18
|
+
})]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Footer } from './Footer';
|
|
2
|
+
export { FooterMeta } from './FooterMeta';
|
|
3
|
+
export { FooterMetaLink } from './FooterMetaLink';
|
|
4
|
+
export { FooterNavigation } from './FooterNavigation';
|
|
5
|
+
export { FooterNavigationLink } from './FooterNavigationLink';
|
|
6
|
+
export { FooterNavigationSection } from './FooterNavigationSection';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "className", "id"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef, useContext } from 'react';
|
|
12
|
+
import { FormGroupContext } from '../internal/FormGroup';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
export var Hint = forwardRef(function (_ref, ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
id = _ref.id,
|
|
18
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var context = useContext(FormGroupContext);
|
|
20
|
+
return _jsx("div", _objectSpread(_objectSpread({
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: clsx('govuk-hint', className),
|
|
23
|
+
id: context.id ? "".concat(context.id, "-hint") : id
|
|
24
|
+
}, rest), {}, {
|
|
25
|
+
children: children
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
28
|
+
Hint.displayName = 'Hint';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Hint';
|
package/react/esm/index.js
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
export * from './accordion';
|
|
4
4
|
export * from './back-link/BackLink';
|
|
5
|
+
export * from './error-message';
|
|
6
|
+
export * from './footer';
|
|
5
7
|
export * from './header';
|
|
8
|
+
export * from './hint';
|
|
9
|
+
export * from './input';
|
|
10
|
+
export * from './label';
|
|
6
11
|
export * from './MODUKBody/MODUKBody';
|
|
7
|
-
export * from './
|
|
12
|
+
export * from './phase-banner';
|
|
13
|
+
export * from './summary-list';
|
|
14
|
+
export * from './table';
|
|
15
|
+
export * from './tag';
|
|
16
|
+
export * from './VisuallyHiddenText';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["aria-describedby", "className", "errorMessage", "formGroupClassName", "hint", "id", "label", "prefix", "suffix", "type"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef, useId } from 'react';
|
|
12
|
+
import { FormGroup } from '../internal/FormGroup';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
function InputWrapper(_ref) {
|
|
17
|
+
var children = _ref.children,
|
|
18
|
+
hasPrefixOrSuffix = _ref.hasPrefixOrSuffix;
|
|
19
|
+
if (hasPrefixOrSuffix) {
|
|
20
|
+
return _jsx("div", {
|
|
21
|
+
className: "govuk-input__wrapper",
|
|
22
|
+
children: children
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return _jsx(_Fragment, {
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export var Input = forwardRef(function (_ref2, ref) {
|
|
30
|
+
var ariaDescribedBy = _ref2['aria-describedby'],
|
|
31
|
+
className = _ref2.className,
|
|
32
|
+
errorMessage = _ref2.errorMessage,
|
|
33
|
+
formGroupClassName = _ref2.formGroupClassName,
|
|
34
|
+
hint = _ref2.hint,
|
|
35
|
+
id = _ref2.id,
|
|
36
|
+
label = _ref2.label,
|
|
37
|
+
prefix = _ref2.prefix,
|
|
38
|
+
suffix = _ref2.suffix,
|
|
39
|
+
_ref2$type = _ref2.type,
|
|
40
|
+
type = _ref2$type === void 0 ? 'text' : _ref2$type,
|
|
41
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
42
|
+
var autoId = useId();
|
|
43
|
+
var resolvedId = id || autoId;
|
|
44
|
+
var resolvedAriaDescribedBy = [ariaDescribedBy !== null && ariaDescribedBy !== void 0 ? ariaDescribedBy : [], errorMessage ? "".concat(resolvedId, "-error") : [], hint ? "".concat(resolvedId, "-hint") : []].flat().join(' ');
|
|
45
|
+
return _jsxs(FormGroup, {
|
|
46
|
+
className: clsx(errorMessage && 'govuk-form-group--error', formGroupClassName),
|
|
47
|
+
id: resolvedId,
|
|
48
|
+
children: [label, hint, errorMessage, _jsxs(InputWrapper, {
|
|
49
|
+
hasPrefixOrSuffix: Boolean(prefix || suffix),
|
|
50
|
+
children: [prefix, _jsx("input", _objectSpread({
|
|
51
|
+
ref: ref,
|
|
52
|
+
"aria-describedby": resolvedAriaDescribedBy,
|
|
53
|
+
className: clsx('govuk-input', errorMessage && 'govuk-input--error', className),
|
|
54
|
+
id: resolvedId,
|
|
55
|
+
type: type
|
|
56
|
+
}, rest)), suffix]
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
Input.displayName = 'Input';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export var InputPrefix = forwardRef(function (_ref, ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
className = _ref.className;
|
|
7
|
+
return _jsx("div", {
|
|
8
|
+
ref: ref,
|
|
9
|
+
className: clsx('govuk-input__prefix', className),
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
children: children
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
InputPrefix.displayName = 'InputPrefix';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export var InputSuffix = forwardRef(function (_ref, ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
className = _ref.className;
|
|
7
|
+
return _jsx("div", {
|
|
8
|
+
ref: ref,
|
|
9
|
+
className: clsx('govuk-input__suffix', className),
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
children: children
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
InputSuffix.displayName = 'InputSuffix';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { FormGroupContext } from './FormGroupContext';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export function FormGroup(_ref) {
|
|
6
|
+
var children = _ref.children,
|
|
7
|
+
className = _ref.className,
|
|
8
|
+
id = _ref.id;
|
|
9
|
+
var contextValue = useMemo(function () {
|
|
10
|
+
return {
|
|
11
|
+
id: id
|
|
12
|
+
};
|
|
13
|
+
}, [id]);
|
|
14
|
+
return _jsx(FormGroupContext.Provider, {
|
|
15
|
+
value: contextValue,
|
|
16
|
+
children: _jsx("div", {
|
|
17
|
+
className: clsx('govuk-form-group', className),
|
|
18
|
+
children: children
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "className", "htmlFor", "id", "isPageHeading"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef, useContext } from 'react';
|
|
12
|
+
import { FormGroupContext } from '../internal/FormGroup';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
export var Label = forwardRef(function (_ref, ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
htmlFor = _ref.htmlFor,
|
|
18
|
+
id = _ref.id,
|
|
19
|
+
isPageHeading = _ref.isPageHeading,
|
|
20
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var context = useContext(FormGroupContext);
|
|
22
|
+
var label = _jsx("label", _objectSpread(_objectSpread({
|
|
23
|
+
ref: ref,
|
|
24
|
+
className: clsx('govuk-label', className),
|
|
25
|
+
htmlFor: context.id || htmlFor,
|
|
26
|
+
id: context.id ? "".concat(context.id, "-label") : id
|
|
27
|
+
}, rest), {}, {
|
|
28
|
+
children: children
|
|
29
|
+
}));
|
|
30
|
+
if (isPageHeading) {
|
|
31
|
+
return _jsx("h1", {
|
|
32
|
+
className: "govuk-label-wrapper",
|
|
33
|
+
children: label
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return label;
|
|
37
|
+
});
|
|
38
|
+
Label.displayName = 'Label';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Label';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "className", "phaseTag"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef } from 'react';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
export var PhaseBanner = forwardRef(function (_ref, ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
phaseTag = _ref.phaseTag,
|
|
18
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
return _jsx("div", _objectSpread(_objectSpread({
|
|
20
|
+
ref: ref,
|
|
21
|
+
className: clsx('govuk-phase-banner', className)
|
|
22
|
+
}, rest), {}, {
|
|
23
|
+
children: _jsxs("p", {
|
|
24
|
+
className: "govuk-phase-banner__content",
|
|
25
|
+
children: [phaseTag, _jsx("span", {
|
|
26
|
+
className: "govuk-phase-banner__text",
|
|
27
|
+
children: children
|
|
28
|
+
})]
|
|
29
|
+
})
|
|
30
|
+
}));
|
|
31
|
+
});
|
|
32
|
+
PhaseBanner.displayName = 'PhaseBanner';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "className"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef } from 'react';
|
|
12
|
+
import { Tag } from '../tag';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
export var PhaseTag = forwardRef(function (_ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
return _jsx(Tag, _objectSpread(_objectSpread({
|
|
19
|
+
className: clsx('govuk-phase-banner__content__tag', className)
|
|
20
|
+
}, rest), {}, {
|
|
21
|
+
children: children
|
|
22
|
+
}));
|
|
23
|
+
});
|
|
24
|
+
PhaseTag.displayName = 'PhaseTag';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { isValidElement } from 'react';
|
|
3
|
+
import flattenChildren from 'react-keyed-flatten-children';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export var SummaryCardActions = function SummaryCardActions(_ref) {
|
|
6
|
+
var children = _ref.children,
|
|
7
|
+
className = _ref.className;
|
|
8
|
+
var flattenedChildren = flattenChildren(children).filter(isValidElement);
|
|
9
|
+
if (flattenedChildren.length === 1) {
|
|
10
|
+
return _jsx("div", {
|
|
11
|
+
className: clsx('govuk-summary-card__actions', className),
|
|
12
|
+
children: children
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return _jsx("ul", {
|
|
16
|
+
className: clsx('govuk-summary-card__actions', className),
|
|
17
|
+
children: flattenedChildren.map(function (child) {
|
|
18
|
+
return _jsx("li", {
|
|
19
|
+
className: "govuk-summary-card__action",
|
|
20
|
+
children: child
|
|
21
|
+
}, child.key);
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export var SummaryCardTitle = function SummaryCardTitle(_ref) {
|
|
4
|
+
var children = _ref.children,
|
|
5
|
+
className = _ref.className,
|
|
6
|
+
_ref$headingTag = _ref.headingTag,
|
|
7
|
+
Heading = _ref$headingTag === void 0 ? 'h2' : _ref$headingTag;
|
|
8
|
+
return _jsx(Heading, {
|
|
9
|
+
className: clsx('govuk-summary-card__title', className),
|
|
10
|
+
children: children
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["card", "className", "rows"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef } from 'react';
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
var SummaryCard = function SummaryCard(_ref) {
|
|
15
|
+
var actions = _ref.actions,
|
|
16
|
+
children = _ref.children,
|
|
17
|
+
className = _ref.className,
|
|
18
|
+
title = _ref.title;
|
|
19
|
+
return _jsxs("div", {
|
|
20
|
+
className: clsx('govuk-summary-card', className),
|
|
21
|
+
children: [_jsxs("div", {
|
|
22
|
+
className: "govuk-summary-card__title-wrapper",
|
|
23
|
+
children: [title, actions]
|
|
24
|
+
}), _jsx("div", {
|
|
25
|
+
className: "govuk-summary-card__content",
|
|
26
|
+
children: children
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var SummaryListRow = function SummaryListRow(_ref2) {
|
|
31
|
+
var children = _ref2.children,
|
|
32
|
+
className = _ref2.className,
|
|
33
|
+
anyRowHasActions = _ref2.anyRowHasActions,
|
|
34
|
+
hasActions = _ref2.hasActions;
|
|
35
|
+
return _jsx("div", {
|
|
36
|
+
className: clsx('govuk-summary-list__row', anyRowHasActions && !hasActions && 'govuk-summary-list__row--no-actions', className),
|
|
37
|
+
children: children
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
export var SummaryList = forwardRef(function (_ref3, ref) {
|
|
41
|
+
var card = _ref3.card,
|
|
42
|
+
className = _ref3.className,
|
|
43
|
+
rows = _ref3.rows,
|
|
44
|
+
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
45
|
+
var anyRowHasActions = rows.some(function (row) {
|
|
46
|
+
return row.actions;
|
|
47
|
+
});
|
|
48
|
+
var allRowsHaveKeys = rows.every(function (row) {
|
|
49
|
+
return row.reactKey;
|
|
50
|
+
});
|
|
51
|
+
var summaryListContents = _jsx("dl", _objectSpread(_objectSpread({
|
|
52
|
+
ref: ref,
|
|
53
|
+
className: clsx('govuk-summary-list', className)
|
|
54
|
+
}, rest), {}, {
|
|
55
|
+
children: rows.map(function (_ref4, index) {
|
|
56
|
+
var rowclassName = _ref4.className,
|
|
57
|
+
key = _ref4.key,
|
|
58
|
+
value = _ref4.value,
|
|
59
|
+
actions = _ref4.actions,
|
|
60
|
+
reactKey = _ref4.reactKey;
|
|
61
|
+
return _jsxs(SummaryListRow, {
|
|
62
|
+
anyRowHasActions: anyRowHasActions,
|
|
63
|
+
className: rowclassName,
|
|
64
|
+
hasActions: Boolean(actions),
|
|
65
|
+
children: [key, value, actions]
|
|
66
|
+
}, allRowsHaveKeys ? reactKey : index);
|
|
67
|
+
})
|
|
68
|
+
}));
|
|
69
|
+
if (card) {
|
|
70
|
+
return _jsx(SummaryCard, _objectSpread(_objectSpread({}, card), {}, {
|
|
71
|
+
children: summaryListContents
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
return summaryListContents;
|
|
75
|
+
});
|
|
76
|
+
SummaryList.displayName = 'SummaryList';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "className"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef } from 'react';
|
|
12
|
+
import { LinkBase } from '../internal/Link/Link';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
export var SummaryListActionLink = forwardRef(function (_ref, ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
return _jsx(LinkBase, _objectSpread(_objectSpread({
|
|
19
|
+
ref: ref,
|
|
20
|
+
className: clsx('govuk-link', className)
|
|
21
|
+
}, props), {}, {
|
|
22
|
+
children: children
|
|
23
|
+
}));
|
|
24
|
+
});
|
|
25
|
+
SummaryListActionLink.displayName = 'SummaryListActionLink';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { isValidElement } from 'react';
|
|
3
|
+
import flattenChildren from 'react-keyed-flatten-children';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export var SummaryListActions = function SummaryListActions(_ref) {
|
|
6
|
+
var children = _ref.children,
|
|
7
|
+
className = _ref.className;
|
|
8
|
+
var flattenedChildren = flattenChildren(children).filter(isValidElement);
|
|
9
|
+
var links = flattenedChildren.length === 1 ? flattenedChildren : _jsx("ul", {
|
|
10
|
+
className: "govuk-summary-list__actions-list",
|
|
11
|
+
children: flattenedChildren.map(function (child) {
|
|
12
|
+
return _jsx("li", {
|
|
13
|
+
className: "govuk-summary-list__actions-list-item",
|
|
14
|
+
children: child
|
|
15
|
+
}, child.key);
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
return _jsx("dd", {
|
|
19
|
+
className: clsx('govuk-summary-list__actions', className),
|
|
20
|
+
children: links
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export var SummaryListKey = function SummaryListKey(_ref) {
|
|
4
|
+
var children = _ref.children,
|
|
5
|
+
className = _ref.className;
|
|
6
|
+
return _jsx("dt", {
|
|
7
|
+
className: clsx('govuk-summary-list__key', className),
|
|
8
|
+
children: children
|
|
9
|
+
});
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export var SummaryListValue = function SummaryListValue(_ref) {
|
|
4
|
+
var children = _ref.children,
|
|
5
|
+
className = _ref.className;
|
|
6
|
+
return _jsx("dd", {
|
|
7
|
+
className: clsx('govuk-summary-list__value', className),
|
|
8
|
+
children: children
|
|
9
|
+
});
|
|
10
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "className"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef } from 'react';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var Tag = forwardRef(function (_ref, ref) {
|
|
14
|
+
var children = _ref.children,
|
|
15
|
+
className = _ref.className,
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
var isTagVariant = (className !== null && className !== void 0 ? className : '').split(' ').some(function (value) {
|
|
18
|
+
return value.trimStart().startsWith('govuk-tag--');
|
|
19
|
+
});
|
|
20
|
+
return _jsx("strong", _objectSpread(_objectSpread({
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: clsx('govuk-tag', className, !isTagVariant && 'moduk-tag--default')
|
|
23
|
+
}, rest), {}, {
|
|
24
|
+
children: children
|
|
25
|
+
}));
|
|
26
|
+
});
|
|
27
|
+
Tag.displayName = 'Tag';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tag } from './Tag';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactElement } from 'react';
|
|
2
|
+
import type { FooterMetaProps } from './FooterMeta';
|
|
3
|
+
import type { FooterNavigationProps } from './FooterNavigation';
|
|
4
|
+
interface FooterProps extends ComponentPropsWithoutRef<'footer'> {
|
|
5
|
+
/**
|
|
6
|
+
* Classes that can be added to the inner container, useful if you want to make the footer full width.
|
|
7
|
+
*/
|
|
8
|
+
containerClassName?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The content licence text.
|
|
11
|
+
*/
|
|
12
|
+
contentLicence?: ReactElement | string;
|
|
13
|
+
/**
|
|
14
|
+
* The copyright text.
|
|
15
|
+
*/
|
|
16
|
+
copyright?: ReactElement | string;
|
|
17
|
+
/**
|
|
18
|
+
* Meta navigation. An instance of FooterMeta.
|
|
19
|
+
*/
|
|
20
|
+
meta?: ReactElement<FooterMetaProps>;
|
|
21
|
+
/**
|
|
22
|
+
* Secondary navigation. An instance of FooterNavigation.
|
|
23
|
+
*/
|
|
24
|
+
navigation?: ReactElement<FooterNavigationProps>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A page footer.
|
|
28
|
+
*
|
|
29
|
+
* @experimental React components are in alpha and subject to change.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* <Footer
|
|
33
|
+
* meta={
|
|
34
|
+
* <FooterMeta>
|
|
35
|
+
* <FooterMetaLink href='#1'>Item 1</FooterMetaLink>
|
|
36
|
+
* <FooterMetaLink href='#2'>Item 2</FooterMetaLink>
|
|
37
|
+
* <FooterMetaLink href='#2'>Item 3</FooterMetaLink>
|
|
38
|
+
* </FooterMeta>
|
|
39
|
+
* }
|
|
40
|
+
* />
|
|
41
|
+
*/
|
|
42
|
+
export declare const Footer: import("react").ForwardRefExoticComponent<FooterProps & import("react").RefAttributes<HTMLElement>>;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=Footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../src/react/footer/Footer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AACpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AA4D/D,UAAU,WAAY,SAAQ,wBAAwB,CAAC,QAAQ,CAAC;IAC9D;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,GAAG,MAAM,CAAA;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,MAAM,CAAA;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,CAAA;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,YAAY,CAAC,qBAAqB,CAAC,CAAA;CACjD;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,qGAuBjB,CAAA"}
|