@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
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import React, { MutableRefObject } from "react";
|
|
4
|
-
import {
|
|
5
|
-
defaultCountries,
|
|
6
|
-
usePhoneInput,
|
|
7
|
-
FlagImage,
|
|
8
|
-
} from "react-international-phone";
|
|
9
|
-
import { type PhoneProps } from "./types";
|
|
10
|
-
import { Popover } from "../../Popover";
|
|
11
|
-
import { Command } from "../../Command";
|
|
4
|
+
import { defaultCountries, FlagImage, usePhoneInput } from "react-international-phone";
|
|
12
5
|
import { cn } from "../../../utilities";
|
|
13
6
|
import { Button } from "../../Button";
|
|
7
|
+
import { Command } from "../../Command";
|
|
8
|
+
import { Popover } from "../../Popover";
|
|
14
9
|
import { Input } from "../Input";
|
|
15
10
|
import { getPhoneButtonClasses, getPhoneInputClasses } from "./constants";
|
|
11
|
+
import { type PhoneProps } from "./types";
|
|
16
12
|
|
|
17
13
|
const Phone = React.forwardRef<HTMLInputElement, PhoneProps>(
|
|
18
14
|
(
|
|
@@ -31,13 +27,7 @@ const Phone = React.forwardRef<HTMLInputElement, PhoneProps>(
|
|
|
31
27
|
ref
|
|
32
28
|
) => {
|
|
33
29
|
const [open, setOpen] = React.useState(false);
|
|
34
|
-
const {
|
|
35
|
-
inputValue,
|
|
36
|
-
handlePhoneValueChange,
|
|
37
|
-
inputRef,
|
|
38
|
-
country,
|
|
39
|
-
setCountry,
|
|
40
|
-
} = usePhoneInput({
|
|
30
|
+
const { inputValue, handlePhoneValueChange, inputRef, country, setCountry } = usePhoneInput({
|
|
41
31
|
value: String(defaultValue) ?? "+231",
|
|
42
32
|
defaultCountry: "lr",
|
|
43
33
|
forceDialCode: true,
|
|
@@ -60,6 +50,7 @@ const Phone = React.forwardRef<HTMLInputElement, PhoneProps>(
|
|
|
60
50
|
<Popover.Trigger asChild>
|
|
61
51
|
<Button
|
|
62
52
|
role="combobox"
|
|
53
|
+
aria-label="Select country code"
|
|
63
54
|
aria-expanded={open}
|
|
64
55
|
size={size}
|
|
65
56
|
variant={variant}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { type RadioProps } from "./types";
|
|
3
|
-
import { getRadioClasses } from "./constants";
|
|
4
2
|
import { cn } from "../../../utilities";
|
|
3
|
+
import { getRadioClasses } from "./constants";
|
|
4
|
+
import { type RadioProps } from "./types";
|
|
5
5
|
|
|
6
6
|
const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
|
|
7
7
|
({ className, size, variant, ...props }, ref) => (
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "../../../libs";
|
|
2
2
|
import { getRadioClasses } from "./constants";
|
|
3
3
|
|
|
4
|
-
export type RadioProps = Omit<
|
|
5
|
-
React.HTMLProps<HTMLInputElement>,
|
|
6
|
-
"size" | "ref" | "type"
|
|
7
|
-
> &
|
|
4
|
+
export type RadioProps = Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> &
|
|
8
5
|
VariantProps<typeof getRadioClasses>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { type RangeProps } from "./types";
|
|
3
|
-
import { getRangeClasses } from "./constants";
|
|
4
2
|
import { cn } from "../../../utilities";
|
|
3
|
+
import { getRangeClasses } from "./constants";
|
|
4
|
+
import { type RangeProps } from "./types";
|
|
5
5
|
|
|
6
6
|
const Range = React.forwardRef<HTMLInputElement, RangeProps>(
|
|
7
7
|
({ className, size, variant, wide, disabled, ...props }, ref) => (
|
|
@@ -9,10 +9,7 @@ const Range = React.forwardRef<HTMLInputElement, RangeProps>(
|
|
|
9
9
|
ref={ref}
|
|
10
10
|
type="range"
|
|
11
11
|
disabled={disabled}
|
|
12
|
-
className={cn(
|
|
13
|
-
getRangeClasses({ size, variant, wide, disabled }),
|
|
14
|
-
className
|
|
15
|
-
)}
|
|
12
|
+
className={cn(getRangeClasses({ size, variant, wide, disabled }), className)}
|
|
16
13
|
{...props}
|
|
17
14
|
/>
|
|
18
15
|
)
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "../../../libs";
|
|
2
2
|
import { getRangeClasses } from "./constants";
|
|
3
3
|
|
|
4
|
-
export type RangeProps = Omit<
|
|
5
|
-
React.HTMLProps<HTMLInputElement>,
|
|
6
|
-
"size" | "ref" | "type"
|
|
7
|
-
> &
|
|
4
|
+
export type RangeProps = Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> &
|
|
8
5
|
VariantProps<typeof getRangeClasses>;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import {
|
|
5
|
-
CheckIcon,
|
|
6
|
-
ChevronDownIcon,
|
|
7
|
-
ChevronUpIcon,
|
|
8
|
-
} from "@radix-ui/react-icons";
|
|
4
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "@radix-ui/react-icons";
|
|
9
5
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
10
|
-
import type {
|
|
11
|
-
SelectContentProps,
|
|
12
|
-
SelectItemProps,
|
|
13
|
-
SelectTriggerProps,
|
|
14
|
-
} from "./types";
|
|
6
|
+
import type { SelectContentProps, SelectItemProps, SelectTriggerProps } from "./types";
|
|
15
7
|
import { cn } from "../../../utilities";
|
|
16
8
|
import {
|
|
17
9
|
getSelectContentClasses,
|
|
@@ -22,9 +14,9 @@ import {
|
|
|
22
14
|
getSelectViewportClasses,
|
|
23
15
|
} from "./constants";
|
|
24
16
|
|
|
25
|
-
const Select = (
|
|
26
|
-
|
|
27
|
-
)
|
|
17
|
+
const Select = (props: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>) => (
|
|
18
|
+
<SelectPrimitive.Root {...props} />
|
|
19
|
+
);
|
|
28
20
|
|
|
29
21
|
const SelectTrigger = React.forwardRef<
|
|
30
22
|
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
@@ -32,10 +24,7 @@ const SelectTrigger = React.forwardRef<
|
|
|
32
24
|
>(({ className, children, size, wide, variant, outline, ...props }, ref) => (
|
|
33
25
|
<SelectPrimitive.Trigger
|
|
34
26
|
ref={ref}
|
|
35
|
-
className={cn(
|
|
36
|
-
getSelectTriggerClasses({ size, wide, variant, outline }),
|
|
37
|
-
className
|
|
38
|
-
)}
|
|
27
|
+
className={cn(getSelectTriggerClasses({ size, wide, variant, outline }), className)}
|
|
39
28
|
{...props}
|
|
40
29
|
>
|
|
41
30
|
{children}
|
|
@@ -69,8 +58,7 @@ const SelectScrollDownButton = React.forwardRef<
|
|
|
69
58
|
<ChevronDownIcon />
|
|
70
59
|
</SelectPrimitive.ScrollDownButton>
|
|
71
60
|
));
|
|
72
|
-
SelectScrollDownButton.displayName =
|
|
73
|
-
SelectPrimitive.ScrollDownButton.displayName;
|
|
61
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
74
62
|
|
|
75
63
|
const SelectContent = React.forwardRef<
|
|
76
64
|
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
@@ -84,9 +72,7 @@ const SelectContent = React.forwardRef<
|
|
|
84
72
|
{...props}
|
|
85
73
|
>
|
|
86
74
|
<SelectScrollUpButton />
|
|
87
|
-
<SelectPrimitive.Viewport
|
|
88
|
-
className={cn(getSelectViewportClasses({ position }))}
|
|
89
|
-
>
|
|
75
|
+
<SelectPrimitive.Viewport className={cn(getSelectViewportClasses({ position }))}>
|
|
90
76
|
{children}
|
|
91
77
|
</SelectPrimitive.Viewport>
|
|
92
78
|
<SelectScrollDownButton />
|
|
@@ -99,42 +85,33 @@ const SelectLabel = React.forwardRef<
|
|
|
99
85
|
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
100
86
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
101
87
|
>((props, ref) => (
|
|
102
|
-
<SelectPrimitive.Label
|
|
103
|
-
ref={ref}
|
|
104
|
-
className={cn(getSelectLabelClasses())}
|
|
105
|
-
{...props}
|
|
106
|
-
/>
|
|
88
|
+
<SelectPrimitive.Label ref={ref} className={cn(getSelectLabelClasses())} {...props} />
|
|
107
89
|
));
|
|
108
90
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
109
91
|
|
|
110
|
-
const SelectItem = React.forwardRef<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</SelectPrimitive.
|
|
123
|
-
</
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
));
|
|
92
|
+
const SelectItem = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Item>, SelectItemProps>(
|
|
93
|
+
({ className, children, variant, ...props }, ref) => (
|
|
94
|
+
<SelectPrimitive.Item
|
|
95
|
+
ref={ref}
|
|
96
|
+
className={cn(getSelectItemClasses({ variant }), className)}
|
|
97
|
+
{...props}
|
|
98
|
+
>
|
|
99
|
+
<span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
100
|
+
<SelectPrimitive.ItemIndicator>
|
|
101
|
+
<CheckIcon className="h-4 w-4" />
|
|
102
|
+
</SelectPrimitive.ItemIndicator>
|
|
103
|
+
</span>
|
|
104
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
105
|
+
</SelectPrimitive.Item>
|
|
106
|
+
)
|
|
107
|
+
);
|
|
127
108
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
128
109
|
|
|
129
110
|
const SelectSeparator = React.forwardRef<
|
|
130
111
|
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
131
112
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
132
113
|
>((props, ref) => (
|
|
133
|
-
<SelectPrimitive.Separator
|
|
134
|
-
ref={ref}
|
|
135
|
-
className={cn(getSelectSeparatorClasses())}
|
|
136
|
-
{...props}
|
|
137
|
-
/>
|
|
114
|
+
<SelectPrimitive.Separator ref={ref} className={cn(getSelectSeparatorClasses())} {...props} />
|
|
138
115
|
));
|
|
139
116
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
140
117
|
|
|
@@ -2,17 +2,11 @@ import * as SelectPrimitive from "@radix-ui/react-select";
|
|
|
2
2
|
import { type VariantProps } from "../../../libs";
|
|
3
3
|
import { getSelectContentClasses, getSelectTriggerClasses } from "./constants";
|
|
4
4
|
|
|
5
|
-
export type SelectTriggerProps = React.ComponentPropsWithoutRef<
|
|
6
|
-
typeof SelectPrimitive.Trigger
|
|
7
|
-
> &
|
|
5
|
+
export type SelectTriggerProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &
|
|
8
6
|
VariantProps<typeof getSelectTriggerClasses>;
|
|
9
7
|
|
|
10
|
-
export type SelectItemProps = React.ComponentPropsWithoutRef<
|
|
11
|
-
typeof SelectPrimitive.Item
|
|
12
|
-
> &
|
|
8
|
+
export type SelectItemProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> &
|
|
13
9
|
VariantProps<typeof getSelectTriggerClasses>;
|
|
14
10
|
|
|
15
|
-
export type SelectContentProps = React.ComponentPropsWithoutRef<
|
|
16
|
-
typeof SelectPrimitive.Content
|
|
17
|
-
> &
|
|
11
|
+
export type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> &
|
|
18
12
|
VariantProps<typeof getSelectContentClasses>;
|
|
@@ -11,33 +11,47 @@ import {
|
|
|
11
11
|
} from "./constants";
|
|
12
12
|
import { type SliderProps } from "./types";
|
|
13
13
|
|
|
14
|
-
const Slider = React.forwardRef<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
const Slider = React.forwardRef<React.ElementRef<typeof SliderPrimitive.Root>, SliderProps>(
|
|
15
|
+
(
|
|
16
|
+
{
|
|
17
|
+
className,
|
|
18
|
+
size,
|
|
19
|
+
variant,
|
|
20
|
+
wide,
|
|
21
|
+
disabled,
|
|
22
|
+
name,
|
|
23
|
+
"aria-label": ariaLabel,
|
|
24
|
+
"aria-labelledby": ariaLabelledBy,
|
|
25
|
+
...props
|
|
26
|
+
},
|
|
27
|
+
ref
|
|
28
|
+
) => (
|
|
29
|
+
<SliderPrimitive.Root
|
|
30
|
+
ref={ref}
|
|
31
|
+
name={name}
|
|
32
|
+
disabled={disabled}
|
|
33
|
+
className={cn(getSliderRootClasses({ wide, disabled }), className)}
|
|
34
|
+
data-testid={name ? `${name}-slider-root` : null}
|
|
35
|
+
{...props}
|
|
29
36
|
>
|
|
30
|
-
<SliderPrimitive.
|
|
31
|
-
className={cn(
|
|
32
|
-
data-testid={`${name}-slider-
|
|
37
|
+
<SliderPrimitive.Track
|
|
38
|
+
className={cn(getSliderTrackClasses({ size, variant }))}
|
|
39
|
+
data-testid={name ? `${name}-slider-track` : null}
|
|
40
|
+
>
|
|
41
|
+
<SliderPrimitive.Range
|
|
42
|
+
className={cn(getSliderClasses({ variant }))}
|
|
43
|
+
data-testid={name ? `${name}-slider-range` : null}
|
|
44
|
+
/>
|
|
45
|
+
</SliderPrimitive.Track>
|
|
46
|
+
<SliderPrimitive.Thumb
|
|
47
|
+
className={cn(getSliderThumbClasses({ size, variant }))}
|
|
48
|
+
data-testid={name ? `${name}-slider-thumb` : null}
|
|
49
|
+
aria-label={ariaLabel}
|
|
50
|
+
aria-labelledby={ariaLabelledBy}
|
|
33
51
|
/>
|
|
34
|
-
</SliderPrimitive.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
data-testid={`${name}-slider-thumb`}
|
|
38
|
-
/>
|
|
39
|
-
</SliderPrimitive.Root>
|
|
40
|
-
));
|
|
52
|
+
</SliderPrimitive.Root>
|
|
53
|
+
)
|
|
54
|
+
);
|
|
41
55
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
42
56
|
|
|
43
57
|
export { Slider };
|
|
@@ -14,32 +14,29 @@ export const getSliderRootClasses = cva(
|
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
|
|
17
|
-
export const getSliderTrackClasses = cva(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
error: "bg-neutral-content",
|
|
29
|
-
neutral: "bg-base-200",
|
|
30
|
-
},
|
|
31
|
-
size: {
|
|
32
|
-
xs: "h-0.5",
|
|
33
|
-
sm: "h-1",
|
|
34
|
-
md: "h-2",
|
|
35
|
-
lg: "h-3",
|
|
36
|
-
},
|
|
17
|
+
export const getSliderTrackClasses = cva("relative h-2 w-full grow overflow-hidden rounded-full", {
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
primary: "bg-neutral-content",
|
|
21
|
+
secondary: "bg-neutral-content",
|
|
22
|
+
accent: "bg-neutral-content",
|
|
23
|
+
success: "bg-neutral-content",
|
|
24
|
+
warning: "bg-neutral-content",
|
|
25
|
+
info: "bg-neutral-content",
|
|
26
|
+
error: "bg-neutral-content",
|
|
27
|
+
neutral: "bg-base-200",
|
|
37
28
|
},
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
size: {
|
|
30
|
+
xs: "h-0.5",
|
|
31
|
+
sm: "h-1",
|
|
32
|
+
md: "h-2",
|
|
33
|
+
lg: "h-3",
|
|
40
34
|
},
|
|
41
|
-
}
|
|
42
|
-
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: "neutral",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
43
40
|
|
|
44
41
|
export const getSliderClasses = cva("absolute h-full", {
|
|
45
42
|
variants: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type VariantProps } from "../../../libs";
|
|
2
1
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
2
|
+
import { type VariantProps } from "../../../libs";
|
|
3
3
|
import {
|
|
4
4
|
getSliderClasses,
|
|
5
5
|
getSliderRootClasses,
|
|
@@ -7,9 +7,7 @@ import {
|
|
|
7
7
|
getSliderTrackClasses,
|
|
8
8
|
} from "./constants";
|
|
9
9
|
|
|
10
|
-
export type SliderProps = React.ComponentPropsWithoutRef<
|
|
11
|
-
typeof SliderPrimitive.Root
|
|
12
|
-
> &
|
|
10
|
+
export type SliderProps = React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> &
|
|
13
11
|
VariantProps<typeof getSliderClasses> &
|
|
14
12
|
VariantProps<typeof getSliderTrackClasses> &
|
|
15
13
|
VariantProps<typeof getSliderThumbClasses> &
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { type SwitchProps } from "./types";
|
|
4
|
-
import { getSwitchClasses } from "./constants";
|
|
5
2
|
import { cn } from "../../../utilities";
|
|
3
|
+
import { getSwitchClasses } from "./constants";
|
|
4
|
+
import { type SwitchProps } from "./types";
|
|
6
5
|
|
|
7
6
|
const Switch = React.forwardRef<HTMLInputElement, SwitchProps>(
|
|
8
7
|
({ className, size, variant, ...props }, ref) => (
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "../../../libs";
|
|
2
2
|
import { getSwitchClasses } from "./constants";
|
|
3
3
|
|
|
4
|
-
export type SwitchProps = Omit<
|
|
5
|
-
React.HTMLProps<HTMLInputElement>,
|
|
6
|
-
"size" | "ref" | "type"
|
|
7
|
-
> &
|
|
4
|
+
export type SwitchProps = Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> &
|
|
8
5
|
VariantProps<typeof getSwitchClasses>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type TextFieldProps } from "./types";
|
|
3
2
|
import { FormControl } from "../components/FormControl/FormControl";
|
|
4
3
|
import { Input } from "../Input";
|
|
4
|
+
import { type TextFieldProps } from "./types";
|
|
5
5
|
|
|
6
6
|
export const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
|
|
7
7
|
({ id, name, info, error, label, ...props }: TextFieldProps, ref) => {
|
|
8
|
-
const feedbackId = `${name}-information
|
|
8
|
+
const feedbackId = name ? `${name}-information` : undefined;
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<FormControl as="label" htmlFor={id}>
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { type TextareaProps } from "./types";
|
|
3
2
|
import { cn } from "../../../utilities";
|
|
4
3
|
import { getTextareaClasses } from "./constants";
|
|
4
|
+
import { type TextareaProps } from "./types";
|
|
5
5
|
|
|
6
6
|
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
7
7
|
({ size, variant, wide, outline, className, ...props }, ref) => {
|
|
8
8
|
return (
|
|
9
9
|
<textarea
|
|
10
10
|
ref={ref}
|
|
11
|
-
className={cn(
|
|
12
|
-
getTextareaClasses({ size, wide, variant, outline }),
|
|
13
|
-
className
|
|
14
|
-
)}
|
|
11
|
+
className={cn(getTextareaClasses({ size, wide, variant, outline }), className)}
|
|
15
12
|
{...props}
|
|
16
13
|
/>
|
|
17
14
|
);
|
|
@@ -1,48 +1,45 @@
|
|
|
1
1
|
import { cva } from "../../../libs";
|
|
2
2
|
|
|
3
|
-
export const getTextareaClasses = cva(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
success: "textarea-success",
|
|
16
|
-
warning: "textarea-warning",
|
|
17
|
-
},
|
|
18
|
-
outline: {
|
|
19
|
-
true: "textarea-bordered",
|
|
20
|
-
},
|
|
21
|
-
wide: {
|
|
22
|
-
true: "w-full",
|
|
23
|
-
},
|
|
24
|
-
size: {
|
|
25
|
-
xs: "textarea-xs",
|
|
26
|
-
sm: "textarea-sm",
|
|
27
|
-
md: "textarea-md",
|
|
28
|
-
lg: "textarea-lg",
|
|
29
|
-
},
|
|
3
|
+
export const getTextareaClasses = cva("textarea rounded-md transition-all duration-100", {
|
|
4
|
+
variants: {
|
|
5
|
+
variant: {
|
|
6
|
+
default: "bg-transparent",
|
|
7
|
+
accent: "textarea-accent",
|
|
8
|
+
error: "textarea-error",
|
|
9
|
+
ghost: "textarea-ghost",
|
|
10
|
+
info: "textarea-info",
|
|
11
|
+
primary: "textarea-primary",
|
|
12
|
+
secondary: "textarea-secondary",
|
|
13
|
+
success: "textarea-success",
|
|
14
|
+
warning: "textarea-warning",
|
|
30
15
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
16
|
+
outline: {
|
|
17
|
+
true: "textarea-bordered",
|
|
18
|
+
},
|
|
19
|
+
wide: {
|
|
20
|
+
true: "w-full",
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
xs: "textarea-xs",
|
|
24
|
+
sm: "textarea-sm",
|
|
25
|
+
md: "textarea-md",
|
|
26
|
+
lg: "textarea-lg",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
compoundVariants: [
|
|
30
|
+
{
|
|
31
|
+
size: undefined,
|
|
32
|
+
className: "min-h-fit h-10",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
variant: undefined,
|
|
36
|
+
outline: true,
|
|
37
|
+
className: "border-neutral-content",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
variant: "default",
|
|
41
|
+
outline: true,
|
|
42
|
+
className: "border-base-content",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Slot } from "@radix-ui/react-slot";
|
|
2
2
|
import type { As, FormControlProps } from "./types";
|
|
3
|
-
import { getFormControlClasses } from "./constants";
|
|
4
3
|
import { cn } from "../../../../utilities";
|
|
5
4
|
import { Label } from "../Label";
|
|
5
|
+
import { getFormControlClasses } from "./constants";
|
|
6
6
|
|
|
7
7
|
export const FormControl = <T extends As>({
|
|
8
8
|
as,
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
2
2
|
import type { LabelProps, LabelTextProps } from "./types";
|
|
3
|
-
import { Text } from "../../../Text";
|
|
4
3
|
import { cn } from "../../../../utilities";
|
|
4
|
+
import { Text } from "../../../Text";
|
|
5
5
|
import { getLabelClasses } from "./constants";
|
|
6
6
|
|
|
7
7
|
const Label = ({ className, ...props }: LabelProps) => (
|
|
8
|
-
<LabelPrimitive.Root
|
|
9
|
-
className={cn(getLabelClasses(), className)}
|
|
10
|
-
{...props}
|
|
11
|
-
/>
|
|
8
|
+
<LabelPrimitive.Root className={cn(getLabelClasses(), className)} {...props} />
|
|
12
9
|
);
|
|
13
10
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
14
11
|
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
2
2
|
import { type VariantProps } from "../../../../libs";
|
|
3
|
-
import { getLabelClasses } from "./constants";
|
|
4
3
|
import { Text } from "../../../Text";
|
|
4
|
+
import { getLabelClasses } from "./constants";
|
|
5
5
|
|
|
6
|
-
export type LabelProps = React.ComponentPropsWithoutRef<
|
|
7
|
-
typeof LabelPrimitive.Root
|
|
8
|
-
> &
|
|
6
|
+
export type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
9
7
|
VariantProps<typeof getLabelClasses>;
|
|
10
8
|
|
|
11
9
|
export type LabelTextProps = Omit<React.ComponentProps<typeof Text>, "as">;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { forwardRef } from "react";
|
|
3
4
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
4
5
|
import { cn } from "../../utilities";
|
|
5
6
|
import { getHoverCardContentClasses } from "./constants";
|
|
6
|
-
import { forwardRef } from "react";
|
|
7
7
|
import { HoverCardProps } from "./types";
|
|
8
8
|
|
|
9
|
-
const HoverCard = (props: HoverCardProps) =>
|
|
10
|
-
<HoverCardPrimitive.Root {...props} />
|
|
11
|
-
);
|
|
9
|
+
const HoverCard = (props: HoverCardProps) => <HoverCardPrimitive.Root {...props} />;
|
|
12
10
|
|
|
13
11
|
const HoverCardContent = forwardRef<
|
|
14
12
|
React.ElementRef<typeof HoverCardPrimitive.Content>,
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
+
import { cn } from "../../utilities";
|
|
1
2
|
import { getLoadingClasses } from "./constants";
|
|
2
3
|
import { type LoadingProps } from "./types";
|
|
3
|
-
import { cn } from "../../utilities";
|
|
4
4
|
|
|
5
|
-
export const Loading = ({
|
|
6
|
-
size,
|
|
7
|
-
intent,
|
|
8
|
-
variant,
|
|
9
|
-
className,
|
|
10
|
-
...props
|
|
11
|
-
}: LoadingProps) => {
|
|
5
|
+
export const Loading = ({ size, intent, variant, className, ...props }: LoadingProps) => {
|
|
12
6
|
return (
|
|
13
|
-
<span
|
|
14
|
-
className={cn(getLoadingClasses({ intent, size, variant }), className)}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
7
|
+
<span className={cn(getLoadingClasses({ intent, size, variant }), className)} {...props} />
|
|
17
8
|
);
|
|
18
9
|
};
|