@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,17 +2,14 @@ import { cva } from "../../libs";
|
|
|
2
2
|
|
|
3
3
|
export const getScrollAreaClasses = cva("relative overflow-hidden");
|
|
4
4
|
|
|
5
|
-
export const getScrollAreaScrollbarClasses = cva(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
horizontal: "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
11
|
-
vertical: "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
12
|
-
},
|
|
5
|
+
export const getScrollAreaScrollbarClasses = cva("flex touch-none select-none transition-colors", {
|
|
6
|
+
variants: {
|
|
7
|
+
orientation: {
|
|
8
|
+
horizontal: "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
9
|
+
vertical: "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
13
10
|
},
|
|
14
|
-
}
|
|
15
|
-
);
|
|
11
|
+
},
|
|
12
|
+
});
|
|
16
13
|
|
|
17
14
|
export const getScrollAreaThumbClasses = cva("relative flex-1 rounded-full", {
|
|
18
15
|
variants: {
|
|
@@ -31,6 +28,4 @@ export const getScrollAreaThumbClasses = cva("relative flex-1 rounded-full", {
|
|
|
31
28
|
},
|
|
32
29
|
});
|
|
33
30
|
|
|
34
|
-
export const getScrollAreaViewportClasses = cva(
|
|
35
|
-
"h-full w-full rounded-[inherit]"
|
|
36
|
-
);
|
|
31
|
+
export const getScrollAreaViewportClasses = cva("h-full w-full rounded-[inherit]");
|
|
@@ -2,9 +2,7 @@ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
|
2
2
|
import { VariantProps } from "../../libs";
|
|
3
3
|
import { getScrollAreaThumbClasses } from "./constants";
|
|
4
4
|
|
|
5
|
-
export type ScrollAreaProps = React.ComponentPropsWithoutRef<
|
|
6
|
-
typeof ScrollAreaPrimitive.Root
|
|
7
|
-
> & {
|
|
5
|
+
export type ScrollAreaProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & {
|
|
8
6
|
scrollbar?: ScrollbarProps;
|
|
9
7
|
};
|
|
10
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
-
import { type SeparatorProps } from "./types";
|
|
5
|
-
import { getSeparatorClasses } from "./constants";
|
|
6
4
|
import { cn } from "../../utilities";
|
|
5
|
+
import { getSeparatorClasses } from "./constants";
|
|
6
|
+
import { type SeparatorProps } from "./types";
|
|
7
7
|
|
|
8
8
|
export const Separator = ({
|
|
9
9
|
className,
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import { type SkeletonProps } from "./types";
|
|
2
|
-
import { getSkeletonClasses } from "./constants";
|
|
3
1
|
import { cn } from "../../utilities";
|
|
2
|
+
import { getSkeletonClasses } from "./constants";
|
|
3
|
+
import { type SkeletonProps } from "./types";
|
|
4
4
|
|
|
5
|
-
export const Skeleton = ({
|
|
6
|
-
round,
|
|
7
|
-
width,
|
|
8
|
-
height,
|
|
9
|
-
variant,
|
|
10
|
-
className,
|
|
11
|
-
...props
|
|
12
|
-
}: SkeletonProps) => {
|
|
5
|
+
export const Skeleton = ({ round, width, height, variant, className, ...props }: SkeletonProps) => {
|
|
13
6
|
return (
|
|
14
7
|
<div
|
|
15
|
-
className={cn(
|
|
16
|
-
getSkeletonClasses({ width, height, round, variant }),
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
8
|
+
className={cn(getSkeletonClasses({ width, height, round, variant }), className)}
|
|
19
9
|
{...props}
|
|
20
10
|
/>
|
|
21
11
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { Toaster as Sonner } from "sonner";
|
|
4
|
-
import { type ToasterProps } from "./types";
|
|
5
4
|
import { cn } from "../../utilities";
|
|
6
5
|
import { getToastButtonClasses, getToastClasses } from "./constants";
|
|
6
|
+
import { type ToasterProps } from "./types";
|
|
7
7
|
|
|
8
8
|
export const Toaster = ({
|
|
9
9
|
theme,
|
|
@@ -30,9 +30,7 @@ export const Toaster = ({
|
|
|
30
30
|
...cancelButton,
|
|
31
31
|
})
|
|
32
32
|
),
|
|
33
|
-
closeButton: cn(
|
|
34
|
-
getToastButtonClasses({ variant: "neutral", ...closeButton })
|
|
35
|
-
),
|
|
33
|
+
closeButton: cn(getToastButtonClasses({ variant: "neutral", ...closeButton })),
|
|
36
34
|
},
|
|
37
35
|
}}
|
|
38
36
|
{...props}
|
|
@@ -42,16 +42,11 @@ export const getToastButtonClasses = cva("", {
|
|
|
42
42
|
accent: "group-[.sonner]:!bg-accent group-[.sonner]:!text-accent-content",
|
|
43
43
|
error: "group-[.sonner]:!bg-error group-[.sonner]:!text-error-content",
|
|
44
44
|
info: "group-[.sonner]:!bg-info group-[.sonner]:!text-info-content",
|
|
45
|
-
neutral:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"group-[.sonner]:!bg-secondary group-[.sonner]:!text-secondary-content",
|
|
51
|
-
success:
|
|
52
|
-
"group-[.sonner]:!bg-success group-[.sonner]:!text-success-content",
|
|
53
|
-
warning:
|
|
54
|
-
"group-[.sonner]:!bg-warning group-[.sonner]:!text-warning-content",
|
|
45
|
+
neutral: "group-[.sonner]:!bg-neutral group-[.sonner]:!text-neutral-content",
|
|
46
|
+
primary: "group-[.sonner]:!bg-primary group-[.sonner]:!text-primary-content",
|
|
47
|
+
secondary: "group-[.sonner]:!bg-secondary group-[.sonner]:!text-secondary-content",
|
|
48
|
+
success: "group-[.sonner]:!bg-success group-[.sonner]:!text-success-content",
|
|
49
|
+
warning: "group-[.sonner]:!bg-warning group-[.sonner]:!text-warning-content",
|
|
55
50
|
},
|
|
56
51
|
outline: {
|
|
57
52
|
true: "group-[.sonner]:!border group-[.sonner]:!border-solid group-[.sonner]:!bg-transparent",
|
|
@@ -76,32 +71,27 @@ export const getToastButtonClasses = cva("", {
|
|
|
76
71
|
{
|
|
77
72
|
outline: true,
|
|
78
73
|
variant: "neutral",
|
|
79
|
-
className:
|
|
80
|
-
"group-[.sonner]:!border-neutral group-[.sonner]:!text-neutral",
|
|
74
|
+
className: "group-[.sonner]:!border-neutral group-[.sonner]:!text-neutral",
|
|
81
75
|
},
|
|
82
76
|
{
|
|
83
77
|
outline: true,
|
|
84
78
|
variant: "primary",
|
|
85
|
-
className:
|
|
86
|
-
"group-[.sonner]:!border-primary group-[.sonner]:!text-primary",
|
|
79
|
+
className: "group-[.sonner]:!border-primary group-[.sonner]:!text-primary",
|
|
87
80
|
},
|
|
88
81
|
{
|
|
89
82
|
outline: true,
|
|
90
83
|
variant: "secondary",
|
|
91
|
-
className:
|
|
92
|
-
"group-[.sonner]:!border-secondary group-[.sonner]:!text-secondary",
|
|
84
|
+
className: "group-[.sonner]:!border-secondary group-[.sonner]:!text-secondary",
|
|
93
85
|
},
|
|
94
86
|
{
|
|
95
87
|
outline: true,
|
|
96
88
|
variant: "success",
|
|
97
|
-
className:
|
|
98
|
-
"group-[.sonner]:!border-success group-[.sonner]:!text-success",
|
|
89
|
+
className: "group-[.sonner]:!border-success group-[.sonner]:!text-success",
|
|
99
90
|
},
|
|
100
91
|
{
|
|
101
92
|
outline: true,
|
|
102
93
|
variant: "warning",
|
|
103
|
-
className:
|
|
104
|
-
"group-[.sonner]:!border-warning group-[.sonner]:!text-warning",
|
|
94
|
+
className: "group-[.sonner]:!border-warning group-[.sonner]:!text-warning",
|
|
105
95
|
},
|
|
106
96
|
],
|
|
107
97
|
});
|
|
@@ -4,14 +4,8 @@ import { getToastButtonClasses, getToastClasses } from "./constants";
|
|
|
4
4
|
|
|
5
5
|
type ToastButtonVariantProps = VariantProps<typeof getToastButtonClasses>;
|
|
6
6
|
|
|
7
|
-
export type ToasterProps = Omit<
|
|
8
|
-
React.ComponentProps<typeof Toaster>,
|
|
9
|
-
"closeButton"
|
|
10
|
-
> &
|
|
7
|
+
export type ToasterProps = Omit<React.ComponentProps<typeof Toaster>, "closeButton"> &
|
|
11
8
|
VariantProps<typeof getToastClasses> &
|
|
12
|
-
Partial<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
ToastButtonVariantProps
|
|
16
|
-
>
|
|
17
|
-
> & { showCloseButton?: boolean };
|
|
9
|
+
Partial<Record<"actionButton" | "cancelButton" | "closeButton", ToastButtonVariantProps>> & {
|
|
10
|
+
showCloseButton?: boolean;
|
|
11
|
+
};
|
|
@@ -1,32 +1,21 @@
|
|
|
1
1
|
import { forwardRef } from "react";
|
|
2
|
-
import { cn } from "../../utilities";
|
|
3
2
|
import type {
|
|
4
3
|
TableBodyProps,
|
|
5
4
|
TableCaptionProps,
|
|
6
5
|
TableCellProps,
|
|
7
6
|
TableFooterProps,
|
|
8
|
-
TableHeadProps,
|
|
9
7
|
TableHeaderProps,
|
|
8
|
+
TableHeadProps,
|
|
10
9
|
TableProps,
|
|
11
10
|
TableRowProps,
|
|
12
11
|
} from "./types";
|
|
12
|
+
import { cn } from "../../utilities";
|
|
13
13
|
import { getTableClasses, getTableHeaderClasses } from "./constants";
|
|
14
14
|
|
|
15
|
-
const Table = ({
|
|
16
|
-
className,
|
|
17
|
-
caption,
|
|
18
|
-
zebra,
|
|
19
|
-
size,
|
|
20
|
-
pinRow,
|
|
21
|
-
pinColumn,
|
|
22
|
-
...props
|
|
23
|
-
}: TableProps) => (
|
|
15
|
+
const Table = ({ className, caption, zebra, size, pinRow, pinColumn, ...props }: TableProps) => (
|
|
24
16
|
<div className="relative w-full overflow-auto">
|
|
25
17
|
<table
|
|
26
|
-
className={cn(
|
|
27
|
-
getTableClasses({ caption, zebra, size, pinRow, pinColumn }),
|
|
28
|
-
className
|
|
29
|
-
)}
|
|
18
|
+
className={cn(getTableClasses({ caption, zebra, size, pinRow, pinColumn }), className)}
|
|
30
19
|
{...props}
|
|
31
20
|
/>
|
|
32
21
|
</div>
|
|
@@ -35,43 +24,39 @@ Table.displayName = "Table";
|
|
|
35
24
|
|
|
36
25
|
const TableHeader = forwardRef<HTMLTableSectionElement, TableHeaderProps>(
|
|
37
26
|
({ className, ...props }, ref) => (
|
|
38
|
-
<thead
|
|
39
|
-
ref={ref}
|
|
40
|
-
className={cn(getTableHeaderClasses(), className)}
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
27
|
+
<thead ref={ref} className={cn(getTableHeaderClasses(), className)} {...props} />
|
|
43
28
|
)
|
|
44
29
|
);
|
|
45
30
|
TableHeader.displayName = "TableHeader";
|
|
46
31
|
|
|
47
|
-
const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(
|
|
48
|
-
|
|
49
|
-
);
|
|
32
|
+
const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>((props, ref) => (
|
|
33
|
+
<tbody ref={ref} {...props} />
|
|
34
|
+
));
|
|
50
35
|
TableBody.displayName = "TableBody";
|
|
51
36
|
|
|
52
|
-
const TableFooter = forwardRef<HTMLTableSectionElement, TableFooterProps>(
|
|
53
|
-
|
|
54
|
-
);
|
|
37
|
+
const TableFooter = forwardRef<HTMLTableSectionElement, TableFooterProps>((props, ref) => (
|
|
38
|
+
<tfoot ref={ref} {...props} />
|
|
39
|
+
));
|
|
55
40
|
TableFooter.displayName = "TableFooter";
|
|
56
41
|
|
|
57
|
-
const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(
|
|
58
|
-
|
|
59
|
-
);
|
|
42
|
+
const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>((props, ref) => (
|
|
43
|
+
<tr ref={ref} {...props} />
|
|
44
|
+
));
|
|
60
45
|
TableRow.displayName = "TableRow";
|
|
61
46
|
|
|
62
|
-
const TableHead = forwardRef<HTMLTableCellElement, TableHeadProps>(
|
|
63
|
-
|
|
64
|
-
);
|
|
47
|
+
const TableHead = forwardRef<HTMLTableCellElement, TableHeadProps>((props, ref) => (
|
|
48
|
+
<th ref={ref} {...props} />
|
|
49
|
+
));
|
|
65
50
|
TableHead.displayName = "TableHead";
|
|
66
51
|
|
|
67
|
-
const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(
|
|
68
|
-
|
|
69
|
-
);
|
|
52
|
+
const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>((props, ref) => (
|
|
53
|
+
<td ref={ref} {...props} />
|
|
54
|
+
));
|
|
70
55
|
TableCell.displayName = "TableCell";
|
|
71
56
|
|
|
72
|
-
const TableCaption = forwardRef<HTMLTableCaptionElement, TableCaptionProps>(
|
|
73
|
-
|
|
74
|
-
);
|
|
57
|
+
const TableCaption = forwardRef<HTMLTableCaptionElement, TableCaptionProps>((props, ref) => (
|
|
58
|
+
<caption ref={ref} {...props} />
|
|
59
|
+
));
|
|
75
60
|
TableCaption.displayName = "TableCaption";
|
|
76
61
|
|
|
77
62
|
Table.Header = TableHeader;
|
|
@@ -2,42 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5
|
+
import type { TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps } from "./types";
|
|
5
6
|
import { cn } from "../../utilities";
|
|
6
|
-
import {
|
|
7
|
-
getTabsContentClasses,
|
|
8
|
-
getTabsListClasses,
|
|
9
|
-
getTabsTriggerClasses,
|
|
10
|
-
} from "./constants";
|
|
11
|
-
import type {
|
|
12
|
-
TabsContentProps,
|
|
13
|
-
TabsListProps,
|
|
14
|
-
TabsProps,
|
|
15
|
-
TabsTriggerProps,
|
|
16
|
-
} from "./types";
|
|
7
|
+
import { getTabsContentClasses, getTabsListClasses, getTabsTriggerClasses } from "./constants";
|
|
17
8
|
|
|
18
9
|
const Tabs = (props: TabsProps) => <TabsPrimitive.Root {...props} />;
|
|
19
10
|
|
|
20
|
-
const TabsList = React.forwardRef<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
ref={ref}
|
|
26
|
-
className={cn(getTabsListClasses(), className)}
|
|
27
|
-
{...props}
|
|
28
|
-
/>
|
|
29
|
-
));
|
|
11
|
+
const TabsList = React.forwardRef<React.ElementRef<typeof TabsPrimitive.List>, TabsListProps>(
|
|
12
|
+
({ className, ...props }, ref) => (
|
|
13
|
+
<TabsPrimitive.List ref={ref} className={cn(getTabsListClasses(), className)} {...props} />
|
|
14
|
+
)
|
|
15
|
+
);
|
|
30
16
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
31
17
|
|
|
32
18
|
const TabsTrigger = React.forwardRef<
|
|
33
19
|
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
34
20
|
TabsTriggerProps
|
|
35
21
|
>(({ className, ...props }, ref) => (
|
|
36
|
-
<TabsPrimitive.Trigger
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(getTabsTriggerClasses(), className)}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
22
|
+
<TabsPrimitive.Trigger ref={ref} className={cn(getTabsTriggerClasses(), className)} {...props} />
|
|
41
23
|
));
|
|
42
24
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
43
25
|
|
|
@@ -45,11 +27,7 @@ const TabsContent = React.forwardRef<
|
|
|
45
27
|
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
46
28
|
TabsContentProps
|
|
47
29
|
>(({ className, ...props }, ref) => (
|
|
48
|
-
<TabsPrimitive.Content
|
|
49
|
-
ref={ref}
|
|
50
|
-
className={cn(getTabsContentClasses(), className)}
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
30
|
+
<TabsPrimitive.Content ref={ref} className={cn(getTabsContentClasses(), className)} {...props} />
|
|
53
31
|
));
|
|
54
32
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
55
33
|
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
2
2
|
import { type VariantProps } from "../../libs";
|
|
3
|
-
import {
|
|
4
|
-
getTabsContentClasses,
|
|
5
|
-
getTabsListClasses,
|
|
6
|
-
getTabsTriggerClasses,
|
|
7
|
-
} from "./constants";
|
|
3
|
+
import { getTabsContentClasses, getTabsListClasses, getTabsTriggerClasses } from "./constants";
|
|
8
4
|
|
|
9
|
-
export type TabsProps = React.ComponentPropsWithoutRef<
|
|
10
|
-
typeof TabsPrimitive.Root
|
|
11
|
-
>;
|
|
5
|
+
export type TabsProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>;
|
|
12
6
|
|
|
13
|
-
export type TabsListProps = React.ComponentPropsWithoutRef<
|
|
14
|
-
typeof TabsPrimitive.List
|
|
15
|
-
> &
|
|
7
|
+
export type TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> &
|
|
16
8
|
VariantProps<typeof getTabsListClasses>;
|
|
17
9
|
|
|
18
|
-
export type TabsTriggerProps = React.ComponentPropsWithoutRef<
|
|
19
|
-
typeof TabsPrimitive.Trigger
|
|
20
|
-
> &
|
|
10
|
+
export type TabsTriggerProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> &
|
|
21
11
|
VariantProps<typeof getTabsTriggerClasses>;
|
|
22
12
|
|
|
23
|
-
export type TabsContentProps = React.ComponentPropsWithoutRef<
|
|
24
|
-
typeof TabsPrimitive.Content
|
|
25
|
-
> &
|
|
13
|
+
export type TabsContentProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content> &
|
|
26
14
|
VariantProps<typeof getTabsContentClasses>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
3
|
import type { As, TextProps } from "./types";
|
|
3
|
-
import { getTextClasses } from "./constants";
|
|
4
4
|
import { cn } from "../../utilities";
|
|
5
|
-
import {
|
|
5
|
+
import { getTextClasses } from "./constants";
|
|
6
6
|
|
|
7
7
|
export const Text = <T extends As>({
|
|
8
8
|
as,
|
|
@@ -16,10 +16,7 @@ export const Text = <T extends As>({
|
|
|
16
16
|
const SlotChild = as ? as : React.Fragment;
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<Comp
|
|
20
|
-
className={cn(getTextClasses({ size, variant }), className)}
|
|
21
|
-
{...props}
|
|
22
|
-
>
|
|
19
|
+
<Comp className={cn(getTextClasses({ size, variant }), className)} {...props}>
|
|
23
20
|
{/* slot merges it's prop into it's immediate child */}
|
|
24
21
|
<SlotChild>{children}</SlotChild>
|
|
25
22
|
</Comp>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Text } from
|
|
1
|
+
export { Text } from "./Text";
|
|
@@ -5,9 +5,7 @@ export type As = "h1" | "h2" | "h3" | "h4" | "h5" | "p" | "span";
|
|
|
5
5
|
|
|
6
6
|
type AllowedElements = Pick<JSX.IntrinsicElements, As>;
|
|
7
7
|
|
|
8
|
-
export type TextProps<T extends As> = React.HTMLAttributes<
|
|
9
|
-
HTMLElement & AllowedElements[T]
|
|
10
|
-
> &
|
|
8
|
+
export type TextProps<T extends As> = React.HTMLAttributes<HTMLElement & AllowedElements[T]> &
|
|
11
9
|
VariantProps<typeof getTextClasses> & {
|
|
12
10
|
as?: As;
|
|
13
11
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { ChangeEvent } from "react";
|
|
4
|
+
import { useLayoutEffect, useState } from "react";
|
|
5
5
|
import { cn, getTheme, saveTheme } from "../../utilities";
|
|
6
6
|
import { getThemeSwitchClasses } from "./constants";
|
|
7
|
+
import { type ThemeSwitchProps } from "./types";
|
|
7
8
|
|
|
8
9
|
const MoonIcon = ({ title }: { title: string }) => (
|
|
9
10
|
<svg
|
|
@@ -2,25 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
5
|
-
import { type ToggleProps } from "./types";
|
|
6
5
|
import { cn } from "../../utilities";
|
|
7
|
-
import { getToggleClasses } from "./constants";
|
|
8
6
|
import { getButtonClasses } from "../Button/constants";
|
|
7
|
+
import { getToggleClasses } from "./constants";
|
|
8
|
+
import { type ToggleProps } from "./types";
|
|
9
9
|
|
|
10
|
-
const Toggle = React.forwardRef<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
));
|
|
10
|
+
const Toggle = React.forwardRef<React.ElementRef<typeof TogglePrimitive.Root>, ToggleProps>(
|
|
11
|
+
({ className, variant = "default", size, wide, outline, ...props }, ref) => (
|
|
12
|
+
<TogglePrimitive.Root
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(
|
|
15
|
+
getButtonClasses({ size, wide, outline }),
|
|
16
|
+
getToggleClasses({ variant }),
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
)
|
|
22
|
+
);
|
|
24
23
|
|
|
25
24
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
26
25
|
|
|
@@ -3,13 +3,8 @@ import { type VariantProps } from "../../libs";
|
|
|
3
3
|
import { getButtonClasses } from "../Button/constants";
|
|
4
4
|
import { getToggleClasses } from "./constants";
|
|
5
5
|
|
|
6
|
-
export type BaseToggleProps = Omit<
|
|
7
|
-
VariantProps<typeof getButtonClasses>,
|
|
8
|
-
"variant" | "isLoading"
|
|
9
|
-
> &
|
|
6
|
+
export type BaseToggleProps = Omit<VariantProps<typeof getButtonClasses>, "variant" | "isLoading"> &
|
|
10
7
|
VariantProps<typeof getToggleClasses>;
|
|
11
8
|
|
|
12
|
-
export type ToggleProps = React.ComponentPropsWithoutRef<
|
|
13
|
-
typeof TogglePrimitive.Root
|
|
14
|
-
> &
|
|
9
|
+
export type ToggleProps = React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
|
15
10
|
BaseToggleProps;
|
|
@@ -2,33 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
import { createContext, forwardRef, useContext } from "react";
|
|
4
4
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5
|
-
import type {
|
|
6
|
-
ToggleGroupContextType,
|
|
7
|
-
ToggleGroupItemProps,
|
|
8
|
-
ToggleGroupProps,
|
|
9
|
-
} from "./types";
|
|
5
|
+
import type { ToggleGroupContextType, ToggleGroupItemProps, ToggleGroupProps } from "./types";
|
|
10
6
|
import { cn } from "../../utilities";
|
|
7
|
+
import { getButtonClasses } from "../Button/constants";
|
|
11
8
|
import { getToggleClasses } from "../Toggle/constants";
|
|
12
9
|
import { getToggleGroupClasses } from "./constants";
|
|
13
|
-
import { getButtonClasses } from "../Button/constants";
|
|
14
10
|
|
|
15
11
|
const ToggleGroupContext = createContext<ToggleGroupContextType>({
|
|
16
12
|
variant: "default",
|
|
17
13
|
});
|
|
18
14
|
|
|
19
|
-
const ToggleGroup = ({
|
|
20
|
-
className,
|
|
21
|
-
|
|
22
|
-
children,
|
|
23
|
-
...props
|
|
24
|
-
}: ToggleGroupProps) => (
|
|
25
|
-
<ToggleGroupPrimitive.Root
|
|
26
|
-
className={cn(getToggleGroupClasses(), className)}
|
|
27
|
-
{...props}
|
|
28
|
-
>
|
|
29
|
-
<ToggleGroupContext.Provider value={{ variant }}>
|
|
30
|
-
{children}
|
|
31
|
-
</ToggleGroupContext.Provider>
|
|
15
|
+
const ToggleGroup = ({ className, variant, children, ...props }: ToggleGroupProps) => (
|
|
16
|
+
<ToggleGroupPrimitive.Root className={cn(getToggleGroupClasses(), className)} {...props}>
|
|
17
|
+
<ToggleGroupContext.Provider value={{ variant }}>{children}</ToggleGroupContext.Provider>
|
|
32
18
|
</ToggleGroupPrimitive.Root>
|
|
33
19
|
);
|
|
34
20
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
2
2
|
import { BaseToggleProps } from "../Toggle/types";
|
|
3
3
|
|
|
4
|
-
export type ToggleGroupProps = React.ComponentPropsWithoutRef<
|
|
5
|
-
typeof ToggleGroupPrimitive.Root
|
|
6
|
-
> &
|
|
4
|
+
export type ToggleGroupProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
|
|
7
5
|
Pick<BaseToggleProps, "variant">;
|
|
8
6
|
|
|
9
7
|
export type ToggleGroupItemProps = React.ComponentPropsWithoutRef<
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
3
|
import type { TooltipArrowProps, TooltipContentProps } from "./types";
|
|
4
|
-
import { getTooltipArrowClasses, getTooltipContentClasses } from "./constants";
|
|
5
4
|
import { cn } from "../../utilities";
|
|
5
|
+
import { getTooltipArrowClasses, getTooltipContentClasses } from "./constants";
|
|
6
6
|
|
|
7
|
-
const Tooltip = (props: TooltipPrimitive.TooltipProps) =>
|
|
8
|
-
<TooltipPrimitive.Root {...props} />
|
|
9
|
-
);
|
|
7
|
+
const Tooltip = (props: TooltipPrimitive.TooltipProps) => <TooltipPrimitive.Root {...props} />;
|
|
10
8
|
|
|
11
9
|
const TooltipArrow = ({ className, variant, ...props }: TooltipArrowProps) => (
|
|
12
10
|
<TooltipPrimitive.Arrow
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
1
2
|
import { type VariantProps } from "../../libs";
|
|
2
3
|
import { getTooltipArrowClasses, getTooltipContentClasses } from "./constants";
|
|
3
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
4
|
|
|
5
5
|
export type TooltipArrowProps = React.HTMLAttributes<
|
|
6
6
|
React.ElementRef<typeof TooltipPrimitive.Arrow>
|
package/src/libs/cva.ts
CHANGED
|
@@ -5,6 +5,4 @@ export { cva } from "class-variance-authority";
|
|
|
5
5
|
type ExcludeNull<T> = { [P in keyof T]: Exclude<T[P], null> };
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
-
export type VariantProps<T extends (...args: any) => any> = ExcludeNull<
|
|
9
|
-
OriginalVariantProps<T>
|
|
10
|
-
>;
|
|
8
|
+
export type VariantProps<T extends (...args: any) => any> = ExcludeNull<OriginalVariantProps<T>>;
|