@asd20/ui 3.2.910 → 3.2.911

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "*.scss",
6
6
  "*.vue"
7
7
  ],
8
- "version": "3.2.910",
8
+ "version": "3.2.911",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -173,11 +173,11 @@ export default {
173
173
  }
174
174
 
175
175
  &--emergency {
176
- .asd20-notification__title,
177
- .asd20-notification__cta {
178
- color: #da2e0b;
179
- border-color: #da2e0b;
180
- }
176
+ // .asd20-notification__title,
177
+ // .asd20-notification__cta {
178
+ // color: #da2e0b;
179
+ // border-color: #da2e0b;
180
+ // }
181
181
  .asd20-icon {
182
182
  --line-color: #da2e0b;
183
183
  --fill-color: white;
@@ -196,11 +196,11 @@ export default {
196
196
  }
197
197
 
198
198
  &--alert {
199
- .asd20-notification__title,
200
- .asd20-notification__cta {
201
- color: #dabf50;
202
- border-color: #dabf50;
203
- }
199
+ // .asd20-notification__title,
200
+ // .asd20-notification__cta {
201
+ // color: #dabf50;
202
+ // border-color: #dabf50;
203
+ // }
204
204
  .asd20-icon {
205
205
  --line-color: black;
206
206
  --fill-color: #dabf50;
@@ -355,7 +355,7 @@ export default {
355
355
  &--emergency.asd20-notification--inline {
356
356
  box-shadow: 0 0 0 5px #da2e0b;
357
357
  .asd20-icon {
358
- --line-color: #white;
358
+ --line-color: #0e2c6c;
359
359
  --fill-color: #da2e0b;
360
360
  }
361
361
  }
@@ -378,6 +378,13 @@ export default {
378
378
  --fill-color: #dabf50;
379
379
  }
380
380
  }
381
+ &--alert.asd20-notification--inline {
382
+ box-shadow: 0 0 0 5px #dabf50;
383
+ .asd20-icon {
384
+ --line-color: #0e2c6c;
385
+ --fill-color: #dabf50;
386
+ }
387
+ }
381
388
  }
382
389
  @media (min-width: 768px) {
383
390
  .asd20-notification {
@@ -0,0 +1,82 @@
1
+ import { storiesOf } from '@storybook/vue'
2
+ import { withKnobs, boolean } from '@storybook/addon-knobs'
3
+
4
+ import mockPageMixin from '../../../mixins/mockPageMixin'
5
+
6
+ import Asd20ArticleDigestCompactTemplate from '.'
7
+ import pageQueryResult from '../../../data/page-queries/digest-page-query-result.json'
8
+ import notifications from '../../../data/messages/notifications'
9
+ import debounce from 'lodash-es/debounce'
10
+
11
+
12
+ const info = {
13
+ summary: 'Article Digest Compact Template',
14
+ }
15
+
16
+ const wrapper = {
17
+ mixins: [mockPageMixin],
18
+ components: {
19
+ Asd20ArticleDigestCompactTemplate,
20
+ },
21
+
22
+ data: () => ({
23
+ pageQueryResult,
24
+ keywords: '',
25
+ selectedCategories: [],
26
+ categoryOptions: [],
27
+ languageCode: 'en',
28
+ }),
29
+
30
+ computed: {
31
+ activeNotificationsByType() {
32
+ const empty = {
33
+ inline: [],
34
+ banner: [],
35
+ floating: [],
36
+ status: [],
37
+ }
38
+ return boolean('Show Notifications', true)
39
+ ? notifications || empty
40
+ : empty
41
+ },
42
+ },
43
+ watch: {
44
+ keywords: debounce(function(newVal, oldVal) {
45
+ if (newVal !== oldVal) {
46
+ this.loadAnnouncements(this.keywords, this.selectedCategories)
47
+ }
48
+ }, 500),
49
+ selectedCategories: debounce(function(newVal, oldVal) {
50
+ if (newVal !== oldVal) {
51
+ this.loadAnnouncements(this.keywords, this.selectedCategories)
52
+ }
53
+ }, 500),
54
+ },
55
+ }
56
+
57
+ const stories = storiesOf('Templates - Asd20ArticleDigestCompactTemplate', module)
58
+ stories.addDecorator(withKnobs)
59
+
60
+ stories.add(
61
+ 'Default',
62
+ () => ({
63
+ ...wrapper,
64
+ template: `
65
+ <Asd20ArticleDigestCompactTemplate
66
+ v-bind="templateProps"
67
+ :menu-open.sync="menuOpen"
68
+ :search-open.sync="searchOpen"
69
+ :keywords.sync="keywords"
70
+ :selected-categories.sync="selectedCategories"
71
+ :languageCode.sync="languageCode"
72
+
73
+ @announcements-in-view="loadAnnouncements"
74
+ @stories-in-view="loadStories"
75
+ @events-in-view="loadEvents"
76
+ @files-in-view="loadFiles"
77
+
78
+ :categoryOptions="categoryOptions"
79
+ />`,
80
+ }),
81
+ { info }
82
+ )
@@ -0,0 +1,566 @@
1
+ <template>
2
+ <div class="asd20-template-article-digest-compact">
3
+ <!-- Skip Nav -->
4
+ <asd20-skip-to />
5
+
6
+ <!-- Site Navigation -->
7
+ <asd20-site-navigation
8
+ :navigation="navigation"
9
+ :action-items="actionItems"
10
+ @update:menuOpen="$emit('update:menuOpen', $event)"
11
+ :menu-open="menuOpen"
12
+ @update:searchOpen="$emit('update:searchOpen', $event)"
13
+ :search-open="searchOpen"
14
+ :organization="organization"
15
+ :organization-options="organizationOptions"
16
+ >
17
+ </asd20-site-navigation>
18
+
19
+ <!-- Banner Notifications -->
20
+ <client-only>
21
+ <asd20-notification-group
22
+ :notifications="activeNotificationsByType.banner"
23
+ group-type="banner"
24
+ @dismiss="$emit('dismiss-notification', $event)"
25
+ @toggle-all="$emit('toggle-all')"
26
+ />
27
+ </client-only>
28
+
29
+ <!-- Page Header -->
30
+ <asd20-page-header
31
+ id="page-header"
32
+ v-if="pageHeaderContent"
33
+ v-bind="pageHeaderContent"
34
+ :organization="organization"
35
+ :organization-options="organizationOptions"
36
+ :languageCode="languageCode"
37
+ v-on="$listeners"
38
+ :breadcrumb-links="breadcrumbLinks"
39
+ >
40
+ <!-- Floating Notifications -->
41
+ <template slot="top">
42
+ <client-only>
43
+ <asd20-notification-group
44
+ class="asd20-notification-group--floating"
45
+ :notifications="activeNotificationsByType.floating"
46
+ :total-dismissed-notifications="totalDismissedNotifications"
47
+ group-type="floating"
48
+ @dismiss="$emit('dismiss-notification', $event)"
49
+ @toggle-all="$emit('toggle-all')"
50
+ ></asd20-notification-group>
51
+ </client-only>
52
+ </template>
53
+ <!-- <asd20-breadcrumb slot="top" :links="breadcrumbLinks"></asd20-breadcrumb> -->
54
+ </asd20-page-header>
55
+
56
+ <!-- Inline-Notifications -->
57
+ <client-only>
58
+ <asd20-notification-group
59
+ :notifications="activeNotificationsByType.inline"
60
+ group-type="inline"
61
+ @dismiss="$emit('dismiss-notification', $event)"
62
+ @toggle-all="$emit('toggle-all')"
63
+ ></asd20-notification-group>
64
+ </client-only>
65
+
66
+ <!-- Page Content -->
67
+ <asd20-page-content
68
+ :primary-messages="primaryMessages"
69
+ :secondary-messages="secondaryMessages"
70
+ omit-detail-links
71
+ omit-calls-to-action
72
+ ></asd20-page-content>
73
+
74
+ <intersect @enter="$emit('stories-in-view')">
75
+ <section aria-label="Feed Section" class="article-digest">
76
+ <h2 class="feed-title">
77
+ {{
78
+ storiesFeedProps && storiesFeedProps.title
79
+ ? storiesFeedProps.title
80
+ : 'Stories & Features'
81
+ }}
82
+ </h2>
83
+ <!-- <div class="search-header">
84
+ <asd20-search-field
85
+ :value="keywords"
86
+ @input="$emit('update:keywords', $event)"
87
+ medium
88
+ />
89
+ <asd20-multiselect-input
90
+ label="Categories"
91
+ :taggable="false"
92
+ :value="selectedCategories"
93
+ :items="categoryOptions"
94
+ @input="$emit('update:selected-categories', $event)"
95
+ :hideLabel="true"
96
+ placeholder="Filter by Category"
97
+ />
98
+ </div> -->
99
+
100
+ <div v-if="cards.length < 1">
101
+ <br />
102
+ <p>There are currently no features to view.</p>
103
+ </div>
104
+ <div class="feed" v-if="cards.length > 0">
105
+ <div
106
+ v-if="cards.length > numberToShow"
107
+ id="list-start"
108
+ class="article-pagination"
109
+ >
110
+ <p class="result-count">
111
+ Viewing article {{ counter }}
112
+ {{ counter === cards.length ? '' : '-' }}
113
+ {{
114
+ counter === cards.length
115
+ ? ''
116
+ : counter2 <= cards.length
117
+ ? counter2
118
+ : cards.length
119
+ }}
120
+ of {{ cards.length }}.
121
+ </p>
122
+ <div class="page-selector">
123
+ <div class="prev-next">
124
+ <asd20-button
125
+ @click.native="prevSet()"
126
+ class="load-more"
127
+ icon="chevron"
128
+ label="Prev"
129
+ :iconAngle="-90"
130
+ size="md"
131
+ horizontal
132
+ transparent
133
+ centered
134
+ opposite
135
+ :disabled="counter === 1"
136
+ />
137
+ <p>
138
+ Page {{ Math.ceil(counter2 / numberToShow) }} of
139
+ {{ Math.ceil(cards.length / numberToShow) }}
140
+ </p>
141
+ <asd20-button
142
+ @click.native="nextSet()"
143
+ class="load-more"
144
+ icon="chevron"
145
+ label="Next"
146
+ :iconAngle="90"
147
+ size="md"
148
+ horizontal
149
+ transparent
150
+ centered
151
+ :disabled="cards.length < counter2"
152
+ />
153
+ </div>
154
+ </div>
155
+ </div>
156
+ <div class="feed-items">
157
+ <asd20-card
158
+ v-for="(card, index) in cards.slice(counter - 1, counter2)"
159
+ :key="index"
160
+ v-bind="card"
161
+ zoom
162
+ ></asd20-card>
163
+ </div>
164
+ <div v-if="cards.length > numberToShow" class="article-pagination">
165
+ <p class="result-count">
166
+ Viewing article {{ counter }}
167
+ {{ counter === cards.length ? '' : '-' }}
168
+ {{
169
+ counter === cards.length
170
+ ? ''
171
+ : counter2 <= cards.length
172
+ ? counter2
173
+ : cards.length
174
+ }}
175
+ of {{ cards.length }}.
176
+ </p>
177
+ <div class="page-selector">
178
+ <div class="prev-next">
179
+ <a href="#list-start">
180
+ <asd20-button
181
+ @click.native="prevSet()"
182
+ class="load-more"
183
+ icon="chevron"
184
+ label="Prev"
185
+ :iconAngle="-90"
186
+ size="md"
187
+ horizontal
188
+ transparent
189
+ centered
190
+ opposite
191
+ :disabled="counter === 1"
192
+ />
193
+ </a>
194
+ <p>
195
+ Page {{ Math.ceil(counter2 / numberToShow) }} of
196
+ {{ Math.ceil(cards.length / numberToShow) }}
197
+ </p>
198
+ <a href="#list-start">
199
+ <asd20-button
200
+ @click.native="nextSet()"
201
+ class="load-more"
202
+ icon="chevron"
203
+ label="Next"
204
+ :iconAngle="90"
205
+ size="md"
206
+ horizontal
207
+ transparent
208
+ centered
209
+ :disabled="cards.length < counter2"
210
+ />
211
+ </a>
212
+ </div>
213
+ </div>
214
+ </div>
215
+ </div>
216
+ </section>
217
+ </intersect>
218
+
219
+ <asd20-media-section
220
+ v-if="combinedMessageImages.length > 1 || combinedMessageVideos.length"
221
+ :images="this.combinedMessageImages || []"
222
+ :videos="this.combinedMessageVideos || []"
223
+ >
224
+ </asd20-media-section>
225
+
226
+ <!-- Bottom Widgets -->
227
+ <asd20-widgets-section
228
+ v-if="widgetsSectionProps.footer || $slots.widgets"
229
+ v-bind="{ ...widgetsSectionProps.footer, ...widgetsSectionProps.sidebar }"
230
+ @events-in-view="$emit('events-in-view')"
231
+ @files-in-view="$emit('files-in-view')"
232
+ @people-in-view="$emit('people-in-view')"
233
+ full
234
+ ><slot name="widgets"
235
+ /></asd20-widgets-section>
236
+
237
+ <!-- Feeds -->
238
+ <!-- <asd20-feeds-section
239
+ :announcements="announcements"
240
+ :announcements-feed-props="announcementsFeedProps"
241
+ @announcements-in-view="$emit('announcements-in-view')"
242
+ ></asd20-feeds-section> -->
243
+
244
+ <!-- Quick Links -->
245
+ <asd20-quicklinks-menu slot="before-footer" :quick-links="quickLinks">
246
+ <slot name="quicklinks-menu" />
247
+ </asd20-quicklinks-menu>
248
+
249
+ <!-- Footer -->
250
+ <asd20-page-footer
251
+ :organization="organization"
252
+ :socialLinks="socialLinks"
253
+ :disclosureLinks="disclosureLinks"
254
+ :websiteLogoProps="websiteLogoProps"
255
+ >
256
+ <slot name="page-footer" />
257
+ </asd20-page-footer>
258
+ </div>
259
+ </template>
260
+
261
+ <script>
262
+ // Components
263
+ import Asd20SkipTo from '../../../components/atoms/Asd20SkipTo'
264
+ import Asd20PageHeader from '../../../components/organisms/Asd20PageHeader'
265
+
266
+ import Asd20SiteNavigation from '../../../components/organisms/Asd20SiteNavigation'
267
+ import Asd20PageContent from '../../../components/organisms/Asd20PageContent'
268
+
269
+ import Asd20WidgetsSection from '../../../components/organisms/Asd20WidgetsSection'
270
+ import Asd20FeedsSection from '../../../components/organisms/Asd20FeedsSection'
271
+ import Asd20MediaSection from '../../../components/organisms/Asd20MediaSection'
272
+
273
+ import Asd20PageFooter from '../../../components/organisms/Asd20PageFooter'
274
+ import Asd20QuicklinksMenu from '../../../components/organisms/Asd20QuicklinksMenu'
275
+ import Asd20NotificationGroup from '../../../components/organisms/Asd20NotificationGroup'
276
+
277
+ import Asd20SearchField from '../../../components/molecules/Asd20SearchField'
278
+ import Asd20MultiselectInput from '../../../components/atoms/Asd20MultiselectInput'
279
+ import Asd20Card from '../../../components/molecules/Asd20Card'
280
+ import Asd20Button from '../../../components/atoms/Asd20Button'
281
+
282
+ import Intersect from 'vue-intersect'
283
+
284
+ // Mixins
285
+ import pageTemplateMixin from '../../../mixins/pageTemplateMixin'
286
+
287
+ // Helpers
288
+ import mapMessageToCard from '../../../helpers/mapMessageToCard'
289
+
290
+ export default {
291
+ name: 'ArticleDigestConpactTemplate',
292
+ mixins: [pageTemplateMixin],
293
+ components: {
294
+ Asd20PageContent,
295
+ Asd20SkipTo,
296
+ Asd20PageHeader,
297
+ Asd20PageFooter,
298
+ Asd20SiteNavigation,
299
+ Asd20WidgetsSection,
300
+ Asd20FeedsSection,
301
+ Asd20NotificationGroup,
302
+ Asd20QuicklinksMenu,
303
+ Asd20SearchField,
304
+ Asd20MultiselectInput,
305
+ Asd20Card,
306
+ Asd20Button,
307
+ Intersect,
308
+ Asd20MediaSection,
309
+ },
310
+
311
+ props: {
312
+ keywords: { type: String, default: '' },
313
+ selectedCategories: { type: Array, default: () => [] },
314
+ // categoryOptions: { type: Array, default: () => [] },
315
+ },
316
+ data: function() {
317
+ return {
318
+ numberToShow: 25,
319
+ counter: 1,
320
+ counter2: 25,
321
+ }
322
+ },
323
+ computed: {
324
+ cards() {
325
+ if (!Array.isArray(this.stories)) return []
326
+ return this.stories.map(s =>
327
+ mapMessageToCard(s, {
328
+ // reversed: true,
329
+ date: '',
330
+ time: '',
331
+ description: '',
332
+ // image: '',
333
+ // pinned: false,
334
+ })
335
+ )
336
+ },
337
+ categoryOptions() {
338
+ // get a unique array of categories with duplicates removed
339
+ return [
340
+ ...new Set(
341
+ this.cards.reduce((a, c) => a.concat(c.categories || []), []).sort()
342
+ ),
343
+ ]
344
+ },
345
+ computedCategoryOptions() {
346
+ // get a unique array of categories with duplicates removed
347
+ if (this.categoryOptions.length === 0) {
348
+ return [
349
+ ...new Set(
350
+ this.cards.reduce((a, c) => a.concat(c.categories || []), []).sort()
351
+ ),
352
+ ]
353
+ }
354
+ return this.categoryOptions
355
+ },
356
+ },
357
+ watch: {
358
+ selectedCategories: function(newVal, oldVal) {
359
+ if (newVal !== oldVal) {
360
+ this.reset()
361
+ }
362
+ },
363
+ },
364
+ methods: {
365
+ nextSet() {
366
+ if (
367
+ Math.ceil(this.counter2 / this.numberToShow) <
368
+ Math.ceil(this.cards.length / this.numberToShow)
369
+ ) {
370
+ this.counter = this.counter + this.numberToShow
371
+ this.counter2 = this.counter2 + this.numberToShow
372
+ this.$emit('stories-in-view')
373
+ }
374
+ },
375
+ prevSet() {
376
+ if (Math.ceil(this.counter2 / this.numberToShow) > 1) {
377
+ this.counter = this.counter - this.numberToShow
378
+ this.counter2 = this.counter2 - this.numberToShow
379
+ this.$emit('stories-in-view')
380
+ }
381
+ },
382
+ reset() {
383
+ this.counter = 1
384
+ this.counter2 = 25
385
+ this.$emit('stories-in-view')
386
+ },
387
+ },
388
+ }
389
+ </script>
390
+
391
+ <style lang="scss">
392
+ @import '../../../design/_variables.scss';
393
+ @import '../../../design/_mixins.scss';
394
+ @import '../../../design/_typography.scss';
395
+ @import '../../../design/_template.scss';
396
+ @import '../../../design/_print.scss';
397
+ @import '../../../design/tokens.css';
398
+
399
+ .asd20-template-article-digest-compact {
400
+ @include typography;
401
+ @include template;
402
+ display: flex;
403
+ flex-direction: column;
404
+ flex-grow: 1;
405
+ flex-shrink: 0;
406
+ overflow: hidden;
407
+ margin-top: space(2.25);
408
+ .asd20-notification-group--floating {
409
+ position: absolute;
410
+ top: space(2.0375);
411
+ }
412
+ .notification-group--inline {
413
+ margin: space(2) space(1) space(1) space(1);
414
+ }
415
+ .asd20-page-content .primary-messaging-section {
416
+ padding: space(1) space(1);
417
+ }
418
+ .article-digest {
419
+ .feed-title {
420
+ margin: space(1) 0 space(1) space(1);
421
+ }
422
+ .asd20-card {
423
+ margin: space(1) space(1) space(2) space(1);
424
+ }
425
+
426
+ .article-pagination {
427
+ display: flex;
428
+ align-items: center;
429
+ justify-content: space-between;
430
+ margin: space(1) space(0.25) space(0) space(0.25);
431
+ flex-direction: column;
432
+ p {
433
+ margin: 0;
434
+ }
435
+ .page-selector {
436
+ display: flex;
437
+ align-items: center;
438
+ .prev-next {
439
+ display: flex;
440
+ align-items: center;
441
+ justify-content: space-between;
442
+ a {
443
+ text-decoration: none !important;
444
+ }
445
+ .asd20-button {
446
+ padding: 0;
447
+ > .asd20-button__label {
448
+ margin: 0;
449
+ padding: 0.5rem;
450
+ }
451
+ }
452
+ p {
453
+ margin: 0 space(0.25);
454
+ }
455
+ }
456
+ }
457
+ }
458
+ .search-header,
459
+ .result-count {
460
+ margin: space(0) space(1) space(1) space(1);
461
+ }
462
+
463
+ .asd20-search-field {
464
+ margin: space(0.5) 0;
465
+ .asd20-icon {
466
+ margin-left: space(0.5);
467
+ }
468
+ input {
469
+ border: 2px solid var(--color__accent);
470
+ font-family: var(--website-typography__font-family-headlines);
471
+ font-size: 1rem;
472
+ }
473
+ }
474
+ .asd20-multiselect-input {
475
+ line-height: 1;
476
+ .multiselect__placeholder {
477
+ padding-left: space(0.5);
478
+ font-size: 1rem;
479
+ }
480
+ }
481
+ }
482
+ }
483
+
484
+ @media (min-width: 768px) {
485
+ .asd20-template-article-digest-compact {
486
+ .asd20-page-content .primary-messaging-section {
487
+ padding: space(1);
488
+ }
489
+ .article-digest {
490
+ .asd20-card {
491
+ margin: space(1) space(1) space(2) space(1);
492
+ }
493
+ }
494
+ }
495
+ }
496
+ @media (min-width: 1024px) {
497
+ .asd20-template-article-digest-compact {
498
+ @include template-desktop;
499
+ margin-left: space(3);
500
+ margin-top: 0;
501
+ .asd20-notification-group--floating {
502
+ position: absolute;
503
+ top: space(1);
504
+ }
505
+ .notification-group--inline {
506
+ margin: space(2) space(3) space(1) space(3);
507
+ flex-basis: 100%;
508
+ }
509
+ .asd20-page-content {
510
+ margin: 0 space(1);
511
+ display: flex;
512
+ justify-content: space-between;
513
+ flex-wrap: wrap;
514
+ .primary-messaging-section {
515
+ padding: space(1) space(2);
516
+ }
517
+ }
518
+
519
+ .article-digest {
520
+ // flex-basis: 100%;
521
+ margin: space(1) space(3) space(1) space(3);
522
+ .feed-title {
523
+ margin-left: 0;
524
+ }
525
+ .prev-next {
526
+ margin: space(1) 0;
527
+ }
528
+ .primary-messaging-section {
529
+ max-width: 100vw;
530
+ }
531
+ .feed-items {
532
+ display: grid;
533
+ grid-template-columns: 1fr 1fr 1fr;
534
+ grid-gap: space(1);
535
+ margin-bottom: space(1);
536
+ .asd20-card {
537
+ margin: 0;
538
+ }
539
+ }
540
+ .search-header,
541
+ .result-count {
542
+ margin: space(0) space(0) space(1) space(0);
543
+ }
544
+ .search-header {
545
+ display: flex;
546
+ flex-basis: 100%;
547
+ justify-content: space-between;
548
+ .asd20-search-field {
549
+ margin: space(0.5) space(0.5);
550
+ flex-basis: 50%;
551
+ .asd20-icon {
552
+ margin-left: 0;
553
+ }
554
+ }
555
+ .asd20-multiselect-input {
556
+ margin-bottom: 0;
557
+ flex-basis: 50%;
558
+ }
559
+ }
560
+ .article-pagination {
561
+ flex-direction: row;
562
+ }
563
+ }
564
+ }
565
+ }
566
+ </style>
@@ -75,7 +75,7 @@
75
75
  {
76
76
  "id": "77321f38-db7d-e103-97fb-6ee49723685x",
77
77
  "title": "Academy District 20 Schools are closed today.",
78
- "icon": "weather-snow",
78
+ "icon": "alert",
79
79
  "description": "All schools are closed today due to inclement weather.",
80
80
  "callToActionUrl": "https://www.asd20.org",
81
81
  "callToActionLabel": "Learn about our closure policy.",