@salesforcedevs/dx-components 0.56.1 → 0.56.2-example
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/lwc.config.json +18 -3
- package/package.json +18 -6
- package/src/assets/icons/salesforcebrand-sprite/svg/symbols.svg +492 -111
- package/src/assets/svg/big-moon.svg +1 -0
- package/src/assets/svg/blue-circle.svg +3 -0
- package/src/assets/svg/login-widget-bg.png +0 -0
- package/src/assets/svg/subscribe-background-left.svg +14 -0
- package/src/assets/svg/subscribe-background-right.svg +11 -0
- package/src/assets/svg/trial-left.svg +6 -0
- package/src/assets/svg/trial-right.svg +26 -0
- package/src/modules/dx/banner/banner (1).ts +12 -0
- package/src/modules/dx/banner/banner.ts +3 -5
- package/src/modules/dx/button/button.css +10 -9
- package/src/modules/dx/buttonToggle/buttonToggle.css +50 -0
- package/src/modules/dx/buttonToggle/buttonToggle.html +17 -0
- package/src/modules/dx/buttonToggle/buttonToggle.ts +75 -0
- package/src/modules/dx/cardCallout/cardCallout.ts +8 -4
- package/src/modules/dx/cardContent/cardContent.html +4 -1
- package/src/modules/dx/cardDocs/cardDocs.html +4 -1
- package/src/modules/dx/cardEvent/cardEvent.html +1 -2
- package/src/modules/dx/cardEvent/cardEvent.ts +1 -1
- package/src/modules/dx/cardExpanded/cardExpanded.html +1 -6
- package/src/modules/dx/cardExpanded/cardExpanded.ts +2 -2
- package/src/modules/dx/cardMinimal/cardMinimal.html +1 -6
- package/src/modules/dx/cardTrial/cardTrial.css +63 -4
- package/src/modules/dx/cardTrial/cardTrial.html +96 -12
- package/src/modules/dx/cardTrial/cardTrial.ts +70 -2
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.css +149 -0
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.html +85 -0
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.ts +67 -0
- package/src/modules/dx/checkbox/checkbox.css +4 -0
- package/src/modules/dx/codeBlock/codeBlock.ts +5 -1
- package/src/modules/dx/dropdown/dropdown.html +5 -1
- package/src/modules/dx/dropdown/dropdown.ts +13 -3
- package/src/modules/dx/dropdownOption/dropdownOption.css +119 -1
- package/src/modules/dx/dropdownOption/dropdownOption.html +4 -0
- package/src/modules/dx/dropdownOption/dropdownOption.ts +20 -7
- package/src/modules/dx/feature/feature.ts +3 -3
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +84 -18
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +109 -99
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +27 -7
- package/src/modules/dx/featuresList/featuresList.css +1 -1
- package/src/modules/dx/filterMenu/filterMenu.css +26 -8
- package/src/modules/dx/filterMenu/filterMenu.html +24 -8
- package/src/modules/dx/filterMenu/filterMenu.ts +1 -0
- package/src/modules/dx/footer/footer.css +1 -1
- package/src/modules/dx/footer/footer.html +25 -20
- package/src/modules/dx/footer/footer.ts +19 -15
- package/src/modules/dx/footer/links.ts +115 -39
- package/src/modules/dx/formattedDateTime/formattedDateTime.ts +8 -3
- package/src/modules/dx/header/header.html +10 -3
- package/src/modules/dx/header/header.ts +4 -0
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.css +1 -0
- package/src/modules/dx/headerSearch/headerSearch.html +0 -1
- package/src/modules/dx/hr/hr.css +2 -4
- package/src/modules/dx/iconBadge/iconBadge.css +12 -0
- package/src/modules/dx/iconBadge/iconBadge.html +2 -7
- package/src/modules/dx/iconBadge/iconBadge.ts +15 -5
- package/src/modules/dx/imageAndLabel/imageAndLabel.css +0 -1
- package/src/modules/dx/input/input.css +17 -1
- package/src/modules/dx/input/input.html +5 -1
- package/src/modules/dx/input/input.ts +8 -0
- package/src/modules/dx/interactiveImage/interactiveImage.css +59 -0
- package/src/modules/dx/interactiveImage/interactiveImage.html +32 -0
- package/src/modules/dx/interactiveImage/interactiveImage.ts +71 -0
- package/src/modules/dx/logo/logo.css +0 -1
- package/src/modules/dx/logo/logo.ts +1 -1
- package/src/modules/dx/metadataBadge/metadataBadge.css +41 -0
- package/src/modules/dx/metadataBadge/metadataBadge.html +5 -0
- package/src/modules/dx/metadataBadge/metadataBadge.ts +24 -0
- package/src/modules/dx/modal/modal.css +40 -0
- package/src/modules/dx/modal/modal.html +10 -0
- package/src/modules/dx/modal/modal.ts +50 -0
- package/src/modules/dx/modalDrawer/modalDrawer.html +2 -2
- package/src/modules/dx/modalDrawer/modalDrawer.ts +7 -1
- package/src/modules/dx/pagination/pagination.css +1 -2
- package/src/modules/dx/popover/popover.css +28 -3
- package/src/modules/dx/popover/popover.html +1 -0
- package/src/modules/dx/popover/popover.ts +83 -44
- package/src/modules/dx/searchResults/coveo.css +18989 -0
- package/src/modules/dx/searchResults/searchResults.css +387 -0
- package/src/modules/dx/searchResults/searchResults.html +104 -0
- package/src/modules/dx/searchResults/searchResults.ts +187 -0
- package/src/modules/dx/section/section.css +10 -1
- package/src/modules/dx/section/section.ts +1 -1
- package/src/modules/dx/select/select.css +7 -3
- package/src/modules/dx/sidebar/sidebar.css +1 -145
- package/src/modules/dx/sidebar/sidebar.ts +2 -0
- package/src/modules/dx/sidebarOld/sidebarOld.css +1 -145
- package/src/modules/dx/sidebarOld/sidebarOld.ts +2 -0
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +23 -3
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.css +1 -1
- package/src/modules/dx/tab/tab.css +0 -4
- package/src/modules/dx/tabPanel/tabPanel.css +20 -0
- package/src/modules/dx/tabPanel/tabPanel.html +13 -0
- package/src/modules/dx/tabPanel/tabPanel.ts +27 -0
- package/src/modules/dx/tabPanelItem/tabPanelItem.css +39 -0
- package/src/modules/dx/tabPanelItem/tabPanelItem.html +15 -0
- package/src/modules/dx/tabPanelItem/tabPanelItem.ts +39 -0
- package/src/modules/dx/tabPanelList/tabPanelList.css +35 -0
- package/src/modules/dx/tabPanelList/tabPanelList.html +47 -0
- package/src/modules/dx/tabPanelList/tabPanelList.ts +164 -0
- package/src/modules/dx/tabPanelList/uniqueId.ts +6 -0
- package/src/modules/dx/tbidAvatarButton/tbidAvatarButton.css +33 -0
- package/src/modules/dx/tbidAvatarButton/tbidAvatarButton.html +53 -0
- package/src/modules/dx/tbidAvatarButton/tbidAvatarButton.ts +440 -0
- package/src/modules/dx/toc/toc.css +1 -0
- package/src/modules/dx/toc/toc.ts +13 -0
- package/src/modules/dx/treeItem/treeItem.html +2 -0
- package/src/modules/dx/treeItem/treeItem.ts +8 -6
- package/src/modules/dx/treeTile/treeTile.css +18 -18
- package/src/modules/dx/treeTile/treeTile.html +5 -4
- package/src/modules/dx/treeTile/treeTile.ts +17 -3
- package/src/modules/dx/typeBadge/typeBadge.css +15 -56
- package/src/modules/dx/typeBadge/typeBadge.html +6 -0
- package/src/modules/dx/typeBadge/typeBadge.ts +149 -46
- package/src/modules/dxBaseElements/archiveCard/archiveCard.ts +2 -6
- package/src/modules/dxBaseElements/headerBase/headerBase.ts +11 -1
- package/src/modules/dxConstants/brands/brands.ts +14 -0
- package/src/modules/dxConstants/colors/colors.ts +14 -0
- package/src/modules/dxConstants/contentTypes/contentTypes.ts +10 -0
- package/src/modules/dxHelpers/card/card.css +1 -1
- package/src/modules/dxHelpers/commonHeader/commonHeader.css +4 -3
- package/src/modules/dxHelpers/commonSidebar/commonSidebar.css +145 -0
- package/src/modules/dxHelpers/{sidebar/sidebar.css → commonTreeItem/commonTreeItem.css} +0 -0
- package/src/modules/dxUtils/async/async.ts +45 -0
- package/src/modules/dxUtils/constants/constants.ts +0 -13
- package/src/modules/dxUtils/css/css.ts +10 -0
- package/src/modules/dxUtils/lwc/lwc.ts +9 -0
- package/src/modules/dxUtils/prismjs/prismjs.ts +347 -9
- package/src/modules/dxUtils/queryCoordinator/queryCoordinator.ts +37 -11
- package/LICENSE +0 -12
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.css +0 -12
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.html +0 -11
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.ts +0 -18
|
@@ -1,33 +1,6 @@
|
|
|
1
1
|
@import "dxHelpers/reset";
|
|
2
2
|
|
|
3
|
-
.
|
|
4
|
-
align-items: center;
|
|
5
|
-
background: var(--dx-c-type-badge-background, var(--background));
|
|
6
|
-
border-radius: var(--dx-c-type-badge-border-radius, var(--border-radius));
|
|
7
|
-
color: var(--dx-c-type-badge-color, var(--color));
|
|
8
|
-
display: flex;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
height: var(--dx-c-type-badge-height, var(--height));
|
|
11
|
-
text-align: center;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
width: min-content;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.typebadge.typebadge_metadata {
|
|
17
|
-
--background: var(--dx-g-cloud-blue-natural-90);
|
|
18
|
-
--border-radius: var(--dx-g-spacing-xs);
|
|
19
|
-
--color: var(--dx-g-blue-vibrant-20);
|
|
20
|
-
--height: var(--dx-g-spacing-md);
|
|
21
|
-
--horizontal-spacing: var(--dx-g-spacing-sm);
|
|
22
|
-
|
|
23
|
-
font-family: var(--dx-g-font-display);
|
|
24
|
-
font-size: 10px;
|
|
25
|
-
letter-spacing: 0.6px;
|
|
26
|
-
text-transform: var(--dx-c-type-badge-text-transform, uppercase);
|
|
27
|
-
padding: 0 var(--horizontal-spacing);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.typebadge.typebadge_content-type {
|
|
3
|
+
.badge {
|
|
31
4
|
--background: var(--sds-g-gray-3);
|
|
32
5
|
--border-radius: var(--dx-g-spacing-smd);
|
|
33
6
|
--color: var(--sds-g-gray-10);
|
|
@@ -35,40 +8,26 @@
|
|
|
35
8
|
--horizontal-spacing: var(--dx-g-spacing-smd);
|
|
36
9
|
--vertical-spacing: var(--dx-g-spacing-xs);
|
|
37
10
|
|
|
11
|
+
color: var(--dx-c-type-badge-color, var(--color));
|
|
12
|
+
background: var(--dx-c-type-badge-background, var(--background));
|
|
13
|
+
border-radius: var(--border-radius);
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
height: var(--height);
|
|
18
|
+
width: min-content;
|
|
19
|
+
text-align: center;
|
|
20
|
+
white-space: nowrap;
|
|
38
21
|
font-family: var(--dx-g-font-sans);
|
|
39
|
-
font-size:
|
|
22
|
+
font-size: 10px;
|
|
40
23
|
font-weight: var(--dx-g-font-bold);
|
|
41
24
|
padding: var(--vertical-spacing) var(--horizontal-spacing);
|
|
42
25
|
}
|
|
43
26
|
|
|
44
|
-
.
|
|
27
|
+
.badge.size-small {
|
|
45
28
|
--height: var(--dx-g-spacing-mlg);
|
|
46
|
-
--horizontal-spacing: var(--dx-g-spacing-sm);
|
|
47
|
-
|
|
48
|
-
font-size: 10px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.typebadge.typebadge_metadata.size-small {
|
|
52
|
-
--height: var(--dx-g-spacing-md);
|
|
53
|
-
--horizontal-spacing: var(--dx-g-spacing-xs);
|
|
54
|
-
|
|
55
|
-
font-size: 8px;
|
|
56
|
-
letter-spacing: 0.5px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.typebadge.typebadge_metadata span {
|
|
60
|
-
transform: translateY(2px);
|
|
61
|
-
width: var(--dx-c-type-badge-text-width, unset);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.typebadge.typebadge_metadata.size-small span {
|
|
65
|
-
transform: translateY(1px);
|
|
66
29
|
}
|
|
67
30
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
height: var(--dx-g-spacing-lg);
|
|
71
|
-
padding: 0 var(--dx-g-spacing-sm);
|
|
72
|
-
font-size: var(--dx-g-text-2xs);
|
|
73
|
-
}
|
|
31
|
+
dx-icon {
|
|
32
|
+
margin-right: var(--dx-g-spacing-sm);
|
|
74
33
|
}
|
|
@@ -1,65 +1,168 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
Brand,
|
|
5
5
|
Color,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
ContentType,
|
|
7
|
+
IconSprite,
|
|
8
|
+
IconSymbol,
|
|
9
|
+
TypeBadgeSize
|
|
9
10
|
} from "typings/custom";
|
|
10
|
-
import { colorToDxColors } from "dxUtils/css";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
import { colorToDxColors, buildStyleColorVariables } from "dxUtils/css";
|
|
12
|
+
import { BRANDS } from "dxConstants/brands";
|
|
13
|
+
import { CONTENT_TYPES } from "dxConstants/contentTypes";
|
|
14
|
+
|
|
15
|
+
const contentTypeLabels = {
|
|
16
|
+
documentation: "Documentation",
|
|
17
|
+
trailhead: "Trailhead",
|
|
18
|
+
blog: "Blog",
|
|
19
|
+
forum: "Forum",
|
|
20
|
+
api: "API",
|
|
21
|
+
event: "Event",
|
|
22
|
+
website: "Website",
|
|
23
|
+
podcast: "Podcast"
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type IconData = {
|
|
27
|
+
iconSymbol: IconSymbol;
|
|
28
|
+
iconSprite: IconSprite;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const contentTypeIcons: {
|
|
32
|
+
[K in ContentType]: IconData;
|
|
33
|
+
} = {
|
|
34
|
+
documentation: {
|
|
35
|
+
iconSprite: "utility",
|
|
36
|
+
iconSymbol: "knowledge_base"
|
|
37
|
+
},
|
|
38
|
+
trailhead: {
|
|
39
|
+
iconSprite: "salesforcebrand",
|
|
40
|
+
iconSymbol: "learning"
|
|
41
|
+
},
|
|
42
|
+
blog: {
|
|
43
|
+
iconSprite: "utility",
|
|
44
|
+
iconSymbol: "comments"
|
|
45
|
+
},
|
|
46
|
+
forum: {
|
|
47
|
+
iconSprite: "general",
|
|
48
|
+
iconSymbol: "question-circle"
|
|
49
|
+
},
|
|
50
|
+
api: {
|
|
51
|
+
iconSprite: "utility",
|
|
52
|
+
iconSymbol: "settings"
|
|
53
|
+
},
|
|
54
|
+
event: {
|
|
55
|
+
iconSprite: "utility",
|
|
56
|
+
iconSymbol: "event"
|
|
57
|
+
},
|
|
58
|
+
website: {
|
|
59
|
+
iconSprite: "utility",
|
|
60
|
+
iconSymbol: "home"
|
|
61
|
+
},
|
|
62
|
+
podcast: {
|
|
63
|
+
iconSprite: "utility",
|
|
64
|
+
iconSymbol: "unmuted"
|
|
65
|
+
}
|
|
66
|
+
};
|
|
27
67
|
|
|
28
68
|
export default class TypeBadge extends LightningElement {
|
|
29
69
|
@api size: TypeBadgeSize = "default";
|
|
30
|
-
@api
|
|
31
|
-
@api color?:
|
|
32
|
-
@api
|
|
70
|
+
@api variant?: Brand | ContentType = "default";
|
|
71
|
+
@api color?: Color;
|
|
72
|
+
@api dark?: false;
|
|
73
|
+
|
|
74
|
+
@api
|
|
75
|
+
get iconSymbol(): IconSymbol | undefined {
|
|
76
|
+
return this.variantIconData
|
|
77
|
+
? this.variantIconData.iconSymbol
|
|
78
|
+
: this._iconSymbol;
|
|
79
|
+
}
|
|
80
|
+
set iconSymbol(value: IconSymbol | undefined) {
|
|
81
|
+
if (value) {
|
|
82
|
+
this._iconSymbol = value;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@api
|
|
87
|
+
get iconSprite(): IconSprite | undefined {
|
|
88
|
+
return this.variantIconData
|
|
89
|
+
? this.variantIconData.iconSprite
|
|
90
|
+
: this._iconSprite;
|
|
91
|
+
}
|
|
92
|
+
set iconSprite(value: IconSprite | undefined) {
|
|
93
|
+
if (value) {
|
|
94
|
+
this._iconSprite = value;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@api
|
|
99
|
+
get value(): string {
|
|
100
|
+
return this._value || this.variantLabel || "";
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
set value(value) {
|
|
104
|
+
if (value) {
|
|
105
|
+
this._value = value;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
private _value?: string;
|
|
110
|
+
private _iconSprite?: IconSprite;
|
|
111
|
+
private _iconSymbol?: IconSymbol;
|
|
112
|
+
|
|
113
|
+
private get variantIconData(): IconData | null {
|
|
114
|
+
if (this.variant && this.variant in contentTypeIcons) {
|
|
115
|
+
return contentTypeIcons[this.variant as ContentType];
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
private get variantLabel(): string | null {
|
|
121
|
+
if (this.isContentType) {
|
|
122
|
+
return contentTypeLabels[this.variant as ContentType];
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
private get variantColorScope(): string | null {
|
|
128
|
+
if (this.isContentType) {
|
|
129
|
+
return "content-type";
|
|
130
|
+
}
|
|
131
|
+
if (this.isBrand) {
|
|
132
|
+
return "brand";
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
private get isContentType(): boolean {
|
|
138
|
+
return CONTENT_TYPES.includes(this.variant as ContentType);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
private get isBrand(): boolean {
|
|
142
|
+
return BRANDS.includes(this.variant as ContentType);
|
|
143
|
+
}
|
|
33
144
|
|
|
34
145
|
private get className(): string {
|
|
35
|
-
return cx(
|
|
36
|
-
"typebadge",
|
|
37
|
-
`size-${this.size}`,
|
|
38
|
-
(this.type && `typebadge_${this.type}`) || DEFAULT_TYPE
|
|
39
|
-
);
|
|
146
|
+
return cx("badge", `size-${this.size}`);
|
|
40
147
|
}
|
|
41
148
|
|
|
42
149
|
private get style(): string {
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
45
|
-
background:
|
|
46
|
-
color:
|
|
150
|
+
if (this.dark) {
|
|
151
|
+
return buildStyleColorVariables({
|
|
152
|
+
background: "--dx-g-purple-vibrant-40",
|
|
153
|
+
color: "--dx-g-brand-default-color-background"
|
|
47
154
|
});
|
|
48
155
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
156
|
+
if (this.variantColorScope) {
|
|
157
|
+
return buildStyleColorVariables({
|
|
158
|
+
background: `--dx-g-${this.variantColorScope}-${this.variant}-color-background`,
|
|
159
|
+
color: `--dx-g-${this.variantColorScope}-${this.variant}-color`
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
if (this.color) {
|
|
163
|
+
const variables = colorToDxColors(this.color as Color);
|
|
164
|
+
return buildStyleColorVariables(variables);
|
|
52
165
|
}
|
|
53
166
|
return "";
|
|
54
167
|
}
|
|
55
|
-
|
|
56
|
-
private buildStyleString({
|
|
57
|
-
background,
|
|
58
|
-
color
|
|
59
|
-
}: {
|
|
60
|
-
background: string;
|
|
61
|
-
color: string;
|
|
62
|
-
}): string {
|
|
63
|
-
return `--color: var(${color}); --background: var(${background})`;
|
|
64
|
-
}
|
|
65
168
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
|
-
import { LinkTarget,
|
|
2
|
+
import { LinkTarget, ContentType } from "typings/custom";
|
|
3
3
|
|
|
4
4
|
const MOBILE_QUERY = "(max-width: 640px)";
|
|
5
5
|
|
|
6
6
|
export abstract class ArchiveCard extends LightningElement {
|
|
7
|
-
@api contentType
|
|
7
|
+
@api contentType!: ContentType;
|
|
8
8
|
@api href!: string;
|
|
9
9
|
@api title!: string;
|
|
10
10
|
@api target: LinkTarget = "_self";
|
|
@@ -12,10 +12,6 @@ export abstract class ArchiveCard extends LightningElement {
|
|
|
12
12
|
private matchMedia!: MediaQueryList;
|
|
13
13
|
protected mobile = false;
|
|
14
14
|
|
|
15
|
-
protected get badgeColor(): Color {
|
|
16
|
-
return this.contentType === "Blog" ? "teal" : "blue";
|
|
17
|
-
}
|
|
18
|
-
|
|
19
15
|
connectedCallback(): void {
|
|
20
16
|
this.matchMedia = window.matchMedia(MOBILE_QUERY);
|
|
21
17
|
this.onMediaChange(this.matchMedia);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { Brand, OptionWithLink, OptionWithNested } from "typings/custom";
|
|
4
|
-
import { toJson } from "dxUtils/normalizers";
|
|
4
|
+
import { toJson, normalizeBoolean } from "dxUtils/normalizers";
|
|
5
5
|
import { track } from "dxUtils/analytics";
|
|
6
6
|
|
|
7
7
|
const VALID_BRANDS = [
|
|
@@ -61,6 +61,15 @@ export abstract class HeaderBase extends LightningElement {
|
|
|
61
61
|
this._versions = toJson(value);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
@api
|
|
65
|
+
get showBanner() {
|
|
66
|
+
return this._showBanner && this.bannerMarkup;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
set showBanner(value) {
|
|
70
|
+
this._showBanner = normalizeBoolean(value);
|
|
71
|
+
}
|
|
72
|
+
|
|
64
73
|
private _navItems!: OptionWithNested[];
|
|
65
74
|
private _versions!: OptionWithLink[];
|
|
66
75
|
private matchMedia!: MediaQueryList;
|
|
@@ -69,6 +78,7 @@ export abstract class HeaderBase extends LightningElement {
|
|
|
69
78
|
private showMobileNavMenu: boolean = false;
|
|
70
79
|
private showNavScrollShadow: boolean = false;
|
|
71
80
|
protected isSearchOpen: boolean = false;
|
|
81
|
+
private _showBanner?: boolean = false;
|
|
72
82
|
|
|
73
83
|
get url() {
|
|
74
84
|
return this.href ? new URL(this.href!) : window.location;
|
|
@@ -170,7 +170,7 @@ a.dx-card-base:hover a.dx-card-base_borderless-image_link {
|
|
|
170
170
|
dx-card-title:hover,
|
|
171
171
|
.dx-card-base_link-hovered dx-card-title,
|
|
172
172
|
a.dx-card-base:hover dx-card-title {
|
|
173
|
-
--dx-c-card-title-color: var(--dx-g-
|
|
173
|
+
--dx-c-card-title-color: var(--dx-g-blue-vibrant-50);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
/* Line Limits */
|
|
@@ -83,7 +83,6 @@ header.state-show-mobile-nav .header_l2_group-nav_overflow {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.header_l2_group-title .subtitle {
|
|
86
|
-
transform: translateY(4px); /* ghost padding */
|
|
87
86
|
margin-right: var(--dx-g-spacing-md);
|
|
88
87
|
}
|
|
89
88
|
|
|
@@ -109,12 +108,14 @@ header.state-show-mobile-nav .header_l2_group-nav_overflow {
|
|
|
109
108
|
margin-left: var(--dx-g-spacing-sm);
|
|
110
109
|
}
|
|
111
110
|
|
|
112
|
-
.header-login-signup
|
|
111
|
+
.header-login-signup,
|
|
112
|
+
.header-tbid-login {
|
|
113
113
|
display: flex;
|
|
114
114
|
align-items: center;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
.header-login-signup dx-button
|
|
117
|
+
.header-login-signup dx-button,
|
|
118
|
+
.header-tbid-login dw-tbid-login-menu {
|
|
118
119
|
margin-left: var(--dx-g-spacing-smd);
|
|
119
120
|
}
|
|
120
121
|
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
--dx-c-sidebar-width: 275px;
|
|
6
|
+
--dx-c-sidebar-button-color: var(--dx-g-blue-vibrant-50);
|
|
7
|
+
--dx-c-sidebar-button-background: white;
|
|
8
|
+
--dx-c-sidebar-button-border: white;
|
|
9
|
+
--dx-c-sidebar-button-color-hover: white;
|
|
10
|
+
--dx-c-sidebar-button-background-hover: var(--dx-g-blue-vibrant-50);
|
|
11
|
+
--dx-c-sidebar-button-border-hover: var(--dx-g-blue-vibrant-50);
|
|
12
|
+
--dx-c-sidebar-left-padding: var(--dx-g-page-padding-horizontal);
|
|
13
|
+
--dx-c-sidebar-vertical-padding: var(--dx-g-spacing-md);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
dx-tree:not(:last-child) {
|
|
17
|
+
margin-bottom: var(--dx-g-spacing-sm);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.header {
|
|
21
|
+
box-sizing: content-box;
|
|
22
|
+
display: flex;
|
|
23
|
+
line-height: var(--dx-g-spacing-xl);
|
|
24
|
+
margin-bottom: 12px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.padding-horizontal {
|
|
28
|
+
padding-left: var(--dx-g-spacing-md);
|
|
29
|
+
padding-right: var(--dx-g-spacing-md);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.header-title {
|
|
33
|
+
line-height: inherit;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.header-toggle-button {
|
|
37
|
+
position: absolute;
|
|
38
|
+
right: calc((-1 * (var(--dx-g-spacing-xl) / 2)) - 1px);
|
|
39
|
+
|
|
40
|
+
--dx-c-button-opacity: 0;
|
|
41
|
+
--dx-c-button-custom-color: var(--dx-c-sidebar-button-color);
|
|
42
|
+
--dx-c-button-custom-background: var(--dx-c-sidebar-button-background);
|
|
43
|
+
--dx-c-button-custom-border: var(--dx-c-sidebar-button-border);
|
|
44
|
+
--dx-c-button-custom-color-hover: var(--dx-c-sidebar-button-color-hover);
|
|
45
|
+
--dx-c-button-custom-background-hover: var(
|
|
46
|
+
--dx-c-sidebar-button-background-hover
|
|
47
|
+
);
|
|
48
|
+
--dx-c-button-custom-border-hover: var(--dx-c-sidebar-button-border-hover);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.header-toggle-icon {
|
|
52
|
+
margin: auto 0 auto auto;
|
|
53
|
+
color: var(--dx-g-blue-vibrant-30);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.header-toggle-icon dx-icon {
|
|
57
|
+
transition: var(--dx-g-transition-transform-2x);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.container.collapsed {
|
|
61
|
+
width: var(--dx-g-spacing-xl);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.container {
|
|
65
|
+
background-color: var(--dx-g-gray-95);
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
height: var(--dx-c-sidebar-height);
|
|
69
|
+
width: calc(var(--dx-c-sidebar-width) + var(--left-spacing));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.container:not(.container-mobile) {
|
|
73
|
+
--border-color: transparent;
|
|
74
|
+
--left-spacing: calc(
|
|
75
|
+
var(--dx-c-sidebar-left-padding) - var(--dx-g-spacing-md)
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
box-shadow: 2px 0 0 0 var(--border-color);
|
|
79
|
+
min-height: var(--dx-c-sidebar-min-height);
|
|
80
|
+
padding: var(--dx-c-sidebar-vertical-padding) 0
|
|
81
|
+
var(--dx-c-sidebar-vertical-padding) var(--left-spacing);
|
|
82
|
+
position: relative;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.collapsed.container:not(.container-mobile) {
|
|
86
|
+
background-color: transparent;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.collapsed.container:not(.container-border-active) {
|
|
90
|
+
--border-color: transparent;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.container:hover .header-toggle-button {
|
|
94
|
+
--dx-c-button-opacity: 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.container.container-mobile {
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.container.container-mobile .header {
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
line-height: var(--dx-g-spacing-2xl);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.container.container-mobile:not(.collapsed) .header {
|
|
107
|
+
background-color: #dddbda;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.container.container-mobile .header-title {
|
|
111
|
+
color: var(--dx-g-gray-10);
|
|
112
|
+
font-family: var(--dx-g-font-sans);
|
|
113
|
+
font-size: var(--dx-g-text-sm);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.container.container-mobile.collapsed {
|
|
117
|
+
height: unset;
|
|
118
|
+
padding-bottom: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.container.container-mobile.collapsed .header {
|
|
122
|
+
margin-bottom: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.container.container-mobile.collapsed .header-toggle-icon dx-icon {
|
|
126
|
+
transform: rotateZ(-90deg);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.container.container-border-active {
|
|
130
|
+
--border-color: var(--dx-c-sidebar-button-color);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.search {
|
|
134
|
+
padding-bottom: var(--dx-g-spacing-md);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.search-box {
|
|
138
|
+
--dx-c-input-width: 100%;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.truncate {
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
text-overflow: ellipsis;
|
|
144
|
+
white-space: nowrap;
|
|
145
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks whether a condition is satisfied at a specified interval, stopping after a maximum amount
|
|
3
|
+
* of time (if specified). Returns a Promise that resolves with `true` if the condition was
|
|
4
|
+
* satisfied during polling (if a maximum time is specified, it can resolve with false if the
|
|
5
|
+
* condition was not satisfied within the maximum time).
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* await pollUntil(() => something.is.true, 200, 1000);
|
|
9
|
+
*
|
|
10
|
+
* @param {Function} condition the "check" callback that will be called to determine whether the
|
|
11
|
+
* condition has been satisfied (satisfied === callback returns truthy value)
|
|
12
|
+
* @param {number} atIntervalMs value in milliseconds specifying how often to poll
|
|
13
|
+
* @param {number} [forMaximumMs] value in milliseconds specifying the maximum time to poll
|
|
14
|
+
* @returns {Promise}
|
|
15
|
+
*/
|
|
16
|
+
export function pollUntil(
|
|
17
|
+
condition: () => boolean,
|
|
18
|
+
atIntervalMs: number,
|
|
19
|
+
forMaximumMs?: number
|
|
20
|
+
) {
|
|
21
|
+
return new Promise<boolean>((resolve) => {
|
|
22
|
+
let timeoutId: ReturnType<typeof setTimeout>;
|
|
23
|
+
const intervalId = setInterval(() => {
|
|
24
|
+
if (condition()) {
|
|
25
|
+
resolveWithCleanup(true);
|
|
26
|
+
}
|
|
27
|
+
}, atIntervalMs);
|
|
28
|
+
if (typeof forMaximumMs === "number") {
|
|
29
|
+
timeoutId = setTimeout(() => {
|
|
30
|
+
// One last check in case the condition was satisfied right before the end:
|
|
31
|
+
resolveWithCleanup(condition() || false);
|
|
32
|
+
}, forMaximumMs);
|
|
33
|
+
}
|
|
34
|
+
if (condition()) {
|
|
35
|
+
// Condition already fulfilled before intervals, no need to keep waiting!
|
|
36
|
+
resolveWithCleanup(true);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function resolveWithCleanup(success: boolean) {
|
|
40
|
+
clearInterval(intervalId);
|
|
41
|
+
clearTimeout(timeoutId);
|
|
42
|
+
resolve(success);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -41,3 +41,13 @@ export const colorToDxColors = (
|
|
|
41
41
|
|
|
42
42
|
export const toDxColor = (color: string) =>
|
|
43
43
|
["white", "transparent"].includes(color) ? color : `var(--dx-g-${color})`;
|
|
44
|
+
|
|
45
|
+
export const buildStyleColorVariables = ({
|
|
46
|
+
background,
|
|
47
|
+
color
|
|
48
|
+
}: {
|
|
49
|
+
background: string;
|
|
50
|
+
color: string;
|
|
51
|
+
}): string => {
|
|
52
|
+
return `--color: var(${color}); --background: var(${background})`;
|
|
53
|
+
};
|