@laerdal/life-react-components 2.3.1-dev.11.full → 2.3.1-dev.12
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/Footer/SiteFooter.cjs +19 -30
- package/dist/Footer/SiteFooter.cjs.map +1 -1
- package/dist/Footer/SiteFooter.d.ts +1 -3
- package/dist/Footer/SiteFooter.js +19 -31
- package/dist/Footer/SiteFooter.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +2 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js +2 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js +2 -2
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs +66 -5
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.js +66 -5
- package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/SubMenu.cjs +102 -19
- package/dist/GlobalNavigationBar/desktop/SubMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/SubMenu.d.ts +4 -1
- package/dist/GlobalNavigationBar/desktop/SubMenu.js +102 -19
- package/dist/GlobalNavigationBar/desktop/SubMenu.js.map +1 -1
- package/dist/Layouts/index.cjs +6 -4
- package/dist/Layouts/index.cjs.map +1 -1
- package/dist/Layouts/index.d.ts +1 -0
- package/dist/Layouts/index.js +4 -3
- package/dist/Layouts/index.js.map +1 -1
- package/dist/NavItem/NestedNavItem.cjs.map +1 -1
- package/dist/NavItem/NestedNavItem.js.map +1 -1
- package/dist/Tabs/TabLink.cjs +3 -4
- package/dist/Tabs/TabLink.cjs.map +1 -1
- package/dist/Tabs/TabLink.d.ts +13 -14
- package/dist/Tabs/TabLink.js +3 -4
- package/dist/Tabs/TabLink.js.map +1 -1
- package/package.json +3 -3
|
@@ -17,15 +17,14 @@ var _FooterTop = _interopRequireDefault(require("./Components/FooterTop"));
|
|
|
17
17
|
var _FooterNewsletterAndSocialSection = _interopRequireDefault(require("./Components/FooterNewsletterAndSocialSection"));
|
|
18
18
|
var _FooterNavSection = _interopRequireDefault(require("./Components/FooterNavSection"));
|
|
19
19
|
var _styles = require("../styles");
|
|
20
|
-
var _Layouts = require("../Layouts");
|
|
21
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
var _excluded = ["id", "sitename", "bottomLinks", "showBetaTag", "copyrightText", "toTopText", "placeholderEmailField", "includeNewsletterAndSocialSection", "newsletterLabel", "navOptions", "onNewsletterSignup"
|
|
21
|
+
var _excluded = ["id", "sitename", "bottomLinks", "showBetaTag", "copyrightText", "toTopText", "placeholderEmailField", "includeNewsletterAndSocialSection", "newsletterLabel", "navOptions", "onNewsletterSignup"];
|
|
23
22
|
var _templateObject, _templateObject2;
|
|
24
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
25
|
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; }
|
|
27
26
|
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) { (0, _defineProperty2.default)(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; }
|
|
28
|
-
var FooterContainer = _styledComponents.default.footer(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin-top: auto;\n background-color: ", ";\n border-top: 8px solid ", ";\n\n padding
|
|
27
|
+
var FooterContainer = _styledComponents.default.footer(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin-top: auto;\n background-color: ", ";\n border-top: 8px solid ", ";\n\n padding: 0 16px 16px;\n\n ", " {\n padding: 16px 32px;\n }\n\n ", " {\n padding: 16px 64px;\n }\n"])), _styles.COLORS.neutral_800, _styles.COLORS.neutral_200, _styles.BREAKPOINTS.MEDIUM, _styles.BREAKPOINTS.LARGE);
|
|
29
28
|
var FooterLine = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border-top: 1px solid ", ";\n display: none;\n ", " {\n display: block;\n }\n"])), _styles.COLORS.white, _styles.BREAKPOINTS.MEDIUM);
|
|
30
29
|
var SiteFooter = function SiteFooter(_ref) {
|
|
31
30
|
var id = _ref.id,
|
|
@@ -39,34 +38,26 @@ var SiteFooter = function SiteFooter(_ref) {
|
|
|
39
38
|
newsletterLabel = _ref.newsletterLabel,
|
|
40
39
|
navOptions = _ref.navOptions,
|
|
41
40
|
onNewsletterSignup = _ref.onNewsletterSignup,
|
|
42
|
-
_ref$useMaxWidth = _ref.useMaxWidth,
|
|
43
|
-
useMaxWidth = _ref$useMaxWidth === void 0 ? true : _ref$useMaxWidth,
|
|
44
|
-
maxWidth = _ref.maxWidth,
|
|
45
41
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
46
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
42
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(FooterContainer, _objectSpread(_objectSpread({
|
|
47
43
|
id: id,
|
|
48
44
|
"data-testid": 'footer-container'
|
|
49
45
|
}, rest), {}, {
|
|
50
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FooterBottomLinks.default, {
|
|
66
|
-
bottomLinks: bottomLinks,
|
|
67
|
-
copyrightText: copyrightText
|
|
68
|
-
})]
|
|
69
|
-
})
|
|
46
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FooterTop.default, {
|
|
47
|
+
sitename: sitename,
|
|
48
|
+
showBetaTag: showBetaTag,
|
|
49
|
+
toTopText: toTopText
|
|
50
|
+
}), navOptions && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FooterNavSection.default, {
|
|
51
|
+
mainId: id,
|
|
52
|
+
navOptions: navOptions
|
|
53
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(FooterLine, {}), includeNewsletterAndSocialSection && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FooterNewsletterAndSocialSection.default, {
|
|
54
|
+
placeholderEmail: placeholderEmailField,
|
|
55
|
+
actionOnNewsletterSignup: onNewsletterSignup,
|
|
56
|
+
newsletterLabel: newsletterLabel || ''
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FooterBottomLinks.default, {
|
|
58
|
+
bottomLinks: bottomLinks,
|
|
59
|
+
copyrightText: copyrightText
|
|
60
|
+
})]
|
|
70
61
|
}));
|
|
71
62
|
};
|
|
72
63
|
SiteFooter.propTypes = {
|
|
@@ -80,9 +71,7 @@ SiteFooter.propTypes = {
|
|
|
80
71
|
newsletterLabel: _propTypes.default.string,
|
|
81
72
|
toTopText: _propTypes.default.string.isRequired,
|
|
82
73
|
placeholderEmailField: _propTypes.default.string,
|
|
83
|
-
onNewsletterSignup: _propTypes.default.func
|
|
84
|
-
useMaxWidth: _propTypes.default.bool,
|
|
85
|
-
maxWidth: _propTypes.default.number
|
|
74
|
+
onNewsletterSignup: _propTypes.default.func
|
|
86
75
|
};
|
|
87
76
|
var _default = SiteFooter;
|
|
88
77
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteFooter.cjs","names":["FooterContainer","styled","footer","COLORS","neutral_800","neutral_200","BREAKPOINTS","MEDIUM","LARGE","FooterLine","div","white","SiteFooter","id","sitename","bottomLinks","showBetaTag","copyrightText","toTopText","placeholderEmailField","includeNewsletterAndSocialSection","newsletterLabel","navOptions","onNewsletterSignup","
|
|
1
|
+
{"version":3,"file":"SiteFooter.cjs","names":["FooterContainer","styled","footer","COLORS","neutral_800","neutral_200","BREAKPOINTS","MEDIUM","LARGE","FooterLine","div","white","SiteFooter","id","sitename","bottomLinks","showBetaTag","copyrightText","toTopText","placeholderEmailField","includeNewsletterAndSocialSection","newsletterLabel","navOptions","onNewsletterSignup","rest","actionOnNewsletterSignup"],"sources":["../../src/Footer/SiteFooter.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom components.\n */\nimport FooterBottomLinks from './Components/FooterBottomLinks';\nimport FooterTop from './Components/FooterTop';\nimport FooterNewsletterAndSocialSection from './Components/FooterNewsletterAndSocialSection';\nimport FooterNavSection from './Components/FooterNavSection';\nimport { BREAKPOINTS, COLORS } from '../styles';\n\n/**\n * Import custom styles.\n */\nimport { NavLink, NavOptions } from '../types';\n\nconst FooterContainer = styled.footer`\n margin-top: auto;\n background-color: ${COLORS.neutral_800};\n border-top: 8px solid ${COLORS.neutral_200};\n\n padding: 0 16px 16px;\n\n ${BREAKPOINTS.MEDIUM} {\n padding: 16px 32px;\n }\n\n ${BREAKPOINTS.LARGE} {\n padding: 16px 64px;\n }\n`;\nconst FooterLine = styled.div`\n border-top: 1px solid ${COLORS.white};\n display: none;\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n`;\n\ninterface NewFooterProps extends Omit<React.HTMLAttributes<HTMLElement>, 'id'> {\n id: string;\n sitename?: string;\n showBetaTag?: boolean;\n bottomLinks?: NavLink[];\n copyrightText?: string;\n includeNewsletterAndSocialSection?: boolean;\n actionOnNewsletterSignup?: (email: string) => void;\n newsletterLabel?: string;\n toTopText: string;\n navOptions?: NavOptions;\n placeholderEmailField?: string;\n onNewsletterSignup?: (email: string) => void;\n}\n\nconst SiteFooter = ({\n id,\n sitename,\n bottomLinks,\n showBetaTag,\n copyrightText,\n toTopText,\n placeholderEmailField,\n includeNewsletterAndSocialSection,\n newsletterLabel,\n navOptions,\n onNewsletterSignup,\n ...rest\n}: NewFooterProps) => {\n return (\n <FooterContainer id={id} data-testid={'footer-container'} {...rest}>\n <FooterTop sitename={sitename} showBetaTag={showBetaTag} toTopText={toTopText} />\n {navOptions && <FooterNavSection mainId={id} navOptions={navOptions} />}\n <FooterLine />\n {includeNewsletterAndSocialSection && (\n <FooterNewsletterAndSocialSection placeholderEmail={placeholderEmailField} actionOnNewsletterSignup={onNewsletterSignup} newsletterLabel={newsletterLabel || ''} />\n )}\n <FooterBottomLinks bottomLinks={bottomLinks} copyrightText={copyrightText} />\n </FooterContainer>\n );\n};\n\nexport default SiteFooter;\n"],"mappings":";;;;;;;;;;;;AAGA;AAKA;AAKA;AACA;AACA;AACA;AACA;AAAgD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOhD,IAAMA,eAAe,GAAGC,yBAAM,CAACC,MAAM,oRAEfC,cAAM,CAACC,WAAW,EACdD,cAAM,CAACE,WAAW,EAIxCC,mBAAW,CAACC,MAAM,EAIlBD,mBAAW,CAACE,KAAK,CAGpB;AACD,IAAMC,UAAU,GAAGR,yBAAM,CAACS,GAAG,6KACHP,cAAM,CAACQ,KAAK,EAElCL,mBAAW,CAACC,MAAM,CAGrB;AAiBD,IAAMK,UAAU,GAAG,SAAbA,UAAU,OAaM;EAAA,IAZpBC,EAAE,QAAFA,EAAE;IACFC,QAAQ,QAARA,QAAQ;IACRC,WAAW,QAAXA,WAAW;IACXC,WAAW,QAAXA,WAAW;IACXC,aAAa,QAAbA,aAAa;IACbC,SAAS,QAATA,SAAS;IACTC,qBAAqB,QAArBA,qBAAqB;IACrBC,iCAAiC,QAAjCA,iCAAiC;IACjCC,eAAe,QAAfA,eAAe;IACfC,UAAU,QAAVA,UAAU;IACVC,kBAAkB,QAAlBA,kBAAkB;IACfC,IAAI;EAEP,oBACE,sBAAC,eAAe;IAAC,EAAE,EAAEX,EAAG;IAAC,eAAa;EAAmB,GAAKW,IAAI;IAAA,wBAChE,qBAAC,kBAAS;MAAC,QAAQ,EAAEV,QAAS;MAAC,WAAW,EAAEE,WAAY;MAAC,SAAS,EAAEE;IAAU,EAAG,EAChFI,UAAU,iBAAI,qBAAC,yBAAgB;MAAC,MAAM,EAAET,EAAG;MAAC,UAAU,EAAES;IAAW,EAAG,eACvE,qBAAC,UAAU,KAAG,EACbF,iCAAiC,iBAChC,qBAAC,yCAAgC;MAAC,gBAAgB,EAAED,qBAAsB;MAAC,wBAAwB,EAAEI,kBAAmB;MAAC,eAAe,EAAEF,eAAe,IAAI;IAAG,EACjK,eACD,qBAAC,0BAAiB;MAAC,WAAW,EAAEN,WAAY;MAAC,aAAa,EAAEE;IAAc,EAAG;EAAA,GAC7D;AAEtB,CAAC;AAAC;EAvCAJ,EAAE;EACFC,QAAQ;EACRE,WAAW;EACXD,WAAW;EACXE,aAAa;EACbG,iCAAiC;EACjCK,wBAAwB;EACxBJ,eAAe;EACfH,SAAS;EAETC,qBAAqB;EACrBI,kBAAkB;AAAA;AAAA,eA8BLX,UAAU;AAAA"}
|
|
@@ -19,8 +19,6 @@ interface NewFooterProps extends Omit<React.HTMLAttributes<HTMLElement>, 'id'> {
|
|
|
19
19
|
navOptions?: NavOptions;
|
|
20
20
|
placeholderEmailField?: string;
|
|
21
21
|
onNewsletterSignup?: (email: string) => void;
|
|
22
|
-
useMaxWidth?: boolean;
|
|
23
|
-
maxWidth?: number;
|
|
24
22
|
}
|
|
25
|
-
declare const SiteFooter: ({ id, sitename, bottomLinks, showBetaTag, copyrightText, toTopText, placeholderEmailField, includeNewsletterAndSocialSection, newsletterLabel, navOptions, onNewsletterSignup,
|
|
23
|
+
declare const SiteFooter: ({ id, sitename, bottomLinks, showBetaTag, copyrightText, toTopText, placeholderEmailField, includeNewsletterAndSocialSection, newsletterLabel, navOptions, onNewsletterSignup, ...rest }: NewFooterProps) => JSX.Element;
|
|
26
24
|
export default SiteFooter;
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
4
4
|
import _pt from "prop-types";
|
|
5
|
-
var _excluded = ["id", "sitename", "bottomLinks", "showBetaTag", "copyrightText", "toTopText", "placeholderEmailField", "includeNewsletterAndSocialSection", "newsletterLabel", "navOptions", "onNewsletterSignup"
|
|
5
|
+
var _excluded = ["id", "sitename", "bottomLinks", "showBetaTag", "copyrightText", "toTopText", "placeholderEmailField", "includeNewsletterAndSocialSection", "newsletterLabel", "navOptions", "onNewsletterSignup"];
|
|
6
6
|
var _templateObject, _templateObject2;
|
|
7
7
|
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; }
|
|
8
8
|
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; }
|
|
@@ -28,11 +28,9 @@ import { BREAKPOINTS, COLORS } from '../styles';
|
|
|
28
28
|
/**
|
|
29
29
|
* Import custom styles.
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
import { PageWidth } from "../Layouts";
|
|
33
31
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
32
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
35
|
-
var FooterContainer = styled.footer(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: auto;\n background-color: ", ";\n border-top: 8px solid ", ";\n\n padding
|
|
33
|
+
var FooterContainer = styled.footer(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: auto;\n background-color: ", ";\n border-top: 8px solid ", ";\n\n padding: 0 16px 16px;\n\n ", " {\n padding: 16px 32px;\n }\n\n ", " {\n padding: 16px 64px;\n }\n"])), COLORS.neutral_800, COLORS.neutral_200, BREAKPOINTS.MEDIUM, BREAKPOINTS.LARGE);
|
|
36
34
|
var FooterLine = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-top: 1px solid ", ";\n display: none;\n ", " {\n display: block;\n }\n"])), COLORS.white, BREAKPOINTS.MEDIUM);
|
|
37
35
|
var SiteFooter = function SiteFooter(_ref) {
|
|
38
36
|
var id = _ref.id,
|
|
@@ -46,34 +44,26 @@ var SiteFooter = function SiteFooter(_ref) {
|
|
|
46
44
|
newsletterLabel = _ref.newsletterLabel,
|
|
47
45
|
navOptions = _ref.navOptions,
|
|
48
46
|
onNewsletterSignup = _ref.onNewsletterSignup,
|
|
49
|
-
_ref$useMaxWidth = _ref.useMaxWidth,
|
|
50
|
-
useMaxWidth = _ref$useMaxWidth === void 0 ? true : _ref$useMaxWidth,
|
|
51
|
-
maxWidth = _ref.maxWidth,
|
|
52
47
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
53
|
-
return /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/_jsxs(FooterContainer, _objectSpread(_objectSpread({
|
|
54
49
|
id: id,
|
|
55
50
|
"data-testid": 'footer-container'
|
|
56
51
|
}, rest), {}, {
|
|
57
|
-
children: /*#__PURE__*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}), /*#__PURE__*/_jsx(FooterBottomLinks, {
|
|
73
|
-
bottomLinks: bottomLinks,
|
|
74
|
-
copyrightText: copyrightText
|
|
75
|
-
})]
|
|
76
|
-
})
|
|
52
|
+
children: [/*#__PURE__*/_jsx(FooterTop, {
|
|
53
|
+
sitename: sitename,
|
|
54
|
+
showBetaTag: showBetaTag,
|
|
55
|
+
toTopText: toTopText
|
|
56
|
+
}), navOptions && /*#__PURE__*/_jsx(FooterNavSection, {
|
|
57
|
+
mainId: id,
|
|
58
|
+
navOptions: navOptions
|
|
59
|
+
}), /*#__PURE__*/_jsx(FooterLine, {}), includeNewsletterAndSocialSection && /*#__PURE__*/_jsx(FooterNewsletterAndSocialSection, {
|
|
60
|
+
placeholderEmail: placeholderEmailField,
|
|
61
|
+
actionOnNewsletterSignup: onNewsletterSignup,
|
|
62
|
+
newsletterLabel: newsletterLabel || ''
|
|
63
|
+
}), /*#__PURE__*/_jsx(FooterBottomLinks, {
|
|
64
|
+
bottomLinks: bottomLinks,
|
|
65
|
+
copyrightText: copyrightText
|
|
66
|
+
})]
|
|
77
67
|
}));
|
|
78
68
|
};
|
|
79
69
|
SiteFooter.propTypes = {
|
|
@@ -87,9 +77,7 @@ SiteFooter.propTypes = {
|
|
|
87
77
|
newsletterLabel: _pt.string,
|
|
88
78
|
toTopText: _pt.string.isRequired,
|
|
89
79
|
placeholderEmailField: _pt.string,
|
|
90
|
-
onNewsletterSignup: _pt.func
|
|
91
|
-
useMaxWidth: _pt.bool,
|
|
92
|
-
maxWidth: _pt.number
|
|
80
|
+
onNewsletterSignup: _pt.func
|
|
93
81
|
};
|
|
94
82
|
export default SiteFooter;
|
|
95
83
|
//# sourceMappingURL=SiteFooter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteFooter.js","names":["React","styled","FooterBottomLinks","FooterTop","FooterNewsletterAndSocialSection","FooterNavSection","BREAKPOINTS","COLORS","
|
|
1
|
+
{"version":3,"file":"SiteFooter.js","names":["React","styled","FooterBottomLinks","FooterTop","FooterNewsletterAndSocialSection","FooterNavSection","BREAKPOINTS","COLORS","FooterContainer","footer","neutral_800","neutral_200","MEDIUM","LARGE","FooterLine","div","white","SiteFooter","id","sitename","bottomLinks","showBetaTag","copyrightText","toTopText","placeholderEmailField","includeNewsletterAndSocialSection","newsletterLabel","navOptions","onNewsletterSignup","rest","actionOnNewsletterSignup"],"sources":["../../src/Footer/SiteFooter.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom components.\n */\nimport FooterBottomLinks from './Components/FooterBottomLinks';\nimport FooterTop from './Components/FooterTop';\nimport FooterNewsletterAndSocialSection from './Components/FooterNewsletterAndSocialSection';\nimport FooterNavSection from './Components/FooterNavSection';\nimport { BREAKPOINTS, COLORS } from '../styles';\n\n/**\n * Import custom styles.\n */\nimport { NavLink, NavOptions } from '../types';\n\nconst FooterContainer = styled.footer`\n margin-top: auto;\n background-color: ${COLORS.neutral_800};\n border-top: 8px solid ${COLORS.neutral_200};\n\n padding: 0 16px 16px;\n\n ${BREAKPOINTS.MEDIUM} {\n padding: 16px 32px;\n }\n\n ${BREAKPOINTS.LARGE} {\n padding: 16px 64px;\n }\n`;\nconst FooterLine = styled.div`\n border-top: 1px solid ${COLORS.white};\n display: none;\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n`;\n\ninterface NewFooterProps extends Omit<React.HTMLAttributes<HTMLElement>, 'id'> {\n id: string;\n sitename?: string;\n showBetaTag?: boolean;\n bottomLinks?: NavLink[];\n copyrightText?: string;\n includeNewsletterAndSocialSection?: boolean;\n actionOnNewsletterSignup?: (email: string) => void;\n newsletterLabel?: string;\n toTopText: string;\n navOptions?: NavOptions;\n placeholderEmailField?: string;\n onNewsletterSignup?: (email: string) => void;\n}\n\nconst SiteFooter = ({\n id,\n sitename,\n bottomLinks,\n showBetaTag,\n copyrightText,\n toTopText,\n placeholderEmailField,\n includeNewsletterAndSocialSection,\n newsletterLabel,\n navOptions,\n onNewsletterSignup,\n ...rest\n}: NewFooterProps) => {\n return (\n <FooterContainer id={id} data-testid={'footer-container'} {...rest}>\n <FooterTop sitename={sitename} showBetaTag={showBetaTag} toTopText={toTopText} />\n {navOptions && <FooterNavSection mainId={id} navOptions={navOptions} />}\n <FooterLine />\n {includeNewsletterAndSocialSection && (\n <FooterNewsletterAndSocialSection placeholderEmail={placeholderEmailField} actionOnNewsletterSignup={onNewsletterSignup} newsletterLabel={newsletterLabel || ''} />\n )}\n <FooterBottomLinks bottomLinks={bottomLinks} copyrightText={copyrightText} />\n </FooterContainer>\n );\n};\n\nexport default SiteFooter;\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;;AAE9B;AACA;AACA;AACA,OAAOC,MAAM,MAAM,mBAAmB;;AAEtC;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,SAAS,MAAM,wBAAwB;AAC9C,OAAOC,gCAAgC,MAAM,+CAA+C;AAC5F,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,SAASC,WAAW,EAAEC,MAAM,QAAQ,WAAW;;AAE/C;AACA;AACA;AAFA;AAAA;AAKA,IAAMC,eAAe,GAAGP,MAAM,CAACQ,MAAM,sQAEfF,MAAM,CAACG,WAAW,EACdH,MAAM,CAACI,WAAW,EAIxCL,WAAW,CAACM,MAAM,EAIlBN,WAAW,CAACO,KAAK,CAGpB;AACD,IAAMC,UAAU,GAAGb,MAAM,CAACc,GAAG,+JACHR,MAAM,CAACS,KAAK,EAElCV,WAAW,CAACM,MAAM,CAGrB;AAiBD,IAAMK,UAAU,GAAG,SAAbA,UAAU,OAaM;EAAA,IAZpBC,EAAE,QAAFA,EAAE;IACFC,QAAQ,QAARA,QAAQ;IACRC,WAAW,QAAXA,WAAW;IACXC,WAAW,QAAXA,WAAW;IACXC,aAAa,QAAbA,aAAa;IACbC,SAAS,QAATA,SAAS;IACTC,qBAAqB,QAArBA,qBAAqB;IACrBC,iCAAiC,QAAjCA,iCAAiC;IACjCC,eAAe,QAAfA,eAAe;IACfC,UAAU,QAAVA,UAAU;IACVC,kBAAkB,QAAlBA,kBAAkB;IACfC,IAAI;EAEP,oBACE,MAAC,eAAe;IAAC,EAAE,EAAEX,EAAG;IAAC,eAAa;EAAmB,GAAKW,IAAI;IAAA,wBAChE,KAAC,SAAS;MAAC,QAAQ,EAAEV,QAAS;MAAC,WAAW,EAAEE,WAAY;MAAC,SAAS,EAAEE;IAAU,EAAG,EAChFI,UAAU,iBAAI,KAAC,gBAAgB;MAAC,MAAM,EAAET,EAAG;MAAC,UAAU,EAAES;IAAW,EAAG,eACvE,KAAC,UAAU,KAAG,EACbF,iCAAiC,iBAChC,KAAC,gCAAgC;MAAC,gBAAgB,EAAED,qBAAsB;MAAC,wBAAwB,EAAEI,kBAAmB;MAAC,eAAe,EAAEF,eAAe,IAAI;IAAG,EACjK,eACD,KAAC,iBAAiB;MAAC,WAAW,EAAEN,WAAY;MAAC,aAAa,EAAEE;IAAc,EAAG;EAAA,GAC7D;AAEtB,CAAC;AAAC;EAvCAJ,EAAE;EACFC,QAAQ;EACRE,WAAW;EACXD,WAAW;EACXE,aAAa;EACbG,iCAAiC;EACjCK,wBAAwB;EACxBJ,eAAe;EACfH,SAAS;EAETC,qBAAqB;EACrBI,kBAAkB;AAAA;AA8BpB,eAAeX,UAAU"}
|
|
@@ -117,6 +117,8 @@ var DesktopActions = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
|
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
|
|
120
|
+
role: "toolbar",
|
|
121
|
+
"aria-label": "Toolbar",
|
|
120
122
|
children: buttons === null || buttons === void 0 ? void 0 : buttons.map(function (item, index) {
|
|
121
123
|
return renderItem(item, index);
|
|
122
124
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DesktopActions.cjs","names":["Wrapper","styled","div","BREAKPOINTS","MEDIUM","ProfileWrapper","DesktopActions","React","forwardRef","ref","buttons","user","profileComponent","onShowUserMenu","useState","elRefs","setElRefs","length","useEffect","Array","fill","map","createRef","useImperativeHandle","r","index","type","renderItem","item","placement","action","rest","e","target","firstName","charAt","lastName","icon"],"sources":["../../../src/GlobalNavigationBar/desktop/DesktopActions.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport {MenuAccountInfo, MobileMenuButtonTypes, DesktopMenuButtonTypes} from '../types';\nimport {IconButton} from '../../Button';\nimport {ProfileButton} from '../../ProfileButton';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS} from '../../styles';\n\nconst Wrapper = styled.div`\n align-items: center;\n\n display: none;\n\n ${BREAKPOINTS.MEDIUM} {\n display: flex;\n }\n`;\n\nconst ProfileWrapper = styled.div`\n margin: 0 8px;\n`;\n\n\ninterface DesktopActionsProps {\n buttons?: DesktopMenuButtonTypes[];\n user?: MenuAccountInfo;\n profileComponent?: React.ReactNode\n onShowUserMenu: () => void;\n}\n\nexport interface DesktopActionsRef {\n buttons?: { ref: React.MutableRefObject<HTMLButtonElement | null>, type: 'profile' | 'action' | 'switcher' | undefined }[]\n}\n\nconst DesktopActions = React.forwardRef(({\n buttons,\n user,\n profileComponent,\n onShowUserMenu\n }: DesktopActionsProps, ref: React.Ref<DesktopActionsRef>) => {\n\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement>[]>([]);\n\n const length = buttons?.length || 0;\n\n React.useEffect(() => {\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\n }, [length]);\n\n React.useImperativeHandle(ref, () => ({\n buttons: elRefs.map((r, index) => ({\n ref: r,\n type: buttons?.[index]?.type,\n }))\n }), [elRefs, buttons]);\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile': {\n const {placement, type, action, ...rest} = item;\n if(!!profileComponent)\n return <ProfileWrapper>{profileComponent}</ProfileWrapper>;\n else\n return <ProfileWrapper>\n <ProfileButton key={index}\n ref={elRefs[index]}\n hideOnLowWidth={true}\n onClick={e => {\n item.action ? item.action(e?.target) : onShowUserMenu()\n }}\n icon={!user && <SystemIcons.User/>}\n initials={(user?.firstName?.charAt(0) ?? '') + (user?.lastName?.charAt(0) ?? '')}\n {...rest}/>\n </ProfileWrapper>\n }\n case 'action': {\n const {placement, type, icon, action, ...rest} = item;\n return <IconButton key={index}\n ref={elRefs[index]}\n variant={'secondary'}\n shape={'circular'}\n hideOnLowWidth={true}\n action={e => item.action && item.action(e?.target)}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n case 'switcher': {\n const {placement, type, action, ...rest} = item;\n return <IconButton key={index}\n ref={elRefs[index]}\n variant={'secondary'}\n shape={'circular'}\n hideOnLowWidth={true}\n id=\"globalNavAppsButton\"\n action={e => item.action && item.action(e?.target)}\n {...rest}>\n <SystemIcons.SwitchApp size=\"24px\"/>\n </IconButton>\n }\n }\n }\n\n return (\n <Wrapper>\n {buttons?.map((item, index) => renderItem(item, index))}\n </Wrapper>\n )\n});\n\n\nexport default DesktopActions;\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAyC;AAAA;EAAA;EAAA;AAAA;AAAA;AAAA;AAEzC,IAAMA,OAAO,GAAGC,yBAAM,CAACC,GAAG,uKAKtBC,mBAAW,CAACC,MAAM,CAGrB;AAED,IAAMC,cAAc,GAAGJ,yBAAM,CAACC,GAAG,yGAEhC;AAcD,IAAOI,cAAc,gBAAGC,cAAK,CAACC,UAAU,CAAC,gBAKwBC,GAAiC,EAAK;EAAA,IAJ5DC,OAAO,QAAPA,OAAO;IACPC,IAAI,QAAJA,IAAI;IACHC,gBAAgB,QAAhBA,gBAAgB;IACjBC,cAAc,QAAdA,cAAc;EAGvD,sBAA4BN,cAAK,CAACO,QAAQ,CAAuC,EAAE,CAAC;IAAA;IAA7EC,MAAM;IAAEC,SAAS;EAExB,IAAMC,MAAM,GAAG,CAAAP,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEO,MAAM,KAAI,CAAC;EAEnCV,cAAK,CAACW,SAAS,CAAC,YAAM;IACpBF,SAAS,CAACG,KAAK,CAACF,MAAM,IAAI,CAAC,CAAC,CAACG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AAK;YACrB,EAAE,EAAC,qBAAqB;YACxB,MAAM,EAAE,gBAAAO,CAAC;cAAA,OAAIJ,IAAI,CAACE,MAAM,IAAIF,IAAI,CAACE,MAAM,CAACE,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEC,MAAM,CAAC;YAAA;UAAC,GAC/CF,MAAI;YAAA,uBACzB,qBAAC,kBAAW,CAAC,SAAS;cAAC,IAAI,EAAC;YAAM;UAAE,IARdN,KAAK,CAShB;QACf;IAAC;EAEL,CAAC;EAED,oBACE,qBAAC,OAAO;IAAA,
|
|
1
|
+
{"version":3,"file":"DesktopActions.cjs","names":["Wrapper","styled","div","BREAKPOINTS","MEDIUM","ProfileWrapper","DesktopActions","React","forwardRef","ref","buttons","user","profileComponent","onShowUserMenu","useState","elRefs","setElRefs","length","useEffect","Array","fill","map","createRef","useImperativeHandle","r","index","type","renderItem","item","placement","action","rest","e","target","firstName","charAt","lastName","icon"],"sources":["../../../src/GlobalNavigationBar/desktop/DesktopActions.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport {MenuAccountInfo, MobileMenuButtonTypes, DesktopMenuButtonTypes} from '../types';\nimport {IconButton} from '../../Button';\nimport {ProfileButton} from '../../ProfileButton';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS} from '../../styles';\n\nconst Wrapper = styled.div`\n align-items: center;\n\n display: none;\n\n ${BREAKPOINTS.MEDIUM} {\n display: flex;\n }\n`;\n\nconst ProfileWrapper = styled.div`\n margin: 0 8px;\n`;\n\n\ninterface DesktopActionsProps {\n buttons?: DesktopMenuButtonTypes[];\n user?: MenuAccountInfo;\n profileComponent?: React.ReactNode\n onShowUserMenu: () => void;\n}\n\nexport interface DesktopActionsRef {\n buttons?: { ref: React.MutableRefObject<HTMLButtonElement | null>, type: 'profile' | 'action' | 'switcher' | undefined }[]\n}\n\nconst DesktopActions = React.forwardRef(({\n buttons,\n user,\n profileComponent,\n onShowUserMenu\n }: DesktopActionsProps, ref: React.Ref<DesktopActionsRef>) => {\n\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement>[]>([]);\n\n const length = buttons?.length || 0;\n\n React.useEffect(() => {\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\n }, [length]);\n\n React.useImperativeHandle(ref, () => ({\n buttons: elRefs.map((r, index) => ({\n ref: r,\n type: buttons?.[index]?.type,\n }))\n }), [elRefs, buttons]);\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile': {\n const {placement, type, action, ...rest} = item;\n if(!!profileComponent)\n return <ProfileWrapper>{profileComponent}</ProfileWrapper>;\n else\n return <ProfileWrapper>\n <ProfileButton key={index}\n ref={elRefs[index]}\n hideOnLowWidth={true}\n onClick={e => {\n item.action ? item.action(e?.target) : onShowUserMenu()\n }}\n icon={!user && <SystemIcons.User/>}\n initials={(user?.firstName?.charAt(0) ?? '') + (user?.lastName?.charAt(0) ?? '')}\n {...rest}/>\n </ProfileWrapper>\n }\n case 'action': {\n const {placement, type, icon, action, ...rest} = item;\n return <IconButton key={index}\n ref={elRefs[index]}\n variant={'secondary'}\n shape={'circular'}\n hideOnLowWidth={true}\n action={e => item.action && item.action(e?.target)}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n case 'switcher': {\n const {placement, type, action, ...rest} = item;\n return <IconButton key={index}\n ref={elRefs[index]}\n variant={'secondary'}\n shape={'circular'}\n hideOnLowWidth={true}\n id=\"globalNavAppsButton\"\n action={e => item.action && item.action(e?.target)}\n {...rest}>\n <SystemIcons.SwitchApp size=\"24px\"/>\n </IconButton>\n }\n }\n }\n\n return (\n <Wrapper role=\"toolbar\" aria-label=\"Toolbar\">\n {buttons?.map((item, index) => renderItem(item, index))}\n </Wrapper>\n )\n});\n\n\nexport default DesktopActions;\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAyC;AAAA;EAAA;EAAA;AAAA;AAAA;AAAA;AAEzC,I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Ac;AAAA"}
|
|
@@ -110,6 +110,8 @@ var DesktopActions = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
return /*#__PURE__*/_jsx(Wrapper, {
|
|
113
|
+
role: "toolbar",
|
|
114
|
+
"aria-label": "Toolbar",
|
|
113
115
|
children: buttons === null || buttons === void 0 ? void 0 : buttons.map(function (item, index) {
|
|
114
116
|
return renderItem(item, index);
|
|
115
117
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DesktopActions.js","names":["React","styled","IconButton","ProfileButton","SystemIcons","BREAKPOINTS","Wrapper","div","MEDIUM","ProfileWrapper","DesktopActions","forwardRef","ref","buttons","user","profileComponent","onShowUserMenu","useState","elRefs","setElRefs","length","useEffect","Array","fill","map","createRef","useImperativeHandle","r","index","type","renderItem","item","placement","action","rest","e","target","firstName","charAt","lastName","icon"],"sources":["../../../src/GlobalNavigationBar/desktop/DesktopActions.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport {MenuAccountInfo, MobileMenuButtonTypes, DesktopMenuButtonTypes} from '../types';\nimport {IconButton} from '../../Button';\nimport {ProfileButton} from '../../ProfileButton';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS} from '../../styles';\n\nconst Wrapper = styled.div`\n align-items: center;\n\n display: none;\n\n ${BREAKPOINTS.MEDIUM} {\n display: flex;\n }\n`;\n\nconst ProfileWrapper = styled.div`\n margin: 0 8px;\n`;\n\n\ninterface DesktopActionsProps {\n buttons?: DesktopMenuButtonTypes[];\n user?: MenuAccountInfo;\n profileComponent?: React.ReactNode\n onShowUserMenu: () => void;\n}\n\nexport interface DesktopActionsRef {\n buttons?: { ref: React.MutableRefObject<HTMLButtonElement | null>, type: 'profile' | 'action' | 'switcher' | undefined }[]\n}\n\nconst DesktopActions = React.forwardRef(({\n buttons,\n user,\n profileComponent,\n onShowUserMenu\n }: DesktopActionsProps, ref: React.Ref<DesktopActionsRef>) => {\n\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement>[]>([]);\n\n const length = buttons?.length || 0;\n\n React.useEffect(() => {\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\n }, [length]);\n\n React.useImperativeHandle(ref, () => ({\n buttons: elRefs.map((r, index) => ({\n ref: r,\n type: buttons?.[index]?.type,\n }))\n }), [elRefs, buttons]);\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile': {\n const {placement, type, action, ...rest} = item;\n if(!!profileComponent)\n return <ProfileWrapper>{profileComponent}</ProfileWrapper>;\n else\n return <ProfileWrapper>\n <ProfileButton key={index}\n ref={elRefs[index]}\n hideOnLowWidth={true}\n onClick={e => {\n item.action ? item.action(e?.target) : onShowUserMenu()\n }}\n icon={!user && <SystemIcons.User/>}\n initials={(user?.firstName?.charAt(0) ?? '') + (user?.lastName?.charAt(0) ?? '')}\n {...rest}/>\n </ProfileWrapper>\n }\n case 'action': {\n const {placement, type, icon, action, ...rest} = item;\n return <IconButton key={index}\n ref={elRefs[index]}\n variant={'secondary'}\n shape={'circular'}\n hideOnLowWidth={true}\n action={e => item.action && item.action(e?.target)}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n case 'switcher': {\n const {placement, type, action, ...rest} = item;\n return <IconButton key={index}\n ref={elRefs[index]}\n variant={'secondary'}\n shape={'circular'}\n hideOnLowWidth={true}\n id=\"globalNavAppsButton\"\n action={e => item.action && item.action(e?.target)}\n {...rest}>\n <SystemIcons.SwitchApp size=\"24px\"/>\n </IconButton>\n }\n }\n }\n\n return (\n <Wrapper>\n {buttons?.map((item, index) => renderItem(item, index))}\n </Wrapper>\n )\n});\n\n\nexport default DesktopActions;\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAAQC,UAAU,QAAO,cAAc;AACvC,SAAQC,aAAa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ACrD,oBAAO,KAAC,UAAU;YACC,GAAG,EAAEb,MAAM,CAACU,KAAK,CAAE;YACnB,OAAO,EAAE,WAAY;YACrB,KAAK,EAAE,UAAW;YAClB,cAAc,EAAE,IAAK;YACrB,MAAM,EAAE,gBAAAO,CAAC;cAAA,OAAIJ,IAAI,CAACE,MAAM,IAAIF,IAAI,CAACE,MAAM,CAACE,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEC,MAAM,CAAC;YAAA;UAAC,GAC/CF,KAAI;YAAA,UACxBH,IAAI,CAACS;UAAI,IAPYZ,KAAK,CAQhB;QACf;MACA,KAAK,UAAU;QAAE;UACf,IAAOI,WAAS,GAA2BD,IAAI,CAAxCC,SAAS;YAAEH,MAAI,GAAqBE,IAAI,CAA7BF,IAAI;YAAEI,QAAM,GAAaF,IAAI,CAAvBE,MAAM;YAAKC,MAAI,4BAAIH,IAAI;UAC/C,oBAAO,KAAC,UAAU;YACC,GAAG,EAAEb,MAAM,CAACU,KAAK,CAAE;YACnB,OAAO,EAAE,WAAY;YACrB,KAAK,EAAE,UAAW;YAClB,cAAc,EAAE,IAAK;YACrB,EAAE,EAAC,qBAAqB;YACxB,MAAM,EAAE,gBAAAO,CAAC;cAAA,OAAIJ,IAAI,CAACE,MAAM,IAAIF,IAAI,CAACE,MAAM,CAACE,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEC,MAAM,CAAC;YAAA;UAAC,GAC/CF,MAAI;YAAA,uBACzB,KAAC,WAAW,CAAC,SAAS;cAAC,IAAI,EAAC;YAAM;UAAE,IARdN,KAAK,CAShB;QACf;IAAC;EAEL,CAAC;EAED,oBACE,KAAC,OAAO;IAAA,
|
|
1
|
+
{"version":3,"file":"DesktopActions.js","names":["React","styled","IconButton","ProfileButton","SystemIcons","BREAKPOINTS","Wrapper","div","MEDIUM","ProfileWrapper","DesktopActions","forwardRef","ref","buttons","user","profileComponent","onShowUserMenu","useState","elRefs","setElRefs","length","useEffect","Array","fill","map","createRef","useImperativeHandle","r","index","type","renderItem","item","placement","action","rest","e","target","firstName","charAt","lastName","icon"],"sources":["../../../src/GlobalNavigationBar/desktop/DesktopActions.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport {MenuAccountInfo, MobileMenuButtonTypes, DesktopMenuButtonTypes} from '../types';\nimport {IconButton} from '../../Button';\nimport {ProfileButton} from '../../ProfileButton';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS} from '../../styles';\n\nconst Wrapper = styled.div`\n align-items: center;\n\n display: none;\n\n ${BREAKPOINTS.MEDIUM} {\n display: flex;\n }\n`;\n\nconst ProfileWrapper = styled.div`\n margin: 0 8px;\n`;\n\n\ninterface DesktopActionsProps {\n buttons?: DesktopMenuButtonTypes[];\n user?: MenuAccountInfo;\n profileComponent?: React.ReactNode\n onShowUserMenu: () => void;\n}\n\nexport interface DesktopActionsRef {\n buttons?: { ref: React.MutableRefObject<HTMLButtonElement | null>, type: 'profile' | 'action' | 'switcher' | undefined }[]\n}\n\nconst DesktopActions = React.forwardRef(({\n buttons,\n user,\n profileComponent,\n onShowUserMenu\n }: DesktopActionsProps, ref: React.Ref<DesktopActionsRef>) => {\n\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement>[]>([]);\n\n const length = buttons?.length || 0;\n\n React.useEffect(() => {\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\n }, [length]);\n\n React.useImperativeHandle(ref, () => ({\n buttons: elRefs.map((r, index) => ({\n ref: r,\n type: buttons?.[index]?.type,\n }))\n }), [elRefs, buttons]);\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile': {\n const {placement, type, action, ...rest} = item;\n if(!!profileComponent)\n return <ProfileWrapper>{profileComponent}</ProfileWrapper>;\n else\n return <ProfileWrapper>\n <ProfileButton key={index}\n ref={elRefs[index]}\n hideOnLowWidth={true}\n onClick={e => {\n item.action ? item.action(e?.target) : onShowUserMenu()\n }}\n icon={!user && <SystemIcons.User/>}\n initials={(user?.firstName?.charAt(0) ?? '') + (user?.lastName?.charAt(0) ?? '')}\n {...rest}/>\n </ProfileWrapper>\n }\n case 'action': {\n const {placement, type, icon, action, ...rest} = item;\n return <IconButton key={index}\n ref={elRefs[index]}\n variant={'secondary'}\n shape={'circular'}\n hideOnLowWidth={true}\n action={e => item.action && item.action(e?.target)}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n case 'switcher': {\n const {placement, type, action, ...rest} = item;\n return <IconButton key={index}\n ref={elRefs[index]}\n variant={'secondary'}\n shape={'circular'}\n hideOnLowWidth={true}\n id=\"globalNavAppsButton\"\n action={e => item.action && item.action(e?.target)}\n {...rest}>\n <SystemIcons.SwitchApp size=\"24px\"/>\n </IconButton>\n }\n }\n }\n\n return (\n <Wrapper role=\"toolbar\" aria-label=\"Toolbar\">\n {buttons?.map((item, index) => renderItem(item, index))}\n </Wrapper>\n )\n});\n\n\nexport default DesktopActions;\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAAQC,UAAU,QAAO,cAAc;AACvC,SAAQC,aAAa,QAAO,qBAAqB;AACjD,SAAQC,WAAW,QAAO,aAAa;AACvC,SAAQC,WAAW,QAAO,cAAc;AAAC;AAEzC,IAAMC,OAAO,GAAGL,MAAM,CAACM,GAAG,yJAKtBF,WAAW,CAACG,MAAM,CAGrB;AAED,IAAMC,cAAc,GAAGR,MAAM,CAACM,GAAG,2FAEhC;AAcD,IAAOG,cAAc,gBAAGV,KAAK,CAACW,UAAU,CAAC,gBAKwBC,GAAiC,EAAK;EAAA,IAJ5DC,OAAO,QAAPA,OAAO;IACPC,IAAI,QAAJA,IAAI;IACHC,gBAAgB,QAAhBA,gBAAgB;IACjBC,cAAc,QAAdA,cAAc;EAGvD,sBAA4BhB,KAAK,CAACiB,QAAQ,CAAuC,EAAE,CAAC;IAAA;IAA7EC,MAAM;IAAEC,SAA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aF,IAAI,CAAvBE,MAAM;YAAKC,MAAI,4BAAIH,IAAI;UAC/C,oBAAO,KAAC,UAAU;YACC,GAAG,EAAEb,MAAM,CAACU,KAAK,CAAE;YACnB,OAAO,EAAE,WAAY;YACrB,KAAK,EAAE,UAAW;YAClB,cAAc,EAAE,IAAK;YACrB,EAAE,EAAC,qBAAqB;YACxB,MAAM,EAAE,gBAAAO,CAAC;cAAA,OAAIJ,IAAI,CAACE,MAAM,IAAIF,IAAI,CAACE,MAAM,CAACE,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEC,MAAM,CAAC;YAAA;UAAC,GAC/CF,MAAI;YAAA,uBACzB,KAAC,WAAW,CAAC,SAAS;cAAC,IAAI,EAAC;YAAM;UAAE,IARdN,KAAK,CAShB;QACf;IAAC;EAEL,CAAC;EAED,oBACE,KAAC,OAAO;IAAC,IAAI,EAAC,SAAS;IAAC,cAAW,SAAS;IAAA,UACzCf,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEW,GAAG,CAAC,UAACO,IAAI,EAAEH,KAAK;MAAA,OAAKE,UAAU,CAACC,IAAI,EAAEH,KAAK,CAAC;IAAA;EAAC,EAC/C;AAEd,CAAC,CAAC;AAAC;EApFDf,OAAO;EAEPE,gBAAgB;EAChBC,cAAc;AAAA;AAoFhB,eAAeN,cAAc"}
|
|
@@ -20,7 +20,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
var flowDown = (0, _styledComponents.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateY(-10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
22
22
|
exports.flowDown = flowDown;
|
|
23
|
-
var Menu = _styledComponents.default.ul(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n list-style: none;\n margin: 0;\n padding: 0;\n background-color: ", ";\n box-sizing: border-box;\n display: none;\n right: -8px;\n min-width: 300px;\n -webkit-animation: ", " 0.2s ease-in-out;\n animation: ", " 0.2s ease-in-out;\n position: absolute;\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n z-index: ", ";\n\n top: 12px;\n ", " {\n top: 18px;\n }\n ", " {\n top: 24px;\n }\n\n .open & {\n display: block;\n }\n"])), _styles.COLORS.white, flowDown, flowDown, _styles.Z_INDEXES.dropdown, _styles.BREAKPOINTS.SMALL, _styles.BREAKPOINTS.MEDIUM);
|
|
23
|
+
var Menu = _styledComponents.default.ul(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n list-style: none;\n margin: 0;\n padding: 0;\n background-color: ", ";\n box-sizing: border-box;\n display: none;\n right: -8px;\n min-width: 300px;\n -webkit-animation: ", " 0.2s ease-in-out;\n animation: ", " 0.2s ease-in-out;\n position: absolute;\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n z-index: ", ";\n\n top: 12px;\n ", " {\n top: 18px;\n }\n ", " {\n top: 24px;\n }\n\n .open & {\n display: block;\n }\n\n &:focus {\n ", "\n }\n"])), _styles.COLORS.white, flowDown, flowDown, _styles.Z_INDEXES.dropdown, _styles.BREAKPOINTS.SMALL, _styles.BREAKPOINTS.MEDIUM, _styles.focusStyles);
|
|
24
24
|
exports.Menu = Menu;
|
|
25
25
|
var MenuSection = _styledComponents.default.li(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: 8px 0;\n position: relative;\n\n &:not(:first-of-type)::before {\n content: '';\n position: absolute;\n background: ", ";\n height: 1px;\n top: 0;\n left: 16px;\n right: 16px;\n }\n"])), _styles.COLORS.neutral_100);
|
|
26
26
|
exports.MenuSection = MenuSection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtendedMainMenu.cjs","names":["flowDown","keyframes","Menu","styled","ul","COLORS","white","Z_INDEXES","dropdown","BREAKPOINTS","SMALL","MEDIUM","MenuSection","li","neutral_100","MenuSectionList","ExtendedMainMenu","clickMenuAction","navigationOptions","console","log","React","useState","entries","setEntries","useEffect","handleKeyPress","e","keyCode","document","addEventListener","removeEventListener","list","map","n","requiredLine","label","to","disabled","onClick","action","exact","Size","Medium"],"sources":["../../../src/GlobalNavigationBar/desktop/ExtendedMainMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled, { keyframes } from 'styled-components';\n\nimport { BREAKPOINTS, COLORS } from '../../styles';\nimport { VerticalTabs } from '../../Tabs';\nimport { VerticalTabEntry } from '../../Tabs';\nimport {MenuNavigationItemTypeItem, Size} from '../../index';\nimport {Z_INDEXES} from '../../styles';\n\nexport const flowDown = keyframes`\n 0% {\n opacity: 0;\n transform: translateY(-10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n`;\n\nexport const Menu = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n background-color: ${COLORS.white};\n box-sizing: border-box;\n display: none;\n right: -8px;\n min-width: 300px;\n -webkit-animation: ${flowDown} 0.2s ease-in-out;\n animation: ${flowDown} 0.2s ease-in-out;\n position: absolute;\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n z-index: ${Z_INDEXES.dropdown};\n\n top: 12px;\n ${BREAKPOINTS.SMALL} {\n top: 18px;\n }\n ${BREAKPOINTS.MEDIUM} {\n top: 24px;\n }\n\n .open & {\n display: block;\n }\n`;\n\nexport const MenuSection = styled.li`\n padding: 8px 0;\n position: relative;\n\n &:not(:first-of-type)::before {\n content: '';\n position: absolute;\n background: ${COLORS.neutral_100};\n height: 1px;\n top: 0;\n left: 16px;\n right: 16px;\n }\n`;\n\nexport const MenuSectionList = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0 2px;\n`;\n\ntype Props = {\n clickMenuAction: () => void;\n navigationOptions: MenuNavigationItemTypeItem[];\n};\n\nconst ExtendedMainMenu = ({ clickMenuAction, navigationOptions }: Props) => {\n console.log(navigationOptions);\n const [entries, setEntries] = React.useState<VerticalTabEntry[]>([]);\n React.useEffect(() => {\n function handleKeyPress(e: any) {\n if (e.keyCode === 27) {\n clickMenuAction();\n }\n }\n\n document.addEventListener('keydown', handleKeyPress, false);\n return () => {\n document.removeEventListener('keydown', handleKeyPress, false);\n };\n }, [clickMenuAction]);\n\n React.useEffect(() => {\n const list = navigationOptions?.map(n => {\n return { requiredLine: n.label, to: n.to, disabled: n.disabled, onClick: n.action, exact: n.exact };\n }) as VerticalTabEntry[];\n setEntries(list);\n }, [navigationOptions]);\n\n return (\n <Menu onClick={clickMenuAction} role=\"menu\" aria-labelledby=\"UserMenuButton\">\n <MenuSection>\n <MenuSectionList>\n <VerticalTabs key=\"ExtendedMenu\" entries={entries} size={Size.Medium} />\n </MenuSectionList>\n </MenuSection>\n </Menu>\n );\n};\n\nexport default ExtendedMainMenu;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AAEA;AACA;AAEA;AAA6D;AAAA;AAAA;AAAA;AAGtD,IAAMA,QAAQ,OAAGC,2BAAS,oNAShC;AAAC;AAEK,IAAMC,IAAI,GAAGC,yBAAM,CAACC,EAAE,
|
|
1
|
+
{"version":3,"file":"ExtendedMainMenu.cjs","names":["flowDown","keyframes","Menu","styled","ul","COLORS","white","Z_INDEXES","dropdown","BREAKPOINTS","SMALL","MEDIUM","focusStyles","MenuSection","li","neutral_100","MenuSectionList","ExtendedMainMenu","clickMenuAction","navigationOptions","console","log","React","useState","entries","setEntries","useEffect","handleKeyPress","e","keyCode","document","addEventListener","removeEventListener","list","map","n","requiredLine","label","to","disabled","onClick","action","exact","Size","Medium"],"sources":["../../../src/GlobalNavigationBar/desktop/ExtendedMainMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled, { keyframes } from 'styled-components';\n\nimport { BREAKPOINTS, COLORS, focusStyles } from '../../styles';\nimport { VerticalTabs } from '../../Tabs';\nimport { VerticalTabEntry } from '../../Tabs';\nimport {MenuNavigationItemTypeItem, Size} from '../../index';\nimport {Z_INDEXES} from '../../styles';\n\nexport const flowDown = keyframes`\n 0% {\n opacity: 0;\n transform: translateY(-10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n`;\n\nexport const Menu = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n background-color: ${COLORS.white};\n box-sizing: border-box;\n display: none;\n right: -8px;\n min-width: 300px;\n -webkit-animation: ${flowDown} 0.2s ease-in-out;\n animation: ${flowDown} 0.2s ease-in-out;\n position: absolute;\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n z-index: ${Z_INDEXES.dropdown};\n\n top: 12px;\n ${BREAKPOINTS.SMALL} {\n top: 18px;\n }\n ${BREAKPOINTS.MEDIUM} {\n top: 24px;\n }\n\n .open & {\n display: block;\n }\n\n &:focus {\n ${focusStyles}\n }\n`;\n\nexport const MenuSection = styled.li`\n padding: 8px 0;\n position: relative;\n\n &:not(:first-of-type)::before {\n content: '';\n position: absolute;\n background: ${COLORS.neutral_100};\n height: 1px;\n top: 0;\n left: 16px;\n right: 16px;\n }\n`;\n\nexport const MenuSectionList = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0 2px;\n`;\n\ntype Props = {\n clickMenuAction: () => void;\n navigationOptions: MenuNavigationItemTypeItem[];\n};\n\nconst ExtendedMainMenu = ({ clickMenuAction, navigationOptions }: Props) => {\n console.log(navigationOptions);\n const [entries, setEntries] = React.useState<VerticalTabEntry[]>([]);\n React.useEffect(() => {\n function handleKeyPress(e: any) {\n if (e.keyCode === 27) {\n clickMenuAction();\n }\n }\n\n document.addEventListener('keydown', handleKeyPress, false);\n return () => {\n document.removeEventListener('keydown', handleKeyPress, false);\n };\n }, [clickMenuAction]);\n\n React.useEffect(() => {\n const list = navigationOptions?.map(n => {\n return { requiredLine: n.label, to: n.to, disabled: n.disabled, onClick: n.action, exact: n.exact };\n }) as VerticalTabEntry[];\n setEntries(list);\n }, [navigationOptions]);\n\n return (\n <Menu onClick={clickMenuAction} role=\"menu\" aria-labelledby=\"UserMenuButton\">\n <MenuSection>\n <MenuSectionList>\n <VerticalTabs key=\"ExtendedMenu\" entries={entries} size={Size.Medium} />\n </MenuSectionList>\n </MenuSection>\n </Menu>\n );\n};\n\nexport default ExtendedMainMenu;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AAEA;AACA;AAEA;AAA6D;AAAA;AAAA;AAAA;AAGtD,IAAMA,QAAQ,OAAGC,2BAAS,oNAShC;AAAC;AAEK,IAAMC,IAAI,GAAGC,yBAAM,CAACC,EAAE,8kBAIPC,cAAM,CAACC,KAAK,EAKXN,QAAQ,EAChBA,QAAQ,EAIVO,iBAAS,CAACC,QAAQ,EAG3BC,mBAAW,CAACC,KAAK,EAGjBD,mBAAW,CAACE,MAAM,EAShBC,mBAAW,CAEhB;AAAC;AAEK,IAAMC,WAAW,GAAGV,yBAAM,CAACW,EAAE,gTAOlBT,cAAM,CAACU,WAAW,CAMnC;AAAC;AAEK,IAAMC,eAAe,GAAGb,yBAAM,CAACC,EAAE,6IAIvC;AAAC;AAOF,IAAMa,gBAAgB,GAAG,SAAnBA,gBAAgB,OAAsD;EAAA,IAAhDC,eAAe,QAAfA,eAAe;IAAEC,iBAAiB,QAAjBA,iBAAiB;EAC5DC,OAAO,CAACC,GAAG,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AC;EApCA1B,eAAe;EACfC,iBAAiB;AAAA;AAAA,eAqCJF,gBAAgB;AAAA"}
|
|
@@ -4,13 +4,13 @@ import _pt from "prop-types";
|
|
|
4
4
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import styled, { keyframes } from 'styled-components';
|
|
7
|
-
import { BREAKPOINTS, COLORS } from '../../styles';
|
|
7
|
+
import { BREAKPOINTS, COLORS, focusStyles } from '../../styles';
|
|
8
8
|
import { VerticalTabs } from '../../Tabs';
|
|
9
9
|
import { Size } from '../../index';
|
|
10
10
|
import { Z_INDEXES } from '../../styles';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
export var flowDown = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateY(-10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
13
|
-
export var Menu = styled.ul(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n list-style: none;\n margin: 0;\n padding: 0;\n background-color: ", ";\n box-sizing: border-box;\n display: none;\n right: -8px;\n min-width: 300px;\n -webkit-animation: ", " 0.2s ease-in-out;\n animation: ", " 0.2s ease-in-out;\n position: absolute;\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n z-index: ", ";\n\n top: 12px;\n ", " {\n top: 18px;\n }\n ", " {\n top: 24px;\n }\n\n .open & {\n display: block;\n }\n"])), COLORS.white, flowDown, flowDown, Z_INDEXES.dropdown, BREAKPOINTS.SMALL, BREAKPOINTS.MEDIUM);
|
|
13
|
+
export var Menu = styled.ul(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n list-style: none;\n margin: 0;\n padding: 0;\n background-color: ", ";\n box-sizing: border-box;\n display: none;\n right: -8px;\n min-width: 300px;\n -webkit-animation: ", " 0.2s ease-in-out;\n animation: ", " 0.2s ease-in-out;\n position: absolute;\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n z-index: ", ";\n\n top: 12px;\n ", " {\n top: 18px;\n }\n ", " {\n top: 24px;\n }\n\n .open & {\n display: block;\n }\n\n &:focus {\n ", "\n }\n"])), COLORS.white, flowDown, flowDown, Z_INDEXES.dropdown, BREAKPOINTS.SMALL, BREAKPOINTS.MEDIUM, focusStyles);
|
|
14
14
|
export var MenuSection = styled.li(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 8px 0;\n position: relative;\n\n &:not(:first-of-type)::before {\n content: '';\n position: absolute;\n background: ", ";\n height: 1px;\n top: 0;\n left: 16px;\n right: 16px;\n }\n"])), COLORS.neutral_100);
|
|
15
15
|
export var MenuSectionList = styled.ul(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n list-style: none;\n margin: 0;\n padding: 0 2px;\n"])));
|
|
16
16
|
var ExtendedMainMenu = function ExtendedMainMenu(_ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtendedMainMenu.js","names":["React","styled","keyframes","BREAKPOINTS","COLORS","VerticalTabs","Size","Z_INDEXES","flowDown","Menu","ul","white","dropdown","SMALL","MEDIUM","MenuSection","li","neutral_100","MenuSectionList","ExtendedMainMenu","clickMenuAction","navigationOptions","console","log","useState","entries","setEntries","useEffect","handleKeyPress","e","keyCode","document","addEventListener","removeEventListener","list","map","n","requiredLine","label","to","disabled","onClick","action","exact","Medium"],"sources":["../../../src/GlobalNavigationBar/desktop/ExtendedMainMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled, { keyframes } from 'styled-components';\n\nimport { BREAKPOINTS, COLORS } from '../../styles';\nimport { VerticalTabs } from '../../Tabs';\nimport { VerticalTabEntry } from '../../Tabs';\nimport {MenuNavigationItemTypeItem, Size} from '../../index';\nimport {Z_INDEXES} from '../../styles';\n\nexport const flowDown = keyframes`\n 0% {\n opacity: 0;\n transform: translateY(-10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n`;\n\nexport const Menu = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n background-color: ${COLORS.white};\n box-sizing: border-box;\n display: none;\n right: -8px;\n min-width: 300px;\n -webkit-animation: ${flowDown} 0.2s ease-in-out;\n animation: ${flowDown} 0.2s ease-in-out;\n position: absolute;\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n z-index: ${Z_INDEXES.dropdown};\n\n top: 12px;\n ${BREAKPOINTS.SMALL} {\n top: 18px;\n }\n ${BREAKPOINTS.MEDIUM} {\n top: 24px;\n }\n\n .open & {\n display: block;\n }\n`;\n\nexport const MenuSection = styled.li`\n padding: 8px 0;\n position: relative;\n\n &:not(:first-of-type)::before {\n content: '';\n position: absolute;\n background: ${COLORS.neutral_100};\n height: 1px;\n top: 0;\n left: 16px;\n right: 16px;\n }\n`;\n\nexport const MenuSectionList = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0 2px;\n`;\n\ntype Props = {\n clickMenuAction: () => void;\n navigationOptions: MenuNavigationItemTypeItem[];\n};\n\nconst ExtendedMainMenu = ({ clickMenuAction, navigationOptions }: Props) => {\n console.log(navigationOptions);\n const [entries, setEntries] = React.useState<VerticalTabEntry[]>([]);\n React.useEffect(() => {\n function handleKeyPress(e: any) {\n if (e.keyCode === 27) {\n clickMenuAction();\n }\n }\n\n document.addEventListener('keydown', handleKeyPress, false);\n return () => {\n document.removeEventListener('keydown', handleKeyPress, false);\n };\n }, [clickMenuAction]);\n\n React.useEffect(() => {\n const list = navigationOptions?.map(n => {\n return { requiredLine: n.label, to: n.to, disabled: n.disabled, onClick: n.action, exact: n.exact };\n }) as VerticalTabEntry[];\n setEntries(list);\n }, [navigationOptions]);\n\n return (\n <Menu onClick={clickMenuAction} role=\"menu\" aria-labelledby=\"UserMenuButton\">\n <MenuSection>\n <MenuSectionList>\n <VerticalTabs key=\"ExtendedMenu\" entries={entries} size={Size.Medium} />\n </MenuSectionList>\n </MenuSection>\n </Menu>\n );\n};\n\nexport default ExtendedMainMenu;\n"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,SAAS,QAAQ,mBAAmB;AAErD,SAASC,WAAW,EAAEC,MAAM,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"file":"ExtendedMainMenu.js","names":["React","styled","keyframes","BREAKPOINTS","COLORS","focusStyles","VerticalTabs","Size","Z_INDEXES","flowDown","Menu","ul","white","dropdown","SMALL","MEDIUM","MenuSection","li","neutral_100","MenuSectionList","ExtendedMainMenu","clickMenuAction","navigationOptions","console","log","useState","entries","setEntries","useEffect","handleKeyPress","e","keyCode","document","addEventListener","removeEventListener","list","map","n","requiredLine","label","to","disabled","onClick","action","exact","Medium"],"sources":["../../../src/GlobalNavigationBar/desktop/ExtendedMainMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled, { keyframes } from 'styled-components';\n\nimport { BREAKPOINTS, COLORS, focusStyles } from '../../styles';\nimport { VerticalTabs } from '../../Tabs';\nimport { VerticalTabEntry } from '../../Tabs';\nimport {MenuNavigationItemTypeItem, Size} from '../../index';\nimport {Z_INDEXES} from '../../styles';\n\nexport const flowDown = keyframes`\n 0% {\n opacity: 0;\n transform: translateY(-10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n`;\n\nexport const Menu = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n background-color: ${COLORS.white};\n box-sizing: border-box;\n display: none;\n right: -8px;\n min-width: 300px;\n -webkit-animation: ${flowDown} 0.2s ease-in-out;\n animation: ${flowDown} 0.2s ease-in-out;\n position: absolute;\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n z-index: ${Z_INDEXES.dropdown};\n\n top: 12px;\n ${BREAKPOINTS.SMALL} {\n top: 18px;\n }\n ${BREAKPOINTS.MEDIUM} {\n top: 24px;\n }\n\n .open & {\n display: block;\n }\n\n &:focus {\n ${focusStyles}\n }\n`;\n\nexport const MenuSection = styled.li`\n padding: 8px 0;\n position: relative;\n\n &:not(:first-of-type)::before {\n content: '';\n position: absolute;\n background: ${COLORS.neutral_100};\n height: 1px;\n top: 0;\n left: 16px;\n right: 16px;\n }\n`;\n\nexport const MenuSectionList = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0 2px;\n`;\n\ntype Props = {\n clickMenuAction: () => void;\n navigationOptions: MenuNavigationItemTypeItem[];\n};\n\nconst ExtendedMainMenu = ({ clickMenuAction, navigationOptions }: Props) => {\n console.log(navigationOptions);\n const [entries, setEntries] = React.useState<VerticalTabEntry[]>([]);\n React.useEffect(() => {\n function handleKeyPress(e: any) {\n if (e.keyCode === 27) {\n clickMenuAction();\n }\n }\n\n document.addEventListener('keydown', handleKeyPress, false);\n return () => {\n document.removeEventListener('keydown', handleKeyPress, false);\n };\n }, [clickMenuAction]);\n\n React.useEffect(() => {\n const list = navigationOptions?.map(n => {\n return { requiredLine: n.label, to: n.to, disabled: n.disabled, onClick: n.action, exact: n.exact };\n }) as VerticalTabEntry[];\n setEntries(list);\n }, [navigationOptions]);\n\n return (\n <Menu onClick={clickMenuAction} role=\"menu\" aria-labelledby=\"UserMenuButton\">\n <MenuSection>\n <MenuSectionList>\n <VerticalTabs key=\"ExtendedMenu\" entries={entries} size={Size.Medium} />\n </MenuSectionList>\n </MenuSection>\n </Menu>\n );\n};\n\nexport default ExtendedMainMenu;\n"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,SAAS,QAAQ,mBAAmB;AAErD,SAASC,WAAW,EAAEC,MAAM,EAAEC,WAAW,QAAQ,cAAc;AAC/D,SAASC,YAAY,QAAQ,YAAY;AAEzC,SAAoCC,IAAI,QAAO,aAAa;AAC5D,SAAQC,SAAS,QAAO,cAAc;AAAC;AAEvC,OAAO,IAAMC,QAAQ,GAAGP,SAAS,qMAShC;AAED,OAAO,IAAMQ,IAAI,GAAGT,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AAEC,OAAO,EAAEL,CAAC,CAACM,MAAM;QAAEC,KAAK,EAAEP,CAAC,CAACO;MAAM,CAAC;IACrG,CAAC,CAAuB;IACxBjB,UAAU,CAACQ,IAAI,CAAC;EAClB,CAAC,EAAE,CAACb,iBAAiB,CAAC,CAAC;EAEvB,oBACE,KAAC,IAAI;IAAC,OAAO,EAAED,eAAgB;IAAC,IAAI,EAAC,MAAM;IAAC,mBAAgB,gBAAgB;IAAA,uBAC1E,KAAC,WAAW;MAAA,uBACV,KAAC,eAAe;QAAA,uBACd,KAAC,YAAY;UAAoB,OAAO,EAAEK,OAAQ;UAAC,IAAI,EAAEnB,IAAI,CAACsC;QAAO,GAAnD,cAAc;MAAwC;IACxD;EACN,EACT;AAEX,CAAC;AAAC;EApCAxB,eAAe;EACfC,iBAAiB;AAAA;AAqCnB,eAAeF,gBAAgB"}
|
|
@@ -54,13 +54,27 @@ var MainMenu = function MainMenu(_ref) {
|
|
|
54
54
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
55
55
|
numberOfItemsAllowed = _React$useState2[0],
|
|
56
56
|
setNumberOfItemsAllowed = _React$useState2[1];
|
|
57
|
-
var _React$useState3 = React.useState(
|
|
57
|
+
var _React$useState3 = React.useState([]),
|
|
58
58
|
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
subMenuRefs = _React$useState4[0],
|
|
60
|
+
setAllSubMenuRefs = _React$useState4[1];
|
|
61
|
+
var extendedMenuOptionRef = /*#__PURE__*/React.createRef();
|
|
62
|
+
React.useEffect(function () {
|
|
63
|
+
setAllSubMenuRefs(items.map(function (x) {
|
|
64
|
+
return x.type == 'desktopgroup' ? /*#__PURE__*/React.createRef() : undefined;
|
|
65
|
+
}));
|
|
66
|
+
}, [items]);
|
|
67
|
+
var _React$useState5 = React.useState({}),
|
|
61
68
|
_React$useState6 = (0, _slicedToArray2.default)(_React$useState5, 2),
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
forceUpdate = _React$useState6[1];
|
|
70
|
+
var _React$useState7 = React.useState(''),
|
|
71
|
+
_React$useState8 = (0, _slicedToArray2.default)(_React$useState7, 2),
|
|
72
|
+
activeItem = _React$useState8[0],
|
|
73
|
+
setActiveItemId = _React$useState8[1];
|
|
74
|
+
var _React$useState9 = React.useState(''),
|
|
75
|
+
_React$useState10 = (0, _slicedToArray2.default)(_React$useState9, 2),
|
|
76
|
+
focusedItemId = _React$useState10[0],
|
|
77
|
+
setFocusedItemId = _React$useState10[1];
|
|
64
78
|
var widthOfItem = 120;
|
|
65
79
|
var recalculateNumberOfItemsAllowed = function recalculateNumberOfItemsAllowed() {
|
|
66
80
|
if (rightSideRef !== null && rightSideRef !== void 0 && rightSideRef.current && mainMenuRef !== null && mainMenuRef !== void 0 && mainMenuRef.current) {
|
|
@@ -105,6 +119,13 @@ var MainMenu = function MainMenu(_ref) {
|
|
|
105
119
|
dropdownMenusOpenedArray.current = [];
|
|
106
120
|
forceUpdate({});
|
|
107
121
|
};
|
|
122
|
+
var onKeyDownTop = function onKeyDownTop(event) {
|
|
123
|
+
if (event.key === 'Escape' || event.key === 'Esc') {
|
|
124
|
+
dropdownMenusOpenedArray.current = [];
|
|
125
|
+
//just trigger rerendering
|
|
126
|
+
forceUpdate({});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
108
129
|
var renderItem = function renderItem(item, index) {
|
|
109
130
|
if (index > numberOfItemsAllowed - 2) return null;
|
|
110
131
|
if (item.type != 'desktopgroup') {
|
|
@@ -153,6 +174,7 @@ var MainMenu = function MainMenu(_ref) {
|
|
|
153
174
|
forceUpdate({});
|
|
154
175
|
}
|
|
155
176
|
};
|
|
177
|
+
var containsActiveItem = (0, _utils.checkIfContainsItem)(item, activeItem);
|
|
156
178
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
157
179
|
style: {
|
|
158
180
|
position: 'relative'
|
|
@@ -166,6 +188,11 @@ var MainMenu = function MainMenu(_ref) {
|
|
|
166
188
|
return _onMouseLeave(event, (_item$id2 = item.id) !== null && _item$id2 !== void 0 ? _item$id2 : '');
|
|
167
189
|
},
|
|
168
190
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_NavItem.NavItem, {
|
|
191
|
+
id: item.id + '_parentOption',
|
|
192
|
+
"aria-expanded": Boolean(existingRef),
|
|
193
|
+
"aria-activedescendant": containsActiveItem ? activeItem : '',
|
|
194
|
+
"aria-controls": item.id,
|
|
195
|
+
role: "listbox",
|
|
169
196
|
onFocus: onFocus,
|
|
170
197
|
onKeyDown: onKeyDown,
|
|
171
198
|
tabIndex: 0,
|
|
@@ -176,6 +203,10 @@ var MainMenu = function MainMenu(_ref) {
|
|
|
176
203
|
size: "24px"
|
|
177
204
|
})]
|
|
178
205
|
}, item.label), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SubMenu.SubMenu, {
|
|
206
|
+
ariaLabelledBy: item.id + '_parentOption',
|
|
207
|
+
ref: subMenuRefs[index],
|
|
208
|
+
onItemFocused: setFocusedItemId,
|
|
209
|
+
focusedItemId: focusedItemId,
|
|
179
210
|
activeItemId: activeItem,
|
|
180
211
|
nestPath: [item.id],
|
|
181
212
|
onItemStateChanged: function onItemStateChanged(item, state) {
|
|
@@ -191,10 +222,25 @@ var MainMenu = function MainMenu(_ref) {
|
|
|
191
222
|
});
|
|
192
223
|
}
|
|
193
224
|
};
|
|
225
|
+
var extended = dropdownMenusOpenedArray.current.find(function (x) {
|
|
226
|
+
return x == ExtendedMenuOption;
|
|
227
|
+
});
|
|
228
|
+
var extendedSectionKeyHandler = function extendedSectionKeyHandler(event) {
|
|
229
|
+
if (event.key == 'Enter' || event.code == 'Space') {
|
|
230
|
+
event.stopPropagation();
|
|
231
|
+
dropdownMenusOpenedArray.current = [ExtendedMenuOption];
|
|
232
|
+
forceUpdate({});
|
|
233
|
+
}
|
|
234
|
+
};
|
|
194
235
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(NavContainer, {
|
|
236
|
+
role: "navigation",
|
|
195
237
|
className: "GlobalNavigationMainMenu",
|
|
196
238
|
ref: mainMenuRef,
|
|
239
|
+
onKeyDown: onKeyDownTop,
|
|
197
240
|
children: [items === null || items === void 0 ? void 0 : items.map(renderItem), items.length + 1 > numberOfItemsAllowed && /*#__PURE__*/(0, _jsxRuntime.jsxs)(ExtendedSection, {
|
|
241
|
+
onKeyDown: function onKeyDown(event) {
|
|
242
|
+
return extendedSectionKeyHandler(event);
|
|
243
|
+
},
|
|
198
244
|
onMouseEnter: function onMouseEnter(event) {
|
|
199
245
|
return _onMouseEnter(event, ExtendedMenuOption);
|
|
200
246
|
},
|
|
@@ -202,6 +248,14 @@ var MainMenu = function MainMenu(_ref) {
|
|
|
202
248
|
return _onMouseLeave(event, ExtendedMenuOption);
|
|
203
249
|
},
|
|
204
250
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
|
|
251
|
+
id: ExtendedMenuOption + '_parentOption',
|
|
252
|
+
"aria-expanded": Boolean(extended),
|
|
253
|
+
"aria-activedescendant": (0, _utils.checkIfContainsItem)({
|
|
254
|
+
items: items.slice(numberOfItemsAllowed - 1),
|
|
255
|
+
id: ExtendedMenuOption
|
|
256
|
+
}, activeItem) ? activeItem : '',
|
|
257
|
+
"aria-controls": ExtendedMenuOption,
|
|
258
|
+
role: "listbox",
|
|
205
259
|
ref: menuButtonRef,
|
|
206
260
|
variant: 'secondary',
|
|
207
261
|
shape: 'circular',
|
|
@@ -210,10 +264,17 @@ var MainMenu = function MainMenu(_ref) {
|
|
|
210
264
|
size: "24px"
|
|
211
265
|
})
|
|
212
266
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SubMenu.SubMenu, {
|
|
267
|
+
ariaLabelledBy: ExtendedMenuOption + '_parentOption',
|
|
213
268
|
activeItemId: activeItem,
|
|
269
|
+
onItemFocused: setFocusedItemId,
|
|
270
|
+
focusedItemId: focusedItemId,
|
|
271
|
+
ref: extendedMenuOptionRef,
|
|
214
272
|
onItemStateChanged: function onItemStateChanged(item, state) {
|
|
273
|
+
console.log(item);
|
|
274
|
+
console.log(state);
|
|
215
275
|
if (state) setActiveItemId(item);else if (item == activeItem) setActiveItemId('');
|
|
216
276
|
},
|
|
277
|
+
nestPath: [ExtendedMenuOption],
|
|
217
278
|
item: {
|
|
218
279
|
items: items.slice(numberOfItemsAllowed - 1),
|
|
219
280
|
id: ExtendedMenuOption
|