-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update starter example with api
- Loading branch information
1 parent
05348ee
commit e6e9df2
Showing
15 changed files
with
263 additions
and
55 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
export * from './sum'; |
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,17 @@ | ||
import { sum } from './sum'; | ||
|
||
const doc = { | ||
title: 'Library/api/sum', | ||
order: 1, | ||
component: sum, | ||
}; | ||
|
||
export const overview = ({ a, b }: { a: number; b: number }) => { | ||
return sum(a, b); | ||
}; | ||
overview.controls = { | ||
a: 1, | ||
b: 2, | ||
}; | ||
|
||
export default doc; |
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,7 @@ | ||
/** | ||
* sum api function | ||
* @param a first parameter to add | ||
* @param b second parameter to add | ||
* @returns the sum of the two parameters | ||
*/ | ||
export const sum = (a: number, b: number): number => a + b; |
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,17 @@ | ||
import React from 'react'; | ||
import { Document, Example } from '@component-controls/core'; | ||
import { useStore } from '@component-controls/store'; | ||
import { Button, ButtonProps } from './Button'; | ||
|
||
const doc: Document = { | ||
title: 'Library/Components/Button', | ||
order: 1, | ||
component: Button | ||
}; | ||
|
||
export const overview: Example<ButtonProps> = (props) => { | ||
const store = useStore(); | ||
return <Button {...props}>{store.config.title}</Button>; | ||
}; | ||
|
||
export default doc; |
File renamed without changes.
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 './Button'; |
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,16 @@ | ||
import React from 'react'; | ||
import { useStore } from '@component-controls/store'; | ||
import { Spinner } from './Spinner'; | ||
|
||
const doc = { | ||
title: 'Library/Components/Spinner', | ||
order: 1, | ||
component: Spinner, | ||
}; | ||
|
||
export const overview = props => { | ||
const store = useStore(); | ||
return <Spinner {...props}>{store.config.title}</Spinner>; | ||
}; | ||
|
||
export default doc; |
File renamed without changes.
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 './Spinner'; |
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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