@bitrix24/b24ui-nuxt 0.3.3 → 0.3.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/.nuxt/b24ui/container.ts +1 -1
- package/.nuxt/b24ui/index.ts +1 -0
- package/.nuxt/b24ui/slideover.ts +101 -0
- package/dist/meta.cjs +467 -4
- package/dist/meta.d.cts +467 -4
- package/dist/meta.d.mts +467 -4
- package/dist/meta.d.ts +467 -4
- package/dist/meta.mjs +467 -4
- package/dist/module.cjs +1 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -2
- package/dist/runtime/components/App.vue +3 -4
- package/dist/runtime/components/Modal.vue +4 -2
- package/dist/runtime/components/OverlayProvider.vue +29 -0
- package/dist/runtime/components/Slideover.vue +193 -0
- package/dist/runtime/composables/useOverlay.d.ts +30 -0
- package/dist/runtime/composables/useOverlay.js +71 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/vue/composables/useAppConfig.d.ts +1 -0
- package/dist/runtime/vue/composables/useAppConfig.js +2 -0
- package/dist/runtime/vue/stubs.d.ts +10 -0
- package/dist/runtime/vue/stubs.js +22 -0
- package/dist/shared/{b24ui-nuxt.ngV6AJEg.cjs → b24ui-nuxt.BpFAFOHo.cjs} +120 -1
- package/dist/shared/{b24ui-nuxt.BTln9cW-.mjs → b24ui-nuxt.BqTJ-9uP.mjs} +120 -1
- package/dist/unplugin.cjs +3 -3
- package/dist/unplugin.mjs +3 -3
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
- package/dist/runtime/components/ModalProvider.vue +0 -12
- package/dist/runtime/composables/useModal.d.ts +0 -17
- package/dist/runtime/composables/useModal.js +0 -46
- package/dist/runtime/plugins/modal.d.ts +0 -2
- package/dist/runtime/plugins/modal.js +0 -10
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'reka-ui'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/b24ui/slideover'
|
|
7
|
+
import { tv } from '../utils/tv'
|
|
8
|
+
import type { ButtonProps, IconComponent } from '../types'
|
|
9
|
+
|
|
10
|
+
const appConfigSlideover = _appConfig as AppConfig & { b24ui: { slideover: Partial<typeof theme> } }
|
|
11
|
+
|
|
12
|
+
const slideover = tv({ extend: tv(theme), ...(appConfigSlideover.b24ui?.slideover || {}) })
|
|
13
|
+
|
|
14
|
+
type SlideoverVariants = VariantProps<typeof slideover>
|
|
15
|
+
|
|
16
|
+
export interface SlideoverProps extends DialogRootProps {
|
|
17
|
+
title?: string
|
|
18
|
+
description?: string
|
|
19
|
+
/** The content of the slideover. */
|
|
20
|
+
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
21
|
+
/**
|
|
22
|
+
* Render an overlay behind the slideover.
|
|
23
|
+
* @defaultValue true
|
|
24
|
+
*/
|
|
25
|
+
overlay?: boolean
|
|
26
|
+
/**
|
|
27
|
+
* Animate the slideover when opening or closing.
|
|
28
|
+
* @defaultValue true
|
|
29
|
+
*/
|
|
30
|
+
transition?: boolean
|
|
31
|
+
side?: SlideoverVariants['side']
|
|
32
|
+
/**
|
|
33
|
+
* Render the slideover in a portal.
|
|
34
|
+
* @defaultValue true
|
|
35
|
+
*/
|
|
36
|
+
portal?: boolean
|
|
37
|
+
/**
|
|
38
|
+
* Display a close button to dismiss the slideover.
|
|
39
|
+
* `{ color: 'primary' }`{lang="ts"} for `left`, `right`
|
|
40
|
+
* `{ color: 'link' }`{lang="ts"} for `top`, `bottom`
|
|
41
|
+
* @defaultValue true
|
|
42
|
+
*/
|
|
43
|
+
close?: boolean | Partial<ButtonProps>
|
|
44
|
+
/**
|
|
45
|
+
* The icon displayed in the close button.
|
|
46
|
+
* @defaultValue icons.close
|
|
47
|
+
*/
|
|
48
|
+
closeIcon?: IconComponent
|
|
49
|
+
/**
|
|
50
|
+
* When `false`, the slideover will not close when clicking outside or pressing escape.
|
|
51
|
+
* @defaultValue true
|
|
52
|
+
*/
|
|
53
|
+
dismissible?: boolean
|
|
54
|
+
scrollbarThin?: boolean
|
|
55
|
+
class?: any
|
|
56
|
+
b24ui?: Partial<typeof slideover.slots>
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface SlideoverEmits extends DialogRootEmits {
|
|
60
|
+
'after:leave': []
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface SlideoverSlots {
|
|
64
|
+
default(props: { open: boolean }): any
|
|
65
|
+
content(props?: {}): any
|
|
66
|
+
header(props?: {}): any
|
|
67
|
+
title(props?: {}): any
|
|
68
|
+
description(props?: {}): any
|
|
69
|
+
close(props: { b24ui: any }): any
|
|
70
|
+
body(props?: {}): any
|
|
71
|
+
footer(props?: {}): any
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<script setup lang="ts">
|
|
76
|
+
import { computed, toRef } from 'vue'
|
|
77
|
+
import { DialogRoot, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose, VisuallyHidden, useForwardPropsEmits } from 'reka-ui'
|
|
78
|
+
import { reactivePick } from '@vueuse/core'
|
|
79
|
+
import { useLocale } from '../composables/useLocale'
|
|
80
|
+
import icons from '../dictionary/icons'
|
|
81
|
+
import B24Button from './Button.vue'
|
|
82
|
+
|
|
83
|
+
const props = withDefaults(defineProps<SlideoverProps>(), {
|
|
84
|
+
close: true,
|
|
85
|
+
portal: true,
|
|
86
|
+
overlay: true,
|
|
87
|
+
transition: true,
|
|
88
|
+
modal: true,
|
|
89
|
+
dismissible: true,
|
|
90
|
+
side: 'right',
|
|
91
|
+
scrollbarThin: true
|
|
92
|
+
})
|
|
93
|
+
const emits = defineEmits<SlideoverEmits>()
|
|
94
|
+
const slots = defineSlots<SlideoverSlots>()
|
|
95
|
+
|
|
96
|
+
const { t } = useLocale()
|
|
97
|
+
|
|
98
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'open', 'defaultOpen', 'modal'), emits)
|
|
99
|
+
const contentProps = toRef(() => props.content)
|
|
100
|
+
const contentEvents = computed(() => {
|
|
101
|
+
if (!props.dismissible) {
|
|
102
|
+
return {
|
|
103
|
+
pointerDownOutside: (e: Event) => e.preventDefault(),
|
|
104
|
+
interactOutside: (e: Event) => e.preventDefault(),
|
|
105
|
+
escapeKeyDown: (e: Event) => e.preventDefault(),
|
|
106
|
+
closeAutoFocus: (e: Event) => e.preventDefault()
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
closeAutoFocus: (e: Event) => e.preventDefault()
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
const b24ui = computed(() => slideover({
|
|
116
|
+
transition: props.transition,
|
|
117
|
+
side: props.side
|
|
118
|
+
}))
|
|
119
|
+
</script>
|
|
120
|
+
|
|
121
|
+
<template>
|
|
122
|
+
<DialogRoot v-slot="{ open }" v-bind="rootProps">
|
|
123
|
+
<DialogTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
124
|
+
<slot :open="open" />
|
|
125
|
+
</DialogTrigger>
|
|
126
|
+
|
|
127
|
+
<DialogPortal :disabled="!portal">
|
|
128
|
+
<DialogOverlay v-if="overlay" :class="b24ui.overlay({ class: props.b24ui?.overlay })" />
|
|
129
|
+
|
|
130
|
+
<DialogContent :data-side="side" :class="b24ui.content({ class: [!slots.default && props.class, props.b24ui?.content] })" v-bind="contentProps" @after-leave="emits('after:leave')" v-on="contentEvents">
|
|
131
|
+
<VisuallyHidden v-if="!!slots.content && ((title || !!slots.title) || (description || !!slots.description))">
|
|
132
|
+
<DialogTitle v-if="title || !!slots.title">
|
|
133
|
+
<slot name="title">
|
|
134
|
+
{{ title }}
|
|
135
|
+
</slot>
|
|
136
|
+
</DialogTitle>
|
|
137
|
+
|
|
138
|
+
<DialogDescription v-if="description || !!slots.description">
|
|
139
|
+
<slot name="description">
|
|
140
|
+
{{ description }}
|
|
141
|
+
</slot>
|
|
142
|
+
</DialogDescription>
|
|
143
|
+
</VisuallyHidden>
|
|
144
|
+
|
|
145
|
+
<slot name="content">
|
|
146
|
+
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (close || !!slots.close)" :class="b24ui.header({ class: props.b24ui?.header })">
|
|
147
|
+
<slot name="header">
|
|
148
|
+
<div :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
|
|
149
|
+
<DialogTitle v-if="title || !!slots.title" :class="b24ui.title({ class: props.b24ui?.title })">
|
|
150
|
+
<slot name="title">
|
|
151
|
+
{{ title }}
|
|
152
|
+
</slot>
|
|
153
|
+
</DialogTitle>
|
|
154
|
+
|
|
155
|
+
<DialogDescription v-if="description || !!slots.description" :class="b24ui.description({ class: props.b24ui?.description })">
|
|
156
|
+
<slot name="description">
|
|
157
|
+
{{ description }}
|
|
158
|
+
</slot>
|
|
159
|
+
</DialogDescription>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<DialogClose as-child>
|
|
163
|
+
<slot name="close" :b24ui="b24ui">
|
|
164
|
+
<B24Button
|
|
165
|
+
v-if="close"
|
|
166
|
+
:icon="closeIcon || icons.close"
|
|
167
|
+
size="md"
|
|
168
|
+
class="group"
|
|
169
|
+
:color="['left', 'right'].includes(props?.side) ? 'primary' : 'link'"
|
|
170
|
+
:aria-label="t('slideover.close')"
|
|
171
|
+
:b24ui="{
|
|
172
|
+
leadingIcon: ['left', 'right'].includes(props?.side) ? 'group-hover:rounded-full group-hover:border-1 group-hover:border-current' : ''
|
|
173
|
+
}"
|
|
174
|
+
v-bind="(typeof close === 'object' ? close as Partial<ButtonProps> : {})"
|
|
175
|
+
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
176
|
+
/>
|
|
177
|
+
</slot>
|
|
178
|
+
</DialogClose>
|
|
179
|
+
</slot>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<div :class="b24ui.body({ class: props.b24ui?.body, scrollbarThin: Boolean(props.scrollbarThin) })">
|
|
183
|
+
<slot name="body" />
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<div v-if="!!slots.footer" :class="b24ui.footer({ class: props.b24ui?.footer })">
|
|
187
|
+
<slot name="footer" />
|
|
188
|
+
</div>
|
|
189
|
+
</slot>
|
|
190
|
+
</DialogContent>
|
|
191
|
+
</DialogPortal>
|
|
192
|
+
</DialogRoot>
|
|
193
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { ComponentProps } from 'vue-component-type-helpers';
|
|
3
|
+
export type OverlayOptions<OverlayAttrs = Record<string, any>> = {
|
|
4
|
+
defaultOpen?: boolean;
|
|
5
|
+
props?: OverlayAttrs;
|
|
6
|
+
destroyOnClose?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type ManagedOverlayOptionsPrivate<T extends Component> = {
|
|
9
|
+
component?: T;
|
|
10
|
+
id: symbol;
|
|
11
|
+
isMounted: boolean;
|
|
12
|
+
modelValue: boolean;
|
|
13
|
+
resolvePromise?: (value: unknown) => void;
|
|
14
|
+
};
|
|
15
|
+
export type Overlay = OverlayOptions<Component> & ManagedOverlayOptionsPrivate<Component>;
|
|
16
|
+
interface OverlayInstance<T> {
|
|
17
|
+
open: (props?: ComponentProps<T>) => Promise<any>;
|
|
18
|
+
close: (value?: any) => void;
|
|
19
|
+
patch: (props: Partial<ComponentProps<T>>) => void;
|
|
20
|
+
}
|
|
21
|
+
declare function _useOverlay(): {
|
|
22
|
+
overlays: import("vue").ShallowReactive<Overlay[]>;
|
|
23
|
+
open: <T extends Component>(id: symbol, props?: ComponentProps<T>) => Promise<any>;
|
|
24
|
+
close: (id: symbol, value?: any) => void;
|
|
25
|
+
create: <T extends Component>(component: T, _options?: OverlayOptions<ComponentProps<T>>) => OverlayInstance<T>;
|
|
26
|
+
patch: <T extends Component>(id: symbol, props: Partial<ComponentProps<T>>) => void;
|
|
27
|
+
unMount: (id: symbol) => void;
|
|
28
|
+
};
|
|
29
|
+
export declare const useOverlay: typeof _useOverlay;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { shallowReactive, reactive, markRaw } from "vue";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
function _useOverlay() {
|
|
4
|
+
const overlays = shallowReactive([]);
|
|
5
|
+
const create = (component, _options) => {
|
|
6
|
+
const { props, defaultOpen, destroyOnClose } = _options || {};
|
|
7
|
+
const options = reactive({
|
|
8
|
+
id: Symbol(import.meta.dev ? "useOverlay" : ""),
|
|
9
|
+
modelValue: !!defaultOpen,
|
|
10
|
+
component: markRaw(component),
|
|
11
|
+
isMounted: !!defaultOpen,
|
|
12
|
+
destroyOnClose: !!destroyOnClose,
|
|
13
|
+
props: props || {}
|
|
14
|
+
});
|
|
15
|
+
overlays.push(options);
|
|
16
|
+
return {
|
|
17
|
+
open: (props2) => open(options.id, props2),
|
|
18
|
+
close: (value) => close(options.id, value),
|
|
19
|
+
patch: (props2) => patch(options.id, props2)
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
const open = (id, props) => {
|
|
23
|
+
const overlay = getOverlay(id);
|
|
24
|
+
if (props) {
|
|
25
|
+
patch(overlay.id, props);
|
|
26
|
+
}
|
|
27
|
+
overlay.modelValue = true;
|
|
28
|
+
overlay.isMounted = true;
|
|
29
|
+
return new Promise((resolve) => {
|
|
30
|
+
overlay.resolvePromise = resolve;
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const close = (id, value) => {
|
|
34
|
+
const overlay = getOverlay(id);
|
|
35
|
+
overlay.modelValue = false;
|
|
36
|
+
if (overlay.resolvePromise) {
|
|
37
|
+
overlay.resolvePromise(value);
|
|
38
|
+
overlay.resolvePromise = void 0;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const unMount = (id) => {
|
|
42
|
+
const overlay = getOverlay(id);
|
|
43
|
+
overlay.isMounted = false;
|
|
44
|
+
if (overlay.destroyOnClose) {
|
|
45
|
+
const index = overlays.findIndex((overlay2) => overlay2.id === id);
|
|
46
|
+
overlays.splice(index, 1);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const patch = (id, props) => {
|
|
50
|
+
const overlay = getOverlay(id);
|
|
51
|
+
Object.entries(props).forEach(([key, value]) => {
|
|
52
|
+
overlay.props[key] = value;
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const getOverlay = (id) => {
|
|
56
|
+
const overlay = overlays.find((overlay2) => overlay2.id === id);
|
|
57
|
+
if (!overlay) {
|
|
58
|
+
throw new Error("Overlay not found");
|
|
59
|
+
}
|
|
60
|
+
return overlay;
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
overlays,
|
|
64
|
+
open,
|
|
65
|
+
close,
|
|
66
|
+
create,
|
|
67
|
+
patch,
|
|
68
|
+
unMount
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export const useOverlay = createSharedComposable(_useOverlay);
|
|
@@ -27,6 +27,7 @@ export * from '../components/Select.vue';
|
|
|
27
27
|
export * from '../components/SelectMenu.vue';
|
|
28
28
|
export * from '../components/Separator.vue';
|
|
29
29
|
export * from '../components/Skeleton.vue';
|
|
30
|
+
export * from '../components/Slideover.vue';
|
|
30
31
|
export * from '../components/Switch.vue';
|
|
31
32
|
export * from '../components/Tabs.vue';
|
|
32
33
|
export * from '../components/Textarea.vue';
|
|
@@ -27,6 +27,7 @@ export * from "../components/Select.vue";
|
|
|
27
27
|
export * from "../components/SelectMenu.vue";
|
|
28
28
|
export * from "../components/Separator.vue";
|
|
29
29
|
export * from "../components/Skeleton.vue";
|
|
30
|
+
export * from "../components/Slideover.vue";
|
|
30
31
|
export * from "../components/Switch.vue";
|
|
31
32
|
export * from "../components/Tabs.vue";
|
|
32
33
|
export * from "../components/Textarea.vue";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useAppConfig: () => any;
|
|
@@ -5,6 +5,16 @@ export { useRoute, useRouter } from 'vue-router';
|
|
|
5
5
|
export { defineShortcuts } from '../composables/defineShortcuts';
|
|
6
6
|
export { useLocale } from '../composables/useLocale';
|
|
7
7
|
export { useConfetti } from '../composables/useConfetti';
|
|
8
|
+
export { useOverlay } from '../composables/useOverlay';
|
|
9
|
+
export declare const useColorMode: () => {
|
|
10
|
+
forced: boolean;
|
|
11
|
+
preference?: undefined;
|
|
12
|
+
readonly value?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
preference: "light" | "dark" | "system";
|
|
15
|
+
readonly value: import("@vueuse/core").BasicColorMode;
|
|
16
|
+
forced: boolean;
|
|
17
|
+
};
|
|
8
18
|
export declare const useAppConfig: () => any;
|
|
9
19
|
export declare const useCookie: <T = string>(_name: string, _options?: Record<string, any>) => {
|
|
10
20
|
value: Ref<T, T>;
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
2
|
import appConfig from "#build/app.config";
|
|
3
|
+
import { useColorMode as useColorModeVueUse } from "@vueuse/core";
|
|
3
4
|
export { useHead } from "@unhead/vue";
|
|
4
5
|
export { useRoute, useRouter } from "vue-router";
|
|
5
6
|
export { defineShortcuts } from "../composables/defineShortcuts.js";
|
|
6
7
|
export { useLocale } from "../composables/useLocale.js";
|
|
7
8
|
export { useConfetti } from "../composables/useConfetti.js";
|
|
9
|
+
export { useOverlay } from "../composables/useOverlay.js";
|
|
10
|
+
export const useColorMode = () => {
|
|
11
|
+
if (!appConfig.colorMode) {
|
|
12
|
+
return {
|
|
13
|
+
forced: true
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const { store, system } = useColorModeVueUse();
|
|
17
|
+
return {
|
|
18
|
+
get preference() {
|
|
19
|
+
return store.value === "auto" ? "system" : store.value;
|
|
20
|
+
},
|
|
21
|
+
set preference(value) {
|
|
22
|
+
store.value = value === "system" ? "auto" : value;
|
|
23
|
+
},
|
|
24
|
+
get value() {
|
|
25
|
+
return store.value === "auto" ? system.value : store.value;
|
|
26
|
+
},
|
|
27
|
+
forced: false
|
|
28
|
+
};
|
|
29
|
+
};
|
|
8
30
|
export const useAppConfig = () => appConfig;
|
|
9
31
|
export const useCookie = (_name, _options = {}) => {
|
|
10
32
|
const value = ref(null);
|
|
@@ -1510,7 +1510,7 @@ const chip = {
|
|
|
1510
1510
|
};
|
|
1511
1511
|
|
|
1512
1512
|
const container = {
|
|
1513
|
-
base: "max-w-[80rem] mx-auto px-
|
|
1513
|
+
base: "max-w-[80rem] mx-auto px-5"
|
|
1514
1514
|
// max-w-7xl w-full
|
|
1515
1515
|
};
|
|
1516
1516
|
|
|
@@ -4089,6 +4089,124 @@ const skeleton = {
|
|
|
4089
4089
|
base: "animate-pulse rounded-md bg-gray-200 dark:bg-gray-800"
|
|
4090
4090
|
};
|
|
4091
4091
|
|
|
4092
|
+
const slideover = {
|
|
4093
|
+
slots: {
|
|
4094
|
+
overlay: "fixed inset-0 bg-base-950/20 dark:bg-base-950/30",
|
|
4095
|
+
content: [
|
|
4096
|
+
"fixed",
|
|
4097
|
+
"bg-base-50 dark:bg-base-950",
|
|
4098
|
+
// 'divide-y divide-(--ui-border)',
|
|
4099
|
+
"sm:shadow-lg",
|
|
4100
|
+
"flex flex-col focus:outline-none"
|
|
4101
|
+
].join(" "),
|
|
4102
|
+
header: [
|
|
4103
|
+
"mt-4 px-5",
|
|
4104
|
+
"flex items-center gap-1.5"
|
|
4105
|
+
].join(" "),
|
|
4106
|
+
wrapper: "min-h-2xl",
|
|
4107
|
+
body: [
|
|
4108
|
+
"mx-0 mt-2",
|
|
4109
|
+
"flex-1 overflow-y-auto"
|
|
4110
|
+
].join(" "),
|
|
4111
|
+
footer: "bg-white dark:bg-base-950 flex items-center justify-center gap-3 py-4 border-t border-t-1 border-t-base-900/10 dark:border-t-white/20 shadow-top-md p-2 pr-(--scrollbar-width)",
|
|
4112
|
+
title: "font-b24-system font-light text-4.5xl leading-none text-base-900 dark:text-base-150",
|
|
4113
|
+
description: "mt-2 mb-1 text-base-500 dark:text-base-400 text-sm",
|
|
4114
|
+
close: "absolute"
|
|
4115
|
+
},
|
|
4116
|
+
variants: {
|
|
4117
|
+
side: {
|
|
4118
|
+
top: {
|
|
4119
|
+
content: "inset-x-0 top-0 max-h-full"
|
|
4120
|
+
},
|
|
4121
|
+
right: {
|
|
4122
|
+
content: "right-0 inset-y-0 w-full max-w-[28rem]"
|
|
4123
|
+
},
|
|
4124
|
+
bottom: {
|
|
4125
|
+
content: "inset-x-0 bottom-0 max-h-full"
|
|
4126
|
+
},
|
|
4127
|
+
left: {
|
|
4128
|
+
content: "left-0 inset-y-0 w-full max-w-[28rem]"
|
|
4129
|
+
}
|
|
4130
|
+
},
|
|
4131
|
+
transition: {
|
|
4132
|
+
true: {
|
|
4133
|
+
overlay: "data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"
|
|
4134
|
+
}
|
|
4135
|
+
},
|
|
4136
|
+
scrollbarThin: {
|
|
4137
|
+
true: {
|
|
4138
|
+
body: "scrollbar-thin"
|
|
4139
|
+
}
|
|
4140
|
+
}
|
|
4141
|
+
},
|
|
4142
|
+
compoundVariants: [
|
|
4143
|
+
// region close ////
|
|
4144
|
+
// close: 'absolute ' ////
|
|
4145
|
+
{
|
|
4146
|
+
side: "right",
|
|
4147
|
+
class: {
|
|
4148
|
+
close: [
|
|
4149
|
+
"pl-1.5 pr-2.5",
|
|
4150
|
+
"top-3 -translate-x-full left-0",
|
|
4151
|
+
"rounded-l-full"
|
|
4152
|
+
].join(" ")
|
|
4153
|
+
}
|
|
4154
|
+
},
|
|
4155
|
+
{
|
|
4156
|
+
side: "left",
|
|
4157
|
+
class: {
|
|
4158
|
+
close: [
|
|
4159
|
+
"pr-1.5 pl-2.5",
|
|
4160
|
+
"top-3 translate-x-full right-0",
|
|
4161
|
+
"rounded-r-full"
|
|
4162
|
+
].join(" ")
|
|
4163
|
+
}
|
|
4164
|
+
},
|
|
4165
|
+
{
|
|
4166
|
+
side: ["top", "bottom"],
|
|
4167
|
+
class: {
|
|
4168
|
+
close: [
|
|
4169
|
+
"top-4 end-4"
|
|
4170
|
+
].join(" ")
|
|
4171
|
+
}
|
|
4172
|
+
},
|
|
4173
|
+
// endregion ////
|
|
4174
|
+
// region transition ////
|
|
4175
|
+
{
|
|
4176
|
+
transition: true,
|
|
4177
|
+
side: "top",
|
|
4178
|
+
class: {
|
|
4179
|
+
content: "data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"
|
|
4180
|
+
}
|
|
4181
|
+
},
|
|
4182
|
+
{
|
|
4183
|
+
transition: true,
|
|
4184
|
+
side: "right",
|
|
4185
|
+
class: {
|
|
4186
|
+
content: "data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"
|
|
4187
|
+
}
|
|
4188
|
+
},
|
|
4189
|
+
{
|
|
4190
|
+
transition: true,
|
|
4191
|
+
side: "bottom",
|
|
4192
|
+
class: {
|
|
4193
|
+
content: "data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"
|
|
4194
|
+
}
|
|
4195
|
+
},
|
|
4196
|
+
{
|
|
4197
|
+
transition: true,
|
|
4198
|
+
side: "left",
|
|
4199
|
+
class: {
|
|
4200
|
+
content: "data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
],
|
|
4204
|
+
defaultVariants: {
|
|
4205
|
+
side: "right",
|
|
4206
|
+
scrollbarThin: true
|
|
4207
|
+
}
|
|
4208
|
+
};
|
|
4209
|
+
|
|
4092
4210
|
const _switch = {
|
|
4093
4211
|
slots: {
|
|
4094
4212
|
root: "relative flex items-start",
|
|
@@ -5068,6 +5186,7 @@ const theme = {
|
|
|
5068
5186
|
selectMenu: selectMenu,
|
|
5069
5187
|
separator: separator,
|
|
5070
5188
|
skeleton: skeleton,
|
|
5189
|
+
slideover: slideover,
|
|
5071
5190
|
switch: _switch,
|
|
5072
5191
|
tabs: tabs,
|
|
5073
5192
|
textarea: textarea,
|
|
@@ -1508,7 +1508,7 @@ const chip = {
|
|
|
1508
1508
|
};
|
|
1509
1509
|
|
|
1510
1510
|
const container = {
|
|
1511
|
-
base: "max-w-[80rem] mx-auto px-
|
|
1511
|
+
base: "max-w-[80rem] mx-auto px-5"
|
|
1512
1512
|
// max-w-7xl w-full
|
|
1513
1513
|
};
|
|
1514
1514
|
|
|
@@ -4087,6 +4087,124 @@ const skeleton = {
|
|
|
4087
4087
|
base: "animate-pulse rounded-md bg-gray-200 dark:bg-gray-800"
|
|
4088
4088
|
};
|
|
4089
4089
|
|
|
4090
|
+
const slideover = {
|
|
4091
|
+
slots: {
|
|
4092
|
+
overlay: "fixed inset-0 bg-base-950/20 dark:bg-base-950/30",
|
|
4093
|
+
content: [
|
|
4094
|
+
"fixed",
|
|
4095
|
+
"bg-base-50 dark:bg-base-950",
|
|
4096
|
+
// 'divide-y divide-(--ui-border)',
|
|
4097
|
+
"sm:shadow-lg",
|
|
4098
|
+
"flex flex-col focus:outline-none"
|
|
4099
|
+
].join(" "),
|
|
4100
|
+
header: [
|
|
4101
|
+
"mt-4 px-5",
|
|
4102
|
+
"flex items-center gap-1.5"
|
|
4103
|
+
].join(" "),
|
|
4104
|
+
wrapper: "min-h-2xl",
|
|
4105
|
+
body: [
|
|
4106
|
+
"mx-0 mt-2",
|
|
4107
|
+
"flex-1 overflow-y-auto"
|
|
4108
|
+
].join(" "),
|
|
4109
|
+
footer: "bg-white dark:bg-base-950 flex items-center justify-center gap-3 py-4 border-t border-t-1 border-t-base-900/10 dark:border-t-white/20 shadow-top-md p-2 pr-(--scrollbar-width)",
|
|
4110
|
+
title: "font-b24-system font-light text-4.5xl leading-none text-base-900 dark:text-base-150",
|
|
4111
|
+
description: "mt-2 mb-1 text-base-500 dark:text-base-400 text-sm",
|
|
4112
|
+
close: "absolute"
|
|
4113
|
+
},
|
|
4114
|
+
variants: {
|
|
4115
|
+
side: {
|
|
4116
|
+
top: {
|
|
4117
|
+
content: "inset-x-0 top-0 max-h-full"
|
|
4118
|
+
},
|
|
4119
|
+
right: {
|
|
4120
|
+
content: "right-0 inset-y-0 w-full max-w-[28rem]"
|
|
4121
|
+
},
|
|
4122
|
+
bottom: {
|
|
4123
|
+
content: "inset-x-0 bottom-0 max-h-full"
|
|
4124
|
+
},
|
|
4125
|
+
left: {
|
|
4126
|
+
content: "left-0 inset-y-0 w-full max-w-[28rem]"
|
|
4127
|
+
}
|
|
4128
|
+
},
|
|
4129
|
+
transition: {
|
|
4130
|
+
true: {
|
|
4131
|
+
overlay: "data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"
|
|
4132
|
+
}
|
|
4133
|
+
},
|
|
4134
|
+
scrollbarThin: {
|
|
4135
|
+
true: {
|
|
4136
|
+
body: "scrollbar-thin"
|
|
4137
|
+
}
|
|
4138
|
+
}
|
|
4139
|
+
},
|
|
4140
|
+
compoundVariants: [
|
|
4141
|
+
// region close ////
|
|
4142
|
+
// close: 'absolute ' ////
|
|
4143
|
+
{
|
|
4144
|
+
side: "right",
|
|
4145
|
+
class: {
|
|
4146
|
+
close: [
|
|
4147
|
+
"pl-1.5 pr-2.5",
|
|
4148
|
+
"top-3 -translate-x-full left-0",
|
|
4149
|
+
"rounded-l-full"
|
|
4150
|
+
].join(" ")
|
|
4151
|
+
}
|
|
4152
|
+
},
|
|
4153
|
+
{
|
|
4154
|
+
side: "left",
|
|
4155
|
+
class: {
|
|
4156
|
+
close: [
|
|
4157
|
+
"pr-1.5 pl-2.5",
|
|
4158
|
+
"top-3 translate-x-full right-0",
|
|
4159
|
+
"rounded-r-full"
|
|
4160
|
+
].join(" ")
|
|
4161
|
+
}
|
|
4162
|
+
},
|
|
4163
|
+
{
|
|
4164
|
+
side: ["top", "bottom"],
|
|
4165
|
+
class: {
|
|
4166
|
+
close: [
|
|
4167
|
+
"top-4 end-4"
|
|
4168
|
+
].join(" ")
|
|
4169
|
+
}
|
|
4170
|
+
},
|
|
4171
|
+
// endregion ////
|
|
4172
|
+
// region transition ////
|
|
4173
|
+
{
|
|
4174
|
+
transition: true,
|
|
4175
|
+
side: "top",
|
|
4176
|
+
class: {
|
|
4177
|
+
content: "data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"
|
|
4178
|
+
}
|
|
4179
|
+
},
|
|
4180
|
+
{
|
|
4181
|
+
transition: true,
|
|
4182
|
+
side: "right",
|
|
4183
|
+
class: {
|
|
4184
|
+
content: "data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"
|
|
4185
|
+
}
|
|
4186
|
+
},
|
|
4187
|
+
{
|
|
4188
|
+
transition: true,
|
|
4189
|
+
side: "bottom",
|
|
4190
|
+
class: {
|
|
4191
|
+
content: "data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"
|
|
4192
|
+
}
|
|
4193
|
+
},
|
|
4194
|
+
{
|
|
4195
|
+
transition: true,
|
|
4196
|
+
side: "left",
|
|
4197
|
+
class: {
|
|
4198
|
+
content: "data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"
|
|
4199
|
+
}
|
|
4200
|
+
}
|
|
4201
|
+
],
|
|
4202
|
+
defaultVariants: {
|
|
4203
|
+
side: "right",
|
|
4204
|
+
scrollbarThin: true
|
|
4205
|
+
}
|
|
4206
|
+
};
|
|
4207
|
+
|
|
4090
4208
|
const _switch = {
|
|
4091
4209
|
slots: {
|
|
4092
4210
|
root: "relative flex items-start",
|
|
@@ -5066,6 +5184,7 @@ const theme = {
|
|
|
5066
5184
|
selectMenu: selectMenu,
|
|
5067
5185
|
separator: separator,
|
|
5068
5186
|
skeleton: skeleton,
|
|
5187
|
+
slideover: slideover,
|
|
5069
5188
|
switch: _switch,
|
|
5070
5189
|
tabs: tabs,
|
|
5071
5190
|
textarea: textarea,
|
package/dist/unplugin.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const pathe = require('pathe');
|
|
|
5
5
|
const unplugin = require('unplugin');
|
|
6
6
|
const defu = require('defu');
|
|
7
7
|
const tailwind = require('@tailwindcss/vite');
|
|
8
|
-
const templates = require('./shared/b24ui-nuxt.
|
|
8
|
+
const templates = require('./shared/b24ui-nuxt.BpFAFOHo.cjs');
|
|
9
9
|
const tinyglobby = require('tinyglobby');
|
|
10
10
|
const knitwork = require('knitwork');
|
|
11
11
|
const MagicString = require('magic-string');
|
|
@@ -194,7 +194,7 @@ function Bitrix24EnvironmentPlugin() {
|
|
|
194
194
|
function AutoImportPlugin(options, meta) {
|
|
195
195
|
const pluginOptions = defu.defu(options.autoImport, {
|
|
196
196
|
dts: options.dts ?? true,
|
|
197
|
-
dirs: [pathe.join(runtimeDir, "composables")]
|
|
197
|
+
dirs: [pathe.join(runtimeDir, "composables"), pathe.join(runtimeDir, "vue/composables")]
|
|
198
198
|
});
|
|
199
199
|
return AutoImport__default.raw(pluginOptions, meta);
|
|
200
200
|
}
|
|
@@ -202,7 +202,7 @@ function AutoImportPlugin(options, meta) {
|
|
|
202
202
|
const runtimeDir = pathe.normalize(node_url.fileURLToPath(new URL("./runtime", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('unplugin.cjs', document.baseURI).href)))));
|
|
203
203
|
const Bitrix24UIPlugin = unplugin.createUnplugin((_options = {}, meta) => {
|
|
204
204
|
const options = defu.defu(_options, { devtools: { enabled: false } }, templates.defaultOptions);
|
|
205
|
-
const appConfig = defu.defu({ b24ui: options.b24ui }, { b24ui: templates.getDefaultUiConfig() });
|
|
205
|
+
const appConfig = defu.defu({ b24ui: options.b24ui, colorMode: options.colorMode }, { b24ui: templates.getDefaultUiConfig() });
|
|
206
206
|
return [
|
|
207
207
|
Bitrix24EnvironmentPlugin(),
|
|
208
208
|
ComponentImportPlugin(options, meta),
|