@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.
Files changed (165) hide show
  1. package/dist/index.d.ts +6 -4
  2. package/dist/stories/Home.mdx +4 -6
  3. package/dist/stories/components/Form/Button/Button.stories.svelte +16 -37
  4. package/dist/stories/components/Form/Button/Button.svelte +44 -46
  5. package/dist/stories/components/Form/Button/Button.svelte.d.ts +10 -9
  6. package/dist/stories/components/Form/Button/Color/Color.stories.svelte +23 -48
  7. package/dist/stories/components/Form/Button/Events/Events.stories.svelte +1 -7
  8. package/dist/stories/components/Form/Button/IconButton/IconButton.stories.svelte +4 -12
  9. package/dist/stories/components/Form/Button/Roundness/Roundness.stories.svelte +5 -31
  10. package/dist/stories/components/Form/Button/Size/Size.stories.svelte +3 -9
  11. package/dist/stories/components/Form/Button/Variant/Variant.stories.svelte +5 -8
  12. package/dist/stories/components/Form/FormControl/FormControl.stories.svelte +11 -12
  13. package/dist/stories/components/Form/FormControl/FormControl.svelte +3 -8
  14. package/dist/stories/components/Form/Label/Label.stories.svelte +1 -11
  15. package/dist/stories/components/Form/Label/Label.svelte +2 -4
  16. package/dist/stories/components/Form/Label/Label.svelte.d.ts +0 -2
  17. package/dist/stories/components/Form/Message/Color/Color.stories.svelte +9 -9
  18. package/dist/stories/components/Form/Message/Message.stories.svelte +5 -13
  19. package/dist/stories/components/Form/Message/Message.svelte +4 -9
  20. package/dist/stories/components/Form/Message/Message.svelte.d.ts +3 -5
  21. package/dist/stories/components/Form/Message/Size/Size.stories.svelte +3 -5
  22. package/dist/stories/components/Form/PasswordInput/Events/Events.stories.svelte +8 -72
  23. package/dist/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +5 -3
  24. package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte +4 -4
  25. package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte.d.ts +3 -2
  26. package/dist/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +4 -4
  27. package/dist/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +2 -2
  28. package/dist/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +3 -30
  29. package/dist/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +4 -4
  30. package/dist/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +4 -6
  31. package/dist/stories/components/Form/SimpleSelect/SimpleSelect.svelte +4 -4
  32. package/dist/stories/components/Form/SimpleSelect/SimpleSelect.svelte.d.ts +3 -2
  33. package/dist/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +2 -2
  34. package/dist/stories/components/Form/TextInput/Events/Events.stories.svelte +7 -63
  35. package/dist/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +4 -4
  36. package/dist/stories/components/Form/TextInput/TextInput.stories.svelte +6 -4
  37. package/dist/stories/components/Form/TextInput/TextInput.svelte +12 -5
  38. package/dist/stories/components/Form/TextInput/TextInput.svelte.d.ts +4 -2
  39. package/dist/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +4 -4
  40. package/dist/stories/components/Layout/Paper/Color/Color.stories.svelte +63 -0
  41. package/dist/stories/components/Layout/Paper/Color/Color.stories.svelte.d.ts +26 -0
  42. package/dist/stories/components/Layout/Paper/Paper.stories.svelte +25 -16
  43. package/dist/stories/components/Layout/Paper/Paper.svelte +211 -14
  44. package/dist/stories/components/Layout/Paper/Paper.svelte.d.ts +18 -7
  45. package/dist/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +8 -13
  46. package/dist/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +6 -24
  47. package/dist/stories/components/Layout/Paper/utils/scss/mixins.scss +46 -0
  48. package/dist/stories/developer tools/Intro.mdx +2 -0
  49. package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +5 -5
  50. package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte +14 -14
  51. package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte.d.ts +3 -2
  52. package/dist/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +4 -4
  53. package/dist/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +4 -4
  54. package/dist/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +3 -3
  55. package/dist/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +4 -3
  56. package/dist/stories/developer tools/components/UtilityButton/UtilityButton.svelte +3 -3
  57. package/dist/stories/developer tools/components/UtilityButton/UtilityButton.svelte.d.ts +1 -1
  58. package/dist/stories/{philosophy/Colors/Colors.mdx → developer tools/philosophy/Colors/Colors.mdx } +2 -2
  59. package/dist/stories/{philosophy/Colors/Swatches/Palette.svelte → developer tools/philosophy/Colors/Swatches/Palette.svelte } +1 -1
  60. package/dist/stories/{philosophy/Colors/Swatches/Swatch.svelte → developer tools/philosophy/Colors/Swatches/Swatch.svelte } +1 -1
  61. package/dist/stories/{philosophy/Colors/Swatches/Swatches.svelte → developer tools/philosophy/Colors/Swatches/Swatches.svelte } +1 -1
  62. package/dist/stories/{philosophy/Colors/utils/color.js → developer tools/philosophy/Colors/utils/color.js } +1 -1
  63. package/dist/stories/{philosophy/Themes.mdx → developer tools/philosophy/Themes.mdx } +1 -1
  64. package/dist/styles/_colors.css +44 -44
  65. package/dist/styles/_components.css +6 -3
  66. package/dist/styles/_shadow.css +13 -20
  67. package/dist/styles/_space.css +7 -0
  68. package/dist/styles/global.css +1 -0
  69. package/dist/types/colors.d.ts +7 -0
  70. package/dist/types/colors.js +10 -0
  71. package/dist/types/roundness.d.ts +3 -0
  72. package/dist/types/roundness.js +1 -0
  73. package/dist/types/shadow.d.ts +3 -0
  74. package/dist/types/shadow.js +1 -0
  75. package/dist/types/size.d.ts +3 -0
  76. package/dist/types/size.js +1 -0
  77. package/dist/types/weight.d.ts +3 -0
  78. package/dist/types/weight.js +1 -0
  79. package/package.json +26 -24
  80. package/src/lib/index.ts +13 -8
  81. package/src/lib/stories/components/Form/Button/Button.svelte +30 -31
  82. package/src/lib/stories/components/Form/FormControl/FormControl.svelte +2 -7
  83. package/src/lib/stories/components/Form/Label/Label.svelte +1 -6
  84. package/src/lib/stories/components/Form/Message/Message.svelte +9 -16
  85. package/src/lib/stories/components/Form/PasswordInput/PasswordInput.svelte +7 -6
  86. package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.svelte +7 -6
  87. package/src/lib/stories/components/Form/TextInput/TextInput.svelte +16 -6
  88. package/src/lib/stories/components/Layout/Paper/Paper.svelte +151 -23
  89. package/src/lib/stories/components/Layout/Paper/utils/scss/mixins.scss +46 -0
  90. package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte +17 -16
  91. package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.svelte +4 -4
  92. package/src/lib/stories/{philosophy/Colors/Swatches/Palette.svelte → developer tools/philosophy/Colors/Swatches/Palette.svelte } +1 -1
  93. package/src/lib/stories/{philosophy/Colors/Swatches/Swatch.svelte → developer tools/philosophy/Colors/Swatches/Swatch.svelte } +1 -1
  94. package/src/lib/stories/{philosophy/Colors/Swatches/Swatches.svelte → developer tools/philosophy/Colors/Swatches/Swatches.svelte } +1 -1
  95. package/src/lib/stories/{philosophy/Colors/utils/color.ts → developer tools/philosophy/Colors/utils/color.ts } +1 -1
  96. package/src/lib/styles/_colors.css +44 -44
  97. package/src/lib/styles/_components.css +6 -3
  98. package/src/lib/styles/_shadow.css +13 -20
  99. package/src/lib/styles/_space.css +7 -0
  100. package/src/lib/styles/global.css +1 -0
  101. package/src/lib/types/colors.ts +16 -0
  102. package/src/lib/types/roundness.ts +3 -0
  103. package/src/lib/types/shadow.ts +3 -0
  104. package/src/lib/types/size.ts +3 -0
  105. package/src/lib/types/weight.ts +3 -0
  106. package/dist/types.d.ts +0 -5
  107. package/dist/types.js +0 -1
  108. package/src/lib/stories/Home.mdx +0 -61
  109. package/src/lib/stories/assets/dark-theme-toggle.png +0 -0
  110. package/src/lib/stories/components/Form/Button/Button.stories.svelte +0 -82
  111. package/src/lib/stories/components/Form/Button/Color/Color.stories.svelte +0 -68
  112. package/src/lib/stories/components/Form/Button/Events/Events.stories.svelte +0 -42
  113. package/src/lib/stories/components/Form/Button/IconButton/IconButton.stories.svelte +0 -51
  114. package/src/lib/stories/components/Form/Button/Roundness/Roundness.stories.svelte +0 -49
  115. package/src/lib/stories/components/Form/Button/Size/Size.stories.svelte +0 -22
  116. package/src/lib/stories/components/Form/Button/Variant/Variant.stories.svelte +0 -21
  117. package/src/lib/stories/components/Form/FormControl/FormControl.stories.svelte +0 -29
  118. package/src/lib/stories/components/Form/Label/Label.stories.svelte +0 -23
  119. package/src/lib/stories/components/Form/Message/Color/Color.stories.svelte +0 -36
  120. package/src/lib/stories/components/Form/Message/Message.stories.svelte +0 -35
  121. package/src/lib/stories/components/Form/Message/Size/Size.stories.svelte +0 -24
  122. package/src/lib/stories/components/Form/PasswordInput/Events/Events.stories.svelte +0 -174
  123. package/src/lib/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +0 -57
  124. package/src/lib/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +0 -20
  125. package/src/lib/stories/components/Form/PasswordInput/Size/Size.stories.svelte +0 -16
  126. package/src/lib/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +0 -31
  127. package/src/lib/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +0 -79
  128. package/src/lib/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +0 -24
  129. package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +0 -64
  130. package/src/lib/stories/components/Form/SimpleSelect/Size/Size.stories.svelte +0 -20
  131. package/src/lib/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +0 -36
  132. package/src/lib/stories/components/Form/TextInput/Events/Events.stories.svelte +0 -153
  133. package/src/lib/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +0 -21
  134. package/src/lib/stories/components/Form/TextInput/Size/Size.stories.svelte +0 -17
  135. package/src/lib/stories/components/Form/TextInput/TextInput.stories.svelte +0 -41
  136. package/src/lib/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +0 -47
  137. package/src/lib/stories/components/Layout/Paper/Paper.stories.svelte +0 -41
  138. package/src/lib/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +0 -30
  139. package/src/lib/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +0 -42
  140. package/src/lib/stories/developer tools/Intro.mdx +0 -7
  141. package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +0 -38
  142. package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +0 -20
  143. package/src/lib/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte +0 -16
  144. package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +0 -47
  145. package/src/lib/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +0 -27
  146. package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +0 -33
  147. package/src/lib/stories/philosophy/Colors/Colors.mdx +0 -43
  148. package/src/lib/stories/philosophy/Colors/Colors.stories.svelte +0 -22
  149. package/src/lib/stories/philosophy/Colors/Opacity.stories.svelte +0 -11
  150. package/src/lib/stories/philosophy/Themes.mdx +0 -23
  151. package/src/lib/types.ts +0 -6
  152. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.stories.svelte +0 -0
  153. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.stories.svelte.d.ts +0 -0
  154. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.svelte +0 -0
  155. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.svelte.d.ts +0 -0
  156. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.stories.svelte +0 -0
  157. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.stories.svelte.d.ts +0 -0
  158. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.svelte +0 -0
  159. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.svelte.d.ts +0 -0
  160. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Swatches/Palette.svelte.d.ts +0 -0
  161. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Swatches/Swatch.svelte.d.ts +0 -0
  162. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Swatches/Swatches.svelte.d.ts +0 -0
  163. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/utils/color.d.ts +0 -0
  164. /package/src/lib/stories/{philosophy → developer tools/philosophy}/Colors/Colors.svelte +0 -0
  165. /package/src/lib/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.svelte +0 -0
@@ -1,39 +1,32 @@
1
1
  :root {
2
- --dodo-shadow-color: #0000000d;
2
+ --dodo-shadow-color: rgba(0, 0, 0, 0.11);
3
3
  }
4
4
 
5
- .dodo-shadow-1x {
6
- --dodo-shadow: 0 1px var(--dodo-shadow-color);
7
- box-shadow: var(--dodo-shadow);
8
- }
9
-
10
- .dodo-shadow-2x {
11
- --dodo-shadow: 0 1px 2px 0 var(--dodo-shadow-color);
12
- box-shadow: var(--dodo-shadow);
5
+ .dodo-theme--dark {
6
+ --dodo-shadow-color: rgba(0, 0, 0, 0.09);
13
7
  }
14
8
 
15
- .dodo-shadow-3x {
16
- --dodo-shadow: 0 1px 3px 0 var(--dodo-shadow-color);
9
+ .dodo-shadow-1 {
10
+ --dodo-shadow: 0 1px 3px var(--dodo-shadow-color), 0 1px 2px var(--dodo-shadow-color);
17
11
  box-shadow: var(--dodo-shadow);
18
12
  }
19
13
 
20
- .dodo-shadow-4x {
21
- --dodo-shadow: 0 4px 6px -1px var(--dodo-shadow-color), 0 2px 4px -2px var(--dodo-shadow-color);
14
+ .dodo-shadow-2 {
15
+ --dodo-shadow: 0 3px 6px var(--dodo-shadow-color), 0 3px 6px var(--dodo-shadow-color);
22
16
  box-shadow: var(--dodo-shadow);
23
17
  }
24
18
 
25
- .dodo-shadow-5x {
26
- --dodo-shadow: 0 10px 15px -3px var(--dodo-shadow-color), 0 4px 6px -4px var(--dodo-shadow-color);
19
+ .dodo-shadow-3 {
20
+ --dodo-shadow: 0 6px 10px var(--dodo-shadow-color), 0 5px 17px var(--dodo-shadow-color);
27
21
  box-shadow: var(--dodo-shadow);
28
22
  }
29
23
 
30
- .dodo-shadow-6x {
31
- --dodo-shadow:
32
- 0 20px 25px -5px var(--dodo-shadow-color), 0 8px 10px -6px var(--dodo-shadow-color);
24
+ .dodo-shadow-4 {
25
+ --dodo-shadow: 0 10px 18px var(--dodo-shadow-color), 0 6px 10px var(--dodo-shadow-color);
33
26
  box-shadow: var(--dodo-shadow);
34
27
  }
35
28
 
36
- .dodo-shadow-7x {
37
- --dodo-shadow: 0 25px 50px -12px var(--dodo-shadow-color);
29
+ .dodo-shadow-5 {
30
+ --dodo-shadow: 0 14px 28px var(--dodo-shadow-color), 0 10px 10px var(--dodo-shadow-color);
38
31
  box-shadow: var(--dodo-shadow);
39
32
  }
@@ -0,0 +1,7 @@
1
+ :root {
2
+ /* Space */
3
+ /* Example: calc(var(--dodo-ui-space) * 2), calc(var(--dodo-ui-space) / 2) */
4
+ --dodo-ui-space-small: 6px;
5
+ --dodo-ui-space: 8px;
6
+ --dodo-ui-space-large: 10px;
7
+ }
@@ -1,6 +1,7 @@
1
1
  @import '_minimal-reset.css';
2
2
  @import '_colors-base.css';
3
3
  @import '_colors.css';
4
+ @import '_space.css';
4
5
  @import '_breakpoint.css';
5
6
  @import '_shadow.css';
6
7
  @import '_components.css';
@@ -0,0 +1,16 @@
1
+ /** Component Color*/
2
+ export type ComponentColorPriority = 'primary' | 'secondary' | 'neutral';
3
+ export const componentColorPriorityArray: ComponentColorPriority[] = [
4
+ 'primary',
5
+ 'secondary',
6
+ 'neutral',
7
+ ];
8
+
9
+ export type ComponentColorSeverity = 'safe' | 'warning' | 'danger';
10
+ export const componentColorSeverityArray: ComponentColorSeverity[] = ['safe', 'warning', 'danger'];
11
+
12
+ export type ComponentColor = ComponentColorPriority | ComponentColorSeverity;
13
+ export const componentColorArray: ComponentColor[] = [
14
+ ...componentColorPriorityArray,
15
+ ...componentColorSeverityArray,
16
+ ];
@@ -0,0 +1,3 @@
1
+ /** Component Roundness */
2
+ export type ComponentRoundness = 0 | 1 | 2 | 3 | 'full';
3
+ export const componentRoundnessArray: ComponentRoundness[] = [0, 1, 2, 3, 'full'];
@@ -0,0 +1,3 @@
1
+ /** Component Shadow */
2
+ export type ComponentShadow = 0 | 1 | 2 | 3 | 4 | 5;
3
+ export const componentShadowArray: ComponentShadow[] = [0, 1, 2, 3, 4, 5];
@@ -0,0 +1,3 @@
1
+ /** Component Size */
2
+ export type ComponentSize = 'normal' | 'small' | 'large';
3
+ export const componentSizeArray: ComponentSize[] = ['normal', 'small', 'large'];
@@ -0,0 +1,3 @@
1
+ /** Component Weight */
2
+ export type ComponentWeight = 'solid' | 'text';
3
+ export const componentWeightArray: ComponentWeight[] = ['solid', 'text'];
package/dist/types.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /** Component Size */
2
- export type ComponentSize = 'normal' | 'small' | 'large';
3
- /** Component Roundness */
4
- export type ComponentRoundness = '1x' | '2x' | '3x';
5
- export type ComponentRoundnessFull = 'full';
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,61 +0,0 @@
1
- import { Source } from '@storybook/blocks';
2
- import item from '../../../package.json?raw';
3
-
4
- <main style={{ textAlign: 'center' }}>
5
-
6
- <img src="dodo-circle-6.png" style={{ width: 200, height: 'auto' }} />
7
-
8
- # Dodo UI
9
-
10
- <h3 style={{ fontWeight: 500 }}>v{JSON.parse(item)?.version}</h3>
11
-
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
-
16
- </main>
17
-
18
- <br />
19
- <br />
20
-
21
- ## Install
22
-
23
- pnpm
24
-
25
- <Source
26
- dark
27
- language="bash"
28
- code={`
29
- pnpm add @flightlesslabs/dodo-ui
30
- `}
31
- />
32
-
33
- npm
34
-
35
- <Source
36
- dark
37
- language="bash"
38
- code={`
39
- npm i @flightlesslabs/dodo-ui
40
- `}
41
- />
42
-
43
- ## Use it!
44
-
45
- Lets import [Button](?path=/docs/components-form-button--docs) component
46
-
47
- <Source
48
- dark
49
- language="js"
50
- code={`
51
- import { Button } '@flightlesslabs/dodo-ui';
52
- `}
53
- />
54
-
55
- Checkout documentation for [Button](?path=/docs/components-form-button--docs)
56
-
57
- ## Explore more
58
-
59
- - [Themes](?path=/docs/philosophy-themes--docs)
60
- - [Colors](?path=/docs/philosophy-colors--docs)
61
- - [Adjust Color Opacity](?path=/docs/philosophy-colors--docs#adjusting-opacity)
@@ -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>