@riverty/web-components 6.1.0 → 6.2.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 +23 -0
- package/custom-elements.json +160 -1
- package/dist/cjs/{index-DJ4H_bFj.js → index-BnETQtSf.js} +9 -382
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/r-accordion-panel.cjs.entry.js +1 -1
- package/dist/cjs/r-accordion-section.cjs.entry.js +1 -1
- package/dist/cjs/r-accordion-trigger.cjs.entry.js +1 -1
- package/dist/cjs/r-accordion.cjs.entry.js +1 -1
- package/dist/cjs/r-alert.cjs.entry.js +9 -6
- package/dist/cjs/r-badge.cjs.entry.js +1 -1
- package/dist/cjs/r-button.cjs.entry.js +6 -2
- package/dist/cjs/r-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/r-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/r-design-system-devtools.cjs.entry.js +1 -1
- package/dist/cjs/r-dialog.cjs.entry.js +1 -1
- package/dist/cjs/r-hint_2.cjs.entry.js +3 -3
- package/dist/cjs/r-icon-button_2.cjs.entry.js +24 -4
- package/dist/cjs/r-icon.cjs.entry.js +2 -2
- package/dist/cjs/r-illustration.cjs.entry.js +396 -0
- package/dist/cjs/r-input-code.cjs.entry.js +34 -12
- package/dist/cjs/r-input-date.cjs.entry.js +7 -7
- package/dist/cjs/r-input-password.cjs.entry.js +3 -3
- package/dist/cjs/r-input-phone-number.cjs.entry.js +4 -4
- package/dist/cjs/r-input.cjs.entry.js +5 -4
- package/dist/cjs/r-list-item.cjs.entry.js +1 -1
- package/dist/cjs/r-pagination.cjs.entry.js +56 -50
- package/dist/cjs/r-panel.cjs.entry.js +3 -3
- package/dist/cjs/r-popover-action.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-content.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-headline.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-trigger.cjs.entry.js +2 -2
- package/dist/cjs/r-popover.cjs.entry.js +46 -5
- package/dist/cjs/r-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-description.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-leading.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-title.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-trailing.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button.cjs.entry.js +8 -7
- package/dist/cjs/r-radio-group.cjs.entry.js +83 -10
- package/dist/cjs/r-select-option.cjs.entry.js +2 -2
- package/dist/cjs/r-select.cjs.entry.js +6 -4
- package/dist/cjs/r-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/r-stepper-item.cjs.entry.js +19 -4
- package/dist/cjs/r-stepper.cjs.entry.js +76 -3
- package/dist/cjs/r-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/r-tab.cjs.entry.js +3 -3
- package/dist/cjs/r-tabs-list.cjs.entry.js +4 -4
- package/dist/cjs/r-tabs.cjs.entry.js +2 -2
- package/dist/cjs/r-textarea.cjs.entry.js +1 -1
- package/dist/cjs/r-toast-group.cjs.entry.js +13 -4
- package/dist/cjs/r-toast.cjs.entry.js +87 -18
- package/dist/cjs/web-components.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/alert/alert.css +4 -3
- package/dist/collection/components/alert/alert.js +7 -4
- package/dist/collection/components/button/button.js +30 -1
- package/dist/collection/components/button/exports.js +1 -0
- package/dist/collection/components/checkbox/checkbox.js +3 -3
- package/dist/collection/components/icon/exports.js +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/riverty-kit.js +1 -1
- package/dist/collection/components/illustration/data.js +112 -0
- package/dist/collection/components/illustration/exports.js +3 -0
- package/dist/collection/components/illustration/illustration.js +540 -0
- package/dist/collection/components/illustration/illustration.scss +56 -0
- package/dist/collection/components/illustration/illustrations-ui-kit.js +2 -0
- package/dist/collection/components/input/exports.js +1 -0
- package/dist/collection/components/input/input.css +3 -0
- package/dist/collection/components/input/input.js +47 -2
- package/dist/collection/components/input-code/input-code.css +6 -0
- package/dist/collection/components/input-code/input-code.js +48 -10
- package/dist/collection/components/input-date/input-date.js +6 -6
- package/dist/collection/components/input-password/input-password.js +2 -2
- package/dist/collection/components/input-phone-number/input-phone-number.js +3 -3
- package/dist/collection/components/label/label.js +2 -2
- package/dist/collection/components/pagination/pagination.css +33 -72
- package/dist/collection/components/pagination/pagination.js +194 -48
- package/dist/collection/components/panel/panel.js +2 -2
- package/dist/collection/components/popover/popover.css +0 -1
- package/dist/collection/components/popover/popover.js +44 -3
- package/dist/collection/components/popover-action/popover-action.js +1 -1
- package/dist/collection/components/popover-content/popover-content.js +1 -1
- package/dist/collection/components/popover-headline/popover-headline.js +1 -1
- package/dist/collection/components/popover-trigger/popover-trigger.js +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js +1 -1
- package/dist/collection/components/radio-button/radio-button.js +7 -6
- package/dist/collection/components/radio-button-description/radio-button-description.js +1 -1
- package/dist/collection/components/radio-button-leading/radio-button-leading.js +1 -1
- package/dist/collection/components/radio-button-title/radio-button-title.js +1 -1
- package/dist/collection/components/radio-button-trailing/radio-button-trailing.js +1 -1
- package/dist/collection/components/radio-group/radio-group.css +4 -1
- package/dist/collection/components/radio-group/radio-group.js +100 -8
- package/dist/collection/components/select/select.js +5 -3
- package/dist/collection/components/select-option/select-option.js +1 -1
- package/dist/collection/components/skip-link/skip-link.js +1 -1
- package/dist/collection/components/stepper/stepper.css +4 -1
- package/dist/collection/components/stepper/stepper.js +125 -1
- package/dist/collection/components/stepper-item/stepper-item.css +22 -9
- package/dist/collection/components/stepper-item/stepper-item.js +36 -2
- package/dist/collection/components/tab/tab.js +2 -2
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/tabs/tabs.js +1 -1
- package/dist/collection/components/tabs-list/tabs-list.js +3 -3
- package/dist/collection/components/toast/toast.css +9 -9
- package/dist/collection/components/toast/toast.js +109 -21
- package/dist/collection/components/toast-group/toast-group.css +5 -11
- package/dist/collection/components/toast-group/toast-group.js +12 -3
- package/dist/collection/components/tooltip/tooltip.js +23 -3
- package/dist/esm/{index-Da7qOBFr.js → index-CTxpqopm.js} +9 -382
- package/dist/esm/loader.js +3 -3
- package/dist/esm/r-accordion-panel.entry.js +1 -1
- package/dist/esm/r-accordion-section.entry.js +1 -1
- package/dist/esm/r-accordion-trigger.entry.js +1 -1
- package/dist/esm/r-accordion.entry.js +1 -1
- package/dist/esm/r-alert.entry.js +9 -6
- package/dist/esm/r-badge.entry.js +1 -1
- package/dist/esm/r-button.entry.js +6 -2
- package/dist/esm/r-checkbox-group.entry.js +1 -1
- package/dist/esm/r-checkbox.entry.js +4 -4
- package/dist/esm/r-design-system-devtools.entry.js +1 -1
- package/dist/esm/r-dialog.entry.js +1 -1
- package/dist/esm/r-hint_2.entry.js +3 -3
- package/dist/esm/r-icon-button_2.entry.js +24 -4
- package/dist/esm/r-icon.entry.js +2 -2
- package/dist/esm/r-illustration.entry.js +394 -0
- package/dist/esm/r-input-code.entry.js +34 -12
- package/dist/esm/r-input-date.entry.js +7 -7
- package/dist/esm/r-input-password.entry.js +3 -3
- package/dist/esm/r-input-phone-number.entry.js +4 -4
- package/dist/esm/r-input.entry.js +5 -4
- package/dist/esm/r-list-item.entry.js +1 -1
- package/dist/esm/r-pagination.entry.js +56 -50
- package/dist/esm/r-panel.entry.js +3 -3
- package/dist/esm/r-popover-action.entry.js +2 -2
- package/dist/esm/r-popover-content.entry.js +2 -2
- package/dist/esm/r-popover-headline.entry.js +2 -2
- package/dist/esm/r-popover-trigger.entry.js +2 -2
- package/dist/esm/r-popover.entry.js +46 -5
- package/dist/esm/r-progress-bar.entry.js +2 -2
- package/dist/esm/r-radio-button-description.entry.js +2 -2
- package/dist/esm/r-radio-button-leading.entry.js +2 -2
- package/dist/esm/r-radio-button-title.entry.js +2 -2
- package/dist/esm/r-radio-button-trailing.entry.js +2 -2
- package/dist/esm/r-radio-button.entry.js +8 -7
- package/dist/esm/r-radio-group.entry.js +83 -10
- package/dist/esm/r-select-option.entry.js +2 -2
- package/dist/esm/r-select.entry.js +6 -4
- package/dist/esm/r-skip-link.entry.js +2 -2
- package/dist/esm/r-stepper-item.entry.js +19 -4
- package/dist/esm/r-stepper.entry.js +76 -3
- package/dist/esm/r-tab-panel.entry.js +2 -2
- package/dist/esm/r-tab.entry.js +3 -3
- package/dist/esm/r-tabs-list.entry.js +4 -4
- package/dist/esm/r-tabs.entry.js +2 -2
- package/dist/esm/r-textarea.entry.js +1 -1
- package/dist/esm/r-toast-group.entry.js +13 -4
- package/dist/esm/r-toast.entry.js +87 -18
- package/dist/esm/web-components.js +3 -3
- package/dist/types/components/alert/alert.d.ts +1 -0
- package/dist/types/components/button/button.d.ts +8 -1
- package/dist/types/components/button/exports.d.ts +2 -0
- package/dist/types/components/icon/exports.d.ts +1 -1
- package/dist/types/components/icon/riverty-kit.d.ts +1 -1
- package/dist/types/components/illustration/data.d.ts +52 -0
- package/dist/types/components/illustration/exports.d.ts +23 -0
- package/dist/types/components/illustration/illustration.d.ts +51 -0
- package/dist/types/components/illustration/illustrations-ui-kit.d.ts +21 -0
- package/dist/types/components/input/exports.d.ts +2 -0
- package/dist/types/components/input/input.d.ts +15 -1
- package/dist/types/components/input-code/input-code.d.ts +15 -1
- package/dist/types/components/pagination/pagination.d.ts +19 -0
- package/dist/types/components/popover/popover.d.ts +9 -0
- package/dist/types/components/radio-group/radio-group.d.ts +16 -0
- package/dist/types/components/stepper/stepper.d.ts +11 -0
- package/dist/types/components/stepper-item/stepper-item.d.ts +7 -0
- package/dist/types/components/toast/toast.d.ts +10 -4
- package/dist/types/components/tooltip/tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +273 -7
- package/dist/web-components/p-02b22f8e.entry.js +1 -0
- package/dist/web-components/{p-d054eb4d.entry.js → p-075a8dc8.entry.js} +1 -1
- package/dist/web-components/{p-8a66d20c.entry.js → p-0a34d33b.entry.js} +1 -1
- package/dist/web-components/{p-8c31cbd5.entry.js → p-10cc9983.entry.js} +1 -1
- package/dist/web-components/{p-d7726e46.entry.js → p-253068b9.entry.js} +1 -1
- package/dist/web-components/{p-3884c6e7.entry.js → p-3b8c8951.entry.js} +1 -1
- package/dist/web-components/{p-550e2237.entry.js → p-3beacdab.entry.js} +1 -1
- package/dist/web-components/p-4214867d.entry.js +1 -0
- package/dist/web-components/{p-3f60c6c0.entry.js → p-42c857e9.entry.js} +1 -1
- package/dist/web-components/{p-7fed6f4d.entry.js → p-44f87e16.entry.js} +1 -1
- package/dist/web-components/p-477614c5.entry.js +1 -0
- package/dist/web-components/{p-1da75540.entry.js → p-495ba3d2.entry.js} +1 -1
- package/dist/web-components/{p-19407a14.entry.js → p-4de76291.entry.js} +1 -1
- package/dist/web-components/{p-cd5daad2.entry.js → p-55600d47.entry.js} +1 -1
- package/dist/web-components/{p-c95b6470.entry.js → p-562051aa.entry.js} +1 -1
- package/dist/web-components/p-5b850e0f.entry.js +1 -0
- package/dist/web-components/p-6013dfc8.entry.js +1 -0
- package/dist/web-components/{p-6cc2ea2c.entry.js → p-62e7ae04.entry.js} +1 -1
- package/dist/web-components/p-71519d37.entry.js +1 -0
- package/dist/web-components/p-88f7b47f.entry.js +1 -0
- package/dist/web-components/p-8975a6a3.entry.js +1 -0
- package/dist/web-components/{p-6bb44ec6.entry.js → p-8e125826.entry.js} +1 -1
- package/dist/web-components/p-91cc0bde.entry.js +1 -0
- package/dist/web-components/{p-0347feff.entry.js → p-93435fcd.entry.js} +1 -1
- package/dist/web-components/p-947969d7.entry.js +1 -0
- package/dist/web-components/{p-cdd88c5a.entry.js → p-95396b5c.entry.js} +1 -1
- package/dist/web-components/p-9de3a1a5.entry.js +1 -0
- package/dist/web-components/p-9f583ed1.entry.js +1 -0
- package/dist/web-components/p-CTxpqopm.js +2 -0
- package/dist/web-components/{p-5eeb7002.entry.js → p-a1086abe.entry.js} +1 -1
- package/dist/web-components/{p-f9d5004c.entry.js → p-bbba6d79.entry.js} +1 -1
- package/dist/web-components/{p-c478712b.entry.js → p-bde44ec4.entry.js} +1 -1
- package/dist/web-components/p-bfc7e6c0.entry.js +1 -0
- package/dist/web-components/p-c1030394.entry.js +1 -0
- package/dist/web-components/p-c1f59ed1.entry.js +1 -0
- package/dist/web-components/{p-26ef77d6.entry.js → p-c80a5541.entry.js} +1 -1
- package/dist/web-components/{p-9ef1bbee.entry.js → p-c96ee61a.entry.js} +1 -1
- package/dist/web-components/{p-8dac326b.entry.js → p-caf8f067.entry.js} +1 -1
- package/dist/web-components/p-cc363c3d.entry.js +1 -0
- package/dist/web-components/p-cf4ff357.entry.js +1 -0
- package/dist/web-components/p-d0310ed4.entry.js +1 -0
- package/dist/web-components/p-d1412932.entry.js +1 -0
- package/dist/web-components/{p-62b788bf.entry.js → p-d2447e30.entry.js} +1 -1
- package/dist/web-components/p-dc9cca06.entry.js +1 -0
- package/dist/web-components/p-e5b943a2.entry.js +1 -0
- package/dist/web-components/{p-4cc58c6a.entry.js → p-e67b13df.entry.js} +1 -1
- package/dist/web-components/p-efec231a.entry.js +1 -0
- package/dist/web-components/{p-4595fa8e.entry.js → p-f867e4c3.entry.js} +1 -1
- package/dist/web-components/web-components.esm.js +1 -1
- package/package.json +5 -2
- package/dist/collection/components/icon/bundled-icons/all-kit.json +0 -1
- package/dist/collection/components/icon/bundled-icons/riverty-kit.json +0 -1
- package/dist/web-components/bundled-icons/all-kit.json +0 -1
- package/dist/web-components/bundled-icons/riverty-kit.json +0 -1
- package/dist/web-components/p-159822fe.entry.js +0 -1
- package/dist/web-components/p-4f261b63.entry.js +0 -1
- package/dist/web-components/p-50893211.entry.js +0 -1
- package/dist/web-components/p-589baaf9.entry.js +0 -1
- package/dist/web-components/p-60341de2.entry.js +0 -1
- package/dist/web-components/p-63fd817d.entry.js +0 -1
- package/dist/web-components/p-67fa3f84.entry.js +0 -1
- package/dist/web-components/p-70784685.entry.js +0 -1
- package/dist/web-components/p-7ce57332.entry.js +0 -1
- package/dist/web-components/p-92c7cf33.entry.js +0 -1
- package/dist/web-components/p-Da7qOBFr.js +0 -2
- package/dist/web-components/p-a7d22c76.entry.js +0 -1
- package/dist/web-components/p-b96d59ca.entry.js +0 -1
- package/dist/web-components/p-b98ab649.entry.js +0 -1
- package/dist/web-components/p-ba801820.entry.js +0 -1
- package/dist/web-components/p-bfc8c077.entry.js +0 -1
- package/dist/web-components/p-c05b05da.entry.js +0 -1
- package/dist/web-components/p-c1e748f2.entry.js +0 -1
- package/dist/web-components/p-d433a828.entry.js +0 -1
- package/dist/web-components/p-d819c8e5.entry.js +0 -1
- package/dist/web-components/p-e4dc60f0.entry.js +0 -1
- package/dist/web-components/p-f7adb875.entry.js +0 -1
- package/dist/collection/components/icon/{icon-data.js → data.js} +0 -0
- package/dist/types/components/icon/{icon-data.d.ts → data.d.ts} +1 -1
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
:host([data-visually-hidden=true]) {
|
|
34
|
+
--r-toast--host--animation-duration: 0.2s;
|
|
34
35
|
--r-toast--host--animation-name: fade-out;
|
|
35
36
|
}
|
|
36
37
|
|
|
@@ -42,7 +43,6 @@
|
|
|
42
43
|
animation-duration: var(--r-toast--host--animation-duration, 0.3s);
|
|
43
44
|
animation-fill-mode: var(--r-toast--host--animation-fill-mode, forwards);
|
|
44
45
|
animation-name: var(--r-toast--host--animation-name, fade-in);
|
|
45
|
-
animation-timing-function: var(--r-toast--host--animation-timing-function, ease-in-out);
|
|
46
46
|
box-sizing: var(--r-toast--host--box-sizing, border-box);
|
|
47
47
|
display: var(--r-toast--host--display, block);
|
|
48
48
|
height: var(--r-toast--host--height, var(--r-toast--host--height-expanded, auto));
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
--r-button--border-color: transparent;
|
|
68
68
|
--r-button--background-color: transparent;
|
|
69
69
|
position: relative;
|
|
70
|
-
top: -8px;
|
|
71
|
-
right: -8px;
|
|
70
|
+
margin-top: -8px;
|
|
71
|
+
margin-right: -8px;
|
|
72
72
|
}
|
|
73
73
|
:host .r-toast--trailing-button:hover {
|
|
74
74
|
--r-button--color: var(--r-text-strong, #000000);
|
|
@@ -88,24 +88,22 @@
|
|
|
88
88
|
from {
|
|
89
89
|
opacity: 0;
|
|
90
90
|
max-height: 0;
|
|
91
|
-
margin-bottom: 0;
|
|
92
91
|
}
|
|
93
92
|
to {
|
|
94
93
|
opacity: 1;
|
|
95
|
-
max-height:
|
|
96
|
-
margin-bottom: var(--r-toast-group--spacing, 0);
|
|
94
|
+
max-height: var(--r-toast--host--height-expanded);
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
97
|
@keyframes fade-out {
|
|
100
98
|
from {
|
|
101
99
|
opacity: 1;
|
|
102
|
-
max-height:
|
|
103
|
-
margin-
|
|
100
|
+
max-height: var(--r-toast--host--height-expanded);
|
|
101
|
+
margin-top: var(--r-spacing-100, 1rem);
|
|
104
102
|
}
|
|
105
103
|
to {
|
|
106
104
|
opacity: 0;
|
|
107
105
|
max-height: 0;
|
|
108
|
-
margin-
|
|
106
|
+
margin-top: 0;
|
|
109
107
|
}
|
|
110
108
|
}
|
|
111
109
|
.r-toast {
|
|
@@ -125,6 +123,7 @@
|
|
|
125
123
|
}
|
|
126
124
|
.r-toast--main {
|
|
127
125
|
flex: var(--r-toast--content--flex, 1);
|
|
126
|
+
word-break: var(--r-toast--content--word-break, break-word);
|
|
128
127
|
}
|
|
129
128
|
.r-toast--leading-icon {
|
|
130
129
|
color: var(--r-toast--leading-icon--color, var(--r-status-info-regular, #3e5c73));
|
|
@@ -145,6 +144,7 @@
|
|
|
145
144
|
font-size: var(--r-toast--content--font-size, var(--r-font-size-300, 0.875rem));
|
|
146
145
|
font-weight: var(--r-toast--content--font-weight, var(--r-font-weight-regular, 400));
|
|
147
146
|
margin-top: var(--r-toast--content--margin-top, 0);
|
|
147
|
+
word-break: var(--r-toast--content--word-break, break-word);
|
|
148
148
|
}
|
|
149
149
|
.r-toast--action {
|
|
150
150
|
display: var(--r-toast--action--display, flex);
|
|
@@ -63,7 +63,17 @@ export class Toast {
|
|
|
63
63
|
this.handleAnimationEnd = (event) => {
|
|
64
64
|
if (event.animationName === 'fade-out') {
|
|
65
65
|
this.animationCompleted = true;
|
|
66
|
-
|
|
66
|
+
// Only emit if still connected to DOM
|
|
67
|
+
if (this.host.isConnected) {
|
|
68
|
+
this.toastDismissed.emit();
|
|
69
|
+
}
|
|
70
|
+
// Clear height after fade-out completes as final cleanup
|
|
71
|
+
this.host.style.setProperty('--r-toast--host--height-expanded', null);
|
|
72
|
+
}
|
|
73
|
+
else if (event.animationName === 'fade-in') {
|
|
74
|
+
// Clear height restriction after fade-in completes to allow natural resizing
|
|
75
|
+
// The toast can now grow/shrink dynamically without animation constraints
|
|
76
|
+
this.host.style.setProperty('--r-toast--host--height-expanded', null);
|
|
67
77
|
}
|
|
68
78
|
};
|
|
69
79
|
this.handleTrailingButtonClick = () => {
|
|
@@ -80,17 +90,28 @@ export class Toast {
|
|
|
80
90
|
* hide the toast before the auto-dismiss timer expires.
|
|
81
91
|
*/
|
|
82
92
|
async dismiss() {
|
|
83
|
-
|
|
93
|
+
// Re-measure height before fade-out to ensure smooth collapse animation
|
|
94
|
+
// This captures the current natural height for the animation
|
|
95
|
+
this.updateHeightVariable();
|
|
84
96
|
this.isOpen = false;
|
|
85
97
|
this.toastDismiss.emit();
|
|
86
98
|
this.animationCompleted = false;
|
|
87
99
|
if (this.removalTimer)
|
|
88
100
|
clearTimeout(this.removalTimer);
|
|
89
101
|
this.removalTimer = setTimeout(() => {
|
|
90
|
-
if (!this.animationCompleted) {
|
|
102
|
+
if (!this.animationCompleted && this.host.isConnected) {
|
|
91
103
|
this.toastDismissed.emit();
|
|
92
104
|
}
|
|
93
|
-
this
|
|
105
|
+
// Safely remove from DOM - check parent exists and contains this element
|
|
106
|
+
if (this.host.isConnected && this.host.parentNode) {
|
|
107
|
+
try {
|
|
108
|
+
this.host.remove();
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
// In test environments, element may have already been removed
|
|
112
|
+
// or DOM structure changed - silently ignore
|
|
113
|
+
}
|
|
114
|
+
}
|
|
94
115
|
}, this.delayBeforeRemoval);
|
|
95
116
|
}
|
|
96
117
|
/**
|
|
@@ -99,27 +120,62 @@ export class Toast {
|
|
|
99
120
|
* automatically dismiss the toast after the specified duration.
|
|
100
121
|
*/
|
|
101
122
|
async reveal() {
|
|
123
|
+
// Measure height for smooth fade-in animation
|
|
124
|
+
await this.measureAndPrepareHeight();
|
|
102
125
|
this.isOpen = true;
|
|
103
|
-
|
|
126
|
+
// Only emit if still connected to DOM
|
|
127
|
+
if (this.host.isConnected) {
|
|
128
|
+
this.toastReveal.emit();
|
|
129
|
+
}
|
|
104
130
|
if (this.delayTimer)
|
|
105
131
|
clearTimeout(this.delayTimer);
|
|
106
132
|
if (this.isDismissManual)
|
|
107
133
|
return;
|
|
108
134
|
if (this.hasDelay)
|
|
109
135
|
this.startDelayTimer();
|
|
136
|
+
return this;
|
|
110
137
|
}
|
|
111
138
|
/**
|
|
112
139
|
* Hides toast, keeps it in dom.
|
|
113
140
|
* */
|
|
114
141
|
async hide() {
|
|
142
|
+
this.updateHeightVariable();
|
|
115
143
|
this.isOpen = false;
|
|
116
|
-
|
|
144
|
+
// Only emit if still connected to DOM
|
|
145
|
+
if (this.host.isConnected) {
|
|
146
|
+
this.toastHide.emit();
|
|
147
|
+
}
|
|
148
|
+
return this;
|
|
117
149
|
}
|
|
118
150
|
/**
|
|
119
151
|
* Toggles visibility of the toast.
|
|
120
152
|
* */
|
|
121
153
|
async toggle() {
|
|
122
154
|
this.isOpen ? this.hide() : this.reveal();
|
|
155
|
+
return this;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Measures the natural height of toast and prepares it for reveal animation.
|
|
159
|
+
* This should be called on newly added toasts before they are revealed.
|
|
160
|
+
*/
|
|
161
|
+
async measureAndPrepareHeight() {
|
|
162
|
+
return new Promise((resolve) => {
|
|
163
|
+
requestAnimationFrame(() => {
|
|
164
|
+
// Temporarily override animation to prevent visual glitches during measurement
|
|
165
|
+
const tempStyle = this.host.style.cssText;
|
|
166
|
+
this.host.style.cssText = tempStyle + '; animation: none !important; max-height: none !important; height: auto !important;';
|
|
167
|
+
// Force reflow and measure
|
|
168
|
+
this.host.offsetHeight;
|
|
169
|
+
const height = this.host.scrollHeight;
|
|
170
|
+
// Restore original style
|
|
171
|
+
this.host.style.cssText = tempStyle;
|
|
172
|
+
// Set the measured height for animation
|
|
173
|
+
if (height > 0) {
|
|
174
|
+
this.host.style.setProperty('--r-toast--host--height-expanded', `${height}px`);
|
|
175
|
+
}
|
|
176
|
+
resolve();
|
|
177
|
+
});
|
|
178
|
+
});
|
|
123
179
|
}
|
|
124
180
|
handleOpenChange() {
|
|
125
181
|
this.isOpen ? this.hide() : this.reveal();
|
|
@@ -181,10 +237,25 @@ export class Toast {
|
|
|
181
237
|
}
|
|
182
238
|
}
|
|
183
239
|
componentWillLoad() {
|
|
184
|
-
|
|
240
|
+
// Set initial state but don't trigger reveal yet - let mutation observer handle it
|
|
241
|
+
this.isOpen = this.open;
|
|
185
242
|
}
|
|
186
|
-
componentDidLoad() {
|
|
243
|
+
async componentDidLoad() {
|
|
187
244
|
this.host.addEventListener('animationend', this.handleAnimationEnd);
|
|
245
|
+
// Measure and store the toast height for smooth initial fade-in animation
|
|
246
|
+
await this.measureAndPrepareHeight();
|
|
247
|
+
// Start auto-dismiss timer if configured and toast is initially open
|
|
248
|
+
if (this.isOpen && !this.isDismissManual && this.hasDelay) {
|
|
249
|
+
this.startDelayTimer();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
updateHeightVariable() {
|
|
253
|
+
// Use requestAnimationFrame to ensure the element is fully rendered
|
|
254
|
+
requestAnimationFrame(() => {
|
|
255
|
+
if (this.host.offsetHeight > 0) {
|
|
256
|
+
this.host.style.setProperty('--r-toast--host--height-expanded', `${this.host.offsetHeight}px`);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
188
259
|
}
|
|
189
260
|
disconnectedCallback() {
|
|
190
261
|
this.host.removeEventListener('animationend', this.handleAnimationEnd);
|
|
@@ -207,14 +278,14 @@ export class Toast {
|
|
|
207
278
|
name: trailingIcon,
|
|
208
279
|
size: 'm'
|
|
209
280
|
};
|
|
210
|
-
return (h(Host, Object.assign({ key: '
|
|
211
|
-
h("div", { key: '
|
|
212
|
-
h("h2", { key: '
|
|
213
|
-
h("div", { key: '
|
|
214
|
-
h("div", { key: '
|
|
215
|
-
h("r-button", Object.assign({ key: '
|
|
216
|
-
h("div", { key: '
|
|
217
|
-
h("r-icon-button", Object.assign({ key: '
|
|
281
|
+
return (h(Host, Object.assign({ key: '4fa8a3d2db292941933f73437d823f3f6581d626' }, hostAttrs, { id: this.uniqueId, "data-visually-hidden": `${this.isOpen ? 'false' : 'true'}`, style: { visibility: this.isOpen ? 'visible' : 'hidden' } }), h("div", { key: '20506092a2459d836918da00f1670cf18730a42c', class: "r-toast" }, this.hasLeading &&
|
|
282
|
+
h("div", { key: '384ce331ff3825bc01323bbb6f3972ccd4198223', class: "r-toast--leading" }, this.hasLeadingSlot && h("slot", { key: 'eb455c5729d37431b8576dfcaff6eceead5000bb', name: "leading" }), this.leadingIconVisible && h("r-icon", Object.assign({ key: '3b0b3e9d9516a072d5c3b5ca50ab3353cdf20053', class: "r-toast--leading-icon" }, leadingIconAttrs))), h("div", { key: 'dcfc949dda66a2437cbb4b3e2847266e55ab83d6', class: "r-toast--main" }, this.hasHeadline &&
|
|
283
|
+
h("h2", { key: 'c1abf4f2b6abc7b53db6727ff09f027d4b2a940d', class: "r-toast--headline" }, h("slot", { key: '9b6a57199eac2a4e0f96d38cc0b3d02adc2bb279', name: "headline" }, headline)), this.hasContent &&
|
|
284
|
+
h("div", { key: '6c182bd58efe6cd404ae7b20ee2464f3965b889d', class: "r-toast--content r-typography" }, h("slot", { key: 'a49fd6e859f1b512069fc3bed9c0c21da35d78cc', onSlotchange: this.handleSlotChange })), this.hasAction &&
|
|
285
|
+
h("div", { key: 'b0282c4677483b96b3eac7ddbdb2e13ae245ebe2', class: "r-toast--action" }, h("slot", { key: 'e267d02a4e39a443865c1c0a62f3d6ed06e2a319', name: "action" }, this.hasActionLink &&
|
|
286
|
+
h("r-button", Object.assign({ key: '8785094717619bd69c5e711873598b2fb7eeb5be', class: "r-toast--action-link", variant: "text-inline", size: "small" }, actionAttrs), action)))), this.hasTrailing &&
|
|
287
|
+
h("div", { key: '066ecbc6346ed516aa9dd193505a26544bbdf92f', class: "r-toast--trailing" }, this.hasTrailingSlot && h("slot", { key: '890fd983d1208ea514b89aeaf394ae82c1d1ec55', name: "trailing" }), this.isDismissManual &&
|
|
288
|
+
h("r-icon-button", Object.assign({ key: '2b9e06adc46cf1a726d5d78f7cedb2d1405b4c72' }, trailingIconAttrs, { class: "r-toast--trailing-button", onClick: this.handleTrailingButtonClick, label: this.dismissLabel }), h("slot", { key: '7349c7b3422f194852609c2cdf150a5dc4498aa9', name: "dismiss" }))))));
|
|
218
289
|
}
|
|
219
290
|
static get is() { return "r-toast"; }
|
|
220
291
|
static get encapsulation() { return "shadow"; }
|
|
@@ -663,7 +734,7 @@ export class Toast {
|
|
|
663
734
|
},
|
|
664
735
|
"reveal": {
|
|
665
736
|
"complexType": {
|
|
666
|
-
"signature": "() => Promise<
|
|
737
|
+
"signature": "() => Promise<this>",
|
|
667
738
|
"parameters": [],
|
|
668
739
|
"references": {
|
|
669
740
|
"Promise": {
|
|
@@ -671,7 +742,7 @@ export class Toast {
|
|
|
671
742
|
"id": "global::Promise"
|
|
672
743
|
}
|
|
673
744
|
},
|
|
674
|
-
"return": "Promise<
|
|
745
|
+
"return": "Promise<this>"
|
|
675
746
|
},
|
|
676
747
|
"docs": {
|
|
677
748
|
"text": "Reveals the toast notification by setting it to a visible state. \nIf the auto-dismiss delay is enabled, it will start the timer to \nautomatically dismiss the toast after the specified duration.",
|
|
@@ -680,7 +751,7 @@ export class Toast {
|
|
|
680
751
|
},
|
|
681
752
|
"hide": {
|
|
682
753
|
"complexType": {
|
|
683
|
-
"signature": "() => Promise<
|
|
754
|
+
"signature": "() => Promise<this>",
|
|
684
755
|
"parameters": [],
|
|
685
756
|
"references": {
|
|
686
757
|
"Promise": {
|
|
@@ -688,7 +759,7 @@ export class Toast {
|
|
|
688
759
|
"id": "global::Promise"
|
|
689
760
|
}
|
|
690
761
|
},
|
|
691
|
-
"return": "Promise<
|
|
762
|
+
"return": "Promise<this>"
|
|
692
763
|
},
|
|
693
764
|
"docs": {
|
|
694
765
|
"text": "Hides toast, keeps it in dom.",
|
|
@@ -696,6 +767,23 @@ export class Toast {
|
|
|
696
767
|
}
|
|
697
768
|
},
|
|
698
769
|
"toggle": {
|
|
770
|
+
"complexType": {
|
|
771
|
+
"signature": "() => Promise<this>",
|
|
772
|
+
"parameters": [],
|
|
773
|
+
"references": {
|
|
774
|
+
"Promise": {
|
|
775
|
+
"location": "global",
|
|
776
|
+
"id": "global::Promise"
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
"return": "Promise<this>"
|
|
780
|
+
},
|
|
781
|
+
"docs": {
|
|
782
|
+
"text": "Toggles visibility of the toast.",
|
|
783
|
+
"tags": []
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
"measureAndPrepareHeight": {
|
|
699
787
|
"complexType": {
|
|
700
788
|
"signature": "() => Promise<void>",
|
|
701
789
|
"parameters": [],
|
|
@@ -708,7 +796,7 @@ export class Toast {
|
|
|
708
796
|
"return": "Promise<void>"
|
|
709
797
|
},
|
|
710
798
|
"docs": {
|
|
711
|
-
"text": "
|
|
799
|
+
"text": "Measures the natural height of toast and prepares it for reveal animation.\nThis should be called on newly added toasts before they are revealed.",
|
|
712
800
|
"tags": []
|
|
713
801
|
}
|
|
714
802
|
}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
@media (max-width: 48rem) {
|
|
2
|
-
:host {
|
|
3
|
-
--width: auto;
|
|
4
|
-
--right: 24px;
|
|
5
|
-
--bottom: auto;
|
|
6
|
-
--left: 24px;
|
|
7
|
-
--padding-right: 0;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
1
|
:host([data-visually-hidden=true]) {
|
|
11
2
|
position: absolute;
|
|
12
3
|
width: 1px;
|
|
@@ -21,7 +12,7 @@
|
|
|
21
12
|
:host {
|
|
22
13
|
display: var(--display, block);
|
|
23
14
|
position: var(--position, fixed);
|
|
24
|
-
top: var(--top,
|
|
15
|
+
top: var(--top, 0);
|
|
25
16
|
right: var(--right, 0);
|
|
26
17
|
bottom: var(--bottom, auto);
|
|
27
18
|
left: var(--left, auto);
|
|
@@ -30,14 +21,17 @@
|
|
|
30
21
|
width: var(--width, 352px);
|
|
31
22
|
max-height: var(--max-height, calc(100vh - 64px));
|
|
32
23
|
padding-right: var(--padding-right, 32px);
|
|
24
|
+
padding-top: var(--padding-top, 16px);
|
|
33
25
|
padding-bottom: var(--padding-bottom, 32px);
|
|
34
26
|
z-index: var(--z-index, 1);
|
|
35
27
|
}
|
|
28
|
+
:host ::slotted(r-toast) {
|
|
29
|
+
margin-top: var(--r-spacing-100, 1rem);
|
|
30
|
+
}
|
|
36
31
|
|
|
37
32
|
.r-toast-group {
|
|
38
33
|
position: relative;
|
|
39
34
|
display: var(--r-toast-group--display, flex);
|
|
40
35
|
flex-direction: var(--r-toast-group--flex-direction, column);
|
|
41
36
|
justify-content: var(--r-toast-group--justify-content, flex-start);
|
|
42
|
-
--r-toast-group--spacing: var(--r-spacing-100, 1rem);
|
|
43
37
|
}
|
|
@@ -5,8 +5,17 @@ export class ToastGroup {
|
|
|
5
5
|
this.host.setAttribute('data-visually-hidden', `${!this.hasChildren}`);
|
|
6
6
|
};
|
|
7
7
|
this.observeSlotContentChange = () => {
|
|
8
|
-
this.observer = new MutationObserver(() => {
|
|
8
|
+
this.observer = new MutationObserver(async (mutations) => {
|
|
9
|
+
var _a, _b;
|
|
9
10
|
this.updateHiddenState();
|
|
11
|
+
const addedToast = mutations
|
|
12
|
+
.flatMap(mutation => Array.from(mutation.addedNodes))
|
|
13
|
+
.find(node => node.nodeName === 'R-TOAST');
|
|
14
|
+
if (addedToast) {
|
|
15
|
+
// Measure height then reveal for smooth animation
|
|
16
|
+
await ((_a = addedToast.measureAndPrepareHeight) === null || _a === void 0 ? void 0 : _a.call(addedToast));
|
|
17
|
+
await ((_b = addedToast.reveal) === null || _b === void 0 ? void 0 : _b.call(addedToast));
|
|
18
|
+
}
|
|
10
19
|
});
|
|
11
20
|
this.observer.observe(this.host, {
|
|
12
21
|
childList: true,
|
|
@@ -22,10 +31,10 @@ export class ToastGroup {
|
|
|
22
31
|
this.observeSlotContentChange();
|
|
23
32
|
}
|
|
24
33
|
render() {
|
|
25
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: '85ab80be1fca1d1a9c3dc2e17de616747748a4dd' }, h("div", { key: 'a88670978563caeb8f500f4b5f9af2bcd0ade386', class: "r-toast-group" }, h("slot", { key: 'ab1480a47cfae0cacc45de708d51e8a77b6dfb85' }))));
|
|
26
35
|
}
|
|
27
36
|
static get is() { return "r-toast-group"; }
|
|
28
|
-
static get encapsulation() { return "
|
|
37
|
+
static get encapsulation() { return "shadow"; }
|
|
29
38
|
static get originalStyleUrls() {
|
|
30
39
|
return {
|
|
31
40
|
"$": ["toast-group.css"]
|
|
@@ -94,13 +94,18 @@ export class Tooltip {
|
|
|
94
94
|
this.rTooltipFocus.emit({ element: this.element });
|
|
95
95
|
};
|
|
96
96
|
this.showTooltip = () => {
|
|
97
|
+
var _a;
|
|
97
98
|
this.isShown = true;
|
|
98
99
|
this.tooltip.classList.add('r-tooltip--content--visible');
|
|
100
|
+
const interactiveElement = this.getInteractiveElement(this.activeElement);
|
|
101
|
+
interactiveElement === null || interactiveElement === void 0 ? void 0 : interactiveElement.setAttribute('aria-description', (_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.innerText);
|
|
99
102
|
};
|
|
100
103
|
this.removeTooltip = () => {
|
|
101
104
|
this.isShown = false;
|
|
102
105
|
this.tooltip.style.width = 'max-content';
|
|
103
106
|
this.tooltip.classList.remove('r-tooltip--content--visible');
|
|
107
|
+
const interactiveElement = this.getInteractiveElement(this.activeElement);
|
|
108
|
+
interactiveElement === null || interactiveElement === void 0 ? void 0 : interactiveElement.removeAttribute('aria-description');
|
|
104
109
|
};
|
|
105
110
|
this.handleScroll = () => {
|
|
106
111
|
if (!this.isShown) {
|
|
@@ -226,6 +231,21 @@ export class Tooltip {
|
|
|
226
231
|
get activeElement() {
|
|
227
232
|
return this.element.querySelector('r-button, r-icon-button, a, button, [tabindex]:not([tabindex="-1"])');
|
|
228
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* Gets the actual interactive element (button/link) from within r-button or r-icon-button shadow DOM,
|
|
236
|
+
* or returns the element itself if it's already interactive
|
|
237
|
+
*/
|
|
238
|
+
getInteractiveElement(element) {
|
|
239
|
+
if (!element)
|
|
240
|
+
return null;
|
|
241
|
+
if (element.tagName === 'R-BUTTON' || element.tagName === 'R-ICON-BUTTON') {
|
|
242
|
+
const shadowRoot = element.shadowRoot;
|
|
243
|
+
if (shadowRoot) {
|
|
244
|
+
return shadowRoot.querySelector('button, a');
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return element;
|
|
248
|
+
}
|
|
229
249
|
/**
|
|
230
250
|
* Define position state
|
|
231
251
|
*/
|
|
@@ -314,7 +334,7 @@ export class Tooltip {
|
|
|
314
334
|
this.adjustArrowPosition();
|
|
315
335
|
this.alignTooltipPosition();
|
|
316
336
|
this.alignArrowPosition();
|
|
317
|
-
//
|
|
337
|
+
// Allow tooltip content wrap and recalculate position
|
|
318
338
|
if (this.tooltip.style.width === 'fit-content') {
|
|
319
339
|
return;
|
|
320
340
|
}
|
|
@@ -348,14 +368,14 @@ export class Tooltip {
|
|
|
348
368
|
const triggerAttrs = {
|
|
349
369
|
tabindex: !this.activeElement ? 0 : null,
|
|
350
370
|
role: !this.activeElement ? 'button' : null,
|
|
351
|
-
'aria-describedby':
|
|
371
|
+
'aria-describedby': !this.activeElement && isShown ? uniqueId : null
|
|
352
372
|
};
|
|
353
373
|
const contentAttrs = {
|
|
354
374
|
id: uniqueId,
|
|
355
375
|
role: 'tooltip',
|
|
356
376
|
'aria-hidden': `${!isShown}`
|
|
357
377
|
};
|
|
358
|
-
return (h(Host, Object.assign({ key: '
|
|
378
|
+
return (h(Host, Object.assign({ key: '5d8a002a227895d5e633e8b1df95ba449a9e253a' }, hostAttrs, { onMouseenter: this.handleHover, onMouseleave: this.removeTooltip }), h("div", { key: '4e6340639dc27fc7d0e981ca7cf8a4046737527f', class: "r-tooltip" }, h("div", Object.assign({ key: 'bcf2d5c73b427b2941be8de56b9ce2f296ae07eb', class: "r-tooltip--trigger", onFocus: this.handleFocus, onBlur: this.removeTooltip }, triggerAttrs), h("slot", { key: 'be7037ba07bf11b4957910c52f4a3f329b514007' })), h("div", Object.assign({ key: '300a3ef08b7c73b6b07161c58860df518ae9a862', class: "r-tooltip--content", ref: (el) => this.tooltip = el }, contentAttrs), text), h("div", { key: '73912349289b0dc365552331197d94bd0896ff3c', ref: (el) => this.arrow = el, class: "r-tooltip--arrow" }))));
|
|
359
379
|
}
|
|
360
380
|
static get is() { return "r-tooltip"; }
|
|
361
381
|
static get encapsulation() { return "shadow"; }
|