-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs[DST-503]:Revise Select and add slots to text component (#4071)
Co-authored-by: Sebastian Sebald <[email protected]>
- Loading branch information
Showing
26 changed files
with
349 additions
and
113 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@marigold/docs": patch | ||
"@marigold/components": patch | ||
"@marigold/theme-b2b": patch | ||
"@marigold/theme-core": patch | ||
--- | ||
|
||
docs[DST-503]:Revise Select and add slots to text component |
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
19 changes: 19 additions & 0 deletions
19
docs/content/components/form/select/select-appearance.demo.tsx
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,19 @@ | ||
import { SelectProps } from '@marigold/components'; | ||
import { Select } from '@marigold/components'; | ||
|
||
export default (props: SelectProps<object>) => ( | ||
<Select | ||
{...props} | ||
label="Genre" | ||
placeholder="Select genre" | ||
description="Select the genre you want." | ||
width="fit" | ||
> | ||
<Select.Option id="pop">Pop</Select.Option> | ||
<Select.Option id="hiphop">Hip Hop</Select.Option> | ||
<Select.Option id="rock">Rock</Select.Option> | ||
<Select.Option id="schlager">Schlager</Select.Option> | ||
<Select.Option id="jazz">Jazz</Select.Option> | ||
<Select.Option id="dance">Dance</Select.Option> | ||
</Select> | ||
); |
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
docs/content/components/form/select/select-default-selected.demo.tsx
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
docs/content/components/form/select/select-description.demo.tsx
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,24 @@ | ||
import { Select, Text } from '@marigold/components'; | ||
|
||
export default () => ( | ||
<Select label="Permissions" width="fit"> | ||
<Select.Option id="read" textValue="Read"> | ||
<Text slot="label">Read</Text> | ||
<Text slot="description" fontSize="xs"> | ||
Read only | ||
</Text> | ||
</Select.Option> | ||
<Select.Option id="write" textValue="Write"> | ||
<Text slot="label">Write</Text> | ||
<Text slot="description" fontSize="xs"> | ||
Read and write only | ||
</Text> | ||
</Select.Option> | ||
<Select.Option id="admin" textValue="Admin"> | ||
<Text slot="label">Admin</Text> | ||
<Text slot="description" fontSize="xs"> | ||
Full access | ||
</Text> | ||
</Select.Option> | ||
</Select> | ||
); |
23 changes: 16 additions & 7 deletions
23
docs/content/components/form/select/select-disabled-keys.demo.tsx
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,12 +1,21 @@ | ||
import { Select } from '@marigold/components'; | ||
|
||
export default () => ( | ||
<Select label="Favorite Color" disabledKeys={['Orange', 'Yellow']}> | ||
<Select.Option id="Red">Red</Select.Option> | ||
<Select.Option id="Orange">Orange</Select.Option> | ||
<Select.Option id="Yellow">Yellow</Select.Option> | ||
<Select.Option id="Green">Green</Select.Option> | ||
<Select.Option id="Blue">Blue</Select.Option> | ||
<Select.Option id="Purple">Purple</Select.Option> | ||
<Select | ||
label="Shipping direction" | ||
disabledKeys={['germany', 'elsalvador', 'poland']} | ||
description="Please select the shipping direction, not every country can be available." | ||
width="fit" | ||
> | ||
<Select.Option id="czechrepublic">Czech Republic</Select.Option> | ||
<Select.Option id="egypt">Egypt</Select.Option> | ||
<Select.Option id="elsalvador">El Salvador</Select.Option> | ||
<Select.Option id="germany">Germany</Select.Option> | ||
<Select.Option id="hungary">Hungary</Select.Option> | ||
<Select.Option id="india">India</Select.Option> | ||
<Select.Option id="nigeria">Nigeria</Select.Option> | ||
<Select.Option id="poland">Poland</Select.Option> | ||
<Select.Option id="portugal">Portugal</Select.Option> | ||
<Select.Option id="ukraine">Ukraine</Select.Option> | ||
</Select> | ||
); |
This file was deleted.
Oops, something went wrong.
50 changes: 36 additions & 14 deletions
50
docs/content/components/form/select/select-section.demo.tsx
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,16 +1,38 @@ | ||
import { Header, Select } from '@marigold/components'; | ||
|
||
export default () => ( | ||
<Select label="Choose your Fandom"> | ||
<Select.Section> | ||
<Header>Fantasy</Header> | ||
<Select.Option>Harry Potter</Select.Option> | ||
<Select.Option>Lord of the Rings</Select.Option> | ||
</Select.Section> | ||
<Select.Section> | ||
<Header>Sci-Fi</Header> | ||
<Select.Option>Star Wars</Select.Option> | ||
<Select.Option>Star Trek</Select.Option> | ||
</Select.Section> | ||
</Select> | ||
); | ||
export default () => { | ||
const items = [ | ||
{ category: 'Comedy', genres: ['Kabarett', 'Satire', 'Stand Up Comedy'] }, | ||
{ | ||
category: 'Classic', | ||
genres: ['Chor', 'Kammermusik', 'Kantate', 'Klavierkonzert'], | ||
}, | ||
{ | ||
category: 'Hardcore', | ||
genres: [ | ||
'Hardcore Punk', | ||
'Jazzcore', | ||
'Mathcore', | ||
'Melodic Hardcore', | ||
'Metalcore', | ||
], | ||
}, | ||
{ | ||
category: 'Metal', | ||
genres: ['Black Metal', 'Death Metal', 'Heavy Metal', 'Nu Metal'], | ||
}, | ||
]; | ||
|
||
return ( | ||
<Select label="Genres" items={items} width="fit"> | ||
{items.map(item => ( | ||
<Select.Section key={item.category}> | ||
<Header>{item.category}</Header> | ||
{item.genres.map(genre => ( | ||
<Select.Option key={genre}>{genre}</Select.Option> | ||
))} | ||
</Select.Section> | ||
))} | ||
</Select> | ||
); | ||
}; |
Oops, something went wrong.