quix-ui 1.2.1 → 1.2.2
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/Provider/FormContext.d.ts +2 -0
- package/dist/Provider/QuixProvider.d.ts +5 -0
- package/dist/Provider/form.types.d.ts +13 -0
- package/dist/Provider/hooks/FormHook/UseForm.d.ts +6 -0
- package/dist/Provider/hooks/FormHook/useFormContext.d.ts +1 -0
- package/dist/Provider/types.d.ts +25 -0
- package/dist/components/Buttons/Buttons.stories.d.ts +3 -0
- package/dist/components/Buttons/types.d.ts +2 -0
- package/dist/components/forms/Forms.d.ts +8 -0
- package/dist/components/forms/Items.d.ts +11 -0
- package/dist/components/forms/index.d.ts +2 -0
- package/dist/components/forms/store/form.store.d.ts +12 -0
- package/dist/components/forms/utils.d.ts +2 -0
- package/dist/components/layout/Layout.d.ts +8 -0
- package/dist/components/layout/Layout.stories.d.ts +24 -0
- package/dist/components/layout/types.d.ts +40 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2131 -10
- package/dist/view/FlexView.d.ts +3 -0
- package/dist/view/Layout.stories.d.ts +31 -12
- package/dist/view/types.d.ts +18 -7
- package/package.json +4 -3
- package/dist/view/ViewContainer.d.ts +0 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FormContextType, ProviderContextType, ThemeContextType } from "./types";
|
|
2
|
+
export declare const ThemeContext: import("react").Context<ThemeContextType | undefined>;
|
|
3
|
+
export declare const QuixProvider: import("react").Context<ProviderContextType | undefined>;
|
|
4
|
+
export declare const FormProvider: import("react").Context<FormContextType | undefined>;
|
|
5
|
+
export declare function useForm(): FormContextType | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type FormValues = Record<string, unknown>;
|
|
3
|
+
export interface FormContextType {
|
|
4
|
+
values: FormValues;
|
|
5
|
+
setFieldValue: (name: string, value: unknown) => void;
|
|
6
|
+
registerField: (name: string) => void;
|
|
7
|
+
submit: () => void;
|
|
8
|
+
resetFields: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface FieldProps {
|
|
11
|
+
value?: unknown;
|
|
12
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useFormContext(): import("../../../components/forms/store/form.store").FormStore;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export type ThemeProps = "light" | "dark";
|
|
3
|
+
export interface ThemeContextType {
|
|
4
|
+
theme: ThemeProps;
|
|
5
|
+
toggleTheme: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface FormDataProps {
|
|
8
|
+
[key: string]: never;
|
|
9
|
+
}
|
|
10
|
+
export interface ProviderContextType {
|
|
11
|
+
formData: {
|
|
12
|
+
[key: string]: never;
|
|
13
|
+
};
|
|
14
|
+
setFormData: React.Dispatch<FormDataProps>;
|
|
15
|
+
}
|
|
16
|
+
export interface FormContextType {
|
|
17
|
+
formData: {
|
|
18
|
+
[key: string]: never;
|
|
19
|
+
};
|
|
20
|
+
setFormData: React.Dispatch<FormDataProps>;
|
|
21
|
+
resetFormdata: () => void;
|
|
22
|
+
}
|
|
23
|
+
export interface ProviderProps {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export interface ButtonsProps {
|
|
2
3
|
onClick: () => void;
|
|
3
4
|
width?: number;
|
|
@@ -13,5 +14,6 @@ export interface ButtonsProps {
|
|
|
13
14
|
bottomLeft?: number;
|
|
14
15
|
bottomRight?: number;
|
|
15
16
|
} | number;
|
|
17
|
+
style?: React.CSSProperties;
|
|
16
18
|
className?: string;
|
|
17
19
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
initialValues?: any;
|
|
4
|
+
onFinish?: (values: any) => void;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export default function Form({ initialValues, onFinish, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { FieldProps } from "../../Provider/form.types";
|
|
3
|
+
interface Props {
|
|
4
|
+
name?: string;
|
|
5
|
+
valuePropName?: string;
|
|
6
|
+
getValueFromEvent?: (e: any) => any;
|
|
7
|
+
shouldUpdate?: boolean | ((prev: any, next: any) => boolean);
|
|
8
|
+
children: ReactElement<FieldProps> | ((ctx: any) => ReactElement<FieldProps>);
|
|
9
|
+
}
|
|
10
|
+
export default function FormItem({ name, valuePropName, getValueFromEvent, shouldUpdate, children, }: Props): ReactElement<FieldProps, string | import("react").JSXElementConstructor<any>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Listener = () => void;
|
|
2
|
+
export declare class FormStore {
|
|
3
|
+
private values;
|
|
4
|
+
private listeners;
|
|
5
|
+
constructor(initialValues: any);
|
|
6
|
+
getValues(): any;
|
|
7
|
+
getValue(name: string): any;
|
|
8
|
+
setValue(name: string, value: any): void;
|
|
9
|
+
subscribe(name: string, fn: Listener): false | (() => boolean);
|
|
10
|
+
private notify;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LayoutProps, menuItemsDynamicStyleProps, menuItemsProps, sideMenuProps } from "./types";
|
|
2
|
+
import './layout.style.css';
|
|
3
|
+
export declare function Layout(props: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function SideMenu(props: sideMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function MenuItem(item: menuItemsProps, ElementType?: "NavLink" | "Link" | "a" | "div", menuItemsDynamicStyle?: menuItemsDynamicStyleProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function Header(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function Content(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function Footer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Layout } from "./Layout";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Layout;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
backgroundColor: {
|
|
12
|
+
control: "color";
|
|
13
|
+
};
|
|
14
|
+
style: {
|
|
15
|
+
control: "text";
|
|
16
|
+
};
|
|
17
|
+
className: {
|
|
18
|
+
control: "text";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
export declare const Layout1: Story;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { JSX } from "react";
|
|
2
|
+
export interface LayoutProps {
|
|
3
|
+
backgroundColor?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
sideMenu?: sideMenuProps;
|
|
7
|
+
ElementStyle?: React.CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
export interface menuItemsProps {
|
|
10
|
+
label: string;
|
|
11
|
+
route: string;
|
|
12
|
+
backgroundColor?: string;
|
|
13
|
+
textColor?: string;
|
|
14
|
+
activeColor?: {
|
|
15
|
+
background: string;
|
|
16
|
+
text: string;
|
|
17
|
+
};
|
|
18
|
+
icon?: {
|
|
19
|
+
position: 'left' | 'right';
|
|
20
|
+
component: JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface sideMenuProps {
|
|
24
|
+
width: number | string;
|
|
25
|
+
height: number | string;
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
menuItems: menuItemsProps[];
|
|
28
|
+
ElementType?: "NavLink" | "Link" | "a" | "div";
|
|
29
|
+
ElementStyle?: React.CSSProperties;
|
|
30
|
+
menuItemsDynamicStyle?: menuItemsDynamicStyleProps;
|
|
31
|
+
top: number;
|
|
32
|
+
}
|
|
33
|
+
export interface menuItemsDynamicStyleProps {
|
|
34
|
+
backgroundColor: string;
|
|
35
|
+
textColor: string;
|
|
36
|
+
activeColor: {
|
|
37
|
+
background: string;
|
|
38
|
+
text: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as FlexView } from './view/FlexView';
|
|
2
2
|
export { default as Buttons } from './components/Buttons/Buttons';
|