@asd20/ui-next 2.7.0 → 2.7.1

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.7.1](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.7.0...ui-next-v2.7.1) (2026-05-05)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * allow compose email modal to interpret AI rejection code ([411c383](https://github.com/academydistrict20/asd20-ui-next/commit/411c38300678a57c4eec6c5892206089b359202d))
9
+
3
10
  # [2.7.0](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.6.0...ui-next-v2.7.0) (2026-05-05)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asd20/ui-next",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "private": false,
5
5
  "description": "ASD20 UI component library for Vue 3.",
6
6
  "license": "MIT",
@@ -92,6 +92,7 @@ $input-focus-color: var(--color__accent-t50);
92
92
  color: var(--website-card__reverse-background-color);
93
93
  border: 2px solid var(--color__accent);
94
94
  border-radius: 0;
95
+ font-family: var(--website-typography__font-family-body);
95
96
  font-size: 1rem;
96
97
  line-height: 1;
97
98
  padding: space(0.25) space(0.25);
@@ -87,6 +87,7 @@ $input-focus-color: var(--color__accent-t50);
87
87
  color: var(--website-card__reverse-background-color);
88
88
  border: 2px solid var(--color__accent);
89
89
  border-radius: 0;
90
+ font-family: var(--website-typography__font-family-body);
90
91
  font-size: 1rem;
91
92
  line-height: 1;
92
93
  padding: space(0.25) space(0.25);
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <asd20-modal
3
3
  :open="open"
4
- title="Send an Email"
4
+ :title="modalTitle"
5
5
  icon="email"
6
6
  dismissable
7
7
  windowed
@@ -141,6 +141,9 @@ export default {
141
141
  },
142
142
  }),
143
143
  computed: {
144
+ modalTitle() {
145
+ return this.sendRejected ? 'Contact our Help Desk' : 'Send an Email'
146
+ },
144
147
  isValid() {
145
148
  return (
146
149
  this.validationErrors.senderName.length === 0 &&
@@ -226,8 +229,23 @@ export default {
226
229
 
227
230
  return 'Something went wrong while sending your email. Please try again later.'
228
231
  },
232
+ getSendEmailResponseData(error) {
233
+ if (error?.response?.data) return error.response.data
234
+
235
+ const message = String(error?.message || '')
236
+ const jsonStart = message.indexOf('{')
237
+ if (jsonStart < 0) return null
238
+
239
+ try {
240
+ return JSON.parse(message.slice(jsonStart))
241
+ } catch (_error) {
242
+ return null
243
+ }
244
+ },
229
245
  isHelpDeskRejection(error) {
230
- return error?.response?.data?.code === 'moderation_rejected'
246
+ return (
247
+ this.getSendEmailResponseData(error)?.code === 'moderation_rejected'
248
+ )
231
249
  },
232
250
  async sendEmail(captchaToken = '') {
233
251
  if (!this.isValid) return
@@ -263,7 +281,8 @@ export default {
263
281
  console.error('Email send failed:', error?.message || error)
264
282
  if (this.isHelpDeskRejection(error)) {
265
283
  this.helpDeskUrl =
266
- error?.response?.data?.helpDeskUrl || 'https://asd20.org/help-desk'
284
+ this.getSendEmailResponseData(error)?.helpDeskUrl ||
285
+ 'https://asd20.org/help-desk'
267
286
  this.sendRejected = true
268
287
  return
269
288
  }