@soave/ui 0.2.2 → 0.3.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/Button.vue +36 -0
- package/dist/components/Card.vue +23 -0
- package/dist/components/Checkbox.vue +44 -0
- package/dist/components/Dialog.vue +99 -0
- package/dist/components/Input.vue +48 -0
- package/dist/components/RadioGroup.vue +35 -0
- package/dist/components/RadioItem.vue +55 -0
- package/dist/components/Select.vue +95 -0
- package/dist/components/SelectContent.vue +40 -0
- package/dist/components/SelectItem.vue +44 -0
- package/dist/components/SelectTrigger.vue +61 -0
- package/dist/components/Switch.vue +43 -0
- package/dist/components/Textarea.vue +55 -0
- package/dist/components/index.d.ts +13 -0
- package/dist/components/index.mjs +13 -0
- package/dist/composables/useButton.d.ts +2 -2
- package/dist/composables/useButton.mjs +14 -41
- package/dist/composables/useCard.d.ts +2 -2
- package/dist/composables/useCard.mjs +5 -18
- package/dist/composables/useCheckbox.d.ts +2 -1
- package/dist/composables/useCheckbox.mjs +11 -44
- package/dist/composables/useFileInput.d.ts +2 -0
- package/dist/composables/useFileInput.mjs +15 -30
- package/dist/composables/useInput.d.ts +2 -2
- package/dist/composables/useInput.mjs +12 -33
- package/dist/composables/useRadio.d.ts +2 -1
- package/dist/composables/useRadio.mjs +10 -42
- package/dist/composables/useSelect.d.ts +3 -0
- package/dist/composables/useSelect.mjs +20 -49
- package/dist/composables/useSwitch.d.ts +2 -1
- package/dist/composables/useSwitch.mjs +10 -43
- package/dist/composables/useTextarea.d.ts +2 -1
- package/dist/composables/useTextarea.mjs +12 -33
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/button.d.ts +19 -5
- package/dist/types/card.d.ts +11 -2
- package/dist/types/checkbox.d.ts +15 -6
- package/dist/types/composables.d.ts +33 -5
- package/dist/types/file-input.d.ts +15 -5
- package/dist/types/input.d.ts +17 -6
- package/dist/types/radio.d.ts +14 -6
- package/dist/types/select.d.ts +25 -7
- package/dist/types/switch.d.ts +14 -5
- package/dist/types/textarea.d.ts +18 -7
- package/package.json +1 -9
- package/dist/components/ui/Alert.vue +0 -41
- package/dist/components/ui/AlertDescription.vue +0 -22
- package/dist/components/ui/AlertTitle.vue +0 -22
- package/dist/components/ui/Button.vue +0 -85
- package/dist/components/ui/Card.vue +0 -39
- package/dist/components/ui/CardContent.vue +0 -22
- package/dist/components/ui/CardDescription.vue +0 -22
- package/dist/components/ui/CardFooter.vue +0 -22
- package/dist/components/ui/CardHeader.vue +0 -22
- package/dist/components/ui/CardTitle.vue +0 -22
- package/dist/components/ui/Checkbox.vue +0 -94
- package/dist/components/ui/Dialog.vue +0 -110
- package/dist/components/ui/DialogDescription.vue +0 -22
- package/dist/components/ui/DialogFooter.vue +0 -22
- package/dist/components/ui/DialogHeader.vue +0 -22
- package/dist/components/ui/DialogTitle.vue +0 -22
- package/dist/components/ui/DropdownMenu.vue +0 -32
- package/dist/components/ui/DropdownMenuContent.vue +0 -69
- package/dist/components/ui/DropdownMenuItem.vue +0 -71
- package/dist/components/ui/DropdownMenuLabel.vue +0 -20
- package/dist/components/ui/DropdownMenuSeparator.vue +0 -16
- package/dist/components/ui/DropdownMenuTrigger.vue +0 -38
- package/dist/components/ui/FileInput.vue +0 -153
- package/dist/components/ui/FormError.vue +0 -20
- package/dist/components/ui/FormField.vue +0 -12
- package/dist/components/ui/FormInput.vue +0 -46
- package/dist/components/ui/FormLabel.vue +0 -19
- package/dist/components/ui/FormTextarea.vue +0 -39
- package/dist/components/ui/Input.vue +0 -72
- package/dist/components/ui/Popover.vue +0 -35
- package/dist/components/ui/PopoverContent.vue +0 -66
- package/dist/components/ui/PopoverTrigger.vue +0 -36
- package/dist/components/ui/RadioGroup.vue +0 -47
- package/dist/components/ui/RadioItem.vue +0 -62
- package/dist/components/ui/Select.vue +0 -62
- package/dist/components/ui/SelectContent.vue +0 -55
- package/dist/components/ui/SelectItem.vue +0 -55
- package/dist/components/ui/SelectTrigger.vue +0 -70
- package/dist/components/ui/SelectValue.vue +0 -27
- package/dist/components/ui/Sheet.vue +0 -148
- package/dist/components/ui/SheetDescription.vue +0 -22
- package/dist/components/ui/SheetFooter.vue +0 -22
- package/dist/components/ui/SheetHeader.vue +0 -22
- package/dist/components/ui/SheetTitle.vue +0 -22
- package/dist/components/ui/Switch.vue +0 -63
- package/dist/components/ui/Textarea.vue +0 -73
- package/dist/components/ui/Toast.vue +0 -116
- package/dist/components/ui/Toaster.vue +0 -76
- package/dist/components/ui/Tooltip.vue +0 -41
- package/dist/components/ui/TooltipContent.vue +0 -71
- package/dist/components/ui/TooltipTrigger.vue +0 -39
- package/dist/components/ui/UIProvider.vue +0 -23
- package/dist/components/ui/index.d.ts +0 -52
- package/dist/components/ui/index.mjs +0 -52
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<textarea
|
|
3
|
-
:id="id"
|
|
4
|
-
:class="[computed_classes, props.class]"
|
|
5
|
-
:disabled="composable.is_disabled.value"
|
|
6
|
-
:readonly="composable.is_readonly.value"
|
|
7
|
-
:placeholder="placeholder"
|
|
8
|
-
:rows="rows"
|
|
9
|
-
:value="modelValue"
|
|
10
|
-
v-bind="composable.aria_attributes.value"
|
|
11
|
-
@input="handleInput"
|
|
12
|
-
@focus="composable.handleFocus"
|
|
13
|
-
@blur="handleBlur"
|
|
14
|
-
/>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script setup lang="ts">
|
|
18
|
-
import { toRef, computed } from "vue"
|
|
19
|
-
import { useTextarea } from "../../composables/useTextarea"
|
|
20
|
-
import { useStyleAdapter, useUI } from "../../composables/useUIConfig"
|
|
21
|
-
import type { TextareaProps } from "../../types/textarea"
|
|
22
|
-
import type { TextareaState } from "../../types/composables"
|
|
23
|
-
|
|
24
|
-
interface Props extends TextareaProps {
|
|
25
|
-
id?: string
|
|
26
|
-
modelValue?: string
|
|
27
|
-
class?: string
|
|
28
|
-
unstyled?: boolean
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
32
|
-
rows: 3,
|
|
33
|
-
resize: "vertical",
|
|
34
|
-
disabled: false,
|
|
35
|
-
readonly: false,
|
|
36
|
-
unstyled: false
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
const emit = defineEmits<{
|
|
40
|
-
"update:modelValue": [value: string]
|
|
41
|
-
blur: [event: FocusEvent]
|
|
42
|
-
}>()
|
|
43
|
-
|
|
44
|
-
const ui_config = useUI("input")
|
|
45
|
-
const style_adapter = useStyleAdapter()
|
|
46
|
-
const composable = useTextarea(toRef(() => props))
|
|
47
|
-
|
|
48
|
-
// StyleAdapterからクラスを取得
|
|
49
|
-
const computed_classes = computed(() => {
|
|
50
|
-
if (props.unstyled) {
|
|
51
|
-
return ""
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const state: TextareaState = {
|
|
55
|
-
size: props.size ?? ui_config.default_size,
|
|
56
|
-
disabled: composable.is_disabled.value,
|
|
57
|
-
readonly: composable.is_readonly.value,
|
|
58
|
-
error: props.error
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return style_adapter.getClasses("textarea", state)
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
const handleInput = (event: Event) => {
|
|
65
|
-
const target = event.target as HTMLTextAreaElement
|
|
66
|
-
emit("update:modelValue", target.value)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const handleBlur = (event: FocusEvent) => {
|
|
70
|
-
composable.handleBlur()
|
|
71
|
-
emit("blur", event)
|
|
72
|
-
}
|
|
73
|
-
</script>
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="[computed_classes, props.class]"
|
|
4
|
-
:role="aria_role"
|
|
5
|
-
:aria-live="aria_live"
|
|
6
|
-
aria-atomic="true"
|
|
7
|
-
>
|
|
8
|
-
<div class="flex-1 space-y-1">
|
|
9
|
-
<div v-if="title" :class="title_classes">
|
|
10
|
-
{{ title }}
|
|
11
|
-
</div>
|
|
12
|
-
<div v-if="description" :class="description_classes">
|
|
13
|
-
{{ description }}
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<div v-if="action || dismissible" class="flex items-center gap-2 ml-4">
|
|
18
|
-
<button
|
|
19
|
-
v-if="action"
|
|
20
|
-
type="button"
|
|
21
|
-
:class="action_classes"
|
|
22
|
-
@click="action.onClick"
|
|
23
|
-
>
|
|
24
|
-
{{ action.label }}
|
|
25
|
-
</button>
|
|
26
|
-
|
|
27
|
-
<button
|
|
28
|
-
v-if="dismissible"
|
|
29
|
-
type="button"
|
|
30
|
-
:class="dismiss_classes"
|
|
31
|
-
aria-label="Dismiss"
|
|
32
|
-
@click="emit('dismiss')"
|
|
33
|
-
>
|
|
34
|
-
<svg
|
|
35
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
36
|
-
width="16"
|
|
37
|
-
height="16"
|
|
38
|
-
viewBox="0 0 24 24"
|
|
39
|
-
fill="none"
|
|
40
|
-
stroke="currentColor"
|
|
41
|
-
stroke-width="2"
|
|
42
|
-
stroke-linecap="round"
|
|
43
|
-
stroke-linejoin="round"
|
|
44
|
-
>
|
|
45
|
-
<path d="M18 6 6 18" />
|
|
46
|
-
<path d="m6 6 12 12" />
|
|
47
|
-
</svg>
|
|
48
|
-
</button>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</template>
|
|
52
|
-
|
|
53
|
-
<script setup lang="ts">
|
|
54
|
-
import { computed } from "vue"
|
|
55
|
-
import { useStyleAdapter } from "../../composables"
|
|
56
|
-
import type { ToastVariant, ToastAction } from "../../types/toast"
|
|
57
|
-
import type { ToastState } from "../../types/composables"
|
|
58
|
-
|
|
59
|
-
export interface Props {
|
|
60
|
-
title?: string
|
|
61
|
-
description?: string
|
|
62
|
-
variant?: ToastVariant
|
|
63
|
-
dismissible?: boolean
|
|
64
|
-
action?: ToastAction
|
|
65
|
-
class?: string
|
|
66
|
-
unstyled?: boolean
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
70
|
-
variant: "default",
|
|
71
|
-
dismissible: true,
|
|
72
|
-
unstyled: false
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
const emit = defineEmits<{
|
|
76
|
-
dismiss: []
|
|
77
|
-
}>()
|
|
78
|
-
|
|
79
|
-
const style_adapter = useStyleAdapter()
|
|
80
|
-
|
|
81
|
-
const computed_classes = computed(() => {
|
|
82
|
-
if (props.unstyled) return ""
|
|
83
|
-
const state: ToastState = {
|
|
84
|
-
variant: props.variant
|
|
85
|
-
}
|
|
86
|
-
return style_adapter.getClasses("toast", state)
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
const title_classes = computed(() => {
|
|
90
|
-
if (props.unstyled) return ""
|
|
91
|
-
return style_adapter.getClasses("toast-title", {})
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
const description_classes = computed(() => {
|
|
95
|
-
if (props.unstyled) return ""
|
|
96
|
-
return style_adapter.getClasses("toast-description", {})
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
const action_classes = computed(() => {
|
|
100
|
-
if (props.unstyled) return ""
|
|
101
|
-
return style_adapter.getClasses("toast-action", {})
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
const dismiss_classes = computed(() => {
|
|
105
|
-
if (props.unstyled) return ""
|
|
106
|
-
return style_adapter.getClasses("toast-dismiss", {})
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
const aria_role = computed(() => {
|
|
110
|
-
return props.variant === "error" ? "alert" : "status"
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
const aria_live = computed(() => {
|
|
114
|
-
return props.variant === "error" ? "assertive" : "polite"
|
|
115
|
-
})
|
|
116
|
-
</script>
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Teleport to="body">
|
|
3
|
-
<div
|
|
4
|
-
:class="[computed_classes, props.class]"
|
|
5
|
-
aria-label="Notifications"
|
|
6
|
-
>
|
|
7
|
-
<TransitionGroup
|
|
8
|
-
name="toast"
|
|
9
|
-
tag="div"
|
|
10
|
-
class="flex flex-col gap-2"
|
|
11
|
-
>
|
|
12
|
-
<Toast
|
|
13
|
-
v-for="toast in visible_toasts"
|
|
14
|
-
:key="toast.id"
|
|
15
|
-
:title="toast.title"
|
|
16
|
-
:description="toast.description"
|
|
17
|
-
:variant="toast.variant"
|
|
18
|
-
:dismissible="toast.dismissible"
|
|
19
|
-
:action="toast.action"
|
|
20
|
-
:unstyled="unstyled"
|
|
21
|
-
@dismiss="handleDismiss(toast.id)"
|
|
22
|
-
/>
|
|
23
|
-
</TransitionGroup>
|
|
24
|
-
</div>
|
|
25
|
-
</Teleport>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script setup lang="ts">
|
|
29
|
-
import { computed, ref, watchEffect } from "vue"
|
|
30
|
-
import { useStyleAdapter } from "../../composables"
|
|
31
|
-
import { useToast } from "../../composables/useToast"
|
|
32
|
-
import Toast from "./Toast.vue"
|
|
33
|
-
import type { ToastPosition, ToastItem } from "../../types/toast"
|
|
34
|
-
|
|
35
|
-
export interface Props {
|
|
36
|
-
position?: ToastPosition
|
|
37
|
-
max_toasts?: number
|
|
38
|
-
gap?: number
|
|
39
|
-
class?: string
|
|
40
|
-
unstyled?: boolean
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
44
|
-
position: "bottom-right",
|
|
45
|
-
max_toasts: 5,
|
|
46
|
-
gap: 8,
|
|
47
|
-
unstyled: false
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
const { toasts, dismiss } = useToast()
|
|
51
|
-
const style_adapter = useStyleAdapter()
|
|
52
|
-
|
|
53
|
-
const internal_toasts = ref<ToastItem[]>([])
|
|
54
|
-
|
|
55
|
-
watchEffect(() => {
|
|
56
|
-
internal_toasts.value = [...toasts]
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
const visible_toasts = computed(() => {
|
|
60
|
-
const sorted = [...internal_toasts.value].sort((a, b) => b.created_at - a.created_at)
|
|
61
|
-
return sorted.slice(0, props.max_toasts)
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
const handleDismiss = (id: string): void => {
|
|
65
|
-
dismiss(id)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const computed_classes = computed(() => {
|
|
69
|
-
if (props.unstyled) return ""
|
|
70
|
-
return style_adapter.getClasses("toaster", { position: props.position })
|
|
71
|
-
})
|
|
72
|
-
</script>
|
|
73
|
-
|
|
74
|
-
<style scoped>
|
|
75
|
-
.toast-enter-active,.toast-leave-active{transition:all .3s ease}.toast-enter-from,.toast-leave-to{opacity:0;transform:translateX(100%)}.toast-move{transition:transform .3s ease}
|
|
76
|
-
</style>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="relative inline-block" :class="props.class">
|
|
3
|
-
<slot />
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import { provide, ref, type Ref } from "vue"
|
|
9
|
-
import { useTooltip } from "../../composables/useTooltip"
|
|
10
|
-
import type { TooltipSide, TooltipAlign } from "../../types/tooltip"
|
|
11
|
-
import { TOOLTIP_CONTEXT_KEY } from "../../types/tooltip"
|
|
12
|
-
|
|
13
|
-
interface Props {
|
|
14
|
-
side?: TooltipSide
|
|
15
|
-
align?: TooltipAlign
|
|
16
|
-
delay_duration?: number
|
|
17
|
-
skip_delay_duration?: number
|
|
18
|
-
disabled?: boolean
|
|
19
|
-
class?: string
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
23
|
-
side: "top",
|
|
24
|
-
align: "center",
|
|
25
|
-
delay_duration: 200,
|
|
26
|
-
skip_delay_duration: 100,
|
|
27
|
-
disabled: false
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
const tooltip_props = ref({
|
|
31
|
-
side: props.side,
|
|
32
|
-
align: props.align,
|
|
33
|
-
delay_duration: props.delay_duration,
|
|
34
|
-
skip_delay_duration: props.skip_delay_duration,
|
|
35
|
-
disabled: props.disabled
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
const tooltip = useTooltip(tooltip_props as Ref<typeof tooltip_props.value>)
|
|
39
|
-
|
|
40
|
-
provide(TOOLTIP_CONTEXT_KEY, tooltip)
|
|
41
|
-
</script>
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Transition name="tooltip">
|
|
3
|
-
<div
|
|
4
|
-
v-if="is_open"
|
|
5
|
-
ref="content_element"
|
|
6
|
-
:id="tooltip_id"
|
|
7
|
-
role="tooltip"
|
|
8
|
-
:style="position_styles"
|
|
9
|
-
:class="[computed_classes, props.class]"
|
|
10
|
-
@mouseenter="handleContentMouseEnter"
|
|
11
|
-
@mouseleave="handleContentMouseLeave"
|
|
12
|
-
>
|
|
13
|
-
<slot />
|
|
14
|
-
</div>
|
|
15
|
-
</Transition>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script setup lang="ts">
|
|
19
|
-
import { inject, ref, computed, watchEffect } from "vue"
|
|
20
|
-
import { useStyleAdapter } from "../../composables"
|
|
21
|
-
import type { TooltipContentProps } from "../../types/tooltip"
|
|
22
|
-
import { TOOLTIP_CONTEXT_KEY } from "../../types/tooltip"
|
|
23
|
-
import type { TooltipState } from "../../types/composables"
|
|
24
|
-
|
|
25
|
-
const props = withDefaults(defineProps<TooltipContentProps>(), {
|
|
26
|
-
unstyled: false
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const context = inject(TOOLTIP_CONTEXT_KEY)
|
|
30
|
-
|
|
31
|
-
if (!context) {
|
|
32
|
-
throw new Error("TooltipContent must be used within a Tooltip component")
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const {
|
|
36
|
-
is_open,
|
|
37
|
-
content_ref,
|
|
38
|
-
tooltip_id,
|
|
39
|
-
position_styles,
|
|
40
|
-
handleMouseEnter,
|
|
41
|
-
handleMouseLeave
|
|
42
|
-
} = context
|
|
43
|
-
|
|
44
|
-
const style_adapter = useStyleAdapter()
|
|
45
|
-
const content_element = ref<HTMLElement | null>(null)
|
|
46
|
-
|
|
47
|
-
watchEffect(() => {
|
|
48
|
-
content_ref.value = content_element.value
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
const computed_classes = computed(() => {
|
|
52
|
-
if (props.unstyled) return ""
|
|
53
|
-
const state: TooltipState = {
|
|
54
|
-
is_open: is_open.value,
|
|
55
|
-
side: "top"
|
|
56
|
-
}
|
|
57
|
-
return style_adapter.getClasses("tooltip", state)
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
const handleContentMouseEnter = (): void => {
|
|
61
|
-
handleMouseEnter()
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const handleContentMouseLeave = (): void => {
|
|
65
|
-
handleMouseLeave()
|
|
66
|
-
}
|
|
67
|
-
</script>
|
|
68
|
-
|
|
69
|
-
<style scoped>
|
|
70
|
-
.tooltip-enter-active,.tooltip-leave-active{transition:opacity .15s ease,transform .15s ease}.tooltip-enter-from,.tooltip-leave-to{opacity:0;transform:scale(.95)}
|
|
71
|
-
</style>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span
|
|
3
|
-
ref="trigger_element"
|
|
4
|
-
:aria-describedby="is_open ? tooltip_id : undefined"
|
|
5
|
-
@mouseenter="handleMouseEnter"
|
|
6
|
-
@mouseleave="handleMouseLeave"
|
|
7
|
-
@focus="handleFocus"
|
|
8
|
-
@blur="handleBlur"
|
|
9
|
-
>
|
|
10
|
-
<slot />
|
|
11
|
-
</span>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import { inject, ref, watchEffect } from "vue"
|
|
16
|
-
import { TOOLTIP_CONTEXT_KEY } from "../../types/tooltip"
|
|
17
|
-
|
|
18
|
-
const context = inject(TOOLTIP_CONTEXT_KEY)
|
|
19
|
-
|
|
20
|
-
if (!context) {
|
|
21
|
-
throw new Error("TooltipTrigger must be used within a Tooltip component")
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const {
|
|
25
|
-
is_open,
|
|
26
|
-
trigger_ref,
|
|
27
|
-
tooltip_id,
|
|
28
|
-
handleMouseEnter,
|
|
29
|
-
handleMouseLeave,
|
|
30
|
-
handleFocus,
|
|
31
|
-
handleBlur
|
|
32
|
-
} = context
|
|
33
|
-
|
|
34
|
-
const trigger_element = ref<HTMLElement | null>(null)
|
|
35
|
-
|
|
36
|
-
watchEffect(() => {
|
|
37
|
-
trigger_ref.value = trigger_element.value
|
|
38
|
-
})
|
|
39
|
-
</script>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { DeepPartial } from "../../types/utils"
|
|
3
|
-
import type { UIConfig } from "../../types/config"
|
|
4
|
-
import type { StyleAdapter } from "../../adapters/types"
|
|
5
|
-
import { useUIProvider } from "../../composables/useUIConfig"
|
|
6
|
-
import { tailwindAdapter } from "../../adapters/tailwind"
|
|
7
|
-
|
|
8
|
-
interface UIProviderProps {
|
|
9
|
-
config?: DeepPartial<UIConfig>
|
|
10
|
-
adapter?: StyleAdapter
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const props = withDefaults(defineProps<UIProviderProps>(), {
|
|
14
|
-
config: () => ({}),
|
|
15
|
-
adapter: () => tailwindAdapter
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
useUIProvider(props.config, props.adapter)
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<template>
|
|
22
|
-
<slot />
|
|
23
|
-
</template>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export { default as UIProvider } from "./UIProvider.vue";
|
|
2
|
-
export { default as Button } from "./Button.vue";
|
|
3
|
-
export { default as Input } from "./Input.vue";
|
|
4
|
-
export { default as Card } from "./Card.vue";
|
|
5
|
-
export { default as CardHeader } from "./CardHeader.vue";
|
|
6
|
-
export { default as CardTitle } from "./CardTitle.vue";
|
|
7
|
-
export { default as CardDescription } from "./CardDescription.vue";
|
|
8
|
-
export { default as CardContent } from "./CardContent.vue";
|
|
9
|
-
export { default as CardFooter } from "./CardFooter.vue";
|
|
10
|
-
export { default as Alert } from "./Alert.vue";
|
|
11
|
-
export { default as AlertTitle } from "./AlertTitle.vue";
|
|
12
|
-
export { default as AlertDescription } from "./AlertDescription.vue";
|
|
13
|
-
export { default as Dialog } from "./Dialog.vue";
|
|
14
|
-
export { default as DialogHeader } from "./DialogHeader.vue";
|
|
15
|
-
export { default as DialogTitle } from "./DialogTitle.vue";
|
|
16
|
-
export { default as DialogDescription } from "./DialogDescription.vue";
|
|
17
|
-
export { default as DialogFooter } from "./DialogFooter.vue";
|
|
18
|
-
export { default as FormField } from "./FormField.vue";
|
|
19
|
-
export { default as FormLabel } from "./FormLabel.vue";
|
|
20
|
-
export { default as FormInput } from "./FormInput.vue";
|
|
21
|
-
export { default as FormError } from "./FormError.vue";
|
|
22
|
-
export { default as Checkbox } from "./Checkbox.vue";
|
|
23
|
-
export { default as RadioGroup } from "./RadioGroup.vue";
|
|
24
|
-
export { default as RadioItem } from "./RadioItem.vue";
|
|
25
|
-
export { default as Switch } from "./Switch.vue";
|
|
26
|
-
export { default as Textarea } from "./Textarea.vue";
|
|
27
|
-
export { default as Select } from "./Select.vue";
|
|
28
|
-
export { default as SelectTrigger } from "./SelectTrigger.vue";
|
|
29
|
-
export { default as SelectValue } from "./SelectValue.vue";
|
|
30
|
-
export { default as SelectContent } from "./SelectContent.vue";
|
|
31
|
-
export { default as SelectItem } from "./SelectItem.vue";
|
|
32
|
-
export { default as FileInput } from "./FileInput.vue";
|
|
33
|
-
export { default as FormTextarea } from "./FormTextarea.vue";
|
|
34
|
-
export { default as Toast } from "./Toast.vue";
|
|
35
|
-
export { default as Toaster } from "./Toaster.vue";
|
|
36
|
-
export { default as Tooltip } from "./Tooltip.vue";
|
|
37
|
-
export { default as TooltipTrigger } from "./TooltipTrigger.vue";
|
|
38
|
-
export { default as TooltipContent } from "./TooltipContent.vue";
|
|
39
|
-
export { default as Popover } from "./Popover.vue";
|
|
40
|
-
export { default as PopoverTrigger } from "./PopoverTrigger.vue";
|
|
41
|
-
export { default as PopoverContent } from "./PopoverContent.vue";
|
|
42
|
-
export { default as DropdownMenu } from "./DropdownMenu.vue";
|
|
43
|
-
export { default as DropdownMenuTrigger } from "./DropdownMenuTrigger.vue";
|
|
44
|
-
export { default as DropdownMenuContent } from "./DropdownMenuContent.vue";
|
|
45
|
-
export { default as DropdownMenuItem } from "./DropdownMenuItem.vue";
|
|
46
|
-
export { default as DropdownMenuSeparator } from "./DropdownMenuSeparator.vue";
|
|
47
|
-
export { default as DropdownMenuLabel } from "./DropdownMenuLabel.vue";
|
|
48
|
-
export { default as Sheet } from "./Sheet.vue";
|
|
49
|
-
export { default as SheetHeader } from "./SheetHeader.vue";
|
|
50
|
-
export { default as SheetTitle } from "./SheetTitle.vue";
|
|
51
|
-
export { default as SheetDescription } from "./SheetDescription.vue";
|
|
52
|
-
export { default as SheetFooter } from "./SheetFooter.vue";
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export { default as UIProvider } from "./UIProvider.vue";
|
|
2
|
-
export { default as Button } from "./Button.vue";
|
|
3
|
-
export { default as Input } from "./Input.vue";
|
|
4
|
-
export { default as Card } from "./Card.vue";
|
|
5
|
-
export { default as CardHeader } from "./CardHeader.vue";
|
|
6
|
-
export { default as CardTitle } from "./CardTitle.vue";
|
|
7
|
-
export { default as CardDescription } from "./CardDescription.vue";
|
|
8
|
-
export { default as CardContent } from "./CardContent.vue";
|
|
9
|
-
export { default as CardFooter } from "./CardFooter.vue";
|
|
10
|
-
export { default as Alert } from "./Alert.vue";
|
|
11
|
-
export { default as AlertTitle } from "./AlertTitle.vue";
|
|
12
|
-
export { default as AlertDescription } from "./AlertDescription.vue";
|
|
13
|
-
export { default as Dialog } from "./Dialog.vue";
|
|
14
|
-
export { default as DialogHeader } from "./DialogHeader.vue";
|
|
15
|
-
export { default as DialogTitle } from "./DialogTitle.vue";
|
|
16
|
-
export { default as DialogDescription } from "./DialogDescription.vue";
|
|
17
|
-
export { default as DialogFooter } from "./DialogFooter.vue";
|
|
18
|
-
export { default as FormField } from "./FormField.vue";
|
|
19
|
-
export { default as FormLabel } from "./FormLabel.vue";
|
|
20
|
-
export { default as FormInput } from "./FormInput.vue";
|
|
21
|
-
export { default as FormError } from "./FormError.vue";
|
|
22
|
-
export { default as Checkbox } from "./Checkbox.vue";
|
|
23
|
-
export { default as RadioGroup } from "./RadioGroup.vue";
|
|
24
|
-
export { default as RadioItem } from "./RadioItem.vue";
|
|
25
|
-
export { default as Switch } from "./Switch.vue";
|
|
26
|
-
export { default as Textarea } from "./Textarea.vue";
|
|
27
|
-
export { default as Select } from "./Select.vue";
|
|
28
|
-
export { default as SelectTrigger } from "./SelectTrigger.vue";
|
|
29
|
-
export { default as SelectValue } from "./SelectValue.vue";
|
|
30
|
-
export { default as SelectContent } from "./SelectContent.vue";
|
|
31
|
-
export { default as SelectItem } from "./SelectItem.vue";
|
|
32
|
-
export { default as FileInput } from "./FileInput.vue";
|
|
33
|
-
export { default as FormTextarea } from "./FormTextarea.vue";
|
|
34
|
-
export { default as Toast } from "./Toast.vue";
|
|
35
|
-
export { default as Toaster } from "./Toaster.vue";
|
|
36
|
-
export { default as Tooltip } from "./Tooltip.vue";
|
|
37
|
-
export { default as TooltipTrigger } from "./TooltipTrigger.vue";
|
|
38
|
-
export { default as TooltipContent } from "./TooltipContent.vue";
|
|
39
|
-
export { default as Popover } from "./Popover.vue";
|
|
40
|
-
export { default as PopoverTrigger } from "./PopoverTrigger.vue";
|
|
41
|
-
export { default as PopoverContent } from "./PopoverContent.vue";
|
|
42
|
-
export { default as DropdownMenu } from "./DropdownMenu.vue";
|
|
43
|
-
export { default as DropdownMenuTrigger } from "./DropdownMenuTrigger.vue";
|
|
44
|
-
export { default as DropdownMenuContent } from "./DropdownMenuContent.vue";
|
|
45
|
-
export { default as DropdownMenuItem } from "./DropdownMenuItem.vue";
|
|
46
|
-
export { default as DropdownMenuSeparator } from "./DropdownMenuSeparator.vue";
|
|
47
|
-
export { default as DropdownMenuLabel } from "./DropdownMenuLabel.vue";
|
|
48
|
-
export { default as Sheet } from "./Sheet.vue";
|
|
49
|
-
export { default as SheetHeader } from "./SheetHeader.vue";
|
|
50
|
-
export { default as SheetTitle } from "./SheetTitle.vue";
|
|
51
|
-
export { default as SheetDescription } from "./SheetDescription.vue";
|
|
52
|
-
export { default as SheetFooter } from "./SheetFooter.vue";
|