@flightlesslabs/dodo-ui 0.6.3 → 0.6.5
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/package.json +40 -42
- package/src/lib/stories/Home.mdx +61 -0
- package/src/lib/stories/assets/dark-theme-toggle.png +0 -0
- package/src/lib/stories/components/Form/Button/Button.stories.svelte +82 -0
- package/src/lib/stories/components/Form/Button/Color/Color.stories.svelte +68 -0
- package/src/lib/stories/components/Form/Button/Events/Events.stories.svelte +42 -0
- package/src/lib/stories/components/Form/Button/IconButton/IconButton.stories.svelte +51 -0
- package/src/lib/stories/components/Form/Button/Roundness/Roundness.stories.svelte +49 -0
- package/src/lib/stories/components/Form/Button/Size/Size.stories.svelte +22 -0
- package/src/lib/stories/components/Form/Button/Variant/Variant.stories.svelte +21 -0
- package/src/lib/stories/components/Form/FormControl/FormControl.stories.svelte +29 -0
- package/src/lib/stories/components/Form/Label/Label.stories.svelte +23 -0
- package/src/lib/stories/components/Form/Message/Color/Color.stories.svelte +36 -0
- package/src/lib/stories/components/Form/Message/Message.stories.svelte +35 -0
- package/src/lib/stories/components/Form/Message/Size/Size.stories.svelte +24 -0
- package/src/lib/stories/components/Form/PasswordInput/Events/Events.stories.svelte +174 -0
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +57 -0
- package/src/lib/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +20 -0
- package/src/lib/stories/components/Form/PasswordInput/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +31 -0
- package/src/lib/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +79 -0
- package/src/lib/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +24 -0
- package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +64 -0
- package/src/lib/stories/components/Form/SimpleSelect/Size/Size.stories.svelte +20 -0
- package/src/lib/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +36 -0
- package/src/lib/stories/components/Form/TextInput/Events/Events.stories.svelte +153 -0
- package/src/lib/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +21 -0
- package/src/lib/stories/components/Form/TextInput/Size/Size.stories.svelte +17 -0
- package/src/lib/stories/components/Form/TextInput/TextInput.stories.svelte +41 -0
- package/src/lib/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +47 -0
- package/src/lib/stories/components/Layout/Paper/Paper.stories.svelte +41 -0
- package/src/lib/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +30 -0
- package/src/lib/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +42 -0
- package/src/lib/stories/developer tools/Intro.mdx +7 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +38 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +20 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +47 -0
- package/src/lib/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +27 -0
- package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +33 -0
- package/src/lib/stories/philosophy/Colors/Colors.mdx +43 -0
- package/src/lib/stories/philosophy/Colors/Colors.stories.svelte +22 -0
- package/src/lib/stories/philosophy/Colors/Colors.svelte +46 -0
- package/src/lib/stories/philosophy/Colors/Opacity.stories.svelte +11 -0
- package/src/lib/stories/philosophy/Colors/Opacity.svelte +23 -0
- package/src/lib/stories/philosophy/Colors/Swatches/Palette.svelte +46 -0
- package/src/lib/stories/philosophy/Colors/Swatches/Swatch.svelte +35 -0
- package/src/lib/stories/philosophy/Colors/Swatches/Swatches.svelte +55 -0
- package/src/lib/stories/philosophy/Colors/utils/color.ts +41 -0
- package/src/lib/stories/philosophy/Themes.mdx +23 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import TextInput from '../TextInput.svelte';
|
|
4
|
+
import { storyTextInputArgTypes } from '../TextInput.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: TextInput,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyTextInputArgTypes,
|
|
11
|
+
args: { value: 'Hello world!' },
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<Story name="Roundness 1x" />
|
|
16
|
+
|
|
17
|
+
<Story name="Roundness 2x" args={{ roundness: '2x' }} />
|
|
18
|
+
|
|
19
|
+
<Story name="Roundness 3x" args={{ roundness: '3x' }} />
|
|
20
|
+
|
|
21
|
+
<Story name="Roundness False" args={{ roundness: false }} />
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import TextInput from '../TextInput.svelte';
|
|
4
|
+
import { storyTextInputArgTypes } from '../TextInput.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: TextInput,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyTextInputArgTypes,
|
|
11
|
+
args: { value: 'Hello world!' },
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<Story name="Normal" />
|
|
16
|
+
<Story name="Small" args={{ size: 'small' }} />
|
|
17
|
+
<Story name="Large" args={{ size: 'large' }} />
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import TextInput from './TextInput.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
|
|
6
|
+
export const storyTextInputArgTypes: StoryBookArgTypes = {
|
|
7
|
+
type: {
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
options: ['text', 'tel', 'email', 'password', 'url', 'number'],
|
|
10
|
+
},
|
|
11
|
+
roundness: {
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
options: [false, '1x', '2x', '3x'],
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
control: { type: 'select' },
|
|
17
|
+
options: ['normal', 'small', 'large'],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
22
|
+
const { Story } = defineMeta({
|
|
23
|
+
component: TextInput,
|
|
24
|
+
tags: ['autodocs'],
|
|
25
|
+
argTypes: storyTextInputArgTypes,
|
|
26
|
+
args: { value: 'Hello world!' },
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<!-- TextInput with default style -->
|
|
31
|
+
<Story name="Default" />
|
|
32
|
+
|
|
33
|
+
<Story name="Placeholder" args={{ value: '', placeholder: 'Type something...' }} />
|
|
34
|
+
|
|
35
|
+
<Story name="No Outline" args={{ outline: false }} />
|
|
36
|
+
|
|
37
|
+
<Story name="Error" args={{ error: true }} />
|
|
38
|
+
|
|
39
|
+
<Story name="Disabled" args={{ disabled: true }} />
|
|
40
|
+
|
|
41
|
+
<Story name="Read only" args={{ readonly: true }} />
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import TextInput from '../TextInput.svelte';
|
|
4
|
+
import { storyTextInputArgTypes } from '../TextInput.stories.svelte';
|
|
5
|
+
import Icon from '@iconify/svelte';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
component: TextInput,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: storyTextInputArgTypes,
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<!-- TextInput icon in front. -->
|
|
16
|
+
<Story name="Icon Before">
|
|
17
|
+
<TextInput>
|
|
18
|
+
{#snippet before()}
|
|
19
|
+
<Icon icon="material-symbols:content-copy" />
|
|
20
|
+
{/snippet}
|
|
21
|
+
</TextInput>
|
|
22
|
+
</Story>
|
|
23
|
+
|
|
24
|
+
<!-- TextInput icon in front. -->
|
|
25
|
+
<Story name="Icon After">
|
|
26
|
+
<TextInput>
|
|
27
|
+
{#snippet after()}
|
|
28
|
+
<Icon icon="material-symbols:download-2" />
|
|
29
|
+
{/snippet}
|
|
30
|
+
</TextInput>
|
|
31
|
+
</Story>
|
|
32
|
+
|
|
33
|
+
<Story name="Small" args={{ size: 'small' }}>
|
|
34
|
+
<TextInput size="small">
|
|
35
|
+
{#snippet before()}
|
|
36
|
+
<Icon icon="material-symbols:content-copy" />
|
|
37
|
+
{/snippet}
|
|
38
|
+
</TextInput>
|
|
39
|
+
</Story>
|
|
40
|
+
|
|
41
|
+
<Story name="Large" args={{ size: 'large' }}>
|
|
42
|
+
<TextInput size="large">
|
|
43
|
+
{#snippet before()}
|
|
44
|
+
<Icon icon="material-symbols:content-copy" />
|
|
45
|
+
{/snippet}
|
|
46
|
+
</TextInput>
|
|
47
|
+
</Story>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Paper from './Paper.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
|
|
6
|
+
export const storyPaperArgTypes: StoryBookArgTypes = {
|
|
7
|
+
roundness: {
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
options: [false, '1x', '2x', '3x', 'full'],
|
|
10
|
+
},
|
|
11
|
+
shadow: {
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
options: [false, '1x', '2x', '3x', '4x', '5x', '6x', '7x'],
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
18
|
+
const { Story } = defineMeta({
|
|
19
|
+
component: Paper,
|
|
20
|
+
tags: ['autodocs'],
|
|
21
|
+
argTypes: storyPaperArgTypes,
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<!-- ⚠️ Test Paper: Do not use! -->
|
|
26
|
+
<Story
|
|
27
|
+
name="Test Paper"
|
|
28
|
+
args={{
|
|
29
|
+
_unsafeChildrenStringForTesting: 'Hola!',
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
<!-- Paper with default style -->
|
|
34
|
+
<Story name="Default">
|
|
35
|
+
<Paper>Hola!</Paper>
|
|
36
|
+
</Story>
|
|
37
|
+
|
|
38
|
+
<!-- Paper with width and height -->
|
|
39
|
+
<Story name="WidthAndHeight">
|
|
40
|
+
<Paper width="200px" height="200px">Hola!</Paper>
|
|
41
|
+
</Story>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Paper from '../Paper.svelte';
|
|
4
|
+
import { storyPaperArgTypes } from '../Paper.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Paper,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyPaperArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Roundness 1x">
|
|
15
|
+
<Paper>Hola!</Paper>
|
|
16
|
+
</Story>
|
|
17
|
+
|
|
18
|
+
<Story name="Roundness 2x" args={{ roundness: '2x' }}><Paper roundness="2x">Hola!</Paper></Story>
|
|
19
|
+
|
|
20
|
+
<Story name="Roundness 3x" args={{ roundness: '3x' }}>
|
|
21
|
+
<Paper roundness="3x">Hola!</Paper>
|
|
22
|
+
</Story>
|
|
23
|
+
|
|
24
|
+
<Story name="Roundness False" args={{ roundness: false }}>
|
|
25
|
+
<Paper roundness={false}>Hola!</Paper>
|
|
26
|
+
</Story>
|
|
27
|
+
|
|
28
|
+
<Story name="Roundness Full" args={{ roundness: 'full' }}>
|
|
29
|
+
<Paper roundness="full">Hola!</Paper>
|
|
30
|
+
</Story>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Paper from '../Paper.svelte';
|
|
4
|
+
import { storyPaperArgTypes } from '../Paper.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Paper,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyPaperArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Shadow 1x">
|
|
15
|
+
<Paper>Hola!</Paper>
|
|
16
|
+
</Story>
|
|
17
|
+
|
|
18
|
+
<Story name="Shadow 2x" args={{ shadow: '2x' }}><Paper shadow="2x">Hola!</Paper></Story>
|
|
19
|
+
|
|
20
|
+
<Story name="Shadow 3x" args={{ shadow: '3x' }}>
|
|
21
|
+
<Paper shadow="3x">Hola!</Paper>
|
|
22
|
+
</Story>
|
|
23
|
+
|
|
24
|
+
<Story name="Shadow 4x" args={{ shadow: '4x' }}>
|
|
25
|
+
<Paper shadow="4x">Hola!</Paper>
|
|
26
|
+
</Story>
|
|
27
|
+
|
|
28
|
+
<Story name="Shadow 5x" args={{ shadow: '5x' }}>
|
|
29
|
+
<Paper shadow="5x">Hola!</Paper>
|
|
30
|
+
</Story>
|
|
31
|
+
|
|
32
|
+
<Story name="Shadow 6x" args={{ shadow: '6x' }}>
|
|
33
|
+
<Paper shadow="6x">Hola!</Paper>
|
|
34
|
+
</Story>
|
|
35
|
+
|
|
36
|
+
<Story name="Shadow 7x" args={{ shadow: '7x' }}>
|
|
37
|
+
<Paper shadow="7x">Hola!</Paper>
|
|
38
|
+
</Story>
|
|
39
|
+
|
|
40
|
+
<Story name="Shadow False" args={{ shadow: false }}>
|
|
41
|
+
<Paper shadow={false}>Hola!</Paper>
|
|
42
|
+
</Story>
|
package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from './InputEnclosure.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
|
|
6
|
+
export const storyInputEnclosureArgTypes: StoryBookArgTypes = {
|
|
7
|
+
roundness: {
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
options: [false, '1x', '2x', '3x'],
|
|
10
|
+
},
|
|
11
|
+
size: {
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
options: ['normal', 'small', 'large'],
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
18
|
+
const { Story } = defineMeta({
|
|
19
|
+
component: InputEnclosure,
|
|
20
|
+
tags: ['autodocs'],
|
|
21
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<!-- An ensloure for Form Inputs [TextInput](?path=/docs/components-form-textinput--docs) -->
|
|
26
|
+
<Story name="Default" />
|
|
27
|
+
|
|
28
|
+
<Story name="Focused" args={{ focused: true }} />
|
|
29
|
+
|
|
30
|
+
<Story name="Error" args={{ error: true }} />
|
|
31
|
+
|
|
32
|
+
<Story name="Disabled" args={{ disabled: true }} />
|
|
33
|
+
|
|
34
|
+
<Story name="Input example">
|
|
35
|
+
<InputEnclosure>
|
|
36
|
+
<input type="text" style="flex: 1; border: 0;" placeholder="Enter name" />
|
|
37
|
+
</InputEnclosure>
|
|
38
|
+
</Story>
|
package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from '../InputEnclosure.svelte';
|
|
4
|
+
import { storyInputEnclosureArgTypes } from '../InputEnclosure.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: InputEnclosure,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Roundness 1x" />
|
|
15
|
+
|
|
16
|
+
<Story name="Roundness 2x" args={{ roundness: '2x' }} />
|
|
17
|
+
|
|
18
|
+
<Story name="Roundness 3x" args={{ roundness: '3x' }} />
|
|
19
|
+
|
|
20
|
+
<Story name="Roundness False" args={{ roundness: false }} />
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from '../InputEnclosure.svelte';
|
|
4
|
+
import { storyInputEnclosureArgTypes } from '../InputEnclosure.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: InputEnclosure,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Normal" />
|
|
15
|
+
<Story name="Small" args={{ size: 'small' }} />
|
|
16
|
+
<Story name="Large" args={{ size: 'large' }} />
|
package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from '../InputEnclosure.svelte';
|
|
4
|
+
import { storyInputEnclosureArgTypes } from '../InputEnclosure.stories.svelte';
|
|
5
|
+
import Icon from '@iconify/svelte';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
component: InputEnclosure,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<!-- InputEnclosure icon in front. -->
|
|
16
|
+
<Story name="Icon Before">
|
|
17
|
+
<InputEnclosure>
|
|
18
|
+
{#snippet before()}
|
|
19
|
+
<Icon icon="material-symbols:content-copy" />
|
|
20
|
+
{/snippet}
|
|
21
|
+
</InputEnclosure>
|
|
22
|
+
</Story>
|
|
23
|
+
|
|
24
|
+
<!-- InputEnclosure icon in front. -->
|
|
25
|
+
<Story name="Icon After">
|
|
26
|
+
<InputEnclosure>
|
|
27
|
+
{#snippet after()}
|
|
28
|
+
<Icon icon="material-symbols:download-2" />
|
|
29
|
+
{/snippet}
|
|
30
|
+
</InputEnclosure>
|
|
31
|
+
</Story>
|
|
32
|
+
|
|
33
|
+
<Story name="Small" args={{ size: 'small' }}>
|
|
34
|
+
<InputEnclosure size="small">
|
|
35
|
+
{#snippet before()}
|
|
36
|
+
<Icon icon="material-symbols:content-copy" />
|
|
37
|
+
{/snippet}
|
|
38
|
+
</InputEnclosure>
|
|
39
|
+
</Story>
|
|
40
|
+
|
|
41
|
+
<Story name="Large" args={{ size: 'large' }}>
|
|
42
|
+
<InputEnclosure size="large">
|
|
43
|
+
{#snippet before()}
|
|
44
|
+
<Icon icon="material-symbols:content-copy" />
|
|
45
|
+
{/snippet}
|
|
46
|
+
</InputEnclosure>
|
|
47
|
+
</Story>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import { fn } from '@storybook/test';
|
|
4
|
+
import UtilityButton from '../UtilityButton.svelte';
|
|
5
|
+
import { storyUtilityButtonArgTypes } from '../UtilityButton.stories.svelte';
|
|
6
|
+
import Icon from '@iconify/svelte';
|
|
7
|
+
|
|
8
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
9
|
+
const { Story } = defineMeta({
|
|
10
|
+
component: UtilityButton,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
argTypes: storyUtilityButtonArgTypes,
|
|
13
|
+
args: {
|
|
14
|
+
onclick: fn(),
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<Story name="Normal" args={{ disabled: false }}>
|
|
20
|
+
<UtilityButton><Icon icon="mdi:eye" width="24" height="24" /></UtilityButton>
|
|
21
|
+
</Story>
|
|
22
|
+
<Story name="Small" args={{ size: 'small' }}>
|
|
23
|
+
<UtilityButton size="small"><Icon icon="mdi:eye" width="22" height="22" /></UtilityButton>
|
|
24
|
+
</Story>
|
|
25
|
+
<Story name="Large" args={{ size: 'large' }}>
|
|
26
|
+
<UtilityButton size="large"><Icon icon="mdi:eye" width="28" height="28" /></UtilityButton>
|
|
27
|
+
</Story>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import UtilityButton from './UtilityButton.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
import Icon from '@iconify/svelte';
|
|
6
|
+
import { fn } from '@storybook/test';
|
|
7
|
+
|
|
8
|
+
export const storyUtilityButtonArgTypes: StoryBookArgTypes = {
|
|
9
|
+
size: {
|
|
10
|
+
control: { type: 'select' },
|
|
11
|
+
options: ['normal', 'small', 'large'],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
16
|
+
const { Story } = defineMeta({
|
|
17
|
+
component: UtilityButton,
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
argTypes: storyUtilityButtonArgTypes,
|
|
20
|
+
args: {
|
|
21
|
+
onclick: fn(),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<!-- Button with default style -->
|
|
27
|
+
<Story name="Default">
|
|
28
|
+
<UtilityButton><Icon icon="mdi:eye" width="24" height="24" /></UtilityButton>
|
|
29
|
+
</Story>
|
|
30
|
+
|
|
31
|
+
<Story name="Disabled" args={{ disabled: true }}>
|
|
32
|
+
<UtilityButton disabled><Icon icon="mdi:eye" width="24" height="24" /></UtilityButton>
|
|
33
|
+
</Story>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Meta, Story, Source } from '@storybook/blocks';
|
|
2
|
+
import * as ColorsStories from './Colors.stories.svelte';
|
|
3
|
+
import * as OpacityStories from './Opacity.stories.svelte';
|
|
4
|
+
|
|
5
|
+
<Meta of={ColorsStories} />
|
|
6
|
+
|
|
7
|
+
# Colors
|
|
8
|
+
|
|
9
|
+
We are using an extensive color pallet identical to [Tailwind Css](https://tailwindcss.com/docs/colors) Colors. The colors are adjusted for dark and light themes.
|
|
10
|
+
|
|
11
|
+
## Main Colors
|
|
12
|
+
|
|
13
|
+
<Story of={ColorsStories.Main} />
|
|
14
|
+
|
|
15
|
+
Neutral pallet
|
|
16
|
+
|
|
17
|
+
<Story of={ColorsStories.ColorsNeutral} />
|
|
18
|
+
|
|
19
|
+
Constant Colors
|
|
20
|
+
|
|
21
|
+
<Story of={ColorsStories.ColorsConstant} />
|
|
22
|
+
|
|
23
|
+
## Base Color
|
|
24
|
+
|
|
25
|
+
<Story of={ColorsStories.ColorsBase} />
|
|
26
|
+
|
|
27
|
+
Neutral pallet
|
|
28
|
+
|
|
29
|
+
<Story of={ColorsStories.BaseColorsNeutral} />
|
|
30
|
+
|
|
31
|
+
## Adjusting opacity
|
|
32
|
+
|
|
33
|
+
Opacity can be adjusted using css `color-mix` function.
|
|
34
|
+
|
|
35
|
+
<Source
|
|
36
|
+
dark
|
|
37
|
+
language="css"
|
|
38
|
+
code={`
|
|
39
|
+
color-mix(in oklab, var(--dodo-color-primary-800) 10%, transparent)
|
|
40
|
+
`}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<Story of={OpacityStories.Main} meta={OpacityStories} />
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Colors from './Colors.svelte';
|
|
4
|
+
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
component: Colors,
|
|
8
|
+
args: {
|
|
9
|
+
swatchType: 'colors',
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Main" />
|
|
15
|
+
|
|
16
|
+
<Story name="ColorsNeutral" args={{ swatchType: 'colors-neutral' }} />
|
|
17
|
+
|
|
18
|
+
<Story name="ColorsConstant" args={{ swatchType: 'colors-constant' }} />
|
|
19
|
+
|
|
20
|
+
<Story name="ColorsBase" args={{ swatchType: 'base-colors' }} />
|
|
21
|
+
|
|
22
|
+
<Story name="BaseColorsNeutral" args={{ swatchType: 'base-colors-neutral' }} />
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Swatches from './Swatches/Swatches.svelte';
|
|
3
|
+
import { colorPalette, colorPaletteBase, colorPaletteNeutral } from './utils/color.js';
|
|
4
|
+
|
|
5
|
+
interface ColorsProps {
|
|
6
|
+
swatchType?:
|
|
7
|
+
| 'base-colors'
|
|
8
|
+
| 'base-colors-neutral'
|
|
9
|
+
| 'colors'
|
|
10
|
+
| 'colors-neutral'
|
|
11
|
+
| 'colors-constant';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { swatchType }: ColorsProps = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="Colors">
|
|
18
|
+
{#if swatchType === 'base-colors'}
|
|
19
|
+
{#each colorPaletteBase as colorPaletteItem (colorPaletteItem)}
|
|
20
|
+
<Swatches colorPalette={colorPaletteItem} prefix="--dodo-color-base-" isColorPaletteValues />
|
|
21
|
+
{/each}
|
|
22
|
+
{:else if swatchType === 'base-colors-neutral'}
|
|
23
|
+
{#each colorPaletteNeutral as colorPaletteItem (colorPaletteItem)}
|
|
24
|
+
<Swatches colorPalette={colorPaletteItem} prefix="--dodo-color-base-" />
|
|
25
|
+
{/each}
|
|
26
|
+
{:else if swatchType === 'colors'}
|
|
27
|
+
{#each colorPalette as colorPaletteItem (colorPaletteItem)}
|
|
28
|
+
<Swatches colorPalette={colorPaletteItem} isColorPaletteValues />
|
|
29
|
+
{/each}
|
|
30
|
+
{:else if swatchType === 'colors-neutral'}
|
|
31
|
+
{#each colorPaletteNeutral as colorPaletteItem (colorPaletteItem)}
|
|
32
|
+
<Swatches colorPalette={colorPaletteItem} />
|
|
33
|
+
{/each}
|
|
34
|
+
{:else if swatchType === 'colors-constant'}
|
|
35
|
+
{#each colorPaletteNeutral as colorPaletteItem (colorPaletteItem)}
|
|
36
|
+
<Swatches colorPalette={colorPaletteItem} prefix="--dodo-color-constant-" />
|
|
37
|
+
{/each}
|
|
38
|
+
{/if}
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<style lang="scss">
|
|
42
|
+
.Colors {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Opacity from './Opacity.svelte';
|
|
4
|
+
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
component: Opacity,
|
|
8
|
+
});
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<Story name="Main" />
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Palette from './Swatches/Palette.svelte';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="Opacity">
|
|
6
|
+
<Palette backgroundColor="color-mix(in oklab, var(--dodo-color-primary-800) 10%, transparent)" />
|
|
7
|
+
<Palette backgroundColor="color-mix(in oklab, var(--dodo-color-primary-800) 20%, transparent)" />
|
|
8
|
+
<Palette backgroundColor="color-mix(in oklab, var(--dodo-color-primary-800) 30%, transparent)" />
|
|
9
|
+
<Palette backgroundColor="color-mix(in oklab, var(--dodo-color-primary-800) 40%, transparent)" />
|
|
10
|
+
<Palette backgroundColor="color-mix(in oklab, var(--dodo-color-primary-800) 50%, transparent)" />
|
|
11
|
+
<Palette backgroundColor="color-mix(in oklab, var(--dodo-color-primary-800) 60%, transparent)" />
|
|
12
|
+
<Palette backgroundColor="color-mix(in oklab, var(--dodo-color-primary-800) 70%, transparent)" />
|
|
13
|
+
<Palette backgroundColor="color-mix(in oklab, var(--dodo-color-primary-800) 80%, transparent)" />
|
|
14
|
+
<Palette backgroundColor="color-mix(in oklab, var(--dodo-color-primary-800) 90%, transparent)" />
|
|
15
|
+
<Palette backgroundColor="color-mix(in oklab, var(--dodo-color-primary-800) 100%, transparent)" />
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<style lang="scss">
|
|
19
|
+
.Opacity {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface PaletteProps {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { backgroundColor }: PaletteProps = $props();
|
|
7
|
+
|
|
8
|
+
function onclick() {
|
|
9
|
+
navigator.clipboard.writeText(backgroundColor);
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<!-- svelte-ignore a11y_consider_explicit_label -->
|
|
14
|
+
<button
|
|
15
|
+
class="Palette"
|
|
16
|
+
style={`background-color: ${backgroundColor};`}
|
|
17
|
+
{onclick}
|
|
18
|
+
title="Click to copy value!"
|
|
19
|
+
></button>
|
|
20
|
+
|
|
21
|
+
<style lang="scss">
|
|
22
|
+
.Palette {
|
|
23
|
+
display: flex;
|
|
24
|
+
width: 60px;
|
|
25
|
+
height: 60px;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
border: 1px solid;
|
|
28
|
+
border-color: color-mix(in oklab, var(--dodo-color-default-800) 20%, transparent);
|
|
29
|
+
background: transparent;
|
|
30
|
+
min-width: initial;
|
|
31
|
+
margin: 0;
|
|
32
|
+
padding: 0;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
outline: 0;
|
|
35
|
+
transition: all 100ms;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
border-width: 2px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:active {
|
|
42
|
+
border-color: color-mix(in oklab, var(--dodo-color-primary-800) 80%, transparent);
|
|
43
|
+
border-width: 2px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</style>
|