-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs]: add Flex configurator (#405)
* [docs]: add Flex configurator * [docs]: remove unused Flex configurator options * [docs]: update Flex configurator option labels * [docs]: fix typo in Flex configurator
- Loading branch information
Showing
4 changed files
with
71 additions
and
31 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 |
---|---|---|
|
@@ -25,4 +25,4 @@ docs: 'core/flex' | |
|
||
## Usage | ||
|
||
<Demo demo={FlexDemos.usage} /> | ||
<Demo demo={FlexDemos.configurator} /> |
69 changes: 69 additions & 0 deletions
69
packages/svelteui-demos/src/demos/core/Flex/Flex.demo.configurator.svelte
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,69 @@ | ||
<script lang="ts" context="module"> | ||
import type { ConfiguratorDemoType, ConfiguratorDemoConfiguration } from '$lib/types'; | ||
const codeTemplate = (props: string) => `<script> | ||
import { Button, Flex } from '@svelteuidev/core'; | ||
<\/script> | ||
<Flex${props}> | ||
<Button>Button 1</Button> | ||
<Button>Button 2</Button> | ||
<Button>Button 3</Button> | ||
</Flex>`; | ||
export const type: ConfiguratorDemoType['type'] = 'configurator'; | ||
export const configuration: ConfiguratorDemoConfiguration = { | ||
codeTemplate, | ||
configurator: [ | ||
{ | ||
name: 'justify', | ||
type: 'select', | ||
data: [ | ||
{ label: 'Left', value: 'left' }, | ||
{ label: 'Right', value: 'right' }, | ||
{ label: 'Center', value: 'center' }, | ||
{ label: 'Space Around', value: 'space-around' }, | ||
{ label: 'Space Between', value: 'space-between' }, | ||
{ label: 'Space Evenly', value: 'space-evenly' } | ||
], | ||
initialValue: 'left', | ||
defaultValue: 'left' | ||
}, | ||
{ | ||
name: 'direction', | ||
type: 'select', | ||
data: [ | ||
{ label: 'Row', value: 'row' }, | ||
{ label: 'Column', value: 'column' } | ||
], | ||
initialValue: 'row', | ||
defaultValue: 'row' | ||
}, | ||
{ | ||
name: 'wrap', | ||
type: 'select', | ||
data: [ | ||
{ label: 'Wrap', value: 'wrap' }, | ||
{ label: 'No Wrap', value: 'nowrap' } | ||
], | ||
initialValue: 'wrap', | ||
defaultValue: 'wrap' | ||
}, | ||
{ name: 'gap', type: 'size', initialValue: 'sm', defaultValue: 'sm' }, | ||
] | ||
}; | ||
</script> | ||
|
||
<script lang="ts"> | ||
import { Button, Flex } from '@svelteuidev/core'; | ||
import type { FlexProps } from '@svelteuidev/core'; | ||
export let props: FlexProps = {}; | ||
</script> | ||
|
||
<Flex {...props}> | ||
<Button>Button 1</Button> | ||
<Button>Button 2</Button> | ||
<Button>Button 3</Button> | ||
</Flex> |
29 changes: 0 additions & 29 deletions
29
packages/svelteui-demos/src/demos/core/Flex/Flex.demo.usage.svelte
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * as usage from './Flex.demo.usage.svelte'; | ||
export * as configurator from './Flex.demo.configurator.svelte'; |