mypgs 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -25
- package/assets/scss/components/_accordion.scss +0 -2
- package/assets/scss/components/_button.scss +1 -1
- package/assets/scss/components/_form.scss +0 -16
- package/assets/scss/components/_formAddon.scss +18 -0
- package/assets/scss/components/_modals.scss +5 -3
- package/assets/scss/components/_search.scss +2 -2
- package/assets/scss/components/_slides.scss +0 -1
- package/assets/scss/components/_tooltip.scss +0 -1
- package/assets/scss/index.scss +1 -0
- package/assets/scss/layout/_footer.scss +0 -2
- package/assets/scss/layout/_header.scss +9 -1
- package/assets/scss/layout/_pageShell.scss +6 -2
- package/assets/scss/mixin/_mx-button.scss +30 -76
- package/assets/scss/mixin/_mx-card.scss +11 -9
- package/assets/scss/mixin/_mx-form.scss +3 -5
- package/assets/scss/mixin/{_mx-form-addon.scss → _mx-formAddon.scss} +23 -26
- package/assets/scss/mixin/_mx-hover.scss +75 -0
- package/assets/scss/mixin/_settings.scss +2 -1
- package/assets/scss/mixin/mixin.scss +2 -1
- package/demo/demo.js +4 -3
- package/dist/css/index.css +1166 -1517
- package/dist/css/index.css.map +1 -1
- package/dist/css/index.min.css +1 -1
- package/docs/componenti-e-markup.md +6 -5
- package/docs/components/accordion.md +22 -22
- package/docs/components/badges.md +19 -19
- package/docs/components/breadcumbs.md +8 -8
- package/docs/components/button.md +17 -17
- package/docs/components/card.md +19 -19
- package/docs/components/dropdown.md +29 -29
- package/docs/components/form.md +63 -40
- package/docs/components/formAddon.md +79 -0
- package/docs/components/logo.md +11 -11
- package/docs/components/menu.md +20 -20
- package/docs/components/modal.md +46 -46
- package/docs/components/notification.md +34 -34
- package/docs/components/search.md +51 -50
- package/docs/components/slides.md +39 -39
- package/docs/components/stepTabs.md +41 -41
- package/docs/components/steps.md +16 -16
- package/docs/components/summary.md +20 -20
- package/docs/components/table.md +7 -7
- package/docs/components/tooltip.md +22 -22
- package/docs/convenzioni.md +11 -11
- package/docs/export-e-sviluppo.md +3 -3
- package/docs/helper-javascript.md +7 -7
- package/docs/layout/body.md +11 -11
- package/docs/layout/flex.md +44 -44
- package/docs/layout/footer.md +23 -23
- package/docs/layout/grid.md +44 -44
- package/docs/layout/header.md +34 -34
- package/docs/layout/pageShell.md +11 -11
- package/docs/layout/section.md +26 -26
- package/docs/patterns/cookieConsent.md +38 -38
- package/docs/utilizzo-css-scss.md +8 -8
- package/package.json +1 -1
- package/scripts/generate-component-docs.js +5 -5
- package/templates/html/components/accordion.html +19 -19
- package/templates/html/components/badges.html +17 -17
- package/templates/html/components/breadcumbs.html +6 -6
- package/templates/html/components/button.html +15 -15
- package/templates/html/components/card.html +17 -17
- package/templates/html/components/dropdown.html +25 -25
- package/templates/html/components/form.html +58 -35
- package/templates/html/components/formAddon.html +72 -0
- package/templates/html/components/logo.html +9 -9
- package/templates/html/components/menu.html +16 -16
- package/templates/html/components/modal.html +42 -42
- package/templates/html/components/notification.html +30 -30
- package/templates/html/components/search.html +43 -42
- package/templates/html/components/slides.html +31 -31
- package/templates/html/components/stepTabs.html +37 -37
- package/templates/html/components/steps.html +13 -13
- package/templates/html/components/summary.html +17 -17
- package/templates/html/components/table.html +5 -5
- package/templates/html/components/tooltip.html +18 -18
- package/templates/html/layout/body.html +9 -10
- package/templates/html/layout/flex.html +42 -42
- package/templates/html/layout/footer.html +20 -20
- package/templates/html/layout/grid.html +42 -42
- package/templates/html/layout/header.html +32 -32
- package/templates/html/layout/pageShell.html +8 -8
- package/templates/html/layout/section.html +24 -24
- package/templates/html/patterns/cookieConsent.html +33 -33
- package/templates/react/components/accordion.jsx +4 -4
- package/templates/react/components/breadcumbs.jsx +1 -1
- package/templates/react/components/button.jsx +5 -5
- package/templates/react/components/card.jsx +4 -4
- package/templates/react/components/dropdown.jsx +8 -8
- package/templates/react/components/form.jsx +2 -2
- package/templates/react/components/modal.jsx +14 -14
- package/templates/react/components/notification.jsx +3 -3
- package/templates/react/components/search.jsx +5 -5
- package/templates/react/components/slides.jsx +3 -3
- package/templates/react/components/stepTabs.jsx +8 -8
- package/templates/react/components/summary.jsx +3 -3
- package/templates/react/components/table.jsx +2 -2
- package/templates/react/layout/flex.jsx +8 -8
- package/templates/react/layout/grid.jsx +8 -8
- package/templates/react/layout/section.jsx +12 -12
- package/templates/react/patterns/cookieConsent.jsx +8 -8
- package/templates/react/patterns/footer.jsx +3 -3
- package/templates/react/patterns/header.jsx +3 -3
package/docs/layout/grid.md
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/layout/grid.html. Edit templates/html/layout/grid.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Grid
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Responsive grid examples that distribute two to six columns while preserving design-system gaps and sizing.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `grid-2`:
|
|
10
|
-
- `grid-3`:
|
|
11
|
-
- `grid-4`:
|
|
12
|
-
- `grid-6`:
|
|
9
|
+
- `grid-2`: creates a responsive grid with up to two columns.
|
|
10
|
+
- `grid-3`: creates a responsive grid with up to three columns.
|
|
11
|
+
- `grid-4`: creates a responsive grid with up to four columns.
|
|
12
|
+
- `grid-6`: creates a responsive grid with up to six columns.
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Related elements
|
|
15
15
|
|
|
16
|
-
- `container`:
|
|
17
|
-
- `flexColumnTexts`:
|
|
18
|
-
- `card`:
|
|
16
|
+
- `container`: defines the container context for the introduction.
|
|
17
|
+
- `flexColumnTexts`: organizes and spaces introductory and card text.
|
|
18
|
+
- `card`: makes the demonstration grid cells visible.
|
|
19
19
|
|
|
20
20
|
## Output
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
HTML collection of responsive grids with two, three, four, and six columns.
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Example
|
|
25
25
|
|
|
26
26
|
```html
|
|
27
27
|
<div pgs="container flexColumnTexts">
|
|
28
|
-
<strong>
|
|
29
|
-
<p>
|
|
28
|
+
<strong>Standard section</strong>
|
|
29
|
+
<p>Centered content inside a MyPGS section.</p>
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
<div pgs="grid-2">
|
|
34
34
|
<article pgs="card flexColumnTexts">
|
|
35
|
-
<strong>
|
|
36
|
-
<p>
|
|
35
|
+
<strong>Column one</strong>
|
|
36
|
+
<p>First column content.</p>
|
|
37
37
|
</article>
|
|
38
38
|
|
|
39
39
|
<article pgs="card flexColumnTexts">
|
|
40
|
-
<strong>
|
|
41
|
-
<p>
|
|
40
|
+
<strong>Column two</strong>
|
|
41
|
+
<p>Second column content.</p>
|
|
42
42
|
</article>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div pgs="grid-3">
|
|
47
47
|
<article pgs="card flexColumnTexts">
|
|
48
|
-
<strong>
|
|
49
|
-
<p>
|
|
48
|
+
<strong>Column one</strong>
|
|
49
|
+
<p>First column content.</p>
|
|
50
50
|
</article>
|
|
51
51
|
|
|
52
52
|
<article pgs="card flexColumnTexts">
|
|
53
|
-
<strong>
|
|
54
|
-
<p>
|
|
53
|
+
<strong>Column two</strong>
|
|
54
|
+
<p>Second column content.</p>
|
|
55
55
|
</article>
|
|
56
56
|
|
|
57
57
|
<article pgs="card flexColumnTexts">
|
|
58
|
-
<strong>
|
|
59
|
-
<p>
|
|
58
|
+
<strong>Column three</strong>
|
|
59
|
+
<p>Third column content.</p>
|
|
60
60
|
</article>
|
|
61
61
|
</div>
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
<div pgs="grid-4">
|
|
65
65
|
<article pgs="card flexColumnTexts">
|
|
66
|
-
<strong>
|
|
67
|
-
<p>
|
|
66
|
+
<strong>Column one</strong>
|
|
67
|
+
<p>First column content.</p>
|
|
68
68
|
</article>
|
|
69
69
|
|
|
70
70
|
<article pgs="card flexColumnTexts">
|
|
71
|
-
<strong>
|
|
72
|
-
<p>
|
|
71
|
+
<strong>Column two</strong>
|
|
72
|
+
<p>Second column content.</p>
|
|
73
73
|
</article>
|
|
74
74
|
|
|
75
75
|
<article pgs="card flexColumnTexts">
|
|
76
|
-
<strong>
|
|
77
|
-
<p>
|
|
76
|
+
<strong>Column three</strong>
|
|
77
|
+
<p>Third column content.</p>
|
|
78
78
|
</article>
|
|
79
79
|
<article pgs="card flexColumnTexts">
|
|
80
|
-
<strong>
|
|
81
|
-
<p>
|
|
80
|
+
<strong>Column four</strong>
|
|
81
|
+
<p>Fourth column content.</p>
|
|
82
82
|
</article>
|
|
83
83
|
</div>
|
|
84
84
|
|
|
85
85
|
<div pgs="grid-6">
|
|
86
86
|
<article pgs="card flexColumnTexts">
|
|
87
|
-
<strong>
|
|
88
|
-
<p>
|
|
87
|
+
<strong>Column one</strong>
|
|
88
|
+
<p>First column content.</p>
|
|
89
89
|
</article>
|
|
90
90
|
|
|
91
91
|
<article pgs="card flexColumnTexts">
|
|
92
|
-
<strong>
|
|
93
|
-
<p>
|
|
92
|
+
<strong>Column two</strong>
|
|
93
|
+
<p>Second column content.</p>
|
|
94
94
|
</article>
|
|
95
95
|
|
|
96
96
|
<article pgs="card flexColumnTexts">
|
|
97
|
-
<strong>
|
|
98
|
-
<p>
|
|
97
|
+
<strong>Column three</strong>
|
|
98
|
+
<p>Third column content.</p>
|
|
99
99
|
</article>
|
|
100
100
|
|
|
101
101
|
<article pgs="card flexColumnTexts">
|
|
102
|
-
<strong>
|
|
103
|
-
<p>
|
|
102
|
+
<strong>Column four</strong>
|
|
103
|
+
<p>Fourth column content.</p>
|
|
104
104
|
</article>
|
|
105
105
|
|
|
106
106
|
<article pgs="card flexColumnTexts">
|
|
107
|
-
<strong>
|
|
108
|
-
<p>
|
|
107
|
+
<strong>Column five</strong>
|
|
108
|
+
<p>Fifth column content.</p>
|
|
109
109
|
</article>
|
|
110
110
|
|
|
111
111
|
<article pgs="card flexColumnTexts">
|
|
112
|
-
<strong>
|
|
113
|
-
<p>
|
|
112
|
+
<strong>Column six</strong>
|
|
113
|
+
<p>Sixth column content.</p>
|
|
114
114
|
</article>
|
|
115
115
|
</div
|
|
116
116
|
```
|
package/docs/layout/header.md
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/layout/header.html. Edit templates/html/layout/header.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Header
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Responsive header that measures available space, switches between desktop and mobile content, and integrates menus, dark mode, and modal navigation.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `header`:
|
|
10
|
-
- `header-element`:
|
|
11
|
-
- `header-element-alwaysOn`:
|
|
12
|
-
- `header-element-onlyDesktop`:
|
|
13
|
-
- `header-element-onlyMobile`:
|
|
14
|
-
- `header-element-alwaysOnLast`:
|
|
15
|
-
- `header-element-hamburger`:
|
|
16
|
-
- `header-element-hamburger-button`:
|
|
9
|
+
- `header`: identifies the main header observed by the JavaScript module.
|
|
10
|
+
- `header-element`: identifies the inner group measured to determine the switch to mobile mode.
|
|
11
|
+
- `header-element-alwaysOn`: identifies the initial area that is always visible.
|
|
12
|
+
- `header-element-onlyDesktop`: identifies content shown only while the desktop menu is active.
|
|
13
|
+
- `header-element-onlyMobile`: identifies content shown only in mobile mode.
|
|
14
|
+
- `header-element-alwaysOnLast`: identifies the final area that is always visible.
|
|
15
|
+
- `header-element-hamburger`: identifies the mobile navigation group.
|
|
16
|
+
- `header-element-hamburger-button`: identifies the header-specific hamburger control.
|
|
17
17
|
|
|
18
18
|
## PGS Options
|
|
19
19
|
|
|
20
|
-
- `horizontal`:
|
|
21
|
-
- `vertical`:
|
|
22
|
-
- `menuHeader`:
|
|
23
|
-
- `containerPGS`:
|
|
24
|
-
- `right`:
|
|
20
|
+
- `horizontal`: arranges the related desktop menu horizontally.
|
|
21
|
+
- `vertical`: arranges the related mobile menu vertically.
|
|
22
|
+
- `menuHeader`: adapts both menus to the header context.
|
|
23
|
+
- `containerPGS`: uses containerPGS[header] on the modal wrapper to move the dialog into the header.
|
|
24
|
+
- `right`: presents the mobile navigation dialog content from the right side.
|
|
25
25
|
|
|
26
26
|
## PGS States
|
|
27
27
|
|
|
28
|
-
- `mobileActive`:
|
|
28
|
+
- `mobileActive`: is applied to header and header-element when their width or the viewport requires mobile navigation.
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Related elements
|
|
31
31
|
|
|
32
|
-
- `logo`:
|
|
33
|
-
- `logo-text`:
|
|
34
|
-
- `menu`:
|
|
35
|
-
- `buttonIcon`:
|
|
36
|
-
- `toggleDarkmode`:
|
|
37
|
-
- `modal`:
|
|
38
|
-
- `modal-button`:
|
|
39
|
-
- `modal-close`:
|
|
40
|
-
- `modal-dialog`:
|
|
41
|
-
- `modal-dialog-content`:
|
|
32
|
+
- `logo`: inserts the brand into the initial area.
|
|
33
|
+
- `logo-text`: uses the text variant of the logo.
|
|
34
|
+
- `menu`: provides desktop and mobile navigation.
|
|
35
|
+
- `buttonIcon`: presents theme and hamburger controls as icon buttons.
|
|
36
|
+
- `toggleDarkmode`: connects the control to the global theme handler.
|
|
37
|
+
- `modal`: provides opening and closing behavior for mobile navigation.
|
|
38
|
+
- `modal-button`: opens the mobile panel.
|
|
39
|
+
- `modal-close`: closes the mobile panel and shares the hamburger control.
|
|
40
|
+
- `modal-dialog`: identifies the mobile navigation dialog.
|
|
41
|
+
- `modal-dialog-content`: identifies the inner mobile navigation panel.
|
|
42
42
|
|
|
43
43
|
## Output
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Complete header HTML with desktop navigation and a side mobile panel.
|
|
46
46
|
|
|
47
|
-
##
|
|
47
|
+
## Example
|
|
48
48
|
|
|
49
49
|
```html
|
|
50
50
|
<header pgs="header">
|
|
@@ -56,10 +56,10 @@ Header HTML completo con navigazione desktop e pannello mobile laterale.
|
|
|
56
56
|
</div>
|
|
57
57
|
|
|
58
58
|
<div pgs="header-element-onlyDesktop">
|
|
59
|
-
<nav pgs="menu" pgs-option="horizontal menuHeader" aria-label="
|
|
59
|
+
<nav pgs="menu" pgs-option="horizontal menuHeader" aria-label="Main menu">
|
|
60
60
|
<ul>
|
|
61
61
|
<li><a href="/">Home</a></li>
|
|
62
|
-
<li><a href="#
|
|
62
|
+
<li><a href="#components">Components</a></li>
|
|
63
63
|
<li><a href="#layout">Layout</a></li>
|
|
64
64
|
</ul>
|
|
65
65
|
</nav>
|
|
@@ -69,7 +69,7 @@ Header HTML completo con navigazione desktop e pannello mobile laterale.
|
|
|
69
69
|
</div>
|
|
70
70
|
|
|
71
71
|
<div pgs="header-element-alwaysOnLast">
|
|
72
|
-
<button pgs="buttonIcon toggleDarkmode" type="button" aria-label="
|
|
72
|
+
<button pgs="buttonIcon toggleDarkmode" type="button" aria-label="Change theme">
|
|
73
73
|
<i class="fa-solid fa-moon"></i>
|
|
74
74
|
</button>
|
|
75
75
|
</div>
|
|
@@ -80,10 +80,10 @@ Header HTML completo con navigazione desktop e pannello mobile laterale.
|
|
|
80
80
|
|
|
81
81
|
<dialog pgs="modal-dialog" pgs-option="right">
|
|
82
82
|
<div pgs="modal-dialog-content">
|
|
83
|
-
<nav pgs="menu" pgs-option="vertical menuHeader" aria-label="
|
|
83
|
+
<nav pgs="menu" pgs-option="vertical menuHeader" aria-label="Mobile menu">
|
|
84
84
|
<ul>
|
|
85
85
|
<li><a href="/">Home</a></li>
|
|
86
|
-
<li><a href="#
|
|
86
|
+
<li><a href="#components">Components</a></li>
|
|
87
87
|
<li><a href="#layout">Layout</a></li>
|
|
88
88
|
</ul>
|
|
89
89
|
</nav>
|
package/docs/layout/pageShell.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/layout/pageShell.html. Edit templates/html/layout/pageShell.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Page Shell
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Responsive page layout that combines main content with zero, one, or two scrollable sidebars and adapts their width and position.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `pageShell`:
|
|
10
|
-
- `pageShell-aside`:
|
|
11
|
-
- `pageShell-aside-scroll`:
|
|
12
|
-
- `pageShell-content`:
|
|
9
|
+
- `pageShell`: identifies the container that calculates the main and aside composition.
|
|
10
|
+
- `pageShell-aside`: identifies a sidebar that can be placed before or after the content.
|
|
11
|
+
- `pageShell-aside-scroll`: identifies the inner area that can remain visible while scrolling.
|
|
12
|
+
- `pageShell-content`: identifies the main page content.
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Related elements
|
|
15
15
|
|
|
16
|
-
- `flexColumnTexts`:
|
|
17
|
-
- `flexColumnElements`:
|
|
16
|
+
- `flexColumnTexts`: organizes text contained in the sidebars.
|
|
17
|
+
- `flexColumnElements`: vertically organizes elements in the main sections.
|
|
18
18
|
|
|
19
19
|
## Output
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Four page-shell HTML configurations with two, one, or no sidebars.
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Example
|
|
24
24
|
|
|
25
25
|
```html
|
|
26
26
|
<div pgs="pageShell">
|
package/docs/layout/section.md
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/layout/section.html. Edit templates/html/layout/section.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Section
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Section variants that control width, padding, and specific content treatment while preserving shared vertical spacing.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `section`:
|
|
10
|
-
- `sectionFull`:
|
|
11
|
-
- `sectionSpecificity`:
|
|
12
|
-
- `sectionSpecificity-child`:
|
|
13
|
-
- `sectionMax`:
|
|
14
|
-
- `sectionNoPadding`:
|
|
9
|
+
- `section`: identifies the standard section with centered content.
|
|
10
|
+
- `sectionFull`: identifies a section that spans the full available width.
|
|
11
|
+
- `sectionSpecificity`: identifies a section that applies a specific structure to its child.
|
|
12
|
+
- `sectionSpecificity-child`: identifies child content managed by the sectionSpecificity variant.
|
|
13
|
+
- `sectionMax`: identifies a section with an extended maximum width.
|
|
14
|
+
- `sectionNoPadding`: identifies a section without standard padding.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Related elements
|
|
17
17
|
|
|
18
|
-
- `flexColumnSections`:
|
|
19
|
-
- `flexColumnElements`:
|
|
20
|
-
- `flexColumnTexts`:
|
|
21
|
-
- `card-img`:
|
|
22
|
-
- `imgCover`:
|
|
18
|
+
- `flexColumnSections`: vertically spaces all sections in the example.
|
|
19
|
+
- `flexColumnElements`: vertically organizes the main elements of each section.
|
|
20
|
+
- `flexColumnTexts`: organizes and spaces inner content.
|
|
21
|
+
- `card-img`: reuses card image treatment in the demonstration sections.
|
|
22
|
+
- `imgCover`: scales images to the section width.
|
|
23
23
|
|
|
24
24
|
## Output
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
HTML collection of the available section variants.
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Example
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
31
|
<div pgs="flexColumnSections">
|
|
32
32
|
<section pgs="section flexColumnElements">
|
|
33
33
|
<div pgs="flexColumnTexts">
|
|
34
|
-
<strong>
|
|
35
|
-
<p>
|
|
34
|
+
<strong>Standard section</strong>
|
|
35
|
+
<p>Centered content inside a MyPGS section.</p>
|
|
36
36
|
</div>
|
|
37
37
|
</section>
|
|
38
38
|
|
|
39
39
|
<section pgs="sectionFull flexColumnElements">
|
|
40
40
|
<div pgs="flexColumnTexts">
|
|
41
|
-
<strong>
|
|
42
|
-
<p>
|
|
41
|
+
<strong>Full-width section</strong>
|
|
42
|
+
<p>Centered content inside a MyPGS section.</p>
|
|
43
43
|
</div>
|
|
44
44
|
</section>
|
|
45
45
|
|
|
46
46
|
<section pgs="sectionSpecificity flexColumnElements">
|
|
47
47
|
<div pgs="flexColumnTexts">
|
|
48
|
-
<img pgs="card-img imgCover" src="https://placehold.co/800x200?text=Hero" alt="
|
|
48
|
+
<img pgs="card-img imgCover" src="https://placehold.co/800x200?text=Hero" alt="Placeholder image">
|
|
49
49
|
</div>
|
|
50
50
|
<div pgs="sectionSpecificity-child flexColumnTexts">
|
|
51
|
-
<strong>
|
|
52
|
-
<p>
|
|
51
|
+
<strong>Specificity-child section</strong>
|
|
52
|
+
<p>Centered content inside a MyPGS section.</p>
|
|
53
53
|
</div>
|
|
54
54
|
</section>
|
|
55
55
|
|
|
56
56
|
<section pgs="sectionMax flexColumnElements" style="background-color: var(--color-primary-soft)">
|
|
57
57
|
<div pgs="flexColumnTexts">
|
|
58
|
-
<strong>
|
|
59
|
-
<p>
|
|
58
|
+
<strong>Max-width section</strong>
|
|
59
|
+
<p>Centered content inside a MyPGS section.</p>
|
|
60
60
|
</div>
|
|
61
61
|
</section>
|
|
62
62
|
|
|
63
63
|
<section pgs="sectionNoPadding flexColumnElements">
|
|
64
64
|
<div pgs="flexColumnTexts">
|
|
65
|
-
<img pgs="card-img imgCover" src="https://placehold.co/800x500?text=HI!" alt="
|
|
65
|
+
<img pgs="card-img imgCover" src="https://placehold.co/800x500?text=HI!" alt="Placeholder image">
|
|
66
66
|
</div>
|
|
67
67
|
</section>
|
|
68
68
|
</div>
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/patterns/cookieConsent.html. Edit templates/html/patterns/cookieConsent.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Cookie Consent
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Accessible pattern for collecting and storing analytics cookie consent, applying preferences, and loading Google Analytics only when authorized.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `cookieConsent`:
|
|
10
|
-
- `cookieConsent-panel`:
|
|
11
|
-
- `cookieConsent-featureEssential`:
|
|
12
|
-
- `cookieConsent-panel-badge`:
|
|
13
|
-
- `cookieConsent-featureAnalytics`:
|
|
14
|
-
- `cookieConsent-toggleAnalytics`:
|
|
15
|
-
- `cookieConsent-actionReject`:
|
|
16
|
-
- `cookieConsent-actionAccept`:
|
|
17
|
-
- `cookieConsent-actionOpen`:
|
|
18
|
-
- `cookieConsent-gaUnavailable`: token
|
|
19
|
-
- `cookieConsent-accepted`: token
|
|
20
|
-
- `cookieConsent-declined`: token
|
|
21
|
-
|
|
22
|
-
##
|
|
23
|
-
|
|
24
|
-
- `flexColumn`:
|
|
25
|
-
- `flexRow`:
|
|
26
|
-
- `nowrap`:
|
|
27
|
-
- `toggle`:
|
|
28
|
-
- `button`:
|
|
29
|
-
- `buttonStrong`:
|
|
9
|
+
- `cookieConsent`: identifies the main panel initialized by the JavaScript pattern.
|
|
10
|
+
- `cookieConsent-panel`: identifies the configurable preference group.
|
|
11
|
+
- `cookieConsent-featureEssential`: identifies the row of always-active essential cookies.
|
|
12
|
+
- `cookieConsent-panel-badge`: identifies the essential-cookie status indicator.
|
|
13
|
+
- `cookieConsent-featureAnalytics`: identifies the optional analytics-cookie row.
|
|
14
|
+
- `cookieConsent-toggleAnalytics`: identifies the control that enables analytics consent.
|
|
15
|
+
- `cookieConsent-actionReject`: applies selected preferences without automatically accepting analytics.
|
|
16
|
+
- `cookieConsent-actionAccept`: accepts all available cookies.
|
|
17
|
+
- `cookieConsent-actionOpen`: identifies external controls that reopen the preference panel.
|
|
18
|
+
- `cookieConsent-gaUnavailable`: runtime token applied to the root when no usable measurement ID is available.
|
|
19
|
+
- `cookieConsent-accepted`: runtime token applied to the root when analytics is allowed.
|
|
20
|
+
- `cookieConsent-declined`: runtime token applied to the root when analytics is not allowed.
|
|
21
|
+
|
|
22
|
+
## Related elements
|
|
23
|
+
|
|
24
|
+
- `flexColumn`: vertically organizes the preference panel.
|
|
25
|
+
- `flexRow`: arranges panel rows and actions.
|
|
26
|
+
- `nowrap`: prevents wrapping in the essential-cookie row.
|
|
27
|
+
- `toggle`: presents analytics consent as a switch.
|
|
28
|
+
- `button`: presents the selection action with standard styling.
|
|
29
|
+
- `buttonStrong`: presents full acceptance as the primary action.
|
|
30
30
|
|
|
31
31
|
## Output
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Consent panel HTML with essential and analytics preferences, actions, and accessible attributes.
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Example
|
|
36
36
|
|
|
37
37
|
```html
|
|
38
38
|
<section id="pgs-cookieConsent" pgs="cookieConsent" role="dialog" aria-modal="true" data-ga-id="G-XXXXXXXXXX" hidden tabindex="-1">
|
|
39
|
-
<p><i class="fa-duotone fa-solid fa-cookie-bite"></i>
|
|
40
|
-
<h2>
|
|
39
|
+
<p><i class="fa-duotone fa-solid fa-cookie-bite"></i> Cookies and privacy <br></p>
|
|
40
|
+
<h2>Your privacy comes first</h2>
|
|
41
41
|
|
|
42
42
|
<p>
|
|
43
|
-
|
|
44
|
-
<strong>Google Analytics</strong>
|
|
45
|
-
|
|
43
|
+
We use essential cookies to provide the service and, with your consent, analytics cookies from
|
|
44
|
+
<strong>Google Analytics</strong> to measure traffic anonymously and improve our content.
|
|
45
|
+
You can change your choice at any time.
|
|
46
46
|
</p>
|
|
47
47
|
|
|
48
48
|
<p>
|
|
@@ -50,17 +50,17 @@ Pannello HTML di consenso con preferenze tecniche e analytics, azioni e attribut
|
|
|
50
50
|
<a href="/cookie-policy/" target="_blank" rel="noopener">Cookie Policy</a>
|
|
51
51
|
</p>
|
|
52
52
|
|
|
53
|
-
<div pgs="cookieConsent-panel flexColumn" role="group" aria-label="
|
|
53
|
+
<div pgs="cookieConsent-panel flexColumn" role="group" aria-label="Cookie preferences">
|
|
54
54
|
<div pgs="flexRow nowrap cookieConsent-featureEssential">
|
|
55
55
|
<div>
|
|
56
56
|
<p>
|
|
57
|
-
<strong>
|
|
57
|
+
<strong>Essential cookies</strong>
|
|
58
58
|
<br>
|
|
59
|
-
<small>
|
|
59
|
+
<small>Always active to ensure the website works correctly.</small>
|
|
60
60
|
</p>
|
|
61
61
|
</div>
|
|
62
62
|
|
|
63
|
-
<span pgs="cookieConsent-panel-badge">
|
|
63
|
+
<span pgs="cookieConsent-panel-badge">Active</span>
|
|
64
64
|
</div>
|
|
65
65
|
|
|
66
66
|
<div pgs="flexRow cookieConsent-featureAnalytics">
|
|
@@ -68,21 +68,21 @@ Pannello HTML di consenso con preferenze tecniche e analytics, azioni e attribut
|
|
|
68
68
|
<p>
|
|
69
69
|
<strong>Analytics</strong>
|
|
70
70
|
<br>
|
|
71
|
-
<small>
|
|
71
|
+
<small>Browsing data collected in aggregate form for anonymous statistics.</small>
|
|
72
72
|
</p>
|
|
73
73
|
|
|
74
|
-
<input type="checkbox" pgs="cookieConsent-toggleAnalytics" aria-label="
|
|
74
|
+
<input type="checkbox" pgs="cookieConsent-toggleAnalytics" aria-label="Enable Google Analytics">
|
|
75
75
|
</label>
|
|
76
76
|
</div>
|
|
77
77
|
</div>
|
|
78
78
|
|
|
79
79
|
<div pgs="flexRow">
|
|
80
80
|
<button type="button" pgs="button cookieConsent-actionReject">
|
|
81
|
-
<i class="fa-solid fa-duotone fa-sliders"></i>
|
|
81
|
+
<i class="fa-solid fa-duotone fa-sliders"></i>Selected only
|
|
82
82
|
</button>
|
|
83
83
|
|
|
84
84
|
<button type="button" pgs="buttonStrong cookieConsent-actionAccept">
|
|
85
|
-
<i class="fa-solid fa-check"></i>
|
|
85
|
+
<i class="fa-solid fa-check"></i> Accept all
|
|
86
86
|
</button>
|
|
87
87
|
</div>
|
|
88
88
|
</section>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CSS/SCSS usage
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The library exposes many custom properties that should be preferred to hardcoded values, for example:
|
|
4
4
|
|
|
5
5
|
```scss
|
|
6
6
|
:root {
|
|
@@ -13,7 +13,7 @@ La libreria espone molte custom properties da preferire agli hardcode, per esemp
|
|
|
13
13
|
}
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Recommended override:
|
|
17
17
|
|
|
18
18
|
```scss
|
|
19
19
|
#danger-action {
|
|
@@ -22,15 +22,15 @@ Override consigliato:
|
|
|
22
22
|
}
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Avoid rewriting padding, gaps, border radii, or colors from scratch when a suitable variable or PGS token already exists.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## The `pgs` system
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Markup uses space-separated tokens inside the `pgs` attribute:
|
|
30
30
|
|
|
31
31
|
```html
|
|
32
|
-
<button pgs="button buttonStrong" type="button">
|
|
32
|
+
<button pgs="button buttonStrong" type="button">Save</button>
|
|
33
33
|
<section pgs="section flexColumnElements"></section>
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
The same tokens connect HTML, SCSS, and JavaScript.
|
package/package.json
CHANGED