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
@@ -1,34 +1,34 @@
1
1
  <!--
2
2
  /**
3
3
  * @title Dropdown
4
- * @description Componente a comparsa che associa un controllo a un contenuto posizionato rispetto al trigger e gestisce apertura, chiusura, click esterno ed Escape.
4
+ * @description Popup component that connects a control to content positioned relative to its trigger and handles opening, closing, outside clicks, and Escape.
5
5
  *
6
6
  * @pgs
7
- * - dropdown: identifica il contenitore inizializzato dal modulo dropdown.
8
- * - dropdown-button: identifica il controllo che apre o chiude il contenuto.
9
- * - dropdown-content: identifica il pannello posizionato rispetto al controllo.
7
+ * - dropdown: identifies the container initialized by the dropdown module.
8
+ * - dropdown-button: identifies the control that opens or closes the content.
9
+ * - dropdown-content: identifies the panel positioned relative to the control.
10
10
  *
11
11
  * @pgs-option
12
- * - position: configura il root come position[lato allineamento]; lato accetta top, right, bottom o left e l'allineamento compatibile accetta top, right, bottom, left o center. Il valore predefinito è bottom center.
13
- * - buttonReverse: inverte testo e icona sui pulsanti di esempio e appartiene al componente button.
12
+ * - position: configures the root as position[side alignment]; side accepts top, right, bottom, or left, while compatible alignment values are top, right, bottom, left, or center. The default is bottom center.
13
+ * - buttonReverse: reverses text and icon on the example buttons and belongs to the button component.
14
14
  *
15
15
  * @pgs-state
16
- * - open: indica che il dropdown è aperto e che il contenuto è visibile.
16
+ * - open: indicates that the dropdown is open and its content is visible.
17
17
  *
18
18
  * @api
19
- * - pgs.dropdown.init(root): inizializza i dropdown non ancora registrati dentro Document o Element indicato.
20
- * - pgs.dropdown.api(element): restituisce l'istanza associata a un root dropdown inizializzato.
21
- * - instance.open(): apre il dropdown, chiudendo eventuali altri dropdown aperti.
22
- * - instance.close(): chiude il dropdown corrente.
23
- * - instance.toggle(): inverte lo stato aperto o chiuso.
24
- * - instance.refresh(): reinizializza il contesto e ricalcola il posizionamento del contenuto.
25
- * - instance.isOpen(): restituisce true quando il dropdown è aperto.
19
+ * - pgs.dropdown.init(root): initializes unregistered dropdowns within the specified Document or Element.
20
+ * - pgs.dropdown.api(element): returns the instance associated with an initialized dropdown root.
21
+ * - instance.open(): opens the dropdown and closes any other open dropdowns.
22
+ * - instance.close(): closes the current dropdown.
23
+ * - instance.toggle(): toggles between the open and closed states.
24
+ * - instance.refresh(): reinitializes the context and recalculates content positioning.
25
+ * - instance.isOpen(): returns true when the dropdown is open.
26
26
  *
27
27
  * @related
28
- * - flexRow: dispone i diversi esempi di posizionamento sulla stessa riga flessibile.
29
- * - button: applica lo stile standard ai controlli del dropdown.
28
+ * - flexRow: arranges the placement examples on the same flexible row.
29
+ * - button: applies standard styling to dropdown controls.
30
30
  *
31
- * @return Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
31
+ * @return Series of HTML dropdowns demonstrating the supported placement directions.
32
32
  */
33
33
  -->
34
34
 
@@ -41,7 +41,7 @@
41
41
  </button>
42
42
 
43
43
  <div pgs="dropdown-content">
44
- Contenuto bottom center
44
+ bottom center content
45
45
  </div>
46
46
  </span>
47
47
 
@@ -52,7 +52,7 @@
52
52
  </button>
53
53
 
54
54
  <div pgs="dropdown-content">
55
- Contenuto top left
55
+ top left content
56
56
  </div>
57
57
  </span>
58
58
 
@@ -63,7 +63,7 @@
63
63
  </button>
64
64
 
65
65
  <div pgs="dropdown-content">
66
- Contenuto top center
66
+ top center content
67
67
  </div>
68
68
  </span>
69
69
 
@@ -74,7 +74,7 @@
74
74
  </button>
75
75
 
76
76
  <div pgs="dropdown-content">
77
- Contenuto top right
77
+ top right content
78
78
  </div>
79
79
  </span>
80
80
 
@@ -85,7 +85,7 @@
85
85
  </button>
86
86
 
87
87
  <div pgs="dropdown-content">
88
- Contenuto bottom left
88
+ bottom left content
89
89
  </div>
90
90
  </span>
91
91
 
@@ -96,7 +96,7 @@
96
96
  </button>
97
97
 
98
98
  <div pgs="dropdown-content">
99
- Contenuto bottom right
99
+ bottom right content
100
100
  </div>
101
101
  </span>
102
102
 
@@ -107,7 +107,7 @@
107
107
  </button>
108
108
 
109
109
  <div pgs="dropdown-content">
110
- Contenuto left center
110
+ left center content
111
111
  </div>
112
112
  </span>
113
113
 
@@ -118,7 +118,7 @@
118
118
  </button>
119
119
 
120
120
  <div pgs="dropdown-content">
121
- Contenuto right center
121
+ right center content
122
122
  </div>
123
123
  </span>
124
124
 
@@ -0,0 +1,128 @@
1
+ <!--
2
+ /**
3
+ * @title Form
4
+ * @description Form structure with labels, text fields, a textarea, a checkbox, and a radio group compatible with HTML constraints and custom PGS_formValidate rules.
5
+ *
6
+ * @pgs
7
+ * - form: identifies the form container and applies the field layout.
8
+ * - formValidate: enables styles associated with validation states managed by the JavaScript utility.
9
+ * - label: identifies labels associated with controls.
10
+ * - input: applies shared styling to text inputs.
11
+ * - textarea: applies shared styling to the text area.
12
+ * - radio: styles a group of native radio inputs while preserving their shared name and selection behavior.
13
+ *
14
+ * @pgs-option
15
+ * - message: defines a field-specific message with the syntax message[Message text].
16
+ * - error: is applied at runtime to the form and fields that fail validation.
17
+ * - success: is applied at runtime to the form after successful validation.
18
+ * - buttonStrong: presents form submission as the primary action.
19
+ *
20
+ * @api
21
+ * - new pgs.formValidate(form, options): creates a utility associated directly with the form, automatically adds novalidate, and accepts fieldError, fieldsError, and success in options.message; messages remain editable through instance.message.
22
+ * - instance.validator(callback, eventName): intercepts the specified event, prevents its default behavior, validates the form, shows the success message, and invokes callback only when valid; eventName defaults to submit.
23
+ * - instance.validate(): validates required fields, updates state attributes, and returns true or false.
24
+ * - instance.success(text): validates the form and shows a success toast when there are no errors.
25
+ * - instance.addNewRule(rule): adds a function that returns one or more invalid fields; validate automatically applies addFieldError to each field.
26
+ * - instance.addFieldError(field, index, total): marks a field as invalid; shows the specific message for one error or a summary message for multiple errors.
27
+ * - instance.removeFieldError(field): removes the error state from the specified field.
28
+ *
29
+ * @related
30
+ * - button: provides the base styling for the primary submit action.
31
+ * - flexColumn: spaces text elements in the radio group.
32
+ *
33
+ * @return Complete HTML form with required fields and an example script for a custom rule, validation, and a success message.
34
+ */
35
+ -->
36
+
37
+ <form pgs="form formValidate" action="#" method="post">
38
+ <label pgs="label" for="form-name">
39
+ Name
40
+ </label>
41
+ <input id="form-name" pgs="input" pgs-option="message[Enter your name]" type="text" name="name" placeholder="John Smith" required>
42
+
43
+ <label pgs="label" for="form-email">
44
+ Email
45
+ </label>
46
+ <input id="form-email" pgs="input" pgs-option="message[Enter a valid email address]" type="email" name="email" placeholder="name@example.com" required>
47
+
48
+ <label pgs="label" for="form-password">
49
+ Password
50
+ </label>
51
+ <input id="form-password" pgs="input" pgs-option="message[Enter a password]" type="password" name="password" autocomplete="new-password" required>
52
+
53
+ <label pgs="label" for="form-confirm-password">
54
+ Confirm password
55
+ </label>
56
+ <input id="form-confirm-password" pgs="input" pgs-option="message[Confirm your password]" type="password" name="confirmPassword" autocomplete="new-password" required>
57
+
58
+ <label pgs="label" for="form-message">
59
+ Message
60
+ </label>
61
+ <textarea id="form-message" pgs="textarea" name="message" rows="5" placeholder="Write your message" required></textarea>
62
+
63
+ <br>
64
+ <fieldset pgs="radio flexColumn">
65
+ <legend>Preferred contact method</legend>
66
+
67
+ <label>
68
+ <input type="radio" name="contactMethod" value="email" pgs-option="message[Choose a contact method]" required>
69
+ <span>Email</span>
70
+ </label>
71
+
72
+ <label>
73
+ <input type="radio" name="contactMethod" value="phone">
74
+ <span>Phone</span>
75
+ </label>
76
+
77
+ <label>
78
+ <input type="radio" name="contactMethod" value="message">
79
+ <span>Direct message</span>
80
+ </label>
81
+ </fieldset>
82
+ <br>
83
+
84
+ <label>
85
+ <input type="checkbox" name="privacy" required>
86
+ <span>I accept the privacy policy</span>
87
+ </label>
88
+ <br>
89
+
90
+ <button pgs="button" pgs-option="buttonStrong" type="submit">
91
+ <i class="fa-solid fa-paper-plane" aria-hidden="true"></i>
92
+ Submit
93
+ </button>
94
+ </form>
95
+
96
+ <script type="module">
97
+ import { pgs } from "mypgs";
98
+
99
+ const form = pgs(document).querySelector("form");
100
+
101
+ const password = form.querySelector('input[name="password"]');
102
+ const confirmPassword = form.querySelector('input[name="confirmPassword"]');
103
+ if (!password || !confirmPassword) return;
104
+
105
+ const formValidate = new pgs.formValidate(form, {
106
+ message: {
107
+ fieldError: "Please complete this field",
108
+ fieldsError: "Please complete all required fields",
109
+ success: "Submitted successfully"
110
+ }
111
+ });
112
+
113
+ //== new roules
114
+ formValidate.addNewRule(() => {
115
+ if (password.value && confirmPassword.value && password.value !== confirmPassword.value) {
116
+ pgs(confirmPassword).option.setValueBrackets("message", "Passwords do not match");
117
+ return [confirmPassword, password];
118
+ }
119
+ });
120
+
121
+ //== validate
122
+ formValidate.validator(event => {
123
+ const values = Object.fromEntries(new FormData(form));
124
+
125
+ // Replace this log with a request to your backend.
126
+ console.log(values);
127
+ }, "submit");
128
+ </script>
@@ -0,0 +1,109 @@
1
+ <!--
2
+ /**
3
+ * @title Form Add-ons
4
+ * @description Additional form controls for selectable cards, two-state buttons, switches, and compact chip groups.
5
+ *
6
+ * @pgs
7
+ * - checkboxBackground: presents a checkbox as a selectable container with a highlighted checked state.
8
+ * - twoState: presents checkbox or radio labels as buttons whose appearance changes when selected.
9
+ * - toggle: presents a checkbox as a switch with a rail and movable thumb.
10
+ * - chip: presents an individual checkbox or radio option as a compact selectable button.
11
+ * - chips: groups twoState controls into a compact segmented selector.
12
+ *
13
+ * @related
14
+ * - form: applies the base form styles to the complete add-on example.
15
+ * - flexColumn: vertically arranges each example with its heading and control.
16
+ * - flexRow: horizontally arranges standalone chip controls.
17
+ * - gapElements: applies element spacing between the form add-on examples.
18
+ *
19
+ * @return HTML examples of the checkboxBackground, twoState, toggle, and chips form controls using native checkbox and radio inputs.
20
+ */
21
+ -->
22
+
23
+ <form pgs="form flexColumn gapElements">
24
+ <section pgs="flexColumn">
25
+ <strong>Checkbox with background</strong>
26
+
27
+ <label pgs="checkboxBackground">
28
+ <input type="checkbox" name="notifications" value="enabled">
29
+ <span>
30
+ <strong>Enable notifications</strong><br>
31
+ Receive important account updates.
32
+ </span>
33
+ </label>
34
+ </section>
35
+
36
+ <section pgs="flexColumn">
37
+ <strong>Two-state controls</strong>
38
+
39
+ <label pgs="twoState">
40
+ <input type="checkbox" name="favorite" value="yes">
41
+ <i class="fa-solid fa-star" aria-hidden="true"></i>
42
+ Add to favorites
43
+ </label>
44
+ </section>
45
+
46
+ <section pgs="flexColumn">
47
+ <strong>Toggle</strong>
48
+
49
+ <label pgs="toggle">
50
+ <span>Enable Wi-Fi</span>
51
+ <input type="checkbox" name="darkMode" value="enabled">
52
+ </label>
53
+ </section>
54
+
55
+ <section pgs="flexColumn">
56
+ <strong>Chips checkbox</strong>
57
+ <div pgs="flexRow" role="group" aria-label="Chip actions">
58
+ <label pgs="chip">
59
+ <input type="checkbox" name="like" value="basic">
60
+ <i class="fa-solid fa-heart"></i>
61
+ Like
62
+ </label>
63
+ <label pgs="chip">
64
+ <input type="checkbox" name="share" value="basic">
65
+ <i class="fa-solid fa-share"></i>
66
+ Share
67
+ </label>
68
+ </div>
69
+ </section>
70
+
71
+ <section pgs="flexColumn gapElements">
72
+ <fieldset pgs="chips">
73
+ <legend>Chip checkbox</legend>
74
+ <label>
75
+ <input type="checkbox" name="plan" value="basic" checked>
76
+ Basic
77
+ </label>
78
+
79
+ <label>
80
+ <input type="checkbox" name="plan" value="pro">
81
+ Pro
82
+ </label>
83
+
84
+ <label>
85
+ <input type="checkbox" name="plan" value="enterprise">
86
+ Enterprise
87
+ </label>
88
+ </fieldset>
89
+
90
+ <fieldset pgs="chips">
91
+ <legend>Chips radio</legend>
92
+ <label>
93
+ <input type="radio" name="characters" value="basic" checked>
94
+ <i class="fa-solid fa-crow"></i>
95
+ Crow
96
+ </label>
97
+
98
+ <label>
99
+ <i class="fa-solid fa-dove"></i> <input type="radio" name="characters" value="pro">
100
+ Dove
101
+ </label>
102
+
103
+ <label>
104
+ <i class="fa-solid fa-dragon"></i> <input type="radio" name="characters" value="enterprise">
105
+ dragon
106
+ </label>
107
+ </fieldset>
108
+ </section>
109
+ </form>
@@ -0,0 +1,28 @@
1
+ <!--
2
+ /**
3
+ * @title Logo
4
+ * @description Component for displaying a graphical or text logo, with image variants that support dark mode.
5
+ *
6
+ * @pgs
7
+ * - logo: identifies the brand link container.
8
+ * - logo-image: identifies the graphical logo image.
9
+ * - logo-text: identifies the text-based brand variant.
10
+ *
11
+ * @pgs-option
12
+ * - logoDarkmode: inverts the logo image when the global darkmode state is active.
13
+ * - logoDarkmodeFixed: keeps the image inversion enabled regardless of the current theme.
14
+ *
15
+ * @pgs-state
16
+ * - darkmode: global document state that activates the logoDarkmode variant.
17
+ *
18
+ * @return HTML examples of the theme-aware graphical logo and the text logo.
19
+ */
20
+ -->
21
+
22
+ <a aria-label="Logo" pgs="logo" pgs-option="logoDarkmode" href="/">
23
+ <img pgs="logo-image" src="https://placehold.co/240x80?text=MyPGS" alt="MyPGS">
24
+ </a>
25
+
26
+ <a aria-label="Text logo" pgs="logo" href="/">
27
+ <span pgs="logo-text">MyPGS</span>
28
+ </a>
@@ -1,33 +1,33 @@
1
1
  <!--
2
2
  /**
3
3
  * @title Menu
4
- * @description Navigazione orizzontale o verticale che trasforma le voci con sottomenu in dropdown accessibili e inizializzati automaticamente.
4
+ * @description Menu markup, configuration, behavior, and usage example.
5
5
  *
6
6
  * @pgs
7
- * - menu: identifica il contenitore di navigazione elaborato dal modulo menu.
8
- * - menu-buttonIcon: identifica il controllo creato dinamicamente accanto alle voci con sottomenu.
7
+ * - menu: identifies the menu element used by Menu.
8
+ * - menu-buttonIcon: identifies the menu-buttonIcon element used by Menu.
9
9
  *
10
10
  * @pgs-option
11
- * - horizontal: dispone il menu e i suoi elementi in orizzontale.
12
- * - vertical: dispone il menu e i suoi elementi in verticale.
13
- * - menuHeader: adatta spaziature e comportamento del menu quando è inserito nell'header.
14
- * - position: viene impostata come position[bottom right] sui dropdown creati per i sottomenu.
11
+ * - horizontal: identifies the horizontal element used by Menu.
12
+ * - vertical: identifies the vertical element used by Menu.
13
+ * - menuHeader: identifies the menuHeader element used by Menu.
14
+ * - position: identifies the position element used by Menu.
15
+ * - buttonNohover: disables hover behavior on menu buttons generated at runtime.
15
16
  *
16
17
  * @pgs-state
17
- * - open: indica il sottomenu trasformato in dropdown attualmente aperto.
18
+ * - open: identifies the open element used by Menu.
18
19
  *
19
20
  * @api
20
- * - pgs.menu.init(root): inizializza i menu non ancora registrati dentro Document o Element indicato e prepara i sottomenu.
21
- * - pgs.menu.api(element): restituisce l'istanza associata a un root menu inizializzato.
22
- * - instance.refresh(): riesegue l'inizializzazione nel contenitore del menu e restituisce l'istanza.
21
+ * - pgs.menu.init(root): initializes matching elements within the specified root.
22
+ * - pgs.menu.api(element): returns the instance associated with the specified initialized element.
23
+ * - instance.refresh(): refreshes the component and returns its updated instance.
23
24
  *
24
25
  * @related
25
- * - dropdown: viene aggiunto dinamicamente alle voci che contengono una lista annidata.
26
- * - dropdown-button: identifica il controllo dinamico del sottomenu.
27
- * - buttonNohover: neutralizza lo stile hover del controllo dinamico.
28
- * - dropdown-content: identifica la lista annidata mostrata come pannello dropdown.
26
+ * - dropdown: uses the related dropdown component or utility in this example.
27
+ * - dropdown-button: uses the related dropdown-button component or utility in this example.
28
+ * - dropdown-content: uses the related dropdown-content component or utility in this example.
29
29
  *
30
- * @return Due strutture nav complete per le varianti orizzontale e verticale del menu.
30
+ * @return Complete HTML markup and usage example for Menu.
31
31
  */
32
32
  -->
33
33
 
@@ -77,4 +77,4 @@
77
77
  </a>
78
78
  </li>
79
79
  </ul>
80
- </nav>
80
+ </nav>
@@ -0,0 +1,123 @@
1
+ <!--
2
+ /**
3
+ * @title Modal
4
+ * @description Modal markup, configuration, behavior, and usage example.
5
+ *
6
+ * @pgs
7
+ * - modal: identifies the modal element used by Modal.
8
+ * - modal-button: identifies the modal-button element used by Modal.
9
+ * - dialog: token aggiunto dinamicamente all'elemento dialog inizializzato.
10
+ * - modal-dialog: identifies the modal-dialog element used by Modal.
11
+ * - modal-dialog-content: identifies the modal-dialog-content element used by Modal.
12
+ * - modal-dialog-content-header: identifies the modal-dialog-content-header element used by Modal.
13
+ * - modal-dialog-content-scroll: identifies the modal-dialog-content-scroll element used by Modal.
14
+ * - modal-close: identifies the modal-close element used by Modal.
15
+ *
16
+ * @pgs-option
17
+ * - containerID: identifies the containerID element used by Modal.
18
+ * - containerPGS: identifies the containerPGS element used by Modal.
19
+ * - disableBackdropClose: identifies the disableBackdropClose element used by Modal.
20
+ * - history: identifies the history element used by Modal.
21
+ * - topLevel: identifies the topLevel element used by Modal.
22
+ * - left: identifies the left element used by Modal.
23
+ * - right: identifies the right element used by Modal.
24
+ * - buttonStrong: applies stronger emphasis to the save action.
25
+ * - buttonClose: styles the close action generated at runtime.
26
+ *
27
+ * @api
28
+ * - pgs.modal.init(root): initializes matching elements within the specified root.
29
+ * - pgs.modal.api(element): returns the instance associated with the specified initialized element.
30
+ * - instance.open(): opens the component.
31
+ * - instance.close(): closes the component.
32
+ * - instance.toggle(): toggles the component state.
33
+ * - instance.refresh(): refreshes the component and returns its updated instance.
34
+ * - instance.isOpen(): returns true when the component is open.
35
+ *
36
+ * @related
37
+ * - button: uses the related button component or utility in this example.
38
+ * - flexColumn: vertically organizes modal content.
39
+ * - gapElements: applies element spacing to modal content.
40
+ * - flexRow: uses the related flexRow component or utility in this example.
41
+ *
42
+ * @return Complete HTML markup and usage example for Modal.
43
+ */
44
+ -->
45
+
46
+ <div pgs="modal" pgs-option="containerID[modal-container]">
47
+ <button pgs="modal-button button" type="button">
48
+ <i class="fa-solid fa-window-maximize"></i> Open modal
49
+ </button>
50
+
51
+ <dialog>
52
+ <div pgs="modal-dialog-content">
53
+ <div pgs="modal-dialog-content-header">
54
+ <h3>Example modal</h3>
55
+ </div>
56
+
57
+ <div pgs="modal-dialog-content-scroll">
58
+ <p>Modal content. The close button is added automatically when missing.</p>
59
+ </div>
60
+ </div>
61
+ </dialog>
62
+ </div>
63
+
64
+ <div pgs="modal" pgs-option="containerID[modal-container]">
65
+ <button pgs="modal-button button" type="button">
66
+ <i class="fa-solid fa-window-maximize"></i> Open modal right
67
+ </button>
68
+
69
+ <dialog pgs-option="right">
70
+ <div pgs="modal-dialog-content">
71
+ <div pgs="modal-dialog-content-header">
72
+ <h3>Side modal</h3>
73
+ </div>
74
+
75
+ <div pgs="modal-dialog-content-scroll">
76
+ <p>Modal content with <code>pgs-option="right"</code>.</p>
77
+ </div>
78
+ </div>
79
+ </dialog>
80
+ </div>
81
+
82
+ <div pgs="modal" pgs-option="containerID[modal-container]">
83
+ <button pgs="modal-button button" type="button">
84
+ <i class="fa-solid fa-window-maximize"></i> Open modal left
85
+ </button>
86
+
87
+ <dialog pgs-option="left">
88
+ <div pgs="modal-dialog-content">
89
+ <div pgs="modal-dialog-content-header">
90
+ <h3>Left-side modal</h3>
91
+ </div>
92
+
93
+ <div pgs="modal-dialog-content-scroll">
94
+ <p>Modal content with <code>pgs-option="left"</code>.</p>
95
+ </div>
96
+ </div>
97
+ </dialog>
98
+ </div>
99
+
100
+ <div pgs="modal">
101
+ <button pgs="modal-button button" type="button">
102
+ <i class="fa-solid fa-floppy-disk"></i> Confirmation salvataggio
103
+ </button>
104
+
105
+ <dialog pgs-option="topLevel">
106
+ <div pgs="modal-dialog-content">
107
+ <div pgs="modal-dialog-content-header">
108
+ <h3>Save changes?</h3>
109
+ </div>
110
+
111
+ <div pgs="modal-dialog-content-scroll flexColumn gapElements">
112
+ <p>You have unsaved changes. Confirm to apply them or cancel to return to the page.</p>
113
+
114
+ <div pgs="flexRow">
115
+ <button pgs="button modal-close" type="button">Cancel</button>
116
+ <button pgs="button" pgs-option="buttonStrong" type="button">Save changes</button>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ </dialog>
121
+ </div>
122
+
123
+ <div id="modal-container"></div>
@@ -0,0 +1,71 @@
1
+ <!--
2
+ /**
3
+ * @title Notification
4
+ * @description Notification markup, configuration, behavior, and usage example.
5
+ *
6
+ * @pgs
7
+ * - notification: identifies the notification element used by Notification.
8
+ * - notificationTrigger: identifies the notificationTrigger element used by Notification.
9
+ * - notification-element: identifies the notification-element element used by Notification.
10
+ * - notification-element-title: identifies the notification-element-title element used by Notification.
11
+ * - notification-element-content: identifies the notification-element-content element used by Notification.
12
+ *
13
+ * @pgs-option
14
+ * - toast: identifies the toast element used by Notification.
15
+ * - notification: identifies the notification element used by Notification.
16
+ * - buttonClose: styles the dismiss action generated at runtime.
17
+ *
18
+ * @pgs-state
19
+ * - success: identifies the success element used by Notification.
20
+ * - error: identifies the error element used by Notification.
21
+ * - warning: identifies the warning element used by Notification.
22
+ * - info: identifies the info element used by Notification.
23
+ *
24
+ * @api
25
+ * - pgs.notification.trigger(root): provides the documented operation through the component public API.
26
+ * - pgs.notification.alert.error(text, link, timeout, icon): provides the documented operation through the component public API.
27
+ * - pgs.notification.alert.success(text, link, timeout, icon): provides the documented operation through the component public API.
28
+ * - pgs.notification.alert.info(text, link, timeout, icon): provides the documented operation through the component public API.
29
+ * - pgs.notification.alert.warning(text, link, timeout, icon): provides the documented operation through the component public API.
30
+ * - pgs.notification.alert.deleteAll(): provides the documented operation through the component public API.
31
+ * - pgs.notification.toast.error(text, timeout, icon): provides the documented operation through the component public API.
32
+ * - pgs.notification.toast.success(text, timeout, icon): provides the documented operation through the component public API.
33
+ * - pgs.notification.toast.info(text, timeout, icon): provides the documented operation through the component public API.
34
+ * - pgs.notification.toast.warning(text, timeout, icon): provides the documented operation through the component public API.
35
+ * - pgs.notification.toast.deleteAll(): provides the documented operation through the component public API.
36
+ *
37
+ * @related
38
+ * - hidden: uses the related hidden component or utility in this example.
39
+ *
40
+ * @return Complete HTML markup and usage example for Notification.
41
+ */
42
+ -->
43
+
44
+ <div pgs="notification" aria-live="polite"></div>
45
+ <div pgs="notification" pgs-option="toast" aria-live="polite"></div>
46
+
47
+ <div pgs="hidden notificationTrigger" pgs-option='notification[{
48
+ "title": "Title",
49
+ "message": "Message",
50
+ "element": "notification",
51
+ "type": "info",
52
+ "icon": null,
53
+ "duration": "-1",
54
+ "link": null
55
+ }]'></div>
56
+
57
+ <div pgs="hidden notificationTrigger" pgs-option='notification[{
58
+ "title": "Benvenuto",
59
+ "message": "Message",
60
+ "element": "toast",
61
+ "type": "info",
62
+ "icon": null,
63
+ "duration": "3000",
64
+ "link": null
65
+ }]'></div>
66
+ <!--
67
+ <div
68
+ pgs="hidden notificationTrigger"
69
+ pgs-option='notification[{"title":"Title","message":"Message","element":"notification","type":"info","icon":"<i class=\"fa-solid fa-rocket\"></i>","duration":"4000","link":"/page/"}]'>
70
+ </div>
71
+ -->