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
@@ -0,0 +1,81 @@
1
+ <!-- Automatically generated from templates/html/components/notification.html. Edit templates/html/components/notification.html and run npm run docs:generate again. -->
2
+
3
+ # Notification
4
+
5
+ Notification markup, configuration, behavior, and usage example.
6
+
7
+ ## PGS
8
+
9
+ - `notification`: identifies the notification element used by Notification.
10
+ - `notificationTrigger`: identifies the notificationTrigger element used by Notification.
11
+ - `notification-element`: identifies the notification-element element used by Notification.
12
+ - `notification-element-title`: identifies the notification-element-title element used by Notification.
13
+ - `notification-element-content`: identifies the notification-element-content element used by Notification.
14
+
15
+ ## PGS Options
16
+
17
+ - `toast`: identifies the toast element used by Notification.
18
+ - `notification`: identifies the notification element used by Notification.
19
+
20
+ ## PGS States
21
+
22
+ - `success`: identifies the success element used by Notification.
23
+ - `error`: identifies the error element used by Notification.
24
+ - `warning`: identifies the warning element used by Notification.
25
+ - `info`: identifies the info element used by Notification.
26
+
27
+ ## JavaScript API
28
+
29
+ - `pgs.notification.trigger(root)`: provides the documented operation through the component public API.
30
+ - `pgs.notification.alert.error(text, link, timeout, icon)`: provides the documented operation through the component public API.
31
+ - `pgs.notification.alert.success(text, link, timeout, icon)`: provides the documented operation through the component public API.
32
+ - `pgs.notification.alert.info(text, link, timeout, icon)`: provides the documented operation through the component public API.
33
+ - `pgs.notification.alert.warning(text, link, timeout, icon)`: provides the documented operation through the component public API.
34
+ - `pgs.notification.alert.deleteAll()`: provides the documented operation through the component public API.
35
+ - `pgs.notification.toast.error(text, timeout, icon)`: provides the documented operation through the component public API.
36
+ - `pgs.notification.toast.success(text, timeout, icon)`: provides the documented operation through the component public API.
37
+ - `pgs.notification.toast.info(text, timeout, icon)`: provides the documented operation through the component public API.
38
+ - `pgs.notification.toast.warning(text, timeout, icon)`: provides the documented operation through the component public API.
39
+ - `pgs.notification.toast.deleteAll()`: provides the documented operation through the component public API.
40
+
41
+ ## Related elements
42
+
43
+ - `hidden`: uses the related hidden component or utility in this example.
44
+ - `buttonClose`: uses the related buttonClose component or utility in this example.
45
+
46
+ ## Output
47
+
48
+ Complete HTML markup and usage example for Notification.
49
+
50
+ ## Example
51
+
52
+ ```html
53
+ <div pgs="notification" aria-live="polite"></div>
54
+ <div pgs="notification" pgs-option="toast" aria-live="polite"></div>
55
+
56
+ <div pgs="hidden notificationTrigger" pgs-option='notification[{
57
+ "title": "Title",
58
+ "message": "Message",
59
+ "element": "notification",
60
+ "type": "info",
61
+ "icon": null,
62
+ "duration": "-1",
63
+ "link": null
64
+ }]'></div>
65
+
66
+ <div pgs="hidden notificationTrigger" pgs-option='notification[{
67
+ "title": "Benvenuto",
68
+ "message": "Message",
69
+ "element": "toast",
70
+ "type": "info",
71
+ "icon": null,
72
+ "duration": "3000",
73
+ "link": null
74
+ }]'></div>
75
+ <!--
76
+ <div
77
+ pgs="hidden notificationTrigger"
78
+ pgs-option='notification[{"title":"Title","message":"Message","element":"notification","type":"info","icon":"<i class=\"fa-solid fa-rocket\"></i>","duration":"4000","link":"/page/"}]'>
79
+ </div>
80
+ -->
81
+ ```
@@ -0,0 +1,118 @@
1
+ <!-- Automatically generated from templates/html/components/search.html. Edit templates/html/components/search.html and run npm run docs:generate again. -->
2
+
3
+ # Search
4
+
5
+ Search markup, configuration, behavior, and usage example.
6
+
7
+ ## PGS
8
+
9
+ - `search`: identifies the search element used by Search.
10
+ - `search-suggestions`: identifies the search-suggestions element used by Search.
11
+ - `search-suggestions-item`: identifies the search-suggestions-item element used by Search.
12
+ - `search-modal`: identifies the search-modal element used by Search.
13
+ - `search-mobile`: identifies the search-mobile element used by Search.
14
+
15
+ ## PGS Options
16
+
17
+ - `containerPGS`: identifies the containerPGS element used by Search.
18
+
19
+ ## PGS States
20
+
21
+ - `open`: identifies the open element used by Search.
22
+ - `loading`: identifies the loading element used by Search.
23
+ - `error`: identifies the error element used by Search.
24
+ - `selected`: identifies the selected element used by Search.
25
+
26
+ ## JavaScript API
27
+
28
+ - `pgs.search.init(root)`: initializes matching elements within the specified root.
29
+ - `pgs.search.api(element)`: returns the instance associated with the specified initialized element.
30
+ - `instance.configure(options)`: provides the documented operation through the component public API.
31
+ - `instance.setSource(source)`: provides the documented operation through the component public API.
32
+ - `instance.search(query)`: provides the documented operation through the component public API.
33
+ - `instance.open()`: opens the component.
34
+ - `instance.close()`: closes the component.
35
+ - `instance.clear()`: provides the documented operation through the component public API.
36
+ - `instance.cancel()`: annulla debounce e richiesta attiva.
37
+ - `instance.select(index, submit)`: provides the documented operation through the component public API.
38
+ - `instance.refresh()`: refreshes the component and returns its updated instance.
39
+ - `instance.destroy()`: removes listeners and releases the component instance.
40
+ - `instance.items()`: provides the documented operation through the component public API.
41
+ - `instance.isOpen()`: returns true when the component is open.
42
+ - `instance.isLoading()`: returns true while the component is loading.
43
+ - `instance.setActiveIndex(index)`: provides the documented operation through the component public API.
44
+
45
+ ## Related elements
46
+
47
+ - `buttonNohover`: uses the related buttonNohover component or utility in this example.
48
+ - `modal`: uses the related modal component or utility in this example.
49
+ - `modal-button`: uses the related modal-button component or utility in this example.
50
+ - `modal-close`: uses the related modal-close component or utility in this example.
51
+ - `buttonIcon`: uses the related buttonIcon component or utility in this example.
52
+ - `flexRow`: uses the related flexRow component or utility in this example.
53
+ - `section`: uses the related section component or utility in this example.
54
+
55
+ ## Output
56
+
57
+ Complete HTML markup and usage example for Search.
58
+
59
+ ## Example
60
+
61
+ ```html
62
+ <form pgs="buttonNohover search" autocomplete="off" action="" method="get">
63
+ <button type="submit" title="Search"><i class="fa-solid fa-search"></i></button>
64
+ <input type="search" name="s" placeholder="Search" value="">
65
+ <ul pgs="search-suggestions"></ul>
66
+ </form>
67
+
68
+ <div pgs="modal search-modal" pgs-option="containerPGS[header]">
69
+
70
+ <button type="button" pgs="modal-button buttonIcon" title="Search">
71
+ <i class="fa-solid fa-search"></i>
72
+ </button>
73
+
74
+ <dialog>
75
+ <div pgs="flexRow section search-mobile">
76
+
77
+ <form pgs="buttonNohover search" autocomplete="off" action="/" method="get">
78
+ <button type="submit" title="Search">
79
+ <i class="fa-solid fa-search"></i>
80
+ </button>
81
+
82
+ <input type="search" name="s" placeholder="Search" value="">
83
+ <ul pgs="search-suggestions"></ul>
84
+
85
+ <button type="button" pgs="modal-close buttonIcon">
86
+ <i class="fa-solid fa-close"></i>
87
+ </button>
88
+ </form>
89
+
90
+
91
+ </div>
92
+ </dialog>
93
+ </div>
94
+
95
+ <script type="module">
96
+ import { pgs } from "mypgs";
97
+
98
+ const components = [
99
+ { label: "Accordion", value: "/componenti/accordion", data: { category: "component" } },
100
+ { label: "Dropdown", value: "/componenti/dropdown", data: { category: "component" } },
101
+ { label: "Modal", value: "/componenti/modal", data: { category: "component" } },
102
+ { label: "Search", value: "/componenti/search", data: { category: "component" } },
103
+ { label: "Page Shell", value: "/layout/page-shell", data: { category: "layout" } },
104
+ ];
105
+
106
+ pgs(document).querySelectorAll("search").forEach(search => {
107
+ pgs.search.api(search)?.configure({
108
+ minLength: 1,
109
+ debounce: 150,
110
+ limit: 5,
111
+ source: components,
112
+ onSelect: ({ item, value }) => {
113
+ console.log(`Selezionato ${item.label}: ${value}`);
114
+ },
115
+ });
116
+ });
117
+ </script>
118
+ ```
@@ -0,0 +1,85 @@
1
+ <!-- Automatically generated from templates/html/components/slides.html. Edit templates/html/components/slides.html and run npm run docs:generate again. -->
2
+
3
+ # Slides
4
+
5
+ Slides markup, configuration, behavior, and usage example.
6
+
7
+ ## PGS
8
+
9
+ - `slides`: identifies the slides element used by Slides.
10
+ - `slides-container`: identifies the slides-container element used by Slides.
11
+ - `slides-prec`: identifies the slides-prec element used by Slides.
12
+ - `slides-next`: identifies the slides-next element used by Slides.
13
+ - `slides-dots`: identifies the slides-dots element used by Slides.
14
+
15
+ ## PGS Options
16
+
17
+ - `singleScroll`: identifies the singleScroll element used by Slides.
18
+ - `shadowDesktop`: identifies the shadowDesktop element used by Slides.
19
+ - `notScrollAnimation`: identifies the notScrollAnimation element used by Slides.
20
+ - `notScrollWithMouse`: identifies the notScrollWithMouse element used by Slides.
21
+
22
+ ## JavaScript API
23
+
24
+ - `pgs.slides.init(root)`: initializes matching elements within the specified root.
25
+ - `pgs.slides.api(element)`: returns the instance associated with the specified initialized element.
26
+ - `instance.previous()`: moves to the previous item.
27
+ - `instance.next()`: moves to the next item.
28
+ - `instance.goTo(index)`: provides the documented operation through the component public API.
29
+ - `instance.getCurrentIndexes()`: provides the documented operation through the component public API.
30
+ - `instance.getCurrentElements()`: provides the documented operation through the component public API.
31
+ - `instance.getTotal()`: returns the total number of items.
32
+ - `instance.isAtStart()`: provides the documented operation through the component public API.
33
+ - `instance.isAtEnd()`: provides the documented operation through the component public API.
34
+ - `instance.refresh()`: refreshes the component and returns its updated instance.
35
+
36
+ ## Related elements
37
+
38
+ - `card`: uses the related card component or utility in this example.
39
+ - `card-img`: uses the related card-img component or utility in this example.
40
+ - `imgCover`: uses the related imgCover component or utility in this example.
41
+ - `flexColumn`: uses the related flexColumn component or utility in this example.
42
+ - `flexColumnTexts`: uses the related flexColumnTexts component or utility in this example.
43
+ - `buttonIcon`: uses the related buttonIcon component or utility in this example.
44
+
45
+ ## Output
46
+
47
+ Complete HTML markup and usage example for Slides.
48
+
49
+ ## Example
50
+
51
+ ```html
52
+ <div pgs="slides" pgs-option="singleScroll shadowDesktop">
53
+ <ul pgs="slides-container">
54
+ <li>
55
+ <article pgs="card flexColumn">
56
+ <img pgs="card-img imgCover" src="https://placehold.co/800x500?text=Slide+1" alt="Slide 1">
57
+ <div pgs="flexColumnTexts">
58
+ <h3>Slide uno</h3>
59
+ <p>First slide content.</p>
60
+ </div>
61
+ </article>
62
+ </li>
63
+
64
+ <li>
65
+ <article pgs="card flexColumn">
66
+ <img pgs="card-img imgCover" src="https://placehold.co/800x500?text=Slide+2" alt="Slide 2">
67
+ <div pgs="flexColumnTexts">
68
+ <h3>Slide due</h3>
69
+ <p>Second slide content.</p>
70
+ </div>
71
+ </article>
72
+ </li>
73
+
74
+ <li>
75
+ <article pgs="card flexColumn">
76
+ <img pgs="card-img imgCover" src="https://placehold.co/800x500?text=Slide+3" alt="Slide 3">
77
+ <div pgs="flexColumnTexts">
78
+ <h3>Slide tre</h3>
79
+ <p>Third slide content.</p>
80
+ </div>
81
+ </article>
82
+ </li>
83
+ </ul>
84
+ </div>
85
+ ```
@@ -0,0 +1,93 @@
1
+ <!-- Automatically generated from templates/html/components/stepTabs.html. Edit templates/html/components/stepTabs.html and run npm run docs:generate again. -->
2
+
3
+ # Step Tabs
4
+
5
+ Step Tabs markup, configuration, behavior, and usage example.
6
+
7
+ ## PGS
8
+
9
+ - `stepTabs`: identifies the stepTabs element used by Step Tabs.
10
+ - `stepTabs-dots`: identifies the stepTabs-dots element used by Step Tabs.
11
+ - `stepTabs-dots-dot`: identifies the stepTabs-dots-dot element used by Step Tabs.
12
+ - `stepTabs-container`: identifies the stepTabs-container element used by Step Tabs.
13
+ - `tab`: identifies the tab element used by Step Tabs.
14
+ - `stepTabs-prev`: identifies the stepTabs-prev element used by Step Tabs.
15
+ - `stepTabs-restart`: identifies the stepTabs-restart element used by Step Tabs.
16
+ - `stepTabs-next`: identifies the stepTabs-next element used by Step Tabs.
17
+
18
+ ## PGS Options
19
+
20
+ - `tabIcon`: identifies the tabIcon element used by Step Tabs.
21
+ - `step`: identifies the step element used by Step Tabs.
22
+ - `buttonReverse`: identifies the buttonReverse element used by Step Tabs.
23
+
24
+ ## PGS States
25
+
26
+ - `is-active`: identifies the is-active element used by Step Tabs.
27
+ - `is-completed`: identifies the is-completed element used by Step Tabs.
28
+ - `is-locked`: identifies the is-locked element used by Step Tabs.
29
+
30
+ ## JavaScript API
31
+
32
+ - `pgs.stepTabs.init(root)`: initializes matching elements within the specified root.
33
+ - `pgs.stepTabs.api(element)`: returns the instance associated with the specified initialized element.
34
+ - `instance.restart()`: torna al primo tab e ripristina i blocchi dichiarati inizialmente.
35
+ - `instance.goTo(index, scroll)`: provides the documented operation through the component public API.
36
+ - `instance.next()`: moves to the next item.
37
+ - `instance.prev()`: moves to the previous item.
38
+ - `instance.toggleLock(index, lock)`: provides the documented operation through the component public API.
39
+ - `instance.refresh()`: refreshes the component and returns its updated instance.
40
+ - `instance.getCurrent()`: provides the documented operation through the component public API.
41
+ - `instance.getState()`: provides the documented operation through the component public API.
42
+
43
+ ## Related elements
44
+
45
+ - `flexColumnElements`: uses the related flexColumnElements component or utility in this example.
46
+ - `flexColumnTexts`: uses the related flexColumnTexts component or utility in this example.
47
+ - `flexRow`: uses the related flexRow component or utility in this example.
48
+ - `button`: uses the related button component or utility in this example.
49
+
50
+ ## Output
51
+
52
+ Complete HTML markup and usage example for Step Tabs.
53
+
54
+ ## Example
55
+
56
+ ```html
57
+ <div pgs="stepTabs flexColumnElements">
58
+ <div pgs="stepTabs-dots" aria-label="Avanzamento"></div>
59
+
60
+ <div pgs="stepTabs-container">
61
+ <section pgs="tab flexColumnTexts" tabindex="-1" pgs-option="tabIcon[fa-user]">
62
+ <h3>Personal details</h3>
63
+ <p>First tab content.</p>
64
+ </section>
65
+
66
+ <section pgs="tab flexColumnTexts" tabindex="-1" pgs-option="tabIcon[fa-list-check]">
67
+ <h3>Preferences</h3>
68
+ <p>Second tab content.</p>
69
+ </section>
70
+
71
+ <section pgs="tab flexColumnTexts" tabindex="-1" pgs-option="tabIcon[fa-check]">
72
+ <h3>Confirmation</h3>
73
+ <p>Third tab content.</p>
74
+ </section>
75
+ </div>
76
+
77
+ <div pgs="flexRow">
78
+ <button pgs="stepTabs-prev button" type="button">
79
+ <i class="fa-solid fa-arrow-left" aria-hidden="true"></i>
80
+ Back
81
+ </button>
82
+
83
+ <button pgs="stepTabs-restart button" type="button">
84
+ Ricomincia
85
+ </button>
86
+
87
+ <button pgs="stepTabs-next button" pgs-option="buttonReverse" type="button">
88
+ Next
89
+ <i class="fa-solid fa-arrow-right" aria-hidden="true"></i>
90
+ </button>
91
+ </div>
92
+ </div>
93
+ ```
@@ -0,0 +1,56 @@
1
+ <!-- Automatically generated from templates/html/components/steps.html. Edit templates/html/components/steps.html and run npm run docs:generate again. -->
2
+
3
+ # Steps
4
+
5
+ Ordered list of steps showing a number, content, and connecting line, with missing structural elements added at runtime.
6
+
7
+ ## PGS
8
+
9
+ - `steps`: identifies the ordered list initialized by the steps module.
10
+ - `steps-step`: identifies each step in the sequence.
11
+ - `steps-step-circle`: identifies the numeric indicator, which is created automatically when missing.
12
+ - `steps-step-content`: identifies the text content of the step.
13
+ - `steps-step-line`: identifies the connecting line dynamically added to each step.
14
+
15
+ ## JavaScript API
16
+
17
+ - `pgs.steps.init(root)`: initializes unregistered step lists within the specified Document or Element.
18
+ - `pgs.steps.api(element)`: returns the instance associated with an initialized steps root.
19
+ - `instance.steps()`: returns an array containing every steps-step element.
20
+ - `instance.getStep(index)`: returns the step at the specified index.
21
+ - `instance.getTotal()`: returns the total number of steps.
22
+ - `instance.refresh()`: reinitializes the list, recreates missing elements, and returns the new instance.
23
+
24
+ ## Output
25
+
26
+ Ordered HTML list of numbered steps completed by the JavaScript module.
27
+
28
+ ## Example
29
+
30
+ ```html
31
+ <ol pgs="steps">
32
+ <li pgs="steps-step">
33
+ <span pgs="steps-step-circle">1</span>
34
+ <div pgs="steps-step-content">
35
+ <h3>Primo step</h3>
36
+ <p>Descrizione del primo passaggio.</p>
37
+ </div>
38
+ </li>
39
+
40
+ <li pgs="steps-step">
41
+ <span pgs="steps-step-circle">2</span>
42
+ <div pgs="steps-step-content">
43
+ <h3>Secondo step</h3>
44
+ <p>Descrizione del secondo passaggio.</p>
45
+ </div>
46
+ </li>
47
+
48
+ <li pgs="steps-step">
49
+ <span pgs="steps-step-circle">3</span>
50
+ <div pgs="steps-step-content">
51
+ <h3>Terzo step</h3>
52
+ <p>Descrizione del terzo passaggio.</p>
53
+ </div>
54
+ </li>
55
+ </ol>
56
+ ```
@@ -0,0 +1,49 @@
1
+ <!-- Automatically generated from templates/html/components/summary.html. Edit templates/html/components/summary.html and run npm run docs:generate again. -->
2
+
3
+ # Summary
4
+
5
+ Summary markup, configuration, behavior, and usage example.
6
+
7
+ ## PGS
8
+
9
+ - `summary`: identifies the summary element used by Summary.
10
+ - `summary-content`: identifies the summary-content element used by Summary.
11
+ - `summary-button`: identifies the summary-button element used by Summary.
12
+
13
+ ## PGS States
14
+
15
+ - `overflow`: identifies the overflow element used by Summary.
16
+ - `open`: identifies the open element used by Summary.
17
+
18
+ ## JavaScript API
19
+
20
+ - `pgs.summary.init(root)`: initializes matching elements within the specified root.
21
+ - `pgs.summary.api(element)`: returns the instance associated with the specified initialized element.
22
+ - `instance.open()`: opens the component.
23
+ - `instance.close()`: closes the component.
24
+ - `instance.toggle()`: toggles the component state.
25
+ - `instance.refresh()`: refreshes the component and returns its updated instance.
26
+ - `instance.isOpen()`: returns true when the component is open.
27
+
28
+ ## Output
29
+
30
+ Complete HTML markup and usage example for Summary.
31
+
32
+ ## Example
33
+
34
+ ```html
35
+ <div pgs="summary">
36
+ <div pgs="summary-content">
37
+ <p>
38
+ 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.
39
+ </p>
40
+ <p>
41
+ When content exceeds three lines, a button is shown to expand or collapse the visible area.
42
+ </p>
43
+ </div>
44
+
45
+ <button pgs="summary-button" type="button">
46
+ Show more
47
+ </button>
48
+ </div>
49
+ ```
@@ -0,0 +1,42 @@
1
+ <!-- Automatically generated from templates/html/components/table.html. Edit templates/html/components/table.html and run npm run docs:generate again. -->
2
+
3
+ # Table
4
+
5
+ Responsive container for a semantic table with headers and data rows consistent with the design system styles.
6
+
7
+ ## PGS
8
+
9
+ - `table`: identifies the wrapper that manages presentation and scrolling for the native table.
10
+
11
+ ## Output
12
+
13
+ Complete HTML table wrapped in the dedicated PGS container.
14
+
15
+ ## Example
16
+
17
+ ```html
18
+ <div pgs="table">
19
+ <table>
20
+ <thead>
21
+ <tr>
22
+ <th>Name</th>
23
+ <th>Stato</th>
24
+ <th>Data</th>
25
+ </tr>
26
+ </thead>
27
+
28
+ <tbody>
29
+ <tr>
30
+ <td>Elemento uno</td>
31
+ <td>Active</td>
32
+ <td>2026-01-01</td>
33
+ </tr>
34
+ <tr>
35
+ <td>Elemento due</td>
36
+ <td>Bozza</td>
37
+ <td>2026-02-01</td>
38
+ </tr>
39
+ </tbody>
40
+ </table>
41
+ </div>
42
+ ```
@@ -0,0 +1,53 @@
1
+ <!-- Automatically generated from templates/html/components/tooltip.html. Edit templates/html/components/tooltip.html and run npm run docs:generate again. -->
2
+
3
+ # Tooltip
4
+
5
+ Tooltip markup, configuration, behavior, and usage example.
6
+
7
+ ## PGS
8
+
9
+ - `tooltip`: identifies the tooltip element used by Tooltip.
10
+ - `tooltip-button`: identifies the tooltip-button element used by Tooltip.
11
+ - `tooltip-content`: identifies the tooltip-content element used by Tooltip.
12
+
13
+ ## PGS Options
14
+
15
+ - `position`: identifies the position element used by Tooltip.
16
+
17
+ ## PGS States
18
+
19
+ - `open`: identifies the open element used by Tooltip.
20
+
21
+ ## JavaScript API
22
+
23
+ - `pgs.dropdown.init(root)`: initializes matching elements within the specified root.
24
+ - `pgs.dropdown.api(element)`: returns the instance associated with the specified initialized element.
25
+ - `instance.open()`: opens the component.
26
+ - `instance.close()`: closes the component.
27
+ - `instance.toggle()`: toggles the component state.
28
+ - `instance.refresh()`: refreshes the component and returns its updated instance.
29
+ - `instance.isOpen()`: returns true when the component is open.
30
+
31
+ ## Related elements
32
+
33
+ - `dropdown`: uses the related dropdown component or utility in this example.
34
+ - `dropdown-button`: uses the related dropdown-button component or utility in this example.
35
+ - `dropdown-content`: uses the related dropdown-content component or utility in this example.
36
+ - `buttonMini`: uses the related buttonMini component or utility in this example.
37
+
38
+ ## Output
39
+
40
+ Complete HTML markup and usage example for Tooltip.
41
+
42
+ ## Example
43
+
44
+ ```html
45
+ <span pgs="dropdown tooltip">
46
+ <button pgs="dropdown-button buttonMini tooltip-button" title="open-tooltip" type="button">
47
+ <i class="fa-solid fa-info"></i>
48
+ </button>
49
+ <div pgs="dropdown-content tooltip-content">
50
+ 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.
51
+ </div>
52
+ </span>
53
+ ```
@@ -1,12 +1,12 @@
1
- # Convenzioni
1
+ # Conventions
2
2
 
3
- - Usa `pgs` come prima scelta per markup, layout, componenti e comportamenti.
4
- - Mantieni coerenti i token tra template, SCSS e JS.
5
- - Usa `pgs-state` per stati runtime.
6
- - Usa `pgs-option` per opzioni dichiarative.
7
- - Preferisci custom properties e mixin a CSS hardcoded.
8
- - Non duplicare componenti gia' presenti nella libreria.
9
- - Non inventare API: verifica i sorgenti in `assets/javascript/`.
10
- - Mantieni in `mypgs` solo stili e comportamenti riutilizzabili.
11
- - Mantieni nel progetto finale le personalizzazioni specifiche del progetto.
12
- - Aggiorna `AGENTS.md` quando introduci pattern importanti.
3
+ - Use `pgs` as the first choice for markup, layouts, components, and behaviors.
4
+ - Keep tokens consistent across templates, SCSS, and JavaScript.
5
+ - Use `pgs-state` for runtime states.
6
+ - Use `pgs-option` for declarative options.
7
+ - Prefer custom properties and mixins to hardcoded CSS.
8
+ - Do not duplicate components that already exist in the library.
9
+ - Do not invent APIs: verify the sources in `assets/javascript/`.
10
+ - Keep only reusable styles and behaviors in `mypgs`.
11
+ - Keep project-specific customizations in the consuming project.
12
+ - Update `AGENTS.md` when introducing important patterns.
@@ -36,7 +36,7 @@ Uso sorgente SCSS:
36
36
 
37
37
  ## Sviluppo
38
38
 
39
- Build una tantum:
39
+ One-time build:
40
40
 
41
41
  ```bash
42
42
  npm run start
@@ -54,7 +54,7 @@ Creare un pacchetto locale:
54
54
  npm pack
55
55
  ```
56
56
 
57
- Flusso consigliato quando modifichi la libreria:
57
+ Recommended workflow when modifying the library:
58
58
 
59
59
  1. modifica i sorgenti in `assets/`;
60
60
  2. aggiorna template o documentazione se cambia il modo d'uso;
@@ -67,7 +67,7 @@ Nota: se la build Webpack fallisce, non modificare manualmente `dist/javascript`
67
67
 
68
68
  ## Aggiungere un nuovo modulo
69
69
 
70
- Esempio componente:
70
+ Component example:
71
71
 
72
72
  ```js
73
73
  export function PGS_myComponent_init(root = document) {