@salesforcedevs/dx-components 0.28.4 → 0.31.0-alpha.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 (32) hide show
  1. package/lwc.config.json +8 -1
  2. package/package.json +4 -4
  3. package/src/assets/svg/no-results-combined.svg +80 -0
  4. package/src/modules/base-elements/matchMediaElement/matchMediaElement.ts +59 -0
  5. package/src/modules/dx/button/button.css +8 -0
  6. package/src/modules/dx/button/button.ts +3 -0
  7. package/src/modules/dx/cardExpanded/cardExpanded.css +2 -1
  8. package/src/modules/dx/cardExpanded/cardExpanded.html +1 -2
  9. package/src/modules/dx/cardExpanded/cardExpanded.ts +0 -1
  10. package/src/modules/dx/cardNews/cardNews.html +1 -0
  11. package/src/modules/dx/cardNews/cardNews.ts +2 -0
  12. package/src/modules/dx/checkbox/checkbox.ts +1 -0
  13. package/src/modules/dx/checkboxNative/checkboxNative.css +21 -0
  14. package/src/modules/dx/checkboxNative/checkboxNative.html +14 -0
  15. package/src/modules/dx/checkboxNative/checkboxNative.ts +38 -0
  16. package/src/modules/dx/contentArchive/contentArchive.css +246 -0
  17. package/src/modules/dx/contentArchive/contentArchive.html +336 -0
  18. package/src/modules/dx/contentArchive/contentArchive.ts +444 -0
  19. package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +33 -31
  20. package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +1 -0
  21. package/src/modules/dx/filterMenu/filterMenu.css +106 -0
  22. package/src/modules/dx/filterMenu/filterMenu.html +107 -0
  23. package/src/modules/dx/filterMenu/filterMenu.ts +104 -0
  24. package/src/modules/dx/headerNav/headerNav.ts +1 -1
  25. package/src/modules/dx/modalDrawer/modalDrawer.css +1 -0
  26. package/src/modules/dx/spinner/spinner.css +0 -7
  27. package/src/modules/dx/topics/topics.css +1 -0
  28. package/src/modules/utils/constants/breakpoints.ts +9 -0
  29. package/src/modules/utils/constants/constants.ts +1 -0
  30. package/src/modules/utils/contentArchive/altData.js +3 -0
  31. package/src/modules/utils/contentArchive/contentArchive.ts +163 -0
  32. package/LICENSE +0 -12
@@ -0,0 +1,246 @@
1
+ @import "helpers/reset";
2
+
3
+ .container {
4
+ display: flex;
5
+ flex-direction: column;
6
+ height: 100%;
7
+ width: 100%;
8
+ padding: 0 40px;
9
+ max-width: 1390px;
10
+ margin: 0 auto;
11
+ }
12
+
13
+ .modal-loading {
14
+ padding: 16px;
15
+ }
16
+
17
+ .filter-container {
18
+ width: 100%;
19
+ }
20
+
21
+ .filter-header-container {
22
+ display: flex;
23
+ justify-content: space-between;
24
+ }
25
+
26
+ .filter-clear-btn {
27
+ color: var(--dx-g-blue-vibrant-50);
28
+ font-family: var(--dx-g-font-display);
29
+ font-size: 14px;
30
+ }
31
+
32
+ .results-heading,
33
+ .posts-month {
34
+ color: var(--dx-g-text-heading-color);
35
+ font-family: var(--dx-g-font-display);
36
+ font-size: 20px;
37
+ letter-spacing: -0.4px;
38
+ line-height: 28px;
39
+ margin-top: 40px;
40
+ }
41
+
42
+ .posts-month {
43
+ margin-bottom: 11px;
44
+ }
45
+
46
+ hr {
47
+ margin-top: 20px;
48
+ margin-bottom: 28px;
49
+ }
50
+
51
+ .content-container {
52
+ width: 100%;
53
+ }
54
+
55
+ .content-info-container {
56
+ display: flex;
57
+ justify-content: space-between;
58
+ margin-top: 60px;
59
+ }
60
+
61
+ .card-type-group {
62
+ display: flex;
63
+ }
64
+
65
+ .min-card-btn,
66
+ .exp-card-btn {
67
+ font-size: 14px;
68
+ color: var(--dx-g-blue-vibrant-20);
69
+ font-family: var(--dx-g-font-display);
70
+ }
71
+
72
+ .btn-active {
73
+ color: var(--dx-g-blue-vibrant-50);
74
+ text-decoration: underline 2px;
75
+ text-underline-offset: 2px;
76
+ }
77
+
78
+ .min-card-btn {
79
+ margin-left: 10px;
80
+ }
81
+
82
+ .min-card-btn:hover,
83
+ .exp-card-btn:hover {
84
+ color: var(--dx-g-blue-vibrant-50);
85
+ }
86
+
87
+ button:focus,
88
+ button:active {
89
+ outline: none;
90
+ }
91
+
92
+ .spinner-container {
93
+ position: relative;
94
+ margin-top: 85px;
95
+ }
96
+
97
+ .pagination-container {
98
+ display: flex;
99
+ justify-content: center;
100
+ margin-top: 36px;
101
+ }
102
+
103
+ .empty-state-container {
104
+ background-image: url(/assets/svg/no-results-combined.svg);
105
+ background-repeat: no-repeat;
106
+ background-position: center;
107
+ background-size: contain;
108
+ display: flex;
109
+ justify-content: center;
110
+ align-items: center;
111
+ height: 170px;
112
+ width: 100%;
113
+ }
114
+
115
+ .empty-state-text {
116
+ color: var(--dx-g-blue-vibrant-20);
117
+ font-family: var(--dx-g-font-display);
118
+ font-size: 12px;
119
+ text-align: center;
120
+ width: 130px;
121
+ }
122
+
123
+ .filter-title {
124
+ font-family: var(--dx-g-font-display);
125
+ font-size: var(--dx-g-text-lg);
126
+ }
127
+
128
+ .filter-content {
129
+ color: var(--dx-g-blue-vibrant-50);
130
+ font-family: var(--dx-g-font-display);
131
+ font-size: 14px;
132
+ width: 100%;
133
+ height: 100%;
134
+ display: inline-flex;
135
+ }
136
+
137
+ dx-modal-drawer {
138
+ width: 300px;
139
+ }
140
+
141
+ dx-icon {
142
+ display: inline;
143
+ margin-left: 5px;
144
+ }
145
+
146
+ .content-page-length {
147
+ font-size: 14px;
148
+ }
149
+
150
+ dx-card-minimal:not(first-of-type) {
151
+ margin-top: 14px;
152
+ }
153
+
154
+ dx-card-expanded:not(:first-of-type) {
155
+ margin-top: 22.5px;
156
+ }
157
+
158
+ dx-filter-menu {
159
+ --dx-c-filter-menu-margin: 16px 0;
160
+ }
161
+
162
+ .filter-chips-container {
163
+ display: flex;
164
+ flex-direction: column;
165
+ gap: 25px;
166
+ margin-top: 23px;
167
+ }
168
+
169
+ .chip-item-container {
170
+ display: flex;
171
+ flex-wrap: wrap;
172
+ align-items: center;
173
+ gap: 8px;
174
+ }
175
+
176
+ .chip-title,
177
+ .chip-item {
178
+ font-size: 14px;
179
+ font-family: var(--dx-g-font-sans);
180
+ }
181
+
182
+ .chip-title {
183
+ font-weight: bold;
184
+ color: rgb(24, 24, 24);
185
+ }
186
+
187
+ .chip-item {
188
+ border: 2px solid rgb(92, 92, 92);
189
+ border-radius: 4px;
190
+ color: rgb(92, 92, 92);
191
+ font-weight: 600;
192
+ padding: 2px 4px;
193
+ }
194
+
195
+ .chip-item dx-button {
196
+ margin-left: 4px;
197
+
198
+ --dx-c-button-primary-color: inherit;
199
+ }
200
+
201
+ /* TABLET */
202
+ @media screen and (min-width: 768px) {
203
+ .container {
204
+ flex-direction: row;
205
+ }
206
+
207
+ .filter-container {
208
+ margin-top: 56px;
209
+ min-width: 220px;
210
+ max-width: 300px;
211
+ }
212
+
213
+ .empty-state-container {
214
+ background-size: 550px 100%;
215
+ height: 250px;
216
+ }
217
+
218
+ .empty-state-text {
219
+ font-size: 18px;
220
+ width: 177px;
221
+ }
222
+
223
+ .content-container {
224
+ margin-left: 30.5px;
225
+ }
226
+
227
+ .results-heading {
228
+ font-size: 24px;
229
+ }
230
+ }
231
+
232
+ /* DESKTOP */
233
+ @media screen and (min-width: 1024px) {
234
+ .content-container {
235
+ margin-left: 62px;
236
+ }
237
+
238
+ .empty-state-container {
239
+ height: 350px;
240
+ }
241
+
242
+ .results-heading {
243
+ font-size: 32px;
244
+ margin-top: 42px;
245
+ }
246
+ }
@@ -0,0 +1,336 @@
1
+ <template>
2
+ <dx-featured-content-header
3
+ class="documentation_header"
4
+ title="Content Archive"
5
+ dark="true"
6
+ no-swoop={isMobile}
7
+ ></dx-featured-content-header>
8
+ <div class="container">
9
+ <template if:true={isMobile}>
10
+ <dx-modal-drawer open={modalOpen} onclickclose={toggleModal}>
11
+ <img
12
+ if:true={filtersLoading}
13
+ src="/assets/svg/sidebar-loading.svg"
14
+ alt="loading"
15
+ class="modal-loading"
16
+ />
17
+ <template if:false={filtersLoading}>
18
+ <div class="filter-header-container">
19
+ <p class="filter-title">Filters</p>
20
+ <button
21
+ onclick={handleFilterClear}
22
+ class="filter-clear-btn"
23
+ >
24
+ Clear all
25
+ </button>
26
+ </div>
27
+ <dx-filter-menu
28
+ name="site"
29
+ title={contentTypeTitle}
30
+ options={contentTypeList}
31
+ onchange={updateSelectedFilters}
32
+ ></dx-filter-menu>
33
+ <dx-filter-menu
34
+ name="dates"
35
+ title={dateTitle}
36
+ options={dateList}
37
+ variant="nested"
38
+ onchange={updateSelectedFilters}
39
+ ></dx-filter-menu>
40
+ <template if:false={hideBlogFilters}>
41
+ <dx-filter-menu
42
+ name="authors"
43
+ title={authorTitle}
44
+ options={authorList}
45
+ onchange={updateSelectedFilters}
46
+ ></dx-filter-menu>
47
+ </template>
48
+ <dx-filter-menu
49
+ name="categories"
50
+ title={categoryTitle}
51
+ options={categoryList}
52
+ onchange={updateSelectedFilters}
53
+ ></dx-filter-menu>
54
+ </template>
55
+ </dx-modal-drawer>
56
+ </template>
57
+ <div class="filter-container">
58
+ <template if:false={isMobile}>
59
+ <img
60
+ if:true={filtersLoading}
61
+ src="/assets/svg/sidebar-loading.svg"
62
+ alt="loading"
63
+ />
64
+ <template if:false={filtersLoading}>
65
+ <div class="filter-header-container">
66
+ <p class="filter-title">Filters</p>
67
+ <button
68
+ onclick={handleFilterClear}
69
+ class="filter-clear-btn"
70
+ >
71
+ Clear all
72
+ </button>
73
+ </div>
74
+ <dx-filter-menu
75
+ name="site"
76
+ title={contentTypeTitle}
77
+ options={contentTypeList}
78
+ onchange={updateSelectedFilters}
79
+ ></dx-filter-menu>
80
+ <dx-filter-menu
81
+ name="dates"
82
+ title={dateTitle}
83
+ options={dateList}
84
+ variant="nested"
85
+ onchange={updateSelectedFilters}
86
+ ></dx-filter-menu>
87
+ <template if:false={hideBlogFilters}>
88
+ <dx-filter-menu
89
+ name="authors"
90
+ title={authorTitle}
91
+ options={authorList}
92
+ onchange={updateSelectedFilters}
93
+ ></dx-filter-menu>
94
+ </template>
95
+ <dx-filter-menu
96
+ name="categories"
97
+ title={categoryTitle}
98
+ options={categoryList}
99
+ onchange={updateSelectedFilters}
100
+ ></dx-filter-menu>
101
+ </template>
102
+ </template>
103
+ <template if:true={isMobile}>
104
+ <div class="content-info-container">
105
+ <button class="filter-content" onclick={toggleModal}>
106
+ Filter
107
+ <span>
108
+ <dx-icon
109
+ class="filter-icon"
110
+ symbol="filter"
111
+ sprite="action"
112
+ size="small"
113
+ ></dx-icon>
114
+ </span>
115
+ </button>
116
+ <div class="card-type-group">
117
+ <button
118
+ onclick={handleCardTypeChange}
119
+ value="expanded"
120
+ class={expandedCardClass}
121
+ >
122
+ Expanded
123
+ </button>
124
+ <button
125
+ onclick={handleCardTypeChange}
126
+ value="minimal"
127
+ class={minimalCardClass}
128
+ >
129
+ Minimal
130
+ </button>
131
+ </div>
132
+ </div>
133
+ </template>
134
+ </div>
135
+ <div class="content-container">
136
+ <div class="content-info-container">
137
+ <p class="content-page-length">{currentPageLength}</p>
138
+ <template if:false={isMobile}>
139
+ <div class="card-type-group">
140
+ <button
141
+ onclick={handleCardTypeChange}
142
+ value="expanded"
143
+ class={expandedCardClass}
144
+ >
145
+ Expanded
146
+ </button>
147
+ <button
148
+ onclick={handleCardTypeChange}
149
+ value="minimal"
150
+ class={minimalCardClass}
151
+ >
152
+ Minimal
153
+ </button>
154
+ </div>
155
+ </template>
156
+ </div>
157
+ <div class="filter-chips-container">
158
+ <template if:true={selectedFilterMenuData.site.length}>
159
+ <div class="chip-item-container">
160
+ <p class="chip-title">Type</p>
161
+ <template
162
+ for:each={selectedFilterMenuData.site}
163
+ for:item="postType"
164
+ >
165
+ <span class="chip-item" key={postType.name}>
166
+ {postType.name}
167
+ <dx-button
168
+ name="site"
169
+ value={postType}
170
+ onclick={removeFilterItem}
171
+ variant="inline"
172
+ >
173
+ &#10005;
174
+ </dx-button>
175
+ </span>
176
+ </template>
177
+ </div>
178
+ </template>
179
+ <template if:true={selectedFilterMenuData.dates.length}>
180
+ <div class="chip-item-container">
181
+ <p class="chip-title">Date</p>
182
+ <template
183
+ for:each={selectedFilterMenuData.dates}
184
+ for:item="date"
185
+ >
186
+ <span class="chip-item" key={date}>
187
+ {date.name}
188
+ <dx-button
189
+ name="dates"
190
+ onclick={removeFilterItem}
191
+ value={date}
192
+ variant="inline"
193
+ >
194
+ &#10005;
195
+ </dx-button>
196
+ </span>
197
+ </template>
198
+ </div>
199
+ </template>
200
+ <template if:true={selectedFilterMenuData.authors.length}>
201
+ <div class="chip-item-container">
202
+ <p class="chip-title">Author</p>
203
+ <template
204
+ for:each={selectedFilterMenuData.authors}
205
+ for:item="author"
206
+ >
207
+ <span class="chip-item" key={author.name}>
208
+ {author.name}
209
+ <dx-button
210
+ name="authors"
211
+ value={author}
212
+ onclick={removeFilterItem}
213
+ variant="inline"
214
+ >
215
+ &#10005;
216
+ </dx-button>
217
+ </span>
218
+ </template>
219
+ </div>
220
+ </template>
221
+ <template if:true={selectedFilterMenuData.categories.length}>
222
+ <div class="chip-item-container">
223
+ <p class="chip-title">Category</p>
224
+ <template
225
+ for:each={selectedFilterMenuData.categories}
226
+ for:item="category"
227
+ >
228
+ <span class="chip-item" key={category.name}>
229
+ {category.name}
230
+ <dx-button
231
+ name="categories"
232
+ value={category}
233
+ onclick={removeFilterItem}
234
+ variant="inline"
235
+ >
236
+ &#10005;
237
+ </dx-button>
238
+ </span>
239
+ </template>
240
+ </div>
241
+ </template>
242
+ </div>
243
+ <h3 class="results-heading" if:false={loading}>{resultsHeading}</h3>
244
+ <hr />
245
+ <template if:true={loading}>
246
+ <template if:false={modalOpen}>
247
+ <div class="spinner-container">
248
+ <dx-spinner
249
+ size={spinnerSize}
250
+ variant="brand"
251
+ ></dx-spinner>
252
+ </div>
253
+ </template>
254
+ </template>
255
+ <template if:false={loading}>
256
+ <template if:false={isEmptyState}>
257
+ <template if:true={isMinimalCard}>
258
+ <template
259
+ for:each={postsByMonth}
260
+ for:item="postByMonth"
261
+ >
262
+ <template iterator:it={postByMonth}>
263
+ <h3
264
+ key={it.value}
265
+ class="posts-month"
266
+ if:true={it.first}
267
+ >
268
+ {it.value}
269
+ </h3>
270
+ <template
271
+ if:false={it.first}
272
+ for:each={it.value}
273
+ for:item="post"
274
+ >
275
+ <dx-card-minimal
276
+ key={post.id}
277
+ content-type={post.contentType}
278
+ title={post.title}
279
+ href={post.href}
280
+ ></dx-card-minimal>
281
+ </template>
282
+ </template>
283
+ </template>
284
+ </template>
285
+ <template for:each={posts} for:item="post">
286
+ <template if:false={isMinimalCard}>
287
+ <template if:true={post.author}>
288
+ <dx-card-expanded
289
+ key={post.id}
290
+ title={post.title}
291
+ content-type={post.contentType}
292
+ href={post.href}
293
+ date={post.date}
294
+ body={post.excerpt}
295
+ author-img-src={post.authorImgSrc}
296
+ author-label={post.author.name}
297
+ topics={post.topics}
298
+ length={post.duration}
299
+ ></dx-card-expanded>
300
+ </template>
301
+ <template if:false={post.author}>
302
+ <dx-card-expanded
303
+ key={post.id}
304
+ title={post.title}
305
+ content-type={post.contentType}
306
+ href={post.href}
307
+ date={post.date}
308
+ body={post.excerpt}
309
+ topics={post.topics}
310
+ length={post.duration}
311
+ ></dx-card-expanded>
312
+ </template>
313
+ </template>
314
+ </template>
315
+ <template if:true={showPagination}>
316
+ <div class="pagination-container">
317
+ <dx-pagination
318
+ current-page={currentPage}
319
+ total-pages={totalPages}
320
+ onpagechange={goToPage}
321
+ pages-to-show="5"
322
+ ></dx-pagination>
323
+ </div>
324
+ </template>
325
+ </template>
326
+ </template>
327
+ <template if:true={isEmptyState}>
328
+ <div class="empty-state-container">
329
+ <p class="empty-state-text">
330
+ Please try a different filter selection.
331
+ </p>
332
+ </div>
333
+ </template>
334
+ </div>
335
+ </div>
336
+ </template>