dibk-design 2.8.0 → 3.0.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.
|
@@ -22,7 +22,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
22
22
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
23
23
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
24
|
var NavigationBar = function NavigationBar(props) {
|
|
25
|
-
var _props$primaryListIte, _props$secondaryListI;
|
|
25
|
+
var _props$primaryListIte, _props$secondaryListI, _props$mainContentId;
|
|
26
26
|
var _useState = (0, _react.useState)(false),
|
|
27
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
28
|
active = _useState2[0],
|
|
@@ -108,16 +108,17 @@ var NavigationBar = function NavigationBar(props) {
|
|
|
108
108
|
};
|
|
109
109
|
var hasListItems = !!((_props$primaryListIte = props.primaryListItems) !== null && _props$primaryListIte !== void 0 && _props$primaryListIte.length) || !!((_props$secondaryListI = props.secondaryListItems) !== null && _props$secondaryListI !== void 0 && _props$secondaryListI.length);
|
|
110
110
|
return _react.default.createElement("div", {
|
|
111
|
-
className: _NavigationBarModule.default.
|
|
112
|
-
}, _react.default.createElement("
|
|
113
|
-
className: _NavigationBarModule.default.navigationBar,
|
|
114
|
-
style: navigationBarThemeStyle
|
|
115
|
-
}, _react.default.createElement("a", {
|
|
111
|
+
className: _NavigationBarModule.default.navigationBarContainer
|
|
112
|
+
}, ((_props$mainContentId = props.mainContentId) === null || _props$mainContentId === void 0 ? void 0 : _props$mainContentId.length) && _react.default.createElement("a", {
|
|
116
113
|
id: "main-content-link",
|
|
117
|
-
|
|
114
|
+
href: "#".concat(props.mainContentId),
|
|
115
|
+
class: _NavigationBarModule.default.mainContentLink
|
|
118
116
|
}, _react.default.createElement("span", {
|
|
119
117
|
id: "main-content-link-text"
|
|
120
118
|
}, "Hopp til hovedinnhold")), _react.default.createElement("div", {
|
|
119
|
+
className: _NavigationBarModule.default.navigationBar,
|
|
120
|
+
style: navigationBarThemeStyle
|
|
121
|
+
}, _react.default.createElement("div", {
|
|
121
122
|
className: _NavigationBarModule.default.logoContainer
|
|
122
123
|
}, renderLogo(props.logoLink)), !!props.children && _react.default.createElement("div", {
|
|
123
124
|
className: _NavigationBarModule.default.childElements
|
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
@import "../style/global.scss";
|
|
2
2
|
|
|
3
|
-
.
|
|
3
|
+
.navigationBarContainer {
|
|
4
4
|
@include box-shadow(0 2px 4px -2px rgba(0, 0, 0, 0.2));
|
|
5
5
|
position: relative;
|
|
6
6
|
z-index: 1;
|
|
7
|
+
.mainContentLink {
|
|
8
|
+
display: block;
|
|
9
|
+
background-color: #072938;
|
|
10
|
+
padding: 8px;
|
|
11
|
+
text-align: center;
|
|
12
|
+
text-decoration: none;
|
|
13
|
+
font-size: 19px;
|
|
14
|
+
color: #fff;
|
|
15
|
+
position: absolute;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
18
|
+
width: 1px;
|
|
19
|
+
height: 1px;
|
|
20
|
+
word-wrap: normal;
|
|
21
|
+
&:focus,
|
|
22
|
+
&:active {
|
|
23
|
+
position: static;
|
|
24
|
+
overflow: visible;
|
|
25
|
+
clip: auto;
|
|
26
|
+
width: auto;
|
|
27
|
+
height: auto;
|
|
28
|
+
span {
|
|
29
|
+
z-index: 100;
|
|
30
|
+
outline: 3px solid #005fca;
|
|
31
|
+
outline-offset: 2px;
|
|
32
|
+
transition: none;
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
7
37
|
.navigationBar {
|
|
8
38
|
background-color: $color-dark-blue;
|
|
9
39
|
height: 54px;
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
cursor: pointer;
|
|
57
57
|
@media only screen and (min-width: $screen-sm) {
|
|
58
58
|
font-size: 19px;
|
|
59
|
-
height: 56px;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
&:hover {
|
|
@@ -76,6 +75,9 @@
|
|
|
76
75
|
&:not(.multiple) {
|
|
77
76
|
height: 47px;
|
|
78
77
|
padding: 10px 40px 10px 10px;
|
|
78
|
+
@media only screen and (min-width: $screen-sm) {
|
|
79
|
+
height: 56px;
|
|
80
|
+
}
|
|
79
81
|
}
|
|
80
82
|
&.multiple {
|
|
81
83
|
max-height: 100px;
|
package/package.json
CHANGED
|
@@ -1,82 +1,83 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"name": "dibk-design",
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"README.md"
|
|
9
|
+
],
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
12
|
+
"@testing-library/react": "^14.0.0",
|
|
13
|
+
"@testing-library/user-event": "^14.4.3",
|
|
14
|
+
"react": "^18.2.0",
|
|
15
|
+
"react-dom": "^18.2.0",
|
|
16
|
+
"react-scripts": "5.0.1",
|
|
17
|
+
"sass": "^1.55.0",
|
|
18
|
+
"web-vitals": "^3.0.3"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"start": "react-scripts start",
|
|
22
|
+
"build-components": "NODE_ENV=production babel src/stories --ignore src/**/*.stories.jsx --out-dir dist/components --copy-files --no-copy-ignored",
|
|
23
|
+
"build-functions": "NODE_ENV=production babel src/functions --out-dir dist/functions --copy-files --no-copy-ignored",
|
|
24
|
+
"build-index": "NODE_ENV=production babel src/index.js --out-dir dist --copy-files --no-copy-ignored",
|
|
25
|
+
"build-style": "NODE_ENV=production babel src/style --out-dir dist/style --copy-files --no-copy-ignored",
|
|
26
|
+
"build-assets": "NODE_ENV=production babel src/assets --out-dir dist/assets --copy-files --no-copy-ignored",
|
|
27
|
+
"build": "rm -rf dist && yarn build-components && yarn build-functions && yarn build-index && yarn build-style && yarn build-assets",
|
|
28
|
+
"eject": "react-scripts eject",
|
|
29
|
+
"storybook": "storybook dev -p 6006 -s public",
|
|
30
|
+
"build-storybook": "storybook build -s public -o docs"
|
|
31
|
+
},
|
|
32
|
+
"eslintConfig": {
|
|
33
|
+
"extends": [
|
|
34
|
+
"react-app",
|
|
35
|
+
"react-app/jest"
|
|
9
36
|
],
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"react": "^18.2.0",
|
|
15
|
-
"react-dom": "^18.2.0",
|
|
16
|
-
"react-scripts": "5.0.1",
|
|
17
|
-
"sass": "^1.55.0",
|
|
18
|
-
"web-vitals": "^3.0.3"
|
|
19
|
-
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"start": "react-scripts start",
|
|
22
|
-
"build-components": "NODE_ENV=production babel src/stories --ignore src/**/*.stories.jsx --out-dir dist/components --copy-files --no-copy-ignored",
|
|
23
|
-
"build-functions": "NODE_ENV=production babel src/functions --out-dir dist/functions --copy-files --no-copy-ignored",
|
|
24
|
-
"build-index": "NODE_ENV=production babel src/index.js --out-dir dist --copy-files --no-copy-ignored",
|
|
25
|
-
"build-style": "NODE_ENV=production babel src/style --out-dir dist/style --copy-files --no-copy-ignored",
|
|
26
|
-
"build-assets": "NODE_ENV=production babel src/assets --out-dir dist/assets --copy-files --no-copy-ignored",
|
|
27
|
-
"build": "rm -rf dist && yarn build-components && yarn build-functions && yarn build-index && yarn build-style && yarn build-assets",
|
|
28
|
-
"eject": "react-scripts eject",
|
|
29
|
-
"storybook": "start-storybook -p 6006 -s public",
|
|
30
|
-
"build-storybook": "build-storybook -s public -o docs"
|
|
31
|
-
},
|
|
32
|
-
"eslintConfig": {
|
|
33
|
-
"extends": [
|
|
34
|
-
"react-app",
|
|
35
|
-
"react-app/jest"
|
|
37
|
+
"overrides": [
|
|
38
|
+
{
|
|
39
|
+
"files": [
|
|
40
|
+
"**/*.stories.*"
|
|
36
41
|
],
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"react-router-dom": "^6.4.2",
|
|
79
|
-
"url-loader": "^4.1.1",
|
|
80
|
-
"webpack": "^5.74.0"
|
|
81
|
-
}
|
|
42
|
+
"rules": {
|
|
43
|
+
"import/no-anonymous-default-export": "off"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"browserslist": {
|
|
49
|
+
"production": [
|
|
50
|
+
">0.2%",
|
|
51
|
+
"not dead",
|
|
52
|
+
"not op_mini all"
|
|
53
|
+
],
|
|
54
|
+
"development": [
|
|
55
|
+
"last 1 chrome version",
|
|
56
|
+
"last 1 firefox version",
|
|
57
|
+
"last 1 safari version"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@babel/cli": "^7.18.10",
|
|
62
|
+
"@storybook/addon-a11y": "^7.0.4",
|
|
63
|
+
"@storybook/addon-actions": "^7.0.4",
|
|
64
|
+
"@storybook/addon-essentials": "^7.0.4",
|
|
65
|
+
"@storybook/addon-interactions": "^7.0.4",
|
|
66
|
+
"@storybook/addon-links": "^7.0.4",
|
|
67
|
+
"@storybook/addon-mdx-gfm": "^7.0.4",
|
|
68
|
+
"@storybook/addons": "^7.0.4",
|
|
69
|
+
"@storybook/node-logger": "^7.0.4",
|
|
70
|
+
"@storybook/preset-create-react-app": "^7.0.4",
|
|
71
|
+
"@storybook/react": "^7.0.4",
|
|
72
|
+
"@storybook/react-webpack5": "^7.0.4",
|
|
73
|
+
"@storybook/testing-library": "^0.1.0",
|
|
74
|
+
"@storybook/theming": "^7.0.4",
|
|
75
|
+
"babel-plugin-named-exports-order": "^0.0.2",
|
|
76
|
+
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
77
|
+
"prop-types": "^15.8.1",
|
|
78
|
+
"react-router-dom": "^6.4.2",
|
|
79
|
+
"storybook": "^7.0.4",
|
|
80
|
+
"url-loader": "^4.1.1",
|
|
81
|
+
"webpack": "^5.74.0"
|
|
82
|
+
}
|
|
82
83
|
}
|