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.
- package/.vscode/tasks.json +39 -0
- package/AGENTS.md +22 -21
- package/README.md +25 -25
- package/assets/javascript/components/_menu.js +2 -1
- package/assets/javascript/components/_modals.js +1 -1
- package/assets/javascript/components/_notifications.js +2 -1
- package/assets/javascript/components/_slides.js +2 -2
- package/assets/scss/base/_body.scss +5 -5
- package/assets/scss/base/_general.scss +27 -18
- package/assets/scss/base/_variables.scss +1 -1
- package/assets/scss/components/_accordion.scss +9 -9
- package/assets/scss/components/_alerts.scss +71 -0
- package/assets/scss/components/_badges.scss +40 -48
- package/assets/scss/components/_button.scss +28 -20
- package/assets/scss/components/_card.scss +9 -4
- package/assets/scss/components/_form.scss +0 -16
- package/assets/scss/components/_formAddon.scss +22 -0
- package/assets/scss/components/_logo.scss +3 -4
- package/assets/scss/components/_menu.scss +26 -3
- package/assets/scss/components/_modals.scss +6 -4
- package/assets/scss/components/_search.scss +2 -2
- package/assets/scss/components/_slides.scss +0 -1
- package/assets/scss/components/_stepTabs.scss +2 -1
- package/assets/scss/components/_tooltip.scss +0 -1
- package/assets/scss/index.scss +3 -3
- package/assets/scss/layout/_footer.scss +0 -2
- package/assets/scss/layout/_header.scss +10 -2
- package/assets/scss/layout/_pageShell.scss +6 -2
- package/assets/scss/layout/_responsive.scss +63 -0
- package/assets/scss/mixin/_mx-base.scss +4 -8
- package/assets/scss/mixin/_mx-button.scss +73 -115
- package/assets/scss/mixin/_mx-card.scss +39 -40
- package/assets/scss/mixin/_mx-form.scss +13 -10
- package/assets/scss/mixin/{_mx-form-addon.scss → _mx-formAddon.scss} +103 -64
- package/assets/scss/mixin/_mx-hover.scss +81 -0
- package/assets/scss/mixin/_mx-responsive.scss +81 -201
- package/assets/scss/mixin/_settings.scss +2 -1
- package/assets/scss/mixin/mixin.scss +2 -1
- package/demo/demo.css +9 -6
- package/demo/demo.html +7 -5
- package/demo/demo.js +37 -34
- package/dist/css/index.css +2469 -3825
- package/dist/css/index.css.map +1 -1
- package/dist/css/index.min.css +1 -1
- package/dist/javascript/index.js +7 -5
- package/dist/javascript/index.js.map +1 -1
- package/dist/javascript/index.min.js +1 -1
- package/docs/componenti-e-markup.md +9 -8
- package/docs/components/accordion.md +23 -23
- package/docs/components/alerts.md +67 -0
- package/docs/components/badges.md +29 -26
- package/docs/components/breadcumbs.md +8 -8
- package/docs/components/button.md +18 -18
- package/docs/components/card.md +25 -22
- package/docs/components/dropdown.md +29 -29
- package/docs/components/form.md +65 -41
- package/docs/components/formAddon.md +116 -0
- package/docs/components/logo.md +11 -11
- package/docs/components/menu.md +20 -20
- package/docs/components/modal.md +52 -51
- package/docs/components/notification.md +34 -34
- package/docs/components/search.md +54 -52
- package/docs/components/slides.md +41 -42
- package/docs/components/stepTabs.md +45 -45
- 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 +24 -23
- package/docs/convenzioni.md +11 -11
- package/docs/export-e-sviluppo.md +4 -4
- package/docs/helper-javascript.md +8 -8
- package/docs/layout/body.md +11 -11
- package/docs/layout/footer.md +28 -24
- package/docs/layout/header.md +36 -35
- package/docs/layout/pageShell.md +19 -19
- package/docs/layout/responsive.md +90 -0
- package/docs/layout/section.md +38 -38
- package/docs/patterns/cookieConsent.md +42 -39
- package/docs/utilizzo-css-scss.md +33 -9
- package/package.json +1 -1
- package/reference/html/components/accordion.html +52 -0
- package/reference/html/components/alerts.html +59 -0
- package/reference/html/components/badges.html +62 -0
- package/{templates → reference}/html/components/breadcumbs.html +6 -6
- package/reference/html/components/button.html +51 -0
- package/reference/html/components/card.html +45 -0
- package/{templates → reference}/html/components/dropdown.html +25 -25
- package/reference/html/components/form.html +128 -0
- package/reference/html/components/formAddon.html +109 -0
- package/reference/html/components/logo.html +28 -0
- package/{templates → reference}/html/components/menu.html +17 -17
- package/reference/html/components/modal.html +123 -0
- package/reference/html/components/notification.html +71 -0
- package/reference/html/components/search.html +109 -0
- package/reference/html/components/slides.html +75 -0
- package/reference/html/components/stepTabs.html +83 -0
- package/reference/html/components/steps.html +49 -0
- package/reference/html/components/summary.html +41 -0
- package/{templates → reference}/html/components/table.html +5 -5
- package/reference/html/components/tooltip.html +44 -0
- package/reference/html/layout/body.html +34 -0
- package/reference/html/layout/footer.html +67 -0
- package/reference/html/layout/header.html +108 -0
- package/{templates → reference}/html/layout/pageShell.html +16 -16
- package/reference/html/layout/responsive.html +83 -0
- package/reference/html/layout/section.html +62 -0
- package/reference/html/patterns/cookieConsent.html +84 -0
- package/{templates → reference}/react/components/accordion.jsx +5 -5
- package/reference/react/components/alerts.jsx +46 -0
- package/{templates → reference}/react/components/breadcumbs.jsx +1 -1
- package/{templates → reference}/react/components/button.jsx +6 -6
- package/{templates → reference}/react/components/card.jsx +6 -6
- package/{templates → reference}/react/components/dropdown.jsx +8 -8
- package/{templates → reference}/react/components/form.jsx +3 -3
- package/{templates → reference}/react/components/modal.jsx +15 -15
- package/{templates → reference}/react/components/notification.jsx +3 -3
- package/{templates → reference}/react/components/search.jsx +8 -8
- package/{templates → reference}/react/components/slides.jsx +4 -4
- package/{templates → reference}/react/components/stepTabs.jsx +12 -12
- package/reference/react/components/summary.jsx +18 -0
- package/{templates → reference}/react/components/table.jsx +2 -2
- package/{templates → reference}/react/components/tooltip.jsx +1 -1
- package/{templates → reference}/react/layout/pageShell.jsx +2 -2
- package/reference/react/layout/responsive.jsx +61 -0
- package/reference/react/layout/section.jsx +44 -0
- package/{templates → reference}/react/patterns/cookieConsent.jsx +9 -9
- package/{templates → reference}/react/patterns/footer.jsx +4 -4
- package/{templates → reference}/react/patterns/header.jsx +4 -4
- package/scripts/generate-component-docs.js +12 -12
- package/assets/scss/layout/_flex.scss +0 -49
- package/assets/scss/layout/_gap.scss +0 -21
- package/assets/scss/layout/_grid.scss +0 -13
- package/docs/layout/flex.md +0 -116
- package/docs/layout/grid.md +0 -116
- package/templates/html/components/accordion.html +0 -52
- package/templates/html/components/badges.html +0 -60
- package/templates/html/components/button.html +0 -51
- package/templates/html/components/card.html +0 -43
- package/templates/html/components/form.html +0 -104
- package/templates/html/components/logo.html +0 -28
- package/templates/html/components/modal.html +0 -122
- package/templates/html/components/notification.html +0 -71
- package/templates/html/components/search.html +0 -107
- package/templates/html/components/slides.html +0 -76
- package/templates/html/components/stepTabs.html +0 -83
- package/templates/html/components/steps.html +0 -49
- package/templates/html/components/summary.html +0 -41
- package/templates/html/components/tooltip.html +0 -43
- package/templates/html/layout/body.html +0 -35
- package/templates/html/layout/flex.html +0 -109
- package/templates/html/layout/footer.html +0 -64
- package/templates/html/layout/grid.html +0 -109
- package/templates/html/layout/header.html +0 -107
- package/templates/html/layout/section.html +0 -62
- package/templates/html/patterns/cookieConsent.html +0 -82
- package/templates/react/components/summary.jsx +0 -18
- package/templates/react/layout/flex.jsx +0 -36
- package/templates/react/layout/grid.jsx +0 -36
- package/templates/react/layout/section.jsx +0 -44
- /package/{templates → reference}/react/components/logo.jsx +0 -0
- /package/{templates → reference}/react/components/menu.jsx +0 -0
- /package/{templates → reference}/react/components/steps.jsx +0 -0
- /package/{templates → reference}/react/layout/body.jsx +0 -0
package/docs/layout/section.md
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from reference/html/layout/section.html. Edit reference/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
|
-
- `
|
|
19
|
-
- `
|
|
20
|
-
- `
|
|
21
|
-
- `card-img`:
|
|
22
|
-
- `imgCover`:
|
|
18
|
+
- `flexColumn`: vertically organizes sections and inner content.
|
|
19
|
+
- `gapSections`: applies section spacing to the outer collection.
|
|
20
|
+
- `gapElements`: applies element spacing inside each section.
|
|
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
|
-
<div pgs="
|
|
32
|
-
<section pgs="section
|
|
33
|
-
<div pgs="
|
|
34
|
-
<strong>
|
|
35
|
-
<p>
|
|
31
|
+
<div pgs="flexColumn gapSections">
|
|
32
|
+
<section pgs="section flexColumn gapElements">
|
|
33
|
+
<div pgs="flexColumn">
|
|
34
|
+
<strong>Standard section</strong>
|
|
35
|
+
<p>Centered content inside a MyPGS section.</p>
|
|
36
36
|
</div>
|
|
37
37
|
</section>
|
|
38
38
|
|
|
39
|
-
<section pgs="sectionFull
|
|
40
|
-
<div pgs="
|
|
41
|
-
<strong>
|
|
42
|
-
<p>
|
|
39
|
+
<section pgs="sectionFull flexColumn gapElements">
|
|
40
|
+
<div pgs="flexColumn">
|
|
41
|
+
<strong>Full-width section</strong>
|
|
42
|
+
<p>Centered content inside a MyPGS section.</p>
|
|
43
43
|
</div>
|
|
44
44
|
</section>
|
|
45
45
|
|
|
46
|
-
<section pgs="sectionSpecificity
|
|
47
|
-
<div pgs="
|
|
48
|
-
<img pgs="card-img imgCover" src="https://placehold.co/800x200?text=Hero" alt="
|
|
46
|
+
<section pgs="sectionSpecificity flexColumn gapElements">
|
|
47
|
+
<div pgs="flexColumn">
|
|
48
|
+
<img pgs="card-img imgCover" src="https://placehold.co/800x200?text=Hero" alt="Placeholder image">
|
|
49
49
|
</div>
|
|
50
|
-
<div pgs="sectionSpecificity-child
|
|
51
|
-
<strong>
|
|
52
|
-
<p>
|
|
50
|
+
<div pgs="sectionSpecificity-child flexColumn">
|
|
51
|
+
<strong>Specificity-child section</strong>
|
|
52
|
+
<p>Centered content inside a MyPGS section.</p>
|
|
53
53
|
</div>
|
|
54
54
|
</section>
|
|
55
55
|
|
|
56
|
-
<section pgs="sectionMax
|
|
57
|
-
<div pgs="
|
|
58
|
-
<strong>
|
|
59
|
-
<p>
|
|
56
|
+
<section pgs="sectionMax flexColumn gapElements" style="background-color: var(--color-primary-soft)">
|
|
57
|
+
<div pgs="flexColumn">
|
|
58
|
+
<strong>Max-width section</strong>
|
|
59
|
+
<p>Centered content inside a MyPGS section.</p>
|
|
60
60
|
</div>
|
|
61
61
|
</section>
|
|
62
62
|
|
|
63
|
-
<section pgs="sectionNoPadding
|
|
64
|
-
<div pgs="
|
|
65
|
-
<img pgs="card-img imgCover" src="https://placehold.co/800x500?text=HI!" alt="
|
|
63
|
+
<section pgs="sectionNoPadding flexColumn gapElements">
|
|
64
|
+
<div pgs="flexColumn">
|
|
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,51 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from reference/html/patterns/cookieConsent.html. Edit reference/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
|
-
- `
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- `
|
|
29
|
-
- `
|
|
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
|
+
## PGS Options
|
|
23
|
+
|
|
24
|
+
- `buttonStrong`: presents full acceptance as the primary action.
|
|
25
|
+
|
|
26
|
+
## Related elements
|
|
27
|
+
|
|
28
|
+
- `flexColumn`: vertically organizes the preference panel.
|
|
29
|
+
- `flexRow`: arranges panel rows and actions.
|
|
30
|
+
- `nowrap`: prevents wrapping in the essential-cookie row.
|
|
31
|
+
- `toggle`: presents analytics consent as a switch.
|
|
32
|
+
- `button`: presents the selection action with standard styling.
|
|
30
33
|
|
|
31
34
|
## Output
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
Consent panel HTML with essential and analytics preferences, actions, and accessible attributes.
|
|
34
37
|
|
|
35
|
-
##
|
|
38
|
+
## Example
|
|
36
39
|
|
|
37
40
|
```html
|
|
38
41
|
<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>
|
|
42
|
+
<p><i class="fa-duotone fa-solid fa-cookie-bite"></i> Cookies and privacy <br></p>
|
|
43
|
+
<h2>Your privacy comes first</h2>
|
|
41
44
|
|
|
42
45
|
<p>
|
|
43
|
-
|
|
44
|
-
<strong>Google Analytics</strong>
|
|
45
|
-
|
|
46
|
+
We use essential cookies to provide the service and, with your consent, analytics cookies from
|
|
47
|
+
<strong>Google Analytics</strong> to measure traffic anonymously and improve our content.
|
|
48
|
+
You can change your choice at any time.
|
|
46
49
|
</p>
|
|
47
50
|
|
|
48
51
|
<p>
|
|
@@ -50,17 +53,17 @@ Pannello HTML di consenso con preferenze tecniche e analytics, azioni e attribut
|
|
|
50
53
|
<a href="/cookie-policy/" target="_blank" rel="noopener">Cookie Policy</a>
|
|
51
54
|
</p>
|
|
52
55
|
|
|
53
|
-
<div pgs="cookieConsent-panel flexColumn" role="group" aria-label="
|
|
56
|
+
<div pgs="cookieConsent-panel flexColumn" role="group" aria-label="Cookie preferences">
|
|
54
57
|
<div pgs="flexRow nowrap cookieConsent-featureEssential">
|
|
55
58
|
<div>
|
|
56
59
|
<p>
|
|
57
|
-
<strong>
|
|
60
|
+
<strong>Essential cookies</strong>
|
|
58
61
|
<br>
|
|
59
|
-
<small>
|
|
62
|
+
<small>Always active to ensure the website works correctly.</small>
|
|
60
63
|
</p>
|
|
61
64
|
</div>
|
|
62
65
|
|
|
63
|
-
<span pgs="cookieConsent-panel-badge">
|
|
66
|
+
<span pgs="cookieConsent-panel-badge">Active</span>
|
|
64
67
|
</div>
|
|
65
68
|
|
|
66
69
|
<div pgs="flexRow cookieConsent-featureAnalytics">
|
|
@@ -68,21 +71,21 @@ Pannello HTML di consenso con preferenze tecniche e analytics, azioni e attribut
|
|
|
68
71
|
<p>
|
|
69
72
|
<strong>Analytics</strong>
|
|
70
73
|
<br>
|
|
71
|
-
<small>
|
|
74
|
+
<small>Browsing data collected in aggregate form for anonymous statistics.</small>
|
|
72
75
|
</p>
|
|
73
76
|
|
|
74
|
-
<input type="checkbox" pgs="cookieConsent-toggleAnalytics" aria-label="
|
|
77
|
+
<input type="checkbox" pgs="cookieConsent-toggleAnalytics" aria-label="Enable Google Analytics">
|
|
75
78
|
</label>
|
|
76
79
|
</div>
|
|
77
80
|
</div>
|
|
78
81
|
|
|
79
82
|
<div pgs="flexRow">
|
|
80
83
|
<button type="button" pgs="button cookieConsent-actionReject">
|
|
81
|
-
<i class="fa-solid fa-duotone fa-sliders"></i>
|
|
84
|
+
<i class="fa-solid fa-duotone fa-sliders"></i>Selected only
|
|
82
85
|
</button>
|
|
83
86
|
|
|
84
|
-
<button type="button" pgs="
|
|
85
|
-
<i class="fa-solid fa-check"></i>
|
|
87
|
+
<button type="button" pgs="button cookieConsent-actionAccept" pgs-option="buttonStrong">
|
|
88
|
+
<i class="fa-solid fa-check"></i> Accept all
|
|
86
89
|
</button>
|
|
87
90
|
</div>
|
|
88
91
|
</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,39 @@ 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
|
+
## Button mixins
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Button styling is split into small mixins so each consumer can include only the behavior it needs. A standard button is composed explicitly:
|
|
30
|
+
|
|
31
|
+
```scss
|
|
32
|
+
.action {
|
|
33
|
+
@include buttonBase();
|
|
34
|
+
@include buttonContent();
|
|
35
|
+
@include buttonHover();
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Use `buttonIcon` instead of `buttonContent` for icon-only controls, and `buttonNohover` instead of `buttonHover` when pointer interaction must remain neutral:
|
|
40
|
+
|
|
41
|
+
```scss
|
|
42
|
+
.icon-action {
|
|
43
|
+
@include buttonBase();
|
|
44
|
+
@include buttonIcon();
|
|
45
|
+
@include buttonNohover();
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`buttonStrong`, `buttonMini`, `buttonBig`, and `buttonClose` contain only their variant declarations and must be added after the required base, content/icon, and interaction mixins. This explicit composition is also the preferred pattern for components such as menus, accordions, forms, and step tabs.
|
|
50
|
+
|
|
51
|
+
## The `pgs` system
|
|
52
|
+
|
|
53
|
+
Markup uses space-separated tokens inside the `pgs` attribute:
|
|
30
54
|
|
|
31
55
|
```html
|
|
32
|
-
<button pgs="button buttonStrong" type="button">
|
|
33
|
-
<section pgs="section
|
|
56
|
+
<button pgs="button" pgs-option="buttonStrong" type="button">Save</button>
|
|
57
|
+
<section pgs="section flexColumn gapElements"></section>
|
|
34
58
|
```
|
|
35
59
|
|
|
36
|
-
|
|
60
|
+
The same tokens connect HTML, SCSS, and JavaScript.
|
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* @title Accordion
|
|
4
|
+
* @description Interactive component that expands one panel at a time while synchronizing visibility, ARIA attributes, and keyboard navigation.
|
|
5
|
+
*
|
|
6
|
+
* @pgs
|
|
7
|
+
* - accordion: identifies each expandable element initialized by the JavaScript module.
|
|
8
|
+
* - accordion-button: identifies the control that opens or closes the associated panel.
|
|
9
|
+
* - accordion-content: identifies the content panel managed through the hidden attribute.
|
|
10
|
+
*
|
|
11
|
+
* @pgs-state
|
|
12
|
+
* - open: indicates the accordion element that is currently open and visible.
|
|
13
|
+
*
|
|
14
|
+
* @api
|
|
15
|
+
* - pgs.accordion.init(root): initializes unregistered accordions within the specified Document or Element.
|
|
16
|
+
* - pgs.accordion.api(element): returns the instance associated with an initialized accordion root.
|
|
17
|
+
* - instance.open(): opens the panel and closes any other accordions on the page.
|
|
18
|
+
* - instance.close(): closes the current panel.
|
|
19
|
+
* - instance.toggle(): toggles the panel between its open and closed states.
|
|
20
|
+
* - instance.refresh(): reruns initialization within the accordion container and returns the instance.
|
|
21
|
+
* - instance.isOpen(): returns true when the open state is active.
|
|
22
|
+
*
|
|
23
|
+
* @related
|
|
24
|
+
* - flexColumn: applies text spacing between the list items.
|
|
25
|
+
*
|
|
26
|
+
* @return HTML list of accessible accordion items with an associated button and panel.
|
|
27
|
+
*/
|
|
28
|
+
-->
|
|
29
|
+
|
|
30
|
+
<ul pgs="flexColumn">
|
|
31
|
+
<li pgs="accordion">
|
|
32
|
+
<button pgs="accordion-button" type="button">
|
|
33
|
+
<i class="fa-solid fa-circle-question" aria-hidden="true"></i>
|
|
34
|
+
<span>Frequently asked question</span>
|
|
35
|
+
</button>
|
|
36
|
+
|
|
37
|
+
<div pgs="accordion-content" hidden>
|
|
38
|
+
<p>Example answer with reusable text content.</p>
|
|
39
|
+
</div>
|
|
40
|
+
</li>
|
|
41
|
+
|
|
42
|
+
<li pgs="accordion">
|
|
43
|
+
<button pgs="accordion-button" type="button">
|
|
44
|
+
<i class="fa-solid fa-circle-info" aria-hidden="true"></i>
|
|
45
|
+
<span>Second section</span>
|
|
46
|
+
</button>
|
|
47
|
+
|
|
48
|
+
<div pgs="accordion-content" hidden>
|
|
49
|
+
<p>Additional accordion panel content.</p>
|
|
50
|
+
</div>
|
|
51
|
+
</li>
|
|
52
|
+
</ul>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* @title Alerts
|
|
4
|
+
* @description Static inline feedback messages for contextual information, successful operations, warnings, and errors. Use the notification API for dynamic floating alerts and toasts.
|
|
5
|
+
*
|
|
6
|
+
* @pgs
|
|
7
|
+
* - alert: identifies the inline alert container.
|
|
8
|
+
* - alert-icon: identifies the decorative status icon.
|
|
9
|
+
* - alert-content: groups the title and descriptive message.
|
|
10
|
+
* - alert-title: identifies the alert heading.
|
|
11
|
+
*
|
|
12
|
+
* @pgs-state
|
|
13
|
+
* - info: presents neutral informational feedback.
|
|
14
|
+
* - success: presents confirmation of a successful operation.
|
|
15
|
+
* - warning: presents a condition that requires attention.
|
|
16
|
+
* - error: presents a failure or blocking problem.
|
|
17
|
+
*
|
|
18
|
+
* @related
|
|
19
|
+
* - flexColumn: vertically arranges the alert examples.
|
|
20
|
+
* - gapElements: applies element spacing between the examples.
|
|
21
|
+
* - notification: provides dynamic floating alerts and toast messages.
|
|
22
|
+
*
|
|
23
|
+
* @return Accessible HTML examples of the four inline alert states.
|
|
24
|
+
*/
|
|
25
|
+
-->
|
|
26
|
+
|
|
27
|
+
<div pgs="flexColumn gapElements">
|
|
28
|
+
<div pgs="alert" pgs-state="info" role="status">
|
|
29
|
+
<i pgs="alert-icon" class="fa-solid fa-circle-info" aria-hidden="true"></i>
|
|
30
|
+
<div pgs="alert-content">
|
|
31
|
+
<strong pgs="alert-title">Information</strong>
|
|
32
|
+
<p>Your profile information can be updated at any time.</p>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div pgs="alert" pgs-state="success" role="status">
|
|
37
|
+
<i pgs="alert-icon" class="fa-solid fa-circle-check" aria-hidden="true"></i>
|
|
38
|
+
<div pgs="alert-content">
|
|
39
|
+
<strong pgs="alert-title">Changes saved</strong>
|
|
40
|
+
<p>Your preferences were updated successfully.</p>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div pgs="alert" pgs-state="warning" role="alert">
|
|
45
|
+
<i pgs="alert-icon" class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i>
|
|
46
|
+
<div pgs="alert-content">
|
|
47
|
+
<strong pgs="alert-title">Check your information</strong>
|
|
48
|
+
<p>Some fields may require your attention before continuing.</p>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div pgs="alert" pgs-state="error" role="alert">
|
|
53
|
+
<i pgs="alert-icon" class="fa-solid fa-circle-xmark" aria-hidden="true"></i>
|
|
54
|
+
<div pgs="alert-content">
|
|
55
|
+
<strong pgs="alert-title">Unable to save</strong>
|
|
56
|
+
<p>Correct the reported errors and try again.</p>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* @title Badge
|
|
4
|
+
* @description Collection of compact indicators for displaying categories, priorities, and visual states with consistent color variants.
|
|
5
|
+
*
|
|
6
|
+
* @pgs
|
|
7
|
+
* - badge: identifies the base badge variant.
|
|
8
|
+
*
|
|
9
|
+
* @pgs-option
|
|
10
|
+
* - badgePrimary: applies the primary color variant.
|
|
11
|
+
* - badgeStrong: applies the high-contrast variant.
|
|
12
|
+
* - badgeSuccess: represents a successful result.
|
|
13
|
+
* - badgeDot: adds a dot indicator to the badge.
|
|
14
|
+
* - badgeWarning: represents a warning.
|
|
15
|
+
* - badgeError: represents an error.
|
|
16
|
+
* - badgeInfo: represents informational content.
|
|
17
|
+
* - badgeNeutral: applies the neutral variant.
|
|
18
|
+
*
|
|
19
|
+
* @related
|
|
20
|
+
* - flexRow: arranges badges horizontally and allows them to wrap.
|
|
21
|
+
*
|
|
22
|
+
* @return HTML examples of the available badge variants.
|
|
23
|
+
*/
|
|
24
|
+
-->
|
|
25
|
+
|
|
26
|
+
<div pgs="flexRow">
|
|
27
|
+
<span pgs="badge">
|
|
28
|
+
Base
|
|
29
|
+
</span>
|
|
30
|
+
|
|
31
|
+
<span pgs="badge" pgs-option="badgePrimary">
|
|
32
|
+
Primary
|
|
33
|
+
</span>
|
|
34
|
+
|
|
35
|
+
<span pgs="badge" pgs-option="badgeStrong">
|
|
36
|
+
Strong
|
|
37
|
+
</span>
|
|
38
|
+
|
|
39
|
+
<span pgs="badge" pgs-option="badgeSuccess badgeDot">
|
|
40
|
+
Active
|
|
41
|
+
</span>
|
|
42
|
+
|
|
43
|
+
<span pgs="badge" pgs-option="badgeWarning">
|
|
44
|
+
<i class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i>
|
|
45
|
+
Warning
|
|
46
|
+
</span>
|
|
47
|
+
|
|
48
|
+
<span pgs="badge" pgs-option="badgeError">
|
|
49
|
+
<i class="fa-solid fa-xmark" aria-hidden="true"></i>
|
|
50
|
+
Error
|
|
51
|
+
</span>
|
|
52
|
+
|
|
53
|
+
<span pgs="badge" pgs-option="badgeInfo">
|
|
54
|
+
<i class="fa-solid fa-circle-info" aria-hidden="true"></i>
|
|
55
|
+
Info
|
|
56
|
+
</span>
|
|
57
|
+
|
|
58
|
+
<span pgs="badge" pgs-option="badgeNeutral">
|
|
59
|
+
Neutral
|
|
60
|
+
</span>
|
|
61
|
+
|
|
62
|
+
</div>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
/**
|
|
3
3
|
* @title Breadcrumb
|
|
4
|
-
* @description
|
|
4
|
+
* @description Hierarchical navigation that shows the current page path with links, separators, and a semantic indication of the active item.
|
|
5
5
|
*
|
|
6
6
|
* @pgs
|
|
7
|
-
* - breadcrumb:
|
|
8
|
-
* - breadcrumb-item:
|
|
9
|
-
* - breadcrumb-item-separator:
|
|
7
|
+
* - breadcrumb: identifies the main navigation path list.
|
|
8
|
+
* - breadcrumb-item: identifies each level in the path.
|
|
9
|
+
* - breadcrumb-item-separator: identifies the decorative separator hidden from assistive technologies.
|
|
10
10
|
*
|
|
11
|
-
* @return
|
|
11
|
+
* @return Semantic breadcrumb HTML structure wrapped in a nav element.
|
|
12
12
|
*/
|
|
13
13
|
-->
|
|
14
14
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
<li pgs="breadcrumb-item">
|
|
32
32
|
<span aria-current="page">
|
|
33
|
-
|
|
33
|
+
Sample article
|
|
34
34
|
</span>
|
|
35
35
|
</li>
|
|
36
36
|
</ul>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* @title Button
|
|
4
|
+
* @description Button and action-link variants with sizes, emphasis, and icon-text composition defined by the design system.
|
|
5
|
+
*
|
|
6
|
+
* @pgs
|
|
7
|
+
* - button: identifies the standard button, which can also be used on anchor elements.
|
|
8
|
+
*
|
|
9
|
+
* @pgs-option
|
|
10
|
+
* - buttonReverse: reverses the visual order of the text and icon on the button.
|
|
11
|
+
* - buttonStrong: applies the variant with stronger visual emphasis.
|
|
12
|
+
* - buttonIcon: identifies a compact button composed primarily of an icon.
|
|
13
|
+
* - buttonMini: applies the smallest size variant.
|
|
14
|
+
* - buttonBig: applies the large size variant.
|
|
15
|
+
*
|
|
16
|
+
* @related
|
|
17
|
+
* - flexRow: arranges the button examples in a flexible row.
|
|
18
|
+
*
|
|
19
|
+
* @return HTML collection of the main button variants.
|
|
20
|
+
*/
|
|
21
|
+
-->
|
|
22
|
+
|
|
23
|
+
<div pgs="flexRow">
|
|
24
|
+
<a pgs="button" href="#">
|
|
25
|
+
<i class="fa-duotone fa-solid fa-store"></i>
|
|
26
|
+
About
|
|
27
|
+
</a>
|
|
28
|
+
|
|
29
|
+
<button pgs="button" type="button" pgs-option="buttonReverse">
|
|
30
|
+
Next
|
|
31
|
+
<i class="fa-solid fa-arrow-right" aria-hidden="true"></i>
|
|
32
|
+
</button>
|
|
33
|
+
|
|
34
|
+
<button pgs="button" pgs-option="buttonStrong" type="button">
|
|
35
|
+
<i class="fa-solid fa-check" aria-hidden="true"></i>
|
|
36
|
+
Submit
|
|
37
|
+
</button>
|
|
38
|
+
|
|
39
|
+
<button pgs="button" pgs-option="buttonIcon" type="button" aria-label="Settings">
|
|
40
|
+
<i class="fa-solid fa-gear" aria-hidden="true"></i>
|
|
41
|
+
</button>
|
|
42
|
+
|
|
43
|
+
<button pgs="button" pgs-option="buttonMini" type="button" aria-label="Information">
|
|
44
|
+
<i class="fa-solid fa-info" aria-hidden="true"></i>
|
|
45
|
+
</button>
|
|
46
|
+
|
|
47
|
+
<button pgs="button" pgs-option="buttonBig" type="button" aria-label="Large button">
|
|
48
|
+
<i class="fa-solid fa-rocket" aria-hidden="true"></i>
|
|
49
|
+
Large button
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* @title Card
|
|
4
|
+
* @description Reusable container for grouping an image, title, text, and actions in responsive previews or collections.
|
|
5
|
+
*
|
|
6
|
+
* @pgs
|
|
7
|
+
* - card: identifies the main card container.
|
|
8
|
+
* - card-img: identifies the main card image.
|
|
9
|
+
*
|
|
10
|
+
* @pgs-option
|
|
11
|
+
* - column-2: configures the related flex layout with two columns.
|
|
12
|
+
*
|
|
13
|
+
* @related
|
|
14
|
+
* - flexRow: arranges the cards in a responsive layout.
|
|
15
|
+
* - flexColumn: organizes the card or link content vertically.
|
|
16
|
+
* - imgCover: scales the image to fill the available area.
|
|
17
|
+
* - button: presents the final link as a standard button.
|
|
18
|
+
*
|
|
19
|
+
* @return Two card HTML structures, one with a separate action and one that is fully clickable.
|
|
20
|
+
*/
|
|
21
|
+
-->
|
|
22
|
+
|
|
23
|
+
<div pgs="flexRow" pgs-option="column-2">
|
|
24
|
+
|
|
25
|
+
<article pgs="card flexColumn">
|
|
26
|
+
<img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="Placeholder image">
|
|
27
|
+
|
|
28
|
+
<div pgs="flexColumn">
|
|
29
|
+
<h3>Reusable card</h3>
|
|
30
|
+
<p>Descriptive card content suitable for lists, previews, and grids.</p>
|
|
31
|
+
<a pgs="button" href="#">Read more</a>
|
|
32
|
+
</div>
|
|
33
|
+
</article>
|
|
34
|
+
|
|
35
|
+
<article pgs="card">
|
|
36
|
+
<a pgs="flexColumn" href="">
|
|
37
|
+
<img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="Placeholder image">
|
|
38
|
+
|
|
39
|
+
<div pgs="flexColumn">
|
|
40
|
+
<h3>Reusable card</h3>
|
|
41
|
+
<p>Descriptive card content suitable for lists, previews, and grids.</p>
|
|
42
|
+
</div>
|
|
43
|
+
</a>
|
|
44
|
+
</article>
|
|
45
|
+
</div>
|