@riverty/web-components 5.6.0 → 5.8.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/CHANGELOG.md +56 -0
- package/custom-elements.json +28 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/r-alert.cjs.entry.js +24 -8
- package/dist/cjs/r-badge.cjs.entry.js +1 -1
- package/dist/cjs/r-button.cjs.entry.js +1 -1
- package/dist/cjs/r-checkbox-group.cjs.entry.js +28 -14
- package/dist/cjs/r-checkbox.cjs.entry.js +25 -10
- package/dist/cjs/r-hint_3.cjs.entry.js +1 -1
- package/dist/cjs/r-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/r-icon.cjs.entry.js +1 -1
- package/dist/cjs/r-input-code.cjs.entry.js +30 -17
- package/dist/cjs/r-input-date.cjs.entry.js +86 -16
- package/dist/cjs/r-input-password.cjs.entry.js +25 -9
- package/dist/cjs/r-input-phone-number.cjs.entry.js +27 -14
- package/dist/cjs/r-input.cjs.entry.js +27 -14
- package/dist/cjs/r-pagination.cjs.entry.js +1 -1
- package/dist/cjs/r-popover-action.cjs.entry.js +1 -1
- package/dist/cjs/r-popover.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-group.cjs.entry.js +21 -17
- package/dist/cjs/r-select.cjs.entry.js +113 -19
- package/dist/cjs/r-textarea.cjs.entry.js +19 -6
- package/dist/cjs/r-toast.cjs.entry.js +50 -19
- package/dist/cjs/web-components.cjs.js +1 -1
- package/dist/collection/components/alert/alert.css +56 -16
- package/dist/collection/components/alert/alert.js +48 -11
- package/dist/collection/components/alert/exports.js +1 -1
- package/dist/collection/components/badge/badge.css +8 -8
- package/dist/collection/components/button/button.css +6 -7
- package/dist/collection/components/checkbox/checkbox.js +45 -10
- package/dist/collection/components/checkbox-group/checkbox-group.css +2 -2
- package/dist/collection/components/checkbox-group/checkbox-group.js +47 -13
- package/dist/collection/components/hint/hint.css +1 -1
- package/dist/collection/components/icon/bundled-icons/riverty-kit.json +1 -1
- package/dist/collection/components/icon/riverty-kit.js +1 -1
- package/dist/collection/components/icon-button/icon-button.css +0 -7
- package/dist/collection/components/input/input.css +1 -1
- package/dist/collection/components/input/input.js +46 -13
- package/dist/collection/components/input-code/input-code.css +1 -1
- package/dist/collection/components/input-code/input-code.js +49 -16
- package/dist/collection/components/input-date/input-date.css +1 -1
- package/dist/collection/components/input-date/input-date.js +235 -16
- package/dist/collection/components/input-password/input-password.js +45 -9
- package/dist/collection/components/input-phone-number/input-phone-number.js +47 -14
- package/dist/collection/components/pagination/pagination.css +23 -23
- package/dist/collection/components/popover/popover.css +11 -3
- package/dist/collection/components/popover-action/popover-action.css +3 -5
- package/dist/collection/components/radio-button/radio-button.css +1 -1
- package/dist/collection/components/radio-group/radio-group.css +2 -2
- package/dist/collection/components/radio-group/radio-group.js +21 -17
- package/dist/collection/components/select/select.css +2 -2
- package/dist/collection/components/select/select.js +193 -21
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/textarea/textarea.js +38 -5
- package/dist/collection/components/toast/toast.css +29 -21
- package/dist/collection/components/toast/toast.js +94 -20
- package/dist/esm/loader.js +1 -1
- package/dist/esm/r-alert.entry.js +24 -8
- package/dist/esm/r-badge.entry.js +1 -1
- package/dist/esm/r-button.entry.js +1 -1
- package/dist/esm/r-checkbox-group.entry.js +28 -14
- package/dist/esm/r-checkbox.entry.js +25 -10
- package/dist/esm/r-hint_3.entry.js +1 -1
- package/dist/esm/r-icon-button.entry.js +1 -1
- package/dist/esm/r-icon.entry.js +1 -1
- package/dist/esm/r-input-code.entry.js +30 -17
- package/dist/esm/r-input-date.entry.js +86 -16
- package/dist/esm/r-input-password.entry.js +25 -9
- package/dist/esm/r-input-phone-number.entry.js +27 -14
- package/dist/esm/r-input.entry.js +27 -14
- package/dist/esm/r-pagination.entry.js +1 -1
- package/dist/esm/r-popover-action.entry.js +1 -1
- package/dist/esm/r-popover.entry.js +1 -1
- package/dist/esm/r-radio-button.entry.js +1 -1
- package/dist/esm/r-radio-group.entry.js +21 -17
- package/dist/esm/r-select.entry.js +113 -19
- package/dist/esm/r-textarea.entry.js +19 -6
- package/dist/esm/r-toast.entry.js +50 -19
- package/dist/esm/web-components.js +1 -1
- package/dist/types/components/alert/alert.d.ts +3 -0
- package/dist/types/components/alert/exports.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +5 -0
- package/dist/types/components/checkbox-group/checkbox-group.d.ts +6 -0
- package/dist/types/components/input/input.d.ts +5 -0
- package/dist/types/components/input-code/input-code.d.ts +5 -0
- package/dist/types/components/input-date/input-date.d.ts +30 -0
- package/dist/types/components/input-password/input-password.d.ts +5 -0
- package/dist/types/components/input-phone-number/input-phone-number.d.ts +5 -0
- package/dist/types/components/radio-group/radio-group.d.ts +1 -2
- package/dist/types/components/select/select.d.ts +34 -2
- package/dist/types/components/textarea/textarea.d.ts +5 -0
- package/dist/types/components/toast/toast.d.ts +10 -2
- package/dist/types/components.d.ts +143 -8
- package/dist/web-components/bundled-icons/riverty-kit.json +1 -1
- package/dist/web-components/p-15ac0fdd.entry.js +1 -0
- package/dist/web-components/p-1c956370.entry.js +1 -0
- package/dist/web-components/p-2a512983.entry.js +1 -0
- package/dist/web-components/p-2e18e762.entry.js +1 -0
- package/dist/web-components/{p-72c0c0d8.entry.js → p-3078b2b8.entry.js} +1 -1
- package/dist/web-components/p-56da04d8.entry.js +1 -0
- package/dist/web-components/p-5744d75c.entry.js +1 -0
- package/dist/web-components/p-5bbd6e3c.entry.js +1 -0
- package/dist/web-components/p-5e6aabd8.entry.js +1 -0
- package/dist/web-components/p-656229de.entry.js +1 -0
- package/dist/web-components/p-6a4f3836.entry.js +1 -0
- package/dist/web-components/p-7775228c.entry.js +1 -0
- package/dist/web-components/{p-29a1e75f.entry.js → p-7ad8e78b.entry.js} +1 -1
- package/dist/web-components/p-8563a1ab.entry.js +1 -0
- package/dist/web-components/p-ad9b2a48.entry.js +1 -0
- package/dist/web-components/{p-e49b1ec3.entry.js → p-b2f03016.entry.js} +1 -1
- package/dist/web-components/p-b87ad83b.entry.js +1 -0
- package/dist/web-components/{p-77155630.entry.js → p-b98ab649.entry.js} +1 -1
- package/dist/web-components/{p-f1e22caa.entry.js → p-d1379ac6.entry.js} +1 -1
- package/dist/web-components/p-dbe579e8.entry.js +1 -0
- package/dist/web-components/p-f2577a3c.entry.js +1 -0
- package/dist/web-components/web-components.esm.js +1 -1
- package/package.json +6 -6
- package/dist/web-components/p-1ae69897.entry.js +0 -1
- package/dist/web-components/p-230e44ae.entry.js +0 -1
- package/dist/web-components/p-44be9992.entry.js +0 -1
- package/dist/web-components/p-4652635a.entry.js +0 -1
- package/dist/web-components/p-8028c2a9.entry.js +0 -1
- package/dist/web-components/p-828cb164.entry.js +0 -1
- package/dist/web-components/p-89136369.entry.js +0 -1
- package/dist/web-components/p-8c577cda.entry.js +0 -1
- package/dist/web-components/p-96ddeb7f.entry.js +0 -1
- package/dist/web-components/p-9b08e9ee.entry.js +0 -1
- package/dist/web-components/p-9eb1f262.entry.js +0 -1
- package/dist/web-components/p-a58124c4.entry.js +0 -1
- package/dist/web-components/p-a5be3395.entry.js +0 -1
- package/dist/web-components/p-b2cec978.entry.js +0 -1
- package/dist/web-components/p-d3ff65b0.entry.js +0 -1
- package/dist/web-components/p-f770e22b.entry.js +0 -1
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
--r-button--border-color: var(--r-border-soft, #686868);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
:host([variant=secondary] .r-button[aria-disabled=
|
|
54
|
+
:host([variant=secondary] .r-button:not([aria-disabled=true]):active) {
|
|
55
55
|
--r-button--color: var(--r-text-regular, #282828);
|
|
56
56
|
--r-button--border-color: var(--r-border-soft, #686868);
|
|
57
57
|
--r-button--background-color: var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12));
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
--r-button--background-color: var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04));
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
:host([variant=text] .r-button[aria-disabled=
|
|
73
|
+
:host([variant=text] .r-button:not([aria-disabled=true]):active) {
|
|
74
74
|
--r-button--background-color: var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12));
|
|
75
75
|
--r-button--border-color: var(--r-border-soft, #686868);
|
|
76
76
|
}
|
|
@@ -99,7 +99,6 @@
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
:host([variant=text-inline]:active:not([disabled]:not([disabled=false]))) {
|
|
102
|
-
--r-button--color: var(--r-border-softer, #c9c9c9);
|
|
103
102
|
--r-button--border-color: transparent;
|
|
104
103
|
--r-button--background-color: transparent;
|
|
105
104
|
}
|
|
@@ -161,10 +160,10 @@
|
|
|
161
160
|
vertical-align: var(--r-button--vertical-align, top);
|
|
162
161
|
opacity: var(--r-button--opacity, 1);
|
|
163
162
|
}
|
|
164
|
-
.r-button[aria-disabled=
|
|
165
|
-
--r-button--color: var(--r-text-regular, #282828);
|
|
166
|
-
--r-button--background-color: var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12));
|
|
167
|
-
--r-button--border-color: var(--r-border-soft, #686868);
|
|
163
|
+
.r-button:not([aria-disabled=true]):active {
|
|
164
|
+
--r-button--color: var(--r-button--color--active, var(--r-text-regular, #282828));
|
|
165
|
+
--r-button--background-color: var(--r-button--background-color--active, var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12)));
|
|
166
|
+
--r-button--border-color: var(--r-button--border-color--active, var(--r-border-soft, #686868));
|
|
168
167
|
}
|
|
169
168
|
.r-button--slot {
|
|
170
169
|
position: var(--r-button--slot--position, relative);
|
|
@@ -17,16 +17,19 @@ export class Checkbox {
|
|
|
17
17
|
this.validityMessage = '';
|
|
18
18
|
this.initial = {};
|
|
19
19
|
this.getValidityStateData = (element) => {
|
|
20
|
+
let validityState = '';
|
|
21
|
+
let validityMessage = '';
|
|
20
22
|
for (const state in element.validity) {
|
|
21
23
|
if (element.validity[state]) {
|
|
22
|
-
|
|
24
|
+
validityState = state;
|
|
23
25
|
if (this[state + 'Message']) {
|
|
24
|
-
|
|
25
|
-
return;
|
|
26
|
+
validityMessage = this[state + 'Message'];
|
|
27
|
+
return { validityState, validityMessage };
|
|
26
28
|
}
|
|
27
|
-
|
|
29
|
+
validityMessage = element.validationMessage;
|
|
28
30
|
}
|
|
29
31
|
}
|
|
32
|
+
return { validityState, validityMessage };
|
|
30
33
|
};
|
|
31
34
|
this.validateFormElement = (element = null) => {
|
|
32
35
|
if (element === null)
|
|
@@ -35,7 +38,9 @@ export class Checkbox {
|
|
|
35
38
|
return;
|
|
36
39
|
if (this.error)
|
|
37
40
|
return;
|
|
38
|
-
this.getValidityStateData(element);
|
|
41
|
+
const { validityState, validityMessage } = this.getValidityStateData(element);
|
|
42
|
+
this.validityState = validityState;
|
|
43
|
+
this.validityMessage = validityMessage;
|
|
39
44
|
const isValid = this.validityState === 'valid';
|
|
40
45
|
this.valid = isValid;
|
|
41
46
|
this.invalid = !isValid;
|
|
@@ -102,7 +107,9 @@ export class Checkbox {
|
|
|
102
107
|
* - `message`: A string containing the validity message.
|
|
103
108
|
*/
|
|
104
109
|
async getValidityState() {
|
|
105
|
-
this.getValidityStateData(this.nativeElement);
|
|
110
|
+
const { validityState, validityMessage } = this.getValidityStateData(this.nativeElement);
|
|
111
|
+
this.validityState = validityState;
|
|
112
|
+
this.validityMessage = validityMessage;
|
|
106
113
|
return {
|
|
107
114
|
state: this.validityState,
|
|
108
115
|
message: this.validityMessage
|
|
@@ -197,6 +204,14 @@ export class Checkbox {
|
|
|
197
204
|
async clearIndeterminate() {
|
|
198
205
|
this.indeterminate = false;
|
|
199
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Validates the checkbox without triggering UI and returns a boolean indicating its validity.
|
|
209
|
+
* @returns A boolean indicating whether the checkbox is valid.
|
|
210
|
+
*/
|
|
211
|
+
async checkValidity() {
|
|
212
|
+
const { validityState } = this.getValidityStateData(this.nativeElement);
|
|
213
|
+
return validityState === 'valid';
|
|
214
|
+
}
|
|
200
215
|
get hasErrorMessage() {
|
|
201
216
|
var _a;
|
|
202
217
|
return typeof this.error === 'string' && ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
@@ -232,13 +247,13 @@ export class Checkbox {
|
|
|
232
247
|
checked,
|
|
233
248
|
indeterminate
|
|
234
249
|
};
|
|
235
|
-
return (h(Host, { key: '
|
|
250
|
+
return (h(Host, { key: '3c1b6f0ea2497cc8c1641b9ba3a1408832c50808', onClick: this.handleClick }, h("div", { key: '585298821156cb66889bfc13e7148afb2847d1c4', class: "r-checkbox" }, h("input", Object.assign({ key: '02509a5c0d4b869c03e6a023e5c3aa1ef4b7057e', class: "r-checkbox--input", type: "checkbox" }, inputAttrs, { id: `${uniqueId}-input`, ref: el => this.nativeElement = el, "aria-describedby": this.hasMessage ? `${uniqueId}-message` : null, "aria-required": `${this.required || false}`, "aria-invalid": `${this.invalid || false}` })), h("div", { key: 'ec02858464651e1938848375fbf527f73fab76f1', class: "r-checkbox--box", "aria-hidden": "true" }, this.checked ?
|
|
236
251
|
h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M8.80019 15.8988L4.6002 11.6988L3.2002 13.0988L8.80019 18.6988L20.8002 6.69883L19.4002 5.29883L8.80019 15.8988Z", fill: "currentColor" }))
|
|
237
252
|
: this.indeterminate ?
|
|
238
253
|
h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("rect", { x: "4", y: "11", width: "16", height: "2", fill: "currentColor" }))
|
|
239
|
-
: null), h("div", { key: '
|
|
240
|
-
h("r-hint", { key: '
|
|
241
|
-
h("r-hint", { key: '
|
|
254
|
+
: null), h("div", { key: '310a1c3a77074fa77bf9daa4e371196f9f39fdd5', class: "r-checkbox--description" }, h("label", { key: '05666e7a11e9907067b9fbe7024669e8b11e5884', class: "r-checkbox--label", id: `${uniqueId}-label`, htmlFor: `${uniqueId}-input` }, h("slot", { key: '45c7ed40f84a15a0dccb6768011d067d4c9da26b' })), h("div", { key: 'b41e092d77775c0a9c4582248d353b1b49533206', id: `${uniqueId}-message`, class: !this.hasMessage ? 'visually-hidden' : 'r-checkbox--message', "aria-live": "polite", "aria-atomic": "true" }, this.hasInvalidMessage &&
|
|
255
|
+
h("r-hint", { key: '169e7d7ae74e6484f50f0cc5575dfdb537b16076', variant: "error" }, error || this.customErrorMessage || this.validityMessage), this.hasValidMessage &&
|
|
256
|
+
h("r-hint", { key: 'cdaaad06d4f0cd0e880a3f327c0eb8d2058eb91b', variant: "success" }, this.validMessage))))));
|
|
242
257
|
}
|
|
243
258
|
static get is() { return "r-checkbox"; }
|
|
244
259
|
static get encapsulation() { return "shadow"; }
|
|
@@ -747,6 +762,26 @@ export class Checkbox {
|
|
|
747
762
|
"text": "Sets the indeterminate state of the checkbox element.",
|
|
748
763
|
"tags": []
|
|
749
764
|
}
|
|
765
|
+
},
|
|
766
|
+
"checkValidity": {
|
|
767
|
+
"complexType": {
|
|
768
|
+
"signature": "() => Promise<boolean>",
|
|
769
|
+
"parameters": [],
|
|
770
|
+
"references": {
|
|
771
|
+
"Promise": {
|
|
772
|
+
"location": "global",
|
|
773
|
+
"id": "global::Promise"
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
"return": "Promise<boolean>"
|
|
777
|
+
},
|
|
778
|
+
"docs": {
|
|
779
|
+
"text": "Validates the checkbox without triggering UI and returns a boolean indicating its validity.",
|
|
780
|
+
"tags": [{
|
|
781
|
+
"name": "returns",
|
|
782
|
+
"text": "A boolean indicating whether the checkbox is valid."
|
|
783
|
+
}]
|
|
784
|
+
}
|
|
750
785
|
}
|
|
751
786
|
};
|
|
752
787
|
}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
:host([invalid]:not([invalid=false])) ::slotted(r-checkbox) {
|
|
8
|
-
--r-checkbox--box--border-color: var(--r-status-error-regular, #
|
|
8
|
+
--r-checkbox--box--border-color: var(--r-status-error-regular, #b00c15);
|
|
9
9
|
--r-checkbox--box--background-color: var(--r-status-error-soft, #fef6f6);
|
|
10
|
-
--r-checkbox--marker--color: var(--r-status-error-regular, #
|
|
10
|
+
--r-checkbox--marker--color: var(--r-status-error-regular, #b00c15);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.r-checkbox-group {
|
|
@@ -27,24 +27,30 @@ export class CheckboxGroup {
|
|
|
27
27
|
const variant = this.valid ? 'success' : 'error';
|
|
28
28
|
return (h("r-hint", { variant: variant, role: "alert", "aria-live": "polite", id: `${this.uniqueId}-message`, class: this.message ? null : 'visually-hidden' }, this.message));
|
|
29
29
|
};
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
this.getValidityStateData = () => {
|
|
31
|
+
let validityState = '';
|
|
32
|
+
let validityMessage = '';
|
|
33
33
|
const isValid = this.checkboxes.some(checkbox => checkbox.checked);
|
|
34
34
|
if (this.required && !isValid) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.invalid = true;
|
|
38
|
-
this.valid = false;
|
|
39
|
-
this.noChecked = true;
|
|
35
|
+
validityState = 'valueMissing';
|
|
36
|
+
validityMessage = this.valueMissingMessage || 'Please select at least one option.';
|
|
40
37
|
}
|
|
41
38
|
else {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.invalid = false;
|
|
45
|
-
this.valid = true;
|
|
46
|
-
this.noChecked = false;
|
|
39
|
+
validityState = 'valid';
|
|
40
|
+
validityMessage = null;
|
|
47
41
|
}
|
|
42
|
+
return { validityState, validityMessage };
|
|
43
|
+
};
|
|
44
|
+
this.validateGroup = () => {
|
|
45
|
+
if (this.isNoValidate || !this.required)
|
|
46
|
+
return;
|
|
47
|
+
const { validityState, validityMessage } = this.getValidityStateData();
|
|
48
|
+
this.validityState = validityState;
|
|
49
|
+
this.validityMessage = validityMessage;
|
|
50
|
+
const isValid = this.validityState === 'valid';
|
|
51
|
+
this.valid = isValid;
|
|
52
|
+
this.invalid = !isValid;
|
|
53
|
+
this.noChecked = !isValid;
|
|
48
54
|
this.rValidate.emit({
|
|
49
55
|
state: this.validityState,
|
|
50
56
|
message: this.validityMessage
|
|
@@ -64,6 +70,14 @@ export class CheckboxGroup {
|
|
|
64
70
|
this.resetToInitial();
|
|
65
71
|
};
|
|
66
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Validates the checkbox group without triggering UI and returns a boolean indicating its validity.
|
|
75
|
+
* @returns A boolean indicating whether the checkbox is valid.
|
|
76
|
+
*/
|
|
77
|
+
async checkValidity() {
|
|
78
|
+
const { validityState } = this.getValidityStateData();
|
|
79
|
+
return validityState === 'valid';
|
|
80
|
+
}
|
|
67
81
|
/**
|
|
68
82
|
* Resets the validity state and message of the radio group.
|
|
69
83
|
* This method clears the validity message and state, and sets the invalid
|
|
@@ -667,6 +681,26 @@ export class CheckboxGroup {
|
|
|
667
681
|
}
|
|
668
682
|
static get methods() {
|
|
669
683
|
return {
|
|
684
|
+
"checkValidity": {
|
|
685
|
+
"complexType": {
|
|
686
|
+
"signature": "() => Promise<boolean>",
|
|
687
|
+
"parameters": [],
|
|
688
|
+
"references": {
|
|
689
|
+
"Promise": {
|
|
690
|
+
"location": "global",
|
|
691
|
+
"id": "global::Promise"
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
"return": "Promise<boolean>"
|
|
695
|
+
},
|
|
696
|
+
"docs": {
|
|
697
|
+
"text": "Validates the checkbox group without triggering UI and returns a boolean indicating its validity.",
|
|
698
|
+
"tags": [{
|
|
699
|
+
"name": "returns",
|
|
700
|
+
"text": "A boolean indicating whether the checkbox is valid."
|
|
701
|
+
}]
|
|
702
|
+
}
|
|
703
|
+
},
|
|
670
704
|
"resetValidity": {
|
|
671
705
|
"complexType": {
|
|
672
706
|
"signature": "() => Promise<void>",
|