@moduk/frontend 1.7.4 → 1.8.1
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/package.json +13 -13
- package/react/esm/index.js +3 -1
- package/react/esm/inset-text/InsetText.js +24 -0
- package/react/esm/inset-text/index.js +1 -0
- package/react/esm/internal/test-utils/Root.js +2 -2
- package/react/esm/warning-text/WarningText.js +37 -0
- package/react/esm/warning-text/index.js +1 -0
- package/react/index.d.ts +2 -0
- package/react/index.d.ts.map +1 -1
- package/react/index.js +1 -1
- package/react/index.js.map +1 -1
- package/react/inset-text/InsetText.d.ts +17 -0
- package/react/inset-text/InsetText.d.ts.map +1 -0
- package/react/inset-text/index.d.ts +2 -0
- package/react/inset-text/index.d.ts.map +1 -0
- package/react/warning-text/WarningText.d.ts +21 -0
- package/react/warning-text/WarningText.d.ts.map +1 -0
- package/react/warning-text/index.d.ts +2 -0
- package/react/warning-text/index.d.ts.map +1 -0
- package/src/react/inset-text/__examples__/default.tsx +5 -0
- package/src/react/warning-text/__examples__/default.tsx +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moduk/frontend",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "The MOD.UK Frontend contains the code you need to start building a user interface for Ministry of Defence platforms and services.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"sass": "src/css/index.scss",
|
|
@@ -102,18 +102,18 @@
|
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@11ty/eleventy": "^2.0.1",
|
|
104
104
|
"@axe-core/playwright": "^4.7.3",
|
|
105
|
-
"@babel/cli": "^7.22.
|
|
106
|
-
"@babel/core": "^7.22.
|
|
107
|
-
"@babel/preset-env": "^7.22.
|
|
108
|
-
"@babel/preset-react": "^7.22.
|
|
109
|
-
"@babel/preset-typescript": "^7.22.
|
|
110
|
-
"@babel/register": "^7.22.
|
|
105
|
+
"@babel/cli": "^7.22.15",
|
|
106
|
+
"@babel/core": "^7.22.17",
|
|
107
|
+
"@babel/preset-env": "^7.22.15",
|
|
108
|
+
"@babel/preset-react": "^7.22.15",
|
|
109
|
+
"@babel/preset-typescript": "^7.22.15",
|
|
110
|
+
"@babel/register": "^7.22.15",
|
|
111
111
|
"@commitlint/cli": "^17.7.1",
|
|
112
112
|
"@commitlint/config-conventional": "^17.7.0",
|
|
113
113
|
"@playwright/test": "^1.37.1",
|
|
114
114
|
"@release-it/conventional-changelog": "^7.0.1",
|
|
115
115
|
"@testing-library/dom": "^9.3.1",
|
|
116
|
-
"@testing-library/jest-dom": "^6.1.
|
|
116
|
+
"@testing-library/jest-dom": "^6.1.3",
|
|
117
117
|
"@testing-library/react": "^14.0.0",
|
|
118
118
|
"@testing-library/user-event": "^14.4.3",
|
|
119
119
|
"@types/lodash": "^4.14.197",
|
|
@@ -121,14 +121,14 @@
|
|
|
121
121
|
"@types/nunjucks": "^3.2.3",
|
|
122
122
|
"@types/react": "^18.2.21",
|
|
123
123
|
"@types/react-dom": "^18.2.7",
|
|
124
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
125
|
-
"@typescript-eslint/parser": "^6.
|
|
124
|
+
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
|
125
|
+
"@typescript-eslint/parser": "^6.6.0",
|
|
126
126
|
"babel-loader": "^9.1.3",
|
|
127
127
|
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
128
128
|
"babel-plugin-module-resolver": "^5.0.0",
|
|
129
129
|
"concurrently": "^8.2.1",
|
|
130
130
|
"dprint": "^0.40.2",
|
|
131
|
-
"eslint": "^8.
|
|
131
|
+
"eslint": "^8.49.0",
|
|
132
132
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
133
133
|
"eslint-import-resolver-typescript": "^3.6.0",
|
|
134
134
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
138
138
|
"eslint-plugin-unicorn": "^48.0.1",
|
|
139
139
|
"glob": "^10.3.4",
|
|
140
|
-
"happy-dom": "^
|
|
140
|
+
"happy-dom": "^11.0.2",
|
|
141
141
|
"husky": "^8.0.3",
|
|
142
142
|
"lint-staged": "^14.0.1",
|
|
143
143
|
"postcss-cli": "^10.1.0",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"ts-node": "^10.9.1",
|
|
155
155
|
"tsconfig-paths": "^4.2.0",
|
|
156
156
|
"typescript": "^5.0.4",
|
|
157
|
-
"vitest": "^0.34.
|
|
157
|
+
"vitest": "^0.34.4",
|
|
158
158
|
"webpack": "^5.88.2",
|
|
159
159
|
"webpack-cli": "^5.1.4"
|
|
160
160
|
},
|
package/react/esm/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from './footer';
|
|
|
10
10
|
export * from './header';
|
|
11
11
|
export * from './hint';
|
|
12
12
|
export * from './input';
|
|
13
|
+
export * from './inset-text';
|
|
13
14
|
export * from './label';
|
|
14
15
|
export * from './MODUKBody/MODUKBody';
|
|
15
16
|
export * from './phase-banner';
|
|
@@ -18,4 +19,5 @@ export * from './summary-list';
|
|
|
18
19
|
export * from './table';
|
|
19
20
|
export * from './tag';
|
|
20
21
|
export * from './textarea';
|
|
21
|
-
export * from './VisuallyHiddenText';
|
|
22
|
+
export * from './VisuallyHiddenText';
|
|
23
|
+
export * from './warning-text';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["children", "className"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
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 InsetText = forwardRef(function (_ref, ref) {
|
|
14
|
+
var children = _ref.children,
|
|
15
|
+
className = _ref.className,
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
return _jsx("div", _objectSpread(_objectSpread({
|
|
18
|
+
ref: ref,
|
|
19
|
+
className: clsx('govuk-inset-text', className)
|
|
20
|
+
}, rest), {}, {
|
|
21
|
+
children: children
|
|
22
|
+
}));
|
|
23
|
+
});
|
|
24
|
+
InsetText.displayName = 'InsetText';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InsetText';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { MODUKBody } from '../../MODUKBody/MODUKBody';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
5
|
export var Root = function Root(_ref) {
|
|
5
6
|
var exampleName = _ref.exampleName,
|
|
6
7
|
component = _ref.component,
|
|
7
8
|
children = _ref.children;
|
|
8
9
|
var titlePrefix = exampleName && component ? "".concat(exampleName, " \u2013 ").concat(component, " \u2013 ") : '';
|
|
9
|
-
return _jsxs(
|
|
10
|
-
lang: "en",
|
|
10
|
+
return _jsxs(_Fragment, {
|
|
11
11
|
children: [_jsxs("head", {
|
|
12
12
|
children: [_jsx("title", {
|
|
13
13
|
children: "".concat(titlePrefix, "MOD.UK Frontend React")
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["children", "className", "iconFallbackText"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
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 WarningText = forwardRef(function (_ref, ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
_ref$iconFallbackText = _ref.iconFallbackText,
|
|
18
|
+
iconFallbackText = _ref$iconFallbackText === void 0 ? 'Warning' : _ref$iconFallbackText,
|
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return _jsxs("div", _objectSpread(_objectSpread({
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: clsx('govuk-warning-text', className)
|
|
23
|
+
}, rest), {}, {
|
|
24
|
+
children: [_jsx("span", {
|
|
25
|
+
className: "govuk-warning-text__icon",
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
children: "!"
|
|
28
|
+
}), _jsxs("strong", {
|
|
29
|
+
className: "govuk-warning-text__text",
|
|
30
|
+
children: [_jsx("span", {
|
|
31
|
+
className: "govuk-warning-text__assistive",
|
|
32
|
+
children: iconFallbackText
|
|
33
|
+
}), children]
|
|
34
|
+
})]
|
|
35
|
+
}));
|
|
36
|
+
});
|
|
37
|
+
WarningText.displayName = 'WarningText';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WarningText } from './WarningText';
|
package/react/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './footer';
|
|
|
8
8
|
export * from './header';
|
|
9
9
|
export * from './hint';
|
|
10
10
|
export * from './input';
|
|
11
|
+
export * from './inset-text';
|
|
11
12
|
export * from './label';
|
|
12
13
|
export * from './MODUKBody/MODUKBody';
|
|
13
14
|
export * from './phase-banner';
|
|
@@ -17,4 +18,5 @@ export * from './table';
|
|
|
17
18
|
export * from './tag';
|
|
18
19
|
export * from './textarea';
|
|
19
20
|
export * from './VisuallyHiddenText';
|
|
21
|
+
export * from './warning-text';
|
|
20
22
|
//# sourceMappingURL=index.d.ts.map
|
package/react/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,YAAY,CAAA;AAC1B,cAAc,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,YAAY,CAAA;AAC1B,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA"}
|