@mbao01/common 0.0.41 → 0.0.43
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/Accordion/Accordion.d.ts +1 -1
- package/dist/types/components/Accordion/constants.d.ts +3 -3
- package/dist/types/components/Accordion/index.d.ts +1 -1
- package/dist/types/components/Accordion/types.d.ts +0 -1
- package/dist/types/components/Alert/Alert.d.ts +1 -1
- package/dist/types/components/Alert/constants.d.ts +1 -1
- package/dist/types/components/Alert/index.d.ts +1 -1
- package/dist/types/components/Alert/types.d.ts +2 -3
- package/dist/types/components/AlertDialog/AlertDialog.d.ts +3 -3
- package/dist/types/components/AlertDialog/constants.d.ts +1 -1
- package/dist/types/components/AlertDialog/index.d.ts +1 -1
- package/dist/types/components/AlertDialog/types.d.ts +3 -4
- package/dist/types/components/Anchor/Anchor.d.ts +1 -1
- package/dist/types/components/Anchor/constant.d.ts +1 -1
- package/dist/types/components/Anchor/index.d.ts +1 -1
- package/dist/types/components/Anchor/types.d.ts +2 -3
- package/dist/types/components/Avatar/Avatar.d.ts +1 -1
- package/dist/types/components/Avatar/constants.d.ts +3 -3
- package/dist/types/components/Avatar/index.d.ts +1 -1
- package/dist/types/components/Avatar/types.d.ts +2 -3
- package/dist/types/components/Badge/Badge.d.ts +1 -1
- package/dist/types/components/Badge/constants.d.ts +1 -1
- package/dist/types/components/Badge/types.d.ts +2 -3
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/types/components/Breadcrumbs/index.d.ts +1 -1
- package/dist/types/components/Breadcrumbs/types.d.ts +0 -1
- package/dist/types/components/Button/Button.d.ts +3 -3
- package/dist/types/components/Button/constants.d.ts +1 -1
- package/dist/types/components/Button/index.d.ts +1 -1
- package/dist/types/components/Button/types.d.ts +3 -3
- package/dist/types/components/Calendar/Calendar.d.ts +1 -1
- package/dist/types/components/Calendar/index.d.ts +1 -1
- package/dist/types/components/Calendar/types.d.ts +1 -2
- package/dist/types/components/Card/Card.d.ts +1 -1
- package/dist/types/components/Card/constants.d.ts +1 -1
- package/dist/types/components/Card/index.d.ts +1 -1
- package/dist/types/components/Card/types.d.ts +3 -3
- package/dist/types/components/Carousel/Carousel.d.ts +11 -12
- package/dist/types/components/Carousel/CarouselContext.d.ts +2 -3
- package/dist/types/components/Carousel/constants.d.ts +4 -4
- package/dist/types/components/Carousel/index.d.ts +1 -1
- package/dist/types/components/Carousel/types.d.ts +1 -2
- package/dist/types/components/Carousel/useCarousel.d.ts +1 -1
- package/dist/types/components/Collapsible/Collapsible.d.ts +3 -4
- package/dist/types/components/Collapsible/index.d.ts +1 -1
- package/dist/types/components/Collapsible/types.d.ts +0 -1
- package/dist/types/components/Combobox/Combobox.d.ts +1 -1
- package/dist/types/components/Combobox/index.d.ts +1 -1
- package/dist/types/components/Command/Command.d.ts +24 -24
- package/dist/types/components/Command/constants.d.ts +11 -11
- package/dist/types/components/Command/index.d.ts +1 -1
- package/dist/types/components/Command/types.d.ts +4 -5
- package/dist/types/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/types/components/DatePicker/DateRangePicker.d.ts +1 -1
- package/dist/types/components/DatePicker/MultipleDatesPicker.d.ts +1 -1
- package/dist/types/components/DatePicker/index.d.ts +3 -3
- package/dist/types/components/DatePicker/types.d.ts +6 -7
- package/dist/types/components/Description/Description.d.ts +1 -1
- package/dist/types/components/Description/index.d.ts +1 -1
- package/dist/types/components/Description/types.d.ts +0 -1
- package/dist/types/components/Dialog/Dialog.d.ts +3 -3
- package/dist/types/components/Dialog/constants.d.ts +7 -7
- package/dist/types/components/Dialog/index.d.ts +1 -1
- package/dist/types/components/Dialog/types.d.ts +2 -3
- package/dist/types/components/Drawer/Drawer.d.ts +15 -20
- package/dist/types/components/Drawer/constants.d.ts +6 -6
- package/dist/types/components/Drawer/index.d.ts +1 -1
- package/dist/types/components/Drawer/types.d.ts +1 -2
- package/dist/types/components/FileUploader/FileUploader.d.ts +4 -5
- package/dist/types/components/FileUploader/FileUploaderContext.d.ts +2 -3
- package/dist/types/components/FileUploader/index.d.ts +1 -1
- package/dist/types/components/FileUploader/types.d.ts +2 -2
- package/dist/types/components/FileUploader/useFileUpload.d.ts +1 -1
- package/dist/types/components/Form/Checkbox/constants.d.ts +1 -1
- package/dist/types/components/Form/Checkbox/index.d.ts +1 -1
- package/dist/types/components/Form/Checkbox/types.d.ts +2 -3
- package/dist/types/components/Form/Input/Input.d.ts +2 -2
- package/dist/types/components/Form/Input/constants.d.ts +1 -1
- package/dist/types/components/Form/Input/index.d.ts +1 -1
- package/dist/types/components/Form/Input/types.d.ts +2 -3
- package/dist/types/components/Form/OtpInput/OtpInput.d.ts +1 -1
- package/dist/types/components/Form/OtpInput/index.d.ts +1 -1
- package/dist/types/components/Form/OtpInput/types.d.ts +2 -2
- package/dist/types/components/Form/Phone/Phone.d.ts +2 -2
- package/dist/types/components/Form/Phone/constants.d.ts +2 -2
- package/dist/types/components/Form/Phone/index.d.ts +1 -1
- package/dist/types/components/Form/Phone/types.d.ts +1 -1
- package/dist/types/components/Form/Radio/constants.d.ts +1 -1
- package/dist/types/components/Form/Radio/index.d.ts +1 -1
- package/dist/types/components/Form/Radio/types.d.ts +2 -3
- package/dist/types/components/Form/Range/Range.d.ts +1 -1
- package/dist/types/components/Form/Range/constants.d.ts +1 -1
- package/dist/types/components/Form/Range/index.d.ts +1 -1
- package/dist/types/components/Form/Range/types.d.ts +2 -3
- package/dist/types/components/Form/Select/Select.d.ts +2 -2
- package/dist/types/components/Form/Select/constants.d.ts +6 -6
- package/dist/types/components/Form/Select/index.d.ts +1 -1
- package/dist/types/components/Form/Select/types.d.ts +2 -3
- package/dist/types/components/Form/Slider/constants.d.ts +4 -4
- package/dist/types/components/Form/Slider/index.d.ts +1 -1
- package/dist/types/components/Form/Slider/types.d.ts +2 -3
- package/dist/types/components/Form/Switch/constants.d.ts +1 -1
- package/dist/types/components/Form/Switch/index.d.ts +1 -1
- package/dist/types/components/Form/Switch/types.d.ts +2 -3
- package/dist/types/components/Form/TextField/TextField.d.ts +3 -3
- package/dist/types/components/Form/TextField/constants.d.ts +1 -1
- package/dist/types/components/Form/TextField/index.d.ts +1 -1
- package/dist/types/components/Form/TextField/types.d.ts +2 -2
- package/dist/types/components/Form/Textarea/Textarea.d.ts +1 -1
- package/dist/types/components/Form/Textarea/constants.d.ts +1 -1
- package/dist/types/components/Form/Textarea/index.d.ts +1 -1
- package/dist/types/components/Form/Textarea/types.d.ts +2 -3
- package/dist/types/components/Form/components/FormControl/FormControl.d.ts +1 -1
- package/dist/types/components/Form/components/FormControl/constants.d.ts +1 -1
- package/dist/types/components/Form/components/FormControl/index.d.ts +1 -1
- package/dist/types/components/Form/components/FormControl/types.d.ts +2 -3
- package/dist/types/components/Form/components/Label/Label.d.ts +1 -1
- package/dist/types/components/Form/components/Label/constants.d.ts +1 -1
- package/dist/types/components/Form/components/Label/index.d.ts +1 -1
- package/dist/types/components/Form/components/Label/types.d.ts +3 -4
- package/dist/types/components/Form/index.d.ts +13 -13
- package/dist/types/components/HoverCard/HoverCard.d.ts +3 -4
- package/dist/types/components/HoverCard/constants.d.ts +1 -1
- package/dist/types/components/HoverCard/index.d.ts +1 -1
- package/dist/types/components/HoverCard/types.d.ts +0 -1
- package/dist/types/components/Loading/Loading.d.ts +1 -1
- package/dist/types/components/Loading/constants.d.ts +1 -1
- package/dist/types/components/Loading/index.d.ts +1 -1
- package/dist/types/components/Loading/types.d.ts +2 -3
- package/dist/types/components/Menu/ContextMenu/ContextMenu.d.ts +19 -20
- package/dist/types/components/Menu/ContextMenu/index.d.ts +1 -1
- package/dist/types/components/Menu/ContextMenu/types.d.ts +2 -3
- package/dist/types/components/Menu/DropdownMenu/DropdownMenu.d.ts +19 -20
- package/dist/types/components/Menu/DropdownMenu/index.d.ts +1 -1
- package/dist/types/components/Menu/DropdownMenu/types.d.ts +2 -3
- package/dist/types/components/Menu/Menubar/constants.d.ts +11 -11
- package/dist/types/components/Menu/Menubar/index.d.ts +1 -1
- package/dist/types/components/Menu/Menubar/types.d.ts +2 -3
- package/dist/types/components/Menu/NavigationMenu/NavigationMenu.d.ts +9 -10
- package/dist/types/components/Menu/NavigationMenu/constants.d.ts +6 -6
- package/dist/types/components/Menu/NavigationMenu/index.d.ts +1 -1
- package/dist/types/components/Menu/NavigationMenu/types.d.ts +2 -3
- package/dist/types/components/Menu/index.d.ts +4 -4
- package/dist/types/components/Pagination/Pagination.d.ts +3 -4
- package/dist/types/components/Pagination/constants.d.ts +5 -5
- package/dist/types/components/Pagination/index.d.ts +1 -1
- package/dist/types/components/Pagination/types.d.ts +2 -3
- package/dist/types/components/Popover/Popover.d.ts +1 -1
- package/dist/types/components/Popover/constants.d.ts +1 -1
- package/dist/types/components/Popover/index.d.ts +1 -1
- package/dist/types/components/Popover/types.d.ts +2 -3
- package/dist/types/components/Progress/Progress.d.ts +1 -1
- package/dist/types/components/Progress/constants.d.ts +2 -2
- package/dist/types/components/Progress/index.d.ts +1 -1
- package/dist/types/components/Progress/types.d.ts +2 -3
- package/dist/types/components/ScrollArea/ScrollArea.d.ts +3 -4
- package/dist/types/components/ScrollArea/constants.d.ts +4 -4
- package/dist/types/components/ScrollArea/index.d.ts +1 -1
- package/dist/types/components/ScrollArea/types.d.ts +2 -3
- package/dist/types/components/Separator/Separator.d.ts +1 -1
- package/dist/types/components/Separator/constants.d.ts +1 -1
- package/dist/types/components/Separator/index.d.ts +1 -1
- package/dist/types/components/Separator/types.d.ts +0 -1
- package/dist/types/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/types/components/Skeleton/constants.d.ts +1 -1
- package/dist/types/components/Skeleton/index.d.ts +1 -1
- package/dist/types/components/Skeleton/types.d.ts +2 -3
- package/dist/types/components/Slot/Slot.d.ts +1 -1
- package/dist/types/components/Slot/index.d.ts +1 -1
- package/dist/types/components/Sonner/Toaster.d.ts +1 -1
- package/dist/types/components/Sonner/constants.d.ts +2 -2
- package/dist/types/components/Sonner/index.d.ts +2 -2
- package/dist/types/components/Sonner/types.d.ts +3 -4
- package/dist/types/components/Table/Table.d.ts +8 -9
- package/dist/types/components/Table/constants.d.ts +2 -2
- package/dist/types/components/Table/index.d.ts +1 -1
- package/dist/types/components/Table/types.d.ts +2 -3
- package/dist/types/components/Tabs/Tabs.d.ts +1 -1
- package/dist/types/components/Tabs/constants.d.ts +3 -3
- package/dist/types/components/Tabs/index.d.ts +1 -1
- package/dist/types/components/Tabs/types.d.ts +2 -3
- package/dist/types/components/Text/Text.d.ts +1 -1
- package/dist/types/components/Text/constants.d.ts +1 -1
- package/dist/types/components/Text/types.d.ts +2 -3
- package/dist/types/components/ThemeSwitch/ThemeSwitch.d.ts +1 -1
- package/dist/types/components/ThemeSwitch/constants.d.ts +1 -1
- package/dist/types/components/ThemeSwitch/index.d.ts +1 -1
- package/dist/types/components/ThemeSwitch/types.d.ts +1 -2
- package/dist/types/components/Toggle/Toggle.d.ts +1 -1
- package/dist/types/components/Toggle/constants.d.ts +1 -1
- package/dist/types/components/Toggle/index.d.ts +1 -1
- package/dist/types/components/Toggle/types.d.ts +3 -4
- package/dist/types/components/ToggleGroup/ToggleGroup.d.ts +4 -5
- package/dist/types/components/ToggleGroup/constants.d.ts +1 -1
- package/dist/types/components/ToggleGroup/index.d.ts +1 -1
- package/dist/types/components/ToggleGroup/types.d.ts +1 -2
- package/dist/types/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/types/components/Tooltip/constants.d.ts +2 -2
- package/dist/types/components/Tooltip/index.d.ts +1 -1
- package/dist/types/components/Tooltip/types.d.ts +2 -3
- package/dist/types/index.d.ts +36 -36
- package/dist/types/libs/cva.d.ts +2 -2
- package/dist/types/libs/index.d.ts +1 -1
- package/dist/types/utilities/cn.d.ts +1 -1
- package/dist/types/utilities/getSubpaths/getSubpaths.d.ts +1 -1
- package/dist/types/utilities/getSubpaths/index.d.ts +1 -1
- package/dist/types/utilities/index.d.ts +3 -3
- package/package.json +82 -73
- package/src/components/Accordion/Accordion.tsx +3 -9
- package/src/components/Accordion/types.ts +2 -6
- package/src/components/Alert/Alert.tsx +3 -14
- package/src/components/AlertDialog/AlertDialog.tsx +3 -6
- package/src/components/AlertDialog/types.ts +3 -5
- package/src/components/Anchor/Anchor.tsx +3 -5
- package/src/components/Avatar/Avatar.tsx +5 -25
- package/src/components/Avatar/constants.ts +15 -18
- package/src/components/Avatar/types.ts +1 -5
- package/src/components/Badge/Badge.tsx +2 -12
- package/src/components/Badge/index.ts +1 -1
- package/src/components/Button/Button.tsx +5 -21
- package/src/components/Button/constants.ts +1 -1
- package/src/components/Button/types.ts +1 -1
- package/src/components/Calendar/Calendar.tsx +40 -34
- package/src/components/Card/Card.tsx +4 -14
- package/src/components/Card/types.ts +1 -2
- package/src/components/Carousel/Carousel.tsx +68 -73
- package/src/components/Carousel/constants.ts +10 -13
- package/src/components/Carousel/types.ts +1 -1
- package/src/components/Collapsible/Collapsible.tsx +2 -4
- package/src/components/Collapsible/types.ts +1 -3
- package/src/components/Combobox/Combobox.tsx +3 -8
- package/src/components/Command/Command.tsx +11 -28
- package/src/components/Command/constants.ts +2 -6
- package/src/components/Command/types.ts +3 -7
- package/src/components/DatePicker/DatePicker.tsx +5 -9
- package/src/components/DatePicker/DateRangePicker.tsx +5 -9
- package/src/components/DatePicker/MultipleDatesPicker.tsx +6 -10
- package/src/components/DatePicker/types.ts +12 -23
- package/src/components/Description/Description.tsx +4 -19
- package/src/components/Dialog/Dialog.tsx +5 -9
- package/src/components/Dialog/constants.ts +2 -6
- package/src/components/Dialog/types.ts +5 -15
- package/src/components/Drawer/Drawer.tsx +6 -19
- package/src/components/Drawer/constants.ts +2 -6
- package/src/components/FileUploader/FileUploader.tsx +31 -53
- package/src/components/FileUploader/FileUploaderContext.tsx +1 -2
- package/src/components/FileUploader/types.ts +1 -1
- package/src/components/Form/Checkbox/Checkbox.tsx +2 -2
- package/src/components/Form/Checkbox/types.ts +1 -4
- package/src/components/Form/Input/Input.tsx +3 -9
- package/src/components/Form/Input/constants.ts +47 -50
- package/src/components/Form/Input/types.ts +1 -4
- package/src/components/Form/OtpInput/OtpInput.tsx +5 -12
- package/src/components/Form/Phone/Phone.tsx +6 -15
- package/src/components/Form/Radio/Radio.tsx +2 -2
- package/src/components/Form/Radio/types.ts +1 -4
- package/src/components/Form/Range/Range.tsx +3 -6
- package/src/components/Form/Range/types.ts +1 -4
- package/src/components/Form/Select/Select.tsx +26 -49
- package/src/components/Form/Select/types.ts +3 -9
- package/src/components/Form/Slider/Slider.tsx +39 -25
- package/src/components/Form/Slider/constants.ts +21 -24
- package/src/components/Form/Slider/types.ts +2 -4
- package/src/components/Form/Switch/Switch.tsx +2 -3
- package/src/components/Form/Switch/types.ts +1 -4
- package/src/components/Form/TextField/TextField.tsx +2 -2
- package/src/components/Form/Textarea/Textarea.tsx +2 -5
- package/src/components/Form/Textarea/constants.ts +42 -45
- package/src/components/Form/components/FormControl/FormControl.tsx +1 -1
- package/src/components/Form/components/Label/Label.tsx +2 -5
- package/src/components/Form/components/Label/types.ts +2 -4
- package/src/components/HoverCard/HoverCard.tsx +2 -4
- package/src/components/HoverCard/types.ts +1 -3
- package/src/components/Loading/Loading.tsx +3 -12
- package/src/components/Menu/ContextMenu/ContextMenu.tsx +5 -17
- package/src/components/Menu/ContextMenu/types.ts +1 -3
- package/src/components/Menu/DropdownMenu/DropdownMenu.tsx +7 -21
- package/src/components/Menu/DropdownMenu/types.ts +1 -3
- package/src/components/Menu/Menubar/Menubar.tsx +33 -49
- package/src/components/Menu/Menubar/types.ts +5 -15
- package/src/components/Menu/NavigationMenu/NavigationMenu.tsx +4 -13
- package/src/components/Pagination/Pagination.tsx +18 -42
- package/src/components/Pagination/constants.ts +2 -6
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/Popover/types.ts +2 -6
- package/src/components/Progress/Progress.tsx +2 -4
- package/src/components/Progress/constants.ts +38 -44
- package/src/components/ScrollArea/ScrollArea.tsx +4 -16
- package/src/components/ScrollArea/constants.ts +8 -13
- package/src/components/ScrollArea/types.ts +1 -3
- package/src/components/Separator/Separator.tsx +2 -2
- package/src/components/Separator/types.ts +1 -3
- package/src/components/Skeleton/Skeleton.tsx +4 -14
- package/src/components/Sonner/Toaster.tsx +2 -4
- package/src/components/Sonner/constants.ts +10 -20
- package/src/components/Sonner/types.ts +4 -10
- package/src/components/Table/Table.tsx +23 -38
- package/src/components/Tabs/Tabs.tsx +9 -31
- package/src/components/Tabs/types.ts +5 -17
- package/src/components/Text/Text.tsx +3 -6
- package/src/components/Text/index.ts +1 -1
- package/src/components/Text/types.ts +1 -3
- package/src/components/ThemeSwitch/ThemeSwitch.tsx +3 -2
- package/src/components/Toggle/Toggle.tsx +15 -16
- package/src/components/Toggle/types.ts +2 -7
- package/src/components/ToggleGroup/ToggleGroup.tsx +5 -19
- package/src/components/ToggleGroup/constants.ts +1 -3
- package/src/components/ToggleGroup/types.ts +1 -3
- package/src/components/Tooltip/Tooltip.tsx +2 -4
- package/src/components/Tooltip/types.ts +1 -1
- package/src/libs/cva.ts +1 -3
- package/src/typography/TypographyDemo.tsx +119 -188
- package/src/typography/TypographyScale.tsx +7 -8
- package/src/utilities/cn.ts +2 -1
- package/src/utilities/getSubpaths/getSubpaths.ts +2 -4
- package/tsconfig.node.json +1 -1
- package/vitest-setup.ts +17 -1
- package/vitest.config.ts +2 -1
- package/dist/types/components/Menu/Menubar/Menubar.d.ts +0 -43
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { DayPicker } from "react-day-picker";
|
|
4
4
|
import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons";
|
|
5
|
-
import { type CalendarProps } from "./types";
|
|
6
5
|
import { cn } from "../../utilities";
|
|
7
6
|
import { getButtonClasses } from "../Button/constants";
|
|
7
|
+
import { type CalendarProps } from "./types";
|
|
8
8
|
|
|
9
9
|
export const Calendar = ({
|
|
10
10
|
className,
|
|
@@ -17,46 +17,52 @@ export const Calendar = ({
|
|
|
17
17
|
showOutsideDays={showOutsideDays}
|
|
18
18
|
className={cn("p-3", className)}
|
|
19
19
|
classNames={{
|
|
20
|
-
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
21
|
-
month: "space-y-4",
|
|
22
|
-
caption: "flex justify-center pt-1 relative items-center",
|
|
23
20
|
caption_label: "text-sm font-medium",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
day: "h-9 w-9 text-center flex items-center justify-center text-sm p-0 relative focus-within:relative focus-within:z-20",
|
|
22
|
+
day_button: cn(
|
|
23
|
+
getButtonClasses({ variant: "ghost" }),
|
|
24
|
+
"h-8 w-8 p-0 font-normal group-has-[*]/today:bg-accent group-aria-[selected]/today:bg-primary group-[.day-in-range]/today:!bg-primary/50 group-has-[*]/today:text-accent-content group-has-[*]/today:rounded-full"
|
|
25
|
+
),
|
|
26
|
+
disabled: "!opacity-30",
|
|
27
|
+
dropdown: "bg-transparent",
|
|
28
|
+
dropdown_root: "text-sm [&>[aria-hidden='true']]:hidden",
|
|
29
|
+
dropdowns: "flex justify-center items-center",
|
|
30
|
+
hidden: "hidden",
|
|
31
|
+
button_previous: cn(
|
|
27
32
|
getButtonClasses({ outline: true }),
|
|
28
|
-
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
33
|
+
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 [&:disabled]:text-opacity-50"
|
|
29
34
|
),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
head_row: "flex",
|
|
34
|
-
head_cell:
|
|
35
|
-
"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
|
36
|
-
row: "flex w-full mt-2",
|
|
37
|
-
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
38
|
-
day: cn(
|
|
39
|
-
getButtonClasses({ variant: "ghost" }),
|
|
40
|
-
"h-8 w-8 p-0 font-normal aria-selected:opacity-100"
|
|
35
|
+
button_next: cn(
|
|
36
|
+
getButtonClasses({ outline: true }),
|
|
37
|
+
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 [&:disabled]:text-opacity-50"
|
|
41
38
|
),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
footer: "text-sm py-2",
|
|
40
|
+
month: "space-y-4",
|
|
41
|
+
month_caption: "flex justify-start pt-1 relative items-center",
|
|
42
|
+
month_grid: "w-full border-collapse space-y-1",
|
|
43
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-y-0 relative",
|
|
44
|
+
nav: "absolute flex gap-2 items-center rtl:left-0 rtl:right-auto right-0 z-10",
|
|
45
|
+
outside: "opacity-50",
|
|
46
|
+
range_end: "!opacity-100",
|
|
47
|
+
range_start: "!opacity-100",
|
|
48
|
+
range_middle: "day-in-range [&>*]:bg-primary/50 [&>*]:text-primary-content",
|
|
49
|
+
selected:
|
|
50
|
+
"[&>*]:bg-primary [&>*]:text-primary-content [&:disabled>*]:bg-primary [&:disabled>*]:text-primary-content [&:hover>*]:bg-primary [&:hover>*]:text-primary-content [&:focus>*]:bg-primary [&:focus>*]:text-primary-content",
|
|
51
|
+
today: "group/today [&:has(*)]:ring-0 ring-1 ring-accent ring-inset rounded-full",
|
|
52
|
+
weekdays: "flex",
|
|
53
|
+
weekday: "rounded-md w-9 font-normal text-[0.8rem]",
|
|
54
|
+
week: "flex w-full mt-2",
|
|
55
|
+
week_number: "flex items-center text-sm italic w-6",
|
|
56
|
+
week_number_header: "w-6",
|
|
55
57
|
...classNames,
|
|
56
58
|
}}
|
|
57
59
|
components={{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
Chevron: ({ orientation, className }) => {
|
|
61
|
+
if (orientation === "left") {
|
|
62
|
+
return <ChevronLeftIcon className={cn("h-4 w-4", className)} />;
|
|
63
|
+
}
|
|
64
|
+
return <ChevronRightIcon className={cn("h-4 w-4", className)} />;
|
|
65
|
+
},
|
|
60
66
|
}}
|
|
61
67
|
{...props}
|
|
62
68
|
/>
|
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
CardActionsProps,
|
|
3
|
+
CardBodyProps,
|
|
3
4
|
CardContentProps,
|
|
4
5
|
CardDescriptionProps,
|
|
5
6
|
CardFooterProps,
|
|
6
7
|
CardHeaderProps,
|
|
7
8
|
CardImageProps,
|
|
8
|
-
CardTitleProps,
|
|
9
9
|
CardProps,
|
|
10
|
-
|
|
10
|
+
CardTitleProps,
|
|
11
11
|
} from "./types";
|
|
12
12
|
import { cn } from "../../utilities";
|
|
13
13
|
import { getCardClasses } from "./constants";
|
|
14
14
|
|
|
15
|
-
const Card = ({
|
|
16
|
-
compact,
|
|
17
|
-
bordered,
|
|
18
|
-
horizontal,
|
|
19
|
-
overlay,
|
|
20
|
-
className,
|
|
21
|
-
...props
|
|
22
|
-
}: CardProps) => (
|
|
15
|
+
const Card = ({ compact, bordered, horizontal, overlay, className, ...props }: CardProps) => (
|
|
23
16
|
<div
|
|
24
|
-
className={cn(
|
|
25
|
-
getCardClasses({ bordered, compact, horizontal, overlay }),
|
|
26
|
-
className
|
|
27
|
-
)}
|
|
17
|
+
className={cn(getCardClasses({ bordered, compact, horizontal, overlay }), className)}
|
|
28
18
|
{...props}
|
|
29
19
|
/>
|
|
30
20
|
);
|
|
@@ -2,8 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { type VariantProps } from "../../libs";
|
|
3
3
|
import { getCardClasses } from "./constants";
|
|
4
4
|
|
|
5
|
-
export type CardProps = React.HTMLAttributes<HTMLDivElement> &
|
|
6
|
-
VariantProps<typeof getCardClasses>;
|
|
5
|
+
export type CardProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof getCardClasses>;
|
|
7
6
|
|
|
8
7
|
export type CardActionsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
9
8
|
export type CardBodyProps = React.HTMLAttributes<HTMLDivElement>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { forwardRef, useCallback, useEffect, useState } from "react";
|
|
4
|
-
import useEmblaCarousel from "embla-carousel-react";
|
|
5
4
|
import { ArrowLeftIcon, ArrowRightIcon } from "@radix-ui/react-icons";
|
|
5
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
6
6
|
import type { CarouselApi, CarouselProps } from "./types";
|
|
7
7
|
import { cn } from "../../utilities";
|
|
8
8
|
import { Button } from "../Button";
|
|
9
|
+
import { CarouselContext } from "./CarouselContext";
|
|
9
10
|
import {
|
|
10
11
|
getCarouselContentClasses,
|
|
11
12
|
getCarouselItemClasses,
|
|
12
13
|
getCarouselNextClasses,
|
|
13
14
|
getCarouselPreviousClasses,
|
|
14
15
|
} from "./constants";
|
|
15
|
-
import { CarouselContext } from "./CarouselContext";
|
|
16
16
|
import { useCarousel } from "./useCarousel";
|
|
17
17
|
|
|
18
18
|
const Carousel = ({
|
|
@@ -92,8 +92,7 @@ const Carousel = ({
|
|
|
92
92
|
carouselRef,
|
|
93
93
|
api: api,
|
|
94
94
|
opts,
|
|
95
|
-
orientation:
|
|
96
|
-
orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
95
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
97
96
|
scrollPrev,
|
|
98
97
|
scrollNext,
|
|
99
98
|
canScrollPrev,
|
|
@@ -114,86 +113,82 @@ const Carousel = ({
|
|
|
114
113
|
};
|
|
115
114
|
Carousel.displayName = "Carousel";
|
|
116
115
|
|
|
117
|
-
const CarouselContent = forwardRef<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
const CarouselContent = forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
117
|
+
({ className, ...props }, ref) => {
|
|
118
|
+
const { carouselRef, orientation } = useCarousel();
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<div ref={carouselRef} className="overflow-hidden">
|
|
122
|
+
<div
|
|
123
|
+
ref={ref}
|
|
124
|
+
className={cn(getCarouselContentClasses({ orientation }), className)}
|
|
125
|
+
{...props}
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
CarouselContent.displayName = "CarouselContent";
|
|
122
132
|
|
|
123
|
-
|
|
124
|
-
|
|
133
|
+
const CarouselItem = forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
134
|
+
({ className, ...props }, ref) => {
|
|
135
|
+
const { orientation } = useCarousel();
|
|
136
|
+
|
|
137
|
+
return (
|
|
125
138
|
<div
|
|
126
139
|
ref={ref}
|
|
127
|
-
|
|
140
|
+
role="group"
|
|
141
|
+
aria-roledescription="slide"
|
|
142
|
+
className={cn(getCarouselItemClasses({ orientation }), className)}
|
|
128
143
|
{...props}
|
|
129
144
|
/>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
CarouselContent.displayName = "CarouselContent";
|
|
134
|
-
|
|
135
|
-
const CarouselItem = forwardRef<
|
|
136
|
-
HTMLDivElement,
|
|
137
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
138
|
-
>(({ className, ...props }, ref) => {
|
|
139
|
-
const { orientation } = useCarousel();
|
|
140
|
-
|
|
141
|
-
return (
|
|
142
|
-
<div
|
|
143
|
-
ref={ref}
|
|
144
|
-
role="group"
|
|
145
|
-
aria-roledescription="slide"
|
|
146
|
-
className={cn(getCarouselItemClasses({ orientation }), className)}
|
|
147
|
-
{...props}
|
|
148
|
-
/>
|
|
149
|
-
);
|
|
150
|
-
});
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
);
|
|
151
148
|
CarouselItem.displayName = "CarouselItem";
|
|
152
149
|
|
|
153
|
-
const CarouselPrevious = forwardRef<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
>(({ className, variant = "ghost", outline = true, ...props }, ref) => {
|
|
157
|
-
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
150
|
+
const CarouselPrevious = forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(
|
|
151
|
+
({ className, variant = "ghost", outline = true, ...props }, ref) => {
|
|
152
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
158
153
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
154
|
+
return (
|
|
155
|
+
<Button
|
|
156
|
+
ref={ref}
|
|
157
|
+
outline={outline}
|
|
158
|
+
variant={variant}
|
|
159
|
+
className={cn(getCarouselPreviousClasses({ orientation }), className)}
|
|
160
|
+
disabled={!canScrollPrev}
|
|
161
|
+
onClick={scrollPrev}
|
|
162
|
+
{...props}
|
|
163
|
+
>
|
|
164
|
+
<ArrowLeftIcon className="h-4 w-4" />
|
|
165
|
+
<span className="sr-only">Previous slide</span>
|
|
166
|
+
</Button>
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
);
|
|
174
170
|
CarouselPrevious.displayName = "CarouselPrevious";
|
|
175
171
|
|
|
176
|
-
const CarouselNext = forwardRef<
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
>(({ className, outline = true, variant = "ghost", ...props }, ref) => {
|
|
180
|
-
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
172
|
+
const CarouselNext = forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(
|
|
173
|
+
({ className, outline = true, variant = "ghost", ...props }, ref) => {
|
|
174
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
181
175
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
176
|
+
return (
|
|
177
|
+
<Button
|
|
178
|
+
ref={ref}
|
|
179
|
+
outline={outline}
|
|
180
|
+
variant={variant}
|
|
181
|
+
className={cn(getCarouselNextClasses({ orientation }), className)}
|
|
182
|
+
disabled={!canScrollNext}
|
|
183
|
+
onClick={scrollNext}
|
|
184
|
+
{...props}
|
|
185
|
+
>
|
|
186
|
+
<ArrowRightIcon className="h-4 w-4" />
|
|
187
|
+
<span className="sr-only">Next slide</span>
|
|
188
|
+
</Button>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
);
|
|
197
192
|
CarouselNext.displayName = "CarouselNext";
|
|
198
193
|
|
|
199
194
|
Carousel.Content = CarouselContent;
|
|
@@ -12,20 +12,17 @@ export const getCarouselContentClasses = cva("flex", {
|
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
export const getCarouselItemClasses = cva(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
horizontal: "pl-4",
|
|
21
|
-
vertical: "pt-4",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
defaultVariants: {
|
|
25
|
-
orientation: "horizontal",
|
|
15
|
+
export const getCarouselItemClasses = cva("min-w-0 shrink-0 grow-0 basis-full", {
|
|
16
|
+
variants: {
|
|
17
|
+
orientation: {
|
|
18
|
+
horizontal: "pl-4",
|
|
19
|
+
vertical: "pt-4",
|
|
26
20
|
},
|
|
27
|
-
}
|
|
28
|
-
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
orientation: "horizontal",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
29
26
|
|
|
30
27
|
export const getCarouselNextClasses = cva(
|
|
31
28
|
"absolute h-8 w-8 rounded-full p-0 disabled:bg-transparent",
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
4
|
-
import { type CollapsibleProps } from "@radix-ui/react-
|
|
4
|
+
import { type CollapsibleProps } from "@radix-ui/react-collapsible";
|
|
5
5
|
|
|
6
|
-
const Collapsible = (props: CollapsibleProps) =>
|
|
7
|
-
<CollapsiblePrimitive.Root {...props} />
|
|
8
|
-
);
|
|
6
|
+
const Collapsible = (props: CollapsibleProps) => <CollapsiblePrimitive.Root {...props} />;
|
|
9
7
|
|
|
10
8
|
Collapsible.Trigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
11
9
|
Collapsible.Content = CollapsiblePrimitive.CollapsibleContent;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
2
|
|
|
3
|
-
export type CollapsibleProps = React.ComponentPropsWithoutRef<
|
|
4
|
-
typeof CollapsiblePrimitive.Root
|
|
5
|
-
>;
|
|
3
|
+
export type CollapsibleProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>;
|
|
@@ -4,9 +4,9 @@ import * as React from "react";
|
|
|
4
4
|
import { CaretSortIcon, CheckIcon } from "@radix-ui/react-icons";
|
|
5
5
|
import type { ComboboxProps, Item } from "./types";
|
|
6
6
|
import { cn } from "../../utilities";
|
|
7
|
+
import { Button } from "../Button";
|
|
7
8
|
import { Command } from "../Command";
|
|
8
9
|
import { Popover } from "../Popover";
|
|
9
|
-
import { Button } from "../Button";
|
|
10
10
|
|
|
11
11
|
export const Combobox = <T extends Item>({
|
|
12
12
|
label,
|
|
@@ -39,13 +39,8 @@ export const Combobox = <T extends Item>({
|
|
|
39
39
|
</Popover.Trigger>
|
|
40
40
|
<Popover.Content className={cn("w-[200px] p-0", classes?.popoverContent)}>
|
|
41
41
|
<Command className={cn(classes?.content)}>
|
|
42
|
-
<Command.Input
|
|
43
|
-
|
|
44
|
-
className={cn(classes?.input)}
|
|
45
|
-
/>
|
|
46
|
-
<Command.Empty className={cn(classes?.empty)}>
|
|
47
|
-
{emptyText}
|
|
48
|
-
</Command.Empty>
|
|
42
|
+
<Command.Input placeholder={placeholder} className={cn(classes?.input)} />
|
|
43
|
+
<Command.Empty className={cn(classes?.empty)}>{emptyText}</Command.Empty>
|
|
49
44
|
<Command.List>
|
|
50
45
|
<Command.Group className={cn(classes?.group)}>
|
|
51
46
|
{items?.map((item) => (
|
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { Command as CommandPrimitive } from "cmdk";
|
|
5
4
|
import { MagnifyingGlassIcon } from "@radix-ui/react-icons";
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
CommandDialogProps,
|
|
9
|
-
CommandInputProps,
|
|
10
|
-
} from "./types";
|
|
11
|
-
import { Dialog } from "../Dialog";
|
|
5
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
6
|
+
import type { CommandDialogProps, CommandInputProps, CommandProps } from "./types";
|
|
12
7
|
import { cn } from "../../utilities";
|
|
8
|
+
import { Dialog } from "../Dialog";
|
|
13
9
|
import {
|
|
14
|
-
getDialogContentClasses,
|
|
15
10
|
getCommandClasses,
|
|
16
11
|
getCommandDialogClasses,
|
|
17
12
|
getCommandEmptyClasses,
|
|
13
|
+
getCommandGroupClasses,
|
|
18
14
|
getCommandInputClasses,
|
|
19
15
|
getCommandInputWrapperClasses,
|
|
16
|
+
getCommandItemClasses,
|
|
20
17
|
getCommandListClasses,
|
|
21
|
-
getCommandGroupClasses,
|
|
22
18
|
getCommandSeparatorClasses,
|
|
23
|
-
getCommandItemClasses,
|
|
24
19
|
getCommandShortcutClasses,
|
|
20
|
+
getDialogContentClasses,
|
|
25
21
|
} from "./constants";
|
|
26
22
|
|
|
27
23
|
const Command = ({ className, ...props }: CommandProps) => (
|
|
@@ -60,11 +56,7 @@ const CommandList = React.forwardRef<
|
|
|
60
56
|
React.ElementRef<typeof CommandPrimitive.List>,
|
|
61
57
|
React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
|
|
62
58
|
>(({ className, ...props }, ref) => (
|
|
63
|
-
<CommandPrimitive.List
|
|
64
|
-
ref={ref}
|
|
65
|
-
className={cn(getCommandListClasses(), className)}
|
|
66
|
-
{...props}
|
|
67
|
-
/>
|
|
59
|
+
<CommandPrimitive.List ref={ref} className={cn(getCommandListClasses(), className)} {...props} />
|
|
68
60
|
));
|
|
69
61
|
|
|
70
62
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
@@ -111,22 +103,13 @@ const CommandItem = React.forwardRef<
|
|
|
111
103
|
React.ElementRef<typeof CommandPrimitive.Item>,
|
|
112
104
|
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
|
|
113
105
|
>(({ className, ...props }, ref) => (
|
|
114
|
-
<CommandPrimitive.Item
|
|
115
|
-
ref={ref}
|
|
116
|
-
className={cn(getCommandItemClasses(), className)}
|
|
117
|
-
{...props}
|
|
118
|
-
/>
|
|
106
|
+
<CommandPrimitive.Item ref={ref} className={cn(getCommandItemClasses(), className)} {...props} />
|
|
119
107
|
));
|
|
120
108
|
|
|
121
109
|
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
122
110
|
|
|
123
|
-
const CommandShortcut = ({
|
|
124
|
-
className,
|
|
125
|
-
...props
|
|
126
|
-
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
127
|
-
return (
|
|
128
|
-
<span className={cn(getCommandShortcutClasses(), className)} {...props} />
|
|
129
|
-
);
|
|
111
|
+
const CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
112
|
+
return <span className={cn(getCommandShortcutClasses(), className)} {...props} />;
|
|
130
113
|
};
|
|
131
114
|
CommandShortcut.displayName = "CommandShortcut";
|
|
132
115
|
|
|
@@ -10,17 +10,13 @@ export const getCommandDialogClasses = cva(
|
|
|
10
10
|
"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
-
export const getCommandInputWrapperClasses = cva(
|
|
14
|
-
"flex items-center border-b px-3"
|
|
15
|
-
);
|
|
13
|
+
export const getCommandInputWrapperClasses = cva("flex items-center border-b px-3");
|
|
16
14
|
|
|
17
15
|
export const getCommandInputClasses = cva(
|
|
18
16
|
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"
|
|
19
17
|
);
|
|
20
18
|
|
|
21
|
-
export const getCommandListClasses = cva(
|
|
22
|
-
"max-h-[300px] overflow-y-auto overflow-x-hidden"
|
|
23
|
-
);
|
|
19
|
+
export const getCommandListClasses = cva("max-h-[300px] overflow-y-auto overflow-x-hidden");
|
|
24
20
|
|
|
25
21
|
export const getCommandEmptyClasses = cva("py-6 text-center text-sm");
|
|
26
22
|
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { Command as CommandPrimitive } from "cmdk";
|
|
2
|
-
import { type DialogProps } from "../Dialog/types";
|
|
3
2
|
import { type VariantProps } from "../../libs";
|
|
3
|
+
import { type DialogProps } from "../Dialog/types";
|
|
4
4
|
import { getCommandClasses, getCommandInputClasses } from "./constants";
|
|
5
5
|
|
|
6
|
-
export type CommandProps = React.ComponentPropsWithoutRef<
|
|
7
|
-
typeof CommandPrimitive
|
|
8
|
-
> &
|
|
6
|
+
export type CommandProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive> &
|
|
9
7
|
VariantProps<typeof getCommandClasses>;
|
|
10
8
|
|
|
11
|
-
export type CommandInputProps = React.ComponentPropsWithoutRef<
|
|
12
|
-
typeof CommandPrimitive.Input
|
|
13
|
-
> &
|
|
9
|
+
export type CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> &
|
|
14
10
|
VariantProps<typeof getCommandInputClasses>;
|
|
15
11
|
|
|
16
12
|
export type CommandDialogProps = DialogProps;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
import { format } from "date-fns";
|
|
5
4
|
import { CalendarIcon } from "@radix-ui/react-icons";
|
|
6
|
-
import {
|
|
5
|
+
import { format } from "date-fns";
|
|
7
6
|
import { cn } from "../../utilities";
|
|
8
7
|
import { Button } from "../Button";
|
|
9
8
|
import { Calendar } from "../Calendar";
|
|
10
9
|
import { Popover } from "../Popover";
|
|
10
|
+
import { type DatePickerProps } from "./types";
|
|
11
11
|
|
|
12
12
|
export const DatePicker = ({
|
|
13
13
|
name,
|
|
@@ -31,11 +31,11 @@ export const DatePicker = ({
|
|
|
31
31
|
|
|
32
32
|
const calendar = (
|
|
33
33
|
<Calendar
|
|
34
|
-
|
|
34
|
+
autoFocus
|
|
35
35
|
mode="single"
|
|
36
36
|
selected={date}
|
|
37
37
|
onSelect={setDate}
|
|
38
|
-
captionLayout="
|
|
38
|
+
captionLayout="label"
|
|
39
39
|
{...props}
|
|
40
40
|
/>
|
|
41
41
|
);
|
|
@@ -50,11 +50,7 @@ export const DatePicker = ({
|
|
|
50
50
|
outline={outline}
|
|
51
51
|
variant={variant}
|
|
52
52
|
disabled={disabled}
|
|
53
|
-
className={cn(
|
|
54
|
-
"justify-start",
|
|
55
|
-
!date && "font-normal",
|
|
56
|
-
triggerClassName
|
|
57
|
-
)}
|
|
53
|
+
className={cn("justify-start", !date && "font-normal", triggerClassName)}
|
|
58
54
|
value={dateValue}
|
|
59
55
|
>
|
|
60
56
|
{dateLabel ?? <span>{label ?? "Pick a date"}</span>}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
import { format } from "date-fns";
|
|
5
4
|
import { type DateRange } from "react-day-picker";
|
|
6
5
|
import { CalendarIcon } from "@radix-ui/react-icons";
|
|
7
|
-
import {
|
|
6
|
+
import { format } from "date-fns";
|
|
8
7
|
import { cn } from "../../utilities";
|
|
9
8
|
import { Button } from "../Button";
|
|
10
9
|
import { Calendar } from "../Calendar";
|
|
11
10
|
import { Popover } from "../Popover";
|
|
11
|
+
import { type DateRangePickerProps } from "./types";
|
|
12
12
|
|
|
13
13
|
export const DateRangePicker = ({
|
|
14
14
|
name,
|
|
@@ -69,11 +69,7 @@ export const DateRangePicker = ({
|
|
|
69
69
|
outline={outline}
|
|
70
70
|
variant={variant}
|
|
71
71
|
disabled={disabled}
|
|
72
|
-
className={cn(
|
|
73
|
-
"justify-start flex-nowrap",
|
|
74
|
-
!range && "font-normal",
|
|
75
|
-
triggerClassName
|
|
76
|
-
)}
|
|
72
|
+
className={cn("justify-start flex-nowrap", !range && "font-normal", triggerClassName)}
|
|
77
73
|
>
|
|
78
74
|
<span className="text-left text-ellipsis overflow-hidden text-nowrap">
|
|
79
75
|
{rangeLabel ?? label ?? "Pick a range"}
|
|
@@ -83,11 +79,11 @@ export const DateRangePicker = ({
|
|
|
83
79
|
</Popover.Trigger>
|
|
84
80
|
<Popover.Content className="w-auto p-0">
|
|
85
81
|
<Calendar
|
|
86
|
-
|
|
82
|
+
autoFocus
|
|
87
83
|
mode="range"
|
|
88
84
|
selected={range}
|
|
89
85
|
onSelect={setRange}
|
|
90
|
-
captionLayout="
|
|
86
|
+
captionLayout="label"
|
|
91
87
|
{...props}
|
|
92
88
|
/>
|
|
93
89
|
</Popover.Content>
|