mypgs 2.0.0 → 3.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 (163) hide show
  1. package/.vscode/tasks.json +39 -0
  2. package/AGENTS.md +22 -21
  3. package/README.md +25 -25
  4. package/assets/javascript/components/_menu.js +2 -1
  5. package/assets/javascript/components/_modals.js +1 -1
  6. package/assets/javascript/components/_notifications.js +2 -1
  7. package/assets/javascript/components/_slides.js +2 -2
  8. package/assets/scss/base/_body.scss +5 -5
  9. package/assets/scss/base/_general.scss +27 -18
  10. package/assets/scss/base/_variables.scss +1 -1
  11. package/assets/scss/components/_accordion.scss +9 -9
  12. package/assets/scss/components/_alerts.scss +71 -0
  13. package/assets/scss/components/_badges.scss +40 -48
  14. package/assets/scss/components/_button.scss +28 -20
  15. package/assets/scss/components/_card.scss +9 -4
  16. package/assets/scss/components/_form.scss +0 -16
  17. package/assets/scss/components/_formAddon.scss +22 -0
  18. package/assets/scss/components/_logo.scss +3 -4
  19. package/assets/scss/components/_menu.scss +26 -3
  20. package/assets/scss/components/_modals.scss +6 -4
  21. package/assets/scss/components/_search.scss +2 -2
  22. package/assets/scss/components/_slides.scss +0 -1
  23. package/assets/scss/components/_stepTabs.scss +2 -1
  24. package/assets/scss/components/_tooltip.scss +0 -1
  25. package/assets/scss/index.scss +3 -3
  26. package/assets/scss/layout/_footer.scss +0 -2
  27. package/assets/scss/layout/_header.scss +10 -2
  28. package/assets/scss/layout/_pageShell.scss +6 -2
  29. package/assets/scss/layout/_responsive.scss +63 -0
  30. package/assets/scss/mixin/_mx-base.scss +4 -8
  31. package/assets/scss/mixin/_mx-button.scss +73 -115
  32. package/assets/scss/mixin/_mx-card.scss +39 -40
  33. package/assets/scss/mixin/_mx-form.scss +13 -10
  34. package/assets/scss/mixin/{_mx-form-addon.scss → _mx-formAddon.scss} +103 -64
  35. package/assets/scss/mixin/_mx-hover.scss +81 -0
  36. package/assets/scss/mixin/_mx-responsive.scss +81 -201
  37. package/assets/scss/mixin/_settings.scss +2 -1
  38. package/assets/scss/mixin/mixin.scss +2 -1
  39. package/demo/demo.css +9 -6
  40. package/demo/demo.html +7 -5
  41. package/demo/demo.js +37 -34
  42. package/dist/css/index.css +2469 -3825
  43. package/dist/css/index.css.map +1 -1
  44. package/dist/css/index.min.css +1 -1
  45. package/dist/javascript/index.js +7 -5
  46. package/dist/javascript/index.js.map +1 -1
  47. package/dist/javascript/index.min.js +1 -1
  48. package/docs/componenti-e-markup.md +9 -8
  49. package/docs/components/accordion.md +23 -23
  50. package/docs/components/alerts.md +67 -0
  51. package/docs/components/badges.md +29 -26
  52. package/docs/components/breadcumbs.md +8 -8
  53. package/docs/components/button.md +18 -18
  54. package/docs/components/card.md +25 -22
  55. package/docs/components/dropdown.md +29 -29
  56. package/docs/components/form.md +65 -41
  57. package/docs/components/formAddon.md +116 -0
  58. package/docs/components/logo.md +11 -11
  59. package/docs/components/menu.md +20 -20
  60. package/docs/components/modal.md +52 -51
  61. package/docs/components/notification.md +34 -34
  62. package/docs/components/search.md +54 -52
  63. package/docs/components/slides.md +41 -42
  64. package/docs/components/stepTabs.md +45 -45
  65. package/docs/components/steps.md +16 -16
  66. package/docs/components/summary.md +20 -20
  67. package/docs/components/table.md +7 -7
  68. package/docs/components/tooltip.md +24 -23
  69. package/docs/convenzioni.md +11 -11
  70. package/docs/export-e-sviluppo.md +4 -4
  71. package/docs/helper-javascript.md +8 -8
  72. package/docs/layout/body.md +11 -11
  73. package/docs/layout/footer.md +28 -24
  74. package/docs/layout/header.md +36 -35
  75. package/docs/layout/pageShell.md +19 -19
  76. package/docs/layout/responsive.md +90 -0
  77. package/docs/layout/section.md +38 -38
  78. package/docs/patterns/cookieConsent.md +42 -39
  79. package/docs/utilizzo-css-scss.md +33 -9
  80. package/package.json +1 -1
  81. package/reference/html/components/accordion.html +52 -0
  82. package/reference/html/components/alerts.html +59 -0
  83. package/reference/html/components/badges.html +62 -0
  84. package/{templates → reference}/html/components/breadcumbs.html +6 -6
  85. package/reference/html/components/button.html +51 -0
  86. package/reference/html/components/card.html +45 -0
  87. package/{templates → reference}/html/components/dropdown.html +25 -25
  88. package/reference/html/components/form.html +128 -0
  89. package/reference/html/components/formAddon.html +109 -0
  90. package/reference/html/components/logo.html +28 -0
  91. package/{templates → reference}/html/components/menu.html +17 -17
  92. package/reference/html/components/modal.html +123 -0
  93. package/reference/html/components/notification.html +71 -0
  94. package/reference/html/components/search.html +109 -0
  95. package/reference/html/components/slides.html +75 -0
  96. package/reference/html/components/stepTabs.html +83 -0
  97. package/reference/html/components/steps.html +49 -0
  98. package/reference/html/components/summary.html +41 -0
  99. package/{templates → reference}/html/components/table.html +5 -5
  100. package/reference/html/components/tooltip.html +44 -0
  101. package/reference/html/layout/body.html +34 -0
  102. package/reference/html/layout/footer.html +67 -0
  103. package/reference/html/layout/header.html +108 -0
  104. package/{templates → reference}/html/layout/pageShell.html +16 -16
  105. package/reference/html/layout/responsive.html +83 -0
  106. package/reference/html/layout/section.html +62 -0
  107. package/reference/html/patterns/cookieConsent.html +84 -0
  108. package/{templates → reference}/react/components/accordion.jsx +5 -5
  109. package/reference/react/components/alerts.jsx +46 -0
  110. package/{templates → reference}/react/components/breadcumbs.jsx +1 -1
  111. package/{templates → reference}/react/components/button.jsx +6 -6
  112. package/{templates → reference}/react/components/card.jsx +6 -6
  113. package/{templates → reference}/react/components/dropdown.jsx +8 -8
  114. package/{templates → reference}/react/components/form.jsx +3 -3
  115. package/{templates → reference}/react/components/modal.jsx +15 -15
  116. package/{templates → reference}/react/components/notification.jsx +3 -3
  117. package/{templates → reference}/react/components/search.jsx +8 -8
  118. package/{templates → reference}/react/components/slides.jsx +4 -4
  119. package/{templates → reference}/react/components/stepTabs.jsx +12 -12
  120. package/reference/react/components/summary.jsx +18 -0
  121. package/{templates → reference}/react/components/table.jsx +2 -2
  122. package/{templates → reference}/react/components/tooltip.jsx +1 -1
  123. package/{templates → reference}/react/layout/pageShell.jsx +2 -2
  124. package/reference/react/layout/responsive.jsx +61 -0
  125. package/reference/react/layout/section.jsx +44 -0
  126. package/{templates → reference}/react/patterns/cookieConsent.jsx +9 -9
  127. package/{templates → reference}/react/patterns/footer.jsx +4 -4
  128. package/{templates → reference}/react/patterns/header.jsx +4 -4
  129. package/scripts/generate-component-docs.js +12 -12
  130. package/assets/scss/layout/_flex.scss +0 -49
  131. package/assets/scss/layout/_gap.scss +0 -21
  132. package/assets/scss/layout/_grid.scss +0 -13
  133. package/docs/layout/flex.md +0 -116
  134. package/docs/layout/grid.md +0 -116
  135. package/templates/html/components/accordion.html +0 -52
  136. package/templates/html/components/badges.html +0 -60
  137. package/templates/html/components/button.html +0 -51
  138. package/templates/html/components/card.html +0 -43
  139. package/templates/html/components/form.html +0 -104
  140. package/templates/html/components/logo.html +0 -28
  141. package/templates/html/components/modal.html +0 -122
  142. package/templates/html/components/notification.html +0 -71
  143. package/templates/html/components/search.html +0 -107
  144. package/templates/html/components/slides.html +0 -76
  145. package/templates/html/components/stepTabs.html +0 -83
  146. package/templates/html/components/steps.html +0 -49
  147. package/templates/html/components/summary.html +0 -41
  148. package/templates/html/components/tooltip.html +0 -43
  149. package/templates/html/layout/body.html +0 -35
  150. package/templates/html/layout/flex.html +0 -109
  151. package/templates/html/layout/footer.html +0 -64
  152. package/templates/html/layout/grid.html +0 -109
  153. package/templates/html/layout/header.html +0 -107
  154. package/templates/html/layout/section.html +0 -62
  155. package/templates/html/patterns/cookieConsent.html +0 -82
  156. package/templates/react/components/summary.jsx +0 -18
  157. package/templates/react/layout/flex.jsx +0 -36
  158. package/templates/react/layout/grid.jsx +0 -36
  159. package/templates/react/layout/section.jsx +0 -44
  160. /package/{templates → reference}/react/components/logo.jsx +0 -0
  161. /package/{templates → reference}/react/components/menu.jsx +0 -0
  162. /package/{templates → reference}/react/components/steps.jsx +0 -0
  163. /package/{templates → reference}/react/layout/body.jsx +0 -0
@@ -0,0 +1,109 @@
1
+ <!--
2
+ /**
3
+ * @title Search
4
+ * @description Search markup, configuration, behavior, and usage example.
5
+ *
6
+ * @pgs
7
+ * - search: identifies the search element used by Search.
8
+ * - search-suggestions: identifies the search-suggestions element used by Search.
9
+ * - search-suggestions-item: identifies the search-suggestions-item element used by Search.
10
+ * - search-modal: identifies the search-modal element used by Search.
11
+ * - search-mobile: identifies the search-mobile element used by Search.
12
+ *
13
+ * @pgs-option
14
+ * - containerPGS: identifies the containerPGS element used by Search.
15
+ * - buttonNohover: disables hover behavior on the search container.
16
+ * - buttonIcon: presents search and close actions as icon buttons.
17
+ *
18
+ * @pgs-state
19
+ * - open: identifies the open element used by Search.
20
+ * - loading: identifies the loading element used by Search.
21
+ * - error: identifies the error element used by Search.
22
+ * - selected: identifies the selected element used by Search.
23
+ *
24
+ * @api
25
+ * - pgs.search.init(root): initializes matching elements within the specified root.
26
+ * - pgs.search.api(element): returns the instance associated with the specified initialized element.
27
+ * - instance.configure(options): provides the documented operation through the component public API.
28
+ * - instance.setSource(source): provides the documented operation through the component public API.
29
+ * - instance.search(query): provides the documented operation through the component public API.
30
+ * - instance.open(): opens the component.
31
+ * - instance.close(): closes the component.
32
+ * - instance.clear(): provides the documented operation through the component public API.
33
+ * - instance.cancel(): annulla debounce e richiesta attiva.
34
+ * - instance.select(index, submit): provides the documented operation through the component public API.
35
+ * - instance.refresh(): refreshes the component and returns its updated instance.
36
+ * - instance.destroy(): removes listeners and releases the component instance.
37
+ * - instance.items(): provides the documented operation through the component public API.
38
+ * - instance.isOpen(): returns true when the component is open.
39
+ * - instance.isLoading(): returns true while the component is loading.
40
+ * - instance.setActiveIndex(index): provides the documented operation through the component public API.
41
+ *
42
+ * @related
43
+ * - button: provides the base styling for search controls.
44
+ * - modal: uses the related modal component or utility in this example.
45
+ * - modal-button: uses the related modal-button component or utility in this example.
46
+ * - modal-close: uses the related modal-close component or utility in this example.
47
+ * - flexRow: uses the related flexRow component or utility in this example.
48
+ * - section: uses the related section component or utility in this example.
49
+ *
50
+ * @return Complete HTML markup and usage example for Search.
51
+ */
52
+ -->
53
+
54
+ <form pgs="button search" pgs-option="buttonNohover" autocomplete="off" action="" method="get">
55
+ <button type="submit" title="Search"><i class="fa-solid fa-search"></i></button>
56
+ <input type="search" name="s" placeholder="Search" value="">
57
+ <ul pgs="search-suggestions"></ul>
58
+ </form>
59
+
60
+ <div pgs="modal search-modal" pgs-option="containerPGS[header]">
61
+
62
+ <button type="button" pgs="modal-button button" pgs-option="buttonIcon" title="Search">
63
+ <i class="fa-solid fa-search"></i>
64
+ </button>
65
+
66
+ <dialog>
67
+ <div pgs="flexRow section search-mobile">
68
+
69
+ <form pgs="button search" pgs-option="buttonNohover" autocomplete="off" action="/" method="get">
70
+ <button type="submit" title="Search">
71
+ <i class="fa-solid fa-search"></i>
72
+ </button>
73
+
74
+ <input type="search" name="s" placeholder="Search" value="">
75
+ <ul pgs="search-suggestions"></ul>
76
+
77
+ <button type="button" pgs="modal-close button" pgs-option="buttonIcon">
78
+ <i class="fa-solid fa-close"></i>
79
+ </button>
80
+ </form>
81
+
82
+
83
+ </div>
84
+ </dialog>
85
+ </div>
86
+
87
+ <script type="module">
88
+ import { pgs } from "mypgs";
89
+
90
+ const components = [
91
+ { label: "Accordion", value: "/componenti/accordion", data: { category: "component" } },
92
+ { label: "Dropdown", value: "/componenti/dropdown", data: { category: "component" } },
93
+ { label: "Modal", value: "/componenti/modal", data: { category: "component" } },
94
+ { label: "Search", value: "/componenti/search", data: { category: "component" } },
95
+ { label: "Page Shell", value: "/layout/page-shell", data: { category: "layout" } },
96
+ ];
97
+
98
+ pgs(document).querySelectorAll("search").forEach(search => {
99
+ pgs.search.api(search)?.configure({
100
+ minLength: 1,
101
+ debounce: 150,
102
+ limit: 5,
103
+ source: components,
104
+ onSelect: ({ item, value }) => {
105
+ console.log(`Selezionato ${item.label}: ${value}`);
106
+ },
107
+ });
108
+ });
109
+ </script>
@@ -0,0 +1,75 @@
1
+ <!--
2
+ /**
3
+ * @title Slides
4
+ * @description Slides markup, configuration, behavior, and usage example.
5
+ *
6
+ * @pgs
7
+ * - slides: identifies the slides element used by Slides.
8
+ * - slides-container: identifies the slides-container element used by Slides.
9
+ * - slides-prec: identifies the slides-prec element used by Slides.
10
+ * - slides-next: identifies the slides-next element used by Slides.
11
+ * - slides-dots: identifies the slides-dots element used by Slides.
12
+ *
13
+ * @pgs-option
14
+ * - singleScroll: identifies the singleScroll element used by Slides.
15
+ * - shadowDesktop: identifies the shadowDesktop element used by Slides.
16
+ * - notScrollAnimation: identifies the notScrollAnimation element used by Slides.
17
+ * - notScrollWithMouse: identifies the notScrollWithMouse element used by Slides.
18
+ * - buttonIcon: styles the previous and next actions generated at runtime.
19
+ *
20
+ * @api
21
+ * - pgs.slides.init(root): initializes matching elements within the specified root.
22
+ * - pgs.slides.api(element): returns the instance associated with the specified initialized element.
23
+ * - instance.previous(): moves to the previous item.
24
+ * - instance.next(): moves to the next item.
25
+ * - instance.goTo(index): provides the documented operation through the component public API.
26
+ * - instance.getCurrentIndexes(): provides the documented operation through the component public API.
27
+ * - instance.getCurrentElements(): provides the documented operation through the component public API.
28
+ * - instance.getTotal(): returns the total number of items.
29
+ * - instance.isAtStart(): provides the documented operation through the component public API.
30
+ * - instance.isAtEnd(): provides the documented operation through the component public API.
31
+ * - instance.refresh(): refreshes the component and returns its updated instance.
32
+ *
33
+ * @related
34
+ * - card: uses the related card component or utility in this example.
35
+ * - card-img: uses the related card-img component or utility in this example.
36
+ * - imgCover: uses the related imgCover component or utility in this example.
37
+ * - flexColumn: uses the related flexColumn component or utility in this example.
38
+ *
39
+ * @return Complete HTML markup and usage example for Slides.
40
+ */
41
+ -->
42
+
43
+ <div pgs="slides" pgs-option="singleScroll shadowDesktop">
44
+ <ul pgs="slides-container">
45
+ <li>
46
+ <article pgs="card flexColumn">
47
+ <img pgs="card-img imgCover" src="https://placehold.co/800x500?text=Slide+1" alt="Slide 1">
48
+ <div pgs="flexColumn">
49
+ <h3>Slide uno</h3>
50
+ <p>First slide content.</p>
51
+ </div>
52
+ </article>
53
+ </li>
54
+
55
+ <li>
56
+ <article pgs="card flexColumn">
57
+ <img pgs="card-img imgCover" src="https://placehold.co/800x500?text=Slide+2" alt="Slide 2">
58
+ <div pgs="flexColumn">
59
+ <h3>Slide due</h3>
60
+ <p>Second slide content.</p>
61
+ </div>
62
+ </article>
63
+ </li>
64
+
65
+ <li>
66
+ <article pgs="card flexColumn">
67
+ <img pgs="card-img imgCover" src="https://placehold.co/800x500?text=Slide+3" alt="Slide 3">
68
+ <div pgs="flexColumn">
69
+ <h3>Slide tre</h3>
70
+ <p>Third slide content.</p>
71
+ </div>
72
+ </article>
73
+ </li>
74
+ </ul>
75
+ </div>
@@ -0,0 +1,83 @@
1
+ <!--
2
+ /**
3
+ * @title Step Tabs
4
+ * @description Step Tabs markup, configuration, behavior, and usage example.
5
+ *
6
+ * @pgs
7
+ * - stepTabs: identifies the stepTabs element used by Step Tabs.
8
+ * - stepTabs-dots: identifies the stepTabs-dots element used by Step Tabs.
9
+ * - stepTabs-dots-dot: identifies the stepTabs-dots-dot element used by Step Tabs.
10
+ * - stepTabs-container: identifies the stepTabs-container element used by Step Tabs.
11
+ * - tab: identifies the tab element used by Step Tabs.
12
+ * - stepTabs-prev: identifies the stepTabs-prev element used by Step Tabs.
13
+ * - stepTabs-restart: identifies the stepTabs-restart element used by Step Tabs.
14
+ * - stepTabs-next: identifies the stepTabs-next element used by Step Tabs.
15
+ *
16
+ * @pgs-option
17
+ * - tabIcon: identifies the tabIcon element used by Step Tabs.
18
+ * - step: identifies the step element used by Step Tabs.
19
+ * - buttonReverse: identifies the buttonReverse element used by Step Tabs.
20
+ *
21
+ * @pgs-state
22
+ * - is-active: identifies the is-active element used by Step Tabs.
23
+ * - is-completed: identifies the is-completed element used by Step Tabs.
24
+ * - is-locked: identifies the is-locked element used by Step Tabs.
25
+ *
26
+ * @api
27
+ * - pgs.stepTabs.init(root): initializes matching elements within the specified root.
28
+ * - pgs.stepTabs.api(element): returns the instance associated with the specified initialized element.
29
+ * - instance.restart(): torna al primo tab e ripristina i blocchi dichiarati inizialmente.
30
+ * - instance.goTo(index, scroll): provides the documented operation through the component public API.
31
+ * - instance.next(): moves to the next item.
32
+ * - instance.prev(): moves to the previous item.
33
+ * - instance.toggleLock(index, lock): provides the documented operation through the component public API.
34
+ * - instance.refresh(): refreshes the component and returns its updated instance.
35
+ * - instance.getCurrent(): provides the documented operation through the component public API.
36
+ * - instance.getState(): provides the documented operation through the component public API.
37
+ *
38
+ * @related
39
+ * - flexColumn: uses the related flexColumn component or utility in this example.
40
+ * - gapElements: applies element spacing to the step tab container.
41
+ * - flexRow: uses the related flexRow component or utility in this example.
42
+ * - button: uses the related button component or utility in this example.
43
+ *
44
+ * @return Complete HTML markup and usage example for Step Tabs.
45
+ */
46
+ -->
47
+
48
+ <div pgs="stepTabs flexColumn gapElements">
49
+ <div pgs="stepTabs-dots" aria-label="Avanzamento"></div>
50
+
51
+ <div pgs="stepTabs-container">
52
+ <section pgs="tab flexColumn" tabindex="-1" pgs-option="tabIcon[fa-user]">
53
+ <h3>Personal details</h3>
54
+ <p>First tab content.</p>
55
+ </section>
56
+
57
+ <section pgs="tab flexColumn" tabindex="-1" pgs-option="tabIcon[fa-list-check]">
58
+ <h3>Preferences</h3>
59
+ <p>Second tab content.</p>
60
+ </section>
61
+
62
+ <section pgs="tab flexColumn" tabindex="-1" pgs-option="tabIcon[fa-check]">
63
+ <h3>Confirmation</h3>
64
+ <p>Third tab content.</p>
65
+ </section>
66
+ </div>
67
+
68
+ <div pgs="flexRow">
69
+ <button pgs="stepTabs-prev button" type="button">
70
+ <i class="fa-solid fa-arrow-left" aria-hidden="true"></i>
71
+ Back
72
+ </button>
73
+
74
+ <button pgs="stepTabs-restart button" type="button">
75
+ Ricomincia
76
+ </button>
77
+
78
+ <button pgs="stepTabs-next button" pgs-option="buttonReverse" type="button">
79
+ Next
80
+ <i class="fa-solid fa-arrow-right" aria-hidden="true"></i>
81
+ </button>
82
+ </div>
83
+ </div>
@@ -0,0 +1,49 @@
1
+ <!--
2
+ /**
3
+ * @title Steps
4
+ * @description Ordered list of steps showing a number, content, and connecting line, with missing structural elements added at runtime.
5
+ *
6
+ * @pgs
7
+ * - steps: identifies the ordered list initialized by the steps module.
8
+ * - steps-step: identifies each step in the sequence.
9
+ * - steps-step-circle: identifies the numeric indicator, which is created automatically when missing.
10
+ * - steps-step-content: identifies the text content of the step.
11
+ * - steps-step-line: identifies the connecting line dynamically added to each step.
12
+ *
13
+ * @api
14
+ * - pgs.steps.init(root): initializes unregistered step lists within the specified Document or Element.
15
+ * - pgs.steps.api(element): returns the instance associated with an initialized steps root.
16
+ * - instance.steps(): returns an array containing every steps-step element.
17
+ * - instance.getStep(index): returns the step at the specified index.
18
+ * - instance.getTotal(): returns the total number of steps.
19
+ * - instance.refresh(): reinitializes the list, recreates missing elements, and returns the new instance.
20
+ *
21
+ * @return Ordered HTML list of numbered steps completed by the JavaScript module.
22
+ */
23
+ -->
24
+
25
+ <ol pgs="steps">
26
+ <li pgs="steps-step">
27
+ <span pgs="steps-step-circle">1</span>
28
+ <div pgs="steps-step-content">
29
+ <h3>Primo step</h3>
30
+ <p>Descrizione del primo passaggio.</p>
31
+ </div>
32
+ </li>
33
+
34
+ <li pgs="steps-step">
35
+ <span pgs="steps-step-circle">2</span>
36
+ <div pgs="steps-step-content">
37
+ <h3>Secondo step</h3>
38
+ <p>Descrizione del secondo passaggio.</p>
39
+ </div>
40
+ </li>
41
+
42
+ <li pgs="steps-step">
43
+ <span pgs="steps-step-circle">3</span>
44
+ <div pgs="steps-step-content">
45
+ <h3>Terzo step</h3>
46
+ <p>Descrizione del terzo passaggio.</p>
47
+ </div>
48
+ </li>
49
+ </ol>
@@ -0,0 +1,41 @@
1
+ <!--
2
+ /**
3
+ * @title Summary
4
+ * @description Summary markup, configuration, behavior, and usage example.
5
+ *
6
+ * @pgs
7
+ * - summary: identifies the summary element used by Summary.
8
+ * - summary-content: identifies the summary-content element used by Summary.
9
+ * - summary-button: identifies the summary-button element used by Summary.
10
+ *
11
+ * @pgs-state
12
+ * - overflow: identifies the overflow element used by Summary.
13
+ * - open: identifies the open element used by Summary.
14
+ *
15
+ * @api
16
+ * - pgs.summary.init(root): initializes matching elements within the specified root.
17
+ * - pgs.summary.api(element): returns the instance associated with the specified initialized element.
18
+ * - instance.open(): opens the component.
19
+ * - instance.close(): closes the component.
20
+ * - instance.toggle(): toggles the component state.
21
+ * - instance.refresh(): refreshes the component and returns its updated instance.
22
+ * - instance.isOpen(): returns true when the component is open.
23
+ *
24
+ * @return Complete HTML markup and usage example for Summary.
25
+ */
26
+ -->
27
+
28
+ <div pgs="summary">
29
+ <div pgs="summary-content">
30
+ <p>
31
+ This demonstration text is long enough to span multiple lines and show the summary component behavior. Content can include text, links, and other inline elements without requiring additional markup.
32
+ </p>
33
+ <p>
34
+ When content exceeds three lines, a button is shown to expand or collapse the visible area.
35
+ </p>
36
+ </div>
37
+
38
+ <button pgs="summary-button" type="button">
39
+ Show more
40
+ </button>
41
+ </div>
@@ -1,12 +1,12 @@
1
1
  <!--
2
2
  /**
3
3
  * @title Table
4
- * @description Contenitore responsive per una tabella semantica con intestazioni e righe di dati coerenti con gli stili del design system.
4
+ * @description Responsive container for a semantic table with headers and data rows consistent with the design system styles.
5
5
  *
6
6
  * @pgs
7
- * - table: identifica il wrapper che gestisce presentazione e scorrimento della tabella nativa.
7
+ * - table: identifies the wrapper that manages presentation and scrolling for the native table.
8
8
  *
9
- * @return Tabella HTML completa racchiusa nel contenitore PGS dedicato.
9
+ * @return Complete HTML table wrapped in the dedicated PGS container.
10
10
  */
11
11
  -->
12
12
 
@@ -14,7 +14,7 @@
14
14
  <table>
15
15
  <thead>
16
16
  <tr>
17
- <th>Nome</th>
17
+ <th>Name</th>
18
18
  <th>Stato</th>
19
19
  <th>Data</th>
20
20
  </tr>
@@ -23,7 +23,7 @@
23
23
  <tbody>
24
24
  <tr>
25
25
  <td>Elemento uno</td>
26
- <td>Attivo</td>
26
+ <td>Active</td>
27
27
  <td>2026-01-01</td>
28
28
  </tr>
29
29
  <tr>
@@ -0,0 +1,44 @@
1
+ <!--
2
+ /**
3
+ * @title Tooltip
4
+ * @description Tooltip markup, configuration, behavior, and usage example.
5
+ *
6
+ * @pgs
7
+ * - tooltip: identifies the tooltip element used by Tooltip.
8
+ * - tooltip-button: identifies the tooltip-button element used by Tooltip.
9
+ * - tooltip-content: identifies the tooltip-content element used by Tooltip.
10
+ *
11
+ * @pgs-option
12
+ * - position: identifies the position element used by Tooltip.
13
+ * - buttonMini: applies the smallest button variant to the tooltip trigger.
14
+ *
15
+ * @pgs-state
16
+ * - open: identifies the open element used by Tooltip.
17
+ *
18
+ * @api
19
+ * - pgs.dropdown.init(root): initializes matching elements within the specified root.
20
+ * - pgs.dropdown.api(element): returns the instance associated with the specified initialized element.
21
+ * - instance.open(): opens the component.
22
+ * - instance.close(): closes the component.
23
+ * - instance.toggle(): toggles the component state.
24
+ * - instance.refresh(): refreshes the component and returns its updated instance.
25
+ * - instance.isOpen(): returns true when the component is open.
26
+ *
27
+ * @related
28
+ * - button: provides the base styling for the tooltip trigger.
29
+ * - dropdown: uses the related dropdown component or utility in this example.
30
+ * - dropdown-button: uses the related dropdown-button component or utility in this example.
31
+ * - dropdown-content: uses the related dropdown-content component or utility in this example.
32
+ *
33
+ * @return Complete HTML markup and usage example for Tooltip.
34
+ */
35
+ -->
36
+
37
+ <span pgs="dropdown tooltip">
38
+ <button pgs="dropdown-button button tooltip-button" pgs-option="buttonMini" title="open-tooltip" type="button">
39
+ <i class="fa-solid fa-info"></i>
40
+ </button>
41
+ <div pgs="dropdown-content tooltip-content">
42
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto hic, id consectetur facilis et, iste animi minima quidem praesentium omnis quod. Quidem provident ad cum aut reprehenderit laboriosam eum placeat.
43
+ </div>
44
+ </span>
@@ -0,0 +1,34 @@
1
+ <!--
2
+ /**
3
+ * @title Body
4
+ * @description Base HTML document that enables MyPGS, configures essential metadata, and applies shared background, text, and heading variants to the body.
5
+ *
6
+ * @pgs
7
+ * - htmlBase: applies the fundamental rules to the html element.
8
+ * - initP: enables layout, component, and pattern styles scoped to the MyPGS namespace.
9
+ * - bodyBase: applies the base structure and spacing to the body.
10
+ * - bodyImg: enables shared rules for images contained in the page.
11
+ * - bodyText: enables text typography and spacing.
12
+ * - bodyHeading: enables the typographic heading hierarchy.
13
+ *
14
+ * @pgs-state
15
+ * - darkmode: is applied dynamically to html and body to activate the dark theme.
16
+ *
17
+ * @return Complete HTML skeleton required to initialize the MyPGS library.
18
+ */
19
+ -->
20
+
21
+ <!DOCTYPE html>
22
+ <html lang="it-IT" pgs="htmlBase initP">
23
+
24
+ <head>
25
+ <meta charset="UTF-8">
26
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
27
+
28
+ <!-- Colori Browsers -->
29
+ <meta name="theme-color" content="">
30
+ <meta name="apple-mobile-web-app-status-bar-color" content="">
31
+
32
+ </head>
33
+
34
+ <body pgs="bodyBase bodyImg bodyText bodyHeading" >
@@ -0,0 +1,67 @@
1
+ <!--
2
+ /**
3
+ * @title Footer
4
+ * @description Complete footer with theme control, brand area, navigation, informational content, and a link to cookie preferences.
5
+ *
6
+ * @pgs
7
+ * - footer: identifies the main footer container.
8
+ * - footer-top: identifies the upper section containing the brand and content.
9
+ * - footer-top-content: identifies the responsive inner layout of the upper section.
10
+ * - footer-brand: identifies the group dedicated to the brand.
11
+ * - footer-brand-motto: identifies the descriptive text associated with the brand.
12
+ * - footer-content: identifies an informational footer column.
13
+ * - footer-legal: identifies the lower section dedicated to legal information.
14
+ * - footer-legal-content: identifies the content of the legal section.
15
+ *
16
+ * @pgs-option
17
+ * - column-3: configures the footer flex layout with three columns.
18
+ *
19
+ * @related
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
+ * - flexRow: 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
+ * @return Complete footer HTML structure with brand, menu, and legal area.
29
+ */
30
+ -->
31
+
32
+ <footer pgs="footer">
33
+ <button pgs="button toggleDarkmode" type="button" aria-label="Change theme">
34
+ <i class="fa-solid fa-moon"></i>
35
+ </button>
36
+
37
+ <section pgs="footer-top section">
38
+ <div pgs="footer-top-content flexRow" pgs-option="column-3">
39
+ <div pgs="footer-brand">
40
+ <a aria-label="Logo" pgs="logo" href="/">
41
+ <span pgs="logo-text">MyPGS</span>
42
+ </a>
43
+ <p pgs="footer-brand-motto">Componenti frontend riutilizzabili.</p>
44
+ </div>
45
+
46
+ <div pgs="footer-content">
47
+ <h2>Menu</h2>
48
+ <nav aria-label="Menu footer">
49
+ <ul>
50
+ <li><a href="/">Home</a></li>
51
+ <li><a href="/contatti">Contatti</a></li>
52
+ </ul>
53
+ </nav>
54
+ </div>
55
+ </div>
56
+ </section>
57
+
58
+ <section pgs="footer-legal section">
59
+ <div pgs="footer-legal-content">
60
+ <button type="button" pgs="button cookieConsent-actionOpen">Cookie preferences</button>
61
+ <p><a href="">Privacy Policy</a></p>
62
+ <p><a href="">Cookie Policy</a></p>
63
+ <p><a href="">Termini e Condizioni</a></p>
64
+ <p>© 2026 MyPgs. No rights reserved.</p>
65
+ </div>
66
+ </section>
67
+ </footer>
@@ -0,0 +1,108 @@
1
+ <!--
2
+ /**
3
+ * @title Header
4
+ * @description Responsive header that measures available space, switches between desktop and mobile content, and integrates menus, dark mode, and modal navigation.
5
+ *
6
+ * @pgs
7
+ * - header: identifies the main header observed by the JavaScript module.
8
+ * - header-element: identifies the inner group measured to determine the switch to mobile mode.
9
+ * - header-element-alwaysOn: identifies the initial area that is always visible.
10
+ * - header-element-onlyDesktop: identifies content shown only while the desktop menu is active.
11
+ * - header-element-onlyMobile: identifies content shown only in mobile mode.
12
+ * - header-element-alwaysOnLast: identifies the final area that is always visible.
13
+ * - header-element-hamburger: identifies the mobile navigation group.
14
+ * - header-element-hamburger-button: identifies the header-specific hamburger control.
15
+ *
16
+ * @pgs-option
17
+ * - horizontal: arranges the related desktop menu horizontally.
18
+ * - vertical: arranges the related mobile menu vertically.
19
+ * - menuHeader: adapts both menus to the header context.
20
+ * - containerPGS: uses containerPGS[header] on the modal wrapper to move the dialog into the header.
21
+ * - right: presents the mobile navigation dialog content from the right side.
22
+ * - buttonIcon: presents theme and hamburger controls as icon buttons.
23
+ *
24
+ * @pgs-state
25
+ * - mobileActive: is applied to header and header-element when their width or the viewport requires mobile navigation.
26
+ *
27
+ * @related
28
+ * - button: provides the base styling for header controls.
29
+ * - logo: inserts the brand into the initial area.
30
+ * - logo-text: uses the text variant of the logo.
31
+ * - menu: provides desktop and mobile navigation.
32
+ * - toggleDarkmode: connects the control to the global theme handler.
33
+ * - modal: provides opening and closing behavior for mobile navigation.
34
+ * - modal-button: opens the mobile panel.
35
+ * - modal-close: closes the mobile panel and shares the hamburger control.
36
+ * - modal-dialog: identifies the mobile navigation dialog.
37
+ * - modal-dialog-content: identifies the inner mobile navigation panel.
38
+ *
39
+ * @return Complete header HTML with desktop navigation and a side mobile panel.
40
+ */
41
+ -->
42
+
43
+ <header pgs="header">
44
+ <div pgs="header-element">
45
+ <div pgs="header-element-alwaysOn">
46
+ <a aria-label="Logo" pgs="logo" href="/">
47
+ <span pgs="logo-text">MyPGS</span>
48
+ </a>
49
+ </div>
50
+
51
+ <div pgs="header-element-onlyDesktop">
52
+ <nav pgs="menu" pgs-option="horizontal menuHeader" aria-label="Main menu">
53
+ <ul>
54
+ <li><a href="/">Home</a></li>
55
+ <li><a href="#components">Components</a></li>
56
+ <li><a href="#layout">Layout</a></li>
57
+ </ul>
58
+ </nav>
59
+ </div>
60
+
61
+ <div pgs="header-element-onlyMobile">
62
+ </div>
63
+
64
+ <div pgs="header-element-alwaysOnLast">
65
+ <button pgs="button toggleDarkmode" pgs-option="buttonIcon" type="button" aria-label="Change theme">
66
+ <i class="fa-solid fa-moon"></i>
67
+ </button>
68
+ </div>
69
+
70
+ <div pgs="header-element-hamburger modal" pgs-option="containerPGS[header] ">
71
+
72
+ <button pgs="button modal-button modal-close header-element-hamburger-button" pgs-option="buttonIcon" type="button"></button>
73
+
74
+ <dialog pgs="modal-dialog" pgs-option="right">
75
+ <div pgs="modal-dialog-content">
76
+ <nav pgs="menu" pgs-option="vertical menuHeader" aria-label="Mobile menu">
77
+ <ul>
78
+ <li><a href="/">Home</a></li>
79
+ <li><a href="#components">Components</a></li>
80
+ <li><a href="#layout">Layout</a></li>
81
+ </ul>
82
+ </nav>
83
+ </div>
84
+ </dialog>
85
+ </div>
86
+ </div>
87
+
88
+ <!-- //# HEADER BOTTOM -->
89
+
90
+ <script>
91
+ const addPgsState = (element, state) => {
92
+ if (!element) return;
93
+
94
+ const states = element.getAttribute("pgs-state")?.split(/\s+/) ?? [];
95
+ element.setAttribute("pgs-state", [...new Set([...states, state])].join(" "));
96
+ };
97
+
98
+ if (localStorage.getItem("screenIsDarkMode") === "true") {
99
+ addPgsState(document.documentElement, "darkmode");
100
+ addPgsState(document.body, "darkmode");
101
+ }
102
+
103
+ if (window.innerWidth < 600) {
104
+ addPgsState(document.querySelector("header"), "mobileActive");
105
+ addPgsState(document.querySelector("[pgs~=header-element]"), "mobileActive");
106
+ }
107
+ </script>
108
+ </header>