daisy-ui-kit 5.0.0-pre.9 → 5.0.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.
Files changed (94) hide show
  1. package/README.md +277 -48
  2. package/app/components/Accordion.vue +8 -5
  3. package/app/components/Alert.vue +2 -1
  4. package/app/components/Avatar.vue +10 -7
  5. package/app/components/AvatarGroup.vue +6 -2
  6. package/app/components/Badge.vue +19 -1
  7. package/app/components/Button.vue +66 -46
  8. package/app/components/Calendar.vue +151 -42
  9. package/app/components/CalendarInput.vue +229 -130
  10. package/app/components/CalendarSkeleton.vue +51 -10
  11. package/app/components/Card.vue +20 -2
  12. package/app/components/CardActions.vue +1 -1
  13. package/app/components/CardBody.vue +1 -1
  14. package/app/components/CardTitle.vue +1 -1
  15. package/app/components/Carousel.vue +2 -1
  16. package/app/components/Chat.vue +6 -1
  17. package/app/components/Checkbox.vue +1 -1
  18. package/app/components/Collapse.vue +38 -5
  19. package/app/components/CollapseTitle.vue +11 -1
  20. package/app/components/Countdown.vue +3 -3
  21. package/app/components/CountdownTimers.vue +4 -7
  22. package/app/components/Counter.vue +14 -3
  23. package/app/components/DaisyLink.vue +33 -15
  24. package/app/components/Dock.vue +5 -6
  25. package/app/components/DockItem.vue +5 -3
  26. package/app/components/Drawer.vue +15 -12
  27. package/app/components/DrawerContent.vue +9 -6
  28. package/app/components/DrawerSide.vue +9 -6
  29. package/app/components/Dropdown.vue +61 -50
  30. package/app/components/DropdownButton.vue +11 -4
  31. package/app/components/DropdownContent.vue +90 -20
  32. package/app/components/DropdownTarget.vue +10 -3
  33. package/app/components/Fab.vue +16 -0
  34. package/app/components/FabClose.vue +18 -0
  35. package/app/components/FabMainAction.vue +5 -0
  36. package/app/components/FabTrigger.vue +117 -0
  37. package/app/components/Fieldset.vue +5 -4
  38. package/app/components/FileInput.vue +1 -1
  39. package/app/components/Filter.vue +45 -38
  40. package/app/components/Flex.vue +8 -1
  41. package/app/components/FlexItem.vue +30 -27
  42. package/app/components/Footer.vue +16 -12
  43. package/app/components/FooterTitle.vue +8 -5
  44. package/app/components/Hero.vue +9 -6
  45. package/app/components/HeroContent.vue +9 -6
  46. package/app/components/Hover3D.vue +22 -0
  47. package/app/components/HoverGallery.vue +11 -0
  48. package/app/components/Indicator.vue +12 -5
  49. package/app/components/IndicatorItem.vue +21 -14
  50. package/app/components/Input.vue +44 -47
  51. package/app/components/Kbd.vue +2 -1
  52. package/app/components/Label.vue +32 -29
  53. package/app/components/MenuExpand.vue +5 -13
  54. package/app/components/MenuExpandToggle.vue +7 -1
  55. package/app/components/MenuItem.vue +6 -4
  56. package/app/components/Modal.vue +23 -17
  57. package/app/components/Progress.vue +13 -1
  58. package/app/components/Prose.vue +7 -2
  59. package/app/components/RadialProgress.vue +8 -8
  60. package/app/components/Radio.vue +1 -1
  61. package/app/components/RadioGroup.vue +2 -2
  62. package/app/components/Range.vue +186 -46
  63. package/app/components/RangeMeasure.vue +33 -30
  64. package/app/components/RangeMeasureTick.vue +4 -5
  65. package/app/components/Rating.vue +70 -53
  66. package/app/components/Select.vue +44 -47
  67. package/app/components/SkeletonText.vue +11 -0
  68. package/app/components/Stack.vue +5 -0
  69. package/app/components/Steps.vue +7 -2
  70. package/app/components/Swap.vue +4 -10
  71. package/app/components/Tab.vue +23 -5
  72. package/app/components/Text.vue +47 -23
  73. package/app/components/TextArea.vue +75 -30
  74. package/app/components/TextRotate.vue +24 -0
  75. package/app/components/ThemeController.vue +3 -4
  76. package/app/components/ThemeProvider.vue +47 -32
  77. package/app/components/TimelineLine.vue +1 -1
  78. package/app/components/TimelineStart.vue +2 -1
  79. package/app/components/Toast.vue +3 -8
  80. package/app/components/Toggle.vue +2 -2
  81. package/app/components/Tooltip.vue +111 -21
  82. package/app/components/TooltipContent.vue +279 -1
  83. package/app/components/TooltipTarget.vue +20 -0
  84. package/app/composables/__tests__/use-calendar.test.ts +239 -0
  85. package/app/composables/use-calendar.ts +288 -0
  86. package/app/composables/use-daisy-theme.ts +140 -0
  87. package/app/composables/use-toast.ts +345 -0
  88. package/app/composables/useSearch.ts +22 -0
  89. package/app/utils/drawer-utils.ts +15 -13
  90. package/app/utils/position-area.ts +40 -0
  91. package/nuxt.d.ts +13 -0
  92. package/nuxt.js +12 -9
  93. package/package.json +34 -17
  94. package/app/utils/random-string.ts +0 -19
@@ -1,17 +1,58 @@
1
1
  <script setup lang="ts">
2
2
  import Skeleton from './Skeleton.vue'
3
3
 
4
- const { numberOfMonths = 1 } = defineProps<{
4
+ const props = defineProps<{
5
5
  numberOfMonths?: number
6
+ date?: Date
7
+ firstDay?: number // 0 = Sunday, 1 = Monday, etc. (matches Pikaday's firstDay option)
6
8
  }>()
9
+
10
+ // Calculate the number of weeks needed for a given month
11
+ function getWeeksInMonth(date: Date, weekStartDay: number = 0): number {
12
+ const year = date.getFullYear()
13
+ const month = date.getMonth()
14
+
15
+ // Get first day of month
16
+ const firstDay = new Date(year, month, 1)
17
+ const firstDayOfWeek = firstDay.getDay()
18
+
19
+ // Get last day of month
20
+ const lastDay = new Date(year, month + 1, 0)
21
+ const daysInMonth = lastDay.getDate()
22
+
23
+ // Calculate offset based on what day the week starts on
24
+ // If week starts on Monday (1) and month starts on Sunday (0), offset is 6
25
+ // If week starts on Sunday (0) and month starts on Sunday (0), offset is 0
26
+ const offset = (firstDayOfWeek - weekStartDay + 7) % 7
27
+
28
+ // Calculate total cells needed (days in month + offset from first day)
29
+ const totalCells = daysInMonth + offset
30
+
31
+ // Return number of weeks (rows) needed
32
+ return Math.ceil(totalCells / 7)
33
+ }
34
+
35
+ // Calculate weeks for each month being displayed
36
+ const weeksPerMonth = computed(() => {
37
+ const baseDate = props.date || new Date()
38
+ const weekStartDay = props.firstDay ?? 0
39
+ const weeks: number[] = []
40
+
41
+ for (let i = 0; i < (props.numberOfMonths || 1); i++) {
42
+ const monthDate = new Date(baseDate.getFullYear(), baseDate.getMonth() + i, 1)
43
+ weeks.push(getWeeksInMonth(monthDate, weekStartDay))
44
+ }
45
+
46
+ return weeks
47
+ })
7
48
  </script>
8
49
 
9
50
  <template>
10
51
  <Skeleton col class="bg-base-200 rounded-box">
11
52
  <div
12
- v-for="(month, idx) in numberOfMonths"
13
- :key="`calendar-${month}`"
14
- class="w-[270px] h-[270px] p-3 mx-auto flex flex-col gap-2"
53
+ v-for="(weeks, idx) in weeksPerMonth"
54
+ :key="`calendar-${idx}`"
55
+ class="w-[270px] px-3 py-[14px] mx-auto flex flex-col gap-2"
15
56
  :class="{
16
57
  '-mt-3.5': idx > 0,
17
58
  }"
@@ -28,17 +69,17 @@ const { numberOfMonths = 1 } = defineProps<{
28
69
  <span
29
70
  class="size-4 rounded-full bg-base-300 inline-block"
30
71
  :class="{
31
- 'bg-base-300': idx === numberOfMonths - 1,
32
- 'bg-transparent': idx !== numberOfMonths - 1,
72
+ 'bg-base-300': idx === weeksPerMonth.length - 1,
73
+ 'bg-transparent': idx !== weeksPerMonth.length - 1,
33
74
  }"
34
75
  />
35
76
  </Flex>
36
- <Flex col grow justify-between class="h-full">
37
- <div class="grid grid-cols-7 gap-[4px] mb-4 flex-shrink-0">
77
+ <Flex col class="h-full">
78
+ <div class="grid grid-cols-7 gap-[4px] mb-3 flex-shrink-0">
38
79
  <span v-for="d in 7" :key="`dow-${d}`" class="size-4 rounded-full bg-base-300 mx-auto block" />
39
80
  </div>
40
- <div class="grid grid-cols-7 gap-[4px] flex-grow items-center">
41
- <span v-for="i in 35" :key="`day-${i}`" class="size-7 rounded-full bg-base-300 block mx-auto" />
81
+ <div class="grid grid-cols-7 gap-y-[8px] gap-x-[4px]">
82
+ <span v-for="i in weeks * 7" :key="`day-${i}`" class="size-7 rounded-full bg-base-300 block mx-auto" />
42
83
  </div>
43
84
  </Flex>
44
85
  </div>
@@ -1,6 +1,12 @@
1
1
  <script setup lang="ts">
2
+ import { computed, resolveComponent } from 'vue'
3
+
4
+ defineOptions({
5
+ inheritAttrs: false,
6
+ })
7
+
2
8
  const { is = 'div', ...props } = defineProps<{
3
- is?: any
9
+ is?: string
4
10
  border?: boolean
5
11
  dash?: boolean
6
12
  side?: boolean
@@ -12,11 +18,23 @@ const { is = 'div', ...props } = defineProps<{
12
18
  sm?: boolean
13
19
  xs?: boolean
14
20
  }>()
21
+
22
+ const NuxtLink = resolveComponent('NuxtLink')
23
+ const RouterLink = resolveComponent('RouterLink')
24
+
25
+ const resolvedComponent = computed(() => {
26
+ if (is === 'NuxtLink') return NuxtLink
27
+ if (is === 'RouterLink') return RouterLink
28
+ return is
29
+ })
15
30
  </script>
16
31
 
17
32
  <template>
18
33
  <component
19
- :is="is" class="card" :class="{
34
+ :is="resolvedComponent"
35
+ v-bind="$attrs"
36
+ class="card"
37
+ :class="{
20
38
  'card-border': props.border,
21
39
  'card-side': props.side,
22
40
  'image-full': props.imageFull,
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import Text from './Text.vue';
2
+ import Text from './Text.vue'
3
3
 
4
4
  const { is = 'div' } = defineProps<{
5
5
  is?: string
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import Text from './Text.vue';
2
+ import Text from './Text.vue'
3
3
 
4
4
  const { is = 'div' } = defineProps<{
5
5
  is?: string
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import Text from './Text.vue';
2
+ import Text from './Text.vue'
3
3
 
4
4
  const { is = 'div' } = defineProps<{ is?: string }>()
5
5
  </script>
@@ -11,7 +11,8 @@ const { snapTo, center, end, vertical } = defineProps<{
11
11
 
12
12
  <template>
13
13
  <div
14
- class="carousel" :class="{
14
+ class="carousel"
15
+ :class="{
15
16
  'carousel-center': center || snapTo === 'center',
16
17
  'carousel-end': end || snapTo === 'end',
17
18
  'carousel-horizontal': horizontal || orientation === 'horizontal',
@@ -1,5 +1,10 @@
1
1
  <script setup lang="ts">
2
- const { pre, align = 'start', start, end } = defineProps<{
2
+ const {
3
+ pre,
4
+ align = 'start',
5
+ start,
6
+ end,
7
+ } = defineProps<{
3
8
  pre?: boolean
4
9
  align?: string
5
10
  start?: boolean
@@ -47,5 +47,5 @@ const currentValue = computed({
47
47
  'checkbox-lg': lg || size === 'lg',
48
48
  'theme-controller': themeController,
49
49
  }"
50
- >
50
+ />
51
51
  </template>
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { inject, ref } from 'vue'
2
+ import { computed, inject, provide, ref, useId, watch } from 'vue'
3
3
 
4
4
  const props = defineProps<{
5
+ id?: string
5
6
  variant?: 'arrow' | 'plus'
6
7
  arrow?: boolean
7
8
  plus?: boolean
@@ -11,19 +12,49 @@ const props = defineProps<{
11
12
  value?: any
12
13
  }>()
13
14
 
15
+ const isOpen = defineModel('open', { default: false })
16
+
14
17
  const accordionValue = inject('accordion-value', ref(null))
15
18
  const useAccordion = accordionValue.value !== null
16
19
 
20
+ // Internal state for toggle mode
21
+ const internalChecked = ref(props.open || false)
22
+
23
+ // Generate unique ID for checkbox
24
+ const checkboxId = props.id || `collapse-${useId()}`
25
+ provide('collapseCheckboxId', checkboxId)
26
+ provide('collapseToggle', props.toggle || useAccordion)
27
+
28
+ // Sync internal state with modelValue
29
+ watch(
30
+ () => isOpen.value,
31
+ newVal => {
32
+ internalChecked.value = newVal
33
+ },
34
+ )
35
+
36
+ watch(internalChecked, newVal => {
37
+ isOpen.value = newVal
38
+ })
39
+
17
40
  function handleClick() {
41
+ // Only handle clicks for accordion mode
18
42
  if (useAccordion) {
19
43
  accordionValue.value = props.value
20
44
  }
21
45
  }
46
+
47
+ const isChecked = computed(() => {
48
+ if (useAccordion) {
49
+ return accordionValue.value === props.value
50
+ }
51
+ return internalChecked.value
52
+ })
22
53
  </script>
23
54
 
24
55
  <template>
25
56
  <div
26
- tabindex="0"
57
+ :tabindex="props.toggle || useAccordion ? undefined : 0"
27
58
  class="collapse"
28
59
  :class="[
29
60
  { 'collapse-arrow': props.arrow || props.variant === 'arrow' },
@@ -31,13 +62,15 @@ function handleClick() {
31
62
  { 'collapse-open': (props.open && !props.close) || (useAccordion && accordionValue === props.value) },
32
63
  { 'collapse-close': props.close },
33
64
  ]"
34
- @click="handleClick"
65
+ @click="useAccordion ? handleClick : undefined"
35
66
  >
36
67
  <input
37
68
  v-if="props.toggle || useAccordion"
69
+ :id="checkboxId"
70
+ v-model="internalChecked"
38
71
  :type="useAccordion ? 'radio' : 'checkbox'"
39
- :checked="useAccordion ? accordionValue === props.value : undefined"
40
- >
72
+ :checked="useAccordion ? isChecked : undefined"
73
+ />
41
74
  <slot />
42
75
  </div>
43
76
  </template>
@@ -1,5 +1,15 @@
1
+ <script setup lang="ts">
2
+ import { inject } from 'vue'
3
+
4
+ const checkboxId = inject('collapseCheckboxId', null)
5
+ const hasToggle = inject('collapseToggle', false)
6
+ </script>
7
+
1
8
  <template>
2
- <div class="collapse-title">
9
+ <label v-if="hasToggle && checkboxId" :for="checkboxId" class="collapse-title">
10
+ <slot />
11
+ </label>
12
+ <div v-else class="collapse-title">
3
13
  <slot />
4
14
  </div>
5
15
  </template>
@@ -1,11 +1,11 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue';
2
+ import { computed } from 'vue'
3
3
 
4
- const { is = 'span' } = defineProps<{
4
+ const props = defineProps<{
5
5
  is?: any
6
6
  }>()
7
7
 
8
- const tag = computed(() => is)
8
+ const tag = computed(() => props.is || 'span')
9
9
  </script>
10
10
 
11
11
  <template>
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { useIntervalFn } from '@vueuse/core';
3
- import { computed, ref, watch } from 'vue';
2
+ import { useIntervalFn } from '@vueuse/core'
3
+ import { computed, ref, watch } from 'vue'
4
4
 
5
5
  const { durationInSeconds = 0, untilDate } = defineProps<{
6
6
  durationInSeconds?: number
@@ -29,7 +29,7 @@ useIntervalFn(() => {
29
29
  timeLeft.value = calcTimeLeft()
30
30
  }, 1000)
31
31
 
32
- watch(timeLeft, (val) => {
32
+ watch(timeLeft, val => {
33
33
  if (val === 0) {
34
34
  emit('done')
35
35
  }
@@ -42,10 +42,7 @@ const totalDays = computed(() => Math.floor(totalHours.value / 24))
42
42
  const totalWeeks = computed(() => Math.floor(totalDays.value / 7))
43
43
  const totalMonths = computed(() => {
44
44
  const now = new Date()
45
- return (
46
- (targetDate.value.getFullYear() - now.getFullYear()) * 12
47
- + (targetDate.value.getMonth() - now.getMonth())
48
- )
45
+ return (targetDate.value.getFullYear() - now.getFullYear()) * 12 + (targetDate.value.getMonth() - now.getMonth())
49
46
  })
50
47
  const split = computed(() => {
51
48
  const days = totalDays.value
@@ -1,10 +1,21 @@
1
1
  <script setup lang="ts">
2
- const { is = 'span' } = defineProps<{
3
- value: number
2
+ import { computed } from 'vue'
3
+
4
+ const props = defineProps<{
5
+ value: number | string
4
6
  is?: any
7
+ digits?: 2 | 3 | '2' | '3'
5
8
  }>()
9
+
10
+ const style = computed(() => {
11
+ let css = `--value:${props.value};`
12
+ if (props.digits) {
13
+ css += `--digits:${props.digits};`
14
+ }
15
+ return css
16
+ })
6
17
  </script>
7
18
 
8
19
  <template>
9
- <component :is="is" v-bind="$attrs" :style="`--value:${value};`" />
20
+ <component :is="props.is || 'span'" v-bind="$attrs" :style="style" />
10
21
  </template>
@@ -1,25 +1,43 @@
1
1
  <script setup lang="ts">
2
- withDefaults(defineProps<{
3
- is?: string
4
- hover?: boolean
2
+ import { computed, resolveComponent } from 'vue'
5
3
 
6
- color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'success' | 'info' | 'warning' | 'error'
7
- neutral?: boolean
8
- primary?: boolean
9
- secondary?: boolean
10
- accent?: boolean
11
- success?: boolean
12
- info?: boolean
13
- warning?: boolean
14
- error?: boolean
15
- }>(), {
16
- is: 'a',
4
+ defineOptions({
5
+ inheritAttrs: false,
6
+ })
7
+
8
+ const props = withDefaults(
9
+ defineProps<{
10
+ is?: string
11
+ hover?: boolean
12
+
13
+ color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'success' | 'info' | 'warning' | 'error'
14
+ neutral?: boolean
15
+ primary?: boolean
16
+ secondary?: boolean
17
+ accent?: boolean
18
+ success?: boolean
19
+ info?: boolean
20
+ warning?: boolean
21
+ error?: boolean
22
+ }>(),
23
+ {
24
+ is: 'a',
25
+ },
26
+ )
27
+ const NuxtLink = resolveComponent('NuxtLink')
28
+ const RouterLink = resolveComponent('RouterLink')
29
+
30
+ const resolvedComponent = computed(() => {
31
+ if (props.is === 'NuxtLink') return NuxtLink
32
+ if (props.is === 'RouterLink') return RouterLink
33
+ return props.is
17
34
  })
18
35
  </script>
19
36
 
20
37
  <template>
21
38
  <component
22
- :is="is"
39
+ :is="resolvedComponent"
40
+ v-bind="$attrs"
23
41
  class="link"
24
42
  :class="{
25
43
  'link-neutral': neutral || color === 'neutral',
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { randomString } from '../utils/random-string';
2
+ import type { Ref } from 'vue'
3
+ import { provide, ref } from 'vue'
3
4
 
4
5
  const { size, xl, lg, md, sm, xs } = defineProps<{
5
6
  size?: string
@@ -13,16 +14,14 @@ const { size, xl, lg, md, sm, xs } = defineProps<{
13
14
  const activeItemId = ref<string | null>(null)
14
15
  const itemIds = ref<string[]>([])
15
16
 
16
- function registerItem() {
17
- const itemId = randomString()
17
+ function registerItem(itemId: string) {
18
18
  itemIds.value.push(itemId)
19
- function unregister() {
19
+ return function unregister() {
20
20
  itemIds.value = itemIds.value.filter(id => id !== itemId)
21
21
  if (activeItemId.value === itemId) {
22
22
  activeItemId.value = null
23
23
  }
24
24
  }
25
- return { id: itemId, unregister }
26
25
  }
27
26
 
28
27
  function setActiveItemId(itemId: string) {
@@ -31,7 +30,7 @@ function setActiveItemId(itemId: string) {
31
30
 
32
31
  export interface DockState {
33
32
  activeItemId: Ref<string | null>
34
- registerItem: () => { id: string, unregister: () => void }
33
+ registerItem: (itemId: string) => () => void
35
34
  setActiveItemId: (itemId: string) => void
36
35
  }
37
36
 
@@ -1,12 +1,14 @@
1
1
  <script setup lang="ts">
2
- import type { DockState } from './Dock.vue';
2
+ import type { DockState } from './Dock.vue'
3
+ import { inject, onUnmounted, useId } from 'vue'
3
4
 
4
5
  const { active } = defineProps<{
5
6
  active?: boolean
6
7
  }>()
7
8
 
9
+ const itemId = useId()
8
10
  const { registerItem, setActiveItemId, activeItemId } = inject<DockState>('dockState')!
9
- const { id: itemId, unregister } = registerItem()
11
+ const unregister = registerItem(itemId)
10
12
 
11
13
  onUnmounted(() => {
12
14
  unregister()
@@ -17,7 +19,7 @@ onUnmounted(() => {
17
19
  <div
18
20
  :id="`dock-item-${itemId}`"
19
21
  class="dock-item"
20
- :class="{ 'dock-active': active || (activeItemId === itemId) }"
22
+ :class="{ 'dock-active': active || activeItemId === itemId }"
21
23
  @click="setActiveItemId(itemId)"
22
24
  >
23
25
  <slot />
@@ -1,21 +1,24 @@
1
1
  <script setup lang="ts">
2
- import { computed, watch } from 'vue';
3
- import { createDrawerState } from '../utils/drawer-utils';
2
+ import { computed, watch } from 'vue'
3
+ import { createDrawerState } from '../utils/drawer-utils'
4
4
 
5
- const props = withDefaults(defineProps<{
6
- open?: boolean
7
- name?: string
8
- end?: boolean
9
- }>(), {
10
- name: 'drawer',
11
- })
5
+ const props = withDefaults(
6
+ defineProps<{
7
+ open?: boolean
8
+ name?: string
9
+ end?: boolean
10
+ }>(),
11
+ {
12
+ name: 'drawer',
13
+ },
14
+ )
12
15
  const emit = defineEmits(['update:open'])
13
16
 
14
17
  // sync `open` prop with drawerState.isDrawerOpen
15
18
  const drawerState = createDrawerState(props.name)
16
19
  watch(
17
20
  () => props.open,
18
- (value) => {
21
+ value => {
19
22
  if (drawerState.isDrawerOpen !== value) {
20
23
  drawerState.isDrawerOpen = value
21
24
  }
@@ -24,7 +27,7 @@ watch(
24
27
  )
25
28
  watch(
26
29
  () => drawerState.isDrawerOpen,
27
- (value) => {
30
+ value => {
28
31
  if (props.open !== value) {
29
32
  emit('update:open', value)
30
33
  }
@@ -41,7 +44,7 @@ const classes = computed(() => {
41
44
 
42
45
  <template>
43
46
  <div class="drawer" :class="classes">
44
- <input :id="name" v-model="drawerState.isDrawerOpen" type="checkbox" class="drawer-toggle">
47
+ <input :id="name" v-model="drawerState.isDrawerOpen" type="checkbox" class="drawer-toggle" />
45
48
  <slot v-bind="drawerState" />
46
49
  </div>
47
50
  </template>
@@ -1,11 +1,14 @@
1
1
  <script setup lang="ts">
2
- import { createDrawerState } from '../utils/drawer-utils';
2
+ import { createDrawerState } from '../utils/drawer-utils'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- name?: string
6
- }>(), {
7
- name: 'drawer',
8
- })
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ name?: string
7
+ }>(),
8
+ {
9
+ name: 'drawer',
10
+ },
11
+ )
9
12
 
10
13
  const drawerState = createDrawerState(props.name)
11
14
  </script>
@@ -1,11 +1,14 @@
1
1
  <script setup lang="ts">
2
- import { createDrawerState } from '../utils/drawer-utils';
2
+ import { createDrawerState } from '../utils/drawer-utils'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- name?: string
6
- }>(), {
7
- name: 'drawer',
8
- })
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ name?: string
7
+ }>(),
8
+ {
9
+ name: 'drawer',
10
+ },
11
+ )
9
12
 
10
13
  const drawerState = createDrawerState(props.name)
11
14
  </script>