@bjj/nuxt-layer-shadcn-ui 0.15.2 → 0.15.3

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.
@@ -171,13 +171,12 @@ function onPointerDownOutside (event: Event) {
171
171
  @pointerDownOutside="onPointerDownOutside"
172
172
  @closeAutoFocus="emit('closed')"
173
173
  >
174
- <!-- A11y: reka-ui requires a title and a description inside the dialog. -->
174
+ <!-- A11y: reka-ui requires a title and a description inside the dialog. The
175
+ visible title doubles as the accessible name, so this one steps in
176
+ whenever that one is not rendered. -->
175
177
  <DialogTitle
176
- class="
177
- px-4 pt-4 text-base font-semibold
178
- md:sr-only md:p-0
179
- shrink-0
180
- "
178
+ v-if="$slots.header || !title"
179
+ class="sr-only"
181
180
  >
182
181
  {{ title }}
183
182
  </DialogTitle>
@@ -193,10 +192,17 @@ function onPointerDownOutside (event: Event) {
193
192
  @select="emit('select', $event)"
194
193
  >
195
194
  <template
196
- v-if="searchable || $slots.header"
195
+ v-if="title || searchable || $slots.header"
197
196
  #header
198
197
  >
199
- <slot name="header" />
198
+ <slot name="header">
199
+ <DialogTitle
200
+ v-if="title"
201
+ class="px-2 py-1 text-base font-semibold"
202
+ >
203
+ {{ title }}
204
+ </DialogTitle>
205
+ </slot>
200
206
 
201
207
  <Input
202
208
  v-if="searchable"
@@ -29,7 +29,10 @@ export interface SidebarModalProps {
29
29
  /** Search keyword. Use `v-model:search` to read or drive it from the outside. */
30
30
  search?: string
31
31
  searchPlaceholder?: string
32
- /** Accessible name of the dialog, rendered for screen readers only. */
32
+ /**
33
+ * Accessible name of the dialog, and the default content of `#header`. A
34
+ * `#header` slot replaces it there and leaves it to screen readers.
35
+ */
33
36
  title?: string
34
37
  modal?: boolean
35
38
  showClose?: boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bjj/nuxt-layer-shadcn-ui",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Nuxt layer providing shadcn-vue based UI components",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -42,5 +42,5 @@
42
42
  "vue-i18n": "^11",
43
43
  "vue-router": "^4 || ^5"
44
44
  },
45
- "gitHead": "44db021855f40b5899bc164cfcea07d75791956b"
45
+ "gitHead": "7bc35e8ae2098667e03bc0e30343815cfb1a69bb"
46
46
  }