@flightlesslabs/dodo-ui 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -4
- package/dist/stories/Home.mdx +4 -6
- package/dist/stories/components/Form/Button/Button.stories.svelte +16 -37
- package/dist/stories/components/Form/Button/Button.svelte +44 -46
- package/dist/stories/components/Form/Button/Button.svelte.d.ts +10 -9
- package/dist/stories/components/Form/Button/Color/Color.stories.svelte +23 -48
- package/dist/stories/components/Form/Button/Events/Events.stories.svelte +1 -7
- package/dist/stories/components/Form/Button/IconButton/IconButton.stories.svelte +4 -12
- package/dist/stories/components/Form/Button/Roundness/Roundness.stories.svelte +5 -31
- package/dist/stories/components/Form/Button/Size/Size.stories.svelte +3 -9
- package/dist/stories/components/Form/Button/Variant/Variant.stories.svelte +5 -8
- package/dist/stories/components/Form/FormControl/FormControl.stories.svelte +11 -12
- package/dist/stories/components/Form/FormControl/FormControl.svelte +3 -8
- package/dist/stories/components/Form/Label/Label.stories.svelte +1 -11
- package/dist/stories/components/Form/Label/Label.svelte +2 -4
- package/dist/stories/components/Form/Label/Label.svelte.d.ts +0 -2
- package/dist/stories/components/Form/Message/Color/Color.stories.svelte +9 -9
- package/dist/stories/components/Form/Message/Message.stories.svelte +5 -13
- package/dist/stories/components/Form/Message/Message.svelte +4 -9
- package/dist/stories/components/Form/Message/Message.svelte.d.ts +3 -5
- package/dist/stories/components/Form/Message/Size/Size.stories.svelte +3 -5
- package/dist/stories/components/Form/PasswordInput/Events/Events.stories.svelte +8 -72
- package/dist/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +5 -3
- package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte +4 -4
- package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte.d.ts +3 -2
- package/dist/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +4 -4
- package/dist/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +2 -2
- package/dist/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +3 -30
- package/dist/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +4 -4
- package/dist/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +4 -6
- package/dist/stories/components/Form/SimpleSelect/SimpleSelect.svelte +4 -4
- package/dist/stories/components/Form/SimpleSelect/SimpleSelect.svelte.d.ts +3 -2
- package/dist/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +2 -2
- package/dist/stories/components/Form/TextInput/Events/Events.stories.svelte +7 -63
- package/dist/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +4 -4
- package/dist/stories/components/Form/TextInput/TextInput.stories.svelte +6 -4
- package/dist/stories/components/Form/TextInput/TextInput.svelte +12 -5
- package/dist/stories/components/Form/TextInput/TextInput.svelte.d.ts +4 -2
- package/dist/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +4 -4
- package/dist/stories/components/Layout/Paper/Color/Color.stories.svelte +63 -0
- package/dist/stories/components/Layout/Paper/Color/Color.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Layout/Paper/Paper.stories.svelte +25 -16
- package/dist/stories/components/Layout/Paper/Paper.svelte +211 -14
- package/dist/stories/components/Layout/Paper/Paper.svelte.d.ts +18 -7
- package/dist/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +8 -13
- package/dist/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +6 -24
- package/dist/stories/components/Layout/Paper/utils/scss/mixins.scss +46 -0
- package/dist/stories/developer tools/Intro.mdx +2 -0
- package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +5 -5
- package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte +14 -14
- package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte.d.ts +3 -2
- package/dist/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +4 -4
- package/dist/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +4 -4
- package/dist/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +3 -3
- package/dist/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +4 -3
- package/dist/stories/developer tools/components/UtilityButton/UtilityButton.svelte +3 -3
- package/dist/stories/developer tools/components/UtilityButton/UtilityButton.svelte.d.ts +1 -1
- package/dist/stories/{philosophy/Colors/Colors.mdx → developer tools/philosophy/Colors/Colors.mdx } +2 -2
- package/dist/stories/{philosophy/Colors/Swatches/Palette.svelte → developer tools/philosophy/Colors/Swatches/Palette.svelte } +1 -1
- package/dist/stories/{philosophy/Colors/Swatches/Swatch.svelte → developer tools/philosophy/Colors/Swatches/Swatch.svelte } +1 -1
- package/dist/stories/{philosophy/Colors/Swatches/Swatches.svelte → developer tools/philosophy/Colors/Swatches/Swatches.svelte } +1 -1
- package/dist/stories/{philosophy/Colors/utils/color.js → developer tools/philosophy/Colors/utils/color.js } +1 -1
- package/dist/stories/{philosophy/Themes.mdx → developer tools/philosophy/Themes.mdx } +1 -1
- package/dist/styles/_colors.css +44 -44
- package/dist/styles/_components.css +6 -3
- package/dist/styles/_shadow.css +13 -20
- package/dist/styles/_space.css +7 -0
- package/dist/styles/global.css +1 -0
- package/dist/types/colors.d.ts +7 -0
- package/dist/types/colors.js +10 -0
- package/dist/types/roundness.d.ts +3 -0
- package/dist/types/roundness.js +1 -0
- package/dist/types/shadow.d.ts +3 -0
- package/dist/types/shadow.js +1 -0
- package/dist/types/size.d.ts +3 -0
- package/dist/types/size.js +1 -0
- package/dist/types/weight.d.ts +3 -0
- package/dist/types/weight.js +1 -0
- package/package.json +26 -24
- package/src/lib/index.ts +13 -8
- package/src/lib/stories/components/Form/Button/Button.svelte +30 -31
- package/src/lib/stories/components/Form/FormControl/FormControl.svelte +2 -7
- package/src/lib/stories/components/Form/Label/Label.svelte +1 -6
- package/src/lib/stories/components/Form/Message/Message.svelte +9 -16
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.svelte +7 -6
- package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.svelte +7 -6
- package/src/lib/stories/components/Form/TextInput/TextInput.svelte +16 -6
- package/src/lib/stories/components/Layout/Paper/Paper.svelte +151 -23
- package/src/lib/stories/components/Layout/Paper/utils/scss/mixins.scss +46 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte +17 -16
- package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.svelte +4 -4
- package/src/lib/stories/{philosophy/Colors/Swatches/Palette.svelte → developer tools/philosophy/Colors/Swatches/Palette.svelte } +1 -1
- package/src/lib/stories/{philosophy/Colors/Swatches/Swatch.svelte → developer tools/philosophy/Colors/Swatches/Swatch.svelte } +1 -1
- package/src/lib/stories/{philosophy/Colors/Swatches/Swatches.svelte → developer tools/philosophy/Colors/Swatches/Swatches.svelte } +1 -1
- package/src/lib/stories/{philosophy/Colors/utils/color.ts → developer tools/philosophy/Colors/utils/color.ts } +1 -1
- package/src/lib/styles/_colors.css +44 -44
- package/src/lib/styles/_components.css +6 -3
- package/src/lib/styles/_shadow.css +13 -20
- package/src/lib/styles/_space.css +7 -0
- package/src/lib/styles/global.css +1 -0
- package/src/lib/types/colors.ts +16 -0
- package/src/lib/types/roundness.ts +3 -0
- package/src/lib/types/shadow.ts +3 -0
- package/src/lib/types/size.ts +3 -0
- package/src/lib/types/weight.ts +3 -0
- package/dist/types.d.ts +0 -5
- package/dist/types.js +0 -1
- package/src/lib/stories/Home.mdx +0 -61
- package/src/lib/stories/assets/dark-theme-toggle.png +0 -0
- package/src/lib/stories/components/Form/Button/Button.stories.svelte +0 -82
- package/src/lib/stories/components/Form/Button/Color/Color.stories.svelte +0 -68
- package/src/lib/stories/components/Form/Button/Events/Events.stories.svelte +0 -42
- package/src/lib/stories/components/Form/Button/IconButton/IconButton.stories.svelte +0 -51
- package/src/lib/stories/components/Form/Button/Roundness/Roundness.stories.svelte +0 -49
- package/src/lib/stories/components/Form/Button/Size/Size.stories.svelte +0 -22
- package/src/lib/stories/components/Form/Button/Variant/Variant.stories.svelte +0 -21
- package/src/lib/stories/components/Form/FormControl/FormControl.stories.svelte +0 -29
- package/src/lib/stories/components/Form/Label/Label.stories.svelte +0 -23
- package/src/lib/stories/components/Form/Message/Color/Color.stories.svelte +0 -36
- package/src/lib/stories/components/Form/Message/Message.stories.svelte +0 -35
- package/src/lib/stories/components/Form/Message/Size/Size.stories.svelte +0 -24
- package/src/lib/stories/components/Form/PasswordInput/Events/Events.stories.svelte +0 -174
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +0 -57
- package/src/lib/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +0 -20
- package/src/lib/stories/components/Form/PasswordInput/Size/Size.stories.svelte +0 -16
- package/src/lib/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +0 -31
- package/src/lib/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +0 -79
- package/src/lib/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +0 -24
- package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +0 -64
- package/src/lib/stories/components/Form/SimpleSelect/Size/Size.stories.svelte +0 -20
- package/src/lib/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +0 -36
- package/src/lib/stories/components/Form/TextInput/Events/Events.stories.svelte +0 -153
- package/src/lib/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +0 -21
- package/src/lib/stories/components/Form/TextInput/Size/Size.stories.svelte +0 -17
- package/src/lib/stories/components/Form/TextInput/TextInput.stories.svelte +0 -41
- package/src/lib/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +0 -47
- package/src/lib/stories/components/Layout/Paper/Paper.stories.svelte +0 -41
- package/src/lib/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +0 -30
- package/src/lib/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +0 -42
- package/src/lib/stories/developer tools/Intro.mdx +0 -7
- package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +0 -38
- package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +0 -20
- package/src/lib/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte +0 -16
- package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +0 -47
- package/src/lib/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +0 -27
- package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +0 -33
- package/src/lib/stories/philosophy/Colors/Colors.mdx +0 -43
- package/src/lib/stories/philosophy/Colors/Colors.stories.svelte +0 -22
- package/src/lib/stories/philosophy/Colors/Opacity.stories.svelte +0 -11
- package/src/lib/stories/philosophy/Themes.mdx +0 -23
- package/src/lib/types.ts +0 -6
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.stories.svelte +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.stories.svelte.d.ts +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.svelte +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.svelte.d.ts +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.stories.svelte +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.stories.svelte.d.ts +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.svelte +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.svelte.d.ts +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Swatches/Palette.svelte.d.ts +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Swatches/Swatch.svelte.d.ts +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Swatches/Swatches.svelte.d.ts +0 -0
- /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/utils/color.d.ts +0 -0
- /package/src/lib/stories/{philosophy → developer tools/philosophy}/Colors/Colors.svelte +0 -0
- /package/src/lib/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.svelte +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import './styles/global.css';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ComponentColorPriority, ComponentColorSeverity, ComponentColor, } from './types/colors.js';
|
|
3
|
+
export type { ComponentRoundness } from './types/roundness.js';
|
|
4
|
+
export type { ComponentSize } from './types/size.js';
|
|
5
|
+
export type { ComponentWeight } from './types/weight.js';
|
|
3
6
|
/** developer tools: components: UtilityButton */
|
|
4
7
|
export { default as UtilityButton } from './stories/developer tools/components/UtilityButton/UtilityButton.svelte';
|
|
5
8
|
/** developer tools: components: InputEnclosure */
|
|
6
9
|
export { default as InputEnclosure } from './stories/developer tools/components/InputEnclosure/InputEnclosure.svelte';
|
|
7
10
|
/** Form: Button */
|
|
8
11
|
export { default as Button } from './stories/components/Form/Button/Button.svelte';
|
|
9
|
-
export type {
|
|
12
|
+
export type { ButtonLinkTarget, ButtonLinkReferrerpolicy, ButtonType, } from './stories/components/Form/Button/Button.svelte';
|
|
10
13
|
/** Form: TextInput */
|
|
11
14
|
export { default as TextInput } from './stories/components/Form/TextInput/TextInput.svelte';
|
|
12
15
|
export type { TextInputType, TextInputFocusEvent, TextInputClipboardEvent, } from './stories/components/Form/TextInput/TextInput.svelte';
|
|
@@ -19,10 +22,9 @@ export { default as Label } from './stories/components/Form/Label/Label.svelte';
|
|
|
19
22
|
export { default as FormControl } from './stories/components/Form/FormControl/FormControl.svelte';
|
|
20
23
|
/** Form: Message */
|
|
21
24
|
export { default as Message } from './stories/components/Form/Message/Message.svelte';
|
|
22
|
-
export type { MessageColor } from './stories/components/Form/Message/Message.svelte';
|
|
23
25
|
/** Form: SimpleSelect */
|
|
24
26
|
export { default as SimpleSelect } from './stories/components/Form/SimpleSelect/SimpleSelect.svelte';
|
|
25
27
|
export type { SimpleSelectFocusEvent, SimpleSelectOption, } from './stories/components/Form/SimpleSelect/SimpleSelect.svelte';
|
|
26
28
|
/** Layout: Paper */
|
|
27
29
|
export { default as Paper } from './stories/components/Layout/Paper/Paper.svelte';
|
|
28
|
-
export type {
|
|
30
|
+
export type { PaperColor } from './stories/components/Layout/Paper/Paper.svelte';
|
package/dist/stories/Home.mdx
CHANGED
|
@@ -42,7 +42,7 @@ npm i @flightlesslabs/dodo-ui
|
|
|
42
42
|
|
|
43
43
|
## Use it!
|
|
44
44
|
|
|
45
|
-
Lets import [Button](?path=/docs/components-form-button--docs) component
|
|
45
|
+
Lets import [Button](?path=/docs/components-form-button--docs) component. Checkout documentation for [Button](?path=/docs/components-form-button--docs)
|
|
46
46
|
|
|
47
47
|
<Source
|
|
48
48
|
dark
|
|
@@ -52,10 +52,8 @@ import { Button } '@flightlesslabs/dodo-ui';
|
|
|
52
52
|
`}
|
|
53
53
|
/>
|
|
54
54
|
|
|
55
|
-
Checkout documentation for [Button](?path=/docs/components-form-button--docs)
|
|
56
|
-
|
|
57
55
|
## Explore more
|
|
58
56
|
|
|
59
|
-
- [
|
|
60
|
-
- [Colors](?path=/docs/philosophy-colors--docs)
|
|
61
|
-
- [Adjust Color Opacity](?path=/docs/philosophy-colors--docs#adjusting-opacity)
|
|
57
|
+
- [Dark Theme ?](?path=/docs/developer-tools-philosophy-themes--docs#dark-theme)
|
|
58
|
+
- [Colors](?path=/docs/developer-tools-philosophy-colors--docs)
|
|
59
|
+
- [Adjust Color Opacity](?path=/docs/developer-tools-philosophy-colors--docs#adjusting-opacity)
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
<script module lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import Button, { buttonTypeArray } from './Button.svelte';
|
|
3
|
+
import { componentRoundnessArray } from '../../../../types/roundness.js';
|
|
4
|
+
import { componentColorArray } from '../../../../types/colors.js';
|
|
5
|
+
import { componentWeightArray } from '../../../../types/weight.js';
|
|
6
|
+
import { componentSizeArray } from '../../../../types/size.js';
|
|
4
7
|
export const storyButtonArgTypes = {
|
|
5
8
|
type: {
|
|
6
9
|
control: { type: 'select' },
|
|
7
|
-
options:
|
|
10
|
+
options: buttonTypeArray,
|
|
8
11
|
},
|
|
9
12
|
color: {
|
|
10
13
|
control: { type: 'select' },
|
|
11
|
-
options:
|
|
14
|
+
options: componentColorArray,
|
|
12
15
|
},
|
|
13
16
|
variant: {
|
|
14
17
|
control: { type: 'select' },
|
|
15
|
-
options:
|
|
18
|
+
options: componentWeightArray,
|
|
16
19
|
},
|
|
17
20
|
roundness: {
|
|
18
21
|
control: { type: 'select' },
|
|
19
|
-
options:
|
|
22
|
+
options: componentRoundnessArray,
|
|
20
23
|
},
|
|
21
24
|
size: {
|
|
22
25
|
control: { type: 'select' },
|
|
23
|
-
options:
|
|
26
|
+
options: componentSizeArray,
|
|
24
27
|
},
|
|
25
28
|
};
|
|
26
29
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
@@ -28,51 +31,27 @@ const { Story } = defineMeta({
|
|
|
28
31
|
component: Button,
|
|
29
32
|
tags: ['autodocs'],
|
|
30
33
|
argTypes: storyButtonArgTypes,
|
|
31
|
-
args: {
|
|
32
|
-
onclick: fn(),
|
|
33
|
-
},
|
|
34
34
|
});
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
|
-
<!-- ⚠️ Test Button: Do not use! -->
|
|
38
|
-
<Story
|
|
39
|
-
name="Test Button"
|
|
40
|
-
args={{
|
|
41
|
-
outline: false,
|
|
42
|
-
disabled: false,
|
|
43
|
-
compact: false,
|
|
44
|
-
_unsafeChildrenStringForTesting: 'Click me!',
|
|
45
|
-
}}
|
|
46
|
-
/>
|
|
47
|
-
|
|
48
37
|
<!-- Button with default style -->
|
|
49
|
-
<Story name="
|
|
50
|
-
<Button>Click me!</Button>
|
|
51
|
-
</Story>
|
|
38
|
+
<Story name="Primary">Click me!</Story>
|
|
52
39
|
|
|
53
40
|
<!-- Button with border around it -->
|
|
54
|
-
<Story name="Outline" args={{ outline: true }}>
|
|
55
|
-
<Button outline>Click me!</Button>
|
|
56
|
-
</Story>
|
|
41
|
+
<Story name="Outline" args={{ outline: true, variant: 'text' }}>Click me!</Story>
|
|
57
42
|
|
|
58
|
-
<Story name="Disabled" args={{ disabled: true }}>
|
|
59
|
-
<Button disabled>Click me!</Button>
|
|
60
|
-
</Story>
|
|
43
|
+
<Story name="Disabled" args={{ disabled: true }}>Click me!</Story>
|
|
61
44
|
|
|
62
45
|
<!-- Form submit button -->
|
|
63
|
-
<Story name="Sumbit Button" args={{ type: 'submit' }}>
|
|
64
|
-
<Button type="submit">Submit Form</Button>
|
|
65
|
-
</Story>
|
|
46
|
+
<Story name="Sumbit Button" args={{ type: 'submit' }}>Submit Form</Story>
|
|
66
47
|
|
|
67
48
|
<!-- Form submit button -->
|
|
68
|
-
<Story name="Full width Button" args={{ fullWidth: true }}>
|
|
69
|
-
<Button fullWidth>Click me!</Button>
|
|
70
|
-
</Story>
|
|
49
|
+
<Story name="Full width Button" args={{ fullWidth: true }}>Click me!</Story>
|
|
71
50
|
|
|
72
51
|
<!-- Anchor Link styled like a Button -->
|
|
73
52
|
<Story
|
|
74
53
|
name="Link Button"
|
|
75
54
|
args={{ href: 'https://www.w3schools.com/tags/tag_a.asp', target: '_blank' }}
|
|
76
55
|
>
|
|
77
|
-
|
|
56
|
+
Link
|
|
78
57
|
</Story>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<script lang="ts" module>export
|
|
1
|
+
<script lang="ts" module>export const buttonTypeArray = ['button', 'submit'];
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
|
-
<script lang="ts">let { children, type = 'button', size = 'normal', color = '
|
|
4
|
+
<script lang="ts">let { children, type = 'button', size = 'normal', color = 'primary', roundness = 1, variant = 'solid', outline = false, compact = false, fullWidth = false, name, id, title, class: className = '', disabled = false, onclick, before, after, href, download, hreflang, media, ping, rel, target, anchorMediaType, referrerpolicy, ref = $bindable(), } = $props();
|
|
5
5
|
export {};
|
|
6
6
|
</script>
|
|
7
7
|
|
|
@@ -14,8 +14,6 @@ export {};
|
|
|
14
14
|
|
|
15
15
|
{#if children}
|
|
16
16
|
{@render children()}
|
|
17
|
-
{:else if _unsafeChildrenStringForTesting}
|
|
18
|
-
{_unsafeChildrenStringForTesting}
|
|
19
17
|
{/if}
|
|
20
18
|
|
|
21
19
|
{#if after}
|
|
@@ -80,15 +78,15 @@ export {};
|
|
|
80
78
|
{/if}
|
|
81
79
|
|
|
82
80
|
<style>:global(:root) {
|
|
83
|
-
--dodo-ui-Button-disabled-color: var(--dodo-color-
|
|
84
|
-
--dodo-ui-Button-disabled-bg: var(--dodo-color-
|
|
85
|
-
--dodo-ui-Button-outline-
|
|
86
|
-
--dodo-ui-Button-text-
|
|
87
|
-
--dodo-ui-Button-text-
|
|
88
|
-
--dodo-ui-Button-text-
|
|
89
|
-
--dodo-ui-Button-solid-
|
|
90
|
-
--dodo-ui-Button-solid-
|
|
91
|
-
--dodo-ui-Button-solid-
|
|
81
|
+
--dodo-ui-Button-disabled-color: var(--dodo-color-neutral-400);
|
|
82
|
+
--dodo-ui-Button-disabled-bg: var(--dodo-color-neutral-200);
|
|
83
|
+
--dodo-ui-Button-outline-neutral: var(--dodo-color-neutral-400);
|
|
84
|
+
--dodo-ui-Button-text-neutral-bg: var(--dodo-color-neutral-100);
|
|
85
|
+
--dodo-ui-Button-text-neutral-hover-bg: var(--dodo-color-neutral-200);
|
|
86
|
+
--dodo-ui-Button-text-neutral-active-bg: var(--dodo-color-neutral-300);
|
|
87
|
+
--dodo-ui-Button-solid-neutral-bg: var(--dodo-color-neutral-500);
|
|
88
|
+
--dodo-ui-Button-solid-neutral-hover-bg: var(--dodo-color-neutral-600);
|
|
89
|
+
--dodo-ui-Button-solid-neutral-active-bg: var(--dodo-color-neutral-700);
|
|
92
90
|
--dodo-ui-Button-outline-primary: var(--dodo-color-primary-400);
|
|
93
91
|
--dodo-ui-Button-text-primary-bg: var(--dodo-color-primary-100);
|
|
94
92
|
--dodo-ui-Button-text-primary-hover-bg: var(--dodo-color-primary-200);
|
|
@@ -127,15 +125,15 @@ export {};
|
|
|
127
125
|
}
|
|
128
126
|
|
|
129
127
|
:global(.dodo-theme--dark) {
|
|
130
|
-
--dodo-ui-Button-disabled-bg: var(--dodo-color-
|
|
131
|
-
--dodo-ui-Button-disabled-color: var(--dodo-color-
|
|
132
|
-
--dodo-ui-Button-outline-
|
|
133
|
-
--dodo-ui-Button-text-
|
|
134
|
-
--dodo-ui-Button-text-
|
|
135
|
-
--dodo-ui-Button-text-
|
|
136
|
-
--dodo-ui-Button-solid-
|
|
137
|
-
--dodo-ui-Button-solid-
|
|
138
|
-
--dodo-ui-Button-solid-
|
|
128
|
+
--dodo-ui-Button-disabled-bg: var(--dodo-color-neutral-100);
|
|
129
|
+
--dodo-ui-Button-disabled-color: var(--dodo-color-neutral-500);
|
|
130
|
+
--dodo-ui-Button-outline-neutral: var(--dodo-color-neutral-300);
|
|
131
|
+
--dodo-ui-Button-text-neutral-bg: var(--dodo-color-neutral-50);
|
|
132
|
+
--dodo-ui-Button-text-neutral-hover-bg: var(--dodo-color-neutral-100);
|
|
133
|
+
--dodo-ui-Button-text-neutral-active-bg: var(--dodo-color-neutral-200);
|
|
134
|
+
--dodo-ui-Button-solid-neutral-bg: var(--dodo-color-neutral-300);
|
|
135
|
+
--dodo-ui-Button-solid-neutral-hover-bg: var(--dodo-color-neutral-200);
|
|
136
|
+
--dodo-ui-Button-solid-neutral-active-bg: var(--dodo-color-neutral-100);
|
|
139
137
|
--dodo-ui-Button-outline-primary: var(--dodo-color-primary-300);
|
|
140
138
|
--dodo-ui-Button-text-primary-bg: var(--dodo-color-primary-50);
|
|
141
139
|
--dodo-ui-Button-text-primary-hover-bg: var(--dodo-color-primary-100);
|
|
@@ -195,55 +193,55 @@ export {};
|
|
|
195
193
|
.dodo-ui-Button.size--normal {
|
|
196
194
|
height: var(--dodo-ui-element-height-normal);
|
|
197
195
|
font-size: 1rem;
|
|
198
|
-
padding: 0
|
|
196
|
+
padding: 0 calc(var(--dodo-ui-space-small) * 2);
|
|
199
197
|
min-width: 45px;
|
|
200
198
|
}
|
|
201
199
|
.dodo-ui-Button.size--small {
|
|
202
200
|
height: var(--dodo-ui-element-height-small);
|
|
203
|
-
padding: 0
|
|
201
|
+
padding: 0 var(--dodo-ui-space);
|
|
204
202
|
font-size: 0.9rem;
|
|
205
203
|
min-width: 35px;
|
|
206
204
|
}
|
|
207
205
|
.dodo-ui-Button.size--large {
|
|
208
206
|
height: var(--dodo-ui-element-height-large);
|
|
209
207
|
font-size: 1.1rem;
|
|
210
|
-
padding: 0
|
|
208
|
+
padding: 0 calc(var(--dodo-ui-space) * 2);
|
|
211
209
|
min-width: 85px;
|
|
212
210
|
}
|
|
213
|
-
.dodo-ui-Button.roundness--
|
|
214
|
-
border-radius: var(--dodo-ui-element-roundness-
|
|
211
|
+
.dodo-ui-Button.roundness--1 {
|
|
212
|
+
border-radius: var(--dodo-ui-element-roundness-1);
|
|
215
213
|
}
|
|
216
|
-
.dodo-ui-Button.roundness--
|
|
217
|
-
border-radius: var(--dodo-ui-element-roundness-
|
|
214
|
+
.dodo-ui-Button.roundness--2 {
|
|
215
|
+
border-radius: var(--dodo-ui-element-roundness-2);
|
|
218
216
|
}
|
|
219
|
-
.dodo-ui-Button.roundness--
|
|
220
|
-
border-radius: var(--dodo-ui-element-roundness-
|
|
217
|
+
.dodo-ui-Button.roundness--3 {
|
|
218
|
+
border-radius: var(--dodo-ui-element-roundness-3);
|
|
221
219
|
}
|
|
222
220
|
.dodo-ui-Button.roundness--full {
|
|
223
221
|
border-radius: 50%;
|
|
224
222
|
}
|
|
225
|
-
.dodo-ui-Button.color--
|
|
226
|
-
color: var(--dodo-color-
|
|
227
|
-
background-color: var(--dodo-ui-Button-text-
|
|
223
|
+
.dodo-ui-Button.color--neutral.variant--text {
|
|
224
|
+
color: var(--dodo-color-neutral-800);
|
|
225
|
+
background-color: var(--dodo-ui-Button-text-neutral-bg);
|
|
228
226
|
}
|
|
229
|
-
.dodo-ui-Button.color--
|
|
230
|
-
background-color: var(--dodo-ui-Button-text-
|
|
227
|
+
.dodo-ui-Button.color--neutral.variant--text:hover {
|
|
228
|
+
background-color: var(--dodo-ui-Button-text-neutral-hover-bg);
|
|
231
229
|
}
|
|
232
|
-
.dodo-ui-Button.color--
|
|
233
|
-
background-color: var(--dodo-ui-Button-text-
|
|
230
|
+
.dodo-ui-Button.color--neutral.variant--text:active {
|
|
231
|
+
background-color: var(--dodo-ui-Button-text-neutral-active-bg);
|
|
234
232
|
}
|
|
235
|
-
.dodo-ui-Button.color--
|
|
236
|
-
border-color: var(--dodo-ui-Button-outline-
|
|
233
|
+
.dodo-ui-Button.color--neutral.variant--text.outline {
|
|
234
|
+
border-color: var(--dodo-ui-Button-outline-neutral);
|
|
237
235
|
}
|
|
238
|
-
.dodo-ui-Button.color--
|
|
236
|
+
.dodo-ui-Button.color--neutral.variant--solid {
|
|
239
237
|
color: var(--dodo-color-constant-white);
|
|
240
|
-
background-color: var(--dodo-ui-Button-solid-
|
|
238
|
+
background-color: var(--dodo-ui-Button-solid-neutral-bg);
|
|
241
239
|
}
|
|
242
|
-
.dodo-ui-Button.color--
|
|
243
|
-
background-color: var(--dodo-ui-Button-solid-
|
|
240
|
+
.dodo-ui-Button.color--neutral.variant--solid:hover {
|
|
241
|
+
background-color: var(--dodo-ui-Button-solid-neutral-hover-bg);
|
|
244
242
|
}
|
|
245
|
-
.dodo-ui-Button.color--
|
|
246
|
-
background-color: var(--dodo-ui-Button-solid-
|
|
243
|
+
.dodo-ui-Button.color--neutral.variant--solid:active {
|
|
244
|
+
background-color: var(--dodo-ui-Button-solid-neutral-active-bg);
|
|
247
245
|
}
|
|
248
246
|
.dodo-ui-Button.color--primary.variant--text {
|
|
249
247
|
color: var(--dodo-color-primary-800);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export type ButtonColor = 'default' | 'primary' | 'secondary' | 'safe' | 'warning' | 'danger';
|
|
2
|
-
export type ButtonRoundness = ComponentRoundness | false | ComponentRoundnessFull;
|
|
3
1
|
export type ButtonLinkTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {}) | undefined | null;
|
|
4
2
|
export type ButtonLinkReferrerpolicy = ReferrerPolicy | undefined | null;
|
|
5
|
-
|
|
3
|
+
export type ButtonType = 'button' | 'submit';
|
|
4
|
+
export declare const buttonTypeArray: ButtonType[];
|
|
5
|
+
import type { ComponentColor } from '../../../../types/colors.js';
|
|
6
|
+
import type { ComponentRoundness } from '../../../../types/roundness.js';
|
|
7
|
+
import type { ComponentSize } from '../../../../types/size.js';
|
|
8
|
+
import type { ComponentWeight } from '../../../../types/weight.js';
|
|
6
9
|
import type { Snippet } from 'svelte';
|
|
7
10
|
import type { MouseEventHandler } from 'svelte/elements';
|
|
8
11
|
interface ButtonProps {
|
|
@@ -11,17 +14,17 @@ interface ButtonProps {
|
|
|
11
14
|
/** Button ref */
|
|
12
15
|
ref?: HTMLButtonElement | HTMLAnchorElement;
|
|
13
16
|
/** Regular button or submit button? */
|
|
14
|
-
type?:
|
|
17
|
+
type?: ButtonType;
|
|
15
18
|
/** How large should the button be? */
|
|
16
19
|
size?: ComponentSize;
|
|
17
20
|
/** Full width button? */
|
|
18
21
|
fullWidth?: boolean;
|
|
19
22
|
/** What color to use? */
|
|
20
|
-
color?:
|
|
23
|
+
color?: ComponentColor;
|
|
21
24
|
/** How round should the border radius be? */
|
|
22
|
-
roundness?:
|
|
25
|
+
roundness?: ComponentRoundness;
|
|
23
26
|
/** How should the button appear? */
|
|
24
|
-
variant?:
|
|
27
|
+
variant?: ComponentWeight;
|
|
25
28
|
/** Add a border around the button */
|
|
26
29
|
outline?: boolean;
|
|
27
30
|
/** Compact button for icons */
|
|
@@ -60,8 +63,6 @@ interface ButtonProps {
|
|
|
60
63
|
anchorMediaType?: string | undefined | null;
|
|
61
64
|
/** Link button: referrerpolicy */
|
|
62
65
|
referrerpolicy?: ButtonLinkReferrerpolicy;
|
|
63
|
-
/** Test: ⚠️ Unsafe Children String. Do Not use*/
|
|
64
|
-
_unsafeChildrenStringForTesting?: string;
|
|
65
66
|
}
|
|
66
67
|
declare const Button: import("svelte").Component<ButtonProps, {}, "ref">;
|
|
67
68
|
type Button = ReturnType<typeof Button>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { fn } from '@storybook/test';
|
|
4
3
|
import Button from '../Button.svelte';
|
|
5
4
|
import { storyButtonArgTypes } from '../Button.stories.svelte';
|
|
6
5
|
|
|
@@ -9,60 +8,36 @@
|
|
|
9
8
|
component: Button,
|
|
10
9
|
tags: ['autodocs'],
|
|
11
10
|
argTypes: storyButtonArgTypes,
|
|
12
|
-
args: {
|
|
13
|
-
onclick: fn(),
|
|
14
|
-
},
|
|
15
11
|
});
|
|
16
12
|
</script>
|
|
17
13
|
|
|
18
|
-
<Story name="
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<Story name="
|
|
22
|
-
<Story name="
|
|
23
|
-
|
|
24
|
-
</Story>
|
|
25
|
-
<Story name="Safe" args={{ color: 'safe' }}><Button color="safe">Click me!</Button></Story>
|
|
26
|
-
<Story name="Warning" args={{ color: 'warning' }}><Button color="warning">Click me!</Button></Story>
|
|
27
|
-
<Story name="Danger" args={{ color: 'danger' }}><Button color="danger">Click me!</Button></Story>
|
|
14
|
+
<Story name="Primary">Click me!</Story>
|
|
15
|
+
<Story name="Secondary" args={{ color: 'secondary' }}>Click me!</Story>
|
|
16
|
+
<Story name="Neutral" args={{ color: 'neutral' }}>Click me!</Story>
|
|
17
|
+
<Story name="Safe" args={{ color: 'safe' }}>Click me!</Story>
|
|
18
|
+
<Story name="Warning" args={{ color: 'warning' }}>Click me!</Story>
|
|
19
|
+
<Story name="Danger" args={{ color: 'danger' }}>Click me!</Story>
|
|
28
20
|
|
|
29
|
-
<Story
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<Story name="Primary Solid" args={{ color: 'primary', variant: 'solid' }}>
|
|
36
|
-
<Button color="primary" variant="solid">Click me!</Button>
|
|
37
|
-
</Story>
|
|
38
|
-
<Story name="Secondary Solid" args={{ color: 'secondary', variant: 'solid' }}>
|
|
39
|
-
<Button color="secondary" variant="solid">Click me!</Button>
|
|
40
|
-
</Story>
|
|
41
|
-
<Story name="Safe Solid" args={{ color: 'safe', variant: 'solid' }}>
|
|
42
|
-
<Button color="safe" variant="solid">Click me!</Button>
|
|
43
|
-
</Story>
|
|
44
|
-
<Story name="Warning Solid" args={{ color: 'warning', variant: 'solid' }}>
|
|
45
|
-
<Button color="warning" variant="solid">Click me!</Button>
|
|
46
|
-
</Story>
|
|
47
|
-
<Story name="Danger Solid" args={{ color: 'danger', variant: 'solid' }}>
|
|
48
|
-
<Button color="danger" variant="solid">Click me!</Button>
|
|
49
|
-
</Story>
|
|
21
|
+
<Story name="Primary Text" args={{ color: 'primary', variant: 'text' }}>Click me!</Story>
|
|
22
|
+
<Story name="Secondary Text" args={{ color: 'secondary', variant: 'text' }}>Click me!</Story>
|
|
23
|
+
<Story name="Neutral Text" args={{ color: 'neutral', variant: 'text' }}>Click me!</Story>
|
|
24
|
+
<Story name="Safe Text" args={{ color: 'safe', variant: 'text' }}>Click me!</Story>
|
|
25
|
+
<Story name="Warning Text" args={{ color: 'warning', variant: 'text' }}>Click me!</Story>
|
|
26
|
+
<Story name="Danger Text" args={{ color: 'danger', variant: 'text' }}>Click me!</Story>
|
|
50
27
|
|
|
51
|
-
<Story name="
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<Story name="Primary Outline" args={{ outline: true, color: 'primary' }}>
|
|
55
|
-
<Button color="primary" outline>Click me!</Button>
|
|
28
|
+
<Story name="Primary Outline" args={{ variant: 'text', outline: true }}>Click me!</Story>
|
|
29
|
+
<Story name="Secondary Outline" args={{ color: 'secondary', variant: 'text', outline: true }}>
|
|
30
|
+
Click me!
|
|
56
31
|
</Story>
|
|
57
|
-
<Story name="
|
|
58
|
-
|
|
32
|
+
<Story name="Neutral Outline" args={{ color: 'neutral', variant: 'text', outline: true }}>
|
|
33
|
+
Click me!
|
|
59
34
|
</Story>
|
|
60
|
-
<Story name="Safe Outline" args={{
|
|
61
|
-
|
|
35
|
+
<Story name="Safe Outline" args={{ color: 'safe', variant: 'text', outline: true }}>
|
|
36
|
+
Click me!
|
|
62
37
|
</Story>
|
|
63
|
-
<Story name="Warning Outline" args={{
|
|
64
|
-
|
|
38
|
+
<Story name="Warning Outline" args={{ color: 'warning', variant: 'text', outline: true }}>
|
|
39
|
+
Click me!
|
|
65
40
|
</Story>
|
|
66
|
-
<Story name="Danger Outline" args={{
|
|
67
|
-
|
|
41
|
+
<Story name="Danger Outline" args={{ color: 'danger', variant: 'text', outline: true }}>
|
|
42
|
+
Click me!
|
|
68
43
|
</Story>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script module lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
2
|
-
import { fn } from '@storybook/test';
|
|
3
2
|
import Button from '../Button.svelte';
|
|
4
3
|
import { storyButtonArgTypes } from '../Button.stories.svelte';
|
|
5
4
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
@@ -7,18 +6,12 @@ const { Story } = defineMeta({
|
|
|
7
6
|
component: Button,
|
|
8
7
|
tags: ['autodocs'],
|
|
9
8
|
argTypes: storyButtonArgTypes,
|
|
10
|
-
args: {
|
|
11
|
-
onclick: fn(),
|
|
12
|
-
},
|
|
13
9
|
});
|
|
14
10
|
</script>
|
|
15
11
|
|
|
16
12
|
<Story
|
|
17
13
|
name="Click"
|
|
18
14
|
args={{
|
|
19
|
-
outline: false,
|
|
20
|
-
disabled: false,
|
|
21
|
-
compact: false,
|
|
22
15
|
onclick: (e: Event) => {
|
|
23
16
|
const target = e.target as HTMLButtonElement;
|
|
24
17
|
|
|
@@ -26,6 +19,7 @@ const { Story } = defineMeta({
|
|
|
26
19
|
console.log('Button Clicked', target);
|
|
27
20
|
},
|
|
28
21
|
}}
|
|
22
|
+
asChild
|
|
29
23
|
>
|
|
30
24
|
<Button
|
|
31
25
|
onclick={(e: Event) => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { fn } from '@storybook/test';
|
|
4
3
|
import Button from '../Button.svelte';
|
|
5
4
|
import { storyButtonArgTypes } from '../Button.stories.svelte';
|
|
6
5
|
import Icon from '@iconify/svelte';
|
|
@@ -10,28 +9,21 @@
|
|
|
10
9
|
component: Button,
|
|
11
10
|
tags: ['autodocs'],
|
|
12
11
|
argTypes: storyButtonArgTypes,
|
|
13
|
-
args: {
|
|
14
|
-
onclick: fn(),
|
|
15
|
-
},
|
|
16
12
|
});
|
|
17
13
|
</script>
|
|
18
14
|
|
|
19
15
|
<!-- Compact button with paddings stripped out and fixed size. We are using this icon library https://iconify.design/docs/icon-components/svelte/ -->
|
|
20
16
|
<Story name="Icon Button" args={{ compact: true }}>
|
|
21
|
-
<
|
|
22
|
-
<Icon icon="material-symbols:app-badging" width="18" height="18" />
|
|
23
|
-
</Button>
|
|
17
|
+
<Icon icon="material-symbols:app-badging" width="18" height="18" />
|
|
24
18
|
</Story>
|
|
25
19
|
|
|
26
20
|
<!-- Circualr Icon button. -->
|
|
27
21
|
<Story name="Icon Button Circular" args={{ compact: true, roundness: 'full' }}>
|
|
28
|
-
<
|
|
29
|
-
<Icon icon="material-symbols:app-badging" width="18" height="18" />
|
|
30
|
-
</Button>
|
|
22
|
+
<Icon icon="material-symbols:app-badging" width="18" height="18" />
|
|
31
23
|
</Story>
|
|
32
24
|
|
|
33
25
|
<!-- Button with an icon in front. -->
|
|
34
|
-
<Story name="Icon Before">
|
|
26
|
+
<Story name="Icon Before" asChild>
|
|
35
27
|
<Button>
|
|
36
28
|
{#snippet before()}
|
|
37
29
|
<Icon icon="material-symbols:content-copy" />
|
|
@@ -41,7 +33,7 @@
|
|
|
41
33
|
</Story>
|
|
42
34
|
|
|
43
35
|
<!-- Button with an icon in front. -->
|
|
44
|
-
<Story name="Icon After">
|
|
36
|
+
<Story name="Icon After" asChild>
|
|
45
37
|
<Button>
|
|
46
38
|
{#snippet after()}
|
|
47
39
|
<Icon icon="material-symbols:download-2" />
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { fn } from '@storybook/test';
|
|
4
3
|
import Button from '../Button.svelte';
|
|
5
4
|
import { storyButtonArgTypes } from '../Button.stories.svelte';
|
|
6
5
|
|
|
@@ -9,41 +8,16 @@
|
|
|
9
8
|
component: Button,
|
|
10
9
|
tags: ['autodocs'],
|
|
11
10
|
argTypes: storyButtonArgTypes,
|
|
12
|
-
args: {
|
|
13
|
-
onclick: fn(),
|
|
14
|
-
},
|
|
15
11
|
});
|
|
16
12
|
</script>
|
|
17
13
|
|
|
18
|
-
<Story name="Roundness
|
|
19
|
-
<Button>Click me!</Button>
|
|
20
|
-
</Story>
|
|
14
|
+
<Story name="Roundness 1">Click me!</Story>
|
|
21
15
|
|
|
22
|
-
<Story
|
|
23
|
-
name="Roundness 2x"
|
|
24
|
-
args={{ outline: false, disabled: false, compact: false, roundness: '2x' }}
|
|
25
|
-
>
|
|
26
|
-
<Button roundness="2x">Click me!</Button>
|
|
27
|
-
</Story>
|
|
16
|
+
<Story name="Roundness 2" args={{ roundness: 2 }}>Click me!</Story>
|
|
28
17
|
|
|
29
|
-
<Story
|
|
30
|
-
name="Roundness 3x"
|
|
31
|
-
args={{ outline: false, disabled: false, compact: false, roundness: '3x' }}
|
|
32
|
-
>
|
|
33
|
-
<Button roundness="3x">Click me!</Button>
|
|
34
|
-
</Story>
|
|
18
|
+
<Story name="Roundness 3" args={{ roundness: 3 }}>Click me!</Story>
|
|
35
19
|
|
|
36
|
-
<Story
|
|
37
|
-
name="Roundness False"
|
|
38
|
-
args={{ outline: false, disabled: false, compact: false, roundness: false }}
|
|
39
|
-
>
|
|
40
|
-
<Button roundness={false}>Click me!</Button>
|
|
41
|
-
</Story>
|
|
20
|
+
<Story name="Roundness 0" args={{ roundness: 0 }}>Click me!</Story>
|
|
42
21
|
|
|
43
22
|
<!-- Button with 50% roundness usefull for icon (Compact) buttons -->
|
|
44
|
-
<Story
|
|
45
|
-
name="Roundness Full"
|
|
46
|
-
args={{ outline: false, disabled: false, compact: false, roundness: 'full' }}
|
|
47
|
-
>
|
|
48
|
-
<Button roundness="full">C</Button>
|
|
49
|
-
</Story>
|
|
23
|
+
<Story name="Roundness Full" args={{ roundness: 'full', compact: true }}>C</Story>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { fn } from '@storybook/test';
|
|
4
3
|
import Button from '../Button.svelte';
|
|
5
4
|
import { storyButtonArgTypes } from '../Button.stories.svelte';
|
|
6
5
|
|
|
@@ -9,14 +8,9 @@
|
|
|
9
8
|
component: Button,
|
|
10
9
|
tags: ['autodocs'],
|
|
11
10
|
argTypes: storyButtonArgTypes,
|
|
12
|
-
args: {
|
|
13
|
-
onclick: fn(),
|
|
14
|
-
},
|
|
15
11
|
});
|
|
16
12
|
</script>
|
|
17
13
|
|
|
18
|
-
<Story name="Normal"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<Story name="Small" args={{ size: 'small' }}><Button size="small">Click me!</Button></Story>
|
|
22
|
-
<Story name="Large" args={{ size: 'large' }}><Button size="large">Click me!</Button></Story>
|
|
14
|
+
<Story name="Normal">Click me!</Story>
|
|
15
|
+
<Story name="Small" args={{ size: 'small' }}>Click me!</Story>
|
|
16
|
+
<Story name="Large" args={{ size: 'large' }}>Click me!</Story>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { fn } from '@storybook/test';
|
|
4
3
|
import Button from '../Button.svelte';
|
|
5
4
|
import { storyButtonArgTypes } from '../Button.stories.svelte';
|
|
6
5
|
|
|
@@ -9,13 +8,11 @@
|
|
|
9
8
|
component: Button,
|
|
10
9
|
tags: ['autodocs'],
|
|
11
10
|
argTypes: storyButtonArgTypes,
|
|
12
|
-
args: {
|
|
13
|
-
onclick: fn(),
|
|
14
|
-
},
|
|
15
11
|
});
|
|
16
12
|
</script>
|
|
17
13
|
|
|
18
|
-
<Story name="
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
<Story name="Solid">Click me!</Story>
|
|
15
|
+
|
|
16
|
+
<Story name="Text" args={{ variant: 'text' }}>Click me!</Story>
|
|
17
|
+
|
|
18
|
+
<Story name="Text Outline" args={{ variant: 'text', outline: true }}>Click me!</Story>
|