@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
|
@@ -1,2 +1,87 @@
|
|
|
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
|
+
ButtonGroup: ()=>ButtonGroup,
|
|
29
|
+
ButtonGroupSeparator: ()=>ButtonGroupSeparator,
|
|
30
|
+
buttonGroupVariants: ()=>buttonGroupVariants,
|
|
31
|
+
ButtonGroupText: ()=>ButtonGroupText
|
|
32
|
+
});
|
|
33
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
34
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
35
|
+
const react_slot_namespaceObject = require("@radix-ui/react-slot");
|
|
36
|
+
const external_separator_cjs_namespaceObject = require("./separator.cjs");
|
|
37
|
+
const buttonGroupVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
38
|
+
base: (0, tailwind_variants_namespaceObject.cn)('flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2', "[&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit", '[&>*]:focus-visible:relative [&>*]:focus-visible:z-10 [&>input]:flex-1', 'has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg'),
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
orientation: 'horizontal'
|
|
41
|
+
},
|
|
42
|
+
variants: {
|
|
43
|
+
orientation: {
|
|
44
|
+
horizontal: '[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none',
|
|
45
|
+
vertical: 'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
function ButtonGroup({ className, orientation, ...props }) {
|
|
50
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
51
|
+
className: (0, tailwind_variants_namespaceObject.cn)(buttonGroupVariants({
|
|
52
|
+
orientation
|
|
53
|
+
}), className),
|
|
54
|
+
"data-orientation": orientation,
|
|
55
|
+
"data-slot": "button-group",
|
|
56
|
+
role: "group",
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function ButtonGroupText({ asChild = false, className, ...props }) {
|
|
61
|
+
const Component = asChild ? react_slot_namespaceObject.Slot : 'div';
|
|
62
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, {
|
|
63
|
+
className: (0, tailwind_variants_namespaceObject.cn)("bg-muted flex items-center gap-2 rounded-lg border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function ButtonGroupSeparator({ className, orientation = 'vertical', ...props }) {
|
|
68
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_separator_cjs_namespaceObject.Separator, {
|
|
69
|
+
className: (0, tailwind_variants_namespaceObject.cn)('bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto', className),
|
|
70
|
+
"data-slot": "button-group-separator",
|
|
71
|
+
orientation: orientation,
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
exports.ButtonGroup = __webpack_exports__.ButtonGroup;
|
|
76
|
+
exports.ButtonGroupSeparator = __webpack_exports__.ButtonGroupSeparator;
|
|
77
|
+
exports.ButtonGroupText = __webpack_exports__.ButtonGroupText;
|
|
78
|
+
exports.buttonGroupVariants = __webpack_exports__.buttonGroupVariants;
|
|
79
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
80
|
+
"ButtonGroup",
|
|
81
|
+
"ButtonGroupSeparator",
|
|
82
|
+
"ButtonGroupText",
|
|
83
|
+
"buttonGroupVariants"
|
|
84
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
85
|
+
Object.defineProperty(exports, '__esModule', {
|
|
86
|
+
value: true
|
|
87
|
+
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import { Separator } from
|
|
1
|
+
import type { VariantProps } from '@codefast/tailwind-variants';
|
|
2
|
+
import type { ComponentProps, JSX } from 'react';
|
|
3
|
+
import { Separator } from './separator';
|
|
4
4
|
declare const buttonGroupVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
5
|
orientation: {
|
|
6
6
|
horizontal: string;
|
|
7
7
|
vertical: string;
|
|
8
8
|
};
|
|
9
9
|
}, Record<string, never>>;
|
|
10
|
-
type ButtonGroupProps = ComponentProps<
|
|
10
|
+
type ButtonGroupProps = ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>;
|
|
11
11
|
declare function ButtonGroup({ className, orientation, ...props }: ButtonGroupProps): JSX.Element;
|
|
12
|
-
interface ButtonGroupTextProps extends ComponentProps<
|
|
12
|
+
interface ButtonGroupTextProps extends ComponentProps<'div'> {
|
|
13
13
|
asChild?: boolean;
|
|
14
14
|
}
|
|
15
15
|
declare function ButtonGroupText({ asChild, className, ...props }: ButtonGroupTextProps): JSX.Element;
|
|
@@ -1,2 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn, tv } from "@codefast/tailwind-variants";
|
|
4
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
+
import { Separator } from "./separator.js";
|
|
6
|
+
const buttonGroupVariants = tv({
|
|
7
|
+
base: cn('flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2', "[&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit", '[&>*]:focus-visible:relative [&>*]:focus-visible:z-10 [&>input]:flex-1', 'has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg'),
|
|
8
|
+
defaultVariants: {
|
|
9
|
+
orientation: 'horizontal'
|
|
10
|
+
},
|
|
11
|
+
variants: {
|
|
12
|
+
orientation: {
|
|
13
|
+
horizontal: '[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none',
|
|
14
|
+
vertical: 'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
function ButtonGroup({ className, orientation, ...props }) {
|
|
19
|
+
return /*#__PURE__*/ jsx("div", {
|
|
20
|
+
className: cn(buttonGroupVariants({
|
|
21
|
+
orientation
|
|
22
|
+
}), className),
|
|
23
|
+
"data-orientation": orientation,
|
|
24
|
+
"data-slot": "button-group",
|
|
25
|
+
role: "group",
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function ButtonGroupText({ asChild = false, className, ...props }) {
|
|
30
|
+
const Component = asChild ? Slot : 'div';
|
|
31
|
+
return /*#__PURE__*/ jsx(Component, {
|
|
32
|
+
className: cn("bg-muted flex items-center gap-2 rounded-lg border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function ButtonGroupSeparator({ className, orientation = 'vertical', ...props }) {
|
|
37
|
+
return /*#__PURE__*/ jsx(Separator, {
|
|
38
|
+
className: cn('bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto', className),
|
|
39
|
+
"data-slot": "button-group-separator",
|
|
40
|
+
orientation: orientation,
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -1 +1,92 @@
|
|
|
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
|
+
buttonVariants: ()=>buttonVariants,
|
|
28
|
+
Button: ()=>Button
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
32
|
+
const react_slot_namespaceObject = require("@radix-ui/react-slot");
|
|
33
|
+
const buttonVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
34
|
+
base: "focus-visible:ring-3 outline-hidden inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
size: 'md',
|
|
37
|
+
variant: 'default'
|
|
38
|
+
},
|
|
39
|
+
variants: {
|
|
40
|
+
size: {
|
|
41
|
+
'icon-sm': 'size-8',
|
|
42
|
+
icon: 'size-9',
|
|
43
|
+
'icon-lg': 'size-10',
|
|
44
|
+
sm: 'h-8 px-3 has-[>svg]:px-2.5',
|
|
45
|
+
md: 'h-9 px-4 has-[>svg]:px-3',
|
|
46
|
+
lg: 'h-10 px-6 has-[>svg]:px-4'
|
|
47
|
+
},
|
|
48
|
+
variant: {
|
|
49
|
+
default: 'bg-primary text-primary-foreground focus-visible:ring-primary/20 dark:focus-visible:ring-primary/40 hover:not-disabled:bg-primary/80',
|
|
50
|
+
destructive: 'bg-destructive dark:bg-destructive/60 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 hover:not-disabled:bg-destructive/90 text-white',
|
|
51
|
+
ghost: 'hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:ring-ring/50 dark:hover:not-disabled:bg-secondary/50',
|
|
52
|
+
link: 'text-primary hover:not-disabled:underline focus-visible:ring-ring/50 underline-offset-4',
|
|
53
|
+
outline: 'border-input shadow-xs hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:ring-ring/50 focus-visible:border-ring aria-invalid:border-destructive dark:aria-invalid:border-destructive/70 hover:not-disabled:aria-invalid:border-destructive/60 focus-within:aria-invalid:ring-destructive/20 dark:focus-within:aria-invalid:ring-destructive/40 dark:bg-input/30 dark:hover:not-disabled:bg-input/50 hover:not-disabled:border-ring/60 border',
|
|
54
|
+
secondary: 'bg-secondary text-secondary-foreground hover:not-disabled:bg-secondary/80 focus-visible:ring-ring/50'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
function Button({ asChild = false, children, className, size, type = 'button', variant, ...props }) {
|
|
59
|
+
const Comp = asChild ? react_slot_namespaceObject.Slot : 'button';
|
|
60
|
+
if (asChild) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Comp, {
|
|
61
|
+
className: buttonVariants({
|
|
62
|
+
className,
|
|
63
|
+
size,
|
|
64
|
+
variant
|
|
65
|
+
}),
|
|
66
|
+
"data-slot": "button",
|
|
67
|
+
"data-variant": variant,
|
|
68
|
+
...props,
|
|
69
|
+
children: children
|
|
70
|
+
});
|
|
71
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
72
|
+
className: buttonVariants({
|
|
73
|
+
className,
|
|
74
|
+
size,
|
|
75
|
+
variant
|
|
76
|
+
}),
|
|
77
|
+
"data-slot": "button",
|
|
78
|
+
"data-variant": variant,
|
|
79
|
+
type: type,
|
|
80
|
+
...props,
|
|
81
|
+
children: children
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
exports.Button = __webpack_exports__.Button;
|
|
85
|
+
exports.buttonVariants = __webpack_exports__.buttonVariants;
|
|
86
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
87
|
+
"Button",
|
|
88
|
+
"buttonVariants"
|
|
89
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
90
|
+
Object.defineProperty(exports, '__esModule', {
|
|
91
|
+
value: true
|
|
92
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { VariantProps } from '@codefast/tailwind-variants';
|
|
2
|
+
import type { ComponentProps, JSX } from 'react';
|
|
3
3
|
declare const buttonVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
4
4
|
size: {
|
|
5
|
-
|
|
5
|
+
'icon-sm': string;
|
|
6
6
|
icon: string;
|
|
7
|
-
|
|
7
|
+
'icon-lg': string;
|
|
8
8
|
sm: string;
|
|
9
9
|
md: string;
|
|
10
10
|
lg: string;
|
|
@@ -18,9 +18,9 @@ declare const buttonVariants: import("@codefast/tailwind-variants").VariantFunct
|
|
|
18
18
|
secondary: string;
|
|
19
19
|
};
|
|
20
20
|
}, Record<string, never>>;
|
|
21
|
-
type ButtonProps = ComponentProps<
|
|
21
|
+
type ButtonProps = ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
22
22
|
asChild?: boolean;
|
|
23
|
-
type?: ComponentProps<
|
|
23
|
+
type?: ComponentProps<'button'>['type'];
|
|
24
24
|
};
|
|
25
25
|
declare function Button({ asChild, children, className, size, type, variant, ...props }: ButtonProps): JSX.Element;
|
|
26
26
|
export { buttonVariants };
|
|
@@ -1 +1,55 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { tv } from "@codefast/tailwind-variants";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
const buttonVariants = tv({
|
|
5
|
+
base: "focus-visible:ring-3 outline-hidden inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
|
|
6
|
+
defaultVariants: {
|
|
7
|
+
size: 'md',
|
|
8
|
+
variant: 'default'
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
'icon-sm': 'size-8',
|
|
13
|
+
icon: 'size-9',
|
|
14
|
+
'icon-lg': 'size-10',
|
|
15
|
+
sm: 'h-8 px-3 has-[>svg]:px-2.5',
|
|
16
|
+
md: 'h-9 px-4 has-[>svg]:px-3',
|
|
17
|
+
lg: 'h-10 px-6 has-[>svg]:px-4'
|
|
18
|
+
},
|
|
19
|
+
variant: {
|
|
20
|
+
default: 'bg-primary text-primary-foreground focus-visible:ring-primary/20 dark:focus-visible:ring-primary/40 hover:not-disabled:bg-primary/80',
|
|
21
|
+
destructive: 'bg-destructive dark:bg-destructive/60 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 hover:not-disabled:bg-destructive/90 text-white',
|
|
22
|
+
ghost: 'hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:ring-ring/50 dark:hover:not-disabled:bg-secondary/50',
|
|
23
|
+
link: 'text-primary hover:not-disabled:underline focus-visible:ring-ring/50 underline-offset-4',
|
|
24
|
+
outline: 'border-input shadow-xs hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:ring-ring/50 focus-visible:border-ring aria-invalid:border-destructive dark:aria-invalid:border-destructive/70 hover:not-disabled:aria-invalid:border-destructive/60 focus-within:aria-invalid:ring-destructive/20 dark:focus-within:aria-invalid:ring-destructive/40 dark:bg-input/30 dark:hover:not-disabled:bg-input/50 hover:not-disabled:border-ring/60 border',
|
|
25
|
+
secondary: 'bg-secondary text-secondary-foreground hover:not-disabled:bg-secondary/80 focus-visible:ring-ring/50'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
function Button({ asChild = false, children, className, size, type = 'button', variant, ...props }) {
|
|
30
|
+
const Comp = asChild ? Slot : 'button';
|
|
31
|
+
if (asChild) return /*#__PURE__*/ jsx(Comp, {
|
|
32
|
+
className: buttonVariants({
|
|
33
|
+
className,
|
|
34
|
+
size,
|
|
35
|
+
variant
|
|
36
|
+
}),
|
|
37
|
+
"data-slot": "button",
|
|
38
|
+
"data-variant": variant,
|
|
39
|
+
...props,
|
|
40
|
+
children: children
|
|
41
|
+
});
|
|
42
|
+
return /*#__PURE__*/ jsx("button", {
|
|
43
|
+
className: buttonVariants({
|
|
44
|
+
className,
|
|
45
|
+
size,
|
|
46
|
+
variant
|
|
47
|
+
}),
|
|
48
|
+
"data-slot": "button",
|
|
49
|
+
"data-variant": variant,
|
|
50
|
+
type: type,
|
|
51
|
+
...props,
|
|
52
|
+
children: children
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export { Button, buttonVariants };
|
|
@@ -1,2 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
"use strict";const __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Calendar:()=>Calendar,CalendarRangeLabel:()=>CalendarRangeLabel,CalendarLabel:()=>CalendarLabel});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_date_fns_namespaceObject=require("date-fns"),external_lucide_react_namespaceObject=require("lucide-react"),external_react_day_picker_namespaceObject=require("react-day-picker"),external_button_cjs_namespaceObject=require("./button.cjs"),tailwind_variants_namespaceObject=require("@codefast/tailwind-variants");function Chevron({className:e,orientation:a,...t}){switch(a){case"up":return(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronUpIcon,{className:(0,tailwind_variants_namespaceObject.cn)("size-4",e),...t});case"down":return(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDownIcon,{className:(0,tailwind_variants_namespaceObject.cn)("size-4",e),...t});case"left":return(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronLeftIcon,{className:(0,tailwind_variants_namespaceObject.cn)("size-4",e),...t});case"right":return(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronRightIcon,{className:(0,tailwind_variants_namespaceObject.cn)("size-4",e),...t});case void 0:throw Error("Not implemented yet: undefined case");default:return(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.DotIcon,{className:(0,tailwind_variants_namespaceObject.cn)("size-4",e),...t})}}function Calendar({classNames:e,showOutsideDays:a=!0,...t}){let c=void 0!==t.mode||void 0!==t.onDayClick;return(0,jsx_runtime_namespaceObject.jsx)(external_react_day_picker_namespaceObject.DayPicker,{classNames:{[external_react_day_picker_namespaceObject.UI.CaptionLabel]:(0,tailwind_variants_namespaceObject.cn)("flex items-center gap-2 [&>svg]:opacity-50",e?.[external_react_day_picker_namespaceObject.UI.CaptionLabel]),[external_react_day_picker_namespaceObject.UI.Chevron]:(0,tailwind_variants_namespaceObject.cn)(e?.[external_react_day_picker_namespaceObject.UI.Chevron]),[external_react_day_picker_namespaceObject.UI.Day]:(0,tailwind_variants_namespaceObject.cn)("grid place-items-center text-center text-sm",c?"min-w-8.5 has-focus-visible:z-20 group":"min-w-8.5 h-8",e?.[external_react_day_picker_namespaceObject.UI.Day]),[external_react_day_picker_namespaceObject.UI.DayButton]:(0,tailwind_variants_namespaceObject.cn)("group-[.is-outside]:text-muted-foreground hover:not-disabled:not-group-aria-selected:bg-secondary hover:not-disabled:not-group-aria-selected:text-secondary-foreground group-data-today:not-group-aria-selected:bg-secondary group-data-today:not-group-aria-selected:text-secondary-foreground group-aria-selected:not-group-[.is-range-middle]:bg-primary group-aria-selected:not-group-[.is-range-middle]:text-primary-foreground outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:ring-primary/20 dark:group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:ring-primary/40 group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:border-primary size-8 rounded-lg border border-transparent disabled:opacity-50",e?.[external_react_day_picker_namespaceObject.UI.DayButton]),[external_react_day_picker_namespaceObject.UI.Dropdown]:(0,tailwind_variants_namespaceObject.cn)("absolute opacity-0",e?.[external_react_day_picker_namespaceObject.UI.Dropdown]),[external_react_day_picker_namespaceObject.UI.DropdownRoot]:(0,tailwind_variants_namespaceObject.cn)("relative",e?.[external_react_day_picker_namespaceObject.UI.DropdownRoot]),[external_react_day_picker_namespaceObject.UI.Dropdowns]:(0,tailwind_variants_namespaceObject.cn)("flex gap-4",e?.[external_react_day_picker_namespaceObject.UI.Dropdowns]),[external_react_day_picker_namespaceObject.UI.Footer]:(0,tailwind_variants_namespaceObject.cn)(e?.[external_react_day_picker_namespaceObject.UI.Footer]),[external_react_day_picker_namespaceObject.UI.Month]:(0,tailwind_variants_namespaceObject.cn)("flex flex-col gap-4",e?.[external_react_day_picker_namespaceObject.UI.Month]),[external_react_day_picker_namespaceObject.UI.MonthCaption]:(0,tailwind_variants_namespaceObject.cn)("py-1 text-sm font-medium",e?.[external_react_day_picker_namespaceObject.UI.MonthCaption]),[external_react_day_picker_namespaceObject.UI.MonthGrid]:(0,tailwind_variants_namespaceObject.cn)(e?.[external_react_day_picker_namespaceObject.UI.MonthGrid]),[external_react_day_picker_namespaceObject.UI.Months]:(0,tailwind_variants_namespaceObject.cn)("relative flex gap-4",e?.[external_react_day_picker_namespaceObject.UI.Months]),[external_react_day_picker_namespaceObject.UI.MonthsDropdown]:(0,tailwind_variants_namespaceObject.cn)(e?.[external_react_day_picker_namespaceObject.UI.MonthsDropdown]),[external_react_day_picker_namespaceObject.UI.Nav]:(0,tailwind_variants_namespaceObject.cn)("absolute end-0 flex gap-2",e?.[external_react_day_picker_namespaceObject.UI.Nav]),[external_react_day_picker_namespaceObject.UI.NextMonthButton]:(0,external_button_cjs_namespaceObject.buttonVariants)({className:["size-7",e?.[external_react_day_picker_namespaceObject.UI.NextMonthButton]],size:"icon",variant:"ghost"}),[external_react_day_picker_namespaceObject.UI.PreviousMonthButton]:(0,external_button_cjs_namespaceObject.buttonVariants)({className:["size-7",e?.[external_react_day_picker_namespaceObject.UI.PreviousMonthButton]],size:"icon",variant:"ghost"}),[external_react_day_picker_namespaceObject.UI.Root]:(0,tailwind_variants_namespaceObject.cn)("p-3",e?.[external_react_day_picker_namespaceObject.UI.Root]),[external_react_day_picker_namespaceObject.UI.Week]:(0,tailwind_variants_namespaceObject.cn)("mt-2 flex justify-between",e?.[external_react_day_picker_namespaceObject.UI.Week]),[external_react_day_picker_namespaceObject.UI.Weekday]:(0,tailwind_variants_namespaceObject.cn)("text-muted-foreground min-w-8.5 text-xs font-medium",e?.[external_react_day_picker_namespaceObject.UI.Weekday]),[external_react_day_picker_namespaceObject.UI.Weekdays]:(0,tailwind_variants_namespaceObject.cn)("flex w-full justify-between",e?.[external_react_day_picker_namespaceObject.UI.Weekdays]),[external_react_day_picker_namespaceObject.UI.WeekNumber]:(0,tailwind_variants_namespaceObject.cn)("text-muted-foreground min-w-8.5 grid h-8 place-items-center text-xs font-normal [&+*]:rounded-l-lg",e?.[external_react_day_picker_namespaceObject.UI.WeekNumber]),[external_react_day_picker_namespaceObject.UI.WeekNumberHeader]:(0,tailwind_variants_namespaceObject.cn)("min-w-8.5",e?.[external_react_day_picker_namespaceObject.UI.WeekNumberHeader]),[external_react_day_picker_namespaceObject.UI.Weeks]:(0,tailwind_variants_namespaceObject.cn)(e?.[external_react_day_picker_namespaceObject.UI.Weeks]),[external_react_day_picker_namespaceObject.UI.YearsDropdown]:(0,tailwind_variants_namespaceObject.cn)(e?.[external_react_day_picker_namespaceObject.UI.YearsDropdown]),[external_react_day_picker_namespaceObject.SelectionState.range_end]:(0,tailwind_variants_namespaceObject.cn)("to-secondary is-range-end rounded-r-lg bg-gradient-to-l first:rounded-l-lg",e?.[external_react_day_picker_namespaceObject.SelectionState.range_end]),[external_react_day_picker_namespaceObject.SelectionState.range_middle]:(0,tailwind_variants_namespaceObject.cn)("is-range-middle bg-secondary text-secondary-foreground first:rounded-l-lg last:rounded-r-lg",e?.[external_react_day_picker_namespaceObject.SelectionState.range_middle]),[external_react_day_picker_namespaceObject.SelectionState.range_start]:(0,tailwind_variants_namespaceObject.cn)("to-secondary is-range-start rounded-l-lg bg-gradient-to-r last:rounded-r-lg",e?.[external_react_day_picker_namespaceObject.SelectionState.range_start]),[external_react_day_picker_namespaceObject.SelectionState.selected]:(0,tailwind_variants_namespaceObject.cn)("is-selected",e?.[external_react_day_picker_namespaceObject.SelectionState.selected]),[external_react_day_picker_namespaceObject.DayFlag.disabled]:(0,tailwind_variants_namespaceObject.cn)("is-disabled",e?.[external_react_day_picker_namespaceObject.DayFlag.disabled]),[external_react_day_picker_namespaceObject.DayFlag.focused]:(0,tailwind_variants_namespaceObject.cn)("is-focused",e?.[external_react_day_picker_namespaceObject.DayFlag.focused]),[external_react_day_picker_namespaceObject.DayFlag.hidden]:(0,tailwind_variants_namespaceObject.cn)("is-hidden size-8",e?.[external_react_day_picker_namespaceObject.DayFlag.hidden]),[external_react_day_picker_namespaceObject.DayFlag.outside]:(0,tailwind_variants_namespaceObject.cn)("is-outside",e?.[external_react_day_picker_namespaceObject.DayFlag.outside]),[external_react_day_picker_namespaceObject.DayFlag.today]:(0,tailwind_variants_namespaceObject.cn)("is-today",e?.[external_react_day_picker_namespaceObject.DayFlag.today])},components:{Chevron},showOutsideDays:a,...t})}function CalendarRangeLabel({date:e,formatStr:a="LLL dd, y",placeholder:t="Pick a date"}){if(!e?.from)return(0,jsx_runtime_namespaceObject.jsx)("span",{className:"truncate",children:t});let c=(0,external_date_fns_namespaceObject.format)(e.from,a);if(!e.to)return(0,jsx_runtime_namespaceObject.jsx)("span",{className:"truncate",children:c});let n=(0,external_date_fns_namespaceObject.format)(e.to,a);return(0,jsx_runtime_namespaceObject.jsxs)("span",{className:"truncate",children:[c," - ",n]})}function CalendarLabel({date:e,formatStr:a="PPP",placeholder:t="Pick a date"}){return e?(0,jsx_runtime_namespaceObject.jsx)("span",{className:"truncate",children:(0,external_date_fns_namespaceObject.format)(e,a)}):(0,jsx_runtime_namespaceObject.jsx)("span",{className:"truncate",children:t})}for(var __webpack_i__ in exports.Calendar=__webpack_exports__.Calendar,exports.CalendarLabel=__webpack_exports__.CalendarLabel,exports.CalendarRangeLabel=__webpack_exports__.CalendarRangeLabel,__webpack_exports__)-1===["Calendar","CalendarLabel","CalendarRangeLabel"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
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
|
+
Calendar: ()=>Calendar,
|
|
29
|
+
CalendarDayButton: ()=>CalendarDayButton
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
33
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
34
|
+
const external_react_namespaceObject = require("react");
|
|
35
|
+
const external_react_day_picker_namespaceObject = require("react-day-picker");
|
|
36
|
+
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
37
|
+
function Calendar({ buttonVariant = 'ghost', captionLayout = 'label', className, classNames, components, formatters, showOutsideDays = true, ...props }) {
|
|
38
|
+
const defaultClassNames = (0, external_react_day_picker_namespaceObject.getDefaultClassNames)();
|
|
39
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_day_picker_namespaceObject.DayPicker, {
|
|
40
|
+
captionLayout: captionLayout,
|
|
41
|
+
className: (0, tailwind_variants_namespaceObject.cn)('bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent', 'rtl:**:[.rdp-button_next>svg]:rotate-180', 'rtl:**:[.rdp-button_previous>svg]:rotate-180', className),
|
|
42
|
+
classNames: {
|
|
43
|
+
button_next: (0, tailwind_variants_namespaceObject.cn)((0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
44
|
+
variant: buttonVariant
|
|
45
|
+
}), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next),
|
|
46
|
+
button_previous: (0, tailwind_variants_namespaceObject.cn)((0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
47
|
+
variant: buttonVariant
|
|
48
|
+
}), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous),
|
|
49
|
+
caption_label: (0, tailwind_variants_namespaceObject.cn)('select-none font-medium', 'label' === captionLayout ? 'text-sm' : 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label),
|
|
50
|
+
day: (0, tailwind_variants_namespaceObject.cn)('relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none', props.showWeekNumber ? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-md' : '[&:first-child[data-selected=true]_button]:rounded-l-md', defaultClassNames.day),
|
|
51
|
+
disabled: (0, tailwind_variants_namespaceObject.cn)('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
52
|
+
dropdown: (0, tailwind_variants_namespaceObject.cn)('absolute bg-popover inset-0 opacity-0', defaultClassNames.dropdown),
|
|
53
|
+
dropdown_root: (0, tailwind_variants_namespaceObject.cn)('relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-3 rounded-md', defaultClassNames.dropdown_root),
|
|
54
|
+
dropdowns: (0, tailwind_variants_namespaceObject.cn)('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns),
|
|
55
|
+
hidden: (0, tailwind_variants_namespaceObject.cn)('invisible', defaultClassNames.hidden),
|
|
56
|
+
month: (0, tailwind_variants_namespaceObject.cn)('flex flex-col w-full gap-4', defaultClassNames.month),
|
|
57
|
+
month_caption: (0, tailwind_variants_namespaceObject.cn)('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption),
|
|
58
|
+
months: (0, tailwind_variants_namespaceObject.cn)('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
|
|
59
|
+
nav: (0, tailwind_variants_namespaceObject.cn)('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav),
|
|
60
|
+
outside: (0, tailwind_variants_namespaceObject.cn)('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
|
|
61
|
+
range_end: (0, tailwind_variants_namespaceObject.cn)('rounded-r-md bg-accent', defaultClassNames.range_end),
|
|
62
|
+
range_middle: (0, tailwind_variants_namespaceObject.cn)('rounded-none', defaultClassNames.range_middle),
|
|
63
|
+
range_start: (0, tailwind_variants_namespaceObject.cn)('rounded-l-md bg-accent', defaultClassNames.range_start),
|
|
64
|
+
root: (0, tailwind_variants_namespaceObject.cn)('w-fit', defaultClassNames.root),
|
|
65
|
+
table: 'w-full border-collapse',
|
|
66
|
+
today: (0, tailwind_variants_namespaceObject.cn)('bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today),
|
|
67
|
+
week: (0, tailwind_variants_namespaceObject.cn)('flex w-full mt-2', defaultClassNames.week),
|
|
68
|
+
week_number: (0, tailwind_variants_namespaceObject.cn)('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number),
|
|
69
|
+
week_number_header: (0, tailwind_variants_namespaceObject.cn)('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
70
|
+
weekday: (0, tailwind_variants_namespaceObject.cn)('text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday),
|
|
71
|
+
weekdays: (0, tailwind_variants_namespaceObject.cn)('flex', defaultClassNames.weekdays),
|
|
72
|
+
...classNames
|
|
73
|
+
},
|
|
74
|
+
components: {
|
|
75
|
+
Chevron: CalendarChevron,
|
|
76
|
+
DayButton: CalendarDayButton,
|
|
77
|
+
Root: CalendarRoot,
|
|
78
|
+
WeekNumber: CalendarWeekNumber,
|
|
79
|
+
...components
|
|
80
|
+
},
|
|
81
|
+
formatters: {
|
|
82
|
+
formatMonthDropdown: (date)=>date.toLocaleString('default', {
|
|
83
|
+
month: 'short'
|
|
84
|
+
}),
|
|
85
|
+
...formatters
|
|
86
|
+
},
|
|
87
|
+
showOutsideDays: showOutsideDays,
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function CalendarChevron({ className, orientation, ...props }) {
|
|
92
|
+
if ('left' === orientation) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronLeftIcon, {
|
|
93
|
+
className: (0, tailwind_variants_namespaceObject.cn)('size-4', className),
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
96
|
+
if ('right' === orientation) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronRightIcon, {
|
|
97
|
+
className: (0, tailwind_variants_namespaceObject.cn)('size-4', className),
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDownIcon, {
|
|
101
|
+
className: (0, tailwind_variants_namespaceObject.cn)('size-4', className),
|
|
102
|
+
...props
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function CalendarRoot({ className, rootRef, ...props }) {
|
|
106
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
107
|
+
ref: rootRef,
|
|
108
|
+
className: (0, tailwind_variants_namespaceObject.cn)(className),
|
|
109
|
+
"data-slot": "calendar",
|
|
110
|
+
...props
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function CalendarWeekNumber({ children, ...props }) {
|
|
114
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("td", {
|
|
115
|
+
...props,
|
|
116
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
117
|
+
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
118
|
+
children: children
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
123
|
+
const defaultClassNames = (0, external_react_day_picker_namespaceObject.getDefaultClassNames)();
|
|
124
|
+
const ref = (0, external_react_namespaceObject.useRef)(null);
|
|
125
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
126
|
+
if (modifiers.focused) ref.current?.focus();
|
|
127
|
+
}, [
|
|
128
|
+
modifiers.focused
|
|
129
|
+
]);
|
|
130
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
131
|
+
ref: ref,
|
|
132
|
+
className: (0, tailwind_variants_namespaceObject.cn)('data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-3 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className),
|
|
133
|
+
"data-day": day.date.toLocaleDateString(),
|
|
134
|
+
"data-range-end": modifiers.range_end,
|
|
135
|
+
"data-range-middle": modifiers.range_middle,
|
|
136
|
+
"data-range-start": modifiers.range_start,
|
|
137
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
138
|
+
size: "icon",
|
|
139
|
+
variant: "ghost",
|
|
140
|
+
...props
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
exports.Calendar = __webpack_exports__.Calendar;
|
|
144
|
+
exports.CalendarDayButton = __webpack_exports__.CalendarDayButton;
|
|
145
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
146
|
+
"Calendar",
|
|
147
|
+
"CalendarDayButton"
|
|
148
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
149
|
+
Object.defineProperty(exports, '__esModule', {
|
|
150
|
+
value: true
|
|
151
|
+
});
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import type { ComponentProps, JSX
|
|
2
|
-
import type {
|
|
3
|
-
import { DayPicker } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
date: Date | undefined;
|
|
14
|
-
formatStr?: string;
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
}
|
|
17
|
-
declare function CalendarLabel({ date, formatStr: formatString, placeholder, }: CalendarLabelProps): ReactNode;
|
|
18
|
-
export { Calendar, CalendarLabel, CalendarRangeLabel };
|
|
19
|
-
export type { CalendarLabelProps, CalendarProps, CalendarRangeLabelProps };
|
|
1
|
+
import type { ComponentProps, JSX } from 'react';
|
|
2
|
+
import type { DayButton } from 'react-day-picker';
|
|
3
|
+
import { DayPicker } from 'react-day-picker';
|
|
4
|
+
import { Button } from './button';
|
|
5
|
+
type CalendarProps = ComponentProps<typeof DayPicker> & {
|
|
6
|
+
buttonVariant?: ComponentProps<typeof Button>['variant'];
|
|
7
|
+
};
|
|
8
|
+
declare function Calendar({ buttonVariant, captionLayout, className, classNames, components, formatters, showOutsideDays, ...props }: CalendarProps): JSX.Element;
|
|
9
|
+
type CalendarDayButtonProps = ComponentProps<typeof DayButton>;
|
|
10
|
+
declare function CalendarDayButton({ className, day, modifiers, ...props }: CalendarDayButtonProps): JSX.Element;
|
|
11
|
+
export { Calendar, CalendarDayButton };
|
|
12
|
+
export type { CalendarDayButtonProps, CalendarProps };
|