@asd20/ui-next 2.0.18 → 2.0.20

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.20](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.0.19...ui-next-v2.0.20) (2026-04-02)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * remove focus-trap styles that may be interfering with moble styles ([ad2be6c](https://github.com/academydistrict20/asd20-ui-next/commit/ad2be6cfd68277861a88d8ce143f53336bda4392))
9
+
10
+ ## [2.0.19](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.0.18...ui-next-v2.0.19) (2026-04-02)
11
+
3
12
  ## [2.0.18](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.0.17...ui-next-v2.0.18) (2026-04-02)
4
13
 
5
14
  ## [2.0.17](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.0.16...ui-next-v2.0.17) (2026-04-02)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asd20/ui-next",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "private": false,
5
5
  "description": "ASD20 UI component library for Vue 3.",
6
6
  "license": "MIT",
@@ -13,8 +13,6 @@
13
13
  >
14
14
  <focus-trap
15
15
  :open="resolvedOpen"
16
- class="asd20-modal-focus-trap"
17
- :class="{ 'asd20-modal-focus-trap--windowed': windowed }"
18
16
  >
19
17
  <div class="asd20-modal">
20
18
  <div
@@ -141,20 +139,6 @@ export default {
141
139
  align-items: stretch;
142
140
  }
143
141
 
144
- .asd20-modal-focus-trap {
145
- display: flex;
146
- flex: 1 1 auto;
147
- width: 100%;
148
- max-width: 100%;
149
- max-height: 100%;
150
- justify-content: center;
151
- align-items: stretch;
152
- }
153
-
154
- .asd20-modal-focus-trap--windowed {
155
- align-items: center;
156
- }
157
-
158
142
  .asd20-modal {
159
143
  position: relative;
160
144
  flex-grow: 1;
@@ -82,6 +82,7 @@ export default {
82
82
  },
83
83
 
84
84
  updated() {
85
+ if (!this.swiper) return
85
86
  this.swiper.update()
86
87
  },
87
88
  beforeUnmount() {
@@ -155,6 +156,7 @@ export default {
155
156
  this.$emit('update:swiper', this.swiper)
156
157
  },
157
158
  onSlideChange() {
159
+ if (!this.swiper) return
158
160
  this.index = this.swiper.realIndex
159
161
  },
160
162
  },
@@ -66,7 +66,7 @@
66
66
  <div class="feed-buttons">
67
67
  <asd20-button
68
68
  v-if="link && linkLabel && (cards.length >= 10 || cardType === 'Event')"
69
- :class="hasProtectedContent ? 'secondary-button' : ''"
69
+ :class="showProtectedContentButtons ? 'secondary-button' : ''"
70
70
  :label="linkLabel"
71
71
  :link="link"
72
72
  size="md"
@@ -76,7 +76,7 @@
76
76
  centered
77
77
  />
78
78
  <asd20-button
79
- v-if="hasProtectedContent"
79
+ v-if="showProtectedContentButtons"
80
80
  class="secondary-button"
81
81
  label="Leadership Announcements"
82
82
  link="/staff-announcements?category=Leadership"
@@ -87,7 +87,7 @@
87
87
  centered
88
88
  />
89
89
  <asd20-button
90
- v-if="hasProtectedContent"
90
+ v-if="showProtectedContentButtons"
91
91
  class="secondary-button"
92
92
  label="Communication Tool Form"
93
93
  link="https://forms.office.com/Pages/ResponsePage.aspx?id=zcp1lGYYyky2X9rtmQDNB-eqaTnt2ZBNtZ1N5vhrzHNUNFBHNlNBOUJaN1VXQjhDRzBVQVdOS1pVQSQlQCN0PWcu"
@@ -128,7 +128,14 @@ export default {
128
128
  hasProtectedContent: { type: Boolean, default: false },
129
129
  },
130
130
 
131
+ data: () => ({
132
+ clientMounted: false,
133
+ }),
134
+
131
135
  computed: {
136
+ showProtectedContentButtons() {
137
+ return this.clientMounted && this.hasProtectedContent
138
+ },
132
139
  swiperOptions() {
133
140
  return {
134
141
  slidesPerView: 1,
@@ -151,6 +158,9 @@ export default {
151
158
  }
152
159
  },
153
160
  },
161
+ mounted() {
162
+ this.clientMounted = true
163
+ },
154
164
  methods: {
155
165
  getCardKey(card, index) {
156
166
  if (card && card.event) {
@@ -1,13 +1,3 @@
1
- <template>
2
- <div
3
- ref="trapRoot"
4
- class="asd20-focus-trap"
5
- tabindex="-1"
6
- >
7
- <slot />
8
- </div>
9
- </template>
10
-
11
1
  <script>
12
2
  import { createFocusTrap } from 'focus-trap'
13
3
 
@@ -21,6 +11,7 @@ export default {
21
11
  },
22
12
  data: () => ({
23
13
  trap: null,
14
+ addedFallbackTabindex: false,
24
15
  }),
25
16
  computed: {
26
17
  enabled() {
@@ -32,7 +23,7 @@ export default {
32
23
  const options = {
33
24
  clickOutsideDeactivates: false,
34
25
  escapeDeactivates: false,
35
- fallbackFocus: () => this.$refs.trapRoot,
26
+ fallbackFocus: () => this.ensureFallbackFocusTarget(),
36
27
  }
37
28
 
38
29
  if (this.initialFocus !== undefined) {
@@ -53,7 +44,7 @@ export default {
53
44
  },
54
45
  mounted() {
55
46
  this.$nextTick(() => {
56
- this.trap = createFocusTrap(this.$refs.trapRoot, this.focusTrapOptions)
47
+ this.trap = createFocusTrap(this.$el, this.focusTrapOptions)
57
48
  this.syncTrapState()
58
49
  })
59
50
  },
@@ -61,6 +52,20 @@ export default {
61
52
  this.disposeTrap()
62
53
  },
63
54
  methods: {
55
+ ensureFallbackFocusTarget() {
56
+ const root = this.$el
57
+
58
+ if (!root || typeof root.hasAttribute !== 'function') {
59
+ return root
60
+ }
61
+
62
+ if (!root.hasAttribute('tabindex')) {
63
+ root.setAttribute('tabindex', '-1')
64
+ this.addedFallbackTabindex = true
65
+ }
66
+
67
+ return root
68
+ },
64
69
  syncTrapState() {
65
70
  if (!this.trap) return
66
71
 
@@ -76,22 +81,21 @@ export default {
76
81
 
77
82
  this.trap.deactivate()
78
83
  this.trap = null
84
+
85
+ if (this.addedFallbackTabindex && this.$el?.removeAttribute) {
86
+ this.$el.removeAttribute('tabindex')
87
+ this.addedFallbackTabindex = false
88
+ }
79
89
  },
80
90
  },
81
- }
82
- </script>
91
+ render() {
92
+ const content = this.$slots.default ? this.$slots.default() : []
83
93
 
84
- <style scoped>
85
- .asd20-focus-trap {
86
- display: flex;
87
- flex: 1 1 auto;
88
- align-items: stretch;
89
- min-width: 0;
90
- max-width: 100%;
91
- max-height: 100%;
94
+ if (content.length !== 1) {
95
+ throw new Error('FocusTrap requires exactly one child')
96
+ }
92
97
 
93
- &:focus {
94
- outline: none;
95
- }
98
+ return content[0]
99
+ },
96
100
  }
97
- </style>
101
+ </script>