@progressive-development/pd-content 0.9.1 → 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.
Files changed (119) hide show
  1. package/LICENSE +21 -2
  2. package/README.md +42 -57
  3. package/dist/_virtual/_commonjsHelpers.js +7 -0
  4. package/dist/_virtual/prism-java.js +3 -0
  5. package/dist/_virtual/prism-java2.js +3 -0
  6. package/dist/_virtual/prism-python.js +3 -0
  7. package/dist/_virtual/prism-python2.js +3 -0
  8. package/dist/_virtual/prism-typescript.js +3 -0
  9. package/dist/_virtual/prism-typescript2.js +3 -0
  10. package/dist/_virtual/prism.js +7 -0
  11. package/dist/_virtual/prism2.js +3 -0
  12. package/dist/generated/locales/be.d.ts +10 -0
  13. package/dist/generated/locales/be.d.ts.map +1 -1
  14. package/dist/generated/locales/de.d.ts +10 -0
  15. package/dist/generated/locales/de.d.ts.map +1 -1
  16. package/dist/generated/locales/en.d.ts +10 -0
  17. package/dist/generated/locales/en.d.ts.map +1 -1
  18. package/dist/index.d.ts +8 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +9 -0
  21. package/dist/locales/be.js +11 -1
  22. package/dist/locales/de.js +11 -1
  23. package/dist/locales/en.js +11 -1
  24. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-bash.js +235 -0
  25. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-java.js +135 -0
  26. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-json.js +27 -0
  27. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.js +415 -0
  28. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-python.js +76 -0
  29. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-sql.js +32 -0
  30. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-typescript.js +71 -0
  31. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-yaml.js +83 -0
  32. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/prism.js +1959 -0
  33. package/dist/pd-box-view/PdBoxView.d.ts +9 -0
  34. package/dist/pd-box-view/PdBoxView.d.ts.map +1 -1
  35. package/dist/pd-box-view/pd-box-view.stories.d.ts +41 -8
  36. package/dist/pd-box-view/pd-box-view.stories.d.ts.map +1 -1
  37. package/dist/pd-code-snippet/PdCodeSnippet.d.ts +105 -0
  38. package/dist/pd-code-snippet/PdCodeSnippet.d.ts.map +1 -0
  39. package/dist/pd-code-snippet/PdCodeSnippet.js +504 -0
  40. package/dist/pd-code-snippet/pd-code-snippet.d.ts +4 -0
  41. package/dist/pd-code-snippet/pd-code-snippet.d.ts.map +1 -0
  42. package/dist/pd-code-snippet/pd-code-snippet.js +5 -0
  43. package/dist/pd-code-snippet/pd-code-snippet.stories.d.ts +55 -0
  44. package/dist/pd-code-snippet/pd-code-snippet.stories.d.ts.map +1 -0
  45. package/dist/pd-collapse/PdCollapse.d.ts +31 -7
  46. package/dist/pd-collapse/PdCollapse.d.ts.map +1 -1
  47. package/dist/pd-collapse/PdCollapse.js +73 -18
  48. package/dist/pd-collapse/pd-collapse.stories.d.ts +49 -21
  49. package/dist/pd-collapse/pd-collapse.stories.d.ts.map +1 -1
  50. package/dist/pd-collapse-group/PdCollapseGroup.d.ts +8 -7
  51. package/dist/pd-collapse-group/PdCollapseGroup.d.ts.map +1 -1
  52. package/dist/pd-collapse-group/PdCollapseGroup.js +7 -6
  53. package/dist/pd-collapse-group/pd-collapse-group.stories.d.ts +39 -4
  54. package/dist/pd-collapse-group/pd-collapse-group.stories.d.ts.map +1 -1
  55. package/dist/pd-edit-content/PdEditContent.d.ts +13 -0
  56. package/dist/pd-edit-content/PdEditContent.d.ts.map +1 -1
  57. package/dist/pd-edit-content/PdEditContent.js +33 -10
  58. package/dist/pd-edit-content/pd-edit-content.stories.d.ts +54 -10
  59. package/dist/pd-edit-content/pd-edit-content.stories.d.ts.map +1 -1
  60. package/dist/pd-loading-state/PdLoadingState.d.ts +64 -0
  61. package/dist/pd-loading-state/PdLoadingState.d.ts.map +1 -0
  62. package/dist/pd-loading-state/PdLoadingState.js +219 -0
  63. package/dist/pd-loading-state/pd-loading-state.d.ts +6 -0
  64. package/dist/pd-loading-state/pd-loading-state.d.ts.map +1 -0
  65. package/dist/pd-loading-state/pd-loading-state.stories.d.ts +48 -0
  66. package/dist/pd-loading-state/pd-loading-state.stories.d.ts.map +1 -0
  67. package/dist/pd-loading-state.d.ts +2 -0
  68. package/dist/pd-loading-state.js +1 -0
  69. package/dist/pd-more-info/PdMoreInfo.d.ts +6 -2
  70. package/dist/pd-more-info/PdMoreInfo.d.ts.map +1 -1
  71. package/dist/pd-more-info/PdMoreInfo.js +30 -4
  72. package/dist/pd-more-info/pd-more-info.stories.d.ts +41 -5
  73. package/dist/pd-more-info/pd-more-info.stories.d.ts.map +1 -1
  74. package/dist/pd-notice-box/PdNoticeBox.d.ts +88 -0
  75. package/dist/pd-notice-box/PdNoticeBox.d.ts.map +1 -0
  76. package/dist/pd-notice-box/PdNoticeBox.js +224 -0
  77. package/dist/pd-notice-box/pd-notice-box.d.ts +3 -0
  78. package/dist/pd-notice-box/pd-notice-box.d.ts.map +1 -0
  79. package/dist/pd-notice-box/pd-notice-box.js +8 -0
  80. package/dist/pd-notice-box/pd-notice-box.stories.d.ts +58 -0
  81. package/dist/pd-notice-box/pd-notice-box.stories.d.ts.map +1 -0
  82. package/dist/pd-panel-viewer/PdPanel.d.ts +5 -0
  83. package/dist/pd-panel-viewer/PdPanel.d.ts.map +1 -1
  84. package/dist/pd-panel-viewer/PdPanelViewer.d.ts +53 -2
  85. package/dist/pd-panel-viewer/PdPanelViewer.d.ts.map +1 -1
  86. package/dist/pd-panel-viewer/PdPanelViewer.js +188 -33
  87. package/dist/pd-panel-viewer/pd-panel-viewer.stories.d.ts +46 -0
  88. package/dist/pd-panel-viewer/pd-panel-viewer.stories.d.ts.map +1 -0
  89. package/dist/pd-resize-content/PdResizeContent.d.ts +12 -10
  90. package/dist/pd-resize-content/PdResizeContent.d.ts.map +1 -1
  91. package/dist/pd-resize-content/PdResizeContent.js +19 -9
  92. package/dist/pd-resize-content/pd-resize-content.stories.d.ts +36 -4
  93. package/dist/pd-resize-content/pd-resize-content.stories.d.ts.map +1 -1
  94. package/dist/pd-tab/PdTab.d.ts +35 -2
  95. package/dist/pd-tab/PdTab.d.ts.map +1 -1
  96. package/dist/pd-tab/PdTab.js +181 -71
  97. package/dist/pd-tab/pd-tab.stories.d.ts +51 -21
  98. package/dist/pd-tab/pd-tab.stories.d.ts.map +1 -1
  99. package/dist/pd-timeline/PdTimeline.d.ts +50 -0
  100. package/dist/pd-timeline/PdTimeline.d.ts.map +1 -0
  101. package/dist/pd-timeline/PdTimeline.js +315 -0
  102. package/dist/pd-timeline/pd-timeline.d.ts +3 -0
  103. package/dist/pd-timeline/pd-timeline.d.ts.map +1 -0
  104. package/dist/pd-timeline/pd-timeline.stories.d.ts +56 -0
  105. package/dist/pd-timeline/pd-timeline.stories.d.ts.map +1 -0
  106. package/dist/pd-timeline-wizard/PdTimelineWizard.d.ts +39 -0
  107. package/dist/pd-timeline-wizard/PdTimelineWizard.d.ts.map +1 -0
  108. package/dist/pd-timeline-wizard/PdTimelineWizard.js +150 -0
  109. package/dist/pd-timeline-wizard/pd-timeline-wizard.d.ts +3 -0
  110. package/dist/pd-timeline-wizard/pd-timeline-wizard.d.ts.map +1 -0
  111. package/dist/pd-timeline-wizard/pd-timeline-wizard.stories.d.ts +54 -0
  112. package/dist/pd-timeline-wizard/pd-timeline-wizard.stories.d.ts.map +1 -0
  113. package/dist/pd-timeline-wizard.d.ts +2 -0
  114. package/dist/pd-timeline-wizard.js +8 -0
  115. package/dist/pd-timeline.d.ts +2 -0
  116. package/dist/pd-timeline.js +8 -0
  117. package/dist/types.d.ts +25 -0
  118. package/dist/types.d.ts.map +1 -1
  119. package/package.json +17 -8
@@ -0,0 +1,315 @@
1
+ import { LitElement, css, html, nothing } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import { ifDefined } from 'lit/directives/if-defined.js';
4
+
5
+ var __defProp = Object.defineProperty;
6
+ var __decorateClass = (decorators, target, key, kind) => {
7
+ var result = void 0 ;
8
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9
+ if (decorator = decorators[i])
10
+ result = (decorator(target, key, result) ) || result;
11
+ if (result) __defProp(target, key, result);
12
+ return result;
13
+ };
14
+ class PdTimeline extends LitElement {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.orientation = "horizontal";
18
+ this.points = [];
19
+ this.clickable = false;
20
+ }
21
+ static {
22
+ this.styles = css`
23
+ :host {
24
+ display: block;
25
+ --pd-timeline-line-color: var(--pd-default-col);
26
+ --pd-timeline-line-width: 2px;
27
+ --pd-timeline-line-style: solid;
28
+
29
+ --pd-timeline-point-size: 28px;
30
+ --pd-timeline-point-bg: var(--pd-default-bg-col);
31
+ --pd-timeline-point-color: var(--pd-default-darkest-col);
32
+ --pd-timeline-point-border-color: var(--pd-default-disabled-col);
33
+ --pd-timeline-point-border-width: 2px;
34
+ --pd-timeline-point-font-size: 0.875rem;
35
+
36
+ --pd-timeline-label-gap: 10px;
37
+ --pd-timeline-label-max-width: 20ch;
38
+
39
+ --pd-timeline-vertical-row-gap: 20px;
40
+
41
+ --pd-timeline-color-active: var(--pd-default-info-col);
42
+ --pd-timeline-color-done: var(--pd-default-success-col);
43
+ --pd-timeline-color-error: var(--pd-default-error-col);
44
+ }
45
+
46
+ /* === Common container === */
47
+ .rail {
48
+ position: relative;
49
+ }
50
+
51
+ /* === Horizontal layout === */
52
+ :host([orientation="horizontal"]) .rail {
53
+ display: grid;
54
+ grid-auto-flow: column;
55
+ grid-auto-columns: 1fr;
56
+ align-items: center;
57
+ gap: 0;
58
+ padding-block: calc(
59
+ var(--pd-timeline-point-size) * 0.5
60
+ ); /* Platz für Labels oben/unten */
61
+ }
62
+
63
+ :host([orientation="horizontal"]) .rail::before {
64
+ content: "";
65
+ position: absolute;
66
+ left: 0;
67
+ right: 0;
68
+ top: 50%;
69
+ transform: translateY(-50%);
70
+ border-top: var(--pd-timeline-line-width) var(--pd-timeline-line-style)
71
+ var(--pd-timeline-line-color);
72
+ z-index: 0;
73
+ }
74
+
75
+ /* === Vertical layout === */
76
+
77
+ :host([orientation="vertical"]) {
78
+ /* default: auto, kann außen überschrieben werden */
79
+ block-size: var(--pd-timeline-vertical-block-size, auto);
80
+ --pd-timeline-label-max-width: 100%;
81
+ }
82
+
83
+ :host([orientation="vertical"]) .rail {
84
+ block-size: 100%;
85
+ display: grid;
86
+ grid-template-rows: repeat(var(--_count, 1), auto);
87
+ row-gap: var(--pd-timeline-vertical-row-gap);
88
+ justify-items: start;
89
+ align-content: space-around;
90
+ padding-inline: 16px;
91
+ padding-block: 6px;
92
+ }
93
+
94
+ :host([orientation="vertical"]) .rail::before {
95
+ content: "";
96
+ position: absolute;
97
+ top: 0;
98
+ bottom: 0;
99
+ left: calc(16px + (var(--pd-timeline-point-size) * 0.5));
100
+ transform: translateX(-50%);
101
+ border-left: var(--pd-timeline-line-width) var(--pd-timeline-line-style)
102
+ var(--pd-timeline-line-color);
103
+ z-index: 0;
104
+ }
105
+
106
+ /* === Item === */
107
+ .item {
108
+ position: relative;
109
+ z-index: 1;
110
+ display: grid;
111
+ }
112
+
113
+ :host([orientation="horizontal"]) .item {
114
+ justify-items: center;
115
+ align-items: center;
116
+ }
117
+
118
+ /* hack: special case timeline-wizard, labels shoud grow */
119
+ :host([orientation="vertical"]) .item {
120
+ display: flex;
121
+ align-items: baseline;
122
+ gap: var(--pd-timeline-label-gap);
123
+ width: 100%;
124
+ }
125
+
126
+ /* === Dot (point) === */
127
+ .dot {
128
+ box-sizing: border-box;
129
+ width: var(--pd-timeline-point-size);
130
+ height: var(--pd-timeline-point-size);
131
+ border-radius: 999px;
132
+ background: var(--pd-timeline-point-bg);
133
+ color: var(--pd-timeline-point-color);
134
+ border: var(--pd-timeline-point-border-width) solid
135
+ var(--pd-timeline-point-border-color);
136
+ display: inline-grid;
137
+ place-items: center;
138
+ font-size: var(--pd-timeline-point-font-size);
139
+ line-height: 1;
140
+ user-select: none;
141
+ }
142
+
143
+ .dot[aria-current="step"] {
144
+ outline: 3px solid
145
+ color-mix(in srgb, var(--pd-timeline-color-active), transparent 60%);
146
+ outline-offset: 2px;
147
+ }
148
+
149
+ .dot--button {
150
+ cursor: pointer;
151
+ }
152
+
153
+ .dot--button:focus-visible {
154
+ outline: 2px solid var(--pd-focus-ring-col);
155
+ outline-offset: 2px;
156
+ }
157
+
158
+ /* State colors (border or inner ring hint) */
159
+ .state-active {
160
+ border-color: var(--pd-timeline-color-active);
161
+ }
162
+ .state-done {
163
+ border-color: var(--pd-timeline-color-done);
164
+ }
165
+ .state-error {
166
+ border-color: var(--pd-timeline-color-error);
167
+ }
168
+
169
+ /* === Labels === */
170
+ .label {
171
+ position: absolute;
172
+ max-width: var(--pd-timeline-label-max-width);
173
+ text-align: center;
174
+ }
175
+
176
+ :host([orientation="vertical"]) .label {
177
+ text-align: left;
178
+ /* max-width above not work? */
179
+ width: max-content;
180
+ }
181
+
182
+ /* Horizontal label placement */
183
+ :host([orientation="horizontal"]) .label.top {
184
+ bottom: calc(
185
+ 50% + var(--pd-timeline-point-size) * 0.5 + var(--pd-timeline-label-gap)
186
+ );
187
+ }
188
+ :host([orientation="horizontal"]) .label.back {
189
+ top: calc(
190
+ 50% + var(--pd-timeline-point-size) * 0.5 + var(--pd-timeline-label-gap)
191
+ );
192
+ }
193
+
194
+ /* Vertical label placement */
195
+ :host([orientation="vertical"]) .label.top {
196
+ right: calc(
197
+ 50% + var(--pd-timeline-point-size) * 0.5 + var(--pd-timeline-label-gap)
198
+ );
199
+ }
200
+
201
+ :host([orientation="vertical"]) .label.back {
202
+ /* Specia use case for timeline-wizard, abel shoud grow corectly */
203
+ position: static;
204
+ width: 100%;
205
+ /* left: calc(var(--pd-timeline-point-size) + var(--pd-timeline-label-gap));
206
+ top: calc((var(--pd-timeline-point-size) * 0.5) - 9px); */
207
+ }
208
+
209
+ /* Make label wrappers not capture clicks if not interactive */
210
+ .label ::slotted(*) {
211
+ pointer-events: auto;
212
+ }
213
+ `;
214
+ }
215
+ updated() {
216
+ this.style.setProperty("--_count", String(this.points?.length ?? 0));
217
+ }
218
+ _labelClass(idx) {
219
+ const p = this.points[idx];
220
+ const defaultSide = "back";
221
+ const side = p?.labelSide ?? defaultSide;
222
+ const sideClass = side === "top" ? "top" : "back";
223
+ return `label ${sideClass}`;
224
+ }
225
+ _stateClass(p, idx) {
226
+ const s = p?.state ?? (this.activeIndex === idx ? "active" : "default");
227
+ return s && s !== "default" ? `state-${s}` : "";
228
+ }
229
+ _onClick(idx, id) {
230
+ if (!this.clickable) return;
231
+ this.dispatchEvent(
232
+ new CustomEvent("step-click", {
233
+ detail: { index: idx, id },
234
+ bubbles: true,
235
+ composed: true
236
+ })
237
+ );
238
+ }
239
+ _onKeyDown(e, idx, id) {
240
+ if (e.key === "Enter" || e.key === " ") {
241
+ e.preventDefault();
242
+ this._onClick(idx, id);
243
+ }
244
+ }
245
+ _renderDotContent(p) {
246
+ if (p.icon) {
247
+ return html`<span aria-hidden="true">${p.icon}</span>`;
248
+ }
249
+ if (p.text) {
250
+ return html`${p.text}`;
251
+ }
252
+ return nothing;
253
+ }
254
+ render() {
255
+ const roleAttr = "list";
256
+ const ariaOrientation = this.orientation;
257
+ return html`
258
+ <div
259
+ class="rail"
260
+ role="${roleAttr}"
261
+ aria-orientation="${ariaOrientation}"
262
+ >
263
+ ${this.points.map((p, i) => {
264
+ const isActive = this.activeIndex === i;
265
+ const stateClass = this._stateClass(p, i);
266
+ const labelName = `label-${i}`;
267
+ return html`
268
+ <div
269
+ class="item"
270
+ role="listitem"
271
+ aria-setsize="${this.points.length}"
272
+ aria-posinset="${i + 1}"
273
+ >
274
+ ${this.clickable ? html`<div
275
+ class="dot dot--button ${stateClass}"
276
+ aria-current=${ifDefined(isActive ? "step" : void 0)}
277
+ role="button"
278
+ tabindex="0"
279
+ @click=${() => this._onClick(i, p.id)}
280
+ @keydown=${(e) => this._onKeyDown(e, i, p.id)}
281
+ title="${p.text ?? p.icon ?? p.id}"
282
+ >
283
+ ${this._renderDotContent(p)}
284
+ </div>` : html`<div
285
+ class="dot ${stateClass}"
286
+ aria-current=${ifDefined(isActive ? "step" : void 0)}
287
+ title="${p.text ?? p.icon ?? p.id}"
288
+ >
289
+ ${this._renderDotContent(p)}
290
+ </div>`}
291
+
292
+ <div class="${this._labelClass(i)}" part="label">
293
+ <slot name="${labelName}"></slot>
294
+ </div>
295
+ </div>
296
+ `;
297
+ })}
298
+ </div>
299
+ `;
300
+ }
301
+ }
302
+ __decorateClass([
303
+ property({ reflect: true })
304
+ ], PdTimeline.prototype, "orientation");
305
+ __decorateClass([
306
+ property({ type: Array })
307
+ ], PdTimeline.prototype, "points");
308
+ __decorateClass([
309
+ property({ type: Number })
310
+ ], PdTimeline.prototype, "activeIndex");
311
+ __decorateClass([
312
+ property({ type: Boolean })
313
+ ], PdTimeline.prototype, "clickable");
314
+
315
+ export { PdTimeline };
@@ -0,0 +1,3 @@
1
+ import { PdTimeline } from './PdTimeline';
2
+ export { PdTimeline };
3
+ //# sourceMappingURL=pd-timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-timeline.d.ts","sourceRoot":"","sources":["../../src/pd-timeline/pd-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { Meta, StoryObj } from '@storybook/web-components-vite';
2
+ import { Orientation, PointItem } from '../types.js';
3
+ /**
4
+ * Story arguments interface for pd-timeline component.
5
+ * Maps to the component's public API.
6
+ */
7
+ interface PdTimelineArgs {
8
+ /** Layout direction: 'horizontal' or 'vertical' */
9
+ orientation: Orientation;
10
+ /** Array of point definitions for the timeline */
11
+ points: PointItem[];
12
+ /** Index of the currently active step */
13
+ activeIndex: number;
14
+ /** Whether points are clickable */
15
+ clickable: boolean;
16
+ }
17
+ /**
18
+ * ## pd-timeline
19
+ *
20
+ * A timeline/stepper component for displaying sequential steps or progress.
21
+ *
22
+ * ### Features
23
+ * - Two orientations: horizontal or vertical layout
24
+ * - State indication: points can show active, done, error, or default state
25
+ * - Clickable points with keyboard support for navigation
26
+ * - Slotted labels via named slots (`label-0`, `label-1`, etc.)
27
+ * - Flexible sizing via CSS custom properties
28
+ * - Vertical mode supports explicit height or container-based sizing
29
+ *
30
+ * ### Accessibility
31
+ * - Container uses `role="list"` with `aria-orientation`
32
+ * - Each point is a `role="listitem"` with `aria-setsize` and `aria-posinset`
33
+ * - Active step indicated via `aria-current="step"`
34
+ * - Clickable points use `role="button"` and `tabindex="0"`
35
+ * - Full keyboard support with Enter and Space keys
36
+ * - Clear `:focus-visible` outline on interactive points
37
+ * - State colors (done/active/error) have sufficient contrast
38
+ */
39
+ declare const meta: Meta<PdTimelineArgs>;
40
+ export default meta;
41
+ type Story = StoryObj<PdTimelineArgs>;
42
+ /** Default horizontal timeline. Interactive via Controls panel. */
43
+ export declare const Default: Story;
44
+ /** Horizontal timeline with done, active, error, and default states. */
45
+ export declare const WithStates: Story;
46
+ /** Vertical timeline layout with labels positioned beside each point. */
47
+ export declare const Vertical: Story;
48
+ /** Vertical timeline constrained to a fixed-height container. */
49
+ export declare const VerticalInContainer: Story;
50
+ /** Display-only timeline without click interaction. */
51
+ export declare const NonClickable: Story;
52
+ /** Visual demonstration of all four individual point states. */
53
+ export declare const AllStates: Story;
54
+ /** CSS Custom Properties -- Branded and Redesigned variants. */
55
+ export declare const CustomStyling: Story;
56
+ //# sourceMappingURL=pd-timeline.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-timeline.stories.d.ts","sourceRoot":"","sources":["../../src/pd-timeline/pd-timeline.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAc,MAAM,aAAa,CAAC;AAMtE;;;GAGG;AACH,UAAU,cAAc;IACtB,mDAAmD;IACnD,WAAW,EAAE,WAAW,CAAC;IACzB,kDAAkD;IAClD,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;CACpB;AAsCD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,cAAc,CAkG9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;AAMtC,mEAAmE;AACnE,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAMF,wEAAwE;AACxE,eAAO,MAAM,UAAU,EAAE,KAqBxB,CAAC;AAMF,yEAAyE;AACzE,eAAO,MAAM,QAAQ,EAAE,KAiBtB,CAAC;AAMF,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,EAAE,KA8BjC,CAAC;AAMF,uDAAuD;AACvD,eAAO,MAAM,YAAY,EAAE,KAc1B,CAAC;AAMF,gEAAgE;AAChE,eAAO,MAAM,SAAS,EAAE,KAwFvB,CAAC;AAMF,gEAAgE;AAChE,eAAO,MAAM,aAAa,EAAE,KA+F3B,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { LitElement } from 'lit';
2
+ import { Orientation, WizardStep } from '../types';
3
+ /**
4
+ * Wizard component combining timeline navigation with step content.
5
+ *
6
+ * @tagname pd-timeline-wizard
7
+ * @summary Timeline wizard with horizontal or vertical accordion layout.
8
+ *
9
+ * @slot content-[index] - Named slots for step content (content-0, content-1, etc.).
10
+ *
11
+ * @cssprop --pd-wizard-gap - Gap between timeline and content. Default: `16px`.
12
+ * @cssprop --pd-wizard-content-max-width - Maximum width of content area. Default: `80ch`.
13
+ * @cssprop --pd-wizard-content-padding - Padding around content area. Default: `0.5rem 0`.
14
+ */
15
+ export declare class PdTimelineWizard extends LitElement {
16
+ orientation: Orientation;
17
+ /** Steps definieren Label & Zustand; daraus werden Points für die Timeline generiert */
18
+ steps: WizardStep[];
19
+ /** Gesteuerter aktiver Index (optional). Ohne diesen greift defaultActiveIndex, später erweitern wir die Logik. */
20
+ activeIndex?: number;
21
+ /** Nur initial, wenn activeIndex nicht gesetzt ist. */
22
+ defaultActiveIndex: number;
23
+ /** Ob die Punkte klickbar gestylt werden (Verhalten folgt später). */
24
+ clickable: boolean;
25
+ /**
26
+ * interner Startwert, solange keine Change-Logik vorhanden
27
+ * @ignore */
28
+ private _internalActive;
29
+ connectedCallback(): void;
30
+ /** @ignore */
31
+ private get _current();
32
+ static styles: import('lit').CSSResult;
33
+ /** Points für die Timeline aus Steps ableiten */
34
+ private _points;
35
+ private _renderHorizontal;
36
+ private _renderVertical;
37
+ protected render(): import('lit').TemplateResult<1>;
38
+ }
39
+ //# sourceMappingURL=PdTimelineWizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdTimelineWizard.d.ts","sourceRoot":"","sources":["../../src/pd-timeline-wizard/PdTimelineWizard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAa,UAAU,EAAE,MAAM,UAAU,CAAC;AAEnE,OAAO,+BAA+B,CAAC;AACvC,OAAO,2CAA2C,CAAC;AACnD,OAAO,+BAA+B,CAAC;AAEvC;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IACjB,WAAW,EAAE,WAAW,CAAgB;IAErE,wFAAwF;IAC7D,KAAK,EAAE,UAAU,EAAE,CAAM;IAEpD,mHAAmH;IACvF,WAAW,CAAC,EAAE,MAAM,CAAC;IAEjD,uDAAuD;IAC3B,kBAAkB,SAAK;IAEnD,sEAAsE;IACzC,SAAS,UAAS;IAE/C;;iBAEa;IACJ,OAAO,CAAC,eAAe,CAAK;IAErC,iBAAiB,IAAI,IAAI;IAUzB,cAAc;IACd,OAAO,KAAK,QAAQ,GAEnB;IAED,MAAM,CAAC,MAAM,0BAyBX;IAEF,iDAAiD;IACjD,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,iBAAiB;IA0BzB,OAAO,CAAC,eAAe;IA6BvB,SAAS,CAAC,MAAM;CAKjB"}
@@ -0,0 +1,150 @@
1
+ import { LitElement, css, html, nothing } from 'lit';
2
+ import { property, state } from 'lit/decorators.js';
3
+ import '../pd-collapse.js';
4
+ import '../pd-collapse-group.js';
5
+ import '../pd-timeline.js';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = void 0 ;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (decorator(target, key, result) ) || result;
13
+ if (result) __defProp(target, key, result);
14
+ return result;
15
+ };
16
+ class PdTimelineWizard extends LitElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.orientation = "horizontal";
20
+ this.steps = [];
21
+ this.defaultActiveIndex = 0;
22
+ this.clickable = false;
23
+ this._internalActive = 0;
24
+ }
25
+ connectedCallback() {
26
+ super.connectedCallback();
27
+ if (this.activeIndex == null) {
28
+ this._internalActive = Math.min(
29
+ Math.max(0, this.defaultActiveIndex || 0),
30
+ Math.max(0, this.steps.length - 1)
31
+ );
32
+ }
33
+ }
34
+ /** @ignore */
35
+ get _current() {
36
+ return this.activeIndex ?? this._internalActive ?? 0;
37
+ }
38
+ static {
39
+ this.styles = css`
40
+ :host {
41
+ display: block;
42
+ --pd-wizard-gap: 16px;
43
+ --pd-wizard-content-max-width: 80ch;
44
+ --pd-wizard-content-padding: 0.5rem 0;
45
+ }
46
+ .h-wrap {
47
+ display: grid;
48
+ gap: var(--pd-wizard-gap);
49
+ }
50
+ .h-content {
51
+ max-inline-size: var(--pd-wizard-content-max-width);
52
+ padding: var(--pd-wizard-content-padding);
53
+ }
54
+
55
+ /* Vertikal: wir lassen Timeline die Labels rendern (als <pd-collapse>),
56
+ daher braucht der Wizard nur Flow-Abstand rundum */
57
+ .v-wrap {
58
+ display: block;
59
+ }
60
+ pd-collapse {
61
+ display: block;
62
+ margin-block: 6px;
63
+ }
64
+ `;
65
+ }
66
+ /** Points für die Timeline aus Steps ableiten */
67
+ _points() {
68
+ return this.steps.map((s, i) => ({
69
+ id: s.id ?? `step-${i}`,
70
+ text: String(i + 1),
71
+ // Nummer im Kreis, Icon später möglich
72
+ state: s.state,
73
+ labelSide: s.labelSide ?? (this.orientation === "vertical" ? "back" : "back")
74
+ }));
75
+ }
76
+ _renderHorizontal() {
77
+ const points = this._points();
78
+ const a = this._current;
79
+ return html`
80
+ <div class="h-wrap">
81
+ <pd-timeline
82
+ .orientation=${"horizontal"}
83
+ .points=${points}
84
+ .activeIndex=${a}
85
+ .clickable=${this.clickable}
86
+ >
87
+ ${this.steps.map(
88
+ (s, i) => html` <span slot="${`label-${i}`}">${s.label}</span> `
89
+ )}
90
+ </pd-timeline>
91
+
92
+ <div class="h-content">
93
+ ${this.steps.map(
94
+ (_, i) => i === a ? html`<slot name="${`content-${i}`}"></slot>` : nothing
95
+ )}
96
+ </div>
97
+ </div>
98
+ `;
99
+ }
100
+ _renderVertical() {
101
+ const points = this._points();
102
+ const a = this._current;
103
+ return html`
104
+ <div class="v-wrap">
105
+ <pd-collapse-group>
106
+ <pd-timeline
107
+ .orientation=${"vertical"}
108
+ .points=${points}
109
+ .activeIndex=${a}
110
+ .clickable=${this.clickable}
111
+ >
112
+ ${this.steps.map(
113
+ (s, i) => html`
114
+ <pd-collapse id="${`collapseId${i}`}" slot="${`label-${i}`}">
115
+ <div slot="header">${s.label}</div>
116
+ <div class="section" slot="content">
117
+ <slot name="${`content-${i}`}"></slot>
118
+ </div>
119
+ </pd-collapse>
120
+ `
121
+ )}
122
+ </pd-timeline>
123
+ </pd-collapse-group>
124
+ </div>
125
+ `;
126
+ }
127
+ render() {
128
+ return this.orientation === "horizontal" ? this._renderHorizontal() : this._renderVertical();
129
+ }
130
+ }
131
+ __decorateClass([
132
+ property({ reflect: true })
133
+ ], PdTimelineWizard.prototype, "orientation");
134
+ __decorateClass([
135
+ property({ type: Array })
136
+ ], PdTimelineWizard.prototype, "steps");
137
+ __decorateClass([
138
+ property({ type: Number })
139
+ ], PdTimelineWizard.prototype, "activeIndex");
140
+ __decorateClass([
141
+ property({ type: Number })
142
+ ], PdTimelineWizard.prototype, "defaultActiveIndex");
143
+ __decorateClass([
144
+ property({ type: Boolean })
145
+ ], PdTimelineWizard.prototype, "clickable");
146
+ __decorateClass([
147
+ state()
148
+ ], PdTimelineWizard.prototype, "_internalActive");
149
+
150
+ export { PdTimelineWizard };
@@ -0,0 +1,3 @@
1
+ import { PdTimelineWizard } from './PdTimelineWizard';
2
+ export { PdTimelineWizard };
3
+ //# sourceMappingURL=pd-timeline-wizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-timeline-wizard.d.ts","sourceRoot":"","sources":["../../src/pd-timeline-wizard/pd-timeline-wizard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAOtD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { Meta, StoryObj } from '@storybook/web-components-vite';
2
+ import { Orientation, WizardStep } from '../types.js';
3
+ /**
4
+ * Story arguments interface for pd-timeline-wizard component.
5
+ * Maps to the component's public API.
6
+ */
7
+ interface PdTimelineWizardArgs {
8
+ /** Layout direction: 'horizontal' or 'vertical' */
9
+ orientation: Orientation;
10
+ /** Array of wizard step definitions */
11
+ steps: WizardStep[];
12
+ /** Initial active step index (when activeIndex is not controlled) */
13
+ defaultActiveIndex: number;
14
+ /** Whether points are clickable */
15
+ clickable: boolean;
16
+ }
17
+ /**
18
+ * ## pd-timeline-wizard
19
+ *
20
+ * A wizard component combining timeline navigation with step content.
21
+ *
22
+ * ### Features
23
+ * - Two orientations: horizontal (timeline above, content below) or vertical (accordion style)
24
+ * - Step states: each step can show done, active, error, or default state
25
+ * - Slotted content via named slots (`content-0`, `content-1`, etc.)
26
+ * - Horizontal mode renders only the active step's content
27
+ * - Vertical mode uses pd-collapse components for accordion behavior
28
+ * - Integrates pd-timeline, pd-collapse, and pd-collapse-group internally
29
+ *
30
+ * ### Accessibility
31
+ * - Inherits all pd-timeline accessibility features (role="list", aria-current)
32
+ * - Vertical mode provides expand/collapse semantics via pd-collapse
33
+ * - Clickable points support keyboard navigation (Tab, Enter, Space)
34
+ * - Focus follows natural tab order through interactive elements
35
+ * - State colors have sufficient contrast (WCAG AA)
36
+ */
37
+ declare const meta: Meta<PdTimelineWizardArgs>;
38
+ export default meta;
39
+ type Story = StoryObj<PdTimelineWizardArgs>;
40
+ /** Default horizontal wizard. Interactive via Controls panel. */
41
+ export declare const Default: Story;
42
+ /** Horizontal wizard with step states (done, active, error). */
43
+ export declare const WithStates: Story;
44
+ /** Vertical wizard with accordion-style content sections. */
45
+ export declare const Vertical: Story;
46
+ /** Vertical wizard showing step state indicators alongside accordion sections. */
47
+ export declare const VerticalWithStates: Story;
48
+ /** Wizard with clickable timeline points for step navigation. */
49
+ export declare const Clickable: Story;
50
+ /** Wizard with rich step content including form inputs. */
51
+ export declare const WithFormContent: Story;
52
+ /** CSS Custom Properties -- Branded and Redesigned variants. */
53
+ export declare const CustomStyling: Story;
54
+ //# sourceMappingURL=pd-timeline-wizard.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-timeline-wizard.stories.d.ts","sourceRoot":"","sources":["../../src/pd-timeline-wizard/pd-timeline-wizard.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AAMvE;;;GAGG;AACH,UAAU,oBAAoB;IAC5B,mDAAmD;IACnD,WAAW,EAAE,WAAW,CAAC;IACzB,uCAAuC;IACvC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,qEAAqE;IACrE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;CACpB;AA0CD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,oBAAoB,CA6GpC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AAM5C,iEAAiE;AACjE,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAMF,gEAAgE;AAChE,eAAO,MAAM,UAAU,EAAE,KAoBxB,CAAC;AAMF,6DAA6D;AAC7D,eAAO,MAAM,QAAQ,EAAE,KAmBtB,CAAC;AAMF,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,EAAE,KAMhC,CAAC;AAMF,iEAAiE;AACjE,eAAO,MAAM,SAAS,EAAE,KAiBvB,CAAC;AAMF,2DAA2D;AAC3D,eAAO,MAAM,eAAe,EAAE,KAgF7B,CAAC;AAMF,gEAAgE;AAChE,eAAO,MAAM,aAAa,EAAE,KAoF3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './pd-timeline-wizard/pd-timeline-wizard'
2
+ export {}
@@ -0,0 +1,8 @@
1
+ import { PdTimelineWizard } from './pd-timeline-wizard/PdTimelineWizard.js';
2
+
3
+ const tag = "pd-timeline-wizard";
4
+ if (!customElements.get(tag)) {
5
+ customElements.define(tag, PdTimelineWizard);
6
+ }
7
+
8
+ export { PdTimelineWizard };
@@ -0,0 +1,2 @@
1
+ export * from './pd-timeline/pd-timeline'
2
+ export {}
@@ -0,0 +1,8 @@
1
+ import { PdTimeline } from './pd-timeline/PdTimeline.js';
2
+
3
+ const tag = "pd-timeline";
4
+ if (!customElements.get(tag)) {
5
+ customElements.define(tag, PdTimeline);
6
+ }
7
+
8
+ export { PdTimeline };