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
@@ -0,0 +1,39 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "Webpack watch",
6
+ "type": "shell",
7
+ "command": "npm run \"start watch\"",
8
+ "options": {
9
+ "cwd": "${workspaceFolder}"
10
+ },
11
+ "problemMatcher": [],
12
+ "group": {
13
+ "kind": "build",
14
+ "isDefault": true
15
+ },
16
+ "presentation": {
17
+ "reveal": "always",
18
+ "panel": "shared"
19
+ }
20
+ },
21
+ {
22
+ "label": "Webpack",
23
+ "type": "shell",
24
+ "command": "npm run start",
25
+ "options": {
26
+ "cwd": "${workspaceFolder}"
27
+ },
28
+ "problemMatcher": [],
29
+ "group": {
30
+ "kind": "build",
31
+ "isDefault": false
32
+ },
33
+ "presentation": {
34
+ "reveal": "always",
35
+ "panel": "shared"
36
+ }
37
+ }
38
+ ]
39
+ }
package/AGENTS.md CHANGED
@@ -9,7 +9,7 @@ This guide is for any AI/Codex agent that initializes or modifies a project base
9
9
  - HTML `pgs` attributes as the contract between markup, SCSS, and JavaScript;
10
10
  - SCSS sources with base styles, layouts, components, patterns, CSS variables, and mixins;
11
11
  - JavaScript modules for recurring behaviors such as accordions, dropdowns, menus, modals, search suggestions, slides, steps, step tabs, notifications, header, cookie consent, and dark mode;
12
- - example HTML templates in `templates/`;
12
+ - canonical HTML and React references in `reference/`;
13
13
  - compiled assets in `dist/`.
14
14
 
15
15
  It solves the problem of rewriting layouts, buttons, forms, modals, menus, tabs, spacing, states, and base interactions every time. It should be used as the design system foundation because it centralizes naming, spacing, colors, radii, shadows, accessible behaviors, and reusable patterns.
@@ -26,7 +26,7 @@ Write custom code only when the pattern does not exist, or when you are adding a
26
26
  ## 2. General Usage Rules
27
27
 
28
28
  - Use `mypgs` as the first choice for layouts, components, helpers, variables, utilities, and available patterns.
29
- - Do not recreate existing components from scratch: buttons, forms, dropdowns, modals, menus, slides, accordions, steps, stepTabs, notifications, tooltips, tables, search, logos, headers, footers, and cookie consent.
29
+ - Do not recreate existing components from scratch: alerts, buttons, forms, dropdowns, modals, menus, slides, accordions, steps, stepTabs, notifications, tooltips, tables, search, logos, headers, footers, and cookie consent.
30
30
  - Do not duplicate logic already handled by the `mypgs` JS modules, such as modal open/close, accordion state, Popover API dropdowns, step tabs, notifications, or form validation.
31
31
  - Keep `pgs` tokens in markup, SCSS selectors, and JS queries consistent.
32
32
  - Prefer composing `pgs` tokens over adding new CSS classes.
@@ -63,22 +63,22 @@ Files analyzed:
63
63
  - `assets/scss/components/*`
64
64
  - `assets/scss/patterns/*`
65
65
  - `assets/scss/mixin/*`
66
- - `templates/html/components/*`
67
- - `templates/html/layout/*`
68
- - `templates/html/patterns/*`
66
+ - `reference/html/components/*`
67
+ - `reference/html/layout/*`
68
+ - `reference/html/patterns/*`
69
69
 
70
70
  Patterns found:
71
71
 
72
72
  - `pgs` is the main attribute: tokens are separated by spaces, for example `pgs="button modal-button"`.
73
73
  - `assets/scss/index.scss` imports base, layout, components, and patterns; layouts/components/patterns are almost all scoped under `[pgs~=initP]`.
74
- - The main markup must enable the library with `htmlBase initP`, and the body with base body tokens. Use `demo/demo.html` and `templates/html/layout/body.html` as the canonical references.
75
- - Components use a root token and child tokens with a consistent prefix. Use `templates/html/components/` as the canonical markup source.
74
+ - The main markup must enable the library with `htmlBase initP`, and the body with base body tokens. Use `demo/demo.html` and `reference/html/layout/body.html` as the canonical references.
75
+ - Components use a root token and child tokens with a consistent prefix. Use `reference/html/components/` as the canonical markup source.
76
76
 
77
77
  - Runtime states use `pgs-state`, for example `open`, `is-active`, `is-completed`, `is-locked`, `success`, `error`, `warning`, and `info`.
78
78
  - La ricerca componibile usa esclusivamente `pgs="search"` come root grafico e comportamentale e il figlio opzionale `pgs="search-suggestions"`. La sorgente dati si configura tramite `pgs.search.api(element)?.configure({ source })` e deve restare indipendente dal backend.
79
- - Configurable options use `pgs-option`, with simple tokens or values inside square brackets. Prefer copying the current option syntax from the relevant template rather than duplicating examples in this guide.
79
+ - Configurable options use `pgs-option`, with simple tokens or values inside square brackets. Prefer copying the current option syntax from the relevant reference file rather than duplicating examples in this guide.
80
80
 
81
- - Naming is mostly camelCase for compound tokens (`menuHorizontal`, `buttonStrong`, `flexColumnElements`) and kebab-like for component sub-elements (`accordion-button`, `modal-dialog-content`, `cookieConsent-actionAccept`).
81
+ - Naming is mostly camelCase for compound tokens (`menuHorizontal`, `buttonStrong`, `flexColumn gapElements`) and kebab-like for component sub-elements (`accordion-button`, `modal-dialog-content`, `cookieConsent-actionAccept`).
82
82
  - JS modules export objects with `init` and/or `api`; `_imports.js` registers them with `pgs.registerModules` for direct `pgs.*` access.
83
83
 
84
84
  ## 4. SCSS Guidelines
@@ -106,7 +106,8 @@ import "mypgs/style.css";
106
106
  SCSS rules:
107
107
 
108
108
  - Use the existing custom properties, for example `--color-primary`, `--color-box`, `--color-text`, `--padding`, `--padding-page`, `--gap-texts`, `--gap-elements`, `--gap-sections`, `--border-radius`, `--border-radius-input`, `--border-complete`, `--box-shadow`, and `--focus-visible`.
109
- - Use existing mixins and tokens instead of rewriting layouts: `flexColumn`, `flexRow`, `grid-*`, `section`, `container`, `card`, `button`, `form`.
109
+ - Use existing mixins and tokens instead of rewriting layouts: `flexColumn`, `flexRow`, `grid` with `pgs-option="column-N"`, `section`, `container`, `card`, `button`, `form`.
110
+ - Compose buttons explicitly with `buttonBase`, either `buttonContent` or `buttonIcon`, either `buttonHover` or `buttonNohover`, and any required variant such as `buttonStrong`, `buttonMini`, `buttonBig`, or `buttonClose`. Variant mixins do not include the base button styles.
110
111
  - Configure dropdown placement with `pgs-option="position[side align]"`, for example `position[top left]`, `position[bottom right]`, or `position[left center]`; do not use a SCSS/CSS custom property for dropdown placement.
111
112
  - Prefer overrides through custom properties on the component:
112
113
 
@@ -222,16 +223,16 @@ pgs.modal.api(modalEl)?.open();
222
223
 
223
224
  ## 6. Components and Markup
224
225
 
225
- Use the templates as the single source of truth for component and layout markup. Do not copy full HTML examples into this guide; this avoids drift when templates change.
226
+ Use the reference files as the single source of truth for component and layout markup. Do not copy full HTML examples into this guide; this avoids drift when references change.
226
227
 
227
- Canonical template references:
228
+ Canonical reference files:
228
229
 
229
- - Layouts: `templates/html/layout/body.html`, `templates/html/layout/flex.html`, `templates/html/layout/grid.html`, `templates/html/layout/pageShell.html`, `templates/html/layout/section.html`
230
- - Components: `templates/html/components/accordion.html`, `templates/html/components/breadcumbs.html`, `templates/html/components/button.html`, `templates/html/components/card.html`, `templates/html/components/dropdown.html`, `templates/html/components/form.html`, `templates/html/components/logo.html`, `templates/html/components/menu.html`, `templates/html/components/modal.html`, `templates/html/components/notification.html`, `templates/html/components/search.html`, `templates/html/components/slides.html`, `templates/html/components/stepTabs.html`, `templates/html/components/steps.html`, `templates/html/components/table.html`, `templates/html/components/tooltip.html`
231
- - Patterns: `templates/html/patterns/cookieConsent.html`, `templates/html/patterns/footer.html`, `templates/html/patterns/header.html`
230
+ - Layouts: `reference/html/layout/body.html`, `reference/html/layout/responsive.html`, `reference/html/layout/pageShell.html`, `reference/html/layout/section.html`
231
+ - Components: `reference/html/components/accordion.html`, `reference/html/components/alerts.html`, `reference/html/components/breadcumbs.html`, `reference/html/components/button.html`, `reference/html/components/card.html`, `reference/html/components/dropdown.html`, `reference/html/components/form.html`, `reference/html/components/logo.html`, `reference/html/components/menu.html`, `reference/html/components/modal.html`, `reference/html/components/notification.html`, `reference/html/components/search.html`, `reference/html/components/slides.html`, `reference/html/components/stepTabs.html`, `reference/html/components/steps.html`, `reference/html/components/table.html`, `reference/html/components/tooltip.html`
232
+ - Patterns: `reference/html/patterns/cookieConsent.html`, `reference/html/patterns/footer.html`, `reference/html/patterns/header.html`
232
233
  - Complete demo assembly. DO NOT use this for inspiration. It is only used to show all the modules: `demo/demo.html`
233
234
 
234
- Before creating markup, open the relevant template and reuse its current structure, tokens, ARIA attributes, and `pgs-option` syntax.
235
+ Before creating markup, open the relevant reference file and reuse its current structure, tokens, ARIA attributes, and `pgs-option` syntax.
235
236
 
236
237
  To extend a component:
237
238
 
@@ -244,7 +245,7 @@ To extend a component:
244
245
 
245
246
  - Do not replace `mypgs` with custom solutions without a clear technical reason.
246
247
  - Do not hardcode colors if variables or custom properties exist; always use `var(--color-primary)`, etc.
247
- - Do not create duplicate components for buttons, forms, modals, dropdowns, slides, tabs, notifications, or menus.
248
+ - Do not create duplicate components for alerts, buttons, forms, modals, dropdowns, slides, tabs, notifications, or menus.
248
249
  - Do not duplicate open, close, state, or accessibility logic already handled by the modules.
249
250
  - Do not make the code more complex than necessary.
250
251
  - Do not invent APIs: if a method is not present in `assets/javascript/*` or in the `.d.ts` files, it must be verified or explicitly added.
@@ -266,7 +267,7 @@ Source SCSS import:
266
267
  @include meta.load-css("../../node_modules/mypgs/assets/scss/index.scss");
267
268
  ```
268
269
 
269
- Recommended: use PGS layout tokens from `templates/html/layout/`.
270
+ Recommended: use PGS layout tokens from `reference/html/layout/`.
270
271
 
271
272
  Avoid: equivalent custom layout with ad hoc classes when a PGS layout token already exists.
272
273
 
@@ -316,7 +317,7 @@ Avoid: creating a separate toast system outside `pgs.notification`.
316
317
 
317
318
  Before developing a new feature:
318
319
 
319
- - check `README.md`, `templates/`, `assets/scss/`, and `assets/javascript/`;
320
+ - check `README.md`, `reference/`, `assets/scss/`, and `assets/javascript/`;
320
321
  - search for existing tokens or APIs with `rg "featureName|pgs-token"`;
321
322
  - verify whether `mypgs` already provides suitable components, helpers, mixins, or variables;
322
323
  - use naming consistent with the existing project;
@@ -331,7 +332,7 @@ For a new reusable component:
331
332
  - create JS in `assets/javascript/components/` or `assets/javascript/patterns/` only if behavior is needed;
332
333
  - export an object with `init` and/or `api` when the module needs a public API;
333
334
  - register it in `assets/javascript/_imports.js` with `pgs.registerModules` if it must be available as `pgs.moduleName`;
334
- - add a template in `templates/html/components/` or `templates/html/layout/`;
335
+ - add a reference file in `reference/html/components/` or `reference/html/layout/`;
335
336
  - update `README.md` and this guide if the usage changes.
336
337
 
337
338
  Example for a new module:
@@ -347,7 +348,7 @@ pgs.registerModules({
347
348
  ## 10. Quick AI Checklist
348
349
 
349
350
  - Did I check whether a suitable `pgs` token or component already exists?
350
- - Did I consult `templates/` to copy the correct markup?
351
+ - Did I consult `reference/` to copy the correct markup?
351
352
  - Did I enable `htmlBase initP` and the base body tokens when the full library is needed?
352
353
  - Am I using PGS CSS variables and mixins instead of hardcoded values?
353
354
  - Am I using `pgs-state` for runtime states and `pgs-option` for configuration?
package/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  `mypgs` is a shared frontend library for building consistent interfaces through `pgs` attributes, SCSS sources, UI components, and reusable JavaScript behaviors.
4
4
 
5
- The library provides a design-system foundation: layouts, spacing, colors, buttons, forms, menus, modals, dropdowns, suggestion search, slides, notifications, and recurring patterns are defined once and reused across projects.
5
+ The library provides a design-system foundation: layouts, spacing, colors, buttons, forms, alerts, menus, modals, dropdowns, suggestion search, slides, notifications, and recurring patterns are defined once and reused across projects.
6
6
 
7
7
  ## What it includes
8
8
 
9
9
  - `assets/scss/`: SCSS sources divided into base, layouts, components, patterns, and mixins.
10
10
  - `assets/javascript/`: the `pgs` helper, JavaScript components, functions, and patterns.
11
- - `templates/`: ready-to-use HTML examples for components and layouts.
11
+ - `reference/`: canonical HTML and React references for components, layouts, and patterns.
12
12
  - `dist/css/`: compiled CSS.
13
13
  - `dist/javascript/`: compiled JavaScript bundle.
14
14
  - `dist/index.d.ts`: TypeScript declarations exported by the package.
@@ -22,7 +22,8 @@ function PGS_menu_init(root = document) {
22
22
  pgs(li).add("dropdown")
23
23
  pgs(li).option.setValueBrackets("position", "bottom right")
24
24
  pgs(button).add("dropdown-button")
25
- pgs(button).add("buttonNohover")
25
+ pgs(button).add("button")
26
+ pgs(button).option.add("buttonNohover")
26
27
  pgs(ul).add("dropdown-content")
27
28
 
28
29
  }
@@ -19,7 +19,7 @@ function initializeModal(MODAL, existingDialog = null) {
19
19
  let historyTimeout = null;
20
20
 
21
21
  //== SELECTOR
22
- const DOMButtonClose = '<button pgs="buttonClose modal-close" type="button" tabindex="0" aria-label="Chiudi"><i class="fa-solid fa-close"></i></button>';
22
+ const DOMButtonClose = '<button pgs="button modal-close" pgs-option="buttonClose" type="button" tabindex="0" aria-label="Chiudi"><i class="fa-solid fa-close"></i></button>';
23
23
  const modalContentHeader = pgs(DIALOG).querySelector("modal-dialog-content-header");
24
24
 
25
25
 
@@ -95,7 +95,8 @@ const fn_notification = {
95
95
  btnDelete.type = "button";
96
96
  btnDelete.ariaLabel = "Rimuovi notifica";
97
97
  btnDelete.innerHTML = '<i class="fa-solid fa-xmark"></i>';
98
- btnDelete.setAttribute("pgs", "buttonClose");
98
+ btnDelete.setAttribute("pgs", "button");
99
+ btnDelete.setAttribute("pgs-option", "buttonClose");
99
100
  notification.insertAdjacentElement("afterbegin", btnDelete);
100
101
 
101
102
  //== event
@@ -36,10 +36,10 @@ class PGS_Slides {
36
36
 
37
37
  //== PULSANTI
38
38
  if (!pgs(EL).querySelector('slides-prec')) {
39
- EL.insertAdjacentHTML("afterbegin", `<button pgs="slides-prec buttonIcon" type="button" class="precButton" aria-label="slide precedente"> <span> <i class="fa-solid fa-arrow-left"></i></span></button>`);
39
+ EL.insertAdjacentHTML("afterbegin", `<button pgs="slides-prec button" pgs-option="buttonIcon" type="button" class="precButton" aria-label="slide precedente"> <span> <i class="fa-solid fa-arrow-left"></i></span></button>`);
40
40
  }
41
41
  if (!pgs(EL).querySelector('slides-next')) {
42
- EL.insertAdjacentHTML("beforeend", `<button pgs="slides-next buttonIcon" type="button" class="nextButton" aria-label="prossima slide"> <span> <i class="fa-solid fa-arrow-right"></i></span></button>`);
42
+ EL.insertAdjacentHTML("beforeend", `<button pgs="slides-next button" pgs-option="buttonIcon" type="button" class="nextButton" aria-label="prossima slide"> <span> <i class="fa-solid fa-arrow-right"></i></span></button>`);
43
43
  }
44
44
 
45
45
  //== DOTS
@@ -47,12 +47,12 @@
47
47
  i {
48
48
  line-height: 1.2;
49
49
  font-size: var(--fa-size);
50
- transition: color 300ms;
50
+ // transition: color 300ms;
51
51
 
52
- &::before,
53
- &::after {
54
- transition: color 300ms;
55
- }
52
+ // &::before,
53
+ // &::after {
54
+ // transition: color 300ms;
55
+ // }
56
56
  }
57
57
 
58
58
  img,
@@ -1,10 +1,6 @@
1
1
  @use "../mixin/mixin" as *;
2
2
 
3
3
  //# GENERAL
4
- [pgs~=boxtext] {
5
- @include boxtext();
6
- }
7
-
8
4
  [pgs~=darkmode] {
9
5
  color-scheme: dark;
10
6
  }
@@ -13,6 +9,24 @@
13
9
  color-scheme: light;
14
10
  }
15
11
 
12
+ [pgs~=blur] {
13
+ backdrop-filter: var(--blur);
14
+ }
15
+
16
+ [pgs~=appearanceNone] {
17
+ all: unset;
18
+ appearance: none;
19
+ }
20
+
21
+ [pgs~=pointer] {
22
+ cursor: pointer;
23
+ }
24
+
25
+ [pgs~=hidden] {
26
+ display: none !important;
27
+ }
28
+
29
+ //= IMG
16
30
  [pgs~=imgCover] {
17
31
  object-fit: cover;
18
32
  }
@@ -21,6 +35,7 @@
21
35
  object-fit: contain;
22
36
  }
23
37
 
38
+ //= BORDER RADIUS
24
39
  [pgs~=borderRadius] {
25
40
  border-radius: var(--border-radius);
26
41
  }
@@ -33,19 +48,13 @@
33
48
  border-radius: var(--border-radius-external);
34
49
  }
35
50
 
36
- [pgs~=blur] {
37
- backdrop-filter: var(--blur);
38
- }
39
-
40
- [pgs~=appearanceNone] {
41
- all: unset;
42
- appearance: none;
43
- }
44
-
45
- [pgs~=pointer] {
46
- cursor: pointer;
47
- }
51
+ //= HOVER
52
+ [pgs~=hover] {
53
+ @include hover();
48
54
 
49
- [pgs~=hidden] {
50
- display: none !important;
55
+ &:not(:disabled):hover {
56
+ [pgs~=hover-text] {
57
+ color: var(--hover-color);
58
+ }
59
+ }
51
60
  }
@@ -16,7 +16,7 @@
16
16
  --border-complete: var(--border) var(--border-color);
17
17
  --border-complete-hover: var(--border) var(--color-white);
18
18
  --box-shadow: 0px 0px 38px 0px #0000000d;
19
- --text-shadow: 0px 0px 50px #000000;
19
+ --text-shadow: 0px 0px 50px #00000060;
20
20
  --backdrop: #0000003e;
21
21
  --blur: blur(20px);
22
22
  --page-top: calc(var(--heightOfHeader) + var(--heightOfHeader));
@@ -8,11 +8,8 @@
8
8
  width: 100% !important;
9
9
  position: relative;
10
10
  user-select: unset !important;
11
-
12
- &:not([pgs-state~=open]) {
13
- @include button(true);
14
- --button-size: var(--padding-2);
15
- }
11
+ @include buttonBase();
12
+ @include buttonContent();
16
13
 
17
14
  //= BUTTON
18
15
  [pgs~="accordion-button"] {
@@ -55,9 +52,14 @@
55
52
  overflow: hidden;
56
53
  }
57
54
 
58
- //= OPEN
55
+ //= OPEN - NOT OPEN
56
+ &:not([pgs-state~=open]) {
57
+ @include buttonHover();
58
+ --button-size: var(--padding-2);
59
+ }
60
+
59
61
  &[pgs-state~=open] {
60
- @include button(false);
62
+ @include buttonNohover();
61
63
  --button-size: var(--padding-2);
62
64
  margin-top: var(--padding);
63
65
 
@@ -0,0 +1,71 @@
1
+ @use "../mixin/mixin" as *;
2
+
3
+ [pgs~="alert"] {
4
+ --alert-accent: var(--color-primary);
5
+ --alert-background: var(--color-primary-soft);
6
+ --alert-color: var(--color-text);
7
+ --alert-title-color: var(--alert-accent);
8
+ --alert-padding: var(--padding-2);
9
+ --alert-gap: var(--gap-texts);
10
+ --alert-border-size: 0.4rem;
11
+ display: grid;
12
+ grid-template-columns: auto minmax(0, 1fr);
13
+ align-items: start;
14
+ gap: var(--alert-gap);
15
+ width: 100%;
16
+ padding: var(--alert-padding);
17
+ border: var(--border-complete);
18
+ border-inline-start: var(--alert-border-size) solid var(--alert-accent);
19
+ border-radius: var(--border-radius-input);
20
+ background: var(--alert-background);
21
+ color: var(--alert-color);
22
+
23
+ [pgs~="alert-icon"] {
24
+ display: grid;
25
+ place-items: center;
26
+ min-inline-size: 2.4rem;
27
+ min-block-size: 2.4rem;
28
+ color: var(--alert-accent);
29
+ font-size: 2rem;
30
+ line-height: 1;
31
+ --fa-size: 2rem;
32
+ --fa-primary-color: var(--alert-accent);
33
+ --fa-secondary-color: var(--alert-accent);
34
+ --fa-secondary-opacity: 0.5;
35
+ }
36
+
37
+ [pgs~="alert-content"] {
38
+ @include flexColumn(calc(var(--alert-gap) / 2));
39
+ min-width: 0;
40
+ }
41
+
42
+ [pgs~="alert-title"] {
43
+ color: var(--alert-title-color);
44
+ font-weight: 800;
45
+ line-height: 1.2;
46
+ }
47
+
48
+ p {
49
+ color: var(--alert-color);
50
+ }
51
+
52
+ &[pgs-state~="info"] {
53
+ --alert-accent: var(--color-link);
54
+ --alert-background: var(--color-linkBackgorud);
55
+ }
56
+
57
+ &[pgs-state~="success"] {
58
+ --alert-accent: var(--color-success);
59
+ --alert-background: var(--color-success-background);
60
+ }
61
+
62
+ &[pgs-state~="warning"] {
63
+ --alert-accent: var(--color-warning);
64
+ --alert-background: var(--color-warning-background);
65
+ }
66
+
67
+ &[pgs-state~="error"] {
68
+ --alert-accent: var(--color-error);
69
+ --alert-background: var(--color-error-background);
70
+ }
71
+ }
@@ -33,61 +33,53 @@
33
33
  }
34
34
  }
35
35
 
36
- [pgs~="badge"],
37
- [pgs~="badgePrimary"],
38
- [pgs~="badgeStrong"],
39
- [pgs~="badgeSuccess"],
40
- [pgs~="badgeWarning"],
41
- [pgs~="badgeError"],
42
- [pgs~="badgeInfo"],
43
- [pgs~="badgeNeutral"],
44
- [pgs~="badgeDot"] {
36
+ [pgs~="badge"] {
45
37
  @include _badge();
46
- }
47
38
 
48
- [pgs~="badgePrimary"] {
49
- --badge-background: var(--color-primary-soft);
50
- --badge-color: var(--color-primary-strong);
51
- }
39
+ &[pgs-option~="badgePrimary"] {
40
+ --badge-background: var(--color-primary-soft);
41
+ --badge-color: var(--color-primary-strong);
42
+ }
52
43
 
53
- [pgs~="badgeStrong"] {
54
- --badge-background: var(--color-primary);
55
- --badge-color: var(--color-whiteFixed);
56
- }
44
+ &[pgs-option~="badgeStrong"] {
45
+ --badge-background: var(--color-primary);
46
+ --badge-color: var(--color-whiteFixed);
47
+ }
57
48
 
58
- [pgs~="badgeSuccess"] {
59
- --badge-background: var(--color-success-background);
60
- --badge-color: var(--color-success);
61
- }
49
+ &[pgs-option~="badgeSuccess"] {
50
+ --badge-background: var(--color-success-background);
51
+ --badge-color: var(--color-success);
52
+ }
62
53
 
63
- [pgs~="badgeWarning"] {
64
- --badge-background: var(--color-warning-background);
65
- --badge-color: var(--color-warning);
66
- }
54
+ &[pgs-option~="badgeWarning"] {
55
+ --badge-background: var(--color-warning-background);
56
+ --badge-color: var(--color-warning);
57
+ }
67
58
 
68
- [pgs~="badgeError"] {
69
- --badge-background: var(--color-error-background);
70
- --badge-color: var(--color-error);
71
- }
59
+ &[pgs-option~="badgeError"] {
60
+ --badge-background: var(--color-error-background);
61
+ --badge-color: var(--color-error);
62
+ }
72
63
 
73
- [pgs~="badgeInfo"] {
74
- --badge-background: var(--color-linkBackgorud);
75
- --badge-color: var(--color-link);
76
- }
64
+ &[pgs-option~="badgeInfo"] {
65
+ --badge-background: var(--color-linkBackgorud);
66
+ --badge-color: var(--color-link);
67
+ }
77
68
 
78
- [pgs~="badgeNeutral"] {
79
- --badge-background: var(--color-box-transparent);
80
- --badge-color: var(--color-text);
81
- }
69
+ &[pgs-option~="badgeNeutral"] {
70
+ --badge-background: var(--color-box-transparent);
71
+ --badge-color: var(--color-text);
72
+ }
82
73
 
83
- [pgs~="badgeDot"] {
84
- &::before {
85
- content: "";
86
- display: block;
87
- inline-size: 0.65em;
88
- block-size: 0.65em;
89
- flex: 0 0 auto;
90
- border-radius: 50%;
91
- background: currentColor;
74
+ &[pgs-option~="badgeDot"] {
75
+ &::before {
76
+ content: "";
77
+ display: block;
78
+ inline-size: 0.65em;
79
+ block-size: 0.65em;
80
+ flex: 0 0 auto;
81
+ border-radius: 50%;
82
+ background: currentColor;
83
+ }
92
84
  }
93
- }
85
+ }
@@ -2,29 +2,37 @@
2
2
 
3
3
  //# BUTTON
4
4
  [pgs~=button] {
5
- @include button()
6
- }
5
+ @include buttonBase();
7
6
 
8
- [pgs~=buttonNohover] {
9
- @include button(false)
10
- }
7
+ &:not([pgs-option~=buttonIcon], [pgs-option~=buttonMini], [pgs-option~=buttonClose]) {
8
+ @include buttonContent();
9
+ }
11
10
 
12
- [pgs~=buttonIcon] {
13
- @include button(true, true);
14
- }
11
+ &:is([pgs-option~=buttonIcon], [pgs-option~=buttonMini], [pgs-option~=buttonClose]) {
12
+ @include buttonIcon();
13
+ }
15
14
 
16
- [pgs~=buttonStrong] {
17
- @include button(true, false, true)
18
- }
15
+ &:not([pgs-option~=buttonNohover]) {
16
+ @include buttonHover();
17
+ }
19
18
 
20
- [pgs~=buttonMini] {
21
- @include buttonMini();
22
- }
19
+ &[pgs-option~=buttonNohover] {
20
+ @include buttonNohover();
21
+ }
23
22
 
24
- [pgs~=buttonBig] {
25
- @include buttonBig()
26
- }
23
+ &[pgs-option~=buttonStrong] {
24
+ @include buttonStrong();
25
+ }
26
+
27
+ &[pgs-option~=buttonMini] {
28
+ @include buttonMini();
29
+ }
30
+
31
+ &[pgs-option~=buttonBig] {
32
+ @include buttonBig();
33
+ }
27
34
 
28
- [pgs~=buttonClose] {
29
- @include buttonClose();
35
+ &[pgs-option~=buttonClose] {
36
+ @include buttonClose();
37
+ }
30
38
  }
@@ -1,10 +1,15 @@
1
1
  @use "../mixin/mixin" as *;
2
2
 
3
- [pgs~=card],
4
- [pgs~=cardImg] {
3
+ [pgs~=card]{
5
4
  @include card();
6
5
 
7
6
  [pgs~=card-img] {
8
- @include card-insideImg();
7
+ @include cardAndWell-insideImg("card");
9
8
  }
10
- }
9
+ }
10
+ [pgs~=well] {
11
+ @include well();
12
+ [pgs~=card-img] {
13
+ @include cardAndWell-insideImg("box");
14
+ }
15
+ }
@@ -15,4 +15,8 @@
15
15
 
16
16
  [pgs~=chips] {
17
17
  @include chips();
18
- }
18
+ }
19
+
20
+ [pgs~=chip] {
21
+ @include chip();
22
+ }
@@ -8,15 +8,14 @@
8
8
  --logo-finter: invert(1) hue-rotate(180deg) brightness(1.5);
9
9
 
10
10
  //== DARKMODE
11
- @at-root [pgs-state~=darkmode] #{&}[pgs-option~="logoDarkmode"] [pgs~="logo-image"] {
11
+ &:is(body[pgs-state~="darkmode"] [pgs-option~="logoDarkmode"]) [pgs~="logo-image"] {
12
12
  filter: var(--logo-finter);
13
13
  }
14
-
14
+
15
15
  //== FIXED DARKMODE
16
16
  &[pgs-option~="logoDarkmodeFixed"] [pgs~="logo-image"] {
17
17
  filter: var(--logo-finter);
18
18
  }
19
-
20
19
 
21
20
  //- tablet
22
21
  @media (max-width: $tablet) {
@@ -50,4 +49,4 @@
50
49
  text-wrap: nowrap;
51
50
  }
52
51
  }
53
- }
52
+ }