@codefast/ui 0.3.9 → 0.3.11-canary.0
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 +30 -0
- package/README.md +277 -167
- package/dist/components/accordion.cjs +97 -1
- package/dist/components/accordion.js +51 -1
- package/dist/components/alert-dialog.cjs +155 -1
- package/dist/components/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog.js +94 -1
- package/dist/components/alert.cjs +84 -1
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +41 -1
- package/dist/components/aspect-ratio.cjs +43 -1
- package/dist/components/aspect-ratio.js +9 -1
- package/dist/components/avatar.cjs +65 -1
- package/dist/components/avatar.js +25 -1
- package/dist/components/badge.cjs +66 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +29 -1
- package/dist/components/breadcrumb.cjs +124 -1
- package/dist/components/breadcrumb.js +72 -1
- package/dist/components/button-group.cjs +86 -1
- package/dist/components/button-group.d.ts +1 -1
- package/dist/components/button-group.js +43 -1
- package/dist/components/button.cjs +92 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +55 -1
- package/dist/components/calendar.cjs +150 -1
- package/dist/components/calendar.d.ts +11 -18
- package/dist/components/calendar.js +113 -1
- package/dist/components/card.cjs +105 -1
- package/dist/components/card.js +53 -1
- package/dist/components/carousel.cjs +210 -1
- package/dist/components/carousel.d.ts +1 -1
- package/dist/components/carousel.js +151 -1
- package/dist/components/chart.cjs +250 -3
- package/dist/components/chart.d.ts +5 -4
- package/dist/components/chart.js +198 -3
- package/dist/components/checkbox-cards.cjs +69 -1
- package/dist/components/checkbox-cards.js +32 -1
- package/dist/components/checkbox-group.cjs +63 -1
- package/dist/components/checkbox-group.js +26 -1
- package/dist/components/checkbox.cjs +53 -1
- package/dist/components/checkbox.js +19 -1
- package/dist/components/collapsible.cjs +61 -1
- package/dist/components/collapsible.js +21 -1
- package/dist/components/command.cjs +167 -1
- package/dist/components/command.js +106 -1
- package/dist/components/context-menu.cjs +218 -1
- package/dist/components/context-menu.js +142 -1
- package/dist/components/dialog.cjs +164 -1
- package/dist/components/dialog.d.ts +2 -2
- package/dist/components/dialog.js +106 -1
- package/dist/components/drawer.cjs +143 -1
- package/dist/components/drawer.d.ts +1 -1
- package/dist/components/drawer.js +85 -1
- package/dist/components/dropdown-menu.cjs +221 -1
- package/dist/components/dropdown-menu.js +145 -1
- package/dist/components/empty.cjs +113 -1
- package/dist/components/empty.d.ts +1 -1
- package/dist/components/empty.js +61 -1
- package/dist/components/field.cjs +193 -1
- package/dist/components/field.d.ts +1 -1
- package/dist/components/field.js +129 -1
- package/dist/components/form.cjs +151 -1
- package/dist/components/form.d.ts +3 -3
- package/dist/components/form.js +96 -1
- package/dist/components/hover-card.cjs +77 -1
- package/dist/components/hover-card.js +34 -1
- package/dist/components/input-group.cjs +155 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-group.js +97 -1
- package/dist/components/input-number.cjs +98 -1
- package/dist/components/input-number.js +64 -1
- package/dist/components/input-otp.cjs +101 -1
- package/dist/components/input-otp.js +49 -1
- package/dist/components/input-password.cjs +71 -1
- package/dist/components/input-password.js +37 -1
- package/dist/components/input-search.cjs +80 -1
- package/dist/components/input-search.js +46 -1
- package/dist/components/input.cjs +45 -1
- package/dist/components/input.js +11 -1
- package/dist/components/item.cjs +186 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/item.js +119 -1
- package/dist/components/kbd.cjs +54 -1
- package/dist/components/kbd.js +17 -1
- package/dist/components/label.cjs +45 -1
- package/dist/components/label.js +11 -1
- package/dist/components/menubar.cjs +232 -1
- package/dist/components/menubar.js +153 -1
- package/dist/components/native-select.cjs +75 -1
- package/dist/components/native-select.js +35 -1
- package/dist/components/navigation-menu.cjs +146 -2
- package/dist/components/navigation-menu.js +94 -2
- package/dist/components/pagination.cjs +138 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +86 -1
- package/dist/components/popover.cjs +86 -1
- package/dist/components/popover.js +40 -1
- package/dist/components/progress-circle.cjs +184 -1
- package/dist/components/progress-circle.d.ts +1 -1
- package/dist/components/progress-circle.js +147 -1
- package/dist/components/progress.cjs +52 -1
- package/dist/components/progress.js +18 -1
- package/dist/components/radio-cards.cjs +66 -1
- package/dist/components/radio-cards.js +29 -1
- package/dist/components/radio-group.cjs +59 -1
- package/dist/components/radio-group.js +22 -1
- package/dist/components/radio.cjs +47 -1
- package/dist/components/radio.js +13 -1
- package/dist/components/resizable.cjs +71 -1
- package/dist/components/resizable.d.ts +6 -6
- package/dist/components/resizable.js +31 -1
- package/dist/components/scroll-area.cjs +140 -1
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area.js +100 -1
- package/dist/components/select.cjs +180 -1
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +119 -1
- package/dist/components/separator.cjs +82 -1
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js +42 -1
- package/dist/components/sheet.cjs +184 -1
- package/dist/components/sheet.d.ts +2 -2
- package/dist/components/sheet.js +123 -1
- package/dist/components/sidebar.cjs +506 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +400 -1
- package/dist/components/skeleton.cjs +44 -1
- package/dist/components/skeleton.js +10 -1
- package/dist/components/slider.cjs +79 -1
- package/dist/components/slider.js +45 -1
- package/dist/components/sonner.cjs +57 -1
- package/dist/components/sonner.js +17 -1
- package/dist/components/spinner.cjs +75 -1
- package/dist/components/spinner.js +41 -1
- package/dist/components/switch.cjs +49 -1
- package/dist/components/switch.js +15 -1
- package/dist/components/table.cjs +118 -1
- package/dist/components/table.js +63 -1
- package/dist/components/tabs.cjs +75 -1
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.js +32 -1
- package/dist/components/textarea.cjs +44 -1
- package/dist/components/textarea.js +10 -1
- package/dist/components/toggle-group.cjs +90 -1
- package/dist/components/toggle-group.d.ts +8 -10
- package/dist/components/toggle-group.js +53 -1
- package/dist/components/toggle.cjs +71 -1
- package/dist/components/toggle.d.ts +8 -10
- package/dist/components/toggle.js +34 -1
- package/dist/components/tooltip.cjs +90 -1
- 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 +17 -0
- 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 +7 -11
- 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 +4 -5
- package/dist/index.js +69 -1
- package/dist/primitives/checkbox-group.cjs +151 -1
- package/dist/primitives/checkbox-group.d.ts +1 -1
- package/dist/primitives/checkbox-group.js +99 -1
- package/dist/primitives/input-number.cjs +439 -1
- package/dist/primitives/input-number.d.ts +1 -1
- package/dist/primitives/input-number.js +381 -1
- package/dist/primitives/input.cjs +99 -1
- package/dist/primitives/input.d.ts +1 -1
- package/dist/primitives/input.js +53 -1
- package/dist/primitives/progress-circle.cjs +198 -1
- package/dist/primitives/progress-circle.d.ts +1 -1
- package/dist/primitives/progress-circle.js +128 -1
- package/package.json +405 -62
|
@@ -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: "inline-flex shrink-0 items-center justify-center gap-2 rounded-lg text-sm font-medium whitespace-nowrap outline-hidden transition select-none focus-visible:ring-3 disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
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 hover:not-disabled:bg-primary/80 focus-visible:ring-primary/20 dark:focus-visible:ring-primary/40",
|
|
50
|
+
destructive: "bg-destructive text-white hover:not-disabled:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
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 underline-offset-4 hover:not-disabled:underline focus-visible:ring-ring/50",
|
|
53
|
+
outline: "border border-input shadow-xs hover:not-disabled:border-ring/60 hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive focus-within:aria-invalid:ring-destructive/20 hover:not-disabled:aria-invalid:border-destructive/60 dark:bg-input/30 dark:hover:not-disabled:bg-input/50 dark:aria-invalid:border-destructive/70 dark:focus-within:aria-invalid:ring-destructive/40",
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
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;
|
|
@@ -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: "inline-flex shrink-0 items-center justify-center gap-2 rounded-lg text-sm font-medium whitespace-nowrap outline-hidden transition select-none focus-visible:ring-3 disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
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 hover:not-disabled:bg-primary/80 focus-visible:ring-primary/20 dark:focus-visible:ring-primary/40",
|
|
21
|
+
destructive: "bg-destructive text-white hover:not-disabled:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
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 underline-offset-4 hover:not-disabled:underline focus-visible:ring-ring/50",
|
|
24
|
+
outline: "border border-input shadow-xs hover:not-disabled:border-ring/60 hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive focus-within:aria-invalid:ring-destructive/20 hover:not-disabled:aria-invalid:border-destructive/60 dark:bg-input/30 dark:hover:not-disabled:bg-input/50 dark:aria-invalid:border-destructive/70 dark:focus-within:aria-invalid:ring-destructive/40",
|
|
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)("group/calendar bg-background 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) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
46
|
+
button_previous: (0, tailwind_variants_namespaceObject.cn)((0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
47
|
+
variant: buttonVariant
|
|
48
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
49
|
+
caption_label: (0, tailwind_variants_namespaceObject.cn)("font-medium select-none", "label" === captionLayout ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
|
|
50
|
+
day: (0, tailwind_variants_namespaceObject.cn)("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md", 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 inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
53
|
+
dropdown_root: (0, tailwind_variants_namespaceObject.cn)("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-3 has-focus:ring-ring/50", defaultClassNames.dropdown_root),
|
|
54
|
+
dropdowns: (0, tailwind_variants_namespaceObject.cn)("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
55
|
+
hidden: (0, tailwind_variants_namespaceObject.cn)("invisible", defaultClassNames.hidden),
|
|
56
|
+
month: (0, tailwind_variants_namespaceObject.cn)("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
57
|
+
month_caption: (0, tailwind_variants_namespaceObject.cn)("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
58
|
+
months: (0, tailwind_variants_namespaceObject.cn)("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
59
|
+
nav: (0, tailwind_variants_namespaceObject.cn)("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", 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)("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
67
|
+
week: (0, tailwind_variants_namespaceObject.cn)("mt-2 flex w-full", defaultClassNames.week),
|
|
68
|
+
week_number: (0, tailwind_variants_namespaceObject.cn)("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
|
|
69
|
+
week_number_header: (0, tailwind_variants_namespaceObject.cn)("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
70
|
+
weekday: (0, tailwind_variants_namespaceObject.cn)("flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground 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)("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:border-ring group-data-[focused=true]/day:ring-3 group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>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 {
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import type { DayButton } from "react-day-picker";
|
|
3
3
|
import { DayPicker } from "react-day-picker";
|
|
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 };
|
|
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 };
|
|
@@ -1,2 +1,114 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
5
|
+
import { useEffect, useRef } from "react";
|
|
6
|
+
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
7
|
+
import { Button, buttonVariants } from "./button.js";
|
|
8
|
+
function Calendar({ buttonVariant = "ghost", captionLayout = "label", className, classNames, components, formatters, showOutsideDays = true, ...props }) {
|
|
9
|
+
const defaultClassNames = getDefaultClassNames();
|
|
10
|
+
return /*#__PURE__*/ jsx(DayPicker, {
|
|
11
|
+
captionLayout: captionLayout,
|
|
12
|
+
className: cn("group/calendar bg-background 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),
|
|
13
|
+
classNames: {
|
|
14
|
+
button_next: cn(buttonVariants({
|
|
15
|
+
variant: buttonVariant
|
|
16
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
17
|
+
button_previous: cn(buttonVariants({
|
|
18
|
+
variant: buttonVariant
|
|
19
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
20
|
+
caption_label: cn("font-medium select-none", "label" === captionLayout ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
|
|
21
|
+
day: cn("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
|
|
22
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
23
|
+
dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
24
|
+
dropdown_root: cn("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-3 has-focus:ring-ring/50", defaultClassNames.dropdown_root),
|
|
25
|
+
dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
26
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
27
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
28
|
+
month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
29
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
30
|
+
nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
|
31
|
+
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
32
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
33
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
34
|
+
range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
|
|
35
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
36
|
+
table: "w-full border-collapse",
|
|
37
|
+
today: cn("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
38
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
39
|
+
week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
|
|
40
|
+
week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
41
|
+
weekday: cn("flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
|
|
42
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
43
|
+
...classNames
|
|
44
|
+
},
|
|
45
|
+
components: {
|
|
46
|
+
Chevron: CalendarChevron,
|
|
47
|
+
DayButton: CalendarDayButton,
|
|
48
|
+
Root: CalendarRoot,
|
|
49
|
+
WeekNumber: CalendarWeekNumber,
|
|
50
|
+
...components
|
|
51
|
+
},
|
|
52
|
+
formatters: {
|
|
53
|
+
formatMonthDropdown: (date)=>date.toLocaleString("default", {
|
|
54
|
+
month: "short"
|
|
55
|
+
}),
|
|
56
|
+
...formatters
|
|
57
|
+
},
|
|
58
|
+
showOutsideDays: showOutsideDays,
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function CalendarChevron({ className, orientation, ...props }) {
|
|
63
|
+
if ("left" === orientation) return /*#__PURE__*/ jsx(ChevronLeftIcon, {
|
|
64
|
+
className: cn("size-4", className),
|
|
65
|
+
...props
|
|
66
|
+
});
|
|
67
|
+
if ("right" === orientation) return /*#__PURE__*/ jsx(ChevronRightIcon, {
|
|
68
|
+
className: cn("size-4", className),
|
|
69
|
+
...props
|
|
70
|
+
});
|
|
71
|
+
return /*#__PURE__*/ jsx(ChevronDownIcon, {
|
|
72
|
+
className: cn("size-4", className),
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function CalendarRoot({ className, rootRef, ...props }) {
|
|
77
|
+
return /*#__PURE__*/ jsx("div", {
|
|
78
|
+
ref: rootRef,
|
|
79
|
+
className: cn(className),
|
|
80
|
+
"data-slot": "calendar",
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function CalendarWeekNumber({ children, ...props }) {
|
|
85
|
+
return /*#__PURE__*/ jsx("td", {
|
|
86
|
+
...props,
|
|
87
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
88
|
+
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
89
|
+
children: children
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
94
|
+
const defaultClassNames = getDefaultClassNames();
|
|
95
|
+
const ref = useRef(null);
|
|
96
|
+
useEffect(()=>{
|
|
97
|
+
if (modifiers.focused) ref.current?.focus();
|
|
98
|
+
}, [
|
|
99
|
+
modifiers.focused
|
|
100
|
+
]);
|
|
101
|
+
return /*#__PURE__*/ jsx(Button, {
|
|
102
|
+
ref: ref,
|
|
103
|
+
className: cn("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:border-ring group-data-[focused=true]/day:ring-3 group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
|
|
104
|
+
"data-day": day.date.toLocaleDateString(),
|
|
105
|
+
"data-range-end": modifiers.range_end,
|
|
106
|
+
"data-range-middle": modifiers.range_middle,
|
|
107
|
+
"data-range-start": modifiers.range_start,
|
|
108
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
109
|
+
size: "icon",
|
|
110
|
+
variant: "ghost",
|
|
111
|
+
...props
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
export { Calendar, CalendarDayButton };
|
package/dist/components/card.cjs
CHANGED
|
@@ -1 +1,105 @@
|
|
|
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
|
+
CardFooter: ()=>CardFooter,
|
|
28
|
+
CardAction: ()=>CardAction,
|
|
29
|
+
CardContent: ()=>CardContent,
|
|
30
|
+
CardDescription: ()=>CardDescription,
|
|
31
|
+
CardHeader: ()=>CardHeader,
|
|
32
|
+
CardTitle: ()=>CardTitle,
|
|
33
|
+
Card: ()=>Card
|
|
34
|
+
});
|
|
35
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
36
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
37
|
+
function Card({ className, ...props }) {
|
|
38
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
39
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex flex-col gap-6 overflow-auto rounded-xl border bg-card py-6 text-card-foreground shadow-sm", className),
|
|
40
|
+
"data-slot": "card",
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function CardHeader({ className, ...props }) {
|
|
45
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
46
|
+
className: (0, tailwind_variants_namespaceObject.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-[data-slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
|
|
47
|
+
"data-slot": "card-header",
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function CardTitle({ children, className, ...props }) {
|
|
52
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
53
|
+
className: (0, tailwind_variants_namespaceObject.cn)("leading-none font-semibold", className),
|
|
54
|
+
"data-slot": "card-title",
|
|
55
|
+
...props,
|
|
56
|
+
children: children
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function CardDescription({ className, ...props }) {
|
|
60
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
61
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-sm text-muted-foreground", className),
|
|
62
|
+
"data-slot": "card-description",
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function CardContent({ className, ...props }) {
|
|
67
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
68
|
+
className: (0, tailwind_variants_namespaceObject.cn)("px-6", className),
|
|
69
|
+
"data-slot": "card-content",
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function CardFooter({ className, ...props }) {
|
|
74
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
75
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex items-center px-6 [.border-t]:pt-6", className),
|
|
76
|
+
"data-slot": "card-footer",
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function CardAction({ className, ...props }) {
|
|
81
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
82
|
+
className: (0, tailwind_variants_namespaceObject.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
83
|
+
"data-slot": "card-action",
|
|
84
|
+
...props
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
exports.Card = __webpack_exports__.Card;
|
|
88
|
+
exports.CardAction = __webpack_exports__.CardAction;
|
|
89
|
+
exports.CardContent = __webpack_exports__.CardContent;
|
|
90
|
+
exports.CardDescription = __webpack_exports__.CardDescription;
|
|
91
|
+
exports.CardFooter = __webpack_exports__.CardFooter;
|
|
92
|
+
exports.CardHeader = __webpack_exports__.CardHeader;
|
|
93
|
+
exports.CardTitle = __webpack_exports__.CardTitle;
|
|
94
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
95
|
+
"Card",
|
|
96
|
+
"CardAction",
|
|
97
|
+
"CardContent",
|
|
98
|
+
"CardDescription",
|
|
99
|
+
"CardFooter",
|
|
100
|
+
"CardHeader",
|
|
101
|
+
"CardTitle"
|
|
102
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
103
|
+
Object.defineProperty(exports, '__esModule', {
|
|
104
|
+
value: true
|
|
105
|
+
});
|