@tb-dev/vue 0.3.4 → 0.3.6
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.
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { ButtonIconProps } from './types';
|
|
3
|
+
declare const _default: <T extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & ButtonIconProps<T> & Partial<{}>> & import('vue').PublicProps;
|
|
5
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
6
|
+
attrs: any;
|
|
7
|
+
slots: Readonly<{
|
|
8
|
+
default?: () => VNode;
|
|
9
|
+
}> & {
|
|
10
|
+
default?: () => VNode;
|
|
11
|
+
};
|
|
12
|
+
emit: {};
|
|
13
|
+
}>) => import('vue').VNode & {
|
|
14
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_PrettifyLocal<T> = {
|
|
18
|
+
[K in keyof T]: T[K];
|
|
19
|
+
} & {};
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
|
-
import { inject as inject$1, toValue, defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, normalizeClass, createElementBlock, Fragment, createVNode, toDisplayString, createCommentVNode, normalizeStyle, createElementVNode, withDirectives, isRef, vModelText, createTextVNode, normalizeProps, guardReactiveProps, ref, toRef, effectScope } from 'vue';
|
|
2
|
+
import { inject as inject$1, toValue, defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, normalizeClass, createElementBlock, Fragment, createVNode, toDisplayString, resolveDynamicComponent, createCommentVNode, normalizeStyle, createElementVNode, withDirectives, isRef, vModelText, createTextVNode, normalizeProps, guardReactiveProps, ref, toRef, effectScope } from 'vue';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { unwrap, isNil, toPixel } from '@tb-dev/utils';
|
|
@@ -88,7 +88,7 @@ function cn(...inputs) {
|
|
|
88
88
|
return twMerge(clsx(inputs));
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
const _sfc_main$
|
|
91
|
+
const _sfc_main$1X = /* @__PURE__ */ defineComponent({
|
|
92
92
|
__name: "Badge",
|
|
93
93
|
props: {
|
|
94
94
|
asChild: { type: Boolean },
|
|
@@ -133,7 +133,7 @@ const badgeVariants = cva(
|
|
|
133
133
|
}
|
|
134
134
|
);
|
|
135
135
|
|
|
136
|
-
const _sfc_main$
|
|
136
|
+
const _sfc_main$1W = /* @__PURE__ */ defineComponent({
|
|
137
137
|
__name: "Button",
|
|
138
138
|
props: {
|
|
139
139
|
variant: {},
|
|
@@ -186,9 +186,9 @@ const buttonVariants = cva(
|
|
|
186
186
|
}
|
|
187
187
|
);
|
|
188
188
|
|
|
189
|
-
const _hoisted_1$
|
|
189
|
+
const _hoisted_1$b = { key: 0 };
|
|
190
190
|
const _hoisted_2$1 = { key: 0 };
|
|
191
|
-
const _sfc_main$
|
|
191
|
+
const _sfc_main$1V = /* @__PURE__ */ defineComponent({
|
|
192
192
|
__name: "ButtonLink",
|
|
193
193
|
props: {
|
|
194
194
|
buttonClass: {},
|
|
@@ -204,14 +204,14 @@ const _sfc_main$1U = /* @__PURE__ */ defineComponent({
|
|
|
204
204
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
205
205
|
createVNode(unref(DefineTemplate), null, {
|
|
206
206
|
default: withCtx(() => [
|
|
207
|
-
createVNode(unref(_sfc_main$
|
|
207
|
+
createVNode(unref(_sfc_main$1W), {
|
|
208
208
|
variant: _ctx.variant,
|
|
209
209
|
size: _ctx.size,
|
|
210
210
|
disabled: _ctx.disabled,
|
|
211
211
|
class: normalizeClass(unref(cn)("size-full", _ctx.buttonClass))
|
|
212
212
|
}, {
|
|
213
213
|
default: withCtx(() => [
|
|
214
|
-
_ctx.label ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
214
|
+
_ctx.label ? (openBlock(), createElementBlock("span", _hoisted_1$b, toDisplayString(_ctx.label), 1)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
215
215
|
]),
|
|
216
216
|
_: 3
|
|
217
217
|
}, 8, ["variant", "size", "disabled", "class"])
|
|
@@ -234,6 +234,52 @@ const _sfc_main$1U = /* @__PURE__ */ defineComponent({
|
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
|
|
237
|
+
const _sfc_main$1U = /* @__PURE__ */ defineComponent({
|
|
238
|
+
__name: "ButtonIcon",
|
|
239
|
+
props: {
|
|
240
|
+
buttonClass: {},
|
|
241
|
+
class: {},
|
|
242
|
+
icon: {},
|
|
243
|
+
iconClass: {},
|
|
244
|
+
iconSize: {},
|
|
245
|
+
to: {}
|
|
246
|
+
},
|
|
247
|
+
setup(__props) {
|
|
248
|
+
const props = __props;
|
|
249
|
+
return (_ctx, _cache) => {
|
|
250
|
+
return _ctx.to ? (openBlock(), createBlock(unref(_sfc_main$1V), {
|
|
251
|
+
key: 0,
|
|
252
|
+
to: _ctx.to,
|
|
253
|
+
variant: "ghost",
|
|
254
|
+
size: "icon",
|
|
255
|
+
class: normalizeClass(props.class),
|
|
256
|
+
"button-class": _ctx.buttonClass
|
|
257
|
+
}, {
|
|
258
|
+
default: withCtx(() => [
|
|
259
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), {
|
|
260
|
+
class: normalizeClass(_ctx.iconClass),
|
|
261
|
+
size: _ctx.iconSize
|
|
262
|
+
}, null, 8, ["class", "size"]))
|
|
263
|
+
]),
|
|
264
|
+
_: 1
|
|
265
|
+
}, 8, ["to", "class", "button-class"])) : (openBlock(), createBlock(unref(_sfc_main$1W), {
|
|
266
|
+
key: 1,
|
|
267
|
+
variant: "ghost",
|
|
268
|
+
size: "icon",
|
|
269
|
+
class: normalizeClass(unref(cn)(props.class, _ctx.buttonClass))
|
|
270
|
+
}, {
|
|
271
|
+
default: withCtx(() => [
|
|
272
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), {
|
|
273
|
+
class: normalizeClass(_ctx.iconClass),
|
|
274
|
+
size: _ctx.iconSize
|
|
275
|
+
}, null, 8, ["class", "size"]))
|
|
276
|
+
]),
|
|
277
|
+
_: 1
|
|
278
|
+
}, 8, ["class"]));
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
|
|
237
283
|
const _sfc_main$1T = /* @__PURE__ */ defineComponent({
|
|
238
284
|
__name: "ScrollBar",
|
|
239
285
|
props: {
|
|
@@ -543,7 +589,7 @@ const _sfc_main$1K = /* @__PURE__ */ defineComponent({
|
|
|
543
589
|
}
|
|
544
590
|
});
|
|
545
591
|
|
|
546
|
-
const _hoisted_1$
|
|
592
|
+
const _hoisted_1$a = { class: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center" };
|
|
547
593
|
const _sfc_main$1J = /* @__PURE__ */ defineComponent({
|
|
548
594
|
__name: "ContextMenuCheckboxItem",
|
|
549
595
|
props: {
|
|
@@ -571,7 +617,7 @@ const _sfc_main$1J = /* @__PURE__ */ defineComponent({
|
|
|
571
617
|
)
|
|
572
618
|
}), {
|
|
573
619
|
default: withCtx(() => [
|
|
574
|
-
createElementVNode("span", _hoisted_1$
|
|
620
|
+
createElementVNode("span", _hoisted_1$a, [
|
|
575
621
|
createVNode(unref(ContextMenuItemIndicator), null, {
|
|
576
622
|
default: withCtx(() => [
|
|
577
623
|
createVNode(unref(Check), { class: "size-4" })
|
|
@@ -748,7 +794,7 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
|
|
|
748
794
|
}
|
|
749
795
|
});
|
|
750
796
|
|
|
751
|
-
const _hoisted_1$
|
|
797
|
+
const _hoisted_1$9 = { class: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center" };
|
|
752
798
|
const _sfc_main$1D = /* @__PURE__ */ defineComponent({
|
|
753
799
|
__name: "ContextMenuRadioItem",
|
|
754
800
|
props: {
|
|
@@ -776,7 +822,7 @@ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
|
|
|
776
822
|
)
|
|
777
823
|
}), {
|
|
778
824
|
default: withCtx(() => [
|
|
779
|
-
createElementVNode("span", _hoisted_1$
|
|
825
|
+
createElementVNode("span", _hoisted_1$9, [
|
|
780
826
|
createVNode(unref(ContextMenuItemIndicator), null, {
|
|
781
827
|
default: withCtx(() => [
|
|
782
828
|
createVNode(unref(Circle), { class: "size-2 fill-current" })
|
|
@@ -1271,7 +1317,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
1271
1317
|
}
|
|
1272
1318
|
});
|
|
1273
1319
|
|
|
1274
|
-
const _hoisted_1$
|
|
1320
|
+
const _hoisted_1$8 = { class: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center" };
|
|
1275
1321
|
const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
1276
1322
|
__name: "DropdownMenuCheckboxItem",
|
|
1277
1323
|
props: {
|
|
@@ -1299,7 +1345,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
|
1299
1345
|
)
|
|
1300
1346
|
}), {
|
|
1301
1347
|
default: withCtx(() => [
|
|
1302
|
-
createElementVNode("span", _hoisted_1$
|
|
1348
|
+
createElementVNode("span", _hoisted_1$8, [
|
|
1303
1349
|
createVNode(unref(DropdownMenuItemIndicator), null, {
|
|
1304
1350
|
default: withCtx(() => [
|
|
1305
1351
|
createVNode(unref(Check), { class: "size-4" })
|
|
@@ -1474,7 +1520,7 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
|
1474
1520
|
}
|
|
1475
1521
|
});
|
|
1476
1522
|
|
|
1477
|
-
const _hoisted_1$
|
|
1523
|
+
const _hoisted_1$7 = { class: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center" };
|
|
1478
1524
|
const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
1479
1525
|
__name: "DropdownMenuRadioItem",
|
|
1480
1526
|
props: {
|
|
@@ -1502,7 +1548,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
|
1502
1548
|
)
|
|
1503
1549
|
}), {
|
|
1504
1550
|
default: withCtx(() => [
|
|
1505
|
-
createElementVNode("span", _hoisted_1$
|
|
1551
|
+
createElementVNode("span", _hoisted_1$7, [
|
|
1506
1552
|
createVNode(unref(DropdownMenuItemIndicator), null, {
|
|
1507
1553
|
default: withCtx(() => [
|
|
1508
1554
|
createVNode(unref(Circle), { class: "size-2 fill-current" })
|
|
@@ -1913,6 +1959,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
1913
1959
|
}
|
|
1914
1960
|
});
|
|
1915
1961
|
|
|
1962
|
+
const _hoisted_1$6 = { class: "w-full" };
|
|
1916
1963
|
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
1917
1964
|
__name: "InputNumber",
|
|
1918
1965
|
props: {
|
|
@@ -1970,7 +2017,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
1970
2017
|
class: normalizeClass(_ctx.labelClass)
|
|
1971
2018
|
}, {
|
|
1972
2019
|
default: withCtx(() => [
|
|
1973
|
-
createElementVNode("span",
|
|
2020
|
+
createElementVNode("span", _hoisted_1$6, toDisplayString(_ctx.label), 1),
|
|
1974
2021
|
createVNode(unref(ReuseTemplate))
|
|
1975
2022
|
]),
|
|
1976
2023
|
_: 1
|
|
@@ -1980,6 +2027,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
1980
2027
|
}
|
|
1981
2028
|
});
|
|
1982
2029
|
|
|
2030
|
+
const _hoisted_1$5 = { class: "w-full" };
|
|
1983
2031
|
const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
1984
2032
|
__name: "InputText",
|
|
1985
2033
|
props: {
|
|
@@ -2030,7 +2078,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
|
2030
2078
|
class: normalizeClass(_ctx.labelClass)
|
|
2031
2079
|
}, {
|
|
2032
2080
|
default: withCtx(() => [
|
|
2033
|
-
createElementVNode("span",
|
|
2081
|
+
createElementVNode("span", _hoisted_1$5, toDisplayString(_ctx.label), 1),
|
|
2034
2082
|
createVNode(unref(ReuseTemplate))
|
|
2035
2083
|
]),
|
|
2036
2084
|
_: 1
|
|
@@ -4146,4 +4194,4 @@ function localRef(key, initial, options) {
|
|
|
4146
4194
|
});
|
|
4147
4195
|
}
|
|
4148
4196
|
|
|
4149
|
-
export { _sfc_main$
|
|
4197
|
+
export { _sfc_main$1X as Badge, _sfc_main$1W as Button, _sfc_main$1U as ButtonIcon, _sfc_main$1V as ButtonLink, _sfc_main$1M as Card, _sfc_main$1L as Checkbox, _sfc_main$1K as ContextMenu, _sfc_main$1J as ContextMenuCheckboxItem, _sfc_main$1I as ContextMenuContent, _sfc_main$1H as ContextMenuGroup, _sfc_main$1G as ContextMenuItem, _sfc_main$1F as ContextMenuLabel, _sfc_main$1E as ContextMenuRadioGroup, _sfc_main$1D as ContextMenuRadioItem, _sfc_main$1C as ContextMenuSeparator, _sfc_main$1B as ContextMenuShortcut, _sfc_main$1A as ContextMenuSub, _sfc_main$1z as ContextMenuSubContent, _sfc_main$1y as ContextMenuSubTrigger, _sfc_main$1x as ContextMenuTrigger, _sfc_main$1w as Dialog, _sfc_main$1v as DialogClose, _sfc_main$1t as DialogContent, _sfc_main$1s as DialogDescription, _sfc_main$1r as DialogFooter, _sfc_main$1q as DialogHeader, _sfc_main$1u as DialogOverlay, _sfc_main$1p as DialogScrollContent, _sfc_main$1o as DialogTitle, _sfc_main$1n as DialogTrigger, _sfc_main$1m as DropdownMenu, _sfc_main$1l as DropdownMenuCheckboxItem, _sfc_main$1k as DropdownMenuContent, _sfc_main$1j as DropdownMenuGroup, _sfc_main$1i as DropdownMenuItem, _sfc_main$1h as DropdownMenuLabel, _sfc_main$1g as DropdownMenuRadioGroup, _sfc_main$1f as DropdownMenuRadioItem, _sfc_main$1e as DropdownMenuSeparator, _sfc_main$1d as DropdownMenuShortcut, _sfc_main$1c as DropdownMenuSub, _sfc_main$1b as DropdownMenuSubContent, _sfc_main$1a as DropdownMenuSubTrigger, _sfc_main$19 as DropdownMenuTrigger, _sfc_main$18 as Input, _sfc_main$10 as InputNumber, _sfc_main$$ as InputText, _sfc_main$16 as Label, _sfc_main$_ as Link, _sfc_main$Z as Popover, _sfc_main$Y as PopoverAnchor, _sfc_main$X as PopoverContent, _sfc_main$W as PopoverTrigger, _sfc_main$V as Progress, _sfc_main$U as RadioGroup, _sfc_main$T as RadioGroupItem, _sfc_main$1S as ScrollArea, _sfc_main$S as Select, _sfc_main$R as SelectContent, _sfc_main$Q as SelectGroup, _sfc_main$P as SelectItem, _sfc_main$O as SelectItemText, _sfc_main$N as SelectLabel, _sfc_main$M as SelectScrollDownButton, _sfc_main$L as SelectScrollUpButton, _sfc_main$K as SelectSeparator, _sfc_main$J as SelectTrigger, _sfc_main$I as SelectValue, _sfc_main$H as Separator, _sfc_main$G as Sheet, _sfc_main$F as SheetClose, _sfc_main$D as SheetContent, _sfc_main$C as SheetDescription, _sfc_main$B as SheetFooter, _sfc_main$A as SheetHeader, _sfc_main$z as SheetTitle, _sfc_main$y as SheetTrigger, _sfc_main$m as Sidebar, _sfc_main$o as Skeleton, _sfc_main$c as Table, _sfc_main$i as TableCell, _sfc_main$g as TableEmpty, _sfc_main$e as TableHead, _sfc_main$b as TableLink, _sfc_main$h as TableRow, _sfc_main$a as Tabs, _sfc_main$9 as TabsContent, _sfc_main$8 as TabsList, _sfc_main$7 as TabsTrigger, _sfc_main$6 as TagsInput, _sfc_main$5 as TagsInputInput, _sfc_main$4 as TagsInputItem, _sfc_main$3 as TagsInputItemDelete, _sfc_main$2 as TagsInputItemText, _sfc_main$1 as Textarea, _sfc_main as Toggle, _sfc_main$s as Tooltip, _sfc_main$r as TooltipContent, _sfc_main$q as TooltipProvider, _sfc_main$p as TooltipTrigger, asyncComputed, asyncRef, cn, getCurrentApp, getErrorHandler, handleError, inject, localRef, maybe, onAltKeyDown, onCtrlKeyDown, onCtrlShiftKeyDown, onKeyDown, onShiftKeyDown, provide, runWithContext, setCurrentApp, setErrorHandler, tryGetCurrentApp, tryInject, trySetCurrentApp, useElementSize, useHeight, useHeightDiff, useSidebar, useWidth, useWidthDiff, useWindowHeight, useWindowWidth };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tb-dev/vue",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "Vue utilities",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@tanstack/vue-table": "^8.21.2",
|
|
29
|
-
"@tb-dev/utils": "^6.0.
|
|
29
|
+
"@tb-dev/utils": "^6.0.1",
|
|
30
30
|
"@vueuse/core": "^13.1.0",
|
|
31
31
|
"class-variance-authority": "^0.7.1",
|
|
32
32
|
"clsx": "^2.1.1",
|
|
33
|
-
"lucide-vue-next": "^0.
|
|
33
|
+
"lucide-vue-next": "^0.488.0",
|
|
34
34
|
"reka-ui": "^2.2.0",
|
|
35
35
|
"tailwind-merge": "^3.2.0",
|
|
36
36
|
"tw-animate-css": "^1.2.5",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@tailwindcss/vite": "^4.1.3",
|
|
42
|
-
"@tb-dev/eslint-config": "^
|
|
42
|
+
"@tb-dev/eslint-config": "^7.0.0",
|
|
43
43
|
"@types/node": "^22.14.1",
|
|
44
44
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
45
45
|
"eslint": "^9.24.0",
|