@mbao01/common 0.8.1 → 0.9.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/dist/types/components/ActivityFeed/ActivityFeed.d.ts +6 -0
- package/dist/types/components/ActivityFeed/constants.d.ts +6 -0
- package/dist/types/components/ActivityFeed/index.d.ts +2 -0
- package/dist/types/components/ActivityFeed/types.d.ts +21 -0
- package/dist/types/components/Amount/Amount.d.ts +6 -0
- package/dist/types/components/Amount/index.d.ts +2 -0
- package/dist/types/components/Amount/types.d.ts +19 -0
- package/dist/types/components/AnimatedCounter/AnimatedCounter.d.ts +6 -0
- package/dist/types/components/AnimatedCounter/index.d.ts +2 -0
- package/dist/types/components/AnimatedCounter/types.d.ts +13 -0
- package/dist/types/components/AnimatedGroup/AnimatedGroup.d.ts +6 -0
- package/dist/types/components/AnimatedGroup/index.d.ts +2 -0
- package/dist/types/components/AnimatedGroup/types.d.ts +22 -0
- package/dist/types/components/AnimatedList/AnimatedList.d.ts +6 -0
- package/dist/types/components/AnimatedList/index.d.ts +2 -0
- package/dist/types/components/AnimatedList/types.d.ts +13 -0
- package/dist/types/components/BorderBeam/BorderBeam.d.ts +6 -0
- package/dist/types/components/BorderBeam/index.d.ts +2 -0
- package/dist/types/components/BorderBeam/types.d.ts +13 -0
- package/dist/types/components/Box/Box.d.ts +4 -0
- package/dist/types/components/Box/constants.d.ts +4 -0
- package/dist/types/components/CalendarHeatmap/CalendarHeatmap.d.ts +6 -0
- package/dist/types/components/CalendarHeatmap/index.d.ts +2 -0
- package/dist/types/components/CalendarHeatmap/types.d.ts +25 -0
- package/dist/types/components/Chart/stories/examples/AreaChart.d.ts +6 -0
- package/dist/types/components/Chart/stories/examples/BarChart.d.ts +11 -0
- package/dist/types/components/Chart/stories/examples/LineChart.d.ts +10 -0
- package/dist/types/components/Chart/stories/examples/PieChart.d.ts +5 -0
- package/dist/types/components/Chart/stories/examples/RadialChart.d.ts +5 -0
- package/dist/types/components/CircularProgress/CircularProgress.d.ts +6 -0
- package/dist/types/components/CircularProgress/constants.d.ts +5 -0
- package/dist/types/components/CircularProgress/index.d.ts +2 -0
- package/dist/types/components/CircularProgress/types.d.ts +17 -0
- package/dist/types/components/ComparisonBar/ComparisonBar.d.ts +6 -0
- package/dist/types/components/ComparisonBar/constants.d.ts +4 -0
- package/dist/types/components/ComparisonBar/index.d.ts +2 -0
- package/dist/types/components/ComparisonBar/types.d.ts +21 -0
- package/dist/types/components/Confetti/Confetti.d.ts +6 -0
- package/dist/types/components/Confetti/index.d.ts +2 -0
- package/dist/types/components/Confetti/types.d.ts +19 -0
- package/dist/types/components/CountdownTimer/CountdownTimer.d.ts +6 -0
- package/dist/types/components/CountdownTimer/index.d.ts +2 -0
- package/dist/types/components/CountdownTimer/types.d.ts +13 -0
- package/dist/types/components/DataList/DataList.d.ts +6 -0
- package/dist/types/components/DataList/constants.d.ts +12 -0
- package/dist/types/components/DataList/index.d.ts +2 -0
- package/dist/types/components/DataList/types.d.ts +15 -0
- package/dist/types/components/DatePicker/DateRangePresetPicker.d.ts +2 -0
- package/dist/types/components/DatePicker/index.d.ts +1 -0
- package/dist/types/components/DatePicker/types.d.ts +19 -0
- package/dist/types/components/Description/Description.d.ts +2 -1
- package/dist/types/components/Description/DescriptionGroup.d.ts +6 -0
- package/dist/types/components/Description/constants.d.ts +23 -0
- package/dist/types/components/Description/index.d.ts +2 -0
- package/dist/types/components/Description/types.d.ts +28 -3
- package/dist/types/components/Form/DatetimeInput/DatetimeInput.d.ts +1 -1
- package/dist/types/components/GlowCard/GlowCard.d.ts +6 -0
- package/dist/types/components/GlowCard/index.d.ts +2 -0
- package/dist/types/components/GlowCard/types.d.ts +8 -0
- package/dist/types/components/GradientText/GradientText.d.ts +6 -0
- package/dist/types/components/GradientText/index.d.ts +2 -0
- package/dist/types/components/GradientText/types.d.ts +14 -0
- package/dist/types/components/Greeting/Greeting.d.ts +6 -0
- package/dist/types/components/Greeting/index.d.ts +2 -0
- package/dist/types/components/Greeting/types.d.ts +9 -0
- package/dist/types/components/KPICard/KPICard.d.ts +6 -0
- package/dist/types/components/KPICard/index.d.ts +2 -0
- package/dist/types/components/KPICard/types.d.ts +21 -0
- package/dist/types/components/Marquee/Marquee.d.ts +6 -0
- package/dist/types/components/Marquee/index.d.ts +2 -0
- package/dist/types/components/Marquee/types.d.ts +12 -0
- package/dist/types/components/Meteors/Meteors.d.ts +6 -0
- package/dist/types/components/Meteors/index.d.ts +2 -0
- package/dist/types/components/Meteors/types.d.ts +5 -0
- package/dist/types/components/MiniAreaChart/MiniAreaChart.d.ts +6 -0
- package/dist/types/components/MiniAreaChart/index.d.ts +2 -0
- package/dist/types/components/MiniAreaChart/types.d.ts +10 -0
- package/dist/types/components/MiniBarChart/MiniBarChart.d.ts +6 -0
- package/dist/types/components/MiniBarChart/index.d.ts +2 -0
- package/dist/types/components/MiniBarChart/types.d.ts +15 -0
- package/dist/types/components/MiniDonutChart/MiniDonutChart.d.ts +6 -0
- package/dist/types/components/MiniDonutChart/index.d.ts +2 -0
- package/dist/types/components/MiniDonutChart/types.d.ts +15 -0
- package/dist/types/components/MiniStackedBar/MiniStackedBar.d.ts +6 -0
- package/dist/types/components/MiniStackedBar/index.d.ts +2 -0
- package/dist/types/components/MiniStackedBar/types.d.ts +13 -0
- package/dist/types/components/NumberTicker/NumberTicker.d.ts +6 -0
- package/dist/types/components/NumberTicker/index.d.ts +2 -0
- package/dist/types/components/NumberTicker/types.d.ts +11 -0
- package/dist/types/components/Pulse/Pulse.d.ts +6 -0
- package/dist/types/components/Pulse/constants.d.ts +10 -0
- package/dist/types/components/Pulse/index.d.ts +2 -0
- package/dist/types/components/Pulse/types.d.ts +11 -0
- package/dist/types/components/ShinyButton/ShinyButton.d.ts +6 -0
- package/dist/types/components/ShinyButton/index.d.ts +2 -0
- package/dist/types/components/ShinyButton/types.d.ts +4 -0
- package/dist/types/components/Sparkline/Sparkline.d.ts +6 -0
- package/dist/types/components/Sparkline/index.d.ts +2 -0
- package/dist/types/components/Sparkline/types.d.ts +17 -0
- package/dist/types/components/SpotlightCard/SpotlightCard.d.ts +6 -0
- package/dist/types/components/SpotlightCard/index.d.ts +2 -0
- package/dist/types/components/SpotlightCard/types.d.ts +7 -0
- package/dist/types/components/StatCard/StatCard.d.ts +6 -0
- package/dist/types/components/StatCard/index.d.ts +2 -0
- package/dist/types/components/StatCard/types.d.ts +15 -0
- package/dist/types/components/TextShimmer/TextShimmer.d.ts +6 -0
- package/dist/types/components/TextShimmer/index.d.ts +2 -0
- package/dist/types/components/TextShimmer/types.d.ts +7 -0
- package/dist/types/components/TrendBadge/TrendBadge.d.ts +6 -0
- package/dist/types/components/TrendBadge/constants.d.ts +7 -0
- package/dist/types/components/TrendBadge/index.d.ts +2 -0
- package/dist/types/components/TrendBadge/types.d.ts +15 -0
- package/dist/types/components/WidgetShell/WidgetShell.d.ts +6 -0
- package/dist/types/components/WidgetShell/index.d.ts +2 -0
- package/dist/types/components/WidgetShell/types.d.ts +20 -0
- package/dist/types/index.d.ts +33 -0
- package/package.json +2 -1
- package/src/components/Accordion/constants.ts +1 -1
- package/src/components/ActivityFeed/ActivityFeed.tsx +51 -0
- package/src/components/ActivityFeed/constants.ts +19 -0
- package/src/components/ActivityFeed/index.ts +2 -0
- package/src/components/ActivityFeed/types.ts +23 -0
- package/src/components/Alert/constants.ts +1 -1
- package/src/components/AlertDialog/constants.ts +1 -1
- package/src/components/Amount/Amount.tsx +50 -0
- package/src/components/Amount/index.ts +2 -0
- package/src/components/Amount/types.ts +20 -0
- package/src/components/AnimatedCounter/AnimatedCounter.tsx +68 -0
- package/src/components/AnimatedCounter/index.ts +2 -0
- package/src/components/AnimatedCounter/types.ts +14 -0
- package/src/components/AnimatedGroup/AnimatedGroup.tsx +97 -0
- package/src/components/AnimatedGroup/index.ts +2 -0
- package/src/components/AnimatedGroup/types.ts +21 -0
- package/src/components/AnimatedList/AnimatedList.tsx +42 -0
- package/src/components/AnimatedList/index.ts +2 -0
- package/src/components/AnimatedList/types.ts +15 -0
- package/src/components/Badge/constants.ts +1 -1
- package/src/components/Banner/constants.ts +1 -1
- package/src/components/BorderBeam/BorderBeam.tsx +41 -0
- package/src/components/BorderBeam/index.ts +2 -0
- package/src/components/BorderBeam/types.ts +14 -0
- package/src/components/Box/Box.tsx +8 -2
- package/src/components/Box/constants.ts +35 -0
- package/src/components/Button/constants.ts +66 -63
- package/src/components/CalendarHeatmap/CalendarHeatmap.tsx +141 -0
- package/src/components/CalendarHeatmap/index.ts +2 -0
- package/src/components/CalendarHeatmap/types.ts +27 -0
- package/src/components/Card/constants.ts +24 -21
- package/src/components/Carousel/constants.ts +2 -2
- package/src/components/Chart/stories/examples/AreaChart.tsx +55 -0
- package/src/components/Chart/stories/examples/BarChart.tsx +95 -0
- package/src/components/Chart/stories/examples/LineChart.tsx +111 -0
- package/src/components/Chart/stories/examples/PieChart.tsx +55 -0
- package/src/components/Chart/stories/examples/RadialChart.tsx +65 -0
- package/src/components/CircularProgress/CircularProgress.tsx +46 -0
- package/src/components/CircularProgress/constants.ts +32 -0
- package/src/components/CircularProgress/index.ts +2 -0
- package/src/components/CircularProgress/types.ts +18 -0
- package/src/components/Command/constants.ts +1 -1
- package/src/components/ComparisonBar/ComparisonBar.tsx +65 -0
- package/src/components/ComparisonBar/constants.ts +23 -0
- package/src/components/ComparisonBar/index.ts +2 -0
- package/src/components/ComparisonBar/types.ts +23 -0
- package/src/components/Confetti/Confetti.tsx +82 -0
- package/src/components/Confetti/index.ts +2 -0
- package/src/components/Confetti/types.ts +20 -0
- package/src/components/CountdownTimer/CountdownTimer.tsx +91 -0
- package/src/components/CountdownTimer/index.ts +2 -0
- package/src/components/CountdownTimer/types.ts +14 -0
- package/src/components/DataList/DataList.tsx +32 -0
- package/src/components/DataList/constants.ts +47 -0
- package/src/components/DataList/index.ts +2 -0
- package/src/components/DataList/types.ts +17 -0
- package/src/components/DatePicker/DateRangePresetPicker.tsx +122 -0
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/DatePicker/types.ts +22 -0
- package/src/components/Description/Description.tsx +67 -5
- package/src/components/Description/DescriptionGroup.tsx +39 -0
- package/src/components/Description/constants.ts +128 -0
- package/src/components/Description/index.ts +10 -0
- package/src/components/Description/types.ts +31 -3
- package/src/components/Dialog/constants.ts +2 -2
- package/src/components/Dock/constants.ts +2 -2
- package/src/components/Drawer/constants.ts +2 -2
- package/src/components/Form/Checkbox/constants.ts +1 -1
- package/src/components/Form/DatetimeInput/constants.ts +1 -1
- package/src/components/Form/Input/constants.ts +1 -1
- package/src/components/Form/MultiSelect/constants.ts +1 -1
- package/src/components/Form/NativeSelect/constants.ts +1 -1
- package/src/components/Form/Radio/constants.ts +1 -1
- package/src/components/Form/Select/constants.ts +1 -1
- package/src/components/Form/Slider/constants.ts +1 -1
- package/src/components/Form/Switch/constants.ts +1 -1
- package/src/components/Form/Textarea/constants.ts +1 -1
- package/src/components/GlowCard/GlowCard.tsx +46 -0
- package/src/components/GlowCard/index.ts +2 -0
- package/src/components/GlowCard/types.ts +9 -0
- package/src/components/GradientText/GradientText.tsx +36 -0
- package/src/components/GradientText/index.ts +2 -0
- package/src/components/GradientText/types.ts +15 -0
- package/src/components/Greeting/Greeting.tsx +46 -0
- package/src/components/Greeting/index.ts +2 -0
- package/src/components/Greeting/types.ts +10 -0
- package/src/components/KPICard/KPICard.tsx +85 -0
- package/src/components/KPICard/index.ts +2 -0
- package/src/components/KPICard/types.ts +22 -0
- package/src/components/Marquee/Marquee.tsx +45 -0
- package/src/components/Marquee/index.ts +2 -0
- package/src/components/Marquee/types.ts +13 -0
- package/src/components/Menu/Menubar/constants.ts +2 -2
- package/src/components/Menu/NavigationMenu/constants.ts +2 -2
- package/src/components/Meteors/Meteors.tsx +38 -0
- package/src/components/Meteors/index.ts +2 -0
- package/src/components/Meteors/types.ts +6 -0
- package/src/components/MiniAreaChart/MiniAreaChart.tsx +68 -0
- package/src/components/MiniAreaChart/index.ts +2 -0
- package/src/components/MiniAreaChart/types.ts +11 -0
- package/src/components/MiniBarChart/MiniBarChart.tsx +49 -0
- package/src/components/MiniBarChart/index.ts +2 -0
- package/src/components/MiniBarChart/types.ts +16 -0
- package/src/components/MiniDonutChart/MiniDonutChart.tsx +87 -0
- package/src/components/MiniDonutChart/index.ts +2 -0
- package/src/components/MiniDonutChart/types.ts +17 -0
- package/src/components/MiniStackedBar/MiniStackedBar.tsx +61 -0
- package/src/components/MiniStackedBar/index.ts +2 -0
- package/src/components/MiniStackedBar/types.ts +15 -0
- package/src/components/NumberTicker/NumberTicker.tsx +58 -0
- package/src/components/NumberTicker/index.ts +2 -0
- package/src/components/NumberTicker/types.ts +12 -0
- package/src/components/Pagination/constants.ts +2 -2
- package/src/components/Progress/constants.ts +1 -1
- package/src/components/Pulse/Pulse.tsx +26 -0
- package/src/components/Pulse/constants.ts +55 -0
- package/src/components/Pulse/index.ts +2 -0
- package/src/components/Pulse/types.ts +12 -0
- package/src/components/Resizable/constants.ts +1 -1
- package/src/components/Sheet/constants.ts +1 -1
- package/src/components/ShinyButton/ShinyButton.tsx +57 -0
- package/src/components/ShinyButton/index.ts +2 -0
- package/src/components/ShinyButton/types.ts +8 -0
- package/src/components/Skeleton/constants.ts +1 -1
- package/src/components/Sonner/constants.ts +1 -1
- package/src/components/Sparkline/Sparkline.tsx +108 -0
- package/src/components/Sparkline/index.ts +2 -0
- package/src/components/Sparkline/types.ts +18 -0
- package/src/components/SpotlightCard/SpotlightCard.tsx +56 -0
- package/src/components/SpotlightCard/index.ts +2 -0
- package/src/components/SpotlightCard/types.ts +8 -0
- package/src/components/Stat/constants.ts +1 -1
- package/src/components/StatCard/StatCard.tsx +59 -0
- package/src/components/StatCard/index.ts +2 -0
- package/src/components/StatCard/types.ts +16 -0
- package/src/components/Tabs/constants.ts +1 -1
- package/src/components/TextShimmer/TextShimmer.tsx +34 -0
- package/src/components/TextShimmer/index.ts +2 -0
- package/src/components/TextShimmer/types.ts +8 -0
- package/src/components/Timeline/constants.ts +1 -1
- package/src/components/Toggle/constants.ts +1 -1
- package/src/components/Tooltip/constants.ts +1 -1
- package/src/components/TrendBadge/TrendBadge.tsx +40 -0
- package/src/components/TrendBadge/constants.ts +38 -0
- package/src/components/TrendBadge/index.ts +2 -0
- package/src/components/TrendBadge/types.ts +16 -0
- package/src/components/WidgetShell/WidgetShell.tsx +101 -0
- package/src/components/WidgetShell/index.ts +2 -0
- package/src/components/WidgetShell/types.ts +22 -0
- package/src/index.ts +35 -0
- package/src/stylesheets/tailwind.css +208 -0
- package/src/utilities/getSubpaths/getSubpaths.ts +1 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
|
|
3
|
+
export type CountdownTimerProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
4
|
+
/** Target date/time to count down to */
|
|
5
|
+
targetDate: Date;
|
|
6
|
+
/** Label to show above the timer */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Callback when countdown reaches zero */
|
|
9
|
+
onComplete?: () => void;
|
|
10
|
+
/** Whether to show seconds */
|
|
11
|
+
showSeconds?: boolean;
|
|
12
|
+
/** Size variant */
|
|
13
|
+
size?: "sm" | "md" | "lg";
|
|
14
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cn } from "../../utilities";
|
|
2
|
+
import {
|
|
3
|
+
getDataListClasses,
|
|
4
|
+
getDataListItemClasses,
|
|
5
|
+
getDataListLabelClasses,
|
|
6
|
+
getDataListValueClasses,
|
|
7
|
+
} from "./constants";
|
|
8
|
+
import type { DataListProps } from "./types";
|
|
9
|
+
|
|
10
|
+
const DataList = ({
|
|
11
|
+
items,
|
|
12
|
+
className,
|
|
13
|
+
size = "md",
|
|
14
|
+
dividers = true,
|
|
15
|
+
horizontal = false,
|
|
16
|
+
...props
|
|
17
|
+
}: DataListProps) => {
|
|
18
|
+
return (
|
|
19
|
+
<dl className={cn(getDataListClasses({ horizontal }), className)} {...props}>
|
|
20
|
+
{items.map((item, index) => (
|
|
21
|
+
<div key={index} className={getDataListItemClasses({ size, dividers, horizontal })}>
|
|
22
|
+
<dt className={getDataListLabelClasses()}>{item.label}</dt>
|
|
23
|
+
<dd className={getDataListValueClasses({ horizontal })}>{item.value}</dd>
|
|
24
|
+
</div>
|
|
25
|
+
))}
|
|
26
|
+
</dl>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
DataList.displayName = "DataList";
|
|
31
|
+
|
|
32
|
+
export { DataList };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { cva } from "../../libs";
|
|
2
|
+
import { createVariants } from "../../utilities";
|
|
3
|
+
|
|
4
|
+
export const getDataListClasses = cva("", {
|
|
5
|
+
variants: createVariants({
|
|
6
|
+
horizontal: {
|
|
7
|
+
true: "flex flex-wrap gap-x-6 gap-y-2",
|
|
8
|
+
false: "flex flex-col",
|
|
9
|
+
},
|
|
10
|
+
}),
|
|
11
|
+
defaultVariants: {
|
|
12
|
+
horizontal: false,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const getDataListItemClasses = cva(
|
|
17
|
+
"flex justify-between gap-4 transition-colors duration-150",
|
|
18
|
+
{
|
|
19
|
+
variants: createVariants({
|
|
20
|
+
size: {
|
|
21
|
+
sm: "py-1.5 text-xs",
|
|
22
|
+
md: "py-2.5 text-sm",
|
|
23
|
+
lg: "py-3 text-base",
|
|
24
|
+
},
|
|
25
|
+
dividers: {
|
|
26
|
+
true: "border-b border-base-200 last:border-0",
|
|
27
|
+
},
|
|
28
|
+
horizontal: {
|
|
29
|
+
true: "flex-col gap-0.5",
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
size: "md",
|
|
34
|
+
dividers: true,
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export const getDataListLabelClasses = cva("text-base-content/60 shrink-0");
|
|
40
|
+
|
|
41
|
+
export const getDataListValueClasses = cva("font-medium text-right tabular-nums", {
|
|
42
|
+
variants: createVariants({
|
|
43
|
+
horizontal: {
|
|
44
|
+
true: "text-left",
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export type DataListItem = {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type DataListProps = Omit<HTMLAttributes<HTMLDListElement>, "children"> & {
|
|
9
|
+
/** Key-value items to display */
|
|
10
|
+
items: DataListItem[];
|
|
11
|
+
/** Size variant */
|
|
12
|
+
size?: "sm" | "md" | "lg";
|
|
13
|
+
/** Whether to show dividers between items */
|
|
14
|
+
dividers?: boolean;
|
|
15
|
+
/** Whether to show items in a horizontal layout */
|
|
16
|
+
horizontal?: boolean;
|
|
17
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { type DateRange } from "react-day-picker";
|
|
5
|
+
import { format, subDays, startOfMonth, startOfYear } from "date-fns";
|
|
6
|
+
import { CalendarDaysIcon } from "lucide-react";
|
|
7
|
+
import { cn } from "../../utilities";
|
|
8
|
+
import { Button } from "../Button";
|
|
9
|
+
import { Calendar } from "../Calendar";
|
|
10
|
+
import { Popover } from "../Popover";
|
|
11
|
+
import { type DateRangePresetPickerProps, type DateRangePreset } from "./types";
|
|
12
|
+
|
|
13
|
+
const DEFAULT_PRESETS: DateRangePreset[] = [
|
|
14
|
+
{ label: "Today", range: () => ({ from: new Date(), to: new Date() }) },
|
|
15
|
+
{ label: "Last 7 days", range: () => ({ from: subDays(new Date(), 7), to: new Date() }) },
|
|
16
|
+
{ label: "Last 30 days", range: () => ({ from: subDays(new Date(), 30), to: new Date() }) },
|
|
17
|
+
{ label: "Last 90 days", range: () => ({ from: subDays(new Date(), 90), to: new Date() }) },
|
|
18
|
+
{ label: "This month", range: () => ({ from: startOfMonth(new Date()), to: new Date() }) },
|
|
19
|
+
{ label: "This year", range: () => ({ from: startOfYear(new Date()), to: new Date() }) },
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export const DateRangePresetPicker = ({
|
|
23
|
+
name,
|
|
24
|
+
size,
|
|
25
|
+
wide,
|
|
26
|
+
label,
|
|
27
|
+
outline,
|
|
28
|
+
variant,
|
|
29
|
+
disabled,
|
|
30
|
+
disabledDates,
|
|
31
|
+
defaultRange,
|
|
32
|
+
presets = DEFAULT_PRESETS,
|
|
33
|
+
onRangeChange,
|
|
34
|
+
getRangeValue = (range) => ({
|
|
35
|
+
from: range?.from?.toUTCString(),
|
|
36
|
+
to: range?.to?.toUTCString(),
|
|
37
|
+
}),
|
|
38
|
+
getRangeLabel = (range) =>
|
|
39
|
+
range?.from
|
|
40
|
+
? range.to
|
|
41
|
+
? `${format(range.from, "LLL dd, y")} - ${format(range.to, "LLL dd, y")}`
|
|
42
|
+
: format(range.from, "LLL dd, y")
|
|
43
|
+
: undefined,
|
|
44
|
+
triggerClassName,
|
|
45
|
+
...props
|
|
46
|
+
}: DateRangePresetPickerProps) => {
|
|
47
|
+
const [range, setRange] = useState<DateRange | undefined>(defaultRange);
|
|
48
|
+
const [activePreset, setActivePreset] = useState<string | null>(null);
|
|
49
|
+
|
|
50
|
+
const handlePresetClick = (preset: DateRangePreset) => {
|
|
51
|
+
const newRange = preset.range();
|
|
52
|
+
setRange(newRange);
|
|
53
|
+
setActivePreset(preset.label);
|
|
54
|
+
onRangeChange?.(newRange, preset.label);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleCalendarSelect = (newRange: DateRange | undefined) => {
|
|
58
|
+
setRange(newRange);
|
|
59
|
+
setActivePreset(null);
|
|
60
|
+
onRangeChange?.(newRange, undefined);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const rangeLabel = getRangeLabel(range);
|
|
64
|
+
const rangeValue = getRangeValue(range);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<Popover>
|
|
68
|
+
{name && (
|
|
69
|
+
<>
|
|
70
|
+
<input hidden className="hidden" aria-hidden="true" name={`${name}.from`} defaultValue={rangeValue.from} />
|
|
71
|
+
<input hidden className="hidden" aria-hidden="true" name={`${name}.to`} defaultValue={rangeValue.to} />
|
|
72
|
+
</>
|
|
73
|
+
)}
|
|
74
|
+
<Popover.Trigger asChild>
|
|
75
|
+
<Button
|
|
76
|
+
name={name}
|
|
77
|
+
size={size}
|
|
78
|
+
wide={wide}
|
|
79
|
+
outline={outline}
|
|
80
|
+
variant={variant}
|
|
81
|
+
disabled={disabled}
|
|
82
|
+
className={cn("justify-start flex-nowrap", !range && "font-normal", triggerClassName)}
|
|
83
|
+
>
|
|
84
|
+
<span className="text-left text-ellipsis overflow-hidden text-nowrap">
|
|
85
|
+
{activePreset ?? rangeLabel ?? label ?? "Select period"}
|
|
86
|
+
</span>
|
|
87
|
+
<CalendarDaysIcon className="ml-auto h-4 w-4 opacity-50" />
|
|
88
|
+
</Button>
|
|
89
|
+
</Popover.Trigger>
|
|
90
|
+
<Popover.Content className="w-auto p-0" align="start">
|
|
91
|
+
<div className="flex">
|
|
92
|
+
<div className="flex flex-col border-r p-2 gap-0.5">
|
|
93
|
+
{presets.map((preset) => (
|
|
94
|
+
<button
|
|
95
|
+
key={preset.label}
|
|
96
|
+
type="button"
|
|
97
|
+
onClick={() => handlePresetClick(preset)}
|
|
98
|
+
className={cn(
|
|
99
|
+
"rounded-md px-3 py-1.5 text-left text-sm transition-colors duration-150 hover:bg-base-200",
|
|
100
|
+
activePreset === preset.label && "bg-primary text-primary-content hover:bg-primary"
|
|
101
|
+
)}
|
|
102
|
+
>
|
|
103
|
+
{preset.label}
|
|
104
|
+
</button>
|
|
105
|
+
))}
|
|
106
|
+
</div>
|
|
107
|
+
<div className="p-2">
|
|
108
|
+
<Calendar
|
|
109
|
+
autoFocus
|
|
110
|
+
mode="range"
|
|
111
|
+
selected={range}
|
|
112
|
+
disabled={disabledDates}
|
|
113
|
+
onSelect={handleCalendarSelect}
|
|
114
|
+
captionLayout="label"
|
|
115
|
+
{...props}
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</Popover.Content>
|
|
120
|
+
</Popover>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
@@ -33,6 +33,28 @@ export type DateRangePickerProps = BaseDatePickerProps &
|
|
|
33
33
|
getRangeLabel?: (range: DateRange | undefined) => string | React.JSX.Element | undefined;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
export type DateRangePreset = {
|
|
37
|
+
/** Display label for the preset */
|
|
38
|
+
label: string;
|
|
39
|
+
/** Function that returns the date range for this preset */
|
|
40
|
+
range: () => DateRange;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type DateRangePresetPickerProps = BaseDatePickerProps &
|
|
44
|
+
Omit<PropsRange, "mode" | "disabled"> & {
|
|
45
|
+
defaultRange?: DateRange;
|
|
46
|
+
disabledDates?: PropsRange["disabled"];
|
|
47
|
+
/** Preset period options. Defaults to Today, Last 7/30/90 days, This month, This year */
|
|
48
|
+
presets?: DateRangePreset[];
|
|
49
|
+
/** Called when range changes, with optional preset label */
|
|
50
|
+
onRangeChange?: (range: DateRange | undefined, presetLabel?: string) => void;
|
|
51
|
+
getRangeValue?: (range: DateRange | undefined) => {
|
|
52
|
+
from: string | undefined;
|
|
53
|
+
to: string | undefined;
|
|
54
|
+
};
|
|
55
|
+
getRangeLabel?: (range: DateRange | undefined) => string | undefined;
|
|
56
|
+
};
|
|
57
|
+
|
|
36
58
|
export type MultipleDatesPickerProps = BaseDatePickerProps &
|
|
37
59
|
Omit<PropsMulti, "mode"> & {
|
|
38
60
|
defaultDates?: Date[];
|
|
@@ -1,19 +1,81 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
2
|
import { cn } from "../../utilities";
|
|
3
|
+
import {
|
|
4
|
+
getDescriptionClasses,
|
|
5
|
+
getDescriptionDetailClasses,
|
|
6
|
+
getDescriptionPairClasses,
|
|
7
|
+
getDescriptionTermClasses,
|
|
8
|
+
} from "./constants";
|
|
9
|
+
import type {
|
|
10
|
+
DescriptionDetailProps,
|
|
11
|
+
DescriptionLayout,
|
|
12
|
+
DescriptionProps,
|
|
13
|
+
DescriptionSize,
|
|
14
|
+
DescriptionTermProps,
|
|
15
|
+
} from "./types";
|
|
3
16
|
|
|
4
|
-
|
|
5
|
-
|
|
17
|
+
type DescriptionContextValue = {
|
|
18
|
+
size: DescriptionSize;
|
|
19
|
+
layout: DescriptionLayout;
|
|
20
|
+
dividers: boolean;
|
|
21
|
+
striped: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const DescriptionContext = createContext<DescriptionContextValue>({
|
|
25
|
+
size: "md",
|
|
26
|
+
layout: "vertical",
|
|
27
|
+
dividers: false,
|
|
28
|
+
striped: false,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const useDescriptionContext = () => useContext(DescriptionContext);
|
|
32
|
+
|
|
33
|
+
const Description = ({
|
|
34
|
+
className,
|
|
35
|
+
variant = "default",
|
|
36
|
+
layout = "vertical",
|
|
37
|
+
size = "md",
|
|
38
|
+
dividers = false,
|
|
39
|
+
striped = false,
|
|
40
|
+
...props
|
|
41
|
+
}: DescriptionProps) => {
|
|
42
|
+
return (
|
|
43
|
+
<DescriptionContext.Provider value={{ size, layout, dividers, striped }}>
|
|
44
|
+
<dl
|
|
45
|
+
className={cn(getDescriptionClasses({ variant, layout, size }), className)}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
</DescriptionContext.Provider>
|
|
49
|
+
);
|
|
6
50
|
};
|
|
7
51
|
|
|
8
52
|
const DescriptionTerm = ({ className, ...props }: DescriptionTermProps) => {
|
|
9
|
-
|
|
53
|
+
const { size, layout } = useDescriptionContext();
|
|
54
|
+
return (
|
|
55
|
+
<dt className={cn(getDescriptionTermClasses({ size, layout }), className)} {...props} />
|
|
56
|
+
);
|
|
10
57
|
};
|
|
11
58
|
|
|
12
59
|
const DescriptionDetail = ({ className, ...props }: DescriptionDetailProps) => {
|
|
13
|
-
|
|
60
|
+
const { size, layout, dividers } = useDescriptionContext();
|
|
61
|
+
return (
|
|
62
|
+
<dd
|
|
63
|
+
className={cn(getDescriptionDetailClasses({ size, layout, dividers }), className)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const DescriptionPair = ({
|
|
70
|
+
className,
|
|
71
|
+
...props
|
|
72
|
+
}: React.HTMLAttributes<HTMLDivElement>) => {
|
|
73
|
+
const { layout, striped } = useDescriptionContext();
|
|
74
|
+
return <div className={cn(getDescriptionPairClasses({ layout, striped }), className)} {...props} />;
|
|
14
75
|
};
|
|
15
76
|
|
|
16
77
|
Description.Term = DescriptionTerm;
|
|
17
78
|
Description.Detail = DescriptionDetail;
|
|
79
|
+
Description.Pair = DescriptionPair;
|
|
18
80
|
|
|
19
81
|
export { Description };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cn } from "../../utilities";
|
|
2
|
+
import { getDescriptionGroupClasses, getDescriptionGroupItemClasses } from "./constants";
|
|
3
|
+
import type { DescriptionGroupProps } from "./types";
|
|
4
|
+
|
|
5
|
+
const DescriptionGroup = ({
|
|
6
|
+
className,
|
|
7
|
+
children,
|
|
8
|
+
direction = "column",
|
|
9
|
+
dividers = false,
|
|
10
|
+
title,
|
|
11
|
+
description,
|
|
12
|
+
...props
|
|
13
|
+
}: DescriptionGroupProps) => {
|
|
14
|
+
return (
|
|
15
|
+
<div className={cn("flex flex-col", className)} {...props}>
|
|
16
|
+
{(title || description) && (
|
|
17
|
+
<div className="mb-4">
|
|
18
|
+
{title && <h3 className="text-base font-semibold text-base-content">{title}</h3>}
|
|
19
|
+
{description && (
|
|
20
|
+
<p className="mt-0.5 text-sm text-base-content/60">{description}</p>
|
|
21
|
+
)}
|
|
22
|
+
</div>
|
|
23
|
+
)}
|
|
24
|
+
<div className={getDescriptionGroupClasses({ direction, dividers })}>
|
|
25
|
+
{Array.isArray(children)
|
|
26
|
+
? children.map((child, i) => (
|
|
27
|
+
<div key={i} className={getDescriptionGroupItemClasses()}>
|
|
28
|
+
{child}
|
|
29
|
+
</div>
|
|
30
|
+
))
|
|
31
|
+
: children}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
DescriptionGroup.displayName = "DescriptionGroup";
|
|
38
|
+
|
|
39
|
+
export { DescriptionGroup };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { cva } from "../../libs";
|
|
2
|
+
import { createVariants } from "../../utilities";
|
|
3
|
+
|
|
4
|
+
export const getDescriptionClasses = cva("", {
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
default: "",
|
|
8
|
+
card: "rounded-lg border border-base-200 bg-base-100 p-4 shadow-sm",
|
|
9
|
+
subtle: "rounded-md bg-base-200/40 p-3",
|
|
10
|
+
},
|
|
11
|
+
layout: {
|
|
12
|
+
vertical: "flex flex-col",
|
|
13
|
+
horizontal: "grid grid-cols-[auto_1fr] gap-x-6",
|
|
14
|
+
inline: "flex flex-wrap gap-x-6 gap-y-1",
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
sm: "" as const,
|
|
18
|
+
md: "" as const,
|
|
19
|
+
lg: "" as const,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "default",
|
|
24
|
+
layout: "vertical",
|
|
25
|
+
size: "md",
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const getDescriptionTermClasses = cva("shrink-0 font-medium text-base-content/60", {
|
|
30
|
+
variants: createVariants({
|
|
31
|
+
size: {
|
|
32
|
+
sm: "py-1 text-xs",
|
|
33
|
+
md: "py-2 text-sm",
|
|
34
|
+
lg: "py-2.5 text-base",
|
|
35
|
+
},
|
|
36
|
+
layout: {
|
|
37
|
+
vertical: "",
|
|
38
|
+
horizontal: "py-2",
|
|
39
|
+
inline: "py-0",
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
size: "md",
|
|
44
|
+
layout: "vertical",
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const getDescriptionDetailClasses = cva("text-base-content transition-colors duration-150", {
|
|
49
|
+
variants: createVariants({
|
|
50
|
+
size: {
|
|
51
|
+
sm: "py-1 text-xs",
|
|
52
|
+
md: "py-2 text-sm",
|
|
53
|
+
lg: "py-2.5 text-base",
|
|
54
|
+
},
|
|
55
|
+
layout: {
|
|
56
|
+
vertical: "not-last:mb-1",
|
|
57
|
+
horizontal: "py-2",
|
|
58
|
+
inline: "py-0 font-medium",
|
|
59
|
+
},
|
|
60
|
+
dividers: {
|
|
61
|
+
true: "",
|
|
62
|
+
false: "",
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
compoundVariants: [
|
|
66
|
+
{ layout: "vertical", dividers: true, className: "border-b border-base-200 last:border-0" },
|
|
67
|
+
{ layout: "horizontal", dividers: true, className: "border-b border-base-200" },
|
|
68
|
+
],
|
|
69
|
+
defaultVariants: {
|
|
70
|
+
size: "md",
|
|
71
|
+
layout: "vertical",
|
|
72
|
+
dividers: false,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export const getDescriptionPairClasses = cva("transition-colors duration-150", {
|
|
77
|
+
variants: createVariants({
|
|
78
|
+
layout: {
|
|
79
|
+
vertical: "",
|
|
80
|
+
horizontal: "contents",
|
|
81
|
+
inline: "flex items-baseline gap-1.5",
|
|
82
|
+
},
|
|
83
|
+
striped: {
|
|
84
|
+
true: "",
|
|
85
|
+
false: "",
|
|
86
|
+
},
|
|
87
|
+
}),
|
|
88
|
+
compoundVariants: [
|
|
89
|
+
{ layout: "vertical", striped: true, className: "even:bg-base-200/30 px-2 -mx-2 rounded" },
|
|
90
|
+
{ layout: "horizontal", striped: true, className: "" },
|
|
91
|
+
],
|
|
92
|
+
defaultVariants: {
|
|
93
|
+
layout: "vertical",
|
|
94
|
+
striped: false,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export const getDescriptionGroupClasses = cva("flex gap-6", {
|
|
99
|
+
variants: createVariants({
|
|
100
|
+
direction: {
|
|
101
|
+
row: "flex-row flex-wrap",
|
|
102
|
+
column: "flex-col",
|
|
103
|
+
},
|
|
104
|
+
dividers: {
|
|
105
|
+
true: "",
|
|
106
|
+
false: "",
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
compoundVariants: [
|
|
110
|
+
{
|
|
111
|
+
direction: "column",
|
|
112
|
+
dividers: true,
|
|
113
|
+
className: "[&>*+*]:border-t [&>*+*]:border-base-200 [&>*+*]:pt-6",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
direction: "row",
|
|
117
|
+
dividers: true,
|
|
118
|
+
className:
|
|
119
|
+
"[&>*+*]:border-l [&>*+*]:border-base-200 [&>*+*]:pl-6",
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
defaultVariants: {
|
|
123
|
+
direction: "column",
|
|
124
|
+
dividers: false,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
export const getDescriptionGroupItemClasses = cva("flex-1 min-w-0");
|
|
@@ -1 +1,11 @@
|
|
|
1
1
|
export { Description } from "./Description";
|
|
2
|
+
export { DescriptionGroup } from "./DescriptionGroup";
|
|
3
|
+
export type {
|
|
4
|
+
DescriptionProps,
|
|
5
|
+
DescriptionTermProps,
|
|
6
|
+
DescriptionDetailProps,
|
|
7
|
+
DescriptionGroupProps,
|
|
8
|
+
DescriptionSize,
|
|
9
|
+
DescriptionLayout,
|
|
10
|
+
DescriptionVariant,
|
|
11
|
+
} from "./types";
|
|
@@ -1,5 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
2
|
|
|
3
|
-
export type
|
|
3
|
+
export type DescriptionSize = "sm" | "md" | "lg";
|
|
4
|
+
export type DescriptionLayout = "vertical" | "horizontal" | "inline";
|
|
5
|
+
export type DescriptionVariant = "default" | "card" | "subtle";
|
|
4
6
|
|
|
5
|
-
export type
|
|
7
|
+
export type DescriptionProps = HTMLAttributes<HTMLDListElement> & {
|
|
8
|
+
/** Visual variant */
|
|
9
|
+
variant?: DescriptionVariant;
|
|
10
|
+
/** Layout direction */
|
|
11
|
+
layout?: DescriptionLayout;
|
|
12
|
+
/** Size preset */
|
|
13
|
+
size?: DescriptionSize;
|
|
14
|
+
/** Show dividers between items */
|
|
15
|
+
dividers?: boolean;
|
|
16
|
+
/** Alternate row shading */
|
|
17
|
+
striped?: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type DescriptionTermProps = HTMLAttributes<HTMLElement>;
|
|
21
|
+
|
|
22
|
+
export type DescriptionDetailProps = HTMLAttributes<HTMLElement>;
|
|
23
|
+
|
|
24
|
+
export type DescriptionGroupProps = HTMLAttributes<HTMLDivElement> & {
|
|
25
|
+
/** Direction to stack descriptions */
|
|
26
|
+
direction?: "row" | "column";
|
|
27
|
+
/** Show dividers between descriptions */
|
|
28
|
+
dividers?: boolean;
|
|
29
|
+
/** Optional heading for the group */
|
|
30
|
+
title?: ReactNode;
|
|
31
|
+
/** Optional subheading */
|
|
32
|
+
description?: ReactNode;
|
|
33
|
+
};
|
|
@@ -2,7 +2,7 @@ import { cva } from "../../libs";
|
|
|
2
2
|
import { createVariants } from "../../utilities";
|
|
3
3
|
|
|
4
4
|
export const getDialogOverlayClasses = cva(
|
|
5
|
-
"fixed inset-0 z-50 bg-black/
|
|
5
|
+
"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
6
6
|
);
|
|
7
7
|
|
|
8
8
|
export const getDialogContentClasses = cva(
|
|
@@ -41,5 +41,5 @@ export const getDialogTitleClasses = cva("text-lg font-semibold leading-none tra
|
|
|
41
41
|
export const getDialogDescriptionClasses = cva("text-sm text-muted-foreground");
|
|
42
42
|
|
|
43
43
|
export const getDialogCloseClasses = cva(
|
|
44
|
-
"absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-
|
|
44
|
+
"absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-all duration-200 hover:opacity-100 hover:rotate-90 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
|
|
45
45
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from "../../libs";
|
|
2
2
|
import { createVariants } from "../../utilities";
|
|
3
3
|
|
|
4
|
-
export const getDockClasses = cva("dock", {
|
|
4
|
+
export const getDockClasses = cva("dock transition-all duration-300", {
|
|
5
5
|
variants: createVariants({
|
|
6
6
|
variant: {
|
|
7
7
|
accent: "bg-accent text-accent-content border-accent",
|
|
@@ -40,7 +40,7 @@ export const getDockClasses = cva("dock", {
|
|
|
40
40
|
],
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
export const getDockButtonClasses = cva("", {
|
|
43
|
+
export const getDockButtonClasses = cva("transition-all duration-200", {
|
|
44
44
|
variants: createVariants({
|
|
45
45
|
active: {
|
|
46
46
|
true: "dock-active",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from "../../libs";
|
|
2
2
|
|
|
3
3
|
export const getDrawerContentClasses = cva(
|
|
4
|
-
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-base-100"
|
|
4
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-base-100 shadow-lg"
|
|
5
5
|
);
|
|
6
6
|
|
|
7
7
|
export const getDrawerDescriptionClasses = cva("text-sm");
|
|
@@ -10,6 +10,6 @@ export const getDrawerHeaderClasses = cva("grid gap-1.5 p-4 text-center sm:text-
|
|
|
10
10
|
|
|
11
11
|
export const getDrawerFooterClasses = cva("mt-auto flex flex-col gap-2 p-4");
|
|
12
12
|
|
|
13
|
-
export const getDrawerOverlayClasses = cva("fixed inset-0 z-50 bg-black/
|
|
13
|
+
export const getDrawerOverlayClasses = cva("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm");
|
|
14
14
|
|
|
15
15
|
export const getDrawerTitleClasses = cva("text-lg font-semibold leading-none tracking-tight");
|
|
@@ -2,7 +2,7 @@ import { cva } from "../../../libs";
|
|
|
2
2
|
import { createVariants } from "../../../utilities";
|
|
3
3
|
|
|
4
4
|
export const getCheckboxClasses = cva(
|
|
5
|
-
"peer flex items-center justify-center h-4 w-4 shrink-0 rounded-xs border focus-visible:border-base-content focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-base-content disabled:cursor-not-allowed disabled:opacity-50",
|
|
5
|
+
"peer flex items-center justify-center h-4 w-4 shrink-0 rounded-xs border transition-all duration-200 focus-visible:border-base-content focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-base-content disabled:cursor-not-allowed disabled:opacity-50",
|
|
6
6
|
{
|
|
7
7
|
variants: createVariants({
|
|
8
8
|
variant: {
|
|
@@ -37,7 +37,7 @@ export const getDatetimeCalendarIconClasses = cva("", {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
export const getTimePickerClasses = cva(
|
|
40
|
-
"border border-neutral-content bg-base-100 shadow-xs cursor-pointer ring-0 py-2 h-8 px-3 w-full text-sm outline-0 inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-
|
|
40
|
+
"border border-neutral-content bg-base-100 shadow-xs cursor-pointer ring-0 py-2 h-8 px-3 w-full text-sm outline-0 inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-all duration-200 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-base-content disabled:pointer-events-none disabled:opacity-50 hover:bg-base-200",
|
|
41
41
|
{
|
|
42
42
|
variants: createVariants({
|
|
43
43
|
selected: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from "../../../libs";
|
|
2
2
|
import { createVariants } from "../../../utilities";
|
|
3
3
|
|
|
4
|
-
export const getInputClasses = cva("input rounded-md transition-all duration-
|
|
4
|
+
export const getInputClasses = cva("input rounded-md transition-all duration-200", {
|
|
5
5
|
variants: createVariants({
|
|
6
6
|
variant: {
|
|
7
7
|
default: "bg-transparent",
|
|
@@ -6,7 +6,7 @@ export const getMultiSelectClasses = cva("overflow-visible bg-transparent flex f
|
|
|
6
6
|
export const getMultiSelectTriggerClasses = cva("flex-wrap h-fit w-fit py-2 overflow-hidden");
|
|
7
7
|
|
|
8
8
|
export const getMultiSelectItemClasses = cva(
|
|
9
|
-
"cursor-pointer transition-
|
|
9
|
+
"cursor-pointer transition-all duration-150 flex justify-between aria-selected:bg-base-300 aria-selected:text-base-content rounded-xs py-1.5 px-2 text-sm outline-hidden",
|
|
10
10
|
{
|
|
11
11
|
variants: createVariants({
|
|
12
12
|
included: {
|