@una-ui/nuxt 0.61.0 → 1.0.0-alpha.2
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/module.d.mts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -3
- package/dist/runtime/components/alert/Alert.vue +94 -0
- package/dist/runtime/components/alert/Alert.vue.d.ts +32 -0
- package/dist/runtime/components/alert/AlertClose.vue +58 -0
- package/dist/runtime/components/alert/AlertClose.vue.d.ts +18 -0
- package/dist/runtime/components/alert/AlertDescription.vue +22 -0
- package/dist/runtime/components/alert/AlertDescription.vue.d.ts +15 -0
- package/dist/runtime/components/alert/AlertTitle.vue +22 -0
- package/dist/runtime/components/alert/AlertTitle.vue.d.ts +15 -0
- package/dist/runtime/components/alert-dialog/AlertDialog.vue +2 -2
- package/dist/runtime/components/alert-dialog/AlertDialog.vue.d.ts +1 -0
- package/dist/runtime/components/alert-dialog/AlertDialogCancel.vue +1 -1
- package/dist/runtime/components/alert-dialog/AlertDialogContent.vue +2 -2
- package/dist/runtime/components/alert-dialog/AlertDialogContent.vue.d.ts +1 -0
- package/dist/runtime/components/aspect-ratio/AspectRatio.vue.d.ts +1 -1
- package/dist/runtime/components/combobox/Combobox.vue +2 -1
- package/dist/runtime/components/combobox/ComboboxTrigger.vue +1 -1
- package/dist/runtime/components/elements/Button.vue.d.ts +3 -3
- package/dist/runtime/components/elements/Skeleton.vue +1 -1
- package/dist/runtime/components/elements/Skeleton.vue.d.ts +3 -1
- package/dist/runtime/components/elements/avatar/Avatar.vue +17 -15
- package/dist/runtime/components/elements/avatar/Avatar.vue.d.ts +6 -4
- package/dist/runtime/components/elements/card/Card.vue +15 -4
- package/dist/runtime/components/elements/card/Card.vue.d.ts +6 -4
- package/dist/runtime/components/elements/card/CardAction.vue +19 -0
- package/dist/runtime/components/elements/card/CardAction.vue.d.ts +13 -0
- package/dist/runtime/components/elements/card/CardContent.vue +1 -0
- package/dist/runtime/components/elements/card/CardDescription.vue +1 -0
- package/dist/runtime/components/elements/card/CardFooter.vue +1 -0
- package/dist/runtime/components/elements/card/CardHeader.vue +1 -0
- package/dist/runtime/components/elements/card/CardTitle.vue +1 -0
- package/dist/runtime/components/elements/dialog/Dialog.vue +73 -62
- package/dist/runtime/components/elements/dialog/Dialog.vue.d.ts +12 -9
- package/dist/runtime/components/elements/dialog/DialogClose.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogClose.vue.d.ts +1 -1
- package/dist/runtime/components/elements/dialog/DialogContent.vue +3 -2
- package/dist/runtime/components/elements/dialog/DialogContent.vue.d.ts +1 -0
- package/dist/runtime/components/elements/dialog/DialogDescription.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogFooter.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogHeader.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogOverlay.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogScrollContent.vue +2 -2
- package/dist/runtime/components/elements/dialog/DialogScrollContent.vue.d.ts +1 -0
- package/dist/runtime/components/elements/dialog/DialogTitle.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogTrigger.vue +16 -0
- package/dist/runtime/components/elements/dialog/DialogTrigger.vue.d.ts +13 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuItem.vue.d.ts +1 -1
- package/dist/runtime/components/elements/pagination/PaginationFirst.vue.d.ts +1 -1
- package/dist/runtime/components/elements/pagination/PaginationLast.vue.d.ts +1 -1
- package/dist/runtime/components/elements/pagination/PaginationNext.vue.d.ts +1 -1
- package/dist/runtime/components/elements/pagination/PaginationPrev.vue.d.ts +1 -1
- package/dist/runtime/components/elements/tabs/TabsTrigger.vue +2 -2
- package/dist/runtime/components/elements/tabs/TabsTrigger.vue.d.ts +1 -0
- package/dist/runtime/components/forms/Checkbox.vue +2 -2
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +2 -0
- package/dist/runtime/components/forms/FormGroup.vue +1 -1
- package/dist/runtime/components/forms/Input.vue.d.ts +6 -6
- package/dist/runtime/components/forms/Slider.vue +12 -11
- package/dist/runtime/components/forms/Slider.vue.d.ts +1 -0
- package/dist/runtime/components/forms/form/FormField.vue +1 -1
- package/dist/runtime/components/forms/radio-group/RadioGroupItem.vue.d.ts +1 -1
- package/dist/runtime/components/forms/select/SelectTrigger.vue +1 -1
- package/dist/runtime/components/misc/ThemeSwitcher.vue +101 -32
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbEllipsis.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbPage.vue +1 -1
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbSeparator.vue.d.ts +1 -1
- package/dist/runtime/components/navigation-menu/NavigationMenuLink.vue.d.ts +1 -1
- package/dist/runtime/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +1 -1
- package/dist/runtime/components/number-field/NumberField.vue.d.ts +1 -1
- package/dist/runtime/components/number-field/NumberFieldDecrement.vue.d.ts +1 -1
- package/dist/runtime/components/number-field/NumberFieldIncrement.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/toast/ToastAction.vue.d.ts +1 -1
- package/dist/runtime/components/scroll-area/ScrollArea.vue.d.ts +1 -1
- package/dist/runtime/components/sheet/Sheet.vue +11 -5
- package/dist/runtime/components/sheet/Sheet.vue.d.ts +7 -4
- package/dist/runtime/components/sheet/SheetClose.vue +1 -0
- package/dist/runtime/components/sheet/SheetContent.vue +6 -5
- package/dist/runtime/components/sheet/SheetContent.vue.d.ts +4 -2
- package/dist/runtime/components/sheet/SheetDescription.vue +1 -0
- package/dist/runtime/components/sheet/SheetFooter.vue +1 -0
- package/dist/runtime/components/sheet/SheetHeader.vue +1 -0
- package/dist/runtime/components/sheet/SheetOverlay.vue +23 -0
- package/dist/runtime/components/sheet/SheetOverlay.vue.d.ts +12 -0
- package/dist/runtime/components/sheet/SheetTitle.vue +1 -0
- package/dist/runtime/components/sheet/SheetTrigger.vue +4 -1
- package/dist/runtime/components/sidebar/Sidebar.vue +8 -3
- package/dist/runtime/components/sidebar/SidebarContent.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarFooter.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarGroup.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarGroupAction.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarGroupContent.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarGroupLabel.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarHeader.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarInput.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarInset.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarMenu.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarMenuAction.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarMenuBadge.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarMenuButton.vue.d.ts +1 -1
- package/dist/runtime/components/sidebar/SidebarMenuButtonChild.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarMenuButtonChild.vue.d.ts +1 -1
- package/dist/runtime/components/sidebar/SidebarMenuItem.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarMenuSkeleton.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarMenuSub.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarMenuSubButton.vue +3 -1
- package/dist/runtime/components/sidebar/SidebarMenuSubButton.vue.d.ts +1 -1
- package/dist/runtime/components/sidebar/SidebarMenuSubItem.vue +2 -0
- package/dist/runtime/components/sidebar/SidebarProvider.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarRail.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarSeparator.vue +1 -0
- package/dist/runtime/components/sidebar/SidebarTrigger.vue +1 -0
- package/dist/runtime/composables/useUnaSettings.js +22 -9
- package/dist/runtime/composables/useUnaThemes.d.ts +5 -5
- package/dist/runtime/composables/useUnaThemes.js +48 -98
- package/dist/runtime/plugins/theme.client.js +13 -0
- package/dist/runtime/plugins/theme.server.js +12 -0
- package/dist/runtime/types/alert-dialog.d.ts +2 -2
- package/dist/runtime/types/alert.d.ts +30 -15
- package/dist/runtime/types/card.d.ts +5 -0
- package/dist/runtime/types/dialog.d.ts +8 -3
- package/dist/runtime/types/index.d.ts +10 -2
- package/dist/runtime/types/sheet.d.ts +2 -2
- package/package.json +9 -9
- package/dist/runtime/components/elements/Alert.vue +0 -127
- package/dist/runtime/components/elements/Alert.vue.d.ts +0 -22
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { reactiveOmit } from "@vueuse/core";
|
|
3
3
|
import { SliderRange, SliderRoot, SliderThumb, SliderTrack, useForwardPropsEmits } from "reka-ui";
|
|
4
|
-
import { computed } from "vue";
|
|
5
4
|
import { cn } from "../../utils";
|
|
6
5
|
const props = defineProps({
|
|
7
6
|
slider: { type: String, required: false, default: "primary" },
|
|
8
|
-
size: { type: String, required: false },
|
|
7
|
+
size: { type: String, required: false, default: "md" },
|
|
9
8
|
una: { type: Object, required: false },
|
|
10
9
|
defaultValue: { type: Array, required: false },
|
|
11
10
|
modelValue: { type: [Array, null], required: false },
|
|
@@ -25,37 +24,38 @@ const props = defineProps({
|
|
|
25
24
|
class: { type: null, required: false }
|
|
26
25
|
});
|
|
27
26
|
const emits = defineEmits(["update:modelValue", "valueCommit"]);
|
|
28
|
-
const rootProps = reactiveOmit(props, ["class", "una", "slider"
|
|
27
|
+
const rootProps = reactiveOmit(props, ["class", "una", "slider"]);
|
|
29
28
|
const forwarded = useForwardPropsEmits(rootProps, emits);
|
|
30
|
-
const isVertical = computed(() => props.orientation === "vertical");
|
|
31
29
|
</script>
|
|
32
30
|
|
|
33
31
|
<template>
|
|
34
32
|
<SliderRoot
|
|
35
33
|
v-slot="{ modelValue }"
|
|
34
|
+
data-slot="slider-root"
|
|
36
35
|
:class="cn(
|
|
37
36
|
'slider-root',
|
|
38
|
-
isVertical && 'slider-root-vertical',
|
|
39
37
|
props.class,
|
|
40
|
-
props.una?.sliderRoot
|
|
41
|
-
disabled && 'slider-disabled'
|
|
38
|
+
props.una?.sliderRoot
|
|
42
39
|
)"
|
|
43
40
|
v-bind="forwarded"
|
|
44
|
-
:slider
|
|
41
|
+
:slider
|
|
42
|
+
:size
|
|
45
43
|
>
|
|
46
44
|
<slot name="slider-track">
|
|
47
45
|
<SliderTrack
|
|
46
|
+
data-slot="slider-track"
|
|
48
47
|
:class="cn(
|
|
49
48
|
'slider-track',
|
|
50
|
-
isVertical && 'slider-track-vertical',
|
|
51
49
|
props.una?.sliderTrack
|
|
52
50
|
)"
|
|
51
|
+
:size
|
|
53
52
|
>
|
|
54
53
|
<slot name="slider-range">
|
|
55
54
|
<SliderRange
|
|
55
|
+
data-slot="slider-range"
|
|
56
|
+
:size
|
|
56
57
|
:class="cn(
|
|
57
58
|
'slider-range',
|
|
58
|
-
isVertical && 'slider-range-vertical',
|
|
59
59
|
props.una?.sliderRange
|
|
60
60
|
)"
|
|
61
61
|
/>
|
|
@@ -67,9 +67,10 @@ const isVertical = computed(() => props.orientation === "vertical");
|
|
|
67
67
|
<SliderThumb
|
|
68
68
|
v-for="(_, key) in modelValue"
|
|
69
69
|
:key="key"
|
|
70
|
+
data-slot="slider-thumb"
|
|
71
|
+
:size
|
|
70
72
|
:class="cn(
|
|
71
73
|
'slider-thumb',
|
|
72
|
-
isVertical && 'slider-thumb-vertical',
|
|
73
74
|
props.una?.sliderThumb
|
|
74
75
|
)"
|
|
75
76
|
/>
|
|
@@ -14,6 +14,7 @@ declare const __VLS_component: import("vue").DefineComponent<NSliderProps, {}, {
|
|
|
14
14
|
"onUpdate:modelValue"?: ((payload: number[] | undefined) => any) | undefined;
|
|
15
15
|
onValueCommit?: ((payload: number[]) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
+
size: string;
|
|
17
18
|
slider: string;
|
|
18
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
20
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -8,8 +8,8 @@ type __VLS_Slots = {} & {
|
|
|
8
8
|
description?: (props: typeof __VLS_19) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_component: import("vue").DefineComponent<NRadioGroupItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NRadioGroupItemProps> & Readonly<{}>, {
|
|
11
|
-
size: import("vue").HTMLAttributes["class"];
|
|
12
11
|
icon: import("vue").HTMLAttributes["class"];
|
|
12
|
+
size: import("vue").HTMLAttributes["class"];
|
|
13
13
|
square: import("vue").HTMLAttributes["class"];
|
|
14
14
|
radioGroup: import("vue").HTMLAttributes["class"];
|
|
15
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -7,7 +7,7 @@ import Button from "../../elements/Button.vue";
|
|
|
7
7
|
import Icon from "../../elements/Icon.vue";
|
|
8
8
|
const props = defineProps({
|
|
9
9
|
id: { type: String, required: false },
|
|
10
|
-
select: { type: String, required: false, default: "
|
|
10
|
+
select: { type: String, required: false, default: "outline-gray" },
|
|
11
11
|
status: { type: String, required: false },
|
|
12
12
|
una: { type: Object, required: false },
|
|
13
13
|
disabled: { type: Boolean, required: false },
|
|
@@ -1,32 +1,47 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { useColorMode } from "#imports";
|
|
2
|
+
import { useAppConfig, useColorMode } from "#imports";
|
|
3
3
|
import { useToggle } from "@vueuse/core";
|
|
4
4
|
import { capitalize, computed } from "vue";
|
|
5
5
|
import { useUnaSettings } from "../../composables/useUnaSettings";
|
|
6
6
|
import { useUnaThemes } from "../../composables/useUnaThemes";
|
|
7
7
|
import { RADIUS } from "../../constants";
|
|
8
8
|
import Button from "../elements/Button.vue";
|
|
9
|
+
import Icon from "../elements/Icon.vue";
|
|
9
10
|
import Label from "../elements/Label.vue";
|
|
10
11
|
import Popover from "../elements/popover/Popover.vue";
|
|
11
12
|
import Separator from "../elements/Separator.vue";
|
|
12
13
|
const colorMode = useColorMode();
|
|
13
14
|
const [value, toggle] = useToggle();
|
|
14
15
|
const { primaryThemes, grayThemes } = useUnaThemes();
|
|
16
|
+
const { una: { themes } } = useAppConfig();
|
|
15
17
|
const { settings, reset } = useUnaSettings();
|
|
16
18
|
const currentPrimaryThemeHex = computed(() => settings.value.primaryColors?.["--una-primary-hex"]);
|
|
17
19
|
const currentPrimaryThemeName = computed(() => {
|
|
20
|
+
if (settings.value.theme) {
|
|
21
|
+
return settings.value.theme;
|
|
22
|
+
}
|
|
18
23
|
const theme = primaryThemes.find(([, theme2]) => theme2["--una-primary-hex"] === currentPrimaryThemeHex.value);
|
|
19
24
|
return theme ? theme[0] : "";
|
|
20
25
|
});
|
|
21
26
|
const currentGrayThemeHex = computed(() => settings.value.grayColors?.["--una-gray-hex"]);
|
|
22
27
|
const currentGrayThemeName = computed(() => {
|
|
28
|
+
if (settings.value.theme) {
|
|
29
|
+
return settings.value.theme;
|
|
30
|
+
}
|
|
23
31
|
const theme = grayThemes.find(([, theme2]) => theme2["--una-gray-hex"] === currentGrayThemeHex.value);
|
|
24
32
|
return theme ? theme[0] : "";
|
|
25
33
|
});
|
|
34
|
+
function updateTheme(theme) {
|
|
35
|
+
settings.value.theme = theme;
|
|
36
|
+
settings.value.primary = false;
|
|
37
|
+
settings.value.gray = false;
|
|
38
|
+
}
|
|
26
39
|
function updatePrimaryTheme(theme) {
|
|
40
|
+
settings.value.theme = false;
|
|
27
41
|
settings.value.primary = theme;
|
|
28
42
|
}
|
|
29
43
|
function updateGrayTheme(theme) {
|
|
44
|
+
settings.value.theme = false;
|
|
30
45
|
settings.value.gray = theme;
|
|
31
46
|
}
|
|
32
47
|
function shuffleTheme() {
|
|
@@ -62,8 +77,7 @@ function shuffleTheme() {
|
|
|
62
77
|
<slot name="trigger" :open="open">
|
|
63
78
|
<Button
|
|
64
79
|
btn="soft"
|
|
65
|
-
square
|
|
66
|
-
icon
|
|
80
|
+
icon square
|
|
67
81
|
label="i-lucide-paintbrush"
|
|
68
82
|
/>
|
|
69
83
|
</slot>
|
|
@@ -72,32 +86,81 @@ function shuffleTheme() {
|
|
|
72
86
|
<slot name="content">
|
|
73
87
|
<div class="flex flex-col">
|
|
74
88
|
<div class="grid space-y-1">
|
|
75
|
-
<h1 class="text-md text-
|
|
89
|
+
<h1 class="text-md text-foreground font-semibold">
|
|
76
90
|
Customize
|
|
77
91
|
</h1>
|
|
78
|
-
<p class="text-xs text-muted">
|
|
92
|
+
<p class="text-xs text-muted-foreground">
|
|
79
93
|
Pick a style and color for your components.
|
|
80
94
|
</p>
|
|
81
95
|
</div>
|
|
82
96
|
|
|
97
|
+
<template v-if="themes.length > 0">
|
|
98
|
+
<Separator />
|
|
99
|
+
|
|
100
|
+
<div
|
|
101
|
+
class="space-y-2"
|
|
102
|
+
>
|
|
103
|
+
<Label for="color" class="text-xs"> Themes</Label>
|
|
104
|
+
<div class="grid grid-cols-2 gap-3">
|
|
105
|
+
<template
|
|
106
|
+
v-for="theme in themes"
|
|
107
|
+
:key="theme"
|
|
108
|
+
>
|
|
109
|
+
<Button
|
|
110
|
+
v-if="theme"
|
|
111
|
+
btn="outline-gray"
|
|
112
|
+
size="xs"
|
|
113
|
+
:title="capitalize(theme?.name)"
|
|
114
|
+
class="justify-start gap-2 ring-primary"
|
|
115
|
+
:aria-label="`Theme: ${theme.name}`"
|
|
116
|
+
:class="currentPrimaryThemeName === theme?.name && 'ring-2'"
|
|
117
|
+
@click="updateTheme(theme.name)"
|
|
118
|
+
>
|
|
119
|
+
<template #leading>
|
|
120
|
+
<Icon
|
|
121
|
+
name="i-tabler-circle-filled"
|
|
122
|
+
square="4.5"
|
|
123
|
+
:style="{
|
|
124
|
+
'--c-primary': `oklch(${theme?.cssVars.dark['--una-primary']})`,
|
|
125
|
+
'--c-primary-foreground': `oklch(${theme?.cssVars.dark['--una-background']})`
|
|
126
|
+
}"
|
|
127
|
+
class="shrink-0 rounded-full from-$c-primary to-$c-primary-foreground from-20% bg-gradient-to-b"
|
|
128
|
+
/>
|
|
129
|
+
</template>
|
|
130
|
+
|
|
131
|
+
<span class="truncate text-xs">
|
|
132
|
+
{{ theme.name }}
|
|
133
|
+
</span>
|
|
134
|
+
</Button>
|
|
135
|
+
</template>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</template>
|
|
139
|
+
|
|
83
140
|
<Separator />
|
|
84
141
|
|
|
85
142
|
<div class="space-y-2">
|
|
86
143
|
<Label for="color" class="text-xs"> Primary Color</Label>
|
|
87
144
|
<div class="grid grid-cols-7 gap-3">
|
|
88
|
-
<
|
|
145
|
+
<template
|
|
89
146
|
v-for="[key, theme] in primaryThemes"
|
|
90
147
|
:key="key"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
148
|
+
>
|
|
149
|
+
<button
|
|
150
|
+
:title="capitalize(key)"
|
|
151
|
+
:style="{
|
|
152
|
+
'--c-primary': `oklch(${theme['--una-primary-600']})`,
|
|
153
|
+
'--c-primary-foreground': `oklch(${theme['--una-primary-500']})`
|
|
154
|
+
}"
|
|
155
|
+
class="bg-$c-primary transition-all dark:bg-$c-primary-foreground"
|
|
156
|
+
rounded="full"
|
|
157
|
+
square="6.5"
|
|
158
|
+
:class="[currentPrimaryThemeName === key ? 'ring-2' : 'scale-93']"
|
|
159
|
+
ring="primary offset-4 offset-background"
|
|
160
|
+
:aria-label="`Primary Color: ${key}`"
|
|
161
|
+
@click="updatePrimaryTheme(key)"
|
|
162
|
+
/>
|
|
163
|
+
</template>
|
|
101
164
|
</div>
|
|
102
165
|
</div>
|
|
103
166
|
|
|
@@ -106,19 +169,25 @@ function shuffleTheme() {
|
|
|
106
169
|
<div class="space-y-2">
|
|
107
170
|
<Label for="color" class="text-xs"> Gray Color </Label>
|
|
108
171
|
<div class="grid grid-cols-7 gap-3">
|
|
109
|
-
<
|
|
172
|
+
<template
|
|
110
173
|
v-for="[key, theme] in grayThemes"
|
|
111
174
|
:key="key"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
175
|
+
>
|
|
176
|
+
<button
|
|
177
|
+
:title="capitalize(key)"
|
|
178
|
+
:style="{
|
|
179
|
+
'--c-gray': `oklch(${theme['--una-gray-600']})`,
|
|
180
|
+
'--c-gray-foreground': `oklch(${theme['--una-gray-500']})`
|
|
181
|
+
}"
|
|
182
|
+
class="bg-$c-gray transition-all dark:bg-$c-gray-foreground"
|
|
183
|
+
rounded="full"
|
|
184
|
+
square="6.5"
|
|
185
|
+
:class="[currentGrayThemeName === key ? 'ring-2' : 'scale-93']"
|
|
186
|
+
ring="gray offset-4 offset-background"
|
|
187
|
+
:aria-label="`Gray Color: ${key}`"
|
|
188
|
+
@click="updateGrayTheme(key)"
|
|
189
|
+
/>
|
|
190
|
+
</template>
|
|
122
191
|
</div>
|
|
123
192
|
</div>
|
|
124
193
|
|
|
@@ -130,7 +199,7 @@ function shuffleTheme() {
|
|
|
130
199
|
<Button
|
|
131
200
|
v-for="r in RADIUS"
|
|
132
201
|
:key="r"
|
|
133
|
-
btn="
|
|
202
|
+
btn="outline-gray"
|
|
134
203
|
size="xs"
|
|
135
204
|
:class="
|
|
136
205
|
r === settings.radius ? 'ring-2 ring-primary' : ''
|
|
@@ -149,7 +218,7 @@ function shuffleTheme() {
|
|
|
149
218
|
|
|
150
219
|
<div class="flex justify-around py-1.5 space-x-2">
|
|
151
220
|
<Button
|
|
152
|
-
btn="
|
|
221
|
+
btn="outline-gray"
|
|
153
222
|
:class="{ 'ring-2 ring-primary': colorMode.preference === 'system' }"
|
|
154
223
|
leading="i-radix-icons-desktop"
|
|
155
224
|
class="px-3"
|
|
@@ -159,7 +228,7 @@ function shuffleTheme() {
|
|
|
159
228
|
/>
|
|
160
229
|
|
|
161
230
|
<Button
|
|
162
|
-
btn="
|
|
231
|
+
btn="outline-gray"
|
|
163
232
|
:class="{ 'ring-2 ring-primary': colorMode.preference === 'light' }"
|
|
164
233
|
leading="i-radix-icons-sun"
|
|
165
234
|
class="px-3"
|
|
@@ -169,7 +238,7 @@ function shuffleTheme() {
|
|
|
169
238
|
/>
|
|
170
239
|
|
|
171
240
|
<Button
|
|
172
|
-
btn="
|
|
241
|
+
btn="outline-gray"
|
|
173
242
|
:class="{ 'ring-2 ring-primary': colorMode.preference === 'dark' }"
|
|
174
243
|
leading="i-radix-icons-moon"
|
|
175
244
|
class="px-3"
|
|
@@ -185,7 +254,7 @@ function shuffleTheme() {
|
|
|
185
254
|
<div class="grid grid-cols-2 gap-2">
|
|
186
255
|
<Button
|
|
187
256
|
size="xs"
|
|
188
|
-
btn="
|
|
257
|
+
btn="outline-gray"
|
|
189
258
|
label="Reset"
|
|
190
259
|
leading="i-radix-icons-reload"
|
|
191
260
|
@click="reset"
|
|
@@ -4,8 +4,8 @@ type __VLS_Slots = {} & {
|
|
|
4
4
|
default?: (props: typeof __VLS_1) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<NBreadcrumbEllipsisProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NBreadcrumbEllipsisProps> & Readonly<{}>, {
|
|
7
|
-
size: string;
|
|
8
7
|
icon: string;
|
|
8
|
+
size: string;
|
|
9
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
11
|
export default _default;
|
|
@@ -4,8 +4,8 @@ type __VLS_Slots = {} & {
|
|
|
4
4
|
default?: (props: typeof __VLS_1) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<NBreadcrumbSeparatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NBreadcrumbSeparatorProps> & Readonly<{}>, {
|
|
7
|
-
size: string;
|
|
8
7
|
icon: string;
|
|
8
|
+
size: string;
|
|
9
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
11
|
export default _default;
|
|
@@ -14,9 +14,9 @@ declare const __VLS_component: import("vue").DefineComponent<NNavigationMenuLink
|
|
|
14
14
|
originalEvent: Event;
|
|
15
15
|
}>) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
as: import("reka-ui").AsTag | import("vue").Component;
|
|
18
17
|
btn: string;
|
|
19
18
|
navigationMenuLink: string;
|
|
19
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
20
20
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
22
22
|
export default _default;
|
|
@@ -4,10 +4,10 @@ type __VLS_Slots = {} & {
|
|
|
4
4
|
default?: (props: typeof __VLS_6) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<NNavigationMenuTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NNavigationMenuTriggerProps> & Readonly<{}>, {
|
|
7
|
-
as: import("reka-ui").AsTag | import("vue").Component;
|
|
8
7
|
btn: string;
|
|
9
8
|
trailing: string;
|
|
10
9
|
navigationMenu: string;
|
|
10
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
11
11
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
13
13
|
export default _default;
|
|
@@ -14,9 +14,9 @@ declare const __VLS_component: import("vue").DefineComponent<NNumberFieldProps,
|
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<NNumberFieldProps> & Readonly<{
|
|
15
15
|
"onUpdate:modelValue"?: ((val: number) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
size: import("vue").HTMLAttributes["class"];
|
|
18
17
|
leading: string;
|
|
19
18
|
trailing: string;
|
|
19
|
+
size: import("vue").HTMLAttributes["class"];
|
|
20
20
|
numberField: import("vue").HTMLAttributes["class"];
|
|
21
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -4,8 +4,8 @@ type __VLS_Slots = {} & {
|
|
|
4
4
|
default?: (props: typeof __VLS_6) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<NNumberFieldDecrementProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NNumberFieldDecrementProps> & Readonly<{}>, {
|
|
7
|
-
size: import("vue").HTMLAttributes["class"];
|
|
8
7
|
icon: string;
|
|
8
|
+
size: import("vue").HTMLAttributes["class"];
|
|
9
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
11
|
export default _default;
|
|
@@ -4,8 +4,8 @@ type __VLS_Slots = {} & {
|
|
|
4
4
|
default?: (props: typeof __VLS_6) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<NNumberFieldIncrementProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NNumberFieldIncrementProps> & Readonly<{}>, {
|
|
7
|
-
size: import("vue").HTMLAttributes["class"];
|
|
8
7
|
icon: string;
|
|
8
|
+
size: import("vue").HTMLAttributes["class"];
|
|
9
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
11
|
export default _default;
|
|
@@ -4,8 +4,8 @@ type __VLS_Slots = {} & {
|
|
|
4
4
|
[K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<NToastActionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NToastActionProps> & Readonly<{}>, {
|
|
7
|
-
size: string;
|
|
8
7
|
btn: string;
|
|
8
|
+
size: string;
|
|
9
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
11
|
export default _default;
|
|
@@ -4,8 +4,8 @@ type __VLS_Slots = {} & {
|
|
|
4
4
|
default?: (props: typeof __VLS_10) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<NScrollAreaProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NScrollAreaProps> & Readonly<{}>, {
|
|
7
|
-
rounded: import("vue").HTMLAttributes["class"];
|
|
8
7
|
size: import("vue").HTMLAttributes["class"];
|
|
8
|
+
rounded: import("vue").HTMLAttributes["class"];
|
|
9
9
|
scrollArea: import("vue").HTMLAttributes["class"];
|
|
10
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
11
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -26,7 +26,7 @@ const props = defineProps({
|
|
|
26
26
|
defaultOpen: { type: Boolean, required: false },
|
|
27
27
|
modal: { type: Boolean, required: false },
|
|
28
28
|
sheet: { type: null, required: false },
|
|
29
|
-
|
|
29
|
+
dismissible: { type: Boolean, required: false, default: true },
|
|
30
30
|
showClose: { type: Boolean, required: false, default: true },
|
|
31
31
|
overlay: { type: Boolean, required: false, default: true }
|
|
32
32
|
});
|
|
@@ -40,8 +40,12 @@ const forwarded = useForwardPropsEmits(rootProps, emits);
|
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
<template>
|
|
43
|
-
<DialogRoot
|
|
44
|
-
|
|
43
|
+
<DialogRoot
|
|
44
|
+
v-slot="{ open }"
|
|
45
|
+
data-slot="sheet"
|
|
46
|
+
v-bind="forwarded"
|
|
47
|
+
>
|
|
48
|
+
<slot>
|
|
45
49
|
<SheetTrigger
|
|
46
50
|
v-if="$slots.trigger"
|
|
47
51
|
v-bind="_sheetTrigger"
|
|
@@ -54,7 +58,7 @@ const forwarded = useForwardPropsEmits(rootProps, emits);
|
|
|
54
58
|
:_sheet-overlay
|
|
55
59
|
:_sheet-portal
|
|
56
60
|
:sheet
|
|
57
|
-
:
|
|
61
|
+
:dismissible
|
|
58
62
|
:show-close
|
|
59
63
|
:overlay
|
|
60
64
|
v-bind="_sheetContent"
|
|
@@ -99,7 +103,9 @@ const forwarded = useForwardPropsEmits(rootProps, emits);
|
|
|
99
103
|
</slot>
|
|
100
104
|
</SheetHeader>
|
|
101
105
|
|
|
102
|
-
<slot
|
|
106
|
+
<slot name="body">
|
|
107
|
+
<slot />
|
|
108
|
+
</slot>
|
|
103
109
|
|
|
104
110
|
<SheetFooter
|
|
105
111
|
v-if="$slots.footer"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { NSheetProps } from '../../types/index.js';
|
|
2
2
|
declare var __VLS_6: {}, __VLS_11: {
|
|
3
3
|
open: boolean;
|
|
4
|
-
}, __VLS_26: {}, __VLS_31: {}, __VLS_36: {}, __VLS_41: {}, __VLS_43: {},
|
|
4
|
+
}, __VLS_26: {}, __VLS_31: {}, __VLS_36: {}, __VLS_41: {}, __VLS_43: {}, __VLS_45: {}, __VLS_50: {};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
|
-
|
|
6
|
+
default?: (props: typeof __VLS_6) => any;
|
|
7
7
|
} & {
|
|
8
8
|
trigger?: (props: typeof __VLS_11) => any;
|
|
9
9
|
} & {
|
|
@@ -15,15 +15,18 @@ type __VLS_Slots = {} & {
|
|
|
15
15
|
} & {
|
|
16
16
|
description?: (props: typeof __VLS_41) => any;
|
|
17
17
|
} & {
|
|
18
|
-
|
|
18
|
+
body?: (props: typeof __VLS_43) => any;
|
|
19
19
|
} & {
|
|
20
|
-
|
|
20
|
+
default?: (props: typeof __VLS_45) => any;
|
|
21
|
+
} & {
|
|
22
|
+
footer?: (props: typeof __VLS_50) => any;
|
|
21
23
|
};
|
|
22
24
|
declare const __VLS_component: import("vue").DefineComponent<NSheetProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
25
|
"update:open": (value: boolean) => any;
|
|
24
26
|
}, string, import("vue").PublicProps, Readonly<NSheetProps> & Readonly<{
|
|
25
27
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
26
28
|
}>, {
|
|
29
|
+
dismissible: boolean;
|
|
27
30
|
overlay: boolean;
|
|
28
31
|
showClose: boolean;
|
|
29
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
-
import { DialogContent,
|
|
3
|
+
import { DialogContent, DialogPortal, useForwardPropsEmits } from "reka-ui";
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import { cn } from "../../utils";
|
|
6
6
|
import SheetClose from "./SheetClose.vue";
|
|
7
|
+
import SheetOverlay from "./SheetOverlay.vue";
|
|
7
8
|
defineOptions({
|
|
8
9
|
inheritAttrs: false
|
|
9
10
|
});
|
|
10
11
|
const props = defineProps({
|
|
11
12
|
class: { type: null, required: false },
|
|
12
13
|
sheet: { type: null, required: false, default: "right" },
|
|
13
|
-
|
|
14
|
+
dismissible: { type: Boolean, required: false, default: true },
|
|
14
15
|
showClose: { type: Boolean, required: false, default: true },
|
|
15
16
|
overlay: { type: Boolean, required: false, default: true },
|
|
16
17
|
_sheetClose: { type: Object, required: false },
|
|
@@ -27,7 +28,7 @@ const emits = defineEmits(["escapeKeyDown", "pointerDownOutside", "focusOutside"
|
|
|
27
28
|
const contentProps = reactiveOmit(props, ["sheet", "class", "_sheetClose", "_sheetPortal", "_sheetOverlay"]);
|
|
28
29
|
const forwarded = useForwardPropsEmits(contentProps, emits);
|
|
29
30
|
const contentEvents = computed(() => {
|
|
30
|
-
if (props.
|
|
31
|
+
if (!props.dismissible) {
|
|
31
32
|
return {
|
|
32
33
|
pointerDownOutside: (e) => e.preventDefault(),
|
|
33
34
|
interactOutside: (e) => e.preventDefault(),
|
|
@@ -46,12 +47,12 @@ const contentEvents = computed(() => {
|
|
|
46
47
|
v-bind="props._sheetPortal"
|
|
47
48
|
:class="cn('sheet-portal', props.una?.sheetPortal, props._sheetPortal?.class)"
|
|
48
49
|
>
|
|
49
|
-
<
|
|
50
|
+
<SheetOverlay
|
|
50
51
|
v-if="props.overlay"
|
|
51
52
|
v-bind="_sheetOverlay"
|
|
52
|
-
:class="cn('sheet-overlay', props.una?.sheetOverlay, props._sheetOverlay?.class)"
|
|
53
53
|
/>
|
|
54
54
|
<DialogContent
|
|
55
|
+
data-slot="sheet-content"
|
|
55
56
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
56
57
|
:sheet
|
|
57
58
|
:class="cn('sheet-content', props.una?.sheetContent, props.class)"
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { NSheetContentProps } from '../../types/index.js';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_13: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
|
-
default?: (props: typeof
|
|
4
|
+
default?: (props: typeof __VLS_13) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<NSheetContentProps>, {
|
|
7
7
|
sheet: string;
|
|
8
8
|
overlay: boolean;
|
|
9
9
|
showClose: boolean;
|
|
10
|
+
dismissible: boolean;
|
|
10
11
|
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
12
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
12
13
|
pointerDownOutside: (event: import("reka-ui").PointerDownOutsideEvent) => any;
|
|
@@ -18,6 +19,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
18
19
|
sheet: string;
|
|
19
20
|
overlay: boolean;
|
|
20
21
|
showClose: boolean;
|
|
22
|
+
dismissible: boolean;
|
|
21
23
|
}>>> & Readonly<{
|
|
22
24
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
23
25
|
onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
|