@una-ui/nuxt-edge 1.0.0-alpha.0-29172721.c5fd9aa → 1.0.0-alpha.0-29173950.b6a8c03
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.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/alert-dialog/AlertDialogCancel.vue +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/Skeleton.vue +1 -1
- package/dist/runtime/components/elements/Skeleton.vue.d.ts +3 -1
- package/dist/runtime/components/elements/tabs/TabsTrigger.vue +1 -1
- 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/Slider.vue +13 -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/select/SelectTrigger.vue +1 -1
- package/dist/runtime/components/misc/ThemeSwitcher.vue +75 -17
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbPage.vue +1 -1
- package/dist/runtime/components/sidebar/SidebarMenuSubButton.vue +2 -1
- package/dist/runtime/composables/useUnaSettings.js +11 -7
- package/dist/runtime/composables/useUnaThemes.d.ts +77 -5
- package/dist/runtime/composables/useUnaThemes.js +414 -98
- package/dist/runtime/plugins/theme.client.js +12 -0
- package/dist/runtime/plugins/theme.server.js +9 -0
- package/dist/runtime/types/index.d.ts +7 -0
- package/package.json +9 -9
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import 'unocss';
|
|
|
8
8
|
import 'unocss-preset-animations';
|
|
9
9
|
|
|
10
10
|
const name = "@una-ui/nuxt-edge";
|
|
11
|
-
const version = "1.0.0-alpha.0-
|
|
11
|
+
const version = "1.0.0-alpha.0-29173950.b6a8c03";
|
|
12
12
|
|
|
13
13
|
const module = defineNuxtModule({
|
|
14
14
|
meta: {
|
|
@@ -33,7 +33,7 @@ const module = defineNuxtModule({
|
|
|
33
33
|
...{
|
|
34
34
|
primary: "yellow",
|
|
35
35
|
gray: "stone",
|
|
36
|
-
radius: 0.
|
|
36
|
+
radius: 0.625,
|
|
37
37
|
fontSize: 16
|
|
38
38
|
},
|
|
39
39
|
...nuxt.options.appConfig.una || {}
|
|
@@ -15,7 +15,7 @@ const props = defineProps({
|
|
|
15
15
|
block: { type: Boolean, required: false },
|
|
16
16
|
to: { type: null, required: false },
|
|
17
17
|
label: { type: String, required: false, default: "Cancel" },
|
|
18
|
-
btn: { type: String, required: false, default: "
|
|
18
|
+
btn: { type: String, required: false, default: "outline-gray" },
|
|
19
19
|
leading: { type: String, required: false },
|
|
20
20
|
trailing: { type: String, required: false },
|
|
21
21
|
size: { type: String, required: false },
|
|
@@ -206,8 +206,9 @@ function isItemSelected(item) {
|
|
|
206
206
|
<slot name="input-wrapper" :model-value :open>
|
|
207
207
|
<ComboboxInput
|
|
208
208
|
v-if="$slots.trigger || $slots.triggerRoot"
|
|
209
|
+
input="~"
|
|
209
210
|
:class="cn(
|
|
210
|
-
'border-
|
|
211
|
+
'border-b-1 rounded-none text-1em',
|
|
211
212
|
props._comboboxInput?.class
|
|
212
213
|
)"
|
|
213
214
|
leading="combobox-input-leading-icon"
|
|
@@ -20,7 +20,7 @@ const props = defineProps({
|
|
|
20
20
|
block: { type: Boolean, required: false },
|
|
21
21
|
to: { type: null, required: false },
|
|
22
22
|
label: { type: String, required: false },
|
|
23
|
-
btn: { type: String, required: false, default: "
|
|
23
|
+
btn: { type: String, required: false, default: "outline-gray" },
|
|
24
24
|
leading: { type: String, required: false },
|
|
25
25
|
trailing: { type: String, required: false },
|
|
26
26
|
size: { type: String, required: false },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { cn } from "../../utils";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
skeleton: { type: null, required: false },
|
|
4
|
+
skeleton: { type: null, required: false, default: "gray" },
|
|
5
5
|
size: { type: null, required: false },
|
|
6
6
|
rounded: { type: null, required: false },
|
|
7
7
|
una: { type: Object, required: false },
|
|
@@ -3,7 +3,9 @@ declare var __VLS_1: {};
|
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
4
|
default?: (props: typeof __VLS_1) => any;
|
|
5
5
|
};
|
|
6
|
-
declare const __VLS_component: import("vue").DefineComponent<NSkeletonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NSkeletonProps> & Readonly<{}>, {
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<NSkeletonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NSkeletonProps> & Readonly<{}>, {
|
|
7
|
+
skeleton: import("vue").HTMLAttributes["class"];
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
9
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
8
10
|
export default _default;
|
|
9
11
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -31,7 +31,7 @@ const props = defineProps({
|
|
|
31
31
|
dropdownMenu: { type: String, required: false },
|
|
32
32
|
toggleOn: { type: String, required: false },
|
|
33
33
|
toggleOff: { type: String, required: false },
|
|
34
|
-
tabsActive: { type: String, required: false, default: "
|
|
34
|
+
tabsActive: { type: String, required: false, default: "outline-gray" },
|
|
35
35
|
tabsInactive: { type: String, required: false },
|
|
36
36
|
navigationMenu: { type: String, required: false },
|
|
37
37
|
navigationMenuLink: { type: String, required: false },
|
|
@@ -9,9 +9,9 @@ defineOptions({
|
|
|
9
9
|
inheritAttrs: false
|
|
10
10
|
});
|
|
11
11
|
const props = defineProps({
|
|
12
|
-
checkbox: { type: String, required: false },
|
|
12
|
+
checkbox: { type: String, required: false, default: "primary" },
|
|
13
13
|
label: { type: String, required: false },
|
|
14
|
-
size: { type: String, required: false },
|
|
14
|
+
size: { type: String, required: false, default: "md" },
|
|
15
15
|
reverse: { type: Boolean, required: false },
|
|
16
16
|
forceMount: { type: Boolean, required: false, default: true },
|
|
17
17
|
_checkboxIndicator: { type: Object, required: false },
|
|
@@ -10,7 +10,9 @@ declare const __VLS_component: import("vue").DefineComponent<NCheckboxProps, {},
|
|
|
10
10
|
}, string, import("vue").PublicProps, Readonly<NCheckboxProps> & Readonly<{
|
|
11
11
|
"onUpdate:modelValue"?: ((value: boolean | "indeterminate") => any) | undefined;
|
|
12
12
|
}>, {
|
|
13
|
+
size: string;
|
|
13
14
|
forceMount: boolean;
|
|
15
|
+
checkbox: string;
|
|
14
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
17
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
16
18
|
export default _default;
|
|
@@ -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,39 @@ 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
|
-
'
|
|
38
|
-
|
|
36
|
+
'relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col',
|
|
37
|
+
// \'slider-root\',
|
|
39
38
|
props.class,
|
|
40
|
-
props.una?.sliderRoot
|
|
41
|
-
disabled && 'slider-disabled'
|
|
39
|
+
props.una?.sliderRoot
|
|
42
40
|
)"
|
|
43
41
|
v-bind="forwarded"
|
|
44
42
|
:slider="slider"
|
|
43
|
+
:size="size"
|
|
45
44
|
>
|
|
46
45
|
<slot name="slider-track">
|
|
47
46
|
<SliderTrack
|
|
47
|
+
data-slot="slider-track"
|
|
48
48
|
:class="cn(
|
|
49
49
|
'slider-track',
|
|
50
|
-
isVertical && 'slider-track-vertical',
|
|
51
50
|
props.una?.sliderTrack
|
|
52
51
|
)"
|
|
52
|
+
:size
|
|
53
53
|
>
|
|
54
54
|
<slot name="slider-range">
|
|
55
55
|
<SliderRange
|
|
56
|
+
data-slot="slider-range"
|
|
57
|
+
:size
|
|
56
58
|
:class="cn(
|
|
57
59
|
'slider-range',
|
|
58
|
-
isVertical && 'slider-range-vertical',
|
|
59
60
|
props.una?.sliderRange
|
|
60
61
|
)"
|
|
61
62
|
/>
|
|
@@ -67,9 +68,10 @@ const isVertical = computed(() => props.orientation === "vertical");
|
|
|
67
68
|
<SliderThumb
|
|
68
69
|
v-for="(_, key) in modelValue"
|
|
69
70
|
:key="key"
|
|
71
|
+
data-slot="slider-thumb"
|
|
72
|
+
:size
|
|
70
73
|
:class="cn(
|
|
71
74
|
'slider-thumb',
|
|
72
|
-
isVertical && 'slider-thumb-vertical',
|
|
73
75
|
props.una?.sliderThumb
|
|
74
76
|
)"
|
|
75
77
|
/>
|
|
@@ -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>;
|
|
@@ -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 },
|
|
@@ -6,27 +6,41 @@ 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
|
-
const { primaryThemes, grayThemes } = useUnaThemes();
|
|
15
|
+
const { primaryThemes, grayThemes, predefinedThemes } = useUnaThemes();
|
|
15
16
|
const { settings, reset } = useUnaSettings();
|
|
16
17
|
const currentPrimaryThemeHex = computed(() => settings.value.primaryColors?.["--una-primary-hex"]);
|
|
17
18
|
const currentPrimaryThemeName = computed(() => {
|
|
19
|
+
if (settings.value.theme) {
|
|
20
|
+
return settings.value.theme.name;
|
|
21
|
+
}
|
|
18
22
|
const theme = primaryThemes.find(([, theme2]) => theme2["--una-primary-hex"] === currentPrimaryThemeHex.value);
|
|
19
23
|
return theme ? theme[0] : "";
|
|
20
24
|
});
|
|
21
25
|
const currentGrayThemeHex = computed(() => settings.value.grayColors?.["--una-gray-hex"]);
|
|
22
26
|
const currentGrayThemeName = computed(() => {
|
|
27
|
+
if (settings.value.theme !== null) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
23
30
|
const theme = grayThemes.find(([, theme2]) => theme2["--una-gray-hex"] === currentGrayThemeHex.value);
|
|
24
31
|
return theme ? theme[0] : "";
|
|
25
32
|
});
|
|
33
|
+
function updateColor(theme) {
|
|
34
|
+
settings.value.theme = theme;
|
|
35
|
+
settings.value.primary = "";
|
|
36
|
+
settings.value.gray = "";
|
|
37
|
+
}
|
|
26
38
|
function updatePrimaryTheme(theme) {
|
|
39
|
+
settings.value.theme = null;
|
|
27
40
|
settings.value.primary = theme;
|
|
28
41
|
}
|
|
29
42
|
function updateGrayTheme(theme) {
|
|
43
|
+
settings.value.theme = null;
|
|
30
44
|
settings.value.gray = theme;
|
|
31
45
|
}
|
|
32
46
|
function shuffleTheme() {
|
|
@@ -62,8 +76,7 @@ function shuffleTheme() {
|
|
|
62
76
|
<slot name="trigger" :open="open">
|
|
63
77
|
<Button
|
|
64
78
|
btn="soft"
|
|
65
|
-
square
|
|
66
|
-
icon
|
|
79
|
+
icon square
|
|
67
80
|
label="i-lucide-paintbrush"
|
|
68
81
|
/>
|
|
69
82
|
</slot>
|
|
@@ -72,32 +85,77 @@ function shuffleTheme() {
|
|
|
72
85
|
<slot name="content">
|
|
73
86
|
<div class="flex flex-col">
|
|
74
87
|
<div class="grid space-y-1">
|
|
75
|
-
<h1 class="text-md text-
|
|
88
|
+
<h1 class="text-md text-foreground font-semibold">
|
|
76
89
|
Customize
|
|
77
90
|
</h1>
|
|
78
|
-
<p class="text-xs text-muted">
|
|
91
|
+
<p class="text-xs text-muted-foreground">
|
|
79
92
|
Pick a style and color for your components.
|
|
80
93
|
</p>
|
|
81
94
|
</div>
|
|
82
95
|
|
|
83
96
|
<Separator />
|
|
84
97
|
|
|
98
|
+
<div class="space-y-2">
|
|
99
|
+
<Label for="color" class="text-xs"> Themes</Label>
|
|
100
|
+
<div class="grid grid-cols-2 gap-3">
|
|
101
|
+
<template
|
|
102
|
+
v-for="theme in predefinedThemes"
|
|
103
|
+
:key="theme.name"
|
|
104
|
+
>
|
|
105
|
+
<Button
|
|
106
|
+
v-if="theme"
|
|
107
|
+
btn="solid-gray"
|
|
108
|
+
size="xs"
|
|
109
|
+
:title="capitalize(theme?.name)"
|
|
110
|
+
class="justify-start gap-2 ring-primary"
|
|
111
|
+
:aria-label="`Theme: ${theme.name}`"
|
|
112
|
+
:class="currentPrimaryThemeName === theme?.name && 'ring-2'"
|
|
113
|
+
@click="updateColor(theme)"
|
|
114
|
+
>
|
|
115
|
+
<template #leading>
|
|
116
|
+
<Icon
|
|
117
|
+
name="i-tabler-circle-filled"
|
|
118
|
+
square="4.5"
|
|
119
|
+
:style="{
|
|
120
|
+
'--c-primary': `oklch(${theme?.cssVars.dark['--una-primary']})`,
|
|
121
|
+
'--c-primary-foreground': `oklch(${theme?.cssVars.dark['--una-background']})`
|
|
122
|
+
}"
|
|
123
|
+
class="shrink-0 rounded-full from-$c-primary to-$c-primary-foreground from-20% bg-gradient-to-b"
|
|
124
|
+
/>
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<span class="truncate text-xs">
|
|
128
|
+
{{ theme.name }}
|
|
129
|
+
</span>
|
|
130
|
+
</Button>
|
|
131
|
+
</template>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<Separator />
|
|
136
|
+
|
|
85
137
|
<div class="space-y-2">
|
|
86
138
|
<Label for="color" class="text-xs"> Primary Color</Label>
|
|
87
139
|
<div class="grid grid-cols-7 gap-3">
|
|
88
|
-
<
|
|
140
|
+
<template
|
|
89
141
|
v-for="[key, theme] in primaryThemes"
|
|
90
142
|
:key="key"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
143
|
+
>
|
|
144
|
+
<button
|
|
145
|
+
:title="capitalize(key)"
|
|
146
|
+
:style="{
|
|
147
|
+
'--c-primary': `oklch(${theme['--una-primary-600']})`,
|
|
148
|
+
'--c-primary-foreground': `oklch(${theme['--una-primary-500']})`
|
|
149
|
+
}"
|
|
150
|
+
class="bg-$c-primary transition-all dark:bg-$c-primary-foreground"
|
|
151
|
+
rounded="full"
|
|
152
|
+
square="6.5"
|
|
153
|
+
:class="[currentPrimaryThemeName === key ? 'ring-2' : 'scale-93']"
|
|
154
|
+
ring="primary offset-4 offset-background"
|
|
155
|
+
:aria-label="`Primary Color: ${key}`"
|
|
156
|
+
@click="updatePrimaryTheme(key)"
|
|
157
|
+
/>
|
|
158
|
+
</template>
|
|
101
159
|
</div>
|
|
102
160
|
</div>
|
|
103
161
|
|
|
@@ -116,7 +174,7 @@ function shuffleTheme() {
|
|
|
116
174
|
rounded="full"
|
|
117
175
|
square="6.5"
|
|
118
176
|
:aria-label="`Gray Color: ${key}`"
|
|
119
|
-
ring="gray offset-4 offset-
|
|
177
|
+
ring="gray offset-4 offset-background"
|
|
120
178
|
@click="updateGrayTheme(key)"
|
|
121
179
|
/>
|
|
122
180
|
</div>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Primitive } from "reka-ui";
|
|
3
3
|
import { cn } from "../../utils";
|
|
4
|
+
import NLink from "../elements/Link.vue";
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
isActive: { type: Boolean, required: false },
|
|
6
7
|
size: { type: String, required: false, default: "md" },
|
|
7
8
|
class: { type: null, required: false },
|
|
8
9
|
una: { type: Object, required: false },
|
|
9
10
|
asChild: { type: Boolean, required: false },
|
|
10
|
-
as: { type: [String, Object, Function], required: false, default:
|
|
11
|
+
as: { type: [String, Object, Function], required: false, default: NLink }
|
|
11
12
|
});
|
|
12
13
|
</script>
|
|
13
14
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { useAppConfig } from "#imports";
|
|
1
|
+
import { useAppConfig, watch } from "#imports";
|
|
2
2
|
import { useStorage } from "@vueuse/core";
|
|
3
3
|
import { defu } from "defu";
|
|
4
|
-
import { watchEffect } from "vue";
|
|
5
4
|
import { useUnaThemes } from "./useUnaThemes.js";
|
|
6
5
|
export function useUnaSettings() {
|
|
7
6
|
const { una } = useAppConfig();
|
|
@@ -12,15 +11,20 @@ export function useUnaSettings() {
|
|
|
12
11
|
primary: una.primary,
|
|
13
12
|
gray: una.gray,
|
|
14
13
|
radius: una.radius,
|
|
15
|
-
fontSize: una.fontSize
|
|
14
|
+
fontSize: una.fontSize,
|
|
15
|
+
theme: null
|
|
16
16
|
};
|
|
17
17
|
const settings = useStorage("una-settings", defaultSettings, void 0, {
|
|
18
18
|
mergeDefaults: defu
|
|
19
19
|
});
|
|
20
|
-
|
|
21
|
-
settings.value.
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
watch(
|
|
21
|
+
() => [settings.value.primary, settings.value.gray],
|
|
22
|
+
([primary, gray]) => {
|
|
23
|
+
settings.value.primaryColors = getPrimaryColors(primary, una.primary);
|
|
24
|
+
settings.value.grayColors = getGrayColors(gray, una.gray);
|
|
25
|
+
},
|
|
26
|
+
{ immediate: true }
|
|
27
|
+
);
|
|
24
28
|
function reset() {
|
|
25
29
|
settings.value.primary = defaultSettings.primary;
|
|
26
30
|
settings.value.gray = defaultSettings.gray;
|
|
@@ -1,8 +1,80 @@
|
|
|
1
1
|
import type { Colors } from '../types/index.js';
|
|
2
|
-
export
|
|
2
|
+
export declare function useUnaThemes(): {
|
|
3
3
|
primaryThemes: [string, Colors][];
|
|
4
4
|
grayThemes: [string, Colors][];
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
predefinedThemes: {
|
|
6
|
+
name: string;
|
|
7
|
+
cssVars: {
|
|
8
|
+
light: {
|
|
9
|
+
'--una-background': string;
|
|
10
|
+
'--una-foreground': string;
|
|
11
|
+
'--una-card': string;
|
|
12
|
+
'--una-card-foreground': string;
|
|
13
|
+
'--una-popover': string;
|
|
14
|
+
'--una-popover-foreground': string;
|
|
15
|
+
'--una-primary': string;
|
|
16
|
+
'--una-primary-foreground': string;
|
|
17
|
+
'--una-secondary': string;
|
|
18
|
+
'--una-secondary-foreground': string;
|
|
19
|
+
'--una-muted': string;
|
|
20
|
+
'--una-muted-foreground': string;
|
|
21
|
+
'--una-accent': string;
|
|
22
|
+
'--una-accent-foreground': string;
|
|
23
|
+
'--una-destructive': string;
|
|
24
|
+
'--una-destructive-foreground': string;
|
|
25
|
+
'--una-border': string;
|
|
26
|
+
'--una-input': string;
|
|
27
|
+
'--una-ring': string;
|
|
28
|
+
'--una-chart-1': string;
|
|
29
|
+
'--una-chart-2': string;
|
|
30
|
+
'--una-chart-3': string;
|
|
31
|
+
'--una-chart-4': string;
|
|
32
|
+
'--una-chart-5': string;
|
|
33
|
+
'--una-sidebar': string;
|
|
34
|
+
'--una-sidebar-foreground': string;
|
|
35
|
+
'--una-sidebar-primary': string;
|
|
36
|
+
'--una-sidebar-primary-foreground': string;
|
|
37
|
+
'--una-sidebar-accent': string;
|
|
38
|
+
'--una-sidebar-accent-foreground': string;
|
|
39
|
+
'--una-sidebar-border': string;
|
|
40
|
+
'--una-sidebar-ring': string;
|
|
41
|
+
};
|
|
42
|
+
dark: {
|
|
43
|
+
'--una-background': string;
|
|
44
|
+
'--una-foreground': string;
|
|
45
|
+
'--una-card': string;
|
|
46
|
+
'--una-card-foreground': string;
|
|
47
|
+
'--una-popover': string;
|
|
48
|
+
'--una-popover-foreground': string;
|
|
49
|
+
'--una-primary': string;
|
|
50
|
+
'--una-primary-foreground': string;
|
|
51
|
+
'--una-secondary': string;
|
|
52
|
+
'--una-secondary-foreground': string;
|
|
53
|
+
'--una-muted': string;
|
|
54
|
+
'--una-muted-foreground': string;
|
|
55
|
+
'--una-accent': string;
|
|
56
|
+
'--una-accent-foreground': string;
|
|
57
|
+
'--una-destructive': string;
|
|
58
|
+
'--una-destructive-foreground': string;
|
|
59
|
+
'--una-border': string;
|
|
60
|
+
'--una-input': string;
|
|
61
|
+
'--una-ring': string;
|
|
62
|
+
'--una-chart-1': string;
|
|
63
|
+
'--una-chart-2': string;
|
|
64
|
+
'--una-chart-3': string;
|
|
65
|
+
'--una-chart-4': string;
|
|
66
|
+
'--una-chart-5': string;
|
|
67
|
+
'--una-sidebar': string;
|
|
68
|
+
'--una-sidebar-foreground': string;
|
|
69
|
+
'--una-sidebar-primary': string;
|
|
70
|
+
'--una-sidebar-primary-foreground': string;
|
|
71
|
+
'--una-sidebar-accent': string;
|
|
72
|
+
'--una-sidebar-accent-foreground': string;
|
|
73
|
+
'--una-sidebar-border': string;
|
|
74
|
+
'--una-sidebar-ring': string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}[];
|
|
78
|
+
getPrimaryColors: (color: string, defaultColor?: string) => Colors;
|
|
79
|
+
getGrayColors: (color: string, defaultColor?: string) => Colors;
|
|
80
|
+
};
|
|
@@ -1,100 +1,39 @@
|
|
|
1
|
-
import { colors } from "@unocss/preset-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
300: "#f8b4b4",
|
|
33
|
-
400: "#f98080",
|
|
34
|
-
500: "#f05252",
|
|
35
|
-
600: "#e02424",
|
|
36
|
-
700: "#c81e1e",
|
|
37
|
-
800: "#9b1c1c",
|
|
38
|
-
900: "#771d1d",
|
|
39
|
-
950: "#3f0708"
|
|
40
|
-
};
|
|
1
|
+
import { colors } from "@unocss/preset-wind4/colors";
|
|
2
|
+
const filteredPrimaryColors = (() => {
|
|
3
|
+
const primaryColors = Object.fromEntries(
|
|
4
|
+
Object.entries(colors).filter(([key]) => [
|
|
5
|
+
"blue",
|
|
6
|
+
"cyan",
|
|
7
|
+
"sky",
|
|
8
|
+
"amber",
|
|
9
|
+
"yellow",
|
|
10
|
+
"emerald",
|
|
11
|
+
"lime",
|
|
12
|
+
"orange",
|
|
13
|
+
"purple",
|
|
14
|
+
"indigo",
|
|
15
|
+
"pink",
|
|
16
|
+
"tomato",
|
|
17
|
+
"green",
|
|
18
|
+
"fuchsia",
|
|
19
|
+
"violet",
|
|
20
|
+
"rose",
|
|
21
|
+
"red",
|
|
22
|
+
"teal"
|
|
23
|
+
].includes(key)).map(([key, value]) => [
|
|
24
|
+
key,
|
|
25
|
+
Object.fromEntries(
|
|
26
|
+
Object.entries(value).filter(([key2]) => ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"].includes(key2))
|
|
27
|
+
)
|
|
28
|
+
])
|
|
29
|
+
);
|
|
30
|
+
return primaryColors;
|
|
31
|
+
})();
|
|
41
32
|
const filteredGrayColors = Object.fromEntries(
|
|
42
33
|
Object.entries(colors).filter(([key]) => ["slate", "gray", "zinc", "neutral", "stone"].includes(key)).map(([key, value]) => [key, Object.fromEntries(
|
|
43
34
|
Object.entries(value).filter(([key2]) => ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"].includes(key2))
|
|
44
35
|
)])
|
|
45
36
|
);
|
|
46
|
-
filteredGrayColors.sage = {
|
|
47
|
-
50: "#f2f2f2",
|
|
48
|
-
100: "#e6e6e6",
|
|
49
|
-
200: "#d9d9d9",
|
|
50
|
-
300: "#b8b8b8",
|
|
51
|
-
400: "#939393",
|
|
52
|
-
500: "#6f6f6f",
|
|
53
|
-
600: "#4b4b4b",
|
|
54
|
-
700: "#323232",
|
|
55
|
-
800: "#1f1f1f",
|
|
56
|
-
900: "#0b0b0b",
|
|
57
|
-
950: "#000000"
|
|
58
|
-
};
|
|
59
|
-
filteredGrayColors.ash = {
|
|
60
|
-
50: "#f9f9f8",
|
|
61
|
-
100: "#f1f0ee",
|
|
62
|
-
200: "#dad7d3",
|
|
63
|
-
300: "#c3beb8",
|
|
64
|
-
400: "#a9a49e",
|
|
65
|
-
500: "#908c84",
|
|
66
|
-
600: "#777168",
|
|
67
|
-
700: "#5e5950",
|
|
68
|
-
800: "#45403a",
|
|
69
|
-
900: "#2c2823",
|
|
70
|
-
950: "#161511"
|
|
71
|
-
};
|
|
72
|
-
filteredGrayColors.olive = {
|
|
73
|
-
50: "#fafaf2",
|
|
74
|
-
100: "#f5f5e6",
|
|
75
|
-
200: "#ebebd9",
|
|
76
|
-
300: "#d6d6b8",
|
|
77
|
-
400: "#b3b393",
|
|
78
|
-
500: "#8f8f6f",
|
|
79
|
-
600: "#6b6b4b",
|
|
80
|
-
700: "#4a4a32",
|
|
81
|
-
800: "#2a2a1f",
|
|
82
|
-
900: "#0e0e0b",
|
|
83
|
-
950: "#000000"
|
|
84
|
-
};
|
|
85
|
-
filteredGrayColors.leaf = {
|
|
86
|
-
50: "#f2faf2",
|
|
87
|
-
100: "#e6f5e6",
|
|
88
|
-
200: "#d9ebd9",
|
|
89
|
-
300: "#b8d6b8",
|
|
90
|
-
400: "#93b393",
|
|
91
|
-
500: "#6f8f6f",
|
|
92
|
-
600: "#4b6b4b",
|
|
93
|
-
700: "#326432",
|
|
94
|
-
800: "#1f2a1f",
|
|
95
|
-
900: "#0b0e0b",
|
|
96
|
-
950: "#000000"
|
|
97
|
-
};
|
|
98
37
|
const filteredColors = {
|
|
99
38
|
...filteredPrimaryColors,
|
|
100
39
|
...filteredGrayColors
|
|
@@ -113,20 +52,397 @@ export function useUnaThemes() {
|
|
|
113
52
|
if (!colorPalette)
|
|
114
53
|
throw new Error(`Invalid primary color: ${color}`);
|
|
115
54
|
const colors2 = {};
|
|
55
|
+
for (const shade of Object.keys(colorPalette)) {
|
|
56
|
+
const value = colorPalette[shade];
|
|
57
|
+
if (value.startsWith("oklch("))
|
|
58
|
+
colors2[`--una-${prefix}-${shade}`] = value.replace("oklch(", "").replace(")", "");
|
|
59
|
+
}
|
|
116
60
|
colors2[`--una-${prefix}-hex`] = colorPalette[600];
|
|
117
|
-
for (const shade of Object.keys(colorPalette))
|
|
118
|
-
colors2[`--una-${prefix}-${shade}`] = hexToRgb(colorPalette[shade]).join(", ");
|
|
119
61
|
return colors2;
|
|
120
62
|
}
|
|
121
|
-
function getPrimaryColors(color) {
|
|
122
|
-
|
|
63
|
+
function getPrimaryColors(color, defaultColor = "yellow") {
|
|
64
|
+
const theme = primaryThemes.find(([colorName, _]) => colorName === color);
|
|
65
|
+
if (!theme)
|
|
66
|
+
return getPrimaryColors(defaultColor);
|
|
67
|
+
return theme[1];
|
|
123
68
|
}
|
|
124
|
-
function getGrayColors(color) {
|
|
125
|
-
|
|
69
|
+
function getGrayColors(color, defaultColor = "stone") {
|
|
70
|
+
const theme = grayThemes.find(([colorName, _]) => colorName === color);
|
|
71
|
+
if (!theme)
|
|
72
|
+
return getGrayColors(defaultColor);
|
|
73
|
+
return theme[1];
|
|
126
74
|
}
|
|
75
|
+
const predefinedThemes = [
|
|
76
|
+
{
|
|
77
|
+
name: "T3-Chat",
|
|
78
|
+
cssVars: {
|
|
79
|
+
light: {
|
|
80
|
+
"--una-background": "0.9754 0.0084 325.6414",
|
|
81
|
+
"--una-foreground": "0.3257 0.1161 325.0372",
|
|
82
|
+
"--una-card": "0.9754 0.0084 325.6414",
|
|
83
|
+
"--una-card-foreground": "0.3257 0.1161 325.0372",
|
|
84
|
+
"--una-popover": "1.0000 0 0",
|
|
85
|
+
"--una-popover-foreground": "0.3257 0.1161 325.0372",
|
|
86
|
+
"--una-primary": "0.5316 0.1409 355.1999",
|
|
87
|
+
"--una-primary-foreground": "1.0000 0 0",
|
|
88
|
+
"--una-secondary": "0.8696 0.0675 334.8991",
|
|
89
|
+
"--una-secondary-foreground": "0.4448 0.1341 324.7991",
|
|
90
|
+
"--una-muted": "0.9395 0.0260 331.5454",
|
|
91
|
+
"--una-muted-foreground": "0.4924 0.1244 324.4523",
|
|
92
|
+
"--una-accent": "0.8696 0.0675 334.8991",
|
|
93
|
+
"--una-accent-foreground": "0.4448 0.1341 324.7991",
|
|
94
|
+
"--una-destructive": "0.5248 0.1368 20.8317",
|
|
95
|
+
"--una-destructive-foreground": "1.0000 0 0",
|
|
96
|
+
"--una-border": "0.8568 0.0829 328.9110",
|
|
97
|
+
"--una-input": "0.8517 0.0558 336.6002",
|
|
98
|
+
"--una-ring": "0.5916 0.2180 0.5844",
|
|
99
|
+
"--una-chart-1": "0.6038 0.2363 344.4657",
|
|
100
|
+
"--una-chart-2": "0.4445 0.2251 300.6246",
|
|
101
|
+
"--una-chart-3": "0.3790 0.0438 226.1538",
|
|
102
|
+
"--una-chart-4": "0.8330 0.1185 88.3461",
|
|
103
|
+
"--una-chart-5": "0.7843 0.1256 58.9964",
|
|
104
|
+
"--una-sidebar": "0.9360 0.0288 320.5788",
|
|
105
|
+
"--una-sidebar-foreground": "0.4948 0.1909 354.5435",
|
|
106
|
+
"--una-sidebar-primary": "0.3963 0.0251 285.1962",
|
|
107
|
+
"--una-sidebar-primary-foreground": "0.9668 0.0124 337.5228",
|
|
108
|
+
"--una-sidebar-accent": "0.9789 0.0013 106.4235",
|
|
109
|
+
"--una-sidebar-accent-foreground": "0.3963 0.0251 285.1962",
|
|
110
|
+
"--una-sidebar-border": "0.8568 0.0829 328.9110",
|
|
111
|
+
"--una-sidebar-ring": "0.5916 0.2180 0.5844"
|
|
112
|
+
},
|
|
113
|
+
dark: {
|
|
114
|
+
"--una-background": "0.2409 0.0201 307.5346",
|
|
115
|
+
"--una-foreground": "0.8398 0.0387 309.5391",
|
|
116
|
+
"--una-card": "0.2803 0.0232 307.5413",
|
|
117
|
+
"--una-card-foreground": "0.8456 0.0302 341.4597",
|
|
118
|
+
"--una-popover": "0.1548 0.0132 338.9015",
|
|
119
|
+
"--una-popover-foreground": "0.9647 0.0091 341.8035",
|
|
120
|
+
"--una-primary": "0.4607 0.1853 4.0994",
|
|
121
|
+
"--una-primary-foreground": "0.8560 0.0618 346.3684",
|
|
122
|
+
"--una-secondary": "0.3137 0.0306 310.0610",
|
|
123
|
+
"--una-secondary-foreground": "0.8483 0.0382 307.9613",
|
|
124
|
+
"--una-muted": "0.2634 0.0219 309.4748",
|
|
125
|
+
"--una-muted-foreground": "0.7940 0.0372 307.1032",
|
|
126
|
+
"--una-accent": "0.3649 0.0508 308.4911",
|
|
127
|
+
"--una-accent-foreground": "0.9647 0.0091 341.8035",
|
|
128
|
+
"--una-destructive": "0.2258 0.0524 12.6119",
|
|
129
|
+
"--una-destructive-foreground": "1.0000 0 0",
|
|
130
|
+
"--una-border": "0.3286 0.0154 343.4461",
|
|
131
|
+
"--una-input": "0.3387 0.0195 332.8347",
|
|
132
|
+
"--una-ring": "0.5916 0.2180 0.5844",
|
|
133
|
+
"--una-chart-1": "0.5316 0.1409 355.1999",
|
|
134
|
+
"--una-chart-2": "0.5633 0.1912 306.8561",
|
|
135
|
+
"--una-chart-3": "0.7227 0.1502 60.5799",
|
|
136
|
+
"--una-chart-4": "0.6193 0.2029 312.7422",
|
|
137
|
+
"--una-chart-5": "0.6118 0.2093 6.1387",
|
|
138
|
+
"--una-sidebar": "0.1893 0.0163 331.0475",
|
|
139
|
+
"--una-sidebar-foreground": "0.8607 0.0293 343.6612",
|
|
140
|
+
"--una-sidebar-primary": "0.4882 0.2172 264.3763",
|
|
141
|
+
"--una-sidebar-primary-foreground": "1.0000 0 0",
|
|
142
|
+
"--una-sidebar-accent": "0.2337 0.0261 338.1961",
|
|
143
|
+
"--una-sidebar-accent-foreground": "0.9674 0.0013 286.3752",
|
|
144
|
+
"--una-sidebar-border": "0.3286 0.0154 343.4461",
|
|
145
|
+
"--una-sidebar-ring": "0.5916 0.2180 0.5844"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "Vercel",
|
|
151
|
+
cssVars: {
|
|
152
|
+
light: {
|
|
153
|
+
"--una-background": "0.9900 0 0",
|
|
154
|
+
"--una-foreground": "0 0 0",
|
|
155
|
+
"--una-card": "1 0 0",
|
|
156
|
+
"--una-card-foreground": "0 0 0",
|
|
157
|
+
"--una-popover": "0.9900 0 0",
|
|
158
|
+
"--una-popover-foreground": "0 0 0",
|
|
159
|
+
"--una-primary": "0 0 0",
|
|
160
|
+
"--una-primary-foreground": "1 0 0",
|
|
161
|
+
"--una-secondary": "0.9400 0 0",
|
|
162
|
+
"--una-secondary-foreground": "0 0 0",
|
|
163
|
+
"--una-muted": "0.9700 0 0",
|
|
164
|
+
"--una-muted-foreground": "0.4400 0 0",
|
|
165
|
+
"--una-accent": "0.9400 0 0",
|
|
166
|
+
"--una-accent-foreground": "0 0 0",
|
|
167
|
+
"--una-destructive": "0.6300 0.1900 23.0300",
|
|
168
|
+
"--una-destructive-foreground": "1 0 0",
|
|
169
|
+
"--una-border": "0.9200 0 0",
|
|
170
|
+
"--una-input": "0.9400 0 0",
|
|
171
|
+
"--una-ring": "0 0 0",
|
|
172
|
+
"--una-chart-1": "0.8100 0.1700 75.3500",
|
|
173
|
+
"--una-chart-2": "0.5500 0.2200 264.5300",
|
|
174
|
+
"--una-chart-3": "0.7200 0 0",
|
|
175
|
+
"--una-chart-4": "0.9200 0 0",
|
|
176
|
+
"--una-chart-5": "0.5600 0 0",
|
|
177
|
+
"--una-sidebar": "0.9900 0 0",
|
|
178
|
+
"--una-sidebar-foreground": "0 0 0",
|
|
179
|
+
"--una-sidebar-primary": "0 0 0",
|
|
180
|
+
"--una-sidebar-primary-foreground": "1 0 0",
|
|
181
|
+
"--una-sidebar-accent": "0.9400 0 0",
|
|
182
|
+
"--una-sidebar-accent-foreground": "0 0 0",
|
|
183
|
+
"--una-sidebar-border": "0.9400 0 0",
|
|
184
|
+
"--una-sidebar-ring": "0 0 0"
|
|
185
|
+
},
|
|
186
|
+
dark: {
|
|
187
|
+
"--una-background": "0 0 0",
|
|
188
|
+
"--una-foreground": "1 0 0",
|
|
189
|
+
"--una-card": "0.1400 0 0",
|
|
190
|
+
"--una-card-foreground": "1 0 0",
|
|
191
|
+
"--una-popover": "0.1800 0 0",
|
|
192
|
+
"--una-popover-foreground": "1 0 0",
|
|
193
|
+
"--una-primary": "1 0 0",
|
|
194
|
+
"--una-primary-foreground": "0 0 0",
|
|
195
|
+
"--una-secondary": "0.2500 0 0",
|
|
196
|
+
"--una-secondary-foreground": "1 0 0",
|
|
197
|
+
"--una-muted": "0.2300 0 0",
|
|
198
|
+
"--una-muted-foreground": "0.7200 0 0",
|
|
199
|
+
"--una-accent": "0.3200 0 0",
|
|
200
|
+
"--una-accent-foreground": "1 0 0",
|
|
201
|
+
"--una-destructive": "0.6900 0.2000 23.9100",
|
|
202
|
+
"--una-destructive-foreground": "0 0 0",
|
|
203
|
+
"--una-border": "0.2600 0 0",
|
|
204
|
+
"--una-input": "0.3200 0 0",
|
|
205
|
+
"--una-ring": "0.7200 0 0",
|
|
206
|
+
"--una-chart-1": "0.8100 0.1700 75.3500",
|
|
207
|
+
"--una-chart-2": "0.5800 0.2100 260.8400",
|
|
208
|
+
"--una-chart-3": "0.5600 0 0",
|
|
209
|
+
"--una-chart-4": "0.4400 0 0",
|
|
210
|
+
"--una-chart-5": "0.9200 0 0",
|
|
211
|
+
"--una-sidebar": "0.1800 0 0",
|
|
212
|
+
"--una-sidebar-foreground": "1 0 0",
|
|
213
|
+
"--una-sidebar-primary": "1 0 0",
|
|
214
|
+
"--una-sidebar-primary-foreground": "0 0 0",
|
|
215
|
+
"--una-sidebar-accent": "0.3200 0 0",
|
|
216
|
+
"--una-sidebar-accent-foreground": "1 0 0",
|
|
217
|
+
"--una-sidebar-border": "0.3200 0 0",
|
|
218
|
+
"--una-sidebar-ring": "0.7200 0 0"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "Notebook",
|
|
224
|
+
cssVars: {
|
|
225
|
+
light: {
|
|
226
|
+
"--una-background": "0.9821 0 0",
|
|
227
|
+
"--una-foreground": "0.3485 0 0",
|
|
228
|
+
"--una-card": "1.0000 0 0",
|
|
229
|
+
"--una-card-foreground": "0.3485 0 0",
|
|
230
|
+
"--una-popover": "1.0000 0 0",
|
|
231
|
+
"--una-popover-foreground": "0.3485 0 0",
|
|
232
|
+
"--una-primary": "0.4891 0 0",
|
|
233
|
+
"--una-primary-foreground": "0.9551 0 0",
|
|
234
|
+
"--una-secondary": "0.9006 0 0",
|
|
235
|
+
"--una-secondary-foreground": "0.3485 0 0",
|
|
236
|
+
"--una-muted": "0.9158 0 0",
|
|
237
|
+
"--una-muted-foreground": "0.4313 0 0",
|
|
238
|
+
"--una-accent": "0.9354 0.0456 94.8549",
|
|
239
|
+
"--una-accent-foreground": "0.4015 0.0436 37.9587",
|
|
240
|
+
"--una-destructive": "0.6627 0.0978 20.0041",
|
|
241
|
+
"--una-destructive-foreground": "1.0000 0 0",
|
|
242
|
+
"--una-border": "0.5538 0.0025 17.2320",
|
|
243
|
+
"--una-input": "1.0000 0 0",
|
|
244
|
+
"--una-ring": "0.7058 0 0",
|
|
245
|
+
"--una-chart-1": "0.3211 0 0",
|
|
246
|
+
"--una-chart-2": "0.4495 0 0",
|
|
247
|
+
"--una-chart-3": "0.5693 0 0",
|
|
248
|
+
"--una-chart-4": "0.6830 0 0",
|
|
249
|
+
"--una-chart-5": "0.7921 0 0",
|
|
250
|
+
"--una-sidebar": "0.9551 0 0",
|
|
251
|
+
"--una-sidebar-foreground": "0.3485 0 0",
|
|
252
|
+
"--una-sidebar-primary": "0.4891 0 0",
|
|
253
|
+
"--una-sidebar-primary-foreground": "0.9551 0 0",
|
|
254
|
+
"--una-sidebar-accent": "0.9354 0.0456 94.8549",
|
|
255
|
+
"--una-sidebar-accent-foreground": "0.4015 0.0436 37.9587",
|
|
256
|
+
"--una-sidebar-border": "0.8078 0 0",
|
|
257
|
+
"--una-sidebar-ring": "0.7058 0 0"
|
|
258
|
+
},
|
|
259
|
+
dark: {
|
|
260
|
+
"--una-background": "0.2891 0 0",
|
|
261
|
+
"--una-foreground": "0.8945 0 0",
|
|
262
|
+
"--una-card": "0.3211 0 0",
|
|
263
|
+
"--una-card-foreground": "0.8945 0 0",
|
|
264
|
+
"--una-popover": "0.3211 0 0",
|
|
265
|
+
"--una-popover-foreground": "0.8945 0 0",
|
|
266
|
+
"--una-primary": "0.7572 0 0",
|
|
267
|
+
"--una-primary-foreground": "0.2891 0 0",
|
|
268
|
+
"--una-secondary": "0.4676 0 0",
|
|
269
|
+
"--una-secondary-foreground": "0.8078 0 0",
|
|
270
|
+
"--una-muted": "0.3904 0 0",
|
|
271
|
+
"--una-muted-foreground": "0.7058 0 0",
|
|
272
|
+
"--una-accent": "0.9067 0 0",
|
|
273
|
+
"--una-accent-foreground": "0.3211 0 0",
|
|
274
|
+
"--una-destructive": "0.7915 0.0491 18.2410",
|
|
275
|
+
"--una-destructive-foreground": "0.2891 0 0",
|
|
276
|
+
"--una-border": "0.4276 0 0",
|
|
277
|
+
"--una-input": "0.3211 0 0",
|
|
278
|
+
"--una-ring": "0.8078 0 0",
|
|
279
|
+
"--una-chart-1": "0.9521 0 0",
|
|
280
|
+
"--una-chart-2": "0.8576 0 0",
|
|
281
|
+
"--una-chart-3": "0.7572 0 0",
|
|
282
|
+
"--una-chart-4": "0.6534 0 0",
|
|
283
|
+
"--una-chart-5": "0.5452 0 0",
|
|
284
|
+
"--una-sidebar": "0.2478 0 0",
|
|
285
|
+
"--una-sidebar-foreground": "0.8945 0 0",
|
|
286
|
+
"--una-sidebar-primary": "0.7572 0 0",
|
|
287
|
+
"--una-sidebar-primary-foreground": "0.2478 0 0",
|
|
288
|
+
"--una-sidebar-accent": "0.9067 0 0",
|
|
289
|
+
"--una-sidebar-accent-foreground": "0.3211 0 0",
|
|
290
|
+
"--una-sidebar-border": "0.4276 0 0",
|
|
291
|
+
"--una-sidebar-ring": "0.8078 0 0"
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
name: "Sunset Horizon",
|
|
297
|
+
cssVars: {
|
|
298
|
+
light: {
|
|
299
|
+
"--una-background": "0.9856 0.0084 56.3169",
|
|
300
|
+
"--una-foreground": "0.3353 0.0132 2.7676",
|
|
301
|
+
"--una-card": "1.0000 0 0",
|
|
302
|
+
"--una-card-foreground": "0.3353 0.0132 2.7676",
|
|
303
|
+
"--una-popover": "1.0000 0 0",
|
|
304
|
+
"--una-popover-foreground": "0.3353 0.0132 2.7676",
|
|
305
|
+
"--una-primary": "0.7357 0.1641 34.7091",
|
|
306
|
+
"--una-primary-foreground": "1.0000 0 0",
|
|
307
|
+
"--una-secondary": "0.9596 0.0200 28.9029",
|
|
308
|
+
"--una-secondary-foreground": "0.5587 0.1294 32.7364",
|
|
309
|
+
"--una-muted": "0.9656 0.0176 39.4009",
|
|
310
|
+
"--una-muted-foreground": "0.5534 0.0116 58.0708",
|
|
311
|
+
"--una-accent": "0.8278 0.1131 57.9984",
|
|
312
|
+
"--una-accent-foreground": "0.3353 0.0132 2.7676",
|
|
313
|
+
"--una-destructive": "0.6122 0.2082 22.2410",
|
|
314
|
+
"--una-destructive-foreground": "1.0000 0 0",
|
|
315
|
+
"--una-border": "0.9296 0.0370 38.6868",
|
|
316
|
+
"--una-input": "0.9296 0.0370 38.6868",
|
|
317
|
+
"--una-ring": "0.7357 0.1641 34.7091",
|
|
318
|
+
"--una-chart-1": "0.7357 0.1641 34.7091",
|
|
319
|
+
"--una-chart-2": "0.8278 0.1131 57.9984",
|
|
320
|
+
"--una-chart-3": "0.8773 0.0763 54.9314",
|
|
321
|
+
"--una-chart-4": "0.8200 0.1054 40.8859",
|
|
322
|
+
"--una-chart-5": "0.6368 0.1306 32.0721",
|
|
323
|
+
"--una-sidebar": "0.9656 0.0176 39.4009",
|
|
324
|
+
"--una-sidebar-foreground": "0.3353 0.0132 2.7676",
|
|
325
|
+
"--una-sidebar-primary": "0.7357 0.1641 34.7091",
|
|
326
|
+
"--una-sidebar-primary-foreground": "1.0000 0 0",
|
|
327
|
+
"--una-sidebar-accent": "0.8278 0.1131 57.9984",
|
|
328
|
+
"--una-sidebar-accent-foreground": "0.3353 0.0132 2.7676",
|
|
329
|
+
"--una-sidebar-border": "0.9296 0.0370 38.6868",
|
|
330
|
+
"--una-sidebar-ring": "0.7357 0.1641 34.7091"
|
|
331
|
+
},
|
|
332
|
+
dark: {
|
|
333
|
+
"--una-background": "0.2569 0.0169 352.4042",
|
|
334
|
+
"--una-foreground": "0.9397 0.0119 51.3156",
|
|
335
|
+
"--una-card": "0.3184 0.0176 341.4465",
|
|
336
|
+
"--una-card-foreground": "0.9397 0.0119 51.3156",
|
|
337
|
+
"--una-popover": "0.3184 0.0176 341.4465",
|
|
338
|
+
"--una-popover-foreground": "0.9397 0.0119 51.3156",
|
|
339
|
+
"--una-primary": "0.7357 0.1641 34.7091",
|
|
340
|
+
"--una-primary-foreground": "1.0000 0 0",
|
|
341
|
+
"--una-secondary": "0.3637 0.0203 342.2664",
|
|
342
|
+
"--una-secondary-foreground": "0.9397 0.0119 51.3156",
|
|
343
|
+
"--una-muted": "0.3184 0.0176 341.4465",
|
|
344
|
+
"--una-muted-foreground": "0.8378 0.0237 52.6346",
|
|
345
|
+
"--una-accent": "0.8278 0.1131 57.9984",
|
|
346
|
+
"--una-accent-foreground": "0.2569 0.0169 352.4042",
|
|
347
|
+
"--una-destructive": "0.6122 0.2082 22.2410",
|
|
348
|
+
"--una-destructive-foreground": "1.0000 0 0",
|
|
349
|
+
"--una-border": "0.3637 0.0203 342.2664",
|
|
350
|
+
"--una-input": "0.3637 0.0203 342.2664",
|
|
351
|
+
"--una-ring": "0.7357 0.1641 34.7091",
|
|
352
|
+
"--una-chart-1": "0.7357 0.1641 34.7091",
|
|
353
|
+
"--una-chart-2": "0.8278 0.1131 57.9984",
|
|
354
|
+
"--una-chart-3": "0.8773 0.0763 54.9314",
|
|
355
|
+
"--una-chart-4": "0.8200 0.1054 40.8859",
|
|
356
|
+
"--una-chart-5": "0.6368 0.1306 32.0721",
|
|
357
|
+
"--una-sidebar": "0.2569 0.0169 352.4042",
|
|
358
|
+
"--una-sidebar-foreground": "0.9397 0.0119 51.3156",
|
|
359
|
+
"--una-sidebar-primary": "0.7357 0.1641 34.7091",
|
|
360
|
+
"--una-sidebar-primary-foreground": "1.0000 0 0",
|
|
361
|
+
"--una-sidebar-accent": "0.8278 0.1131 57.9984",
|
|
362
|
+
"--una-sidebar-accent-foreground": "0.2569 0.0169 352.4042",
|
|
363
|
+
"--una-sidebar-border": "0.3637 0.0203 342.2664",
|
|
364
|
+
"--una-sidebar-ring": "0.7357 0.1641 34.7091"
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: "Claude",
|
|
370
|
+
cssVars: {
|
|
371
|
+
light: {
|
|
372
|
+
"--una-background": "0.9818 0.0054 95.0986",
|
|
373
|
+
"--una-foreground": "0.3438 0.0269 95.7226",
|
|
374
|
+
"--una-card": "0.9818 0.0054 95.0986",
|
|
375
|
+
"--una-card-foreground": "0.1908 0.0020 106.5859",
|
|
376
|
+
"--una-popover": "1.0000 0 0",
|
|
377
|
+
"--una-popover-foreground": "0.2671 0.0196 98.9390",
|
|
378
|
+
"--una-primary": "0.6171 0.1375 39.0427",
|
|
379
|
+
"--una-primary-foreground": "1.0000 0 0",
|
|
380
|
+
"--una-secondary": "0.9245 0.0138 92.9892",
|
|
381
|
+
"--una-secondary-foreground": "0.4334 0.0177 98.6048",
|
|
382
|
+
"--una-muted": "0.9341 0.0153 90.2390",
|
|
383
|
+
"--una-muted-foreground": "0.6059 0.0075 97.4233",
|
|
384
|
+
"--una-accent": "0.9245 0.0138 92.9892",
|
|
385
|
+
"--una-accent-foreground": "0.2671 0.0196 98.9390",
|
|
386
|
+
"--una-destructive": "0.1908 0.0020 106.5859",
|
|
387
|
+
"--una-destructive-foreground": "1.0000 0 0",
|
|
388
|
+
"--una-border": "0.8847 0.0069 97.3627",
|
|
389
|
+
"--una-input": "0.7621 0.0156 98.3528",
|
|
390
|
+
"--una-ring": "0.5937 0.1673 253.0630",
|
|
391
|
+
"--una-chart-1": "0.5583 0.1276 42.9956",
|
|
392
|
+
"--una-chart-2": "0.6898 0.1581 290.4107",
|
|
393
|
+
"--una-chart-3": "0.8816 0.0276 93.1280",
|
|
394
|
+
"--una-chart-4": "0.8822 0.0403 298.1792",
|
|
395
|
+
"--una-chart-5": "0.5608 0.1348 42.0584",
|
|
396
|
+
"--una-sidebar": "0.9663 0.0080 98.8792",
|
|
397
|
+
"--una-sidebar-foreground": "0.3590 0.0051 106.6524",
|
|
398
|
+
"--una-sidebar-primary": "0.6171 0.1375 39.0427",
|
|
399
|
+
"--una-sidebar-primary-foreground": "0.9881 0 0",
|
|
400
|
+
"--una-sidebar-accent": "0.9245 0.0138 92.9892",
|
|
401
|
+
"--una-sidebar-accent-foreground": "0.3250 0 0",
|
|
402
|
+
"--una-sidebar-border": "0.9401 0 0",
|
|
403
|
+
"--una-sidebar-ring": "0.7731 0 0"
|
|
404
|
+
},
|
|
405
|
+
dark: {
|
|
406
|
+
"--una-background": "0.2679 0.0036 106.6427",
|
|
407
|
+
"--una-foreground": "0.8074 0.0142 93.0137",
|
|
408
|
+
"--una-card": "0.2679 0.0036 106.6427",
|
|
409
|
+
"--una-card-foreground": "0.9818 0.0054 95.0986",
|
|
410
|
+
"--una-popover": "0.3085 0.0035 106.6039",
|
|
411
|
+
"--una-popover-foreground": "0.9211 0.0040 106.4781",
|
|
412
|
+
"--una-primary": "0.6724 0.1308 38.7559",
|
|
413
|
+
"--una-primary-foreground": "1.0000 0 0",
|
|
414
|
+
"--una-secondary": "0.9818 0.0054 95.0986",
|
|
415
|
+
"--una-secondary-foreground": "0.3085 0.0035 106.6039",
|
|
416
|
+
"--una-muted": "0.2213 0.0038 106.7070",
|
|
417
|
+
"--una-muted-foreground": "0.7713 0.0169 99.0657",
|
|
418
|
+
"--una-accent": "0.2130 0.0078 95.4245",
|
|
419
|
+
"--una-accent-foreground": "0.9663 0.0080 98.8792",
|
|
420
|
+
"--una-destructive": "0.6368 0.2078 25.3313",
|
|
421
|
+
"--una-destructive-foreground": "1.0000 0 0",
|
|
422
|
+
"--una-border": "0.3618 0.0101 106.8928",
|
|
423
|
+
"--una-input": "0.4336 0.0113 100.2195",
|
|
424
|
+
"--una-ring": "0.5937 0.1673 253.0630",
|
|
425
|
+
"--una-chart-1": "0.5583 0.1276 42.9956",
|
|
426
|
+
"--una-chart-2": "0.6898 0.1581 290.4107",
|
|
427
|
+
"--una-chart-3": "0.2130 0.0078 95.4245",
|
|
428
|
+
"--una-chart-4": "0.3074 0.0516 289.3230",
|
|
429
|
+
"--una-chart-5": "0.5608 0.1348 42.0584",
|
|
430
|
+
"--una-sidebar": "0.2357 0.0024 67.7077",
|
|
431
|
+
"--una-sidebar-foreground": "0.8074 0.0142 93.0137",
|
|
432
|
+
"--una-sidebar-primary": "0.3250 0 0",
|
|
433
|
+
"--una-sidebar-primary-foreground": "0.9881 0 0",
|
|
434
|
+
"--una-sidebar-accent": "0.1680 0.0020 106.6177",
|
|
435
|
+
"--una-sidebar-accent-foreground": "0.8074 0.0142 93.0137",
|
|
436
|
+
"--una-sidebar-border": "0.3618 0.0101 106.8928",
|
|
437
|
+
"--una-sidebar-ring": "0.7731 0 0"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
];
|
|
127
442
|
return {
|
|
128
443
|
primaryThemes,
|
|
129
444
|
grayThemes,
|
|
445
|
+
predefinedThemes,
|
|
130
446
|
getPrimaryColors,
|
|
131
447
|
getGrayColors
|
|
132
448
|
};
|
|
@@ -10,6 +10,18 @@ export default defineNuxtPlugin(() => {
|
|
|
10
10
|
const html = document.documentElement;
|
|
11
11
|
html.removeAttribute("style");
|
|
12
12
|
const computedStyles = computed(() => {
|
|
13
|
+
if (settings.value.theme) {
|
|
14
|
+
return `
|
|
15
|
+
:root {
|
|
16
|
+
${Object.entries(settings.value.theme.cssVars.light).map(([k, v]) => `${k}: ${v};`).join("\n")}
|
|
17
|
+
--una-radius: ${settings.value.radius}rem;
|
|
18
|
+
--una-font-size: ${settings.value.fontSize}px;
|
|
19
|
+
}
|
|
20
|
+
.dark {
|
|
21
|
+
${Object.entries(settings.value.theme.cssVars.dark).map(([k, v]) => `${k}: ${v};`).join("\n")}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
13
25
|
return `
|
|
14
26
|
:root {
|
|
15
27
|
${Object.entries(settings.value.primaryColors).map(([k, v]) => `${k}: ${v};`).join("\n")}
|
|
@@ -16,6 +16,15 @@ export default defineNuxtPlugin(() => {
|
|
|
16
16
|
const html = document.documentElement
|
|
17
17
|
${process.dev ? "console.log({ settings })" : ""}
|
|
18
18
|
|
|
19
|
+
if (settings.theme) {
|
|
20
|
+
Object.entries(settings.theme.cssVars.light).map(i => html.style.setProperty(i[0], i[1]))
|
|
21
|
+
Object.entries(settings.theme.cssVars.dark).map(i => html.style.setProperty(i[0], i[1]))
|
|
22
|
+
|
|
23
|
+
html.style.setProperty('--una-radius', settings.radius + 'rem')
|
|
24
|
+
html.style.setProperty('--una-font-size', settings.fontSize + 'px')
|
|
25
|
+
return
|
|
26
|
+
}
|
|
27
|
+
|
|
19
28
|
if (settings.primary)
|
|
20
29
|
Object.entries(settings.primaryColors).map(i => html.style.setProperty(i[0], i[1]))
|
|
21
30
|
if (settings.gray)
|
|
@@ -61,6 +61,13 @@ export interface ColorPalette {
|
|
|
61
61
|
export interface UnaSettings {
|
|
62
62
|
primaryColors: Colors;
|
|
63
63
|
grayColors: Colors;
|
|
64
|
+
theme: {
|
|
65
|
+
name: string;
|
|
66
|
+
cssVars: {
|
|
67
|
+
light: Colors;
|
|
68
|
+
dark: Colors;
|
|
69
|
+
};
|
|
70
|
+
} | null | false | undefined;
|
|
64
71
|
primary: string;
|
|
65
72
|
gray: string;
|
|
66
73
|
fontSize: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@una-ui/nuxt-edge",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-alpha.0-
|
|
4
|
+
"version": "1.0.0-alpha.0-29173950.b6a8c03",
|
|
5
5
|
"description": "Nuxt module for @una-ui",
|
|
6
6
|
"author": "Phojie Rengel <phojrengel@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"@nuxt/kit": "^3.17.5",
|
|
42
42
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
43
43
|
"@tanstack/vue-table": "^8.21.3",
|
|
44
|
-
"@una-ui/extractor-vue-script": "npm:@una-ui/extractor-vue-script-edge@1.0.0-alpha.0-
|
|
45
|
-
"@una-ui/preset": "npm:@una-ui/preset-edge@1.0.0-alpha.0-
|
|
46
|
-
"@unocss/core": "^66.
|
|
47
|
-
"@unocss/nuxt": "^66.
|
|
48
|
-
"@unocss/preset-attributify": "^66.
|
|
49
|
-
"@unocss/preset-icons": "^66.
|
|
44
|
+
"@una-ui/extractor-vue-script": "npm:@una-ui/extractor-vue-script-edge@1.0.0-alpha.0-29173950.b6a8c03",
|
|
45
|
+
"@una-ui/preset": "npm:@una-ui/preset-edge@1.0.0-alpha.0-29173950.b6a8c03",
|
|
46
|
+
"@unocss/core": "^66.2.0",
|
|
47
|
+
"@unocss/nuxt": "^66.2.0",
|
|
48
|
+
"@unocss/preset-attributify": "^66.2.0",
|
|
49
|
+
"@unocss/preset-icons": "^66.2.0",
|
|
50
50
|
"@vee-validate/nuxt": "^4.15.1",
|
|
51
51
|
"@vee-validate/zod": "^4.15.1",
|
|
52
52
|
"@vueuse/core": "^12.8.2",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"ohash": "^1.1.6",
|
|
58
58
|
"reka-ui": "^2.3.1",
|
|
59
59
|
"tailwind-merge": "^3.3.1",
|
|
60
|
-
"unocss": "^66.
|
|
60
|
+
"unocss": "^66.2.0",
|
|
61
61
|
"unocss-preset-animations": "^1.2.1",
|
|
62
62
|
"vaul-vue": "^0.4.1"
|
|
63
63
|
},
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"build": "nuxt-build-module build",
|
|
78
78
|
"stub": "nuxt-build-module build --stub && pnpm nuxt-module-build prepare",
|
|
79
79
|
"dev": "nuxi dev playground",
|
|
80
|
-
"playground:build": "nuxi
|
|
80
|
+
"playground:build": "nuxi build playground",
|
|
81
81
|
"playground:preview": "nuxi preview playground"
|
|
82
82
|
}
|
|
83
83
|
}
|