@redseed/redseed-ui-vue3 8.22.0 → 8.22.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseed/redseed-ui-vue3",
3
- "version": "8.22.0",
3
+ "version": "8.22.1",
4
4
  "description": "RedSeed UI Vue 3 components",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/redseedtraining/redseed-ui",
@@ -60,7 +60,7 @@ function handleClick() {
60
60
  <div v-if="status !== false"
61
61
  class="rsui-feed-item__avatar-indicator"
62
62
  >
63
- <span class="sr-only">{{ status }}</span>
63
+ <span class="rsui-feed-item__avatar-indicator-label">{{ status }}</span>
64
64
  <slot name="avatar-indicator"
65
65
  :status="status"
66
66
  >
@@ -1,9 +1,8 @@
1
1
  <script setup>
2
- import { ref, computed } from 'vue'
2
+ import { ref, computed, useAttrs, useSlots } from 'vue'
3
3
  import FormFieldSlot from './FormFieldSlot.vue'
4
4
  import Loader from '../Loader/Loader.vue'
5
5
  import { PlusIcon, DocumentIcon, ExclamationCircleIcon, XMarkIcon } from '@heroicons/vue/24/outline'
6
- import { useFormFieldA11y } from '../../composables/useFormFieldA11y.js'
7
6
 
8
7
  defineOptions({
9
8
  inheritAttrs: false,
@@ -20,9 +19,21 @@ const props = defineProps({
20
19
  },
21
20
  })
22
21
 
22
+ const attrs = useAttrs()
23
+ const slots = useSlots()
24
+
23
25
  const emit = defineEmits(['remove'])
24
26
 
25
- const { inputId, ariaDescribedby } = useFormFieldA11y()
27
+ // Generate a11y values locally useFormFieldA11y() cannot inject from
28
+ // FormFieldSlot because the slot is a child, not a parent
29
+ const autoId = _.uniqueId('form-field-')
30
+ const inputId = computed(() => attrs.id || autoId)
31
+ const ariaDescribedby = computed(() => {
32
+ const ids = []
33
+ if (slots.help) ids.push(`${inputId.value}-help`)
34
+ if (slots.error) ids.push(`${inputId.value}-error`)
35
+ return ids.length > 0 ? ids.join(' ') : undefined
36
+ })
26
37
 
27
38
  const stateDefault = computed(() => {
28
39
  return !stateUploading.value
@@ -102,7 +113,7 @@ function removeAction() {
102
113
  </script>
103
114
  <template>
104
115
  <FormFieldSlot
105
- :id="$attrs.id"
116
+ :id="inputId"
106
117
  :class="[$attrs.class, 'rsui-form-field-uploader']"
107
118
  :required="$attrs.required"
108
119
  :showAsterisk="$attrs.showAsterisk"
@@ -66,7 +66,6 @@ function clickItem(event) {
66
66
  :class="listItemClass"
67
67
  :tabindex="clickable ? 0 : undefined"
68
68
  :role="clickable ? 'button' : undefined"
69
- @click="clickItem"
70
69
  @keydown.enter.self.prevent="!$event.repeat && clickItem($event)"
71
70
  @keydown.space.self.prevent="!$event.repeat && clickItem($event)"
72
71
  >
@@ -105,7 +104,7 @@ function clickItem(event) {
105
104
  The hover effect is also applied when the header action button is hovered,
106
105
  but not the active effect when the header action button is clicked.
107
106
  -->
108
- <div :class="listItemBackgroundClass"></div>
107
+ <div :class="listItemBackgroundClass" @click="clickItem"></div>
109
108
  <!--
110
109
  This body div is used to show meta and description slots in larger screens.
111
110
  It is hidden in smaller screens.