-
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.
readme updates for generator, artifak, fluidsizing, container, text-i…
…nput and typography
- Loading branch information
Showing
7 changed files
with
255 additions
and
91 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
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 |
---|---|---|
@@ -1,11 +1,33 @@ | ||
# `@artifak/container` | ||
|
||
> TODO: description | ||
A basic container component. By default has full 100% width and margin 0 auto. All you need to do is specify your max widths. | ||
|
||
## Usage | ||
|
||
``` | ||
const container = require('@artifak/container'); | ||
Apart from widths, the component also accepts the following style properties: | ||
|
||
- background | ||
- border | ||
- color | ||
- display | ||
- layout | ||
- position | ||
- shadow | ||
- space | ||
- typography | ||
|
||
Below is a usage example. | ||
|
||
```ts | ||
import { Container } from 'artifak'; | ||
|
||
// TODO: DEMONSTRATE API | ||
export function Example() { | ||
return ( | ||
<Container maxWidth={['40em', '52em', '64em', '80em']}> | ||
<> | ||
<p>Hello World</p> | ||
</> | ||
</Container> | ||
); | ||
} | ||
``` |
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 |
---|---|---|
@@ -1,11 +1,70 @@ | ||
# `@artifak/text-input` | ||
|
||
> TODO: description | ||
A text based input element generator. | ||
|
||
## Usage | ||
## Installation | ||
|
||
### Yarn | ||
|
||
```sh | ||
yarn add @artifak/text-input | ||
``` | ||
const textInput = require('@artifak/text-input'); | ||
|
||
// TODO: DEMONSTRATE API | ||
### NPM | ||
|
||
```sh | ||
npm install @artifak/text-input | ||
``` | ||
|
||
## Usage | ||
|
||
```ts | ||
import { createTextInputs } from '@artifak/text-input'; | ||
|
||
const inputs = { | ||
base: { | ||
styles: { | ||
width: '100%', | ||
border: '1px solid black', | ||
padding: ['1em'] | ||
} | ||
}, | ||
|
||
components: { | ||
InputSearch: { | ||
maxWidth: '300px', | ||
attrs: { type: 'search' } | ||
}, | ||
|
||
InputUrl: { | ||
display: 'block', | ||
attrs: { type: 'url' } | ||
} | ||
} | ||
}; | ||
|
||
type BasicUsageProps = { | ||
disabled?: boolean; | ||
placeholder?: string; | ||
onBlur?: () => void; | ||
}; | ||
|
||
const { Base: InputText, InputSearch, InputUrl } = createTextInputs< | ||
typeof inputs.components, | ||
BasicUsageProps | ||
>(inputs.base, inputs.components); | ||
|
||
export function BasicUsage() { | ||
const onBlur = (text: string) => () => { | ||
console.log('Blur', text); | ||
}; | ||
|
||
return ( | ||
<> | ||
<InputText onBlur={onBlur('Hello')} /> | ||
<InputSearch /> | ||
<InputUrl /> | ||
</> | ||
); | ||
} | ||
``` |
Oops, something went wrong.