-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,124 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Project | ||
**/i18n/messages/ | ||
toolkit/vocs/pages/ | ||
library/metadata.json | ||
output/ | ||
dist/ | ||
gen/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
:::import::: | ||
import {Button} from 'vocs/components'; | ||
|
||
# :::name::: | ||
|
||
> :::desc::: | ||
:::example | ||
|
||
<Card | ||
header="Test" | ||
thumbnail={undefined} | ||
/> | ||
|
||
::: | ||
|
||
```tsx twoslash | ||
import React from 'react'; | ||
// ---cut--- | ||
// @log: ↓ Import the component | ||
:::import::: | ||
|
||
// @log: ↓ Try the example | ||
:::example::: | ||
``` | ||
|
||
<Button href=":::storybook:::">Storybook</Button> | ||
|
||
## Props | ||
|
||
:::props::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import {useStyles, createStyleSheet} from 'react-native-unistyles'; | ||
import {View, Text} from 'react-native'; | ||
|
||
export interface CardProps { | ||
/** The card header */ | ||
header: string, | ||
/** The card thumbnail */ | ||
thumbnail?: JSX.Element, | ||
/** An identifier used for testing */ | ||
testID?: string, | ||
} | ||
|
||
/** | ||
* A simple card block component | ||
* */ | ||
export function Card(props: CardProps) { | ||
const {styles} = useStyles(stylesheet); | ||
|
||
return ( | ||
<View style={styles.root} testID={props.testID ?? "2218:99"}> | ||
{props.thumbnail} | ||
<View style={styles.contents} testID="2218:101"> | ||
<Text style={styles.header} testID="2218:102"> | ||
{`Header`} | ||
</Text> | ||
<Text style={styles.body} testID="2218:103"> | ||
{`Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt...`} | ||
</Text> | ||
<Text style={styles.footer} testID="2218:116"> | ||
{`Footer`} | ||
</Text> | ||
</View> | ||
</View> | ||
); | ||
} | ||
|
||
const stylesheet = createStyleSheet(theme => ({ | ||
root: { | ||
flexDirection: 'row', | ||
padding: 16, | ||
alignItems: 'flex-start', | ||
rowGap: 16, | ||
columnGap: 16, | ||
alignSelf: 'stretch', | ||
borderRadius: 6, | ||
borderWidth: 1, | ||
borderStyle: 'solid', | ||
borderColor: theme.colors.border, | ||
backgroundColor: theme.colors.popover, | ||
}, | ||
header: { | ||
color: theme.colors.cardForeground, | ||
fontFamily: 'Inter', | ||
fontSize: 14, | ||
fontStyle: 'normal', | ||
fontWeight: '600', | ||
lineHeight: 20, | ||
}, | ||
body: { | ||
alignSelf: 'stretch', | ||
color: theme.colors.cardForeground, | ||
fontFamily: 'Inter', | ||
fontSize: 14, | ||
fontStyle: 'normal', | ||
fontWeight: '400', | ||
lineHeight: 20, | ||
}, | ||
footer: { | ||
alignSelf: 'stretch', | ||
color: theme.colors.mutedForeground, | ||
fontFamily: 'Inter', | ||
fontSize: 12, | ||
fontStyle: 'normal', | ||
fontWeight: '400', | ||
lineHeight: 16, | ||
}, | ||
contents: { | ||
flexDirection: 'column', | ||
alignItems: 'flex-start', | ||
rowGap: 4, | ||
columnGap: 4, | ||
flexGrow: 1, | ||
flexShrink: 0, | ||
flexBasis: 0, | ||
alignSelf: 'stretch', | ||
}, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Card'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export {} | ||
export * from './components/layout/card'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ src/ | |
plugins/ | ||
node_modules/ | ||
tsconfig.json | ||
typedoc.json | ||
metadata.json | ||
vite.config.mts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "https://typedoc.org/schema.json", | ||
"entryPoints": ["./src/index.ts"], | ||
"json": "./metadata.json", | ||
"emit": "docs", | ||
"pretty": true, | ||
"categorizeByGroup": false, | ||
"skipErrorChecking": true, | ||
"excludeProtected": true, | ||
"excludePrivate": true, | ||
"excludeInternal": true, | ||
"excludeExternals": true, | ||
"excludeReferences": false, | ||
"excludeNotDocumented": false, | ||
} |
Oops, something went wrong.