@codefast/ui 0.3.9 → 0.3.10
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/CHANGELOG.md +11 -0
- package/dist/components/accordion.cjs +97 -1
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +51 -1
- package/dist/components/alert-dialog.cjs +155 -1
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +94 -1
- package/dist/components/alert.cjs +84 -1
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +41 -1
- package/dist/components/aspect-ratio.cjs +43 -1
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/aspect-ratio.js +9 -1
- package/dist/components/avatar.cjs +65 -1
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +25 -1
- package/dist/components/badge.cjs +66 -1
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +29 -1
- package/dist/components/breadcrumb.cjs +126 -1
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +74 -1
- package/dist/components/button-group.cjs +86 -1
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +43 -1
- package/dist/components/button.cjs +92 -1
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +55 -1
- package/dist/components/calendar.cjs +150 -1
- package/dist/components/calendar.d.ts +12 -19
- package/dist/components/calendar.js +113 -1
- package/dist/components/card.cjs +105 -1
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +53 -1
- package/dist/components/carousel.cjs +210 -1
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +151 -1
- package/dist/components/chart.cjs +250 -3
- package/dist/components/chart.d.ts +9 -9
- package/dist/components/chart.js +198 -3
- package/dist/components/checkbox-cards.cjs +69 -1
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +32 -1
- package/dist/components/checkbox-group.cjs +63 -1
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +26 -1
- package/dist/components/checkbox.cjs +53 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +19 -1
- package/dist/components/collapsible.cjs +61 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/collapsible.js +21 -1
- package/dist/components/command.cjs +167 -1
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +106 -1
- package/dist/components/context-menu.cjs +218 -1
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +142 -1
- package/dist/components/dialog.cjs +164 -1
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +106 -1
- package/dist/components/drawer.cjs +143 -1
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +85 -1
- package/dist/components/dropdown-menu.cjs +221 -1
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +145 -1
- package/dist/components/empty.cjs +113 -1
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +61 -1
- package/dist/components/field.cjs +193 -1
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +129 -1
- package/dist/components/form.cjs +151 -1
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +96 -1
- package/dist/components/hover-card.cjs +77 -1
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +34 -1
- package/dist/components/input-group.cjs +155 -1
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +97 -1
- package/dist/components/input-number.cjs +98 -1
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +64 -1
- package/dist/components/input-otp.cjs +101 -1
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +49 -1
- package/dist/components/input-password.cjs +71 -1
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +37 -1
- package/dist/components/input-search.cjs +80 -1
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +46 -1
- package/dist/components/input.cjs +45 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +11 -1
- package/dist/components/item.cjs +186 -1
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +119 -1
- package/dist/components/kbd.cjs +54 -1
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +17 -1
- package/dist/components/label.cjs +45 -1
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +11 -1
- package/dist/components/menubar.cjs +232 -1
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +153 -1
- package/dist/components/native-select.cjs +75 -1
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +35 -1
- package/dist/components/navigation-menu.cjs +146 -2
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +94 -2
- package/dist/components/pagination.cjs +138 -1
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +86 -1
- package/dist/components/popover.cjs +86 -1
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +40 -1
- package/dist/components/progress-circle.cjs +184 -1
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +147 -1
- package/dist/components/progress.cjs +52 -1
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +18 -1
- package/dist/components/radio-cards.cjs +66 -1
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +29 -1
- package/dist/components/radio-group.cjs +59 -1
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +22 -1
- package/dist/components/radio.cjs +47 -1
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +13 -1
- package/dist/components/resizable.cjs +71 -1
- package/dist/components/resizable.d.ts +8 -8
- package/dist/components/resizable.js +31 -1
- package/dist/components/scroll-area.cjs +140 -1
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +100 -1
- package/dist/components/select.cjs +180 -1
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +119 -1
- package/dist/components/separator.cjs +82 -1
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +42 -1
- package/dist/components/sheet.cjs +184 -1
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +123 -1
- package/dist/components/sidebar.cjs +506 -1
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +400 -1
- package/dist/components/skeleton.cjs +44 -1
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +10 -1
- package/dist/components/slider.cjs +79 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +45 -1
- package/dist/components/sonner.cjs +57 -1
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +17 -1
- package/dist/components/spinner.cjs +75 -1
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +41 -1
- package/dist/components/switch.cjs +49 -1
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +15 -1
- package/dist/components/table.cjs +118 -1
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +63 -1
- package/dist/components/tabs.cjs +75 -1
- package/dist/components/tabs.d.ts +3 -3
- package/dist/components/tabs.js +32 -1
- package/dist/components/textarea.cjs +44 -1
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +10 -1
- package/dist/components/toggle-group.cjs +90 -1
- package/dist/components/toggle-group.d.ts +10 -12
- package/dist/components/toggle-group.js +53 -1
- package/dist/components/toggle.cjs +71 -1
- package/dist/components/toggle.d.ts +10 -12
- package/dist/components/toggle.js +34 -1
- package/dist/components/tooltip.cjs +90 -1
- package/dist/components/tooltip.d.ts +3 -3
- package/dist/components/tooltip.js +44 -1
- package/dist/css/amber.css +95 -1
- package/dist/css/blue.css +95 -1
- package/dist/css/cyan.css +95 -1
- package/dist/css/emerald.css +95 -1
- package/dist/css/fuchsia.css +95 -1
- package/dist/css/gray.css +95 -1
- package/dist/css/green.css +95 -1
- package/dist/css/indigo.css +95 -1
- package/dist/css/lime.css +95 -1
- package/dist/css/neutral.css +95 -1
- package/dist/css/orange.css +95 -1
- package/dist/css/pink.css +95 -1
- package/dist/css/preset.css +118 -1
- package/dist/css/purple.css +95 -1
- package/dist/css/red.css +95 -1
- package/dist/css/rose.css +95 -1
- package/dist/css/sky.css +95 -1
- package/dist/css/slate.css +95 -1
- package/dist/css/stone.css +95 -1
- package/dist/css/style.css +3 -1
- package/dist/css/teal.css +95 -1
- package/dist/css/violet.css +95 -1
- package/dist/css/yellow.css +95 -1
- package/dist/css/zinc.css +95 -1
- package/dist/hooks/use-animated-value.cjs +74 -1
- package/dist/hooks/use-animated-value.d.ts +9 -10
- package/dist/hooks/use-animated-value.js +40 -1
- package/dist/hooks/use-copy-to-clipboard.cjs +57 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +18 -1
- package/dist/hooks/use-copy-to-clipboard.js +23 -1
- package/dist/hooks/use-is-mobile.cjs +39 -1
- package/dist/hooks/use-is-mobile.d.ts +15 -6
- package/dist/hooks/use-is-mobile.js +5 -1
- package/dist/hooks/use-media-query.cjs +56 -1
- package/dist/hooks/use-media-query.d.ts +11 -3
- package/dist/hooks/use-media-query.js +22 -1
- package/dist/hooks/use-mutation-observer.cjs +56 -1
- package/dist/hooks/use-mutation-observer.d.ts +8 -12
- package/dist/hooks/use-mutation-observer.js +22 -1
- package/dist/hooks/use-pagination.cjs +92 -1
- package/dist/hooks/use-pagination.d.ts +12 -10
- package/dist/hooks/use-pagination.js +55 -1
- package/dist/index.cjs +1081 -1
- package/dist/index.d.ts +130 -131
- package/dist/index.js +69 -1
- package/dist/primitives/checkbox-group.cjs +151 -1
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +99 -1
- package/dist/primitives/input-number.cjs +439 -1
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +381 -1
- package/dist/primitives/input.cjs +99 -1
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +53 -1
- package/dist/primitives/progress-circle.cjs +198 -1
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +128 -1
- package/package.json +385 -38
package/dist/components/table.js
CHANGED
|
@@ -1 +1,63 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
3
|
+
function Table({ className, ...props }) {
|
|
4
|
+
return /*#__PURE__*/ jsx("div", {
|
|
5
|
+
className: "relative w-full overflow-auto",
|
|
6
|
+
"data-slot": "table-cotainer",
|
|
7
|
+
children: /*#__PURE__*/ jsx("table", {
|
|
8
|
+
className: cn('w-full caption-bottom text-sm', className),
|
|
9
|
+
"data-slot": "table",
|
|
10
|
+
...props
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function TableHeader({ className, ...props }) {
|
|
15
|
+
return /*#__PURE__*/ jsx("thead", {
|
|
16
|
+
className: cn('*:border-b *:has-aria-expanded:bg-transparent', className),
|
|
17
|
+
"data-slot": "table-header",
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function TableBody({ className, ...props }) {
|
|
22
|
+
return /*#__PURE__*/ jsx("tbody", {
|
|
23
|
+
className: cn('*:last-child:border-0', className),
|
|
24
|
+
"data-slot": "table-body",
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function TableFooter({ className, ...props }) {
|
|
29
|
+
return /*#__PURE__*/ jsx("tfoot", {
|
|
30
|
+
className: cn('bg-muted/50 font-medium *:border-t *:border-b-0 *:has-aria-expanded:bg-transparent', className),
|
|
31
|
+
"data-slot": "table-footer",
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function TableRow({ className, ...props }) {
|
|
36
|
+
return /*#__PURE__*/ jsx("tr", {
|
|
37
|
+
className: cn('hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors', className),
|
|
38
|
+
"data-slot": "table-row",
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function TableHead({ className, ...props }) {
|
|
43
|
+
return /*#__PURE__*/ jsx("th", {
|
|
44
|
+
className: cn('p-2 text-left align-middle font-medium', className),
|
|
45
|
+
"data-slot": "table-head",
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function TableCell({ className, ...props }) {
|
|
50
|
+
return /*#__PURE__*/ jsx("td", {
|
|
51
|
+
className: cn('p-2 align-middle', className),
|
|
52
|
+
"data-slot": "table-cell",
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function TableCaption({ className, ...props }) {
|
|
57
|
+
return /*#__PURE__*/ jsx("caption", {
|
|
58
|
+
className: cn('text-muted-foreground mt-4 text-sm', className),
|
|
59
|
+
"data-slot": "table-caption",
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
package/dist/components/tabs.cjs
CHANGED
|
@@ -1,2 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
TabsList: ()=>TabsList,
|
|
29
|
+
Tabs: ()=>Tabs,
|
|
30
|
+
TabsTrigger: ()=>TabsTrigger,
|
|
31
|
+
TabsContent: ()=>TabsContent
|
|
32
|
+
});
|
|
33
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
34
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
35
|
+
const react_tabs_namespaceObject = require("@radix-ui/react-tabs");
|
|
36
|
+
function Tabs({ className, ...props }) {
|
|
37
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_tabs_namespaceObject.Root, {
|
|
38
|
+
className: (0, tailwind_variants_namespaceObject.cn)('flex flex-col gap-2', className),
|
|
39
|
+
"data-slot": "tabs",
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function TabsList({ className, ...props }) {
|
|
44
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_tabs_namespaceObject.List, {
|
|
45
|
+
className: (0, tailwind_variants_namespaceObject.cn)('bg-muted text-muted-foreground inline-flex w-fit items-center justify-center gap-1 rounded-xl px-1 py-1', className),
|
|
46
|
+
"data-slot": "tabs-list",
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function TabsTrigger({ className, ...props }) {
|
|
51
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_tabs_namespaceObject.Trigger, {
|
|
52
|
+
className: (0, tailwind_variants_namespaceObject.cn)("data-[state=active]:bg-background dark:data-[state=active]:bg-input/50 text-muted-foreground focus-visible:ring-ring/50 dark:outline-ring data-[state=active]:text-foreground hover:not-disabled:text-foreground inline-flex items-center justify-center gap-1.5 rounded-lg px-2 py-1.5 text-sm font-medium whitespace-nowrap transition not-dark:outline-hidden focus-visible:ring-3 disabled:opacity-50 data-[state=active]:shadow-sm dark:-outline-offset-1 dark:data-[state=active]:outline-1 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
53
|
+
"data-slot": "tabs-trigger",
|
|
54
|
+
...props
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function TabsContent({ className, ...props }) {
|
|
58
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_tabs_namespaceObject.Content, {
|
|
59
|
+
className: (0, tailwind_variants_namespaceObject.cn)('outline-ring ring-ring/50 mt-2 rounded-xl focus-visible:ring-4 focus-visible:outline-1', className),
|
|
60
|
+
"data-slot": "tabs-content",
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
exports.Tabs = __webpack_exports__.Tabs;
|
|
65
|
+
exports.TabsContent = __webpack_exports__.TabsContent;
|
|
66
|
+
exports.TabsList = __webpack_exports__.TabsList;
|
|
67
|
+
exports.TabsTrigger = __webpack_exports__.TabsTrigger;
|
|
68
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
69
|
+
"Tabs",
|
|
70
|
+
"TabsContent",
|
|
71
|
+
"TabsList",
|
|
72
|
+
"TabsTrigger"
|
|
73
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
74
|
+
Object.defineProperty(exports, '__esModule', {
|
|
75
|
+
value: true
|
|
76
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as TabsPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from 'react';
|
|
2
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
3
|
type TabsProps = ComponentProps<typeof TabsPrimitive.Root>;
|
|
4
|
-
declare function Tabs({ ...props }: TabsProps): JSX.Element;
|
|
4
|
+
declare function Tabs({ className, ...props }: TabsProps): JSX.Element;
|
|
5
5
|
type TabsListProps = ComponentProps<typeof TabsPrimitive.List>;
|
|
6
6
|
declare function TabsList({ className, ...props }: TabsListProps): JSX.Element;
|
|
7
7
|
type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Trigger>;
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,2 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
|
|
5
|
+
function Tabs({ className, ...props }) {
|
|
6
|
+
return /*#__PURE__*/ jsx(Root, {
|
|
7
|
+
className: cn('flex flex-col gap-2', className),
|
|
8
|
+
"data-slot": "tabs",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function TabsList({ className, ...props }) {
|
|
13
|
+
return /*#__PURE__*/ jsx(List, {
|
|
14
|
+
className: cn('bg-muted text-muted-foreground inline-flex w-fit items-center justify-center gap-1 rounded-xl px-1 py-1', className),
|
|
15
|
+
"data-slot": "tabs-list",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function TabsTrigger({ className, ...props }) {
|
|
20
|
+
return /*#__PURE__*/ jsx(Trigger, {
|
|
21
|
+
className: cn("data-[state=active]:bg-background dark:data-[state=active]:bg-input/50 text-muted-foreground focus-visible:ring-ring/50 dark:outline-ring data-[state=active]:text-foreground hover:not-disabled:text-foreground inline-flex items-center justify-center gap-1.5 rounded-lg px-2 py-1.5 text-sm font-medium whitespace-nowrap transition not-dark:outline-hidden focus-visible:ring-3 disabled:opacity-50 data-[state=active]:shadow-sm dark:-outline-offset-1 dark:data-[state=active]:outline-1 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
22
|
+
"data-slot": "tabs-trigger",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function TabsContent({ className, ...props }) {
|
|
27
|
+
return /*#__PURE__*/ jsx(Content, {
|
|
28
|
+
className: cn('outline-ring ring-ring/50 mt-2 rounded-xl focus-visible:ring-4 focus-visible:outline-1', className),
|
|
29
|
+
"data-slot": "tabs-content",
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -1 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
Textarea: ()=>Textarea
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
31
|
+
function Textarea({ className, ...props }) {
|
|
32
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("textarea", {
|
|
33
|
+
className: (0, tailwind_variants_namespaceObject.cn)('border-input hover:not-disabled:not-focus-visible:border-ring/60 focus-visible:border-ring focus-visible:ring-ring/50 placeholder:text-muted-foreground aria-invalid:border-destructive hover:not-disabled:not-focus-within:aria-invalid:border-destructive/60 focus-within:aria-invalid:ring-destructive/20 dark:focus-within:aria-invalid:ring-destructive/40 dark:bg-input/30 flex min-h-16 w-full grow rounded-lg border px-3 py-2 text-base shadow-xs outline-hidden transition focus-visible:ring-3 disabled:opacity-50 md:text-sm', className),
|
|
34
|
+
"data-slot": "textarea",
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
exports.Textarea = __webpack_exports__.Textarea;
|
|
39
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
40
|
+
"Textarea"
|
|
41
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
42
|
+
Object.defineProperty(exports, '__esModule', {
|
|
43
|
+
value: true
|
|
44
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
type TextareaProps = ComponentProps<
|
|
1
|
+
import type { ComponentProps, JSX } from 'react';
|
|
2
|
+
type TextareaProps = ComponentProps<'textarea'>;
|
|
3
3
|
declare function Textarea({ className, ...props }: TextareaProps): JSX.Element;
|
|
4
4
|
export { Textarea };
|
|
5
5
|
export type { TextareaProps };
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
3
|
+
function Textarea({ className, ...props }) {
|
|
4
|
+
return /*#__PURE__*/ jsx("textarea", {
|
|
5
|
+
className: cn('border-input hover:not-disabled:not-focus-visible:border-ring/60 focus-visible:border-ring focus-visible:ring-ring/50 placeholder:text-muted-foreground aria-invalid:border-destructive hover:not-disabled:not-focus-within:aria-invalid:border-destructive/60 focus-within:aria-invalid:ring-destructive/20 dark:focus-within:aria-invalid:ring-destructive/40 dark:bg-input/30 flex min-h-16 w-full grow rounded-lg border px-3 py-2 text-base shadow-xs outline-hidden transition focus-visible:ring-3 disabled:opacity-50 md:text-sm', className),
|
|
6
|
+
"data-slot": "textarea",
|
|
7
|
+
...props
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export { Textarea };
|
|
@@ -1,2 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
ToggleGroup: ()=>ToggleGroup,
|
|
29
|
+
ToggleGroupItem: ()=>ToggleGroupItem
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
33
|
+
const react_context_namespaceObject = require("@radix-ui/react-context");
|
|
34
|
+
const react_toggle_group_namespaceObject = require("@radix-ui/react-toggle-group");
|
|
35
|
+
const external_toggle_cjs_namespaceObject = require("./toggle.cjs");
|
|
36
|
+
const TOGGLE_GROUP_NAME = 'ToggleGroup';
|
|
37
|
+
const [createToggleGroupContext] = (0, react_context_namespaceObject.createContextScope)(TOGGLE_GROUP_NAME, [
|
|
38
|
+
react_toggle_group_namespaceObject.createToggleGroupScope
|
|
39
|
+
]);
|
|
40
|
+
const useToggleGroupScope = (0, react_toggle_group_namespaceObject.createToggleGroupScope)();
|
|
41
|
+
const [ToggleGroupProvider, useToggleGroupContext] = createToggleGroupContext(TOGGLE_GROUP_NAME);
|
|
42
|
+
function ToggleGroup({ __scopeToggleGroup, children, className, size, spacing = 0, variant, ...props }) {
|
|
43
|
+
const toggleGroupScope = useToggleGroupScope(__scopeToggleGroup);
|
|
44
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ToggleGroupProvider, {
|
|
45
|
+
scope: __scopeToggleGroup,
|
|
46
|
+
size: size,
|
|
47
|
+
spacing: spacing,
|
|
48
|
+
variant: variant,
|
|
49
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_toggle_group_namespaceObject.Root, {
|
|
50
|
+
className: (0, tailwind_variants_namespaceObject.cn)('group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-lg data-[spacing=default]:data-[variant=outline]:shadow-xs', className),
|
|
51
|
+
"data-size": size,
|
|
52
|
+
"data-slot": "toggle-group",
|
|
53
|
+
"data-spacing": spacing,
|
|
54
|
+
"data-variant": variant,
|
|
55
|
+
style: {
|
|
56
|
+
'--gap': spacing
|
|
57
|
+
},
|
|
58
|
+
...toggleGroupScope,
|
|
59
|
+
...props,
|
|
60
|
+
children: children
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const TOGGLE_GROUP_ITEM_NAME = 'ToggleGroupItem';
|
|
65
|
+
function ToggleGroupItem({ __scopeToggleGroup, children, className, ...props }) {
|
|
66
|
+
const { size, spacing, variant } = useToggleGroupContext(TOGGLE_GROUP_ITEM_NAME, __scopeToggleGroup);
|
|
67
|
+
const toggleGroupScope = useToggleGroupScope(__scopeToggleGroup);
|
|
68
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_toggle_group_namespaceObject.Item, {
|
|
69
|
+
className: (0, tailwind_variants_namespaceObject.cn)((0, external_toggle_cjs_namespaceObject.toggleVariants)({
|
|
70
|
+
className,
|
|
71
|
+
size,
|
|
72
|
+
variant
|
|
73
|
+
}), 'w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10', 'data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-lg data-[spacing=0]:last:rounded-r-lg data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l'),
|
|
74
|
+
"data-size": size,
|
|
75
|
+
"data-slot": "toggle-group-item",
|
|
76
|
+
"data-spacing": spacing,
|
|
77
|
+
"data-variant": variant,
|
|
78
|
+
...toggleGroupScope,
|
|
79
|
+
...props,
|
|
80
|
+
children: children
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
exports.ToggleGroup = __webpack_exports__.ToggleGroup;
|
|
84
|
+
exports.ToggleGroupItem = __webpack_exports__.ToggleGroupItem;
|
|
85
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
86
|
+
"ToggleGroup",
|
|
87
|
+
"ToggleGroupItem"
|
|
88
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
89
|
+
Object.defineProperty(exports, '__esModule', {
|
|
90
|
+
value: true
|
|
91
|
+
});
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
1
|
+
import type { Scope } from '@radix-ui/react-context';
|
|
2
|
+
import type { ComponentProps, JSX } from 'react';
|
|
3
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
4
|
+
import type { ToggleVariants } from './toggle';
|
|
6
5
|
type ScopedProps<P> = P & {
|
|
7
6
|
__scopeToggleGroup?: Scope;
|
|
8
7
|
};
|
|
9
|
-
type ToggleGroupProps = ComponentProps<typeof ToggleGroupPrimitive.Root> &
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
declare function ToggleGroupItem({ __scopeToggleGroup, children, className, prefix, suffix, ...props }: ToggleGroupItemProps): JSX.Element;
|
|
8
|
+
type ToggleGroupProps = ComponentProps<typeof ToggleGroupPrimitive.Root> & ToggleVariants & {
|
|
9
|
+
spacing?: number;
|
|
10
|
+
};
|
|
11
|
+
declare function ToggleGroup({ __scopeToggleGroup, children, className, size, spacing, variant, ...props }: ScopedProps<ToggleGroupProps>): JSX.Element;
|
|
12
|
+
type ToggleGroupItemProps = ScopedProps<ComponentProps<typeof ToggleGroupPrimitive.Item>>;
|
|
13
|
+
declare function ToggleGroupItem({ __scopeToggleGroup, children, className, ...props }: ToggleGroupItemProps): JSX.Element;
|
|
16
14
|
export { ToggleGroup, ToggleGroupItem };
|
|
17
15
|
export type { ToggleGroupItemProps, ToggleGroupProps };
|
|
@@ -1,2 +1,54 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { createContextScope } from "@radix-ui/react-context";
|
|
5
|
+
import { Item, Root, createToggleGroupScope } from "@radix-ui/react-toggle-group";
|
|
6
|
+
import { toggleVariants } from "./toggle.js";
|
|
7
|
+
const TOGGLE_GROUP_NAME = 'ToggleGroup';
|
|
8
|
+
const [createToggleGroupContext] = createContextScope(TOGGLE_GROUP_NAME, [
|
|
9
|
+
createToggleGroupScope
|
|
10
|
+
]);
|
|
11
|
+
const useToggleGroupScope = createToggleGroupScope();
|
|
12
|
+
const [ToggleGroupProvider, useToggleGroupContext] = createToggleGroupContext(TOGGLE_GROUP_NAME);
|
|
13
|
+
function ToggleGroup({ __scopeToggleGroup, children, className, size, spacing = 0, variant, ...props }) {
|
|
14
|
+
const toggleGroupScope = useToggleGroupScope(__scopeToggleGroup);
|
|
15
|
+
return /*#__PURE__*/ jsx(ToggleGroupProvider, {
|
|
16
|
+
scope: __scopeToggleGroup,
|
|
17
|
+
size: size,
|
|
18
|
+
spacing: spacing,
|
|
19
|
+
variant: variant,
|
|
20
|
+
children: /*#__PURE__*/ jsx(Root, {
|
|
21
|
+
className: cn('group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-lg data-[spacing=default]:data-[variant=outline]:shadow-xs', className),
|
|
22
|
+
"data-size": size,
|
|
23
|
+
"data-slot": "toggle-group",
|
|
24
|
+
"data-spacing": spacing,
|
|
25
|
+
"data-variant": variant,
|
|
26
|
+
style: {
|
|
27
|
+
'--gap': spacing
|
|
28
|
+
},
|
|
29
|
+
...toggleGroupScope,
|
|
30
|
+
...props,
|
|
31
|
+
children: children
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const TOGGLE_GROUP_ITEM_NAME = 'ToggleGroupItem';
|
|
36
|
+
function ToggleGroupItem({ __scopeToggleGroup, children, className, ...props }) {
|
|
37
|
+
const { size, spacing, variant } = useToggleGroupContext(TOGGLE_GROUP_ITEM_NAME, __scopeToggleGroup);
|
|
38
|
+
const toggleGroupScope = useToggleGroupScope(__scopeToggleGroup);
|
|
39
|
+
return /*#__PURE__*/ jsx(Item, {
|
|
40
|
+
className: cn(toggleVariants({
|
|
41
|
+
className,
|
|
42
|
+
size,
|
|
43
|
+
variant
|
|
44
|
+
}), 'w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10', 'data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-lg data-[spacing=0]:last:rounded-r-lg data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l'),
|
|
45
|
+
"data-size": size,
|
|
46
|
+
"data-slot": "toggle-group-item",
|
|
47
|
+
"data-spacing": spacing,
|
|
48
|
+
"data-variant": variant,
|
|
49
|
+
...toggleGroupScope,
|
|
50
|
+
...props,
|
|
51
|
+
children: children
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,2 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
Toggle: ()=>Toggle,
|
|
29
|
+
toggleVariants: ()=>toggleVariants
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
33
|
+
const react_toggle_namespaceObject = require("@radix-ui/react-toggle");
|
|
34
|
+
const toggleVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
35
|
+
base: "inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
36
|
+
variants: {
|
|
37
|
+
size: {
|
|
38
|
+
default: 'h-9 px-2 min-w-9',
|
|
39
|
+
lg: 'h-10 px-2.5 min-w-10',
|
|
40
|
+
sm: 'h-8 px-1.5 min-w-8'
|
|
41
|
+
},
|
|
42
|
+
variant: {
|
|
43
|
+
default: 'bg-transparent',
|
|
44
|
+
outline: 'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
size: 'default',
|
|
49
|
+
variant: 'default'
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
function Toggle({ children, className, size, variant, ...props }) {
|
|
53
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_toggle_namespaceObject.Root, {
|
|
54
|
+
className: toggleVariants({
|
|
55
|
+
className,
|
|
56
|
+
size,
|
|
57
|
+
variant
|
|
58
|
+
}),
|
|
59
|
+
"data-slot": "toggle",
|
|
60
|
+
...props,
|
|
61
|
+
children: children
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
exports.Toggle = __webpack_exports__.Toggle;
|
|
65
|
+
exports.toggleVariants = __webpack_exports__.toggleVariants;
|
|
66
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
67
|
+
"Toggle",
|
|
68
|
+
"toggleVariants"
|
|
69
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import * as TogglePrimitive from
|
|
1
|
+
import type { VariantProps } from '@codefast/tailwind-variants';
|
|
2
|
+
import type { ComponentProps, JSX } from 'react';
|
|
3
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
4
4
|
declare const toggleVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
5
|
size: {
|
|
6
|
-
|
|
7
|
-
md: string;
|
|
6
|
+
default: string;
|
|
8
7
|
lg: string;
|
|
8
|
+
sm: string;
|
|
9
9
|
};
|
|
10
10
|
variant: {
|
|
11
11
|
default: string;
|
|
12
12
|
outline: string;
|
|
13
13
|
};
|
|
14
14
|
}, Record<string, never>>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
suffix?: ReactNode;
|
|
15
|
+
type ToggleVariants = VariantProps<typeof toggleVariants>;
|
|
16
|
+
interface ToggleProps extends ComponentProps<typeof TogglePrimitive.Root>, ToggleVariants {
|
|
18
17
|
}
|
|
19
|
-
declare function Toggle({ children, className,
|
|
20
|
-
export { toggleVariants };
|
|
21
|
-
export {
|
|
22
|
-
export type { ToggleProps };
|
|
18
|
+
declare function Toggle({ children, className, size, variant, ...props }: ToggleProps): JSX.Element;
|
|
19
|
+
export { Toggle, toggleVariants };
|
|
20
|
+
export type { ToggleProps, ToggleVariants };
|
|
@@ -1,2 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { tv } from "@codefast/tailwind-variants";
|
|
4
|
+
import { Root } from "@radix-ui/react-toggle";
|
|
5
|
+
const toggleVariants = tv({
|
|
6
|
+
base: "inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
default: 'h-9 px-2 min-w-9',
|
|
10
|
+
lg: 'h-10 px-2.5 min-w-10',
|
|
11
|
+
sm: 'h-8 px-1.5 min-w-8'
|
|
12
|
+
},
|
|
13
|
+
variant: {
|
|
14
|
+
default: 'bg-transparent',
|
|
15
|
+
outline: 'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: 'default',
|
|
20
|
+
variant: 'default'
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function Toggle({ children, className, size, variant, ...props }) {
|
|
24
|
+
return /*#__PURE__*/ jsx(Root, {
|
|
25
|
+
className: toggleVariants({
|
|
26
|
+
className,
|
|
27
|
+
size,
|
|
28
|
+
variant
|
|
29
|
+
}),
|
|
30
|
+
"data-slot": "toggle",
|
|
31
|
+
...props,
|
|
32
|
+
children: children
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export { Toggle, toggleVariants };
|