@progressive-development/pd-order 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 CHANGED
@@ -1,2 +1,21 @@
1
- No License, all rights reserved
2
- @2021 - PD Progressive Development UG
1
+ MIT License
2
+
3
+ Copyright (c) 2021-present PD Progressive Development UG
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,76 +1,50 @@
1
- # \<pd-order>
1
+ # @progressive-development/pd-order
2
2
 
3
- This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
3
+ [![npm version](https://img.shields.io/npm/v/@progressive-development/pd-order.svg)](https://www.npmjs.com/package/@progressive-development/pd-order)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5
+
6
+ Order flow components for multi-address management and order summaries.
7
+
8
+ ## Features
9
+
10
+ - **Lit 3 & TypeScript** – Modern, type-safe web components
11
+ - **Accessible** – WCAG 2.1 compliant, keyboard navigation, ARIA support
12
+ - **Themeable** – CSS Custom Properties for easy customization
13
+ - **Localized** – Built-in i18n support (EN, DE, BE)
14
+ - **Lightweight** – No heavy dependencies, tree-shakeable
15
+ - **Framework-agnostic** – Works with React, Vue, Angular, or vanilla JS
16
+ - **Multi-Address Management** – Handle customer, billing, property, and manager addresses with smart fallbacks
17
+ - **Property Owner Scenarios** – Specialized fields for landlord workflows with conditional address sections
18
+ - **Dual Display Modes** – Switch between full edit form and compact summary view
19
+ - **Order Summary with Terms** – Price table integration, tax display, and legal consent checkbox with modal
4
20
 
5
21
  ## Installation
6
22
 
7
23
  ```bash
8
- npm i pd-order
24
+ npm install @progressive-development/pd-order
9
25
  ```
10
26
 
11
- ## Usage
27
+ ## Quick Start
12
28
 
13
29
  ```html
14
30
  <script type="module">
15
- import 'pd-order/pd-order.js';
31
+ import '@progressive-development/pd-order';
16
32
  </script>
17
33
 
18
- <pd-order></pd-order>
34
+ <pd-order-contacts></pd-order-contacts>
19
35
  ```
20
36
 
21
- ## Linting and formatting
37
+ ## Components
22
38
 
23
- To scan the project for linting and formatting errors, run
39
+ | Component | Description |
40
+ |-----------|-------------|
41
+ | `<pd-order-contacts>` | Multi-address contact management |
42
+ | `<pd-order-summary>` | Order overview with pricing and terms |
24
43
 
25
- ```bash
26
- npm run lint
27
- ```
28
-
29
- To automatically fix linting and formatting errors, run
30
-
31
- ```bash
32
- npm run format
33
- ```
44
+ ## Documentation
34
45
 
35
- ## Testing with Web Test Runner
36
-
37
- To execute a single test run:
38
-
39
- ```bash
40
- npm run test
41
- ```
42
-
43
- To run the tests in interactive watch mode run:
44
-
45
- ```bash
46
- npm run test:watch
47
- ```
46
+ 📖 **Full documentation:** [pd-components.web.app](https://pd-components.web.app/)
48
47
 
49
- ## Demoing with Storybook
50
-
51
- To run a local instance of Storybook for your component, run
52
-
53
- ```bash
54
- npm run storybook
55
- ```
56
-
57
- To build a production version of Storybook, run
58
-
59
- ```bash
60
- npm run storybook:build
61
- ```
62
-
63
-
64
- ## Tooling configs
65
-
66
- For most of the tools, the configuration is in the `package.json` to minimize the amount of files in your project.
67
-
68
- If you customize the configuration a lot, you can consider moving them to individual files.
69
-
70
- ## Local Demo with `web-dev-server`
71
-
72
- ```bash
73
- npm start
74
- ```
48
+ ## License
75
49
 
76
- To run a local development server that serves the basic demo located in `demo/index.html`
50
+ MIT © [PD Progressive Development UG](https://progressive-development.com)
@@ -1,37 +1,41 @@
1
1
  import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
2
2
  import { PdContactData, PdContactMatch } from '@progressive-development/pd-contact';
3
3
  /**
4
- * Renders and manages contact input sections for order processing.
5
- * Supports optional billing address, property owner info and admin contact.
4
+ * Order contact management with multiple address sections.
6
5
  *
7
- * @fires validate-form - Triggers validation of embedded contact components.
8
- * @slot - General slot
9
6
  * @tagname pd-order-contacts
7
+ * @summary Multi-contact form with order, billing, admin, and property addresses.
8
+ *
9
+ * @event validate-form - Fired during contact validation.
10
10
  */
11
11
  export declare class PdOrderContacts extends LitElement {
12
- /** Zeigt die Komponente im Zusammenfassungsmodus (read-only) */
12
+ /** Show read-only summary mode */
13
13
  summary: boolean;
14
- /** Überschriften für die einzelnen Kontaktsektionen */
14
+ /** Section title overrides for contact headers */
15
15
  contactTitle: Record<string, string>;
16
- /** Liste erforderlicher Eingabefelder je Kontakt (z.B. ['street', 'zip']) */
16
+ /** Required field names per contact (e.g., ['street', 'zip']) */
17
17
  requiredFields: string[];
18
- /** Kontaktadresse des Auftraggebers */
18
+ /** Primary order contact data */
19
19
  orderContact?: PdContactData;
20
- /** Optionale separate Rechnungsadresse */
20
+ /** Optional separate billing address */
21
21
  billingContact?: PdContactData;
22
- /** Optionale Verwaltungsadresse */
22
+ /** Optional admin/management contact */
23
23
  adminContact?: PdContactData;
24
- /** Adresse der Immobilie, falls abweichend */
24
+ /** Property address if different from order address */
25
25
  propertyContact?: PdContactData;
26
- /** Aktiviert die Option zur separaten Rechnungsadresse */
26
+ /** Enable billing address option */
27
27
  withPayment: boolean;
28
- /** Aktiviert die Option zur Verwaltung von Vermieterinformationen */
28
+ /** Enable property owner/landlord options */
29
29
  withPropertyOwner: boolean;
30
+ /** Enable property date field */
30
31
  withPropertyDate: boolean;
31
- /** Optionaler Match-Parameter zur Feldvalidierung oder Mapping-Zwecken */
32
+ /** Optional field validation/mapping configuration */
32
33
  match?: PdContactMatch;
34
+ /** @ignore */
33
35
  private _ownBillingContact;
36
+ /** @ignore */
34
37
  private _ownAdminContact;
38
+ /** @ignore */
35
39
  private _isPropertyOwner;
36
40
  static styles: CSSResultGroup;
37
41
  update(changedProps: PropertyValues<this>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"PdOrderContacts.d.ts","sourceRoot":"","sources":["../../src/pd-order-contacts/PdOrderContacts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIV,cAAc,EACd,cAAc,EACf,MAAM,KAAK,CAAC;AAIb,OAAO,uDAAuD,CAAC;AAC/D,OAAO,iDAAiD,CAAC;AACzD,OAAO,gDAAgD,CAAC;AACxD,OAAO,+CAA+C,CAAC;AAIvD,OAAO,EAEL,aAAa,EACb,cAAc,EACf,MAAM,qCAAqC,CAAC;AAE7C;;;;;;;GAOG;AACH,qBACa,eAAgB,SAAQ,UAAU;IAC7C,gEAAgE;IAEhE,OAAO,UAAS;IAEhB,uDAAuD;IAEvD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAE1C,6EAA6E;IAE7E,cAAc,EAAE,MAAM,EAAE,CAAM;IAE9B,uCAAuC;IAEvC,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,0CAA0C;IAE1C,cAAc,CAAC,EAAE,aAAa,CAAC;IAE/B,mCAAmC;IAEnC,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,8CAA8C;IAE9C,eAAe,CAAC,EAAE,aAAa,CAAC;IAEhC,0DAA0D;IAE1D,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Aa,CAAC;IAE7B,uDAAuD;IAEvD,eAAe,CAAC,EAAE,aAAa,CAAC;IAEhC,oCAAoC;IAEpC,WAAW,UAAS;IAEpB,6CAA6C;IAE7C,iBAAiB,UAAS;IAE1B,iCAAiC;IAEjC,gBAAgB,UAAS;IAEzB,sDAAsD;IAEtD,KAAK,CAAC,EAAE,cAAc,CAAC;IAEvB,cAAc;IAEd,OAAO,CAAC,kBAAkB,CAAS;IAEnC,cAAc;IAEd,OAAO,CAAC,gBAAgB,CAAS;IAEjC,cAAc;IAEd,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAgB,MAAM,EAAE,cAAc,CA+CpC;IAEO,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAazD,SAAS,CAAC,MAAM;IAIhB,OAAO,CAAC,mBAAmB;IAiK3B,OAAO,CAAC,cAAc;IA+CtB,IAAI,KAAK,IAAI,OAAO,CASnB;IAEY,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAkCzC,SAAS;IAWhB,OAAO,CAAC,eAAe;CAoBxB"}
@@ -325,12 +325,12 @@ PdOrderContacts.styles = [
325
325
  }
326
326
 
327
327
  .property-owner-box {
328
- border: 2px solid #007b8f;
329
- border-radius: 8px;
330
- padding: 16px;
331
- margin: 16px 0;
332
- background-color: #f8fafb;
333
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
328
+ border: 2px solid var(--pd-default-col);
329
+ border-radius: var(--pd-radius-lg);
330
+ padding: var(--pd-spacing-lg);
331
+ margin: var(--pd-spacing-lg) 0;
332
+ background-color: var(--pd-default-bg-light-col);
333
+ box-shadow: var(--pd-shadow-md);
334
334
  }
335
335
  `
336
336
  ];
@@ -1,17 +1,65 @@
1
- import { Meta, StoryFn } from '@storybook/web-components';
2
- import { PdOrderContacts } from './pd-order-contacts';
3
- declare const _default: Meta<PdOrderContacts>;
4
- export default _default;
5
- export declare const Default: StoryFn<PdOrderContacts>;
6
- export declare const WithPropertyDate: StoryFn<PdOrderContacts>;
7
- export declare const RequiredFields: StoryFn<PdOrderContacts>;
8
- export declare const WithBilling: StoryFn<PdOrderContacts>;
9
- export declare const WithBillingAndAdmin: StoryFn<PdOrderContacts>;
10
- export declare const WithBillingAdminPropertyDate: StoryFn<PdOrderContacts>;
11
- export declare const ViewOnly: StoryFn<PdOrderContacts>;
12
- export declare const ViewWithBilling: StoryFn<PdOrderContacts>;
13
- export declare const ViewWithBillingAndAdmin: StoryFn<PdOrderContacts>;
14
- export declare const Filled: StoryFn<PdOrderContacts>;
15
- export declare const FilledWithAdmin: StoryFn<PdOrderContacts>;
16
- export declare const FilledWithAdminAndDate: StoryFn<PdOrderContacts>;
1
+ import { Meta, StoryObj } from '@storybook/web-components-vite';
2
+ import { PdContactData } from '@progressive-development/pd-contact';
3
+ /**
4
+ * Story arguments interface for pd-order-contacts component.
5
+ * Maps to the component's public API for multi-contact order forms.
6
+ */
7
+ interface PdOrderContactsArgs {
8
+ /** Show read-only summary mode */
9
+ summary: boolean;
10
+ /** Enable billing address option */
11
+ withPayment: boolean;
12
+ /** Enable property owner/landlord options */
13
+ withPropertyOwner: boolean;
14
+ /** Enable property date field */
15
+ withPropertyDate: boolean;
16
+ /** Required field names per contact */
17
+ requiredFields: string[];
18
+ /** Primary order contact data */
19
+ orderContact?: PdContactData;
20
+ /** Optional billing contact data */
21
+ billingContact?: PdContactData;
22
+ /** Optional admin contact data */
23
+ adminContact?: PdContactData;
24
+ /** Optional property address data */
25
+ propertyContact?: PdContactData;
26
+ }
27
+ /**
28
+ * ## pd-order-contacts
29
+ *
30
+ * Multi-contact management component for order workflows with collapsible
31
+ * address sections for order, billing, property, and admin contacts.
32
+ *
33
+ * ### Features
34
+ * - Primary order contact form (always visible)
35
+ * - Optional billing address section with toggle
36
+ * - Optional property owner section with landlord checkbox
37
+ * - Optional property date field
38
+ * - Admin/management contact for property owners
39
+ * - Summary mode for read-only display of all contacts
40
+ * - Form validation with required field support across all contacts
41
+ * - Collapsible sections via pd-collapse-group
42
+ *
43
+ * ### Form Methods
44
+ * - `triggerValidate()` — validates all visible contacts, opens first invalid section
45
+ * - `getValues()` — returns all visible contact data
46
+ * - `valid` — getter for current validation state
47
+ */
48
+ declare const meta: Meta<PdOrderContactsArgs>;
49
+ export default meta;
50
+ type Story = StoryObj<PdOrderContactsArgs>;
51
+ /** Default empty order contacts form with a single address section. Interactive via Controls panel. */
52
+ export declare const Default: Story;
53
+ /** Form with pre-populated order contact data. */
54
+ export declare const Prepopulated: Story;
55
+ /** Form with billing address section enabled — shows toggle to add separate billing address. */
56
+ export declare const WithBilling: Story;
57
+ /** Form with property owner section — includes landlord checkbox, property address, and admin contact. */
58
+ export declare const WithPropertyOwner: Story;
59
+ /** All features enabled with pre-populated data across all contact sections. */
60
+ export declare const FullyConfigured: Story;
61
+ /** Read-only summary showing all configured contacts side by side. */
62
+ export declare const SummaryMode: Story;
63
+ /** Form with all fields marked as required — triggers validation on submit. */
64
+ export declare const RequiredFields: Story;
17
65
  //# sourceMappingURL=pd-order-contacts.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pd-order-contacts.stories.d.ts","sourceRoot":"","sources":["../../src/pd-order-contacts/pd-order-contacts.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,qBAAqB,CAAC;wBAMxB,IAAI,CAAC,eAAe,CAAC;AAJ1B,wBAI2B;AA8E3B,eAAO,MAAM,OAAO,0BAAoB,CAAC;AAKzC,eAAO,MAAM,gBAAgB,0BAAoB,CAAC;AAMlD,eAAO,MAAM,cAAc,0BAAoB,CAAC;AAiBhD,eAAO,MAAM,WAAW,0BAAoB,CAAC;AAM7C,eAAO,MAAM,mBAAmB,0BAAoB,CAAC;AAOrD,eAAO,MAAM,4BAA4B,0BAAoB,CAAC;AAQ9D,eAAO,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AAO,EAAE,KAAU,CAAC;AAMjC,kDAAkD;AAClD,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAC;AAMF,gGAAgG;AAChG,eAAO,MAAM,WAAW,EAAE,KAKzB,CAAC;AAMF,0GAA0G;AAC1G,eAAO,MAAM,iBAAiB,EAAE,KAc/B,CAAC;AAMF,gFAAgF;AAChF,eAAO,MAAM,eAAe,EAAE,KAkB7B,CAAC;AAMF,sEAAsE;AACtE,eAAO,MAAM,WAAW,EAAE,KA8CzB,CAAC;AAMF,+EAA+E;AAC/E,eAAO,MAAM,cAAc,EAAE,KAI5B,CAAC"}
@@ -1,31 +1,31 @@
1
1
  import { LitElement, CSSResultGroup, TemplateResult } from 'lit';
2
2
  import { PdOrderStep } from '../types.js';
3
3
  /**
4
- * Komponente zur Darstellung der Bestellübersicht
4
+ * Order summary component displaying steps, pricing, and agreement.
5
5
  *
6
- * @fires go-to - Wird ausgelöst, wenn der Benutzer "edit-content" aktiviert
7
- * @slot legal - Slot für die AGB-Inhalte
8
6
  * @tagname pd-order-summary
7
+ * @summary Order summary with steps, pricing, and terms agreement.
8
+ *
9
+ * @event go-to - Fired when user clicks edit on a step. Detail: `{ step }`.
10
+ *
11
+ * @slot legal - Terms and conditions content.
12
+ * @slot [stepKey] - Named slots for custom step content.
13
+ *
14
+ * @cssprop --pd-order-summary-payment-bg-col - Payment section background. Default: `var(--pd-default-light-col)`.
9
15
  */
10
16
  export declare class PdOrderSummary extends LitElement {
11
- /**
12
- * Die Liste der Bestellschritte (z.B. Buchung, Kontaktdaten, etc.),
13
- * wie sie in der Zusammenfassung gerendert werden.
14
- */
17
+ /** Order steps to display in summary (e.g., booking, contacts) */
15
18
  orderSteps: PdOrderStep[];
16
- /**
17
- * Gibt an, ob ein Zahlungsabschnitt mit Preisdetails angezeigt werden soll.
18
- */
19
+ /** Show payment/pricing section */
19
20
  withPayment: boolean;
20
- /**
21
- * Gibt an, ob eine Checkbox zur Zustimmung zu den AGB angezeigt und validiert werden soll.
22
- */
21
+ /** Show terms agreement checkbox with validation */
23
22
  withAgreement: boolean;
24
- /**
25
- * Die vollständigen Bestelldaten inklusive Postleitzahl, Kontakten und Preisinformationen.
26
- */
23
+ /** Complete order data including zip, contacts, and pricing */
27
24
  order?: any;
25
+ /** @ignore */
28
26
  private _agreeForm;
27
+ /** @ignore */
28
+ private _agreePopup;
29
29
  static styles: CSSResultGroup;
30
30
  firstUpdated(): void;
31
31
  render(): TemplateResult<1>;
@@ -1 +1 @@
1
- {"version":3,"file":"PdOrderSummary.d.ts","sourceRoot":"","sources":["../../src/pd-order-summary/PdOrderSummary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI5E,OAAO,qDAAqD,CAAC;AAC7D,OAAO,+CAA+C,CAAC;AACvD,OAAO,+CAA+C,CAAC;AAEvD,OAAO,iDAAiD,CAAC;AACzD,OAAO,6CAA6C,CAAC;AACrD,OAAO,qDAAqD,CAAC;AAE7D,OAAO,EAAsB,WAAW,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,2CAA2C,CAAC;AAGnD;;;;;;GAMG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C;;;OAGG;IAEH,UAAU,EAAE,WAAW,EAAE,CAAM;IAE/B;;OAEG;IAEH,WAAW,UAAS;IAEpB;;OAEG;IAEH,aAAa,UAAS;IAEtB;;OAEG;IAEH,KAAK,CAAC,EAAE,GAAG,CAAC;IAGZ,OAAO,CAAC,UAAU,CAAmB;IAErC,OAAgB,MAAM,EAAE,cAAc,CAmDpC;IAEO,YAAY,IAAI,IAAI;IAYpB,MAAM;IA0Df,IAAI,KAAK,YAER;IAEY,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IA6BhD,SAAS,CAAC,oBAAoB,CAC5B,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,MAAM,GACZ,cAAc;IAkBjB,SAAS,CAAC,6BAA6B,CACrC,IAAI,E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IAUxB,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW;IAoB9D,OAAO,CAAC,uBAAuB;CAIhC"}
@@ -40,7 +40,6 @@ let PdOrderSummary = class extends LitElement {
40
40
  render() {
41
41
  if (!this.order) return html`<p>No order is set</p>`;
42
42
  return html`
43
- <h3>${msg("Übersicht", { id: "pd.order.summary.title" })}</h3>
44
43
  <div class="edit-summary-container">
45
44
  ${this.orderSteps.map(
46
45
  (step, index) => this._mapOrderStepSummary(step, index)
@@ -162,10 +161,7 @@ let PdOrderSummary = class extends LitElement {
162
161
  }
163
162
  _openTermsAndConditions(e) {
164
163
  e.stopPropagation();
165
- const popup = this.shadowRoot?.getElementById(
166
- "agreePopupId"
167
- );
168
- popup?.showPopup();
164
+ this._agreePopup?.showPopup();
169
165
  }
170
166
  };
171
167
  PdOrderSummary.styles = [
@@ -235,6 +231,9 @@ __decorateClass([
235
231
  __decorateClass([
236
232
  query("#submitSummaryFormId")
237
233
  ], PdOrderSummary.prototype, "_agreeForm", 2);
234
+ __decorateClass([
235
+ query("#agreePopupId")
236
+ ], PdOrderSummary.prototype, "_agreePopup", 2);
238
237
  PdOrderSummary = __decorateClass([
239
238
  localized()
240
239
  ], PdOrderSummary);
@@ -1,13 +1,59 @@
1
- import { Meta, StoryFn } from '@storybook/web-components';
2
- import { TestSummary } from '../stories/test-impl/test-summary.js';
3
- declare const _default: Meta<TestSummary>;
4
- export default _default;
5
- export declare const OrderSummary: StoryFn<TestSummary & {
6
- orderContact: any;
7
- billingContact?: any;
8
- }>;
9
- export declare const OrderSummaryEmptyBilling: StoryFn<TestSummary & {
10
- orderContact: any;
11
- billingContact?: any;
12
- }>;
1
+ import { Meta, StoryObj } from '@storybook/web-components-vite';
2
+ import { PdContactData } from '@progressive-development/pd-contact';
3
+ import { PdOrderStep } from '../types.js';
4
+ /**
5
+ * Story arguments interface for pd-order-summary component.
6
+ * Maps to the component's public API for order summary display.
7
+ */
8
+ interface PdOrderSummaryArgs {
9
+ /** Show payment/pricing section */
10
+ withPayment: boolean;
11
+ /** Show terms agreement checkbox with validation */
12
+ withAgreement: boolean;
13
+ /** Order steps to display in summary */
14
+ orderSteps: PdOrderStep[];
15
+ /** Primary order contact data */
16
+ orderContact: PdContactData;
17
+ /** Optional billing contact data */
18
+ billingContact?: PdContactData;
19
+ }
20
+ /**
21
+ * ## pd-order-summary
22
+ *
23
+ * Order summary component that displays configurable steps, pricing information,
24
+ * and an optional terms-and-conditions agreement.
25
+ *
26
+ * ### Features
27
+ * - Configurable order steps with edit-content integration
28
+ * - Automatic contact summary rendering for "contacts" step key
29
+ * - Price table with tax calculation via pd-pricetable
30
+ * - Terms and conditions agreement checkbox with popup
31
+ * - Named slots for custom step content and legal text
32
+ * - Fires `go-to` event when user clicks edit on a step
33
+ *
34
+ * ### Slots
35
+ * - `legal` — Terms and conditions content (shown in popup)
36
+ * - `[stepKey]` — Named slots for custom step content
37
+ *
38
+ * ### Usage Note
39
+ * Stories use `pd-order-summary-test` (a test wrapper that extends PdOrderSummary)
40
+ * to provide a concrete implementation for demo purposes.
41
+ */
42
+ declare const meta: Meta<PdOrderSummaryArgs>;
43
+ export default meta;
44
+ type Story = StoryObj<PdOrderSummaryArgs>;
45
+ /** Default order summary with payment and agreement enabled. Interactive via Controls panel. */
46
+ export declare const Default: Story;
47
+ /** Order summary showing separate billing contact alongside order contact. */
48
+ export declare const WithBillingContact: Story;
49
+ /** Order summary without the pricing/payment section — for non-billable orders. */
50
+ export declare const WithoutPayment: Story;
51
+ /** Order summary without the terms agreement checkbox — when agreement is handled elsewhere. */
52
+ export declare const WithoutAgreement: Story;
53
+ /** Minimal order summary without payment and agreement — just the order steps and contacts. */
54
+ export declare const Minimal: Story;
55
+ /** All summary configurations side by side for comparison. */
56
+ export declare const AllConfigurations: Story;
57
+ /** CSS Custom Properties — Branded and Redesigned payment section variants. */
58
+ export declare const CustomStyling: Story;
13
59
  //# sourceMappingURL=pd-order-summary.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pd-order-summary.stories.d.ts","sourceRoot":"","sources":["../../src/pd-order-summary/pd-order-summary.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,sCAAsC,CAAC;wBAMzC,IAAI,CAAC,WAAW,CAAC;AAJtB,wBAIuB;AA0EvB,eAAO,MAAM,YAAY;kBAxCP,GAAG;qBACA,GAAG;EAuCqB,CAAC;AAuB9C,eAAO,MAAM,wBAAwB;kBA/DnB,GAAG;qBACA,GAAG;EA8DiC,CAAC"}
1
+ {"version":3,"file":"pd-order-summary.stories.d.ts","sourceRoot":"","sources":["../../src/pd-order-summary/pd-order-summary.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,6CAA6C,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,OAAO,sCAAsC,CAAC;AAM9C;;;GAGG;AACH,UAAU,kBAAkB;IAC1B,mCAAmC;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,aAAa,EAAE,OAAO,CAAC;IACvB,wCAAwC;IACxC,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,iCAAiC;IACjC,YAAY,EAAE,aAAa,CAAC;IAC5B,oCAAoC;IACpC,cAAc,CAAC,EAAE,aAAa,CAAC;CAChC;AA4FD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAiGlC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AAM1C,gGAAgG;AAChG,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAMjC,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,EAAE,KAIhC,CAAC;AAMF,mFAAmF;AACnF,eAAO,MAAM,cAAc,EAAE,KAI5B,CAAC;AAMF,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,EAAE,KAI9B,CAAC;AAMF,+FAA+F;AAC/F,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAMF,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,EAAE,KAqD/B,CAAC;AAMF,+EAA+E;AAC/E,eAAO,MAAM,aAAa,EAAE,KAwE3B,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@progressive-development/pd-order",
3
- "version": "0.9.2",
3
+ "version": "1.0.0",
4
4
  "description": "Progressive Development Order Component",
5
5
  "author": "PD Progressive Development",
6
- "license": "SEE LICENSE IN LICENSE",
6
+ "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
7
10
  "main": "./dist/index.js",
8
11
  "module": "./dist/index.js",
9
12
  "type": "module",
@@ -27,12 +30,12 @@
27
30
  "@lit/localize": "^0.12.2",
28
31
  "fecha": "^4.2.3",
29
32
  "tslib": "^2.8.1",
30
- "@progressive-development/pd-shared-styles": "0.3.0",
31
- "@progressive-development/pd-price": "0.9.2",
32
- "@progressive-development/pd-contact": "0.9.2",
33
- "@progressive-development/pd-forms": "0.9.2",
34
- "@progressive-development/pd-dialog": "0.9.2",
35
- "@progressive-development/pd-content": "0.9.2"
33
+ "@progressive-development/pd-shared-styles": "0.3.1",
34
+ "@progressive-development/pd-contact": "1.0.0",
35
+ "@progressive-development/pd-content": "1.0.0",
36
+ "@progressive-development/pd-forms": "1.0.0",
37
+ "@progressive-development/pd-dialog": "1.0.0",
38
+ "@progressive-development/pd-price": "1.0.0"
36
39
  },
37
40
  "customElements": "custom-elements.json",
38
41
  "keywords": [