do-ui-design-system 0.0.10 → 0.0.12
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/components/atoms/Button/Button.stories.svelte +92 -0
- package/dist/components/atoms/Button/Button.stories.svelte.d.ts +19 -0
- package/dist/{atoms → components/atoms}/Icons/Icon.svelte.d.ts +1 -1
- package/dist/components/atoms/Icons/Icons.stories.svelte +50 -0
- package/dist/components/atoms/Icons/Icons.stories.svelte.d.ts +18 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +3 -0
- package/dist/components/molecules/IconButton/IconButton.stories.svelte +77 -0
- package/dist/components/molecules/IconButton/IconButton.stories.svelte.d.ts +19 -0
- package/dist/{molecules → components/molecules}/IconButton/iProps.d.ts +1 -1
- package/dist/do-theme/index.css +0 -2
- package/dist/do-theme/post-compiled.css +8 -1187
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -12
- package/package.json +31 -21
- package/src/lib/do-theme/index.css +0 -2
- package/src/lib/do-theme/post-compiled.css +482 -0
- package/dist/do-theme/icomoon/generate-icon-list.d.cts +0 -1
- /package/dist/{atoms → components/atoms}/Button/Button.svelte +0 -0
- /package/dist/{atoms → components/atoms}/Button/Button.svelte.d.ts +0 -0
- /package/dist/{atoms → components/atoms}/Button/iProps.d.ts +0 -0
- /package/dist/{atoms → components/atoms}/Button/iProps.js +0 -0
- /package/dist/{atoms → components/atoms}/Icons/Icon.svelte +0 -0
- /package/dist/{atoms → components/atoms}/Icons/iProps.d.ts +0 -0
- /package/dist/{atoms → components/atoms}/Icons/iProps.js +0 -0
- /package/dist/{atoms → components/atoms}/index.d.ts +0 -0
- /package/dist/{atoms → components/atoms}/index.js +0 -0
- /package/dist/{molecules → components/molecules}/IconButton/IconButton.svelte +0 -0
- /package/dist/{molecules → components/molecules}/IconButton/IconButton.svelte.d.ts +0 -0
- /package/dist/{molecules → components/molecules}/IconButton/iProps.js +0 -0
- /package/dist/{molecules → components/molecules}/index.d.ts +0 -0
- /package/dist/{molecules → components/molecules}/index.js +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Button from './Button.svelte';
|
|
4
|
+
import { fn } from '@storybook/test';
|
|
5
|
+
import type { ArgTypes, Args } from '@storybook/core/types';
|
|
6
|
+
|
|
7
|
+
const colorOptions = ['btn-primary', 'btn-secondary', 'btn-accent', 'btn-neutral'];
|
|
8
|
+
const sizeOptions = ['btn-sm', 'btn-md', 'btn-lg'];
|
|
9
|
+
// const typeOptions = ['rounded'];
|
|
10
|
+
|
|
11
|
+
const { Story } = defineMeta({
|
|
12
|
+
title: 'DO - Sistema de diseño/Átomos/Botón',
|
|
13
|
+
component: Button,
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
parameters: {
|
|
16
|
+
docs: {
|
|
17
|
+
toc: {
|
|
18
|
+
disable: true // 👈 Disables the table of contents
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const argTypes: ArgTypes = {
|
|
24
|
+
label: {
|
|
25
|
+
control: { type: 'text' },
|
|
26
|
+
description: 'Texto del botón'
|
|
27
|
+
},
|
|
28
|
+
color: {
|
|
29
|
+
control: { type: 'radio' },
|
|
30
|
+
options: colorOptions,
|
|
31
|
+
description: 'Color del botón'
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
control: { type: 'radio' },
|
|
35
|
+
options: sizeOptions,
|
|
36
|
+
description: 'Tamaño del botón'
|
|
37
|
+
},
|
|
38
|
+
disabled: {
|
|
39
|
+
control: { type: 'boolean' },
|
|
40
|
+
description: 'Deshabilitar el botón'
|
|
41
|
+
},
|
|
42
|
+
loading: {
|
|
43
|
+
control: { type: 'boolean' },
|
|
44
|
+
description: 'Mostrar el estado de carga'
|
|
45
|
+
},
|
|
46
|
+
type: {
|
|
47
|
+
control: { type: 'radio' },
|
|
48
|
+
options: ['button', 'submit', 'reset'],
|
|
49
|
+
description: 'Tipo de botón'
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const args: Args = {
|
|
53
|
+
size: 'btn-md',
|
|
54
|
+
label: 'Botón',
|
|
55
|
+
color: 'btn-primary',
|
|
56
|
+
type: 'button',
|
|
57
|
+
disabled: false,
|
|
58
|
+
loading: false
|
|
59
|
+
};
|
|
60
|
+
const colors = [
|
|
61
|
+
{ color: 'btn-primary', label: 'Primary', size: 'btn-md' },
|
|
62
|
+
{ color: 'btn-secondary', label: 'Secondary', size: 'btn-md' },
|
|
63
|
+
{ color: 'btn-neutral', label: 'Neutral', size: 'btn-md' },
|
|
64
|
+
{ color: 'btn-accent', label: 'Accent', size: 'btn-md' }
|
|
65
|
+
] as const;
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<Story name="Botón" {argTypes} {args} />
|
|
69
|
+
|
|
70
|
+
<Story name="Colores" parameters={{ controls: { disable: true } }}>
|
|
71
|
+
<div class="margin mb-4 flex flex-row gap-[2rem]">
|
|
72
|
+
{#each colors as { color, label, size }}
|
|
73
|
+
<Button {color} {size} {label} on:click={()=> args.onClick()} />
|
|
74
|
+
{/each}
|
|
75
|
+
</div>
|
|
76
|
+
</Story>
|
|
77
|
+
|
|
78
|
+
<Story name="Modo: disabled" parameters={{ controls: { disable: true } }}>
|
|
79
|
+
<div class="margin mb-4 flex flex-row gap-[2rem]">
|
|
80
|
+
{#each colors as { color, label, size }}
|
|
81
|
+
<Button {color} {size} {label} onClick={fn()} disabled={true} />
|
|
82
|
+
{/each}
|
|
83
|
+
</div>
|
|
84
|
+
</Story>
|
|
85
|
+
|
|
86
|
+
<Story name="Modo: loading" parameters={{ controls: { disable: true } }}>
|
|
87
|
+
<div class="margin mb-4 flex flex-row gap-[2rem]">
|
|
88
|
+
{#each colors as { color, label, size }}
|
|
89
|
+
<Button {color} {size} loading {label} onClick={fn()} />
|
|
90
|
+
{/each}
|
|
91
|
+
</div>
|
|
92
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Button from './Button.svelte';
|
|
2
|
+
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> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Button: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Button = InstanceType<typeof Button>;
|
|
19
|
+
export default Button;
|
|
@@ -22,7 +22,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
22
22
|
*/
|
|
23
23
|
declare const Icon: $$__sveltets_2_IsomorphicComponent<{
|
|
24
24
|
[x: string]: any;
|
|
25
|
-
name?: iProps["name"]
|
|
25
|
+
name?: iProps["name"];
|
|
26
26
|
color?: string | undefined;
|
|
27
27
|
size?: string | undefined;
|
|
28
28
|
}, {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import type { ArgTypes, Args } from '@storybook/core/types';
|
|
4
|
+
import Icon from './Icon.svelte';
|
|
5
|
+
import iconList from "../../../do-theme/icomoon/iconList.ts";
|
|
6
|
+
|
|
7
|
+
const colorOptions = ['text-red-600', 'text-zinc-600', 'text-green-600', 'text-blue-600'];
|
|
8
|
+
const sizeOptions = ['text-xs', 'text-sm', 'text-base', 'text-lg', 'text-xl', 'text-2xl', 'text-3xl'];
|
|
9
|
+
|
|
10
|
+
const { Story } = defineMeta({
|
|
11
|
+
title: 'DO - Sistema de diseño/Átomos/Íconos',
|
|
12
|
+
component: Icon,
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
parameters:{
|
|
15
|
+
docs: {
|
|
16
|
+
source: {
|
|
17
|
+
code: `
|
|
18
|
+
<i class="icon-name some-tw-text-size some-tw-text-color"></i>
|
|
19
|
+
`
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const argTypes: ArgTypes = {
|
|
26
|
+
name: {
|
|
27
|
+
control: { type: 'select' }
|
|
28
|
+
},
|
|
29
|
+
color: {
|
|
30
|
+
control: { type: 'select' },
|
|
31
|
+
defaultValue: 'text-red-600',
|
|
32
|
+
options: colorOptions
|
|
33
|
+
},
|
|
34
|
+
size: {
|
|
35
|
+
control: { type: 'select' },
|
|
36
|
+
options: sizeOptions
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<Story name="Ícono" {argTypes} />
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
<Story name="Listado" {argTypes} parameters={{ controls: { disable: true } }}>
|
|
45
|
+
<section class="flex flex-wrap gap-4">
|
|
46
|
+
{#each iconList as icon}
|
|
47
|
+
<Icon name={icon}/>
|
|
48
|
+
{/each}
|
|
49
|
+
</section>
|
|
50
|
+
</Story>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
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> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Icons: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Icons = InstanceType<typeof Icons>;
|
|
18
|
+
export default Icons;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import IconButton from './IconButton.svelte';
|
|
4
|
+
import { fn } from '@storybook/test';
|
|
5
|
+
import type { Args, ArgTypes } from '@storybook/core/types';
|
|
6
|
+
|
|
7
|
+
const colorOptions = ['btn-primary', 'btn-secondary', 'btn-accent', 'btn-neutral'];
|
|
8
|
+
const sizeOptions = ['btn-sm', 'btn-md', 'btn-lg'];
|
|
9
|
+
|
|
10
|
+
// const typeOptions = ['rounded'];
|
|
11
|
+
|
|
12
|
+
const { Story } = defineMeta({
|
|
13
|
+
title: 'DO - Sistema de diseño/Moléculas',
|
|
14
|
+
component: IconButton,
|
|
15
|
+
argTypes: {
|
|
16
|
+
label: {
|
|
17
|
+
control: { type: 'text' },
|
|
18
|
+
description: 'Texto del botón',
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const argTypes: ArgTypes = {
|
|
23
|
+
disabled: {
|
|
24
|
+
control: { type: 'boolean' },
|
|
25
|
+
options: [true, false],
|
|
26
|
+
description: 'Deshabilitar el botón'
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
control: { type: 'radio' },
|
|
30
|
+
options: sizeOptions,
|
|
31
|
+
description: 'Tamaño del botón'
|
|
32
|
+
},
|
|
33
|
+
label: {
|
|
34
|
+
control: { type: 'text' },
|
|
35
|
+
description: 'Texto del botón'
|
|
36
|
+
},
|
|
37
|
+
color: {
|
|
38
|
+
control: { type: 'radio' },
|
|
39
|
+
options: colorOptions,
|
|
40
|
+
description: 'Color del botón'
|
|
41
|
+
},
|
|
42
|
+
onClick: {
|
|
43
|
+
action: 'clicked',
|
|
44
|
+
description: 'Función que se ejecuta al hacer clic en el botón',
|
|
45
|
+
},
|
|
46
|
+
iconPosition: {
|
|
47
|
+
control: { type: 'radio' },
|
|
48
|
+
options: ['start', 'end'],
|
|
49
|
+
description: 'Posición del ícono'
|
|
50
|
+
},
|
|
51
|
+
iconSize: {
|
|
52
|
+
control: { type: 'select' },
|
|
53
|
+
options: ['inherit', 'text-sm', 'text-md', 'text-lg', 'text-xl', 'text-2xl'],
|
|
54
|
+
description: 'Tamaño del ícono'
|
|
55
|
+
},
|
|
56
|
+
iconName: {
|
|
57
|
+
control: { type: 'select' },
|
|
58
|
+
description: 'Nombre del ícono'
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const args: Args = {
|
|
63
|
+
color: 'btn-primary',
|
|
64
|
+
size: 'btn-md',
|
|
65
|
+
label: 'Botón ícono',
|
|
66
|
+
disabled: false,
|
|
67
|
+
onClick: fn(),
|
|
68
|
+
iconName: 'icon-arrow',
|
|
69
|
+
iconColor: 'inherit',
|
|
70
|
+
iconPosition: 'end',
|
|
71
|
+
type: 'button',
|
|
72
|
+
loading: false,
|
|
73
|
+
iconSize: 'inherit'
|
|
74
|
+
};
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<Story name="Boton ícono" {argTypes} {args}/>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import IconButton from './IconButton.svelte';
|
|
2
|
+
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> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const IconButton: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type IconButton = InstanceType<typeof IconButton>;
|
|
19
|
+
export default IconButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IconNames } from '
|
|
1
|
+
import type { IconNames } from '../../../do-theme/icomoon/iconList.ts';
|
|
2
2
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
3
|
export interface iProps extends HTMLButtonAttributes {
|
|
4
4
|
color?: 'btn-primary' | 'btn-secondary' | 'btn-neutral' | 'btn-accent' | string;
|