@atlure/ui 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -6
- package/package.json +5 -6
- package/src/components/alert-dialog/alert-dialog.tsx +59 -0
- package/src/components/alert-dialog/utils.ts +5 -0
- package/src/components/avatar/avatar-group.tsx +52 -0
- package/src/components/avatar/avatar.tsx +54 -11
- package/src/components/badge/urgency-badge.tsx +21 -0
- package/src/components/calendar/calendar.tsx +189 -0
- package/src/components/checkbox/checkbox.tsx +26 -9
- package/src/components/chip/chip.tsx +66 -0
- package/src/components/date-range-picker/date-range-picker.tsx +104 -0
- package/src/components/dialog/dialog.tsx +137 -0
- package/src/components/format/date-label.tsx +41 -0
- package/src/components/format/distance-label.tsx +13 -0
- package/src/components/format/duration-label.tsx +13 -0
- package/src/components/format/money-label.tsx +20 -0
- package/src/components/picker/picker.tsx +104 -0
- package/src/components/progress/progress.tsx +95 -0
- package/src/components/progress/utils.ts +10 -0
- package/src/components/radio-group/radio-group-context.tsx +27 -0
- package/src/components/radio-group/radio-group.tsx +150 -0
- package/src/components/screen-header/screen-header.tsx +62 -0
- package/src/components/segmented-control/segmented-control.tsx +67 -0
- package/src/components/select/select.tsx +134 -0
- package/src/components/settings-row/settings-row.tsx +52 -0
- package/src/components/sheet/sheet.tsx +139 -0
- package/src/components/sheet/utils.ts +55 -0
- package/src/components/slider/format-label.ts +3 -0
- package/src/components/slider/hooks/use-slider-drag.ts +47 -0
- package/src/components/slider/range-slider.tsx +203 -0
- package/src/components/slider/slider.tsx +148 -0
- package/src/components/slider/utils.ts +57 -0
- package/src/components/star-rating/star-rating.tsx +98 -0
- package/src/components/switch/switch.tsx +34 -6
- package/src/components/tabs/tabs-context.tsx +32 -0
- package/src/components/tabs/tabs.tsx +239 -0
- package/src/components/time-picker/time-picker.tsx +131 -0
- package/src/components/toast/toast-context.tsx +26 -0
- package/src/components/toast/toast-provider.tsx +70 -0
- package/src/components/toast/toast.tsx +41 -0
- package/src/components/toast/utils.ts +2 -0
- package/src/index.ts +54 -0
- package/src/lib/calendar.ts +204 -0
- package/src/lib/format/date.ts +46 -0
- package/src/lib/format/distance.ts +36 -0
- package/src/lib/format/duration.ts +28 -0
- package/src/lib/format/money.ts +20 -0
- package/src/lib/locale.tsx +36 -0
- package/src/lib/portal.tsx +54 -0
- package/src/lib/touch-target.ts +5 -1
- package/src/lib/use-sheet.ts +18 -0
- package/src/lib/use-toast.ts +17 -0
- package/src/variants/avatar-variants.ts +68 -15
- package/src/variants/badge-variants.ts +8 -0
- package/src/variants/calendar-variants.ts +26 -0
- package/src/variants/checkbox-variants.ts +5 -14
- package/src/variants/chip-variants.ts +38 -0
- package/src/variants/dialog-variants.ts +11 -0
- package/src/variants/index.ts +9 -0
- package/src/variants/overlay-variants.ts +1 -0
- package/src/variants/progress-variants.ts +18 -0
- package/src/variants/radio-group-variants.ts +48 -0
- package/src/variants/screen-header-variants.ts +33 -0
- package/src/variants/segmented-control-variants.ts +41 -0
- package/src/variants/select-variants.ts +48 -0
- package/src/variants/settings-row-variants.ts +18 -0
- package/src/variants/sheet-variants.ts +10 -0
- package/src/variants/slider-variants.ts +8 -0
- package/src/variants/star-rating-variants.ts +28 -0
- package/src/variants/switch-variants.ts +26 -4
- package/src/variants/tabs-variants.ts +46 -0
- package/src/variants/toast-variants.ts +31 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
2
|
|
|
3
|
+
export const checkboxBoxSize = 24;
|
|
4
|
+
|
|
3
5
|
export const checkboxRowVariants = cva("flex-row items-center gap-sm", {
|
|
4
6
|
variants: {
|
|
5
7
|
isDisabled: {
|
|
@@ -14,7 +16,7 @@ export const checkboxRowVariants = cva("flex-row items-center gap-sm", {
|
|
|
14
16
|
|
|
15
17
|
export const checkboxBoxVariants = cva("h-6 w-6 items-center justify-center rounded-sm border-2", {
|
|
16
18
|
variants: {
|
|
17
|
-
|
|
19
|
+
isSelected: {
|
|
18
20
|
true: "border-primary bg-primary",
|
|
19
21
|
false: "border-border/20 bg-input-background",
|
|
20
22
|
},
|
|
@@ -24,23 +26,12 @@ export const checkboxBoxVariants = cva("h-6 w-6 items-center justify-center roun
|
|
|
24
26
|
},
|
|
25
27
|
},
|
|
26
28
|
defaultVariants: {
|
|
27
|
-
|
|
29
|
+
isSelected: false,
|
|
28
30
|
isInvalid: false,
|
|
29
31
|
},
|
|
30
32
|
});
|
|
31
33
|
|
|
32
|
-
export const
|
|
33
|
-
variants: {
|
|
34
|
-
isChecked: {
|
|
35
|
-
true: "bg-primary-foreground",
|
|
36
|
-
false: "bg-transparent",
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
defaultVariants: {
|
|
40
|
-
isChecked: false,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
34
|
+
export const checkboxIndicatorClassName = "text-primary-foreground";
|
|
43
35
|
|
|
44
36
|
export type CheckboxRowVariantProps = VariantProps<typeof checkboxRowVariants>;
|
|
45
37
|
export type CheckboxBoxVariantProps = VariantProps<typeof checkboxBoxVariants>;
|
|
46
|
-
export type CheckboxIndicatorVariantProps = VariantProps<typeof checkboxIndicatorVariants>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const chipHeight = 32;
|
|
4
|
+
|
|
5
|
+
export const chipVariants = cva("flex-row items-center self-start rounded-full border", {
|
|
6
|
+
variants: {
|
|
7
|
+
isSelected: {
|
|
8
|
+
true: "border-primary bg-primary",
|
|
9
|
+
false: "border-border/20 bg-transparent",
|
|
10
|
+
},
|
|
11
|
+
isDisabled: {
|
|
12
|
+
true: "opacity-50",
|
|
13
|
+
false: "",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
isSelected: false,
|
|
18
|
+
isDisabled: false,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const chipBodyClassName = "flex-row items-center px-md py-xs";
|
|
23
|
+
export const chipDismissClassName = "flex-row items-center py-xs pl-xs pr-md";
|
|
24
|
+
|
|
25
|
+
export const chipLabelVariants = cva("text-sm font-medium", {
|
|
26
|
+
variants: {
|
|
27
|
+
isSelected: {
|
|
28
|
+
true: "text-primary-foreground",
|
|
29
|
+
false: "text-foreground",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
isSelected: false,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export type ChipVariantProps = VariantProps<typeof chipVariants>;
|
|
38
|
+
export type ChipLabelVariantProps = VariantProps<typeof chipLabelVariants>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const dialogOverlayClassName = "flex-1 items-center justify-center p-lg";
|
|
2
|
+
|
|
3
|
+
export const dialogContentClassName = "w-full max-w-sm gap-md rounded-lg bg-card p-lg";
|
|
4
|
+
|
|
5
|
+
export const dialogHeaderClassName = "gap-xs";
|
|
6
|
+
|
|
7
|
+
export const dialogTitleClassName = "text-lg font-semibold text-foreground";
|
|
8
|
+
|
|
9
|
+
export const dialogDescriptionClassName = "text-sm text-muted-foreground";
|
|
10
|
+
|
|
11
|
+
export const dialogFooterClassName = "flex-row justify-end gap-sm";
|
package/src/variants/index.ts
CHANGED
|
@@ -3,9 +3,18 @@ export * from "./badge-variants";
|
|
|
3
3
|
export * from "./button-variants";
|
|
4
4
|
export * from "./card-variants";
|
|
5
5
|
export * from "./checkbox-variants";
|
|
6
|
+
export * from "./chip-variants";
|
|
6
7
|
export * from "./input-variants";
|
|
7
8
|
export * from "./label-variants";
|
|
9
|
+
export * from "./radio-group-variants";
|
|
10
|
+
export * from "./screen-header-variants";
|
|
11
|
+
export * from "./segmented-control-variants";
|
|
8
12
|
export * from "./separator-variants";
|
|
13
|
+
export * from "./progress-variants";
|
|
14
|
+
export * from "./settings-row-variants";
|
|
9
15
|
export * from "./skeleton-variants";
|
|
16
|
+
export * from "./slider-variants";
|
|
17
|
+
export * from "./star-rating-variants";
|
|
10
18
|
export * from "./switch-variants";
|
|
19
|
+
export * from "./tabs-variants";
|
|
11
20
|
export * from "./text-variants";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const overlayBackdropClassName = "absolute inset-0 bg-foreground/40";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const progressTrackVariants = cva("w-full overflow-hidden rounded-full bg-muted", {
|
|
4
|
+
variants: {
|
|
5
|
+
size: {
|
|
6
|
+
sm: "h-1",
|
|
7
|
+
md: "h-2",
|
|
8
|
+
lg: "h-3",
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
defaultVariants: {
|
|
12
|
+
size: "md",
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const progressFillClassName = "h-full rounded-full bg-primary";
|
|
17
|
+
|
|
18
|
+
export type ProgressVariantProps = VariantProps<typeof progressTrackVariants>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const radioGroupIndicatorSize = 24;
|
|
4
|
+
|
|
5
|
+
export const radioGroupVariants = cva("flex-col gap-sm", {
|
|
6
|
+
variants: {
|
|
7
|
+
isDisabled: {
|
|
8
|
+
true: "opacity-50",
|
|
9
|
+
false: "",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
isDisabled: false,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const radioGroupItemVariants = cva("flex-row items-center gap-sm", {
|
|
18
|
+
variants: {
|
|
19
|
+
isDisabled: {
|
|
20
|
+
true: "opacity-50",
|
|
21
|
+
false: "",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
isDisabled: false,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const radioGroupIndicatorVariants = cva(
|
|
30
|
+
"h-6 w-6 items-center justify-center rounded-full border-2",
|
|
31
|
+
{
|
|
32
|
+
variants: {
|
|
33
|
+
isSelected: {
|
|
34
|
+
true: "border-primary",
|
|
35
|
+
false: "border-border/20 bg-input-background",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
isSelected: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export const radioGroupDotClassName = "h-3 w-3 rounded-full bg-primary";
|
|
45
|
+
|
|
46
|
+
export type RadioGroupVariantProps = VariantProps<typeof radioGroupVariants>;
|
|
47
|
+
export type RadioGroupItemVariantProps = VariantProps<typeof radioGroupItemVariants>;
|
|
48
|
+
export type RadioGroupIndicatorVariantProps = VariantProps<typeof radioGroupIndicatorVariants>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const screenHeaderVariants = cva("flex-row bg-background px-md", {
|
|
4
|
+
variants: {
|
|
5
|
+
variant: {
|
|
6
|
+
default: "items-center gap-sm py-sm",
|
|
7
|
+
large: "items-start gap-md py-lg",
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
defaultVariants: {
|
|
11
|
+
variant: "default",
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const screenHeaderTextClassName = "flex-1 flex-col gap-xs";
|
|
16
|
+
export const screenHeaderActionsClassName = "flex-row items-center gap-xs";
|
|
17
|
+
|
|
18
|
+
export const screenHeaderTitleVariants = cva("", {
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
default: "text-lg font-semibold text-foreground",
|
|
22
|
+
large: "text-2xl font-bold text-foreground",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: "default",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const screenHeaderSubtitleClassName = "text-sm font-normal text-muted-foreground";
|
|
31
|
+
|
|
32
|
+
export type ScreenHeaderVariantProps = VariantProps<typeof screenHeaderVariants>;
|
|
33
|
+
export type ScreenHeaderTitleVariantProps = VariantProps<typeof screenHeaderTitleVariants>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const segmentedControlClassName =
|
|
4
|
+
"flex-row items-center rounded-full border border-border/20 bg-muted p-xs";
|
|
5
|
+
|
|
6
|
+
export const segmentedControlSegmentVariants = cva(
|
|
7
|
+
"flex-1 items-center justify-center rounded-full px-md py-sm",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
isSelected: {
|
|
11
|
+
true: "bg-background",
|
|
12
|
+
false: "bg-transparent",
|
|
13
|
+
},
|
|
14
|
+
isDisabled: {
|
|
15
|
+
true: "opacity-50",
|
|
16
|
+
false: "",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
isSelected: false,
|
|
21
|
+
isDisabled: false,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const segmentedControlLabelVariants = cva("text-sm", {
|
|
27
|
+
variants: {
|
|
28
|
+
isSelected: {
|
|
29
|
+
true: "font-semibold text-foreground",
|
|
30
|
+
false: "font-medium text-muted-foreground",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
isSelected: false,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export type SegmentedControlSegmentVariantProps = VariantProps<
|
|
39
|
+
typeof segmentedControlSegmentVariants
|
|
40
|
+
>;
|
|
41
|
+
export type SegmentedControlLabelVariantProps = VariantProps<typeof segmentedControlLabelVariants>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const selectTriggerClassName = "flex-row items-center justify-between gap-sm";
|
|
4
|
+
|
|
5
|
+
export const selectValueVariants = cva("flex-1 text-base", {
|
|
6
|
+
variants: {
|
|
7
|
+
isPlaceholder: {
|
|
8
|
+
true: "text-muted-foreground",
|
|
9
|
+
false: "text-foreground",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
isPlaceholder: false,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const selectItemVariants = cva(
|
|
18
|
+
"min-h-control-md flex-row items-center justify-between py-sm",
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
isDisabled: {
|
|
22
|
+
true: "opacity-50",
|
|
23
|
+
false: "",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
isDisabled: false,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export const selectItemLabelVariants = cva("flex-1 text-base", {
|
|
33
|
+
variants: {
|
|
34
|
+
isSelected: {
|
|
35
|
+
true: "font-semibold text-foreground",
|
|
36
|
+
false: "text-foreground",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
isSelected: false,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const selectOptionListClassName = "flex-1";
|
|
45
|
+
|
|
46
|
+
export type SelectValueVariantProps = VariantProps<typeof selectValueVariants>;
|
|
47
|
+
export type SelectItemVariantProps = VariantProps<typeof selectItemVariants>;
|
|
48
|
+
export type SelectItemLabelVariantProps = VariantProps<typeof selectItemLabelVariants>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const settingsRowVariants = cva("flex-row items-center gap-md py-sm", {
|
|
4
|
+
variants: {
|
|
5
|
+
isDisabled: {
|
|
6
|
+
true: "opacity-50",
|
|
7
|
+
false: "",
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
defaultVariants: {
|
|
11
|
+
isDisabled: false,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const settingsRowTextClassName = "flex-1 flex-col gap-xs";
|
|
16
|
+
export const settingsRowControlClassName = "shrink-0";
|
|
17
|
+
|
|
18
|
+
export type SettingsRowVariantProps = VariantProps<typeof settingsRowVariants>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { overlayBackdropClassName } from "./overlay-variants";
|
|
2
|
+
|
|
3
|
+
export const sheetContainerClassName = "flex-1 justify-end";
|
|
4
|
+
|
|
5
|
+
export const sheetBackdropClassName = overlayBackdropClassName;
|
|
6
|
+
|
|
7
|
+
export const sheetContentClassName = "w-full overflow-hidden rounded-t-xl bg-card px-md";
|
|
8
|
+
|
|
9
|
+
export const sheetHandleClassName =
|
|
10
|
+
"my-sm h-1 w-12 self-center rounded-full bg-muted-foreground/40";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const sliderContainerClassName = "w-full justify-center py-2";
|
|
2
|
+
export const sliderTrackClassName = "h-2 w-full overflow-hidden rounded-full bg-muted";
|
|
3
|
+
export const sliderFillClassName = "absolute h-2 rounded-full bg-primary";
|
|
4
|
+
export const sliderThumbClassName =
|
|
5
|
+
"absolute h-6 w-6 -ml-3 rounded-full border-2 border-primary bg-background";
|
|
6
|
+
export const sliderLabelClassName = "mt-2 text-sm text-foreground";
|
|
7
|
+
|
|
8
|
+
export const SLIDER_THUMB_SIZE = 24;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const starRatingIconSize = {
|
|
4
|
+
sm: 12,
|
|
5
|
+
md: 16,
|
|
6
|
+
lg: 24,
|
|
7
|
+
} as const;
|
|
8
|
+
|
|
9
|
+
export type StarRatingSize = keyof typeof starRatingIconSize;
|
|
10
|
+
|
|
11
|
+
export const starRatingClassName = "flex-row items-center gap-xs";
|
|
12
|
+
export const starRatingFilledClassName = "text-warning";
|
|
13
|
+
export const starRatingEmptyClassName = "text-muted-foreground";
|
|
14
|
+
|
|
15
|
+
export const starRatingValueVariants = cva("font-medium text-muted-foreground", {
|
|
16
|
+
variants: {
|
|
17
|
+
size: {
|
|
18
|
+
sm: "text-xs",
|
|
19
|
+
md: "text-sm",
|
|
20
|
+
lg: "text-base",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
size: "md",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type StarRatingValueVariantProps = VariantProps<typeof starRatingValueVariants>;
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const switchTrackHeight = {
|
|
4
|
+
sm: 24,
|
|
5
|
+
md: 28,
|
|
6
|
+
} as const;
|
|
7
|
+
|
|
8
|
+
export const switchThumbTravel = {
|
|
9
|
+
sm: 16,
|
|
10
|
+
md: 20,
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
export type SwitchSize = keyof typeof switchTrackHeight;
|
|
14
|
+
|
|
15
|
+
export const switchTrackVariants = cva("flex-row items-center rounded-full p-xs", {
|
|
4
16
|
variants: {
|
|
17
|
+
size: {
|
|
18
|
+
sm: "h-6 w-10",
|
|
19
|
+
md: "h-7 w-12",
|
|
20
|
+
},
|
|
5
21
|
isChecked: {
|
|
6
|
-
true: "
|
|
7
|
-
false: "
|
|
22
|
+
true: "bg-primary",
|
|
23
|
+
false: "bg-muted",
|
|
8
24
|
},
|
|
9
25
|
isDisabled: {
|
|
10
26
|
true: "opacity-50",
|
|
@@ -12,19 +28,25 @@ export const switchTrackVariants = cva("h-7 w-12 flex-row items-center rounded-f
|
|
|
12
28
|
},
|
|
13
29
|
},
|
|
14
30
|
defaultVariants: {
|
|
31
|
+
size: "md",
|
|
15
32
|
isChecked: false,
|
|
16
33
|
isDisabled: false,
|
|
17
34
|
},
|
|
18
35
|
});
|
|
19
36
|
|
|
20
|
-
export const switchThumbVariants = cva("
|
|
37
|
+
export const switchThumbVariants = cva("rounded-full", {
|
|
21
38
|
variants: {
|
|
39
|
+
size: {
|
|
40
|
+
sm: "h-4 w-4",
|
|
41
|
+
md: "h-5 w-5",
|
|
42
|
+
},
|
|
22
43
|
isChecked: {
|
|
23
44
|
true: "bg-primary-foreground",
|
|
24
45
|
false: "bg-background",
|
|
25
46
|
},
|
|
26
47
|
},
|
|
27
48
|
defaultVariants: {
|
|
49
|
+
size: "md",
|
|
28
50
|
isChecked: false,
|
|
29
51
|
},
|
|
30
52
|
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const tabsIndicatorHeight = 2;
|
|
4
|
+
|
|
5
|
+
export const tabsListClassName = "relative flex-row items-end border-b border-border/20";
|
|
6
|
+
export const tabsIndicatorClassName = "h-full w-full rounded-full bg-primary";
|
|
7
|
+
|
|
8
|
+
export const tabsTriggerVariants = cva("items-center justify-center px-md py-sm", {
|
|
9
|
+
variants: {
|
|
10
|
+
isDisabled: {
|
|
11
|
+
true: "opacity-50",
|
|
12
|
+
false: "",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
isDisabled: false,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const tabsTriggerLabelVariants = cva("text-sm", {
|
|
21
|
+
variants: {
|
|
22
|
+
isActive: {
|
|
23
|
+
true: "font-semibold text-primary",
|
|
24
|
+
false: "font-medium text-muted-foreground",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
isActive: false,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const tabsContentVariants = cva("flex-1", {
|
|
33
|
+
variants: {
|
|
34
|
+
isActive: {
|
|
35
|
+
true: "",
|
|
36
|
+
false: "hidden",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
isActive: true,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export type TabsTriggerVariantProps = VariantProps<typeof tabsTriggerVariants>;
|
|
45
|
+
export type TabsTriggerLabelVariantProps = VariantProps<typeof tabsTriggerLabelVariants>;
|
|
46
|
+
export type TabsContentVariantProps = VariantProps<typeof tabsContentVariants>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const toastViewportClassName = "absolute inset-x-0 bottom-0 px-md";
|
|
4
|
+
|
|
5
|
+
export const toastVariants = cva("w-full flex-row items-center gap-sm rounded-lg p-md", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-card",
|
|
9
|
+
success: "bg-success",
|
|
10
|
+
error: "bg-destructive",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const toastMessageVariants = cva("flex-1 text-base", {
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
default: "text-foreground",
|
|
22
|
+
success: "text-success-foreground",
|
|
23
|
+
error: "text-destructive-foreground",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export type ToastVariantProps = VariantProps<typeof toastVariants>;
|