Skip to content

Commit

Permalink
docs([DST-498]): revise Button page (#4045)
Browse files Browse the repository at this point in the history
* planning

* first example

* save

* full width

* cleanup

* align with table blueprint

* remove variants add anatomy

* add label demo

* more stuff

* save

* save

* add disbled demo

* done!

* add updated badge

* vie -> compete

* area -> section

* remove sentence

* adjustments

* add general usage

* fix link to tooltip

* clarification

* updates!

* more updates

* fix typo

* add on press example adn related
  • Loading branch information
sebald authored Aug 5, 2024
1 parent f85d05d commit 1a6880c
Show file tree
Hide file tree
Showing 17 changed files with 290 additions and 114 deletions.
11 changes: 11 additions & 0 deletions docs/content/components/form/button/button-disabled.demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Button, Stack, Text } from '@marigold/components';

export default () => (
<Stack space={1} alignX="left">
<Button disabled>Add discount code</Button>
<Text color="text-base-disabled" fontSize="xs">
Only Fanclub members can add a discount code. If you're a Fanclub member,
please log in first.
</Text>
</Stack>
);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button } from '@marigold/components';

export default () => (
<Button as="a" variant="primary" href="/rx-logo.png" download>
Download Logo
<Button variant="primary" fullWidth>
Proceed to checkout
</Button>
);
10 changes: 0 additions & 10 deletions docs/content/components/form/button/button-ghost.demo.tsx

This file was deleted.

11 changes: 6 additions & 5 deletions docs/content/components/form/button/button-icon.demo.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Button, Inline } from '@marigold/components';
import { Ticket } from '@marigold/icons';
import { Edit } from '@marigold/icons';

export default () => (
<Inline space={2}>
<Inline space={5} alignY="center" alignX="center">
<Button variant="primary">Edit</Button>
<Button variant="primary">
<Ticket /> Icon Primary
<Edit size={16} /> Edit
</Button>
<Button variant="primary" disabled>
<Ticket /> Icon Primary
<Button variant="icon" aria-label="Edit">
<Edit />
</Button>
</Inline>
);
27 changes: 27 additions & 0 deletions docs/content/components/form/button/button-press.demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { useState } from 'react';
import { Button, Stack, Text } from '@marigold/components';

export default () => {
const [pointerType, setPointerType] = useState('');
const [count, setCount] = useState(0);

return (
<Stack space={3} alignX="left">
<Button
variant="secondary"
onPress={() => setCount(count + 1)}
onPressStart={e => setPointerType(e.pointerType)}
onPressEnd={() => setPointerType('')}
>
Press me
</Button>
<Text>
Number of times presse: {count} (
{pointerType
? `Button is pressed via ${pointerType}.`
: 'Button not pressed.'}
)
</Text>
</Stack>
);
};
10 changes: 0 additions & 10 deletions docs/content/components/form/button/button-primary.demo.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions docs/content/components/form/button/button-secondary.demo.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions docs/content/components/form/button/button-size.demo.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions docs/content/components/form/button/button-text.demo.tsx

This file was deleted.

Loading

0 comments on commit 1a6880c

Please sign in to comment.