@flightlesslabs/dodo-ui 0.6.1 → 0.6.3

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.
Files changed (44) hide show
  1. package/README.md +3 -1
  2. package/dist/stories/Home.mdx +3 -2
  3. package/dist/stories/philosophy/Colors/Colors.svelte +1 -1
  4. package/dist/stories/philosophy/Colors/Swatches/Palette.svelte +26 -4
  5. package/dist/stories/philosophy/Colors/Swatches/Swatch.svelte +6 -0
  6. package/dist/stories/philosophy/Colors/Swatches/Swatches.svelte +7 -3
  7. package/package.json +20 -20
  8. package/src/lib/stories/components/Form/Button/Button.stories.svelte +0 -82
  9. package/src/lib/stories/components/Form/Button/Color/Color.stories.svelte +0 -68
  10. package/src/lib/stories/components/Form/Button/Events/Events.stories.svelte +0 -42
  11. package/src/lib/stories/components/Form/Button/IconButton/IconButton.stories.svelte +0 -51
  12. package/src/lib/stories/components/Form/Button/Roundness/Roundness.stories.svelte +0 -49
  13. package/src/lib/stories/components/Form/Button/Size/Size.stories.svelte +0 -22
  14. package/src/lib/stories/components/Form/Button/Variant/Variant.stories.svelte +0 -21
  15. package/src/lib/stories/components/Form/FormControl/FormControl.stories.svelte +0 -29
  16. package/src/lib/stories/components/Form/Label/Label.stories.svelte +0 -23
  17. package/src/lib/stories/components/Form/Message/Color/Color.stories.svelte +0 -36
  18. package/src/lib/stories/components/Form/Message/Message.stories.svelte +0 -35
  19. package/src/lib/stories/components/Form/Message/Size/Size.stories.svelte +0 -24
  20. package/src/lib/stories/components/Form/PasswordInput/Events/Events.stories.svelte +0 -174
  21. package/src/lib/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +0 -57
  22. package/src/lib/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +0 -20
  23. package/src/lib/stories/components/Form/PasswordInput/Size/Size.stories.svelte +0 -16
  24. package/src/lib/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +0 -31
  25. package/src/lib/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +0 -79
  26. package/src/lib/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +0 -24
  27. package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +0 -64
  28. package/src/lib/stories/components/Form/SimpleSelect/Size/Size.stories.svelte +0 -20
  29. package/src/lib/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +0 -36
  30. package/src/lib/stories/components/Form/TextInput/Events/Events.stories.svelte +0 -153
  31. package/src/lib/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +0 -21
  32. package/src/lib/stories/components/Form/TextInput/Size/Size.stories.svelte +0 -17
  33. package/src/lib/stories/components/Form/TextInput/TextInput.stories.svelte +0 -41
  34. package/src/lib/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +0 -47
  35. package/src/lib/stories/components/Layout/Paper/Paper.stories.svelte +0 -41
  36. package/src/lib/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +0 -30
  37. package/src/lib/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +0 -42
  38. package/src/lib/stories/developer tools/Intro.mdx +0 -7
  39. package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +0 -38
  40. package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +0 -20
  41. package/src/lib/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte +0 -16
  42. package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +0 -47
  43. package/src/lib/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +0 -27
  44. package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +0 -33
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
- ![Sonny and Mariel high fiving.](https://flightlesslabs.github.io/dodo-ui/og.png)
1
+ ![Dodo logo](https://flightlesslabs.github.io/dodo-ui/og.png)
2
2
 
3
3
  # Dodo Ui
4
4
 
5
5
  An open-source, opinionated UI framework for Svelte.
6
+
7
+ [Github](https://github.com/flightlesslabs/dodo-ui) | [npm](https://www.npmjs.com/package/@flightlesslabs/dodo-ui)
@@ -10,6 +10,9 @@ import item from '../../../package.json?raw';
10
10
  <h3 style={{ fontWeight: 500 }}>v{JSON.parse(item)?.version}</h3>
11
11
 
12
12
  <h3 style={{ fontWeight: 400 }}>An open-source, opinionated UI framework for Svelte.</h3>
13
+
14
+ ### [Github](https://github.com/flightlesslabs/dodo-ui) - [npm](https://www.npmjs.com/package/@flightlesslabs/dodo-ui)
15
+
13
16
  </main>
14
17
 
15
18
  <br />
@@ -56,5 +59,3 @@ Checkout documentation for [Button](?path=/docs/components-form-button--docs)
56
59
  - [Themes](?path=/docs/philosophy-themes--docs)
57
60
  - [Colors](?path=/docs/philosophy-colors--docs)
58
61
  - [Adjust Color Opacity](?path=/docs/philosophy-colors--docs#adjusting-opacity)
59
- - [Github](https://github.com/flightlesslabs/dodo-ui)
60
- - [NPM](https://www.npmjs.com/package/@flightlesslabs/dodo-ui)
@@ -29,5 +29,5 @@ const { swatchType } = $props();
29
29
 
30
30
  <style>.Colors {
31
31
  display: flex;
32
- flex-wrap: wrap;
32
+ flex-direction: column;
33
33
  }</style>
@@ -1,15 +1,37 @@
1
1
  <script lang="ts">"use strict";
2
2
  const { backgroundColor } = $props();
3
+ function onclick() {
4
+ navigator.clipboard.writeText(backgroundColor);
5
+ }
3
6
  </script>
4
7
 
5
- <span class="Palette" style={`background-color: ${backgroundColor};`}></span>
8
+ <!-- svelte-ignore a11y_consider_explicit_label -->
9
+ <button
10
+ class="Palette"
11
+ style={`background-color: ${backgroundColor};`}
12
+ {onclick}
13
+ title="Click to copy value!"
14
+ ></button>
6
15
 
7
16
  <style>.Palette {
8
17
  display: flex;
9
- width: 30px;
10
- height: 30px;
11
- margin-right: 8px;
18
+ width: 60px;
19
+ height: 60px;
12
20
  border-radius: 4px;
13
21
  border: 1px solid;
14
22
  border-color: color-mix(in oklab, var(--dodo-color-default-800) 20%, transparent);
23
+ background: transparent;
24
+ min-width: initial;
25
+ margin: 0;
26
+ padding: 0;
27
+ cursor: pointer;
28
+ outline: 0;
29
+ transition: all 100ms;
30
+ }
31
+ .Palette:hover {
32
+ border-width: 2px;
33
+ }
34
+ .Palette:active {
35
+ border-color: color-mix(in oklab, var(--dodo-color-primary-800) 80%, transparent);
36
+ border-width: 2px;
15
37
  }</style>
@@ -8,6 +8,7 @@ const { colorPalette, colorPaletteValue, prefix = '--dodo-color-' } = $props();
8
8
  {:else}
9
9
  <Palette backgroundColor={`var(${prefix}${colorPalette})`} />
10
10
  {/if}
11
+
11
12
  <div class="colorPaletteValue">{colorPaletteValue}</div>
12
13
  </div>
13
14
 
@@ -15,4 +16,9 @@ const { colorPalette, colorPaletteValue, prefix = '--dodo-color-' } = $props();
15
16
  color: var(--dodo-color-default-900);
16
17
  display: flex;
17
18
  align-items: center;
19
+ flex-direction: column;
20
+ margin: 4px;
21
+ }
22
+ .Swatch .colorPaletteValue {
23
+ margin-top: 8px;
18
24
  }</style>
@@ -23,14 +23,18 @@ const { colorPalette, prefix, isColorPaletteValues = false } = $props();
23
23
  color: var(--dodo-color-default-900);
24
24
  margin: 0;
25
25
  padding: 0;
26
- width: 100px;
26
+ width: 150px;
27
27
  margin: 16px 0;
28
+ display: flex;
29
+ width: 100%;
28
30
  }
29
31
  .Swatches b {
30
32
  text-transform: capitalize;
31
- margin-bottom: 16px;
32
- display: block;
33
+ display: flex;
33
34
  font-weight: 500;
35
+ width: 100px;
36
+ align-items: center;
37
+ margin-bottom: 30px;
34
38
  }
35
39
  .Swatches li {
36
40
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flightlesslabs/dodo-ui",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "scripts": {
5
5
  "build": "vite build && pnpm run prepack",
6
6
  "preview": "vite preview",
@@ -27,8 +27,8 @@
27
27
  "src/lib",
28
28
  "!src/lib/**/*.test.*",
29
29
  "!src/lib/**/*.spec.*",
30
- "!src/lib/stories/*.stories.*",
31
- "!src/lib/stories/*.mdx",
30
+ "!src/lib/stories/**/*.stories.*",
31
+ "!src/lib/stories/**/*.mdx",
32
32
  "!src/lib/stories/assets",
33
33
  "!src/lib/stories/philosophy"
34
34
  ],
@@ -50,7 +50,7 @@
50
50
  "devDependencies": {
51
51
  "@chromatic-com/storybook": "^3.2.6",
52
52
  "@eslint/compat": "^1.2.8",
53
- "@eslint/js": "^9.24.0",
53
+ "@eslint/js": "^9.25.1",
54
54
  "@storybook/addon-essentials": "^8.6.12",
55
55
  "@storybook/addon-svelte-csf": "5.0.0-next.28",
56
56
  "@storybook/blocks": "^8.6.12",
@@ -61,36 +61,36 @@
61
61
  "@storybook/test": "^8.6.12",
62
62
  "@storybook/theming": "^8.6.12",
63
63
  "@sveltejs/adapter-static": "^3.0.8",
64
- "@sveltejs/kit": "^2.20.5",
65
- "@sveltejs/package": "^2.3.10",
64
+ "@sveltejs/kit": "^2.20.7",
65
+ "@sveltejs/package": "^2.3.11",
66
66
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
67
- "@vitest/browser": "^3.1.1",
68
- "@vitest/coverage-v8": "^3.1.1",
69
- "eslint": "^9.24.0",
70
- "eslint-config-prettier": "^10.1.1",
67
+ "@vitest/browser": "^3.1.2",
68
+ "@vitest/coverage-v8": "^3.1.2",
69
+ "eslint": "^9.25.1",
70
+ "eslint-config-prettier": "^10.1.2",
71
71
  "eslint-plugin-svelte": "^3.5.1",
72
72
  "globals": "^16.0.0",
73
- "playwright": "^1.51.1",
73
+ "playwright": "^1.52.0",
74
74
  "prettier": "^3.5.3",
75
75
  "prettier-plugin-svelte": "^3.3.3",
76
- "publint": "^0.3.11",
77
- "sass": "^1.86.3",
76
+ "publint": "^0.3.12",
77
+ "sass": "^1.87.0",
78
78
  "storybook": "^8.6.12",
79
79
  "storybook-dark-mode": "^4.0.2",
80
- "svelte": "^5.25.10",
81
- "svelte-check": "^4.1.5",
80
+ "svelte": "^5.28.2",
81
+ "svelte-check": "^4.1.6",
82
82
  "svelte-preprocess": "^6.0.3",
83
83
  "typescript": "^5.8.3",
84
- "typescript-eslint": "^8.29.1",
85
- "vite": "^6.2.5",
86
- "vitest": "^3.1.1"
84
+ "typescript-eslint": "^8.31.0",
85
+ "vite": "^6.3.3",
86
+ "vitest": "^3.1.2"
87
87
  },
88
88
  "keywords": [
89
89
  "svelte"
90
90
  ],
91
91
  "volta": {
92
- "node": "22.14.0",
93
- "pnpm": "10.7.1"
92
+ "node": "22.15.0",
93
+ "pnpm": "10.9.0"
94
94
  },
95
95
  "dependencies": {
96
96
  "@iconify/svelte": "^4.2.0"
@@ -1,82 +0,0 @@
1
- <script module lang="ts">
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { fn } from '@storybook/test';
4
- import Button from './Button.svelte';
5
- import type { StoryBookArgTypes } from '$lib/storybook-types.js';
6
-
7
- export const storyButtonArgTypes: StoryBookArgTypes = {
8
- type: {
9
- control: { type: 'select' },
10
- options: ['button', 'submit'],
11
- },
12
- color: {
13
- control: { type: 'select' },
14
- options: ['default', 'secondary', 'primary', 'safe', 'warning', 'danger'],
15
- },
16
- variant: {
17
- control: { type: 'select' },
18
- options: ['text', 'solid'],
19
- },
20
- roundness: {
21
- control: { type: 'select' },
22
- options: [false, '1x', '2x', '3x', 'full'],
23
- },
24
- size: {
25
- control: { type: 'select' },
26
- options: ['normal', 'small', 'large'],
27
- },
28
- };
29
-
30
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
31
- const { Story } = defineMeta({
32
- component: Button,
33
- tags: ['autodocs'],
34
- argTypes: storyButtonArgTypes,
35
- args: {
36
- onclick: fn(),
37
- },
38
- });
39
- </script>
40
-
41
- <!-- ⚠️ Test Button: Do not use! -->
42
- <Story
43
- name="Test Button"
44
- args={{
45
- outline: false,
46
- disabled: false,
47
- compact: false,
48
- _unsafeChildrenStringForTesting: 'Click me!',
49
- }}
50
- />
51
-
52
- <!-- Button with default style -->
53
- <Story name="Default" args={{ outline: false, disabled: false, compact: false }}>
54
- <Button>Click me!</Button>
55
- </Story>
56
-
57
- <!-- Button with border around it -->
58
- <Story name="Outline" args={{ outline: true }}>
59
- <Button outline>Click me!</Button>
60
- </Story>
61
-
62
- <Story name="Disabled" args={{ disabled: true }}>
63
- <Button disabled>Click me!</Button>
64
- </Story>
65
-
66
- <!-- Form submit button -->
67
- <Story name="Sumbit Button" args={{ type: 'submit' }}>
68
- <Button type="submit">Submit Form</Button>
69
- </Story>
70
-
71
- <!-- Form submit button -->
72
- <Story name="Full width Button" args={{ fullWidth: true }}>
73
- <Button fullWidth>Click me!</Button>
74
- </Story>
75
-
76
- <!-- Anchor Link styled like a Button -->
77
- <Story
78
- name="Link Button"
79
- args={{ href: 'https://www.w3schools.com/tags/tag_a.asp', target: '_blank' }}
80
- >
81
- <Button href="https://www.w3schools.com/tags/tag_a.asp" target="_blank">Link</Button>
82
- </Story>
@@ -1,68 +0,0 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { fn } from '@storybook/test';
4
- import Button from '../Button.svelte';
5
- import { storyButtonArgTypes } from '../Button.stories.svelte';
6
-
7
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
8
- const { Story } = defineMeta({
9
- component: Button,
10
- tags: ['autodocs'],
11
- argTypes: storyButtonArgTypes,
12
- args: {
13
- onclick: fn(),
14
- },
15
- });
16
- </script>
17
-
18
- <Story name="Default" args={{ outline: false, disabled: false, compact: false }}>
19
- <Button>Click me!</Button>
20
- </Story>
21
- <Story name="Primary" args={{ color: 'primary' }}><Button color="primary">Click me!</Button></Story>
22
- <Story name="Secondary" args={{ color: 'secondary' }}>
23
- <Button color="secondary">Click me!</Button>
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>
28
-
29
- <Story
30
- name="Default Solid"
31
- args={{ outline: false, disabled: false, compact: false, variant: 'solid' }}
32
- >
33
- <Button variant="solid">Click me!</Button>
34
- </Story>
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>
50
-
51
- <Story name="Default Outline" args={{ outline: true, disabled: false, compact: false }}>
52
- <Button outline>Click me!</Button>
53
- </Story>
54
- <Story name="Primary Outline" args={{ outline: true, color: 'primary' }}>
55
- <Button color="primary" outline>Click me!</Button>
56
- </Story>
57
- <Story name="Secondary Outline" args={{ outline: true, color: 'secondary' }}>
58
- <Button color="secondary" outline>Click me!</Button>
59
- </Story>
60
- <Story name="Safe Outline" args={{ outline: true, color: 'safe' }}>
61
- <Button color="safe" outline>Click me!</Button>
62
- </Story>
63
- <Story name="Warning Outline" args={{ outline: true, color: 'warning' }}>
64
- <Button color="warning" outline>Click me!</Button>
65
- </Story>
66
- <Story name="Danger Outline" args={{ outline: true, color: 'danger' }}>
67
- <Button color="danger" outline>Click me!</Button>
68
- </Story>
@@ -1,42 +0,0 @@
1
- <script module lang="ts">
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { fn } from '@storybook/test';
4
- import Button from '../Button.svelte';
5
- import { storyButtonArgTypes } from '../Button.stories.svelte';
6
-
7
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
8
- const { Story } = defineMeta({
9
- component: Button,
10
- tags: ['autodocs'],
11
- argTypes: storyButtonArgTypes,
12
- args: {
13
- onclick: fn(),
14
- },
15
- });
16
- </script>
17
-
18
- <Story
19
- name="Click"
20
- args={{
21
- outline: false,
22
- disabled: false,
23
- compact: false,
24
- onclick: (e: Event) => {
25
- const target = e.target as HTMLButtonElement;
26
-
27
- alert('Button Clicked');
28
- console.log('Button Clicked', target);
29
- },
30
- }}
31
- >
32
- <Button
33
- onclick={(e: Event) => {
34
- const target = e.target as HTMLButtonElement;
35
-
36
- alert('Button Clicked');
37
- console.log('Button Clicked', target);
38
- }}
39
- >
40
- Click me!
41
- </Button>
42
- </Story>
@@ -1,51 +0,0 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { fn } from '@storybook/test';
4
- import Button from '../Button.svelte';
5
- import { storyButtonArgTypes } from '../Button.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: Button,
11
- tags: ['autodocs'],
12
- argTypes: storyButtonArgTypes,
13
- args: {
14
- onclick: fn(),
15
- },
16
- });
17
- </script>
18
-
19
- <!-- Compact button with paddings stripped out and fixed size. We are using this icon library https://iconify.design/docs/icon-components/svelte/ -->
20
- <Story name="Icon Button" args={{ compact: true }}>
21
- <Button compact>
22
- <Icon icon="material-symbols:app-badging" width="18" height="18" />
23
- </Button>
24
- </Story>
25
-
26
- <!-- Circualr Icon button. -->
27
- <Story name="Icon Button Circular" args={{ compact: true, roundness: 'full' }}>
28
- <Button roundness="full" compact>
29
- <Icon icon="material-symbols:app-badging" width="18" height="18" />
30
- </Button>
31
- </Story>
32
-
33
- <!-- Button with an icon in front. -->
34
- <Story name="Icon Before">
35
- <Button>
36
- {#snippet before()}
37
- <Icon icon="material-symbols:content-copy" />
38
- {/snippet}
39
- Copy
40
- </Button>
41
- </Story>
42
-
43
- <!-- Button with an icon in front. -->
44
- <Story name="Icon After">
45
- <Button>
46
- {#snippet after()}
47
- <Icon icon="material-symbols:download-2" />
48
- {/snippet}
49
- Download
50
- </Button>
51
- </Story>
@@ -1,49 +0,0 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { fn } from '@storybook/test';
4
- import Button from '../Button.svelte';
5
- import { storyButtonArgTypes } from '../Button.stories.svelte';
6
-
7
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
8
- const { Story } = defineMeta({
9
- component: Button,
10
- tags: ['autodocs'],
11
- argTypes: storyButtonArgTypes,
12
- args: {
13
- onclick: fn(),
14
- },
15
- });
16
- </script>
17
-
18
- <Story name="Roundness 1x" args={{ outline: false, disabled: false, compact: false }}>
19
- <Button>Click me!</Button>
20
- </Story>
21
-
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>
28
-
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>
35
-
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>
42
-
43
- <!-- 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>
@@ -1,22 +0,0 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { fn } from '@storybook/test';
4
- import Button from '../Button.svelte';
5
- import { storyButtonArgTypes } from '../Button.stories.svelte';
6
-
7
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
8
- const { Story } = defineMeta({
9
- component: Button,
10
- tags: ['autodocs'],
11
- argTypes: storyButtonArgTypes,
12
- args: {
13
- onclick: fn(),
14
- },
15
- });
16
- </script>
17
-
18
- <Story name="Normal" args={{ outline: false, disabled: false, compact: false }}>
19
- <Button>Click me!</Button>
20
- </Story>
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>
@@ -1,21 +0,0 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { fn } from '@storybook/test';
4
- import Button from '../Button.svelte';
5
- import { storyButtonArgTypes } from '../Button.stories.svelte';
6
-
7
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
8
- const { Story } = defineMeta({
9
- component: Button,
10
- tags: ['autodocs'],
11
- argTypes: storyButtonArgTypes,
12
- args: {
13
- onclick: fn(),
14
- },
15
- });
16
- </script>
17
-
18
- <Story name="Text" args={{ outline: false, disabled: false, compact: false }}>
19
- <Button>Click me!</Button>
20
- </Story>
21
- <Story name="Solid" args={{ variant: 'solid' }}><Button variant="solid">Click me!</Button></Story>
@@ -1,29 +0,0 @@
1
- <script module lang="ts">
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import FormControl from './FormControl.svelte';
4
- import TextInput from '../TextInput/TextInput.svelte';
5
-
6
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
7
- const { Story } = defineMeta({
8
- component: FormControl,
9
- tags: ['autodocs'],
10
- });
11
- </script>
12
-
13
- <Story name="Default" args={{ label: 'Hello there' }} />
14
-
15
- <Story name="Example TextInput" args={{ label: 'Whats your first name?' }}>
16
- <FormControl label="Whats your first name?" for="first-name-01">
17
- <TextInput placeholder="First name" id="first-name-01" />
18
- </FormControl>
19
- </Story>
20
-
21
- <Story name="ErrorMessage" args={{ label: 'Whats your first name?' }}>
22
- <FormControl
23
- label="Whats your first name?"
24
- for="first-name-02"
25
- errorMessage="This is an error message"
26
- >
27
- <TextInput value="John Smith" id="first-name-02" error />
28
- </FormControl>
29
- </Story>
@@ -1,23 +0,0 @@
1
- <script module lang="ts">
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import Label from './Label.svelte';
4
-
5
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
6
- const { Story } = defineMeta({
7
- component: Label,
8
- tags: ['autodocs'],
9
- });
10
- </script>
11
-
12
- <!-- ⚠️ Test Label: Do not use! -->
13
- <Story
14
- name="Test Label"
15
- args={{
16
- _unsafeChildrenStringForTesting: 'This is a form label',
17
- }}
18
- />
19
-
20
- <!-- Label with default style -->
21
- <Story name="Default">
22
- <Label>This is a form label</Label>
23
- </Story>
@@ -1,36 +0,0 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import Message from '../Message.svelte';
4
- import { storyMessageArgTypes } from '../Message.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: Message,
9
- tags: ['autodocs'],
10
- argTypes: storyMessageArgTypes,
11
- });
12
- </script>
13
-
14
- <Story name="Default">
15
- <Message>Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
16
- </Story>
17
-
18
- <Story name="Primary" args={{ color: 'primary' }}>
19
- <Message color="primary">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
20
- </Story>
21
-
22
- <Story name="Secondary" args={{ color: 'secondary' }}>
23
- <Message color="secondary">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
24
- </Story>
25
-
26
- <Story name="Safe" args={{ color: 'safe' }}>
27
- <Message color="safe">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
28
- </Story>
29
-
30
- <Story name="Warning" args={{ color: 'warning' }}>
31
- <Message color="warning">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
32
- </Story>
33
-
34
- <Story name="Danger" args={{ color: 'danger' }}>
35
- <Message color="danger">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
36
- </Story>
@@ -1,35 +0,0 @@
1
- <script module lang="ts">
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import Message from './Message.svelte';
4
- import type { StoryBookArgTypes } from '$lib/storybook-types.js';
5
-
6
- export const storyMessageArgTypes: StoryBookArgTypes = {
7
- color: {
8
- control: { type: 'select' },
9
- options: ['default', 'primary', 'secondary', 'safe', 'warning', 'danger'],
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: Message,
20
- tags: ['autodocs'],
21
- argTypes: storyMessageArgTypes,
22
- });
23
- </script>
24
-
25
- <!-- ⚠️ Test Message: Do not use! -->
26
- <Story
27
- name="Test Message"
28
- args={{
29
- _unsafeChildrenStringForTesting: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
30
- }}
31
- />
32
-
33
- <Story name="Default">
34
- <Message>Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
35
- </Story>