@royaltics/ui 1.0.5 → 1.0.7
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/buttons/Button.d.ts +14 -16
- package/dist/buttons/Button.d.ts.map +1 -1
- package/dist/buttons/Button.js +23 -8
- package/dist/buttons/Button.js.map +1 -1
- package/dist/buttons/Button.stories.d.ts +18 -0
- package/dist/buttons/Button.stories.d.ts.map +1 -0
- package/dist/buttons/Button.stories.js +41 -0
- package/dist/buttons/Button.stories.js.map +1 -0
- package/dist/buttons/LinkButton.d.ts +8 -0
- package/dist/buttons/LinkButton.d.ts.map +1 -0
- package/dist/buttons/LinkButton.js +9 -0
- package/dist/buttons/LinkButton.js.map +1 -0
- package/dist/buttons/LinkButton.stories.d.ts +7 -0
- package/dist/buttons/LinkButton.stories.d.ts.map +1 -0
- package/dist/buttons/LinkButton.stories.js +48 -0
- package/dist/buttons/LinkButton.stories.js.map +1 -0
- package/dist/buttons/index.d.ts +2 -1
- package/dist/buttons/index.d.ts.map +1 -1
- package/dist/buttons/index.js +1 -0
- package/dist/buttons/index.js.map +1 -1
- package/dist/components/CheckboxTree.d.ts +5 -0
- package/dist/components/CheckboxTree.d.ts.map +1 -0
- package/dist/components/CheckboxTree.js +126 -0
- package/dist/components/CheckboxTree.js.map +1 -0
- package/dist/components/CheckboxTree.stories.d.ts +18 -0
- package/dist/components/CheckboxTree.stories.d.ts.map +1 -0
- package/dist/components/CheckboxTree.stories.js +39 -0
- package/dist/components/CheckboxTree.stories.js.map +1 -0
- package/dist/components/ConfirmDialogModal.d.ts +14 -0
- package/dist/components/ConfirmDialogModal.d.ts.map +1 -0
- package/dist/components/ConfirmDialogModal.js +25 -0
- package/dist/components/ConfirmDialogModal.js.map +1 -0
- package/dist/components/ConfirmDialogModal.stories.d.ts +18 -0
- package/dist/components/ConfirmDialogModal.stories.d.ts.map +1 -0
- package/dist/components/ConfirmDialogModal.stories.js +39 -0
- package/dist/components/ConfirmDialogModal.stories.js.map +1 -0
- package/dist/components/GenericCard.d.ts +13 -0
- package/dist/components/GenericCard.d.ts.map +1 -0
- package/dist/components/GenericCard.js +14 -0
- package/dist/components/GenericCard.js.map +1 -0
- package/dist/components/GenericCard.stories.d.ts +17 -0
- package/dist/components/GenericCard.stories.d.ts.map +1 -0
- package/dist/components/GenericCard.stories.js +30 -0
- package/dist/components/GenericCard.stories.js.map +1 -0
- package/dist/components/Paginate.d.ts +22 -0
- package/dist/components/Paginate.d.ts.map +1 -0
- package/dist/components/Paginate.js +102 -0
- package/dist/components/Paginate.js.map +1 -0
- package/dist/components/Paginate.stories.d.ts +18 -0
- package/dist/components/Paginate.stories.d.ts.map +1 -0
- package/dist/components/Paginate.stories.js +40 -0
- package/dist/components/Paginate.stories.js.map +1 -0
- package/dist/components/PhotoCard.d.ts +12 -0
- package/dist/components/PhotoCard.d.ts.map +1 -0
- package/dist/components/PhotoCard.js +62 -0
- package/dist/components/PhotoCard.js.map +1 -0
- package/dist/components/PlayerYoutube.d.ts +17 -0
- package/dist/components/PlayerYoutube.d.ts.map +1 -0
- package/dist/components/PlayerYoutube.js +41 -0
- package/dist/components/PlayerYoutube.js.map +1 -0
- package/dist/components/checkboxtree/CheckBoxTreeButton.d.ts +8 -0
- package/dist/components/checkboxtree/CheckBoxTreeButton.d.ts.map +1 -0
- package/dist/components/checkboxtree/CheckBoxTreeButton.js +7 -0
- package/dist/components/checkboxtree/CheckBoxTreeButton.js.map +1 -0
- package/dist/components/checkboxtree/CheckboxTreeError.d.ts +5 -0
- package/dist/components/checkboxtree/CheckboxTreeError.d.ts.map +1 -0
- package/dist/components/checkboxtree/CheckboxTreeError.js +16 -0
- package/dist/components/checkboxtree/CheckboxTreeError.js.map +1 -0
- package/dist/components/checkboxtree/NativeCheckbox.d.ts +7 -0
- package/dist/components/checkboxtree/NativeCheckbox.d.ts.map +1 -0
- package/dist/components/checkboxtree/NativeCheckbox.js +17 -0
- package/dist/components/checkboxtree/NativeCheckbox.js.map +1 -0
- package/dist/components/checkboxtree/NodeModel.d.ts +30 -0
- package/dist/components/checkboxtree/NodeModel.d.ts.map +1 -0
- package/dist/components/checkboxtree/NodeModel.js +184 -0
- package/dist/components/checkboxtree/NodeModel.js.map +1 -0
- package/dist/components/checkboxtree/TreeNode.d.ts +44 -0
- package/dist/components/checkboxtree/TreeNode.d.ts.map +1 -0
- package/dist/components/checkboxtree/TreeNode.js +139 -0
- package/dist/components/checkboxtree/TreeNode.js.map +1 -0
- package/dist/components/checkboxtree/constants.d.ts +8 -0
- package/dist/components/checkboxtree/constants.d.ts.map +1 -0
- package/dist/components/checkboxtree/constants.js +46 -0
- package/dist/components/checkboxtree/constants.js.map +1 -0
- package/dist/components/checkboxtree/types/types.d.ts +70 -0
- package/dist/components/checkboxtree/types/types.d.ts.map +1 -0
- package/dist/components/checkboxtree/types/types.js +2 -0
- package/dist/components/checkboxtree/types/types.js.map +1 -0
- package/dist/components/checkboxtree/utils.d.ts +16 -0
- package/dist/components/checkboxtree/utils.d.ts.map +1 -0
- package/dist/components/checkboxtree/utils.js +28 -0
- package/dist/components/checkboxtree/utils.js.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/constants/DataArrayNodes.d.ts +53 -0
- package/dist/constants/DataArrayNodes.d.ts.map +1 -0
- package/dist/constants/DataArrayNodes.js +162 -0
- package/dist/constants/DataArrayNodes.js.map +1 -0
- package/dist/constants/Variants.d.ts +26 -0
- package/dist/constants/Variants.d.ts.map +1 -0
- package/dist/constants/Variants.js +26 -0
- package/dist/constants/Variants.js.map +1 -0
- package/dist/forms/Button.d.ts +12 -0
- package/dist/forms/Button.d.ts.map +1 -0
- package/dist/forms/Button.js +28 -0
- package/dist/forms/Button.js.map +1 -0
- package/dist/forms/Button.stories.d.ts +18 -0
- package/dist/forms/Button.stories.d.ts.map +1 -0
- package/dist/forms/Button.stories.js +41 -0
- package/dist/forms/Button.stories.js.map +1 -0
- package/dist/forms/Checkbox.d.ts +13 -10
- package/dist/forms/Checkbox.d.ts.map +1 -1
- package/dist/forms/Checkbox.js +43 -4
- package/dist/forms/Checkbox.js.map +1 -1
- package/dist/forms/Checkbox.stories.d.ts +20 -0
- package/dist/forms/Checkbox.stories.d.ts.map +1 -0
- package/dist/forms/Checkbox.stories.js +65 -0
- package/dist/forms/Checkbox.stories.js.map +1 -0
- package/dist/forms/Input.d.ts +11 -22
- package/dist/forms/Input.d.ts.map +1 -1
- package/dist/forms/Input.js +27 -12
- package/dist/forms/Input.js.map +1 -1
- package/dist/forms/Input.stories.d.ts +22 -0
- package/dist/forms/Input.stories.d.ts.map +1 -0
- package/dist/forms/Input.stories.js +59 -0
- package/dist/forms/Input.stories.js.map +1 -0
- package/dist/forms/LinkButton.d.ts +8 -0
- package/dist/forms/LinkButton.d.ts.map +1 -0
- package/dist/forms/LinkButton.js +9 -0
- package/dist/forms/LinkButton.js.map +1 -0
- package/dist/forms/LinkButton.stories.d.ts +7 -0
- package/dist/forms/LinkButton.stories.d.ts.map +1 -0
- package/dist/forms/LinkButton.stories.js +48 -0
- package/dist/forms/LinkButton.stories.js.map +1 -0
- package/dist/forms/PhotoCard.d.ts.map +1 -1
- package/dist/forms/PlayerYoutube.d.ts.map +1 -1
- package/dist/forms/RadioButton.d.ts +2 -2
- package/dist/forms/RadioButton.d.ts.map +1 -1
- package/dist/forms/RadioButton.js +1 -1
- package/dist/forms/RadioButton.js.map +1 -1
- package/dist/forms/Select.d.ts +6 -14
- package/dist/forms/Select.d.ts.map +1 -1
- package/dist/forms/Select.js +25 -15
- package/dist/forms/Select.js.map +1 -1
- package/dist/forms/Select.stories.d.ts +17 -0
- package/dist/forms/Select.stories.d.ts.map +1 -0
- package/dist/forms/Select.stories.js +36 -0
- package/dist/forms/Select.stories.js.map +1 -0
- package/dist/forms/TextArea.d.ts +5 -13
- package/dist/forms/TextArea.d.ts.map +1 -1
- package/dist/forms/TextArea.js +4 -4
- package/dist/forms/TextArea.js.map +1 -1
- package/dist/forms/TextArea.stories.d.ts +17 -0
- package/dist/forms/TextArea.stories.d.ts.map +1 -0
- package/dist/forms/TextArea.stories.js +29 -0
- package/dist/forms/TextArea.stories.js.map +1 -0
- package/dist/forms/ToggleSwitch.d.ts.map +1 -1
- package/dist/forms/index.d.ts +4 -3
- package/dist/forms/index.d.ts.map +1 -1
- package/dist/forms/index.js +3 -9
- package/dist/forms/index.js.map +1 -1
- package/dist/hooks/useHttpState.d.ts.map +1 -1
- package/dist/hooks/useRouter.d.ts +2 -2
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +3 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +2 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -12
- package/dist/index.js.map +1 -1
- package/dist/reducers/index.d.ts.map +1 -1
- package/dist/stories/Button.d.ts +17 -0
- package/dist/stories/Button.d.ts.map +1 -0
- package/dist/stories/Button.js +8 -0
- package/dist/stories/Button.js.map +1 -0
- package/dist/stories/Button.stories.d.ts +25 -0
- package/dist/stories/Button.stories.d.ts.map +1 -0
- package/dist/stories/Button.stories.js +51 -0
- package/dist/stories/Button.stories.js.map +1 -0
- package/dist/stories/Header.d.ts +14 -0
- package/dist/stories/Header.d.ts.map +1 -0
- package/dist/stories/Header.js +21 -0
- package/dist/stories/Header.js.map +1 -0
- package/dist/stories/Header.stories.d.ts +19 -0
- package/dist/stories/Header.stories.d.ts.map +1 -0
- package/dist/stories/Header.stories.js +27 -0
- package/dist/stories/Header.stories.js.map +1 -0
- package/dist/stories/Page.d.ts +4 -0
- package/dist/stories/Page.d.ts.map +1 -0
- package/dist/stories/Page.js +38 -0
- package/dist/stories/Page.js.map +1 -0
- package/dist/stories/Page.stories.d.ts +13 -0
- package/dist/stories/Page.stories.d.ts.map +1 -0
- package/dist/stories/Page.stories.js +25 -0
- package/dist/stories/Page.stories.js.map +1 -0
- package/dist/types/StoriesArguments.d.ts +4 -0
- package/dist/types/StoriesArguments.d.ts.map +1 -0
- package/dist/types/StoriesArguments.js +52 -0
- package/dist/types/StoriesArguments.js.map +1 -0
- package/dist/types/global.d.ts +31 -0
- package/dist/types/global.d.ts.map +1 -0
- package/dist/types/global.js +2 -0
- package/dist/types/global.js.map +1 -0
- package/dist/utils/cvmix.d.ts +23 -0
- package/dist/utils/cvmix.d.ts.map +1 -0
- package/dist/utils/cvmix.js +46 -0
- package/dist/utils/cvmix.js.map +1 -0
- package/dist/validators/index.d.ts.map +1 -1
- package/package.json +101 -75
package/dist/forms/TextArea.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
const TextArea = ({ id, lb, placeholder, state,
|
|
3
|
-
const
|
|
2
|
+
const TextArea = ({ id, lb, placeholder, state, readOnly, className, onKeyDown, onEnter, tabIndex, onBlur }) => {
|
|
3
|
+
const [inputs, setInputs] = state;
|
|
4
4
|
const _onKeyDown = (evt) => {
|
|
5
5
|
if (evt.keyCode == 13 && onEnter && !evt.repeat) { //if Enter
|
|
6
6
|
onEnter(evt);
|
|
@@ -9,10 +9,10 @@ const TextArea = ({ id, lb, placeholder, state, disabled, readOnly, className, o
|
|
|
9
9
|
onKeyDown(evt);
|
|
10
10
|
};
|
|
11
11
|
return (React.createElement("div", { className: className },
|
|
12
|
-
lb && React.createElement("label", { htmlFor: id, className: `font-medium text-
|
|
12
|
+
lb && React.createElement("label", { htmlFor: id, className: `font-medium text-input-label pb-1 ` },
|
|
13
13
|
lb,
|
|
14
14
|
":"),
|
|
15
|
-
React.createElement("textarea", { className: `py-1.5 rounded-md border-1 px-2 w-full outline-none ${readOnly ? '
|
|
15
|
+
React.createElement("textarea", { className: `py-1.5 rounded-md border-1 px-2 w-full outline-none ${readOnly ? 'opacity-80' : 'bg-input text-input-foreground '}`, autoComplete: "off", spellCheck: "false", rows: 4, value: inputs?.[id] || '', disabled: readOnly, readOnly: readOnly, onKeyDown: _onKeyDown, onBlur: onBlur, placeholder: placeholder || lb, tabIndex: tabIndex, onChange: (e) => {
|
|
16
16
|
if (setInputs)
|
|
17
17
|
setInputs({ [id]: e.target.value });
|
|
18
18
|
} })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../src/forms/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../src/forms/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAiB,EAAE,EAAE;IAC5H,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC;IAElC,MAAM,UAAU,GAAG,CAAC,GAAQ,EAAE,EAAE;QAC9B,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU;YAC3D,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QACD,IAAI,SAAS;YAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC,CAAA;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,SAAS;QACtB,EAAE,IAAI,+BAAO,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,oCAAoC;YAAG,EAAE;gBAAU;QACzF,kCACE,SAAS,EAAE,uDAAuD,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iCAAiC,EAAE,EAC/H,YAAY,EAAC,KAAK,EAClB,UAAU,EAAC,OAAO,EAClB,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,EACzB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,IAAI,EAAE,EAC9B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,IAAI,SAAS;oBACX,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YACxC,CAAC,GACD,CACE,CACP,CAAC;AACJ,CAAC,CAAA;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { TextAreaProps } from './TextArea.js';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ id, lb, placeholder, state, readOnly, className, onKeyDown, onEnter, tabIndex, onBlur }: TextAreaProps) => import("react").JSX.Element;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export declare const textAreaNormal: StoryObj<typeof meta>;
|
|
16
|
+
export declare const textAreaSecondary: StoryObj<typeof meta>;
|
|
17
|
+
//# sourceMappingURL=TextArea.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.stories.d.ts","sourceRoot":"","sources":["../../src/forms/TextArea.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGxD,QAAA,MAAM,IAAI;;;;;;;;;;CAQqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AAIpB,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,OAAO,IAAI,CAMhD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,OAAO,IAAI,CAMnD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ArgumentsBase } from '../types/StoriesArguments.js';
|
|
2
|
+
import TextArea from './TextArea.js';
|
|
3
|
+
// Configuración general para el componente en Storybook
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'UI/Forms/TextArea', // Categoría y nombre en la barra lateral de Storybook
|
|
6
|
+
component: TextArea,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered', // Centra el componente en el lienzo
|
|
9
|
+
},
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: { ...ArgumentsBase }
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
// Historias individuales
|
|
15
|
+
export const textAreaNormal = {
|
|
16
|
+
args: {
|
|
17
|
+
lb: 'TextArea',
|
|
18
|
+
id: "sss",
|
|
19
|
+
state: [{}]
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const textAreaSecondary = {
|
|
23
|
+
args: {
|
|
24
|
+
lb: 'TextArea Normal',
|
|
25
|
+
id: "sss",
|
|
26
|
+
state: [{}]
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=TextArea.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.stories.js","sourceRoot":"","sources":["../../src/forms/TextArea.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,QAA2B,MAAM,eAAe,CAAC;AAExD,wDAAwD;AACxD,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,mBAAmB,EAAE,sDAAsD;IAClF,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU,EAAE,oCAAoC;KACzD;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE,EAAE,GAAG,aAAa,EAAE;CACD,CAAC;AAEhC,eAAe,IAAI,CAAC;AAGpB,yBAAyB;AACzB,MAAM,CAAC,MAAM,cAAc,GAA0B;IACnD,IAAI,EAAE;QACJ,EAAE,EAAE,UAAU;QACd,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,CAAC,EAAE,CAAC;KACZ;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAA0B;IACtD,IAAI,EAAE;QACJ,EAAE,EAAE,iBAAiB;QACrB,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,CAAC,EAAE,CAAC;KACZ;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleSwitch.d.ts","sourceRoot":"","sources":["../../src/forms/ToggleSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,UAAU,iBAAiB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;CAE3D;AAED,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"ToggleSwitch.d.ts","sourceRoot":"","sources":["../../src/forms/ToggleSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,UAAU,iBAAiB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;CAE3D;AAED,QAAA,MAAM,YAAY,GAAI,mBAAmB,iBAAiB,sBAqBzD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/forms/index.d.ts
CHANGED
|
@@ -4,8 +4,9 @@ export { default as TextArea } from "./TextArea.js";
|
|
|
4
4
|
export { default as Checkbox } from "./Checkbox.js";
|
|
5
5
|
export { default as RadioButton } from "./RadioButton.js";
|
|
6
6
|
export { default as Select } from "./Select.js";
|
|
7
|
+
/**Buttons */
|
|
8
|
+
export { default as Button } from "./Button.js";
|
|
9
|
+
export { default as LinkButtonSmall } from "./LinkButton.js";
|
|
7
10
|
export { default as ToggleSwitch } from "./ToggleSwitch.js";
|
|
8
|
-
export {
|
|
9
|
-
export { default as PhotoCard } from "./PhotoCard.js";
|
|
10
|
-
export { default as PlayerYoutube } from "./PlayerYoutube.js";
|
|
11
|
+
export type { ButtonProps } from './Button.js';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAEhD,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/forms/index.js
CHANGED
|
@@ -4,14 +4,8 @@ export { default as TextArea } from "./TextArea.js";
|
|
|
4
4
|
export { default as Checkbox } from "./Checkbox.js";
|
|
5
5
|
export { default as RadioButton } from "./RadioButton.js";
|
|
6
6
|
export { default as Select } from "./Select.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// export { default as Button } from "../buttons/Button.js";
|
|
7
|
+
/**Buttons */
|
|
8
|
+
export { default as Button } from "./Button.js";
|
|
9
|
+
export { default as LinkButtonSmall } from "./LinkButton.js";
|
|
11
10
|
export { default as ToggleSwitch } from "./ToggleSwitch.js"; // Corregido "ToogleSwitch" a "ToggleSwitch" si fue un error tipográfico.
|
|
12
|
-
// Si estos componentes pertenecen a 'forms', déjalos. Si son de otra sección (ej. 'cards' o 'ui/components'),
|
|
13
|
-
// deberían estar en sus propios archivos index.js dentro de esas secciones.
|
|
14
|
-
export { default as Paginate } from "./Paginate.js";
|
|
15
|
-
export { default as PhotoCard } from "./PhotoCard.js";
|
|
16
|
-
export { default as PlayerYoutube } from "./PlayerYoutube.js";
|
|
17
11
|
//# sourceMappingURL=index.js.map
|
package/dist/forms/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAEhD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAEhD,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC,CAAC,yEAAyE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHttpState.d.ts","sourceRoot":"","sources":["../../src/hooks/useHttpState.ts"],"names":[],"mappings":"AAGA,UAAU,qBAAqB;IAC9B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrD,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACxC,OAAO,CAAC,EAAE;QACT,aAAa,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACjD;AAED,UAAU,cAAe,SAAQ,qBAAqB;IACrD,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACvB;AAID,UAAU,mBAAmB;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAED,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"useHttpState.d.ts","sourceRoot":"","sources":["../../src/hooks/useHttpState.ts"],"names":[],"mappings":"AAGA,UAAU,qBAAqB;IAC9B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrD,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACxC,OAAO,CAAC,EAAE;QACT,aAAa,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACjD;AAED,UAAU,cAAe,SAAQ,qBAAqB;IACrD,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACvB;AAID,UAAU,mBAAmB;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAED,QAAA,MAAM,YAAY,GAAI,UAAU,mBAAmB;;gBAyFrC,MAAM,GAAG,MAAM,EAAE,WAAW,qBAAqB;iBAChD,MAAM,GAAG,MAAM,EAAE,WAAW,qBAAqB;qBAC7C,MAAM,GAAG,MAAM,EAAE,WAAW,qBAAqB;eACvD,MAAM,GAAG,MAAM,EAAE,WAAW,qBAAqB;gBAChD,MAAM,GAAG,MAAM,EAAE,WAAW,cAAc;CAEvD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -2,8 +2,8 @@ export default function useRouter(): {
|
|
|
2
2
|
pathname: string;
|
|
3
3
|
query: any;
|
|
4
4
|
params: Readonly<import("react-router-dom").Params<string>>;
|
|
5
|
-
setSearchParams: import("react-router").SetURLSearchParams;
|
|
6
|
-
push: import("react-router").NavigateFunction;
|
|
5
|
+
setSearchParams: import("react-router-dom").SetURLSearchParams;
|
|
6
|
+
push: import("react-router-dom").NavigateFunction;
|
|
7
7
|
refresh: () => void;
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=useRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/icons/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/icons/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,cAAc,2BAA2B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { toast, ToastContainer } from "react-toastify";
|
|
2
|
-
export { toast, ToastContainer };
|
|
3
2
|
import "react-toastify/dist/ReactToastify.css";
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export * from "./buttons/index.js";
|
|
7
|
-
export * from "./cards/index.js";
|
|
8
|
-
export * from "./reducers/index.js";
|
|
9
|
-
export * from "./hooks/index.js";
|
|
3
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
4
|
+
export { toast, ToastContainer, uuidv4 };
|
|
10
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { toast, ToastContainer } from "react-toastify";
|
|
2
|
-
export { toast, ToastContainer };
|
|
3
2
|
import "react-toastify/dist/ReactToastify.css";
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export * from "./forms/index.js";
|
|
7
|
-
export * from "./buttons/index.js";
|
|
8
|
-
export * from "./cards/index.js";
|
|
9
|
-
export * from "./reducers/index.js";
|
|
10
|
-
export * from "./hooks/index.js";
|
|
11
|
-
//export { default as Checkbox } from "./forms/Checkbox.js";
|
|
12
|
-
//export { default as Button } from "./buttons/Button.js";
|
|
13
|
-
//export * as IconsOutline from '@heroicons/react/24/outline';
|
|
14
|
-
//export * from "./components";
|
|
3
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
4
|
+
export { toast, ToastContainer, uuidv4 };
|
|
15
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reducers/index.ts"],"names":[],"mappings":"AAAA,UAAU,kBAAkB,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,eAAO,MAAM,OAAO,GAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reducers/index.ts"],"names":[],"mappings":"AAAA,UAAU,kBAAkB,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,kBAAkB,CAAC,CAAC,CAAC,KAAG,CAMlE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../src/stories/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,YAAY,CAAC;AAMpB,MAAM,CAAC,MAAM,IAAI,GAAa,GAAG,EAAE;IACjC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAQ,CAAC;IAE/C,OAAO,CACL;QACE,oBAAC,MAAM,IACL,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAC5C,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,EAClC,eAAe,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,GACpD;QAEF,iCAAS,SAAS,EAAC,gBAAgB;YACjC,qDAA2B;YAC3B;;gBACmC,GAAG;gBACpC,2BAAG,IAAI,EAAC,6BAA6B,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB;oBAC7E,uDAAiC,CAC/B;gBAAC,GAAG;iFAEN;YACJ,oOAII;YACJ;gBACE,6JAGK;gBACL,2IAGK,CACF;YACL;;gBAC2D,GAAG;gBAC5D,2BAAG,IAAI,EAAC,qCAAqC,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,0BAEnF;;gBACe,GAAG;gBACtB,2BAAG,IAAI,EAAC,+BAA+B,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,WAE7E;oBAEF;YACJ,6BAAK,SAAS,EAAC,aAAa;gBAC1B,8BAAM,SAAS,EAAC,KAAK,UAAW;;gBAAyC,GAAG;gBAC5E,6BAAK,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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoriesArguments.d.ts","sourceRoot":"","sources":["../../src/types/StoriesArguments.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,GAAG,CAqC5C,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,GAAG,CAOtC,CAAA;AAID,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,GAAG,CAMxC,CAAA"}
|