mypgs 2.1.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 (135) hide show
  1. package/.vscode/tasks.json +39 -0
  2. package/AGENTS.md +22 -21
  3. package/README.md +2 -2
  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 -7
  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 +27 -19
  15. package/assets/scss/components/_card.scss +9 -4
  16. package/assets/scss/components/_formAddon.scss +5 -1
  17. package/assets/scss/components/_logo.scss +3 -4
  18. package/assets/scss/components/_menu.scss +26 -3
  19. package/assets/scss/components/_modals.scss +2 -2
  20. package/assets/scss/components/_stepTabs.scss +2 -1
  21. package/assets/scss/index.scss +2 -3
  22. package/assets/scss/layout/_header.scss +3 -3
  23. package/assets/scss/layout/_responsive.scss +63 -0
  24. package/assets/scss/mixin/_mx-base.scss +4 -8
  25. package/assets/scss/mixin/_mx-button.scss +74 -70
  26. package/assets/scss/mixin/_mx-card.scss +33 -36
  27. package/assets/scss/mixin/_mx-form.scss +10 -5
  28. package/assets/scss/mixin/_mx-formAddon.scss +100 -58
  29. package/assets/scss/mixin/_mx-hover.scss +21 -15
  30. package/assets/scss/mixin/_mx-responsive.scss +81 -201
  31. package/demo/demo.css +9 -6
  32. package/demo/demo.html +7 -5
  33. package/demo/demo.js +34 -32
  34. package/dist/css/index.css +2502 -3507
  35. package/dist/css/index.css.map +1 -1
  36. package/dist/css/index.min.css +1 -1
  37. package/dist/javascript/index.js +7 -5
  38. package/dist/javascript/index.js.map +1 -1
  39. package/dist/javascript/index.min.js +1 -1
  40. package/docs/componenti-e-markup.md +5 -5
  41. package/docs/components/accordion.md +3 -3
  42. package/docs/components/alerts.md +67 -0
  43. package/docs/components/badges.md +11 -8
  44. package/docs/components/breadcumbs.md +1 -1
  45. package/docs/components/button.md +9 -9
  46. package/docs/components/card.md +9 -6
  47. package/docs/components/dropdown.md +1 -1
  48. package/docs/components/form.md +6 -5
  49. package/docs/components/formAddon.md +56 -19
  50. package/docs/components/logo.md +1 -1
  51. package/docs/components/menu.md +2 -2
  52. package/docs/components/modal.md +7 -6
  53. package/docs/components/notification.md +2 -2
  54. package/docs/components/search.md +8 -7
  55. package/docs/components/slides.md +5 -6
  56. package/docs/components/stepTabs.md +7 -7
  57. package/docs/components/steps.md +1 -1
  58. package/docs/components/summary.md +1 -1
  59. package/docs/components/table.md +1 -1
  60. package/docs/components/tooltip.md +4 -3
  61. package/docs/convenzioni.md +1 -1
  62. package/docs/export-e-sviluppo.md +1 -1
  63. package/docs/helper-javascript.md +1 -1
  64. package/docs/layout/body.md +1 -1
  65. package/docs/layout/footer.md +7 -3
  66. package/docs/layout/header.md +5 -4
  67. package/docs/layout/pageShell.md +11 -11
  68. package/docs/layout/responsive.md +90 -0
  69. package/docs/layout/section.md +16 -16
  70. package/docs/patterns/cookieConsent.md +6 -3
  71. package/docs/utilizzo-css-scss.md +26 -2
  72. package/package.json +1 -1
  73. package/{templates → reference}/html/components/accordion.html +2 -2
  74. package/reference/html/components/alerts.html +59 -0
  75. package/{templates → reference}/html/components/badges.html +9 -7
  76. package/{templates → reference}/html/components/button.html +7 -7
  77. package/{templates → reference}/html/components/card.html +7 -5
  78. package/{templates → reference}/html/components/form.html +5 -4
  79. package/reference/html/components/formAddon.html +109 -0
  80. package/{templates → reference}/html/components/menu.html +2 -2
  81. package/{templates → reference}/html/components/modal.html +6 -5
  82. package/{templates → reference}/html/components/notification.html +2 -2
  83. package/{templates → reference}/html/components/search.html +7 -6
  84. package/{templates → reference}/html/components/slides.html +4 -5
  85. package/{templates → reference}/html/components/stepTabs.html +6 -6
  86. package/{templates → reference}/html/components/tooltip.html +3 -2
  87. package/{templates → reference}/html/layout/footer.html +5 -2
  88. package/{templates → reference}/html/layout/header.html +4 -3
  89. package/{templates → reference}/html/layout/pageShell.html +10 -10
  90. package/reference/html/layout/responsive.html +83 -0
  91. package/{templates → reference}/html/layout/section.html +15 -15
  92. package/{templates → reference}/html/patterns/cookieConsent.html +4 -2
  93. package/{templates → reference}/react/components/accordion.jsx +1 -1
  94. package/reference/react/components/alerts.jsx +46 -0
  95. package/{templates → reference}/react/components/button.jsx +4 -4
  96. package/{templates → reference}/react/components/card.jsx +2 -2
  97. package/{templates → reference}/react/components/form.jsx +1 -1
  98. package/{templates → reference}/react/components/modal.jsx +2 -2
  99. package/{templates → reference}/react/components/search.jsx +4 -4
  100. package/{templates → reference}/react/components/slides.jsx +1 -1
  101. package/{templates → reference}/react/components/stepTabs.jsx +4 -4
  102. package/{templates → reference}/react/components/tooltip.jsx +1 -1
  103. package/{templates → reference}/react/layout/pageShell.jsx +2 -2
  104. package/reference/react/layout/responsive.jsx +61 -0
  105. package/{templates → reference}/react/layout/section.jsx +12 -12
  106. package/{templates → reference}/react/patterns/cookieConsent.jsx +1 -1
  107. package/{templates → reference}/react/patterns/footer.jsx +1 -1
  108. package/{templates → reference}/react/patterns/header.jsx +2 -2
  109. package/scripts/generate-component-docs.js +8 -8
  110. package/assets/scss/layout/_flex.scss +0 -49
  111. package/assets/scss/layout/_gap.scss +0 -21
  112. package/assets/scss/layout/_grid.scss +0 -13
  113. package/docs/layout/flex.md +0 -116
  114. package/docs/layout/grid.md +0 -116
  115. package/templates/html/components/formAddon.html +0 -72
  116. package/templates/html/layout/flex.html +0 -109
  117. package/templates/html/layout/grid.html +0 -109
  118. package/templates/react/layout/flex.jsx +0 -36
  119. package/templates/react/layout/grid.jsx +0 -36
  120. /package/{templates → reference}/html/components/breadcumbs.html +0 -0
  121. /package/{templates → reference}/html/components/dropdown.html +0 -0
  122. /package/{templates → reference}/html/components/logo.html +0 -0
  123. /package/{templates → reference}/html/components/steps.html +0 -0
  124. /package/{templates → reference}/html/components/summary.html +0 -0
  125. /package/{templates → reference}/html/components/table.html +0 -0
  126. /package/{templates → reference}/html/layout/body.html +0 -0
  127. /package/{templates → reference}/react/components/breadcumbs.jsx +0 -0
  128. /package/{templates → reference}/react/components/dropdown.jsx +0 -0
  129. /package/{templates → reference}/react/components/logo.jsx +0 -0
  130. /package/{templates → reference}/react/components/menu.jsx +0 -0
  131. /package/{templates → reference}/react/components/notification.jsx +0 -0
  132. /package/{templates → reference}/react/components/steps.jsx +0 -0
  133. /package/{templates → reference}/react/components/summary.jsx +0 -0
  134. /package/{templates → reference}/react/components/table.jsx +0 -0
  135. /package/{templates → reference}/react/layout/body.jsx +0 -0
package/demo/demo.js CHANGED
@@ -1,10 +1,10 @@
1
1
  //# DEMO PAGE
2
2
 
3
- //= demo Renderer HTML
3
+ //= Reference Renderer HTML
4
4
  const demoRenderer = {
5
- templateFiles: [
6
- "components/form.html",
5
+ referenceFiles: [
7
6
  "components/formAddon.html",
7
+ "components/form.html",
8
8
  "components/search.html",
9
9
  "components/summary.html",
10
10
  "components/menu.html",
@@ -12,6 +12,7 @@ const demoRenderer = {
12
12
  "components/modal.html",
13
13
  "components/stepTabs.html",
14
14
  "components/accordion.html",
15
+ "components/alerts.html",
15
16
  "components/badges.html",
16
17
  "components/breadcumbs.html",
17
18
  "components/button.html",
@@ -25,23 +26,22 @@ const demoRenderer = {
25
26
  "components/notification.html",
26
27
  "patterns/cookieConsent.html",
27
28
  "layout/body.html",
28
- "layout/flex.html",
29
- "layout/grid.html",
29
+ "layout/responsive.html",
30
30
  "layout/footer.html",
31
31
  "layout/header.html",
32
32
  "layout/section.html",
33
33
  "layout/pageShell.html",
34
34
  ],
35
35
 
36
- getTemplateTitle(path) {
36
+ getReferenceTitle(path) {
37
37
  return path.replace(".html", "").replace("/", " / ");
38
38
  },
39
39
 
40
- stripTemplateDocumentation(html) {
40
+ stripReferenceDocumentation(html) {
41
41
  return html.replace(/^\uFEFF?<!--[\t\r\n ]*\/\*\*[\s\S]*?\*\/[\t\r\n ]*-->[\t\r\n ]*/, "");
42
42
  },
43
43
 
44
- renderSourceTemplate(section, html) {
44
+ renderSourceReference(section, html) {
45
45
  const pre = document.createElement("pre");
46
46
  const code = document.createElement("code");
47
47
  code.textContent = html.trim();
@@ -49,9 +49,9 @@ const demoRenderer = {
49
49
  section.append(pre);
50
50
  },
51
51
 
52
- renderTemplate(section, path, html) {
52
+ renderReference(section, path, html) {
53
53
  const content = document.createElement("div");
54
- content.setAttribute("pgs", "container flexColumnElements");
54
+ content.setAttribute("pgs", "container flexColumn gapElements");
55
55
  content.innerHTML = html;
56
56
  section.append(content);
57
57
  },
@@ -64,15 +64,15 @@ const demoRenderer = {
64
64
 
65
65
  renderTitle(section, path) {
66
66
  const title = document.createElement("p");
67
- title.classList.add("template-title");
68
- title.innerHTML = "<strong>" + this.getTemplateTitle(path) + "</strong>";
67
+ title.classList.add("reference-title");
68
+ title.innerHTML = "<strong>" + this.getReferenceTitle(path) + "</strong>";
69
69
  section.append(title);
70
70
  },
71
71
 
72
- async loadTemplate(path) {
73
- const response = await fetch(`../templates/html/${path}`);
72
+ async loadReference(path) {
73
+ const response = await fetch(`../reference/html/${path}`);
74
74
  if (!response.ok) throw new Error(`${path}: ${response.status}`);
75
- return this.stripTemplateDocumentation(await response.text());
75
+ return this.stripReferenceDocumentation(await response.text());
76
76
  },
77
77
 
78
78
  loadPgsJavascript() {
@@ -86,22 +86,22 @@ const demoRenderer = {
86
86
  },
87
87
 
88
88
  async boot() {
89
- const BEEFORE = document.getElementById("templates-demo-before");
90
- const MAIN = document.getElementById("templates-demo-main");
91
- const AFTER = document.getElementById("templates-demo-after");
89
+ const BEEFORE = document.getElementById("reference-demo-before");
90
+ const MAIN = document.getElementById("reference-demo-main");
91
+ const AFTER = document.getElementById("reference-demo-after");
92
92
 
93
- for (const path of this.templateFiles) {
93
+ for (const path of this.referenceFiles) {
94
94
  const isHeader = path === "layout/header.html";
95
95
  const isfooter = path === "layout/footer.html";
96
96
  const isBody = path === "layout/body.html";
97
97
 
98
98
  if (isHeader || isfooter) {
99
99
  try {
100
- const html = await this.loadTemplate(path);
100
+ const html = await this.loadReference(path);
101
101
  this.renderLayout(isHeader ? BEEFORE : AFTER, path, html);
102
102
  } catch (error) {
103
103
  const message = document.createElement("p");
104
- message.textContent = `Template non caricato: ${error.message}`;
104
+ message.textContent = `Riferimento non caricato: ${error.message}`;
105
105
  (isHeader ? BEEFORE : AFTER).append(message);
106
106
  }
107
107
  continue;
@@ -111,24 +111,24 @@ const demoRenderer = {
111
111
  const isSection = path !== "layout/section.html" && path !== "layout/pageShell.html"
112
112
  isSection ? section = document.createElement("section") : section = document.createElement("div");
113
113
 
114
- if (isSection) section.setAttribute("pgs", "section flexColumnElements");
114
+ if (isSection) section.setAttribute("pgs", "section flexColumn gapElements");
115
115
 
116
- section.dataset.template = path;
116
+ section.dataset.reference = path;
117
117
  this.renderTitle(section, path);
118
118
 
119
119
  if (isBody) {
120
- const html = await this.loadTemplate(path);
121
- this.renderSourceTemplate(section, html);
120
+ const html = await this.loadReference(path);
121
+ this.renderSourceReference(section, html);
122
122
  MAIN.append(section);
123
123
  continue;
124
124
  }
125
125
 
126
126
  try {
127
- const html = await this.loadTemplate(path);
128
- this.renderTemplate(section, path, html);
127
+ const html = await this.loadReference(path);
128
+ this.renderReference(section, path, html);
129
129
  } catch (error) {
130
130
  const message = document.createElement("p");
131
- message.textContent = `Template non caricato: ${error.message}`;
131
+ message.textContent = `Riferimento non caricato: ${error.message}`;
132
132
  section.append(message);
133
133
  }
134
134
 
@@ -140,10 +140,12 @@ const demoRenderer = {
140
140
  }
141
141
 
142
142
  try {
143
- //+ ADD FUNCTION
143
+ //# CORE
144
144
  await this.loadPgsJavascript();
145
145
  configureSearchDemo();
146
146
  configureFormDemo();
147
+ document.body.classList.remove('is-loading');
148
+ //# end CORE
147
149
  } catch (error) {
148
150
  console.error("Demo PGS non inizializzata.", error);
149
151
  }
@@ -153,10 +155,10 @@ const demoRenderer = {
153
155
  //= Search Demo
154
156
  function configureSearchDemo() {
155
157
  const pgsApi = globalThis.pgs;
156
- const section = document.querySelector('[data-template="components/search.html"]');
158
+ const section = document.querySelector('[data-reference="components/search.html"]');
157
159
  if (!pgsApi?.search || !section) return;
158
160
 
159
- pgsApi(section).querySelectorAll("search").forEach(search => {
161
+ pgsApi(document).querySelectorAll("search").forEach(search => {
160
162
  pgsApi.search.api(search)?.configure({
161
163
  minLength: 2,
162
164
  debounce: 250,
@@ -205,7 +207,7 @@ function configureSearchDemo() {
205
207
  //= Form Demo
206
208
  function configureFormDemo() {
207
209
  const pgsApi = globalThis.pgs;
208
- const section = document.querySelector('[data-template="components/form.html"]');
210
+ const section = document.querySelector('[data-reference="components/form.html"]');
209
211
  const form = section?.querySelector('[pgs~="form"]');
210
212
  if (!form) return;
211
213