@progressive-development/pd-page 0.1.94 → 0.1.96
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 +26 -17
- package/src/PdMenu.js +39 -15
- 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.96",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -13,40 +13,49 @@
|
|
|
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",
|
|
23
|
-
"@progressive-development/pd-contact": "^0.1.
|
|
24
|
-
"@progressive-development/pd-dialog": "^0.1.
|
|
25
|
-
"@progressive-development/pd-forms": "^0.1.
|
|
26
|
-
"@progressive-development/pd-icon": "^0.1.
|
|
23
|
+
"@progressive-development/pd-contact": "^0.1.48",
|
|
24
|
+
"@progressive-development/pd-dialog": "^0.1.64",
|
|
25
|
+
"@progressive-development/pd-forms": "^0.1.50",
|
|
26
|
+
"@progressive-development/pd-icon": "^0.1.17",
|
|
27
27
|
"@progressive-development/pd-shared-styles": "^0.1.1",
|
|
28
|
-
"lit": "^2.
|
|
28
|
+
"lit": "^2.8.0",
|
|
29
29
|
"pwa-helpers": "^0.9.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
33
|
-
"@lit/localize-tools": "^0.6.
|
|
33
|
+
"@lit/localize-tools": "^0.6.10",
|
|
34
34
|
"@open-wc/eslint-config": "^4.3.0",
|
|
35
|
-
"@open-wc/testing": "next",
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
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",
|
|
41
|
+
"@web/dev-server": "^0.1.38",
|
|
42
|
+
"@web/test-runner": "^0.13.31",
|
|
39
43
|
"eslint": "^7.32.0",
|
|
40
|
-
"eslint-config-prettier": "^8.
|
|
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.
|
|
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,10 +80,19 @@ 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
|
|
|
82
91
|
:host([_activeBurgerMenu]) .burger-ul {
|
|
83
|
-
visibility: visible;
|
|
92
|
+
visibility: visible;
|
|
93
|
+
opacity: 1;
|
|
94
|
+
top: var(--pd-menu-burger-top, var(--pd-menu-height, 100px));
|
|
95
|
+
transition-timing-function: ease-in;
|
|
84
96
|
}
|
|
85
97
|
|
|
86
98
|
.menu-li {
|
|
@@ -135,21 +147,32 @@ export class PdMenu extends LitElement {
|
|
|
135
147
|
|
|
136
148
|
.burger-menu {
|
|
137
149
|
display: flex;
|
|
150
|
+
gap: 0.3rem;
|
|
138
151
|
width: 100%;
|
|
139
|
-
justify-content:
|
|
152
|
+
justify-content: end;
|
|
153
|
+
align-items: center;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.burger-menu .item{
|
|
157
|
+
padding: 0;
|
|
158
|
+
font-size: 1.5em;
|
|
140
159
|
}
|
|
141
160
|
|
|
142
161
|
.topItemLogo {
|
|
143
162
|
--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));
|
|
163
|
+
--pd-icon-bg-col: transparent;
|
|
147
164
|
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
148
|
-
|
|
165
|
+
--pd-icon-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
}
|
|
149
168
|
|
|
169
|
+
.burgerLogo {
|
|
170
|
+
--pd-icon-size: 2rem;
|
|
150
171
|
--pd-icon-bg-col: transparent;
|
|
151
172
|
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
152
|
-
--pd-icon-col: var(--pd-
|
|
173
|
+
--pd-icon-col: var(--pd-default-hover-col);
|
|
174
|
+
--pd-icon-stroke-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
175
|
+
--pd-icon-col-active: lightgrey;
|
|
153
176
|
pointer-events: none;
|
|
154
177
|
}
|
|
155
178
|
|
|
@@ -168,10 +191,11 @@ export class PdMenu extends LitElement {
|
|
|
168
191
|
.locale-selection-logo {
|
|
169
192
|
--pd-icon-size: 0.8rem;
|
|
170
193
|
--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))
|
|
194
|
+
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
195
|
+
--pd-icon-col: var(--pd-default-hover-col);
|
|
196
|
+
--pd-icon-stroke-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
197
|
+
--pd-icon-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
198
|
+
margin-top: 2px;
|
|
175
199
|
pointer-events: none;
|
|
176
200
|
}
|
|
177
201
|
|
|
@@ -259,13 +283,13 @@ export class PdMenu extends LitElement {
|
|
|
259
283
|
${(this.locales && this.locales.length) > 1 ? html`
|
|
260
284
|
<li class="item menu-li" @click="${this._toggleLocaleSelection}">
|
|
261
285
|
${this.selectedLocale}
|
|
262
|
-
<pd-icon class="locale-selection-logo" icon="${
|
|
286
|
+
<pd-icon class="locale-selection-logo" icon="${toggleArrow}" ?activeIcon="${!this._activeLocaleMenu}"></pd-icon>
|
|
263
287
|
</li>
|
|
264
288
|
` : ''}
|
|
265
289
|
</ul>
|
|
266
290
|
` : html`
|
|
267
291
|
<div class="burger-menu" @click="${this._toggleBurgerMenu}">
|
|
268
|
-
<pd-icon class="
|
|
292
|
+
<pd-icon class="burgerLogo" icon="${burgerIcon}" ?activeIcon="${!this._activeBurgerMenu}"></pd-icon>
|
|
269
293
|
<span class="item">Menu</span>
|
|
270
294
|
</div>
|
|
271
295
|
`}
|
|
@@ -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 || 80}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
|
-
});
|