@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,11 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
5
|
-
import {
|
|
6
|
-
CheckIcon,
|
|
7
|
-
ChevronRightIcon,
|
|
8
|
-
DotFilledIcon,
|
|
9
|
-
} from "@radix-ui/react-icons";
|
|
5
|
+
import { CheckIcon, ChevronRightIcon, DotFilledIcon } from "@radix-ui/react-icons";
|
|
10
6
|
import type {
|
|
11
7
|
ContextMenuCheckboxItemProps,
|
|
12
8
|
ContextMenuContentProps,
|
|
@@ -32,9 +28,7 @@ import {
|
|
|
32
28
|
getMenubarSubTriggerClasses,
|
|
33
29
|
} from "../Menubar/constants";
|
|
34
30
|
|
|
35
|
-
const ContextMenu = (props: ContextMenuProps) =>
|
|
36
|
-
<ContextMenuPrimitive.Root {...props} />
|
|
37
|
-
);
|
|
31
|
+
const ContextMenu = (props: ContextMenuProps) => <ContextMenuPrimitive.Root {...props} />;
|
|
38
32
|
|
|
39
33
|
const ContextMenuSubTrigger = forwardRef<
|
|
40
34
|
React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
|
|
@@ -106,8 +100,7 @@ const ContextMenuCheckboxItem = forwardRef<
|
|
|
106
100
|
{children}
|
|
107
101
|
</ContextMenuPrimitive.CheckboxItem>
|
|
108
102
|
));
|
|
109
|
-
ContextMenuCheckboxItem.displayName =
|
|
110
|
-
ContextMenuPrimitive.CheckboxItem.displayName;
|
|
103
|
+
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
111
104
|
|
|
112
105
|
const ContextMenuRadioItem = forwardRef<
|
|
113
106
|
React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
|
|
@@ -152,13 +145,8 @@ const ContextMenuSeparator = forwardRef<
|
|
|
152
145
|
));
|
|
153
146
|
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
154
147
|
|
|
155
|
-
const ContextMenuShortcut = ({
|
|
156
|
-
className,
|
|
157
|
-
...props
|
|
158
|
-
}: ContextMenuShortcutProps) => {
|
|
159
|
-
return (
|
|
160
|
-
<span className={cn(getMenubarShortcutClasses(), className)} {...props} />
|
|
161
|
-
);
|
|
148
|
+
const ContextMenuShortcut = ({ className, ...props }: ContextMenuShortcutProps) => {
|
|
149
|
+
return <span className={cn(getMenubarShortcutClasses(), className)} {...props} />;
|
|
162
150
|
};
|
|
163
151
|
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
164
152
|
|
|
@@ -12,9 +12,7 @@ import {
|
|
|
12
12
|
getMenubarSubTriggerClasses,
|
|
13
13
|
} from "../Menubar/constants";
|
|
14
14
|
|
|
15
|
-
export type ContextMenuProps = React.ComponentPropsWithoutRef<
|
|
16
|
-
typeof ContextMenuPrimitive.Root
|
|
17
|
-
>;
|
|
15
|
+
export type ContextMenuProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Root>;
|
|
18
16
|
|
|
19
17
|
export type ContextMenuSubTriggerProps = React.ComponentPropsWithoutRef<
|
|
20
18
|
typeof ContextMenuPrimitive.SubTrigger
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
5
|
-
import {
|
|
6
|
-
CheckIcon,
|
|
7
|
-
ChevronRightIcon,
|
|
8
|
-
DotFilledIcon,
|
|
9
|
-
} from "@radix-ui/react-icons";
|
|
5
|
+
import { CheckIcon, ChevronRightIcon, DotFilledIcon } from "@radix-ui/react-icons";
|
|
10
6
|
import type {
|
|
11
7
|
DropdownMenuCheckboxItemProps,
|
|
12
8
|
DropdownMenuContentProps,
|
|
@@ -32,9 +28,7 @@ import {
|
|
|
32
28
|
getMenubarSubTriggerClasses,
|
|
33
29
|
} from "../Menubar/constants";
|
|
34
30
|
|
|
35
|
-
const DropdownMenu = (props: DropdownMenuProps) =>
|
|
36
|
-
<DropdownMenuPrimitive.Root {...props} />
|
|
37
|
-
);
|
|
31
|
+
const DropdownMenu = (props: DropdownMenuProps) => <DropdownMenuPrimitive.Root {...props} />;
|
|
38
32
|
|
|
39
33
|
const DropdownMenuSubTrigger = forwardRef<
|
|
40
34
|
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
@@ -49,8 +43,7 @@ const DropdownMenuSubTrigger = forwardRef<
|
|
|
49
43
|
<ChevronRightIcon className="ml-auto h-4 w-4" />
|
|
50
44
|
</DropdownMenuPrimitive.SubTrigger>
|
|
51
45
|
));
|
|
52
|
-
DropdownMenuSubTrigger.displayName =
|
|
53
|
-
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
46
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
54
47
|
|
|
55
48
|
const DropdownMenuSubContent = forwardRef<
|
|
56
49
|
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
@@ -62,8 +55,7 @@ const DropdownMenuSubContent = forwardRef<
|
|
|
62
55
|
{...props}
|
|
63
56
|
/>
|
|
64
57
|
));
|
|
65
|
-
DropdownMenuSubContent.displayName =
|
|
66
|
-
DropdownMenuPrimitive.SubContent.displayName;
|
|
58
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
67
59
|
|
|
68
60
|
const DropdownMenuContent = forwardRef<
|
|
69
61
|
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
@@ -109,8 +101,7 @@ const DropdownMenuCheckboxItem = forwardRef<
|
|
|
109
101
|
{children}
|
|
110
102
|
</DropdownMenuPrimitive.CheckboxItem>
|
|
111
103
|
));
|
|
112
|
-
DropdownMenuCheckboxItem.displayName =
|
|
113
|
-
DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
104
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
114
105
|
|
|
115
106
|
const DropdownMenuRadioItem = forwardRef<
|
|
116
107
|
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
|
|
@@ -155,13 +146,8 @@ const DropdownMenuSeparator = forwardRef<
|
|
|
155
146
|
));
|
|
156
147
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
157
148
|
|
|
158
|
-
const DropdownMenuShortcut = ({
|
|
159
|
-
className,
|
|
160
|
-
...props
|
|
161
|
-
}: DropdownMenuShortcutProps) => {
|
|
162
|
-
return (
|
|
163
|
-
<span className={cn(getMenubarShortcutClasses(), className)} {...props} />
|
|
164
|
-
);
|
|
149
|
+
const DropdownMenuShortcut = ({ className, ...props }: DropdownMenuShortcutProps) => {
|
|
150
|
+
return <span className={cn(getMenubarShortcutClasses(), className)} {...props} />;
|
|
165
151
|
};
|
|
166
152
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
167
153
|
|
|
@@ -12,9 +12,7 @@ import {
|
|
|
12
12
|
getMenubarSubTriggerClasses,
|
|
13
13
|
} from "../Menubar/constants";
|
|
14
14
|
|
|
15
|
-
export type DropdownMenuProps = React.ComponentPropsWithoutRef<
|
|
16
|
-
typeof DropdownMenuPrimitive.Root
|
|
17
|
-
>;
|
|
15
|
+
export type DropdownMenuProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root>;
|
|
18
16
|
|
|
19
17
|
export type DropdownMenuSubTriggerProps = React.ComponentPropsWithoutRef<
|
|
20
18
|
typeof DropdownMenuPrimitive.SubTrigger
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import {
|
|
5
|
-
CheckIcon,
|
|
6
|
-
ChevronRightIcon,
|
|
7
|
-
DotFilledIcon,
|
|
8
|
-
} from "@radix-ui/react-icons";
|
|
4
|
+
import { CheckIcon, ChevronRightIcon, DotFilledIcon } from "@radix-ui/react-icons";
|
|
9
5
|
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
10
6
|
import type {
|
|
11
7
|
MenubarCheckboxItemProps,
|
|
@@ -36,10 +32,7 @@ import {
|
|
|
36
32
|
} from "./constants";
|
|
37
33
|
|
|
38
34
|
const Menubar = ({ className, ...props }: MenubarProps) => (
|
|
39
|
-
<MenubarPrimitive.Root
|
|
40
|
-
className={cn(getMenubarClasses(), className)}
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
35
|
+
<MenubarPrimitive.Root className={cn(getMenubarClasses(), className)} {...props} />
|
|
43
36
|
);
|
|
44
37
|
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
45
38
|
|
|
@@ -85,35 +78,29 @@ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
|
85
78
|
const MenubarContent = forwardRef<
|
|
86
79
|
React.ElementRef<typeof MenubarPrimitive.Content>,
|
|
87
80
|
MenubarContentProps
|
|
88
|
-
>(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
</MenubarPrimitive.Portal>
|
|
103
|
-
)
|
|
104
|
-
);
|
|
81
|
+
>(({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => (
|
|
82
|
+
<MenubarPrimitive.Portal>
|
|
83
|
+
<MenubarPrimitive.Content
|
|
84
|
+
ref={ref}
|
|
85
|
+
align={align}
|
|
86
|
+
alignOffset={alignOffset}
|
|
87
|
+
sideOffset={sideOffset}
|
|
88
|
+
className={cn(getMenubarContentClasses(), className)}
|
|
89
|
+
{...props}
|
|
90
|
+
/>
|
|
91
|
+
</MenubarPrimitive.Portal>
|
|
92
|
+
));
|
|
105
93
|
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
106
94
|
|
|
107
|
-
const MenubarItem = forwardRef<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
));
|
|
95
|
+
const MenubarItem = forwardRef<React.ElementRef<typeof MenubarPrimitive.Item>, MenubarItemProps>(
|
|
96
|
+
({ className, inset, variant, ...props }, ref) => (
|
|
97
|
+
<MenubarPrimitive.Item
|
|
98
|
+
ref={ref}
|
|
99
|
+
className={cn(getMenubarItemClasses({ inset, variant }), className)}
|
|
100
|
+
{...props}
|
|
101
|
+
/>
|
|
102
|
+
)
|
|
103
|
+
);
|
|
117
104
|
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
118
105
|
|
|
119
106
|
const MenubarCheckboxItem = forwardRef<
|
|
@@ -154,16 +141,15 @@ const MenubarRadioItem = forwardRef<
|
|
|
154
141
|
));
|
|
155
142
|
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
156
143
|
|
|
157
|
-
const MenubarLabel = forwardRef<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
));
|
|
144
|
+
const MenubarLabel = forwardRef<React.ElementRef<typeof MenubarPrimitive.Label>, MenubarLabelProps>(
|
|
145
|
+
({ className, inset, ...props }, ref) => (
|
|
146
|
+
<MenubarPrimitive.Label
|
|
147
|
+
ref={ref}
|
|
148
|
+
className={cn(getMenubarLabelClasses({ inset }), className)}
|
|
149
|
+
{...props}
|
|
150
|
+
/>
|
|
151
|
+
)
|
|
152
|
+
);
|
|
167
153
|
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
168
154
|
|
|
169
155
|
const MenubarSeparator = forwardRef<
|
|
@@ -179,9 +165,7 @@ const MenubarSeparator = forwardRef<
|
|
|
179
165
|
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
180
166
|
|
|
181
167
|
const MenubarShortcut = ({ className, ...props }: MenubarShortcutProps) => {
|
|
182
|
-
return (
|
|
183
|
-
<span className={cn(getMenubarShortcutClasses(), className)} {...props} />
|
|
184
|
-
);
|
|
168
|
+
return <span className={cn(getMenubarShortcutClasses(), className)} {...props} />;
|
|
185
169
|
};
|
|
186
170
|
MenubarShortcut.displayname = "MenubarShortcut";
|
|
187
171
|
|
|
@@ -13,13 +13,9 @@ import {
|
|
|
13
13
|
getMenubarTriggerClasses,
|
|
14
14
|
} from "./constants";
|
|
15
15
|
|
|
16
|
-
export type MenubarProps = React.ComponentPropsWithoutRef<
|
|
17
|
-
typeof MenubarPrimitive.Root
|
|
18
|
-
>;
|
|
16
|
+
export type MenubarProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>;
|
|
19
17
|
|
|
20
|
-
export type MenubarTriggerProps = React.ComponentPropsWithoutRef<
|
|
21
|
-
typeof MenubarPrimitive.Trigger
|
|
22
|
-
> &
|
|
18
|
+
export type MenubarTriggerProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger> &
|
|
23
19
|
VariantProps<typeof getMenubarTriggerClasses>;
|
|
24
20
|
|
|
25
21
|
export type MenubarSubTriggerProps = React.ComponentPropsWithoutRef<
|
|
@@ -27,9 +23,7 @@ export type MenubarSubTriggerProps = React.ComponentPropsWithoutRef<
|
|
|
27
23
|
> &
|
|
28
24
|
VariantProps<typeof getMenubarSubTriggerClasses>;
|
|
29
25
|
|
|
30
|
-
export type MenubarContentProps = React.ComponentPropsWithoutRef<
|
|
31
|
-
typeof MenubarPrimitive.Content
|
|
32
|
-
> &
|
|
26
|
+
export type MenubarContentProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content> &
|
|
33
27
|
VariantProps<typeof getMenubarContentClasses>;
|
|
34
28
|
|
|
35
29
|
export type MenubarSubContentProps = React.ComponentPropsWithoutRef<
|
|
@@ -37,9 +31,7 @@ export type MenubarSubContentProps = React.ComponentPropsWithoutRef<
|
|
|
37
31
|
> &
|
|
38
32
|
VariantProps<typeof getMenubarSubContentClasses>;
|
|
39
33
|
|
|
40
|
-
export type MenubarItemProps = React.ComponentPropsWithoutRef<
|
|
41
|
-
typeof MenubarPrimitive.Item
|
|
42
|
-
> &
|
|
34
|
+
export type MenubarItemProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> &
|
|
43
35
|
VariantProps<typeof getMenubarItemClasses>;
|
|
44
36
|
|
|
45
37
|
export type MenubarCheckboxItemProps = React.ComponentPropsWithoutRef<
|
|
@@ -52,9 +44,7 @@ export type MenubarRadioItemProps = React.ComponentPropsWithoutRef<
|
|
|
52
44
|
> &
|
|
53
45
|
VariantProps<typeof getMenubarRadioItemClasses>;
|
|
54
46
|
|
|
55
|
-
export type MenubarLabelProps = React.ComponentPropsWithoutRef<
|
|
56
|
-
typeof MenubarPrimitive.Label
|
|
57
|
-
> &
|
|
47
|
+
export type MenubarLabelProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> &
|
|
58
48
|
VariantProps<typeof getMenubarLabelClasses>;
|
|
59
49
|
|
|
60
50
|
export type MenubarSeparatorProps = React.ComponentPropsWithoutRef<
|
|
@@ -19,15 +19,8 @@ import {
|
|
|
19
19
|
getNavigationMenuViewportClasses,
|
|
20
20
|
} from "./constants";
|
|
21
21
|
|
|
22
|
-
const NavigationMenu = ({
|
|
23
|
-
className,
|
|
24
|
-
children,
|
|
25
|
-
...props
|
|
26
|
-
}: NavigationMenuProps) => (
|
|
27
|
-
<NavigationMenuPrimitive.Root
|
|
28
|
-
className={cn(getNavigationMenuClasses(), className)}
|
|
29
|
-
{...props}
|
|
30
|
-
>
|
|
22
|
+
const NavigationMenu = ({ className, children, ...props }: NavigationMenuProps) => (
|
|
23
|
+
<NavigationMenuPrimitive.Root className={cn(getNavigationMenuClasses(), className)} {...props}>
|
|
31
24
|
{children}
|
|
32
25
|
<NavigationMenuViewport />
|
|
33
26
|
</NavigationMenuPrimitive.Root>
|
|
@@ -88,8 +81,7 @@ const NavigationMenuViewport = forwardRef<
|
|
|
88
81
|
/>
|
|
89
82
|
</div>
|
|
90
83
|
));
|
|
91
|
-
NavigationMenuViewport.displayName =
|
|
92
|
-
NavigationMenuPrimitive.Viewport.displayName;
|
|
84
|
+
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
93
85
|
|
|
94
86
|
const NavigationMenuIndicator = forwardRef<
|
|
95
87
|
React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
|
|
@@ -103,8 +95,7 @@ const NavigationMenuIndicator = forwardRef<
|
|
|
103
95
|
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
104
96
|
</NavigationMenuPrimitive.Indicator>
|
|
105
97
|
));
|
|
106
|
-
NavigationMenuIndicator.displayName =
|
|
107
|
-
NavigationMenuPrimitive.Indicator.displayName;
|
|
98
|
+
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
108
99
|
|
|
109
100
|
NavigationMenu.List = NavigationMenuList;
|
|
110
101
|
NavigationMenu.Item = NavigationMenuPrimitive.Item;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { forwardRef } from "react";
|
|
2
|
+
import { ChevronLeftIcon, ChevronRightIcon, DotsHorizontalIcon } from "@radix-ui/react-icons";
|
|
3
|
+
import type { PaginationProps } from "./types";
|
|
4
|
+
import { cn } from "../../utilities";
|
|
5
|
+
import { getButtonClasses } from "../Button/constants";
|
|
2
6
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
getPaginationClasses,
|
|
8
|
+
getPaginationContentClasses,
|
|
9
|
+
getPaginationEllipsisClasses,
|
|
10
|
+
getPaginationNextClasses,
|
|
11
|
+
getPaginationPreviousClasses,
|
|
12
|
+
} from "./constants";
|
|
7
13
|
import {
|
|
8
14
|
PaginationContentProps,
|
|
9
15
|
PaginationEllipsisProps,
|
|
@@ -11,18 +17,7 @@ import {
|
|
|
11
17
|
PaginationLinkProps,
|
|
12
18
|
PaginationNextProps,
|
|
13
19
|
PaginationPreviousProps,
|
|
14
|
-
type PaginationProps,
|
|
15
20
|
} from "./types";
|
|
16
|
-
import { cn } from "../../utilities";
|
|
17
|
-
import {
|
|
18
|
-
getPaginationClasses,
|
|
19
|
-
getPaginationContentClasses,
|
|
20
|
-
getPaginationEllipsisClasses,
|
|
21
|
-
getPaginationNextClasses,
|
|
22
|
-
getPaginationPreviousClasses,
|
|
23
|
-
} from "./constants";
|
|
24
|
-
|
|
25
|
-
import { getButtonClasses } from "../Button/constants";
|
|
26
21
|
|
|
27
22
|
const Pagination = ({ className, ...props }: PaginationProps) => (
|
|
28
23
|
<nav
|
|
@@ -36,18 +31,14 @@ Pagination.displayName = "Pagination";
|
|
|
36
31
|
|
|
37
32
|
const PaginationContent = forwardRef<HTMLUListElement, PaginationContentProps>(
|
|
38
33
|
({ className, ...props }, ref) => (
|
|
39
|
-
<ul
|
|
40
|
-
ref={ref}
|
|
41
|
-
className={cn(getPaginationContentClasses(), className)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
34
|
+
<ul ref={ref} className={cn(getPaginationContentClasses(), className)} {...props} />
|
|
44
35
|
)
|
|
45
36
|
);
|
|
46
37
|
PaginationContent.displayName = "PaginationContent";
|
|
47
38
|
|
|
48
|
-
const PaginationItem = forwardRef<HTMLLIElement, PaginationItemProps>(
|
|
49
|
-
|
|
50
|
-
);
|
|
39
|
+
const PaginationItem = forwardRef<HTMLLIElement, PaginationItemProps>((props, ref) => (
|
|
40
|
+
<li ref={ref} {...props} />
|
|
41
|
+
));
|
|
51
42
|
PaginationItem.displayName = "PaginationItem";
|
|
52
43
|
|
|
53
44
|
const PaginationLink = ({
|
|
@@ -75,11 +66,7 @@ const PaginationLink = ({
|
|
|
75
66
|
);
|
|
76
67
|
PaginationLink.displayName = "PaginationLink";
|
|
77
68
|
|
|
78
|
-
const PaginationPrevious = ({
|
|
79
|
-
className,
|
|
80
|
-
children,
|
|
81
|
-
...props
|
|
82
|
-
}: PaginationPreviousProps) => (
|
|
69
|
+
const PaginationPrevious = ({ className, children, ...props }: PaginationPreviousProps) => (
|
|
83
70
|
<PaginationLink
|
|
84
71
|
aria-label="Go to previous page"
|
|
85
72
|
className={cn(getPaginationPreviousClasses(), className)}
|
|
@@ -91,11 +78,7 @@ const PaginationPrevious = ({
|
|
|
91
78
|
);
|
|
92
79
|
PaginationPrevious.displayName = "PaginationPrevious";
|
|
93
80
|
|
|
94
|
-
const PaginationNext = ({
|
|
95
|
-
className,
|
|
96
|
-
children,
|
|
97
|
-
...props
|
|
98
|
-
}: PaginationNextProps) => (
|
|
81
|
+
const PaginationNext = ({ className, children, ...props }: PaginationNextProps) => (
|
|
99
82
|
<PaginationLink
|
|
100
83
|
aria-label="Go to next page"
|
|
101
84
|
className={cn(getPaginationNextClasses(), className)}
|
|
@@ -107,15 +90,8 @@ const PaginationNext = ({
|
|
|
107
90
|
);
|
|
108
91
|
PaginationNext.displayName = "PaginationNext";
|
|
109
92
|
|
|
110
|
-
const PaginationEllipsis = ({
|
|
111
|
-
className,
|
|
112
|
-
...props
|
|
113
|
-
}: PaginationEllipsisProps) => (
|
|
114
|
-
<span
|
|
115
|
-
aria-hidden
|
|
116
|
-
className={cn(getPaginationEllipsisClasses(), className)}
|
|
117
|
-
{...props}
|
|
118
|
-
>
|
|
93
|
+
const PaginationEllipsis = ({ className, ...props }: PaginationEllipsisProps) => (
|
|
94
|
+
<span aria-hidden className={cn(getPaginationEllipsisClasses(), className)} {...props}>
|
|
119
95
|
<DotsHorizontalIcon className="h-4 w-4" />
|
|
120
96
|
<span className="sr-only">More pages</span>
|
|
121
97
|
</span>
|
|
@@ -2,13 +2,9 @@ import { cva } from "../../libs";
|
|
|
2
2
|
|
|
3
3
|
export const getPaginationClasses = cva("flex justify-center");
|
|
4
4
|
|
|
5
|
-
export const getPaginationContentClasses = cva(
|
|
6
|
-
"flex flex-row items-center gap-1"
|
|
7
|
-
);
|
|
5
|
+
export const getPaginationContentClasses = cva("flex flex-row items-center gap-1");
|
|
8
6
|
|
|
9
|
-
export const getPaginationEllipsisClasses = cva(
|
|
10
|
-
"flex h-9 w-9 items-center justify-center"
|
|
11
|
-
);
|
|
7
|
+
export const getPaginationEllipsisClasses = cva("flex h-9 w-9 items-center justify-center");
|
|
12
8
|
|
|
13
9
|
export const getPaginationNextClasses = cva("gap-1 px-3");
|
|
14
10
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
5
|
-
import { getPopoverContentClasses } from "./constants";
|
|
6
5
|
import { cn } from "../../utilities";
|
|
6
|
+
import { getPopoverContentClasses } from "./constants";
|
|
7
7
|
import { PopoverContentProps, PopoverProps } from "./types";
|
|
8
8
|
|
|
9
9
|
const Popover = (props: PopoverProps) => <PopoverPrimitive.Root {...props} />;
|
|
@@ -2,11 +2,7 @@ import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
|
2
2
|
import { type VariantProps } from "../../libs";
|
|
3
3
|
import { getPopoverContentClasses } from "./constants";
|
|
4
4
|
|
|
5
|
-
export type PopoverProps = React.ComponentPropsWithoutRef<
|
|
6
|
-
typeof PopoverPrimitive.Root
|
|
7
|
-
>;
|
|
5
|
+
export type PopoverProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>;
|
|
8
6
|
|
|
9
|
-
export type PopoverContentProps = React.ComponentPropsWithoutRef<
|
|
10
|
-
typeof PopoverPrimitive.Content
|
|
11
|
-
> &
|
|
7
|
+
export type PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> &
|
|
12
8
|
VariantProps<typeof getPopoverContentClasses>;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
5
|
-
import { type ProgressProps } from "./types";
|
|
6
5
|
import { cn } from "../../utilities";
|
|
7
6
|
import { getProgressClasses, getProgressIndicatorClasses } from "./constants";
|
|
7
|
+
import { type ProgressProps } from "./types";
|
|
8
8
|
|
|
9
9
|
export const Progress = React.forwardRef<
|
|
10
10
|
React.ElementRef<typeof ProgressPrimitive.Root>,
|
|
@@ -20,9 +20,7 @@ export const Progress = React.forwardRef<
|
|
|
20
20
|
<ProgressPrimitive.Indicator
|
|
21
21
|
className={cn(getProgressIndicatorClasses({ variant }))}
|
|
22
22
|
style={{
|
|
23
|
-
transform: `translateX(-${
|
|
24
|
-
(100 * (max - Math.max(Math.min(value ?? 0, max), 0))) / max
|
|
25
|
-
}%)`,
|
|
23
|
+
transform: `translateX(-${(100 * (max - Math.max(Math.min(value ?? 0, max), 0))) / max}%)`,
|
|
26
24
|
}}
|
|
27
25
|
/>
|
|
28
26
|
</ProgressPrimitive.Root>
|
|
@@ -1,49 +1,43 @@
|
|
|
1
1
|
import { cva } from "../../libs";
|
|
2
2
|
|
|
3
|
-
export const getProgressClasses = cva(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
success: "bg-success/20",
|
|
18
|
-
warning: "bg-warning/20",
|
|
19
|
-
},
|
|
3
|
+
export const getProgressClasses = cva("relative h-2 w-full overflow-hidden rounded-full", {
|
|
4
|
+
variants: {
|
|
5
|
+
variant: {
|
|
6
|
+
accent: "bg-accent/20",
|
|
7
|
+
base: "bg-base-content/20",
|
|
8
|
+
error: "bg-error/20",
|
|
9
|
+
ghost: "bg-ghost/20",
|
|
10
|
+
info: "bg-info/20",
|
|
11
|
+
link: "bg-link/20",
|
|
12
|
+
neutral: "bg-neutral/20",
|
|
13
|
+
primary: "bg-primary/20",
|
|
14
|
+
secondary: "bg-secondary/20",
|
|
15
|
+
success: "bg-success/20",
|
|
16
|
+
warning: "bg-warning/20",
|
|
20
17
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
);
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "base",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
26
23
|
|
|
27
|
-
export const getProgressIndicatorClasses = cva(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
success: "bg-success",
|
|
42
|
-
warning: "bg-warning",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
defaultVariants: {
|
|
46
|
-
variant: "base",
|
|
24
|
+
export const getProgressIndicatorClasses = cva("h-full w-full flex-1 transition-all", {
|
|
25
|
+
variants: {
|
|
26
|
+
variant: {
|
|
27
|
+
accent: "bg-accent",
|
|
28
|
+
base: "bg-base-content",
|
|
29
|
+
error: "bg-error",
|
|
30
|
+
ghost: "bg-ghost",
|
|
31
|
+
info: "bg-info",
|
|
32
|
+
link: "bg-link",
|
|
33
|
+
neutral: "bg-neutral",
|
|
34
|
+
primary: "bg-primary",
|
|
35
|
+
secondary: "bg-secondary",
|
|
36
|
+
success: "bg-success",
|
|
37
|
+
warning: "bg-warning",
|
|
47
38
|
},
|
|
48
|
-
}
|
|
49
|
-
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "base",
|
|
42
|
+
},
|
|
43
|
+
});
|
|
@@ -11,19 +11,9 @@ import {
|
|
|
11
11
|
getScrollAreaViewportClasses,
|
|
12
12
|
} from "./constants";
|
|
13
13
|
|
|
14
|
-
const ScrollArea = ({
|
|
15
|
-
className,
|
|
16
|
-
|
|
17
|
-
scrollbar,
|
|
18
|
-
...props
|
|
19
|
-
}: ScrollAreaProps) => (
|
|
20
|
-
<ScrollAreaPrimitive.Root
|
|
21
|
-
className={cn(getScrollAreaClasses(), className)}
|
|
22
|
-
{...props}
|
|
23
|
-
>
|
|
24
|
-
<ScrollAreaPrimitive.Viewport
|
|
25
|
-
className={cn(getScrollAreaViewportClasses())}
|
|
26
|
-
>
|
|
14
|
+
const ScrollArea = ({ className, children, scrollbar, ...props }: ScrollAreaProps) => (
|
|
15
|
+
<ScrollAreaPrimitive.Root className={cn(getScrollAreaClasses(), className)} {...props}>
|
|
16
|
+
<ScrollAreaPrimitive.Viewport className={cn(getScrollAreaViewportClasses())}>
|
|
27
17
|
{children}
|
|
28
18
|
</ScrollAreaPrimitive.Viewport>
|
|
29
19
|
<Scrollbar {...scrollbar} />
|
|
@@ -42,9 +32,7 @@ const Scrollbar = forwardRef<
|
|
|
42
32
|
className={cn(getScrollAreaScrollbarClasses({ orientation }), className)}
|
|
43
33
|
{...props}
|
|
44
34
|
>
|
|
45
|
-
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
46
|
-
className={cn(getScrollAreaThumbClasses({ variant }))}
|
|
47
|
-
/>
|
|
35
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className={cn(getScrollAreaThumbClasses({ variant }))} />
|
|
48
36
|
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
49
37
|
));
|
|
50
38
|
Scrollbar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|