@soave/ui 0.2.0 → 0.2.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.
- package/dist/components/ui/Dialog.vue +3 -8
- package/dist/components/ui/DropdownMenu.vue +4 -5
- package/dist/components/ui/DropdownMenuContent.vue +1 -1
- package/dist/components/ui/DropdownMenuItem.vue +1 -1
- package/dist/components/ui/DropdownMenuTrigger.vue +1 -1
- package/dist/components/ui/Popover.vue +4 -5
- package/dist/components/ui/PopoverContent.vue +1 -1
- package/dist/components/ui/PopoverTrigger.vue +1 -1
- package/dist/components/ui/Sheet.vue +2 -2
- package/dist/types/dialog.d.ts +5 -1
- package/dist/types/dialog.mjs +1 -0
- package/dist/types/dropdown.d.ts +3 -0
- package/dist/types/dropdown.mjs +1 -0
- package/dist/types/popover.d.ts +3 -0
- package/dist/types/popover.mjs +1 -0
- package/dist/types/sheet.d.ts +2 -0
- package/dist/types/sheet.mjs +1 -0
- package/package.json +1 -1
|
@@ -44,9 +44,10 @@
|
|
|
44
44
|
</template>
|
|
45
45
|
|
|
46
46
|
<script setup lang="ts">
|
|
47
|
-
import { computed, provide
|
|
47
|
+
import { computed, provide } from "vue"
|
|
48
48
|
import { useStyleAdapter } from "../../composables"
|
|
49
49
|
import type { DialogProps } from "../../types/dialog"
|
|
50
|
+
import { DIALOG_KEY } from "../../types/dialog"
|
|
50
51
|
import type { DialogState } from "../../types/composables"
|
|
51
52
|
|
|
52
53
|
interface DialogComponentProps extends DialogProps {
|
|
@@ -101,13 +102,7 @@ const handleOverlayClick = () => {
|
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
|
|
105
|
-
close: () => void
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export const DialogKey: InjectionKey<DialogContext> = Symbol("dialog")
|
|
109
|
-
|
|
110
|
-
provide(DialogKey, { close })
|
|
105
|
+
provide(DIALOG_KEY, { close })
|
|
111
106
|
</script>
|
|
112
107
|
|
|
113
108
|
<style scoped>
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
|
-
import { provide, ref, type
|
|
9
|
-
import { useDropdown
|
|
8
|
+
import { provide, ref, type Ref } from "vue"
|
|
9
|
+
import { useDropdown } from "../../composables/useDropdown"
|
|
10
10
|
import type { DropdownSide, DropdownAlign } from "../../types/dropdown"
|
|
11
|
+
import { DROPDOWN_CONTEXT_KEY } from "../../types/dropdown"
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
interface Props {
|
|
13
14
|
side?: DropdownSide
|
|
14
15
|
align?: DropdownAlign
|
|
15
16
|
class?: string
|
|
@@ -20,8 +21,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
20
21
|
align: "start"
|
|
21
22
|
})
|
|
22
23
|
|
|
23
|
-
export const DROPDOWN_CONTEXT_KEY: InjectionKey<UseDropdownReturn> = Symbol("dropdown-context")
|
|
24
|
-
|
|
25
24
|
const dropdown_props = ref({
|
|
26
25
|
side: props.side,
|
|
27
26
|
align: props.align
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
<script setup lang="ts">
|
|
20
20
|
import { inject, ref, computed, watchEffect, nextTick, watch } from "vue"
|
|
21
21
|
import { useStyleAdapter } from "../../composables"
|
|
22
|
-
import { DROPDOWN_CONTEXT_KEY } from "./DropdownMenu.vue"
|
|
23
22
|
import type { DropdownContentProps } from "../../types/dropdown"
|
|
23
|
+
import { DROPDOWN_CONTEXT_KEY } from "../../types/dropdown"
|
|
24
24
|
import type { DropdownState } from "../../types/composables"
|
|
25
25
|
|
|
26
26
|
const props = withDefaults(defineProps<DropdownContentProps>(), {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
19
|
import { inject, computed, onMounted } from "vue"
|
|
20
20
|
import { useStyleAdapter } from "../../composables"
|
|
21
|
-
import { DROPDOWN_CONTEXT_KEY } from "./DropdownMenu.vue"
|
|
22
21
|
import type { DropdownItemProps } from "../../types/dropdown"
|
|
22
|
+
import { DROPDOWN_CONTEXT_KEY } from "../../types/dropdown"
|
|
23
23
|
|
|
24
24
|
const props = withDefaults(defineProps<DropdownItemProps>(), {
|
|
25
25
|
disabled: false,
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
|
-
import { provide, ref, type
|
|
9
|
-
import { usePopover
|
|
8
|
+
import { provide, ref, type Ref } from "vue"
|
|
9
|
+
import { usePopover } from "../../composables/usePopover"
|
|
10
10
|
import type { PopoverSide, PopoverAlign } from "../../types/popover"
|
|
11
|
+
import { POPOVER_CONTEXT_KEY } from "../../types/popover"
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
interface Props {
|
|
13
14
|
side?: PopoverSide
|
|
14
15
|
align?: PopoverAlign
|
|
15
16
|
modal?: boolean
|
|
@@ -22,8 +23,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
22
23
|
modal: false
|
|
23
24
|
})
|
|
24
25
|
|
|
25
|
-
export const POPOVER_CONTEXT_KEY: InjectionKey<UsePopoverReturn> = Symbol("popover-context")
|
|
26
|
-
|
|
27
26
|
const popover_props = ref({
|
|
28
27
|
side: props.side,
|
|
29
28
|
align: props.align,
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
19
|
import { inject, ref, computed, watchEffect, onMounted } from "vue"
|
|
20
20
|
import { useStyleAdapter } from "../../composables"
|
|
21
|
-
import { POPOVER_CONTEXT_KEY } from "./Popover.vue"
|
|
22
21
|
import type { PopoverContentProps } from "../../types/popover"
|
|
22
|
+
import { POPOVER_CONTEXT_KEY } from "../../types/popover"
|
|
23
23
|
import type { PopoverState } from "../../types/composables"
|
|
24
24
|
|
|
25
25
|
const props = withDefaults(defineProps<PopoverContentProps>(), {
|
|
@@ -48,9 +48,10 @@
|
|
|
48
48
|
</template>
|
|
49
49
|
|
|
50
50
|
<script setup lang="ts">
|
|
51
|
-
import { ref, computed, watch, provide, onMounted, onUnmounted
|
|
51
|
+
import { ref, computed, watch, provide, onMounted, onUnmounted } from "vue"
|
|
52
52
|
import { useStyleAdapter } from "../../composables"
|
|
53
53
|
import type { SheetSide, SheetContext, SheetProps } from "../../types/sheet"
|
|
54
|
+
import { SHEET_CONTEXT_KEY } from "../../types/sheet"
|
|
54
55
|
import type { SheetState } from "../../types/composables"
|
|
55
56
|
|
|
56
57
|
interface Props extends SheetProps {}
|
|
@@ -66,7 +67,6 @@ const emit = defineEmits<{
|
|
|
66
67
|
"update:open": [value: boolean]
|
|
67
68
|
}>()
|
|
68
69
|
|
|
69
|
-
export const SHEET_CONTEXT_KEY: InjectionKey<SheetContext> = Symbol("sheet-context")
|
|
70
70
|
|
|
71
71
|
const style_adapter = useStyleAdapter()
|
|
72
72
|
const is_open = ref(props.open)
|
package/dist/types/dialog.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { Ref, DeepReadonly } from "vue";
|
|
1
|
+
import type { Ref, DeepReadonly, InjectionKey } from "vue";
|
|
2
|
+
export interface DialogContext {
|
|
3
|
+
close: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const DIALOG_KEY: InjectionKey<DialogContext>;
|
|
2
6
|
export interface DialogProps {
|
|
3
7
|
open?: boolean;
|
|
4
8
|
modal?: boolean;
|
package/dist/types/dialog.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DIALOG_KEY = Symbol("dialog");
|
package/dist/types/dropdown.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { InjectionKey } from "vue";
|
|
2
|
+
import type { UseDropdownReturn } from "../composables/useDropdown";
|
|
1
3
|
export type DropdownSide = "top" | "right" | "bottom" | "left";
|
|
2
4
|
export type DropdownAlign = "start" | "center" | "end";
|
|
3
5
|
export interface DropdownProps {
|
|
@@ -33,3 +35,4 @@ export interface DropdownItemContext {
|
|
|
33
35
|
is_active: boolean;
|
|
34
36
|
is_disabled: boolean;
|
|
35
37
|
}
|
|
38
|
+
export declare const DROPDOWN_CONTEXT_KEY: InjectionKey<UseDropdownReturn>;
|
package/dist/types/dropdown.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DROPDOWN_CONTEXT_KEY = Symbol("dropdown-context");
|
package/dist/types/popover.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { InjectionKey } from "vue";
|
|
2
|
+
import type { UsePopoverReturn } from "../composables/usePopover";
|
|
1
3
|
export type PopoverSide = "top" | "right" | "bottom" | "left";
|
|
2
4
|
export type PopoverAlign = "start" | "center" | "end";
|
|
3
5
|
export interface PopoverProps {
|
|
@@ -19,3 +21,4 @@ export interface PopoverContext {
|
|
|
19
21
|
close: () => void;
|
|
20
22
|
toggle: () => void;
|
|
21
23
|
}
|
|
24
|
+
export declare const POPOVER_CONTEXT_KEY: InjectionKey<UsePopoverReturn>;
|
package/dist/types/popover.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const POPOVER_CONTEXT_KEY = Symbol("popover-context");
|
package/dist/types/sheet.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { InjectionKey } from "vue";
|
|
1
2
|
export type SheetSide = "top" | "right" | "bottom" | "left";
|
|
2
3
|
export interface SheetProps {
|
|
3
4
|
open?: boolean;
|
|
@@ -28,3 +29,4 @@ export interface SheetContext {
|
|
|
28
29
|
open: () => void;
|
|
29
30
|
close: () => void;
|
|
30
31
|
}
|
|
32
|
+
export declare const SHEET_CONTEXT_KEY: InjectionKey<SheetContext>;
|
package/dist/types/sheet.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SHEET_CONTEXT_KEY = Symbol("sheet-context");
|