@salesforcedevs/arch-components 1.20.17-alpha13 → 1.20.17-alpha15

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 (146) hide show
  1. package/package.json +1 -1
  2. package/src/assets/css/arch-variables.css +512 -0
  3. package/src/modules/arch/badge/badge.css +22 -0
  4. package/src/modules/arch/badge/badge.html +5 -0
  5. package/src/modules/arch/badge/badge.ts +9 -0
  6. package/src/modules/arch/button/button.css +1 -0
  7. package/src/modules/arch/button/button.html +20 -0
  8. package/src/modules/arch/button/button.ts +67 -0
  9. package/src/modules/arch/buttonLink/buttonLink.css +1 -0
  10. package/src/modules/arch/buttonLink/buttonLink.html +19 -0
  11. package/src/modules/arch/buttonLink/buttonLink.stories.js +24 -0
  12. package/src/modules/arch/buttonLink/buttonLink.ts +8 -0
  13. package/src/modules/arch/buttonStyles/buttonStyles.css +220 -0
  14. package/src/modules/arch/card/card.css +128 -0
  15. package/src/modules/arch/card/card.html +85 -0
  16. package/src/modules/arch/card/card.ts +277 -0
  17. package/src/modules/arch/cardBase/cardBase.css +11 -0
  18. package/src/modules/arch/cardBase/cardBase.html +2 -0
  19. package/src/modules/arch/cardGridA/cardGridA.css +11 -0
  20. package/src/modules/arch/cardGridA/cardGridA.html +21 -0
  21. package/src/modules/arch/cardGridA/cardGridA.stories.js +107 -0
  22. package/src/modules/arch/cardGridA/cardGridA.ts +24 -0
  23. package/src/modules/arch/cardGridC/cardGridC.css +24 -0
  24. package/src/modules/arch/cardGridC/cardGridC.html +22 -0
  25. package/src/modules/arch/cardGridC/cardGridC.stories.js +42 -0
  26. package/src/modules/arch/cardGridC/cardGridC.ts +11 -0
  27. package/src/modules/arch/cardGridD/cardGridD.css +17 -0
  28. package/src/modules/arch/cardGridD/cardGridD.html +20 -0
  29. package/src/modules/arch/cardGridD/cardGridD.stories.js +34 -0
  30. package/src/modules/arch/cardGridD/cardGridD.ts +7 -0
  31. package/src/modules/arch/cardNew/cardNew.css +31 -0
  32. package/src/modules/arch/cardNew/cardNew.html +32 -0
  33. package/src/modules/arch/cardNew/cardNew.ts +66 -0
  34. package/src/modules/arch/children/children.html +2 -0
  35. package/src/modules/arch/children/children.ts +31 -0
  36. package/src/modules/arch/color/color.ts +59 -0
  37. package/src/modules/arch/content/__fixtures__/index.ts +884 -0
  38. package/src/modules/arch/content/content.css +643 -0
  39. package/src/modules/arch/content/content.html +65 -0
  40. package/src/modules/arch/content/content.stories.js +14 -0
  41. package/src/modules/arch/content/content.ts +169 -0
  42. package/src/modules/arch/contentIcon/contentIcon.css +48 -0
  43. package/src/modules/arch/contentIcon/contentIcon.html +15 -0
  44. package/src/modules/arch/contentIcon/contentIcon.stories.js +110 -0
  45. package/src/modules/arch/contentIcon/contentIcon.ts +68 -0
  46. package/src/modules/arch/context/context.ts +21 -19
  47. package/src/modules/arch/contextAdapter/constants.ts +1 -0
  48. package/src/modules/arch/contextAdapter/contextAdapter.html +1 -0
  49. package/src/modules/arch/contextAdapter/contextAdapter.ts +54 -0
  50. package/src/modules/arch/debounce/debounce.ts +32 -0
  51. package/src/modules/arch/dialog/dialog.ts +154 -0
  52. package/src/modules/arch/dialogStyles/dialogStyles.css +90 -0
  53. package/src/modules/arch/effectAdapter/effectAdapter.ts +19 -9
  54. package/src/modules/arch/explorer/explorer.css +301 -0
  55. package/src/modules/arch/explorer/explorer.html +418 -0
  56. package/src/modules/arch/explorer/explorer.ts +718 -0
  57. package/src/modules/arch/explorer/types.d.ts +60 -0
  58. package/src/modules/arch/fetch/fetch.ts +55 -0
  59. package/src/modules/arch/footerMfe/footerMfe.html +3 -0
  60. package/src/modules/arch/footerMfe/footerMfe.ts +19 -0
  61. package/src/modules/arch/gallery/gallery.css +365 -0
  62. package/src/modules/arch/gallery/gallery.html +71 -0
  63. package/src/modules/arch/gallery/gallery.ts +366 -0
  64. package/src/modules/arch/gallery/types.d.ts +35 -0
  65. package/src/modules/arch/heading/heading.css +1 -0
  66. package/src/modules/arch/heading/heading.html +9 -0
  67. package/src/modules/arch/heading/heading.ts +36 -0
  68. package/src/modules/arch/helpers/helpers.ts +141 -0
  69. package/src/modules/arch/heroA/heroA.css +116 -0
  70. package/src/modules/arch/heroA/heroA.html +28 -0
  71. package/src/modules/arch/heroA/heroA.stories.js +49 -0
  72. package/src/modules/arch/heroA/heroA.ts +53 -0
  73. package/src/modules/arch/heroB/heroB.css +79 -0
  74. package/src/modules/arch/heroB/heroB.html +27 -0
  75. package/src/modules/arch/heroB/heroB.stories.js +44 -0
  76. package/src/modules/arch/heroB/heroB.ts +26 -0
  77. package/src/modules/arch/i18n/i18n.ts +78 -0
  78. package/src/modules/arch/icon/icon.css +28 -0
  79. package/src/modules/arch/icon/icon.html +17 -0
  80. package/src/modules/arch/icon/icon.stories.js +18 -0
  81. package/src/modules/arch/icon/icon.ts +92 -0
  82. package/src/modules/arch/instrumentation/instrumentation.css +1 -0
  83. package/src/modules/arch/instrumentation/instrumentation.html +1 -0
  84. package/src/modules/arch/instrumentation/instrumentation.ts +113 -0
  85. package/src/modules/arch/labels/helpers.ts +25 -0
  86. package/src/modules/arch/labels/pointHelpers.ts +47 -0
  87. package/src/modules/arch/labels/timeHelpers.ts +182 -0
  88. package/src/modules/arch/labels/types.d.ts +5 -0
  89. package/src/modules/arch/logger/logger.ts +33 -0
  90. package/src/modules/arch/menu/menu.ts +260 -0
  91. package/src/modules/arch/overflow/overflow.ts +71 -0
  92. package/src/modules/arch/page/page.css +3 -0
  93. package/src/modules/arch/page/page.html +3 -0
  94. package/src/modules/arch/page/page.stories.js +10 -0
  95. package/src/modules/arch/page/page.ts +3 -0
  96. package/src/modules/arch/pageHeaderA/pageHeaderA.css +82 -0
  97. package/src/modules/arch/pageHeaderA/pageHeaderA.html +24 -0
  98. package/src/modules/arch/pageHeaderA/pageHeaderA.stories.js +18 -0
  99. package/src/modules/arch/pageHeaderA/pageHeaderA.ts +51 -0
  100. package/src/modules/arch/pill/pill.css +70 -0
  101. package/src/modules/arch/pill/pill.html +17 -0
  102. package/src/modules/arch/pill/pill.ts +34 -0
  103. package/src/modules/arch/polling-request.ts +97 -0
  104. package/src/modules/arch/reflectedElement/reflectedElement.html +2 -0
  105. package/src/modules/arch/reflectedElement/reflectedElement.ts +5 -3
  106. package/src/modules/arch/reset/reset.css +39 -0
  107. package/src/modules/arch/searchList/searchList.css +120 -0
  108. package/src/modules/arch/searchList/searchList.html +46 -0
  109. package/src/modules/arch/searchList/searchList.ts +53 -0
  110. package/src/modules/arch/sectionA/sectionA.css +64 -0
  111. package/src/modules/arch/sectionA/sectionA.html +21 -0
  112. package/src/modules/arch/sectionA/sectionA.stories.js +18 -0
  113. package/src/modules/arch/sectionA/sectionA.ts +27 -0
  114. package/src/modules/arch/select/select.css +40 -0
  115. package/src/modules/arch/select/select.html +24 -0
  116. package/src/modules/arch/select/select.ts +64 -0
  117. package/src/modules/arch/socialShare/socialShare.css +50 -0
  118. package/src/modules/arch/socialShare/socialShare.html +56 -0
  119. package/src/modules/arch/socialShare/socialShare.ts +29 -0
  120. package/src/modules/arch/spinner/spinner.css +195 -0
  121. package/src/modules/arch/spinner/spinner.html +9 -0
  122. package/src/modules/arch/spinner/spinner.ts +15 -0
  123. package/src/modules/arch/styles/styles.css +24 -0
  124. package/src/modules/arch/summary/summary.css +134 -0
  125. package/src/modules/arch/summary/summary.html +71 -0
  126. package/src/modules/arch/summary/summary.stories.js +148 -0
  127. package/src/modules/arch/summary/summary.ts +96 -0
  128. package/src/modules/arch/tab/tab.css +3 -0
  129. package/src/modules/arch/tab/tab.html +5 -0
  130. package/src/modules/arch/tab/tab.ts +46 -0
  131. package/src/modules/arch/tabset/tabset.css +112 -0
  132. package/src/modules/arch/tabset/tabset.html +62 -0
  133. package/src/modules/arch/tabset/tabset.ts +244 -0
  134. package/src/modules/arch/testutils.ts +118 -0
  135. package/src/modules/arch/threeCardGrid/threeCardGrid.css +6 -0
  136. package/src/modules/arch/threeCardGrid/threeCardGrid.html +5 -0
  137. package/src/modules/arch/threeCardGrid/threeCardGrid.ts +3 -0
  138. package/src/modules/arch/track/track.ts +23 -0
  139. package/src/modules/arch/trailhead.ts +120 -0
  140. package/src/modules/arch/types.d.ts +1 -0
  141. package/src/modules/arch/useEffectAttr.ts +16 -0
  142. package/src/modules/arch/utils/utils.ts +20 -0
  143. package/src/modules/arch/withState.ts +21 -0
  144. package/src/modules/arch/xsfMfeEvents/xsfMfeEvents.html +1 -0
  145. package/src/modules/arch/xsfMfeEvents/xsfMfeEvents.ts +47 -0
  146. package/src/modules/arch/slot/slot.ts +0 -20
@@ -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,148 @@
1
+ import { html } from 'lit-html';
2
+
3
+ export default {
4
+ title: 'arch/arch-summary',
5
+ parameters: {
6
+ modules: ['/modules/arch-summary.js'],
7
+ chromatic: {
8
+ viewports: [400, 800, 1199]
9
+ }
10
+ }
11
+ };
12
+
13
+ export const Base = () => html`
14
+ <arch-summary
15
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
16
+ path="/"
17
+ pretitle="Pretitle by "
18
+ pretitle-link-href="/"
19
+ pretitle-link-title="Link"
20
+ title="Title"
21
+ >
22
+ <arch-content-icon
23
+ slot="image"
24
+ src="/images/badge-1.png"
25
+ ></arch-content-icon>
26
+ <button slot="action">Action</button>
27
+ <span slot="meta-left">Meta left</span>
28
+ <span slot="meta-right">Meta right</span>
29
+ </arch-summary>
30
+ `;
31
+
32
+ export const CustomPretitle = () => html`
33
+ <arch-summary
34
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
35
+ path="/"
36
+ title="Title"
37
+ >
38
+ <arch-content-icon
39
+ slot="image"
40
+ src="/images/badge-1.png"
41
+ ></arch-content-icon>
42
+ <div slot="pretitle">
43
+ Pretitle by <a href="#">Link</a> (custom content)
44
+ </div>
45
+ <button slot="action">Action</button>
46
+ <span slot="meta-left">Meta left</span>
47
+ <span slot="meta-right">Meta right</span>
48
+ </arch-summary>
49
+ `;
50
+
51
+ export const Brick = () => html`
52
+ <arch-summary
53
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
54
+ display-mode="brick"
55
+ path="/"
56
+ title="Title"
57
+ >
58
+ <arch-content-icon
59
+ slot="image"
60
+ src="/images/badge-1.png"
61
+ size="small"
62
+ ></arch-content-icon>
63
+
64
+ <div slot="pretitle">
65
+ Pretitle by <a href="#">Link</a> (custom content)
66
+ </div>
67
+ <button slot="action">Action</button>
68
+ <span slot="meta-left">Meta left</span>
69
+ <span slot="meta-right">Meta right</span>
70
+ </arch-summary>
71
+ `;
72
+
73
+ export const BrickTile = () => html`
74
+ <arch-summary
75
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
76
+ display-mode="brick-tile"
77
+ path="/"
78
+ title="Title"
79
+ >
80
+ <arch-content-icon
81
+ slot="image"
82
+ src="/images/badge-1.png"
83
+ size="small"
84
+ ></arch-content-icon>
85
+
86
+ <div slot="pretitle">
87
+ Pretitle by <a href="#">Link</a> (custom content)
88
+ </div>
89
+ <button slot="action">Action</button>
90
+ <span slot="meta-left">Meta left</span>
91
+ <span slot="meta-right">Meta right</span>
92
+ </arch-summary>
93
+ `;
94
+
95
+ export const BrickCompact = () => html`
96
+ <arch-summary
97
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
98
+ compact
99
+ display-mode="brick-tile"
100
+ path="/"
101
+ title="Title"
102
+ >
103
+ <arch-content-icon
104
+ slot="image"
105
+ src="/images/badge-1.png"
106
+ size="small"
107
+ ></arch-content-icon>
108
+
109
+ <div slot="pretitle">
110
+ Pretitle by <a href="#">Link</a> (custom content)
111
+ </div>
112
+ <button slot="action">Action</button>
113
+ <span slot="meta-left">Meta left</span>
114
+ <span slot="meta-right">Meta right</span>
115
+ </arch-summary>
116
+ `;
117
+
118
+ export const TitleButton = () => html`
119
+ <arch-summary
120
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
121
+ pretitle="Pretitle by "
122
+ pretitle-link-href="/"
123
+ pretitle-link-title="Link"
124
+ title="Title"
125
+ title-mode="button"
126
+ >
127
+ <arch-content-icon
128
+ slot="image"
129
+ src="/images/badge-1.png"
130
+ ></arch-content-icon>
131
+ </arch-summary>
132
+ `;
133
+
134
+ export const TitleText = () => html`
135
+ <arch-summary
136
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
137
+ pretitle="Pretitle by "
138
+ pretitle-link-href="/"
139
+ pretitle-link-title="Link"
140
+ title="Title"
141
+ title-mode="text"
142
+ >
143
+ <arch-content-icon
144
+ slot="image"
145
+ src="/images/badge-1.png"
146
+ ></arch-content-icon>
147
+ </arch-summary>
148
+ `;
@@ -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>