@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
|
@@ -10,18 +10,17 @@ const { Story } = defineMeta({
|
|
|
10
10
|
|
|
11
11
|
<Story name="Default" args={{ label: 'Hello there' }} />
|
|
12
12
|
|
|
13
|
-
<Story name="Example TextInput" args={{ label: 'Whats your first name?' }}>
|
|
14
|
-
<
|
|
15
|
-
<TextInput placeholder="First name" id="first-name-01" />
|
|
16
|
-
</FormControl>
|
|
13
|
+
<Story name="Example TextInput" args={{ label: 'Whats your first name?', for: 'first-name-01' }}>
|
|
14
|
+
<TextInput placeholder="First name" id="first-name-01" />
|
|
17
15
|
</Story>
|
|
18
16
|
|
|
19
|
-
<Story
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
<Story
|
|
18
|
+
name="ErrorMessage"
|
|
19
|
+
args={{
|
|
20
|
+
label: 'Whats your first name?',
|
|
21
|
+
for: 'first-name-02',
|
|
22
|
+
errorMessage: 'This is an error message',
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<TextInput value="John Smith" id="first-name-02" error />
|
|
27
26
|
</Story>
|
|
@@ -21,14 +21,9 @@ let { children, label, class: className = '', for: htmlFor, form, ref = $bindabl
|
|
|
21
21
|
{/if}
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
|
-
<style
|
|
25
|
-
--dodo-ui-
|
|
26
|
-
--dodo-ui-FormControl-errorMessage-gap: 10px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.dodo-ui-FormControl .LabelSection {
|
|
30
|
-
margin-bottom: var(--dodo-ui-FormControl-LabelSection-gap);
|
|
24
|
+
<style>.dodo-ui-FormControl .LabelSection {
|
|
25
|
+
margin-bottom: var(--dodo-ui-space);
|
|
31
26
|
}
|
|
32
27
|
.dodo-ui-FormControl .errorMessage {
|
|
33
|
-
margin-top: var(--dodo-ui-
|
|
28
|
+
margin-top: var(--dodo-ui-space-large);
|
|
34
29
|
}</style>
|
|
@@ -7,15 +7,5 @@ const { Story } = defineMeta({
|
|
|
7
7
|
});
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
|
-
<!-- ⚠️ Test Label: Do not use! -->
|
|
11
|
-
<Story
|
|
12
|
-
name="Test Label"
|
|
13
|
-
args={{
|
|
14
|
-
_unsafeChildrenStringForTesting: 'This is a form label',
|
|
15
|
-
}}
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
10
|
<!-- Label with default style -->
|
|
19
|
-
<Story name="Default">
|
|
20
|
-
<Label>This is a form label</Label>
|
|
21
|
-
</Story>
|
|
11
|
+
<Story name="Default">This is a form label</Story>
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
<script lang="ts">let { children, class: className = '', for: htmlFor, form,
|
|
1
|
+
<script lang="ts">let { children, class: className = '', for: htmlFor, form, ref = $bindable(), } = $props();
|
|
2
2
|
export {};
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<label class={['dodo-ui-Label', className].join(' ')} for={htmlFor} {form} bind:this={ref}>
|
|
6
6
|
{#if children}
|
|
7
7
|
{@render children()}
|
|
8
|
-
{:else if _unsafeChildrenStringForTesting}
|
|
9
|
-
{_unsafeChildrenStringForTesting}
|
|
10
8
|
{/if}
|
|
11
9
|
</label>
|
|
12
10
|
|
|
13
11
|
<style>.dodo-ui-Label {
|
|
14
12
|
font-size: 0.95rem;
|
|
15
|
-
color: var(--dodo-color-
|
|
13
|
+
color: var(--dodo-color-neutral-700);
|
|
16
14
|
display: flex;
|
|
17
15
|
align-items: center;
|
|
18
16
|
font-family: inherit;
|
|
@@ -10,8 +10,6 @@ interface LabelProps {
|
|
|
10
10
|
form?: string;
|
|
11
11
|
/** Custom css class*/
|
|
12
12
|
class?: string;
|
|
13
|
-
/** Test: ⚠️ Unsafe Children String. Do Not use*/
|
|
14
|
-
_unsafeChildrenStringForTesting?: string;
|
|
15
13
|
}
|
|
16
14
|
declare const Label: import("svelte").Component<LabelProps, {}, "ref">;
|
|
17
15
|
type Label = ReturnType<typeof Label>;
|
|
@@ -11,26 +11,26 @@
|
|
|
11
11
|
});
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
|
-
<Story name="Default">
|
|
15
|
-
<Message>Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
16
|
-
</Story>
|
|
17
|
-
|
|
18
14
|
<Story name="Primary" args={{ color: 'primary' }}>
|
|
19
|
-
|
|
15
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
20
16
|
</Story>
|
|
21
17
|
|
|
22
18
|
<Story name="Secondary" args={{ color: 'secondary' }}>
|
|
23
|
-
|
|
19
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
20
|
+
</Story>
|
|
21
|
+
|
|
22
|
+
<Story name="Neutral" args={{ color: 'neutral' }}>
|
|
23
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
24
24
|
</Story>
|
|
25
25
|
|
|
26
26
|
<Story name="Safe" args={{ color: 'safe' }}>
|
|
27
|
-
|
|
27
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
28
28
|
</Story>
|
|
29
29
|
|
|
30
30
|
<Story name="Warning" args={{ color: 'warning' }}>
|
|
31
|
-
|
|
31
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
32
32
|
</Story>
|
|
33
33
|
|
|
34
34
|
<Story name="Danger" args={{ color: 'danger' }}>
|
|
35
|
-
|
|
35
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
36
36
|
</Story>
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<script module lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
2
2
|
import Message from './Message.svelte';
|
|
3
|
+
import { componentColorArray } from '../../../../types/colors.js';
|
|
4
|
+
import { componentSizeArray } from '../../../../types/size.js';
|
|
3
5
|
export const storyMessageArgTypes = {
|
|
4
6
|
color: {
|
|
5
7
|
control: { type: 'select' },
|
|
6
|
-
options:
|
|
8
|
+
options: componentColorArray,
|
|
7
9
|
},
|
|
8
10
|
size: {
|
|
9
11
|
control: { type: 'select' },
|
|
10
|
-
options:
|
|
12
|
+
options: componentSizeArray,
|
|
11
13
|
},
|
|
12
14
|
};
|
|
13
15
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
@@ -18,14 +20,4 @@ const { Story } = defineMeta({
|
|
|
18
20
|
});
|
|
19
21
|
</script>
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
<Story
|
|
23
|
-
name="Test Message"
|
|
24
|
-
args={{
|
|
25
|
-
_unsafeChildrenStringForTesting: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
|
|
26
|
-
}}
|
|
27
|
-
/>
|
|
28
|
-
|
|
29
|
-
<Story name="Default">
|
|
30
|
-
<Message>Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
31
|
-
</Story>
|
|
23
|
+
<Story name="Primary">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Story>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
</script>
|
|
3
|
-
|
|
4
|
-
<script lang="ts">let { children, class: className = '', color = 'default', ref = $bindable(), _unsafeChildrenStringForTesting, size = 'normal', } = $props();
|
|
1
|
+
<script lang="ts">let { children, class: className = '', color = 'primary', ref = $bindable(), size = 'normal', } = $props();
|
|
5
2
|
export {};
|
|
6
3
|
</script>
|
|
7
4
|
|
|
@@ -11,8 +8,6 @@ export {};
|
|
|
11
8
|
>
|
|
12
9
|
{#if children}
|
|
13
10
|
{@render children()}
|
|
14
|
-
{:else if _unsafeChildrenStringForTesting}
|
|
15
|
-
{_unsafeChildrenStringForTesting}
|
|
16
11
|
{/if}
|
|
17
12
|
</div>
|
|
18
13
|
|
|
@@ -30,15 +25,15 @@ export {};
|
|
|
30
25
|
.dodo-ui-Message.size--large {
|
|
31
26
|
font-size: 1.1rem;
|
|
32
27
|
}
|
|
33
|
-
.dodo-ui-Message.color--default {
|
|
34
|
-
color: var(--dodo-color-default-800);
|
|
35
|
-
}
|
|
36
28
|
.dodo-ui-Message.color--primary {
|
|
37
29
|
color: var(--dodo-color-primary-600);
|
|
38
30
|
}
|
|
39
31
|
.dodo-ui-Message.color--secondary {
|
|
40
32
|
color: var(--dodo-color-secondary-600);
|
|
41
33
|
}
|
|
34
|
+
.dodo-ui-Message.color--neutral {
|
|
35
|
+
color: var(--dodo-color-neutral-600);
|
|
36
|
+
}
|
|
42
37
|
.dodo-ui-Message.color--safe {
|
|
43
38
|
color: var(--dodo-color-safe-600);
|
|
44
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ComponentSize } from '../../../../types.js';
|
|
1
|
+
import type { ComponentColor } from '../../../../types/colors.js';
|
|
2
|
+
import type { ComponentSize } from '../../../../types/size.js';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
interface MessageProps {
|
|
5
5
|
/** Message contents goes here */
|
|
@@ -7,13 +7,11 @@ interface MessageProps {
|
|
|
7
7
|
/** Message ref */
|
|
8
8
|
ref?: HTMLDivElement;
|
|
9
9
|
/** What color to use? */
|
|
10
|
-
color?:
|
|
10
|
+
color?: ComponentColor;
|
|
11
11
|
/** Message size */
|
|
12
12
|
size?: ComponentSize;
|
|
13
13
|
/** Custom css class*/
|
|
14
14
|
class?: string;
|
|
15
|
-
/** Test: ⚠️ Unsafe Children String. Do Not use*/
|
|
16
|
-
_unsafeChildrenStringForTesting?: string;
|
|
17
15
|
}
|
|
18
16
|
declare const Message: import("svelte").Component<MessageProps, {}, "ref">;
|
|
19
17
|
type Message = ReturnType<typeof Message>;
|
|
@@ -11,14 +11,12 @@
|
|
|
11
11
|
});
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
|
-
<Story name="Normal">
|
|
15
|
-
<Message>Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
16
|
-
</Story>
|
|
14
|
+
<Story name="Normal">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Story>
|
|
17
15
|
|
|
18
16
|
<Story name="Small" args={{ size: 'small' }}>
|
|
19
|
-
|
|
17
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
20
18
|
</Story>
|
|
21
19
|
|
|
22
20
|
<Story name="Large" args={{ size: 'large' }}>
|
|
23
|
-
|
|
21
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
24
22
|
</Story>
|
|
@@ -18,15 +18,7 @@ const { Story } = defineMeta({
|
|
|
18
18
|
console.log('Input Event', target.value);
|
|
19
19
|
},
|
|
20
20
|
}}
|
|
21
|
-
|
|
22
|
-
<PasswordInput
|
|
23
|
-
oninput={(e: Event) => {
|
|
24
|
-
const target = e.target as HTMLInputElement;
|
|
25
|
-
|
|
26
|
-
console.log('Input Event', target.value);
|
|
27
|
-
}}
|
|
28
|
-
/>
|
|
29
|
-
</Story>
|
|
21
|
+
/>
|
|
30
22
|
|
|
31
23
|
<Story
|
|
32
24
|
name="Change"
|
|
@@ -37,15 +29,7 @@ const { Story } = defineMeta({
|
|
|
37
29
|
console.log('onChange Event', target.value);
|
|
38
30
|
},
|
|
39
31
|
}}
|
|
40
|
-
|
|
41
|
-
<PasswordInput
|
|
42
|
-
onchange={(e: Event) => {
|
|
43
|
-
const target = e.target as HTMLInputElement;
|
|
44
|
-
|
|
45
|
-
console.log('onchange Event', target.value);
|
|
46
|
-
}}
|
|
47
|
-
/>
|
|
48
|
-
</Story>
|
|
32
|
+
/>
|
|
49
33
|
|
|
50
34
|
<!-- `e: PasswordInputToggleEvent` -->
|
|
51
35
|
<Story
|
|
@@ -57,15 +41,7 @@ const { Story } = defineMeta({
|
|
|
57
41
|
console.log('ontoggle Event', e, target);
|
|
58
42
|
},
|
|
59
43
|
}}
|
|
60
|
-
|
|
61
|
-
<PasswordInput
|
|
62
|
-
ontoggle={(e: PasswordInputToggleEvent) => {
|
|
63
|
-
const target = e.event.target as HTMLButtonElement;
|
|
64
|
-
|
|
65
|
-
console.log('ontoggle Event', e, target);
|
|
66
|
-
}}
|
|
67
|
-
/>
|
|
68
|
-
</Story>
|
|
44
|
+
/>
|
|
69
45
|
|
|
70
46
|
<!-- `e: TextInputFocusEvent` -->
|
|
71
47
|
<Story
|
|
@@ -77,15 +53,7 @@ const { Story } = defineMeta({
|
|
|
77
53
|
console.log('onfocus Event', target);
|
|
78
54
|
},
|
|
79
55
|
}}
|
|
80
|
-
|
|
81
|
-
<PasswordInput
|
|
82
|
-
onfocus={(e: TextInputFocusEvent) => {
|
|
83
|
-
const target = e.target as HTMLInputElement;
|
|
84
|
-
|
|
85
|
-
console.log('onfocus Event', target);
|
|
86
|
-
}}
|
|
87
|
-
/>
|
|
88
|
-
</Story>
|
|
56
|
+
/>
|
|
89
57
|
|
|
90
58
|
<!-- `e: TextInputFocusEvent` -->
|
|
91
59
|
<Story
|
|
@@ -97,15 +65,7 @@ const { Story } = defineMeta({
|
|
|
97
65
|
console.log('onblur Event', target);
|
|
98
66
|
},
|
|
99
67
|
}}
|
|
100
|
-
|
|
101
|
-
<PasswordInput
|
|
102
|
-
onblur={(e: TextInputFocusEvent) => {
|
|
103
|
-
const target = e.target as HTMLInputElement;
|
|
104
|
-
|
|
105
|
-
console.log('onblur Event', target);
|
|
106
|
-
}}
|
|
107
|
-
/>
|
|
108
|
-
</Story>
|
|
68
|
+
/>
|
|
109
69
|
|
|
110
70
|
<!-- `e: TextInputClipboardEvent` -->
|
|
111
71
|
<Story
|
|
@@ -117,15 +77,7 @@ const { Story } = defineMeta({
|
|
|
117
77
|
console.log('oncopy Event', target);
|
|
118
78
|
},
|
|
119
79
|
}}
|
|
120
|
-
|
|
121
|
-
<PasswordInput
|
|
122
|
-
oncopy={(e: TextInputClipboardEvent) => {
|
|
123
|
-
const target = e.target as HTMLInputElement;
|
|
124
|
-
|
|
125
|
-
console.log('oncopy Event', target);
|
|
126
|
-
}}
|
|
127
|
-
/>
|
|
128
|
-
</Story>
|
|
80
|
+
/>
|
|
129
81
|
|
|
130
82
|
<!-- `e: TextInputClipboardEvent` -->
|
|
131
83
|
<Story
|
|
@@ -137,15 +89,7 @@ const { Story } = defineMeta({
|
|
|
137
89
|
console.log('oncut Event', target);
|
|
138
90
|
},
|
|
139
91
|
}}
|
|
140
|
-
|
|
141
|
-
<PasswordInput
|
|
142
|
-
oncut={(e: TextInputClipboardEvent) => {
|
|
143
|
-
const target = e.target as HTMLInputElement;
|
|
144
|
-
|
|
145
|
-
console.log('oncut Event', target);
|
|
146
|
-
}}
|
|
147
|
-
/>
|
|
148
|
-
</Story>
|
|
92
|
+
/>
|
|
149
93
|
|
|
150
94
|
<!-- `e: TextInputClipboardEvent` -->
|
|
151
95
|
<Story
|
|
@@ -157,12 +101,4 @@ const { Story } = defineMeta({
|
|
|
157
101
|
console.log('onpaste Event', target);
|
|
158
102
|
},
|
|
159
103
|
}}
|
|
160
|
-
|
|
161
|
-
<PasswordInput
|
|
162
|
-
onpaste={(e: TextInputClipboardEvent) => {
|
|
163
|
-
const target = e.target as HTMLInputElement;
|
|
164
|
-
|
|
165
|
-
console.log('onpaste Event', target);
|
|
166
|
-
}}
|
|
167
|
-
/>
|
|
168
|
-
</Story>
|
|
104
|
+
/>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
<script module lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
2
2
|
import PasswordInput from './PasswordInput.svelte';
|
|
3
3
|
import Icon from '@iconify/svelte';
|
|
4
|
+
import { componentRoundnessArray } from '../../../../types/roundness.js';
|
|
5
|
+
import { componentSizeArray } from '../../../../types/size.js';
|
|
4
6
|
export const storyPasswordInputArgTypes = {
|
|
5
7
|
roundness: {
|
|
6
8
|
control: { type: 'select' },
|
|
7
|
-
options:
|
|
9
|
+
options: componentRoundnessArray,
|
|
8
10
|
},
|
|
9
11
|
size: {
|
|
10
12
|
control: { type: 'select' },
|
|
11
|
-
options:
|
|
13
|
+
options: componentSizeArray,
|
|
12
14
|
},
|
|
13
15
|
};
|
|
14
16
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
@@ -40,7 +42,7 @@ const { Story } = defineMeta({
|
|
|
40
42
|
<Story name="Read only" args={{ readonly: true }} />
|
|
41
43
|
|
|
42
44
|
<!-- Show Password by default -->
|
|
43
|
-
<Story name="Custom toggle icon">
|
|
45
|
+
<Story name="Custom toggle icon" asChild>
|
|
44
46
|
<PasswordInput value="Hello world!">
|
|
45
47
|
{#snippet customPasswordToggleIcon(toggle)}
|
|
46
48
|
{#if toggle}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<script lang="ts">import Icon from '@iconify/svelte';
|
|
5
5
|
import UtilityButton from '../../../developer tools/components/UtilityButton/UtilityButton.svelte';
|
|
6
6
|
import InputEnclosure from '../../../developer tools/components/InputEnclosure/InputEnclosure.svelte';
|
|
7
|
-
let { size = 'normal', roundness =
|
|
7
|
+
let { size = 'normal', roundness = 1, outline = true, name, id, class: className = '', disabled = false, oninput, onchange, onblur, onfocus, onpaste, oncopy, oncut, before, after, customPasswordToggleIcon, error = false, passwordToggle = true, passwordToggleState = $bindable(), value = $bindable(), placeholder, ontoggle, ref = $bindable(), readonly = false, } = $props();
|
|
8
8
|
let focused = $state(false);
|
|
9
9
|
let toggle = $state(passwordToggleState);
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -86,13 +86,13 @@ function ontoggleMod(e) {
|
|
|
86
86
|
}
|
|
87
87
|
.dodo-ui-PasswordInput.size--normal input {
|
|
88
88
|
font-size: 1rem;
|
|
89
|
-
padding: 0
|
|
89
|
+
padding: 0 calc(var(--dodo-ui-space-small) * 2);
|
|
90
90
|
}
|
|
91
91
|
.dodo-ui-PasswordInput.size--small input {
|
|
92
|
-
padding: 0
|
|
92
|
+
padding: 0 var(--dodo-ui-space);
|
|
93
93
|
font-size: 0.9rem;
|
|
94
94
|
}
|
|
95
95
|
.dodo-ui-PasswordInput.size--large input {
|
|
96
96
|
font-size: 1.1rem;
|
|
97
|
-
padding: 0
|
|
97
|
+
padding: 0 calc(var(--dodo-ui-space) * 2);
|
|
98
98
|
}</style>
|
|
@@ -2,9 +2,10 @@ export type PasswordInputToggleEvent = {
|
|
|
2
2
|
event: Event;
|
|
3
3
|
toggle: boolean;
|
|
4
4
|
};
|
|
5
|
-
import type { ComponentRoundness, ComponentSize } from '../../../../types.js';
|
|
6
5
|
import type { Snippet } from 'svelte';
|
|
7
6
|
import type { ChangeEventHandler, ClipboardEventHandler, FocusEventHandler, FormEventHandler } from 'svelte/elements';
|
|
7
|
+
import type { ComponentSize } from '../../../../types/size.js';
|
|
8
|
+
import type { ComponentRoundness } from '../../../../types/roundness.js';
|
|
8
9
|
interface PasswordInputProps {
|
|
9
10
|
/** How large should the button be? */
|
|
10
11
|
size?: ComponentSize;
|
|
@@ -17,7 +18,7 @@ interface PasswordInputProps {
|
|
|
17
18
|
/** Toggle Password Icon */
|
|
18
19
|
customPasswordToggleIcon?: (toggle: boolean) => Snippet;
|
|
19
20
|
/** How round should the border radius be? */
|
|
20
|
-
roundness?: ComponentRoundness
|
|
21
|
+
roundness?: ComponentRoundness;
|
|
21
22
|
/** Add a border around the button. Default True */
|
|
22
23
|
outline?: boolean;
|
|
23
24
|
/** Input value */
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
});
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
|
-
<Story name="Roundness
|
|
14
|
+
<Story name="Roundness 1" />
|
|
15
15
|
|
|
16
|
-
<Story name="Roundness
|
|
16
|
+
<Story name="Roundness 2" args={{ roundness: 2 }} />
|
|
17
17
|
|
|
18
|
-
<Story name="Roundness
|
|
18
|
+
<Story name="Roundness 3" args={{ roundness: 3 }} />
|
|
19
19
|
|
|
20
|
-
<Story name="Roundness
|
|
20
|
+
<Story name="Roundness 0" args={{ roundness: 0 }} />
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<!-- PasswordInput icon in front. -->
|
|
16
|
-
<Story name="Icon Before">
|
|
16
|
+
<Story name="Icon Before" asChild>
|
|
17
17
|
<PasswordInput>
|
|
18
18
|
{#snippet before()}
|
|
19
19
|
<Icon icon="material-symbols:content-copy" />
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
</Story>
|
|
23
23
|
|
|
24
24
|
<!-- PasswordInput icon in front. -->
|
|
25
|
-
<Story name="Icon After">
|
|
25
|
+
<Story name="Icon After" asChild>
|
|
26
26
|
<PasswordInput>
|
|
27
27
|
{#snippet after()}
|
|
28
28
|
<Icon icon="material-symbols:download-2" />
|
|
@@ -20,16 +20,7 @@ const { Story } = defineMeta({
|
|
|
20
20
|
console.log('onChange Event', target.value);
|
|
21
21
|
},
|
|
22
22
|
}}
|
|
23
|
-
|
|
24
|
-
<SimpleSelect
|
|
25
|
-
onchange={(e: Event) => {
|
|
26
|
-
const target = e.target as HTMLSelectElement;
|
|
27
|
-
|
|
28
|
-
console.log('onchange Event', target.value);
|
|
29
|
-
}}
|
|
30
|
-
options={storySimpleSelectOptions}
|
|
31
|
-
/>
|
|
32
|
-
</Story>
|
|
23
|
+
/>
|
|
33
24
|
|
|
34
25
|
<!-- `e: SimpleSelectFocusEvent` -->
|
|
35
26
|
<Story
|
|
@@ -41,16 +32,7 @@ const { Story } = defineMeta({
|
|
|
41
32
|
console.log('onfocus Event', target);
|
|
42
33
|
},
|
|
43
34
|
}}
|
|
44
|
-
|
|
45
|
-
<SimpleSelect
|
|
46
|
-
onfocus={(e: SimpleSelectFocusEvent) => {
|
|
47
|
-
const target = e.target as HTMLSelectElement;
|
|
48
|
-
|
|
49
|
-
console.log('onfocus Event', target);
|
|
50
|
-
}}
|
|
51
|
-
options={storySimpleSelectOptions}
|
|
52
|
-
/>
|
|
53
|
-
</Story>
|
|
35
|
+
/>
|
|
54
36
|
|
|
55
37
|
<!-- `e: SimpleSelectFocusEvent` -->
|
|
56
38
|
<Story
|
|
@@ -62,13 +44,4 @@ const { Story } = defineMeta({
|
|
|
62
44
|
console.log('onblur Event', target);
|
|
63
45
|
},
|
|
64
46
|
}}
|
|
65
|
-
|
|
66
|
-
<SimpleSelect
|
|
67
|
-
onblur={(e: SimpleSelectFocusEvent) => {
|
|
68
|
-
const target = e.target as HTMLSelectElement;
|
|
69
|
-
|
|
70
|
-
console.log('onblur Event', target);
|
|
71
|
-
}}
|
|
72
|
-
options={storySimpleSelectOptions}
|
|
73
|
-
/>
|
|
74
|
-
</Story>
|
|
47
|
+
/>
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
});
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
|
-
<Story name="Roundness
|
|
18
|
+
<Story name="Roundness 1" />
|
|
19
19
|
|
|
20
|
-
<Story name="Roundness
|
|
20
|
+
<Story name="Roundness 2" args={{ roundness: 2 }} />
|
|
21
21
|
|
|
22
|
-
<Story name="Roundness
|
|
22
|
+
<Story name="Roundness 3" args={{ roundness: 3 }} />
|
|
23
23
|
|
|
24
|
-
<Story name="Roundness
|
|
24
|
+
<Story name="Roundness 0" args={{ roundness: 0 }} />
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
<script module lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
2
2
|
import {} from './SimpleSelect.svelte';
|
|
3
3
|
import SimpleSelect from './SimpleSelect.svelte';
|
|
4
|
+
import { componentRoundnessArray } from '../../../../types/roundness.js';
|
|
5
|
+
import { componentSizeArray } from '../../../../types/size.js';
|
|
4
6
|
export const storySimpleSelectArgTypes = {
|
|
5
|
-
type: {
|
|
6
|
-
control: { type: 'select' },
|
|
7
|
-
options: ['text', 'tel', 'email', 'password', 'url', 'number'],
|
|
8
|
-
},
|
|
9
7
|
roundness: {
|
|
10
8
|
control: { type: 'select' },
|
|
11
|
-
options:
|
|
9
|
+
options: componentRoundnessArray,
|
|
12
10
|
},
|
|
13
11
|
size: {
|
|
14
12
|
control: { type: 'select' },
|
|
15
|
-
options:
|
|
13
|
+
options: componentSizeArray,
|
|
16
14
|
},
|
|
17
15
|
};
|
|
18
16
|
export const storySimpleSelectOptions = [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
4
|
<script lang="ts">import InputEnclosure from '../../../developer tools/components/InputEnclosure/InputEnclosure.svelte';
|
|
5
|
-
let { size = 'normal', roundness =
|
|
5
|
+
let { size = 'normal', roundness = 1, outline = true, name, id, class: className = '', disabled = false, onchange, onblur, onfocus, before, after, error = false, value, placeholder, ref = $bindable(), options, } = $props();
|
|
6
6
|
let focused = $state(false);
|
|
7
7
|
function onfocusMod(e) {
|
|
8
8
|
focused = true;
|
|
@@ -57,13 +57,13 @@ function onblurMod(e) {
|
|
|
57
57
|
}
|
|
58
58
|
.dodo-ui-SimpleSelect.size--normal select {
|
|
59
59
|
font-size: 1rem;
|
|
60
|
-
padding: 0
|
|
60
|
+
padding: 0 calc(var(--dodo-ui-space-small) * 2);
|
|
61
61
|
}
|
|
62
62
|
.dodo-ui-SimpleSelect.size--small select {
|
|
63
|
-
padding: 0
|
|
63
|
+
padding: 0 var(--dodo-ui-space);
|
|
64
64
|
font-size: 0.9rem;
|
|
65
65
|
}
|
|
66
66
|
.dodo-ui-SimpleSelect.size--large select {
|
|
67
67
|
font-size: 1.1rem;
|
|
68
|
-
padding: 0
|
|
68
|
+
padding: 0 calc(var(--dodo-ui-space) * 2);
|
|
69
69
|
}</style>
|
|
@@ -6,7 +6,8 @@ export type SimpleSelectOption = {
|
|
|
6
6
|
label: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
};
|
|
9
|
-
import type { ComponentRoundness
|
|
9
|
+
import type { ComponentRoundness } from '../../../../types/roundness.js';
|
|
10
|
+
import type { ComponentSize } from '../../../../types/size.js';
|
|
10
11
|
import type { Snippet } from 'svelte';
|
|
11
12
|
import type { ChangeEventHandler, FocusEventHandler } from 'svelte/elements';
|
|
12
13
|
interface SimpleSelectProps {
|
|
@@ -15,7 +16,7 @@ interface SimpleSelectProps {
|
|
|
15
16
|
/** How large should the button be? */
|
|
16
17
|
size?: ComponentSize;
|
|
17
18
|
/** How round should the border radius be? */
|
|
18
|
-
roundness?: ComponentRoundness
|
|
19
|
+
roundness?: ComponentRoundness;
|
|
19
20
|
/** How round should the border radius be? */
|
|
20
21
|
options: SimpleSelectOption[];
|
|
21
22
|
/** Add a border around the button. Default True */
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<!-- SimpleSelect icon in front. -->
|
|
21
|
-
<Story name="Icon Before">
|
|
21
|
+
<Story name="Icon Before" asChild>
|
|
22
22
|
<SimpleSelect options={storySimpleSelectOptions}>
|
|
23
23
|
{#snippet before()}
|
|
24
24
|
<Icon icon="material-symbols:content-copy" />
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</Story>
|
|
28
28
|
|
|
29
29
|
<!-- SimpleSelect icon in front. -->
|
|
30
|
-
<Story name="Icon After">
|
|
30
|
+
<Story name="Icon After" asChild>
|
|
31
31
|
<SimpleSelect options={storySimpleSelectOptions}>
|
|
32
32
|
{#snippet after()}
|
|
33
33
|
<Icon icon="material-symbols:download-2" />
|