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,30 +1,30 @@
1
- <!-- File generato automaticamente da templates/html/components/button.html. Modificare templates/html/components/button.html e rieseguire npm run docs:generate. -->
1
+ <!-- Automatically generated from reference/html/components/button.html. Edit reference/html/components/button.html and run npm run docs:generate again. -->
2
2
 
3
3
  # Button
4
4
 
5
- Varianti di pulsante e collegamento d'azione con dimensioni, enfasi e composizione icona-testo definite dal design system.
5
+ Button and action-link variants with sizes, emphasis, and icon-text composition defined by the design system.
6
6
 
7
7
  ## PGS
8
8
 
9
- - `button`: identifica il pulsante standard utilizzabile anche su elementi a.
10
- - `buttonStrong`: applica la variante con maggiore enfasi visiva.
11
- - `buttonIcon`: identifica un pulsante compatto composto principalmente da un'icona.
12
- - `buttonMini`: applica la variante di dimensione minima.
13
- - `buttonBig`: applica la variante di dimensione ampia.
9
+ - `button`: identifies the standard button, which can also be used on anchor elements.
14
10
 
15
11
  ## PGS Options
16
12
 
17
- - `buttonReverse`: inverte l'ordine visivo di testo e icona sul pulsante a cui è applicata.
13
+ - `buttonReverse`: reverses the visual order of the text and icon on the button.
14
+ - `buttonStrong`: applies the variant with stronger visual emphasis.
15
+ - `buttonIcon`: identifies a compact button composed primarily of an icon.
16
+ - `buttonMini`: applies the smallest size variant.
17
+ - `buttonBig`: applies the large size variant.
18
18
 
19
- ## Elementi correlati
19
+ ## Related elements
20
20
 
21
- - `flexRow`: dispone gli esempi di pulsante su una riga flessibile.
21
+ - `flexRow`: arranges the button examples in a flexible row.
22
22
 
23
23
  ## Output
24
24
 
25
- Raccolta HTML delle principali varianti di button.
25
+ HTML collection of the main button variants.
26
26
 
27
- ## Esempio
27
+ ## Example
28
28
 
29
29
  ```html
30
30
  <div pgs="flexRow">
@@ -34,26 +34,26 @@ Raccolta HTML delle principali varianti di button.
34
34
  </a>
35
35
 
36
36
  <button pgs="button" type="button" pgs-option="buttonReverse">
37
- Avanti
37
+ Next
38
38
  <i class="fa-solid fa-arrow-right" aria-hidden="true"></i>
39
39
  </button>
40
40
 
41
- <button pgs="buttonStrong" type="button">
41
+ <button pgs="button" pgs-option="buttonStrong" type="button">
42
42
  <i class="fa-solid fa-check" aria-hidden="true"></i>
43
43
  Submit
44
44
  </button>
45
45
 
46
- <button pgs="buttonIcon" type="button" aria-label="Impostazioni">
46
+ <button pgs="button" pgs-option="buttonIcon" type="button" aria-label="Settings">
47
47
  <i class="fa-solid fa-gear" aria-hidden="true"></i>
48
48
  </button>
49
49
 
50
- <button pgs="buttonMini" type="button" aria-label="Informazioni">
50
+ <button pgs="button" pgs-option="buttonMini" type="button" aria-label="Information">
51
51
  <i class="fa-solid fa-info" aria-hidden="true"></i>
52
52
  </button>
53
53
 
54
- <button pgs="buttonBig" type="button" aria-label="Bottone grande">
54
+ <button pgs="button" pgs-option="buttonBig" type="button" aria-label="Large button">
55
55
  <i class="fa-solid fa-rocket" aria-hidden="true"></i>
56
- Bottone grande
56
+ Large button
57
57
  </button>
58
58
  </div>
59
59
  ```
@@ -1,48 +1,51 @@
1
- <!-- File generato automaticamente da templates/html/components/card.html. Modificare templates/html/components/card.html e rieseguire npm run docs:generate. -->
1
+ <!-- Automatically generated from reference/html/components/card.html. Edit reference/html/components/card.html and run npm run docs:generate again. -->
2
2
 
3
3
  # Card
4
4
 
5
- Contenitore riutilizzabile per raggruppare immagine, titolo, testo e azioni in anteprime o raccolte responsive.
5
+ Reusable container for grouping an image, title, text, and actions in responsive previews or collections.
6
6
 
7
7
  ## PGS
8
8
 
9
- - `card`: identifica il contenitore principale della scheda.
10
- - `card-img`: identifica l'immagine principale della card.
9
+ - `card`: identifies the main card container.
10
+ - `card-img`: identifies the main card image.
11
11
 
12
- ## Elementi correlati
12
+ ## PGS Options
13
13
 
14
- - `flex-2`: dispone le card in un layout responsive a due elementi.
15
- - `flexColumn`: organizza verticalmente il contenuto della card o del relativo link.
16
- - `imgCover`: adatta l'immagine riempiendo l'area disponibile.
17
- - `flexColumnTexts`: applica la spaziatura verticale ai contenuti testuali.
18
- - `button`: presenta il collegamento finale come pulsante standard.
14
+ - `column-2`: configures the related flex layout with two columns.
15
+
16
+ ## Related elements
17
+
18
+ - `flexRow`: arranges the cards in a responsive layout.
19
+ - `flexColumn`: organizes the card or link content vertically.
20
+ - `imgCover`: scales the image to fill the available area.
21
+ - `button`: presents the final link as a standard button.
19
22
 
20
23
  ## Output
21
24
 
22
- Due strutture HTML di card, una con azione separata e una interamente cliccabile.
25
+ Two card HTML structures, one with a separate action and one that is fully clickable.
23
26
 
24
- ## Esempio
27
+ ## Example
25
28
 
26
29
  ```html
27
- <div pgs="flex-2">
30
+ <div pgs="flexRow" pgs-option="column-2">
28
31
 
29
32
  <article pgs="card flexColumn">
30
- <img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="Immagine segnaposto">
33
+ <img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="Placeholder image">
31
34
 
32
- <div pgs="flexColumnTexts">
33
- <h3>Card riutilizzabile</h3>
34
- <p>Contenuto descrittivo della card, adatto a liste, anteprime e griglie.</p>
35
- <a pgs="button" href="#">Leggi di piu</a>
35
+ <div pgs="flexColumn">
36
+ <h3>Reusable card</h3>
37
+ <p>Descriptive card content suitable for lists, previews, and grids.</p>
38
+ <a pgs="button" href="#">Read more</a>
36
39
  </div>
37
40
  </article>
38
41
 
39
42
  <article pgs="card">
40
43
  <a pgs="flexColumn" href="">
41
- <img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="Immagine segnaposto">
44
+ <img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="Placeholder image">
42
45
 
43
- <div pgs="flexColumnTexts">
44
- <h3>Card riutilizzabile</h3>
45
- <p>Contenuto descrittivo della card, adatto a liste, anteprime e griglie.</p>
46
+ <div pgs="flexColumn">
47
+ <h3>Reusable card</h3>
48
+ <p>Descriptive card content suitable for lists, previews, and grids.</p>
46
49
  </div>
47
50
  </a>
48
51
  </article>
@@ -1,44 +1,44 @@
1
- <!-- File generato automaticamente da templates/html/components/dropdown.html. Modificare templates/html/components/dropdown.html e rieseguire npm run docs:generate. -->
1
+ <!-- Automatically generated from reference/html/components/dropdown.html. Edit reference/html/components/dropdown.html and run npm run docs:generate again. -->
2
2
 
3
3
  # Dropdown
4
4
 
5
- Componente a comparsa che associa un controllo a un contenuto posizionato rispetto al trigger e gestisce apertura, chiusura, click esterno ed Escape.
5
+ Popup component that connects a control to content positioned relative to its trigger and handles opening, closing, outside clicks, and Escape.
6
6
 
7
7
  ## PGS
8
8
 
9
- - `dropdown`: identifica il contenitore inizializzato dal modulo dropdown.
10
- - `dropdown-button`: identifica il controllo che apre o chiude il contenuto.
11
- - `dropdown-content`: identifica il pannello posizionato rispetto al controllo.
9
+ - `dropdown`: identifies the container initialized by the dropdown module.
10
+ - `dropdown-button`: identifies the control that opens or closes the content.
11
+ - `dropdown-content`: identifies the panel positioned relative to the control.
12
12
 
13
13
  ## PGS Options
14
14
 
15
- - `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.
16
- - `buttonReverse`: inverte testo e icona sui pulsanti di esempio e appartiene al componente button.
15
+ - `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.
16
+ - `buttonReverse`: reverses text and icon on the example buttons and belongs to the button component.
17
17
 
18
18
  ## PGS States
19
19
 
20
- - `open`: indica che il dropdown è aperto e che il contenuto è visibile.
20
+ - `open`: indicates that the dropdown is open and its content is visible.
21
21
 
22
- ## API JavaScript
22
+ ## JavaScript API
23
23
 
24
- - `pgs.dropdown.init(root)`: inizializza i dropdown non ancora registrati dentro Document o Element indicato.
25
- - `pgs.dropdown.api(element)`: restituisce l'istanza associata a un root dropdown inizializzato.
26
- - `instance.open()`: apre il dropdown, chiudendo eventuali altri dropdown aperti.
27
- - `instance.close()`: chiude il dropdown corrente.
28
- - `instance.toggle()`: inverte lo stato aperto o chiuso.
29
- - `instance.refresh()`: reinizializza il contesto e ricalcola il posizionamento del contenuto.
30
- - `instance.isOpen()`: restituisce true quando il dropdown è aperto.
24
+ - `pgs.dropdown.init(root)`: initializes unregistered dropdowns within the specified Document or Element.
25
+ - `pgs.dropdown.api(element)`: returns the instance associated with an initialized dropdown root.
26
+ - `instance.open()`: opens the dropdown and closes any other open dropdowns.
27
+ - `instance.close()`: closes the current dropdown.
28
+ - `instance.toggle()`: toggles between the open and closed states.
29
+ - `instance.refresh()`: reinitializes the context and recalculates content positioning.
30
+ - `instance.isOpen()`: returns true when the dropdown is open.
31
31
 
32
- ## Elementi correlati
32
+ ## Related elements
33
33
 
34
- - `flexRow`: dispone i diversi esempi di posizionamento sulla stessa riga flessibile.
35
- - `button`: applica lo stile standard ai controlli del dropdown.
34
+ - `flexRow`: arranges the placement examples on the same flexible row.
35
+ - `button`: applies standard styling to dropdown controls.
36
36
 
37
37
  ## Output
38
38
 
39
- Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
39
+ Series of HTML dropdowns demonstrating the supported placement directions.
40
40
 
41
- ## Esempio
41
+ ## Example
42
42
 
43
43
  ```html
44
44
  <div pgs="flexRow">
@@ -50,7 +50,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
50
50
  </button>
51
51
 
52
52
  <div pgs="dropdown-content">
53
- Contenuto bottom center
53
+ bottom center content
54
54
  </div>
55
55
  </span>
56
56
 
@@ -61,7 +61,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
61
61
  </button>
62
62
 
63
63
  <div pgs="dropdown-content">
64
- Contenuto top left
64
+ top left content
65
65
  </div>
66
66
  </span>
67
67
 
@@ -72,7 +72,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
72
72
  </button>
73
73
 
74
74
  <div pgs="dropdown-content">
75
- Contenuto top center
75
+ top center content
76
76
  </div>
77
77
  </span>
78
78
 
@@ -83,7 +83,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
83
83
  </button>
84
84
 
85
85
  <div pgs="dropdown-content">
86
- Contenuto top right
86
+ top right content
87
87
  </div>
88
88
  </span>
89
89
 
@@ -94,7 +94,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
94
94
  </button>
95
95
 
96
96
  <div pgs="dropdown-content">
97
- Contenuto bottom left
97
+ bottom left content
98
98
  </div>
99
99
  </span>
100
100
 
@@ -105,7 +105,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
105
105
  </button>
106
106
 
107
107
  <div pgs="dropdown-content">
108
- Contenuto bottom right
108
+ bottom right content
109
109
  </div>
110
110
  </span>
111
111
 
@@ -116,7 +116,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
116
116
  </button>
117
117
 
118
118
  <div pgs="dropdown-content">
119
- Contenuto left center
119
+ left center content
120
120
  </div>
121
121
  </span>
122
122
 
@@ -127,7 +127,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
127
127
  </button>
128
128
 
129
129
  <div pgs="dropdown-content">
130
- Contenuto right center
130
+ right center content
131
131
  </div>
132
132
  </span>
133
133
 
@@ -1,79 +1,103 @@
1
- <!-- File generato automaticamente da templates/html/components/form.html. Modificare templates/html/components/form.html e rieseguire npm run docs:generate. -->
1
+ <!-- Automatically generated from reference/html/components/form.html. Edit reference/html/components/form.html and run npm run docs:generate again. -->
2
2
 
3
3
  # Form
4
4
 
5
- Struttura di modulo con etichette, campi testuali, textarea e controllo toggle compatibile con i vincoli HTML e con regole personalizzate di PGS_formValidate.
5
+ Form structure with labels, text fields, a textarea, a checkbox, and a radio group compatible with HTML constraints and custom PGS_formValidate rules.
6
6
 
7
7
  ## PGS
8
8
 
9
- - `form`: identifica il contenitore del modulo e applica il layout dei campi.
10
- - `formValidate`: abilita gli stili associati agli stati di validazione gestiti dalla utility JavaScript.
11
- - `label`: identifica le etichette associate ai controlli.
12
- - `input`: applica lo stile condiviso agli input testuali.
13
- - `textarea`: applica lo stile condiviso all'area di testo.
14
- - `toggle`: presenta una checkbox come controllo a due stati.
9
+ - `form`: identifies the form container and applies the field layout.
10
+ - `formValidate`: enables styles associated with validation states managed by the JavaScript utility.
11
+ - `label`: identifies labels associated with controls.
12
+ - `input`: applies shared styling to text inputs.
13
+ - `textarea`: applies shared styling to the text area.
14
+ - `radio`: styles a group of native radio inputs while preserving their shared name and selection behavior.
15
15
 
16
16
  ## PGS Options
17
17
 
18
- - `message`: definisce il messaggio specifico del campo con la sintassi message[Testo del messaggio].
19
- - `error`: viene applicata a runtime al form e ai campi che non superano la validazione.
20
- - `success`: viene applicata a runtime al form quando la validazione ha esito positivo.
18
+ - `message`: defines a field-specific message with the syntax message[Message text].
19
+ - `error`: is applied at runtime to the form and fields that fail validation.
20
+ - `success`: is applied at runtime to the form after successful validation.
21
+ - `buttonStrong`: presents form submission as the primary action.
21
22
 
22
- ## API JavaScript
23
+ ## JavaScript API
23
24
 
24
- - `new pgs.formValidate(form, options)`: crea una utility associata direttamente al form, aggiunge automaticamente novalidate e accetta fieldError, fieldsError e success in options.message; i messaggi restano modificabili tramite instance.message.
25
- - `instance.validator(callback, eventName)`: intercetta l'evento indicato, previene il comportamento predefinito, valida il form, mostra il messaggio di successo e richiama callback solo quando è valido; eventName usa submit come valore predefinito.
26
- - `instance.validate()`: valida i campi required, aggiorna gli attributi di stato e restituisce true o false.
27
- - `instance.success(text)`: valida il form e mostra un toast positivo quando non sono presenti errori.
28
- - `instance.addNewRule(rule)`: aggiunge una funzione che restituisce uno o più campi non validi; validate applica automaticamente addFieldError a ciascun campo.
29
- - `instance.addFieldError(field, index, total)`: marca un campo come non valido; mostra il messaggio specifico per un solo errore o un messaggio riepilogativo per più errori.
30
- - `instance.removeFieldError(field)`: rimuove lo stato di errore dal campo indicato.
25
+ - `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.
26
+ - `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.
27
+ - `instance.validate()`: validates required fields, updates state attributes, and returns true or false.
28
+ - `instance.success(text)`: validates the form and shows a success toast when there are no errors.
29
+ - `instance.addNewRule(rule)`: adds a function that returns one or more invalid fields; validate automatically applies addFieldError to each field.
30
+ - `instance.addFieldError(field, index, total)`: marks a field as invalid; shows the specific message for one error or a summary message for multiple errors.
31
+ - `instance.removeFieldError(field)`: removes the error state from the specified field.
31
32
 
32
- ## Elementi correlati
33
+ ## Related elements
33
34
 
34
- - `buttonStrong`: presenta l'invio del modulo come azione primaria.
35
+ - `button`: provides the base styling for the primary submit action.
36
+ - `flexColumn`: spaces text elements in the radio group.
35
37
 
36
38
  ## Output
37
39
 
38
- Modulo HTML completo con campi required e script di esempio per una regola personalizzata, la validazione e il messaggio di successo.
40
+ Complete HTML form with required fields and an example script for a custom rule, validation, and a success message.
39
41
 
40
- ## Esempio
42
+ ## Example
41
43
 
42
44
  ```html
43
45
  <form pgs="form formValidate" action="#" method="post">
44
46
  <label pgs="label" for="form-name">
45
- Nome
47
+ Name
46
48
  </label>
47
- <input id="form-name" pgs="input" pgs-option="message[Inserisci il nome]" type="text" name="name" placeholder="Mario Rossi" required>
49
+ <input id="form-name" pgs="input" pgs-option="message[Enter your name]" type="text" name="name" placeholder="John Smith" required>
48
50
 
49
51
  <label pgs="label" for="form-email">
50
52
  Email
51
53
  </label>
52
- <input id="form-email" pgs="input" pgs-option="message[Inserisci una email valida]" type="email" name="email" placeholder="nome@example.com" required>
54
+ <input id="form-email" pgs="input" pgs-option="message[Enter a valid email address]" type="email" name="email" placeholder="name@example.com" required>
53
55
 
54
56
  <label pgs="label" for="form-password">
55
57
  Password
56
58
  </label>
57
- <input id="form-password" pgs="input" pgs-option="message[Inserisci una password]" type="password" name="password" autocomplete="new-password" required>
59
+ <input id="form-password" pgs="input" pgs-option="message[Enter a password]" type="password" name="password" autocomplete="new-password" required>
58
60
 
59
61
  <label pgs="label" for="form-confirm-password">
60
- Conferma password
62
+ Confirm password
61
63
  </label>
62
- <input id="form-confirm-password" pgs="input" pgs-option="message[Conferma la password]" type="password" name="confirmPassword" autocomplete="new-password" required>
64
+ <input id="form-confirm-password" pgs="input" pgs-option="message[Confirm your password]" type="password" name="confirmPassword" autocomplete="new-password" required>
63
65
 
64
66
  <label pgs="label" for="form-message">
65
- Messaggio
67
+ Message
66
68
  </label>
67
- <textarea id="form-message" pgs="textarea" name="message" rows="5" placeholder="Scrivi il messaggio" required></textarea>
68
-
69
- <label pgs="toggle">
70
- <span>Accetto la privacy policy</span>
69
+ <textarea id="form-message" pgs="textarea" name="message" rows="5" placeholder="Write your message" required></textarea>
70
+
71
+ <br>
72
+ <fieldset pgs="radio flexColumn">
73
+ <legend>Preferred contact method</legend>
74
+
75
+ <label>
76
+ <input type="radio" name="contactMethod" value="email" pgs-option="message[Choose a contact method]" required>
77
+ <span>Email</span>
78
+ </label>
79
+
80
+ <label>
81
+ <input type="radio" name="contactMethod" value="phone">
82
+ <span>Phone</span>
83
+ </label>
84
+
85
+ <label>
86
+ <input type="radio" name="contactMethod" value="message">
87
+ <span>Direct message</span>
88
+ </label>
89
+ </fieldset>
90
+ <br>
91
+
92
+ <label>
71
93
  <input type="checkbox" name="privacy" required>
94
+ <span>I accept the privacy policy</span>
72
95
  </label>
96
+ <br>
73
97
 
74
- <button pgs="buttonStrong" type="submit">
98
+ <button pgs="button" pgs-option="buttonStrong" type="submit">
75
99
  <i class="fa-solid fa-paper-plane" aria-hidden="true"></i>
76
- Invia
100
+ Submit
77
101
  </button>
78
102
  </form>
79
103
 
@@ -88,16 +112,16 @@ Modulo HTML completo con campi required e script di esempio per una regola perso
88
112
 
89
113
  const formValidate = new pgs.formValidate(form, {
90
114
  message: {
91
- fieldError: "Completa questo campo",
92
- fieldsError: "Completa tutti i campi obbligatori",
93
- success: "Inviato con successo"
115
+ fieldError: "Please complete this field",
116
+ fieldsError: "Please complete all required fields",
117
+ success: "Submitted successfully"
94
118
  }
95
119
  });
96
120
 
97
121
  //== new roules
98
122
  formValidate.addNewRule(() => {
99
123
  if (password.value && confirmPassword.value && password.value !== confirmPassword.value) {
100
- pgs(confirmPassword).option.setValueBrackets("message", "Le password non coincidono");
124
+ pgs(confirmPassword).option.setValueBrackets("message", "Passwords do not match");
101
125
  return [confirmPassword, password];
102
126
  }
103
127
  });
@@ -106,7 +130,7 @@ Modulo HTML completo con campi required e script di esempio per una regola perso
106
130
  formValidate.validator(event => {
107
131
  const values = Object.fromEntries(new FormData(form));
108
132
 
109
- // Sostituisci questo log con l'invio dei dati al tuo backend.
133
+ // Replace this log with a request to your backend.
110
134
  console.log(values);
111
135
  }, "submit");
112
136
  </script>
@@ -0,0 +1,116 @@
1
+ <!-- Automatically generated from reference/html/components/formAddon.html. Edit reference/html/components/formAddon.html and run npm run docs:generate again. -->
2
+
3
+ # Form Add-ons
4
+
5
+ Additional form controls for selectable cards, two-state buttons, switches, and compact chip groups.
6
+
7
+ ## PGS
8
+
9
+ - `checkboxBackground`: presents a checkbox as a selectable container with a highlighted checked state.
10
+ - `twoState`: presents checkbox or radio labels as buttons whose appearance changes when selected.
11
+ - `toggle`: presents a checkbox as a switch with a rail and movable thumb.
12
+ - `chip`: presents an individual checkbox or radio option as a compact selectable button.
13
+ - `chips`: groups twoState controls into a compact segmented selector.
14
+
15
+ ## Related elements
16
+
17
+ - `form`: applies the base form styles to the complete add-on example.
18
+ - `flexColumn`: vertically arranges each example with its heading and control.
19
+ - `flexRow`: horizontally arranges standalone chip controls.
20
+ - `gapElements`: applies element spacing between the form add-on examples.
21
+
22
+ ## Output
23
+
24
+ HTML examples of the checkboxBackground, twoState, toggle, and chips form controls using native checkbox and radio inputs.
25
+
26
+ ## Example
27
+
28
+ ```html
29
+ <form pgs="form flexColumn gapElements">
30
+ <section pgs="flexColumn">
31
+ <strong>Checkbox with background</strong>
32
+
33
+ <label pgs="checkboxBackground">
34
+ <input type="checkbox" name="notifications" value="enabled">
35
+ <span>
36
+ <strong>Enable notifications</strong><br>
37
+ Receive important account updates.
38
+ </span>
39
+ </label>
40
+ </section>
41
+
42
+ <section pgs="flexColumn">
43
+ <strong>Two-state controls</strong>
44
+
45
+ <label pgs="twoState">
46
+ <input type="checkbox" name="favorite" value="yes">
47
+ <i class="fa-solid fa-star" aria-hidden="true"></i>
48
+ Add to favorites
49
+ </label>
50
+ </section>
51
+
52
+ <section pgs="flexColumn">
53
+ <strong>Toggle</strong>
54
+
55
+ <label pgs="toggle">
56
+ <span>Enable Wi-Fi</span>
57
+ <input type="checkbox" name="darkMode" value="enabled">
58
+ </label>
59
+ </section>
60
+
61
+ <section pgs="flexColumn">
62
+ <strong>Chips checkbox</strong>
63
+ <div pgs="flexRow" role="group" aria-label="Chip actions">
64
+ <label pgs="chip">
65
+ <input type="checkbox" name="like" value="basic">
66
+ <i class="fa-solid fa-heart"></i>
67
+ Like
68
+ </label>
69
+ <label pgs="chip">
70
+ <input type="checkbox" name="share" value="basic">
71
+ <i class="fa-solid fa-share"></i>
72
+ Share
73
+ </label>
74
+ </div>
75
+ </section>
76
+
77
+ <section pgs="flexColumn gapElements">
78
+ <fieldset pgs="chips">
79
+ <legend>Chip checkbox</legend>
80
+ <label>
81
+ <input type="checkbox" name="plan" value="basic" checked>
82
+ Basic
83
+ </label>
84
+
85
+ <label>
86
+ <input type="checkbox" name="plan" value="pro">
87
+ Pro
88
+ </label>
89
+
90
+ <label>
91
+ <input type="checkbox" name="plan" value="enterprise">
92
+ Enterprise
93
+ </label>
94
+ </fieldset>
95
+
96
+ <fieldset pgs="chips">
97
+ <legend>Chips radio</legend>
98
+ <label>
99
+ <input type="radio" name="characters" value="basic" checked>
100
+ <i class="fa-solid fa-crow"></i>
101
+ Crow
102
+ </label>
103
+
104
+ <label>
105
+ <i class="fa-solid fa-dove"></i> <input type="radio" name="characters" value="pro">
106
+ Dove
107
+ </label>
108
+
109
+ <label>
110
+ <i class="fa-solid fa-dragon"></i> <input type="radio" name="characters" value="enterprise">
111
+ dragon
112
+ </label>
113
+ </fieldset>
114
+ </section>
115
+ </form>
116
+ ```
@@ -1,36 +1,36 @@
1
- <!-- File generato automaticamente da templates/html/components/logo.html. Modificare templates/html/components/logo.html e rieseguire npm run docs:generate. -->
1
+ <!-- Automatically generated from reference/html/components/logo.html. Edit reference/html/components/logo.html and run npm run docs:generate again. -->
2
2
 
3
3
  # Logo
4
4
 
5
- Componente per mostrare un logo grafico o testuale, con supporto alle varianti dell'immagine legate al tema scuro.
5
+ Component for displaying a graphical or text logo, with image variants that support dark mode.
6
6
 
7
7
  ## PGS
8
8
 
9
- - `logo`: identifica il collegamento contenitore del marchio.
10
- - `logo-image`: identifica l'immagine grafica del logo.
11
- - `logo-text`: identifica la variante testuale del marchio.
9
+ - `logo`: identifies the brand link container.
10
+ - `logo-image`: identifies the graphical logo image.
11
+ - `logo-text`: identifies the text-based brand variant.
12
12
 
13
13
  ## PGS Options
14
14
 
15
- - `logoDarkmode`: inverte l'immagine del logo quando lo stato globale darkmode è attivo.
16
- - `logoDarkmodeFixed`: mantiene applicata l'inversione dell'immagine indipendentemente dal tema corrente.
15
+ - `logoDarkmode`: inverts the logo image when the global darkmode state is active.
16
+ - `logoDarkmodeFixed`: keeps the image inversion enabled regardless of the current theme.
17
17
 
18
18
  ## PGS States
19
19
 
20
- - `darkmode`: stato globale applicato al documento che attiva la variante logoDarkmode.
20
+ - `darkmode`: global document state that activates the logoDarkmode variant.
21
21
 
22
22
  ## Output
23
23
 
24
- Esempi HTML del logo grafico sensibile al tema e del logo testuale.
24
+ HTML examples of the theme-aware graphical logo and the text logo.
25
25
 
26
- ## Esempio
26
+ ## Example
27
27
 
28
28
  ```html
29
29
  <a aria-label="Logo" pgs="logo" pgs-option="logoDarkmode" href="/">
30
30
  <img pgs="logo-image" src="https://placehold.co/240x80?text=MyPGS" alt="MyPGS">
31
31
  </a>
32
32
 
33
- <a aria-label="Logo testuale" pgs="logo" href="/">
33
+ <a aria-label="Text logo" pgs="logo" href="/">
34
34
  <span pgs="logo-text">MyPGS</span>
35
35
  </a>
36
36
  ```