@progressive-development/pd-page 0.9.2 → 1.0.1

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 (67) hide show
  1. package/LICENSE +21 -2
  2. package/README.md +34 -57
  3. package/dist/generated/locales/be.d.ts +19 -1
  4. package/dist/generated/locales/be.d.ts.map +1 -1
  5. package/dist/generated/locales/de.d.ts +19 -1
  6. package/dist/generated/locales/de.d.ts.map +1 -1
  7. package/dist/generated/locales/en.d.ts +19 -1
  8. package/dist/generated/locales/en.d.ts.map +1 -1
  9. package/dist/index.d.ts +6 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +7 -0
  12. package/dist/locales/be.js +19 -1
  13. package/dist/locales/de.js +19 -1
  14. package/dist/locales/en.js +19 -1
  15. package/dist/pd-contact-us/PdContactUs.d.ts +15 -5
  16. package/dist/pd-contact-us/PdContactUs.d.ts.map +1 -1
  17. package/dist/pd-contact-us/PdContactUs.js +94 -131
  18. package/dist/pd-contact-us/pd-contact-us.stories.d.ts +36 -5
  19. package/dist/pd-contact-us/pd-contact-us.stories.d.ts.map +1 -1
  20. package/dist/pd-footer/PdFooter.d.ts +27 -15
  21. package/dist/pd-footer/PdFooter.d.ts.map +1 -1
  22. package/dist/pd-footer/PdFooter.js +122 -71
  23. package/dist/pd-footer/pd-footer.stories.d.ts +47 -7
  24. package/dist/pd-footer/pd-footer.stories.d.ts.map +1 -1
  25. package/dist/pd-login/PdLogin.d.ts +59 -0
  26. package/dist/pd-login/PdLogin.d.ts.map +1 -0
  27. package/dist/pd-login/PdLogin.js +292 -0
  28. package/dist/pd-login/pd-login.d.ts +3 -0
  29. package/dist/pd-login/pd-login.d.ts.map +1 -0
  30. package/dist/pd-login/pd-login.stories.d.ts +55 -0
  31. package/dist/pd-login/pd-login.stories.d.ts.map +1 -0
  32. package/dist/pd-login.d.ts +2 -0
  33. package/dist/pd-login.js +8 -0
  34. package/dist/pd-menu/PdMenu.d.ts +72 -40
  35. package/dist/pd-menu/PdMenu.d.ts.map +1 -1
  36. package/dist/pd-menu/PdMenu.js +384 -273
  37. package/dist/pd-menu/pd-menu.stories.d.ts +59 -17
  38. package/dist/pd-menu/pd-menu.stories.d.ts.map +1 -1
  39. package/dist/pd-socialmedia/PdSocialmedia.d.ts +56 -0
  40. package/dist/pd-socialmedia/PdSocialmedia.d.ts.map +1 -0
  41. package/dist/pd-socialmedia/PdSocialmedia.js +426 -0
  42. package/dist/pd-socialmedia/pd-socialmedia-model.d.ts +16 -0
  43. package/dist/pd-socialmedia/pd-socialmedia-model.d.ts.map +1 -0
  44. package/dist/pd-socialmedia/pd-socialmedia-model.js +240 -0
  45. package/dist/pd-socialmedia/pd-socialmedia.d.ts +3 -0
  46. package/dist/pd-socialmedia/pd-socialmedia.d.ts.map +1 -0
  47. package/dist/pd-socialmedia/pd-socialmedia.stories.d.ts +53 -0
  48. package/dist/pd-socialmedia/pd-socialmedia.stories.d.ts.map +1 -0
  49. package/dist/pd-socialmedia.d.ts +2 -0
  50. package/dist/pd-socialmedia.js +7 -0
  51. package/dist/pd-toast/PdToast.d.ts +23 -0
  52. package/dist/pd-toast/PdToast.d.ts.map +1 -0
  53. package/dist/pd-toast/PdToast.js +222 -0
  54. package/dist/pd-toast/pd-toast.d.ts +3 -0
  55. package/dist/pd-toast/pd-toast.d.ts.map +1 -0
  56. package/dist/pd-toast/pd-toast.stories.d.ts +47 -0
  57. package/dist/pd-toast/pd-toast.stories.d.ts.map +1 -0
  58. package/dist/pd-toast.d.ts +2 -0
  59. package/dist/pd-toast.js +8 -0
  60. package/dist/stories/01_index.stories.d.ts +36 -4
  61. package/dist/stories/01_index.stories.d.ts.map +1 -1
  62. package/dist/toast-bus/toast-bus.d.ts +61 -0
  63. package/dist/toast-bus/toast-bus.d.ts.map +1 -0
  64. package/dist/toast-bus/toast-bus.js +42 -0
  65. package/dist/types.d.ts +18 -0
  66. package/dist/types.d.ts.map +1 -1
  67. package/package.json +31 -24
@@ -1,7 +1,7 @@
1
1
  import { css, LitElement, html } from 'lit';
2
2
  import { localized, msg } from '@lit/localize';
3
- import { property } from 'lit/decorators.js';
4
- import '@progressive-development/pd-forms/pd-panel-button';
3
+ import { property, query } from 'lit/decorators.js';
4
+ import '@progressive-development/pd-forms/pd-button';
5
5
  import '@progressive-development/pd-forms/pd-form-container';
6
6
  import '@progressive-development/pd-forms/pd-form-row';
7
7
  import '@progressive-development/pd-forms/pd-input';
@@ -26,117 +26,95 @@ let PdContactUs = class extends LitElement {
26
26
  }
27
27
  render() {
28
28
  return html`
29
- <div class="content-block">
30
- <h2>${msg("Kontakt", { id: "pd.contactus.title" })}</h2>
31
-
32
- <div class="contact-block">
33
- <div class="left-content">
34
- <pd-contact
35
- class="company-contact"
36
- .contact="${this.contact}"
37
- addressTitle="${msg("Adresse", {
38
- id: "pd.contactus.address.title"
39
- })}"
40
- summary
41
- ></pd-contact>
42
- </div>
29
+ <div class="contact-layout">
30
+ <div class="contact-card">
31
+ <pd-contact .contact="${this.contact}" summary></pd-contact>
32
+ </div>
43
33
 
44
- <div class="right-content">
45
- <pd-form-container id="contactFormId">
46
- <pd-form-row>
47
- <pd-input
48
- id="nameInputId"
49
- class="quarter3"
50
- minlength="3"
51
- maxlength="100"
52
- placeHolder="${msg("Name", {
34
+ <div class="contact-form">
35
+ <pd-form-container id="contactFormId">
36
+ <pd-form-row>
37
+ <pd-input
38
+ id="nameInputId"
39
+ minlength="3"
40
+ maxlength="100"
41
+ placeHolder="${msg("Name", {
53
42
  id: "pd.contactus.address.name"
54
43
  })}"
55
- valueName="name"
56
- autoCompleteName="full-name"
57
- required
58
- ></pd-input>
59
- </pd-form-row>
44
+ valueName="name"
45
+ autoCompleteName="full-name"
46
+ required
47
+ ></pd-input>
48
+ </pd-form-row>
60
49
 
61
- <pd-form-row>
62
- <pd-input
63
- id="mailInputId"
64
- class="quarter3"
65
- placeHolder="${msg("Email", {
50
+ <pd-form-row>
51
+ <pd-input
52
+ id="mailInputId"
53
+ placeHolder="${msg("Email", {
66
54
  id: "pd.contactus.address.email"
67
55
  })}"
68
- valueName="email"
69
- autoCompleteName="email"
70
- name="email"
71
- fieldType="mail"
72
- required
73
- ></pd-input>
74
- </pd-form-row>
56
+ valueName="email"
57
+ autoCompleteName="email"
58
+ name="email"
59
+ fieldType="mail"
60
+ required
61
+ ></pd-input>
62
+ </pd-form-row>
75
63
 
76
- <pd-form-row>
77
- <pd-input
78
- id="phoneInputId"
79
- class="quarter3"
80
- placeHolder="${msg("Telefon", {
64
+ <pd-form-row>
65
+ <pd-input
66
+ id="phoneInputId"
67
+ placeHolder="${msg("Telefon", {
81
68
  id: "pd.contactus.address.phone"
82
69
  })}"
83
- valueName="phone"
84
- fieldType="phone"
85
- autoCompleteName="tel"
86
- required
87
- ></pd-input>
88
- </pd-form-row>
70
+ valueName="phone"
71
+ fieldType="phone"
72
+ autoCompleteName="tel"
73
+ required
74
+ ></pd-input>
75
+ </pd-form-row>
89
76
 
90
- <pd-form-row>
91
- <pd-input-area
92
- id="msgInputId"
93
- class="quarter3-area"
94
- minlength="6"
95
- maxlength="500"
96
- placeHolder="${msg("Nachricht", {
77
+ <pd-form-row>
78
+ <pd-input-area
79
+ id="msgInputId"
80
+ minlength="6"
81
+ maxlength="500"
82
+ placeHolder="${msg("Nachricht", {
97
83
  id: "pd.contactus.address.message"
98
84
  })}"
99
- rows="8"
100
- required
101
- valueName="msg1"
102
- ></pd-input-area>
103
- </pd-form-row>
85
+ rows="8"
86
+ required
87
+ valueName="msg1"
88
+ ></pd-input-area>
89
+ </pd-form-row>
104
90
 
105
- <pd-form-row>
106
- <pd-panel-button
107
- class="quarter3"
108
- pdButtonIcon="${pdIcons.ICON_MAIL}"
109
- buttonText="${msg("Absenden", {
91
+ <pd-form-row>
92
+ <pd-button
93
+ icon="${pdIcons.ICON_MAIL}"
94
+ text="${msg("Absenden", {
110
95
  id: "pd.contactus.address.send"
111
96
  })}"
112
- @click="${this._sendMail}"
113
- primary
114
- ></pd-panel-button>
115
- </pd-form-row>
116
- </pd-form-container>
117
- </div>
97
+ @button-clicked="${this._sendMail}"
98
+ primary
99
+ ></pd-button>
100
+ </pd-form-row>
101
+ </pd-form-container>
118
102
  </div>
119
103
  </div>
120
104
  `;
121
105
  }
122
106
  clear() {
123
- this.shadowRoot?.getElementById("nameInputId")?.["clear"]?.();
124
- this.shadowRoot?.getElementById("mailInputId")?.["clear"]?.();
125
- this.shadowRoot?.getElementById("phoneInputId")?.["clear"]?.();
126
- this.shadowRoot?.getElementById("msgInputId")?.["clear"]?.();
107
+ this._form?.clear();
127
108
  }
128
109
  _sendMail() {
129
- const form = this.shadowRoot?.getElementById(
130
- "contactFormId"
131
- );
132
- form.triggerValidate().then((result) => {
110
+ this._form.triggerValidate().then((result) => {
133
111
  if (result) {
134
112
  this.dispatchEvent(
135
113
  new CustomEvent("send-contact-request", {
136
- detail: { msgObj: form.getValues().origin }
114
+ detail: { msgObj: this._form.getValues().origin }
137
115
  })
138
116
  );
139
- form.reset();
117
+ this._form.reset();
140
118
  }
141
119
  });
142
120
  }
@@ -144,75 +122,60 @@ let PdContactUs = class extends LitElement {
144
122
  PdContactUs.styles = [
145
123
  css`
146
124
  :host {
147
- display: flex;
148
- flex-flow: row;
125
+ display: block;
149
126
  background-color: var(--pd-contactus-bg-col, var(--pd-default-col));
150
127
  background-image: var(--pd-contactus-bg-image);
151
128
  background-repeat: no-repeat;
152
- min-height: 500px;
153
129
  width: 100%;
154
130
  }
155
131
 
156
- h2 {
157
- font-family: var(--pd-default-font-title-family);
158
- font-style: normal;
159
- color: var(--pd-contactus-font-col, var(--pd-default-bg-col));
160
- margin-top: 1.4em;
161
- margin-bottom: 2.5rem;
162
- font-size: var(--pd-contactus-font-h2-size, 2.5rem);
163
- }
164
-
165
- .content-block {
166
- overflow: hidden;
167
- display: flex;
168
- flex-direction: column;
169
- align-items: flex-start;
170
- justify-content: flex-start;
171
- flex-grow: 1;
172
- max-width: 1170px;
173
- margin: 0 auto;
174
- padding-left: 30px;
175
- }
176
-
177
- .contact-block {
132
+ .contact-layout {
178
133
  display: flex;
179
134
  flex-wrap: wrap;
180
- padding-bottom: 50px;
181
- }
182
-
183
- .left-content {
184
- width: 35%;
185
- min-width: 230px;
186
- }
187
-
188
- .right-content {
189
- width: 65%;
135
+ gap: 2rem;
136
+ align-items: flex-start;
190
137
  }
191
138
 
192
- .company-contact {
193
- --app-font-content-col: var(
139
+ .contact-card {
140
+ flex: 1 1 300px;
141
+ min-width: 280px;
142
+ max-width: 420px;
143
+ /* Forward --pd-contactus-font-col to pd-contact internals */
144
+ --pd-contact-address-col: var(
145
+ --pd-contactus-font-col,
146
+ var(--pd-default-bg-col)
147
+ );
148
+ --pd-contact-address-title-col: var(
149
+ --pd-contactus-font-col,
150
+ var(--pd-default-bg-col)
151
+ );
152
+ --pd-default-font-content-col: var(
153
+ --pd-contactus-font-col,
154
+ var(--pd-default-bg-col)
155
+ );
156
+ --pd-default-font-title-col: var(
194
157
  --pd-contactus-font-col,
195
158
  var(--pd-default-bg-col)
196
159
  );
197
- --app-font-title-col: var(
160
+ --pd-contact-icon-col: var(
198
161
  --pd-contactus-font-col,
199
162
  var(--pd-default-bg-col)
200
163
  );
201
164
  }
202
165
 
203
- @media (max-width: 440px) {
204
- .item {
205
- display: none;
206
- }
207
- ul {
208
- justify-content: flex-start;
209
- }
166
+ .contact-form {
167
+ flex: 1 1 360px;
168
+ min-width: 300px;
169
+ max-width: 520px;
210
170
  }
211
171
  `
212
172
  ];
213
173
  __decorateClass([
214
174
  property({ type: Object })
215
175
  ], PdContactUs.prototype, "contact", 2);
176
+ __decorateClass([
177
+ query("#contactFormId")
178
+ ], PdContactUs.prototype, "_form", 2);
216
179
  PdContactUs = __decorateClass([
217
180
  localized()
218
181
  ], PdContactUs);
@@ -1,6 +1,37 @@
1
- import { Meta, StoryFn } from '@storybook/web-components';
2
- import { PdContactUs } from './pd-contact-us';
3
- declare const _default: Meta<PdContactUs>;
4
- export default _default;
5
- export declare const Default: StoryFn<PdContactUs>;
1
+ import { Meta, StoryObj } from '@storybook/web-components-vite';
2
+ import { PdContactData } from '@progressive-development/pd-contact';
3
+ /**
4
+ * Story arguments interface for pd-contact-us component.
5
+ * Maps to the component's public API.
6
+ */
7
+ interface PdContactUsArgs {
8
+ /** Contact data for address display */
9
+ contact: PdContactData;
10
+ }
11
+ /**
12
+ * ## pd-contact-us
13
+ *
14
+ * Contact section with company address card and message form.
15
+ *
16
+ * ### Features
17
+ * - **Address Display**: Shows company contact information via pd-contact card
18
+ * - **Contact Form**: Name, email, phone, and message fields with validation
19
+ * - **Responsive Layout**: Card and form wrap below each other on narrow screens
20
+ * - **Localization**: All labels localized via @lit/localize
21
+ * - **Email/Phone Types**: Proper input types for better mobile UX
22
+ *
23
+ * ### Accessibility
24
+ * - Form fields use proper input types (email, tel)
25
+ * - Required fields are marked for screen readers
26
+ * - Submit button uses native button semantics
27
+ */
28
+ declare const meta: Meta<PdContactUsArgs>;
29
+ export default meta;
30
+ type Story = StoryObj<PdContactUsArgs>;
31
+ /** Default contact section with company info and message form. Interactive via Controls panel. */
32
+ export declare const Default: Story;
33
+ /** All contact data configurations at a glance: full, standard, and minimal. */
34
+ export declare const AllVariants: Story;
35
+ /** CSS Custom Properties — Branded and Redesigned variants. */
36
+ export declare const CustomStyling: Story;
6
37
  //# sourceMappingURL=pd-contact-us.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pd-contact-us.stories.d.ts","sourceRoot":"","sources":["../../src/pd-contact-us/pd-contact-us.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,iBAAiB,CAAC;wBAoBpB,IAAI,CAAC,WAAW,CAAC;AAlBtB,wBAkBuB;AAMvB,eAAO,MAAM,OAAO,sBAAoB,CAAC"}
1
+ {"version":3,"file":"pd-contact-us.stories.d.ts","sourceRoot":"","sources":["../../src/pd-contact-us/pd-contact-us.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;AAEzE,OAAO,oBAAoB,CAAC;AAM5B;;;GAGG;AACH,UAAU,eAAe;IACvB,uCAAuC;IACvC,OAAO,EAAE,aAAa,CAAC;CACxB;AAoCD;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,eAAe,CA8D/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAMvC,kGAAkG;AAClG,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAMjC,gFAAgF;AAChF,eAAO,MAAM,WAAW,EAAE,KAiCzB,CAAC;AAMF,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,KA2D3B,CAAC"}
@@ -1,31 +1,43 @@
1
1
  import { LitElement, CSSResultGroup } from 'lit';
2
2
  import { PdFooterLink, PdFooterMadeBy } from '../types';
3
3
  /**
4
- * Footer-Komponente mit konfigurierbaren Links, Version und Copyright.
4
+ * Application footer with links, version, and copyright.
5
+ *
6
+ * @summary Footer with navigation links, copyright, version, and developer reference.
5
7
  *
6
- * @fires footer-link - Wird ausgelöst, wenn auf einen Footer-Link geklickt wird.
7
- * @slot - Standard-Slot nicht verwendet.
8
8
  * @tagname pd-footer
9
+ *
10
+ * @event footer-link - Fired when a footer link is clicked.
11
+ *
12
+ * @cssprop --pd-footer-bg-col - Footer background. Default: `var(--pd-default-col)`.
13
+ * @cssprop --pd-footer-font-col - Footer text color. Default: `var(--pd-on-primary-col)`.
14
+ * @cssprop --pd-footer-font-family - Footer font family. Default: `var(--pd-default-font-link-family)`.
15
+ * @cssprop --pd-footer-font-size - Footer font size. Default: `1.1em`.
16
+ * @cssprop --pd-footer-bottom-col - Bottom line background. Default: `var(--pd-default-light-col)`.
17
+ * @cssprop --pd-footer-bottom-font-size - Bottom line font size. Default: `0.9em`.
18
+ * @cssprop --pd-footer-bottom-font-col - Bottom line text color. Default: `var(--pd-default-dark-col)`.
9
19
  */
10
20
  export declare class PdFooter extends LitElement {
11
- /**
12
- * Optional: Copyright-Zeile, z.B. "2024 PD Progressive Development UG".
13
- */
21
+ /** Copyright text, e.g. "2024 PD Progressive Development UG". */
14
22
  copyright: string;
15
- /**
16
- * Optionale Versionsangabe, z.B. "v1.2.3".
17
- */
23
+ /** Version string, e.g. "v1.2.3". */
18
24
  version: string;
19
- /**
20
- * Optionaler Verweis auf den Entwickler oder die Agentur.
21
- */
25
+ /** Developer or agency reference with text and email/link. */
22
26
  madeBy?: PdFooterMadeBy;
23
- /**
24
- * Liste von Footer-Links.
25
- */
27
+ /** Footer navigation links. */
26
28
  footerLinks: PdFooterLink[];
27
29
  static styles: CSSResultGroup;
28
30
  render(): import('lit').TemplateResult<1>;
31
+ /**
32
+ * Handles keyboard events on footer links.
33
+ * Activates on Enter or Space key.
34
+ */
35
+ private _handleLinkKeydown;
36
+ /**
37
+ * Handles keyboard events on madeBy element.
38
+ * Activates on Enter or Space key.
39
+ */
40
+ private _handleMadeByKeydown;
29
41
  private _clickMadeBy;
30
42
  private _footerLinkClicked;
31
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PdFooter.d.ts","sourceRoot":"","sources":["../../src/pd-footer/PdFooter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,cAAc,EAAE,MAAM,KAAK,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;;GAMG;AACH,qBAAa,QAAS,SAAQ,UAAU;IACtC;;OAEG;IAEH,SAAS,SAAM;IAEf;;OAEG;IAEH,OAAO,SAAM;IAEb;;OAEG;IAEH,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB;;OAEG;IAEH,WAAW,EAAE,YAAY,EAAE,CAAM;IAEjC,OAAgB,MAAM,EAAE,cAAc,CAyEpC;IAEO,MAAM;IAmCf,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,kBAAkB;CAe3B"}
1
+ {"version":3,"file":"PdFooter.d.ts","sourceRoot":"","sources":["../../src/pd-footer/PdFooter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,cAAc,EAAE,MAAM,KAAK,CAAC;AAIrE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC,iEAAiE;IAEjE,SAAS,SAAM;IAEf,qCAAqC;IAErC,OAAO,SAAM;IAEb,8DAA8D;IAE9D,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB,+BAA+B;IAE/B,WAAW,EAAE,YAAY,EAAE,CAAM;IAEjC,OAAgB,MAAM,EAAE,cAAc,CAsFpC;IAEO,MAAM;IA+Cf;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,kBAAkB;CAe3B"}
@@ -1,25 +1,111 @@
1
- import { LitElement, css, nothing, html } from 'lit';
1
+ import { css, LitElement, nothing, html } from 'lit';
2
2
  import { property } from 'lit/decorators.js';
3
+ import { localized, msg } from '@lit/localize';
3
4
 
4
5
  var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
7
  var __decorateClass = (decorators, target, key, kind) => {
6
- var result = void 0 ;
8
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
7
9
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8
10
  if (decorator = decorators[i])
9
- result = (decorator(target, key, result) ) || result;
10
- if (result) __defProp(target, key, result);
11
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12
+ if (kind && result) __defProp(target, key, result);
11
13
  return result;
12
14
  };
13
- class PdFooter extends LitElement {
15
+ let PdFooter = class extends LitElement {
14
16
  constructor() {
15
17
  super(...arguments);
16
18
  this.copyright = "";
17
19
  this.version = "";
18
20
  this.footerLinks = [];
19
21
  }
20
- static {
21
- this.styles = [
22
- css`
22
+ render() {
23
+ return html`
24
+ <nav
25
+ class="footer-links"
26
+ aria-label="${msg("Footer Navigation", { id: "pd.footer.nav.aria" })}"
27
+ >
28
+ <ul role="list">
29
+ ${this.footerLinks?.map(
30
+ (link) => html`
31
+ <li
32
+ role="button"
33
+ tabindex="0"
34
+ data-link="${link.key}"
35
+ @click="${this._footerLinkClicked}"
36
+ @keydown="${this._handleLinkKeydown}"
37
+ >
38
+ ${link.name}
39
+ </li>
40
+ `
41
+ )}
42
+ </ul>
43
+ </nav>
44
+
45
+ <div class="bottom-line">
46
+ <div>
47
+ ${this.copyright ? html`<span class="copyright">© ${this.copyright}, </span>` : nothing}
48
+ ${this.version ? html`<span class="version">${this.version}</span>` : nothing}
49
+ </div>
50
+
51
+ ${this.madeBy ? html`<span
52
+ class="made-by"
53
+ role="button"
54
+ tabindex="0"
55
+ @click="${this._clickMadeBy}"
56
+ @keydown="${this._handleMadeByKeydown}"
57
+ >${this.madeBy.txt}</span
58
+ >` : nothing}
59
+ </div>
60
+ `;
61
+ }
62
+ /**
63
+ * Handles keyboard events on footer links.
64
+ * Activates on Enter or Space key.
65
+ */
66
+ _handleLinkKeydown(e) {
67
+ if (e.key === "Enter" || e.key === " ") {
68
+ e.preventDefault();
69
+ this._footerLinkClicked(e);
70
+ }
71
+ }
72
+ /**
73
+ * Handles keyboard events on madeBy element.
74
+ * Activates on Enter or Space key.
75
+ */
76
+ _handleMadeByKeydown(e) {
77
+ if (e.key === "Enter" || e.key === " ") {
78
+ e.preventDefault();
79
+ this._clickMadeBy();
80
+ }
81
+ }
82
+ _clickMadeBy() {
83
+ if (this.madeBy?.email) {
84
+ window.location.href = `mailto:${this.madeBy.email}`;
85
+ } else if (this.madeBy?.link) {
86
+ const url = this.madeBy.link;
87
+ if (url.startsWith("https://") || url.startsWith("http://")) {
88
+ window.open(url, "_blank", "noopener,noreferrer");
89
+ }
90
+ }
91
+ }
92
+ _footerLinkClicked(e) {
93
+ const target = e.currentTarget;
94
+ const linkKey = target.dataset.link;
95
+ const linkObj = this.footerLinks?.find((fl) => fl.key === linkKey);
96
+ if (linkObj) {
97
+ this.dispatchEvent(
98
+ new CustomEvent("footer-link", {
99
+ detail: { linkObj },
100
+ bubbles: true,
101
+ composed: true
102
+ })
103
+ );
104
+ }
105
+ }
106
+ };
107
+ PdFooter.styles = [
108
+ css`
23
109
  :host {
24
110
  display: flex;
25
111
  flex-flow: column;
@@ -34,7 +120,7 @@ class PdFooter extends LitElement {
34
120
  align-items: center;
35
121
  justify-content: right;
36
122
  height: 100%;
37
- color: var(--pd-footer-font-col, var(--pd-default-bg-col));
123
+ color: var(--pd-footer-font-col, var(--pd-on-primary-col));
38
124
  font-family: var(
39
125
  --pd-footer-font-family,
40
126
  var(--pd-default-font-link-family)
@@ -46,9 +132,9 @@ class PdFooter extends LitElement {
46
132
  display: flex;
47
133
  flex-wrap: wrap;
48
134
  list-style: none;
49
- gap: 2em;
135
+ gap: var(--pd-spacing-lg);
50
136
  margin: 0;
51
- padding: 2em 2.5em;
137
+ padding: var(--pd-spacing-lg);
52
138
  }
53
139
 
54
140
  .footer-links li {
@@ -59,6 +145,12 @@ class PdFooter extends LitElement {
59
145
  color: var(--pd-default-hover-col);
60
146
  }
61
147
 
148
+ .footer-links li:focus-visible {
149
+ outline: 2px solid var(--pd-focus-ring-col, var(--pd-default-col));
150
+ outline-offset: 2px;
151
+ border-radius: var(--pd-radius-sm);
152
+ }
153
+
62
154
  .bottom-line {
63
155
  background-color: var(
64
156
  --pd-footer-bottom-col,
@@ -66,9 +158,9 @@ class PdFooter extends LitElement {
66
158
  );
67
159
  font-size: var(--pd-footer-bottom-font-size, 0.9em);
68
160
  color: var(--pd-footer-bottom-font-col, var(--pd-default-dark-col));
69
- padding: 0.5em;
161
+ padding: var(--pd-spacing-sm);
70
162
  display: flex;
71
- gap: 1em;
163
+ gap: var(--pd-spacing-md);
72
164
  flex-wrap: wrap;
73
165
  justify-content: space-between;
74
166
  align-items: center;
@@ -82,78 +174,37 @@ class PdFooter extends LitElement {
82
174
  font-weight: normal;
83
175
  }
84
176
 
85
- .madeBy {
177
+ .made-by {
86
178
  cursor: pointer;
87
179
  font-style: italic;
180
+ white-space: normal;
88
181
  }
89
182
 
90
- .madeBy:hover {
183
+ .made-by:hover {
91
184
  color: var(--pd-default-col);
92
185
  }
93
- `
94
- ];
95
- }
96
- render() {
97
- return html`
98
- <div class="footer-links">
99
- <ul>
100
- ${this.footerLinks?.map(
101
- (link) => html`
102
- <li>
103
- <a @click=${this._footerLinkClicked} data-link=${link.key}
104
- >${link.name}</a
105
- >
106
- </li>
107
- `
108
- )}
109
- </ul>
110
- </div>
111
186
 
112
- <div class="bottom-line">
113
- <div>
114
- ${this.copyright ? html`<span class="copyright">© ${this.copyright}, </span>` : nothing}
115
- ${this.version ? html`<span class="version">${this.version}</span>` : nothing}
116
- </div>
117
-
118
- ${this.madeBy ? html`<span class="madeBy" @click=${this._clickMadeBy}
119
- >${this.madeBy.txt}</span
120
- >` : nothing}
121
- </div>
122
- `;
123
- }
124
- _clickMadeBy() {
125
- if (this.madeBy?.email) {
126
- window.location.href = `mailto:${this.madeBy.email}`;
127
- } else if (this.madeBy?.link) {
128
- window.open(this.madeBy.link, "_blank");
129
- }
130
- }
131
- _footerLinkClicked(e) {
132
- const target = e.currentTarget;
133
- const linkKey = target.dataset.link;
134
- const linkObj = this.footerLinks?.find((fl) => fl.key === linkKey);
135
- if (linkObj) {
136
- this.dispatchEvent(
137
- new CustomEvent("footer-link", {
138
- detail: { linkObj },
139
- bubbles: true,
140
- composed: true
141
- })
142
- );
143
- }
144
- }
145
- }
187
+ .made-by:focus-visible {
188
+ outline: 2px solid var(--pd-focus-ring-col, var(--pd-default-col));
189
+ outline-offset: 2px;
190
+ border-radius: var(--pd-radius-sm);
191
+ }
192
+ `
193
+ ];
146
194
  __decorateClass([
147
195
  property({ type: String })
148
- ], PdFooter.prototype, "copyright");
196
+ ], PdFooter.prototype, "copyright", 2);
149
197
  __decorateClass([
150
198
  property({ type: String })
151
- ], PdFooter.prototype, "version");
199
+ ], PdFooter.prototype, "version", 2);
152
200
  __decorateClass([
153
201
  property({ type: Object })
154
- ], PdFooter.prototype, "madeBy");
202
+ ], PdFooter.prototype, "madeBy", 2);
155
203
  __decorateClass([
156
204
  property({ type: Array })
157
- ], PdFooter.prototype, "footerLinks");
205
+ ], PdFooter.prototype, "footerLinks", 2);
206
+ PdFooter = __decorateClass([
207
+ localized()
208
+ ], PdFooter);
158
209
 
159
210
  export { PdFooter };