@nuxt/ui 2.18.3 → 2.18.4
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 +1 -1
- package/dist/runtime/components/data/Table.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Accordion.vue.d.ts +2 -3
- package/dist/runtime/components/elements/Alert.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/elements/AvatarGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Badge.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Button.vue.d.ts +1 -1
- package/dist/runtime/components/elements/ButtonGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Carousel.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Chip.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Kbd.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Meter.vue.d.ts +1 -1
- package/dist/runtime/components/elements/MeterGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Progress.vue.d.ts +1 -1
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +1 -1
- package/dist/runtime/components/forms/Form.vue +2 -5
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +1 -1
- package/dist/runtime/components/forms/Input.vue.d.ts +1 -1
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +1 -1
- package/dist/runtime/components/forms/Radio.vue.d.ts +1 -1
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +1 -1
- package/dist/runtime/components/forms/Range.vue.d.ts +1 -1
- package/dist/runtime/components/forms/Select.vue.d.ts +1 -1
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +1 -1
- package/dist/runtime/components/forms/Textarea.vue.d.ts +1 -1
- package/dist/runtime/components/forms/Toggle.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Divider.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Tabs.vue +5 -2
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Modal.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Notification.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +5 -5
- package/dist/runtime/components/overlays/Popover.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Slideover.vue +1 -1
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +1 -1
- package/dist/runtime/composables/useFormGroup.d.ts +1 -1
- package/dist/runtime/composables/useFormGroup.js +13 -17
- package/dist/runtime/composables/useUI.d.ts +1 -1
- package/dist/runtime/plugins/colors.js +3 -3
- package/dist/runtime/utils/colors.js +75 -67
- package/dist/runtime/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -14,7 +14,7 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
|
14
14
|
const __dirname = __cjs_path__.dirname(__filename);
|
|
15
15
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
16
16
|
const name = "@nuxt/ui";
|
|
17
|
-
const version = "2.18.
|
|
17
|
+
const version = "2.18.4";
|
|
18
18
|
|
|
19
19
|
function createTemplates(nuxt = useNuxt()) {
|
|
20
20
|
const template = addTemplate({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType, AriaAttributes } from 'vue';
|
|
2
|
-
import type { Strategy, Button, ProgressColor, ProgressAnimation } from '../../types.js';
|
|
2
|
+
import type { Strategy, Button, ProgressColor, ProgressAnimation } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
wrapper: string;
|
|
5
5
|
base: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
import type { AccordionItem, Strategy } from '../../types.js';
|
|
2
|
+
import type { AccordionItem, Strategy } from '../../types/index.js';
|
|
4
3
|
declare const config: {
|
|
5
4
|
wrapper: string;
|
|
6
5
|
container: string;
|
|
@@ -169,7 +168,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
169
168
|
close: (e: EventTarget) => {};
|
|
170
169
|
}[]>;
|
|
171
170
|
closeOthers: (currentIndex: number, e: Event) => void;
|
|
172
|
-
omit:
|
|
171
|
+
omit: any;
|
|
173
172
|
onEnter: (_el: Element, done: () => void) => void;
|
|
174
173
|
onBeforeLeave: (_el: Element) => void;
|
|
175
174
|
onAfterEnter: (_el: Element) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { Avatar, Button, AlertColor, AlertVariant, AlertAction, Strategy } from '../../types.js';
|
|
2
|
+
import type { Avatar, Button, AlertColor, AlertVariant, AlertAction, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
wrapper: string;
|
|
5
5
|
inner: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { AvatarSize, AvatarChipColor, AvatarChipPosition, Strategy } from '../../types.js';
|
|
2
|
+
import type { AvatarSize, AvatarChipColor, AvatarChipPosition, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
wrapper: string;
|
|
5
5
|
background: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { BadgeColor, BadgeSize, BadgeVariant, Strategy } from '../../types.js';
|
|
2
|
+
import type { BadgeColor, BadgeSize, BadgeVariant, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
base: string;
|
|
5
5
|
rounded: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { ButtonColor, ButtonSize, ButtonVariant, Strategy } from '../../types.js';
|
|
2
|
+
import type { ButtonColor, ButtonSize, ButtonVariant, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
base: string;
|
|
5
5
|
font: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { ChipSize, ChipColor, ChipPosition, Strategy } from '../../types.js';
|
|
2
|
+
import type { ChipSize, ChipColor, ChipPosition, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
wrapper: string;
|
|
5
5
|
base: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import { twJoin } from 'tailwind-merge';
|
|
3
|
-
import type { DropdownItem, PopperOptions, Strategy } from '../../types.js';
|
|
3
|
+
import type { DropdownItem, PopperOptions, Strategy } from '../../types/index.js';
|
|
4
4
|
declare const config: {
|
|
5
5
|
wrapper: string;
|
|
6
6
|
container: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VNode, SlotsType, PropType } from 'vue';
|
|
2
2
|
import Meter from './Meter.vue.js';
|
|
3
|
-
import type { Strategy, MeterSize } from '../../types.js';
|
|
3
|
+
import type { Strategy, MeterSize } from '../../types/index.js';
|
|
4
4
|
declare const meterGroupConfig: {
|
|
5
5
|
wrapper: string;
|
|
6
6
|
base: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { Strategy, ProgressSize, ProgressAnimation, ProgressColor } from '../../types.js';
|
|
2
|
+
import type { Strategy, ProgressSize, ProgressAnimation, ProgressColor } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
wrapper: string;
|
|
5
5
|
indicator: {
|
|
@@ -100,11 +100,8 @@ export default defineComponent({
|
|
|
100
100
|
if (props.validateOn?.includes("submit")) {
|
|
101
101
|
await validate();
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
data: props.state
|
|
106
|
-
};
|
|
107
|
-
emit("submit", submitEvent);
|
|
103
|
+
event.data = props.state;
|
|
104
|
+
emit("submit", event);
|
|
108
105
|
} catch (error) {
|
|
109
106
|
if (!(error instanceof FormException)) {
|
|
110
107
|
throw error;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { InputSize, InputColor, InputVariant, Strategy } from '../../types.js';
|
|
2
|
+
import type { InputSize, InputColor, InputVariant, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
wrapper: string;
|
|
5
5
|
base: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { InputSize, InputColor, InputVariant, PopperOptions, Strategy } from '../../types.js';
|
|
2
|
+
import type { InputSize, InputColor, InputVariant, PopperOptions, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
wrapper: string;
|
|
5
5
|
base: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType, ComputedRef } from 'vue';
|
|
2
|
-
import type { SelectSize, SelectColor, SelectVariant, Strategy } from '../../types.js';
|
|
2
|
+
import type { SelectSize, SelectColor, SelectVariant, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
form: string;
|
|
5
5
|
placeholder: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { SelectSize, SelectColor, SelectVariant, PopperOptions, Strategy } from '../../types.js';
|
|
2
|
+
import type { SelectSize, SelectColor, SelectVariant, PopperOptions, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
form: string;
|
|
5
5
|
placeholder: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { TextareaSize, TextareaColor, TextareaVariant, Strategy } from '../../types.js';
|
|
2
|
+
import type { TextareaSize, TextareaColor, TextareaVariant, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
form: string;
|
|
5
5
|
default: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import { twJoin } from 'tailwind-merge';
|
|
3
|
-
import type { BreadcrumbLink, Strategy } from '../../types.js';
|
|
3
|
+
import type { BreadcrumbLink, Strategy } from '../../types/index.js';
|
|
4
4
|
declare const config: {
|
|
5
5
|
wrapper: string;
|
|
6
6
|
ol: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComputedRef, PropType, ComponentPublicInstance } from 'vue';
|
|
2
2
|
import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
|
|
3
|
-
import type { Group, Command, Button, Strategy } from '../../types.js';
|
|
3
|
+
import type { Group, Command, Button, Strategy } from '../../types/index.js';
|
|
4
4
|
declare const config: {
|
|
5
5
|
wrapper: string;
|
|
6
6
|
container: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { Command, Group } from '../../types.js';
|
|
2
|
+
import type { Command, Group } from '../../types/index.js';
|
|
3
3
|
import { commandPalette } from '#ui/ui.config';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
group: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import { twJoin } from 'tailwind-merge';
|
|
3
|
-
import type { HorizontalNavigationLink, Strategy } from '../../types.js';
|
|
3
|
+
import type { HorizontalNavigationLink, Strategy } from '../../types/index.js';
|
|
4
4
|
declare const config: {
|
|
5
5
|
wrapper: string;
|
|
6
6
|
container: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { RouteLocationRaw } from '#vue-router';
|
|
3
|
-
import type { Button, ButtonSize, Strategy } from '../../types.js';
|
|
3
|
+
import type { Button, ButtonSize, Strategy } from '../../types/index.js';
|
|
4
4
|
declare const config: {
|
|
5
5
|
wrapper: string;
|
|
6
6
|
base: string;
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script>
|
|
56
|
-
import { toRef, ref, watch, onMounted, defineComponent } from "vue";
|
|
56
|
+
import { toRef, ref, watch, onMounted, defineComponent, nextTick } from "vue";
|
|
57
57
|
import { TabGroup as HTabGroup, TabList as HTabList, Tab as HTab, TabPanels as HTabPanels, TabPanel as HTabPanel, provideUseId } from "@headlessui/vue";
|
|
58
58
|
import { useResizeObserver } from "@vueuse/core";
|
|
59
59
|
import UIcon from "../elements/Icon.vue";
|
|
@@ -143,7 +143,10 @@ export default defineComponent({
|
|
|
143
143
|
selectedIndex.value = value;
|
|
144
144
|
calcMarkerSize(selectedIndex.value);
|
|
145
145
|
});
|
|
146
|
-
onMounted(() =>
|
|
146
|
+
onMounted(async () => {
|
|
147
|
+
await nextTick();
|
|
148
|
+
calcMarkerSize(selectedIndex.value);
|
|
149
|
+
});
|
|
147
150
|
provideUseId(() => useId());
|
|
148
151
|
return {
|
|
149
152
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import { twJoin } from 'tailwind-merge';
|
|
3
|
-
import type { VerticalNavigationLink, Strategy } from '../../types.js';
|
|
3
|
+
import type { VerticalNavigationLink, Strategy } from '../../types/index.js';
|
|
4
4
|
declare const config: {
|
|
5
5
|
wrapper: string;
|
|
6
6
|
base: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { Avatar, Button, NotificationColor, NotificationAction, Strategy } from '../../types.js';
|
|
2
|
+
import type { Avatar, Button, NotificationColor, NotificationAction, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
wrapper: string;
|
|
5
5
|
container: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { Notification, Strategy } from '../../types.js';
|
|
2
|
+
import type { Notification, Strategy } from '../../types/index.js';
|
|
3
3
|
declare const config: {
|
|
4
4
|
wrapper: string;
|
|
5
5
|
position: string;
|
|
@@ -33,13 +33,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
33
|
title?: string;
|
|
34
34
|
description?: string;
|
|
35
35
|
icon?: string;
|
|
36
|
-
avatar?: import("../../types").Avatar;
|
|
37
|
-
closeButton?: import("../../types").Button;
|
|
36
|
+
avatar?: import("../../types/avatar").Avatar;
|
|
37
|
+
closeButton?: import("../../types/button").Button;
|
|
38
38
|
timeout?: number;
|
|
39
|
-
actions?: import("../../types").NotificationAction[];
|
|
39
|
+
actions?: import("../../types/notification").NotificationAction[];
|
|
40
40
|
click?: (...args: any[]) => void;
|
|
41
41
|
callback?: (...args: any[]) => void;
|
|
42
|
-
color?: import("../../types").NotificationColor;
|
|
42
|
+
color?: import("../../types/notification").NotificationColor;
|
|
43
43
|
ui?: any;
|
|
44
44
|
};
|
|
45
45
|
remove: (id: string) => void;
|
|
@@ -9,7 +9,7 @@ type InputProps = {
|
|
|
9
9
|
export declare const useFormGroup: (inputProps?: InputProps, config?: any) => {
|
|
10
10
|
inputId: import("vue").ComputedRef<string>;
|
|
11
11
|
name: import("vue").ComputedRef<string>;
|
|
12
|
-
size: import("vue").ComputedRef<
|
|
12
|
+
size: import("vue").ComputedRef<any>;
|
|
13
13
|
color: import("vue").ComputedRef<string>;
|
|
14
14
|
emitFormBlur: () => void;
|
|
15
15
|
emitFormInput: import("@vueuse/shared").PromisifyFn<() => void>;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { inject, ref, computed } from "vue";
|
|
2
2
|
import { useDebounceFn } from "@vueuse/core";
|
|
3
|
-
import { mergeConfig } from "../utils/index.js";
|
|
4
|
-
import appConfig from "#build/app.config";
|
|
5
|
-
import { formGroup } from "#ui/ui.config";
|
|
6
|
-
const formGroupConfig = mergeConfig(appConfig.ui.strategy, appConfig.ui.formGroup, formGroup);
|
|
7
3
|
export const useFormGroup = (inputProps, config) => {
|
|
8
4
|
const formBus = inject("form-events", void 0);
|
|
9
|
-
const
|
|
5
|
+
const formGroup = inject("form-group", void 0);
|
|
10
6
|
const formInputs = inject("form-inputs", void 0);
|
|
11
|
-
if (
|
|
7
|
+
if (formGroup) {
|
|
12
8
|
if (inputProps?.id) {
|
|
13
|
-
|
|
9
|
+
formGroup.inputId.value = inputProps?.id;
|
|
14
10
|
}
|
|
15
11
|
if (formInputs) {
|
|
16
|
-
formInputs.value[
|
|
12
|
+
formInputs.value[formGroup.name.value] = formGroup.inputId.value;
|
|
17
13
|
}
|
|
18
14
|
}
|
|
19
15
|
const blurred = ref(false);
|
|
@@ -23,25 +19,25 @@ export const useFormGroup = (inputProps, config) => {
|
|
|
23
19
|
}
|
|
24
20
|
}
|
|
25
21
|
function emitFormBlur() {
|
|
26
|
-
emitFormEvent("blur",
|
|
22
|
+
emitFormEvent("blur", formGroup?.name.value);
|
|
27
23
|
blurred.value = true;
|
|
28
24
|
}
|
|
29
25
|
function emitFormChange() {
|
|
30
|
-
emitFormEvent("change",
|
|
26
|
+
emitFormEvent("change", formGroup?.name.value);
|
|
31
27
|
}
|
|
32
28
|
const emitFormInput = useDebounceFn(() => {
|
|
33
|
-
if (blurred.value ||
|
|
34
|
-
emitFormEvent("input",
|
|
29
|
+
if (blurred.value || formGroup?.eagerValidation.value) {
|
|
30
|
+
emitFormEvent("input", formGroup?.name.value);
|
|
35
31
|
}
|
|
36
32
|
}, 300);
|
|
37
33
|
return {
|
|
38
|
-
inputId: computed(() => inputProps?.id ??
|
|
39
|
-
name: computed(() => inputProps?.name ??
|
|
34
|
+
inputId: computed(() => inputProps?.id ?? formGroup?.inputId.value),
|
|
35
|
+
name: computed(() => inputProps?.name ?? formGroup?.name.value),
|
|
40
36
|
size: computed(() => {
|
|
41
|
-
const formGroupSize = config.size[
|
|
42
|
-
return inputProps?.size ?? formGroupSize ??
|
|
37
|
+
const formGroupSize = config.size[formGroup?.size.value] ? formGroup?.size.value : null;
|
|
38
|
+
return inputProps?.size ?? formGroupSize ?? config.default?.size;
|
|
43
39
|
}),
|
|
44
|
-
color: computed(() =>
|
|
40
|
+
color: computed(() => formGroup?.error?.value ? "red" : inputProps?.color),
|
|
45
41
|
emitFormBlur,
|
|
46
42
|
emitFormInput,
|
|
47
43
|
emitFormChange
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
|
-
import type { Strategy } from '../types.js';
|
|
2
|
+
import type { Strategy } from '../types/index.js';
|
|
3
3
|
export declare const useUI: <T>(key: any, $ui?: Ref<(Partial<T> & {
|
|
4
4
|
strategy?: Strategy;
|
|
5
5
|
}) | undefined>, $config?: Ref<T> | T, $wrapperClass?: Ref<string>, withAppConfig?: boolean) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
|
-
import { hexToRgb } from "../utils/index.js";
|
|
2
|
+
import { get, hexToRgb } from "../utils/index.js";
|
|
3
3
|
import { defineNuxtPlugin, useAppConfig, useNuxtApp, useHead } from "#imports";
|
|
4
4
|
import colors from "#tailwind-config/theme/colors";
|
|
5
5
|
export default defineNuxtPlugin(() => {
|
|
6
6
|
const appConfig = useAppConfig();
|
|
7
7
|
const nuxtApp = useNuxtApp();
|
|
8
8
|
const root = computed(() => {
|
|
9
|
-
const primary = colors
|
|
10
|
-
const gray = colors
|
|
9
|
+
const primary = get(colors, appConfig.ui.primary);
|
|
10
|
+
const gray = get(colors, appConfig.ui.gray);
|
|
11
11
|
if (!primary) {
|
|
12
12
|
console.warn(`[@nuxt/ui] Primary color '${appConfig.ui.primary}' not found in Tailwind config`);
|
|
13
13
|
}
|
|
@@ -16,193 +16,193 @@ const colorsToExclude = [
|
|
|
16
16
|
];
|
|
17
17
|
const safelistByComponent = {
|
|
18
18
|
alert: (colorsAsRegex2) => [{
|
|
19
|
-
pattern:
|
|
19
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-50$`)
|
|
20
20
|
}, {
|
|
21
|
-
pattern:
|
|
21
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
|
|
22
22
|
variants: ["dark"]
|
|
23
23
|
}, {
|
|
24
|
-
pattern:
|
|
24
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
|
|
25
25
|
}, {
|
|
26
|
-
pattern:
|
|
26
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
27
27
|
variants: ["dark"]
|
|
28
28
|
}, {
|
|
29
|
-
pattern:
|
|
29
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
|
|
30
30
|
}, {
|
|
31
|
-
pattern:
|
|
31
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
|
|
32
32
|
variants: ["dark"]
|
|
33
33
|
}, {
|
|
34
|
-
pattern:
|
|
34
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`)
|
|
35
35
|
}],
|
|
36
36
|
avatar: (colorsAsRegex2) => [{
|
|
37
|
-
pattern:
|
|
37
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
|
|
38
38
|
variants: ["dark"]
|
|
39
39
|
}, {
|
|
40
|
-
pattern:
|
|
40
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
|
|
41
41
|
}],
|
|
42
42
|
badge: (colorsAsRegex2) => [{
|
|
43
|
-
pattern:
|
|
43
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-50$`)
|
|
44
44
|
}, {
|
|
45
|
-
pattern:
|
|
45
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
|
|
46
46
|
variants: ["dark"]
|
|
47
47
|
}, {
|
|
48
|
-
pattern:
|
|
48
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
|
|
49
49
|
}, {
|
|
50
|
-
pattern:
|
|
50
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
51
51
|
variants: ["dark"]
|
|
52
52
|
}, {
|
|
53
|
-
pattern:
|
|
53
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
|
|
54
54
|
}, {
|
|
55
|
-
pattern:
|
|
55
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
|
|
56
56
|
variants: ["dark"]
|
|
57
57
|
}, {
|
|
58
|
-
pattern:
|
|
58
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`)
|
|
59
59
|
}],
|
|
60
60
|
button: (colorsAsRegex2) => [{
|
|
61
|
-
pattern:
|
|
61
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-50$`),
|
|
62
62
|
variants: ["hover", "disabled"]
|
|
63
63
|
}, {
|
|
64
|
-
pattern:
|
|
64
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-100$`),
|
|
65
65
|
variants: ["hover"]
|
|
66
66
|
}, {
|
|
67
|
-
pattern:
|
|
67
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
|
|
68
68
|
variants: ["dark", "dark:disabled"]
|
|
69
69
|
}, {
|
|
70
|
-
pattern:
|
|
70
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`),
|
|
71
71
|
variants: ["disabled", "dark:hover"]
|
|
72
72
|
}, {
|
|
73
|
-
pattern:
|
|
73
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-600$`),
|
|
74
74
|
variants: ["hover"]
|
|
75
75
|
}, {
|
|
76
|
-
pattern:
|
|
76
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-900$`),
|
|
77
77
|
variants: ["dark:hover"]
|
|
78
78
|
}, {
|
|
79
|
-
pattern:
|
|
79
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-950$`),
|
|
80
80
|
variants: ["dark", "dark:hover", "dark:disabled"]
|
|
81
81
|
}, {
|
|
82
|
-
pattern:
|
|
82
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
83
83
|
variants: ["dark", "dark:disabled"]
|
|
84
84
|
}, {
|
|
85
|
-
pattern:
|
|
85
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`),
|
|
86
86
|
variants: ["dark:hover", "disabled"]
|
|
87
87
|
}, {
|
|
88
|
-
pattern:
|
|
88
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-600$`),
|
|
89
89
|
variants: ["hover"]
|
|
90
90
|
}, {
|
|
91
|
-
pattern:
|
|
91
|
+
pattern: RegExp(`^outline-(${colorsAsRegex2})-400$`),
|
|
92
92
|
variants: ["dark:focus-visible"]
|
|
93
93
|
}, {
|
|
94
|
-
pattern:
|
|
94
|
+
pattern: RegExp(`^outline-(${colorsAsRegex2})-500$`),
|
|
95
95
|
variants: ["focus-visible"]
|
|
96
96
|
}, {
|
|
97
|
-
pattern:
|
|
97
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
|
|
98
98
|
variants: ["dark:focus-visible"]
|
|
99
99
|
}, {
|
|
100
|
-
pattern:
|
|
100
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
|
|
101
101
|
variants: ["focus-visible"]
|
|
102
102
|
}],
|
|
103
103
|
input: (colorsAsRegex2) => [{
|
|
104
|
-
pattern:
|
|
104
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
105
105
|
variants: ["dark"]
|
|
106
106
|
}, {
|
|
107
|
-
pattern:
|
|
107
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
|
|
108
108
|
}, {
|
|
109
|
-
pattern:
|
|
109
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
|
|
110
110
|
variants: ["dark", "dark:focus"]
|
|
111
111
|
}, {
|
|
112
|
-
pattern:
|
|
112
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
|
|
113
113
|
variants: ["focus"]
|
|
114
114
|
}],
|
|
115
115
|
radio: (colorsAsRegex2) => [{
|
|
116
|
-
pattern:
|
|
116
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
117
117
|
variants: ["dark"]
|
|
118
118
|
}, {
|
|
119
|
-
pattern:
|
|
119
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
|
|
120
120
|
}, {
|
|
121
|
-
pattern:
|
|
121
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
|
|
122
122
|
variants: ["dark:focus-visible"]
|
|
123
123
|
}, {
|
|
124
|
-
pattern:
|
|
124
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
|
|
125
125
|
variants: ["focus-visible"]
|
|
126
126
|
}],
|
|
127
127
|
checkbox: (colorsAsRegex2) => [{
|
|
128
|
-
pattern:
|
|
128
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
129
129
|
variants: ["dark"]
|
|
130
130
|
}, {
|
|
131
|
-
pattern:
|
|
131
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
|
|
132
132
|
}, {
|
|
133
|
-
pattern:
|
|
133
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
|
|
134
134
|
variants: ["dark:focus-visible"]
|
|
135
135
|
}, {
|
|
136
|
-
pattern:
|
|
136
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
|
|
137
137
|
variants: ["focus-visible"]
|
|
138
138
|
}],
|
|
139
139
|
toggle: (colorsAsRegex2) => [{
|
|
140
|
-
pattern:
|
|
140
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
|
|
141
141
|
variants: ["dark"]
|
|
142
142
|
}, {
|
|
143
|
-
pattern:
|
|
143
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
|
|
144
144
|
}, {
|
|
145
|
-
pattern:
|
|
145
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
146
146
|
variants: ["dark"]
|
|
147
147
|
}, {
|
|
148
|
-
pattern:
|
|
148
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
|
|
149
149
|
}, {
|
|
150
|
-
pattern:
|
|
150
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
|
|
151
151
|
variants: ["dark:focus-visible"]
|
|
152
152
|
}, {
|
|
153
|
-
pattern:
|
|
153
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
|
|
154
154
|
variants: ["focus-visible"]
|
|
155
155
|
}],
|
|
156
156
|
range: (colorsAsRegex2) => [{
|
|
157
|
-
pattern:
|
|
157
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
|
|
158
158
|
variants: ["dark"]
|
|
159
159
|
}, {
|
|
160
|
-
pattern:
|
|
160
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
|
|
161
161
|
}, {
|
|
162
|
-
pattern:
|
|
162
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
163
163
|
variants: ["dark"]
|
|
164
164
|
}, {
|
|
165
|
-
pattern:
|
|
165
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
|
|
166
166
|
}, {
|
|
167
|
-
pattern:
|
|
167
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-400$`),
|
|
168
168
|
variants: ["dark:focus-visible"]
|
|
169
169
|
}, {
|
|
170
|
-
pattern:
|
|
170
|
+
pattern: RegExp(`^ring-(${colorsAsRegex2})-500$`),
|
|
171
171
|
variants: ["focus-visible"]
|
|
172
172
|
}],
|
|
173
173
|
progress: (colorsAsRegex2) => [{
|
|
174
|
-
pattern:
|
|
174
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
175
175
|
variants: ["dark"]
|
|
176
176
|
}, {
|
|
177
|
-
pattern:
|
|
177
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
|
|
178
178
|
}],
|
|
179
179
|
meter: (colorsAsRegex2) => [{
|
|
180
|
-
pattern:
|
|
180
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
|
|
181
181
|
variants: ["dark"]
|
|
182
182
|
}, {
|
|
183
|
-
pattern:
|
|
183
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
|
|
184
184
|
}, {
|
|
185
|
-
pattern:
|
|
185
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
186
186
|
variants: ["dark"]
|
|
187
187
|
}, {
|
|
188
|
-
pattern:
|
|
188
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
|
|
189
189
|
}],
|
|
190
190
|
notification: (colorsAsRegex2) => [{
|
|
191
|
-
pattern:
|
|
191
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
|
|
192
192
|
variants: ["dark"]
|
|
193
193
|
}, {
|
|
194
|
-
pattern:
|
|
194
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
|
|
195
195
|
}, {
|
|
196
|
-
pattern:
|
|
196
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-400$`),
|
|
197
197
|
variants: ["dark"]
|
|
198
198
|
}, {
|
|
199
|
-
pattern:
|
|
199
|
+
pattern: RegExp(`^text-(${colorsAsRegex2})-500$`)
|
|
200
200
|
}],
|
|
201
201
|
chip: (colorsAsRegex2) => [{
|
|
202
|
-
pattern:
|
|
202
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-400$`),
|
|
203
203
|
variants: ["dark"]
|
|
204
204
|
}, {
|
|
205
|
-
pattern:
|
|
205
|
+
pattern: RegExp(`^bg-(${colorsAsRegex2})-500$`)
|
|
206
206
|
}]
|
|
207
207
|
};
|
|
208
208
|
const safelistComponentAliasesMap = {
|
|
@@ -289,7 +289,15 @@ export const customSafelistExtractor = (prefix, content, colors, safelistColors)
|
|
|
289
289
|
const matches2 = group.pattern.source.match(/\(([^)]+)\)/g);
|
|
290
290
|
return matches2.map((match2) => {
|
|
291
291
|
const colorOptions = match2.substring(1, match2.length - 1).split("|");
|
|
292
|
-
return colorOptions.map(
|
|
292
|
+
return colorOptions.map(
|
|
293
|
+
(color2) => {
|
|
294
|
+
const classesExtracted = group.pattern.source.replace(match2, color2).replace("^", "").replace("$", "");
|
|
295
|
+
if (variant) {
|
|
296
|
+
return `${variant}:${classesExtracted}`;
|
|
297
|
+
}
|
|
298
|
+
return classesExtracted;
|
|
299
|
+
}
|
|
300
|
+
);
|
|
293
301
|
}).flat();
|
|
294
302
|
});
|
|
295
303
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Strategy } from '../types.js';
|
|
1
|
+
import type { Strategy } from '../types/index.js';
|
|
2
2
|
export declare function mergeConfig<T>(strategy: Strategy, ...configs: any[]): T;
|
|
3
3
|
export declare function hexToRgb(hex: string): string;
|
|
4
4
|
export declare function getSlotsChildren(slots: any): any;
|