@salesforcedevs/docs-components 0.56.2-comp-flex-ref-2 → 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.
Files changed (77) hide show
  1. package/lwc.config.json +10 -2
  2. package/package.json +18 -12
  3. package/src/modules/doc/{amfReference/utils.ts → amfModelParser/amfModelParser.ts} +10 -5
  4. package/src/modules/doc/amfReference/amfReference.css +23 -3
  5. package/src/modules/doc/amfReference/amfReference.html +34 -21
  6. package/src/modules/doc/amfReference/amfReference.ts +377 -97
  7. package/src/modules/doc/amfReference/types.ts +5 -12
  8. package/src/modules/doc/amfTopic/amfTopic.css +20 -0
  9. package/src/modules/doc/amfTopic/amfTopic.ts +35 -18
  10. package/src/modules/doc/amfTopic/types.ts +15 -13
  11. package/src/modules/doc/amfTopic/utils.ts +12 -6
  12. package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +2 -1
  13. package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +1 -1
  14. package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +22 -0
  15. package/src/modules/doc/breadcrumbs/breadcrumbs.css +9 -1
  16. package/src/modules/doc/breadcrumbs/breadcrumbs.html +44 -34
  17. package/src/modules/doc/breadcrumbs/breadcrumbs.ts +62 -23
  18. package/src/modules/doc/componentPlayground/componentPlayground.css +22 -0
  19. package/src/modules/doc/componentPlayground/componentPlayground.html +20 -0
  20. package/src/modules/doc/componentPlayground/componentPlayground.ts +42 -0
  21. package/src/modules/doc/content/content.css +70 -76
  22. package/src/modules/doc/content/content.html +1 -0
  23. package/src/modules/doc/content/content.ts +26 -47
  24. package/src/modules/doc/contentCallout/contentCallout.css +15 -7
  25. package/src/modules/doc/contentCallout/contentCallout.html +13 -4
  26. package/src/modules/doc/contentCallout/contentCallout.ts +14 -2
  27. package/src/modules/doc/contentLayout/contentLayout.css +1 -100
  28. package/src/modules/doc/contentLayout/contentLayout.html +30 -17
  29. package/src/modules/doc/contentLayout/contentLayout.ts +314 -70
  30. package/src/modules/doc/doDont/doDont.css +47 -0
  31. package/src/modules/doc/doDont/doDont.html +27 -0
  32. package/src/modules/doc/doDont/doDont.ts +17 -0
  33. package/src/modules/doc/header/header.css +65 -36
  34. package/src/modules/doc/header/header.html +41 -139
  35. package/src/modules/doc/header/header.ts +54 -76
  36. package/src/modules/doc/heading/heading.css +16 -37
  37. package/src/modules/doc/heading/heading.html +4 -4
  38. package/src/modules/doc/heading/heading.ts +12 -10
  39. package/src/modules/doc/headingAnchor/headingAnchor.css +2 -2
  40. package/src/modules/doc/headingAnchor/headingAnchor.ts +2 -2
  41. package/src/modules/doc/headingContent/headingContent.css +6 -8
  42. package/src/modules/doc/headingContent/headingContent.html +9 -15
  43. package/src/modules/doc/headingContent/headingContent.ts +2 -14
  44. package/src/modules/doc/lwcContentLayout/lwcContentLayout.css +1 -0
  45. package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +68 -0
  46. package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +256 -0
  47. package/src/modules/doc/overview/overview.css +40 -0
  48. package/src/modules/doc/overview/overview.html +34 -0
  49. package/src/modules/doc/overview/overview.ts +12 -0
  50. package/src/modules/doc/phase/phase.css +18 -3
  51. package/src/modules/doc/phase/phase.html +15 -3
  52. package/src/modules/doc/phase/phase.ts +44 -8
  53. package/src/modules/doc/specificationContent/specificationContent.css +36 -0
  54. package/src/modules/doc/specificationContent/specificationContent.html +167 -0
  55. package/src/modules/doc/specificationContent/specificationContent.ts +127 -0
  56. package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
  57. package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
  58. package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
  59. package/src/modules/doc/toc/toc.ts +1 -1
  60. package/src/modules/doc/versionPicker/versionPicker.css +64 -0
  61. package/src/modules/doc/versionPicker/versionPicker.html +38 -0
  62. package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
  63. package/src/modules/doc/xmlContent/types.ts +12 -3
  64. package/src/modules/doc/xmlContent/utils.ts +17 -12
  65. package/src/modules/doc/xmlContent/xmlContent.css +32 -3
  66. package/src/modules/doc/xmlContent/xmlContent.html +41 -15
  67. package/src/modules/doc/xmlContent/xmlContent.ts +310 -96
  68. package/src/modules/docHelpers/amfStyle/amfStyle.css +10 -45
  69. package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +131 -0
  70. package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
  71. package/src/modules/docHelpers/status/status.css +1 -1
  72. package/src/modules/docUtils/{SearchSyncer/SearchSyncer.ts → searchSyncer/searchSyncer.ts} +1 -0
  73. package/src/modules/docUtils/utils/__mocks__/coveo.analytics.ts +16 -0
  74. package/src/modules/docUtils/utils/coveo.analytics.d.ts +10 -0
  75. package/src/modules/docUtils/utils/utils.ts +32 -0
  76. package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +0 -93
  77. package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +0 -39
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div class="container">
3
+ <div class="doc-do-dont-header">
4
+ <template lwc:if={isDo}>
5
+ <dx-icon
6
+ symbol="success"
7
+ size="large"
8
+ color="green-vibrant-50"
9
+ ></dx-icon>
10
+ <div class="doc-do-dont-label doc-do-color">Do</div>
11
+ </template>
12
+ <template lwc:else>
13
+ <dx-icon
14
+ symbol="clear"
15
+ size="large"
16
+ color="red-vibrant-30"
17
+ class="doc-do-dont-icon"
18
+ ></dx-icon>
19
+ <div class="doc-do-dont-label doc-dont-color">Don't</div>
20
+ </template>
21
+ </div>
22
+ <div class="do-dont-image-container">
23
+ <img class="doc-do-dont-img" src={imgSrc} alt={caption} />
24
+ </div>
25
+ <div class="dx-text-body-4">{caption}</div>
26
+ </div>
27
+ </template>
@@ -0,0 +1,17 @@
1
+ import { LightningElement, api } from "lwc";
2
+ import { normalizeBoolean } from "dxUtils/normalizers";
3
+
4
+ export default class DoDont extends LightningElement {
5
+ @api caption: string = "";
6
+ @api imgSrc!: string;
7
+ _isDo: boolean = false;
8
+
9
+ @api
10
+ get isDo(): boolean {
11
+ return this._isDo;
12
+ }
13
+
14
+ set isDo(value) {
15
+ this._isDo = normalizeBoolean(value);
16
+ }
17
+ }
@@ -2,11 +2,39 @@
2
2
 
3
3
  dx-logo {
4
4
  min-width: fit-content;
5
- min-width: -moz-fit-content;
5
+ }
6
+
7
+ .dev-center-link {
8
+ display: inline-block;
9
+ padding: var(--dx-g-spacing-smd) var(--dx-g-spacing-lg) 0
10
+ var(--dx-g-global-header-padding-horizontal);
11
+ height: var(--dx-g-spacing-xl);
12
+ }
13
+
14
+ .dev-center-content {
15
+ display: flex;
16
+ align-items: center;
17
+ text-decoration: none;
18
+ color: inherit;
19
+ font-weight: var(--dx-g-font-bold);
20
+ }
21
+
22
+ dx-icon {
23
+ --dx-c-icon-size: var(--dx-g-icon-size-xs);
24
+ --dx-c-icon-color: var(--dx-g-blue-vibrant-20);
25
+ }
26
+
27
+ .dev-center-content > * + * {
28
+ margin-left: 8px; /* Adjust this value to your desired spacing */
6
29
  }
7
30
 
8
31
  .header_l2 {
9
32
  justify-content: space-between;
33
+ height: var(--dx-g-doc-header-main-nav-height);
34
+ }
35
+
36
+ .has-brand .header_l2 {
37
+ height: var(--dx-g-spacing-3xl);
10
38
  }
11
39
 
12
40
  .nav_menu-button {
@@ -16,50 +44,44 @@ dx-logo {
16
44
  );
17
45
  }
18
46
 
47
+ .has-brand.has-scoped-nav-items {
48
+ border-bottom: 1px solid var(--dx-g-gray-90);
49
+ border-top: 1px solid var(--dx-g-gray-90);
50
+ }
51
+
19
52
  .nav_menu-ctas {
20
53
  margin-right: var(--dx-g-spacing-sm);
21
54
  }
22
55
 
23
56
  header:not(.has-brand) > .header_l1 {
24
- background: var(--dx-g-brand-current-color-background);
57
+ background: white;
58
+ border-bottom: 1px solid var(--dx-g-gray-90);
25
59
  }
26
60
 
27
61
  header:not(.has-brand) > .header_l2 {
28
- background: var(--dx-g-brand-current-color-background-2);
62
+ border-bottom: 1px solid var(--dx-g-gray-90);
63
+ border-top: 1px solid var(--dx-g-gray-90);
29
64
  }
30
65
 
31
66
  .header_l2_group.header_l2_group-right-ctas {
32
67
  align-items: baseline;
33
68
  }
34
69
 
35
- .header_bail-link {
36
- --dx-c-button-horizontal-spacing: var(--dx-g-spacing-sm);
37
-
38
- margin-left: var(--dx-g-spacing-sm);
39
- }
40
-
41
- .header_lang-dropdown {
42
- --button-primary-color: var(--dx-g-blue-vibrant-50);
43
- --button-primary-color-hover: var(--dx-g-blue-vibrant-40);
44
- }
45
-
46
- .header_lang-dropdown > dx-button {
47
- --dx-c-button-primary-color: var(--button-primary-color);
48
- --dx-c-button-primary-color-hover: var(--button-primary-color-hover);
49
- --dx-c-slot-empty-width: min-content;
50
- --border-color: var(--button-primary-color);
51
-
52
- border-bottom: 1px dashed var(--border-color);
70
+ .has-brand .header_l2_group-title {
71
+ padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-xl)
72
+ calc(var(--dx-g-spacing-smd) - 1px) 0;
73
+ min-width: 320px;
53
74
  }
54
75
 
55
- .header_lang-dropdown > dx-button:hover {
56
- --border-color: var(--button-primary-color-hover);
76
+ .no-header-content {
77
+ border-top: 1px solid var(--dx-g-gray-90);
57
78
  }
58
79
 
59
- @media (max-width: 740px) {
80
+ @media (max-width: 768px) {
60
81
  .header_l2 {
61
82
  padding: 0;
62
83
  flex-wrap: wrap;
84
+ height: 100%;
63
85
  }
64
86
 
65
87
  .has-nav-items .header_l2 {
@@ -70,34 +92,41 @@ header:not(.has-brand) > .header_l2 {
70
92
  width: 100%;
71
93
  }
72
94
 
95
+ .header_l2_group-title {
96
+ margin-right: 0;
97
+ padding: var(--dx-g-spacing-sm) 0 2px
98
+ var(--dx-g-global-header-padding-horizontal);
99
+ min-height: var(--dx-g-doc-header-main-nav-height);
100
+ }
101
+
73
102
  .header_l2_group-nav {
74
103
  height: var(--dx-g-spacing-3xl);
75
104
  padding: 0;
76
- padding-left: var(--dx-g-spacing-sm);
105
+ margin-top: calc(var(--dx-g-spacing-2xs) + 1px);
77
106
  }
78
107
 
79
108
  .header_l2_group-nav_overflow {
109
+ height: var(--dx-g-spacing-3xl);
80
110
  margin-right: var(--dx-g-spacing-sm);
81
111
  }
82
112
 
83
- .header_l2_group-title {
84
- margin-right: 0;
85
- padding: var(--dx-g-spacing-smd) var(--dx-g-page-padding-horizontal);
113
+ .subtitle {
114
+ font-weight: var(--dx-g-font-demi);
115
+ letter-spacing: -0.08px;
86
116
  }
87
117
 
88
- .header_l2_group-title .header_lang-dropdown {
89
- margin-left: auto;
90
- }
91
-
92
- .header_lang-dropdown > dx-button {
93
- padding: var(--dx-g-spacing-2xs) 0;
118
+ .has-brand .header_l2_group-title {
119
+ margin-right: 0;
120
+ padding: var(--dx-g-spacing-sm) 0 var(--dx-g-spacing-2xs)
121
+ var(--dx-g-global-header-padding-horizontal);
94
122
  }
95
123
 
96
124
  .has-scoped-nav-items > .header_l2 {
97
125
  height: unset;
98
126
  }
99
127
 
100
- .has-scoped-nav-items .header_l2_group-title {
101
- border-bottom: 1px solid var(--dx-g-brand-current-color-border-2);
128
+ header:not(.has-brand) > .header_l2 {
129
+ padding-bottom: 0;
130
+ border: 0;
102
131
  }
103
132
  }
@@ -1,153 +1,55 @@
1
1
  <template>
2
- <dx-brand-theme-provider brand={brand}>
3
- <header class={className}>
4
- <dx-skip-nav-link></dx-skip-nav-link>
5
- <dx-banner
6
- if:true={bannerMarkup}
7
- banner-markup={bannerMarkup}
8
- ></dx-banner>
9
- <div class="header_l1">
10
- <div if:true={showMenuButton} class="nav_menu-ctas">
11
- <dx-button
12
- aria-label="Menu Button"
13
- class="nav_menu-button"
14
- icon-size="large"
15
- icon-symbol={mobileMenuIconSymbol}
16
- variant="tertiary"
17
- onclick={toggleMobileNavMenu}
18
- ></dx-button>
19
- </div>
20
- <dx-logo label={title}></dx-logo>
21
- <dx-header-nav
22
- if:true={showDesktopNavItems}
23
- aria-label="Global Navigation Bar"
24
- nav-items={navItems}
25
- onrequestopennavmenu={onRequestOpenNavMenu}
26
- pathname={pathname}
27
- variant="small"
28
- ></dx-header-nav>
29
- <div class="header-cta-container">
30
- <dx-header-search
31
- if:true={hasSearch}
32
- coveo-organization-id={coveoOrganizationId}
33
- coveo-public-access-token={coveoPublicAccessToken}
34
- coveo-search-pipeline={coveoSearchPipeline}
35
- coveo-search-hub={coveoSearchHub}
36
- mobile={tablet}
37
- onstatechange={handleStateChange}
38
- ></dx-header-search>
39
- </div>
40
- <div if:true={showSignup} class="header-login-signup">
41
- <dx-button
42
- aria-label="Sign Up For Salesforce Developer Edition"
43
- size="small"
44
- href={signupLink}
45
- onclick={handleSignUpClick}
46
- >
47
- Sign Up
48
- </dx-button>
49
- </div>
50
- <dx-header-mobile-nav-menu
51
- if:true={hasNavItems}
52
- nav-items={navItems}
53
- open={showMobileNavMenu}
54
- pathname={pathname}
55
- value={mobileNavMenuValue}
56
- onchange={onMobileNavMenuChange}
57
- onrequestclose={closeMobileNavMenu}
58
- >
59
- <dx-button
60
- aria-label={bailLabel}
61
- if:true={hasBailLink}
62
- href={bailHref}
63
- variant="tertiary"
64
- icon-symbol="new_window"
65
- >
66
- {bailLabel}
67
- </dx-button>
68
- </dx-header-mobile-nav-menu>
69
- </div>
70
- <div class="header_l2">
71
- <div class="header_l2_group header_l2_group-title">
72
- <a href={headerHref} class="home-link">
2
+ <template lwc:if={shouldRender}>
3
+ <dx-brand-theme-provider brand={brand}>
4
+ <header class={className}>
5
+ <dx-banner
6
+ lwc:if={showBanner}
7
+ banner-markup={bannerMarkup}
8
+ ></dx-banner>
9
+ <!-- To-Do: Move the devCenter as a new component and use it here, as devCenter is also used in Sidebar now -->
10
+ <div lwc:if={devCenter} class="dev-center-link">
11
+ <a href={devCenter.link} class="dev-center-content">
12
+ <dx-icon symbol="back"></dx-icon>
73
13
  <dx-icon
74
14
  class="brand-icon"
75
- if:true={isValidBrand}
15
+ lwc:if={devCenter.icon}
76
16
  sprite="salesforcebrand"
77
17
  symbol={brand}
78
- size="xlarge"
18
+ size="large"
79
19
  ></dx-icon>
80
- <span class="subtitle dx-text-heading-4">
81
- {subtitle}
20
+ <span class="subtitle dx-text-body-4">
21
+ {devCenter.title}
82
22
  </span>
83
23
  </a>
84
- <dx-dropdown
85
- if:true={showMobileLanguages}
86
- class="header_lang-dropdown"
87
- options={languages}
88
- small
89
- value={language}
90
- value-path={langValuePath}
91
- onchange={onLangChange}
92
- >
93
- <dx-button
94
- aria-label="Select Language"
95
- variant="inline"
96
- icon-size="large"
97
- icon-symbol="world"
98
- ></dx-button>
99
- </dx-dropdown>
100
24
  </div>
101
- <div
102
- if:true={hasScopedNavItems}
103
- class="header_l2_group header_l2_group-nav"
104
- >
105
- <div
106
- class="header_l2_group-nav_overflow"
107
- onscroll={onNavScroll}
108
- >
109
- <dx-header-nav
110
- aria-label="Scoped Navigation Bar"
111
- nav-items={scopedNavItems}
112
- pathname={pathname}
113
- ></dx-header-nav>
25
+ <div class="header_l2">
26
+ <div class="header_l2_group header_l2_group-title">
27
+ <a href={headerHref} class="home-link">
28
+ <span class="subtitle dx-text-display-7">
29
+ {subtitle}
30
+ </span>
31
+ </a>
114
32
  </div>
115
- </div>
116
- <div
117
- if:false={smallMobile}
118
- class="header_l2_group header_l2_group-right-ctas"
119
- >
120
- <dx-dropdown
121
- if:true={hasLanguages}
122
- class="header_lang-dropdown"
123
- options={languages}
124
- small
125
- value-path={langValuePath}
126
- value={language}
127
- onchange={onLangChange}
33
+ <div
34
+ lwc:if={showScopedNavItems}
35
+ class="header_l2_group header_l2_group-nav"
128
36
  >
129
- <dx-button
130
- aria-label="Select Language"
131
- variant="inline"
132
- icon-size="small"
133
- icon-symbol="world"
37
+ <div
38
+ class="header_l2_group-nav_overflow"
39
+ onscroll={onNavScroll}
134
40
  >
135
- {languageLabel}
136
- </dx-button>
137
- </dx-dropdown>
138
- <dx-button
139
- if:true={hasBailLink}
140
- aria-label={bailLabel}
141
- class="header_bail-link"
142
- href={bailHref}
143
- variant="tertiary"
144
- icon-symbol="new_window"
145
- target="_blank"
146
- >
147
- {bailLabel}
148
- </dx-button>
41
+ <dx-header-nav
42
+ aria-label="Scoped Navigation Bar"
43
+ nav-items={scopedNavItems}
44
+ pathname={pathname}
45
+ ></dx-header-nav>
46
+ </div>
47
+ </div>
149
48
  </div>
150
- </div>
151
- </header>
152
- </dx-brand-theme-provider>
49
+ </header>
50
+ </dx-brand-theme-provider>
51
+ </template>
52
+ <template lwc:if={shouldHideHeader}>
53
+ <div class="no-header-content"></div>
54
+ </template>
153
55
  </template>
@@ -1,93 +1,76 @@
1
1
  import { api } from "lwc";
2
2
  import cx from "classnames";
3
- import type { OptionWithNested, OptionWithLink } from "typings/custom";
3
+ import type { OptionWithNested, DevCenterConfig } from "typings/custom";
4
4
  import { HeaderBase } from "dxBaseElements/headerBase";
5
- import { toJson } from "dxUtils/normalizers";
6
- import get from "lodash.get";
5
+ import { toJson, normalizeBoolean } from "dxUtils/normalizers";
7
6
 
8
7
  const TABLET_MATCH = "980px";
9
- const MOBILE_MATCH = "880px";
10
- const SMALL_MOBILE_MATCH = "740px";
8
+ const MOBILE_MATCH = "768px";
9
+
10
+ const isStorybook = () => {
11
+ const { host } = window.location;
12
+ return (
13
+ host === "localhost:6006" || /^dsc-comp.*\.herokuapp\.com$/.test(host)
14
+ );
15
+ };
11
16
 
12
17
  export default class Header extends HeaderBase {
13
18
  @api langValuePath: string = "id"; // allows to override how language property is interpreted, follows valuePath dropdown api.
14
19
  @api headerHref: string = "/";
15
20
 
16
21
  @api
17
- get scopedNavItems() {
18
- return this._scopedNavItems;
22
+ get hideDocHeader() {
23
+ return this._hideDocHeader;
19
24
  }
20
25
 
21
- set scopedNavItems(value) {
22
- this._scopedNavItems = toJson(value);
26
+ set hideDocHeader(value) {
27
+ this._hideDocHeader = normalizeBoolean(value);
23
28
  }
24
29
 
25
30
  @api
26
- get languages() {
27
- return this._languages;
31
+ get scopedNavItems() {
32
+ return this._scopedNavItems;
28
33
  }
29
34
 
30
- set languages(value) {
31
- this._languages = toJson(value);
35
+ set scopedNavItems(value) {
36
+ this._scopedNavItems = toJson(value);
32
37
  }
33
38
 
34
39
  @api
35
- get language() {
36
- return this._language;
40
+ get devCenter(): DevCenterConfig {
41
+ return this._devCenter;
37
42
  }
38
43
 
39
- set language(value) {
40
- if (this._language !== value) {
41
- this._language = value;
42
- }
44
+ set devCenter(value) {
45
+ this._devCenter = toJson(value);
43
46
  }
44
47
 
45
- private _language: string | null = null;
46
- private _languages!: OptionWithLink[];
47
48
  private _scopedNavItems!: OptionWithNested[];
48
- private smallMobile = false;
49
- private smallMobileMatchMedia!: MediaQueryList;
50
49
  private tablet = false;
51
50
  private tabletMatchMedia!: MediaQueryList;
51
+ private shouldRender: boolean = false;
52
+ private showDocDivider: boolean = false;
53
+ private _devCenter!: DevCenterConfig;
54
+ private _hideDocHeader: boolean = false;
52
55
 
53
56
  protected mobileBreakpoint(): string {
54
57
  return MOBILE_MATCH;
55
58
  }
56
59
 
57
- private get hasScopedNavItems(): boolean {
58
- return this.scopedNavItems && this.scopedNavItems.length > 0;
59
- }
60
-
61
- private get showDesktopNavItems(): boolean {
62
- return !this.mobile && this.hasNavItems;
63
- }
64
-
65
- private get showSignup(): boolean {
66
- return this.signupLink
67
- ? (this.tablet && !this.isSearchOpen) || !this.tablet
68
- : false;
69
- }
70
-
71
- private get hasLanguages(): boolean {
72
- return !!(this.languages && this.languages.length);
73
- }
74
-
75
- private get showMobileLanguages(): boolean {
76
- return this.smallMobile && this.hasLanguages;
77
- }
78
-
79
- private get languageLabel(): string {
60
+ private get showScopedNavItems(): boolean {
80
61
  return (
81
- (this.language &&
82
- this.languages.find(
83
- (lang) => get(lang, this.langValuePath) === this.language
84
- )?.label) ||
85
- this.languages[0].label
62
+ this.scopedNavItems &&
63
+ this.scopedNavItems.length > 0 &&
64
+ !this.hideDocHeader
86
65
  );
87
66
  }
88
67
 
89
- private get showMenuButton(): boolean {
90
- return this.mobile && this.hasNavItems;
68
+ /**
69
+ * This function returns true if the hideDocHeader is true and the view is not mobile.
70
+ * Also we need to show the header border in case the doc is hidden or if the brand information doesn't exists.
71
+ */
72
+ private get shouldHideHeader(): boolean {
73
+ return (this.hideDocHeader && !this.mobile) || this.showDocDivider;
91
74
  }
92
75
 
93
76
  connectedCallback(): void {
@@ -98,14 +81,23 @@ export default class Header extends HeaderBase {
98
81
  this.onTabletChange(this.tabletMatchMedia);
99
82
  this.tabletMatchMedia.addEventListener("change", this.onTabletChange);
100
83
 
101
- this.smallMobileMatchMedia = window.matchMedia(
102
- `(max-width: ${SMALL_MOBILE_MATCH})`
103
- );
104
- this.onSmallMobileChange(this.smallMobileMatchMedia);
105
- this.smallMobileMatchMedia.addEventListener(
106
- "change",
107
- this.onSmallMobileChange
108
- );
84
+ if (
85
+ (!this.shouldHideHeader &&
86
+ window.location.pathname.includes("/docs/") &&
87
+ window.location.pathname !== "/docs/apis") ||
88
+ window.location.pathname ===
89
+ "/tableau/embedding-playground/overview" ||
90
+ isStorybook()
91
+ ) {
92
+ this.shouldRender = true;
93
+ }
94
+
95
+ if (this.shouldRender && window.location.pathname.includes("/docs/")) {
96
+ if (!this.brand && !this.mobile) {
97
+ this.shouldRender = false;
98
+ this.showDocDivider = true;
99
+ }
100
+ }
109
101
  }
110
102
 
111
103
  disconnectedCallback(): void {
@@ -114,29 +106,15 @@ export default class Header extends HeaderBase {
114
106
  "change",
115
107
  this.onTabletChange
116
108
  );
117
-
118
- this.smallMobileMatchMedia.removeEventListener(
119
- "change",
120
- this.onSmallMobileChange
121
- );
122
109
  }
123
110
 
124
111
  private onTabletChange = (e: MediaQueryListEvent | MediaQueryList) =>
125
112
  (this.tablet = e.matches);
126
113
 
127
- private onSmallMobileChange = (e: MediaQueryListEvent | MediaQueryList) =>
128
- (this.smallMobile = e.matches);
129
-
130
114
  protected additionalClasses(): string {
131
115
  return cx(
132
116
  this.brand && "has-brand",
133
- this.hasScopedNavItems && "has-scoped-nav-items"
117
+ this.showScopedNavItems && "has-scoped-nav-items"
134
118
  );
135
119
  }
136
-
137
- private onLangChange(event: CustomEvent<string>): void {
138
- const { detail } = event;
139
- this._language = detail;
140
- this.dispatchEvent(new CustomEvent("langchange", { detail }));
141
- }
142
120
  }
@@ -1,54 +1,33 @@
1
- h1,
2
- h2,
3
- h3,
4
- h4,
5
- h5,
6
- h6 {
7
- color: var(--dx-g-blue-vibrant-20);
8
- font-family: var(--dx-g-font-display);
9
- font-weight: var(--dx-g-font-demi);
10
- }
1
+ @import "dxHelpers/text";
11
2
 
12
- .display-3 {
13
- margin: 0 0 24px 0;
14
- font-size: var(--dx-g-text-3xl);
15
- letter-spacing: -0.85px;
16
- line-height: var(--dx-g-text-4xl);
3
+ h1 {
4
+ margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
17
5
  }
18
6
 
19
- .display-3 doc-heading-content {
20
- --doc-c-heading-anchor-button-bottom: 8px;
7
+ h1 doc-heading-content {
8
+ --doc-c-heading-anchor-button-bottom: 9.5px;
21
9
  }
22
10
 
23
- .display-4 {
24
- margin: var(--dx-g-spacing-xl) 0 var(--dx-g-spacing-md) 0;
25
- font-size: var(--dx-g-text-xl);
26
- letter-spacing: -0.1px;
27
- line-height: var(--dx-g-spacing-lg);
11
+ h2 {
12
+ margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
28
13
  }
29
14
 
30
- .display-4 doc-heading-content {
31
- --doc-c-heading-anchor-button-bottom: -3px;
15
+ h2 doc-heading-content {
16
+ --doc-c-heading-anchor-button-bottom: 3px;
32
17
  }
33
18
 
34
- .display-5 {
35
- margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-md) 0;
36
- font-size: var(--dx-g-text-lg);
37
- letter-spacing: -0.1px;
38
- line-height: var(--dx-g-spacing-lg);
19
+ h3 {
20
+ margin: var(--dx-g-spacing-xl) 0 var(--dx-g-spacing-md) 0;
39
21
  }
40
22
 
41
- .display-5 doc-heading-content {
42
- --doc-c-heading-anchor-button-bottom: -4px;
23
+ h3 doc-heading-content {
24
+ --doc-c-heading-anchor-button-bottom: -0.5px;
43
25
  }
44
26
 
45
- .display-6 {
46
- margin: var(--dx-g-spacing-md) 0 var(--dx-g-spacing-sm) 0;
47
- font-size: var(--dx-g-text-base);
48
- letter-spacing: 0;
49
- line-height: var(--dx-g-spacing-mlg);
27
+ h4 {
28
+ margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-sm) 0;
50
29
  }
51
30
 
52
- .display-6 doc-heading-content {
31
+ h4 doc-heading-content {
53
32
  --doc-c-heading-anchor-button-bottom: -6px;
54
33
  }