@salesforcedevs/arch-components 1.20.17-alpha9 → 1.25.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.
Files changed (158) hide show
  1. package/LICENSE +12 -0
  2. package/lwc.config.json +42 -3
  3. package/package.json +36 -46
  4. package/src/assets/css/arch-variables.css +512 -0
  5. package/src/modules/arch/badge/badge.css +22 -0
  6. package/src/modules/arch/badge/badge.html +5 -0
  7. package/src/modules/arch/badge/badge.ts +9 -0
  8. package/src/modules/arch/button/button.css +1 -0
  9. package/src/modules/arch/button/button.html +20 -0
  10. package/src/modules/arch/button/button.ts +67 -0
  11. package/src/modules/arch/buttonLink/buttonLink.css +1 -0
  12. package/src/modules/arch/buttonLink/buttonLink.html +19 -0
  13. package/src/modules/arch/buttonLink/buttonLink.stories.js +34 -0
  14. package/src/modules/arch/buttonLink/buttonLink.ts +8 -0
  15. package/src/modules/arch/buttonStyles/buttonStyles.css +220 -0
  16. package/src/modules/arch/card/card.css +128 -0
  17. package/src/modules/arch/card/card.html +85 -0
  18. package/src/modules/arch/card/card.ts +277 -0
  19. package/src/modules/arch/cardBase/cardBase.css +11 -0
  20. package/src/modules/arch/cardBase/cardBase.html +2 -0
  21. package/src/modules/arch/cardGridA/cardGridA.css +11 -0
  22. package/src/modules/arch/cardGridA/cardGridA.html +21 -0
  23. package/src/modules/arch/cardGridA/cardGridA.stories.js +118 -0
  24. package/src/modules/arch/cardGridA/cardGridA.ts +24 -0
  25. package/src/modules/arch/cardGridC/cardGridC.css +24 -0
  26. package/src/modules/arch/cardGridC/cardGridC.html +22 -0
  27. package/src/modules/arch/cardGridC/cardGridC.stories.js +51 -0
  28. package/src/modules/arch/cardGridC/cardGridC.ts +11 -0
  29. package/src/modules/arch/cardGridD/cardGridD.css +17 -0
  30. package/src/modules/arch/cardGridD/cardGridD.html +20 -0
  31. package/src/modules/arch/cardGridD/cardGridD.stories.js +43 -0
  32. package/src/modules/arch/cardGridD/cardGridD.ts +7 -0
  33. package/src/modules/arch/cardNew/cardNew.css +31 -0
  34. package/src/modules/arch/cardNew/cardNew.html +32 -0
  35. package/src/modules/arch/cardNew/cardNew.ts +66 -0
  36. package/src/modules/arch/children/children.html +2 -0
  37. package/src/modules/arch/children/children.ts +31 -0
  38. package/src/modules/arch/color/color.ts +59 -0
  39. package/src/modules/arch/content/__fixtures__/index.ts +884 -0
  40. package/src/modules/arch/content/content.css +643 -0
  41. package/src/modules/arch/content/content.html +65 -0
  42. package/src/modules/arch/content/content.stories.js +21 -0
  43. package/src/modules/arch/content/content.ts +169 -0
  44. package/src/modules/arch/contentIcon/contentIcon.css +48 -0
  45. package/src/modules/arch/contentIcon/contentIcon.html +15 -0
  46. package/src/modules/arch/contentIcon/contentIcon.stories.js +130 -0
  47. package/src/modules/arch/contentIcon/contentIcon.ts +68 -0
  48. package/src/{common → modules/arch}/context/context.ts +21 -19
  49. package/src/modules/arch/contextAdapter/constants.ts +1 -0
  50. package/src/modules/arch/contextAdapter/contextAdapter.ts +54 -0
  51. package/src/modules/arch/debounce/debounce.ts +32 -0
  52. package/src/modules/arch/dialog/dialog.ts +154 -0
  53. package/src/modules/arch/dialogStyles/dialogStyles.css +90 -0
  54. package/src/modules/arch/effectAdapter/effectAdapter.html +1 -0
  55. package/src/modules/arch/effectAdapter/effectAdapter.ts +28 -0
  56. package/src/modules/arch/explorer/explorer.css +301 -0
  57. package/src/modules/arch/explorer/explorer.html +418 -0
  58. package/src/modules/arch/explorer/explorer.ts +718 -0
  59. package/src/modules/arch/explorer/types.d.ts +60 -0
  60. package/src/modules/arch/fetch/fetch.ts +55 -0
  61. package/src/modules/arch/footerMfe/footerMfe.html +3 -0
  62. package/src/modules/arch/footerMfe/footerMfe.ts +19 -0
  63. package/src/modules/arch/gallery/gallery.css +365 -0
  64. package/src/modules/arch/gallery/gallery.html +71 -0
  65. package/src/modules/arch/gallery/gallery.ts +366 -0
  66. package/src/modules/arch/gallery/types.d.ts +35 -0
  67. package/src/modules/arch/heading/heading.css +1 -0
  68. package/src/modules/arch/heading/heading.html +9 -0
  69. package/src/modules/arch/heading/heading.ts +36 -0
  70. package/src/modules/arch/helpers/helpers.ts +141 -0
  71. package/src/modules/arch/heroA/heroA.css +116 -0
  72. package/src/modules/arch/heroA/heroA.html +28 -0
  73. package/src/modules/arch/heroA/heroA.stories.js +60 -0
  74. package/src/modules/arch/heroA/heroA.ts +53 -0
  75. package/src/modules/arch/heroB/heroB.css +79 -0
  76. package/src/modules/arch/heroB/heroB.html +27 -0
  77. package/src/modules/arch/heroB/heroB.stories.js +55 -0
  78. package/src/modules/arch/heroB/heroB.ts +26 -0
  79. package/src/modules/arch/i18n/i18n.ts +78 -0
  80. package/src/modules/arch/icon/icon.css +28 -0
  81. package/src/modules/arch/icon/icon.html +17 -0
  82. package/src/modules/arch/icon/icon.stories.js +26 -0
  83. package/src/modules/arch/icon/icon.ts +92 -0
  84. package/src/modules/arch/instrumentation/instrumentation.css +1 -0
  85. package/src/modules/arch/instrumentation/instrumentation.html +1 -0
  86. package/src/modules/arch/instrumentation/instrumentation.ts +113 -0
  87. package/src/modules/arch/labels/helpers.ts +25 -0
  88. package/src/modules/arch/labels/pointHelpers.ts +47 -0
  89. package/src/modules/arch/labels/timeHelpers.ts +182 -0
  90. package/src/modules/arch/labels/types.d.ts +5 -0
  91. package/src/modules/arch/logger/logger.ts +33 -0
  92. package/src/modules/arch/menu/menu.ts +260 -0
  93. package/src/modules/arch/overflow/overflow.ts +71 -0
  94. package/src/modules/arch/page/page.css +3 -0
  95. package/src/modules/arch/page/page.html +3 -0
  96. package/src/modules/arch/page/page.stories.js +19 -0
  97. package/src/modules/arch/page/page.ts +3 -0
  98. package/src/modules/arch/pageHeaderA/pageHeaderA.css +82 -0
  99. package/src/modules/arch/pageHeaderA/pageHeaderA.html +24 -0
  100. package/src/modules/arch/pageHeaderA/pageHeaderA.stories.js +25 -0
  101. package/src/modules/arch/pageHeaderA/pageHeaderA.ts +51 -0
  102. package/src/modules/arch/pill/pill.css +70 -0
  103. package/src/modules/arch/pill/pill.html +17 -0
  104. package/src/modules/arch/pill/pill.ts +34 -0
  105. package/src/modules/arch/polling-request.ts +97 -0
  106. package/src/modules/arch/reflectedElement/reflectedElement.html +2 -0
  107. package/src/{common → modules/arch}/reflectedElement/reflectedElement.ts +5 -3
  108. package/src/modules/arch/reset/reset.css +39 -0
  109. package/src/modules/arch/searchList/searchList.css +120 -0
  110. package/src/modules/arch/searchList/searchList.html +46 -0
  111. package/src/modules/arch/searchList/searchList.ts +53 -0
  112. package/src/modules/arch/sectionA/sectionA.css +64 -0
  113. package/src/modules/arch/sectionA/sectionA.html +21 -0
  114. package/src/modules/arch/sectionA/sectionA.stories.js +25 -0
  115. package/src/modules/arch/sectionA/sectionA.ts +27 -0
  116. package/src/modules/arch/select/select.css +40 -0
  117. package/src/modules/arch/select/select.html +24 -0
  118. package/src/modules/arch/select/select.ts +64 -0
  119. package/src/modules/arch/socialShare/socialShare.css +50 -0
  120. package/src/modules/arch/socialShare/socialShare.html +56 -0
  121. package/src/modules/arch/socialShare/socialShare.ts +29 -0
  122. package/src/modules/arch/spinner/spinner.css +195 -0
  123. package/src/modules/arch/spinner/spinner.html +9 -0
  124. package/src/modules/arch/spinner/spinner.ts +15 -0
  125. package/src/modules/arch/styles/styles.css +24 -0
  126. package/src/modules/arch/summary/summary.css +134 -0
  127. package/src/modules/arch/summary/summary.html +71 -0
  128. package/src/modules/arch/summary/summary.stories.js +163 -0
  129. package/src/modules/arch/summary/summary.ts +96 -0
  130. package/src/modules/arch/tab/tab.css +3 -0
  131. package/src/modules/arch/tab/tab.html +5 -0
  132. package/src/modules/arch/tab/tab.ts +46 -0
  133. package/src/modules/arch/tabset/tabset.css +112 -0
  134. package/src/modules/arch/tabset/tabset.html +62 -0
  135. package/src/modules/arch/tabset/tabset.ts +244 -0
  136. package/src/modules/arch/testutils.ts +118 -0
  137. package/src/modules/arch/threeCardGrid/threeCardGrid.css +6 -0
  138. package/src/modules/arch/threeCardGrid/threeCardGrid.html +5 -0
  139. package/src/modules/arch/threeCardGrid/threeCardGrid.ts +3 -0
  140. package/src/modules/arch/track/track.ts +23 -0
  141. package/src/modules/arch/trailhead.ts +120 -0
  142. package/src/modules/arch/types.d.ts +1 -0
  143. package/src/modules/arch/useEffectAttr.ts +16 -0
  144. package/src/modules/arch/utils/utils.ts +20 -0
  145. package/src/modules/arch/withState.ts +21 -0
  146. package/src/modules/arch/xsfMfeEvents/xsfMfeEvents.html +1 -0
  147. package/src/modules/arch/xsfMfeEvents/xsfMfeEvents.ts +47 -0
  148. package/src/common/effectAdapter/__tests__/effectAdapter.test.ts +0 -12
  149. package/src/common/effectAdapter/effectAdapter.ts +0 -18
  150. package/src/common/reflectedElement/__tests__/modules/test/select/select.html +0 -3
  151. package/src/common/reflectedElement/__tests__/modules/test/select/select.ts +0 -7
  152. package/src/common/reflectedElement/__tests__/modules/test/selectTransform/selectTransform.html +0 -3
  153. package/src/common/reflectedElement/__tests__/modules/test/selectTransform/selectTransform.ts +0 -18
  154. package/src/common/reflectedElement/__tests__/reflectedElement.test.ts +0 -75
  155. package/src/common/slot/__tests__/slot.test.ts +0 -96
  156. package/src/common/slot/slot.ts +0 -20
  157. /package/src/{common → modules/arch}/context/context.html +0 -0
  158. /package/src/{common/effectAdapter/effectAdapter.html → modules/arch/contextAdapter/contextAdapter.html} +0 -0
@@ -0,0 +1,134 @@
1
+ @import "arch/reset";
2
+
3
+ .summary {
4
+ display: flex;
5
+ padding-bottom: 0.75rem;
6
+ padding-top: 0.75rem;
7
+ }
8
+
9
+ [data-display="brick"] {
10
+ flex-direction: row;
11
+ }
12
+
13
+ [data-display*="tile"] {
14
+ flex-direction: column;
15
+ }
16
+
17
+ .body,
18
+ .footer {
19
+ flex-wrap: wrap;
20
+ margin-top: var(--arch-spacing-3);
21
+ }
22
+
23
+ .header {
24
+ align-items: flex-start;
25
+ display: flex;
26
+ justify-content: space-between;
27
+ }
28
+
29
+ .header-actions {
30
+ margin-bottom: -1.5rem;
31
+ }
32
+
33
+ .header-actions[data-alignment="start"] {
34
+ align-self: flex-start;
35
+ }
36
+
37
+ .header-actions[data-alignment="center"] {
38
+ align-self: flex-center;
39
+ }
40
+
41
+ .header-actions[data-alignment="end"] {
42
+ align-self: flex-end;
43
+ }
44
+
45
+ .summary:not([data-slots*="image"], [data-slots*="action"]) .header {
46
+ display: none;
47
+ }
48
+
49
+ .content {
50
+ display: flex;
51
+ flex: 1;
52
+ }
53
+
54
+ .content-start {
55
+ flex: 1;
56
+ }
57
+
58
+ .pretitle,
59
+ .title,
60
+ .description {
61
+ margin-top: var(--arch-spacing-1);
62
+ }
63
+
64
+ .pretitle {
65
+ color: var(--arch-color-meteorite);
66
+ font-size: var(--arch-font-size-sm);
67
+ }
68
+
69
+ .pretitle a {
70
+ color: var(--arch-color-brand);
71
+ text-decoration: none;
72
+ }
73
+
74
+ .pretitle a:hover {
75
+ text-decoration: underline;
76
+ }
77
+
78
+ .title {
79
+ display: inline-block;
80
+ font-size: var(--title-font-size, var(--arch-font-size-lg));
81
+ font-weight: 600;
82
+ text-align: left;
83
+ }
84
+
85
+ .title-link {
86
+ appearance: none;
87
+ background: none;
88
+ border: none;
89
+ color: var(--arch-color-brand);
90
+ cursor: pointer;
91
+ text-decoration: none;
92
+ }
93
+
94
+ .title-link:hover {
95
+ text-decoration: underline;
96
+ }
97
+
98
+ .description {
99
+ color: var(--arch-color-meteorite);
100
+ font-size: var(--arch-font-size-sm);
101
+ }
102
+
103
+ .footer {
104
+ display: flex;
105
+ font-size: var(--arch-font-size-sm);
106
+ justify-content: space-between;
107
+ align-items: center;
108
+ }
109
+
110
+ .summary:not([data-slots*="meta"]) .footer {
111
+ display: none;
112
+ }
113
+
114
+ [data-display="brick"] .body {
115
+ flex: 1;
116
+ margin-top: 0;
117
+ margin-left: var(--arch-spacing-4);
118
+ }
119
+
120
+ [data-display="brick"] .body .content {
121
+ margin-top: 0;
122
+ }
123
+
124
+ @media screen and (min-width: 640px) {
125
+ [data-display^="brick-tile"] {
126
+ flex-direction: row;
127
+ }
128
+
129
+ [data-display^="brick-tile"] .body {
130
+ margin-left: var(--arch-spacing-4);
131
+ margin-top: 0;
132
+ flex: 1;
133
+ }
134
+ }
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <div class="summary" data-display={displayMode}>
3
+ <div class="header">
4
+ <div class="image">
5
+ <slot name="image" onslotchange={onSlotChange}></slot>
6
+ </div>
7
+ <template if:true={isTile}>
8
+ <div data-alignment={actionsAlignment} class="header-actions">
9
+ <slot name="action" onslotchange={onSlotChange}></slot>
10
+ </div>
11
+ </template>
12
+ </div>
13
+ <div class="body">
14
+ <div class="content">
15
+ <div class="content-start">
16
+ <div class="pretitle">
17
+ <slot name="pretitle" onslotchange={onSlotChange}>
18
+ {pretitle}
19
+ <a
20
+ if:true={pretitleLinkHref}
21
+ href={pretitleLinkHref}
22
+ target={pretitleLinkTarget}
23
+ >
24
+ {pretitleLinkTitle}
25
+ </a>
26
+ </slot>
27
+ </div>
28
+ <arch-heading level={titleHeadingLevel}>
29
+ <template if:true={titleIsAnchor}>
30
+ <a
31
+ class="title title-link"
32
+ href={path}
33
+ onclick={onTitleClick}
34
+ target={pathTarget}
35
+ >
36
+ {title}
37
+ </a>
38
+ </template>
39
+ <template if:true={titleIsButton}>
40
+ <button
41
+ class="title title-link"
42
+ onclick={onTitleButtonClick}
43
+ >
44
+ {title}
45
+ </button>
46
+ </template>
47
+ <template if:true={titleIsText}>
48
+ <span class="title">{title}</span>
49
+ </template>
50
+ </arch-heading>
51
+ <template if:true={showDescription}>
52
+ <div class="description">{description}</div>
53
+ </template>
54
+ </div>
55
+ <template if:false={isTile}>
56
+ <div class="content-end">
57
+ <slot name="action" onslotchange={onSlotChange}></slot>
58
+ </div>
59
+ </template>
60
+ </div>
61
+ <div class="footer">
62
+ <div>
63
+ <slot name="meta-left" onslotchange={onSlotChange}></slot>
64
+ </div>
65
+ <div>
66
+ <slot name="meta-right" onslotchange={onSlotChange}></slot>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </template>
@@ -0,0 +1,163 @@
1
+ import { html } from "lit-html";
2
+
3
+ export default {
4
+ title: "arch/arch-summary",
5
+ component: "sb-arch-summary",
6
+ parameters: {
7
+ chromatic: {
8
+ viewports: [400, 800, 1199]
9
+ }
10
+ }
11
+ };
12
+
13
+ // prettier-ignore
14
+ const createStyles = () => html `
15
+ <style>
16
+ sb-arch-summary {
17
+ display: block;
18
+ }
19
+ </style>`;
20
+
21
+ // prettier-ignore
22
+ export const Base = () => html` ${createStyles()}
23
+ <sb-arch-summary
24
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
25
+ path="/"
26
+ pretitle="Pretitle by "
27
+ pretitle-link-href="/"
28
+ pretitle-link-title="Link"
29
+ title="Title"
30
+ >
31
+ <sb-arch-content-icon
32
+ slot="image"
33
+ src="/images/badge-1.png"
34
+ ></sb-arch-content-icon>
35
+ <button slot="action">Action</button>
36
+ <span slot="meta-left">Meta left</span>
37
+ <span slot="meta-right">Meta right</span>
38
+ </sb-arch-summary>
39
+ `;
40
+
41
+ // prettier-ignore
42
+ export const CustomPretitle = () => html` ${createStyles()}
43
+ <sb-arch-summary
44
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
45
+ path="/"
46
+ title="Title"
47
+ >
48
+ <sb-arch-content-icon
49
+ slot="image"
50
+ src="/images/badge-1.png"
51
+ ></sb-arch-content-icon>
52
+ <div slot="pretitle">
53
+ Pretitle by <a href="#">Link</a> (custom content)
54
+ </div>
55
+ <button slot="action">Action</button>
56
+ <span slot="meta-left">Meta left</span>
57
+ <span slot="meta-right">Meta right</span>
58
+ </sb-arch-summary>
59
+ `;
60
+
61
+ // prettier-ignore
62
+ export const Brick = () => html` ${createStyles()}
63
+ <sb-arch-summary
64
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
65
+ display-mode="brick"
66
+ path="/"
67
+ title="Title"
68
+ >
69
+ <sb-arch-content-icon
70
+ slot="image"
71
+ src="/images/badge-1.png"
72
+ size="small"
73
+ ></sb-arch-content-icon>
74
+
75
+ <div slot="pretitle">
76
+ Pretitle by <a href="#">Link</a> (custom content)
77
+ </div>
78
+ <button slot="action">Action</button>
79
+ <span slot="meta-left">Meta left</span>
80
+ <span slot="meta-right">Meta right</span>
81
+ </sb-arch-summary>
82
+ `;
83
+
84
+ // prettier-ignore
85
+ export const BrickTile = () => html` ${createStyles()}
86
+ <sb-arch-summary
87
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
88
+ display-mode="brick-tile"
89
+ path="/"
90
+ title="Title"
91
+ >
92
+ <sb-arch-content-icon
93
+ slot="image"
94
+ src="/images/badge-1.png"
95
+ size="small"
96
+ ></sb-arch-content-icon>
97
+
98
+ <div slot="pretitle">
99
+ Pretitle by <a href="#">Link</a> (custom content)
100
+ </div>
101
+ <button slot="action">Action</button>
102
+ <span slot="meta-left">Meta left</span>
103
+ <span slot="meta-right">Meta right</span>
104
+ </sb-arch-summary>
105
+ `;
106
+
107
+ // prettier-ignore
108
+ export const BrickCompact = () => html` ${createStyles()}
109
+ <sb-arch-summary
110
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
111
+ compact
112
+ display-mode="brick-tile"
113
+ path="/"
114
+ title="Title"
115
+ >
116
+ <sb-arch-content-icon
117
+ slot="image"
118
+ src="/images/badge-1.png"
119
+ size="small"
120
+ ></sb-arch-content-icon>
121
+
122
+ <div slot="pretitle">
123
+ Pretitle by <a href="#">Link</a> (custom content)
124
+ </div>
125
+ <button slot="action">Action</button>
126
+ <span slot="meta-left">Meta left</span>
127
+ <span slot="meta-right">Meta right</span>
128
+ </sb-arch-summary>
129
+ `;
130
+
131
+ // prettier-ignore
132
+ export const TitleButton = () => html` ${createStyles()}
133
+ <sb-arch-summary
134
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
135
+ pretitle="Pretitle by "
136
+ pretitle-link-href="/"
137
+ pretitle-link-title="Link"
138
+ title="Title"
139
+ title-mode="button"
140
+ >
141
+ <sb-arch-content-icon
142
+ slot="image"
143
+ src="/images/badge-1.png"
144
+ ></sb-arch-content-icon>
145
+ </sb-arch-summary>
146
+ `;
147
+
148
+ // prettier-ignore
149
+ export const TitleText = () => html` ${createStyles()}
150
+ <sb-arch-summary
151
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
152
+ pretitle="Pretitle by "
153
+ pretitle-link-href="/"
154
+ pretitle-link-title="Link"
155
+ title="Title"
156
+ title-mode="text"
157
+ >
158
+ <sb-arch-content-icon
159
+ slot="image"
160
+ src="/images/badge-1.png"
161
+ ></sb-arch-content-icon>
162
+ </sb-arch-summary>
163
+ `;
@@ -0,0 +1,96 @@
1
+ import { api, LightningElement } from 'lwc';
2
+
3
+ type TitleMode = 'anchor' | 'button' | 'text';
4
+
5
+ export const mediaQueryTile = window.matchMedia(`(max-width: 640px)`);
6
+
7
+ export default class extends LightningElement {
8
+ @api actionsAlignment: 'start' | 'center' | 'end' = 'start';
9
+ @api compact: boolean | string | null = null;
10
+ @api description: string | null = null;
11
+ @api displayMode: 'brick' | 'brick-tile' | 'tile' = 'tile';
12
+ @api path: string | null = null;
13
+ @api pathTarget: string | null = null;
14
+ @api pretitle: string | null = null;
15
+ @api pretitleLinkHref: string | null = null;
16
+ @api pretitleLinkTarget: string | null = null;
17
+ @api pretitleLinkTitle: string | null = null;
18
+ @api title: string = '';
19
+ @api titleHeadingLevel: '1' | '2' | '3' | '4' | null = null;
20
+
21
+ private _titleMode: TitleMode = 'anchor';
22
+
23
+ @api
24
+ get titleMode(): TitleMode {
25
+ // Backwards compatability
26
+ if (this._titleMode === 'anchor' && !this.path) {
27
+ if (process.env.NODE_ENV === 'development') {
28
+ console.warn(
29
+ `title-mode was set to "anchor" but is missing "path" attribute, falling back to "button"`
30
+ );
31
+ }
32
+ return 'button';
33
+ }
34
+ return this._titleMode;
35
+ }
36
+
37
+ set titleMode(value) {
38
+ this._titleMode = value;
39
+ }
40
+
41
+ private isTile = true;
42
+
43
+ connectedCallback() {
44
+ this.onMediaQueryTile(mediaQueryTile);
45
+ mediaQueryTile.addListener(this.onMediaQueryTile);
46
+ }
47
+
48
+ disconnectedCallback() {
49
+ mediaQueryTile.removeListener(this.onMediaQueryTile);
50
+ }
51
+
52
+ private get isCompact() {
53
+ return typeof this.compact === 'boolean'
54
+ ? this.compact
55
+ : this.compact !== null;
56
+ }
57
+
58
+ private onMediaQueryTile = () => {
59
+ this.isTile =
60
+ this.displayMode === 'tile' ||
61
+ (this.displayMode === 'brick-tile' && mediaQueryTile.matches);
62
+ };
63
+
64
+ private onSlotChange() {
65
+ const slots = Array.from(
66
+ this.template.querySelectorAll('slot')
67
+ ) as HTMLSlotElement[];
68
+ const slotNames = slots
69
+ .filter((slot) => slot.assignedNodes()[0])
70
+ .map((slot) => slot.getAttribute('name'))
71
+ .join(' ');
72
+ this.template
73
+ .querySelector('.summary')!
74
+ .setAttribute('data-slots', slotNames);
75
+ }
76
+
77
+ private onTitleButtonClick() {
78
+ this.dispatchEvent(new CustomEvent('navigate'));
79
+ }
80
+
81
+ private get showDescription() {
82
+ return !this.isCompact;
83
+ }
84
+
85
+ private get titleIsAnchor() {
86
+ return this.titleMode === 'anchor';
87
+ }
88
+
89
+ private get titleIsButton() {
90
+ return this.titleMode === 'button';
91
+ }
92
+
93
+ private get titleIsText() {
94
+ return this.titleMode === 'text';
95
+ }
96
+ }
@@ -0,0 +1,3 @@
1
+ :host {
2
+ display: block;
3
+ }
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <template if:true={loaded}>
3
+ <slot></slot>
4
+ </template>
5
+ </template>
@@ -0,0 +1,46 @@
1
+ import { LightningElement, api } from 'lwc';
2
+
3
+ let uid = 0;
4
+
5
+ export type TabElement = {
6
+ label: string;
7
+ load: () => void;
8
+ title: string;
9
+ unload: () => void;
10
+ value: string;
11
+ };
12
+
13
+ export default class extends LightningElement {
14
+ @api label: string | null = null;
15
+ @api value: string | null = null;
16
+
17
+ private loaded: boolean = false;
18
+
19
+ @api load() {
20
+ this.loaded = true;
21
+ }
22
+
23
+ @api unload() {
24
+ this.loaded = false;
25
+ }
26
+
27
+ connectedCallback() {
28
+ setTimeout(()=> {
29
+ this.dispatchEvent(
30
+ new CustomEvent('privatetabregister', {
31
+ cancelable: true,
32
+ bubbles: true,
33
+ composed: true,
34
+ detail: {
35
+ label: this.label,
36
+ title: this.title || this.label,
37
+ value: this.value || `tab-${uid++}`,
38
+ load: () => this.load(),
39
+ unload: () => this.unload()
40
+ }
41
+ })
42
+ );
43
+
44
+ }, 0);
45
+ }
46
+ }
@@ -0,0 +1,112 @@
1
+ @import "arch/reset";
2
+
3
+ .tablist {
4
+ display: flex;
5
+ align-items: flex-start;
6
+ list-style: none;
7
+ margin: 0;
8
+ padding: 0;
9
+ border-bottom: 1px solid var(--arch-color-fog);
10
+ }
11
+
12
+ .tab {
13
+ position: relative;
14
+ color: var(--arch-color-meteorite);
15
+ padding: 0 var(--arch-spacing-3);
16
+ margin-bottom: -1px;
17
+ height: var(--arch-spacing-10);
18
+ line-height: var(--arch-spacing-10);
19
+ box-shadow: inset 0 0 var(--arch-color-ocean);
20
+ transition: box-shadow var(--arch-duration-normal);
21
+ }
22
+
23
+ .tab:hover {
24
+ box-shadow: inset 0 -2px var(--arch-color-ocean);
25
+ }
26
+
27
+ .tab[aria-hidden="true"] {
28
+ visibility: hidden;
29
+ }
30
+
31
+ .tab-active {
32
+ font-weight: bold;
33
+ color: var(--arch-color-black);
34
+ box-shadow: inset 0 -3px var(--arch-color-ocean) !important;
35
+ }
36
+
37
+ .tab > a {
38
+ max-width: 100%;
39
+ overflow: hidden;
40
+ text-overflow: ellipsis;
41
+ white-space: nowrap;
42
+ display: flex;
43
+ align-items: center;
44
+ text-decoration: none;
45
+ cursor: pointer;
46
+ color: inherit;
47
+ border: 0;
48
+ text-transform: inherit;
49
+ z-index: 1;
50
+ outline: none !important;
51
+ }
52
+
53
+ .tab > a:focus {
54
+ text-decoration: underline;
55
+ }
56
+
57
+ .tabpanel[aria-hidden="true"] {
58
+ display: none;
59
+ }
60
+
61
+ .tabpanel {
62
+ position: relative;
63
+ padding: var(--arch-spacing-4) 0;
64
+ }
65
+
66
+ .overflow-tab {
67
+ position: relative;
68
+ }
69
+
70
+ .overflow-tab-icon {
71
+ margin-left: var(--arch-spacing-1);
72
+ }
73
+
74
+ .menu {
75
+ background-color: var(--arch-color-white);
76
+ border-radius: var(--arch-radius-md);
77
+ border: 1px solid var(--arch-color-fog);
78
+ box-shadow: var(--arch-shadow-sm);
79
+ margin-top: var(--arch-spacing-2);
80
+ position: absolute;
81
+ top: 100%;
82
+ right: 0;
83
+ z-index: 9999;
84
+ padding: var(--arch-spacing-1) 0;
85
+ outline: 0;
86
+ }
87
+
88
+ .menu-item {
89
+ position: relative;
90
+ display: flex;
91
+ justify-content: space-between;
92
+ align-items: center;
93
+ padding: var(--arch-spacing-2) var(--arch-spacing-3);
94
+ color: var(--arch-color-black);
95
+ white-space: nowrap;
96
+ cursor: pointer;
97
+ font-size: var(--arch-font-size-sm);
98
+ line-height: var(--arch-line-height-normal);
99
+ outline: 0;
100
+ }
101
+
102
+ .menu-item > span {
103
+ max-width: 100%;
104
+ overflow: hidden;
105
+ text-overflow: ellipsis;
106
+ white-space: nowrap;
107
+ }
108
+
109
+ .menu-item[data-active="true"],
110
+ .menu-item:hover {
111
+ background-color: var(--arch-color-sand);
112
+ }
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <div onprivatetabregister={handleTabRegister}>
3
+ <ul role="tablist" class="tablist" onkeydown={handleKeyDown}>
4
+ <template for:each={tabs} for:item="tab">
5
+ <li
6
+ key={tab.value}
7
+ role="presentation"
8
+ title={tab.title}
9
+ class={tab.className}
10
+ if:false={tab.overflow}
11
+ >
12
+ <a
13
+ id={tab.labelId}
14
+ role="tab"
15
+ tabindex={tab.tabindex}
16
+ aria-selected={tab.active}
17
+ data-value={tab.value}
18
+ onclick={tab.onselect}
19
+ aria-controls="tabpanel"
20
+ >
21
+ {tab.label}
22
+ </a>
23
+ </li>
24
+ </template>
25
+ <li class="tab overflow-tab" aria-hidden={isOverflowHidden}>
26
+ <a tabindex="0" data-menu="trigger">
27
+ {labels.overflowButton}
28
+ <arch-icon
29
+ class="overflow-tab-icon"
30
+ symbol="chevrondown"
31
+ size="small"
32
+ ></arch-icon>
33
+ </a>
34
+
35
+ <div data-menu="menu" id="menu" class="menu">
36
+ <template for:each={tabs} for:item="tab">
37
+ <a
38
+ if:true={tab.overflow}
39
+ key={tab.value}
40
+ class="menu-item"
41
+ data-menu="item"
42
+ data-value={tab.value}
43
+ onclick={tab.onmenuselect}
44
+ >
45
+ {tab.label}
46
+ </a>
47
+ </template>
48
+ </div>
49
+ </li>
50
+ </ul>
51
+
52
+ <div
53
+ id="tabpanel"
54
+ class="tabpanel"
55
+ role="tabpanel"
56
+ aria-labelledby="active-tab"
57
+ tabindex="0"
58
+ >
59
+ <slot></slot>
60
+ </div>
61
+ </div>
62
+ </template>