@schandlergarcia/sf-web-components 1.4.0 → 1.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 +2 -0
- package/dist/components/library/heroui/Alert.d.ts +6 -5
- package/dist/components/library/heroui/Alert.js +7 -8
- package/dist/components/library/heroui/Alert.js.map +1 -1
- package/dist/components/library/heroui/Badge.d.ts +8 -5
- package/dist/components/library/heroui/Badge.js +2 -3
- package/dist/components/library/heroui/Badge.js.map +1 -1
- package/dist/components/library/heroui/Button.d.ts +16 -26
- package/dist/components/library/heroui/Button.js +21 -22
- package/dist/components/library/heroui/Button.js.map +1 -1
- package/dist/components/library/heroui/Card.d.ts +8 -5
- package/dist/components/library/heroui/Card.js +6 -7
- package/dist/components/library/heroui/Card.js.map +1 -1
- package/dist/components/library/heroui/Input.d.ts +5 -1
- package/dist/components/library/heroui/Input.js +0 -1
- package/dist/components/library/heroui/Input.js.map +1 -1
- package/dist/components/library/heroui/Kbd.d.ts +6 -5
- package/dist/components/library/heroui/Kbd.js +4 -5
- package/dist/components/library/heroui/Kbd.js.map +1 -1
- package/dist/components/library/heroui/Modal.d.ts +6 -2
- package/dist/components/library/heroui/Modal.js +2 -3
- package/dist/components/library/heroui/Modal.js.map +1 -1
- package/dist/components/library/heroui/Pagination.d.ts +6 -2
- package/dist/components/library/heroui/Pagination.js +4 -5
- package/dist/components/library/heroui/Pagination.js.map +1 -1
- package/dist/components/library/heroui/ProgressBar.d.ts +8 -5
- package/dist/components/library/heroui/ProgressBar.js +0 -1
- package/dist/components/library/heroui/ProgressBar.js.map +1 -1
- package/dist/components/library/heroui/ProgressCircle.d.ts +8 -5
- package/dist/components/library/heroui/ProgressCircle.js +0 -1
- package/dist/components/library/heroui/ProgressCircle.js.map +1 -1
- package/dist/components/library/heroui/ScrollShadow.d.ts +8 -5
- package/dist/components/library/heroui/ScrollShadow.js +3 -4
- package/dist/components/library/heroui/ScrollShadow.js.map +1 -1
- package/dist/components/library/heroui/Separator.d.ts +6 -2
- package/dist/components/library/heroui/Separator.js +4 -5
- package/dist/components/library/heroui/Separator.js.map +1 -1
- package/dist/components/library/heroui/Skeleton.d.ts +8 -5
- package/dist/components/library/heroui/Skeleton.js +4 -5
- package/dist/components/library/heroui/Skeleton.js.map +1 -1
- package/dist/components/library/heroui/Tabs.d.ts +6 -5
- package/dist/components/library/heroui/Tabs.js +7 -8
- package/dist/components/library/heroui/Tabs.js.map +1 -1
- package/dist/components/library/heroui/Toast.d.ts +6 -3
- package/dist/components/library/heroui/Toast.js +3 -4
- package/dist/components/library/heroui/Toast.js.map +1 -1
- package/dist/components/library/heroui/Toggle.d.ts +5 -4
- package/dist/components/library/heroui/Toggle.js +5 -6
- package/dist/components/library/heroui/Toggle.js.map +1 -1
- package/dist/components/library/heroui/Tooltip.d.ts +6 -2
- package/dist/components/library/heroui/Tooltip.js +2 -3
- package/dist/components/library/heroui/Tooltip.js.map +1 -1
- package/dist/components/library/ui/Chip.d.ts +18 -7
- package/dist/components/library/ui/Chip.js +11 -12
- package/dist/components/library/ui/Chip.js.map +1 -1
- package/dist/components/library/ui/Container.d.ts +12 -13
- package/dist/components/library/ui/Container.js +16 -17
- package/dist/components/library/ui/Container.js.map +1 -1
- package/dist/components/library/ui/FieldGroup.d.ts +4 -5
- package/dist/components/library/ui/FieldGroup.js +4 -5
- package/dist/components/library/ui/FieldGroup.js.map +1 -1
- package/dist/components/library/ui/Text.d.ts +24 -10
- package/dist/components/library/ui/Text.js +20 -23
- package/dist/components/library/ui/Text.js.map +1 -1
- package/package.json +1 -1
- package/src/components/library/heroui/Alert.tsx +13 -0
- package/src/components/library/heroui/Badge.tsx +14 -0
- package/src/components/library/heroui/{Button.jsx → Button.tsx} +26 -8
- package/src/components/library/heroui/Card.tsx +14 -0
- package/src/components/library/heroui/Input.tsx +10 -0
- package/src/components/library/heroui/Kbd.tsx +11 -0
- package/src/components/library/heroui/{Modal.jsx → Modal.tsx} +5 -2
- package/src/components/library/heroui/Pagination.tsx +11 -0
- package/src/components/library/heroui/ProgressBar.tsx +14 -0
- package/src/components/library/heroui/ProgressCircle.tsx +14 -0
- package/src/components/library/heroui/ScrollShadow.tsx +14 -0
- package/src/components/library/heroui/Separator.tsx +11 -0
- package/src/components/library/heroui/Skeleton.tsx +14 -0
- package/src/components/library/heroui/{Tabs.jsx → Tabs.tsx} +8 -3
- package/src/components/library/heroui/{Toast.jsx → Toast.tsx} +5 -2
- package/src/components/library/heroui/{Toggle.jsx → Toggle.tsx} +6 -2
- package/src/components/library/heroui/{Tooltip.jsx → Tooltip.tsx} +5 -2
- package/src/components/library/ui/{Chip.jsx → Chip.tsx} +11 -7
- package/src/components/library/ui/{Container.jsx → Container.tsx} +13 -4
- package/src/components/library/ui/{FieldGroup.jsx → FieldGroup.tsx} +4 -2
- package/src/components/library/ui/{Text.jsx → Text.tsx} +19 -12
- package/src/components/library/heroui/Alert.jsx +0 -8
- package/src/components/library/heroui/Badge.jsx +0 -8
- package/src/components/library/heroui/Card.jsx +0 -8
- package/src/components/library/heroui/Input.jsx +0 -6
- package/src/components/library/heroui/Kbd.jsx +0 -8
- package/src/components/library/heroui/Pagination.jsx +0 -8
- package/src/components/library/heroui/ProgressBar.jsx +0 -8
- package/src/components/library/heroui/ProgressCircle.jsx +0 -8
- package/src/components/library/heroui/ScrollShadow.jsx +0 -8
- package/src/components/library/heroui/Separator.jsx +0 -8
- package/src/components/library/heroui/Skeleton.jsx +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
import { Button as HeroButton } from "@heroui/react";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -9,6 +9,21 @@ import { Button as HeroButton } from "@heroui/react";
|
|
|
9
9
|
* - outline -> bordered
|
|
10
10
|
* - ghost -> light
|
|
11
11
|
*/
|
|
12
|
+
|
|
13
|
+
type ShadcnVariant = "primary" | "secondary" | "destructive" | "outline" | "ghost";
|
|
14
|
+
|
|
15
|
+
export interface HeroUIButtonProps {
|
|
16
|
+
variant?: ShadcnVariant;
|
|
17
|
+
size?: "sm" | "md" | "lg";
|
|
18
|
+
fullWidth?: boolean;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
type?: "button" | "submit" | "reset";
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
|
|
12
27
|
export default function HeroUIButton({
|
|
13
28
|
variant = "primary",
|
|
14
29
|
size = "md",
|
|
@@ -17,9 +32,9 @@ export default function HeroUIButton({
|
|
|
17
32
|
children,
|
|
18
33
|
className = "",
|
|
19
34
|
...props
|
|
20
|
-
}) {
|
|
35
|
+
}: HeroUIButtonProps) {
|
|
21
36
|
// Map shadcn variants to HeroUI variants
|
|
22
|
-
const variantMap = {
|
|
37
|
+
const variantMap: Record<ShadcnVariant, string> = {
|
|
23
38
|
primary: "solid",
|
|
24
39
|
secondary: "solid",
|
|
25
40
|
destructive: "solid",
|
|
@@ -28,7 +43,7 @@ export default function HeroUIButton({
|
|
|
28
43
|
};
|
|
29
44
|
|
|
30
45
|
// Map shadcn variants to HeroUI colors
|
|
31
|
-
const colorMap = {
|
|
46
|
+
const colorMap: Record<ShadcnVariant, string> = {
|
|
32
47
|
primary: "primary",
|
|
33
48
|
secondary: "default",
|
|
34
49
|
destructive: "danger",
|
|
@@ -36,11 +51,13 @@ export default function HeroUIButton({
|
|
|
36
51
|
ghost: "default"
|
|
37
52
|
};
|
|
38
53
|
|
|
39
|
-
const heroVariant = variantMap[variant]
|
|
40
|
-
const heroColor = colorMap[variant]
|
|
54
|
+
const heroVariant = variantMap[variant];
|
|
55
|
+
const heroColor = colorMap[variant];
|
|
56
|
+
|
|
57
|
+
const HeroButtonAny = HeroButton as any;
|
|
41
58
|
|
|
42
59
|
return (
|
|
43
|
-
<
|
|
60
|
+
<HeroButtonAny
|
|
44
61
|
variant={heroVariant}
|
|
45
62
|
color={heroColor}
|
|
46
63
|
size={size}
|
|
@@ -50,9 +67,10 @@ export default function HeroUIButton({
|
|
|
50
67
|
{...props}
|
|
51
68
|
>
|
|
52
69
|
{children}
|
|
53
|
-
</
|
|
70
|
+
</HeroButtonAny>
|
|
54
71
|
);
|
|
55
72
|
}
|
|
56
73
|
|
|
57
74
|
// Also export as Button for shadcn compatibility
|
|
58
75
|
export const Button = HeroUIButton;
|
|
76
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Card } from "@heroui/react";
|
|
3
|
+
import type { CardProps } from "@heroui/react";
|
|
4
|
+
|
|
5
|
+
export interface HeroUICardProps extends CardProps {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function HeroUICard({ children, ...props }: HeroUICardProps) {
|
|
10
|
+
return <Card {...props}>{children}</Card>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { Card };
|
|
14
|
+
export type { CardProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Input } from "@heroui/react";
|
|
2
|
+
import type { InputProps } from "@heroui/react";
|
|
3
|
+
|
|
4
|
+
export interface HeroUIInputProps extends InputProps {}
|
|
5
|
+
|
|
6
|
+
export default function HeroUIInput(props: HeroUIInputProps) {
|
|
7
|
+
return <Input {...props} />;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type { InputProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Kbd } from "@heroui/react";
|
|
2
|
+
import type { KbdProps } from "@heroui/react";
|
|
3
|
+
|
|
4
|
+
export interface HeroUIKbdProps extends KbdProps {}
|
|
5
|
+
|
|
6
|
+
export default function HeroUIKbd({ children, ...props }: HeroUIKbdProps) {
|
|
7
|
+
return <Kbd {...props}>{children}</Kbd>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { Kbd };
|
|
11
|
+
export type { KbdProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Modal } from "@heroui/react";
|
|
2
|
+
import type { ModalProps } from "@heroui/react";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* HeroUI v3 Modal — compound component.
|
|
@@ -25,8 +25,11 @@ import { Modal } from "@heroui/react";
|
|
|
25
25
|
* </Modal.Backdrop>
|
|
26
26
|
* </Modal>
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export interface HeroUIModalProps extends ModalProps {}
|
|
29
|
+
|
|
30
|
+
export default function HeroUIModal(props: HeroUIModalProps) {
|
|
29
31
|
return <Modal {...props} />;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
export { Modal };
|
|
35
|
+
export type { ModalProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Pagination } from "@heroui/react";
|
|
2
|
+
import type { PaginationProps } from "@heroui/react";
|
|
3
|
+
|
|
4
|
+
export interface HeroUIPaginationProps extends PaginationProps {}
|
|
5
|
+
|
|
6
|
+
export default function HeroUIPagination(props: HeroUIPaginationProps) {
|
|
7
|
+
return <Pagination {...props} />;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { Pagination };
|
|
11
|
+
export type { PaginationProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { ProgressBar } from "@heroui/react";
|
|
3
|
+
import type { ProgressBarProps } from "@heroui/react";
|
|
4
|
+
|
|
5
|
+
export interface HeroUIProgressBarProps extends ProgressBarProps {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function HeroUIProgressBar({ children, ...props }: HeroUIProgressBarProps) {
|
|
10
|
+
return <ProgressBar {...props}>{children}</ProgressBar>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ProgressBar };
|
|
14
|
+
export type { ProgressBarProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { ProgressCircle } from "@heroui/react";
|
|
3
|
+
import type { ProgressCircleProps } from "@heroui/react";
|
|
4
|
+
|
|
5
|
+
export interface HeroUIProgressCircleProps extends ProgressCircleProps {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function HeroUIProgressCircle({ children, ...props }: HeroUIProgressCircleProps) {
|
|
10
|
+
return <ProgressCircle {...props}>{children}</ProgressCircle>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ProgressCircle };
|
|
14
|
+
export type { ProgressCircleProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { ScrollShadow } from "@heroui/react";
|
|
3
|
+
import type { ScrollShadowProps } from "@heroui/react";
|
|
4
|
+
|
|
5
|
+
export interface HeroUIScrollShadowProps extends ScrollShadowProps {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function HeroUIScrollShadow({ children, ...props }: HeroUIScrollShadowProps) {
|
|
10
|
+
return <ScrollShadow {...props}>{children}</ScrollShadow>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ScrollShadow };
|
|
14
|
+
export type { ScrollShadowProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Separator } from "@heroui/react";
|
|
2
|
+
import type { SeparatorProps } from "@heroui/react";
|
|
3
|
+
|
|
4
|
+
export interface HeroUISeparatorProps extends SeparatorProps {}
|
|
5
|
+
|
|
6
|
+
export default function HeroUISeparator(props: HeroUISeparatorProps) {
|
|
7
|
+
return <Separator {...props} />;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { Separator };
|
|
11
|
+
export type { SeparatorProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Skeleton } from "@heroui/react";
|
|
3
|
+
import type { SkeletonProps } from "@heroui/react";
|
|
4
|
+
|
|
5
|
+
export interface HeroUISkeletonProps extends SkeletonProps {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function HeroUISkeleton({ children, ...props }: HeroUISkeletonProps) {
|
|
10
|
+
return <Skeleton {...props}>{children}</Skeleton>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { Skeleton };
|
|
14
|
+
export type { SkeletonProps };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Tabs } from "@heroui/react";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -19,8 +18,14 @@ import { Tabs } from "@heroui/react";
|
|
|
19
18
|
* <Tabs.Panel id="analytics">…</Tabs.Panel>
|
|
20
19
|
* </Tabs>
|
|
21
20
|
*/
|
|
22
|
-
export
|
|
23
|
-
|
|
21
|
+
export interface HeroUITabsProps {
|
|
22
|
+
variant?: string;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default function HeroUITabs({ variant = "primary", ...props }: HeroUITabsProps) {
|
|
27
|
+
const TabsAny = Tabs as any;
|
|
28
|
+
return <TabsAny variant={variant} {...props} />;
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
export { Tabs };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Toast, toast } from "@heroui/react";
|
|
2
|
+
import type { ToastProps } from "@heroui/react";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* HeroUI v3 Toast — notification system.
|
|
@@ -18,8 +18,11 @@ import { Toast, toast } from "@heroui/react";
|
|
|
18
18
|
* Toast.Title, Toast.Description, Toast.ActionButton,
|
|
19
19
|
* Toast.CloseButton
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export interface HeroUIToastProps extends ToastProps {}
|
|
22
|
+
|
|
23
|
+
export default function HeroUIToast(props: HeroUIToastProps) {
|
|
22
24
|
return <Toast {...props} />;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export { Toast, toast };
|
|
28
|
+
export type { ToastProps };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Switch } from "@heroui/react";
|
|
2
|
+
import type { SwitchProps } from "@heroui/react";
|
|
3
3
|
import { useThemeMode } from "../theme/AppThemeProvider";
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export interface HeroUIToggleProps extends Omit<SwitchProps, 'isSelected' | 'onChange'> {
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function HeroUIToggle({ label = "Dark mode", ...props }: HeroUIToggleProps) {
|
|
6
10
|
const { mode, toggle } = useThemeMode();
|
|
7
11
|
const isSelected = mode === "dark";
|
|
8
12
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Tooltip } from "@heroui/react";
|
|
2
|
+
import type { TooltipProps } from "@heroui/react";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* HeroUI v3 Tooltip — compound component.
|
|
@@ -14,8 +14,11 @@ import { Tooltip } from "@heroui/react";
|
|
|
14
14
|
* <Tooltip.Content>Helpful info</Tooltip.Content>
|
|
15
15
|
* </Tooltip>
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export interface HeroUITooltipProps extends TooltipProps {}
|
|
18
|
+
|
|
19
|
+
export default function HeroUITooltip(props: HeroUITooltipProps) {
|
|
18
20
|
return <Tooltip {...props} />;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export { Tooltip };
|
|
24
|
+
export type { TooltipProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
3
|
const TONE_STYLES = {
|
|
4
4
|
neutral:
|
|
@@ -11,20 +11,25 @@ const TONE_STYLES = {
|
|
|
11
11
|
"border-amber-200/80 bg-amber-50/70 text-amber-900 ring-amber-900/5 hover:bg-amber-50 dark:border-amber-900/40 dark:bg-amber-950/20 dark:text-amber-200 dark:ring-amber-300/10 dark:hover:bg-amber-950/30",
|
|
12
12
|
danger:
|
|
13
13
|
"border-rose-200/80 bg-rose-50/70 text-rose-900 ring-rose-900/5 hover:bg-rose-50 dark:border-rose-900/40 dark:bg-rose-950/20 dark:text-rose-200 dark:ring-rose-300/10 dark:hover:bg-rose-950/30"
|
|
14
|
-
};
|
|
14
|
+
} as const;
|
|
15
15
|
|
|
16
16
|
const SIZE_STYLES = {
|
|
17
17
|
xs: "px-2 py-0.5 text-[11px]",
|
|
18
18
|
sm: "px-2.5 py-1 text-xs"
|
|
19
|
-
};
|
|
19
|
+
} as const;
|
|
20
20
|
|
|
21
|
-
export
|
|
21
|
+
export interface UIChipProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
22
|
+
tone?: keyof typeof TONE_STYLES;
|
|
23
|
+
size?: keyof typeof SIZE_STYLES;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default function UIChip({ tone = "neutral", size = "xs", className = "", children, ...rest }: UIChipProps) {
|
|
22
27
|
return (
|
|
23
28
|
<span
|
|
24
29
|
className={[
|
|
25
30
|
"inline-flex items-center gap-1 rounded-full border font-semibold shadow-sm ring-1 transition",
|
|
26
|
-
SIZE_STYLES[size]
|
|
27
|
-
TONE_STYLES[tone]
|
|
31
|
+
SIZE_STYLES[size],
|
|
32
|
+
TONE_STYLES[tone],
|
|
28
33
|
className
|
|
29
34
|
]
|
|
30
35
|
.filter(Boolean)
|
|
@@ -35,4 +40,3 @@ export default function UIChip({ tone = "neutral", size = "xs", className = "",
|
|
|
35
40
|
</span>
|
|
36
41
|
);
|
|
37
42
|
}
|
|
38
|
-
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import UIText from "./Text";
|
|
3
3
|
|
|
4
|
+
export interface UIContainerProps extends React.HTMLAttributes<HTMLElement> {
|
|
5
|
+
title?: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
actions?: React.ReactNode;
|
|
9
|
+
empty?: boolean;
|
|
10
|
+
emptyText?: string;
|
|
11
|
+
emptyIcon?: React.ReactNode;
|
|
12
|
+
emptyHeight?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
4
15
|
export default function UIContainer({
|
|
5
16
|
title,
|
|
6
17
|
subtitle,
|
|
@@ -13,7 +24,7 @@ export default function UIContainer({
|
|
|
13
24
|
className = "",
|
|
14
25
|
style,
|
|
15
26
|
children
|
|
16
|
-
}) {
|
|
27
|
+
}: UIContainerProps) {
|
|
17
28
|
const sub = subtitle ?? description;
|
|
18
29
|
|
|
19
30
|
return (
|
|
@@ -52,5 +63,3 @@ export default function UIContainer({
|
|
|
52
63
|
</section>
|
|
53
64
|
);
|
|
54
65
|
}
|
|
55
|
-
|
|
56
|
-
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export interface FieldGroupProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
4
|
+
|
|
5
|
+
export default function FieldGroup({ className = "", children, ...rest }: FieldGroupProps) {
|
|
4
6
|
return (
|
|
5
7
|
<div
|
|
6
8
|
className={[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
3
|
const SIZE_CLASSES = {
|
|
4
4
|
xs: "text-xs",
|
|
@@ -7,30 +7,39 @@ const SIZE_CLASSES = {
|
|
|
7
7
|
lg: "text-lg",
|
|
8
8
|
xl: "text-xl",
|
|
9
9
|
xxl: "text-2xl"
|
|
10
|
-
};
|
|
10
|
+
} as const;
|
|
11
11
|
|
|
12
12
|
const WEIGHT_CLASSES = {
|
|
13
13
|
regular: "font-normal",
|
|
14
14
|
medium: "font-medium",
|
|
15
15
|
bold: "font-semibold"
|
|
16
|
-
};
|
|
16
|
+
} as const;
|
|
17
17
|
|
|
18
|
-
export
|
|
19
|
-
as
|
|
18
|
+
export interface UITextProps<T extends React.ElementType = "span"> {
|
|
19
|
+
as?: T;
|
|
20
|
+
size?: keyof typeof SIZE_CLASSES;
|
|
21
|
+
weight?: keyof typeof WEIGHT_CLASSES;
|
|
22
|
+
muted?: boolean;
|
|
23
|
+
className?: string;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default function UIText<T extends React.ElementType = "span">({
|
|
28
|
+
as,
|
|
20
29
|
size = "md",
|
|
21
30
|
weight = "regular",
|
|
22
31
|
muted = false,
|
|
23
|
-
style,
|
|
24
32
|
className = "",
|
|
25
33
|
children,
|
|
26
34
|
...rest
|
|
27
|
-
}) {
|
|
35
|
+
}: UITextProps<T> & Omit<React.ComponentPropsWithoutRef<T>, keyof UITextProps<T>>) {
|
|
36
|
+
const Comp = as || "span";
|
|
37
|
+
|
|
28
38
|
return (
|
|
29
39
|
<Comp
|
|
30
|
-
style={style}
|
|
31
40
|
className={[
|
|
32
|
-
SIZE_CLASSES[size]
|
|
33
|
-
WEIGHT_CLASSES[weight]
|
|
41
|
+
SIZE_CLASSES[size],
|
|
42
|
+
WEIGHT_CLASSES[weight],
|
|
34
43
|
muted ? "text-slate-600 dark:text-slate-300" : "text-slate-900 dark:text-slate-50",
|
|
35
44
|
className
|
|
36
45
|
]
|
|
@@ -42,5 +51,3 @@ export default function UIText({
|
|
|
42
51
|
</Comp>
|
|
43
52
|
);
|
|
44
53
|
}
|
|
45
|
-
|
|
46
|
-
|