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
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
/**
|
|
3
3
|
* @title Dropdown
|
|
4
|
-
* @description
|
|
4
|
+
* @description Popup component that connects a control to content positioned relative to its trigger and handles opening, closing, outside clicks, and Escape.
|
|
5
5
|
*
|
|
6
6
|
* @pgs
|
|
7
|
-
* - dropdown:
|
|
8
|
-
* - dropdown-button:
|
|
9
|
-
* - dropdown-content:
|
|
7
|
+
* - dropdown: identifies the container initialized by the dropdown module.
|
|
8
|
+
* - dropdown-button: identifies the control that opens or closes the content.
|
|
9
|
+
* - dropdown-content: identifies the panel positioned relative to the control.
|
|
10
10
|
*
|
|
11
11
|
* @pgs-option
|
|
12
|
-
* - position:
|
|
13
|
-
* - buttonReverse:
|
|
12
|
+
* - position: configures the root as position[side alignment]; side accepts top, right, bottom, or left, while compatible alignment values are top, right, bottom, left, or center. The default is bottom center.
|
|
13
|
+
* - buttonReverse: reverses text and icon on the example buttons and belongs to the button component.
|
|
14
14
|
*
|
|
15
15
|
* @pgs-state
|
|
16
|
-
* - open:
|
|
16
|
+
* - open: indicates that the dropdown is open and its content is visible.
|
|
17
17
|
*
|
|
18
18
|
* @api
|
|
19
|
-
* - pgs.dropdown.init(root):
|
|
20
|
-
* - pgs.dropdown.api(element):
|
|
21
|
-
* - instance.open():
|
|
22
|
-
* - instance.close():
|
|
23
|
-
* - instance.toggle():
|
|
24
|
-
* - instance.refresh():
|
|
25
|
-
* - instance.isOpen():
|
|
19
|
+
* - pgs.dropdown.init(root): initializes unregistered dropdowns within the specified Document or Element.
|
|
20
|
+
* - pgs.dropdown.api(element): returns the instance associated with an initialized dropdown root.
|
|
21
|
+
* - instance.open(): opens the dropdown and closes any other open dropdowns.
|
|
22
|
+
* - instance.close(): closes the current dropdown.
|
|
23
|
+
* - instance.toggle(): toggles between the open and closed states.
|
|
24
|
+
* - instance.refresh(): reinitializes the context and recalculates content positioning.
|
|
25
|
+
* - instance.isOpen(): returns true when the dropdown is open.
|
|
26
26
|
*
|
|
27
27
|
* @related
|
|
28
|
-
* - flexRow:
|
|
29
|
-
* - button:
|
|
28
|
+
* - flexRow: arranges the placement examples on the same flexible row.
|
|
29
|
+
* - button: applies standard styling to dropdown controls.
|
|
30
30
|
*
|
|
31
|
-
* @return
|
|
31
|
+
* @return Series of HTML dropdowns demonstrating the supported placement directions.
|
|
32
32
|
*/
|
|
33
33
|
-->
|
|
34
34
|
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
</button>
|
|
42
42
|
|
|
43
43
|
<div pgs="dropdown-content">
|
|
44
|
-
|
|
44
|
+
bottom center content
|
|
45
45
|
</div>
|
|
46
46
|
</span>
|
|
47
47
|
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
</button>
|
|
53
53
|
|
|
54
54
|
<div pgs="dropdown-content">
|
|
55
|
-
|
|
55
|
+
top left content
|
|
56
56
|
</div>
|
|
57
57
|
</span>
|
|
58
58
|
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
</button>
|
|
64
64
|
|
|
65
65
|
<div pgs="dropdown-content">
|
|
66
|
-
|
|
66
|
+
top center content
|
|
67
67
|
</div>
|
|
68
68
|
</span>
|
|
69
69
|
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
</button>
|
|
75
75
|
|
|
76
76
|
<div pgs="dropdown-content">
|
|
77
|
-
|
|
77
|
+
top right content
|
|
78
78
|
</div>
|
|
79
79
|
</span>
|
|
80
80
|
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
</button>
|
|
86
86
|
|
|
87
87
|
<div pgs="dropdown-content">
|
|
88
|
-
|
|
88
|
+
bottom left content
|
|
89
89
|
</div>
|
|
90
90
|
</span>
|
|
91
91
|
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
</button>
|
|
97
97
|
|
|
98
98
|
<div pgs="dropdown-content">
|
|
99
|
-
|
|
99
|
+
bottom right content
|
|
100
100
|
</div>
|
|
101
101
|
</span>
|
|
102
102
|
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
</button>
|
|
108
108
|
|
|
109
109
|
<div pgs="dropdown-content">
|
|
110
|
-
|
|
110
|
+
left center content
|
|
111
111
|
</div>
|
|
112
112
|
</span>
|
|
113
113
|
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
</button>
|
|
119
119
|
|
|
120
120
|
<div pgs="dropdown-content">
|
|
121
|
-
|
|
121
|
+
right center content
|
|
122
122
|
</div>
|
|
123
123
|
</span>
|
|
124
124
|
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* @title Form
|
|
4
|
+
* @description Form structure with labels, text fields, a textarea, a checkbox, and a radio group compatible with HTML constraints and custom PGS_formValidate rules.
|
|
5
|
+
*
|
|
6
|
+
* @pgs
|
|
7
|
+
* - form: identifies the form container and applies the field layout.
|
|
8
|
+
* - formValidate: enables styles associated with validation states managed by the JavaScript utility.
|
|
9
|
+
* - label: identifies labels associated with controls.
|
|
10
|
+
* - input: applies shared styling to text inputs.
|
|
11
|
+
* - textarea: applies shared styling to the text area.
|
|
12
|
+
* - radio: styles a group of native radio inputs while preserving their shared name and selection behavior.
|
|
13
|
+
*
|
|
14
|
+
* @pgs-option
|
|
15
|
+
* - message: defines a field-specific message with the syntax message[Message text].
|
|
16
|
+
* - error: is applied at runtime to the form and fields that fail validation.
|
|
17
|
+
* - success: is applied at runtime to the form after successful validation.
|
|
18
|
+
* - buttonStrong: presents form submission as the primary action.
|
|
19
|
+
*
|
|
20
|
+
* @api
|
|
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.
|
|
22
|
+
* - instance.validator(callback, eventName): intercepts the specified event, prevents its default behavior, validates the form, shows the success message, and invokes callback only when valid; eventName defaults to submit.
|
|
23
|
+
* - instance.validate(): validates required fields, updates state attributes, and returns true or false.
|
|
24
|
+
* - instance.success(text): validates the form and shows a success toast when there are no errors.
|
|
25
|
+
* - instance.addNewRule(rule): adds a function that returns one or more invalid fields; validate automatically applies addFieldError to each field.
|
|
26
|
+
* - instance.addFieldError(field, index, total): marks a field as invalid; shows the specific message for one error or a summary message for multiple errors.
|
|
27
|
+
* - instance.removeFieldError(field): removes the error state from the specified field.
|
|
28
|
+
*
|
|
29
|
+
* @related
|
|
30
|
+
* - button: provides the base styling for the primary submit action.
|
|
31
|
+
* - flexColumn: spaces text elements in the radio group.
|
|
32
|
+
*
|
|
33
|
+
* @return Complete HTML form with required fields and an example script for a custom rule, validation, and a success message.
|
|
34
|
+
*/
|
|
35
|
+
-->
|
|
36
|
+
|
|
37
|
+
<form pgs="form formValidate" action="#" method="post">
|
|
38
|
+
<label pgs="label" for="form-name">
|
|
39
|
+
Name
|
|
40
|
+
</label>
|
|
41
|
+
<input id="form-name" pgs="input" pgs-option="message[Enter your name]" type="text" name="name" placeholder="John Smith" required>
|
|
42
|
+
|
|
43
|
+
<label pgs="label" for="form-email">
|
|
44
|
+
Email
|
|
45
|
+
</label>
|
|
46
|
+
<input id="form-email" pgs="input" pgs-option="message[Enter a valid email address]" type="email" name="email" placeholder="name@example.com" required>
|
|
47
|
+
|
|
48
|
+
<label pgs="label" for="form-password">
|
|
49
|
+
Password
|
|
50
|
+
</label>
|
|
51
|
+
<input id="form-password" pgs="input" pgs-option="message[Enter a password]" type="password" name="password" autocomplete="new-password" required>
|
|
52
|
+
|
|
53
|
+
<label pgs="label" for="form-confirm-password">
|
|
54
|
+
Confirm password
|
|
55
|
+
</label>
|
|
56
|
+
<input id="form-confirm-password" pgs="input" pgs-option="message[Confirm your password]" type="password" name="confirmPassword" autocomplete="new-password" required>
|
|
57
|
+
|
|
58
|
+
<label pgs="label" for="form-message">
|
|
59
|
+
Message
|
|
60
|
+
</label>
|
|
61
|
+
<textarea id="form-message" pgs="textarea" name="message" rows="5" placeholder="Write your message" required></textarea>
|
|
62
|
+
|
|
63
|
+
<br>
|
|
64
|
+
<fieldset pgs="radio flexColumn">
|
|
65
|
+
<legend>Preferred contact method</legend>
|
|
66
|
+
|
|
67
|
+
<label>
|
|
68
|
+
<input type="radio" name="contactMethod" value="email" pgs-option="message[Choose a contact method]" required>
|
|
69
|
+
<span>Email</span>
|
|
70
|
+
</label>
|
|
71
|
+
|
|
72
|
+
<label>
|
|
73
|
+
<input type="radio" name="contactMethod" value="phone">
|
|
74
|
+
<span>Phone</span>
|
|
75
|
+
</label>
|
|
76
|
+
|
|
77
|
+
<label>
|
|
78
|
+
<input type="radio" name="contactMethod" value="message">
|
|
79
|
+
<span>Direct message</span>
|
|
80
|
+
</label>
|
|
81
|
+
</fieldset>
|
|
82
|
+
<br>
|
|
83
|
+
|
|
84
|
+
<label>
|
|
85
|
+
<input type="checkbox" name="privacy" required>
|
|
86
|
+
<span>I accept the privacy policy</span>
|
|
87
|
+
</label>
|
|
88
|
+
<br>
|
|
89
|
+
|
|
90
|
+
<button pgs="button" pgs-option="buttonStrong" type="submit">
|
|
91
|
+
<i class="fa-solid fa-paper-plane" aria-hidden="true"></i>
|
|
92
|
+
Submit
|
|
93
|
+
</button>
|
|
94
|
+
</form>
|
|
95
|
+
|
|
96
|
+
<script type="module">
|
|
97
|
+
import { pgs } from "mypgs";
|
|
98
|
+
|
|
99
|
+
const form = pgs(document).querySelector("form");
|
|
100
|
+
|
|
101
|
+
const password = form.querySelector('input[name="password"]');
|
|
102
|
+
const confirmPassword = form.querySelector('input[name="confirmPassword"]');
|
|
103
|
+
if (!password || !confirmPassword) return;
|
|
104
|
+
|
|
105
|
+
const formValidate = new pgs.formValidate(form, {
|
|
106
|
+
message: {
|
|
107
|
+
fieldError: "Please complete this field",
|
|
108
|
+
fieldsError: "Please complete all required fields",
|
|
109
|
+
success: "Submitted successfully"
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
//== new roules
|
|
114
|
+
formValidate.addNewRule(() => {
|
|
115
|
+
if (password.value && confirmPassword.value && password.value !== confirmPassword.value) {
|
|
116
|
+
pgs(confirmPassword).option.setValueBrackets("message", "Passwords do not match");
|
|
117
|
+
return [confirmPassword, password];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
//== validate
|
|
122
|
+
formValidate.validator(event => {
|
|
123
|
+
const values = Object.fromEntries(new FormData(form));
|
|
124
|
+
|
|
125
|
+
// Replace this log with a request to your backend.
|
|
126
|
+
console.log(values);
|
|
127
|
+
}, "submit");
|
|
128
|
+
</script>
|
|
@@ -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>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* @title Logo
|
|
4
|
+
* @description Component for displaying a graphical or text logo, with image variants that support dark mode.
|
|
5
|
+
*
|
|
6
|
+
* @pgs
|
|
7
|
+
* - logo: identifies the brand link container.
|
|
8
|
+
* - logo-image: identifies the graphical logo image.
|
|
9
|
+
* - logo-text: identifies the text-based brand variant.
|
|
10
|
+
*
|
|
11
|
+
* @pgs-option
|
|
12
|
+
* - logoDarkmode: inverts the logo image when the global darkmode state is active.
|
|
13
|
+
* - logoDarkmodeFixed: keeps the image inversion enabled regardless of the current theme.
|
|
14
|
+
*
|
|
15
|
+
* @pgs-state
|
|
16
|
+
* - darkmode: global document state that activates the logoDarkmode variant.
|
|
17
|
+
*
|
|
18
|
+
* @return HTML examples of the theme-aware graphical logo and the text logo.
|
|
19
|
+
*/
|
|
20
|
+
-->
|
|
21
|
+
|
|
22
|
+
<a aria-label="Logo" pgs="logo" pgs-option="logoDarkmode" href="/">
|
|
23
|
+
<img pgs="logo-image" src="https://placehold.co/240x80?text=MyPGS" alt="MyPGS">
|
|
24
|
+
</a>
|
|
25
|
+
|
|
26
|
+
<a aria-label="Text logo" pgs="logo" href="/">
|
|
27
|
+
<span pgs="logo-text">MyPGS</span>
|
|
28
|
+
</a>
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
/**
|
|
3
3
|
* @title Menu
|
|
4
|
-
* @description
|
|
4
|
+
* @description Menu markup, configuration, behavior, and usage example.
|
|
5
5
|
*
|
|
6
6
|
* @pgs
|
|
7
|
-
* - menu:
|
|
8
|
-
* - menu-buttonIcon:
|
|
7
|
+
* - menu: identifies the menu element used by Menu.
|
|
8
|
+
* - menu-buttonIcon: identifies the menu-buttonIcon element used by Menu.
|
|
9
9
|
*
|
|
10
10
|
* @pgs-option
|
|
11
|
-
* - horizontal:
|
|
12
|
-
* - vertical:
|
|
13
|
-
* - menuHeader:
|
|
14
|
-
* - position:
|
|
11
|
+
* - horizontal: identifies the horizontal element used by Menu.
|
|
12
|
+
* - vertical: identifies the vertical element used by Menu.
|
|
13
|
+
* - menuHeader: identifies the menuHeader element used by Menu.
|
|
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
|
-
* - open:
|
|
18
|
+
* - open: identifies the open element used by Menu.
|
|
18
19
|
*
|
|
19
20
|
* @api
|
|
20
|
-
* - pgs.menu.init(root):
|
|
21
|
-
* - pgs.menu.api(element):
|
|
22
|
-
* - instance.refresh():
|
|
21
|
+
* - pgs.menu.init(root): initializes matching elements within the specified root.
|
|
22
|
+
* - pgs.menu.api(element): returns the instance associated with the specified initialized element.
|
|
23
|
+
* - instance.refresh(): refreshes the component and returns its updated instance.
|
|
23
24
|
*
|
|
24
25
|
* @related
|
|
25
|
-
* - dropdown:
|
|
26
|
-
* - dropdown-button:
|
|
27
|
-
* -
|
|
28
|
-
* - dropdown-content: identifica la lista annidata mostrata come pannello dropdown.
|
|
26
|
+
* - dropdown: uses the related dropdown component or utility in this example.
|
|
27
|
+
* - dropdown-button: uses the related dropdown-button component or utility in this example.
|
|
28
|
+
* - dropdown-content: uses the related dropdown-content component or utility in this example.
|
|
29
29
|
*
|
|
30
|
-
* @return
|
|
30
|
+
* @return Complete HTML markup and usage example for Menu.
|
|
31
31
|
*/
|
|
32
32
|
-->
|
|
33
33
|
|
|
@@ -77,4 +77,4 @@
|
|
|
77
77
|
</a>
|
|
78
78
|
</li>
|
|
79
79
|
</ul>
|
|
80
|
-
</nav>
|
|
80
|
+
</nav>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* @title Modal
|
|
4
|
+
* @description Modal markup, configuration, behavior, and usage example.
|
|
5
|
+
*
|
|
6
|
+
* @pgs
|
|
7
|
+
* - modal: identifies the modal element used by Modal.
|
|
8
|
+
* - modal-button: identifies the modal-button element used by Modal.
|
|
9
|
+
* - dialog: token aggiunto dinamicamente all'elemento dialog inizializzato.
|
|
10
|
+
* - modal-dialog: identifies the modal-dialog element used by Modal.
|
|
11
|
+
* - modal-dialog-content: identifies the modal-dialog-content element used by Modal.
|
|
12
|
+
* - modal-dialog-content-header: identifies the modal-dialog-content-header element used by Modal.
|
|
13
|
+
* - modal-dialog-content-scroll: identifies the modal-dialog-content-scroll element used by Modal.
|
|
14
|
+
* - modal-close: identifies the modal-close element used by Modal.
|
|
15
|
+
*
|
|
16
|
+
* @pgs-option
|
|
17
|
+
* - containerID: identifies the containerID element used by Modal.
|
|
18
|
+
* - containerPGS: identifies the containerPGS element used by Modal.
|
|
19
|
+
* - disableBackdropClose: identifies the disableBackdropClose element used by Modal.
|
|
20
|
+
* - history: identifies the history element used by Modal.
|
|
21
|
+
* - topLevel: identifies the topLevel element used by Modal.
|
|
22
|
+
* - left: identifies the left element used by Modal.
|
|
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.
|
|
26
|
+
*
|
|
27
|
+
* @api
|
|
28
|
+
* - pgs.modal.init(root): initializes matching elements within the specified root.
|
|
29
|
+
* - pgs.modal.api(element): returns the instance associated with the specified initialized element.
|
|
30
|
+
* - instance.open(): opens the component.
|
|
31
|
+
* - instance.close(): closes the component.
|
|
32
|
+
* - instance.toggle(): toggles the component state.
|
|
33
|
+
* - instance.refresh(): refreshes the component and returns its updated instance.
|
|
34
|
+
* - instance.isOpen(): returns true when the component is open.
|
|
35
|
+
*
|
|
36
|
+
* @related
|
|
37
|
+
* - button: uses the related button component or utility in this example.
|
|
38
|
+
* - flexColumn: vertically organizes modal content.
|
|
39
|
+
* - gapElements: applies element spacing to modal content.
|
|
40
|
+
* - flexRow: uses the related flexRow component or utility in this example.
|
|
41
|
+
*
|
|
42
|
+
* @return Complete HTML markup and usage example for Modal.
|
|
43
|
+
*/
|
|
44
|
+
-->
|
|
45
|
+
|
|
46
|
+
<div pgs="modal" pgs-option="containerID[modal-container]">
|
|
47
|
+
<button pgs="modal-button button" type="button">
|
|
48
|
+
<i class="fa-solid fa-window-maximize"></i> Open modal
|
|
49
|
+
</button>
|
|
50
|
+
|
|
51
|
+
<dialog>
|
|
52
|
+
<div pgs="modal-dialog-content">
|
|
53
|
+
<div pgs="modal-dialog-content-header">
|
|
54
|
+
<h3>Example modal</h3>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div pgs="modal-dialog-content-scroll">
|
|
58
|
+
<p>Modal content. The close button is added automatically when missing.</p>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</dialog>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div pgs="modal" pgs-option="containerID[modal-container]">
|
|
65
|
+
<button pgs="modal-button button" type="button">
|
|
66
|
+
<i class="fa-solid fa-window-maximize"></i> Open modal right
|
|
67
|
+
</button>
|
|
68
|
+
|
|
69
|
+
<dialog pgs-option="right">
|
|
70
|
+
<div pgs="modal-dialog-content">
|
|
71
|
+
<div pgs="modal-dialog-content-header">
|
|
72
|
+
<h3>Side modal</h3>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div pgs="modal-dialog-content-scroll">
|
|
76
|
+
<p>Modal content with <code>pgs-option="right"</code>.</p>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</dialog>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div pgs="modal" pgs-option="containerID[modal-container]">
|
|
83
|
+
<button pgs="modal-button button" type="button">
|
|
84
|
+
<i class="fa-solid fa-window-maximize"></i> Open modal left
|
|
85
|
+
</button>
|
|
86
|
+
|
|
87
|
+
<dialog pgs-option="left">
|
|
88
|
+
<div pgs="modal-dialog-content">
|
|
89
|
+
<div pgs="modal-dialog-content-header">
|
|
90
|
+
<h3>Left-side modal</h3>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div pgs="modal-dialog-content-scroll">
|
|
94
|
+
<p>Modal content with <code>pgs-option="left"</code>.</p>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</dialog>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div pgs="modal">
|
|
101
|
+
<button pgs="modal-button button" type="button">
|
|
102
|
+
<i class="fa-solid fa-floppy-disk"></i> Confirmation salvataggio
|
|
103
|
+
</button>
|
|
104
|
+
|
|
105
|
+
<dialog pgs-option="topLevel">
|
|
106
|
+
<div pgs="modal-dialog-content">
|
|
107
|
+
<div pgs="modal-dialog-content-header">
|
|
108
|
+
<h3>Save changes?</h3>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<div pgs="modal-dialog-content-scroll flexColumn gapElements">
|
|
112
|
+
<p>You have unsaved changes. Confirm to apply them or cancel to return to the page.</p>
|
|
113
|
+
|
|
114
|
+
<div pgs="flexRow">
|
|
115
|
+
<button pgs="button modal-close" type="button">Cancel</button>
|
|
116
|
+
<button pgs="button" pgs-option="buttonStrong" type="button">Save changes</button>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</dialog>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div id="modal-container"></div>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* @title Notification
|
|
4
|
+
* @description Notification markup, configuration, behavior, and usage example.
|
|
5
|
+
*
|
|
6
|
+
* @pgs
|
|
7
|
+
* - notification: identifies the notification element used by Notification.
|
|
8
|
+
* - notificationTrigger: identifies the notificationTrigger element used by Notification.
|
|
9
|
+
* - notification-element: identifies the notification-element element used by Notification.
|
|
10
|
+
* - notification-element-title: identifies the notification-element-title element used by Notification.
|
|
11
|
+
* - notification-element-content: identifies the notification-element-content element used by Notification.
|
|
12
|
+
*
|
|
13
|
+
* @pgs-option
|
|
14
|
+
* - toast: identifies the toast element used by Notification.
|
|
15
|
+
* - notification: identifies the notification element used by Notification.
|
|
16
|
+
* - buttonClose: styles the dismiss action generated at runtime.
|
|
17
|
+
*
|
|
18
|
+
* @pgs-state
|
|
19
|
+
* - success: identifies the success element used by Notification.
|
|
20
|
+
* - error: identifies the error element used by Notification.
|
|
21
|
+
* - warning: identifies the warning element used by Notification.
|
|
22
|
+
* - info: identifies the info element used by Notification.
|
|
23
|
+
*
|
|
24
|
+
* @api
|
|
25
|
+
* - pgs.notification.trigger(root): provides the documented operation through the component public API.
|
|
26
|
+
* - pgs.notification.alert.error(text, link, timeout, icon): provides the documented operation through the component public API.
|
|
27
|
+
* - pgs.notification.alert.success(text, link, timeout, icon): provides the documented operation through the component public API.
|
|
28
|
+
* - pgs.notification.alert.info(text, link, timeout, icon): provides the documented operation through the component public API.
|
|
29
|
+
* - pgs.notification.alert.warning(text, link, timeout, icon): provides the documented operation through the component public API.
|
|
30
|
+
* - pgs.notification.alert.deleteAll(): provides the documented operation through the component public API.
|
|
31
|
+
* - pgs.notification.toast.error(text, timeout, icon): provides the documented operation through the component public API.
|
|
32
|
+
* - pgs.notification.toast.success(text, timeout, icon): provides the documented operation through the component public API.
|
|
33
|
+
* - pgs.notification.toast.info(text, timeout, icon): provides the documented operation through the component public API.
|
|
34
|
+
* - pgs.notification.toast.warning(text, timeout, icon): provides the documented operation through the component public API.
|
|
35
|
+
* - pgs.notification.toast.deleteAll(): provides the documented operation through the component public API.
|
|
36
|
+
*
|
|
37
|
+
* @related
|
|
38
|
+
* - hidden: uses the related hidden component or utility in this example.
|
|
39
|
+
*
|
|
40
|
+
* @return Complete HTML markup and usage example for Notification.
|
|
41
|
+
*/
|
|
42
|
+
-->
|
|
43
|
+
|
|
44
|
+
<div pgs="notification" aria-live="polite"></div>
|
|
45
|
+
<div pgs="notification" pgs-option="toast" aria-live="polite"></div>
|
|
46
|
+
|
|
47
|
+
<div pgs="hidden notificationTrigger" pgs-option='notification[{
|
|
48
|
+
"title": "Title",
|
|
49
|
+
"message": "Message",
|
|
50
|
+
"element": "notification",
|
|
51
|
+
"type": "info",
|
|
52
|
+
"icon": null,
|
|
53
|
+
"duration": "-1",
|
|
54
|
+
"link": null
|
|
55
|
+
}]'></div>
|
|
56
|
+
|
|
57
|
+
<div pgs="hidden notificationTrigger" pgs-option='notification[{
|
|
58
|
+
"title": "Benvenuto",
|
|
59
|
+
"message": "Message",
|
|
60
|
+
"element": "toast",
|
|
61
|
+
"type": "info",
|
|
62
|
+
"icon": null,
|
|
63
|
+
"duration": "3000",
|
|
64
|
+
"link": null
|
|
65
|
+
}]'></div>
|
|
66
|
+
<!--
|
|
67
|
+
<div
|
|
68
|
+
pgs="hidden notificationTrigger"
|
|
69
|
+
pgs-option='notification[{"title":"Title","message":"Message","element":"notification","type":"info","icon":"<i class=\"fa-solid fa-rocket\"></i>","duration":"4000","link":"/page/"}]'>
|
|
70
|
+
</div>
|
|
71
|
+
-->
|