@madgex/design-system 9.1.0 → 9.1.2
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/_tokens/css/_tokens.css +1 -1
- package/dist/_tokens/js/_tokens-module.js +1 -1
- package/dist/_tokens/json/_tokens-flat.json +181 -0
- package/dist/_tokens/json/_tokens-nested.json +3974 -0
- package/dist/css/index.css +1 -1
- package/dist/js/index.js +1 -1
- package/package.json +2 -2
- package/src/components/_macro-index.njk +1 -0
- package/src/components/subnavigation/README.md +18 -0
- package/src/components/subnavigation/_macro.njk +3 -0
- package/src/components/subnavigation/_template.njk +25 -0
- package/src/components/subnavigation/subnavigation.config.js +190 -0
- package/src/components/subnavigation/subnavigation.js +104 -0
- package/src/components/subnavigation/subnavigation.njk +10 -0
- package/src/components/subnavigation/subnavigation.scss +122 -0
- package/src/js/index.js +2 -0
- package/src/scss/components/__index.scss +1 -0
- package/src/scss/constants/_sd-tokens.scss +1 -1
- package/src/tokens/_config.js +28 -16
- package/dist/_tokens/sketch/_tokens.sketchpalette +0 -5
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
.mds-subnavigation {
|
|
2
|
+
display: flex;
|
|
3
|
+
position: relative;
|
|
4
|
+
border-bottom: solid 1px $constant-color-neutral-lighter;
|
|
5
|
+
background-color: var(--mds-color-background-body);
|
|
6
|
+
flex-wrap: wrap;
|
|
7
|
+
align-items: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.mds-subnavigation__link-list {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-grow: 1;
|
|
13
|
+
gap: 6px;
|
|
14
|
+
align-items: center;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
margin-bottom: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.mds-subnavigation__drawer-label,
|
|
20
|
+
.mds-subnavigation__link {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
min-height: 60px;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
text-decoration: none;
|
|
27
|
+
border: none;
|
|
28
|
+
border-radius: 0;
|
|
29
|
+
border-bottom: solid 6px rgba(0,0,0,0);
|
|
30
|
+
|
|
31
|
+
&:hover,
|
|
32
|
+
&:focus {
|
|
33
|
+
border-color: $constant-color-neutral-light;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&[aria-expanded='true'] {
|
|
37
|
+
border-color: $constant-color-neutral-light;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&[aria-current="page"] {
|
|
41
|
+
color: var(--mds-color-text-headers-base);
|
|
42
|
+
border-color: $link-hover-color;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.mds-subnavigation__drawer-icon,
|
|
47
|
+
.mds-subnavigation__drawer-icon--open,
|
|
48
|
+
.mds-subnavigation__drawer-label[aria-expanded='false'] + .mds-subnavigation__drawer-content,
|
|
49
|
+
.mds-subnavigation__drawer {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.mds-subnavigation__drawer-content {
|
|
54
|
+
position: absolute;
|
|
55
|
+
z-index: 1;
|
|
56
|
+
|
|
57
|
+
.mds-subnavigation__link {
|
|
58
|
+
border: solid 1px $constant-color-neutral-lighter;
|
|
59
|
+
background-color: var(--mds-color-background-body);
|
|
60
|
+
justify-content: flex-start;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.mds-subnavigation__drawer-content li:not(:first-child) .mds-subnavigation__link {
|
|
65
|
+
border-top: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.mds-subnavigation__drawer-label[aria-expanded='false'] .mds-subnavigation__drawer-icon,
|
|
69
|
+
.mds-subnavigation__drawer-label[aria-expanded='true'] .mds-subnavigation__drawer-icon--open {
|
|
70
|
+
display: inline;
|
|
71
|
+
position: static;
|
|
72
|
+
margin: 0 0 0 0.4em;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.mds-subnavigation__drawer-label-text--mobile,
|
|
76
|
+
.mds-subnavigation__mobile-title {
|
|
77
|
+
display: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.mds-subnavigation__drawer-label-text {
|
|
81
|
+
display: inline;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@media only screen and (max-width: $constant-size-breakpoint-md) {
|
|
85
|
+
.mds-subnavigation__drawer-label-text {
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.mds-subnavigation__drawer-label-text--mobile,
|
|
90
|
+
.mds-subnavigation__mobile-title {
|
|
91
|
+
display: inline;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.mds-subnavigation__drawer {
|
|
95
|
+
margin-left: auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.mds-subnavigation__drawer-label {
|
|
99
|
+
border-bottom: none;
|
|
100
|
+
padding-left: 0;
|
|
101
|
+
|
|
102
|
+
&[aria-expanded='true'] {
|
|
103
|
+
color: var(--button-text-color);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.mds-subnavigation__drawer-content {
|
|
108
|
+
left: -1px;
|
|
109
|
+
right: -1px;
|
|
110
|
+
z-index: 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
html:not(.js) {
|
|
115
|
+
.mds-subnavigation__mobile-title {
|
|
116
|
+
display: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.mds-subnavigation__link {
|
|
120
|
+
min-height: auto;
|
|
121
|
+
}
|
|
122
|
+
}
|
package/src/js/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import './webpack-public-path';
|
|
|
11
11
|
import './common';
|
|
12
12
|
import tabs from '../components/tabs/tabs';
|
|
13
13
|
import accordion from '../components/accordion/accordion';
|
|
14
|
+
import subnavigation from '../components/subnavigation/subnavigation';
|
|
14
15
|
import checkboxList from '../components/inputs/checkbox-list/checkbox-list';
|
|
15
16
|
import popovers from '../components/popover/popover';
|
|
16
17
|
import modals from '../components/modal/modal';
|
|
@@ -22,6 +23,7 @@ import prose from '../helpers/prose/prose';
|
|
|
22
23
|
document.addEventListener('DOMContentLoaded', () => {
|
|
23
24
|
tabs.init();
|
|
24
25
|
accordion.init();
|
|
26
|
+
subnavigation.init();
|
|
25
27
|
checkboxList.init();
|
|
26
28
|
modals.init();
|
|
27
29
|
fileUpload.init();
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@import '../../components/tabs/tabs';
|
|
6
6
|
@import '../../components/accordion/accordion';
|
|
7
7
|
@import '../../components/pagination/pagination';
|
|
8
|
+
@import '../../components/subnavigation/subnavigation';
|
|
8
9
|
@import '../../components/switch-state/switch-state';
|
|
9
10
|
@import '../../components/popover/popover';
|
|
10
11
|
@import '../../components/notification/notification';
|
package/src/tokens/_config.js
CHANGED
|
@@ -35,27 +35,39 @@ const config = {
|
|
|
35
35
|
},
|
|
36
36
|
],
|
|
37
37
|
},
|
|
38
|
-
sketch: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
files: [
|
|
43
|
-
{
|
|
44
|
-
destination: '_tokens.sketchpalette',
|
|
45
|
-
format: 'sketch/palette',
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
// json: {
|
|
50
|
-
// transformGroup: 'js',
|
|
51
|
-
// buildPath: 'dist/json/',
|
|
38
|
+
// sketch: {
|
|
39
|
+
// transformGroup: 'web',
|
|
40
|
+
// buildPath: `${path.resolve(__dirname, '../../dist/_tokens/sketch/')}/`,
|
|
41
|
+
// prefix: 'mds',
|
|
52
42
|
// files: [
|
|
53
43
|
// {
|
|
54
|
-
// destination: '
|
|
55
|
-
// format: '
|
|
44
|
+
// destination: '_tokens.sketchpalette',
|
|
45
|
+
// format: 'sketch/palette',
|
|
56
46
|
// },
|
|
57
47
|
// ],
|
|
58
48
|
// },
|
|
49
|
+
'json-flat': {
|
|
50
|
+
transformGroup: 'js',
|
|
51
|
+
transforms: ['attribute/cti', 'name/cti/kebab', 'color/css'],
|
|
52
|
+
buildPath: 'dist/_tokens/json/',
|
|
53
|
+
files: [
|
|
54
|
+
{
|
|
55
|
+
destination: '_tokens-flat.json',
|
|
56
|
+
format: 'json/flat',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
'json-nested': {
|
|
61
|
+
transformGroup: 'js',
|
|
62
|
+
transforms: ['attribute/cti', 'name/cti/kebab', 'color/css'],
|
|
63
|
+
buildPath: 'dist/_tokens/json/',
|
|
64
|
+
files: [
|
|
65
|
+
{
|
|
66
|
+
destination: '_tokens-nested.json',
|
|
67
|
+
format: 'json',
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
59
71
|
// 'js-es6': {
|
|
60
72
|
// transformGroup: 'js',
|
|
61
73
|
// buildPath: 'dist/js/',
|