@astacinco/rn-primitives 0.1.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 +195 -0
- package/__tests__/Button.test.tsx +114 -0
- package/__tests__/Card.test.tsx +73 -0
- package/__tests__/Container.test.tsx +71 -0
- package/__tests__/Divider.test.tsx +41 -0
- package/__tests__/Input.test.tsx +69 -0
- package/__tests__/Stack.test.tsx +85 -0
- package/__tests__/Text.test.tsx +64 -0
- package/__tests__/__snapshots__/Button.test.tsx.snap +143 -0
- package/__tests__/__snapshots__/Card.test.tsx.snap +47 -0
- package/__tests__/__snapshots__/Container.test.tsx.snap +51 -0
- package/__tests__/__snapshots__/Divider.test.tsx.snap +37 -0
- package/__tests__/__snapshots__/Input.test.tsx.snap +73 -0
- package/__tests__/__snapshots__/Stack.test.tsx.snap +101 -0
- package/__tests__/__snapshots__/Text.test.tsx.snap +39 -0
- package/package.json +47 -0
- package/src/Button/Button.tsx +119 -0
- package/src/Button/index.ts +2 -0
- package/src/Button/types.ts +43 -0
- package/src/Card/Card.tsx +62 -0
- package/src/Card/index.ts +2 -0
- package/src/Card/types.ts +21 -0
- package/src/Container/Container.tsx +42 -0
- package/src/Container/index.ts +2 -0
- package/src/Container/types.ts +23 -0
- package/src/Divider/Divider.tsx +40 -0
- package/src/Divider/index.ts +2 -0
- package/src/Divider/types.ts +21 -0
- package/src/Input/Input.tsx +103 -0
- package/src/Input/index.ts +2 -0
- package/src/Input/types.ts +23 -0
- package/src/Stack/Stack.tsx +77 -0
- package/src/Stack/index.ts +2 -0
- package/src/Stack/types.ts +30 -0
- package/src/Text/Text.tsx +50 -0
- package/src/Text/index.ts +2 -0
- package/src/Text/types.ts +21 -0
- package/src/index.ts +51 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TextProps as RNTextProps } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export type TextVariant = 'title' | 'subtitle' | 'body' | 'caption' | 'label';
|
|
4
|
+
|
|
5
|
+
export interface TextProps extends RNTextProps {
|
|
6
|
+
/**
|
|
7
|
+
* Text variant that determines styling
|
|
8
|
+
* @default 'body'
|
|
9
|
+
*/
|
|
10
|
+
variant?: TextVariant;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Override text color (uses theme color by default)
|
|
14
|
+
*/
|
|
15
|
+
color?: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Test ID for testing
|
|
19
|
+
*/
|
|
20
|
+
testID?: string;
|
|
21
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @astacinco/rn-primitives
|
|
3
|
+
*
|
|
4
|
+
* Theme-aware UI primitives for React Native.
|
|
5
|
+
* All components automatically adapt to light/dark modes.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { Text, Button, Card, VStack } from '@astacinco/rn-primitives';
|
|
10
|
+
*
|
|
11
|
+
* function MyScreen() {
|
|
12
|
+
* return (
|
|
13
|
+
* <VStack spacing="md">
|
|
14
|
+
* <Text variant="title">Welcome</Text>
|
|
15
|
+
* <Card>
|
|
16
|
+
* <Text>Card content</Text>
|
|
17
|
+
* </Card>
|
|
18
|
+
* <Button label="Get Started" onPress={() => {}} />
|
|
19
|
+
* </VStack>
|
|
20
|
+
* );
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// Text
|
|
26
|
+
export { Text } from './Text';
|
|
27
|
+
export type { TextProps, TextVariant } from './Text';
|
|
28
|
+
|
|
29
|
+
// Button
|
|
30
|
+
export { Button } from './Button';
|
|
31
|
+
export type { ButtonProps, ButtonVariant, ButtonSize } from './Button';
|
|
32
|
+
|
|
33
|
+
// Card
|
|
34
|
+
export { Card } from './Card';
|
|
35
|
+
export type { CardProps, CardVariant } from './Card';
|
|
36
|
+
|
|
37
|
+
// Stack
|
|
38
|
+
export { VStack, HStack } from './Stack';
|
|
39
|
+
export type { StackProps, StackSpacing, StackAlign, StackJustify } from './Stack';
|
|
40
|
+
|
|
41
|
+
// Container
|
|
42
|
+
export { Container } from './Container';
|
|
43
|
+
export type { ContainerProps } from './Container';
|
|
44
|
+
|
|
45
|
+
// Input
|
|
46
|
+
export { Input } from './Input';
|
|
47
|
+
export type { InputProps } from './Input';
|
|
48
|
+
|
|
49
|
+
// Divider
|
|
50
|
+
export { Divider } from './Divider';
|
|
51
|
+
export type { DividerProps, DividerVariant } from './Divider';
|