lightning-base-components 1.18.5-alpha → 1.18.6-alpha
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/package.json +3 -2
- package/src/lightning/button/button.js +3 -2
- package/src/lightning/f6Controller/f6Controller.js +49 -3
- package/src/lightning/formattedRichText/formatted-rich-text.slds.css +1 -1
- package/src/lightning/formattedRichText/formattedRichText.css +1 -0
- package/src/lightning/formattedRichText/formattedRichText.html +1 -1
- package/src/lightning/formattedRichText/formattedRichText.js +1 -0
- package/src/lightning/layout/layout.js +2 -0
- package/src/lightning/layoutItem/layoutItem.js +2 -0
- package/src/lightning/primitiveButton/primitiveButton.js +8 -8
- package/src/lightning/sldsCommon/sldsCommon.css +14 -6
- package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.css +4 -4
- package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.css +50 -19
- package/src/lightning/spinner/spinner.js +7 -3
- package/src/lightning/tab/tab.js +14 -22
- package/src/lightning/tabset/tabset.js +10 -28
- package/src/lightning/toast/button-icon.slds.css +909 -0
- package/src/lightning/toast/formatted-rich-text.slds.css +230 -0
- package/src/lightning/toast/icon.slds.css +209 -0
- package/src/lightning/toast/toast.css +22 -6
- package/src/lightning/toast/toast.html +1 -1
- package/src/lightning/toast/toast.js +9 -7
- package/src/lightning/toast/toast.slds.css +97 -0
- package/src/lightning/toastContainer/toast.slds.css +97 -0
- package/src/lightning/toastContainer/toastContainer.css +17 -6
- package/src/lightning/toastContainer/toastContainer.js +4 -0
- package/src/lightning/utilsPrivate/url.js +4 -1
- package/src/lightning/utilsPrivate/utilsPrivate.js +8 -4
- package/src/lightning/tab/tab.css +0 -2
- package/src/lightning/tab/tab.slds.css +0 -47
- package/src/lightning/tabset/tabset.css +0 -10
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
|
|
2
|
+
:host([data-render-mode="shadow"]) .slds-notify_toast {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
position: relative;
|
|
6
|
+
background: none;
|
|
7
|
+
background-color: var(--slds-c-toast-color-background, var(--sds-g-color-neutral-base-50, #747474));
|
|
8
|
+
color: var(--slds-c-toast-text-color, var(--sds-g-color-neutral-base-100, #ffffff));
|
|
9
|
+
border-radius: var(--slds-c-toast-radius-border, var(--sds-g-radius-border-2, 0.25rem));
|
|
10
|
+
margin: var(--sds-g-spacing-2, 0.5rem);
|
|
11
|
+
padding-block-start: var(--slds-c-toast-spacing-block-start, var(--sds-g-spacing-3, 0.75rem));
|
|
12
|
+
padding-inline-end: var(--slds-c-toast-spacing-inline-end, var(--sds-g-spacing-8, 3rem));
|
|
13
|
+
padding-block-end: var(--slds-c-toast-spacing-block-end, var(--sds-g-spacing-3, 0.75rem));
|
|
14
|
+
padding-inline-start: var(--slds-c-toast-spacing-inline-start, var(--sds-g-spacing-5, 1.5rem));
|
|
15
|
+
min-width: var(--slds-c-toast-sizing-min-width, var(--sds-g-sizing-16, 30rem));
|
|
16
|
+
text-align: left;
|
|
17
|
+
justify-content: flex-start;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([data-render-mode="shadow"]) .slds-notify_toast a {
|
|
21
|
+
color: currentColor;
|
|
22
|
+
border: var(--sds-g-sizing-border-1, 1px) solid transparent;
|
|
23
|
+
border-radius: var(--sds-g-radius-border-2, 0.25rem);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([data-render-mode="shadow"]) .slds-notify_toast a:hover,:host([data-render-mode="shadow"])
|
|
27
|
+
.slds-notify_toast a:focus {
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
outline: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([data-render-mode="shadow"]) .slds-notify_toast a:focus {
|
|
33
|
+
box-shadow: 0 0 3px var(--sds-g-color-neutral-base-95, #f3f3f3);
|
|
34
|
+
border: var(--sds-g-sizing-border-1, 1px) solid var(--slds-g-color-neutral-base-100, var(--sds-g-color-neutral-base-100, #ffffff));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([data-render-mode="shadow"]) .slds-notify_toast a:active {
|
|
38
|
+
color: var(--slds-g-color-neutral-100-opacity-50, rgba(255, 255, 255, 0.5));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([data-render-mode="shadow"]) .slds-notify_toast a[disabled] {
|
|
42
|
+
color: var(--slds-g-color-neutral-100-opacity-10, rgba(255, 255, 255, 0.15));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([data-render-mode="shadow"]) .slds-notify_toast .slds-notify__close {
|
|
46
|
+
float: right;
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: var(--sds-g-spacing-3, 0.75rem);
|
|
49
|
+
right: var(--sds-g-spacing-3, 0.75rem);
|
|
50
|
+
margin-inline-start: var(--sds-g-spacing-1, 0.25rem);
|
|
51
|
+
transform: translateY(-0.125rem);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([data-render-mode="shadow"]) .slds-region_narrow .slds-notify_toast {
|
|
55
|
+
min-width: auto;
|
|
56
|
+
width: 100%;
|
|
57
|
+
margin-inline-start: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* TODO W-12674349: remove after name-value-list utils are added */
|
|
61
|
+
|
|
62
|
+
:host([data-render-mode="shadow"]) .slds-list--inline {
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
max-width: 100%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* TODO W-12674349: remove after assistive text util is added */
|
|
68
|
+
|
|
69
|
+
:host([data-render-mode="shadow"]) .slds-assistive-text {
|
|
70
|
+
position: absolute !important;
|
|
71
|
+
margin: -1px !important;
|
|
72
|
+
border: 0 !important;
|
|
73
|
+
padding: 0 !important;
|
|
74
|
+
width: 1px !important;
|
|
75
|
+
height: 1px !important;
|
|
76
|
+
overflow: hidden !important;
|
|
77
|
+
clip: rect(0 0 0 0) !important;
|
|
78
|
+
text-transform: none !important;
|
|
79
|
+
white-space: nowrap !important;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* TODO W-12674349: remove after text utils are added */
|
|
83
|
+
|
|
84
|
+
:host([data-render-mode="shadow"]) .slds-text-heading_small {
|
|
85
|
+
font-size: var(--sds-g-font-size-base, 1rem);
|
|
86
|
+
line-height: var(--sds-g-font-lineheight-2, 1.25);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* TODO W-12674349: remove after alert is added */
|
|
90
|
+
|
|
91
|
+
:host([data-render-mode="shadow"]) .slds-notify__close {
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: 50%;
|
|
94
|
+
right: var(--sds-g-spacing-3, 0.75rem);
|
|
95
|
+
margin-inline-start: var(--sds-g-spacing-1, 0.25rem);
|
|
96
|
+
transform: translateY(-50%);
|
|
97
|
+
}
|
|
@@ -1,30 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
@import 'lightning/sldsCommon';
|
|
2
|
+
@import './toast.slds.css';
|
|
3
|
+
@import 'lightning/sldsUtilsPosition';
|
|
4
|
+
@import 'lightning/sldsUtilsGrid';
|
|
5
|
+
|
|
6
|
+
.top,
|
|
7
|
+
:host([data-render-mode="shadow"]) .top {
|
|
2
8
|
top: 0;
|
|
3
9
|
bottom: unset;
|
|
4
10
|
}
|
|
5
11
|
|
|
6
|
-
.bottom
|
|
12
|
+
.bottom,
|
|
13
|
+
:host([data-render-mode="shadow"]) .bottom {
|
|
7
14
|
bottom: 0;
|
|
8
15
|
top: unset;
|
|
9
16
|
}
|
|
10
17
|
|
|
11
|
-
.left
|
|
18
|
+
.left,
|
|
19
|
+
:host([data-render-mode="shadow"]) .left {
|
|
12
20
|
left: 0;
|
|
13
21
|
right: auto;
|
|
14
22
|
}
|
|
15
23
|
|
|
16
|
-
.right
|
|
24
|
+
.right,
|
|
25
|
+
:host([data-render-mode="shadow"]) .right {
|
|
17
26
|
left: auto;
|
|
18
27
|
right: 0;
|
|
19
28
|
}
|
|
20
29
|
|
|
21
|
-
.center
|
|
30
|
+
.center,
|
|
31
|
+
:host([data-render-mode="shadow"]) .center {
|
|
22
32
|
transform: translate(50%);
|
|
23
33
|
right: 50%;
|
|
24
34
|
}
|
|
25
35
|
|
|
26
36
|
@media (max-width: 30rem) {
|
|
27
|
-
.center
|
|
37
|
+
.center,
|
|
38
|
+
:host([data-render-mode="shadow"]) .center {
|
|
28
39
|
transform: none;
|
|
29
40
|
right: 0;
|
|
30
41
|
left: 0;
|
|
@@ -172,6 +172,10 @@ export default class ToastContainer extends LightningOverlay {
|
|
|
172
172
|
|
|
173
173
|
// private functions
|
|
174
174
|
connectedCallback() {
|
|
175
|
+
// Set `data-render-mode` attribute in native shadow mode
|
|
176
|
+
if (!this.template.synthetic) {
|
|
177
|
+
this.setAttribute('data-render-mode', 'shadow');
|
|
178
|
+
}
|
|
175
179
|
if (globalContainer.length < MAX_NUM_GLOBAL_TOAST_CONTAINER) {
|
|
176
180
|
this._showToastHandler = this.handleShowToast.bind(this);
|
|
177
181
|
document.body.addEventListener(
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { isCSR } from './ssr';
|
|
2
|
+
|
|
1
3
|
const URL_CHECK_REGEX = /^(\/+|\.+|ftp|http(s?):\/\/)/i;
|
|
4
|
+
const SSR_PROTOCOL = 'https:'; // For LWR (SSR), the protocol will always be HTTPS. See TD-0141280.
|
|
2
5
|
|
|
3
6
|
export function isAbsoluteUrl(url) {
|
|
4
7
|
return URL_CHECK_REGEX.test(url);
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
export function makeAbsoluteUrl(url) {
|
|
8
|
-
const protocol = window.location.protocol;
|
|
11
|
+
const protocol = isCSR ? window.location.protocol : SSR_PROTOCOL;
|
|
9
12
|
return isAbsoluteUrl(url) ? url : `${protocol}//${url}`;
|
|
10
13
|
}
|
|
11
14
|
|
|
@@ -162,10 +162,14 @@ const DEFAULT_ZINDEX_BASELINE = DEFAULT_MODAL_ZINDEX + DEFAULT_ZINDEX_OFFSET;
|
|
|
162
162
|
export function getZIndexBaseline() {
|
|
163
163
|
// When SLDS styles are present, typically on Core
|
|
164
164
|
// this currently resolves to: '9000' (string)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
// If function is called in server context, use default as window and document are not available.
|
|
166
|
+
const isCSR = typeof window !== 'undefined';
|
|
167
|
+
const modalZindexValueLwc = isCSR
|
|
168
|
+
? (
|
|
169
|
+
window.getComputedStyle(document.documentElement) ||
|
|
170
|
+
document.documentElement.style
|
|
171
|
+
).getPropertyValue('--lwc-zIndexModal')
|
|
172
|
+
: DEFAULT_MODAL_ZINDEX;
|
|
169
173
|
|
|
170
174
|
const baseZindexModalLwc = parseInt(modalZindexValueLwc, 10);
|
|
171
175
|
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
@supports (--styling-hooks: '') {
|
|
3
|
-
/* Reassignments for parity with SLDS blueprint
|
|
4
|
-
https://www.lightningdesignsystem.com/components/tabs/#Styling-Hooks-Overview */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
:host([data-render-mode="shadow"].slds-tabs_default__content) {
|
|
8
|
-
--slds-c-tabs-panel-spacing-block-start: var(--slds-c-tab-panel-spacing-block-start);
|
|
9
|
-
--slds-c-tabs-panel-spacing-block-end: var(--slds-c-tab-panel-spacing-block-end);
|
|
10
|
-
--slds-c-tabs-panel-spacing-inline-end: var(--slds-c-tab-panel-spacing-inline-end);
|
|
11
|
-
--slds-c-tabs-panel-spacing-inline-start: var(--slds-c-tab-panel-spacing-inline-start);
|
|
12
|
-
|
|
13
|
-
position: relative;
|
|
14
|
-
padding-block-start: var(--slds-c-tab-panel-spacing-block-start, var(--sds-g-spacing-3, 0.75rem));
|
|
15
|
-
padding-inline-end: var(--slds-c-tab-panel-spacing-inline-end, 0);
|
|
16
|
-
padding-block-end: var(--slds-c-tab-panel-spacing-block-end, var(--sds-g-spacing-3, 0.75rem));
|
|
17
|
-
padding-inline-start: var(--slds-c-tab-panel-spacing-inline-start, 0);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
:host([data-render-mode="shadow"].slds-tabs_scoped__content) {
|
|
21
|
-
background-color: var(--slds-g-color-neutral-base-100, var(--sds-g-color-neutral-base-100, #ffffff));
|
|
22
|
-
border: var(--sds-g-sizing-border-1, 1px) solid var(--slds-g-color-border-base-4, var(--sds-g-color-neutral-base-80, #c9c9c9));
|
|
23
|
-
border-block-start: 0;
|
|
24
|
-
border-start-start-radius: 0;
|
|
25
|
-
border-start-end-radius: 0;
|
|
26
|
-
border-end-end-radius: var(--sds-g-spacing-1, 0.25rem);
|
|
27
|
-
border-end-start-radius: var(--sds-g-spacing-1, 0.25rem);
|
|
28
|
-
padding: var(--sds-g-spacing-4, 1rem);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
:host([data-render-mode="shadow"].slds-vertical-tabs__content) {
|
|
32
|
-
flex: 1;
|
|
33
|
-
padding: var(--sds-g-spacing-4, 1rem);
|
|
34
|
-
background: var(--slds-g-color-neutral-base-100, var(--sds-g-color-neutral-base-100, #ffffff));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* TODO W-12674349: Replace with Visibility Utility Classes when available */
|
|
38
|
-
:host([data-render-mode="shadow"].slds-show) {
|
|
39
|
-
display: block;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* TODO W-12674349: Replace with Visibility Utility Classes when available */
|
|
43
|
-
:host([data-render-mode="shadow"].slds-hide) {
|
|
44
|
-
display: none !important
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* TODO W-12129682: styles are commented out for the future migration of `tabset`
|
|
2
|
-
to Native Shadow
|
|
3
|
-
|
|
4
|
-
:host([data-render-mode="shadow"]) .slds-vertical-tabs {
|
|
5
|
-
display: flex;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
border: 1px solid var(--slds-g-color-border-base-1, #e5e5e5);
|
|
8
|
-
border-radius: 0.25rem;]
|
|
9
|
-
}
|
|
10
|
-
*/
|