@robin-ux/native 0.1.3 → 0.1.4
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/build/components/Card.d.ts +14 -0
- package/build/components/Card.d.ts.map +1 -0
- package/build/components/Card.js +38 -0
- package/build/components/Card.js.map +1 -0
- package/build/components/index.d.ts +2 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +1 -0
- package/build/components/index.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Card.tsx +53 -0
- package/src/components/index.ts +3 -0
- package/src/index.ts +2 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewProps } from "react-native";
|
|
3
|
+
import { spacing } from "../utils/styles";
|
|
4
|
+
type CardVariant = "default" | "elevated" | "outlined";
|
|
5
|
+
export interface CardProps extends Omit<ViewProps, "style"> {
|
|
6
|
+
variant?: CardVariant;
|
|
7
|
+
padding?: keyof typeof spacing;
|
|
8
|
+
style?: ViewProps["style"];
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
bg?: "primary" | "secondary";
|
|
11
|
+
}
|
|
12
|
+
export declare function Card({ variant, padding, style, children, bg, ...props }: CardProps): React.JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/components/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAyB,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEjE,KAAK,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEvD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC;IACvD,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,EAAE,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;CAChC;AAED,wBAAgB,IAAI,CAAC,EAAE,OAAmB,EAAE,OAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,qBA+BrG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { useTheme } from "../theme";
|
|
4
|
+
import { borderRadius, shadows, spacing } from "../utils/styles";
|
|
5
|
+
export function Card({ variant = "default", padding = "md", style, children, bg, ...props }) {
|
|
6
|
+
const { colors } = useTheme();
|
|
7
|
+
let backgroundColor = colors.card;
|
|
8
|
+
if (bg === "primary") {
|
|
9
|
+
backgroundColor = colors.background;
|
|
10
|
+
}
|
|
11
|
+
else if (bg === "secondary") {
|
|
12
|
+
backgroundColor = colors.background;
|
|
13
|
+
}
|
|
14
|
+
const variantStyles = {
|
|
15
|
+
default: {
|
|
16
|
+
backgroundColor: backgroundColor,
|
|
17
|
+
},
|
|
18
|
+
elevated: {
|
|
19
|
+
backgroundColor: backgroundColor,
|
|
20
|
+
...shadows.md,
|
|
21
|
+
},
|
|
22
|
+
outlined: {
|
|
23
|
+
backgroundColor: backgroundColor,
|
|
24
|
+
borderWidth: 1,
|
|
25
|
+
borderColor: colors.border,
|
|
26
|
+
},
|
|
27
|
+
}[variant];
|
|
28
|
+
const cardStyle = [styles.card, variantStyles, { padding: spacing[padding] }, style];
|
|
29
|
+
return (<View style={cardStyle} {...props}>
|
|
30
|
+
{children}
|
|
31
|
+
</View>);
|
|
32
|
+
}
|
|
33
|
+
const styles = StyleSheet.create({
|
|
34
|
+
card: {
|
|
35
|
+
borderRadius: borderRadius.lg,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../src/components/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAYjE,MAAM,UAAU,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE,OAAO,GAAG,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,KAAK,EAAa;IAClG,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC9B,IAAI,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC;IAClC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACnB,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC;IACxC,CAAC;SAAM,IAAI,EAAE,KAAK,WAAW,EAAE,CAAC;QAC5B,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC;IACxC,CAAC;IAED,MAAM,aAAa,GAAG;QAClB,OAAO,EAAE;YACL,eAAe,EAAE,eAAe;SACnC;QACD,QAAQ,EAAE;YACN,eAAe,EAAE,eAAe;YAChC,GAAG,OAAO,CAAC,EAAE;SAChB;QACD,QAAQ,EAAE;YACN,eAAe,EAAE,eAAe;YAChC,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,MAAM;SAC7B;KACJ,CAAC,OAAO,CAAC,CAAC;IAEX,MAAM,SAAS,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAErF,OAAO,CACH,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,CAAC,CAC9B;YAAA,CAAC,QAAQ,CACb;QAAA,EAAE,IAAI,CAAC,CACV,CAAC;AACN,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE;QACF,YAAY,EAAE,YAAY,CAAC,EAAE;KAChC;CACJ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { StyleSheet, View, ViewProps } from \"react-native\";\nimport { useTheme } from \"../theme\";\nimport { borderRadius, shadows, spacing } from \"../utils/styles\";\n\ntype CardVariant = \"default\" | \"elevated\" | \"outlined\";\n\nexport interface CardProps extends Omit<ViewProps, \"style\"> {\n variant?: CardVariant;\n padding?: keyof typeof spacing;\n style?: ViewProps[\"style\"];\n children: React.ReactNode;\n bg?: \"primary\" | \"secondary\";\n}\n\nexport function Card({ variant = \"default\", padding = \"md\", style, children, bg, ...props }: CardProps) {\n const { colors } = useTheme();\n let backgroundColor = colors.card;\n if (bg === \"primary\") {\n backgroundColor = colors.background;\n } else if (bg === \"secondary\") {\n backgroundColor = colors.background;\n }\n\n const variantStyles = {\n default: {\n backgroundColor: backgroundColor,\n },\n elevated: {\n backgroundColor: backgroundColor,\n ...shadows.md,\n },\n outlined: {\n backgroundColor: backgroundColor,\n borderWidth: 1,\n borderColor: colors.border,\n },\n }[variant];\n\n const cardStyle = [styles.card, variantStyles, { padding: spacing[padding] }, style];\n\n return (\n <View style={cardStyle} {...props}>\n {children}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n card: {\n borderRadius: borderRadius.lg,\n },\n});\n"]}
|
|
@@ -16,4 +16,6 @@ export { FormView } from "./FormView";
|
|
|
16
16
|
export type { FormViewProps } from "./FormView";
|
|
17
17
|
export { TextArea } from "./TextArea";
|
|
18
18
|
export type { TextAreaProps } from "./TextArea";
|
|
19
|
+
export { Card } from "./Card";
|
|
20
|
+
export type { CardProps } from "./Card";
|
|
19
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGvE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGvF,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1D,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGzE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY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EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,QAAQ;AACR,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG1D,mBAAmB;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,QAAQ;AACR,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,mBAAmB;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["// Button\nexport { Button } from \"./Button\";\nexport type { ButtonProps, ButtonSize, ButtonVariant } from \"./Button\";\n\n// Text\nexport { Text } from \"./Text\";\nexport type { TextAlign, TextColor, TextProps, TextVariant, TextWeight } from \"./Text\";\n\n// Input\nexport { BaseInput, Input, PasswordInput } from \"./Input\";\nexport type { InputProps } from \"./Input\";\n\n// SegmentedControl\nexport { SegmentedControl } from \"./SegmentedControl\";\nexport type { Segment, SegmentedControlProps } from \"./SegmentedControl\";\n\n// Badge\nexport { Badge } from \"./Badge\";\nexport type { BadgeProps, BadgeStatus } from \"./Badge\";\n\n// DynamicStatusBar\nexport { DynamicStatusBar } from \"./DynamicStatusBar\";\nexport type { DynamicStatusBarProps } from \"./DynamicStatusBar\";\n\nexport { HeaderView } from \"./HeaderView\";\nexport type { HeaderViewProps } from \"./HeaderView\";\n\nexport { FormView } from \"./FormView\";\nexport type { FormViewProps } from \"./FormView\";\n\nexport { TextArea } from \"./TextArea\";\nexport type { TextAreaProps } from \"./TextArea\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,QAAQ;AACR,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG1D,mBAAmB;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,QAAQ;AACR,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,mBAAmB;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["// Button\nexport { Button } from \"./Button\";\nexport type { ButtonProps, ButtonSize, ButtonVariant } from \"./Button\";\n\n// Text\nexport { Text } from \"./Text\";\nexport type { TextAlign, TextColor, TextProps, TextVariant, TextWeight } from \"./Text\";\n\n// Input\nexport { BaseInput, Input, PasswordInput } from \"./Input\";\nexport type { InputProps } from \"./Input\";\n\n// SegmentedControl\nexport { SegmentedControl } from \"./SegmentedControl\";\nexport type { Segment, SegmentedControlProps } from \"./SegmentedControl\";\n\n// Badge\nexport { Badge } from \"./Badge\";\nexport type { BadgeProps, BadgeStatus } from \"./Badge\";\n\n// DynamicStatusBar\nexport { DynamicStatusBar } from \"./DynamicStatusBar\";\nexport type { DynamicStatusBarProps } from \"./DynamicStatusBar\";\n\nexport { HeaderView } from \"./HeaderView\";\nexport type { HeaderViewProps } from \"./HeaderView\";\n\nexport { FormView } from \"./FormView\";\nexport type { FormViewProps } from \"./FormView\";\n\nexport { TextArea } from \"./TextArea\";\nexport type { TextAreaProps } from \"./TextArea\";\n\nexport { Card } from \"./Card\";\nexport type { CardProps } from \"./Card\";\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { defaultDarkColors, defaultDarkTheme, defaultLightColors, defaultTheme, ThemeContext, ThemeProvider, useTheme, useThemeSafe } from "./theme";
|
|
2
2
|
export type { Theme, ThemeColors, ThemeContextValue, ThemeProviderProps } from "./theme";
|
|
3
|
-
export { Badge, BaseInput, Button, DynamicStatusBar, FormView, HeaderView, Input, PasswordInput, SegmentedControl, Text, TextArea } from "./components";
|
|
4
|
-
export type { BadgeProps, BadgeStatus, ButtonProps, ButtonSize, ButtonVariant, DynamicStatusBarProps, FormViewProps, InputProps, Segment, SegmentedControlProps, TextAlign, TextAreaProps, TextColor, TextProps, TextVariant, TextWeight, } from "./components";
|
|
3
|
+
export { Badge, BaseInput, Button, Card, DynamicStatusBar, FormView, HeaderView, Input, PasswordInput, SegmentedControl, Text, TextArea } from "./components";
|
|
4
|
+
export type { BadgeProps, BadgeStatus, ButtonProps, ButtonSize, ButtonVariant, CardProps, DynamicStatusBarProps, FormViewProps, InputProps, Segment, SegmentedControlProps, TextAlign, TextAreaProps, TextColor, TextProps, TextVariant, TextWeight, } from "./components";
|
|
5
5
|
export { borderRadius, createThemedStyle, layouts, shadows, spacing, typography, useThemedStyles } from "./utils";
|
|
6
6
|
export type { BorderRadiusKey, LayoutKey, ShadowKey, SpacingKey, TypographyVariant } from "./utils";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EA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CAAC;AAElH,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Theme system
|
|
5
5
|
export { defaultDarkColors, defaultDarkTheme, defaultLightColors, defaultTheme, ThemeContext, ThemeProvider, useTheme, useThemeSafe } from "./theme";
|
|
6
6
|
// Components
|
|
7
|
-
export { Badge, BaseInput, Button, DynamicStatusBar, FormView, HeaderView, Input, PasswordInput, SegmentedControl, Text, TextArea } from "./components";
|
|
7
|
+
export { Badge, BaseInput, Button, Card, DynamicStatusBar, FormView, HeaderView, Input, PasswordInput, SegmentedControl, Text, TextArea } from "./components";
|
|
8
8
|
// Utilities
|
|
9
9
|
export { borderRadius, createThemedStyle, layouts, shadows, spacing, typography, useThemedStyles } from "./utils";
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,0DAA0D;AAC1D,+EAA+E;AAE/E,eAAe;AACf,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIrJ,aAAa;AACb,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,0DAA0D;AAC1D,+EAA+E;AAE/E,eAAe;AACf,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIrJ,aAAa;AACb,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAsB9J,YAAY;AACZ,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC","sourcesContent":["// ============================================================================\n// @robin-ux/native - Themeable React Native UI Components\n// ============================================================================\n\n// Theme system\nexport { defaultDarkColors, defaultDarkTheme, defaultLightColors, defaultTheme, ThemeContext, ThemeProvider, useTheme, useThemeSafe } from \"./theme\";\n\nexport type { Theme, ThemeColors, ThemeContextValue, ThemeProviderProps } from \"./theme\";\n\n// Components\nexport { Badge, BaseInput, Button, Card, DynamicStatusBar, FormView, HeaderView, Input, PasswordInput, SegmentedControl, Text, TextArea } from \"./components\";\n\nexport type {\n BadgeProps,\n BadgeStatus,\n ButtonProps,\n ButtonSize,\n ButtonVariant,\n CardProps,\n DynamicStatusBarProps,\n FormViewProps,\n InputProps,\n Segment,\n SegmentedControlProps,\n TextAlign,\n TextAreaProps,\n TextColor,\n TextProps,\n TextVariant,\n TextWeight,\n} from \"./components\";\n\n// Utilities\nexport { borderRadius, createThemedStyle, layouts, shadows, spacing, typography, useThemedStyles } from \"./utils\";\n\nexport type { BorderRadiusKey, LayoutKey, ShadowKey, SpacingKey, TypographyVariant } from \"./utils\";\n"]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleSheet, View, ViewProps } from "react-native";
|
|
3
|
+
import { useTheme } from "../theme";
|
|
4
|
+
import { borderRadius, shadows, spacing } from "../utils/styles";
|
|
5
|
+
|
|
6
|
+
type CardVariant = "default" | "elevated" | "outlined";
|
|
7
|
+
|
|
8
|
+
export interface CardProps extends Omit<ViewProps, "style"> {
|
|
9
|
+
variant?: CardVariant;
|
|
10
|
+
padding?: keyof typeof spacing;
|
|
11
|
+
style?: ViewProps["style"];
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
bg?: "primary" | "secondary";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function Card({ variant = "default", padding = "md", style, children, bg, ...props }: CardProps) {
|
|
17
|
+
const { colors } = useTheme();
|
|
18
|
+
let backgroundColor = colors.card;
|
|
19
|
+
if (bg === "primary") {
|
|
20
|
+
backgroundColor = colors.background;
|
|
21
|
+
} else if (bg === "secondary") {
|
|
22
|
+
backgroundColor = colors.background;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const variantStyles = {
|
|
26
|
+
default: {
|
|
27
|
+
backgroundColor: backgroundColor,
|
|
28
|
+
},
|
|
29
|
+
elevated: {
|
|
30
|
+
backgroundColor: backgroundColor,
|
|
31
|
+
...shadows.md,
|
|
32
|
+
},
|
|
33
|
+
outlined: {
|
|
34
|
+
backgroundColor: backgroundColor,
|
|
35
|
+
borderWidth: 1,
|
|
36
|
+
borderColor: colors.border,
|
|
37
|
+
},
|
|
38
|
+
}[variant];
|
|
39
|
+
|
|
40
|
+
const cardStyle = [styles.card, variantStyles, { padding: spacing[padding] }, style];
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<View style={cardStyle} {...props}>
|
|
44
|
+
{children}
|
|
45
|
+
</View>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const styles = StyleSheet.create({
|
|
50
|
+
card: {
|
|
51
|
+
borderRadius: borderRadius.lg,
|
|
52
|
+
},
|
|
53
|
+
});
|
package/src/components/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { defaultDarkColors, defaultDarkTheme, defaultLightColors, defaultTheme,
|
|
|
8
8
|
export type { Theme, ThemeColors, ThemeContextValue, ThemeProviderProps } from "./theme";
|
|
9
9
|
|
|
10
10
|
// Components
|
|
11
|
-
export { Badge, BaseInput, Button, DynamicStatusBar, FormView, HeaderView, Input, PasswordInput, SegmentedControl, Text, TextArea } from "./components";
|
|
11
|
+
export { Badge, BaseInput, Button, Card, DynamicStatusBar, FormView, HeaderView, Input, PasswordInput, SegmentedControl, Text, TextArea } from "./components";
|
|
12
12
|
|
|
13
13
|
export type {
|
|
14
14
|
BadgeProps,
|
|
@@ -16,6 +16,7 @@ export type {
|
|
|
16
16
|
ButtonProps,
|
|
17
17
|
ButtonSize,
|
|
18
18
|
ButtonVariant,
|
|
19
|
+
CardProps,
|
|
19
20
|
DynamicStatusBarProps,
|
|
20
21
|
FormViewProps,
|
|
21
22
|
InputProps,
|