daisy-ui-kit 3.0.7 → 3.0.9

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.
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { computed, inject } from 'vue'
2
+ import { computed, inject, ref } from 'vue'
3
3
 
4
4
  const props = defineProps<{
5
5
  style?: 'arrow' | 'plus'
@@ -5,6 +5,8 @@ import { onClickOutside, syncRefs, useElementHover } from '@vueuse/core'
5
5
  import { randomString } from '../utils/random-string'
6
6
 
7
7
  const props = withDefaults(defineProps<{
8
+ // allows passing a custom id to the dropdown. Required for SSR hydration.
9
+ randomId?: string
8
10
  autoFocus?: boolean
9
11
 
10
12
  placement?: 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end'
@@ -29,7 +31,7 @@ provide('isDropdownOpen', isOpen)
29
31
  const autoFocus = ref(props.autoFocus)
30
32
  provide('dropdownAutoFocus', autoFocus)
31
33
 
32
- const randomValue = randomString(12)
34
+ const randomValue = props.randomId || randomString(12)
33
35
  const wrapperId = `dropdown-wrapper-${randomValue}`
34
36
  const id = `dropdown-${randomValue}`
35
37
  provide('dropdownId', id)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daisy-ui-kit",
3
- "version": "3.0.7",
3
+ "version": "3.0.9",
4
4
  "description": "Start with DaisyUI CSS and Sprinkle in TypeScript and A11y.",
5
5
  "author": "Marshall Thompson",
6
6
  "license": "MIT",