daisy-ui-kit 1.0.5 → 1.0.7

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,14 +1,15 @@
1
1
  <script setup lang="ts">
2
2
  import { inject } from 'vue'
3
+ import { drawerStateKey } from './drawer-utils'
3
4
 
4
5
  interface DrawerState {
5
6
  isDrawerOpen: boolean
6
- openDrawer: Function
7
- closeDrawer: Function
8
- toggleDrawer: Function
7
+ openDrawer: () => void
8
+ closeDrawer: () => void
9
+ toggleDrawer: () => void
9
10
  }
10
11
 
11
- const drawerState: DrawerState | undefined = inject('drawerState')
12
+ const drawerState: DrawerState | undefined = inject(drawerStateKey)
12
13
  </script>
13
14
 
14
15
  <template>
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, provide, reactive } from 'vue'
3
+ import { drawerStateKey } from './drawer-utils'
3
4
 
4
5
  const props = defineProps({
5
6
  right: Boolean,
@@ -17,7 +18,8 @@ const drawerState = reactive({
17
18
  drawerState.isDrawerOpen = !drawerState.isDrawerOpen
18
19
  },
19
20
  })
20
- provide('drawerState', drawerState)
21
+
22
+ provide(drawerStateKey, drawerState)
21
23
 
22
24
  const classes = computed(() => {
23
25
  return {
@@ -1,7 +1,15 @@
1
1
  <script setup lang="ts">
2
2
  import { inject } from 'vue'
3
+ import { drawerStateKey } from './drawer-utils'
3
4
 
4
- const drawerState = inject('drawerState')
5
+ interface DrawerState {
6
+ isDrawerOpen: boolean
7
+ openDrawer: () => void
8
+ closeDrawer: () => void
9
+ toggleDrawer: () => void
10
+ }
11
+
12
+ const drawerState: DrawerState | undefined = inject(drawerStateKey)
5
13
  </script>
6
14
 
7
15
  <template>
@@ -2,7 +2,7 @@
2
2
  import { computed, withDefaults } from 'vue'
3
3
 
4
4
  interface Props {
5
- modelValue?: string
5
+ modelValue?: string | number
6
6
  placeholder?: string
7
7
  type?: 'text' | 'phone' | 'email' | 'search' | 'password'
8
8
 
@@ -0,0 +1,10 @@
1
+ import type { InjectionKey } from 'vue'
2
+
3
+ export interface DrawerState {
4
+ isDrawerOpen: boolean
5
+ openDrawer: () => void
6
+ closeDrawer: () => void
7
+ toggleDrawer: () => void
8
+ }
9
+
10
+ export const drawerStateKey = Symbol('drawerState') as InjectionKey<DrawerState>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daisy-ui-kit",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "nuxi build",