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.
- package/.vscode/tasks.json +39 -0
- package/AGENTS.md +22 -21
- package/README.md +2 -2
- 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 -7
- package/assets/scss/components/_alerts.scss +71 -0
- package/assets/scss/components/_badges.scss +40 -48
- package/assets/scss/components/_button.scss +27 -19
- package/assets/scss/components/_card.scss +9 -4
- package/assets/scss/components/_formAddon.scss +5 -1
- package/assets/scss/components/_logo.scss +3 -4
- package/assets/scss/components/_menu.scss +26 -3
- package/assets/scss/components/_modals.scss +2 -2
- package/assets/scss/components/_stepTabs.scss +2 -1
- package/assets/scss/index.scss +2 -3
- package/assets/scss/layout/_header.scss +3 -3
- package/assets/scss/layout/_responsive.scss +63 -0
- package/assets/scss/mixin/_mx-base.scss +4 -8
- package/assets/scss/mixin/_mx-button.scss +74 -70
- package/assets/scss/mixin/_mx-card.scss +33 -36
- package/assets/scss/mixin/_mx-form.scss +10 -5
- package/assets/scss/mixin/_mx-formAddon.scss +100 -58
- package/assets/scss/mixin/_mx-hover.scss +21 -15
- package/assets/scss/mixin/_mx-responsive.scss +81 -201
- package/demo/demo.css +9 -6
- package/demo/demo.html +7 -5
- package/demo/demo.js +34 -32
- package/dist/css/index.css +2502 -3507
- 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 +5 -5
- package/docs/components/accordion.md +3 -3
- package/docs/components/alerts.md +67 -0
- package/docs/components/badges.md +11 -8
- package/docs/components/breadcumbs.md +1 -1
- package/docs/components/button.md +9 -9
- package/docs/components/card.md +9 -6
- package/docs/components/dropdown.md +1 -1
- package/docs/components/form.md +6 -5
- package/docs/components/formAddon.md +56 -19
- package/docs/components/logo.md +1 -1
- package/docs/components/menu.md +2 -2
- package/docs/components/modal.md +7 -6
- package/docs/components/notification.md +2 -2
- package/docs/components/search.md +8 -7
- package/docs/components/slides.md +5 -6
- package/docs/components/stepTabs.md +7 -7
- package/docs/components/steps.md +1 -1
- package/docs/components/summary.md +1 -1
- package/docs/components/table.md +1 -1
- package/docs/components/tooltip.md +4 -3
- package/docs/convenzioni.md +1 -1
- package/docs/export-e-sviluppo.md +1 -1
- package/docs/helper-javascript.md +1 -1
- package/docs/layout/body.md +1 -1
- package/docs/layout/footer.md +7 -3
- package/docs/layout/header.md +5 -4
- package/docs/layout/pageShell.md +11 -11
- package/docs/layout/responsive.md +90 -0
- package/docs/layout/section.md +16 -16
- package/docs/patterns/cookieConsent.md +6 -3
- package/docs/utilizzo-css-scss.md +26 -2
- package/package.json +1 -1
- package/{templates → reference}/html/components/accordion.html +2 -2
- package/reference/html/components/alerts.html +59 -0
- package/{templates → reference}/html/components/badges.html +9 -7
- package/{templates → reference}/html/components/button.html +7 -7
- package/{templates → reference}/html/components/card.html +7 -5
- package/{templates → reference}/html/components/form.html +5 -4
- package/reference/html/components/formAddon.html +109 -0
- package/{templates → reference}/html/components/menu.html +2 -2
- package/{templates → reference}/html/components/modal.html +6 -5
- package/{templates → reference}/html/components/notification.html +2 -2
- package/{templates → reference}/html/components/search.html +7 -6
- package/{templates → reference}/html/components/slides.html +4 -5
- package/{templates → reference}/html/components/stepTabs.html +6 -6
- package/{templates → reference}/html/components/tooltip.html +3 -2
- package/{templates → reference}/html/layout/footer.html +5 -2
- package/{templates → reference}/html/layout/header.html +4 -3
- package/{templates → reference}/html/layout/pageShell.html +10 -10
- package/reference/html/layout/responsive.html +83 -0
- package/{templates → reference}/html/layout/section.html +15 -15
- package/{templates → reference}/html/patterns/cookieConsent.html +4 -2
- package/{templates → reference}/react/components/accordion.jsx +1 -1
- package/reference/react/components/alerts.jsx +46 -0
- package/{templates → reference}/react/components/button.jsx +4 -4
- package/{templates → reference}/react/components/card.jsx +2 -2
- package/{templates → reference}/react/components/form.jsx +1 -1
- package/{templates → reference}/react/components/modal.jsx +2 -2
- package/{templates → reference}/react/components/search.jsx +4 -4
- package/{templates → reference}/react/components/slides.jsx +1 -1
- package/{templates → reference}/react/components/stepTabs.jsx +4 -4
- 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/{templates → reference}/react/layout/section.jsx +12 -12
- package/{templates → reference}/react/patterns/cookieConsent.jsx +1 -1
- package/{templates → reference}/react/patterns/footer.jsx +1 -1
- package/{templates → reference}/react/patterns/header.jsx +2 -2
- package/scripts/generate-component-docs.js +8 -8
- 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/formAddon.html +0 -72
- package/templates/html/layout/flex.html +0 -109
- package/templates/html/layout/grid.html +0 -109
- package/templates/react/layout/flex.jsx +0 -36
- package/templates/react/layout/grid.jsx +0 -36
- /package/{templates → reference}/html/components/breadcumbs.html +0 -0
- /package/{templates → reference}/html/components/dropdown.html +0 -0
- /package/{templates → reference}/html/components/logo.html +0 -0
- /package/{templates → reference}/html/components/steps.html +0 -0
- /package/{templates → reference}/html/components/summary.html +0 -0
- /package/{templates → reference}/html/components/table.html +0 -0
- /package/{templates → reference}/html/layout/body.html +0 -0
- /package/{templates → reference}/react/components/breadcumbs.jsx +0 -0
- /package/{templates → reference}/react/components/dropdown.jsx +0 -0
- /package/{templates → reference}/react/components/logo.jsx +0 -0
- /package/{templates → reference}/react/components/menu.jsx +0 -0
- /package/{templates → reference}/react/components/notification.jsx +0 -0
- /package/{templates → reference}/react/components/steps.jsx +0 -0
- /package/{templates → reference}/react/components/summary.jsx +0 -0
- /package/{templates → reference}/react/components/table.jsx +0 -0
- /package/{templates → reference}/react/layout/body.jsx +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<!-- Automatically generated from reference/html/layout/responsive.html. Edit reference/html/layout/responsive.html and run npm run docs:generate again. -->
|
|
2
|
+
|
|
3
|
+
# Responsive
|
|
4
|
+
|
|
5
|
+
Responsive flex and grid layouts with configurable columns, spacing utilities, and wrapping controls.
|
|
6
|
+
|
|
7
|
+
## PGS
|
|
8
|
+
|
|
9
|
+
- `flex`: creates a responsive flex layout.
|
|
10
|
+
- `grid`: creates a responsive grid layout.
|
|
11
|
+
- `flexColumn`: stacks text inside each demonstration cell.
|
|
12
|
+
- `flexRow`: arranges the gap demonstration items horizontally.
|
|
13
|
+
- `gapTexts`: applies the text spacing token.
|
|
14
|
+
- `gapElements`: applies the element spacing token.
|
|
15
|
+
- `gapSections`: applies the section spacing token.
|
|
16
|
+
- `wrap`: allows flex items to wrap.
|
|
17
|
+
- `nowrap`: prevents flex items from wrapping.
|
|
18
|
+
- `box`: makes the demonstration cells visible.
|
|
19
|
+
|
|
20
|
+
## PGS Options
|
|
21
|
+
|
|
22
|
+
- `column-2`: configures the flex example with two columns; column values from 1 through 8 are supported.
|
|
23
|
+
- `column-4`: configures the grid example with four columns; column values from 1 through 8 are supported.
|
|
24
|
+
- `m2e`: keeps two elements per row at the mobile breakpoint, returning to one column on watch-sized containers.
|
|
25
|
+
|
|
26
|
+
## Output
|
|
27
|
+
|
|
28
|
+
Flex, grid, and gap examples in that order, using the current responsive layout API.
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<div pgs="flexColumn gapSections">
|
|
34
|
+
<section>
|
|
35
|
+
<strong>Flex</strong>
|
|
36
|
+
<div pgs="flexRow" pgs-option="column-2 m2e">
|
|
37
|
+
<article pgs="box flexColumn">
|
|
38
|
+
<strong>Column one</strong>
|
|
39
|
+
<p>First flex column.</p>
|
|
40
|
+
</article>
|
|
41
|
+
<article pgs="box flexColumn">
|
|
42
|
+
<strong>Column two</strong>
|
|
43
|
+
<p>Second flex column.</p>
|
|
44
|
+
</article>
|
|
45
|
+
<article pgs="box flexColumn">
|
|
46
|
+
<strong>Column three</strong>
|
|
47
|
+
<p>Third flex column.</p>
|
|
48
|
+
</article>
|
|
49
|
+
</div>
|
|
50
|
+
</section>
|
|
51
|
+
|
|
52
|
+
<section>
|
|
53
|
+
<strong>Grid</strong>
|
|
54
|
+
<div pgs="grid" pgs-option="column-4 m2e">
|
|
55
|
+
<article pgs="box flexColumn">
|
|
56
|
+
<strong>Column one</strong>
|
|
57
|
+
<p>First grid column.</p>
|
|
58
|
+
</article>
|
|
59
|
+
<article pgs="box flexColumn">
|
|
60
|
+
<strong>Column two</strong>
|
|
61
|
+
<p>Second grid column.</p>
|
|
62
|
+
</article>
|
|
63
|
+
<article pgs="box flexColumn">
|
|
64
|
+
<strong>Column three</strong>
|
|
65
|
+
<p>Third grid column.</p>
|
|
66
|
+
</article>
|
|
67
|
+
<article pgs="box flexColumn">
|
|
68
|
+
<strong>Column four</strong>
|
|
69
|
+
<p>Third grid column.</p>
|
|
70
|
+
</article>
|
|
71
|
+
</div>
|
|
72
|
+
</section>
|
|
73
|
+
|
|
74
|
+
<section pgs="flexRow">
|
|
75
|
+
<strong>Gap</strong>
|
|
76
|
+
<div pgs="flexRow gapTexts wrap">
|
|
77
|
+
<span pgs="box">Text gap</span>
|
|
78
|
+
<span pgs="box">Text gap</span>
|
|
79
|
+
</div>
|
|
80
|
+
<div pgs="flexRow gapElements wrap">
|
|
81
|
+
<span pgs="box">Element gap</span>
|
|
82
|
+
<span pgs="box">Element gap</span>
|
|
83
|
+
</div>
|
|
84
|
+
<div pgs="flexRow gapSections nowrap">
|
|
85
|
+
<span pgs="box">Section gap</span>
|
|
86
|
+
<span pgs="box">Section gap</span>
|
|
87
|
+
</div>
|
|
88
|
+
</section>
|
|
89
|
+
</div>
|
|
90
|
+
```
|
package/docs/layout/section.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Automatically generated from
|
|
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
|
|
|
@@ -15,9 +15,9 @@ Section variants that control width, padding, and specific content treatment whi
|
|
|
15
15
|
|
|
16
16
|
## Related elements
|
|
17
17
|
|
|
18
|
-
- `
|
|
19
|
-
- `
|
|
20
|
-
- `
|
|
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
21
|
- `card-img`: reuses card image treatment in the demonstration sections.
|
|
22
22
|
- `imgCover`: scales images to the section width.
|
|
23
23
|
|
|
@@ -28,40 +28,40 @@ HTML collection of the available section variants.
|
|
|
28
28
|
## Example
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
|
-
<div pgs="
|
|
32
|
-
<section pgs="section
|
|
33
|
-
<div pgs="
|
|
31
|
+
<div pgs="flexColumn gapSections">
|
|
32
|
+
<section pgs="section flexColumn gapElements">
|
|
33
|
+
<div pgs="flexColumn">
|
|
34
34
|
<strong>Standard section</strong>
|
|
35
35
|
<p>Centered content inside a MyPGS section.</p>
|
|
36
36
|
</div>
|
|
37
37
|
</section>
|
|
38
38
|
|
|
39
|
-
<section pgs="sectionFull
|
|
40
|
-
<div pgs="
|
|
39
|
+
<section pgs="sectionFull flexColumn gapElements">
|
|
40
|
+
<div pgs="flexColumn">
|
|
41
41
|
<strong>Full-width section</strong>
|
|
42
42
|
<p>Centered content inside a MyPGS section.</p>
|
|
43
43
|
</div>
|
|
44
44
|
</section>
|
|
45
45
|
|
|
46
|
-
<section pgs="sectionSpecificity
|
|
47
|
-
<div pgs="
|
|
46
|
+
<section pgs="sectionSpecificity flexColumn gapElements">
|
|
47
|
+
<div pgs="flexColumn">
|
|
48
48
|
<img pgs="card-img imgCover" src="https://placehold.co/800x200?text=Hero" alt="Placeholder image">
|
|
49
49
|
</div>
|
|
50
|
-
<div pgs="sectionSpecificity-child
|
|
50
|
+
<div pgs="sectionSpecificity-child flexColumn">
|
|
51
51
|
<strong>Specificity-child section</strong>
|
|
52
52
|
<p>Centered content inside a MyPGS section.</p>
|
|
53
53
|
</div>
|
|
54
54
|
</section>
|
|
55
55
|
|
|
56
|
-
<section pgs="sectionMax
|
|
57
|
-
<div pgs="
|
|
56
|
+
<section pgs="sectionMax flexColumn gapElements" style="background-color: var(--color-primary-soft)">
|
|
57
|
+
<div pgs="flexColumn">
|
|
58
58
|
<strong>Max-width section</strong>
|
|
59
59
|
<p>Centered content inside a MyPGS section.</p>
|
|
60
60
|
</div>
|
|
61
61
|
</section>
|
|
62
62
|
|
|
63
|
-
<section pgs="sectionNoPadding
|
|
64
|
-
<div pgs="
|
|
63
|
+
<section pgs="sectionNoPadding flexColumn gapElements">
|
|
64
|
+
<div pgs="flexColumn">
|
|
65
65
|
<img pgs="card-img imgCover" src="https://placehold.co/800x500?text=HI!" alt="Placeholder image">
|
|
66
66
|
</div>
|
|
67
67
|
</section>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Automatically generated from
|
|
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
|
|
|
@@ -19,6 +19,10 @@ Accessible pattern for collecting and storing analytics cookie consent, applying
|
|
|
19
19
|
- `cookieConsent-accepted`: runtime token applied to the root when analytics is allowed.
|
|
20
20
|
- `cookieConsent-declined`: runtime token applied to the root when analytics is not allowed.
|
|
21
21
|
|
|
22
|
+
## PGS Options
|
|
23
|
+
|
|
24
|
+
- `buttonStrong`: presents full acceptance as the primary action.
|
|
25
|
+
|
|
22
26
|
## Related elements
|
|
23
27
|
|
|
24
28
|
- `flexColumn`: vertically organizes the preference panel.
|
|
@@ -26,7 +30,6 @@ Accessible pattern for collecting and storing analytics cookie consent, applying
|
|
|
26
30
|
- `nowrap`: prevents wrapping in the essential-cookie row.
|
|
27
31
|
- `toggle`: presents analytics consent as a switch.
|
|
28
32
|
- `button`: presents the selection action with standard styling.
|
|
29
|
-
- `buttonStrong`: presents full acceptance as the primary action.
|
|
30
33
|
|
|
31
34
|
## Output
|
|
32
35
|
|
|
@@ -81,7 +84,7 @@ Consent panel HTML with essential and analytics preferences, actions, and access
|
|
|
81
84
|
<i class="fa-solid fa-duotone fa-sliders"></i>Selected only
|
|
82
85
|
</button>
|
|
83
86
|
|
|
84
|
-
<button type="button" pgs="
|
|
87
|
+
<button type="button" pgs="button cookieConsent-actionAccept" pgs-option="buttonStrong">
|
|
85
88
|
<i class="fa-solid fa-check"></i> Accept all
|
|
86
89
|
</button>
|
|
87
90
|
</div>
|
|
@@ -24,13 +24,37 @@ Recommended override:
|
|
|
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
|
+
## Button mixins
|
|
28
|
+
|
|
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
|
+
|
|
27
51
|
## The `pgs` system
|
|
28
52
|
|
|
29
53
|
Markup uses space-separated tokens inside the `pgs` attribute:
|
|
30
54
|
|
|
31
55
|
```html
|
|
32
|
-
<button pgs="button buttonStrong" type="button">Save</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
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
* - instance.isOpen(): returns true when the open state is active.
|
|
22
22
|
*
|
|
23
23
|
* @related
|
|
24
|
-
* -
|
|
24
|
+
* - flexColumn: applies text spacing between the list items.
|
|
25
25
|
*
|
|
26
26
|
* @return HTML list of accessible accordion items with an associated button and panel.
|
|
27
27
|
*/
|
|
28
28
|
-->
|
|
29
29
|
|
|
30
|
-
<ul pgs="
|
|
30
|
+
<ul pgs="flexColumn">
|
|
31
31
|
<li pgs="accordion">
|
|
32
32
|
<button pgs="accordion-button" type="button">
|
|
33
33
|
<i class="fa-solid fa-circle-question" aria-hidden="true"></i>
|
|
@@ -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>
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @pgs
|
|
7
7
|
* - badge: identifies the base badge variant.
|
|
8
|
+
*
|
|
9
|
+
* @pgs-option
|
|
8
10
|
* - badgePrimary: applies the primary color variant.
|
|
9
11
|
* - badgeStrong: applies the high-contrast variant.
|
|
10
12
|
* - badgeSuccess: represents a successful result.
|
|
@@ -26,34 +28,34 @@
|
|
|
26
28
|
Base
|
|
27
29
|
</span>
|
|
28
30
|
|
|
29
|
-
<span pgs="badgePrimary">
|
|
31
|
+
<span pgs="badge" pgs-option="badgePrimary">
|
|
30
32
|
Primary
|
|
31
33
|
</span>
|
|
32
34
|
|
|
33
|
-
<span pgs="badgeStrong">
|
|
35
|
+
<span pgs="badge" pgs-option="badgeStrong">
|
|
34
36
|
Strong
|
|
35
37
|
</span>
|
|
36
38
|
|
|
37
|
-
<span pgs="badgeSuccess badgeDot">
|
|
39
|
+
<span pgs="badge" pgs-option="badgeSuccess badgeDot">
|
|
38
40
|
Active
|
|
39
41
|
</span>
|
|
40
42
|
|
|
41
|
-
<span pgs="badgeWarning">
|
|
43
|
+
<span pgs="badge" pgs-option="badgeWarning">
|
|
42
44
|
<i class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i>
|
|
43
45
|
Warning
|
|
44
46
|
</span>
|
|
45
47
|
|
|
46
|
-
<span pgs="badgeError">
|
|
48
|
+
<span pgs="badge" pgs-option="badgeError">
|
|
47
49
|
<i class="fa-solid fa-xmark" aria-hidden="true"></i>
|
|
48
50
|
Error
|
|
49
51
|
</span>
|
|
50
52
|
|
|
51
|
-
<span pgs="badgeInfo">
|
|
53
|
+
<span pgs="badge" pgs-option="badgeInfo">
|
|
52
54
|
<i class="fa-solid fa-circle-info" aria-hidden="true"></i>
|
|
53
55
|
Info
|
|
54
56
|
</span>
|
|
55
57
|
|
|
56
|
-
<span pgs="
|
|
58
|
+
<span pgs="badge" pgs-option="badgeNeutral">
|
|
57
59
|
Neutral
|
|
58
60
|
</span>
|
|
59
61
|
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @pgs
|
|
7
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.
|
|
8
11
|
* - buttonStrong: applies the variant with stronger visual emphasis.
|
|
9
12
|
* - buttonIcon: identifies a compact button composed primarily of an icon.
|
|
10
13
|
* - buttonMini: applies the smallest size variant.
|
|
11
14
|
* - buttonBig: applies the large size variant.
|
|
12
15
|
*
|
|
13
|
-
* @pgs-option
|
|
14
|
-
* - buttonReverse: reverses the visual order of the text and icon on the button.
|
|
15
|
-
*
|
|
16
16
|
* @related
|
|
17
17
|
* - flexRow: arranges the button examples in a flexible row.
|
|
18
18
|
*
|
|
@@ -31,20 +31,20 @@
|
|
|
31
31
|
<i class="fa-solid fa-arrow-right" aria-hidden="true"></i>
|
|
32
32
|
</button>
|
|
33
33
|
|
|
34
|
-
<button pgs="buttonStrong" type="button">
|
|
34
|
+
<button pgs="button" pgs-option="buttonStrong" type="button">
|
|
35
35
|
<i class="fa-solid fa-check" aria-hidden="true"></i>
|
|
36
36
|
Submit
|
|
37
37
|
</button>
|
|
38
38
|
|
|
39
|
-
<button pgs="buttonIcon" type="button" aria-label="Settings">
|
|
39
|
+
<button pgs="button" pgs-option="buttonIcon" type="button" aria-label="Settings">
|
|
40
40
|
<i class="fa-solid fa-gear" aria-hidden="true"></i>
|
|
41
41
|
</button>
|
|
42
42
|
|
|
43
|
-
<button pgs="buttonMini" type="button" aria-label="Information">
|
|
43
|
+
<button pgs="button" pgs-option="buttonMini" type="button" aria-label="Information">
|
|
44
44
|
<i class="fa-solid fa-info" aria-hidden="true"></i>
|
|
45
45
|
</button>
|
|
46
46
|
|
|
47
|
-
<button pgs="buttonBig" type="button" aria-label="Large button">
|
|
47
|
+
<button pgs="button" pgs-option="buttonBig" type="button" aria-label="Large button">
|
|
48
48
|
<i class="fa-solid fa-rocket" aria-hidden="true"></i>
|
|
49
49
|
Large button
|
|
50
50
|
</button>
|
|
@@ -7,23 +7,25 @@
|
|
|
7
7
|
* - card: identifies the main card container.
|
|
8
8
|
* - card-img: identifies the main card image.
|
|
9
9
|
*
|
|
10
|
+
* @pgs-option
|
|
11
|
+
* - column-2: configures the related flex layout with two columns.
|
|
12
|
+
*
|
|
10
13
|
* @related
|
|
11
|
-
* -
|
|
14
|
+
* - flexRow: arranges the cards in a responsive layout.
|
|
12
15
|
* - flexColumn: organizes the card or link content vertically.
|
|
13
16
|
* - imgCover: scales the image to fill the available area.
|
|
14
|
-
* - flexColumnTexts: applies vertical spacing to text content.
|
|
15
17
|
* - button: presents the final link as a standard button.
|
|
16
18
|
*
|
|
17
19
|
* @return Two card HTML structures, one with a separate action and one that is fully clickable.
|
|
18
20
|
*/
|
|
19
21
|
-->
|
|
20
22
|
|
|
21
|
-
<div pgs="
|
|
23
|
+
<div pgs="flexRow" pgs-option="column-2">
|
|
22
24
|
|
|
23
25
|
<article pgs="card flexColumn">
|
|
24
26
|
<img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="Placeholder image">
|
|
25
27
|
|
|
26
|
-
<div pgs="
|
|
28
|
+
<div pgs="flexColumn">
|
|
27
29
|
<h3>Reusable card</h3>
|
|
28
30
|
<p>Descriptive card content suitable for lists, previews, and grids.</p>
|
|
29
31
|
<a pgs="button" href="#">Read more</a>
|
|
@@ -34,7 +36,7 @@
|
|
|
34
36
|
<a pgs="flexColumn" href="">
|
|
35
37
|
<img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="Placeholder image">
|
|
36
38
|
|
|
37
|
-
<div pgs="
|
|
39
|
+
<div pgs="flexColumn">
|
|
38
40
|
<h3>Reusable card</h3>
|
|
39
41
|
<p>Descriptive card content suitable for lists, previews, and grids.</p>
|
|
40
42
|
</div>
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* - message: defines a field-specific message with the syntax message[Message text].
|
|
16
16
|
* - error: is applied at runtime to the form and fields that fail validation.
|
|
17
17
|
* - success: is applied at runtime to the form after successful validation.
|
|
18
|
+
* - buttonStrong: presents form submission as the primary action.
|
|
18
19
|
*
|
|
19
20
|
* @api
|
|
20
21
|
* - new pgs.formValidate(form, options): creates a utility associated directly with the form, automatically adds novalidate, and accepts fieldError, fieldsError, and success in options.message; messages remain editable through instance.message.
|
|
@@ -26,8 +27,8 @@
|
|
|
26
27
|
* - instance.removeFieldError(field): removes the error state from the specified field.
|
|
27
28
|
*
|
|
28
29
|
* @related
|
|
29
|
-
* -
|
|
30
|
-
* -
|
|
30
|
+
* - button: provides the base styling for the primary submit action.
|
|
31
|
+
* - flexColumn: spaces text elements in the radio group.
|
|
31
32
|
*
|
|
32
33
|
* @return Complete HTML form with required fields and an example script for a custom rule, validation, and a success message.
|
|
33
34
|
*/
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
<textarea id="form-message" pgs="textarea" name="message" rows="5" placeholder="Write your message" required></textarea>
|
|
61
62
|
|
|
62
63
|
<br>
|
|
63
|
-
<fieldset pgs="radio
|
|
64
|
+
<fieldset pgs="radio flexColumn">
|
|
64
65
|
<legend>Preferred contact method</legend>
|
|
65
66
|
|
|
66
67
|
<label>
|
|
@@ -86,7 +87,7 @@
|
|
|
86
87
|
</label>
|
|
87
88
|
<br>
|
|
88
89
|
|
|
89
|
-
<button pgs="buttonStrong" type="submit">
|
|
90
|
+
<button pgs="button" pgs-option="buttonStrong" type="submit">
|
|
90
91
|
<i class="fa-solid fa-paper-plane" aria-hidden="true"></i>
|
|
91
92
|
Submit
|
|
92
93
|
</button>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* @title Form Add-ons
|
|
4
|
+
* @description Additional form controls for selectable cards, two-state buttons, switches, and compact chip groups.
|
|
5
|
+
*
|
|
6
|
+
* @pgs
|
|
7
|
+
* - checkboxBackground: presents a checkbox as a selectable container with a highlighted checked state.
|
|
8
|
+
* - twoState: presents checkbox or radio labels as buttons whose appearance changes when selected.
|
|
9
|
+
* - toggle: presents a checkbox as a switch with a rail and movable thumb.
|
|
10
|
+
* - chip: presents an individual checkbox or radio option as a compact selectable button.
|
|
11
|
+
* - chips: groups twoState controls into a compact segmented selector.
|
|
12
|
+
*
|
|
13
|
+
* @related
|
|
14
|
+
* - form: applies the base form styles to the complete add-on example.
|
|
15
|
+
* - flexColumn: vertically arranges each example with its heading and control.
|
|
16
|
+
* - flexRow: horizontally arranges standalone chip controls.
|
|
17
|
+
* - gapElements: applies element spacing between the form add-on examples.
|
|
18
|
+
*
|
|
19
|
+
* @return HTML examples of the checkboxBackground, twoState, toggle, and chips form controls using native checkbox and radio inputs.
|
|
20
|
+
*/
|
|
21
|
+
-->
|
|
22
|
+
|
|
23
|
+
<form pgs="form flexColumn gapElements">
|
|
24
|
+
<section pgs="flexColumn">
|
|
25
|
+
<strong>Checkbox with background</strong>
|
|
26
|
+
|
|
27
|
+
<label pgs="checkboxBackground">
|
|
28
|
+
<input type="checkbox" name="notifications" value="enabled">
|
|
29
|
+
<span>
|
|
30
|
+
<strong>Enable notifications</strong><br>
|
|
31
|
+
Receive important account updates.
|
|
32
|
+
</span>
|
|
33
|
+
</label>
|
|
34
|
+
</section>
|
|
35
|
+
|
|
36
|
+
<section pgs="flexColumn">
|
|
37
|
+
<strong>Two-state controls</strong>
|
|
38
|
+
|
|
39
|
+
<label pgs="twoState">
|
|
40
|
+
<input type="checkbox" name="favorite" value="yes">
|
|
41
|
+
<i class="fa-solid fa-star" aria-hidden="true"></i>
|
|
42
|
+
Add to favorites
|
|
43
|
+
</label>
|
|
44
|
+
</section>
|
|
45
|
+
|
|
46
|
+
<section pgs="flexColumn">
|
|
47
|
+
<strong>Toggle</strong>
|
|
48
|
+
|
|
49
|
+
<label pgs="toggle">
|
|
50
|
+
<span>Enable Wi-Fi</span>
|
|
51
|
+
<input type="checkbox" name="darkMode" value="enabled">
|
|
52
|
+
</label>
|
|
53
|
+
</section>
|
|
54
|
+
|
|
55
|
+
<section pgs="flexColumn">
|
|
56
|
+
<strong>Chips checkbox</strong>
|
|
57
|
+
<div pgs="flexRow" role="group" aria-label="Chip actions">
|
|
58
|
+
<label pgs="chip">
|
|
59
|
+
<input type="checkbox" name="like" value="basic">
|
|
60
|
+
<i class="fa-solid fa-heart"></i>
|
|
61
|
+
Like
|
|
62
|
+
</label>
|
|
63
|
+
<label pgs="chip">
|
|
64
|
+
<input type="checkbox" name="share" value="basic">
|
|
65
|
+
<i class="fa-solid fa-share"></i>
|
|
66
|
+
Share
|
|
67
|
+
</label>
|
|
68
|
+
</div>
|
|
69
|
+
</section>
|
|
70
|
+
|
|
71
|
+
<section pgs="flexColumn gapElements">
|
|
72
|
+
<fieldset pgs="chips">
|
|
73
|
+
<legend>Chip checkbox</legend>
|
|
74
|
+
<label>
|
|
75
|
+
<input type="checkbox" name="plan" value="basic" checked>
|
|
76
|
+
Basic
|
|
77
|
+
</label>
|
|
78
|
+
|
|
79
|
+
<label>
|
|
80
|
+
<input type="checkbox" name="plan" value="pro">
|
|
81
|
+
Pro
|
|
82
|
+
</label>
|
|
83
|
+
|
|
84
|
+
<label>
|
|
85
|
+
<input type="checkbox" name="plan" value="enterprise">
|
|
86
|
+
Enterprise
|
|
87
|
+
</label>
|
|
88
|
+
</fieldset>
|
|
89
|
+
|
|
90
|
+
<fieldset pgs="chips">
|
|
91
|
+
<legend>Chips radio</legend>
|
|
92
|
+
<label>
|
|
93
|
+
<input type="radio" name="characters" value="basic" checked>
|
|
94
|
+
<i class="fa-solid fa-crow"></i>
|
|
95
|
+
Crow
|
|
96
|
+
</label>
|
|
97
|
+
|
|
98
|
+
<label>
|
|
99
|
+
<i class="fa-solid fa-dove"></i> <input type="radio" name="characters" value="pro">
|
|
100
|
+
Dove
|
|
101
|
+
</label>
|
|
102
|
+
|
|
103
|
+
<label>
|
|
104
|
+
<i class="fa-solid fa-dragon"></i> <input type="radio" name="characters" value="enterprise">
|
|
105
|
+
dragon
|
|
106
|
+
</label>
|
|
107
|
+
</fieldset>
|
|
108
|
+
</section>
|
|
109
|
+
</form>
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - vertical: identifies the vertical element used by Menu.
|
|
13
13
|
* - menuHeader: identifies the menuHeader element used by Menu.
|
|
14
14
|
* - position: identifies the position element used by Menu.
|
|
15
|
+
* - buttonNohover: disables hover behavior on menu buttons generated at runtime.
|
|
15
16
|
*
|
|
16
17
|
* @pgs-state
|
|
17
18
|
* - open: identifies the open element used by Menu.
|
|
@@ -24,7 +25,6 @@
|
|
|
24
25
|
* @related
|
|
25
26
|
* - dropdown: uses the related dropdown component or utility in this example.
|
|
26
27
|
* - dropdown-button: uses the related dropdown-button component or utility in this example.
|
|
27
|
-
* - buttonNohover: uses the related buttonNohover component or utility in this example.
|
|
28
28
|
* - dropdown-content: uses the related dropdown-content component or utility in this example.
|
|
29
29
|
*
|
|
30
30
|
* @return Complete HTML markup and usage example for Menu.
|
|
@@ -77,4 +77,4 @@
|
|
|
77
77
|
</a>
|
|
78
78
|
</li>
|
|
79
79
|
</ul>
|
|
80
|
-
</nav>
|
|
80
|
+
</nav>
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
* - topLevel: identifies the topLevel element used by Modal.
|
|
22
22
|
* - left: identifies the left element used by Modal.
|
|
23
23
|
* - right: identifies the right element used by Modal.
|
|
24
|
+
* - buttonStrong: applies stronger emphasis to the save action.
|
|
25
|
+
* - buttonClose: styles the close action generated at runtime.
|
|
24
26
|
*
|
|
25
27
|
* @api
|
|
26
28
|
* - pgs.modal.init(root): initializes matching elements within the specified root.
|
|
@@ -33,9 +35,8 @@
|
|
|
33
35
|
*
|
|
34
36
|
* @related
|
|
35
37
|
* - button: uses the related button component or utility in this example.
|
|
36
|
-
* -
|
|
37
|
-
* -
|
|
38
|
-
* - flexColumnElements: uses the related flexColumnElements component or utility in this example.
|
|
38
|
+
* - flexColumn: vertically organizes modal content.
|
|
39
|
+
* - gapElements: applies element spacing to modal content.
|
|
39
40
|
* - flexRow: uses the related flexRow component or utility in this example.
|
|
40
41
|
*
|
|
41
42
|
* @return Complete HTML markup and usage example for Modal.
|
|
@@ -107,12 +108,12 @@
|
|
|
107
108
|
<h3>Save changes?</h3>
|
|
108
109
|
</div>
|
|
109
110
|
|
|
110
|
-
<div pgs="modal-dialog-content-scroll
|
|
111
|
+
<div pgs="modal-dialog-content-scroll flexColumn gapElements">
|
|
111
112
|
<p>You have unsaved changes. Confirm to apply them or cancel to return to the page.</p>
|
|
112
113
|
|
|
113
114
|
<div pgs="flexRow">
|
|
114
115
|
<button pgs="button modal-close" type="button">Cancel</button>
|
|
115
|
-
<button pgs="buttonStrong" type="button">Save changes</button>
|
|
116
|
+
<button pgs="button" pgs-option="buttonStrong" type="button">Save changes</button>
|
|
116
117
|
</div>
|
|
117
118
|
</div>
|
|
118
119
|
</div>
|