@flightlesslabs/dodo-ui 0.6.5 → 0.7.0
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 +32 -9
- package/dist/index.js +12 -2
- 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 +45 -47
- package/dist/stories/components/Form/Button/Button.svelte.d.ts +16 -12
- 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 +6 -8
- package/dist/stories/components/Form/FormControl/FormControl.svelte.d.ts +1 -1
- package/dist/stories/components/Form/Label/Label.stories.svelte +1 -11
- package/dist/stories/components/Form/Label/Label.svelte +6 -5
- package/dist/stories/components/Form/Label/Label.svelte.d.ts +1 -3
- 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 +5 -7
- package/dist/stories/components/Form/Message/Message.svelte.d.ts +4 -6
- 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 +26 -33
- package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte.d.ts +6 -5
- 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/Select/Customize/Customize.stories.svelte +120 -0
- package/dist/stories/components/Form/Select/Customize/Customize.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/Select/Events/Events.stories.svelte +138 -0
- package/dist/stories/components/Form/Select/Options/OptionFormat.mdx +40 -0
- package/dist/stories/components/Form/Select/Roundness/Roundness.stories.svelte +28 -0
- package/dist/stories/components/Form/Select/Roundness/Roundness.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/Select/Select.stories.svelte +114 -0
- package/dist/stories/components/Form/Select/Select.stories.svelte.d.ts +22 -0
- package/dist/stories/components/Form/Select/Select.svelte +285 -0
- package/dist/stories/components/Form/Select/Select.svelte.d.ts +87 -0
- package/dist/stories/components/Form/Select/Size/Size.stories.svelte +24 -0
- package/dist/stories/components/Form/Select/Size/Size.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/Select/WithIcon/WithIcon.stories.svelte +39 -0
- package/dist/stories/components/Form/Select/WithIcon/WithIcon.stories.svelte.d.ts +18 -0
- 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 +18 -30
- package/dist/stories/components/Form/TextInput/TextInput.svelte.d.ts +10 -5
- package/dist/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +4 -4
- package/dist/stories/components/Layout/Menu/Menu.stories.svelte +65 -0
- package/dist/stories/components/Layout/Menu/Menu.stories.svelte.d.ts +21 -0
- package/dist/stories/components/Layout/Menu/Menu.svelte +30 -0
- package/dist/stories/components/Layout/Menu/Menu.svelte.d.ts +23 -0
- package/dist/stories/components/Layout/Menu/MenuItem/MenuItem.stories.svelte +30 -0
- package/dist/stories/components/Layout/Menu/MenuItem/MenuItem.stories.svelte.d.ts +21 -0
- package/dist/stories/components/Layout/Menu/MenuItem/MenuItem.svelte +164 -0
- package/dist/stories/components/Layout/Menu/MenuItem/MenuItem.svelte.d.ts +49 -0
- package/dist/stories/components/Layout/Menu/MenuItem/Size/Size.stories.svelte +16 -0
- package/dist/stories/components/Layout/Menu/MenuItem/Type/Type.stories.svelte +21 -0
- package/dist/stories/components/{Form/SimpleSelect/WithIcon/WithIcon.stories.svelte.d.ts → Layout/Menu/MenuItem/Type/Type.stories.svelte.d.ts} +3 -3
- package/dist/stories/components/Layout/Menu/Size/Size.stories.svelte +37 -0
- package/dist/stories/components/{Form/SimpleSelect/Roundness/Roundness.stories.svelte.d.ts → Layout/Menu/Size/Size.stories.svelte.d.ts} +3 -3
- 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 +20 -9
- 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/components/Layout/Separator/Color/Color.stories.svelte +19 -0
- package/dist/stories/components/Layout/Separator/Color/Color.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Layout/Separator/Separator.stories.svelte +26 -0
- package/dist/stories/components/Layout/Separator/Separator.stories.svelte.d.ts +21 -0
- package/dist/stories/components/Layout/Separator/Separator.svelte +66 -0
- package/dist/stories/components/Layout/Separator/Separator.svelte.d.ts +22 -0
- package/dist/stories/components/Layout/Separator/utils/scss/mixins.scss +24 -0
- package/dist/stories/developer tools/Intro.mdx +2 -0
- package/dist/stories/developer tools/components/DynamicInput/DynamicInput.stories.svelte +49 -0
- package/dist/stories/{components/Form/SimpleSelect/SimpleSelect.stories.svelte.d.ts → developer tools/components/DynamicInput/DynamicInput.stories.svelte.d.ts } +5 -7
- package/dist/stories/developer tools/components/DynamicInput/DynamicInput.svelte +92 -0
- package/dist/stories/developer tools/components/DynamicInput/DynamicInput.svelte.d.ts +60 -0
- package/{src/lib/stories/components/Form/TextInput/Size/Size.stories.svelte → dist/stories/developer tools/components/DynamicInput/Size/Size.stories.svelte } +4 -4
- package/dist/stories/developer tools/components/DynamicInput/Size/Size.stories.svelte.d.ts +26 -0
- package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +5 -5
- package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte +19 -15
- package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte.d.ts +4 -3
- 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/Popper/Popper.stories.svelte +119 -0
- package/dist/stories/developer tools/components/Popper/Popper.stories.svelte.d.ts +21 -0
- package/dist/stories/developer tools/components/Popper/Popper.svelte +77 -0
- package/dist/stories/developer tools/components/Popper/Popper.svelte.d.ts +50 -0
- package/dist/stories/developer tools/components/Popper/PopperPopup/PopperPopup.stories.svelte +60 -0
- package/dist/stories/developer tools/components/Popper/PopperPopup/PopperPopup.stories.svelte.d.ts +21 -0
- package/dist/stories/developer tools/components/Popper/PopperPopup/PopperPopup.svelte +66 -0
- package/dist/stories/developer tools/components/Popper/PopperPopup/PopperPopup.svelte.d.ts +34 -0
- package/dist/stories/developer tools/components/Popper/PopperPopup/utils/getPopupPosition.d.ts +21 -0
- package/dist/stories/developer tools/components/Popper/PopperPopup/utils/getPopupPosition.js +62 -0
- package/dist/stories/developer tools/components/Popper/Positions/AutoPosition/AutoPosition.stories.svelte +89 -0
- package/dist/stories/developer tools/components/Popper/Positions/AutoPosition/AutoPosition.stories.svelte.d.ts +18 -0
- package/dist/stories/developer tools/components/Popper/Positions/Positions.stories.svelte +111 -0
- package/dist/stories/developer tools/components/Popper/Positions/Positions.stories.svelte.d.ts +18 -0
- package/dist/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +6 -8
- package/dist/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +4 -7
- package/dist/stories/developer tools/components/UtilityButton/UtilityButton.svelte +8 -5
- package/dist/stories/developer tools/components/UtilityButton/UtilityButton.svelte.d.ts +2 -2
- package/dist/stories/developer tools/directives/clickOutside/clickOutside.d.ts +3 -0
- package/dist/stories/developer tools/directives/clickOutside/clickOutside.js +14 -0
- package/dist/stories/developer tools/directives/clickOutside/index.mdx +25 -0
- 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/_z-index.css +9 -0
- package/dist/styles/global.css +2 -0
- package/dist/types/colors.d.ts +7 -0
- package/dist/types/colors.js +10 -0
- package/dist/types/position.d.ts +4 -0
- package/dist/types/position.js +2 -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 +61 -15
- package/src/lib/stories/components/Form/Button/Button.svelte +39 -36
- package/src/lib/stories/components/Form/FormControl/FormControl.svelte +9 -11
- package/src/lib/stories/components/Form/Label/Label.svelte +5 -8
- package/src/lib/stories/components/Form/Message/Message.svelte +11 -16
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.svelte +50 -50
- package/src/lib/stories/components/Form/Select/Select.svelte +501 -0
- package/src/lib/stories/components/Form/TextInput/TextInput.svelte +43 -60
- package/src/lib/stories/components/Layout/Menu/Menu.svelte +65 -0
- package/src/lib/stories/components/Layout/Menu/MenuItem/MenuItem.svelte +268 -0
- package/src/lib/stories/components/Layout/Paper/Paper.svelte +154 -27
- package/src/lib/stories/components/Layout/Paper/utils/scss/mixins.scss +46 -0
- package/src/lib/stories/components/Layout/Separator/Separator.svelte +96 -0
- package/src/lib/stories/components/Layout/Separator/utils/scss/mixins.scss +24 -0
- package/src/lib/stories/developer tools/components/DynamicInput/DynamicInput.svelte +195 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte +22 -18
- package/src/lib/stories/developer tools/components/Popper/Popper.svelte +159 -0
- package/src/lib/stories/developer tools/components/Popper/PopperPopup/PopperPopup.svelte +120 -0
- package/src/lib/stories/developer tools/components/Popper/PopperPopup/utils/getPopupPosition.ts +87 -0
- package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.svelte +8 -6
- package/src/lib/stories/developer tools/directives/clickOutside/clickOutside.ts +17 -0
- 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/_z-index.css +9 -0
- package/src/lib/styles/global.css +2 -0
- package/src/lib/types/colors.ts +16 -0
- package/src/lib/types/position.ts +5 -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/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +0 -74
- package/dist/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +0 -24
- package/dist/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +0 -59
- package/dist/stories/components/Form/SimpleSelect/SimpleSelect.svelte +0 -69
- package/dist/stories/components/Form/SimpleSelect/SimpleSelect.svelte.d.ts +0 -50
- package/dist/stories/components/Form/SimpleSelect/Size/Size.stories.svelte +0 -20
- package/dist/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +0 -36
- 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/SimpleSelect.svelte +0 -159
- 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/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/components/Form/{SimpleSelect → Select}/Events/Events.stories.svelte.d.ts +0 -0
- /package/dist/stories/components/{Form/SimpleSelect → Layout/Menu/MenuItem}/Size/Size.stories.svelte.d.ts +0 -0
- /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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { fn } from '@storybook/test';
|
|
4
3
|
import Button from '../Button.svelte';
|
|
5
4
|
import { storyButtonArgTypes } from '../Button.stories.svelte';
|
|
6
5
|
|
|
@@ -9,14 +8,9 @@
|
|
|
9
8
|
component: Button,
|
|
10
9
|
tags: ['autodocs'],
|
|
11
10
|
argTypes: storyButtonArgTypes,
|
|
12
|
-
args: {
|
|
13
|
-
onclick: fn(),
|
|
14
|
-
},
|
|
15
11
|
});
|
|
16
12
|
</script>
|
|
17
13
|
|
|
18
|
-
<Story name="Normal"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<Story name="Small" args={{ size: 'small' }}><Button size="small">Click me!</Button></Story>
|
|
22
|
-
<Story name="Large" args={{ size: 'large' }}><Button size="large">Click me!</Button></Story>
|
|
14
|
+
<Story name="Normal">Click me!</Story>
|
|
15
|
+
<Story name="Small" args={{ size: 'small' }}>Click me!</Story>
|
|
16
|
+
<Story name="Large" args={{ size: 'large' }}>Click me!</Story>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { fn } from '@storybook/test';
|
|
4
3
|
import Button from '../Button.svelte';
|
|
5
4
|
import { storyButtonArgTypes } from '../Button.stories.svelte';
|
|
6
5
|
|
|
@@ -9,13 +8,11 @@
|
|
|
9
8
|
component: Button,
|
|
10
9
|
tags: ['autodocs'],
|
|
11
10
|
argTypes: storyButtonArgTypes,
|
|
12
|
-
args: {
|
|
13
|
-
onclick: fn(),
|
|
14
|
-
},
|
|
15
11
|
});
|
|
16
12
|
</script>
|
|
17
13
|
|
|
18
|
-
<Story name="
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
<Story name="Solid">Click me!</Story>
|
|
15
|
+
|
|
16
|
+
<Story name="Text" args={{ variant: 'text' }}>Click me!</Story>
|
|
17
|
+
|
|
18
|
+
<Story name="Text Outline" args={{ variant: 'text', outline: true }}>Click me!</Story>
|
|
@@ -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>
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
<script lang="ts" module>export {};
|
|
2
|
+
</script>
|
|
3
|
+
|
|
1
4
|
<script lang="ts">import Label from '../Label/Label.svelte';
|
|
2
5
|
import Message from '../Message/Message.svelte';
|
|
3
6
|
let { children, label, class: className = '', for: htmlFor, form, ref = $bindable(), errorMessage, } = $props();
|
|
@@ -21,14 +24,9 @@ let { children, label, class: className = '', for: htmlFor, form, ref = $bindabl
|
|
|
21
24
|
{/if}
|
|
22
25
|
</div>
|
|
23
26
|
|
|
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);
|
|
27
|
+
<style>.dodo-ui-FormControl .LabelSection {
|
|
28
|
+
margin-bottom: var(--dodo-ui-space);
|
|
31
29
|
}
|
|
32
30
|
.dodo-ui-FormControl .errorMessage {
|
|
33
|
-
margin-top: var(--dodo-ui-
|
|
31
|
+
margin-top: var(--dodo-ui-space-large);
|
|
34
32
|
}</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,19 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
1
|
+
<script lang="ts" module>export {};
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<script lang="ts">"use strict";
|
|
5
|
+
let { children, class: className = '', for: htmlFor, form, ref = $bindable(), } = $props();
|
|
3
6
|
</script>
|
|
4
7
|
|
|
5
8
|
<label class={['dodo-ui-Label', className].join(' ')} for={htmlFor} {form} bind:this={ref}>
|
|
6
9
|
{#if children}
|
|
7
10
|
{@render children()}
|
|
8
|
-
{:else if _unsafeChildrenStringForTesting}
|
|
9
|
-
{_unsafeChildrenStringForTesting}
|
|
10
11
|
{/if}
|
|
11
12
|
</label>
|
|
12
13
|
|
|
13
14
|
<style>.dodo-ui-Label {
|
|
14
15
|
font-size: 0.95rem;
|
|
15
|
-
color: var(--dodo-color-
|
|
16
|
+
color: var(--dodo-color-neutral-700);
|
|
16
17
|
display: flex;
|
|
17
18
|
align-items: center;
|
|
18
19
|
font-family: inherit;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
interface LabelProps {
|
|
2
|
+
export interface LabelProps {
|
|
3
3
|
/** Label contents goes here */
|
|
4
4
|
children?: Snippet;
|
|
5
5
|
/** Label ref */
|
|
@@ -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,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts" module>export {};
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
|
-
<script lang="ts">
|
|
5
|
-
|
|
4
|
+
<script lang="ts">"use strict";
|
|
5
|
+
let { children, class: className = '', color = 'primary', ref = $bindable(), size = 'normal', } = $props();
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<div
|
|
@@ -11,8 +11,6 @@ export {};
|
|
|
11
11
|
>
|
|
12
12
|
{#if children}
|
|
13
13
|
{@render children()}
|
|
14
|
-
{:else if _unsafeChildrenStringForTesting}
|
|
15
|
-
{_unsafeChildrenStringForTesting}
|
|
16
14
|
{/if}
|
|
17
15
|
</div>
|
|
18
16
|
|
|
@@ -30,15 +28,15 @@ export {};
|
|
|
30
28
|
.dodo-ui-Message.size--large {
|
|
31
29
|
font-size: 1.1rem;
|
|
32
30
|
}
|
|
33
|
-
.dodo-ui-Message.color--default {
|
|
34
|
-
color: var(--dodo-color-default-800);
|
|
35
|
-
}
|
|
36
31
|
.dodo-ui-Message.color--primary {
|
|
37
32
|
color: var(--dodo-color-primary-600);
|
|
38
33
|
}
|
|
39
34
|
.dodo-ui-Message.color--secondary {
|
|
40
35
|
color: var(--dodo-color-secondary-600);
|
|
41
36
|
}
|
|
37
|
+
.dodo-ui-Message.color--neutral {
|
|
38
|
+
color: var(--dodo-color-neutral-600);
|
|
39
|
+
}
|
|
42
40
|
.dodo-ui-Message.color--safe {
|
|
43
41
|
color: var(--dodo-color-safe-600);
|
|
44
42
|
}
|
|
@@ -1,19 +1,17 @@
|
|
|
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
|
-
interface MessageProps {
|
|
4
|
+
export interface MessageProps {
|
|
5
5
|
/** Message contents goes here */
|
|
6
6
|
children?: Snippet;
|
|
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,21 +4,24 @@
|
|
|
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
|
-
|
|
7
|
+
import { DynamicInput } from '../../../../index.js';
|
|
8
|
+
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
9
|
let focused = $state(false);
|
|
9
10
|
let toggle = $state(passwordToggleState);
|
|
10
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
12
|
let customPasswordToggleIconTyped = customPasswordToggleIcon;
|
|
12
13
|
function onfocusMod(e) {
|
|
14
|
+
const eTyped = e;
|
|
13
15
|
focused = true;
|
|
14
16
|
if (onfocus) {
|
|
15
|
-
onfocus(
|
|
17
|
+
onfocus(eTyped);
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
20
|
function onblurMod(e) {
|
|
21
|
+
const eTyped = e;
|
|
19
22
|
focused = false;
|
|
20
23
|
if (onblur) {
|
|
21
|
-
onblur(
|
|
24
|
+
onblur(eTyped);
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
function ontoggleMod(e) {
|
|
@@ -42,11 +45,12 @@ function ontoggleMod(e) {
|
|
|
42
45
|
class={['dodo-ui-PasswordInput', `size--${size}`, `roundness--${roundness}`, className].join(' ')}
|
|
43
46
|
>
|
|
44
47
|
<InputEnclosure {outline} {disabled} {error} {focused} {size} {roundness} {before} {after}>
|
|
45
|
-
<
|
|
48
|
+
<DynamicInput
|
|
46
49
|
type={passwordToggle && toggle ? 'text' : 'password'}
|
|
47
50
|
{name}
|
|
48
51
|
{id}
|
|
49
52
|
{disabled}
|
|
53
|
+
bind:ref
|
|
50
54
|
{oninput}
|
|
51
55
|
{onchange}
|
|
52
56
|
onfocus={onfocusMod}
|
|
@@ -56,43 +60,32 @@ function ontoggleMod(e) {
|
|
|
56
60
|
{oncut}
|
|
57
61
|
{placeholder}
|
|
58
62
|
bind:value
|
|
59
|
-
bind:this={ref}
|
|
60
63
|
{readonly}
|
|
64
|
+
variant="input"
|
|
61
65
|
/>
|
|
62
66
|
|
|
63
67
|
{#if passwordToggle && !disabled}
|
|
64
|
-
<
|
|
65
|
-
{
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
<div class:after class="passwordToggle">
|
|
69
|
+
<UtilityButton {size} title="Toggle password" onclick={ontoggleMod}>
|
|
70
|
+
{#if customPasswordToggleIcon}
|
|
71
|
+
{@render customPasswordToggleIconTyped(toggle)}
|
|
72
|
+
{:else if toggle}
|
|
73
|
+
<Icon icon="mdi:eye-off" width="24" height="24" />
|
|
74
|
+
{:else}
|
|
75
|
+
<Icon icon="mdi:eye" width="24" height="24" />
|
|
76
|
+
{/if}
|
|
77
|
+
</UtilityButton>
|
|
78
|
+
</div>
|
|
73
79
|
{/if}
|
|
74
80
|
</InputEnclosure>
|
|
75
81
|
</div>
|
|
76
82
|
|
|
77
|
-
<style>.dodo-ui-PasswordInput
|
|
78
|
-
|
|
79
|
-
border: 0;
|
|
80
|
-
outline: 0;
|
|
81
|
-
height: 100%;
|
|
82
|
-
background-color: transparent;
|
|
83
|
-
font-family: inherit;
|
|
84
|
-
color: inherit;
|
|
85
|
-
letter-spacing: 0.3px;
|
|
83
|
+
<style>.dodo-ui-PasswordInput.size--normal .passwordToggle.after {
|
|
84
|
+
margin-right: calc(var(--dodo-ui-space-small) * 2);
|
|
86
85
|
}
|
|
87
|
-
.dodo-ui-PasswordInput.size--
|
|
88
|
-
|
|
89
|
-
padding: 0 12px;
|
|
86
|
+
.dodo-ui-PasswordInput.size--small .passwordToggle.after {
|
|
87
|
+
margin-right: var(--dodo-ui-space);
|
|
90
88
|
}
|
|
91
|
-
.dodo-ui-PasswordInput.size--
|
|
92
|
-
|
|
93
|
-
font-size: 0.9rem;
|
|
94
|
-
}
|
|
95
|
-
.dodo-ui-PasswordInput.size--large input {
|
|
96
|
-
font-size: 1.1rem;
|
|
97
|
-
padding: 0 14px;
|
|
89
|
+
.dodo-ui-PasswordInput.size--large .passwordToggle.after {
|
|
90
|
+
margin-right: calc(var(--dodo-ui-space) * 2);
|
|
98
91
|
}</style>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type { ComponentSize } from '../../../../types/size.js';
|
|
2
|
+
import type { ComponentRoundness } from '../../../../types/roundness.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import type { ChangeEventHandler, ClipboardEventHandler, FocusEventHandler, FormEventHandler } from 'svelte/elements';
|
|
1
5
|
export type PasswordInputToggleEvent = {
|
|
2
6
|
event: Event;
|
|
3
7
|
toggle: boolean;
|
|
4
8
|
};
|
|
5
|
-
|
|
6
|
-
import type { Snippet } from 'svelte';
|
|
7
|
-
import type { ChangeEventHandler, ClipboardEventHandler, FocusEventHandler, FormEventHandler } from 'svelte/elements';
|
|
8
|
-
interface PasswordInputProps {
|
|
9
|
+
export interface PasswordInputProps {
|
|
9
10
|
/** How large should the button be? */
|
|
10
11
|
size?: ComponentSize;
|
|
11
12
|
/** Input ref */
|
|
@@ -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" />
|