v2.15.0

Slideover

Диалог, который выезжает с любой стороны экрана.

Использование

Поместите в слот по умолчанию Slideover Button или любой другой компонент.

Затем слот #content задаёт содержимое, которое показывается при открытом Slideover.

<template>
  <B24Slideover
    :b24ui="{
      content: 'sm:top-[300px] sm:max-h-[calc(100%-300px)]'
    }"
  >
    <B24Button label="Open" />

    <template #content>
      <Placeholder class="h-full m-4" />
    </template>
  </B24Slideover>
</template>

Слоты #header, #body и #footer позволяют настроить содержимое Slideover.

Заголовок

Пропс title задаёт заголовок в шапке Slideover.

<template>
  <B24Slideover title="Боковая панель с заголовком">
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full" />
    </template>
  </B24Slideover>
</template>

Описание

Пропс description задаёт описание в шапке Slideover.

<template>
  <B24Slideover
    title="Боковая панель с описанием"
    description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
  >
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full" />
    </template>
  </B24Slideover>
</template>

Закрытие

Пропс close настраивает кнопку закрытия в шапке Slideover или скрывает её (значение false).

Можно передать любое свойство компонента Button.

<template>
  <B24Slideover
    title="Боковая панель с кнопкой закрытия"
    :close="{
      color: 'air-secondary-accent-2'
    }"
  >
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full" />
    </template>
  </B24Slideover>
</template>
Кнопка закрытия не показывается, если используется слот #content: она входит в шапку.

Иконка закрытия

Пропс close-icon меняет иконку кнопки закрытия.

<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>

<template>
  <B24Slideover title="Боковая панель с кнопкой закрытия" :close-icon="RocketIcon">
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full" />
    </template>
  </B24Slideover>
</template>

Сторона

Пропс side задаёт сторону экрана, с которой выезжает Slideover. По умолчанию bottom.

<template>
  <B24Slideover side="bottom" title="Боковая панель со стороной выезда">
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full min-h-48" />
    </template>
  </B24Slideover>
</template>

Отступ от краёв

Пропс inset отодвигает Slideover от краёв экрана.

<template>
  <B24Slideover side="right" inset title="Боковая панель с отступом от краёв">
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="min-w-96 min-h-96 size-full" />
    </template>
  </B24Slideover>
</template>

Анимация

Пропс transition определяет, анимируется ли Slideover. По умолчанию true.

<template>
  <B24Slideover :transition="false" title="Боковая панель без анимации">
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full" />
    </template>
  </B24Slideover>
</template>

Оверлей

Пропс overlay определяет, есть ли у Slideover оверлей. По умолчанию true.

<template>
  <B24Slideover :overlay="false" title="Боковая панель без оверлея">
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full" />
    </template>
  </B24Slideover>
</template>

Размытие оверлея

Чтобы отключить размытие фона, используйте пропс overlayBlur.

У пропса overlayBlur три значения:

  • auto: когда пользователь не запрашивал уменьшение анимации
  • on: размытие всегда включено
  • off: (по умолчанию) размытия нет
<template>
  <B24Slideover overlay-blur="auto" title="Размытие оверлея">
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full" />
    </template>
  </B24Slideover>
</template>

Пропс modal определяет, блокирует ли Slideover взаимодействие с содержимым вне панели. По умолчанию true.

При modal равном false оверлей отключается автоматически, а содержимое вне панели остаётся интерактивным.
<template>
  <B24Slideover :modal="false" title="Интерактивная боковая панель">
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full" />
    </template>
  </B24Slideover>
</template>

Закрытие по действию вне окна

Пропс dismissible определяет, закрывается ли Slideover щелчком вне панели или нажатием Escape. По умолчанию true.

При попытке закрыть панель генерируется событие close:prevent.
Сочетание modal: false и dismissible: false делает фон интерактивным, не закрывая Slideover.
<template>
  <B24Slideover :dismissible="false" title="Боковая панель без закрытия по щелчку вне панели">
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full" />
    </template>
  </B24Slideover>
</template>

Выгрузка содержимого

Пропс unmount-on-hide управляет выгрузкой содержимого Slideover при закрытии. По умолчанию true.

<template>
  <B24Slideover :unmount-on-hide="false" title="Боковая панель">
    <B24Button label="Open" />

    <template #body>
      <Placeholder class="h-full" />
    </template>
  </B24Slideover>
</template>
В DOM видно, что содержимое Slideover отрисовано, даже пока панель закрыта.
Если пропс portal равен false, содержимое отрисовывается и на сервере. Это полезно, чтобы отрисовать открытый Slideover при SSR без мигания при загрузке страницы, или чтобы открыть содержимое для SEO.

Примеры

Управление открытием

Состоянием открытия управляют пропс default-open или директива v-model:open.

<script setup lang="ts">
const open = ref(false)

defineShortcuts({
  o: () => open.value = !open.value
})
</script>

<template>
  <B24Slideover v-model:open="open" :b24ui="{ content: 'sm:top-[300px] sm:max-h-[calc(100%-300px)]' }">
    <B24Button label="Открыть" />

    <template #content>
      <Placeholder class="h-full m-4" />
    </template>
  </B24Slideover>
</template>
<script setup lang="ts">
import { ref } from 'vue'

const open = ref(false)

defineShortcuts({
  o: () => open.value = !open.value
})
</script>

<template>
  <B24Slideover v-model:open="open" :b24ui="{ content: 'sm:top-[300px] sm:max-h-[calc(100%-300px)]' }">
    <B24Button label="Открыть" />

    <template #content>
      <Placeholder class="h-full m-4" />
    </template>
  </B24Slideover>
</template>
В этом примере с помощью defineShortcuts Slideover переключается по нажатию O.
Так можно вынести триггер за пределы Slideover или убрать его совсем.

Программное использование

Открыть Slideover программно позволяет композабл useOverlay.

Оберните приложение в компонент App, который использует компонент OverlayProvider.

Сначала создайте компонент боковой панели, которая будет открываться программно:

SlideoverExample.vue
<script setup lang="ts">
defineProps<{
  count: number
}>()

const emit = defineEmits<{ close: [boolean] }>()
</script>

<template>
  <B24Slideover
    :close="{ onClick: () => emit('close', false) }"
    :description="`Эта боковая панель открыта программно столько раз: ${count}`"
  >
    <template #body>
      <Placeholder class="h-full" />
    </template>

    <template #footer>
      <B24Button size="lg" color="air-primary" label="Сохранить" @click="emit('close', true)" />
      <B24Button
        size="sm"
        color="air-tertiary"
        label="Отмена"
        :normal-case="false"
        @click="emit('close', false)"
      />
    </template>
  </B24Slideover>
</template>
Здесь при закрытии или отклонении панели генерируется событие close. Через него можно передать любые данные: они станут результатом open(). Событие нужно сгенерировать, иначе промис не завершится.

Затем используйте его в приложении:

<script setup lang="ts">
import { LazySlideoverExample } from '#components'

const count = ref(0)

const toast = useToast()
const overlay = useOverlay()

const slideover = overlay.create(LazySlideoverExample)

async function open() {
  const instance = slideover.open({
    count: count.value
  })

  const shouldIncrement = await instance.result

  if (shouldIncrement) {
    count.value++

    toast.add({
      title: `Success: ${shouldIncrement}`,
      color: 'air-primary-success',
      id: 'slideover-success'
    })

    // Обновляем счётчик
    slideover.patch({
      count: count.value
    })
    return
  }

  toast.add({
    title: `Dismissed: ${shouldIncrement}`,
    color: 'air-primary-alert',
    id: 'slideover-dismiss'
  })
}
</script>

<template>
  <B24Button label="Открыть" @click="open" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { LazySlideoverExample } from '#components'

const count = ref(0)

const toast = useToast()
const overlay = useOverlay()

const slideover = overlay.create(LazySlideoverExample)

async function open() {
  const instance = slideover.open({
    count: count.value
  })

  const shouldIncrement = await instance.result

  if (shouldIncrement) {
    count.value++

    toast.add({
      title: `Success: ${shouldIncrement}`,
      color: 'air-primary-success',
      id: 'slideover-success'
    })

    // Обновляем счётчик
    slideover.patch({
      count: count.value
    })
    return
  }

  toast.add({
    title: `Dismissed: ${shouldIncrement}`,
    color: 'air-primary-alert',
    id: 'slideover-dismiss'
  })
}
</script>

<template>
  <B24Button label="Открыть" @click="open" />
</template>
Закрыть боковую панель изнутри компонента можно вызовом emit('close').

Вложенные боковые панели

Боковые панели можно вкладывать друг в друга.

<script setup lang="ts">
const first = ref(false)
const second = ref(false)
</script>

<template>
  <B24Slideover v-model:open="first" title="Первая боковая панель">
    <B24Button variant="subtle" label="Открыть" />

    <template #body>
      <Placeholder class="h-full" />
    </template>

    <template #footer>
      <B24Slideover v-model:open="second" title="Вторая боковая панель">
        <B24Button size="lg" label="Открыть второе" color="air-primary" />

        <template #body>
          <Placeholder class="h-full" />
        </template>

        <template #footer>
          <B24Button size="sm" color="air-tertiary" label="Отмена" :normal-case="false" @click="second = false" />
        </template>
      </B24Slideover>

      <B24Button size="sm" color="air-tertiary" label="Отмена" :normal-case="false" @click="first = false" />
    </template>
  </B24Slideover>
</template>
<script setup lang="ts">
import { ref } from 'vue'

const first = ref(false)
const second = ref(false)
</script>

<template>
  <B24Slideover v-model:open="first" title="Первая боковая панель">
    <B24Button variant="subtle" label="Открыть" />

    <template #body>
      <Placeholder class="h-full" />
    </template>

    <template #footer>
      <B24Slideover v-model:open="second" title="Вторая боковая панель">
        <B24Button size="lg" label="Открыть второе" color="air-primary" />

        <template #body>
          <Placeholder class="h-full" />
        </template>

        <template #footer>
          <B24Button size="sm" color="air-tertiary" label="Отмена" :normal-case="false" @click="second = false" />
        </template>
      </B24Slideover>

      <B24Button size="sm" color="air-tertiary" label="Отмена" :normal-case="false" @click="first = false" />
    </template>
  </B24Slideover>
</template>

Слот #footer добавляет содержимое после тела Slideover.

<script setup lang="ts">
const open = ref(false)
</script>

<template>
  <B24Slideover
    v-model:open="open"
    title="Боковая панель с подвалом"
    description="Пригодится, когда в боковой панели нужна форма."
    :b24ui="{ footer: 'justify-between' }"
  >
    <B24Button label="Открыть" />

    <template #body>
      <Placeholder class="h-full" />
    </template>

    <template #footer="{ close }">
      <div class="w-1/5 flex items-center justify-start" />
      <div class="w-full flex flex-row items-center justify-center gap-2.5">
        <B24ModalDialogClose>
          <B24Button size="lg" color="air-primary" label="Сохранить" />
        </B24ModalDialogClose>
        <B24Button size="sm" color="air-tertiary" label="Отмена" :normal-case="false" @click="close" />
      </div>
      <div class="w-1/5 flex items-center justify-end">
        <B24Button label="Полная версия" size="sm" color="air-tertiary-no-accent" />
      </div>
    </template>
  </B24Slideover>
</template>
<script setup lang="ts">
import { ref } from 'vue'

const open = ref(false)
</script>

<template>
  <B24Slideover
    v-model:open="open"
    title="Боковая панель с подвалом"
    description="Пригодится, когда в боковой панели нужна форма."
    :b24ui="{ footer: 'justify-between' }"
  >
    <B24Button label="Открыть" />

    <template #body>
      <Placeholder class="h-full" />
    </template>

    <template #footer="{ close }">
      <div class="w-1/5 flex items-center justify-start" />
      <div class="w-full flex flex-row items-center justify-center gap-2.5">
        <B24ModalDialogClose>
          <B24Button size="lg" color="air-primary" label="Сохранить" />
        </B24ModalDialogClose>
        <B24Button size="sm" color="air-tertiary" label="Отмена" :normal-case="false" @click="close" />
      </div>
      <div class="w-1/5 flex items-center justify-end">
        <B24Button label="Полная версия" size="sm" color="air-tertiary-no-accent" />
      </div>
    </template>
  </B24Slideover>
</template>

Простой список элементов

<script setup lang="ts">
import { ref } from 'vue'
import TrendUpIcon from '@bitrix24/b24icons-vue/outline/TrendUpIcon'
import TrendDownIcon from '@bitrix24/b24icons-vue/outline/TrendDownIcon'
import BusinesProcessStagesIcon from '@bitrix24/b24icons-vue/outline/BusinesProcessStagesIcon'

const openListItem = ref(false)

// Управляем состоянием загрузки
const handleAction = async () => {
  await new Promise(resolve => setTimeout(resolve, 2_000))
}
</script>

<template>
  <B24Slideover
    ref="currentSlideoverRef"
    title="Какой-то список"
    description="Какое-то описание"
    :use-light-content="false"
    :b24ui="{
      content: [
        'sm:max-w-[970px] sm:top-[275px] sm:max-h-[calc(100%-275px)]',
        'air-custom-bg',
        'edge-dark',
        'edge-dark:[--air-theme-bg-color:#7c235b]',
        'edge-dark:[--air-theme-bg-size:cover]',
        'edge-dark:[--air-theme-bg-repeat:no-repeat]',
        'edge-dark:[--air-theme-bg-position:0_0]',
        'edge-dark:[--air-theme-bg-attachment:local]',
        'edge-dark:[--air-theme-bg-image:url(/bg/edge-dark-v2.jpg)]',
        'dark:before:absolute',
        'dark:before:inset-0 dark:before:bg-black/50'
      ].join(' '),
      body: 'scrollbar-thin pt-0'
    }"
  >
    <B24Button label="Какой-то список" color="air-boost" />
    <template #body>
      <B24Card class="base-mode" :b24ui="{ body: '!px-0 !py-0' }">
        <B24TableWrapper
          row-hover
          class="overflow-x-auto w-full"
        >
          <table>
            <!-- шапка -->
            <thead>
              <tr>
                <th>#</th>
                <th>Компания</th>
                <th>Статус</th>
                <th>Сумма (USD)</th>
              </tr>
            </thead>
            <tbody>
              <!-- строка 1 -->
              <tr>
                <th>1</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Tech Innovators Inc.
                  </B24Link>
                </td>
                <td><B24Badge label="Предложение отправлено" use-link use-close /></td>
                <td>50,000</td>
              </tr>
              <!-- строка 2 -->
              <tr>
                <th>2</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Global Solutions Ltd.
                  </B24Link>
                </td>
                <td><B24Badge label="Переговоры" use-link inverted use-close /></td>
                <td>120,000</td>
              </tr>
              <!-- строка 3 -->
              <tr>
                <th>3</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Future Enterprises
                  </B24Link>
                </td>
                <td><B24Chip standalone color="air-primary-warning" text="Договор подписан" size="lg" :trailing-icon="TrendUpIcon" /></td>
                <td>200,000</td>
              </tr>
              <!-- строка 4 -->
              <tr>
                <th>4</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Bright Ideas Co.
                  </B24Link>
                </td>
                <td>
                  <B24Chip
                    standalone
                    text="Первичный контакт"
                    color="air-primary-alert"
                    size="lg"
                    inverted
                    :trailing-icon="TrendDownIcon"
                  />
                </td>
                <td>15,000</td>
              </tr>
              <!-- строка 5 -->
              <tr>
                <th>5</th>
                <td>
                  <B24Link @click="openListItem = true">
                    NextGen Technologies
                  </B24Link>
                </td>
                <td>
                  <B24Chip
                    standalone
                    text="Важно"
                    size="lg"
                    color="air-primary-alert"
                    :b24ui="{ base: 'style-filled-boost' }"
                  />
                </td>
                <td>300,000</td>
              </tr>
              <!-- строка 6 -->
              <tr>
                <th>6</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Apex Dynamics
                  </B24Link>
                </td>
                <td><B24Badge label="Первичный звонок" use-link use-close /></td>
                <td>35,000</td>
              </tr>
              <!-- строка 7 -->
              <tr>
                <th>7</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Vertex Systems
                  </B24Link>
                </td>
                <td><B24Badge label="Предложение отправлено" use-link inverted use-close /></td>
                <td>82,000</td>
              </tr>
              <!-- строка 8 -->
              <tr>
                <th>8</th>
                <td>
                  <B24Link @click="openListItem = true">
                    NovaSphere LLC
                  </B24Link>
                </td>
                <td><B24Chip standalone color="air-primary-success" text="Закрыто успешно" size="lg" :trailing-icon="TrendUpIcon" /></td>
                <td>450,000</td>
              </tr>
              <!-- строка 9 -->
              <tr>
                <th>9</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Stellar Innovations
                  </B24Link>
                </td>
                <td>
                  <B24Chip
                    standalone
                    text="Проверка договора"
                    color="air-primary-warning"
                    size="lg"
                    inverted
                    :trailing-icon="TrendUpIcon"
                  />
                </td>
                <td>175,000</td>
              </tr>
              <!-- строка 10 -->
              <tr>
                <th>10</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Crestline Partners
                  </B24Link>
                </td>
                <td><B24Badge label="Переговоры" use-link use-close /></td>
                <td>95,000</td>
              </tr>
              <!-- строка 11 -->
              <tr>
                <th>11</th>
                <td>
                  <B24Link @click="openListItem = true">
                    OmniCore Solutions
                  </B24Link>
                </td>
                <td>
                  <B24Chip
                    standalone
                    text="Срочно"
                    size="lg"
                    color="air-primary-alert"
                    :b24ui="{ base: 'style-filled-boost' }"
                  />
                </td>
                <td>60,000</td>
              </tr>
              <!-- строка 12 -->
              <tr>
                <th>12</th>
                <td>
                  <B24Link @click="openListItem = true">
                    BlueWave Technologies
                  </B24Link>
                </td>
                <td><B24Badge label="Предложение отправлено" use-link inverted use-close /></td>
                <td>110,000</td>
              </tr>
              <!-- строка 13 -->
              <tr>
                <th>13</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Aspire Group
                  </B24Link>
                </td>
                <td><B24Chip standalone color="air-primary-success" text="Закрыто успешно" size="lg" :trailing-icon="TrendUpIcon" /></td>
                <td>525,000</td>
              </tr>
              <!-- строка 14 -->
              <tr>
                <th>14</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Catalyst Partners
                  </B24Link>
                </td>
                <td>
                  <B24Chip
                    standalone
                    text="Первичный контакт"
                    color="air-primary-alert"
                    size="lg"
                    inverted
                    :trailing-icon="TrendDownIcon"
                  />
                </td>
                <td>28,000</td>
              </tr>
              <!-- строка 15 -->
              <tr>
                <th>15</th>
                <td>
                  <B24Link @click="openListItem = true">
                    Zenith Technologies
                  </B24Link>
                </td>
                <td><B24Badge label="Первичный звонок" use-link use-close /></td>
                <td>42,000</td>
              </tr>
            </tbody>
            <tfoot>
              <tr>
                <th colspan="3" class="text-end">
                  Total:
                </th>
                <td>
                  2,387,000
                </td>
              </tr>
            </tfoot>
          </table>
        </B24TableWrapper>
      </B24Card>
    </template>

    <template #footer>
      <B24Button
        size="lg"
        color="air-primary"
        label="Перезагрузить"
        loading-auto
        @click="handleAction"
      />
      <B24ModalDialogClose>
        <B24Button
          size="sm"
          color="air-tertiary"
          label="Отмена"
          :normal-case="false"
        />
      </B24ModalDialogClose>
    </template>
  </B24Slideover>
  <B24Slideover
    v-model:open="openListItem"
    :close="{ label: 'Элемент' }"
    title="Элемент"
    description="Какое-то описание"
    :b24ui="{ content: 'sm:max-w-[965px] sm:top-[375px] sm:max-h-[calc(100%-375px)]' }"
  >
    <template #header>
      <B24Card class="base-mode" :b24ui="{ root: 'w-full', body: 'flex flex-row items-center justify-between gap-[20px]' }">
        <B24Avatar
          :icon="BusinesProcessStagesIcon"
          alt="Рабочие процессы"
          size="2xl"
          :b24ui="{
            root: 'bg-(--ui-color-primary)',
            icon: 'size-[48px] text-(--ui-color-palette-white-base)'
          }"
        />
        <div class="flex-1">
          <ProseH1 class="leading-[29px] font-(--ui-font-weight-light)">
            Рабочие процессы
          </ProseH1>
          <ProseP small accent="less">
            Автоматизируйте рабочие процессы, контролируйте каждый этап и управляйте процессами с телефона.
          </ProseP>
        </div>
      </B24Card>
    </template>
    <template #body>
      <Placeholder class="size-full" />
    </template>
    <template #footer>
      <B24ModalDialogClose>
        <B24Button size="lg" color="air-primary" label="Продолжить" />
      </B24ModalDialogClose>
      <B24ModalDialogClose>
        <B24Button size="sm" color="air-tertiary" label="Отмена" :normal-case="false" />
      </B24ModalDialogClose>
    </template>
  </B24Slideover>
</template>
Много примеров есть в песочнице и в демо-версии.

API

Пропсы

Prop Default Type
title string
description string
content DialogContentProps & Partial<EmitsToProps<DialogContentImplEmits>>

The content of the slideover.

overlaytrueboolean

Render an overlay behind the slideover.

overlayBlur'off' "off" | "auto" | "on"

Render an overlay blur behind the slideover. auto use motion-safe.

transitiontrueboolean

Animate the slideover when opening or closing.

side'bottom' "bottom" | "top" | "right" | "left"

The side of the slideover.

insetfalseboolean

Whether to inset the slideover from the edges.

portaltrue string | false | true | HTMLElement

Render the slideover in a portal.

closetrueboolean | Omit<ButtonProps, LinkPropsKeys>

Display a close button to dismiss the slideover. { color: 'air-primary' } for left, right, bottom{ color: 'air-tertiary' } for top

closeIconicons.closeIconComponent

The icon displayed in the close button.

dismissibletrueboolean

When false, the slideover will not close when clicking outside or pressing escape.

openboolean

The controlled open state of the dialog. Can be binded as v-model:open.

defaultOpenboolean

The open state of the dialog when it is initially rendered. Use when you do not need to control its open state.

modaltrueboolean

The modality of the dialog When set to true,
interaction with outside elements will be disabled and only dialog content will be visible to screen readers.

unmountOnHidetrueboolean

When set to false, the dialog content will not be unmounted when closed, but instead hidden with CSS.
Useful for SEO or when you want to improve performance by not remounting the component on every open.

b24ui { overlay?: SlotClass; content?: SlotClass; header?: SlotClass; wrapper?: SlotClass; body?: SlotClass; footer?: SlotClass; title?: SlotClass; description?: SlotClass; close?: SlotClass; safeList?: SlotClass; }

Слоты

Slot Type
default{ open: boolean; }
content{ close: () => void; }
header{ close: () => void; }
title{}
description{}
actions{}
close{ b24ui: object; }
body{ close: () => void; }
footer{ close: () => void; }

События

Event Type
leave[]
after:leave[]
enter[]
after:enter[]
close:prevent[]
update:open[value: boolean]

Доступность 2.14+

При открытии фокус на один такт снимается с триггера, после чего его перехватывает ловушка фокуса диалога. Так обходится ошибка тайминга в reka-ui, из-за которой браузер отказывается применять aria-hidden и пишет в журнал «Blocked aria-hidden on an element because its descendant retained focus».

Фокус возвращается туда, где он был до открытия, в том числе когда компонент открыт программно, а не через слот триггера. Скринридеры, которые сразу озвучивают смену фокуса (в первую очередь VoiceOver), могут на мгновение произнести заголовок страницы раньше заголовка диалога.

Тема

https://github.com/bx-shef/b24-ui/tree/main/src/theme/slideover.ts
export default {
  slots: {
    overlay: 'fixed inset-0 bg-linear-to-b from-[#00204e]/52 to-[#00204e]',
    content: 'base-mode fixed bg-(--ui-color-gray-05) dark:bg-(--ui-color-base-black-fixed) sm:shadow-lg flex flex-col focus:outline-none h-full',
    header: 'py-5 px-5 flex items-center gap-x-3 gap-y-1.5',
    wrapper: '',
    body: 'size-full flex-1 overflow-y-auto pb-2.5 px-5',
    footer: 'absolute inset-x-0 bottom-0 base-mode bg-(--ui-color-bg-content-primary) flex items-center justify-center gap-2.5 border-t border-t-1 border-t-(--ui-color-divider-less) shadow-top-md py-[13px] px-[13px]',
    title: 'font-[family-name:var(--ui-font-family-primary)] text-label font-(--ui-font-weight-semi-bold) mb-0 text-(length:--ui-font-size-4xl)/[calc(var(--ui-font-size-4xl)+2px)]',
    description: 'mt-1 text-description text-(length:--ui-font-size-sm)',
    close: 'absolute',
    safeList: 'group-hover:rounded-full group-hover:border-1 group-hover:border-current'
  },
  variants: {
    useFooter: {
      true: {
        body: 'mb-[64px]'
      }
    },
    overlayBlur: {
      auto: {
        overlay: 'motion-safe:backdrop-blur-sm'
      },
      on: {
        overlay: 'backdrop-blur-sm'
      },
      off: {
        overlay: ''
      }
    },
    side: {
      top: {
        content: ''
      },
      right: {
        content: '',
        header: 'py-1 min-h-(--b24ui-header-height)'
      },
      bottom: {
        content: ''
      },
      left: {
        content: '',
        header: 'py-1 min-h-(--b24ui-header-height)'
      }
    },
    inset: {
      true: {
        content: 'rounded-[18px]'
      }
    },
    transition: {
      true: {
        overlay: 'motion-safe:data-[state=open]:animate-[fade-in_200ms_var(--ease-out)] motion-safe:data-[state=closed]:animate-[fade-out_200ms_var(--ease-out)]'
      }
    }
  },
  compoundVariants: [
    {
      side: 'top',
      inset: true,
      class: {
        content: 'max-h-[calc(100%-2rem)] inset-x-4 top-4'
      }
    },
    {
      side: 'top',
      inset: false,
      class: {
        content: 'max-h-full inset-x-0 top-0'
      }
    },
    {
      side: 'right',
      inset: true,
      class: {
        content: 'w-[calc(100%-2rem)] max-h-[calc(100%-2rem)] inset-y-4 right-4 '
      }
    },
    {
      side: 'right',
      inset: false,
      class: {
        content: 'w-[calc(100%-60px)] sm:w-[calc(100%-150px)] inset-y-0 right-0'
      }
    },
    {
      side: 'bottom',
      inset: true,
      class: {
        content: 'max-h-[calc(100%-2rem)] w-[calc(100%-2rem)] end-4 bottom-4'
      }
    },
    {
      side: 'bottom',
      inset: false,
      class: {
        content: 'max-h-full sm:max-h-[calc(100%-18px)] right-[5px] top-0 sm:top-4.5 bottom-0 w-[calc(100%-60px-5px)] sm:w-[calc(100%-150px-70px)] sm:rounded-t-[18px]'
      }
    },
    {
      side: 'left',
      inset: true,
      class: {
        content: 'w-[calc(100%-2rem)] max-h-[calc(100%-2rem)] inset-y-4 left-4'
      }
    },
    {
      side: 'left',
      inset: false,
      class: {
        content: 'w-[calc(100%-60px)] sm:w-[calc(100%-150px)] inset-y-0 left-0'
      }
    },
    {
      side: [
        'right',
        'bottom'
      ],
      inset: false,
      class: {
        close: 'pl-1.5 pr-[4px] top-[17px] -translate-x-full left-0 rounded-l-full'
      }
    },
    {
      side: 'left',
      inset: false,
      class: {
        close: 'pr-1.5 pl-[4px] top-[17px] translate-x-full right-0 rounded-r-full [&>div]:flex-row-reverse'
      }
    },
    {
      inset: true,
      class: {
        close: 'top-4 end-4'
      }
    },
    {
      side: 'top',
      class: {
        close: 'top-4 end-4'
      }
    },
    {
      transition: true,
      side: 'top',
      class: {
        content: 'motion-safe:data-[state=open]:animate-[slide-in-from-top_200ms_var(--ease-out)] motion-safe:data-[state=closed]:animate-[slide-out-to-top_200ms_var(--ease-out)]'
      }
    },
    {
      transition: true,
      side: 'right',
      class: {
        content: 'motion-safe:data-[state=open]:animate-[slide-in-from-right_200ms_var(--ease-out)] motion-safe:data-[state=closed]:animate-[slide-out-to-right_200ms_var(--ease-out)]'
      }
    },
    {
      transition: true,
      side: 'bottom',
      class: {
        content: 'motion-safe:data-[state=open]:animate-[slide-in-from-bottom_200ms_var(--ease-out)] motion-safe:data-[state=closed]:animate-[slide-out-to-bottom_200ms_var(--ease-out)]'
      }
    },
    {
      transition: true,
      side: 'left',
      class: {
        content: 'motion-safe:data-[state=open]:animate-[slide-in-from-left_200ms_var(--ease-out)] motion-safe:data-[state=closed]:animate-[slide-out-to-left_200ms_var(--ease-out)]'
      }
    }
  ],
  defaultVariants: {
    side: 'bottom',
    overlayBlur: 'off'
  }
}