@royaltics/ui 1.0.4 → 1.0.6
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 +131 -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/GenericCard.d.ts +12 -0
- package/dist/components/GenericCard.d.ts.map +1 -0
- package/dist/components/GenericCard.js +19 -0
- package/dist/components/GenericCard.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 +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +3 -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/Checkbox.d.ts +13 -10
- package/dist/forms/Checkbox.d.ts.map +1 -1
- package/dist/forms/Checkbox.js +29 -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/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 -13
- 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.map +1 -1
- package/dist/forms/ToggleSwitch.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/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 -74
|
@@ -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
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
+
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"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export const ArgumentsComponents = {
|
|
2
|
+
size: {
|
|
3
|
+
control: { type: 'select' },
|
|
4
|
+
options: ['xs', 'sm', 'md', 'lg'],
|
|
5
|
+
description: 'Size Padding Component',
|
|
6
|
+
},
|
|
7
|
+
theme: {
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
options: ['primary', 'secondary', 'accent', 'success', 'warn', 'danger'],
|
|
10
|
+
description: 'Theme Colors Banckground and Foreground for Components',
|
|
11
|
+
},
|
|
12
|
+
type: {
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: ["text", 'time', "date", "number", "decimal", 'email', 'password', 'month', 'datetime-local',],
|
|
15
|
+
description: 'Theme Colors Banckground and Foreground for Components',
|
|
16
|
+
},
|
|
17
|
+
variant: {
|
|
18
|
+
control: { type: 'select' },
|
|
19
|
+
options: ['fill', 'outline'],
|
|
20
|
+
description: 'Style theme border and background components',
|
|
21
|
+
},
|
|
22
|
+
tabIndex: {
|
|
23
|
+
control: 'number',
|
|
24
|
+
description: 'Style theme border and background components',
|
|
25
|
+
},
|
|
26
|
+
width: {
|
|
27
|
+
control: { type: 'select' },
|
|
28
|
+
options: ['full', 'max'],
|
|
29
|
+
description: 'Style Width and Height COmponent',
|
|
30
|
+
},
|
|
31
|
+
loading: { control: 'boolean', description: 'Loading el botón' },
|
|
32
|
+
disabled: { control: 'boolean', description: 'Deshabilita el botón' },
|
|
33
|
+
readOnly: {
|
|
34
|
+
control: 'boolean',
|
|
35
|
+
description: 'No editable input',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export const ArgumentsBase = {
|
|
39
|
+
size: ArgumentsComponents.size,
|
|
40
|
+
theme: ArgumentsComponents.theme,
|
|
41
|
+
variant: ArgumentsComponents.variant,
|
|
42
|
+
width: ArgumentsComponents.width,
|
|
43
|
+
tabIndex: ArgumentsComponents.tabIndex,
|
|
44
|
+
};
|
|
45
|
+
export const ArgumentsInputs = {
|
|
46
|
+
size: ArgumentsComponents.size,
|
|
47
|
+
variant: ArgumentsComponents.variant,
|
|
48
|
+
width: ArgumentsComponents.width,
|
|
49
|
+
tabIndex: ArgumentsComponents.tabIndex,
|
|
50
|
+
readOnly: ArgumentsComponents.readOnly,
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=StoriesArguments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoriesArguments.js","sourceRoot":"","sources":["../../src/types/StoriesArguments.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC7C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Aa,GAAiB;IACvC,IAAI,EAAE,mBAAmB,CAAC,IAAI;IAC9B,KAAK,EAAE,mBAAmB,CAAC,KAAK;IAChC,OAAO,EAAE,mBAAmB,CAAC,OAAO;IACpC,KAAK,EAAE,mBAAmB,CAAC,KAAK;IAChC,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;CAEzC,CAAA;AAID,MAAM,CAAC,MAAM,eAAe,GAAiB;IACzC,IAAI,EAAE,mBAAmB,CAAC,IAAI;IAC9B,OAAO,EAAE,mBAAmB,CAAC,OAAO;IACpC,KAAK,EAAE,mBAAmB,CAAC,KAAK;IAChC,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;IACtC,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;CACzC,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HtmlHTMLAttributes, LegacyRef } from "react";
|
|
2
|
+
export type SizeComponent = 'xs' | 'sm' | 'md' | 'lg';
|
|
3
|
+
export type ThemeComponent = 'primary' | 'secondary' | 'accent' | 'success' | 'warn' | 'danger';
|
|
4
|
+
export type VariantComponent = 'fill' | 'outline';
|
|
5
|
+
export interface ComponentBase {
|
|
6
|
+
theme?: ThemeComponent;
|
|
7
|
+
variant?: VariantComponent;
|
|
8
|
+
size?: SizeComponent;
|
|
9
|
+
width?: 'full' | 'max';
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: HtmlHTMLAttributes<HTMLDivElement>["style"];
|
|
12
|
+
tabIndex?: number;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ComponentInputBase {
|
|
16
|
+
id: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
referer?: LegacyRef<any>;
|
|
19
|
+
lb?: string;
|
|
20
|
+
variant?: VariantComponent;
|
|
21
|
+
size?: SizeComponent;
|
|
22
|
+
width?: 'full' | 'max';
|
|
23
|
+
className?: string;
|
|
24
|
+
style?: HtmlHTMLAttributes<HTMLDivElement>["style"];
|
|
25
|
+
tabIndex?: number;
|
|
26
|
+
readOnly?: boolean;
|
|
27
|
+
required?: boolean;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
error?: boolean;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=global.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/types/global.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAChG,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAAC;AAGlD,MAAM,WAAW,aAAa;IAC1B,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAGD,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/types/global.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { default as cn } from 'classnames';
|
|
2
|
+
type BaseVariantConfig = Record<string, string>;
|
|
3
|
+
type NestedVariantLevel = {
|
|
4
|
+
__base?: string;
|
|
5
|
+
[key: string]: string | Record<string, string> | undefined;
|
|
6
|
+
};
|
|
7
|
+
type NestedVariantConfig = {
|
|
8
|
+
__key: string;
|
|
9
|
+
__base?: string;
|
|
10
|
+
[key: string]: NestedVariantLevel | string | undefined;
|
|
11
|
+
};
|
|
12
|
+
type CvaMixConfig<T extends Record<string, any>> = {
|
|
13
|
+
[K in keyof T]?: BaseVariantConfig | NestedVariantConfig;
|
|
14
|
+
};
|
|
15
|
+
type DefaultProps<T extends Record<string, any>> = {
|
|
16
|
+
[K in keyof T]?: string;
|
|
17
|
+
} & {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function cvaMix<T extends Record<string, any>>(baseClasses: string, config: CvaMixConfig<T>, defaultOptions?: DefaultProps<T>): (mainProps: { [K in keyof T]?: string; }, keyProps?: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
}) => string;
|
|
23
|
+
//# sourceMappingURL=cvmix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cvmix.d.ts","sourceRoot":"","sources":["../../src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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import clsx from 'clsx'; // Asegúrate de tener clsx instalado: npm install clsx
|
|
2
|
+
export { default as cn } from 'classnames';
|
|
3
|
+
export function cvaMix(baseClasses, config, defaultOptions = {}) {
|
|
4
|
+
// La función principal que se retorna para aplicar las variantes
|
|
5
|
+
return (mainProps, keyProps = {}) => {
|
|
6
|
+
let classes = [baseClasses];
|
|
7
|
+
// Iterar sobre las propiedades principales para aplicar las variantes
|
|
8
|
+
for (const propKey in config) {
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(config, propKey)) {
|
|
10
|
+
const variantConfig = config[propKey];
|
|
11
|
+
const propValue = mainProps[propKey] || defaultOptions[propKey]; // Valor actual de la prop o valor por defecto
|
|
12
|
+
if (typeof variantConfig === 'object' && !('__key' in variantConfig)) {
|
|
13
|
+
// Es una variante base (ej., 'size')
|
|
14
|
+
if (propValue && variantConfig[propValue]) {
|
|
15
|
+
classes.push(variantConfig[propValue]);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else if (typeof variantConfig === 'object' && '__key' in variantConfig) {
|
|
19
|
+
// Es una variante anidada (ej., 'variant')
|
|
20
|
+
const nestedConfig = variantConfig;
|
|
21
|
+
const nestedPropKey = nestedConfig.__key; // Ej., 'theme'
|
|
22
|
+
// Aplicar la base de la variante principal si existe
|
|
23
|
+
if (nestedConfig.__base) {
|
|
24
|
+
classes.push(nestedConfig.__base);
|
|
25
|
+
}
|
|
26
|
+
// Verificar si el valor de la prop principal coincide con una de las variantes anidadas (ej., 'filled', 'outline')
|
|
27
|
+
if (propValue && typeof nestedConfig[propValue] === 'object') {
|
|
28
|
+
const currentNestedLevel = nestedConfig[propValue];
|
|
29
|
+
const nestedPropValue = keyProps[nestedPropKey] || defaultOptions[nestedPropKey];
|
|
30
|
+
// Aplicar la base del nivel anidado (ej., '__base' de 'filled' o 'outline')
|
|
31
|
+
if (currentNestedLevel.__base) {
|
|
32
|
+
classes.push(currentNestedLevel.__base);
|
|
33
|
+
}
|
|
34
|
+
// Aplicar la clase específica del nivel más profundo (ej., 'primary' de 'filled')
|
|
35
|
+
if (nestedPropValue && currentNestedLevel[nestedPropValue]) {
|
|
36
|
+
classes.push(currentNestedLevel[nestedPropValue]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Retorna la cadena de clases combinada por clsx
|
|
43
|
+
return clsx(...classes);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=cvmix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cvmix.js","sourceRoot":"","sources":["../../src/utils/cvmix.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC,CAAC,sDAAsD;AAC/E,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AA4B3C,MAAM,UAAU,MAAM,CAClB,WAAmB,EACnB,MAAuB,EACvB,iBAAkC,EAAE;IAEpC,iEAAiE;IACjE,OAAO,CACH,SAAsC,EACtC,WAAsC,EAAE,EAClC,EAAE;QACR,IAAI,OAAO,GAA2B,CAAC,WAAW,CAAC,CAAC;QAEpD,sEAAsE;QACtE,KAAK,MAAM,OAAO,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;gBACxD,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;gBACtC,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,8CAA8C;gBAE/G,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,IAAI,aAAa,CAAC,EAAE,CAAC;oBACnE,qCAAqC;oBACrC,IAAI,SAAS,IAAK,aAAmC,CAAC,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AGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,GAAI,MAAM,GAAG,EAAE,YAAW,MAAU,YAGvD,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,OAEzC,CAAA;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,OAEjC;AAED,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,KAAG,OAItC,CAAC;AAGF,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,YAIlD,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,KAAG,OAGvC,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,KAAG,OAGrC,CAAA;AAGD,KAAK,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,EAAE,GAAG,OAAO,MAAM,EAAE,GAAG,OAAO,MAAM,EAAE,CAAC;AACtI,KAAK,KAAK,GAAG;IACT,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,OAAO,GAAG,MAAM,CAAA;KAAE,CAAA;CACnH,CAAA;AAOD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,GAAG,EAAE,aAAa,KAAK,EAAE,QAAQ,GAAG,KAAG,OAyF1E,CAAA"}
|