@asd20/ui 3.2.1021 → 3.2.1023

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.1021",
8
+ "version": "3.2.1023",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -36,8 +36,7 @@ storiesOf('Atoms - Asd20Icon', module)
36
36
  />`,
37
37
  }),
38
38
  {
39
- info:
40
- 'Makes it accessible, by takeing the name and passing it as a title, declares it as an image and provides aria roles.',
39
+ info: 'Makes it accessible, by takeing the name and passing it as a title, declares it as an image and provides aria roles.',
41
40
  }
42
41
  )
43
42
  .add(
@@ -77,88 +76,83 @@ storiesOf('Atoms - Asd20Icon', module)
77
76
  ...wrapper,
78
77
  data: () => ({
79
78
  icons: [
80
- 'gallery',
81
- 'video',
82
79
  'cards',
83
- 'list',
80
+ 'chevron',
81
+ 'close',
82
+ 'contact',
84
83
  'email',
84
+ 'external',
85
+ 'facebook',
86
+ 'fax',
85
87
  'file',
86
88
  'filter',
87
-
88
- 'heart-filled',
89
+ 'gallery',
90
+ 'group-alt',
89
91
  'heart',
90
- 'pin-filled',
91
- 'pin',
92
- 'star-filled',
93
- 'star',
94
- 'thumb',
95
- 'thumb-filled',
96
- 'info-alt',
97
-
98
- 'phone-alt',
92
+ 'heart-filled',
99
93
  'hours-alt',
100
- 'group-alt',
94
+ 'info-alt',
95
+ 'instagram',
96
+ 'linkedin',
97
+ 'list',
101
98
  'map',
102
- 'external',
103
- 'contact',
104
- 'fax',
105
- 'chevron',
106
99
  'menu',
107
- 'close',
100
+ 'phone-alt',
101
+ 'pin',
102
+ 'pin-filled',
108
103
  'search',
109
-
110
- 'instagram',
111
- 'linkedin',
112
- 'youtube',
104
+ 'star',
105
+ 'star-filled',
106
+ 'thumb',
107
+ 'thumb-filled',
113
108
  'twitter',
114
- 'facebook',
109
+ 'video',
110
+ 'youtube',
111
+
115
112
  'accessibility',
116
113
  'alert',
114
+ 'arts',
115
+ 'athletics',
117
116
  'award',
118
117
  'bell',
119
- 'calendar-alt',
118
+ 'bus',
120
119
  'calendar',
120
+ 'calendar-alt',
121
121
  'committee',
122
+ 'cora',
122
123
  'danger',
123
124
  'directions',
124
125
  'directory',
125
126
  'district',
126
127
  'files',
127
128
  'finance',
129
+ 'food',
130
+ 'group',
128
131
  'hours',
129
132
  'info',
133
+ 'ix',
130
134
  'jobs',
131
135
  'language',
136
+ 'library',
132
137
  'link',
133
138
  'login',
139
+ 'parentsquare',
134
140
  'personalize',
135
141
  'phone',
142
+ 'printer',
136
143
  'register',
137
144
  'school',
138
- 'staff',
139
- 'website',
140
- 'vendors',
141
- 'cora',
142
- 'weather-snow',
143
- 'weather-sun',
144
- 'athletics',
145
- 'arts',
146
- 'food',
147
- 'group',
148
- 'library',
149
-
150
- 'translate',
151
-
152
- 'technology',
153
145
  'schoology',
154
- 'ix',
155
-
156
- 'bus',
157
- 'printer',
158
146
  'share',
159
147
  'share-alt',
160
- 'parentsquare',
148
+ 'staff',
149
+ 'technology',
150
+ 'translate',
151
+ 'vendors',
161
152
  'video-alt',
153
+ 'weather-snow',
154
+ 'weather-sun',
155
+ 'website',
162
156
  ],
163
157
  }),
164
158
  template: `
@@ -36,7 +36,7 @@
36
36
  <rect x="15" y="21" width="2" height="2" rx="0.7" class="line" fill="currentColor"/>
37
37
  <rect x="19" y="21" width="2" height="2" rx="0.7" class="line" fill="currentColor"/>
38
38
  <!-- Dollar sign ($) in display (line color) -->
39
- <text
39
+ <!-- <text
40
40
  x="16"
41
41
  y="12.5"
42
42
  text-anchor="middle"
@@ -46,6 +46,6 @@
46
46
  font-weight="bold"
47
47
  class="fill"
48
48
  style="pointer-events: none;"
49
- >$</text>
49
+ >$</text> -->
50
50
  </g>
51
51
  </template>
@@ -17,23 +17,23 @@
17
17
  />
18
18
  <!-- Rectangle -->
19
19
  <rect
20
- x="9"
21
- y="9"
22
- width="14"
23
- height="14"
20
+ x="9.5"
21
+ y="9.5"
22
+ width="13"
23
+ height="13"
24
24
  rx="2"
25
25
  stroke="#000000"
26
- stroke-width="2"
26
+ stroke-width="3"
27
27
  stroke-linecap="round"
28
28
  stroke-linejoin="round"
29
29
  fill="none"
30
30
  />
31
31
 
32
32
  <!-- Corner dots -->
33
- <circle cx="10" cy="10" r="4" class="line" stroke="currentColor" stroke-width="1" />
34
- <circle cx="22" cy="10" r="4" class="line" stroke="currentColor" stroke-width="1" />
35
- <circle cx="10" cy="22" r="4" class="line" stroke="currentColor" stroke-width="1" />
36
- <circle cx="22" cy="22" r="4" class="line" stroke="currentColor" stroke-width="1" />
33
+ <circle cx="10" cy="10" r="3.5" class="line" stroke="currentColor" stroke-width="1" />
34
+ <circle cx="22" cy="10" r="3.5" class="line" stroke="currentColor" stroke-width="1" />
35
+ <circle cx="10" cy="22" r="3.5" class="line" stroke="currentColor" stroke-width="1" />
36
+ <circle cx="22" cy="22" r="3.5" class="line" stroke="currentColor" stroke-width="1" />
37
37
  </g>
38
38
  </g>
39
39
  </template>
@@ -6,6 +6,7 @@
6
6
  :key="option.value"
7
7
  >
8
8
  <asd20-checkbox
9
+ :title="option.title"
9
10
  :label="option.text"
10
11
  :count="option.count"
11
12
  :description="option.description"
@@ -245,29 +245,16 @@
245
245
  class="asd20-school-details__secondary-content"
246
246
  aria-label="Program Offerings"
247
247
  >
248
- <asd20-list
249
- v-if="academicsListItems.length > 0"
250
- :items="academicsListItems"
251
- class="asd20-school-details__academics-offerings"
252
- headline="Academics Offerings"
253
- icon="library"
254
- />
255
- <div class="otherOfferings">
248
+ <template v-for="cat in dynamicCategoryOrder">
256
249
  <asd20-list
257
- v-if="artsListItems.length > 0"
258
- :items="artsListItems"
259
- class="asd20-school-details__arts-offerings"
260
- headline="Arts Offerings"
261
- icon="arts"
250
+ :key="'cat-' + cat"
251
+ v-if="(orgOfferingsByCategory[cat] || []).length > 0"
252
+ :items="orgOfferingsByCategory[cat]"
253
+ class="asd20-school-details__category-offerings"
254
+ :headline="cat"
255
+ :icon="iconForCategory(cat)"
262
256
  />
263
- <asd20-list
264
- v-if="athleticsListItems.length > 0"
265
- :items="athleticsListItems"
266
- class="asd20-school-details__athletics-offerings"
267
- headline="Athletics Offerings"
268
- icon="athletics"
269
- />
270
- </div>
257
+ </template>
271
258
  </section>
272
259
  </section>
273
260
 
@@ -381,66 +368,104 @@ export default {
381
368
  return this.organization.openSeats.map(g => JSON.parse(g))
382
369
  },
383
370
 
384
- // profileHeaderContent() {
385
- // if (!this.organization) return
386
- // return {
387
- // heading: this.organization.title.replace(
388
- // /(Elementary|Elementary-Middle|Middle|Middle-High|High|Elementary-Middle-High) School/,
389
- // '<small>$1 School</small>'
390
- // ),
391
- // lead: this.organization.elevatorPitch,
392
- // imageUrl: this.organization.exteriorPhotoUrl,
393
- // organization: this.organization,
394
- // }
395
- // },
396
-
397
- academicsListItems() {
398
- return this.organization.offerings
399
- .filter(o =>
400
- o.offering.categories
401
- .map(oc => oc.category.title)
402
- .includes('Academics')
403
- )
404
- .map(a => ({
405
- label: a.offering.title,
406
- description: a.offering.description,
407
- alignTop: true,
408
- actionable: false,
409
- condensed: true,
410
- checked: true,
411
- }))
412
- .sort((a, b) => (a.label > b.label ? 1 : b.label > a.label ? -1 : 0))
413
- },
414
- artsListItems() {
415
- return this.organization.offerings
416
- .filter(o =>
417
- o.offering.categories.map(oc => oc.category.title).includes('Arts')
418
- )
419
- .map(a => ({
420
- label: a.offering.title,
421
- alignTop: true,
422
- actionable: false,
423
- condensed: true,
424
- checked: true,
425
- }))
426
- .sort((a, b) => (a.label > b.label ? 1 : b.label > a.label ? -1 : 0))
371
+ // Categories present on THIS organization, ordered with preferred first.
372
+ dynamicCategoryOrder: function () {
373
+ var org = this.organization || {}
374
+ var offs = org.offerings || []
375
+ var set = {}
376
+ var list = []
377
+
378
+ function getCategoryTitle(c) {
379
+ if (!c) return null
380
+ if (c.category && c.category.title) return c.category.title
381
+ if (c.title) return c.title
382
+ return null
383
+ }
384
+
385
+ for (var i = 0; i < offs.length; i++) {
386
+ var wrap = offs[i]
387
+ var o = wrap && wrap.offering ? wrap.offering : wrap
388
+ if (!o) continue
389
+ var cats = o.categories && o.categories.length ? o.categories : []
390
+ for (var j = 0; j < cats.length; j++) {
391
+ var t = getCategoryTitle(cats[j])
392
+ if (t && !set[t]) {
393
+ set[t] = true
394
+ list.push(t)
395
+ }
396
+ }
397
+ }
398
+
399
+ var preferred = ['Academics', 'Arts', 'Athletics']
400
+ var preferredPresent = []
401
+ for (var p = 0; p < preferred.length; p++) {
402
+ if (set[preferred[p]]) preferredPresent.push(preferred[p])
403
+ }
404
+
405
+ var rest = []
406
+ for (var k = 0; k < list.length; k++) {
407
+ if (preferred.indexOf(list[k]) === -1) rest.push(list[k])
408
+ }
409
+ rest.sort(function (a, b) {
410
+ if (typeof a.localeCompare === 'function') return a.localeCompare(b)
411
+ return a < b ? -1 : a > b ? 1 : 0
412
+ })
413
+
414
+ return preferredPresent.concat(rest)
427
415
  },
428
- athleticsListItems() {
429
- return this.organization.offerings
430
- .filter(o =>
431
- o.offering.categories
432
- .map(oc => oc.category.title)
433
- .includes('Athletics')
434
- )
435
- .map(a => ({
436
- label: a.offering.title,
437
- alignTop: true,
438
- actionable: false,
439
- condensed: true,
440
- checked: true,
441
- }))
442
- .sort((a, b) => (a.label > b.label ? 1 : b.label > a.label ? -1 : 0))
416
+
417
+ // Items grouped by category for THIS organization
418
+ orgOfferingsByCategory: function () {
419
+ var org = this.organization || {}
420
+ var offs = org.offerings || []
421
+ var out = {}
422
+
423
+ function getCategoryTitle(c) {
424
+ if (!c) return null
425
+ if (c.category && c.category.title) return c.category.title
426
+ if (c.title) return c.title
427
+ return null
428
+ }
429
+
430
+ for (var i = 0; i < offs.length; i++) {
431
+ var wrap = offs[i]
432
+ var o = wrap && wrap.offering ? wrap.offering : wrap
433
+ if (!o) continue
434
+
435
+ var label = o.title || ''
436
+ var desc = o.description || ''
437
+ var cats = o.categories && o.categories.length ? o.categories : []
438
+
439
+ for (var j = 0; j < cats.length; j++) {
440
+ var cat = getCategoryTitle(cats[j])
441
+ if (!cat) continue
442
+ if (!out[cat]) out[cat] = []
443
+ out[cat].push({
444
+ label: label,
445
+ description: desc, // keep description like your Academics list
446
+ alignTop: true,
447
+ actionable: false,
448
+ condensed: true,
449
+ checked: true,
450
+ })
451
+ }
452
+ }
453
+
454
+ // Sort items A→Z within each category
455
+ for (var name in out) {
456
+ if (!out.hasOwnProperty(name)) continue
457
+ out[name].sort(function (a, b) {
458
+ var al = a.label || '',
459
+ bl = b.label || ''
460
+ if (typeof al.localeCompare === 'function')
461
+ return al.localeCompare(bl)
462
+ return al < bl ? -1 : al > bl ? 1 : 0
463
+ })
464
+ }
465
+
466
+ return out
443
467
  },
468
+
444
469
  getGradeRange() {
445
470
  let levels = this.organization.educationLevels
446
471
  let gradeRange = []
@@ -502,6 +527,19 @@ export default {
502
527
  }
503
528
  },
504
529
  },
530
+ methods: {
531
+ iconForCategory: function (cat) {
532
+ // Known icons first
533
+ if (cat === 'Academics') return 'library'
534
+ if (cat === 'Arts') return 'arts'
535
+ if (cat === 'Athletics') return 'athletics'
536
+ // Common new ones (adjust to your icon set)
537
+ if (cat === 'Support') return 'vendors'
538
+ if (cat === 'Community') return 'group'
539
+ // Fallback
540
+ return 'list'
541
+ },
542
+ },
505
543
  }
506
544
  </script>
507
545
 
@@ -657,13 +695,13 @@ export default {
657
695
  &__secondary-content {
658
696
  padding: space(1);
659
697
  display: flex;
660
- flex-direction: column;
661
- .asd20-school-details__academics-offerings {
662
- max-width: 90%;
663
- padding-bottom: 2rem;
664
- }
665
- .asd20-school-details__athletics-offerings {
666
- margin-top: 2rem;
698
+ flex-wrap: wrap;
699
+ gap: space(1); /* modern flex gap */
700
+ /* single column by default */
701
+ .asd20-school-details__category-offerings {
702
+ flex: 1 1 100%;
703
+ max-width: 100%;
704
+ padding-right: 0; /* override any prior rule */
667
705
  }
668
706
  }
669
707
 
@@ -702,10 +740,14 @@ export default {
702
740
  &__secondary-content {
703
741
  padding: space(2);
704
742
  display: flex;
705
- flex-direction: row;
706
- .asd20-school-details__academics-offerings {
707
- max-width: 60%;
708
- padding-right: 2rem;
743
+ flex-wrap: wrap;
744
+ gap: space(1);
745
+
746
+ .asd20-school-details__category-offerings {
747
+ /* two columns: equal widths */
748
+ flex: 1 1 calc(50% - #{space(0.5)});
749
+ max-width: calc(50% - #{space(0.5)});
750
+ padding-right: 0;
709
751
  }
710
752
  }
711
753
  }
@@ -719,13 +761,6 @@ export default {
719
761
  .asd20-notification-group--floating {
720
762
  position: absolute;
721
763
  top: space(1);
722
- // .bell {
723
- // span {
724
- // background: var(--color__accent);
725
- // top: -0.6em !important;
726
- // right: -0.6em !important;
727
- // }
728
- // }
729
764
  }
730
765
  .notification-group--inline {
731
766
  margin: space(2) space(3) space(1) space(3);
@@ -757,11 +792,20 @@ export default {
757
792
  .asd20-school-details {
758
793
  &__primary-content {
759
794
  padding: space(2);
795
+ padding-right: 0;
760
796
  .primary-section {
761
- width: 30%;
797
+ width: 31%;
762
798
  padding: 0 1vw 3rem 1vw;
763
799
  }
764
800
  }
801
+ &__secondary-content {
802
+ padding: space(2);
803
+ padding-right: 0;
804
+ .asd20-school-details__category-offerings {
805
+ flex: 1 1 calc(32% - #{space(0.5)});
806
+ max-width: calc(32% - #{space(0.5)});
807
+ }
808
+ }
765
809
  .asd20-contact {
766
810
  padding: space(1) space(3);
767
811
  }