@byyuurin/ui 0.0.5 → 0.0.7
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/README.md +15 -11
- package/dist/module.cjs +5 -0
- package/dist/module.json +12 -0
- package/dist/{nuxt.mjs → module.mjs} +7 -6
- package/dist/module.mjs.map +1 -0
- package/dist/runtime/components/Accordion.vue +20 -31
- package/dist/runtime/components/Alert.vue +1 -1
- package/dist/runtime/components/App.vue +1 -1
- package/dist/runtime/components/Badge.vue +0 -1
- package/dist/runtime/components/Button.vue +14 -12
- package/dist/runtime/components/ButtonGroup.vue +47 -0
- package/dist/runtime/components/Card.vue +9 -6
- package/dist/runtime/components/Carousel.vue +310 -0
- package/dist/runtime/components/Checkbox.vue +3 -4
- package/dist/runtime/components/Chip.vue +9 -4
- package/dist/runtime/components/Collapsible.vue +56 -0
- package/dist/runtime/components/Drawer.vue +4 -2
- package/dist/runtime/components/Input.vue +12 -8
- package/dist/runtime/components/InputNumber.vue +167 -0
- package/dist/runtime/components/Link.vue +301 -72
- package/dist/runtime/components/LinkBase.vue +88 -0
- package/dist/runtime/components/Modal.vue +2 -4
- package/dist/runtime/components/Pagination.vue +167 -0
- package/dist/runtime/components/PinInput.vue +0 -1
- package/dist/runtime/components/RadioGroup.vue +0 -1
- package/dist/runtime/components/ScrollArea.vue +1 -1
- package/dist/runtime/components/Select.vue +9 -5
- package/dist/runtime/components/Separator.vue +63 -0
- package/dist/runtime/components/Slider.vue +0 -1
- package/dist/runtime/components/Switch.vue +4 -6
- package/dist/runtime/components/Table.vue +292 -0
- package/dist/runtime/components/Tabs.vue +17 -18
- package/dist/runtime/components/Textarea.vue +0 -1
- package/dist/runtime/components/Toast.vue +21 -10
- package/dist/runtime/components/Toaster.vue +4 -39
- package/dist/runtime/composables/useButtonGroup.d.ts +13 -0
- package/dist/runtime/composables/useButtonGroup.js +14 -0
- package/dist/runtime/composables/{useComponentIcons.mjs → useComponentIcons.js} +1 -1
- package/dist/runtime/composables/useModal.d.ts +1 -1
- package/dist/runtime/composables/{useModal.mjs → useModal.js} +1 -1
- package/dist/runtime/composables/useTheme.d.ts +4 -4
- package/dist/runtime/composables/{useTheme.mjs → useTheme.js} +4 -4
- package/dist/runtime/composables/useToast.d.ts +4 -4
- package/dist/runtime/composables/{useToast.mjs → useToast.js} +19 -6
- package/dist/runtime/index.d.ts +34 -0
- package/dist/runtime/index.js +34 -0
- package/dist/runtime/theme/accordion.d.ts +22 -5
- package/dist/runtime/theme/{accordion.mjs → accordion.js} +2 -2
- package/dist/runtime/theme/alert.d.ts +41 -1
- package/dist/runtime/theme/{alert.mjs → alert.js} +4 -4
- package/dist/runtime/theme/app.d.ts +8 -0
- package/dist/runtime/theme/app.js +18 -0
- package/dist/runtime/theme/badge.d.ts +48 -21
- package/dist/runtime/theme/{badge.mjs → badge.js} +5 -2
- package/dist/runtime/theme/button-group.d.ts +66 -0
- package/dist/runtime/theme/button-group.js +42 -0
- package/dist/runtime/theme/button.d.ts +68 -111
- package/dist/runtime/theme/button.js +164 -0
- package/dist/runtime/theme/card.d.ts +38 -19
- package/dist/runtime/theme/card.js +37 -0
- package/dist/runtime/theme/carousel.d.ts +113 -0
- package/dist/runtime/theme/carousel.js +43 -0
- package/dist/runtime/theme/checkbox.d.ts +4 -1
- package/dist/runtime/theme/{checkbox.mjs → checkbox.js} +7 -4
- package/dist/runtime/theme/chip.d.ts +56 -12
- package/dist/runtime/theme/{chip.mjs → chip.js} +10 -7
- package/dist/runtime/theme/collapsible.d.ts +38 -0
- package/dist/runtime/theme/collapsible.js +10 -0
- package/dist/runtime/theme/drawer.d.ts +71 -33
- package/dist/runtime/theme/{drawer.mjs → drawer.js} +33 -22
- package/dist/runtime/theme/index.d.ts +31 -24
- package/dist/runtime/theme/index.js +31 -0
- package/dist/runtime/theme/input-number.d.ts +135 -0
- package/dist/runtime/theme/input-number.js +92 -0
- package/dist/runtime/theme/input.d.ts +94 -111
- package/dist/runtime/theme/input.js +151 -0
- package/dist/runtime/theme/link.d.ts +14 -1
- package/dist/runtime/theme/{link.mjs → link.js} +1 -1
- package/dist/runtime/theme/modal.d.ts +33 -7
- package/dist/runtime/theme/{modal.mjs → modal.js} +8 -10
- package/dist/runtime/theme/pagination.d.ts +56 -0
- package/dist/runtime/theme/pagination.js +13 -0
- package/dist/runtime/theme/pinInput.d.ts +45 -42
- package/dist/runtime/theme/{pinInput.mjs → pinInput.js} +14 -11
- package/dist/runtime/theme/popover.d.ts +16 -5
- package/dist/runtime/theme/{radioGroup.d.ts → radio-group.d.ts} +4 -1
- package/dist/runtime/theme/{radioGroup.mjs → radio-group.js} +3 -0
- package/dist/runtime/theme/scroll-area.d.ts +73 -0
- package/dist/runtime/theme/{scrollArea.mjs → scroll-area.js} +2 -2
- package/dist/runtime/theme/select.d.ts +95 -99
- package/dist/runtime/theme/{select.mjs → select.js} +22 -17
- package/dist/runtime/theme/separator.d.ts +95 -0
- package/dist/runtime/theme/separator.js +53 -0
- package/dist/runtime/theme/slider.d.ts +4 -1
- package/dist/runtime/theme/{slider.mjs → slider.js} +6 -3
- package/dist/runtime/theme/switch.d.ts +4 -1
- package/dist/runtime/theme/{switch.mjs → switch.js} +5 -2
- package/dist/runtime/theme/table.d.ts +89 -0
- package/dist/runtime/theme/table.js +35 -0
- package/dist/runtime/theme/tabs.d.ts +72 -52
- package/dist/runtime/theme/{tabs.mjs → tabs.js} +15 -12
- package/dist/runtime/theme/textarea.d.ts +46 -37
- package/dist/runtime/theme/{textarea.mjs → textarea.js} +14 -11
- package/dist/runtime/theme/toast.d.ts +45 -7
- package/dist/runtime/theme/{toast.mjs → toast.js} +12 -7
- package/dist/runtime/theme/toaster.d.ts +89 -25
- package/dist/runtime/theme/{toaster.mjs → toaster.js} +5 -0
- package/dist/runtime/theme/tooltip.d.ts +20 -7
- package/dist/runtime/theme/{tooltip.mjs → tooltip.js} +2 -2
- package/dist/runtime/types/components.d.ts +7 -1
- package/dist/runtime/types/index.d.ts +4 -4
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/types/utils.d.ts +1 -1
- package/dist/runtime/utils/index.d.ts +3 -3
- package/dist/runtime/utils/{index.mjs → index.js} +3 -3
- package/dist/runtime/utils/link.d.ts +22 -7
- package/dist/runtime/utils/link.js +30 -0
- package/dist/runtime/utils/styler.d.ts +2 -2
- package/dist/runtime/vue/stubs.d.ts +9 -0
- package/dist/runtime/vue/stubs.js +16 -0
- package/dist/shared/ui.d1728164.mjs +4 -0
- package/dist/shared/ui.d1728164.mjs.map +1 -0
- package/dist/types.d.mts +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/{unocss-preset.d.ts → unocss.d.mts} +10 -15
- package/dist/{unocss-preset.d.mts → unocss.d.ts} +10 -15
- package/dist/{unocss-preset.mjs → unocss.mjs} +53 -21
- package/dist/unocss.mjs.map +1 -0
- package/dist/unplugin.d.mts +4 -3
- package/dist/unplugin.d.ts +4 -3
- package/dist/unplugin.mjs +49 -5
- package/dist/unplugin.mjs.map +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +7 -5
- package/dist/vite.mjs.map +1 -1
- package/package.json +59 -45
- package/dist/index.d.ts +0 -26
- package/dist/index.mjs +0 -26
- package/dist/nuxt.mjs.map +0 -1
- package/dist/runtime/theme/app.mjs +0 -10
- package/dist/runtime/theme/button.mjs +0 -143
- package/dist/runtime/theme/card.mjs +0 -14
- package/dist/runtime/theme/index.mjs +0 -24
- package/dist/runtime/theme/input.mjs +0 -146
- package/dist/runtime/theme/scrollArea.d.ts +0 -51
- package/dist/runtime/types/index.mjs +0 -2
- package/dist/runtime/utils/link.mjs +0 -4
- package/dist/shared/ui.CzDyI29e.mjs +0 -8
- package/dist/shared/ui.CzDyI29e.mjs.map +0 -1
- package/dist/unocss-preset.mjs.map +0 -1
- /package/{LICENSE.md → LICENSE} +0 -0
- /package/dist/{nuxt.d.mts → module.d.mts} +0 -0
- /package/dist/{nuxt.d.ts → module.d.ts} +0 -0
- /package/dist/runtime/composables/{defineInjection.mjs → defineInjection.js} +0 -0
- /package/dist/runtime/theme/{popover.mjs → popover.js} +0 -0
- /package/dist/runtime/types/{components.mjs → components.js} +0 -0
- /package/dist/runtime/types/{utils.mjs → utils.js} +0 -0
- /package/dist/runtime/utils/{extend-theme.mjs → extend-theme.js} +0 -0
- /package/dist/runtime/utils/{styler.mjs → styler.js} +0 -0
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from '@byyuurin/ui-kit'
|
|
2
3
|
import type { PrimitiveProps, ToastRootEmits, ToastRootProps } from 'reka-ui'
|
|
3
4
|
import type { toast } from '../theme'
|
|
4
5
|
import type { ButtonProps, ComponentAttrs } from '../types'
|
|
5
6
|
|
|
7
|
+
type ToastVariants = VariantProps<typeof toast>
|
|
8
|
+
|
|
6
9
|
export interface ToastProps extends ComponentAttrs<typeof toast>, Pick<ToastRootProps, 'defaultOpen' | 'open' | 'type' | 'duration'> {
|
|
7
10
|
/** @default "li" */
|
|
8
11
|
as?: PrimitiveProps['as']
|
|
9
12
|
title?: string
|
|
10
13
|
description?: string
|
|
11
14
|
icon?: string
|
|
15
|
+
orientation?: ToastVariants['orientation']
|
|
16
|
+
/**
|
|
17
|
+
* Display a list of actions:
|
|
18
|
+
* - under the title and description when orientation is `vertical`
|
|
19
|
+
* - next to the close button when orientation is `horizontal`
|
|
20
|
+
*/
|
|
12
21
|
actions?: ButtonProps[]
|
|
13
22
|
/**
|
|
14
23
|
* Display a close button to dismiss the toast.
|
|
15
24
|
* @default true
|
|
16
25
|
*/
|
|
17
26
|
close?: ButtonProps | boolean
|
|
18
|
-
/** @default
|
|
27
|
+
/** @default app.icons.close */
|
|
19
28
|
closeIcon?: string
|
|
20
29
|
}
|
|
21
30
|
|
|
@@ -39,6 +48,7 @@ import { useTheme } from '../composables/useTheme'
|
|
|
39
48
|
import Button from './Button.vue'
|
|
40
49
|
|
|
41
50
|
const props = withDefaults(defineProps<ToastProps>(), {
|
|
51
|
+
orientation: 'vertical',
|
|
42
52
|
close: true,
|
|
43
53
|
})
|
|
44
54
|
|
|
@@ -50,12 +60,13 @@ const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'defaultOpen',
|
|
|
50
60
|
const el = ref<InstanceType<typeof ToastRoot>>()
|
|
51
61
|
const { height } = useElementBounding(() => el.value?.$el.getBoundingClientRect ? el.value.$el : undefined)
|
|
52
62
|
|
|
53
|
-
const multiline = computed(() => !!props.title && !!props.description)
|
|
54
|
-
|
|
55
63
|
const { theme, createStyler } = useTheme()
|
|
56
64
|
const style = computed(() => {
|
|
57
65
|
const styler = createStyler(theme.value.toast)
|
|
58
|
-
return styler({
|
|
66
|
+
return styler({
|
|
67
|
+
...props,
|
|
68
|
+
title: !!(props.title || slots.title),
|
|
69
|
+
})
|
|
59
70
|
})
|
|
60
71
|
|
|
61
72
|
defineExpose({
|
|
@@ -68,11 +79,11 @@ defineExpose({
|
|
|
68
79
|
ref="el"
|
|
69
80
|
v-slot="{ remaining, duration }"
|
|
70
81
|
v-bind="rootProps"
|
|
71
|
-
:class="style.root({ class: [props.class, props.ui?.root]
|
|
82
|
+
:class="style.root({ class: [props.class, props.ui?.root] })"
|
|
72
83
|
:style="{ '--height': height }"
|
|
73
84
|
>
|
|
74
85
|
<slot name="icon">
|
|
75
|
-
<
|
|
86
|
+
<span v-if="props.icon" :class="style.icon({ class: [props.icon, props.ui?.icon] })"></span>
|
|
76
87
|
</slot>
|
|
77
88
|
|
|
78
89
|
<div :class="style.wrapper({ class: props.ui?.wrapper })">
|
|
@@ -87,7 +98,7 @@ defineExpose({
|
|
|
87
98
|
</slot>
|
|
88
99
|
</ToastDescription>
|
|
89
100
|
|
|
90
|
-
<div v-if="
|
|
101
|
+
<div v-if="props.orientation === 'vertical' && actions?.length" :class="style.actions({ class: props.ui?.actions })">
|
|
91
102
|
<slot name="actions">
|
|
92
103
|
<ToastAction v-for="(action, index) in props.actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
93
104
|
<Button size="xs" v-bind="action" />
|
|
@@ -96,8 +107,8 @@ defineExpose({
|
|
|
96
107
|
</div>
|
|
97
108
|
</div>
|
|
98
109
|
|
|
99
|
-
<div v-if="(
|
|
100
|
-
<template v-if="
|
|
110
|
+
<div v-if="(props.orientation === 'horizontal' && actions?.length) || props.close !== null" :class="style.actions({ class: props.ui?.actions })">
|
|
111
|
+
<template v-if="props.orientation === 'horizontal'">
|
|
101
112
|
<slot name="actions">
|
|
102
113
|
<ToastAction v-for="(action, index) in props.actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
103
114
|
<Button size="xs" v-bind="action" />
|
|
@@ -107,7 +118,7 @@ defineExpose({
|
|
|
107
118
|
|
|
108
119
|
<ToastClose as-child>
|
|
109
120
|
<slot name="close" :ui="ui">
|
|
110
|
-
<
|
|
121
|
+
<Button
|
|
111
122
|
v-if="props.close"
|
|
112
123
|
:icon="props.closeIcon || theme.app.icons.close"
|
|
113
124
|
size="md"
|
|
@@ -72,6 +72,7 @@ const style = computed(() => {
|
|
|
72
72
|
return styler({
|
|
73
73
|
...props,
|
|
74
74
|
swipeDirection: swipeDirection.value,
|
|
75
|
+
clickable: false,
|
|
75
76
|
})
|
|
76
77
|
})
|
|
77
78
|
|
|
@@ -114,11 +115,9 @@ function getOffset(index: number) {
|
|
|
114
115
|
'--translate': expanded ? 'calc(var(--offset) * var(--translate-factor))' : 'calc(var(--before) * var(--gap))',
|
|
115
116
|
'--transform': 'translateY(var(--translate)) scale(var(--scale))',
|
|
116
117
|
}"
|
|
117
|
-
:class="
|
|
118
|
-
'cursor-pointer': !!toast.click,
|
|
119
|
-
}]"
|
|
118
|
+
:class="style.base({ clickable: !!(toast.onClick) })"
|
|
120
119
|
@update:open="onUpdateOpen($event, toast.id)"
|
|
121
|
-
@click="toast.
|
|
120
|
+
@click="toast.onClick && toast.onClick(toast)"
|
|
122
121
|
/>
|
|
123
122
|
|
|
124
123
|
<ToastPortal :disabled="!portal">
|
|
@@ -140,39 +139,5 @@ function getOffset(index: number) {
|
|
|
140
139
|
</template>
|
|
141
140
|
|
|
142
141
|
<style>
|
|
143
|
-
@keyframes toast-collapsed-closed {
|
|
144
|
-
from {
|
|
145
|
-
transform: var(--transform);
|
|
146
|
-
}
|
|
147
|
-
to {
|
|
148
|
-
transform: translateY(calc((var(--before) - var(--height)) * var(--gap)))
|
|
149
|
-
scale(var(--scale));
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
@keyframes toast-closed {
|
|
153
|
-
from {
|
|
154
|
-
transform: var(--transform);
|
|
155
|
-
}
|
|
156
|
-
to {
|
|
157
|
-
transform: translateY(
|
|
158
|
-
calc((var(--offset) - var(--height)) * var(--translate-factor))
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
@keyframes toast-slide-left {
|
|
163
|
-
from {
|
|
164
|
-
transform: translateX(0) translateY(var(--translate));
|
|
165
|
-
}
|
|
166
|
-
to {
|
|
167
|
-
transform: translateX(-100%) translateY(var(--translate));
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
@keyframes toast-slide-right {
|
|
171
|
-
from {
|
|
172
|
-
transform: translateX(0) translateY(var(--translate));
|
|
173
|
-
}
|
|
174
|
-
to {
|
|
175
|
-
transform: translateX(100%) translateY(var(--translate));
|
|
176
|
-
}
|
|
177
|
-
}
|
|
142
|
+
@keyframes toast-collapsed-closed{0%{transform:var(--transform)}to{transform:translateY(calc((var(--before) - var(--height))*var(--gap))) scale(var(--scale))}}@keyframes toast-closed{0%{transform:var(--transform)}to{transform:translateY(calc((var(--offset) - var(--height))*var(--translate-factor)))}}@keyframes toast-slide-left{0%{transform:translateX(0) translateY(var(--translate))}to{transform:translateX(-100%) translateY(var(--translate))}}@keyframes toast-slide-right{0%{transform:translateX(0) translateY(var(--translate))}to{transform:translateX(100%) translateY(var(--translate))}}
|
|
178
143
|
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
import type { ButtonGroupProps } from '../components/ButtonGroup.vue.js';
|
|
3
|
+
interface ButtonGroupInjectData {
|
|
4
|
+
size: ButtonGroupProps['size'];
|
|
5
|
+
orientation: ButtonGroupProps['orientation'];
|
|
6
|
+
}
|
|
7
|
+
export declare const InjectionKeyButtonGroup: import("vue").InjectionKey<ComputedRef<ButtonGroupInjectData>>, injectButtonGroup: () => ComputedRef<ButtonGroupInjectData> | undefined, provideButtonGroup: (value: ComputedRef<ButtonGroupInjectData>) => void;
|
|
8
|
+
type UseButtonGroupProps = Pick<ButtonGroupProps, 'size'>;
|
|
9
|
+
export declare function useButtonGroup(props?: UseButtonGroupProps): {
|
|
10
|
+
size: ComputedRef<any>;
|
|
11
|
+
orientation: ComputedRef<any>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { defineInjection } from "./defineInjection.js";
|
|
3
|
+
export const {
|
|
4
|
+
InjectionKey: InjectionKeyButtonGroup,
|
|
5
|
+
inject: injectButtonGroup,
|
|
6
|
+
provide: provideButtonGroup
|
|
7
|
+
} = defineInjection("ui.buttonGroup");
|
|
8
|
+
export function useButtonGroup(props = {}) {
|
|
9
|
+
const buttonGroup = injectButtonGroup();
|
|
10
|
+
return {
|
|
11
|
+
size: computed(() => props.size ?? buttonGroup?.value.size),
|
|
12
|
+
orientation: computed(() => buttonGroup?.value.orientation)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, toValue } from "vue";
|
|
2
|
-
import { useTheme } from "./useTheme.
|
|
2
|
+
import { useTheme } from "./useTheme.js";
|
|
3
3
|
export function useComponentIcons(componentProps) {
|
|
4
4
|
const { theme } = useTheme();
|
|
5
5
|
const props = computed(() => toValue(componentProps));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Component, ShallowRef } from 'vue';
|
|
2
2
|
import type { ComponentProps } from 'vue-component-type-helpers';
|
|
3
|
-
import type { ModalProps } from '../types';
|
|
3
|
+
import type { ModalProps } from '../types/index.js';
|
|
4
4
|
export interface ModalState {
|
|
5
5
|
component: Component | string;
|
|
6
6
|
props: ModalProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createSharedComposable } from "@vueuse/core";
|
|
2
2
|
import { ref } from "vue";
|
|
3
|
-
import { defineInjection } from "./defineInjection.
|
|
3
|
+
import { defineInjection } from "./defineInjection.js";
|
|
4
4
|
export const {
|
|
5
5
|
InjectionKey: InjectionKeyModalState,
|
|
6
6
|
inject: injectModalState,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { UserConfig } from 'unocss';
|
|
1
|
+
import type { UserConfig } from '@unocss/core';
|
|
2
2
|
import type { MaybeRefOrGetter } from 'vue';
|
|
3
|
-
import * as theme from '../theme';
|
|
4
|
-
export declare const InjectionKeyThemeExtension: import("vue").InjectionKey<MaybeRefOrGetter<import("
|
|
3
|
+
import * as theme from '../theme/index.js';
|
|
4
|
+
export declare const InjectionKeyThemeExtension: import("vue").InjectionKey<MaybeRefOrGetter<import("..").PartialTheme<typeof theme>>>, provideThemeExtension: (value: MaybeRefOrGetter<import("..").PartialTheme<typeof theme>>) => void, injectThemeExtension: () => MaybeRefOrGetter<import("..").PartialTheme<typeof theme>>;
|
|
5
5
|
export declare const InjectionKeyUnoConfig: import("vue").InjectionKey<UserConfig<object>>, provideUnoConfig: (value: UserConfig<object>) => void, injectUnoConfig: () => UserConfig<object>;
|
|
6
6
|
export declare const useTheme: () => {
|
|
7
7
|
theme: import("vue").ComputedRef<typeof theme>;
|
|
8
|
-
createStyler: <V extends import("@byyuurin/ui-kit
|
|
8
|
+
createStyler: <V extends import("@byyuurin/ui-kit").CVVariants<S, B>, CV extends import("@byyuurin/ui-kit").CVCompoundVariants<V, S, B>, DV extends import("@byyuurin/ui-kit").CVDefaultVariants<V, S>, B extends import("@byyuurin/ui-kit").ClassValue = undefined, S extends import("@byyuurin/ui-kit").CVSlots = undefined>(theme: import("@byyuurin/ui-kit").CVMeta<V, CV, DV, B, S>) => [keyof V] extends string[] ? (props: import("@byyuurin/ui-kit").VariantProps<import("@byyuurin/ui-kit").CVReturnType<V, S, B>> & import("..").StylerBaseProps) => S extends undefined ? string : { [K in keyof S | (B extends undefined ? never : "base")]: import("@byyuurin/ui-kit").CVHandler<V, S, string>; } : (props?: import("..").StylerBaseProps) => S extends undefined ? string : { [K in keyof S | (B extends undefined ? never : "base")]: import("@byyuurin/ui-kit").CVHandler<V, S, string>; };
|
|
9
9
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { transformUnoRules } from "@byyuurin/ui/unocss
|
|
1
|
+
import { transformUnoRules } from "@byyuurin/ui/unocss";
|
|
2
2
|
import { createSharedComposable } from "@vueuse/core";
|
|
3
3
|
import { computed, toValue } from "vue";
|
|
4
|
-
import * as theme from "../theme/index.
|
|
5
|
-
import { extendTheme, prepareStyler } from "../utils/index.
|
|
6
|
-
import { defineInjection } from "./defineInjection.
|
|
4
|
+
import * as theme from "../theme/index.js";
|
|
5
|
+
import { extendTheme, prepareStyler } from "../utils/index.js";
|
|
6
|
+
import { defineInjection } from "./defineInjection.js";
|
|
7
7
|
export const {
|
|
8
8
|
InjectionKey: InjectionKeyThemeExtension,
|
|
9
9
|
provide: provideThemeExtension,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ToastProps } from '
|
|
1
|
+
import type { ToastProps } from '../types/index.js';
|
|
2
2
|
export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
|
|
3
3
|
id: string | number;
|
|
4
|
-
|
|
4
|
+
onClick?: (toast: Toast) => void;
|
|
5
5
|
}
|
|
6
6
|
export declare const useToast: () => {
|
|
7
7
|
toasts: import("vue").Ref<{
|
|
@@ -9,13 +9,13 @@ export declare const useToast: () => {
|
|
|
9
9
|
[x: number]: any;
|
|
10
10
|
[x: symbol]: ToastProps;
|
|
11
11
|
id: string | number;
|
|
12
|
-
|
|
12
|
+
onClick?: ((toast: Toast) => void) | undefined;
|
|
13
13
|
}[], Toast[] | {
|
|
14
14
|
[x: string]: any;
|
|
15
15
|
[x: number]: any;
|
|
16
16
|
[x: symbol]: ToastProps;
|
|
17
17
|
id: string | number;
|
|
18
|
-
|
|
18
|
+
onClick?: ((toast: Toast) => void) | undefined;
|
|
19
19
|
}[]>;
|
|
20
20
|
add: (toast: Partial<Toast>) => Toast;
|
|
21
21
|
update: (id: string | number, toast: Partial<Omit<Toast, "id">>) => void;
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
import { createSharedComposable } from "@vueuse/core";
|
|
2
|
-
import { ref } from "vue";
|
|
2
|
+
import { nextTick, ref } from "vue";
|
|
3
3
|
export const useToast = createSharedComposable(() => {
|
|
4
4
|
const toasts = ref([]);
|
|
5
|
+
const running = ref(false);
|
|
6
|
+
const maxToasts = 5;
|
|
7
|
+
const queue = [];
|
|
8
|
+
const generateId = () => `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
9
|
+
async function processQueue() {
|
|
10
|
+
if (running.value || queue.length === 0)
|
|
11
|
+
return;
|
|
12
|
+
running.value = true;
|
|
13
|
+
while (queue.length > 0) {
|
|
14
|
+
const toast = queue.shift();
|
|
15
|
+
await nextTick();
|
|
16
|
+
toasts.value = [...toasts.value, toast].slice(-maxToasts);
|
|
17
|
+
}
|
|
18
|
+
running.value = false;
|
|
19
|
+
}
|
|
5
20
|
function add(toast) {
|
|
6
21
|
const body = {
|
|
7
|
-
id:
|
|
22
|
+
id: generateId(),
|
|
8
23
|
open: true,
|
|
9
24
|
...toast
|
|
10
25
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
toasts.value.push(body);
|
|
14
|
-
toasts.value = toasts.value.slice(-5);
|
|
26
|
+
queue.push(body);
|
|
27
|
+
processQueue();
|
|
15
28
|
return body;
|
|
16
29
|
}
|
|
17
30
|
function update(id, toast) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export { default as Accordion } from './components/Accordion.vue.js';
|
|
2
|
+
export { default as Alert } from './components/Alert.vue.js';
|
|
3
|
+
export { default as App } from './components/App.vue.js';
|
|
4
|
+
export { default as Badge } from './components/Badge.vue.js';
|
|
5
|
+
export { default as Button } from './components/Button.vue.js';
|
|
6
|
+
export { default as ButtonGroup } from './components/ButtonGroup.vue.js';
|
|
7
|
+
export { default as Card } from './components/Card.vue.js';
|
|
8
|
+
export { default as Carousel } from './components/Carousel.vue.js';
|
|
9
|
+
export { default as Checkbox } from './components/Checkbox.vue.js';
|
|
10
|
+
export { default as Chip } from './components/Chip.vue.js';
|
|
11
|
+
export { default as Collapsible } from './components/Collapsible.vue.js';
|
|
12
|
+
export { default as Drawer } from './components/Drawer.vue.js';
|
|
13
|
+
export { default as Input } from './components/Input.vue.js';
|
|
14
|
+
export { default as InputNumber } from './components/InputNumber.vue.js';
|
|
15
|
+
export { default as Link } from './components/Link.vue.js';
|
|
16
|
+
export { default as LinkBase } from './components/LinkBase.vue.js';
|
|
17
|
+
export { default as Modal } from './components/Modal.vue.js';
|
|
18
|
+
export { default as ModalProvider } from './components/ModalProvider.vue.js';
|
|
19
|
+
export { default as Pagination } from './components/Pagination.vue.js';
|
|
20
|
+
export { default as PinInput } from './components/PinInput.vue.js';
|
|
21
|
+
export { default as Popover } from './components/Popover.vue.js';
|
|
22
|
+
export { default as RadioGroup } from './components/RadioGroup.vue.js';
|
|
23
|
+
export { default as ScrollArea } from './components/ScrollArea.vue.js';
|
|
24
|
+
export { default as Select } from './components/Select.vue.js';
|
|
25
|
+
export { default as Separator } from './components/Separator.vue.js';
|
|
26
|
+
export { default as Slider } from './components/Slider.vue.js';
|
|
27
|
+
export { default as Switch } from './components/Switch.vue.js';
|
|
28
|
+
export { default as Table } from './components/Table.vue.js';
|
|
29
|
+
export { default as Tabs } from './components/Tabs.vue.js';
|
|
30
|
+
export { default as Textarea } from './components/Textarea.vue.js';
|
|
31
|
+
export { default as Toast } from './components/Toast.vue.js';
|
|
32
|
+
export { default as Toaster } from './components/Toaster.vue.js';
|
|
33
|
+
export { default as Tooltip } from './components/Tooltip.vue.js';
|
|
34
|
+
export * from './types/index.js';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export { default as Accordion } from "./components/Accordion.vue";
|
|
2
|
+
export { default as Alert } from "./components/Alert.vue";
|
|
3
|
+
export { default as App } from "./components/App.vue";
|
|
4
|
+
export { default as Badge } from "./components/Badge.vue";
|
|
5
|
+
export { default as Button } from "./components/Button.vue";
|
|
6
|
+
export { default as ButtonGroup } from "./components/ButtonGroup.vue";
|
|
7
|
+
export { default as Card } from "./components/Card.vue";
|
|
8
|
+
export { default as Carousel } from "./components/Carousel.vue";
|
|
9
|
+
export { default as Checkbox } from "./components/Checkbox.vue";
|
|
10
|
+
export { default as Chip } from "./components/Chip.vue";
|
|
11
|
+
export { default as Collapsible } from "./components/Collapsible.vue";
|
|
12
|
+
export { default as Drawer } from "./components/Drawer.vue";
|
|
13
|
+
export { default as Input } from "./components/Input.vue";
|
|
14
|
+
export { default as InputNumber } from "./components/InputNumber.vue";
|
|
15
|
+
export { default as Link } from "./components/Link.vue";
|
|
16
|
+
export { default as LinkBase } from "./components/LinkBase.vue";
|
|
17
|
+
export { default as Modal } from "./components/Modal.vue";
|
|
18
|
+
export { default as ModalProvider } from "./components/ModalProvider.vue";
|
|
19
|
+
export { default as Pagination } from "./components/Pagination.vue";
|
|
20
|
+
export { default as PinInput } from "./components/PinInput.vue";
|
|
21
|
+
export { default as Popover } from "./components/Popover.vue";
|
|
22
|
+
export { default as RadioGroup } from "./components/RadioGroup.vue";
|
|
23
|
+
export { default as ScrollArea } from "./components/ScrollArea.vue";
|
|
24
|
+
export { default as Select } from "./components/Select.vue";
|
|
25
|
+
export { default as Separator } from "./components/Separator.vue";
|
|
26
|
+
export { default as Slider } from "./components/Slider.vue";
|
|
27
|
+
export { default as Switch } from "./components/Switch.vue";
|
|
28
|
+
export { default as Table } from "./components/Table.vue";
|
|
29
|
+
export { default as Tabs } from "./components/Tabs.vue";
|
|
30
|
+
export { default as Textarea } from "./components/Textarea.vue";
|
|
31
|
+
export { default as Toast } from "./components/Toast.vue";
|
|
32
|
+
export { default as Toaster } from "./components/Toaster.vue";
|
|
33
|
+
export { default as Tooltip } from "./components/Tooltip.vue";
|
|
34
|
+
export * from "./types/index.js";
|
|
@@ -7,8 +7,8 @@ declare const _default: {
|
|
|
7
7
|
trigger: string;
|
|
8
8
|
content: string[];
|
|
9
9
|
body: string;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
prefixIcon: string;
|
|
11
|
+
suffixIcon: string;
|
|
12
12
|
label: string;
|
|
13
13
|
};
|
|
14
14
|
variants: {
|
|
@@ -18,7 +18,7 @@ declare const _default: {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
compoundVariants: import("@byyuurin/ui-kit
|
|
21
|
+
compoundVariants: import("@byyuurin/ui-kit").CVCompoundVariants<{
|
|
22
22
|
disabled: {
|
|
23
23
|
true: {
|
|
24
24
|
trigger: string;
|
|
@@ -31,9 +31,26 @@ declare const _default: {
|
|
|
31
31
|
trigger: string;
|
|
32
32
|
content: string[];
|
|
33
33
|
body: string;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
prefixIcon: string;
|
|
35
|
+
suffixIcon: string;
|
|
36
36
|
label: string;
|
|
37
37
|
}, undefined>;
|
|
38
|
+
defaultVariants: import("@byyuurin/ui-kit").CVDefaultVariants<{
|
|
39
|
+
disabled: {
|
|
40
|
+
true: {
|
|
41
|
+
trigger: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}, {
|
|
45
|
+
root: string;
|
|
46
|
+
item: string;
|
|
47
|
+
header: string;
|
|
48
|
+
trigger: string;
|
|
49
|
+
content: string[];
|
|
50
|
+
body: string;
|
|
51
|
+
prefixIcon: string;
|
|
52
|
+
suffixIcon: string;
|
|
53
|
+
label: string;
|
|
54
|
+
}>;
|
|
38
55
|
};
|
|
39
56
|
export default _default;
|
|
@@ -13,8 +13,8 @@ export default ct(
|
|
|
13
13
|
"data-[state=closed]:animate-[accordion-up_200ms_ease-out]"
|
|
14
14
|
],
|
|
15
15
|
body: "text-sm pb-4 color-ui-cb/80",
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
prefixIcon: "shrink-0 size-5",
|
|
17
|
+
suffixIcon: "shrink-0 size-5 ms-auto group-data-[state=open]:rotate-180 transition-all duration-200",
|
|
18
18
|
label: "text-start break-words"
|
|
19
19
|
},
|
|
20
20
|
variants: {
|
|
@@ -41,7 +41,7 @@ declare const _default: {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
compoundVariants: import("@byyuurin/ui-kit
|
|
44
|
+
compoundVariants: import("@byyuurin/ui-kit").CVCompoundVariants<{
|
|
45
45
|
variant: {
|
|
46
46
|
solid: {
|
|
47
47
|
root: string;
|
|
@@ -81,5 +81,45 @@ declare const _default: {
|
|
|
81
81
|
actions: string;
|
|
82
82
|
close: string;
|
|
83
83
|
}, undefined>;
|
|
84
|
+
defaultVariants: import("@byyuurin/ui-kit").CVDefaultVariants<{
|
|
85
|
+
variant: {
|
|
86
|
+
solid: {
|
|
87
|
+
root: string;
|
|
88
|
+
close: string;
|
|
89
|
+
};
|
|
90
|
+
outline: {
|
|
91
|
+
root: string;
|
|
92
|
+
};
|
|
93
|
+
soft: {
|
|
94
|
+
root: string;
|
|
95
|
+
};
|
|
96
|
+
'soft-outline': {
|
|
97
|
+
root: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
orientation: {
|
|
101
|
+
horizontal: {
|
|
102
|
+
root: string;
|
|
103
|
+
actions: string;
|
|
104
|
+
};
|
|
105
|
+
vertical: {
|
|
106
|
+
root: string;
|
|
107
|
+
actions: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
title: {
|
|
111
|
+
true: {
|
|
112
|
+
description: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
}, {
|
|
116
|
+
root: string;
|
|
117
|
+
wrapper: string;
|
|
118
|
+
title: string;
|
|
119
|
+
description: string;
|
|
120
|
+
icon: string;
|
|
121
|
+
actions: string;
|
|
122
|
+
close: string;
|
|
123
|
+
}>;
|
|
84
124
|
};
|
|
85
125
|
export default _default;
|
|
@@ -14,17 +14,17 @@ export default ct(
|
|
|
14
14
|
variants: {
|
|
15
15
|
variant: {
|
|
16
16
|
"solid": {
|
|
17
|
-
root: "color-ui-
|
|
17
|
+
root: "color-ui-cx bg-ui-fill",
|
|
18
18
|
close: "ui-base-inverted"
|
|
19
19
|
},
|
|
20
20
|
"outline": {
|
|
21
|
-
root: "color-ui-content bg-ui-
|
|
21
|
+
root: "color-ui-content bg-ui-cx ring ring-inset ring-ui-fill/30"
|
|
22
22
|
},
|
|
23
23
|
"soft": {
|
|
24
|
-
root: "color-ui-content bg-ui-fill/10"
|
|
24
|
+
root: "color-ui-content bg-soft-ui-fill/10"
|
|
25
25
|
},
|
|
26
26
|
"soft-outline": {
|
|
27
|
-
root: "color-ui-content bg-ui-fill/10 ring ring-inset ring-ui-fill/
|
|
27
|
+
root: "color-ui-content bg-soft-ui-fill/10 ring ring-inset ring-ui-fill/30"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
orientation: {
|
|
@@ -4,7 +4,15 @@ declare const _default: {
|
|
|
4
4
|
loading: string;
|
|
5
5
|
check: string;
|
|
6
6
|
indeterminate: string;
|
|
7
|
+
up: string;
|
|
7
8
|
down: string;
|
|
9
|
+
arrowLeft: string;
|
|
10
|
+
arrowRight: string;
|
|
11
|
+
doubleLeft: string;
|
|
12
|
+
doubleRight: string;
|
|
13
|
+
ellipsis: string;
|
|
14
|
+
plus: string;
|
|
15
|
+
minus: string;
|
|
8
16
|
};
|
|
9
17
|
};
|
|
10
18
|
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
/* @unocss-include */
|
|
3
|
+
icons: {
|
|
4
|
+
close: "i-mdi-close-thick",
|
|
5
|
+
loading: "i-mdi-loading",
|
|
6
|
+
check: "i-mdi-check-bold",
|
|
7
|
+
indeterminate: "i-mdi-minus-thick",
|
|
8
|
+
up: "i-mdi-chevron-up",
|
|
9
|
+
down: "i-mdi-chevron-down",
|
|
10
|
+
arrowLeft: "i-mdi-chevron-left",
|
|
11
|
+
arrowRight: "i-mdi-chevron-right",
|
|
12
|
+
doubleLeft: "i-mdi-chevron-double-left",
|
|
13
|
+
doubleRight: "i-mdi-chevron-double-right",
|
|
14
|
+
ellipsis: "i-mdi-dots-horizontal",
|
|
15
|
+
plus: "i-mdi-plus",
|
|
16
|
+
minus: "i-mdi-minus"
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -50,30 +50,57 @@ declare const _default: {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
compoundVariants: ({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
compoundVariants: import("@byyuurin/ui-kit").CVCompoundVariants<{
|
|
54
|
+
size: {
|
|
55
|
+
xs: {
|
|
56
|
+
root: string;
|
|
57
|
+
};
|
|
58
|
+
sm: {
|
|
59
|
+
root: string;
|
|
60
|
+
};
|
|
61
|
+
md: {
|
|
62
|
+
root: string;
|
|
63
|
+
};
|
|
64
|
+
lg: {
|
|
65
|
+
root: string;
|
|
66
|
+
};
|
|
67
|
+
xl: {
|
|
68
|
+
root: string;
|
|
69
|
+
};
|
|
58
70
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
position: {
|
|
72
|
+
'top-right': {
|
|
73
|
+
base: string;
|
|
74
|
+
};
|
|
75
|
+
'bottom-right': {
|
|
76
|
+
base: string;
|
|
77
|
+
};
|
|
78
|
+
'top-left': {
|
|
79
|
+
base: string;
|
|
80
|
+
};
|
|
81
|
+
'bottom-left': {
|
|
82
|
+
base: string;
|
|
83
|
+
};
|
|
64
84
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
base: string;
|
|
85
|
+
show: {
|
|
86
|
+
true: {
|
|
87
|
+
base: string;
|
|
88
|
+
};
|
|
70
89
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
inset: {
|
|
91
|
+
true: "";
|
|
92
|
+
};
|
|
93
|
+
standalone: {
|
|
94
|
+
false: {
|
|
95
|
+
base: string;
|
|
96
|
+
};
|
|
76
97
|
};
|
|
77
|
-
}
|
|
98
|
+
}, {
|
|
99
|
+
root: string;
|
|
100
|
+
base: string[];
|
|
101
|
+
}, undefined>;
|
|
102
|
+
defaultVariants: {
|
|
103
|
+
size: "md";
|
|
104
|
+
};
|
|
78
105
|
};
|
|
79
106
|
export default _default;
|