docs/.vitepress/theme/components/settings/ScreenLayoutSwitch.vue

87e89bbd05e11ad365524dbc66500fd5a43b7bd2
wotaku/docs/.vitepress/theme/components/settings/ScreenLayoutSwitch.vue history · blame · raw

66 lines · 1971 bytes

 1<script setup lang="ts">
 2import { NuInputHorizontalRadioGroup } from '@nolebase/ui'
 3import { computed } from 'vue'
 4
 5import MenuTitle from './MenuTitle.vue'
 6
 7import { LayoutMode } from '../../constants'
 8
 9const fieldOptions = computed(() => [
10  {
11    value: LayoutMode.FullWidth,
12    title: 'Expand all',
13    ariaLabel: 'Expand all',
14    icon: 'i-icon-park-outline:full-screen-one',
15    name: 'VitePress Nolebase Enhanced Readabilities Layout Mode Checkbox'
16  },
17  {
18    value: LayoutMode.SidebarWidthAdjustableOnly,
19    title: 'Expand sidebar with adjustable values',
20    ariaLabel: 'Expand sidebar with adjustable values',
21    icon: 'i-icon-park-outline:full-screen-two',
22    name: 'VitePress Nolebase Enhanced Readabilities Layout Mode Checkbox'
23  },
24  {
25    value: LayoutMode.BothWidthAdjustable,
26    title: 'Expand all with adjustable values',
27    ariaLabel: 'Expand all with adjustable values',
28    icon: 'i-icon-park-outline:full-screen',
29    name: 'VitePress Nolebase Enhanced Readabilities Layout Mode Checkbox'
30  },
31  {
32    value: LayoutMode.Original,
33    title: 'Original width',
34    ariaLabel: 'Original width',
35    icon: 'i-icon-park-outline:overall-reduction',
36    name: 'VitePress Nolebase Enhanced Readabilities Layout Mode Checkbox'
37  }
38])
39</script>
40
41<template>
42  <div space-y-2>
43    <MenuTitle title="Layout Switch" aria-label="Layout Switch" disabled>
44      <template #icon>
45        <slot i-icon-park-outline:layout-one mr-1 aria-hidden="true" />
46      </template>
47    </MenuTitle>
48    <div
49      border="1 red/50 solid"
50      bg="red/30"
51      flex
52      items-center
53      rounded-lg
54      p-2
55      opacity-50
56    >
57      <span text-xs>No available layout can be switched in mobile screen.</span>
58    </div>
59    <NuInputHorizontalRadioGroup
60      bg="$vp-nolebase-enhanced-readabilities-menu-background-color"
61      text="sm $vp-nolebase-enhanced-readabilities-menu-text-color"
62      :options="fieldOptions"
63      disabled
64    />
65  </div>
66</template>