@progressive-development/pd-page 0.1.95 → 0.1.97
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/.storybook/main.js +12 -2
- package/.storybook/preview.js +14 -0
- package/package.json +16 -7
- package/src/PdMenu.js +88 -17
- package/{stories → src/stories}/01_index.stories.js +4 -4
- package/{stories → src/stories}/contactUs.stories.js +1 -1
- package/{stories → src/stories}/footer.stories.js +1 -1
- package/{stories → src/stories}/menu.stories.js +21 -4
- package/{stories → src/stories}/teaser.stories.js +1 -1
- package/.storybook/server.mjs +0 -8
package/.storybook/main.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** @type { import('@storybook/web-components-vite').StorybookConfig } */
|
|
2
|
+
const config = {
|
|
3
|
+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
4
|
+
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
|
5
|
+
framework: {
|
|
6
|
+
name: '@storybook/web-components-vite',
|
|
7
|
+
options: {},
|
|
8
|
+
},
|
|
9
|
+
docs: {
|
|
10
|
+
autodocs: 'tag',
|
|
11
|
+
},
|
|
3
12
|
};
|
|
13
|
+
export default config;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @type { import('@storybook/web-components').Preview } */
|
|
2
|
+
const preview = {
|
|
3
|
+
parameters: {
|
|
4
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
5
|
+
controls: {
|
|
6
|
+
matchers: {
|
|
7
|
+
color: /(background|color)$/i,
|
|
8
|
+
date: /Date$/i,
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default preview;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Progressive development page helper, teaser, menu, footer.",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "PD Progressive Development",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.97",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
|
|
14
14
|
"test": "web-test-runner --coverage",
|
|
15
15
|
"test:watch": "web-test-runner --watch",
|
|
16
|
-
"storybook": "npm run analyze -- --exclude dist && web-dev-server -c .storybook/server.mjs",
|
|
17
|
-
"storybook:build": "npm run analyze -- --exclude dist && build-storybook",
|
|
18
16
|
"localizeExtract": "lit-localize extract",
|
|
19
|
-
"localizeBuild": "lit-localize build"
|
|
17
|
+
"localizeBuild": "lit-localize build",
|
|
18
|
+
"storybook": "storybook dev -p 6006",
|
|
19
|
+
"build-storybook": "storybook build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@lit/localize": "^0.11.4",
|
|
@@ -33,20 +33,29 @@
|
|
|
33
33
|
"@lit/localize-tools": "^0.6.10",
|
|
34
34
|
"@open-wc/eslint-config": "^4.3.0",
|
|
35
35
|
"@open-wc/testing": "^3.0.0-next.5",
|
|
36
|
+
"@storybook/addon-essentials": "^7.5.3",
|
|
37
|
+
"@storybook/addon-links": "^7.5.3",
|
|
38
|
+
"@storybook/blocks": "^7.5.3",
|
|
39
|
+
"@storybook/web-components": "^7.5.3",
|
|
40
|
+
"@storybook/web-components-vite": "^7.5.3",
|
|
36
41
|
"@web/dev-server": "^0.1.38",
|
|
37
|
-
"@web/dev-server-storybook": "^0.3.7-next.0",
|
|
38
42
|
"@web/test-runner": "^0.13.31",
|
|
39
43
|
"eslint": "^7.32.0",
|
|
40
44
|
"eslint-config-prettier": "^8.10.0",
|
|
45
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
41
46
|
"husky": "^4.3.8",
|
|
42
47
|
"lint-staged": "^10.5.4",
|
|
43
|
-
"prettier": "^2.8.8"
|
|
48
|
+
"prettier": "^2.8.8",
|
|
49
|
+
"react": "^18.2.0",
|
|
50
|
+
"react-dom": "^18.2.0",
|
|
51
|
+
"storybook": "^7.5.3"
|
|
44
52
|
},
|
|
45
53
|
"customElements": "custom-elements.json",
|
|
46
54
|
"eslintConfig": {
|
|
47
55
|
"extends": [
|
|
48
56
|
"@open-wc",
|
|
49
|
-
"prettier"
|
|
57
|
+
"prettier",
|
|
58
|
+
"plugin:storybook/recommended"
|
|
50
59
|
]
|
|
51
60
|
},
|
|
52
61
|
"prettier": {
|
package/src/PdMenu.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
import { LitElement, html, css } from 'lit';
|
|
8
8
|
import { installMediaQueryWatcher } from 'pwa-helpers/media-query.js';
|
|
9
|
-
import { ICON_TOOGLE_ARROW as
|
|
9
|
+
import { ICON_TOOGLE_ARROW as toggleArrow } from '@progressive-development/pd-icon/src/PdIcon.js';
|
|
10
|
+
import { ICON_BURGER_MENU as burgerIcon } from '@progressive-development/pd-icon/src/PdIcon.js';
|
|
10
11
|
import '@progressive-development/pd-icon/pd-icon.js';
|
|
11
12
|
import { PDColorStyles, PDFontStyles } from '@progressive-development/pd-shared-styles';
|
|
12
13
|
|
|
@@ -65,9 +66,11 @@ export class PdMenu extends LitElement {
|
|
|
65
66
|
|
|
66
67
|
.burger-ul {
|
|
67
68
|
visibility: hidden;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
z-index: -1;
|
|
68
71
|
position: absolute;
|
|
69
72
|
flex-direction: column;
|
|
70
|
-
top:
|
|
73
|
+
top: calc(var(--pd-menu-height, 100px) * -1);
|
|
71
74
|
right: 0px;
|
|
72
75
|
background-color: var(--pd-menu-burger-bg-col, var(--pd-default-light-col));
|
|
73
76
|
|
|
@@ -77,11 +80,49 @@ export class PdMenu extends LitElement {
|
|
|
77
80
|
width:100%;
|
|
78
81
|
-moz-border-radius: var(--pd-border-radius);
|
|
79
82
|
border-radius: var(--pd-border-radius);
|
|
83
|
+
|
|
84
|
+
transition: 0.5s;
|
|
85
|
+
transition-timing-function: ease-out;
|
|
86
|
+
|
|
87
|
+
transform: translateY(0);
|
|
88
|
+
opacity: 0;
|
|
80
89
|
}
|
|
81
90
|
|
|
91
|
+
.locale-ul {
|
|
92
|
+
visibility: hidden;
|
|
93
|
+
position: absolute;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
top: 10px;
|
|
96
|
+
right: 15px;
|
|
97
|
+
background-color: var(--pd-menu-burger-bg-col, var(--pd-default-light-col));
|
|
98
|
+
|
|
99
|
+
box-shadow: var(--pd-menu-shadow, 3px 3px 5px grey);
|
|
100
|
+
border-bottom: var(--pd-menu-burger-bottomborder);
|
|
101
|
+
padding: var(--pd-menu-burger-padding, 0);
|
|
102
|
+
-moz-border-radius: var(--pd-border-radius);
|
|
103
|
+
border-radius: var(--pd-border-radius);
|
|
104
|
+
|
|
105
|
+
transition: 0.5s;
|
|
106
|
+
transition-timing-function: ease-out;
|
|
107
|
+
|
|
108
|
+
transform: translateY(0);
|
|
109
|
+
opacity: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
82
112
|
:host([_activeBurgerMenu]) .burger-ul {
|
|
83
|
-
visibility: visible;
|
|
84
|
-
|
|
113
|
+
visibility: visible;
|
|
114
|
+
opacity: 1;
|
|
115
|
+
top: var(--pd-menu-burger-top, var(--pd-menu-height, 100px));
|
|
116
|
+
transition-timing-function: ease-in;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
:host([_activeLocaleMenu]) .locale-ul {
|
|
121
|
+
visibility: visible;
|
|
122
|
+
opacity: 1;
|
|
123
|
+
top: 40px;
|
|
124
|
+
transition-timing-function: ease-in;
|
|
125
|
+
}
|
|
85
126
|
|
|
86
127
|
.menu-li {
|
|
87
128
|
display: flex;
|
|
@@ -98,6 +139,10 @@ export class PdMenu extends LitElement {
|
|
|
98
139
|
height:1rem;
|
|
99
140
|
}
|
|
100
141
|
|
|
142
|
+
.locale-li {
|
|
143
|
+
position: relative;
|
|
144
|
+
}
|
|
145
|
+
|
|
101
146
|
.burger-li:hover {
|
|
102
147
|
background-color: var(--pd-default-dark-col);
|
|
103
148
|
}
|
|
@@ -114,6 +159,10 @@ export class PdMenu extends LitElement {
|
|
|
114
159
|
color: var(--pd-menu-burger-font-col, var(--pd-default-dark-col));
|
|
115
160
|
}
|
|
116
161
|
|
|
162
|
+
.locale-item {
|
|
163
|
+
padding-left: 1.5em;
|
|
164
|
+
}
|
|
165
|
+
|
|
117
166
|
.item.active,
|
|
118
167
|
.item:hover {
|
|
119
168
|
color: var(--pd-default-hover-col);
|
|
@@ -135,21 +184,32 @@ export class PdMenu extends LitElement {
|
|
|
135
184
|
|
|
136
185
|
.burger-menu {
|
|
137
186
|
display: flex;
|
|
187
|
+
gap: 0.3rem;
|
|
138
188
|
width: 100%;
|
|
139
|
-
justify-content:
|
|
189
|
+
justify-content: end;
|
|
190
|
+
align-items: center;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.burger-menu .item{
|
|
194
|
+
padding: 0;
|
|
195
|
+
font-size: 1.5em;
|
|
140
196
|
}
|
|
141
197
|
|
|
142
198
|
.topItemLogo {
|
|
143
199
|
--pd-icon-size: 1.4rem;
|
|
144
|
-
|
|
145
|
-
--pd-icon-bg-col: var(--pd-menu-bg-col, var(--pd-default-col));
|
|
146
|
-
--pd-icon-col: var(--pd-menu-bg-col, var(--pd-default-dark-col));
|
|
200
|
+
--pd-icon-bg-col: transparent;
|
|
147
201
|
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
148
|
-
|
|
202
|
+
--pd-icon-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
203
|
+
pointer-events: none;
|
|
204
|
+
}
|
|
149
205
|
|
|
206
|
+
.burgerLogo {
|
|
207
|
+
--pd-icon-size: 2rem;
|
|
150
208
|
--pd-icon-bg-col: transparent;
|
|
151
209
|
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
152
|
-
--pd-icon-col: var(--pd-
|
|
210
|
+
--pd-icon-col: var(--pd-default-hover-col);
|
|
211
|
+
--pd-icon-stroke-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
212
|
+
--pd-icon-col-active: lightgrey;
|
|
153
213
|
pointer-events: none;
|
|
154
214
|
}
|
|
155
215
|
|
|
@@ -168,10 +228,11 @@ export class PdMenu extends LitElement {
|
|
|
168
228
|
.locale-selection-logo {
|
|
169
229
|
--pd-icon-size: 0.8rem;
|
|
170
230
|
--pd-icon-bg-col: transparent;
|
|
171
|
-
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col))
|
|
172
|
-
--pd-icon-col: var(--pd-
|
|
173
|
-
--pd-icon-stroke-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col))
|
|
174
|
-
--pd-icon-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col))
|
|
231
|
+
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
232
|
+
--pd-icon-col: var(--pd-default-hover-col);
|
|
233
|
+
--pd-icon-stroke-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
234
|
+
--pd-icon-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
235
|
+
margin-top: 2px;
|
|
175
236
|
pointer-events: none;
|
|
176
237
|
}
|
|
177
238
|
|
|
@@ -257,15 +318,25 @@ export class PdMenu extends LitElement {
|
|
|
257
318
|
${this._renderItems(this.topMenuItems, false)}
|
|
258
319
|
|
|
259
320
|
${(this.locales && this.locales.length) > 1 ? html`
|
|
260
|
-
<li class="item menu-li" @click="${this._toggleLocaleSelection}">
|
|
321
|
+
<li class="item menu-li locale-li" @click="${this._toggleLocaleSelection}">
|
|
261
322
|
${this.selectedLocale}
|
|
262
|
-
<pd-icon class="locale-selection-logo" icon="${
|
|
323
|
+
<pd-icon class="locale-selection-logo" icon="${toggleArrow}" ?activeIcon="${!this._activeLocaleMenu}"></pd-icon>
|
|
324
|
+
<ul class="menu-ul locale-ul">
|
|
325
|
+
${this.locales.map(locale => html`
|
|
326
|
+
<li class="item menu-li burger-li burger-item locale-item"
|
|
327
|
+
data-key="${locale}"
|
|
328
|
+
@click="${this._localeClicked}"
|
|
329
|
+
>
|
|
330
|
+
${locale}
|
|
331
|
+
</li>
|
|
332
|
+
`)}
|
|
333
|
+
</ul>
|
|
263
334
|
</li>
|
|
264
335
|
` : ''}
|
|
265
336
|
</ul>
|
|
266
337
|
` : html`
|
|
267
338
|
<div class="burger-menu" @click="${this._toggleBurgerMenu}">
|
|
268
|
-
<pd-icon class="
|
|
339
|
+
<pd-icon class="burgerLogo" icon="${burgerIcon}" ?activeIcon="${!this._activeBurgerMenu}"></pd-icon>
|
|
269
340
|
<span class="item">Menu</span>
|
|
270
341
|
</div>
|
|
271
342
|
`}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
|
|
3
|
-
import '
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
3
|
+
import '../../pd-teaser.js';
|
|
4
|
+
import '../../pd-menu.js';
|
|
5
|
+
import '../../pd-contact-us.js';
|
|
6
|
+
import '../../pd-footer.js';
|
|
7
7
|
|
|
8
8
|
const ticomiLogo = html`
|
|
9
9
|
<svg
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
|
|
3
|
-
import '
|
|
3
|
+
import '../../pd-menu.js';
|
|
4
4
|
|
|
5
5
|
const ticomiLogo = html`
|
|
6
6
|
<svg
|
|
@@ -82,11 +82,12 @@ export default {
|
|
|
82
82
|
},
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
function Template({ menuItems, topMenuItems, color, logo, menuColor, locales, selectedLocale, noBurger }) {
|
|
85
|
+
function Template({ menuItems, topMenuItems, color, logo, menuColor, locales, selectedLocale, noBurger, menuHeight }) {
|
|
86
86
|
return html`
|
|
87
87
|
<pd-menu
|
|
88
|
-
style="--
|
|
89
|
-
|
|
88
|
+
style="--pd-menu-bg-col: ${menuColor || color};
|
|
89
|
+
--pd-menu-height: ${menuHeight || 160}px;
|
|
90
|
+
transition: background-color 1s;"
|
|
90
91
|
.menuItems=${menuItems}
|
|
91
92
|
.topMenuItems=${topMenuItems}
|
|
92
93
|
?teaserClosed="${true}"
|
|
@@ -169,3 +170,19 @@ WithoutBurger.args = {
|
|
|
169
170
|
selectedLocale: "de",
|
|
170
171
|
noBurger: true
|
|
171
172
|
};
|
|
173
|
+
|
|
174
|
+
// with top items
|
|
175
|
+
export const SmallTopMenuWitoutBurger = Template.bind({});
|
|
176
|
+
SmallTopMenuWitoutBurger.args = {
|
|
177
|
+
menuItems: [],
|
|
178
|
+
topMenuItems: [
|
|
179
|
+
{ name: 'Preise', route: 'prices' },
|
|
180
|
+
{ name: 'AGB', route: 'agb' },
|
|
181
|
+
{ name: 'Profile', icon: 'userIcon', route: 'profile' }
|
|
182
|
+
],
|
|
183
|
+
color: '#084c61',
|
|
184
|
+
locales: ["de", "en"],
|
|
185
|
+
selectedLocale: "de",
|
|
186
|
+
menuHeight: 50,
|
|
187
|
+
noBurger: true
|
|
188
|
+
};
|
package/.storybook/server.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { storybookPlugin } from '@web/dev-server-storybook';
|
|
2
|
-
import baseConfig from '../web-dev-server.config.mjs';
|
|
3
|
-
|
|
4
|
-
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
5
|
-
...baseConfig,
|
|
6
|
-
open: '/',
|
|
7
|
-
plugins: [storybookPlugin({ type: 'web-components' }), ...baseConfig.plugins],
|
|
8
|
-
});
|