@progressive-development/pd-wizard 0.9.2 → 1.0.0
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/LICENSE +21 -2
- package/README.md +33 -57
- package/dist/default-step-address/DefaultStepAddress.d.ts +26 -0
- package/dist/default-step-address/DefaultStepAddress.d.ts.map +1 -0
- package/dist/default-step-address/DefaultStepAddress.js +66 -0
- package/dist/default-step-address/default-step-address.d.ts +2 -0
- package/dist/default-step-address/default-step-address.d.ts.map +1 -0
- package/dist/default-step-address.d.ts +2 -0
- package/dist/default-step-address.js +1 -0
- package/dist/default-step-summary/DefaultStepSummary.d.ts +58 -0
- package/dist/default-step-summary/DefaultStepSummary.d.ts.map +1 -0
- package/dist/default-step-summary/DefaultStepSummary.js +77 -0
- package/dist/default-step-summary/default-step-summary.d.ts +3 -0
- package/dist/default-step-summary/default-step-summary.d.ts.map +1 -0
- package/dist/default-step-summary.d.ts +2 -0
- package/dist/default-step-summary.js +1 -0
- package/dist/default-wizard/DefaultWizard.d.ts +57 -0
- package/dist/default-wizard/DefaultWizard.d.ts.map +1 -0
- package/dist/default-wizard/DefaultWizard.js +270 -0
- package/dist/default-wizard/default-wizard.d.ts +3 -0
- package/dist/default-wizard/default-wizard.d.ts.map +1 -0
- package/dist/default-wizard.d.ts +2 -0
- package/dist/default-wizard.js +1 -0
- package/dist/generated/locales/be.d.ts +17 -0
- package/dist/generated/locales/be.d.ts.map +1 -1
- package/dist/generated/locales/de.d.ts +17 -0
- package/dist/generated/locales/de.d.ts.map +1 -1
- package/dist/generated/locales/en.d.ts +17 -0
- package/dist/generated/locales/en.d.ts.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/locales/be.js +20 -1
- package/dist/locales/de.js +20 -1
- package/dist/locales/en.js +20 -1
- package/dist/pd-components/pd-content/dist/pd-notice-box/PdNoticeBox.js +224 -0
- package/dist/pd-components/pd-content/dist/pd-notice-box/pd-notice-box.js +8 -0
- package/dist/pd-default-wizard-step/PdDefaultWizardStep.d.ts +85 -0
- package/dist/pd-default-wizard-step/PdDefaultWizardStep.d.ts.map +1 -0
- package/dist/pd-default-wizard-step/PdDefaultWizardStep.js +167 -0
- package/dist/pd-default-wizard-step/pd-default-wizard-step.d.ts +2 -0
- package/dist/pd-default-wizard-step/pd-default-wizard-step.d.ts.map +1 -0
- package/dist/pd-default-wizard-step.d.ts +2 -0
- package/dist/pd-default-wizard-step.js +1 -0
- package/dist/pd-utils/dist/date-helper.js +35 -0
- package/dist/pd-utils/dist/locale-format.js +6 -0
- package/dist/pd-wizard/PdWizard.d.ts +36 -23
- package/dist/pd-wizard/PdWizard.d.ts.map +1 -1
- package/dist/pd-wizard/PdWizard.js +91 -142
- package/dist/pd-wizard/pd-steps/PdSteps.d.ts +26 -10
- package/dist/pd-wizard/pd-steps/PdSteps.d.ts.map +1 -1
- package/dist/pd-wizard/pd-steps/PdSteps.js +126 -59
- package/dist/pd-wizard/pd-steps/pd-steps.stories.d.ts +45 -37
- package/dist/pd-wizard/pd-steps/pd-steps.stories.d.ts.map +1 -1
- package/dist/pd-wizard/pd-wizard.stories.d.ts +46 -7
- package/dist/pd-wizard/pd-wizard.stories.d.ts.map +1 -1
- package/dist/wizard-close-popup/WizardClosePopup.d.ts +12 -0
- package/dist/wizard-close-popup/WizardClosePopup.d.ts.map +1 -0
- package/dist/wizard-close-popup/WizardClosePopup.js +56 -0
- package/dist/wizard-close-popup/wizard-close-popup.d.ts +2 -0
- package/dist/wizard-close-popup/wizard-close-popup.d.ts.map +1 -0
- package/dist/wizard-close-popup/wizard-close-popup.stories.d.ts +39 -0
- package/dist/wizard-close-popup/wizard-close-popup.stories.d.ts.map +1 -0
- package/dist/wizard-close-popup.d.ts +2 -0
- package/dist/wizard-close-popup.js +1 -0
- package/dist/wizard-reload-popup/WizardReloadPopup.d.ts +19 -0
- package/dist/wizard-reload-popup/WizardReloadPopup.d.ts.map +1 -0
- package/dist/wizard-reload-popup/WizardReloadPopup.js +88 -0
- package/dist/wizard-reload-popup/wizard-reload-popup.d.ts +3 -0
- package/dist/wizard-reload-popup/wizard-reload-popup.d.ts.map +1 -0
- package/dist/wizard-reload-popup/wizard-reload-popup.stories.d.ts +42 -0
- package/dist/wizard-reload-popup/wizard-reload-popup.stories.d.ts.map +1 -0
- package/dist/wizard-reload-popup.d.ts +2 -0
- package/dist/wizard-reload-popup.js +1 -0
- package/package.json +18 -5
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { LitElement, css, html } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import { msg, str } from '@lit/localize';
|
|
3
6
|
|
|
4
7
|
var __defProp = Object.defineProperty;
|
|
5
8
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -20,12 +23,19 @@ class PdSteps extends LitElement {
|
|
|
20
23
|
static {
|
|
21
24
|
this.styles = [
|
|
22
25
|
css`
|
|
26
|
+
/* =========================================================================
|
|
27
|
+
HOST & LAYOUT
|
|
28
|
+
========================================================================= */
|
|
23
29
|
:host {
|
|
24
|
-
--
|
|
30
|
+
--_circle-size: var(--pd-step-circle-size, 40px);
|
|
31
|
+
--_name-font-size: var(--pd-step-name-font-size, 0.9em);
|
|
32
|
+
--_color: var(--pd-step-color, var(--pd-on-primary-col));
|
|
33
|
+
--_bg: var(--pd-step-bg, var(--pd-default-col));
|
|
34
|
+
|
|
25
35
|
display: block;
|
|
26
|
-
background-color: var(--
|
|
27
|
-
padding-top:
|
|
28
|
-
padding-bottom: calc(var(--
|
|
36
|
+
background-color: var(--_bg);
|
|
37
|
+
padding-top: 0.5em;
|
|
38
|
+
padding-bottom: calc(var(--_name-font-size) * 2.5);
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
.parent {
|
|
@@ -35,6 +45,9 @@ class PdSteps extends LitElement {
|
|
|
35
45
|
position: relative;
|
|
36
46
|
}
|
|
37
47
|
|
|
48
|
+
/* =========================================================================
|
|
49
|
+
STEP CONTAINER (state holder)
|
|
50
|
+
========================================================================= */
|
|
38
51
|
.step-container {
|
|
39
52
|
display: flex;
|
|
40
53
|
flex-direction: column;
|
|
@@ -45,81 +58,108 @@ class PdSteps extends LitElement {
|
|
|
45
58
|
position: relative;
|
|
46
59
|
}
|
|
47
60
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
/* =========================================================================
|
|
62
|
+
CIRCLE (the clickable step indicator)
|
|
63
|
+
========================================================================= */
|
|
64
|
+
.step {
|
|
65
|
+
width: var(--_circle-size);
|
|
66
|
+
height: var(--_circle-size);
|
|
51
67
|
border-radius: 50%;
|
|
52
|
-
border: solid var(--
|
|
53
|
-
|
|
54
|
-
background-color: var(--pd-step-circle-bg-color, var(--pd-default-col));
|
|
68
|
+
border: solid 2px var(--_color);
|
|
69
|
+
background-color: var(--_bg);
|
|
55
70
|
display: flex;
|
|
56
71
|
justify-content: center;
|
|
57
72
|
align-items: center;
|
|
58
73
|
position: relative;
|
|
59
|
-
z-index: 51;
|
|
74
|
+
z-index: 51;
|
|
60
75
|
}
|
|
61
76
|
|
|
62
|
-
/*
|
|
77
|
+
/* =========================================================================
|
|
78
|
+
STEP NUMBER (inside circle)
|
|
79
|
+
========================================================================= */
|
|
63
80
|
.step-nr {
|
|
64
81
|
font-family: var(--pd-default-font-title-family);
|
|
65
82
|
font-weight: bold;
|
|
66
|
-
|
|
67
|
-
|
|
83
|
+
font-size: calc(var(--_circle-size) / 1.8);
|
|
84
|
+
color: var(--_color);
|
|
68
85
|
position: absolute;
|
|
69
86
|
pointer-events: none;
|
|
70
87
|
}
|
|
71
88
|
|
|
89
|
+
/* =========================================================================
|
|
90
|
+
CONNECTING LINE
|
|
91
|
+
========================================================================= */
|
|
72
92
|
hr {
|
|
73
|
-
background-color: var(--
|
|
93
|
+
background-color: var(--_color);
|
|
74
94
|
height: 2px;
|
|
75
95
|
position: absolute;
|
|
76
96
|
top: 50%;
|
|
77
97
|
left: 0;
|
|
78
98
|
width: 100%;
|
|
79
99
|
z-index: 50;
|
|
80
|
-
border
|
|
81
|
-
border-width: 0;
|
|
100
|
+
border: none;
|
|
82
101
|
margin: 0;
|
|
83
102
|
}
|
|
84
103
|
|
|
104
|
+
/* =========================================================================
|
|
105
|
+
STEP NAME (below circle)
|
|
106
|
+
========================================================================= */
|
|
85
107
|
.step-name {
|
|
86
108
|
font-family: var(--pd-default-font-title-family);
|
|
87
|
-
color: var(--pd-step-name-color, white);
|
|
88
|
-
font-size: var(--pd-step-name-font-size, 1em);
|
|
89
109
|
font-weight: bold;
|
|
110
|
+
font-size: var(--_name-font-size);
|
|
111
|
+
color: var(--_color);
|
|
90
112
|
position: absolute;
|
|
91
|
-
top: calc(
|
|
92
|
-
var(--circle-size) + (var(--pd-step-name-font-size, 1em) / 2)
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.current {
|
|
97
|
-
color: var(--pd-step-color-current, var(--pd-default-hover-col));
|
|
113
|
+
top: calc(var(--_circle-size) + (var(--_name-font-size) / 2));
|
|
98
114
|
}
|
|
99
115
|
|
|
100
|
-
|
|
101
|
-
|
|
116
|
+
/* =========================================================================
|
|
117
|
+
STATE: CURRENT
|
|
118
|
+
========================================================================= */
|
|
119
|
+
.step-container.current .step {
|
|
120
|
+
border-color: var(--pd-step-current-color, var(--pd-default-hover-col));
|
|
102
121
|
}
|
|
103
122
|
|
|
104
|
-
.
|
|
105
|
-
|
|
123
|
+
.step-container.current .step-nr,
|
|
124
|
+
.step-container.current .step-name {
|
|
125
|
+
color: var(--pd-step-current-color, var(--pd-default-hover-col));
|
|
106
126
|
}
|
|
107
127
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
128
|
+
/* =========================================================================
|
|
129
|
+
STATE: PASSED
|
|
130
|
+
========================================================================= */
|
|
131
|
+
.step-container.passed .step {
|
|
132
|
+
border-color: var(--pd-default-success-col);
|
|
133
|
+
background-color: var(
|
|
134
|
+
--pd-step-passed-bg,
|
|
135
|
+
var(--pd-default-success-light-col)
|
|
112
136
|
);
|
|
113
|
-
background-color: var(--pd-default-success-light-col);
|
|
114
137
|
cursor: pointer;
|
|
115
138
|
}
|
|
116
139
|
|
|
140
|
+
.step-container.passed .step-nr {
|
|
141
|
+
color: var(--pd-step-passed-nr-color, var(--pd-default-col));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* passed name uses default --_color (same as pending) */
|
|
145
|
+
|
|
146
|
+
.step-container.passed .step:hover {
|
|
147
|
+
transform: scale(1.1);
|
|
148
|
+
transition: transform 0.15s ease-in-out;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.step-container.passed .step:focus-visible {
|
|
152
|
+
outline: 2px solid var(--pd-focus-ring-col, var(--pd-default-hover-col));
|
|
153
|
+
outline-offset: 2px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* =========================================================================
|
|
157
|
+
RESPONSIVE
|
|
158
|
+
========================================================================= */
|
|
117
159
|
@media (max-width: 700px) {
|
|
118
160
|
:host {
|
|
119
|
-
--
|
|
120
|
-
|
|
121
|
-
.step-name {
|
|
122
|
-
font-size: 0.9em;
|
|
161
|
+
--_circle-size: var(--pd-step-circle-size, 30px);
|
|
162
|
+
--_name-font-size: var(--pd-step-name-font-size, 0.8em);
|
|
123
163
|
}
|
|
124
164
|
}
|
|
125
165
|
`
|
|
@@ -130,35 +170,45 @@ class PdSteps extends LitElement {
|
|
|
130
170
|
}
|
|
131
171
|
_renderCircle() {
|
|
132
172
|
return html`
|
|
133
|
-
<div
|
|
134
|
-
|
|
173
|
+
<div
|
|
174
|
+
class="parent"
|
|
175
|
+
role="list"
|
|
176
|
+
aria-label="${msg("Wizard-Schritte", { id: "pd.steps.aria.label" })}"
|
|
177
|
+
>
|
|
178
|
+
<hr />
|
|
135
179
|
${this.steps.map((st, index) => {
|
|
136
180
|
const stepNr = index + 1;
|
|
137
181
|
const isCurrent = this.currentStepNr === stepNr;
|
|
138
182
|
const isPassed = this.currentStepNr > stepNr;
|
|
139
|
-
const
|
|
140
|
-
"step",
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
"
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
|
|
183
|
+
const containerClasses = classMap({
|
|
184
|
+
"step-container": true,
|
|
185
|
+
current: isCurrent,
|
|
186
|
+
passed: isPassed
|
|
187
|
+
});
|
|
188
|
+
const stepLabel = isPassed ? msg(
|
|
189
|
+
str`Schritt ${stepNr}: ${st.name ?? ""} - abgeschlossen, klicken um zurückzukehren`,
|
|
190
|
+
{ id: "pd.steps.aria.passed" }
|
|
191
|
+
) : isCurrent ? msg(
|
|
192
|
+
str`Schritt ${stepNr}: ${st.name ?? ""} - aktueller Schritt`,
|
|
193
|
+
{ id: "pd.steps.aria.current" }
|
|
194
|
+
) : msg(str`Schritt ${stepNr}: ${st.name ?? ""} - ausstehend`, {
|
|
195
|
+
id: "pd.steps.aria.pending"
|
|
196
|
+
});
|
|
152
197
|
return html`
|
|
153
|
-
<div class="
|
|
198
|
+
<div class="${containerClasses}" role="listitem">
|
|
154
199
|
<div
|
|
155
|
-
class="
|
|
200
|
+
class="step"
|
|
156
201
|
data-step="${stepNr}"
|
|
157
|
-
|
|
202
|
+
tabindex="${isPassed ? "0" : "-1"}"
|
|
203
|
+
role="${ifDefined(isPassed ? "button" : void 0)}"
|
|
204
|
+
aria-label="${stepLabel}"
|
|
205
|
+
aria-current="${ifDefined(isCurrent ? "step" : void 0)}"
|
|
206
|
+
@click="${this._stepClicked}"
|
|
207
|
+
@keydown="${this._handleStepKeydown}"
|
|
158
208
|
>
|
|
159
|
-
<span class="
|
|
209
|
+
<span class="step-nr" aria-hidden="true">${stepNr}</span>
|
|
160
210
|
</div>
|
|
161
|
-
<span class="
|
|
211
|
+
<span class="step-name" aria-hidden="true">${st.name}</span>
|
|
162
212
|
</div>
|
|
163
213
|
`;
|
|
164
214
|
})}
|
|
@@ -167,6 +217,23 @@ class PdSteps extends LitElement {
|
|
|
167
217
|
}
|
|
168
218
|
_stepClicked(e) {
|
|
169
219
|
const stepStr = e.currentTarget.dataset.step;
|
|
220
|
+
this._navigateToStep(stepStr);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Handles keyboard events on step circles.
|
|
224
|
+
* Activates on Enter or Space key.
|
|
225
|
+
*/
|
|
226
|
+
_handleStepKeydown(e) {
|
|
227
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
228
|
+
e.preventDefault();
|
|
229
|
+
const stepStr = e.currentTarget.dataset.step;
|
|
230
|
+
this._navigateToStep(stepStr);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Navigates to a specific step if it's a passed step.
|
|
235
|
+
*/
|
|
236
|
+
_navigateToStep(stepStr) {
|
|
170
237
|
const step = Number(stepStr);
|
|
171
238
|
if (!isNaN(step) && step < this.currentStepNr) {
|
|
172
239
|
this.dispatchEvent(
|
|
@@ -1,42 +1,50 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/web-components';
|
|
2
|
-
|
|
3
|
-
title: string;
|
|
4
|
-
component: string;
|
|
5
|
-
tags: string[];
|
|
6
|
-
render: ({ steps, currentStepNr, styleTyp }: import('@storybook/web-components').Args) => import('lit').TemplateResult<1>;
|
|
7
|
-
argTypes: {
|
|
8
|
-
steps: {
|
|
9
|
-
control: "object";
|
|
10
|
-
};
|
|
11
|
-
currentStepNr: {
|
|
12
|
-
control: {
|
|
13
|
-
type: "number";
|
|
14
|
-
min: number;
|
|
15
|
-
max: number;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
styleTyp: {
|
|
19
|
-
control: "select";
|
|
20
|
-
options: string[];
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export default meta;
|
|
25
|
-
type Story = StoryObj;
|
|
26
|
-
/**
|
|
27
|
-
* Standard-Zustand mit mehreren Schritten und aktuellem Schritt
|
|
28
|
-
*/
|
|
29
|
-
export declare const DefaultSteps: Story;
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { PdWizardStep } from '../../types.js';
|
|
30
3
|
/**
|
|
31
|
-
*
|
|
4
|
+
* Story arguments interface for pd-steps component.
|
|
5
|
+
* Maps to the component's public API.
|
|
32
6
|
*/
|
|
33
|
-
|
|
7
|
+
interface PdStepsArgs {
|
|
8
|
+
/** Step definitions with names */
|
|
9
|
+
steps: PdWizardStep[];
|
|
10
|
+
/** Current visible step (1-based) */
|
|
11
|
+
currentStepNr: number;
|
|
12
|
+
/** Display mode: circle or tab */
|
|
13
|
+
styleTyp: "circle" | "tab";
|
|
14
|
+
}
|
|
34
15
|
/**
|
|
35
|
-
*
|
|
16
|
+
* ## pd-steps
|
|
17
|
+
*
|
|
18
|
+
* A progress indicator component that displays wizard steps as numbered circles
|
|
19
|
+
* with connecting lines, showing current, passed, and future states.
|
|
20
|
+
*
|
|
21
|
+
* ### Features
|
|
22
|
+
* - Circle-style step indicators with numbered circles and connecting line
|
|
23
|
+
* - Three visual states: current (accent color), passed (green, clickable), and pending
|
|
24
|
+
* - Click navigation on passed steps to go back
|
|
25
|
+
* - Full keyboard accessibility on passed step circles
|
|
26
|
+
* - Responsive sizing for smaller screens
|
|
27
|
+
* - Step name labels displayed below each circle
|
|
28
|
+
* - CSS Custom Properties for circle size, colors, and font sizes
|
|
29
|
+
*
|
|
30
|
+
* ### Accessibility
|
|
31
|
+
* - Uses `role="list"` / `role="listitem"` for semantic step structure
|
|
32
|
+
* - Passed steps have `role="button"` and are keyboard focusable
|
|
33
|
+
* - `aria-current="step"` marks the current step
|
|
34
|
+
* - Each step has a descriptive `aria-label` with state information
|
|
35
|
+
* - Focus-visible styling on interactive passed steps
|
|
36
36
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*/
|
|
41
|
-
export declare const
|
|
37
|
+
declare const meta: Meta<PdStepsArgs>;
|
|
38
|
+
export default meta;
|
|
39
|
+
type Story = StoryObj<PdStepsArgs>;
|
|
40
|
+
/** Default step indicator with four steps, second step active. Interactive via Controls panel. */
|
|
41
|
+
export declare const Default: Story;
|
|
42
|
+
/** All step states shown in one overview: first step, middle step, last step, and all passed. */
|
|
43
|
+
export declare const AllStates: Story;
|
|
44
|
+
/** Six steps demonstrating how the indicator handles a larger number of steps. */
|
|
45
|
+
export declare const ManySteps: Story;
|
|
46
|
+
/** Tab-style display variant (alternative to circle style). */
|
|
47
|
+
export declare const TabStyle: Story;
|
|
48
|
+
/** CSS Custom Properties — Branded and Redesigned variants. */
|
|
49
|
+
export declare const CustomStyling: Story;
|
|
42
50
|
//# sourceMappingURL=pd-steps.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-steps.stories.d.ts","sourceRoot":"","sources":["../../../src/pd-wizard/pd-steps/pd-steps.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pd-steps.stories.d.ts","sourceRoot":"","sources":["../../../src/pd-wizard/pd-steps/pd-steps.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,eAAe,CAAC;AAMvB;;;GAGG;AACH,UAAU,WAAW;IACnB,kCAAkC;IAClC,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,qCAAqC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAAC;CAC5B;AAgCD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,WAAW,CA0F3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;AAMnC,kGAAkG;AAClG,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAMjC,iGAAiG;AACjG,eAAO,MAAM,SAAS,EAAE,KAwDvB,CAAC;AAMF,kFAAkF;AAClF,eAAO,MAAM,SAAS,EAAE,KAavB,CAAC;AAMF,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,EAAE,KAiBtB,CAAC;AAMF,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,KA+E3B,CAAC"}
|
|
@@ -1,12 +1,51 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/web-components';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
2
|
import { PdWizardStep } from '../types.js';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Story arguments interface for pd-wizard component.
|
|
5
|
+
* Maps to the component's public API.
|
|
6
|
+
*/
|
|
7
|
+
interface PdWizardArgs {
|
|
8
|
+
/** List of wizard step definitions */
|
|
4
9
|
wizardSteps: PdWizardStep[];
|
|
10
|
+
/** Current step number (1-based index) */
|
|
5
11
|
currentNumber: number;
|
|
6
|
-
}
|
|
7
|
-
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ## pd-wizard
|
|
15
|
+
*
|
|
16
|
+
* A multi-step wizard UI component with navigation, progress tracking, and submit handling.
|
|
17
|
+
*
|
|
18
|
+
* ### Features
|
|
19
|
+
* - Step navigation with Back/Next buttons and automatic visibility
|
|
20
|
+
* - Visual progress indicator via integrated pd-steps component
|
|
21
|
+
* - Dynamic step content via named slots (step-1, step-2, etc.)
|
|
22
|
+
* - Submit handling on final step with disabled-after-submit protection
|
|
23
|
+
* - Close button with keyboard accessibility (Enter/Space)
|
|
24
|
+
* - CSS Parts for full styling control (`::part(header)`, `::part(content)`, `::part(buttons)`)
|
|
25
|
+
* - CSS Custom Properties for token-based theming
|
|
26
|
+
* - Responsive padding adjustments for mobile screens
|
|
27
|
+
*
|
|
28
|
+
* ### Accessibility
|
|
29
|
+
* - Close icon is keyboard-focusable with `role="button"` and `aria-label`
|
|
30
|
+
* - Focus-visible styling on close icon for keyboard users
|
|
31
|
+
* - Back/Next buttons use native `<pd-button>` with full keyboard support
|
|
32
|
+
* - Step indicator supports keyboard navigation for passed steps
|
|
33
|
+
*/
|
|
34
|
+
declare const meta: Meta<PdWizardArgs>;
|
|
8
35
|
export default meta;
|
|
9
|
-
type Story = StoryObj<
|
|
10
|
-
|
|
11
|
-
export declare const
|
|
36
|
+
type Story = StoryObj<PdWizardArgs>;
|
|
37
|
+
/** Default wizard with four steps at the first step. Interactive via Controls panel. */
|
|
38
|
+
export declare const Default: Story;
|
|
39
|
+
/** Wizard navigated to the second step, showing Back and Next buttons. */
|
|
40
|
+
export declare const MiddleStep: Story;
|
|
41
|
+
/** Wizard at the final step with the Submit button replacing Next. */
|
|
42
|
+
export declare const FinalStep: Story;
|
|
43
|
+
/** A shorter wizard with three steps, demonstrating flexible step count. */
|
|
44
|
+
export declare const ThreeSteps: Story;
|
|
45
|
+
/** Default scroll behavior — content scrolls within fixed wizard height. */
|
|
46
|
+
export declare const ScrollableContent: Story;
|
|
47
|
+
/** Growing wizard — wizard expands with content, no internal scroll. */
|
|
48
|
+
export declare const GrowingContent: Story;
|
|
49
|
+
/** CSS Custom Properties and CSS Parts — Branded and Redesigned variants. */
|
|
50
|
+
export declare const CustomStyling: Story;
|
|
12
51
|
//# sourceMappingURL=pd-wizard.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-wizard.stories.d.ts","sourceRoot":"","sources":["../../src/pd-wizard/pd-wizard.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pd-wizard.stories.d.ts","sourceRoot":"","sources":["../../src/pd-wizard/pd-wizard.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,gBAAgB,CAAC;AAMxB;;;GAGG;AACH,UAAU,YAAY;IACpB,sCAAsC;IACtC,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;CACvB;AAuBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,YAAY,CAuH5B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAMpC,wFAAwF;AACxF,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAMF,0EAA0E;AAC1E,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAC;AAMF,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAMF,4EAA4E;AAC5E,eAAO,MAAM,UAAU,EAAE,KAgCxB,CAAC;AA2BF,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,EAAE,KAsC/B,CAAC;AAMF,wEAAwE;AACxE,eAAO,MAAM,cAAc,EAAE,KAqC5B,CAAC;AAMF,6EAA6E;AAC7E,eAAO,MAAM,aAAa,EAAE,KA+I3B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSResultGroup } from 'lit';
|
|
2
|
+
import { PdConfirmDialog, PdDialogType } from '@progressive-development/pd-dialog';
|
|
3
|
+
export declare class WizardClosePopup extends PdConfirmDialog {
|
|
4
|
+
protected _singleButton: boolean;
|
|
5
|
+
protected _dialogType: PdDialogType;
|
|
6
|
+
protected _dialogTitle: string;
|
|
7
|
+
/** Whether local storage persistence is enabled */
|
|
8
|
+
withStorage: boolean;
|
|
9
|
+
static styles: CSSResultGroup;
|
|
10
|
+
protected _renderContent(): import('lit').TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=WizardClosePopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardClosePopup.d.ts","sourceRoot":"","sources":["../../src/wizard-close-popup/WizardClosePopup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAIhD,OAAO,EACL,eAAe,EACf,YAAY,EACb,MAAM,oCAAoC,CAAC;AAE5C,qBACa,gBAAiB,SAAQ,eAAe;IACnD,SAAS,CAAC,aAAa,UAAS;IAEhC,SAAS,CAAC,WAAW,EAAE,YAAY,CAAU;IAE7C,SAAS,CAAC,YAAY,SAEnB;IAEH,mDAAmD;IAEnD,WAAW,UAAS;IAEpB,MAAM,CAAC,MAAM,EAQR,cAAc,CAAC;IAEpB,SAAS,CAAC,cAAc;CAezB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { css, html } from 'lit';
|
|
2
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
3
|
+
import { msg } from '@lit/localize';
|
|
4
|
+
import { PdConfirmDialog } from '@progressive-development/pd-dialog';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
9
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
10
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11
|
+
if (decorator = decorators[i])
|
|
12
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13
|
+
if (kind && result) __defProp(target, key, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
let WizardClosePopup = class extends PdConfirmDialog {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this._singleButton = false;
|
|
20
|
+
this._dialogType = "warn";
|
|
21
|
+
this._dialogTitle = msg("Änderungen verwerfen?", {
|
|
22
|
+
id: "pdWizard.close.popup.title"
|
|
23
|
+
});
|
|
24
|
+
this.withStorage = false;
|
|
25
|
+
}
|
|
26
|
+
_renderContent() {
|
|
27
|
+
return html`
|
|
28
|
+
<div class="popup-content">
|
|
29
|
+
<p>
|
|
30
|
+
${this.withStorage ? msg("Eingaben für später speichern oder verwerfen?", {
|
|
31
|
+
id: "pdWizard.close.popup.storage.content"
|
|
32
|
+
}) : msg("Nicht gespeicherte Daten gehen verloren.", {
|
|
33
|
+
id: "pdWizard.close.popup.noStorage.content"
|
|
34
|
+
})}
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
WizardClosePopup.styles = [
|
|
41
|
+
PdConfirmDialog.styles,
|
|
42
|
+
css`
|
|
43
|
+
.popup-content {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
}
|
|
47
|
+
`
|
|
48
|
+
];
|
|
49
|
+
__decorateClass([
|
|
50
|
+
property({ type: Boolean })
|
|
51
|
+
], WizardClosePopup.prototype, "withStorage", 2);
|
|
52
|
+
WizardClosePopup = __decorateClass([
|
|
53
|
+
customElement("wizard-close-popup")
|
|
54
|
+
], WizardClosePopup);
|
|
55
|
+
|
|
56
|
+
export { WizardClosePopup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard-close-popup.d.ts","sourceRoot":"","sources":["../../src/wizard-close-popup/wizard-close-popup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
/**
|
|
3
|
+
* Story arguments interface for wizard-close-popup component.
|
|
4
|
+
* Maps to the component's public API.
|
|
5
|
+
*/
|
|
6
|
+
interface WizardClosePopupArgs {
|
|
7
|
+
/** Whether local storage persistence is enabled */
|
|
8
|
+
withStorage: boolean;
|
|
9
|
+
/** Text for the confirm button */
|
|
10
|
+
confirmButtonText: string;
|
|
11
|
+
/** Text for the cancel button */
|
|
12
|
+
cancelButtonText: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ## wizard-close-popup
|
|
16
|
+
*
|
|
17
|
+
* A confirmation dialog shown when a user attempts to close a wizard with unsaved changes.
|
|
18
|
+
* Extends PdConfirmDialog with warning-style presentation.
|
|
19
|
+
*
|
|
20
|
+
* ### Features
|
|
21
|
+
* - Warning dialog type for visual emphasis on data loss
|
|
22
|
+
* - Two modes: with storage (save/discard) and without storage (close/cancel)
|
|
23
|
+
* - Customizable button texts via properties
|
|
24
|
+
* - Inherits full PdConfirmDialog behavior and styling
|
|
25
|
+
*
|
|
26
|
+
* ### Usage
|
|
27
|
+
* This component is typically used internally by DefaultWizard.
|
|
28
|
+
* It is instantiated programmatically when the close-wizard event fires.
|
|
29
|
+
*/
|
|
30
|
+
declare const meta: Meta<WizardClosePopupArgs>;
|
|
31
|
+
export default meta;
|
|
32
|
+
type Story = StoryObj<WizardClosePopupArgs>;
|
|
33
|
+
/** Default close popup without storage — warns about losing unsaved data. */
|
|
34
|
+
export declare const Default: Story;
|
|
35
|
+
/** Close popup with storage enabled — offers save/discard options. */
|
|
36
|
+
export declare const WithStorage: Story;
|
|
37
|
+
/** Side-by-side comparison of both modes: without and with storage. */
|
|
38
|
+
export declare const BothModes: Story;
|
|
39
|
+
//# sourceMappingURL=wizard-close-popup.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard-close-popup.stories.d.ts","sourceRoot":"","sources":["../../src/wizard-close-popup/wizard-close-popup.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,uBAAuB,CAAC;AAM/B;;;GAGG;AACH,UAAU,oBAAoB;IAC5B,mDAAmD;IACnD,WAAW,EAAE,OAAO,CAAC;IACrB,kCAAkC;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iCAAiC;IACjC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAMD;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,oBAAoB,CAqEpC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AAM5C,6EAA6E;AAC7E,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAMjC,sEAAsE;AACtE,eAAO,MAAM,WAAW,EAAE,KAmBzB,CAAC;AAMF,uEAAuE;AACvE,eAAO,MAAM,SAAS,EAAE,KAkCvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WizardClosePopup } from './wizard-close-popup/WizardClosePopup.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CSSResultGroup } from 'lit';
|
|
2
|
+
import { PdConfirmDialog, PdDialogType } from '@progressive-development/pd-dialog';
|
|
3
|
+
/** Reload item data from storage */
|
|
4
|
+
export interface WizardReloadItem {
|
|
5
|
+
/** Timestamp when data was saved */
|
|
6
|
+
timestamp: string;
|
|
7
|
+
/** Step number where user left off */
|
|
8
|
+
wizardStep: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class WizardReloadPopup extends PdConfirmDialog {
|
|
11
|
+
protected _singleButton: boolean;
|
|
12
|
+
protected _dialogType: PdDialogType;
|
|
13
|
+
protected _dialogTitle: string;
|
|
14
|
+
/** Saved wizard state to display */
|
|
15
|
+
reloadItem: WizardReloadItem;
|
|
16
|
+
static styles: CSSResultGroup;
|
|
17
|
+
protected _renderContent(): import('lit').TemplateResult<1>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=WizardReloadPopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardReloadPopup.d.ts","sourceRoot":"","sources":["../../src/wizard-reload-popup/WizardReloadPopup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAIhD,OAAO,0CAA0C,CAAC;AAElD,OAAO,mDAAmD,CAAC;AAE3D,OAAO,EACL,eAAe,EACf,YAAY,EACb,MAAM,oCAAoC,CAAC;AAO5C,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBACa,iBAAkB,SAAQ,eAAe;IACpD,SAAS,CAAC,aAAa,UAAS;IAEhC,SAAS,CAAC,WAAW,EAAE,YAAY,CAAU;IAE7C,SAAS,CAAC,YAAY,SAEnB;IAEH,oCAAoC;IAEpC,UAAU,EAAG,gBAAgB,CAAC;IAE9B,MAAM,CAAC,MAAM,EA0BR,cAAc,CAAC;IAEpB,SAAS,CAAC,cAAc;CA4BzB"}
|