@flightlesslabs/dodo-ui 0.4.0 → 0.6.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 +9 -1
- package/dist/index.js +6 -0
- package/dist/stories/components/Form/Button/Button.stories.svelte +1 -1
- package/dist/stories/components/Form/Button/Button.svelte +37 -37
- package/dist/stories/components/Form/Button/Button.svelte.d.ts +1 -1
- package/dist/stories/components/Form/Button/Color/Color.stories.svelte +9 -7
- package/dist/stories/components/Form/FormControl/FormControl.svelte +1 -1
- package/dist/stories/components/Form/Message/Color/Color.stories.svelte +36 -0
- package/dist/stories/components/Form/Message/Color/Color.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Form/Message/Message.stories.svelte +11 -26
- package/dist/stories/components/Form/Message/Message.stories.svelte.d.ts +2 -0
- package/dist/stories/components/Form/Message/Message.svelte +17 -6
- package/dist/stories/components/Form/Message/Message.svelte.d.ts +4 -1
- package/dist/stories/components/Form/Message/Size/Size.stories.svelte +24 -0
- package/dist/stories/components/Form/Message/Size/Size.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte +32 -130
- package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte.d.ts +2 -3
- package/dist/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +74 -0
- package/dist/stories/components/Form/SimpleSelect/Events/Events.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +24 -0
- package/dist/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +59 -0
- package/dist/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte.d.ts +23 -0
- package/dist/stories/components/Form/SimpleSelect/SimpleSelect.svelte +69 -0
- package/dist/stories/components/Form/SimpleSelect/SimpleSelect.svelte.d.ts +50 -0
- package/dist/stories/components/Form/SimpleSelect/Size/Size.stories.svelte +20 -0
- package/dist/stories/components/Form/SimpleSelect/Size/Size.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +36 -0
- package/dist/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Form/TextInput/TextInput.svelte +22 -120
- package/dist/stories/components/Form/TextInput/TextInput.svelte.d.ts +1 -2
- package/dist/stories/components/Layout/Paper/Paper.stories.svelte +32 -0
- package/dist/stories/components/Layout/Paper/Paper.stories.svelte.d.ts +21 -0
- package/dist/stories/components/Layout/Paper/Paper.svelte +52 -0
- package/dist/stories/components/Layout/Paper/Paper.svelte.d.ts +23 -0
- package/dist/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +30 -0
- package/dist/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +42 -0
- package/dist/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte.d.ts +26 -0
- package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +34 -0
- package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte.d.ts +21 -0
- package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte +120 -0
- package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte.d.ts +29 -0
- package/dist/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +20 -0
- package/dist/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte.d.ts +26 -0
- package/dist/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte +16 -0
- package/dist/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte.d.ts +26 -0
- package/dist/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +47 -0
- package/dist/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte.d.ts +26 -0
- package/dist/stories/philosophy/Colors/utils/color.js +1 -1
- package/dist/styles/_colors.css +26 -26
- package/dist/styles/_shadow.css +39 -0
- package/dist/styles/global.css +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/lib/index.ts +17 -1
- package/src/lib/stories/components/Form/Button/Button.stories.svelte +1 -1
- package/src/lib/stories/components/Form/Button/Button.svelte +4 -4
- package/src/lib/stories/components/Form/Button/Color/Color.stories.svelte +9 -7
- package/src/lib/stories/components/Form/FormControl/FormControl.svelte +1 -1
- package/src/lib/stories/components/Form/Message/Color/Color.stories.svelte +36 -0
- package/src/lib/stories/components/Form/Message/Message.stories.svelte +13 -26
- package/src/lib/stories/components/Form/Message/Message.svelte +28 -7
- package/src/lib/stories/components/Form/Message/Size/Size.stories.svelte +24 -0
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.svelte +35 -157
- package/src/lib/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +79 -0
- package/src/lib/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +24 -0
- package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +64 -0
- package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.svelte +159 -0
- package/src/lib/stories/components/Form/SimpleSelect/Size/Size.stories.svelte +20 -0
- package/src/lib/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +36 -0
- package/src/lib/stories/components/Form/TextInput/TextInput.svelte +22 -143
- package/src/lib/stories/components/Layout/Paper/Paper.stories.svelte +36 -0
- package/src/lib/stories/components/Layout/Paper/Paper.svelte +91 -0
- package/src/lib/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +30 -0
- package/src/lib/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +42 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +38 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte +198 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +20 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +47 -0
- package/src/lib/styles/_colors.css +26 -26
- package/src/lib/styles/_shadow.css +39 -0
- package/src/lib/styles/global.css +1 -0
- package/src/lib/types.ts +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default Roundness;
|
|
2
|
+
type Roundness = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const Roundness: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from '../InputEnclosure.svelte';
|
|
4
|
+
import { storyInputEnclosureArgTypes } from '../InputEnclosure.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: InputEnclosure,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Normal" />
|
|
15
|
+
<Story name="Small" args={{ size: 'small' }} />
|
|
16
|
+
<Story name="Large" args={{ size: 'large' }} />
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default Size;
|
|
2
|
+
type Size = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const Size: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
package/dist/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from '../InputEnclosure.svelte';
|
|
4
|
+
import { storyInputEnclosureArgTypes } from '../InputEnclosure.stories.svelte';
|
|
5
|
+
import Icon from '@iconify/svelte';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
component: InputEnclosure,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<!-- InputEnclosure icon in front. -->
|
|
16
|
+
<Story name="Icon Before">
|
|
17
|
+
<InputEnclosure>
|
|
18
|
+
{#snippet before()}
|
|
19
|
+
<Icon icon="material-symbols:content-copy" />
|
|
20
|
+
{/snippet}
|
|
21
|
+
</InputEnclosure>
|
|
22
|
+
</Story>
|
|
23
|
+
|
|
24
|
+
<!-- InputEnclosure icon in front. -->
|
|
25
|
+
<Story name="Icon After">
|
|
26
|
+
<InputEnclosure>
|
|
27
|
+
{#snippet after()}
|
|
28
|
+
<Icon icon="material-symbols:download-2" />
|
|
29
|
+
{/snippet}
|
|
30
|
+
</InputEnclosure>
|
|
31
|
+
</Story>
|
|
32
|
+
|
|
33
|
+
<Story name="Small" args={{ size: 'small' }}>
|
|
34
|
+
<InputEnclosure size="small">
|
|
35
|
+
{#snippet before()}
|
|
36
|
+
<Icon icon="material-symbols:content-copy" />
|
|
37
|
+
{/snippet}
|
|
38
|
+
</InputEnclosure>
|
|
39
|
+
</Story>
|
|
40
|
+
|
|
41
|
+
<Story name="Large" args={{ size: 'large' }}>
|
|
42
|
+
<InputEnclosure size="large">
|
|
43
|
+
{#snippet before()}
|
|
44
|
+
<Icon icon="material-symbols:content-copy" />
|
|
45
|
+
{/snippet}
|
|
46
|
+
</InputEnclosure>
|
|
47
|
+
</Story>
|
package/dist/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default WithIcon;
|
|
2
|
+
type WithIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const WithIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -22,7 +22,7 @@ export const colorPaletteBase = [
|
|
|
22
22
|
'stone',
|
|
23
23
|
];
|
|
24
24
|
export const colorPaletteNeutral = ['black', 'white'];
|
|
25
|
-
export const colorPalette = ['default', 'primary', 'safe', 'warning', 'danger', '
|
|
25
|
+
export const colorPalette = ['default', 'primary', 'safe', 'warning', 'danger', 'secondary'];
|
|
26
26
|
export const colorPaletteValues = [
|
|
27
27
|
'50',
|
|
28
28
|
'100',
|
package/dist/styles/_colors.css
CHANGED
|
@@ -33,6 +33,19 @@
|
|
|
33
33
|
--dodo-color-primary-900: var(--dodo-color-base-violet-900);
|
|
34
34
|
--dodo-color-primary-950: var(--dodo-color-base-violet-950);
|
|
35
35
|
|
|
36
|
+
/* Secondary color */
|
|
37
|
+
--dodo-color-secondary-50: var(--dodo-color-base-cyan-50);
|
|
38
|
+
--dodo-color-secondary-100: var(--dodo-color-base-cyan-100);
|
|
39
|
+
--dodo-color-secondary-200: var(--dodo-color-base-cyan-200);
|
|
40
|
+
--dodo-color-secondary-300: var(--dodo-color-base-cyan-300);
|
|
41
|
+
--dodo-color-secondary-400: var(--dodo-color-base-cyan-400);
|
|
42
|
+
--dodo-color-secondary-500: var(--dodo-color-base-cyan-500);
|
|
43
|
+
--dodo-color-secondary-600: var(--dodo-color-base-cyan-600);
|
|
44
|
+
--dodo-color-secondary-700: var(--dodo-color-base-cyan-700);
|
|
45
|
+
--dodo-color-secondary-800: var(--dodo-color-base-cyan-800);
|
|
46
|
+
--dodo-color-secondary-900: var(--dodo-color-base-cyan-900);
|
|
47
|
+
--dodo-color-secondary-950: var(--dodo-color-base-cyan-950);
|
|
48
|
+
|
|
36
49
|
/* Safe color */
|
|
37
50
|
--dodo-color-safe-50: var(--dodo-color-base-emerald-50);
|
|
38
51
|
--dodo-color-safe-100: var(--dodo-color-base-emerald-100);
|
|
@@ -71,19 +84,6 @@
|
|
|
71
84
|
--dodo-color-danger-800: var(--dodo-color-base-red-800);
|
|
72
85
|
--dodo-color-danger-900: var(--dodo-color-base-red-900);
|
|
73
86
|
--dodo-color-danger-950: var(--dodo-color-base-red-950);
|
|
74
|
-
|
|
75
|
-
/* Info color */
|
|
76
|
-
--dodo-color-info-50: var(--dodo-color-base-cyan-50);
|
|
77
|
-
--dodo-color-info-100: var(--dodo-color-base-cyan-100);
|
|
78
|
-
--dodo-color-info-200: var(--dodo-color-base-cyan-200);
|
|
79
|
-
--dodo-color-info-300: var(--dodo-color-base-cyan-300);
|
|
80
|
-
--dodo-color-info-400: var(--dodo-color-base-cyan-400);
|
|
81
|
-
--dodo-color-info-500: var(--dodo-color-base-cyan-500);
|
|
82
|
-
--dodo-color-info-600: var(--dodo-color-base-cyan-600);
|
|
83
|
-
--dodo-color-info-700: var(--dodo-color-base-cyan-700);
|
|
84
|
-
--dodo-color-info-800: var(--dodo-color-base-cyan-800);
|
|
85
|
-
--dodo-color-info-900: var(--dodo-color-base-cyan-900);
|
|
86
|
-
--dodo-color-info-950: var(--dodo-color-base-cyan-950);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
.dodo-theme--dark {
|
|
@@ -117,6 +117,19 @@
|
|
|
117
117
|
--dodo-color-primary-900: var(--dodo-color-base-violet-100);
|
|
118
118
|
--dodo-color-primary-950: var(--dodo-color-base-violet-50);
|
|
119
119
|
|
|
120
|
+
/* Dark: Secondary color */
|
|
121
|
+
--dodo-color-secondary-50: var(--dodo-color-base-cyan-950);
|
|
122
|
+
--dodo-color-secondary-100: var(--dodo-color-base-cyan-900);
|
|
123
|
+
--dodo-color-secondary-200: var(--dodo-color-base-cyan-800);
|
|
124
|
+
--dodo-color-secondary-300: var(--dodo-color-base-cyan-700);
|
|
125
|
+
--dodo-color-secondary-400: var(--dodo-color-base-cyan-600);
|
|
126
|
+
--dodo-color-secondary-500: var(--dodo-color-base-cyan-500);
|
|
127
|
+
--dodo-color-secondary-600: var(--dodo-color-base-cyan-400);
|
|
128
|
+
--dodo-color-secondary-700: var(--dodo-color-base-cyan-300);
|
|
129
|
+
--dodo-color-secondary-800: var(--dodo-color-base-cyan-200);
|
|
130
|
+
--dodo-color-secondary-900: var(--dodo-color-base-cyan-100);
|
|
131
|
+
--dodo-color-secondary-950: var(--dodo-color-base-cyan-50);
|
|
132
|
+
|
|
120
133
|
/* Dark: Safe color */
|
|
121
134
|
--dodo-color-safe-50: var(--dodo-color-base-emerald-950);
|
|
122
135
|
--dodo-color-safe-100: var(--dodo-color-base-emerald-900);
|
|
@@ -155,17 +168,4 @@
|
|
|
155
168
|
--dodo-color-danger-800: var(--dodo-color-base-red-200);
|
|
156
169
|
--dodo-color-danger-900: var(--dodo-color-base-red-100);
|
|
157
170
|
--dodo-color-danger-950: var(--dodo-color-base-red-50);
|
|
158
|
-
|
|
159
|
-
/* Dark: Info color */
|
|
160
|
-
--dodo-color-info-50: var(--dodo-color-base-cyan-950);
|
|
161
|
-
--dodo-color-info-100: var(--dodo-color-base-cyan-900);
|
|
162
|
-
--dodo-color-info-200: var(--dodo-color-base-cyan-800);
|
|
163
|
-
--dodo-color-info-300: var(--dodo-color-base-cyan-700);
|
|
164
|
-
--dodo-color-info-400: var(--dodo-color-base-cyan-600);
|
|
165
|
-
--dodo-color-info-500: var(--dodo-color-base-cyan-500);
|
|
166
|
-
--dodo-color-info-600: var(--dodo-color-base-cyan-400);
|
|
167
|
-
--dodo-color-info-700: var(--dodo-color-base-cyan-300);
|
|
168
|
-
--dodo-color-info-800: var(--dodo-color-base-cyan-200);
|
|
169
|
-
--dodo-color-info-900: var(--dodo-color-base-cyan-100);
|
|
170
|
-
--dodo-color-info-950: var(--dodo-color-base-cyan-50);
|
|
171
171
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--dodo-shadow-color: #0000000d;
|
|
3
|
+
}
|
|
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);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dodo-shadow-3x {
|
|
16
|
+
--dodo-shadow: 0 1px 3px 0 var(--dodo-shadow-color);
|
|
17
|
+
box-shadow: var(--dodo-shadow);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.dodo-shadow-4x {
|
|
21
|
+
--dodo-shadow: 0 4px 6px -1px var(--dodo-shadow-color), 0 2px 4px -2px var(--dodo-shadow-color);
|
|
22
|
+
box-shadow: var(--dodo-shadow);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dodo-shadow-5x {
|
|
26
|
+
--dodo-shadow: 0 10px 15px -3px var(--dodo-shadow-color), 0 4px 6px -4px var(--dodo-shadow-color);
|
|
27
|
+
box-shadow: var(--dodo-shadow);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dodo-shadow-6x {
|
|
31
|
+
--dodo-shadow:
|
|
32
|
+
0 20px 25px -5px var(--dodo-shadow-color), 0 8px 10px -6px var(--dodo-shadow-color);
|
|
33
|
+
box-shadow: var(--dodo-shadow);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dodo-shadow-7x {
|
|
37
|
+
--dodo-shadow: 0 25px 50px -12px var(--dodo-shadow-color);
|
|
38
|
+
box-shadow: var(--dodo-shadow);
|
|
39
|
+
}
|
package/dist/styles/global.css
CHANGED
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
package/src/lib/index.ts
CHANGED
|
@@ -5,6 +5,9 @@ export type { ComponentSize, ComponentRoundness, ComponentRoundnessFull } from '
|
|
|
5
5
|
/** developer tools: components: UtilityButton */
|
|
6
6
|
export { default as UtilityButton } from '$lib/stories/developer tools/components/UtilityButton/UtilityButton.svelte';
|
|
7
7
|
|
|
8
|
+
/** developer tools: components: InputEnclosure */
|
|
9
|
+
export { default as InputEnclosure } from '$lib/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte';
|
|
10
|
+
|
|
8
11
|
/** Form: Button */
|
|
9
12
|
export { default as Button } from '$lib/stories/components/Form/Button/Button.svelte';
|
|
10
13
|
export type {
|
|
@@ -17,7 +20,6 @@ export type {
|
|
|
17
20
|
/** Form: TextInput */
|
|
18
21
|
export { default as TextInput } from '$lib/stories/components/Form/TextInput/TextInput.svelte';
|
|
19
22
|
export type {
|
|
20
|
-
TextInputRoundness,
|
|
21
23
|
TextInputType,
|
|
22
24
|
TextInputFocusEvent,
|
|
23
25
|
TextInputClipboardEvent,
|
|
@@ -36,3 +38,17 @@ export { default as FormControl } from '$lib/stories/components/Form/FormControl
|
|
|
36
38
|
/** Form: Message */
|
|
37
39
|
export { default as Message } from '$lib/stories/components/Form/Message/Message.svelte';
|
|
38
40
|
export type { MessageColor } from '$lib/stories/components/Form/Message/Message.svelte';
|
|
41
|
+
|
|
42
|
+
/** Form: SimpleSelect */
|
|
43
|
+
export { default as SimpleSelect } from '$lib/stories/components/Form/SimpleSelect/SimpleSelect.svelte';
|
|
44
|
+
export type {
|
|
45
|
+
SimpleSelectFocusEvent,
|
|
46
|
+
SimpleSelectOption,
|
|
47
|
+
} from '$lib/stories/components/Form/SimpleSelect/SimpleSelect.svelte';
|
|
48
|
+
|
|
49
|
+
/** Layout: Paper */
|
|
50
|
+
export { default as Paper } from '$lib/stories/components/Layout/Paper/Paper.svelte';
|
|
51
|
+
export type {
|
|
52
|
+
PaperRoundness,
|
|
53
|
+
PaperShadow,
|
|
54
|
+
} from '$lib/stories/components/Layout/Paper/Paper.svelte';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
export type ButtonColor = 'default' | 'primary' | '
|
|
2
|
+
export type ButtonColor = 'default' | 'primary' | 'secondary' | 'safe' | 'warning' | 'danger';
|
|
3
3
|
export type ButtonRoundness = ComponentRoundness | false | ComponentRoundnessFull;
|
|
4
4
|
export type ButtonLinkTarget =
|
|
5
5
|
| '_self'
|
|
@@ -192,10 +192,10 @@
|
|
|
192
192
|
|
|
193
193
|
@include generate-dodo-ui-button-colors(default);
|
|
194
194
|
@include generate-dodo-ui-button-colors(primary);
|
|
195
|
+
@include generate-dodo-ui-button-colors(secondary);
|
|
195
196
|
@include generate-dodo-ui-button-colors(safe);
|
|
196
197
|
@include generate-dodo-ui-button-colors(warning);
|
|
197
198
|
@include generate-dodo-ui-button-colors(danger);
|
|
198
|
-
@include generate-dodo-ui-button-colors(info);
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
:global(.dodo-theme--dark) {
|
|
@@ -204,10 +204,10 @@
|
|
|
204
204
|
|
|
205
205
|
@include generate-dodo-ui-button-colors-dark(default);
|
|
206
206
|
@include generate-dodo-ui-button-colors-dark(primary);
|
|
207
|
+
@include generate-dodo-ui-button-colors-dark(secondary);
|
|
207
208
|
@include generate-dodo-ui-button-colors-dark(safe);
|
|
208
209
|
@include generate-dodo-ui-button-colors-dark(warning);
|
|
209
210
|
@include generate-dodo-ui-button-colors-dark(danger);
|
|
210
|
-
@include generate-dodo-ui-button-colors-dark(info);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
.dodo-ui-Button {
|
|
@@ -273,10 +273,10 @@
|
|
|
273
273
|
&.color {
|
|
274
274
|
@include generate-dodo-ui-button-color(default);
|
|
275
275
|
@include generate-dodo-ui-button-color(primary);
|
|
276
|
+
@include generate-dodo-ui-button-color(secondary);
|
|
276
277
|
@include generate-dodo-ui-button-color(safe);
|
|
277
278
|
@include generate-dodo-ui-button-color(warning);
|
|
278
279
|
@include generate-dodo-ui-button-color(danger);
|
|
279
|
-
@include generate-dodo-ui-button-color(info);
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
&[disabled] {
|
|
@@ -19,10 +19,12 @@
|
|
|
19
19
|
<Button>Click me!</Button>
|
|
20
20
|
</Story>
|
|
21
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>
|
|
22
25
|
<Story name="Safe" args={{ color: 'safe' }}><Button color="safe">Click me!</Button></Story>
|
|
23
26
|
<Story name="Warning" args={{ color: 'warning' }}><Button color="warning">Click me!</Button></Story>
|
|
24
27
|
<Story name="Danger" args={{ color: 'danger' }}><Button color="danger">Click me!</Button></Story>
|
|
25
|
-
<Story name="Info" args={{ color: 'info' }}><Button color="info">Click me!</Button></Story>
|
|
26
28
|
|
|
27
29
|
<Story
|
|
28
30
|
name="Default Solid"
|
|
@@ -33,6 +35,9 @@
|
|
|
33
35
|
<Story name="Primary Solid" args={{ color: 'primary', variant: 'solid' }}>
|
|
34
36
|
<Button color="primary" variant="solid">Click me!</Button>
|
|
35
37
|
</Story>
|
|
38
|
+
<Story name="Secondary Solid" args={{ color: 'secondary', variant: 'solid' }}>
|
|
39
|
+
<Button color="secondary" variant="solid">Click me!</Button>
|
|
40
|
+
</Story>
|
|
36
41
|
<Story name="Safe Solid" args={{ color: 'safe', variant: 'solid' }}>
|
|
37
42
|
<Button color="safe" variant="solid">Click me!</Button>
|
|
38
43
|
</Story>
|
|
@@ -42,9 +47,6 @@
|
|
|
42
47
|
<Story name="Danger Solid" args={{ color: 'danger', variant: 'solid' }}>
|
|
43
48
|
<Button color="danger" variant="solid">Click me!</Button>
|
|
44
49
|
</Story>
|
|
45
|
-
<Story name="Info Solid" args={{ color: 'info', variant: 'solid' }}>
|
|
46
|
-
<Button color="info" variant="solid">Click me!</Button>
|
|
47
|
-
</Story>
|
|
48
50
|
|
|
49
51
|
<Story name="Default Outline" args={{ outline: true, disabled: false, compact: false }}>
|
|
50
52
|
<Button outline>Click me!</Button>
|
|
@@ -52,6 +54,9 @@
|
|
|
52
54
|
<Story name="Primary Outline" args={{ outline: true, color: 'primary' }}>
|
|
53
55
|
<Button color="primary" outline>Click me!</Button>
|
|
54
56
|
</Story>
|
|
57
|
+
<Story name="Secondary Outline" args={{ outline: true, color: 'secondary' }}>
|
|
58
|
+
<Button color="secondary" outline>Click me!</Button>
|
|
59
|
+
</Story>
|
|
55
60
|
<Story name="Safe Outline" args={{ outline: true, color: 'safe' }}>
|
|
56
61
|
<Button color="safe" outline>Click me!</Button>
|
|
57
62
|
</Story>
|
|
@@ -61,6 +66,3 @@
|
|
|
61
66
|
<Story name="Danger Outline" args={{ outline: true, color: 'danger' }}>
|
|
62
67
|
<Button color="danger" outline>Click me!</Button>
|
|
63
68
|
</Story>
|
|
64
|
-
<Story name="Info Outline" args={{ outline: true, color: 'info' }}>
|
|
65
|
-
<Button color="info" outline>Click me!</Button>
|
|
66
|
-
</Story>
|
|
@@ -0,0 +1,36 @@
|
|
|
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,17 +1,24 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
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
|
+
};
|
|
4
16
|
|
|
5
17
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
6
18
|
const { Story } = defineMeta({
|
|
7
19
|
component: Message,
|
|
8
20
|
tags: ['autodocs'],
|
|
9
|
-
argTypes:
|
|
10
|
-
color: {
|
|
11
|
-
control: { type: 'select' },
|
|
12
|
-
options: ['default', 'primary', 'safe', 'warning', 'danger', 'info'],
|
|
13
|
-
},
|
|
14
|
-
},
|
|
21
|
+
argTypes: storyMessageArgTypes,
|
|
15
22
|
});
|
|
16
23
|
</script>
|
|
17
24
|
|
|
@@ -26,23 +33,3 @@
|
|
|
26
33
|
<Story name="Default">
|
|
27
34
|
<Message>Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
28
35
|
</Story>
|
|
29
|
-
|
|
30
|
-
<Story name="Primary" args={{ color: 'primary' }}>
|
|
31
|
-
<Message color="primary">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
32
|
-
</Story>
|
|
33
|
-
|
|
34
|
-
<Story name="Safe" args={{ color: 'safe' }}>
|
|
35
|
-
<Message color="safe">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
36
|
-
</Story>
|
|
37
|
-
|
|
38
|
-
<Story name="Warning" args={{ color: 'warning' }}>
|
|
39
|
-
<Message color="warning">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
40
|
-
</Story>
|
|
41
|
-
|
|
42
|
-
<Story name="Danger" args={{ color: 'danger' }}>
|
|
43
|
-
<Message color="danger">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
44
|
-
</Story>
|
|
45
|
-
|
|
46
|
-
<Story name="Info" args={{ color: 'info' }}>
|
|
47
|
-
<Message color="info">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
48
|
-
</Story>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
export type MessageColor = 'default' | 'primary' | '
|
|
2
|
+
export type MessageColor = 'default' | 'primary' | 'secondary' | 'safe' | 'warning' | 'danger';
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script lang="ts">
|
|
6
|
+
import type { ComponentSize } from '$lib/types.js';
|
|
7
|
+
|
|
6
8
|
import type { Snippet } from 'svelte';
|
|
7
9
|
|
|
8
10
|
interface MessageProps {
|
|
@@ -12,6 +14,8 @@
|
|
|
12
14
|
ref?: HTMLDivElement;
|
|
13
15
|
/** What color to use? */
|
|
14
16
|
color?: MessageColor;
|
|
17
|
+
/** Message size */
|
|
18
|
+
size?: ComponentSize;
|
|
15
19
|
/** Custom css class*/
|
|
16
20
|
class?: string;
|
|
17
21
|
/** Test: ⚠️ Unsafe Children String. Do Not use*/
|
|
@@ -24,10 +28,14 @@
|
|
|
24
28
|
color = 'default',
|
|
25
29
|
ref = $bindable<HTMLDivElement>(),
|
|
26
30
|
_unsafeChildrenStringForTesting,
|
|
31
|
+
size = 'normal',
|
|
27
32
|
}: MessageProps = $props();
|
|
28
33
|
</script>
|
|
29
34
|
|
|
30
|
-
<div
|
|
35
|
+
<div
|
|
36
|
+
class={['dodo-ui-Message', `color--${color}`, `size--${size}`, className].join(' ')}
|
|
37
|
+
bind:this={ref}
|
|
38
|
+
>
|
|
31
39
|
{#if children}
|
|
32
40
|
{@render children()}
|
|
33
41
|
{:else if _unsafeChildrenStringForTesting}
|
|
@@ -37,11 +45,24 @@
|
|
|
37
45
|
|
|
38
46
|
<style lang="scss">
|
|
39
47
|
.dodo-ui-Message {
|
|
40
|
-
font-size: 1rem;
|
|
41
48
|
letter-spacing: 0.3px;
|
|
42
49
|
display: flex;
|
|
43
50
|
font-family: inherit;
|
|
44
51
|
|
|
52
|
+
&.size {
|
|
53
|
+
&--normal {
|
|
54
|
+
font-size: 1rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&--small {
|
|
58
|
+
font-size: 0.9rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&--large {
|
|
62
|
+
font-size: 1.1rem;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
45
66
|
&.color {
|
|
46
67
|
&--default {
|
|
47
68
|
color: var(--dodo-color-default-800);
|
|
@@ -51,6 +72,10 @@
|
|
|
51
72
|
color: var(--dodo-color-primary-600);
|
|
52
73
|
}
|
|
53
74
|
|
|
75
|
+
&--secondary {
|
|
76
|
+
color: var(--dodo-color-secondary-600);
|
|
77
|
+
}
|
|
78
|
+
|
|
54
79
|
&--safe {
|
|
55
80
|
color: var(--dodo-color-safe-600);
|
|
56
81
|
}
|
|
@@ -62,10 +87,6 @@
|
|
|
62
87
|
&--danger {
|
|
63
88
|
color: var(--dodo-color-danger-600);
|
|
64
89
|
}
|
|
65
|
-
|
|
66
|
-
&--info {
|
|
67
|
-
color: var(--dodo-color-info-600);
|
|
68
|
-
}
|
|
69
90
|
}
|
|
70
91
|
}
|
|
71
92
|
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
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="Normal">
|
|
15
|
+
<Message>Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
16
|
+
</Story>
|
|
17
|
+
|
|
18
|
+
<Story name="Small" args={{ size: 'small' }}>
|
|
19
|
+
<Message size="small">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
20
|
+
</Story>
|
|
21
|
+
|
|
22
|
+
<Story name="Large" args={{ size: 'large' }}>
|
|
23
|
+
<Message size="large">Lorem ipsum dolor sit amet, consectetur adipiscing elit</Message>
|
|
24
|
+
</Story>
|