@royaltics/ui 1.0.8 → 1.0.9
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/package.json +1 -1
- package/dist/buttons/Button.d.ts +0 -17
- package/dist/buttons/Button.d.ts.map +0 -1
- package/dist/buttons/Button.js +0 -27
- package/dist/buttons/Button.js.map +0 -1
- package/dist/buttons/Button.stories.d.ts +0 -18
- package/dist/buttons/Button.stories.d.ts.map +0 -1
- package/dist/buttons/Button.stories.js +0 -41
- package/dist/buttons/Button.stories.js.map +0 -1
- package/dist/buttons/LinkButton.d.ts +0 -8
- package/dist/buttons/LinkButton.d.ts.map +0 -1
- package/dist/buttons/LinkButton.js +0 -9
- package/dist/buttons/LinkButton.js.map +0 -1
- package/dist/buttons/LinkButton.stories.d.ts +0 -7
- package/dist/buttons/LinkButton.stories.d.ts.map +0 -1
- package/dist/buttons/LinkButton.stories.js +0 -48
- package/dist/buttons/LinkButton.stories.js.map +0 -1
- package/dist/buttons/index.d.ts +0 -4
- package/dist/buttons/index.d.ts.map +0 -1
- package/dist/buttons/index.js +0 -3
- package/dist/buttons/index.js.map +0 -1
- package/dist/cards/index.d.ts +0 -12
- package/dist/cards/index.d.ts.map +0 -1
- package/dist/cards/index.js +0 -18
- package/dist/cards/index.js.map +0 -1
- package/dist/forms/Paginate.d.ts +0 -12
- package/dist/forms/Paginate.d.ts.map +0 -1
- package/dist/forms/Paginate.js +0 -35
- package/dist/forms/Paginate.js.map +0 -1
- package/dist/forms/PhotoCard.d.ts +0 -12
- package/dist/forms/PhotoCard.d.ts.map +0 -1
- package/dist/forms/PhotoCard.js +0 -62
- package/dist/forms/PhotoCard.js.map +0 -1
- package/dist/forms/PlayerYoutube.d.ts +0 -17
- package/dist/forms/PlayerYoutube.d.ts.map +0 -1
- package/dist/forms/PlayerYoutube.js +0 -41
- package/dist/forms/PlayerYoutube.js.map +0 -1
- package/dist/stories/Button.d.ts +0 -17
- package/dist/stories/Button.d.ts.map +0 -1
- package/dist/stories/Button.js +0 -8
- package/dist/stories/Button.js.map +0 -1
- package/dist/stories/Button.stories.d.ts +0 -25
- package/dist/stories/Button.stories.d.ts.map +0 -1
- package/dist/stories/Button.stories.js +0 -51
- package/dist/stories/Button.stories.js.map +0 -1
- package/dist/stories/Header.d.ts +0 -14
- package/dist/stories/Header.d.ts.map +0 -1
- package/dist/stories/Header.js +0 -21
- package/dist/stories/Header.js.map +0 -1
- package/dist/stories/Header.stories.d.ts +0 -19
- package/dist/stories/Header.stories.d.ts.map +0 -1
- package/dist/stories/Header.stories.js +0 -27
- package/dist/stories/Header.stories.js.map +0 -1
- package/dist/stories/Page.d.ts +0 -4
- package/dist/stories/Page.d.ts.map +0 -1
- package/dist/stories/Page.js +0 -38
- package/dist/stories/Page.js.map +0 -1
- package/dist/stories/Page.stories.d.ts +0 -13
- package/dist/stories/Page.stories.d.ts.map +0 -1
- package/dist/stories/Page.stories.js +0 -25
- package/dist/stories/Page.stories.js.map +0 -1
package/package.json
CHANGED
package/dist/buttons/Button.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentBase } from '../types/global.js';
|
|
3
|
-
export declare const classNamesProps: (mainProps: {
|
|
4
|
-
size?: string | undefined;
|
|
5
|
-
variant?: string | undefined;
|
|
6
|
-
}, keyProps?: {
|
|
7
|
-
[key: string]: string;
|
|
8
|
-
}) => string;
|
|
9
|
-
export interface ButtonProps extends ComponentBase {
|
|
10
|
-
lb?: string;
|
|
11
|
-
Icon?: React.PropsWithRef<any>;
|
|
12
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
-
loading?: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare const Button: ({ lb, theme, loading, Icon, variant, size, className, onClick, disabled, tabIndex, width }: ButtonProps) => React.JSX.Element;
|
|
16
|
-
export default Button;
|
|
17
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/buttons/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKnD,eAAO,MAAM,eAAe;;;;;YAe3B,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,aAAa;IACjD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,QAAA,MAAM,MAAM,GAAI,4FAA8I,WAAW,sBAgBxK,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/buttons/Button.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import cn from 'classnames';
|
|
3
|
-
import { ArrowPathIcon } from '@heroicons/react/16/solid';
|
|
4
|
-
import { cvaMix } from '../utils/cvmix.js';
|
|
5
|
-
import { Variants } from '../constants/Variants.js';
|
|
6
|
-
export const classNamesProps = cvaMix("flex items-center justify-between rounded-md cursor-pointer", {
|
|
7
|
-
size: Variants.size,
|
|
8
|
-
variant: {
|
|
9
|
-
__key: 'theme',
|
|
10
|
-
__base: 'disabled:opacity-70',
|
|
11
|
-
fill: Variants.fill,
|
|
12
|
-
outline: Variants.outline
|
|
13
|
-
}
|
|
14
|
-
}, {
|
|
15
|
-
size: 'xs',
|
|
16
|
-
filled: 'outline',
|
|
17
|
-
theme: 'primary',
|
|
18
|
-
});
|
|
19
|
-
;
|
|
20
|
-
const Button = ({ lb = '', theme = 'primary', loading, Icon, variant = 'fill', size = 'md', className, onClick, disabled = false, tabIndex, width = 'full' }) => {
|
|
21
|
-
return (React.createElement("div", { className: cn('flex flex-col items-stretch justify-end', width == 'full' ? 'w-full' : 'w-max', className) },
|
|
22
|
-
React.createElement("button", { className: cn(classNamesProps({ variant, size }, { theme })), onClick: onClick, title: lb, tabIndex: tabIndex, disabled: disabled },
|
|
23
|
-
loading ? (React.createElement(ArrowPathIcon, { className: "animate-spin h-5" })) : (Icon ? React.createElement(Icon, { className: cn('h-5 w-5 shrink-0', { 'h-4 w-4': size === 'xs' || size === 'sm' }) }) : null),
|
|
24
|
-
lb && React.createElement("span", { className: cn({ 'hidden md:block': width == 'max' && Icon }) }, lb))));
|
|
25
|
-
};
|
|
26
|
-
export default Button;
|
|
27
|
-
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/buttons/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,6DAA6D,EAClG;IACC,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,OAAO,EAAE;QACR,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,qBAAqB;QAC7B,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;KACzB;CACD,EACD;IACC,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;CAChB,CACD,CAAC;AAOD,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAE,KAAK,GAAG,MAAM,EAAe,EAAE,EAAE;IAE5K,OAAO,CACN,6BAAK,SAAS,EAAE,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC;QAC7G,gCACC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAC5D,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ;YAEjB,OAAO,CAAC,CAAC,CAAC,CAAC,oBAAC,aAAa,IAAC,SAAS,EAAC,kBAAkB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC,GAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YACvK,EAAE,IAAI,8BAAM,SAAS,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,KAAK,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC,IAAG,EAAE,CAAQ,CAC9E,CACJ,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { ButtonProps } from './Button.js';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: ({ lb, theme, loading, Icon, variant, size, className, onClick, disabled, tabIndex, width }: ButtonProps) => import("react").JSX.Element;
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: string;
|
|
8
|
-
};
|
|
9
|
-
tags: string[];
|
|
10
|
-
argTypes: {
|
|
11
|
-
disabled: any;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export default meta;
|
|
15
|
-
export declare const buttonPrimary: StoryObj<typeof meta>;
|
|
16
|
-
export declare const buttonSecondary: StoryObj<typeof meta>;
|
|
17
|
-
export declare const variantbuttonSize: StoryObj<typeof meta>;
|
|
18
|
-
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../src/buttons/Button.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAKlD,QAAA,MAAM,IAAI;;;;;;;;;;CAQmB,CAAC;AAE9B,eAAe,IAAI,CAAC;AAIpB,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,OAAO,IAAI,CAO/C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,OAAO,IAAI,CASjD,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,OAAO,IAAI,CAQnD,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import Button from './Button.js'; // Sin .js si usas la configuración por defecto de Webpack/Vite
|
|
2
|
-
import { ArgumentsBase, ArgumentsComponents } from '../types/StoriesArguments.js';
|
|
3
|
-
import { TrashIcon } from '@heroicons/react/16/solid';
|
|
4
|
-
// Configuración general para el componente en Storybook
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'UI/Buttons/Button', // Categoría y nombre en la barra lateral de Storybook
|
|
7
|
-
component: Button,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'centered', // Centra el componente en el lienzo
|
|
10
|
-
},
|
|
11
|
-
tags: ['autodocs'],
|
|
12
|
-
argTypes: { ...ArgumentsBase, disabled: ArgumentsComponents.disabled }
|
|
13
|
-
};
|
|
14
|
-
export default meta;
|
|
15
|
-
// Historias individuales
|
|
16
|
-
export const buttonPrimary = {
|
|
17
|
-
args: {
|
|
18
|
-
lb: 'Botón Primario',
|
|
19
|
-
variant: 'fill',
|
|
20
|
-
loading: true,
|
|
21
|
-
theme: 'primary'
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
export const buttonSecondary = {
|
|
25
|
-
args: {
|
|
26
|
-
lb: 'Botón Secundario',
|
|
27
|
-
theme: 'secondary',
|
|
28
|
-
size: 'xs',
|
|
29
|
-
variant: 'fill',
|
|
30
|
-
Icon: TrashIcon
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
export const variantbuttonSize = {
|
|
34
|
-
args: {
|
|
35
|
-
lb: 'Botón Variante primary',
|
|
36
|
-
theme: 'primary',
|
|
37
|
-
size: 'lg',
|
|
38
|
-
variant: 'outline',
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../src/buttons/Button.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,MAAuB,MAAM,aAAa,CAAC,CAAC,+DAA+D;AAClH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,wDAAwD;AACxD,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,mBAAmB,EAAE,sDAAsD;IAClF,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU,EAAE,oCAAoC;KACzD;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE,EAAE,GAAG,aAAa,EAAE,QAAQ,EAAE,mBAAmB,CAAC,QAAQ,EAAE;CAC3C,CAAC;AAE9B,eAAe,IAAI,CAAC;AAGpB,yBAAyB;AACzB,MAAM,CAAC,MAAM,aAAa,GAA0B;IAClD,IAAI,EAAE;QACJ,EAAE,EAAE,gBAAgB;QACpB,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,SAAS;KACjB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAA0B;IACpD,IAAI,EAAE;QACJ,EAAE,EAAE,kBAAkB;QACtB,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,SAAS;KAEhB;CACF,CAAC;AAGF,MAAM,CAAC,MAAM,iBAAiB,GAA0B;IACtD,IAAI,EAAE;QACJ,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,SAAS;KAEnB;CACF,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ButtonProps } from "./Button.js";
|
|
3
|
-
export interface LinkButtonProps extends ButtonProps {
|
|
4
|
-
to: string;
|
|
5
|
-
}
|
|
6
|
-
declare const LinkButton: (props: LinkButtonProps) => React.JSX.Element;
|
|
7
|
-
export default LinkButton;
|
|
8
|
-
//# sourceMappingURL=LinkButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkButton.d.ts","sourceRoot":"","sources":["../../src/buttons/LinkButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAe,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AACjD,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,EAAE,EAAE,MAAM,CAAA;CACX;AAED,QAAA,MAAM,UAAU,GAAI,OAAO,eAAe,sBASzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Link } from "react-router-dom";
|
|
3
|
-
import Button from "./Button.js";
|
|
4
|
-
const LinkButton = (props) => {
|
|
5
|
-
return (React.createElement(Link, { to: props.to, title: props.lb },
|
|
6
|
-
React.createElement(Button, { ...props })));
|
|
7
|
-
};
|
|
8
|
-
export default LinkButton;
|
|
9
|
-
//# sourceMappingURL=LinkButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkButton.js","sourceRoot":"","sources":["../../src/buttons/LinkButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,MAAsB,MAAM,aAAa,CAAC;AAKjD,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IAE5C,OAAO,CACL,oBAAC,IAAI,IACH,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,KAAK,EAAE,KAAK,CAAC,EAAE;QACf,oBAAC,MAAM,OAAK,KAAK,GAAI,CAChB,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
declare const meta: any;
|
|
3
|
-
export default meta;
|
|
4
|
-
export declare const LinkButtonPrimary: StoryObj<typeof meta>;
|
|
5
|
-
export declare const LinkButtonSecondary: StoryObj<typeof meta>;
|
|
6
|
-
export declare const variantLinkButtonSize: StoryObj<typeof meta>;
|
|
7
|
-
//# sourceMappingURL=LinkButton.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkButton.stories.d.ts","sourceRoot":"","sources":["../../src/buttons/LinkButton.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,QAAA,MAAM,IAAI,EAAE,GAcqB,CAAC;AAGlC,eAAe,IAAI,CAAC;AAIpB,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,OAAO,IAAI,CAQnD,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,OAAO,IAAI,CAUrD,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,OAAO,IAAI,CASvD,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import LinkButton from './LinkButton.js'; // Sin .js si usas la configuración por defecto de Webpack/Vite
|
|
3
|
-
import { ArgumentsBase, ArgumentsComponents } from '../types/StoriesArguments.js';
|
|
4
|
-
import { TrashIcon } from '@heroicons/react/16/solid';
|
|
5
|
-
import { BrowserRouter } from 'react-router-dom';
|
|
6
|
-
// Configuración general para el componente en Storybook
|
|
7
|
-
const meta = {
|
|
8
|
-
title: 'UI/Buttons/LinkButton', // Categoría y nombre en la barra lateral de Storybook
|
|
9
|
-
component: LinkButton,
|
|
10
|
-
// Aplica el decorador solo a esta historia o a este archivo de historias
|
|
11
|
-
decorators: [
|
|
12
|
-
(Story) => (React.createElement(BrowserRouter, null,
|
|
13
|
-
React.createElement(Story, null))),
|
|
14
|
-
],
|
|
15
|
-
tags: ['autodocs'],
|
|
16
|
-
argTypes: { ...ArgumentsBase, disabled: ArgumentsComponents.disabled }
|
|
17
|
-
};
|
|
18
|
-
export default meta;
|
|
19
|
-
// Historias individuales
|
|
20
|
-
export const LinkButtonPrimary = {
|
|
21
|
-
args: {
|
|
22
|
-
to: '',
|
|
23
|
-
lb: 'Botón Primario',
|
|
24
|
-
variant: 'fill',
|
|
25
|
-
loading: true,
|
|
26
|
-
theme: 'primary'
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
export const LinkButtonSecondary = {
|
|
30
|
-
args: {
|
|
31
|
-
to: '',
|
|
32
|
-
lb: 'Botón Secundario',
|
|
33
|
-
theme: 'secondary',
|
|
34
|
-
size: 'xs',
|
|
35
|
-
variant: 'fill',
|
|
36
|
-
Icon: TrashIcon
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
export const variantLinkButtonSize = {
|
|
40
|
-
args: {
|
|
41
|
-
to: '',
|
|
42
|
-
lb: 'Botón Variante primary',
|
|
43
|
-
theme: 'primary',
|
|
44
|
-
size: 'lg',
|
|
45
|
-
variant: 'outline',
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=LinkButton.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkButton.stories.js","sourceRoot":"","sources":["../../src/buttons/LinkButton.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,UAA+B,MAAM,iBAAiB,CAAC,CAAC,+DAA+D;AAC9H,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,wDAAwD;AACxD,MAAM,IAAI,GAAQ;IAChB,KAAK,EAAE,uBAAuB,EAAE,sDAAsD;IACtF,SAAS,EAAE,UAAU;IACrB,yEAAyE;IACzE,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,oBAAC,aAAa;YACZ,oBAAC,KAAK,OAAG,CACK,CACjB;KACF;IAED,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE,EAAE,GAAG,aAAa,EAAE,QAAQ,EAAE,mBAAmB,CAAC,QAAQ,EAAE;CACvC,CAAC;AAGlC,eAAe,IAAI,CAAC;AAGpB,yBAAyB;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAA0B;IACtD,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,gBAAgB;QACpB,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,SAAS;KACjB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAA0B;IACxD,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,kBAAkB;QACtB,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,SAAS;KAEhB;CACF,CAAC;AAGF,MAAM,CAAC,MAAM,qBAAqB,GAA0B;IAC1D,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,SAAS;KAEnB;CACF,CAAC"}
|
package/dist/buttons/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/buttons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/buttons/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/buttons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/cards/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface GenericCardProps {
|
|
3
|
-
imageUrl?: string;
|
|
4
|
-
title?: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
theme?: 'light' | 'dark';
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const GenericCard: React.FC<GenericCardProps>;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cards/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,gBAAgB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAuClD,CAAC"}
|
package/dist/cards/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export const GenericCard = ({ imageUrl, title, description, children, theme = 'light', // Tema por defecto 'light'
|
|
3
|
-
className = '', }) => {
|
|
4
|
-
// Clases base para el contenedor de la tarjeta
|
|
5
|
-
const baseClasses = 'rounded-lg shadow-md overflow-hidden';
|
|
6
|
-
// Clases condicionales para el tema (dark/light)
|
|
7
|
-
const themeClasses = theme === 'dark'
|
|
8
|
-
? 'bg-gray-800 text-white'
|
|
9
|
-
: 'bg-white text-gray-900';
|
|
10
|
-
return (React.createElement("div", { className: `${baseClasses} ${themeClasses} ${className}` },
|
|
11
|
-
imageUrl && (React.createElement("img", { className: "w-full h-48 object-cover", src: imageUrl, alt: title || 'Card image' })),
|
|
12
|
-
React.createElement("div", { className: "p-6" },
|
|
13
|
-
title && (React.createElement("h2", { className: "font-bold text-xl mb-2" }, title)),
|
|
14
|
-
description && (React.createElement("p", { className: "text-base mb-4" }, description)),
|
|
15
|
-
children,
|
|
16
|
-
" ")));
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cards/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cards/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EACpD,QAAQ,EACR,KAAK,EACL,WAAW,EACX,QAAQ,EACR,KAAK,GAAG,OAAO,EAAE,2BAA2B;AAC5C,SAAS,GAAG,EAAE,GACjB,EAAE,EAAE;IACD,+CAA+C;IAC/C,MAAM,WAAW,GAAG,sCAAsC,CAAC;IAE3D,iDAAiD;IACjD,MAAM,YAAY,GAAG,KAAK,KAAK,MAAM;QACjC,CAAC,CAAC,wBAAwB;QAC1B,CAAC,CAAC,wBAAwB,CAAC;IAE/B,OAAO,CACH,6BAAK,SAAS,EAAE,GAAG,WAAW,IAAI,YAAY,IAAI,SAAS,EAAE;QAExD,QAAQ,IAAI,CACT,6BAAK,SAAS,EAAC,0BAA0B,EAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,IAAI,YAAY,GAAI,CAC1F;QACD,6BAAK,SAAS,EAAC,KAAK;YACf,KAAK,IAAI,CACN,4BAAI,SAAS,EAAC,wBAAwB,IACjC,KAAK,CACL,CACR;YAEG,WAAW,IAAI,CACX,2BAAG,SAAS,EAAC,gBAAgB,IACxB,WAAW,CACZ,CACP;YAEJ,QAAQ;gBACP,CACJ,CACT,CAAC;AACN,CAAC,CAAC"}
|
package/dist/forms/Paginate.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type PaginateProps = {
|
|
3
|
-
defaultPage?: number;
|
|
4
|
-
onChangue: (page: number, offset: number, limit: number) => void;
|
|
5
|
-
rows: number;
|
|
6
|
-
rowsPage: number;
|
|
7
|
-
children: any;
|
|
8
|
-
overFlowAuto?: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare const _default: React.MemoExoticComponent<({ defaultPage, rows, rowsPage, children, onChangue, overFlowAuto }: PaginateProps) => JSX.Element>;
|
|
11
|
-
export default _default;
|
|
12
|
-
//# sourceMappingURL=Paginate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Paginate.d.ts","sourceRoot":"","sources":["../../src/forms/Paginate.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,KAAK,aAAa,GAAG;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAA;uHAE8F,aAAa,KAAG,GAAG,CAAC,OAAO;AAoD1H,wBAAoC"}
|
package/dist/forms/Paginate.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/solid';
|
|
2
|
-
import React, { useEffect, useReducer } from 'react';
|
|
3
|
-
import { Reducer } from '../reducers/index.js';
|
|
4
|
-
const Paginate = ({ defaultPage = 1, rows, rowsPage = 30, children, onChangue, overFlowAuto }) => {
|
|
5
|
-
const [paginate, setPaginate] = useReducer((Reducer), { current: defaultPage, total: 1 });
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
let pageTotal = 1;
|
|
8
|
-
if (rowsPage > 0)
|
|
9
|
-
pageTotal = Math.ceil(rows / rowsPage);
|
|
10
|
-
setPaginate({ total: pageTotal });
|
|
11
|
-
}, [rows]);
|
|
12
|
-
const nextPage = () => {
|
|
13
|
-
const page = (paginate.current + 1) >= paginate.total ? paginate.total : paginate.current + 1;
|
|
14
|
-
onChangue((page - 1) * rowsPage, page * rowsPage, page);
|
|
15
|
-
setPaginate({ current: page });
|
|
16
|
-
};
|
|
17
|
-
const prevPage = () => {
|
|
18
|
-
const page = (paginate.current - 1) < 0 ? 0 : paginate.current - 1;
|
|
19
|
-
onChangue((page - 1) * rowsPage, page * rowsPage, page);
|
|
20
|
-
setPaginate({ current: page });
|
|
21
|
-
};
|
|
22
|
-
return (React.createElement(React.Fragment, null,
|
|
23
|
-
React.createElement("div", { className: overFlowAuto ? 'w-full overflow-auto h-96 scrollbar-thin' : '' }, children),
|
|
24
|
-
React.createElement("div", { className: "my-1 flex items-center gap-1 cursor-pointer text-base select-none" },
|
|
25
|
-
React.createElement("button", { title: 'Anterior', disabled: paginate.current == 1 || paginate.total == 1, onClick: prevPage, className: 'p-1 font-bold rounded-md bg-slate-200 dark:bg-slate-600 disabled:text-gray-400 hover:bg-black/15' },
|
|
26
|
-
React.createElement(ChevronLeftIcon, { height: 24, width: 17 })),
|
|
27
|
-
Array.from({ length: paginate.total }, (_, index) => index + 1).map((pag) => (React.createElement("button", { key: pag, onClick: () => {
|
|
28
|
-
onChangue((pag - 1) * rowsPage, pag * rowsPage, pag);
|
|
29
|
-
setPaginate({ current: pag });
|
|
30
|
-
}, className: `p-1 px-2 rounded-md bg-slate-200 dark:bg-slate-600 dark:text-gray-200 disabled:text-gray-400 hover:bg-black/15 ${pag == paginate.current ? ' font-medium !bg-sky-650 text-white' : ' '}` }, pag))),
|
|
31
|
-
React.createElement("button", { title: 'Siguiente', disabled: paginate.current == paginate.total || paginate.total == 1, onClick: nextPage, className: 'p-1 font-bold rounded-md bg-slate-200 dark:bg-slate-600 disabled:text-gray-400 hover:bg-black/15' },
|
|
32
|
-
React.createElement(ChevronRightIcon, { height: 24, width: 17 })))));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(Paginate);
|
|
35
|
-
//# sourceMappingURL=Paginate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Paginate.js","sourceRoot":"","sources":["../../src/forms/Paginate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAoB,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAW/C,MAAM,QAAQ,GAAG,CAAC,EAAE,WAAW,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAG,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAiB,EAAe,EAAE;IACzH,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,UAAU,CAAC,CAAA,OAAY,CAAA,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAE7F,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,IAAI,QAAQ,GAAG,CAAC;YAAE,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC;QACzD,WAAW,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,MAAM,QAAQ,GAAG,GAAG,EAAE;QAClB,MAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC;QAC9F,SAAS,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,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AC,GAAG,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC;oBACrD,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAA;gBACjC,CAAC,EACG,SAAS,EAAE,mHAAmH,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,qCAAqC,CAAC,CAAC,CAAC,GAAG,EAAE,IACpM,GAAG,CACC,CACZ,CAAC;YAGN,gCAAQ,KAAK,EAAC,WAAW,EAAC,QAAQ,EAAE,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,IAAI,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAC,sGAAsG;gBAC9N,oBAAC,gBAAgB,IAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,GAAI,CACtC,CACP,CACP,CACN,CAAA;AACL,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
type PhotoCardType = {
|
|
3
|
-
uuid?: string;
|
|
4
|
-
user_id?: any;
|
|
5
|
-
api: string;
|
|
6
|
-
photo: string | null;
|
|
7
|
-
theme?: 'small' | 'default';
|
|
8
|
-
set: (url: any) => void;
|
|
9
|
-
};
|
|
10
|
-
declare const PhotoCard: ({ uuid, api, user_id, photo, set, theme }: PhotoCardType) => React.JSX.Element;
|
|
11
|
-
export default PhotoCard;
|
|
12
|
-
//# sourceMappingURL=PhotoCard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PhotoCard.d.ts","sourceRoot":"","sources":["../../src/forms/PhotoCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,KAAK,aAAa,GAAG;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAC3B,CAAA;AAED,QAAA,MAAM,SAAS,GAAI,2CAA4D,aAAa,sBA8E3F,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/dist/forms/PhotoCard.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import { toast } from "react-toastify";
|
|
3
|
-
import { FolderIcon, TrashIcon } from '@heroicons/react/24/outline';
|
|
4
|
-
import cn from "classnames";
|
|
5
|
-
import useHttpState from "../hooks/useHttpState.js";
|
|
6
|
-
const PhotoCard = ({ uuid = '', api, user_id, photo, set, theme = 'default' }) => {
|
|
7
|
-
// Valores de los inputs
|
|
8
|
-
const [preview, setPreview] = useState(null);
|
|
9
|
-
const { deleteReq, patch } = useHttpState();
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
setPreview(photo);
|
|
12
|
-
}, [photo]);
|
|
13
|
-
// Crear una vista previa como efecto, siempre que se cambie el archivo seleccionado
|
|
14
|
-
//Update and Selected Image
|
|
15
|
-
const onSelectFile = (e) => {
|
|
16
|
-
if (!e.target.files || e.target.files.length === 0) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const exts = e.target.files[0].name?.split(".");
|
|
20
|
-
const ext = exts[exts.length - 1];
|
|
21
|
-
if (["jpg", "png", "jpeg", "bpm", "tif"].includes(ext)) {
|
|
22
|
-
setPreview(URL.createObjectURL(e.target.files[0]));
|
|
23
|
-
patch(api, {
|
|
24
|
-
data: { user_id, enterprise_id: 1, photo: e.target.files[0] },
|
|
25
|
-
content_type: 'file',
|
|
26
|
-
onSuccess: (data) => {
|
|
27
|
-
set({ photo: data.photo });
|
|
28
|
-
toast.success('Imagen Actualizada Correctamente!');
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
toast.error("Por favor seleccione una imagen de Extensión (jpg,png,bmp)");
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const deletePreview = () => {
|
|
37
|
-
setPreview(null);
|
|
38
|
-
if (photo != 'Photo.jpg') {
|
|
39
|
-
deleteReq(api, {
|
|
40
|
-
onSuccess: (data) => {
|
|
41
|
-
set({ photo: 'Photo.jpg' });
|
|
42
|
-
toast.success('Imagen Eliminada Correctamente!');
|
|
43
|
-
setPreview(null);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
return (React.createElement("div", { className: "flex items-center space-x-2 justify-center" },
|
|
49
|
-
React.createElement("img", { src: preview ? preview : '/images/Photo.jpg', alt: "", className: cn(" rounded-full", theme == 'default' ? ' h-20 w-20' : 'h-8 w-8') }),
|
|
50
|
-
React.createElement("div", { className: cn("flex gap-2", theme == 'default' ? 'flex-col text-sm' : 'text-xs') },
|
|
51
|
-
React.createElement("input", { className: "hidden", type: "file", id: `profile-file-${uuid}`, accept: ".jpg, .png, .jpeg, .bmp, .tif, .tiff|image/*", onChange: (e) => {
|
|
52
|
-
onSelectFile(e);
|
|
53
|
-
} }),
|
|
54
|
-
React.createElement("label", { htmlFor: `profile-file-${uuid}`, className: "button outline-gray" },
|
|
55
|
-
React.createElement(FolderIcon, { className: "h-4" }),
|
|
56
|
-
React.createElement("span", { className: theme == 'small' ? 'hidden' : '' }, " Cambiar Imagen")),
|
|
57
|
-
preview && React.createElement("button", { className: "button outline-red", onClick: deletePreview },
|
|
58
|
-
React.createElement(TrashIcon, { className: "h-4" }),
|
|
59
|
-
React.createElement("span", { className: theme == 'small' ? 'hidden' : '' }, "Eliminar Imagen")))));
|
|
60
|
-
};
|
|
61
|
-
export default PhotoCard;
|
|
62
|
-
//# sourceMappingURL=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,mBAAmB,EAAE,GAAG,EAAC,EAAE,EAAC,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,GAAI;QAC3I,6BAAK,SAAS,EAAE,EAAE,CAAC,YAAY,EAC3B,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CACvD;YACG,+BACI,SAAS,EAAC,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,EAAE,EAAE,gBAAgB,IAAI,EAAE,EAC1B,MAAM,EAAC,8CAA8C,EACrD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;oBACZ,YAAY,CAAC,CAAC,CAAC,CAAC;gBACpB,CAAC,GACH;YACF,+BAAO,OAAO,EAAE,gBAAgB,IAAI,EAAE,EAAE,SAAS,EAAC,qBAAqB;gBACnE,oBAAC,UAAU,IAAC,SAAS,EAAC,KAAK,GAAG;gBAC9B,8BAAM,SAAS,EAAE,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,sBAAwB,CACrE;YACP,OAAO,IAAI,gCAAQ,SAAS,EAAC,oBAAoB,EAAC,OAAO,EAAE,aAAa;gBACrE,oBAAC,SAAS,IAAC,SAAS,EAAC,KAAK,GAAG;gBAC7B,8BAAM,SAAS,EAAE,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,sBAAwB,CACpE,CAEP,CACJ,CAET,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface YouTubePlayerProps {
|
|
3
|
-
videoId: string;
|
|
4
|
-
className?: string;
|
|
5
|
-
iframeClassName?: string;
|
|
6
|
-
onReady?: (player: YT.Player) => void;
|
|
7
|
-
onStateChange?: (event: YT.OnStateChangeEvent) => void;
|
|
8
|
-
options?: {
|
|
9
|
-
autoplay?: 0 | 1;
|
|
10
|
-
controls?: 0 | 1;
|
|
11
|
-
loop?: 0 | 1;
|
|
12
|
-
mute?: 0 | 1;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
declare const YouTubePlayer: ({ videoId, className, iframeClassName, onReady, onStateChange, options, }: YouTubePlayerProps) => React.JSX.Element;
|
|
16
|
-
export default YouTubePlayer;
|
|
17
|
-
//# sourceMappingURL=PlayerYoutube.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlayerYoutube.d.ts","sourceRoot":"","sources":["../../src/forms/PlayerYoutube.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAUjD,UAAU,kBAAkB;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC;IACtC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,KAAK,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QACb,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;KACd,CAAC;CACH;AAED,QAAA,MAAM,aAAa,GAAI,2EAOpB,kBAAkB,sBAuCpB,CAAC;AAEF,eAAgB,aAAa,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from "react";
|
|
2
|
-
;
|
|
3
|
-
const YouTubePlayer = ({ videoId, className, iframeClassName, onReady, onStateChange, options = {}, }) => {
|
|
4
|
-
const playerRef = useRef(null);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
if (!playerRef.current)
|
|
7
|
-
return;
|
|
8
|
-
// Cargar el script de la API de YouTube si no está en el documento
|
|
9
|
-
if (!window.YT) {
|
|
10
|
-
const tag = document.createElement("script");
|
|
11
|
-
tag.src = "https://www.youtube.com/iframe_api";
|
|
12
|
-
tag.async = true;
|
|
13
|
-
document.body.appendChild(tag);
|
|
14
|
-
}
|
|
15
|
-
const onYouTubeIframeAPIReady = () => {
|
|
16
|
-
const player = new YT.Player(playerRef.current, {
|
|
17
|
-
videoId,
|
|
18
|
-
playerVars: {
|
|
19
|
-
autoplay: options.autoplay ?? 0,
|
|
20
|
-
controls: options.controls ?? 1,
|
|
21
|
-
loop: options.loop ?? 0,
|
|
22
|
-
mute: options.mute ?? 0,
|
|
23
|
-
},
|
|
24
|
-
events: {
|
|
25
|
-
onReady: (event) => onReady?.(event.target),
|
|
26
|
-
onStateChange,
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
// Esperar a que la API de YouTube esté lista
|
|
31
|
-
if (window.YT && window.YT.Player) {
|
|
32
|
-
onYouTubeIframeAPIReady();
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
window.onYouTubeIframeAPIReady = onYouTubeIframeAPIReady;
|
|
36
|
-
}
|
|
37
|
-
}, [videoId, options]);
|
|
38
|
-
return React.createElement("div", { ref: playerRef, className: className });
|
|
39
|
-
};
|
|
40
|
-
export default YouTubePlayer;
|
|
41
|
-
//# sourceMappingURL=PlayerYoutube.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlayerYoutube.js","sourceRoot":"","sources":["../../src/forms/PlayerYoutube.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAQhD,CAAC;AAgBF,MAAM,aAAa,GAAG,CAAC,EACrB,OAAO,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C;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAEvB,OAAO,6BAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAI,CAAC;AACvD,CAAC,CAAC;AAEF,eAAgB,aAAa,CAAC"}
|
package/dist/stories/Button.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './button.css';
|
|
3
|
-
export interface ButtonProps {
|
|
4
|
-
/** Is this the principal call to action on the page? */
|
|
5
|
-
primary?: boolean;
|
|
6
|
-
/** What background color to use */
|
|
7
|
-
backgroundColor?: string;
|
|
8
|
-
/** How large should the button be? */
|
|
9
|
-
size?: 'small' | 'medium' | 'large';
|
|
10
|
-
/** Button contents */
|
|
11
|
-
label: string;
|
|
12
|
-
/** Optional click handler */
|
|
13
|
-
onClick?: () => void;
|
|
14
|
-
}
|
|
15
|
-
/** Primary UI component for user interaction */
|
|
16
|
-
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => React.JSX.Element;
|
|
17
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/stories/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mCAAmC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,gDAAgD;AAChD,eAAO,MAAM,MAAM,GAAI,qDAMpB,WAAW,sBAYb,CAAC"}
|
package/dist/stories/Button.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './button.css';
|
|
3
|
-
/** Primary UI component for user interaction */
|
|
4
|
-
export const Button = ({ primary = false, size = 'medium', backgroundColor, label, ...props }) => {
|
|
5
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
6
|
-
return (React.createElement("button", { type: "button", className: ['storybook-button', `storybook-button--${size}`, mode].join(' '), style: { backgroundColor }, ...props }, label));
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/stories/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AAetB,gDAAgD;AAChD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,OAAO,GAAG,KAAK,EACf,IAAI,GAAG,QAAQ,EACf,eAAe,EACf,KAAK,EACL,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,6BAA6B,CAAC;IACnF,OAAO,CACL,gCACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC5E,KAAK,EAAE,EAAE,eAAe,EAAE,KACtB,KAAK,IAER,KAAK,CACC,CACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: any;
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: string;
|
|
7
|
-
};
|
|
8
|
-
tags: string[];
|
|
9
|
-
argTypes: {
|
|
10
|
-
backgroundColor: {
|
|
11
|
-
control: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
args: {
|
|
15
|
-
onClick: import("storybook/internal/test").Mock<(...args: any[]) => any>;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof meta>;
|
|
20
|
-
export declare const Primary: Story;
|
|
21
|
-
export declare const Secondary: Story;
|
|
22
|
-
export declare const Large: Story;
|
|
23
|
-
export declare const Small: Story;
|
|
24
|
-
export declare const ButtonPrimary: Story;
|
|
25
|
-
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../src/stories/Button.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;CAeqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAK3B,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { fn } from 'storybook/test';
|
|
2
|
-
import { Button } from './Button';
|
|
3
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Example/Button',
|
|
6
|
-
component: Button,
|
|
7
|
-
parameters: {
|
|
8
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
},
|
|
11
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
14
|
-
argTypes: {
|
|
15
|
-
backgroundColor: { control: 'color' },
|
|
16
|
-
},
|
|
17
|
-
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
18
|
-
args: { onClick: fn() },
|
|
19
|
-
};
|
|
20
|
-
export default meta;
|
|
21
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
22
|
-
export const Primary = {
|
|
23
|
-
args: {
|
|
24
|
-
primary: true,
|
|
25
|
-
label: 'Button',
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
export const Secondary = {
|
|
29
|
-
args: {
|
|
30
|
-
label: 'Button',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
export const Large = {
|
|
34
|
-
args: {
|
|
35
|
-
size: 'large',
|
|
36
|
-
label: 'Button',
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
export const Small = {
|
|
40
|
-
args: {
|
|
41
|
-
size: 'small',
|
|
42
|
-
label: 'Button',
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
export const ButtonPrimary = {
|
|
46
|
-
args: {
|
|
47
|
-
primary: false,
|
|
48
|
-
label: "Button"
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../src/stories/Button.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,iGAAiG;AACjG,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE;QACV,4HAA4H;QAC5H,MAAM,EAAE,UAAU;KACnB;IACD,0HAA0H;IAC1H,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,+DAA+D;IAC/D,QAAQ,EAAE;QACR,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;KACtC;IACD,wJAAwJ;IACxJ,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE;CACM,CAAC;AAEhC,eAAe,IAAI,CAAC;AAGpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC"}
|
package/dist/stories/Header.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './header.css';
|
|
3
|
-
type User = {
|
|
4
|
-
name: string;
|
|
5
|
-
};
|
|
6
|
-
export interface HeaderProps {
|
|
7
|
-
user?: User;
|
|
8
|
-
onLogin?: () => void;
|
|
9
|
-
onLogout?: () => void;
|
|
10
|
-
onCreateAccount?: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => React.JSX.Element;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/stories/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,cAAc,CAAC;AAEtB,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,MAAM,GAAI,8CAA8C,WAAW,sBAuC/E,CAAC"}
|
package/dist/stories/Header.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from './Button';
|
|
3
|
-
import './header.css';
|
|
4
|
-
export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (React.createElement("header", null,
|
|
5
|
-
React.createElement("div", { className: "storybook-header" },
|
|
6
|
-
React.createElement("div", null,
|
|
7
|
-
React.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg" },
|
|
8
|
-
React.createElement("g", { fill: "none", fillRule: "evenodd" },
|
|
9
|
-
React.createElement("path", { d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z", fill: "#FFF" }),
|
|
10
|
-
React.createElement("path", { d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z", fill: "#555AB9" }),
|
|
11
|
-
React.createElement("path", { d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z", fill: "#91BAF8" }))),
|
|
12
|
-
React.createElement("h1", null, "Acme")),
|
|
13
|
-
React.createElement("div", null, user ? (React.createElement(React.Fragment, null,
|
|
14
|
-
React.createElement("span", { className: "welcome" },
|
|
15
|
-
"Welcome, ",
|
|
16
|
-
React.createElement("b", null, user.name),
|
|
17
|
-
"!"),
|
|
18
|
-
React.createElement(Button, { size: "small", onClick: onLogout, label: "Log out" }))) : (React.createElement(React.Fragment, null,
|
|
19
|
-
React.createElement(Button, { size: "small", onClick: onLogin, label: "Log in" }),
|
|
20
|
-
React.createElement(Button, { primary: true, size: "small", onClick: onCreateAccount, label: "Sign up" })))))));
|
|
21
|
-
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/stories/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,cAAc,CAAC;AAatB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAe,EAAE,EAAE,CAAC,CACnF;IACE,6BAAK,SAAS,EAAC,kBAAkB;QAC/B;YACE,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;gBAChF,2BAAG,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS;oBAC/B,8BACE,CAAC,EAAC,mFAAmF,EACrF,IAAI,EAAC,MAAM,GACX;oBACF,8BACE,CAAC,EAAC,kEAAkE,EACpE,IAAI,EAAC,SAAS,GACd;oBACF,8BACE,CAAC,EAAC,gEAAgE,EAClE,IAAI,EAAC,SAAS,GACd,CACA,CACA;YACN,uCAAa,CACT;QACN,iCACG,IAAI,CAAC,CAAC,CAAC,CACN;YACE,8BAAM,SAAS,EAAC,SAAS;;gBACd,+BAAI,IAAI,CAAC,IAAI,CAAK;oBACtB;YACP,oBAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAC,SAAS,GAAG,CACzD,CACJ,CAAC,CAAC,CAAC,CACF;YACE,oBAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,QAAQ,GAAG;YACxD,oBAAC,MAAM,IAAC,OAAO,QAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAC,SAAS,GAAG,CACxE,CACJ,CACG,CACF,CACC,CACV,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: any;
|
|
5
|
-
tags: string[];
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: string;
|
|
8
|
-
};
|
|
9
|
-
args: {
|
|
10
|
-
onLogin: import("storybook/internal/test").Mock<(...args: any[]) => any>;
|
|
11
|
-
onLogout: import("storybook/internal/test").Mock<(...args: any[]) => any>;
|
|
12
|
-
onCreateAccount: import("storybook/internal/test").Mock<(...args: any[]) => any>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default meta;
|
|
16
|
-
type Story = StoryObj<typeof meta>;
|
|
17
|
-
export declare const LoggedIn: Story;
|
|
18
|
-
export declare const LoggedOut: Story;
|
|
19
|
-
//# sourceMappingURL=Header.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.stories.d.ts","sourceRoot":"","sources":["../../src/stories/Header.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAM5D,QAAA,MAAM,IAAI;;;;;;;;;;;;CAcqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAU,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { fn } from 'storybook/test';
|
|
2
|
-
import { Header } from './Header';
|
|
3
|
-
const meta = {
|
|
4
|
-
title: 'Example/Header',
|
|
5
|
-
component: Header,
|
|
6
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
},
|
|
12
|
-
args: {
|
|
13
|
-
onLogin: fn(),
|
|
14
|
-
onLogout: fn(),
|
|
15
|
-
onCreateAccount: fn(),
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
export default meta;
|
|
19
|
-
export const LoggedIn = {
|
|
20
|
-
args: {
|
|
21
|
-
user: {
|
|
22
|
-
name: 'Jane Doe',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
export const LoggedOut = {};
|
|
27
|
-
//# sourceMappingURL=Header.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.stories.js","sourceRoot":"","sources":["../../src/stories/Header.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,MAAM;IACjB,0HAA0H;IAC1H,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,2FAA2F;QAC3F,MAAM,EAAE,YAAY;KACrB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE,EAAE;QACd,eAAe,EAAE,EAAE,EAAE;KACtB;CAC4B,CAAC;AAEhC,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;SACjB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU,EAAE,CAAC"}
|
package/dist/stories/Page.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../src/stories/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,YAAY,CAAC;AAMpB,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EA+DxB,CAAC"}
|
package/dist/stories/Page.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Header } from './Header.js';
|
|
3
|
-
import './page.css';
|
|
4
|
-
export const Page = () => {
|
|
5
|
-
const [user, setUser] = React.useState();
|
|
6
|
-
return (React.createElement("article", null,
|
|
7
|
-
React.createElement(Header, { user: user, onLogin: () => setUser({ name: 'Jane Doe' }), onLogout: () => setUser(undefined), onCreateAccount: () => setUser({ name: 'Jane Doe' }) }),
|
|
8
|
-
React.createElement("section", { className: "storybook-page" },
|
|
9
|
-
React.createElement("h2", null, "Pages in Storybook"),
|
|
10
|
-
React.createElement("p", null,
|
|
11
|
-
"We recommend building UIs with a",
|
|
12
|
-
' ',
|
|
13
|
-
React.createElement("a", { href: "https://componentdriven.org", target: "_blank", rel: "noopener noreferrer" },
|
|
14
|
-
React.createElement("strong", null, "component-driven")),
|
|
15
|
-
' ',
|
|
16
|
-
"process starting with atomic components and ending with pages."),
|
|
17
|
-
React.createElement("p", null, "Render pages with mock data. This makes it easy to build and review page states without needing to navigate to them in your app. Here are some handy patterns for managing page data in Storybook:"),
|
|
18
|
-
React.createElement("ul", null,
|
|
19
|
-
React.createElement("li", null, "Use a higher-level connected component. Storybook helps you compose such data from the \"args\" of child component stories"),
|
|
20
|
-
React.createElement("li", null, "Assemble data in the page component from your services. You can mock these services out using Storybook.")),
|
|
21
|
-
React.createElement("p", null,
|
|
22
|
-
"Get a guided tutorial on component-driven development at",
|
|
23
|
-
' ',
|
|
24
|
-
React.createElement("a", { href: "https://storybook.js.org/tutorials/", target: "_blank", rel: "noopener noreferrer" }, "Storybook tutorials"),
|
|
25
|
-
". Read more in the",
|
|
26
|
-
' ',
|
|
27
|
-
React.createElement("a", { href: "https://storybook.js.org/docs", target: "_blank", rel: "noopener noreferrer" }, "docs"),
|
|
28
|
-
"."),
|
|
29
|
-
React.createElement("div", { className: "tip-wrapper" },
|
|
30
|
-
React.createElement("span", { className: "tip" }, "Tip"),
|
|
31
|
-
" Adjust the width of the canvas with the",
|
|
32
|
-
' ',
|
|
33
|
-
React.createElement("svg", { width: "10", height: "10", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg" },
|
|
34
|
-
React.createElement("g", { fill: "none", fillRule: "evenodd" },
|
|
35
|
-
React.createElement("path", { d: "M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z", id: "a", fill: "#999" }))),
|
|
36
|
-
"Viewports addon in the toolbar"))));
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=Page.js.map
|
package/dist/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K,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;oBAChF,2BAAG,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS;wBAC/B,8BACE,CAAC,EAAC,sOAAsO,EACxO,EAAE,EAAC,GAAG,EACN,IAAI,EAAC,MAAM,GACX,CACA,CACA;iDAEF,CACE,CACF,CACX,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: any;
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export default meta;
|
|
10
|
-
type Story = StoryObj<typeof meta>;
|
|
11
|
-
export declare const LoggedOut: Story;
|
|
12
|
-
export declare const LoggedIn: Story;
|
|
13
|
-
//# sourceMappingURL=Page.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Page.stories.d.ts","sourceRoot":"","sources":["../../src/stories/Page.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAM5D,QAAA,MAAM,IAAI;;;;;;CAOmB,CAAC;AAE9B,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,SAAS,EAAE,KAAU,CAAC;AAGnC,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { expect, userEvent, within } from 'storybook/test';
|
|
2
|
-
import { Page } from './Page';
|
|
3
|
-
const meta = {
|
|
4
|
-
title: 'Example/Page',
|
|
5
|
-
component: Page,
|
|
6
|
-
parameters: {
|
|
7
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
export const LoggedOut = {};
|
|
13
|
-
// More on component testing: https://storybook.js.org/docs/writing-tests/interaction-testing
|
|
14
|
-
export const LoggedIn = {
|
|
15
|
-
play: async ({ canvasElement }) => {
|
|
16
|
-
const canvas = within(canvasElement);
|
|
17
|
-
const loginButton = canvas.getByRole('button', { name: /Log in/i });
|
|
18
|
-
await expect(loginButton).toBeInTheDocument();
|
|
19
|
-
await userEvent.click(loginButton);
|
|
20
|
-
await expect(loginButton).not.toBeInTheDocument();
|
|
21
|
-
const logoutButton = canvas.getByRole('button', { name: /Log out/i });
|
|
22
|
-
await expect(logoutButton).toBeInTheDocument();
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=Page.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Page.stories.js","sourceRoot":"","sources":["../../src/stories/Page.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV,2FAA2F;QAC3F,MAAM,EAAE,YAAY;KACrB;CAC0B,CAAC;AAE9B,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,SAAS,GAAU,EAAE,CAAC;AAEnC,6FAA6F;AAC7F,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE;QAChC,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QACrC,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QACpE,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAC9C,MAAM,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACnC,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAElD,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACtE,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACjD,CAAC;CACF,CAAC"}
|