@riverty/web-components 6.0.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 +44 -0
- package/custom-elements.json +259 -2
- 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 +27 -7
- 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 +8 -5
- package/dist/cjs/r-list-item.cjs.entry.js +17 -16
- package/dist/cjs/r-pagination.cjs.entry.js +56 -50
- package/dist/cjs/r-panel.cjs.entry.js +6 -6
- 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 +7 -3
- package/dist/cjs/r-tabs-list.cjs.entry.js +161 -3
- package/dist/cjs/r-tabs.cjs.entry.js +35 -7
- package/dist/cjs/r-textarea.cjs.entry.js +2 -2
- package/dist/cjs/r-toast-group.cjs.entry.js +13 -4
- package/dist/cjs/r-toast.cjs.entry.js +104 -15
- package/dist/cjs/web-components.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/alert/alert.css +6 -6
- 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/icon-button/icon-button.js +22 -3
- 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 +3 -0
- package/dist/collection/components/input/input.css +3 -0
- package/dist/collection/components/input/input.js +100 -3
- package/dist/collection/components/input-code/exports.js +2 -2
- package/dist/collection/components/input-code/input-code.css +6 -0
- package/dist/collection/components/input-code/input-code.js +54 -16
- 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/list-item/list-item/list-item.css +46 -12
- package/dist/collection/components/list-item/list-item/list-item.js +34 -14
- package/dist/collection/components/pagination/pagination.css +33 -72
- package/dist/collection/components/pagination/pagination.js +194 -48
- package/dist/collection/components/panel/panel.css +40 -17
- package/dist/collection/components/panel/panel.js +6 -6
- 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 +5 -2
- package/dist/collection/components/stepper/stepper.js +125 -1
- package/dist/collection/components/stepper-item/stepper-item.css +25 -12
- package/dist/collection/components/stepper-item/stepper-item.js +36 -2
- package/dist/collection/components/tab/tab.css +29 -29
- package/dist/collection/components/tab/tab.js +5 -1
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/tabs/tabs.js +34 -6
- package/dist/collection/components/tabs-list/exports.js +2 -0
- package/dist/collection/components/tabs-list/tabs-list.css +43 -2
- package/dist/collection/components/tabs-list/tabs-list.js +277 -1
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/toast/toast.css +37 -11
- package/dist/collection/components/toast/toast.js +140 -18
- 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 +24 -4
- 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 +27 -7
- 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 +8 -5
- package/dist/esm/r-list-item.entry.js +17 -16
- package/dist/esm/r-pagination.entry.js +56 -50
- package/dist/esm/r-panel.entry.js +6 -6
- 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 +7 -3
- package/dist/esm/r-tabs-list.entry.js +161 -3
- package/dist/esm/r-tabs.entry.js +35 -7
- package/dist/esm/r-textarea.entry.js +2 -2
- package/dist/esm/r-toast-group.entry.js +13 -4
- package/dist/esm/r-toast.entry.js +104 -15
- 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/{icon-data.d.ts → data.d.ts} +2 -1
- package/dist/types/components/icon/exports.d.ts +2 -1
- package/dist/types/components/icon/riverty-kit.d.ts +2 -1
- package/dist/types/components/icon-button/icon-button.d.ts +4 -0
- 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 +6 -0
- package/dist/types/components/input/input.d.ts +31 -1
- package/dist/types/components/input-code/exports.d.ts +4 -4
- package/dist/types/components/input-code/input-code.d.ts +18 -4
- package/dist/types/components/list-item/list-item/list-item.d.ts +5 -3
- 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/tabs/tabs.d.ts +1 -0
- package/dist/types/components/tabs-list/exports.d.ts +4 -0
- package/dist/types/components/tabs-list/tabs-list.d.ts +38 -0
- package/dist/types/components/toast/toast.d.ts +20 -3
- package/dist/types/components/tooltip/tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +360 -17
- 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-e2188953.entry.js → p-4214867d.entry.js} +1 -1
- 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-4de76291.entry.js +1 -0
- package/dist/web-components/{p-05738503.entry.js → p-55600d47.entry.js} +1 -1
- package/dist/web-components/p-562051aa.entry.js +1 -0
- 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-8e125826.entry.js +1 -0
- 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-95396b5c.entry.js +1 -0
- 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-e5945c01.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-0e4c8bf1.entry.js +0 -1
- package/dist/web-components/p-3a5a67e7.entry.js +0 -1
- package/dist/web-components/p-4254a383.entry.js +0 -1
- package/dist/web-components/p-5441b746.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-60ca994e.entry.js +0 -1
- package/dist/web-components/p-6303b9fe.entry.js +0 -1
- package/dist/web-components/p-63fd817d.entry.js +0 -1
- package/dist/web-components/p-673dbfd0.entry.js +0 -1
- package/dist/web-components/p-67fa3f84.entry.js +0 -1
- package/dist/web-components/p-6a4f3836.entry.js +0 -1
- package/dist/web-components/p-70784685.entry.js +0 -1
- package/dist/web-components/p-8b4d2448.entry.js +0 -1
- package/dist/web-components/p-Da7qOBFr.js +0 -2
- package/dist/web-components/p-a0dbde7c.entry.js +0 -1
- package/dist/web-components/p-a71485d8.entry.js +0 -1
- package/dist/web-components/p-a7d22c76.entry.js +0 -1
- package/dist/web-components/p-ae251d2f.entry.js +0 -1
- package/dist/web-components/p-b98ab649.entry.js +0 -1
- package/dist/web-components/p-b9e3b3d6.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-f7adb875.entry.js +0 -1
- /package/dist/collection/components/icon/{icon-data.js → data.js} +0 -0
|
@@ -1,16 +1,174 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BnETQtSf.js');
|
|
4
4
|
|
|
5
|
-
const tabsListCss = ":host{display:block}.r-tabs-list{display:var(--r-tabs-list--display, flex);margin-bottom:var(--r-tabs-list--margin-bottom,
|
|
5
|
+
const tabsListCss = ":host{display:block}:host([variant=compact]){--r-tabs-list--r-tab--margin-right:0;--r-tabs-list--r-tab--flex:1;--r-tab--width:100%}:host([scrollable=true]){--r-tabs-list--tabs-container--margin:-6px 4px}:host([border=branded]){--r-tab--marker--background-color:var(--r-border-brand-vanguard, #527a42)}.r-tabs-list{display:var(--r-tabs-list--display, flex);margin-bottom:var(--r-tabs-list--margin-bottom, var(--r-spacing-250, 2.5rem));border-bottom-width:var(--r-tabs-list--border-bottom-width, 1px);border-bottom-style:var(--r-tabs-list--border-bottom-style, solid);border-bottom-color:var(--r-tabs-list--border-bottom-color, var(--r-border-softer, #c9c9c9))}.r-tabs-list--scroll-button{--r-icon-button--border-radius:var(--r-tabs-list--border-radius, 0);--r-icon-button--width:var(--r-tabs-list--scroll-button--width, var(--r-spacing-200, 2rem));--r-icon-button--height:var(--r-tabs-list--scroll-button--height, var(--r-spacing-200, 2rem))}.r-tabs-list--tabs-container{display:var(--r-tabs-list--tabs-container--display, flex);flex:var(--r-tabs-list--tabs-container--flex, 1);overflow:var(--r-tabs-list--tabs-container--overflow, scroll hidden);scroll-snap-type:var(--r-tabs-list--tabs-container--scroll-snap-type, x proximity);scrollbar-width:var(--r-tabs-list--tabs-container--scrollbar-width, none);margin:var(--r-tabs-list--tabs-container--margin, -6px);padding:var(--r-tabs-list--tabs-container--padding, 6px)}.r-tabs-list--scroll-button-container{display:var(--r-tabs-list--scroll-button-container--display, flex);align-items:var(--r-tabs-list--scroll-button-container--align-items, start);gap:var(--r-tabs-list--scroll-button-container--gap, var(--r-spacing-025, 0.25rem))}.r-tabs-list--scroll-indicator{margin-top:var(--r-tabs-list--scroll-indicator--margin, 2px);width:var(--r-tabs-list--scroll-button--after--width, 1px);height:var(--r-tabs-list--scroll-button--after--height, var(--r-spacing-175, 1.75rem));background-color:var(--r-tabs-list----scroll-indicator--background-color, var(--r-border-softer, #c9c9c9));z-index:var(--r-tabs-list----scroll-indicator--z-index, 1)}.r-tabs-list ::slotted(r-tab){margin-right:var(--r-tabs-list--r-tab--margin-right, var(--r-spacing-250, 2.5rem));flex:var(--r-tabs-list--r-tab--flex, none)}.r-tabs-list ::slotted(r-tab:last-of-type){margin-right:var(--r-tabs-list--r-tab--last-of-type--margin-right, 0)}";
|
|
6
6
|
|
|
7
7
|
const RTabsList = class {
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
|
+
/**
|
|
11
|
+
* Visual variant of the tab list
|
|
12
|
+
* @defaulr 'expanded'
|
|
13
|
+
* */
|
|
14
|
+
this.variant = 'expanded';
|
|
15
|
+
/**
|
|
16
|
+
* Border style of the active tab
|
|
17
|
+
* @default 'standard'
|
|
18
|
+
* */
|
|
19
|
+
this.border = 'standard';
|
|
20
|
+
/** Indicates if the tab list is scrollable */
|
|
21
|
+
this.scrollable = false;
|
|
22
|
+
/** Indicates if the first tab is fully visible */
|
|
23
|
+
this.firstItemVisible = true;
|
|
24
|
+
/** Indicates if the last tab is fully visible */
|
|
25
|
+
this.lastItemVisible = false;
|
|
26
|
+
this.initiatizeResizeObserver = () => {
|
|
27
|
+
if (!this.containerRef || this.resizeObserver)
|
|
28
|
+
return;
|
|
29
|
+
this.resizeObserver = new ResizeObserver(() => this.updateScrollState());
|
|
30
|
+
this.resizeObserver.observe(this.containerRef);
|
|
31
|
+
};
|
|
32
|
+
this.updateScrollState = () => {
|
|
33
|
+
if (!this.containerRef)
|
|
34
|
+
return;
|
|
35
|
+
const { scrollWidth, clientWidth } = this.containerRef;
|
|
36
|
+
const containerRect = this.containerRef.getBoundingClientRect();
|
|
37
|
+
const tabs = Array.from(this.tabElements);
|
|
38
|
+
// Check if content is scrollable
|
|
39
|
+
this.scrollable = scrollWidth > clientWidth;
|
|
40
|
+
if (!this.scrollable || tabs.length === 0) {
|
|
41
|
+
this.firstItemVisible = true;
|
|
42
|
+
this.lastItemVisible = true;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const firstTab = tabs[0];
|
|
46
|
+
const firstTabRect = firstTab.getBoundingClientRect();
|
|
47
|
+
this.firstItemVisible = firstTabRect.left >= containerRect.left - 1;
|
|
48
|
+
const lastTab = tabs[tabs.length - 1];
|
|
49
|
+
const lastTabRect = lastTab.getBoundingClientRect();
|
|
50
|
+
this.lastItemVisible = lastTabRect.right <= containerRect.right + 1;
|
|
51
|
+
};
|
|
52
|
+
this.getVisibleTabOnLeft = () => {
|
|
53
|
+
if (!this.containerRef)
|
|
54
|
+
return null;
|
|
55
|
+
const containerRect = this.containerRef.getBoundingClientRect();
|
|
56
|
+
const tabs = Array.from(this.tabElements);
|
|
57
|
+
// Find first tab that's partially or fully visible from the left
|
|
58
|
+
for (const tab of tabs) {
|
|
59
|
+
const tabRect = tab.getBoundingClientRect();
|
|
60
|
+
if (tabRect.right > containerRect.left + 1) {
|
|
61
|
+
return tab;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
};
|
|
66
|
+
this.getVisibleTabOnRight = () => {
|
|
67
|
+
if (!this.containerRef)
|
|
68
|
+
return null;
|
|
69
|
+
const containerRect = this.containerRef.getBoundingClientRect();
|
|
70
|
+
const tabs = Array.from(this.tabElements);
|
|
71
|
+
for (let i = tabs.length - 1; i >= 0; i--) {
|
|
72
|
+
const tab = tabs[i];
|
|
73
|
+
const tabRect = tab.getBoundingClientRect();
|
|
74
|
+
if (tabRect.left < containerRect.right - 1) {
|
|
75
|
+
return tab;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
};
|
|
80
|
+
this.scrollLeft = () => {
|
|
81
|
+
if (!this.containerRef)
|
|
82
|
+
return;
|
|
83
|
+
const visibleTab = this.getVisibleTabOnLeft();
|
|
84
|
+
if (!visibleTab)
|
|
85
|
+
return;
|
|
86
|
+
const tabs = Array.from(this.tabElements);
|
|
87
|
+
const currentIndex = tabs.indexOf(visibleTab);
|
|
88
|
+
const prevTab = currentIndex > 0 ? tabs[currentIndex - 1] : null;
|
|
89
|
+
if (!prevTab)
|
|
90
|
+
return;
|
|
91
|
+
const containerLeft = this.containerRef.getBoundingClientRect().left;
|
|
92
|
+
const prevTabLeft = prevTab.getBoundingClientRect().left;
|
|
93
|
+
const offset = prevTabLeft - containerLeft;
|
|
94
|
+
this.containerRef.scrollBy({
|
|
95
|
+
left: offset,
|
|
96
|
+
behavior: 'smooth'
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
this.scrollRight = () => {
|
|
100
|
+
if (!this.containerRef)
|
|
101
|
+
return;
|
|
102
|
+
const visibleTab = this.getVisibleTabOnRight();
|
|
103
|
+
if (!visibleTab)
|
|
104
|
+
return;
|
|
105
|
+
const tabs = Array.from(this.tabElements);
|
|
106
|
+
const currentIndex = tabs.indexOf(visibleTab);
|
|
107
|
+
const nextTab = currentIndex < tabs.length - 1 ? tabs[currentIndex + 1] : null;
|
|
108
|
+
if (!nextTab)
|
|
109
|
+
return;
|
|
110
|
+
const containerRight = this.containerRef.getBoundingClientRect().right;
|
|
111
|
+
const nextTabRight = nextTab.getBoundingClientRect().right;
|
|
112
|
+
const offset = nextTabRight - containerRight;
|
|
113
|
+
this.containerRef.scrollBy({
|
|
114
|
+
left: offset,
|
|
115
|
+
behavior: 'smooth'
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
this.scrollToActiveTab = (activeTabElement) => {
|
|
119
|
+
if (!this.containerRef || !this.scrollable)
|
|
120
|
+
return;
|
|
121
|
+
const activeTab = activeTabElement || this.host.querySelector('r-tab[active]');
|
|
122
|
+
if (!activeTab)
|
|
123
|
+
return;
|
|
124
|
+
const containerRect = this.containerRef.getBoundingClientRect();
|
|
125
|
+
const activeTabRect = activeTab.getBoundingClientRect();
|
|
126
|
+
// Check if already fully visible
|
|
127
|
+
const isVisible = activeTabRect.left >= containerRect.left &&
|
|
128
|
+
activeTabRect.right <= containerRect.right;
|
|
129
|
+
if (isVisible)
|
|
130
|
+
return;
|
|
131
|
+
// Center the active tab
|
|
132
|
+
const offset = (activeTabRect.left - containerRect.left) -
|
|
133
|
+
(containerRect.width / 2) +
|
|
134
|
+
(activeTabRect.width / 2);
|
|
135
|
+
this.containerRef.scrollBy({
|
|
136
|
+
left: offset,
|
|
137
|
+
behavior: 'smooth'
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
this.renderScrollButton = (direction, disabled, onClick, tooltip) => {
|
|
141
|
+
const iconName = direction === 'left' ? 'angle-left' : 'angle-right';
|
|
142
|
+
const button = (index.h("r-icon-button", { onRClick: onClick, disabled: disabled, name: iconName, size: "s", rTabindex: -1, class: "r-tabs-list--scroll-button" }));
|
|
143
|
+
if (tooltip) {
|
|
144
|
+
return (index.h("r-tooltip", { text: tooltip, position: "top" }, button));
|
|
145
|
+
}
|
|
146
|
+
return button;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** Listen for "click" event on `<r-tab>` */
|
|
150
|
+
tabChangeAction(event) {
|
|
151
|
+
this.scrollToActiveTab(event.target);
|
|
152
|
+
}
|
|
153
|
+
/** `<r-tab>` group of elements */
|
|
154
|
+
get tabElements() {
|
|
155
|
+
return this.host.querySelectorAll('r-tab');
|
|
156
|
+
}
|
|
157
|
+
componentDidLoad() {
|
|
158
|
+
this.updateScrollState();
|
|
159
|
+
this.initiatizeResizeObserver();
|
|
160
|
+
this.scrollToActiveTab();
|
|
161
|
+
}
|
|
162
|
+
disconnectedCallback() {
|
|
163
|
+
var _a;
|
|
164
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
10
165
|
}
|
|
11
166
|
render() {
|
|
12
|
-
return (index.h(index.Host, { key: '
|
|
167
|
+
return (index.h(index.Host, { key: '19666af123fe058aa3e654c153ad84ec16861a59', scrollable: `${this.scrollable}`, role: "tablist" }, index.h("div", { key: '5de7241f57b419133f81ae565bf517873a8e9268', class: "r-tabs-list" }, this.scrollable &&
|
|
168
|
+
index.h("div", { key: 'ff5edcbb61dd4ba9be3e0baf22822edbcbf8ec6d', "aria-hidden": "true", class: "r-tabs-list--scroll-button-container" }, this.renderScrollButton('left', this.firstItemVisible, this.scrollLeft, this.scrollLeftTooltip), !this.firstItemVisible && index.h("div", { key: '76fbeab529e2a7869ac7e946b1c0863969114888', class: "r-tabs-list--scroll-indicator" })), index.h("div", { key: 'd520b386242700c000daf85eba8d50fb014fc616', class: "r-tabs-list--tabs-container", ref: (el) => this.containerRef = el, onScroll: this.updateScrollState }, index.h("slot", { key: 'f8534275445ed4d32154519f0a8f592ee7ea3353' })), this.scrollable &&
|
|
169
|
+
index.h("div", { key: '8ca03d4864eba5af975de4dd6dc6fd3c3e8be108', "aria-hidden": "true", class: "r-tabs-list--scroll-button-container" }, !this.lastItemVisible && index.h("div", { key: '1a0534b79bbe3273a73f48530a3a17ccac0d7826', class: "r-tabs-list--scroll-indicator" }), this.renderScrollButton('right', this.lastItemVisible, this.scrollRight, this.scrollRightTooltip)))));
|
|
13
170
|
}
|
|
171
|
+
get host() { return index.getElement(this); }
|
|
14
172
|
};
|
|
15
173
|
RTabsList.style = tabsListCss;
|
|
16
174
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BnETQtSf.js');
|
|
4
4
|
|
|
5
5
|
const tabsCss = ":host{display:block;margin-top:var(--r-spacing-150, 1.5rem)}";
|
|
6
6
|
|
|
@@ -187,23 +187,51 @@ const RTabs = class {
|
|
|
187
187
|
history.pushState({ tabId, tabsGroup }, '', url.toString());
|
|
188
188
|
}
|
|
189
189
|
_changeFocusTab(tab, keycode) {
|
|
190
|
-
var _a, _b, _c, _d;
|
|
191
190
|
const tabs = Array.from(this.tabElements).filter(element => !element.disabled);
|
|
192
191
|
const index = tabs.indexOf(tab);
|
|
192
|
+
let nextTab;
|
|
193
193
|
switch (keycode) {
|
|
194
194
|
case 'ArrowLeft':
|
|
195
|
-
index === 0 ?
|
|
195
|
+
nextTab = index === 0 ? tabs[tabs.length - 1] : tabs[index - 1];
|
|
196
196
|
break;
|
|
197
197
|
case 'ArrowRight':
|
|
198
|
-
index === tabs.length - 1 ?
|
|
198
|
+
nextTab = index === tabs.length - 1 ? tabs[0] : tabs[index + 1];
|
|
199
199
|
break;
|
|
200
200
|
case 'Home':
|
|
201
|
-
|
|
201
|
+
nextTab = tabs[0];
|
|
202
202
|
break;
|
|
203
203
|
case 'End':
|
|
204
|
-
|
|
204
|
+
nextTab = tabs[tabs.length - 1];
|
|
205
205
|
break;
|
|
206
206
|
}
|
|
207
|
+
if (nextTab) {
|
|
208
|
+
nextTab.focus();
|
|
209
|
+
this.scrollTabIntoView(nextTab);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
scrollTabIntoView(tab) {
|
|
213
|
+
var _a;
|
|
214
|
+
const tabsList = this.host.querySelector('r-tabs-list');
|
|
215
|
+
if (!tabsList)
|
|
216
|
+
return;
|
|
217
|
+
const container = (_a = tabsList.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.r-tabs-list--tabs-container');
|
|
218
|
+
if (!container)
|
|
219
|
+
return;
|
|
220
|
+
const containerRect = container.getBoundingClientRect();
|
|
221
|
+
const tabRect = tab.getBoundingClientRect();
|
|
222
|
+
// Check if tab is fully visible
|
|
223
|
+
const isFullyVisible = tabRect.left >= containerRect.left - 1 &&
|
|
224
|
+
tabRect.right <= containerRect.right + 1;
|
|
225
|
+
if (isFullyVisible)
|
|
226
|
+
return;
|
|
227
|
+
// Calculate scroll offset to center the tab
|
|
228
|
+
const centerOffset = (tabRect.left - containerRect.left) -
|
|
229
|
+
(containerRect.width / 2) +
|
|
230
|
+
(tabRect.width / 2);
|
|
231
|
+
container.scrollBy({
|
|
232
|
+
left: centerOffset,
|
|
233
|
+
behavior: 'smooth'
|
|
234
|
+
});
|
|
207
235
|
}
|
|
208
236
|
/** Listen for "click" event on `<r-tab>` */
|
|
209
237
|
tabChangeAction(event) {
|
|
@@ -240,7 +268,7 @@ const RTabs = class {
|
|
|
240
268
|
this._changeFocusTab(e.target, e.detail.keycode);
|
|
241
269
|
}
|
|
242
270
|
render() {
|
|
243
|
-
return (index.h(index.Host, { key: '
|
|
271
|
+
return (index.h(index.Host, { key: '0737bf78e596f8fb9d4a2ec10f1503d1072f2683', class: "r-tabs" }, index.h("slot", { key: '5bc87b17930c9ea159ef29335c6b11f0f4c7d43e' })));
|
|
244
272
|
}
|
|
245
273
|
get host() { return index.getElement(this); }
|
|
246
274
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BnETQtSf.js');
|
|
4
4
|
var formData = require('./formData-B2DZyLxP.js');
|
|
5
5
|
|
|
6
|
-
const textareaCss = ":host{opacity:1;display:block;outline:none;--r-label--margin-bottom:0}:host(:focus-visible){outline:none}:host([resize=none]){--r-textarea--input--resize:none}:host([resize=both]){--r-textarea--input--resize:both}:host([resize=horizontal]){--r-textarea--input--resize:horizontal}:host([resize=vertical]){--r-textarea--input--resize:vertical}:host([resize=initial]){--r-textarea--input--resize:initial}:host([resize=inherit]){--r-textarea--input--resize:inherit}:host([invalid]:not([invalid=false])){--r-textarea--container--background-color:var(--r-status-error-soft, #fef6f6);--r-textarea--container--border-color:var(--r-status-error-regular, #b00c15)}.r-textarea--label-container{display:var(--r-textarea--label-container--display, flex);gap:var(--r-textarea--label-container--gap, var(--r-spacing-100, 1rem));align-items:var(--r-textarea--label-container--align-items, center);justify-content:var(--r-textarea--label-container--align-items, space-between)}.r-textarea--label-container ::slotted([slot=popover]){display:var(--r-textarea--popover--display, inline-flex);height:var(--r-textarea--popover--height, var(--r-spacing-150, 1.5));align-items:var(--r-textarea--popover--align-items, center);justify-content:var(--r-textarea--popover--justify-content, center);margin-right:var(--r-textarea--popover--margin-right, -0.25rem);--r-popover--trigger--min-width:var(--r-textarea--popover-trigger--min-width, var(--r-spacing-150, 1.5))}.r-textarea--input::placeholder{color:var(--r-textarea--input--placeholder--color, var(--r-text-soft, #686868))}.r-textarea--input{vertical-align:top;width:var(--r-textarea--input--width, 100%);max-width:var(--r-textarea--input--max-width, 100%);min-height:var(--r-textarea--input--min-height, 8.875em);font-family:var(--r-textarea--input--font-family, var(--r-font-family-text, system-ui));font-weight:var(--r-textarea--input--font-weight, var(--r-font-weight-regular, 400));font-size:var(--r-textarea--input--font-size, var(--r-font-size-400, 1rem));line-height:var(--r-textarea--input--line-height, var(--r-line-height-m, 1.5));color:var(--r-textarea--input--color, var(--r-text-regular, #282828));background-color:var(--r-textarea--input--background-color, transparent);opacity:var(--r-textarea--input--opacity, 1);border-width:var(--r-textarea--input--border-width, 0px);border-style:var(--r-textarea--input--border-style, solid);border-color:var(--r-textarea--input--border-color, var(--r-border-soft, #686868));border-radius:var(--r-textarea--input--border-radius, 0);box-sizing:var(--r-textarea--input--box-sizing, border-box);box-shadow:var(--r-textarea--input--box-shadow, none);padding:var(--r-textarea--input--padding, var(--r-textarea--input--padding-top, 0.688em) var(--r-textarea--input--padding-right, 0.625em) var(--r-textarea--input--padding-bottom, 0.688em) var(--r-textarea--input--padding-left, 0.625em));margin-top:var(--r-textarea--input--margin-top, 0);resize:var(--r-textarea--input--resize, both);z-index:var(--r-textarea--input--z-index,
|
|
6
|
+
const textareaCss = ":host{opacity:1;display:block;outline:none;--r-label--margin-bottom:0}:host(:focus-visible){outline:none}:host([resize=none]){--r-textarea--input--resize:none}:host([resize=both]){--r-textarea--input--resize:both}:host([resize=horizontal]){--r-textarea--input--resize:horizontal}:host([resize=vertical]){--r-textarea--input--resize:vertical}:host([resize=initial]){--r-textarea--input--resize:initial}:host([resize=inherit]){--r-textarea--input--resize:inherit}:host([invalid]:not([invalid=false])){--r-textarea--container--background-color:var(--r-status-error-soft, #fef6f6);--r-textarea--container--border-color:var(--r-status-error-regular, #b00c15)}.r-textarea--label-container{display:var(--r-textarea--label-container--display, flex);gap:var(--r-textarea--label-container--gap, var(--r-spacing-100, 1rem));align-items:var(--r-textarea--label-container--align-items, center);justify-content:var(--r-textarea--label-container--align-items, space-between)}.r-textarea--label-container ::slotted([slot=popover]){display:var(--r-textarea--popover--display, inline-flex);height:var(--r-textarea--popover--height, var(--r-spacing-150, 1.5));align-items:var(--r-textarea--popover--align-items, center);justify-content:var(--r-textarea--popover--justify-content, center);margin-right:var(--r-textarea--popover--margin-right, -0.25rem);--r-popover--trigger--min-width:var(--r-textarea--popover-trigger--min-width, var(--r-spacing-150, 1.5))}.r-textarea--input::placeholder{color:var(--r-textarea--input--placeholder--color, var(--r-text-soft, #686868))}.r-textarea--input{vertical-align:top;width:var(--r-textarea--input--width, 100%);max-width:var(--r-textarea--input--max-width, 100%);min-height:var(--r-textarea--input--min-height, 8.875em);font-family:var(--r-textarea--input--font-family, var(--r-font-family-text, system-ui));font-weight:var(--r-textarea--input--font-weight, var(--r-font-weight-regular, 400));font-size:var(--r-textarea--input--font-size, var(--r-font-size-400, 1rem));line-height:var(--r-textarea--input--line-height, var(--r-line-height-m, 1.5));color:var(--r-textarea--input--color, var(--r-text-regular, #282828));background-color:var(--r-textarea--input--background-color, transparent);opacity:var(--r-textarea--input--opacity, 1);border-width:var(--r-textarea--input--border-width, 0px);border-style:var(--r-textarea--input--border-style, solid);border-color:var(--r-textarea--input--border-color, var(--r-border-soft, #686868));border-radius:var(--r-textarea--input--border-radius, 0);box-sizing:var(--r-textarea--input--box-sizing, border-box);box-shadow:var(--r-textarea--input--box-shadow, none);padding:var(--r-textarea--input--padding, var(--r-textarea--input--padding-top, 0.688em) var(--r-textarea--input--padding-right, 0.625em) var(--r-textarea--input--padding-bottom, 0.688em) var(--r-textarea--input--padding-left, 0.625em));margin-top:var(--r-textarea--input--margin-top, 0);resize:var(--r-textarea--input--resize, both);z-index:var(--r-textarea--input--z-index, initial);outline:var(--r-textarea--input--outline, none);outline-offset:var(--r-textarea--input--outline-offset, 0);pointer-events:var(--r-textarea--input--pointer-events, auto);cursor:var(--r-textarea--input--cursor, inherit)}.r-textarea--container{display:flex;align-items:start;overflow:visible;background-color:var(--r-textarea--container--background-color, var(--r-background-interactive-softest, #f7f7f7));border-width:var(--r-textarea--container--border-width, 1px);border-style:var(--r-textarea--container--border-style, solid);border-color:var(--r-textarea--container--border-color, var(--r-border-soft, #686868));padding:var(--r-textarea--container--padding, 0);margin-top:var(--r-textarea--container--margin-top, var(--r-spacing-025, 0.25rem));box-shadow:var(--r-textarea--container--box-shadow, none);outline:var(--r-textarea--container--outline, none);outline-offset:var(--r-textarea--container--outline-offset, none)}.r-textarea--container[data-readonly=true]{--r-textarea--container--background-color:var(--r-background-soft, #f3f1f0);--r-textarea--container--border-color:transparent transparent var(--r-border-soft, #686868) transparent;--r-textarea--container--cursor:text}.r-textarea--container:hover:not([data-disabled=true]):not([data-readonly=true]){--r-textarea--container--background-color:var(--r-background-interactive-hovered)}.r-textarea--container:active:not([data-disabled=true]):not([data-readonly=true]){--r-textarea--container--background-color:var(--r-background-interactive-pressed)}.r-textarea--container:focus-within{--r-textarea--container--box-shadow:0 0 0 6px var(--r-border-focused-outlined, #fff);--r-textarea--container--outline:2px solid var(--r-border-focused, #0071e3);--r-textarea--container--outline-offset:2px}.r-textarea--trailing{display:var(--r-textarea--trailing--display, flex);margin-top:var(--r-textarea--trailing--margin-top, 0.688em);margin-right:var(--r-textarea--trailing--margin-right, 0.625em);margin-left:var(--r-textarea--trailing--margin-left, auto);gap:var(--r-textarea--trailing--gap, 0.625rem)}.r-textarea--trailing:empty{display:none}.r-textarea--readonly-icon{color:var(--r-textarea--readonly-icon--color, var(--r-icon-soft, #686868))}.r-textarea--messages{display:flex;gap:var(--r-textarea--messages--gap, var(--r-spacing-025, 0.25rem))}.r-textarea--messages--counter{margin-left:auto}.r-textarea--messages:has(r-hint){margin-top:var(--r-spacing-025, 0.25rem)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";
|
|
7
7
|
|
|
8
8
|
const RTextarea = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BnETQtSf.js');
|
|
4
4
|
|
|
5
|
-
const toastGroupCss = "
|
|
5
|
+
const toastGroupCss = ":host([data-visually-hidden=true]){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}:host{display:var(--display, block);position:var(--position, fixed);top:var(--top, 0);right:var(--right, 0);bottom:var(--bottom, auto);left:var(--left, auto);overflow:var(--overflow, hidden);overflow-y:var(--overflow-y, auto);width:var(--width, 352px);max-height:var(--max-height, calc(100vh - 64px));padding-right:var(--padding-right, 32px);padding-top:var(--padding-top, 16px);padding-bottom:var(--padding-bottom, 32px);z-index:var(--z-index, 1)}:host ::slotted(r-toast){margin-top:var(--r-spacing-100, 1rem)}.r-toast-group{position:relative;display:var(--r-toast-group--display, flex);flex-direction:var(--r-toast-group--flex-direction, column);justify-content:var(--r-toast-group--justify-content, flex-start)}";
|
|
6
6
|
|
|
7
7
|
const ToastGroup = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -11,8 +11,17 @@ const ToastGroup = class {
|
|
|
11
11
|
this.host.setAttribute('data-visually-hidden', `${!this.hasChildren}`);
|
|
12
12
|
};
|
|
13
13
|
this.observeSlotContentChange = () => {
|
|
14
|
-
this.observer = new MutationObserver(() => {
|
|
14
|
+
this.observer = new MutationObserver(async (mutations) => {
|
|
15
|
+
var _a, _b;
|
|
15
16
|
this.updateHiddenState();
|
|
17
|
+
const addedToast = mutations
|
|
18
|
+
.flatMap(mutation => Array.from(mutation.addedNodes))
|
|
19
|
+
.find(node => node.nodeName === 'R-TOAST');
|
|
20
|
+
if (addedToast) {
|
|
21
|
+
// Measure height then reveal for smooth animation
|
|
22
|
+
await ((_a = addedToast.measureAndPrepareHeight) === null || _a === void 0 ? void 0 : _a.call(addedToast));
|
|
23
|
+
await ((_b = addedToast.reveal) === null || _b === void 0 ? void 0 : _b.call(addedToast));
|
|
24
|
+
}
|
|
16
25
|
});
|
|
17
26
|
this.observer.observe(this.host, {
|
|
18
27
|
childList: true,
|
|
@@ -28,7 +37,7 @@ const ToastGroup = class {
|
|
|
28
37
|
this.observeSlotContentChange();
|
|
29
38
|
}
|
|
30
39
|
render() {
|
|
31
|
-
return (index.h(index.Host, { key: '
|
|
40
|
+
return (index.h(index.Host, { key: '85ab80be1fca1d1a9c3dc2e17de616747748a4dd' }, index.h("div", { key: 'a88670978563caeb8f500f4b5f9af2bcd0ade386', class: "r-toast-group" }, index.h("slot", { key: 'ab1480a47cfae0cacc45de708d51e8a77b6dfb85' }))));
|
|
32
41
|
}
|
|
33
42
|
get host() { return index.getElement(this); }
|
|
34
43
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BnETQtSf.js');
|
|
4
4
|
|
|
5
|
-
const toastCss = ":host([status=info]){--r-toast--border-color:var(--r-status-info-regular, #3e5c73);--r-toast--background-color:var(--r-status-info-soft, #f8fafb);--r-toast--leading-icon--color:var(--r-status-info-regular, #3e5c73)}:host([status=warning]){--r-toast--border-color:var(--r-status-warning-regular, #ff7429);--r-toast--background-color:var(--r-status-warning-soft, #fef9f5);--r-toast--leading-icon--color:var(--r-status-warning-regular, #89411A)}:host([status=error]){--r-toast--border-color:var(--r-status-error-regular, #b00c15);--r-toast--background-color:var(--r-status-error-soft, #fef6f6);--r-toast--leading-icon--color:var(--r-status-error-regular, #b00c15)}:host([status=success]){--r-toast--border-color:var(--r-status-success-regular, #298535);--r-toast--background-color:var(--r-status-success-soft, #f7fdf8);--r-toast--leading-icon--color:var(--r-status-success-regular, #298535)}:host([is-content=false]){--r-toast--content--display:none}:host([headline]){--r-toast--content--margin-top:var(--r-spacing-050, 0.5rem)}:host([data-visually-hidden=true]){--r-toast--host--
|
|
5
|
+
const toastCss = ":host([status=info]){--r-toast--border-color:var(--r-status-info-regular, #3e5c73);--r-toast--background-color:var(--r-status-info-soft, #f8fafb);--r-toast--leading-icon--color:var(--r-status-info-regular, #3e5c73)}:host([status=warning]){--r-toast--border-color:var(--r-status-warning-regular, #ff7429);--r-toast--background-color:var(--r-status-warning-soft, #fef9f5);--r-toast--leading-icon--color:var(--r-status-warning-regular, #89411A)}:host([status=error]){--r-toast--border-color:var(--r-status-error-regular, #b00c15);--r-toast--background-color:var(--r-status-error-soft, #fef6f6);--r-toast--leading-icon--color:var(--r-status-error-regular, #b00c15)}:host([status=success]){--r-toast--border-color:var(--r-status-success-regular, #298535);--r-toast--background-color:var(--r-status-success-soft, #f7fdf8);--r-toast--leading-icon--color:var(--r-status-success-regular, #298535)}:host([is-content=false]){--r-toast--content--display:none}:host([headline]){--r-toast--content--margin-top:var(--r-spacing-050, 0.5rem)}:host([data-visually-hidden=true]){--r-toast--host--animation-duration:0.2s;--r-toast--host--animation-name:fade-out}:host(:not(:last-child)){margin-bottom:var(--r-toast-group--spacing, 0)}:host{animation-duration:var(--r-toast--host--animation-duration, 0.3s);animation-fill-mode:var(--r-toast--host--animation-fill-mode, forwards);animation-name:var(--r-toast--host--animation-name, fade-in);box-sizing:var(--r-toast--host--box-sizing, border-box);display:var(--r-toast--host--display, block);height:var(--r-toast--host--height, var(--r-toast--host--height-expanded, auto));opacity:var(--r-toast--host--opacity, 1);overflow:var(--r-toast--host--overflow, hidden);position:var(--r-toast--host--position, relative);transition:var(--r-toast--host--transition, none);transition-delay:var(--r-toast--host--transition-delay, 0s)}:host ::slotted(p){margin:0}:host ::slotted(p+p),:host ::slotted(p+ul),:host ::slotted(p+ol){margin-top:1rem}:host .r-toast--trailing-button{--r-button--width:2.75rem;--r-button--height:2.75rem;--r-button--color:var(--r-text-regular, #282828);--r-button--border-color:transparent;--r-button--background-color:transparent;position:relative;margin-top:-8px;margin-right:-8px}:host .r-toast--trailing-button:hover{--r-button--color:var(--r-text-strong, #000000);--r-button--background-color:var(--r-background-interactive-hovered, #000000)}:host .r-toast--trailing-button:active{--r-button--transform:scale(0.94)}@media (prefers-reduced-motion){:host{transition:none;animation-name:none}}@keyframes fade-in{from{opacity:0;max-height:0}to{opacity:1;max-height:var(--r-toast--host--height-expanded)}}@keyframes fade-out{from{opacity:1;max-height:var(--r-toast--host--height-expanded);margin-top:var(--r-spacing-100, 1rem)}to{opacity:0;max-height:0;margin-top:0}}.r-toast{font-family:var(--r-toast--font-family, var(--r-font-family-text, system-ui));font-size:var(--r-toast--font-size, var(--r-font-size-400, 1rem));display:var(--r-toast--display, flex);flex-direction:var(--r-toast--flex-direction, row);align-items:var(--r-toast--align-items, stretch);gap:var(--r-toast--gap, var(--r-spacing-050, 0.5rem));padding:var(--r-toast--padding, 12px);border-width:var(--r-toast--border-width, 1px);border-style:var(--r-toast--border-style, solid);border-color:var(--r-toast--border-color, var(--r-status-info-regular, #3e5c73));background-color:var(--r-toast--background-color, var(--r-status-info-soft, #f8fafb));box-sizing:var(--r-toast--box-sizing, border-box);transition:var(--r-toast--transition, none)}.r-toast--main{flex:var(--r-toast--content--flex, 1);word-break:var(--r-toast--content--word-break, break-word)}.r-toast--leading-icon{color:var(--r-toast--leading-icon--color, var(--r-status-info-regular, #3e5c73));margin-top:var(--r-toast--leading-icon--margin-top, 0);margin-right:var(--r-toast--leading-icon--margin-right, var(--r-spacing-025, 0.25rem))}.r-toast--headline{color:var(--r-toast--headline--color, var(--r-text-regular, #282828));font-size:var(--r-toast--headline--font-size, var(--r-font-size-400, 1rem));font-weight:var(--r-toast--headline--font-weight, var(--r-font-weight-semibold, 600));line-height:var(--r-toast--headline--line-height, var(--r-line-height-m, 1.5));margin:var(--r-toast--headline--margin, 0)}.r-toast--content{display:var(--r-toast--content--display, block);color:var(--r-toast--content--color, var(--r-text-regular, #282828));line-height:var(--r-toast--content--line-height, var(--r-line-height-m, 1.5));font-size:var(--r-toast--content--font-size, var(--r-font-size-300, 0.875rem));font-weight:var(--r-toast--content--font-weight, var(--r-font-weight-regular, 400));margin-top:var(--r-toast--content--margin-top, 0);word-break:var(--r-toast--content--word-break, break-word)}.r-toast--action{display:var(--r-toast--action--display, flex);margin-top:var(--r-toast--action--margin-top, var(--r-spacing-050, 0.5rem));color:var(--r-toast--action--color, var(--r-text-regular, #282828));font-size:var(--r-toast--action--font-size, var(--r-font-size-300, 0.875rem));font-weight:var(--r-toast--action--font-weight, var(--r-font-weight-light, 300))}.r-toast--action-link,.r-toast--action ::slotted(r-button){--r-button--background-color:transparent;--r-button--border-width:0;--r-button--color:var(--r-text-regular);--r-button--padding:10px 2px 18px 2px;--r-button--slot--text-decoration:underline;--r-button--slot--text-underline-offset:9px}.r-toast--action-link:hover,.r-toast--action ::slotted(r-button:hover:not([disabled]):not([disabled=true])){--r-button--background-color:var(--r-background-interactive-hovered)}.r-toast--action-link:active,.r-toast--action ::slotted(r-button:active:not([disabled]):not([disabled=true])){--r-button--background-color:var(--r-background-interactive-pressed)}.r-toast--action ::slotted(*){font-size:inherit;color:inherit}.r-toast--action ::slotted(a){color:var(--r-toast--action--color, var(--r-text-regular, #282828))}";
|
|
6
6
|
|
|
7
7
|
const Toast = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -11,6 +11,7 @@ const Toast = class {
|
|
|
11
11
|
this.toastDismiss = index.createEvent(this, "dismiss");
|
|
12
12
|
this.toastReveal = index.createEvent(this, "reveal");
|
|
13
13
|
this.toastHide = index.createEvent(this, "hide");
|
|
14
|
+
this.toastDismissed = index.createEvent(this, "dismissed");
|
|
14
15
|
/**
|
|
15
16
|
* Controls if toast is initially shown.
|
|
16
17
|
* */
|
|
@@ -51,6 +52,7 @@ const Toast = class {
|
|
|
51
52
|
* @default 300
|
|
52
53
|
* */
|
|
53
54
|
this.delayBeforeRemoval = 300;
|
|
55
|
+
this.animationCompleted = false;
|
|
54
56
|
/** Unique id for each accordion item/row */
|
|
55
57
|
this.uniqueId = `r-toast-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
56
58
|
this.hasElContent = (selector) => {
|
|
@@ -69,6 +71,22 @@ const Toast = class {
|
|
|
69
71
|
clearTimeout(this.delayTimer);
|
|
70
72
|
}, time);
|
|
71
73
|
};
|
|
74
|
+
this.handleAnimationEnd = (event) => {
|
|
75
|
+
if (event.animationName === 'fade-out') {
|
|
76
|
+
this.animationCompleted = true;
|
|
77
|
+
// Only emit if still connected to DOM
|
|
78
|
+
if (this.host.isConnected) {
|
|
79
|
+
this.toastDismissed.emit();
|
|
80
|
+
}
|
|
81
|
+
// Clear height after fade-out completes as final cleanup
|
|
82
|
+
this.host.style.setProperty('--r-toast--host--height-expanded', null);
|
|
83
|
+
}
|
|
84
|
+
else if (event.animationName === 'fade-in') {
|
|
85
|
+
// Clear height restriction after fade-in completes to allow natural resizing
|
|
86
|
+
// The toast can now grow/shrink dynamically without animation constraints
|
|
87
|
+
this.host.style.setProperty('--r-toast--host--height-expanded', null);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
72
90
|
this.handleTrailingButtonClick = () => {
|
|
73
91
|
this.rClickToastTrailingIcon.emit();
|
|
74
92
|
this.dismiss();
|
|
@@ -83,12 +101,29 @@ const Toast = class {
|
|
|
83
101
|
* hide the toast before the auto-dismiss timer expires.
|
|
84
102
|
*/
|
|
85
103
|
async dismiss() {
|
|
86
|
-
|
|
104
|
+
// Re-measure height before fade-out to ensure smooth collapse animation
|
|
105
|
+
// This captures the current natural height for the animation
|
|
106
|
+
this.updateHeightVariable();
|
|
87
107
|
this.isOpen = false;
|
|
88
108
|
this.toastDismiss.emit();
|
|
109
|
+
this.animationCompleted = false;
|
|
89
110
|
if (this.removalTimer)
|
|
90
111
|
clearTimeout(this.removalTimer);
|
|
91
|
-
this.removalTimer = setTimeout(() =>
|
|
112
|
+
this.removalTimer = setTimeout(() => {
|
|
113
|
+
if (!this.animationCompleted && this.host.isConnected) {
|
|
114
|
+
this.toastDismissed.emit();
|
|
115
|
+
}
|
|
116
|
+
// Safely remove from DOM - check parent exists and contains this element
|
|
117
|
+
if (this.host.isConnected && this.host.parentNode) {
|
|
118
|
+
try {
|
|
119
|
+
this.host.remove();
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
// In test environments, element may have already been removed
|
|
123
|
+
// or DOM structure changed - silently ignore
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}, this.delayBeforeRemoval);
|
|
92
127
|
}
|
|
93
128
|
/**
|
|
94
129
|
* Reveals the toast notification by setting it to a visible state.
|
|
@@ -96,27 +131,60 @@ const Toast = class {
|
|
|
96
131
|
* automatically dismiss the toast after the specified duration.
|
|
97
132
|
*/
|
|
98
133
|
async reveal() {
|
|
134
|
+
// Measure height for smooth fade-in animation
|
|
135
|
+
await this.measureAndPrepareHeight();
|
|
99
136
|
this.isOpen = true;
|
|
100
|
-
|
|
137
|
+
// Only emit if still connected to DOM
|
|
138
|
+
if (this.host.isConnected) {
|
|
139
|
+
this.toastReveal.emit();
|
|
140
|
+
}
|
|
101
141
|
if (this.delayTimer)
|
|
102
142
|
clearTimeout(this.delayTimer);
|
|
103
143
|
if (this.isDismissManual)
|
|
104
144
|
return;
|
|
105
145
|
if (this.hasDelay)
|
|
106
146
|
this.startDelayTimer();
|
|
147
|
+
return this;
|
|
107
148
|
}
|
|
108
149
|
/**
|
|
109
150
|
* Hides toast, keeps it in dom.
|
|
110
151
|
* */
|
|
111
152
|
async hide() {
|
|
153
|
+
this.updateHeightVariable();
|
|
112
154
|
this.isOpen = false;
|
|
113
|
-
|
|
155
|
+
// Only emit if still connected to DOM
|
|
156
|
+
if (this.host.isConnected) {
|
|
157
|
+
this.toastHide.emit();
|
|
158
|
+
}
|
|
159
|
+
return this;
|
|
114
160
|
}
|
|
115
161
|
/**
|
|
116
162
|
* Toggles visibility of the toast.
|
|
117
163
|
* */
|
|
118
164
|
async toggle() {
|
|
119
165
|
this.isOpen ? this.hide() : this.reveal();
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Measures the natural height of toast and prepares it for reveal animation.
|
|
170
|
+
* This should be called on newly added toasts before they are revealed.
|
|
171
|
+
*/
|
|
172
|
+
async measureAndPrepareHeight() {
|
|
173
|
+
return new Promise((resolve) => {
|
|
174
|
+
requestAnimationFrame(() => {
|
|
175
|
+
// Temporarily override animation to prevent visual glitches during measurement
|
|
176
|
+
const tempStyle = this.host.style.cssText;
|
|
177
|
+
this.host.style.cssText = tempStyle + '; animation: none !important; max-height: none !important; height: auto !important;';
|
|
178
|
+
const height = this.host.scrollHeight;
|
|
179
|
+
// Restore original style
|
|
180
|
+
this.host.style.cssText = tempStyle;
|
|
181
|
+
// Set the measured height for animation
|
|
182
|
+
if (height > 0) {
|
|
183
|
+
this.host.style.setProperty('--r-toast--host--height-expanded', `${height}px`);
|
|
184
|
+
}
|
|
185
|
+
resolve();
|
|
186
|
+
});
|
|
187
|
+
});
|
|
120
188
|
}
|
|
121
189
|
handleOpenChange() {
|
|
122
190
|
this.isOpen ? this.hide() : this.reveal();
|
|
@@ -178,7 +246,28 @@ const Toast = class {
|
|
|
178
246
|
}
|
|
179
247
|
}
|
|
180
248
|
componentWillLoad() {
|
|
181
|
-
|
|
249
|
+
// Set initial state but don't trigger reveal yet - let mutation observer handle it
|
|
250
|
+
this.isOpen = this.open;
|
|
251
|
+
}
|
|
252
|
+
async componentDidLoad() {
|
|
253
|
+
this.host.addEventListener('animationend', this.handleAnimationEnd);
|
|
254
|
+
// Measure and store the toast height for smooth initial fade-in animation
|
|
255
|
+
await this.measureAndPrepareHeight();
|
|
256
|
+
// Start auto-dismiss timer if configured and toast is initially open
|
|
257
|
+
if (this.isOpen && !this.isDismissManual && this.hasDelay) {
|
|
258
|
+
this.startDelayTimer();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
updateHeightVariable() {
|
|
262
|
+
// Use requestAnimationFrame to ensure the element is fully rendered
|
|
263
|
+
requestAnimationFrame(() => {
|
|
264
|
+
if (this.host.offsetHeight > 0) {
|
|
265
|
+
this.host.style.setProperty('--r-toast--host--height-expanded', `${this.host.offsetHeight}px`);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
disconnectedCallback() {
|
|
270
|
+
this.host.removeEventListener('animationend', this.handleAnimationEnd);
|
|
182
271
|
}
|
|
183
272
|
render() {
|
|
184
273
|
const { headline, href, action, target, trailingIcon } = this;
|
|
@@ -198,14 +287,14 @@ const Toast = class {
|
|
|
198
287
|
name: trailingIcon,
|
|
199
288
|
size: 'm'
|
|
200
289
|
};
|
|
201
|
-
return (index.h(index.Host, Object.assign({ key: '
|
|
202
|
-
index.h("div", { key: '
|
|
203
|
-
index.h("h2", { key: '
|
|
204
|
-
index.h("div", { key: '
|
|
205
|
-
index.h("div", { key: '
|
|
206
|
-
index.h("r-button", Object.assign({ key: '
|
|
207
|
-
index.h("div", { key: '
|
|
208
|
-
index.h("r-icon-button", Object.assign({ key: '
|
|
290
|
+
return (index.h(index.Host, Object.assign({ key: '4fa8a3d2db292941933f73437d823f3f6581d626' }, hostAttrs, { id: this.uniqueId, "data-visually-hidden": `${this.isOpen ? 'false' : 'true'}`, style: { visibility: this.isOpen ? 'visible' : 'hidden' } }), index.h("div", { key: '20506092a2459d836918da00f1670cf18730a42c', class: "r-toast" }, this.hasLeading &&
|
|
291
|
+
index.h("div", { key: '384ce331ff3825bc01323bbb6f3972ccd4198223', class: "r-toast--leading" }, this.hasLeadingSlot && index.h("slot", { key: 'eb455c5729d37431b8576dfcaff6eceead5000bb', name: "leading" }), this.leadingIconVisible && index.h("r-icon", Object.assign({ key: '3b0b3e9d9516a072d5c3b5ca50ab3353cdf20053', class: "r-toast--leading-icon" }, leadingIconAttrs))), index.h("div", { key: 'dcfc949dda66a2437cbb4b3e2847266e55ab83d6', class: "r-toast--main" }, this.hasHeadline &&
|
|
292
|
+
index.h("h2", { key: 'c1abf4f2b6abc7b53db6727ff09f027d4b2a940d', class: "r-toast--headline" }, index.h("slot", { key: '9b6a57199eac2a4e0f96d38cc0b3d02adc2bb279', name: "headline" }, headline)), this.hasContent &&
|
|
293
|
+
index.h("div", { key: '6c182bd58efe6cd404ae7b20ee2464f3965b889d', class: "r-toast--content r-typography" }, index.h("slot", { key: 'a49fd6e859f1b512069fc3bed9c0c21da35d78cc', onSlotchange: this.handleSlotChange })), this.hasAction &&
|
|
294
|
+
index.h("div", { key: 'b0282c4677483b96b3eac7ddbdb2e13ae245ebe2', class: "r-toast--action" }, index.h("slot", { key: 'e267d02a4e39a443865c1c0a62f3d6ed06e2a319', name: "action" }, this.hasActionLink &&
|
|
295
|
+
index.h("r-button", Object.assign({ key: '8785094717619bd69c5e711873598b2fb7eeb5be', class: "r-toast--action-link", variant: "text-inline", size: "small" }, actionAttrs), action)))), this.hasTrailing &&
|
|
296
|
+
index.h("div", { key: '066ecbc6346ed516aa9dd193505a26544bbdf92f', class: "r-toast--trailing" }, this.hasTrailingSlot && index.h("slot", { key: '890fd983d1208ea514b89aeaf394ae82c1d1ec55', name: "trailing" }), this.isDismissManual &&
|
|
297
|
+
index.h("r-icon-button", Object.assign({ key: '2b9e06adc46cf1a726d5d78f7cedb2d1405b4c72' }, trailingIconAttrs, { class: "r-toast--trailing-button", onClick: this.handleTrailingButtonClick, label: this.dismissLabel }), index.h("slot", { key: '7349c7b3422f194852609c2cdf150a5dc4498aa9', name: "dismiss" }))))));
|
|
209
298
|
}
|
|
210
299
|
get host() { return index.getElement(this); }
|
|
211
300
|
static get watchers() { return {
|