@timmbr/native-ui 0.0.0-stage → 1.0.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/dist/components/Actionsheet/Actionsheet.d.ts +12 -0
- package/dist/components/Actionsheet/Actionsheet.d.ts.map +1 -0
- package/dist/components/Actionsheet/Actionsheet.js +116 -0
- package/dist/components/Actionsheet/Actionsheet.styles.d.ts +43 -0
- package/dist/components/Actionsheet/Actionsheet.styles.d.ts.map +1 -0
- package/dist/components/Actionsheet/Actionsheet.styles.js +25 -0
- package/dist/components/Actionsheet/Actionsheet.types.d.ts +39 -0
- package/dist/components/Actionsheet/Actionsheet.types.d.ts.map +1 -0
- package/dist/components/Actionsheet/index.d.ts +4 -0
- package/dist/components/Actionsheet/index.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +8 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.js +66 -0
- package/dist/components/Avatar/Avatar.styles.d.ts +25 -0
- package/dist/components/Avatar/Avatar.styles.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.styles.js +29 -0
- package/dist/components/Avatar/Avatar.types.d.ts +21 -0
- package/dist/components/Avatar/Avatar.types.d.ts.map +1 -0
- package/dist/components/Avatar/index.d.ts +4 -0
- package/dist/components/Avatar/index.d.ts.map +1 -0
- package/dist/components/Badge/Badge.d.ts +7 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/Badge.js +73 -0
- package/dist/components/Badge/Badge.styles.d.ts +15 -0
- package/dist/components/Badge/Badge.styles.d.ts.map +1 -0
- package/dist/components/Badge/Badge.styles.js +71 -0
- package/dist/components/Badge/Badge.types.d.ts +25 -0
- package/dist/components/Badge/Badge.types.d.ts.map +1 -0
- package/dist/components/Badge/index.d.ts +4 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Box/Box.d.ts +4 -0
- package/dist/components/Box/Box.d.ts.map +1 -0
- package/dist/components/Box/Box.js +26 -0
- package/dist/components/Box/Box.styles.d.ts +7 -0
- package/dist/components/Box/Box.styles.d.ts.map +1 -0
- package/dist/components/Box/Box.styles.js +7 -0
- package/dist/components/Box/Box.types.d.ts +8 -0
- package/dist/components/Box/Box.types.d.ts.map +1 -0
- package/dist/components/Box/index.d.ts +4 -0
- package/dist/components/Box/index.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts +9 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.js +169 -0
- package/dist/components/Button/Button.styles.d.ts +30 -0
- package/dist/components/Button/Button.styles.d.ts.map +1 -0
- package/dist/components/Button/Button.styles.js +106 -0
- package/dist/components/Button/Button.types.d.ts +41 -0
- package/dist/components/Button/Button.types.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +4 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Card/Card.d.ts +8 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Card/Card.js +50 -0
- package/dist/components/Card/Card.styles.d.ts +26 -0
- package/dist/components/Card/Card.styles.d.ts.map +1 -0
- package/dist/components/Card/Card.styles.js +32 -0
- package/dist/components/Card/Card.types.d.ts +26 -0
- package/dist/components/Card/Card.types.d.ts.map +1 -0
- package/dist/components/Card/index.d.ts +4 -0
- package/dist/components/Card/index.d.ts.map +1 -0
- package/dist/components/Divider/Divider.d.ts +4 -0
- package/dist/components/Divider/Divider.d.ts.map +1 -0
- package/dist/components/Divider/Divider.js +22 -0
- package/dist/components/Divider/Divider.styles.d.ts +7 -0
- package/dist/components/Divider/Divider.styles.d.ts.map +1 -0
- package/dist/components/Divider/Divider.styles.js +16 -0
- package/dist/components/Divider/Divider.types.d.ts +7 -0
- package/dist/components/Divider/Divider.types.d.ts.map +1 -0
- package/dist/components/Divider/index.d.ts +4 -0
- package/dist/components/Divider/index.d.ts.map +1 -0
- package/dist/components/HStack/HStack.d.ts +4 -0
- package/dist/components/HStack/HStack.d.ts.map +1 -0
- package/dist/components/HStack/HStack.js +21 -0
- package/dist/components/HStack/HStack.styles.d.ts +8 -0
- package/dist/components/HStack/HStack.styles.d.ts.map +1 -0
- package/dist/components/HStack/HStack.styles.js +28 -0
- package/dist/components/HStack/HStack.types.d.ts +9 -0
- package/dist/components/HStack/HStack.types.d.ts.map +1 -0
- package/dist/components/HStack/index.d.ts +4 -0
- package/dist/components/HStack/index.d.ts.map +1 -0
- package/dist/components/Heading/Heading.d.ts +4 -0
- package/dist/components/Heading/Heading.d.ts.map +1 -0
- package/dist/components/Heading/Heading.js +22 -0
- package/dist/components/Heading/Heading.styles.d.ts +8 -0
- package/dist/components/Heading/Heading.styles.d.ts.map +1 -0
- package/dist/components/Heading/Heading.styles.js +28 -0
- package/dist/components/Heading/Heading.types.d.ts +10 -0
- package/dist/components/Heading/Heading.types.d.ts.map +1 -0
- package/dist/components/Heading/index.d.ts +4 -0
- package/dist/components/Heading/index.d.ts.map +1 -0
- package/dist/components/Icon/Icon.d.ts +4 -0
- package/dist/components/Icon/Icon.d.ts.map +1 -0
- package/dist/components/Icon/Icon.js +37 -0
- package/dist/components/Icon/Icon.styles.d.ts +7 -0
- package/dist/components/Icon/Icon.styles.d.ts.map +1 -0
- package/dist/components/Icon/Icon.styles.js +20 -0
- package/dist/components/Icon/Icon.types.d.ts +9 -0
- package/dist/components/Icon/Icon.types.d.ts.map +1 -0
- package/dist/components/Icon/index.d.ts +4 -0
- package/dist/components/Icon/index.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +8 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/Input.js +105 -0
- package/dist/components/Input/Input.styles.d.ts +23 -0
- package/dist/components/Input/Input.styles.d.ts.map +1 -0
- package/dist/components/Input/Input.styles.js +56 -0
- package/dist/components/Input/Input.types.d.ts +32 -0
- package/dist/components/Input/Input.types.d.ts.map +1 -0
- package/dist/components/Input/index.d.ts +4 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Modal/Modal.d.ts +11 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/Modal.js +102 -0
- package/dist/components/Modal/Modal.styles.d.ts +43 -0
- package/dist/components/Modal/Modal.styles.d.ts.map +1 -0
- package/dist/components/Modal/Modal.styles.js +37 -0
- package/dist/components/Modal/Modal.types.d.ts +38 -0
- package/dist/components/Modal/Modal.types.d.ts.map +1 -0
- package/dist/components/Modal/index.d.ts +4 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/Pressable/Pressable.d.ts +4 -0
- package/dist/components/Pressable/Pressable.d.ts.map +1 -0
- package/dist/components/Pressable/Pressable.js +43 -0
- package/dist/components/Pressable/Pressable.styles.d.ts +7 -0
- package/dist/components/Pressable/Pressable.styles.d.ts.map +1 -0
- package/dist/components/Pressable/Pressable.styles.js +16 -0
- package/dist/components/Pressable/Pressable.types.d.ts +9 -0
- package/dist/components/Pressable/Pressable.types.d.ts.map +1 -0
- package/dist/components/Pressable/index.d.ts +4 -0
- package/dist/components/Pressable/index.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.d.ts +4 -0
- package/dist/components/Spinner/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.js +52 -0
- package/dist/components/Spinner/Spinner.styles.d.ts +7 -0
- package/dist/components/Spinner/Spinner.styles.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.styles.js +20 -0
- package/dist/components/Spinner/Spinner.types.d.ts +8 -0
- package/dist/components/Spinner/Spinner.types.d.ts.map +1 -0
- package/dist/components/Spinner/index.d.ts +4 -0
- package/dist/components/Spinner/index.d.ts.map +1 -0
- package/dist/components/Switch/Switch.d.ts +4 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -0
- package/dist/components/Switch/Switch.js +56 -0
- package/dist/components/Switch/Switch.styles.d.ts +16 -0
- package/dist/components/Switch/Switch.styles.d.ts.map +1 -0
- package/dist/components/Switch/Switch.styles.js +50 -0
- package/dist/components/Switch/Switch.types.d.ts +11 -0
- package/dist/components/Switch/Switch.types.d.ts.map +1 -0
- package/dist/components/Switch/index.d.ts +4 -0
- package/dist/components/Switch/index.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +9 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.js +109 -0
- package/dist/components/Tabs/Tabs.styles.d.ts +31 -0
- package/dist/components/Tabs/Tabs.styles.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.styles.js +37 -0
- package/dist/components/Tabs/Tabs.types.d.ts +31 -0
- package/dist/components/Tabs/Tabs.types.d.ts.map +1 -0
- package/dist/components/Tabs/index.d.ts +4 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Text/Text.d.ts +4 -0
- package/dist/components/Text/Text.d.ts.map +1 -0
- package/dist/components/Text/Text.js +29 -0
- package/dist/components/Text/Text.styles.d.ts +9 -0
- package/dist/components/Text/Text.styles.d.ts.map +1 -0
- package/dist/components/Text/Text.styles.js +35 -0
- package/dist/components/Text/Text.types.d.ts +11 -0
- package/dist/components/Text/Text.types.d.ts.map +1 -0
- package/dist/components/Text/index.d.ts +4 -0
- package/dist/components/Text/index.d.ts.map +1 -0
- package/dist/components/Textarea/Textarea.d.ts +6 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea/Textarea.js +66 -0
- package/dist/components/Textarea/Textarea.styles.d.ts +16 -0
- package/dist/components/Textarea/Textarea.styles.d.ts.map +1 -0
- package/dist/components/Textarea/Textarea.styles.js +47 -0
- package/dist/components/Textarea/Textarea.types.d.ts +20 -0
- package/dist/components/Textarea/Textarea.types.d.ts.map +1 -0
- package/dist/components/Textarea/index.d.ts +4 -0
- package/dist/components/Textarea/index.d.ts.map +1 -0
- package/dist/components/Toast/Toast.d.ts +7 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/Toast.js +39 -0
- package/dist/components/Toast/Toast.styles.d.ts +20 -0
- package/dist/components/Toast/Toast.styles.d.ts.map +1 -0
- package/dist/components/Toast/Toast.styles.js +42 -0
- package/dist/components/Toast/Toast.types.d.ts +22 -0
- package/dist/components/Toast/Toast.types.d.ts.map +1 -0
- package/dist/components/Toast/index.d.ts +4 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/VStack/VStack.d.ts +4 -0
- package/dist/components/VStack/VStack.d.ts.map +1 -0
- package/dist/components/VStack/VStack.js +21 -0
- package/dist/components/VStack/VStack.styles.d.ts +8 -0
- package/dist/components/VStack/VStack.styles.d.ts.map +1 -0
- package/dist/components/VStack/VStack.styles.js +28 -0
- package/dist/components/VStack/VStack.types.d.ts +9 -0
- package/dist/components/VStack/VStack.types.d.ts.map +1 -0
- package/dist/components/VStack/index.d.ts +4 -0
- package/dist/components/VStack/index.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/provider/TimmbrNativeProvider.d.ts +21 -0
- package/dist/provider/TimmbrNativeProvider.d.ts.map +1 -0
- package/dist/provider/TimmbrNativeProvider.js +110 -0
- package/dist/theme/config.d.ts +360 -0
- package/dist/theme/config.d.ts.map +1 -0
- package/dist/theme/config.js +129 -0
- package/package.json +70 -3
- package/src/native/index.tsx +799 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,eAAO,MAAM,GAAG,iFAkBf,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { boxStyle } from './Box.styles.js';
|
|
4
|
+
import { cn } from '@timmbr/utils';
|
|
5
|
+
|
|
6
|
+
const Box = React.forwardRef(
|
|
7
|
+
({ className, children, onPress, onClick, as: Component = "div", ...props }, ref) => {
|
|
8
|
+
const handleClick = (e) => {
|
|
9
|
+
onPress?.(e);
|
|
10
|
+
onClick?.(e);
|
|
11
|
+
};
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
Component,
|
|
14
|
+
{
|
|
15
|
+
ref,
|
|
16
|
+
className: cn(boxStyle(), className),
|
|
17
|
+
onClick: handleClick,
|
|
18
|
+
...props,
|
|
19
|
+
children
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
Box.displayName = "Box";
|
|
25
|
+
|
|
26
|
+
export { Box };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Box/Box.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;;;yBAEnB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
onPress?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=Box.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.types.d.ts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,QAAS,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC5D,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ButtonProps, ButtonTextProps, ButtonIconProps, ButtonSpinnerProps, ButtonGroupProps, ButtonContextValue } from './Button.types';
|
|
3
|
+
export declare const useButtonContext: () => ButtonContextValue;
|
|
4
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const ButtonText: React.ForwardRefExoticComponent<ButtonTextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
export declare const ButtonIcon: React.ForwardRefExoticComponent<ButtonIconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
export declare const ButtonSpinner: React.ForwardRefExoticComponent<ButtonSpinnerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
export declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAUxB,eAAO,MAAM,gBAAgB,0BAAwC,CAAC;AAEtE,eAAO,MAAM,MAAM,uFA8DlB,CAAC;AAIF,eAAO,MAAM,UAAU,yFAatB,CAAC;AAIF,eAAO,MAAM,UAAU,yFAatB,CAAC;AAIF,eAAO,MAAM,aAAa,4FAiCzB,CAAC;AAIF,eAAO,MAAM,WAAW,yFAuBvB,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { buttonStyle, buttonGroupStyle, buttonIconStyle, buttonTextStyle } from './Button.styles.js';
|
|
4
|
+
import { cn } from '@timmbr/utils';
|
|
5
|
+
|
|
6
|
+
const ButtonContext = React.createContext({
|
|
7
|
+
action: "primary",
|
|
8
|
+
variant: "solid",
|
|
9
|
+
size: "md",
|
|
10
|
+
isDisabled: false
|
|
11
|
+
});
|
|
12
|
+
const useButtonContext = () => React.useContext(ButtonContext);
|
|
13
|
+
const Button = React.forwardRef(
|
|
14
|
+
({
|
|
15
|
+
action = "primary",
|
|
16
|
+
variant = "solid",
|
|
17
|
+
size = "md",
|
|
18
|
+
isDisabled = false,
|
|
19
|
+
isLoading = false,
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
onPress,
|
|
23
|
+
onClick,
|
|
24
|
+
disabled,
|
|
25
|
+
type = "button",
|
|
26
|
+
...props
|
|
27
|
+
}, ref) => {
|
|
28
|
+
const isActuallyDisabled = isDisabled || isLoading || disabled;
|
|
29
|
+
const handleClick = (e) => {
|
|
30
|
+
if (isActuallyDisabled) {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
onPress?.(e);
|
|
35
|
+
onClick?.(e);
|
|
36
|
+
};
|
|
37
|
+
const contextValue = React.useMemo(
|
|
38
|
+
() => ({
|
|
39
|
+
action,
|
|
40
|
+
variant,
|
|
41
|
+
size,
|
|
42
|
+
isDisabled: isActuallyDisabled
|
|
43
|
+
}),
|
|
44
|
+
[action, variant, size, isActuallyDisabled]
|
|
45
|
+
);
|
|
46
|
+
return /* @__PURE__ */ jsx(ButtonContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
type,
|
|
51
|
+
disabled: isActuallyDisabled,
|
|
52
|
+
"aria-disabled": isActuallyDisabled,
|
|
53
|
+
"data-action": action,
|
|
54
|
+
"data-variant": variant,
|
|
55
|
+
"data-size": size,
|
|
56
|
+
className: cn(
|
|
57
|
+
buttonStyle({ action, variant, size, isDisabled: isActuallyDisabled }),
|
|
58
|
+
className
|
|
59
|
+
),
|
|
60
|
+
onClick: handleClick,
|
|
61
|
+
...props,
|
|
62
|
+
children: [
|
|
63
|
+
isLoading && /* @__PURE__ */ jsx(ButtonSpinner, {}),
|
|
64
|
+
children
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
) });
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
Button.displayName = "Button";
|
|
71
|
+
const ButtonText = React.forwardRef(
|
|
72
|
+
({ className, children, ...props }, ref) => {
|
|
73
|
+
const { size } = useButtonContext();
|
|
74
|
+
return /* @__PURE__ */ jsx(
|
|
75
|
+
"span",
|
|
76
|
+
{
|
|
77
|
+
ref,
|
|
78
|
+
className: cn(buttonTextStyle({ size }), className),
|
|
79
|
+
...props,
|
|
80
|
+
children
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
ButtonText.displayName = "ButtonText";
|
|
86
|
+
const ButtonIcon = React.forwardRef(
|
|
87
|
+
({ as: Component, className, size: iconSizeProp, children, ...props }, ref) => {
|
|
88
|
+
const { size } = useButtonContext();
|
|
89
|
+
return /* @__PURE__ */ jsx(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
ref,
|
|
93
|
+
className: cn(buttonIconStyle({ size }), className),
|
|
94
|
+
...props,
|
|
95
|
+
children: Component ? /* @__PURE__ */ jsx(Component, { size: iconSizeProp }) : children
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
ButtonIcon.displayName = "ButtonIcon";
|
|
101
|
+
const ButtonSpinner = React.forwardRef(
|
|
102
|
+
({ className, color = "currentColor", ...props }, ref) => {
|
|
103
|
+
return /* @__PURE__ */ jsx(
|
|
104
|
+
"span",
|
|
105
|
+
{
|
|
106
|
+
ref,
|
|
107
|
+
role: "status",
|
|
108
|
+
"aria-label": "Loading",
|
|
109
|
+
className: cn("inline-block animate-spin shrink-0 size-4", className),
|
|
110
|
+
...props,
|
|
111
|
+
children: /* @__PURE__ */ jsxs(
|
|
112
|
+
"svg",
|
|
113
|
+
{
|
|
114
|
+
className: "size-full",
|
|
115
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
116
|
+
fill: "none",
|
|
117
|
+
viewBox: "0 0 24 24",
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
"circle",
|
|
121
|
+
{
|
|
122
|
+
className: "opacity-25",
|
|
123
|
+
cx: "12",
|
|
124
|
+
cy: "12",
|
|
125
|
+
r: "10",
|
|
126
|
+
stroke: color,
|
|
127
|
+
strokeWidth: "4"
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ jsx(
|
|
131
|
+
"path",
|
|
132
|
+
{
|
|
133
|
+
className: "opacity-75",
|
|
134
|
+
fill: color,
|
|
135
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
ButtonSpinner.displayName = "ButtonSpinner";
|
|
146
|
+
const ButtonGroup = React.forwardRef(
|
|
147
|
+
({
|
|
148
|
+
space = "md",
|
|
149
|
+
isAttached = false,
|
|
150
|
+
reversed = false,
|
|
151
|
+
className,
|
|
152
|
+
children,
|
|
153
|
+
...props
|
|
154
|
+
}, ref) => {
|
|
155
|
+
return /* @__PURE__ */ jsx(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
ref,
|
|
159
|
+
role: "group",
|
|
160
|
+
className: cn(buttonGroupStyle({ space, isAttached, reversed }), className),
|
|
161
|
+
...props,
|
|
162
|
+
children
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
ButtonGroup.displayName = "ButtonGroup";
|
|
168
|
+
|
|
169
|
+
export { Button, ButtonGroup, ButtonIcon, ButtonSpinner, ButtonText, useButtonContext };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const buttonStyle: (props?: ({
|
|
2
|
+
action?: string | boolean | undefined;
|
|
3
|
+
variant?: string | boolean | undefined;
|
|
4
|
+
size?: string | boolean | undefined;
|
|
5
|
+
isDisabled?: string | boolean | undefined;
|
|
6
|
+
} & {
|
|
7
|
+
class?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}) | undefined) => string;
|
|
10
|
+
export declare const buttonTextStyle: (props?: ({
|
|
11
|
+
size?: string | boolean | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
class?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}) | undefined) => string;
|
|
16
|
+
export declare const buttonIconStyle: (props?: ({
|
|
17
|
+
size?: string | boolean | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
class?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
}) | undefined) => string;
|
|
22
|
+
export declare const buttonGroupStyle: (props?: ({
|
|
23
|
+
space?: string | boolean | undefined;
|
|
24
|
+
isAttached?: string | boolean | undefined;
|
|
25
|
+
reversed?: string | boolean | undefined;
|
|
26
|
+
} & {
|
|
27
|
+
class?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
}) | undefined) => string;
|
|
30
|
+
//# sourceMappingURL=Button.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;yBAqDtB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;yBAa1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;yBAa1B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;yBAuB3B,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { tva } from '../../theme/config.js';
|
|
2
|
+
|
|
3
|
+
const buttonStyle = tva({
|
|
4
|
+
base: "inline-flex items-center justify-center font-sans font-medium transition-colors select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98]",
|
|
5
|
+
variants: {
|
|
6
|
+
action: {
|
|
7
|
+
primary: "",
|
|
8
|
+
secondary: "",
|
|
9
|
+
positive: "",
|
|
10
|
+
negative: "",
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
variant: {
|
|
14
|
+
solid: "",
|
|
15
|
+
outline: "bg-transparent border",
|
|
16
|
+
link: "bg-transparent underline-offset-4 hover:underline p-0 h-auto active:scale-100"
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
xs: "h-8 px-2.5 text-xs gap-1.5 rounded",
|
|
20
|
+
sm: "h-9 px-3 text-xs gap-2 rounded-md",
|
|
21
|
+
md: "h-10 px-4 text-sm gap-2 rounded-md",
|
|
22
|
+
lg: "h-11 px-5 text-base gap-2.5 rounded-lg"
|
|
23
|
+
},
|
|
24
|
+
isDisabled: {
|
|
25
|
+
true: "opacity-50 pointer-events-none cursor-not-allowed",
|
|
26
|
+
false: ""
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
compoundVariants: [
|
|
30
|
+
{ action: "primary", variant: "solid", class: "bg-primary text-primary-foreground hover:bg-primary/90" },
|
|
31
|
+
{ action: "primary", variant: "outline", class: "border-primary text-primary hover:bg-primary/10" },
|
|
32
|
+
{ action: "primary", variant: "link", class: "text-primary" },
|
|
33
|
+
{ action: "secondary", variant: "solid", class: "bg-secondary text-secondary-foreground hover:bg-secondary/80" },
|
|
34
|
+
{ action: "secondary", variant: "outline", class: "border-secondary-foreground/20 text-secondary-foreground hover:bg-secondary/20" },
|
|
35
|
+
{ action: "secondary", variant: "link", class: "text-secondary-foreground" },
|
|
36
|
+
{ action: "positive", variant: "solid", class: "bg-success text-white hover:bg-success/90" },
|
|
37
|
+
{ action: "positive", variant: "outline", class: "border-success text-success hover:bg-success/10" },
|
|
38
|
+
{ action: "positive", variant: "link", class: "text-success" },
|
|
39
|
+
{ action: "negative", variant: "solid", class: "bg-destructive text-destructive-foreground hover:bg-destructive/90" },
|
|
40
|
+
{ action: "negative", variant: "outline", class: "border-destructive text-destructive hover:bg-destructive/10" },
|
|
41
|
+
{ action: "negative", variant: "link", class: "text-destructive" },
|
|
42
|
+
{ action: "default", variant: "solid", class: "bg-muted text-foreground hover:bg-muted/80" },
|
|
43
|
+
{ action: "default", variant: "outline", class: "border-border text-foreground hover:bg-muted/30" },
|
|
44
|
+
{ action: "default", variant: "link", class: "text-foreground" }
|
|
45
|
+
],
|
|
46
|
+
defaultVariants: {
|
|
47
|
+
action: "primary",
|
|
48
|
+
variant: "solid",
|
|
49
|
+
size: "md",
|
|
50
|
+
isDisabled: false
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const buttonTextStyle = tva({
|
|
54
|
+
base: "font-medium leading-none select-none",
|
|
55
|
+
variants: {
|
|
56
|
+
size: {
|
|
57
|
+
xs: "text-xs",
|
|
58
|
+
sm: "text-xs",
|
|
59
|
+
md: "text-sm",
|
|
60
|
+
lg: "text-base"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
defaultVariants: {
|
|
64
|
+
size: "md"
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const buttonIconStyle = tva({
|
|
68
|
+
base: "shrink-0",
|
|
69
|
+
variants: {
|
|
70
|
+
size: {
|
|
71
|
+
xs: "size-3.5",
|
|
72
|
+
sm: "size-4",
|
|
73
|
+
md: "size-4",
|
|
74
|
+
lg: "size-5"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
defaultVariants: {
|
|
78
|
+
size: "md"
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const buttonGroupStyle = tva({
|
|
82
|
+
base: "inline-flex items-center",
|
|
83
|
+
variants: {
|
|
84
|
+
space: {
|
|
85
|
+
xs: "gap-1",
|
|
86
|
+
sm: "gap-2",
|
|
87
|
+
md: "gap-3",
|
|
88
|
+
lg: "gap-4"
|
|
89
|
+
},
|
|
90
|
+
isAttached: {
|
|
91
|
+
true: "gap-0 [&>button:not(:first-child)]:rounded-l-none [&>button:not(:last-child)]:rounded-r-none [&>button:not(:first-child)]:-ml-[1px]",
|
|
92
|
+
false: ""
|
|
93
|
+
},
|
|
94
|
+
reversed: {
|
|
95
|
+
true: "flex-row-reverse",
|
|
96
|
+
false: "flex-row"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
defaultVariants: {
|
|
100
|
+
space: "md",
|
|
101
|
+
isAttached: false,
|
|
102
|
+
reversed: false
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export { buttonGroupStyle, buttonIconStyle, buttonStyle, buttonTextStyle };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type ButtonAction = 'primary' | 'secondary' | 'positive' | 'negative' | 'default';
|
|
3
|
+
export type ButtonVariant = 'solid' | 'outline' | 'link';
|
|
4
|
+
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
+
export interface ButtonContextValue {
|
|
6
|
+
action?: ButtonAction;
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
12
|
+
action?: ButtonAction;
|
|
13
|
+
variant?: ButtonVariant;
|
|
14
|
+
size?: ButtonSize;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isLoading?: boolean;
|
|
17
|
+
onPress?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export interface ButtonTextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
22
|
+
className?: string;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export interface ButtonIconProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
26
|
+
as?: React.ElementType;
|
|
27
|
+
className?: string;
|
|
28
|
+
size?: number | string;
|
|
29
|
+
}
|
|
30
|
+
export interface ButtonSpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
31
|
+
className?: string;
|
|
32
|
+
color?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
35
|
+
space?: 'xs' | 'sm' | 'md' | 'lg';
|
|
36
|
+
isAttached?: boolean;
|
|
37
|
+
reversed?: boolean;
|
|
38
|
+
className?: string;
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=Button.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AACzF,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AACzD,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAChF,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IAC5E,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { CardProps, CardHeaderProps, CardBodyProps, CardFooterProps, CardContextValue } from './Card.types';
|
|
3
|
+
export declare const useCardContext: () => CardContextValue;
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const CardBody: React.ForwardRefExoticComponent<CardBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const CardFooter: React.ForwardRefExoticComponent<CardFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,aAAa,EACb,eAAe,EACf,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAQtB,eAAO,MAAM,cAAc,wBAAsC,CAAC;AAElE,eAAO,MAAM,IAAI,kFAqBhB,CAAC;AAIF,eAAO,MAAM,UAAU,wFAQtB,CAAC;AAIF,eAAO,MAAM,QAAQ,sFAQpB,CAAC;AAIF,eAAO,MAAM,UAAU,wFAQtB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cardStyle, cardBodyStyle, cardFooterStyle, cardHeaderStyle } from './Card.styles.js';
|
|
4
|
+
import { cn } from '@timmbr/utils';
|
|
5
|
+
|
|
6
|
+
const CardContext = React.createContext({
|
|
7
|
+
size: "md",
|
|
8
|
+
variant: "elevated"
|
|
9
|
+
});
|
|
10
|
+
const useCardContext = () => React.useContext(CardContext);
|
|
11
|
+
const Card = React.forwardRef(
|
|
12
|
+
({ size = "md", variant = "elevated", className, children, ...props }, ref) => {
|
|
13
|
+
const contextValue = React.useMemo(
|
|
14
|
+
() => ({ size, variant }),
|
|
15
|
+
[size, variant]
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ jsx(CardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
ref,
|
|
21
|
+
"data-size": size,
|
|
22
|
+
"data-variant": variant,
|
|
23
|
+
className: cn(cardStyle({ size, variant }), className),
|
|
24
|
+
...props,
|
|
25
|
+
children
|
|
26
|
+
}
|
|
27
|
+
) });
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
Card.displayName = "Card";
|
|
31
|
+
const CardHeader = React.forwardRef(
|
|
32
|
+
({ className, children, ...props }, ref) => {
|
|
33
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(cardHeaderStyle(), className), ...props, children });
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
CardHeader.displayName = "CardHeader";
|
|
37
|
+
const CardBody = React.forwardRef(
|
|
38
|
+
({ className, children, ...props }, ref) => {
|
|
39
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(cardBodyStyle(), className), ...props, children });
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
CardBody.displayName = "CardBody";
|
|
43
|
+
const CardFooter = React.forwardRef(
|
|
44
|
+
({ className, children, ...props }, ref) => {
|
|
45
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(cardFooterStyle(), className), ...props, children });
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
CardFooter.displayName = "CardFooter";
|
|
49
|
+
|
|
50
|
+
export { Card, CardBody, CardFooter, CardHeader, useCardContext };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const cardStyle: (props?: ({
|
|
2
|
+
size?: string | boolean | undefined;
|
|
3
|
+
variant?: string | boolean | undefined;
|
|
4
|
+
} & {
|
|
5
|
+
class?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}) | undefined) => string;
|
|
8
|
+
export declare const cardHeaderStyle: (props?: ({
|
|
9
|
+
[x: string]: string | boolean | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
class?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}) | undefined) => string;
|
|
14
|
+
export declare const cardBodyStyle: (props?: ({
|
|
15
|
+
[x: string]: string | boolean | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
class?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
}) | undefined) => string;
|
|
20
|
+
export declare const cardFooterStyle: (props?: ({
|
|
21
|
+
[x: string]: string | boolean | undefined;
|
|
22
|
+
} & {
|
|
23
|
+
class?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}) | undefined) => string;
|
|
26
|
+
//# sourceMappingURL=Card.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;yBAkBpB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;yBAE1B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;yBAExB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;yBAE1B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { tva } from '../../theme/config.js';
|
|
2
|
+
|
|
3
|
+
const cardStyle = tva({
|
|
4
|
+
base: "rounded-xl bg-card text-card-foreground transition-shadow",
|
|
5
|
+
variants: {
|
|
6
|
+
size: {
|
|
7
|
+
sm: "p-3",
|
|
8
|
+
md: "p-4",
|
|
9
|
+
lg: "p-6"
|
|
10
|
+
},
|
|
11
|
+
variant: {
|
|
12
|
+
elevated: "shadow-sm border border-border/40",
|
|
13
|
+
outline: "border border-border shadow-none",
|
|
14
|
+
ghost: "bg-transparent shadow-none border-none"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
size: "md",
|
|
19
|
+
variant: "elevated"
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const cardHeaderStyle = tva({
|
|
23
|
+
base: "flex flex-col space-y-1.5 pb-2"
|
|
24
|
+
});
|
|
25
|
+
const cardBodyStyle = tva({
|
|
26
|
+
base: "flex-1 py-1 text-sm text-muted-foreground"
|
|
27
|
+
});
|
|
28
|
+
const cardFooterStyle = tva({
|
|
29
|
+
base: "flex items-center pt-3"
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { cardBodyStyle, cardFooterStyle, cardHeaderStyle, cardStyle };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type CardSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export type CardVariant = 'elevated' | 'outline' | 'ghost';
|
|
4
|
+
export interface CardContextValue {
|
|
5
|
+
size?: CardSize;
|
|
6
|
+
variant?: CardVariant;
|
|
7
|
+
}
|
|
8
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
size?: CardSize;
|
|
10
|
+
variant?: CardVariant;
|
|
11
|
+
className?: string;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface CardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
className?: string;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface CardBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
className?: string;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
className?: string;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=Card.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.types.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC1C,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Card/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,eAAO,MAAM,OAAO,qFAYnB,CAAC"}
|