mypgs 1.6.0 → 2.1.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 (125) hide show
  1. package/AGENTS.md +2 -2
  2. package/README.md +25 -25
  3. package/assets/javascript/components/_accordion.js +2 -2
  4. package/assets/javascript/components/_modals.js +159 -136
  5. package/assets/javascript/components/_notifications.js +19 -9
  6. package/assets/javascript/components/_search.js +2 -2
  7. package/assets/javascript/components/_slides.js +66 -32
  8. package/assets/javascript/components/_stepTabs.js +4 -4
  9. package/assets/javascript/components/_steps.js +2 -2
  10. package/assets/javascript/components/_summary.js +2 -2
  11. package/assets/javascript/functions/_formValidate.js +97 -53
  12. package/assets/javascript/functions/_scrollY.js +10 -10
  13. package/assets/javascript/layout/_header.js +3 -0
  14. package/assets/scss/base/_html.scss +2 -2
  15. package/assets/scss/base/_variables.scss +2 -2
  16. package/assets/scss/components/_accordion.scss +0 -2
  17. package/assets/scss/components/_button.scss +1 -1
  18. package/assets/scss/components/_form.scss +2 -18
  19. package/assets/scss/components/_formAddon.scss +18 -0
  20. package/assets/scss/components/_modals.scss +5 -3
  21. package/assets/scss/components/_notification.scss +23 -30
  22. package/assets/scss/components/_search.scss +29 -23
  23. package/assets/scss/components/_slides.scss +0 -1
  24. package/assets/scss/components/_tooltip.scss +0 -1
  25. package/assets/scss/index.scss +1 -0
  26. package/assets/scss/layout/_footer.scss +0 -2
  27. package/assets/scss/layout/_header.scss +9 -1
  28. package/assets/scss/layout/_pageShell.scss +24 -17
  29. package/assets/scss/mixin/_mx-button.scss +30 -76
  30. package/assets/scss/mixin/_mx-card.scss +11 -9
  31. package/assets/scss/mixin/_mx-form.scss +10 -12
  32. package/assets/scss/mixin/{_mx-form-addon.scss → _mx-formAddon.scss} +23 -26
  33. package/assets/scss/mixin/_mx-hover.scss +75 -0
  34. package/assets/scss/mixin/_settings.scss +2 -1
  35. package/assets/scss/mixin/mixin.scss +2 -1
  36. package/{templates/html → demo}/demo.html +1 -1
  37. package/demo/demo.js +241 -0
  38. package/dist/css/index.css +1317 -1674
  39. package/dist/css/index.css.map +1 -1
  40. package/dist/css/index.min.css +1 -1
  41. package/dist/javascript/index.js +356 -255
  42. package/dist/javascript/index.js.map +1 -1
  43. package/dist/javascript/index.min.js +1 -1
  44. package/docs/componenti-e-markup.md +32 -32
  45. package/docs/components/accordion.md +61 -0
  46. package/docs/components/badges.md +67 -0
  47. package/docs/components/breadcumbs.md +43 -0
  48. package/docs/components/button.md +59 -0
  49. package/docs/components/card.md +50 -0
  50. package/docs/components/dropdown.md +135 -0
  51. package/docs/components/form.md +136 -0
  52. package/docs/components/formAddon.md +79 -0
  53. package/docs/components/logo.md +36 -0
  54. package/docs/components/menu.md +90 -0
  55. package/docs/components/modal.md +131 -0
  56. package/docs/components/notification.md +81 -0
  57. package/docs/components/search.md +118 -0
  58. package/docs/components/slides.md +85 -0
  59. package/docs/components/stepTabs.md +93 -0
  60. package/docs/components/steps.md +56 -0
  61. package/docs/components/summary.md +49 -0
  62. package/docs/components/table.md +42 -0
  63. package/docs/components/tooltip.md +53 -0
  64. package/docs/convenzioni.md +11 -11
  65. package/docs/export-e-sviluppo.md +3 -3
  66. package/docs/helper-javascript.md +73 -8
  67. package/docs/layout/body.md +41 -0
  68. package/docs/layout/flex.md +116 -0
  69. package/docs/layout/footer.md +71 -0
  70. package/docs/layout/grid.md +116 -0
  71. package/docs/layout/header.md +116 -0
  72. package/docs/layout/pageShell.md +94 -0
  73. package/docs/layout/section.md +69 -0
  74. package/docs/patterns/cookieConsent.md +89 -0
  75. package/docs/utilizzo-css-scss.md +8 -8
  76. package/package.json +2 -1
  77. package/scripts/generate-component-docs.js +557 -0
  78. package/templates/html/components/accordion.html +36 -7
  79. package/templates/html/components/badges.html +28 -5
  80. package/templates/html/components/breadcumbs.html +15 -1
  81. package/templates/html/components/button.html +28 -6
  82. package/templates/html/components/card.html +28 -8
  83. package/templates/html/components/dropdown.html +42 -8
  84. package/templates/html/components/form.html +110 -9
  85. package/templates/html/components/formAddon.html +72 -0
  86. package/templates/html/components/logo.html +22 -1
  87. package/templates/html/components/menu.html +33 -6
  88. package/templates/html/components/modal.html +58 -14
  89. package/templates/html/components/notification.html +68 -32
  90. package/templates/html/components/search.html +85 -8
  91. package/templates/html/components/slides.html +46 -3
  92. package/templates/html/components/stepTabs.html +55 -8
  93. package/templates/html/components/steps.html +24 -0
  94. package/templates/html/components/summary.html +30 -3
  95. package/templates/html/components/table.html +14 -2
  96. package/templates/html/components/tooltip.html +35 -0
  97. package/templates/html/layout/body.html +20 -6
  98. package/templates/html/layout/flex.html +53 -33
  99. package/templates/html/layout/footer.html +32 -4
  100. package/templates/html/layout/grid.html +53 -33
  101. package/templates/html/layout/header.html +47 -6
  102. package/templates/html/layout/pageShell.html +19 -0
  103. package/templates/html/layout/section.html +41 -19
  104. package/templates/html/patterns/cookieConsent.html +44 -13
  105. package/templates/react/components/accordion.jsx +4 -4
  106. package/templates/react/components/breadcumbs.jsx +1 -1
  107. package/templates/react/components/button.jsx +5 -5
  108. package/templates/react/components/card.jsx +4 -4
  109. package/templates/react/components/dropdown.jsx +8 -8
  110. package/templates/react/components/form.jsx +5 -5
  111. package/templates/react/components/modal.jsx +14 -14
  112. package/templates/react/components/notification.jsx +7 -7
  113. package/templates/react/components/search.jsx +5 -5
  114. package/templates/react/components/slides.jsx +3 -3
  115. package/templates/react/components/stepTabs.jsx +8 -8
  116. package/templates/react/components/summary.jsx +3 -3
  117. package/templates/react/components/table.jsx +2 -2
  118. package/templates/react/layout/flex.jsx +8 -8
  119. package/templates/react/layout/grid.jsx +8 -8
  120. package/templates/react/layout/section.jsx +12 -12
  121. package/templates/react/patterns/cookieConsent.jsx +8 -8
  122. package/templates/react/patterns/footer.jsx +4 -4
  123. package/templates/react/patterns/header.jsx +3 -3
  124. package/templates/html/demo.js +0 -130
  125. /package/{templates/html → demo}/demo.css +0 -0
@@ -1,4 +1,4 @@
1
- # Helper JavaScript
1
+ # JavaScript helper
2
2
 
3
3
  `pgs(root)` permette di cercare e modificare token PGS senza scrivere selettori manuali:
4
4
 
@@ -11,6 +11,21 @@ pgs(modal).remove("custom-token");
11
11
  pgs(modal).toggle("custom-token", true);
12
12
  ```
13
13
 
14
+ ## API dell'helper `pgs`
15
+
16
+ Ricerca disponibile su `Document` ed `Element`:
17
+
18
+ - `pgs(root).querySelector(token)`: restituisce il primo discendente che contiene il token `pgs` richiesto.
19
+ - `pgs(root).querySelectorAll(token)`: restituisce tutti i discendenti corrispondenti; accetta anche un array o token separati da virgola.
20
+
21
+ Manipulation available when `root` è un `Element`:
22
+
23
+ - `pgs(element).add(...tokens)`: aggiunge token evitando duplicati e restituisce l'helper.
24
+ - `pgs(element).remove(...tokens)`: rimuove i token indicati e restituisce l'helper.
25
+ - `pgs(element).toggle(token, force)`: inverte o forza la presenza del token e restituisce lo stato risultante.
26
+ - `pgs(element).contains(token)`: verifica la presenza esatta del token.
27
+ - `pgs(element).value`: legge o sostituisce il valore completo dell'attributo `pgs`.
28
+
14
29
  Stati runtime:
15
30
 
16
31
  ```js
@@ -19,6 +34,12 @@ pgs(modal).state.toggle("open", false);
19
34
  pgs(modal).state.contains("open");
20
35
  ```
21
36
 
37
+ - `state.add(...states)` oppure `state(...states)`: aggiunge uno o più stati.
38
+ - `state.remove(...states)`: rimuove gli stati indicati.
39
+ - `state.toggle(state, force)`: inverte o forza uno stato e restituisce il risultato.
40
+ - `state.contains(state)`: verifica se lo stato è presente.
41
+ - `state.value`: legge o sostituisce l'intero attributo `pgs-state`.
42
+
22
43
  Opzioni:
23
44
 
24
45
  ```js
@@ -26,14 +47,22 @@ pgs(modal).option.contains("history");
26
47
  pgs(modal).option.getValueBrackets("containerID");
27
48
  ```
28
49
 
29
- Esempio markup con opzioni:
50
+ - `option.add(...options)`: aggiunge opzioni semplici o parametrizzate.
51
+ - `option.remove(...keys)`: rimuove le opzioni usando la relativa chiave.
52
+ - `option.toggle(option, force)`: inverte o forza un'opzione.
53
+ - `option.contains(key)`: verifica la presenza di una chiave anche quando possiede un payload.
54
+ - `option.getValueBrackets(key)`: restituisce il contenuto tra parentesi quadre oppure `undefined`.
55
+ - `option.setValueBrackets(key, value)`: imposta o sostituisce una singola opzione parametrizzata.
56
+ - `option.value`: legge o sostituisce l'intero attributo `pgs-option`.
57
+
58
+ Example markup with options:
30
59
 
31
60
  ```html
32
61
  <div pgs="modal" pgs-option="containerID[modal-container]"></div>
33
62
  <div pgs="slides" pgs-option="singleScroll shadowDesktop"></div>
34
63
  ```
35
64
 
36
- ## JavaScript inizializzato automaticamente
65
+ ## Automatically initialized JavaScript
37
66
 
38
67
  Importando `mypgs`, l'entrypoint inizializza:
39
68
 
@@ -64,6 +93,7 @@ Serve per usare i moduli direttamente da `pgs`:
64
93
 
65
94
  ```js
66
95
  pgs.registerModules({
96
+ svg: PGS_svg,
67
97
  accordion: PGS_accordion,
68
98
  dropdown: PGS_dropdown,
69
99
  menu: PGS_menu,
@@ -73,6 +103,7 @@ pgs.registerModules({
73
103
  slides: PGS_slides,
74
104
  stepTabs: PGS_stepTabs,
75
105
  steps: PGS_steps,
106
+ summary: PGS_summary,
76
107
  formValidate: PGS_formValidate,
77
108
  scrollHorizontal: PGS_scrollHorizontal,
78
109
  });
@@ -87,8 +118,9 @@ pgs.dropdown.api(dropdownEl)?.close();
87
118
  pgs.slides.api(slidesEl)?.next();
88
119
  ```
89
120
 
90
- Shortcut disponibili dopo `import "mypgs"`:
121
+ Shortcuts available after `import "mypgs"`:
91
122
 
123
+ - `pgs.svg`
92
124
  - `pgs.accordion`
93
125
  - `pgs.dropdown`
94
126
  - `pgs.menu`
@@ -98,10 +130,37 @@ Shortcut disponibili dopo `import "mypgs"`:
98
130
  - `pgs.slides`
99
131
  - `pgs.stepTabs`
100
132
  - `pgs.steps`
133
+ - `pgs.summary`
101
134
  - `pgs.formValidate`
102
135
  - `pgs.scrollHorizontal`
103
136
 
104
- ## Struttura dei moduli componente
137
+ ## Component API reference
138
+
139
+ Le firme, i parametri e la funzione di ogni metodo sono generati dai commenti nei template:
140
+
141
+ - [Accordion](components/accordion.md#api-javascript)
142
+ - [Dropdown](components/dropdown.md#api-javascript)
143
+ - [Form validation](components/form.md#api-javascript)
144
+ - [Menu](components/menu.md#api-javascript)
145
+ - [Modal](components/modal.md#api-javascript)
146
+ - [Notification](components/notification.md#api-javascript)
147
+ - [Search](components/search.md#api-javascript)
148
+ - [Slides](components/slides.md#api-javascript)
149
+ - [Step Tabs](components/stepTabs.md#api-javascript)
150
+ - [Steps](components/steps.md#api-javascript)
151
+ - [Summary](components/summary.md#api-javascript)
152
+ - [Tooltip tramite Dropdown](components/tooltip.md#api-javascript)
153
+
154
+ I componenti non elencati non espongono attualmente un'API JavaScript specifica.
155
+
156
+ ## Utility JavaScript pubbliche
157
+
158
+ - `pgs.scrollHorizontal(element, speed)`: converte lo scroll verticale della rotella in scorrimento orizzontale quando il contenitore può ancora muoversi nella direzione richiesta e restituisce una funzione che rimuove il listener.
159
+ - `pgs.svg.applyColorsSVG(isDarkMode)`: aggiorna i colori degli SVG caricati tramite `object` e marcati con `svgChangeColor`.
160
+ - `pgs.svg.applyColorsLottie(isDarkMode)`: aggiorna i colori degli SVG interni ai player Lottie marcati con `lottieChangeColor`.
161
+ - `pgs.svg.eventChangeColor`: contiene il nome dell'evento `pgs:svg:changeColor` ascoltato dal modulo SVG.
162
+
163
+ ## Component module structure
105
164
 
106
165
  I componenti con istanze seguono questo schema:
107
166
 
@@ -112,16 +171,22 @@ export const PGS_modal = {
112
171
  };
113
172
  ```
114
173
 
115
- - `PGS_name`: nome ufficiale del modulo per il registro legacy.
116
- - `init`: inizializza o reinizializza markup, utile dopo contenuti dinamici.
174
+ Le funzioni `PGS_modal_init` e `PGS_modal_api` restano interne al modulo: l'unico export del file è `PGS_modal`. Lo stesso criterio vale per gli altri componenti.
175
+
176
+ - `init`: inizializza o reinizializza il markup nel `Document` o `Element` ricevuto; senza argomenti usa `document`.
117
177
  - `api`: recupera l'API di una singola istanza gia' inizializzata.
118
178
 
119
179
  Esempio:
120
180
 
121
181
  ```js
122
182
  pgs.modal.init();
123
- pgs.modal.init(container);
124
183
  pgs.modal.api(modalEl)?.open();
125
184
  ```
126
185
 
127
186
  `PGS_notification` e' un caso diverso: funziona piu' come service/helper e espone `alert`, `toast` e `trigger`.
187
+
188
+ ## Registro ed estensione
189
+
190
+ - `pgs.registerModules(modules)`: espone un oggetto di moduli direttamente come proprietà di `pgs` e impedisce sovrascritture incompatibili.
191
+ - `pgs.registerImport(...modules)`: registra moduli nel registro nominato usato dalle integrazioni avanzate.
192
+ - `pgs.import(...names)`: recupera dal registro i moduli richiesti e genera un errore per i nomi non registrati.
@@ -0,0 +1,41 @@
1
+ <!-- Automatically generated from templates/html/layout/body.html. Edit templates/html/layout/body.html and run npm run docs:generate again. -->
2
+
3
+ # Body
4
+
5
+ Base HTML document that enables MyPGS, configures essential metadata, and applies shared background, text, and heading variants to the body.
6
+
7
+ ## PGS
8
+
9
+ - `htmlBase`: applies the fundamental rules to the html element.
10
+ - `initP`: enables layout, component, and pattern styles scoped to the MyPGS namespace.
11
+ - `bodyBase`: applies the base structure and spacing to the body.
12
+ - `bodyImg`: enables shared rules for images contained in the page.
13
+ - `bodyText`: enables text typography and spacing.
14
+ - `bodyHeading`: enables the typographic heading hierarchy.
15
+
16
+ ## PGS States
17
+
18
+ - `darkmode`: is applied dynamically to html and body to activate the dark theme.
19
+
20
+ ## Output
21
+
22
+ Complete HTML skeleton required to initialize the MyPGS library.
23
+
24
+ ## Example
25
+
26
+ ```html
27
+ <!DOCTYPE html>
28
+ <html lang="it-IT" pgs="htmlBase initP">
29
+
30
+ <head>
31
+ <meta charset="UTF-8">
32
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
33
+
34
+ <!-- Colori Browsers -->
35
+ <meta name="theme-color" content="">
36
+ <meta name="apple-mobile-web-app-status-bar-color" content="">
37
+
38
+ </head>
39
+
40
+ <body pgs="bodyBase bodyImg bodyText bodyHeading" >
41
+ ```
@@ -0,0 +1,116 @@
1
+ <!-- Automatically generated from templates/html/layout/flex.html. Edit templates/html/layout/flex.html and run npm run docs:generate again. -->
2
+
3
+ # Flex
4
+
5
+ Flex markup, configuration, behavior, and usage example.
6
+
7
+ ## PGS
8
+
9
+ - `flex-2`: identifies the flex-2 element used by Flex.
10
+ - `flex-3`: identifies the flex-3 element used by Flex.
11
+ - `flex-4`: identifies the flex-4 element used by Flex.
12
+ - `flex-6`: identifies the flex-6 element used by Flex.
13
+
14
+ ## Related elements
15
+
16
+ - `container`: defines the container context for the introduction.
17
+ - `flexColumnTexts`: vertically organizes and spaces card text and content.
18
+ - `card`: makes the demonstration cells of the flex layout visible.
19
+
20
+ ## Output
21
+
22
+ HTML collection of responsive flex layouts with two, three, four, and six items.
23
+
24
+ ## Example
25
+
26
+ ```html
27
+ <div pgs="container flexColumnTexts">
28
+ <strong>Standard section</strong>
29
+ <p>Centered content inside a MyPGS section.</p>
30
+ </div>
31
+
32
+
33
+ <div pgs="flex-2">
34
+ <article pgs="card flexColumnTexts">
35
+ <strong>Column one</strong>
36
+ <p>First column content.</p>
37
+ </article>
38
+
39
+ <article pgs="card flexColumnTexts">
40
+ <strong>Column two</strong>
41
+ <p>Second column content.</p>
42
+ </article>
43
+ </div>
44
+
45
+
46
+ <div pgs="flex-3">
47
+ <article pgs="card flexColumnTexts">
48
+ <strong>Column one</strong>
49
+ <p>First column content.</p>
50
+ </article>
51
+
52
+ <article pgs="card flexColumnTexts">
53
+ <strong>Column two</strong>
54
+ <p>Second column content.</p>
55
+ </article>
56
+
57
+ <article pgs="card flexColumnTexts">
58
+ <strong>Column three</strong>
59
+ <p>Third column content.</p>
60
+ </article>
61
+ </div>
62
+
63
+
64
+ <div pgs="flex-4">
65
+ <article pgs="card flexColumnTexts">
66
+ <strong>Column one</strong>
67
+ <p>First column content.</p>
68
+ </article>
69
+
70
+ <article pgs="card flexColumnTexts">
71
+ <strong>Column two</strong>
72
+ <p>Second column content.</p>
73
+ </article>
74
+
75
+ <article pgs="card flexColumnTexts">
76
+ <strong>Column three</strong>
77
+ <p>Third column content.</p>
78
+ </article>
79
+ <article pgs="card flexColumnTexts">
80
+ <strong>Column four</strong>
81
+ <p>Fourth column content.</p>
82
+ </article>
83
+ </div>
84
+
85
+ <div pgs="flex-6">
86
+ <article pgs="card flexColumnTexts">
87
+ <strong>Column one</strong>
88
+ <p>First column content.</p>
89
+ </article>
90
+
91
+ <article pgs="card flexColumnTexts">
92
+ <strong>Column two</strong>
93
+ <p>Second column content.</p>
94
+ </article>
95
+
96
+ <article pgs="card flexColumnTexts">
97
+ <strong>Column three</strong>
98
+ <p>Third column content.</p>
99
+ </article>
100
+
101
+ <article pgs="card flexColumnTexts">
102
+ <strong>Column four</strong>
103
+ <p>Fourth column content.</p>
104
+ </article>
105
+
106
+ <article pgs="card flexColumnTexts">
107
+ <strong>Column five</strong>
108
+ <p>Fifth column content.</p>
109
+ </article>
110
+
111
+ <article pgs="card flexColumnTexts">
112
+ <strong>Column six</strong>
113
+ <p>Sixth column content.</p>
114
+ </article>
115
+ </div
116
+ ```
@@ -0,0 +1,71 @@
1
+ <!-- Automatically generated from templates/html/layout/footer.html. Edit templates/html/layout/footer.html and run npm run docs:generate again. -->
2
+
3
+ # Footer
4
+
5
+ Complete footer with theme control, brand area, navigation, informational content, and a link to cookie preferences.
6
+
7
+ ## PGS
8
+
9
+ - `footer`: identifies the main footer container.
10
+ - `footer-top`: identifies the upper section containing the brand and content.
11
+ - `footer-top-content`: identifies the responsive inner layout of the upper section.
12
+ - `footer-brand`: identifies the group dedicated to the brand.
13
+ - `footer-brand-motto`: identifies the descriptive text associated with the brand.
14
+ - `footer-content`: identifies an informational footer column.
15
+ - `footer-legal`: identifies the lower section dedicated to legal information.
16
+ - `footer-legal-content`: identifies the content of the legal section.
17
+
18
+ ## Related elements
19
+
20
+ - `button`: presents theme and cookie preference controls as buttons.
21
+ - `toggleDarkmode`: connects the control to the global light or dark theme handler.
22
+ - `section`: applies the shared section structure to the upper and legal areas.
23
+ - `flex-3`: distributes the upper columns responsively.
24
+ - `logo`: inserts the brand into the footer.
25
+ - `logo-text`: uses the text variant of the logo.
26
+ - `cookieConsent-actionOpen`: opens the Cookie Consent preference panel.
27
+
28
+ ## Output
29
+
30
+ Complete footer HTML structure with brand, menu, and legal area.
31
+
32
+ ## Example
33
+
34
+ ```html
35
+ <footer pgs="footer">
36
+ <button pgs="button toggleDarkmode" type="button" aria-label="Change theme">
37
+ <i class="fa-solid fa-moon"></i>
38
+ </button>
39
+
40
+ <section pgs="footer-top section">
41
+ <div pgs="footer-top-content flex-3">
42
+ <div pgs="footer-brand">
43
+ <a aria-label="Logo" pgs="logo" href="/">
44
+ <span pgs="logo-text">MyPGS</span>
45
+ </a>
46
+ <p pgs="footer-brand-motto">Componenti frontend riutilizzabili.</p>
47
+ </div>
48
+
49
+ <div pgs="footer-content">
50
+ <h2>Menu</h2>
51
+ <nav aria-label="Menu footer">
52
+ <ul>
53
+ <li><a href="/">Home</a></li>
54
+ <li><a href="/contatti">Contatti</a></li>
55
+ </ul>
56
+ </nav>
57
+ </div>
58
+ </div>
59
+ </section>
60
+
61
+ <section pgs="footer-legal section">
62
+ <div pgs="footer-legal-content">
63
+ <button type="button" pgs="button cookieConsent-actionOpen">Cookie preferences</button>
64
+ <p><a href="">Privacy Policy</a></p>
65
+ <p><a href="">Cookie Policy</a></p>
66
+ <p><a href="">Termini e Condizioni</a></p>
67
+ <p>© 2026 MyPgs. No rights reserved.</p>
68
+ </div>
69
+ </section>
70
+ </footer>
71
+ ```
@@ -0,0 +1,116 @@
1
+ <!-- Automatically generated from templates/html/layout/grid.html. Edit templates/html/layout/grid.html and run npm run docs:generate again. -->
2
+
3
+ # Grid
4
+
5
+ Responsive grid examples that distribute two to six columns while preserving design-system gaps and sizing.
6
+
7
+ ## PGS
8
+
9
+ - `grid-2`: creates a responsive grid with up to two columns.
10
+ - `grid-3`: creates a responsive grid with up to three columns.
11
+ - `grid-4`: creates a responsive grid with up to four columns.
12
+ - `grid-6`: creates a responsive grid with up to six columns.
13
+
14
+ ## Related elements
15
+
16
+ - `container`: defines the container context for the introduction.
17
+ - `flexColumnTexts`: organizes and spaces introductory and card text.
18
+ - `card`: makes the demonstration grid cells visible.
19
+
20
+ ## Output
21
+
22
+ HTML collection of responsive grids with two, three, four, and six columns.
23
+
24
+ ## Example
25
+
26
+ ```html
27
+ <div pgs="container flexColumnTexts">
28
+ <strong>Standard section</strong>
29
+ <p>Centered content inside a MyPGS section.</p>
30
+ </div>
31
+
32
+
33
+ <div pgs="grid-2">
34
+ <article pgs="card flexColumnTexts">
35
+ <strong>Column one</strong>
36
+ <p>First column content.</p>
37
+ </article>
38
+
39
+ <article pgs="card flexColumnTexts">
40
+ <strong>Column two</strong>
41
+ <p>Second column content.</p>
42
+ </article>
43
+ </div>
44
+
45
+
46
+ <div pgs="grid-3">
47
+ <article pgs="card flexColumnTexts">
48
+ <strong>Column one</strong>
49
+ <p>First column content.</p>
50
+ </article>
51
+
52
+ <article pgs="card flexColumnTexts">
53
+ <strong>Column two</strong>
54
+ <p>Second column content.</p>
55
+ </article>
56
+
57
+ <article pgs="card flexColumnTexts">
58
+ <strong>Column three</strong>
59
+ <p>Third column content.</p>
60
+ </article>
61
+ </div>
62
+
63
+
64
+ <div pgs="grid-4">
65
+ <article pgs="card flexColumnTexts">
66
+ <strong>Column one</strong>
67
+ <p>First column content.</p>
68
+ </article>
69
+
70
+ <article pgs="card flexColumnTexts">
71
+ <strong>Column two</strong>
72
+ <p>Second column content.</p>
73
+ </article>
74
+
75
+ <article pgs="card flexColumnTexts">
76
+ <strong>Column three</strong>
77
+ <p>Third column content.</p>
78
+ </article>
79
+ <article pgs="card flexColumnTexts">
80
+ <strong>Column four</strong>
81
+ <p>Fourth column content.</p>
82
+ </article>
83
+ </div>
84
+
85
+ <div pgs="grid-6">
86
+ <article pgs="card flexColumnTexts">
87
+ <strong>Column one</strong>
88
+ <p>First column content.</p>
89
+ </article>
90
+
91
+ <article pgs="card flexColumnTexts">
92
+ <strong>Column two</strong>
93
+ <p>Second column content.</p>
94
+ </article>
95
+
96
+ <article pgs="card flexColumnTexts">
97
+ <strong>Column three</strong>
98
+ <p>Third column content.</p>
99
+ </article>
100
+
101
+ <article pgs="card flexColumnTexts">
102
+ <strong>Column four</strong>
103
+ <p>Fourth column content.</p>
104
+ </article>
105
+
106
+ <article pgs="card flexColumnTexts">
107
+ <strong>Column five</strong>
108
+ <p>Fifth column content.</p>
109
+ </article>
110
+
111
+ <article pgs="card flexColumnTexts">
112
+ <strong>Column six</strong>
113
+ <p>Sixth column content.</p>
114
+ </article>
115
+ </div
116
+ ```
@@ -0,0 +1,116 @@
1
+ <!-- Automatically generated from templates/html/layout/header.html. Edit templates/html/layout/header.html and run npm run docs:generate again. -->
2
+
3
+ # Header
4
+
5
+ Responsive header that measures available space, switches between desktop and mobile content, and integrates menus, dark mode, and modal navigation.
6
+
7
+ ## PGS
8
+
9
+ - `header`: identifies the main header observed by the JavaScript module.
10
+ - `header-element`: identifies the inner group measured to determine the switch to mobile mode.
11
+ - `header-element-alwaysOn`: identifies the initial area that is always visible.
12
+ - `header-element-onlyDesktop`: identifies content shown only while the desktop menu is active.
13
+ - `header-element-onlyMobile`: identifies content shown only in mobile mode.
14
+ - `header-element-alwaysOnLast`: identifies the final area that is always visible.
15
+ - `header-element-hamburger`: identifies the mobile navigation group.
16
+ - `header-element-hamburger-button`: identifies the header-specific hamburger control.
17
+
18
+ ## PGS Options
19
+
20
+ - `horizontal`: arranges the related desktop menu horizontally.
21
+ - `vertical`: arranges the related mobile menu vertically.
22
+ - `menuHeader`: adapts both menus to the header context.
23
+ - `containerPGS`: uses containerPGS[header] on the modal wrapper to move the dialog into the header.
24
+ - `right`: presents the mobile navigation dialog content from the right side.
25
+
26
+ ## PGS States
27
+
28
+ - `mobileActive`: is applied to header and header-element when their width or the viewport requires mobile navigation.
29
+
30
+ ## Related elements
31
+
32
+ - `logo`: inserts the brand into the initial area.
33
+ - `logo-text`: uses the text variant of the logo.
34
+ - `menu`: provides desktop and mobile navigation.
35
+ - `buttonIcon`: presents theme and hamburger controls as icon buttons.
36
+ - `toggleDarkmode`: connects the control to the global theme handler.
37
+ - `modal`: provides opening and closing behavior for mobile navigation.
38
+ - `modal-button`: opens the mobile panel.
39
+ - `modal-close`: closes the mobile panel and shares the hamburger control.
40
+ - `modal-dialog`: identifies the mobile navigation dialog.
41
+ - `modal-dialog-content`: identifies the inner mobile navigation panel.
42
+
43
+ ## Output
44
+
45
+ Complete header HTML with desktop navigation and a side mobile panel.
46
+
47
+ ## Example
48
+
49
+ ```html
50
+ <header pgs="header">
51
+ <div pgs="header-element">
52
+ <div pgs="header-element-alwaysOn">
53
+ <a aria-label="Logo" pgs="logo" href="/">
54
+ <span pgs="logo-text">MyPGS</span>
55
+ </a>
56
+ </div>
57
+
58
+ <div pgs="header-element-onlyDesktop">
59
+ <nav pgs="menu" pgs-option="horizontal menuHeader" aria-label="Main menu">
60
+ <ul>
61
+ <li><a href="/">Home</a></li>
62
+ <li><a href="#components">Components</a></li>
63
+ <li><a href="#layout">Layout</a></li>
64
+ </ul>
65
+ </nav>
66
+ </div>
67
+
68
+ <div pgs="header-element-onlyMobile">
69
+ </div>
70
+
71
+ <div pgs="header-element-alwaysOnLast">
72
+ <button pgs="buttonIcon toggleDarkmode" type="button" aria-label="Change theme">
73
+ <i class="fa-solid fa-moon"></i>
74
+ </button>
75
+ </div>
76
+
77
+ <div pgs="header-element-hamburger modal" pgs-option="containerPGS[header] ">
78
+
79
+ <button pgs="buttonIcon modal-button modal-close header-element-hamburger-button" type="button"></button>
80
+
81
+ <dialog pgs="modal-dialog" pgs-option="right">
82
+ <div pgs="modal-dialog-content">
83
+ <nav pgs="menu" pgs-option="vertical menuHeader" aria-label="Mobile menu">
84
+ <ul>
85
+ <li><a href="/">Home</a></li>
86
+ <li><a href="#components">Components</a></li>
87
+ <li><a href="#layout">Layout</a></li>
88
+ </ul>
89
+ </nav>
90
+ </div>
91
+ </dialog>
92
+ </div>
93
+ </div>
94
+
95
+ <!-- //# HEADER BOTTOM -->
96
+
97
+ <script>
98
+ const addPgsState = (element, state) => {
99
+ if (!element) return;
100
+
101
+ const states = element.getAttribute("pgs-state")?.split(/\s+/) ?? [];
102
+ element.setAttribute("pgs-state", [...new Set([...states, state])].join(" "));
103
+ };
104
+
105
+ if (localStorage.getItem("screenIsDarkMode") === "true") {
106
+ addPgsState(document.documentElement, "darkmode");
107
+ addPgsState(document.body, "darkmode");
108
+ }
109
+
110
+ if (window.innerWidth < 600) {
111
+ addPgsState(document.querySelector("header"), "mobileActive");
112
+ addPgsState(document.querySelector("[pgs~=header-element]"), "mobileActive");
113
+ }
114
+ </script>
115
+ </header>
116
+ ```