@julien-wiegandt/open-ui 0.1.0 → 0.1.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/app.d.ts +1 -1
- package/dist/components/button/index.d.ts +31 -3
- package/dist/components/button/style.d.ts +7 -0
- package/dist/components/chip/index.d.ts +30 -0
- package/dist/components/chip/style.d.ts +5 -0
- package/dist/components/common/index.d.ts +5 -0
- package/dist/components/common/types.d.ts +18 -0
- package/dist/components/divider/index.d.ts +6 -0
- package/dist/components/flex/index.d.ts +32 -0
- package/dist/components/flex/style.d.ts +2 -0
- package/dist/components/image/index.d.ts +12 -0
- package/dist/components/image/style.d.ts +7 -0
- package/dist/components/modal/index.d.ts +14 -0
- package/dist/components/number-select/index.d.ts +9 -0
- package/dist/components/progress-bar/index.d.ts +7 -0
- package/dist/components/select/index.d.ts +12 -0
- package/dist/components/text/index.d.ts +15 -0
- package/dist/components/text/styled.d.ts +13 -0
- package/dist/components/textarea/index.d.ts +11 -0
- package/dist/components/textarea/styled.d.ts +2 -0
- package/dist/components/textfield/index.d.ts +15 -0
- package/dist/components/textfield/styled.d.ts +2 -0
- package/dist/components/title/index.d.ts +6 -0
- package/dist/components/title/style.d.ts +7 -0
- package/dist/components/utils/get-color-variations.d.ts +11 -0
- package/dist/components/utils/get-text-color-based-on-background.d.ts +2 -0
- package/dist/hooks/use-responsive.d.ts +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/open-ui.js +1554 -178
- package/dist/open-ui.umd.cjs +110 -4
- package/dist/theme/constants.d.ts +3 -0
- package/dist/theme/types.d.ts +18 -0
- package/dist/theme/use-theme.d.ts +15 -0
- package/dist/views/components/buttons/index.d.ts +1 -0
- package/dist/views/components/chips/index.d.ts +1 -0
- package/dist/views/components/flexs/index.d.ts +1 -0
- package/dist/views/components/progress-bars/index.d.ts +1 -0
- package/dist/views/components/textareas/index.d.ts +1 -0
- package/dist/views/components/textfields/index.d.ts +1 -0
- package/dist/views/components/texts/index.d.ts +1 -0
- package/dist/views/components/theme/index.d.ts +1 -0
- package/dist/views/components/titles/index.d.ts +1 -0
- package/package.json +5 -2
package/dist/app.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const App: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default App;
|
|
@@ -1,4 +1,32 @@
|
|
|
1
|
+
import { Color } from '../../theme/types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { MarginProps, PaddingProps } from '../common/types';
|
|
4
|
+
export type ButtonStyleProps = {
|
|
5
|
+
color: Color;
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
|
+
bgcolor?: string;
|
|
8
|
+
bRadius?: string;
|
|
9
|
+
gap?: string | number;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
variant: "contained" | "outlined" | "text";
|
|
12
|
+
txtColor?: string;
|
|
13
|
+
} & MarginProps & PaddingProps & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
1
14
|
export type ButtonProps = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
15
|
+
label?: string;
|
|
16
|
+
startIcon?: React.ReactNode;
|
|
17
|
+
endIcon?: React.ReactNode;
|
|
18
|
+
} & ButtonStyleProps;
|
|
19
|
+
export declare const Button: React.ForwardRefExoticComponent<{
|
|
20
|
+
label?: string;
|
|
21
|
+
startIcon?: React.ReactNode;
|
|
22
|
+
endIcon?: React.ReactNode;
|
|
23
|
+
} & {
|
|
24
|
+
color: Color;
|
|
25
|
+
size?: "sm" | "md" | "lg";
|
|
26
|
+
bgcolor?: string;
|
|
27
|
+
bRadius?: string;
|
|
28
|
+
gap?: string | number;
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
variant: "contained" | "outlined" | "text";
|
|
31
|
+
txtColor?: string;
|
|
32
|
+
} & MarginProps & PaddingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ButtonStyleProps } from '.';
|
|
2
|
+
import { TextProps } from '../text';
|
|
3
|
+
export declare const sizeMap: Record<NonNullable<ButtonStyleProps["size"]>, {
|
|
4
|
+
padding: string;
|
|
5
|
+
fontSize: TextProps["size"];
|
|
6
|
+
}>;
|
|
7
|
+
export declare const StyledButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ButtonStyleProps>> & string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Color } from '../../theme/types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { MarginProps, PaddingProps } from '../common/types';
|
|
4
|
+
export type ChipStyleProps = {
|
|
5
|
+
color: Color;
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
|
+
bgcolor?: string;
|
|
8
|
+
bRadius?: string;
|
|
9
|
+
gap?: string | number;
|
|
10
|
+
variant: "contained" | "outlined" | "text";
|
|
11
|
+
fontColor?: string;
|
|
12
|
+
} & MarginProps & PaddingProps & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
13
|
+
export type ChipProps = {
|
|
14
|
+
label?: string;
|
|
15
|
+
startIcon?: React.ReactNode;
|
|
16
|
+
endIcon?: React.ReactNode;
|
|
17
|
+
} & ChipStyleProps;
|
|
18
|
+
export declare const Chip: React.ForwardRefExoticComponent<{
|
|
19
|
+
label?: string;
|
|
20
|
+
startIcon?: React.ReactNode;
|
|
21
|
+
endIcon?: React.ReactNode;
|
|
22
|
+
} & {
|
|
23
|
+
color: Color;
|
|
24
|
+
size?: "sm" | "md" | "lg";
|
|
25
|
+
bgcolor?: string;
|
|
26
|
+
bRadius?: string;
|
|
27
|
+
gap?: string | number;
|
|
28
|
+
variant: "contained" | "outlined" | "text";
|
|
29
|
+
fontColor?: string;
|
|
30
|
+
} & MarginProps & PaddingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ChipStyleProps } from '.';
|
|
2
|
+
export declare const sizeMap: Record<NonNullable<ChipStyleProps["size"]>, {
|
|
3
|
+
padding: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const StyledChip: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ChipStyleProps>> & string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MarginProps, PaddingProps } from './types';
|
|
2
|
+
export declare const toRem: (value: number | string) => string;
|
|
3
|
+
export declare const getMarginsCSS: (props: MarginProps) => string;
|
|
4
|
+
export declare const getPaddingCSS: (props: PaddingProps) => string;
|
|
5
|
+
export declare const getScrollbarCSS: () => string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type MarginProps = {
|
|
2
|
+
m?: string | number;
|
|
3
|
+
mt?: string | number;
|
|
4
|
+
mr?: string | number;
|
|
5
|
+
mb?: string | number;
|
|
6
|
+
ml?: string | number;
|
|
7
|
+
mx?: string | number;
|
|
8
|
+
my?: string | number;
|
|
9
|
+
};
|
|
10
|
+
export type PaddingProps = {
|
|
11
|
+
p?: string | number;
|
|
12
|
+
pt?: string | number;
|
|
13
|
+
pr?: string | number;
|
|
14
|
+
pb?: string | number;
|
|
15
|
+
pl?: string | number;
|
|
16
|
+
px?: string | number;
|
|
17
|
+
py?: string | number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type DividerProps = {
|
|
2
|
+
horizontal?: boolean;
|
|
3
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
4
|
+
export declare const Divider: import('react').ForwardRefExoticComponent<{
|
|
5
|
+
horizontal?: boolean;
|
|
6
|
+
} & import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Styles } from 'styled-components/dist/types';
|
|
2
|
+
import { MarginProps, PaddingProps } from '../common/types';
|
|
3
|
+
export type FlexDirection = "row" | "column";
|
|
4
|
+
export type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
5
|
+
export type FlexJustify = "center" | "start" | "end" | "between" | "around" | "evenly";
|
|
6
|
+
export type FlexAlign = "normal" | "center" | "start" | "end" | "stretch";
|
|
7
|
+
export type FlexProps = {
|
|
8
|
+
elevation?: 0 | 1 | 2 | 3 | 4 | 6 | 8;
|
|
9
|
+
direction?: FlexDirection;
|
|
10
|
+
gap?: string | number;
|
|
11
|
+
align?: FlexAlign;
|
|
12
|
+
justify?: FlexJustify;
|
|
13
|
+
wrap?: FlexWrap;
|
|
14
|
+
width?: string;
|
|
15
|
+
height?: string;
|
|
16
|
+
minWidth?: string;
|
|
17
|
+
minheight?: string;
|
|
18
|
+
hoverstyle?: Styles<object>;
|
|
19
|
+
} & MarginProps & PaddingProps & React.HTMLAttributes<HTMLDivElement>;
|
|
20
|
+
export declare const Flex: import('react').ForwardRefExoticComponent<{
|
|
21
|
+
elevation?: 0 | 1 | 2 | 3 | 4 | 6 | 8;
|
|
22
|
+
direction?: FlexDirection;
|
|
23
|
+
gap?: string | number;
|
|
24
|
+
align?: FlexAlign;
|
|
25
|
+
justify?: FlexJustify;
|
|
26
|
+
wrap?: FlexWrap;
|
|
27
|
+
width?: string;
|
|
28
|
+
height?: string;
|
|
29
|
+
minWidth?: string;
|
|
30
|
+
minheight?: string;
|
|
31
|
+
hoverstyle?: Styles<object>;
|
|
32
|
+
} & MarginProps & PaddingProps & import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { FlexProps } from '.';
|
|
2
|
+
export declare const SlyledFlex: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, FlexProps>> & string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Styles } from 'styled-components/dist/types';
|
|
3
|
+
export type ImageProps = {
|
|
4
|
+
hoverstyle?: Styles<object>;
|
|
5
|
+
pressstyle?: Styles<object>;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
} & React.ImgHTMLAttributes<HTMLImageElement>;
|
|
8
|
+
export declare const Image: React.ForwardRefExoticComponent<{
|
|
9
|
+
hoverstyle?: Styles<object>;
|
|
10
|
+
pressstyle?: Styles<object>;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
} & React.ImgHTMLAttributes<HTMLImageElement> & React.RefAttributes<HTMLImageElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const StyledImage: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {
|
|
2
|
+
hoverstyle?: import('styled-components/dist/types').Styles<object>;
|
|
3
|
+
pressstyle?: import('styled-components/dist/types').Styles<object>;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
} & import('react').ImgHTMLAttributes<HTMLImageElement> & {
|
|
6
|
+
initstyle?: React.CSSProperties;
|
|
7
|
+
}>> & string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ModalProps = {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
fullScreen?: boolean;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
7
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
8
|
+
export declare const Modal: import('react').ForwardRefExoticComponent<{
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
fullScreen?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
14
|
+
} & import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type SelectOption = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
export type SelectProps = {
|
|
7
|
+
options: Array<SelectOption>;
|
|
8
|
+
initialValue?: SelectOption;
|
|
9
|
+
onChange?: (value: SelectOption) => void;
|
|
10
|
+
label?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const Select: React.FC<SelectProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MarginProps, PaddingProps } from '../common/types';
|
|
2
|
+
export type TextProps = {
|
|
3
|
+
weight?: "regular" | "medium" | "semibold" | "bold";
|
|
4
|
+
size?: "8" | "10" | "12" | "14" | "15" | "16" | "18" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96";
|
|
5
|
+
width?: string;
|
|
6
|
+
height?: string;
|
|
7
|
+
align?: "left" | "center" | "right";
|
|
8
|
+
} & MarginProps & PaddingProps & React.HTMLAttributes<HTMLParagraphElement>;
|
|
9
|
+
export declare const Text: import('react').ForwardRefExoticComponent<{
|
|
10
|
+
weight?: "regular" | "medium" | "semibold" | "bold";
|
|
11
|
+
size?: "8" | "10" | "12" | "14" | "15" | "16" | "18" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96";
|
|
12
|
+
width?: string;
|
|
13
|
+
height?: string;
|
|
14
|
+
align?: "left" | "center" | "right";
|
|
15
|
+
} & MarginProps & PaddingProps & import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Breakpoint } from '../../hooks/use-responsive';
|
|
2
|
+
import { TextProps } from '.';
|
|
3
|
+
export declare const getFontSize: (size: TextProps["size"], breakpoint: Breakpoint) => string;
|
|
4
|
+
export declare const getFontWeight: (weight: TextProps["weight"]) => "400" | "500" | "600" | "700";
|
|
5
|
+
export declare const StyledText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {
|
|
6
|
+
weight?: "regular" | "medium" | "semibold" | "bold";
|
|
7
|
+
size?: "8" | "10" | "12" | "14" | "15" | "16" | "18" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96";
|
|
8
|
+
width?: string;
|
|
9
|
+
height?: string;
|
|
10
|
+
align?: "left" | "center" | "right";
|
|
11
|
+
} & import('../common/types').MarginProps & import('../common/types').PaddingProps & import('react').HTMLAttributes<HTMLParagraphElement> & {
|
|
12
|
+
breakpoint: Breakpoint;
|
|
13
|
+
}>> & string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MarginProps, PaddingProps } from '../common/types';
|
|
2
|
+
export type TextAreaProps = {
|
|
3
|
+
error?: string;
|
|
4
|
+
w?: string;
|
|
5
|
+
h?: string;
|
|
6
|
+
} & MarginProps & PaddingProps & React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
7
|
+
export declare const TextArea: import('react').ForwardRefExoticComponent<{
|
|
8
|
+
error?: string;
|
|
9
|
+
w?: string;
|
|
10
|
+
h?: string;
|
|
11
|
+
} & MarginProps & PaddingProps & import('react').TextareaHTMLAttributes<HTMLTextAreaElement> & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { TextAreaProps } from '.';
|
|
2
|
+
export declare const StyledTextArea: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, TextAreaProps>> & string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MarginProps, PaddingProps } from '../common/types';
|
|
2
|
+
export type TextFieldProps = {
|
|
3
|
+
error?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
w?: string;
|
|
7
|
+
h?: string;
|
|
8
|
+
} & MarginProps & PaddingProps & React.InputHTMLAttributes<HTMLInputElement>;
|
|
9
|
+
export declare const TextField: import('react').ForwardRefExoticComponent<{
|
|
10
|
+
error?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
w?: string;
|
|
14
|
+
h?: string;
|
|
15
|
+
} & MarginProps & PaddingProps & import('react').InputHTMLAttributes<HTMLInputElement> & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { TextFieldProps } from '.';
|
|
2
|
+
export declare const StyledTextField: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, TextFieldProps>> & string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MarginProps, PaddingProps } from '../common/types';
|
|
2
|
+
export type TitleProps = {
|
|
3
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
weight?: "regular" | "medium" | "semibold" | "bold";
|
|
5
|
+
} & MarginProps & PaddingProps & React.HTMLAttributes<HTMLHeadingElement>;
|
|
6
|
+
export declare const Title: ({ children, ...props }: TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Breakpoint } from '../../hooks/use-responsive';
|
|
2
|
+
export declare const StyledTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {
|
|
3
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
weight?: "regular" | "medium" | "semibold" | "bold";
|
|
5
|
+
} & import('../common/types').MarginProps & import('../common/types').PaddingProps & import('react').HTMLAttributes<HTMLHeadingElement> & {
|
|
6
|
+
breakpoint: Breakpoint;
|
|
7
|
+
}>> & string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates light and dark variations of a given hex color.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} hex - The base hex color (e.g., "#3498db").
|
|
5
|
+
* @param {number} percentage - The percentage (0 to 1) to lighten or darken by. Defaults to 0.2 (20%).
|
|
6
|
+
* @returns {{light: string, dark: string}} An object with the light and dark hex color strings.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getColorVariations: (hex: string, percentage?: number) => {
|
|
9
|
+
light: string;
|
|
10
|
+
dark: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Breakpoint = "sm" | "md" | "lg" | "xl";
|
|
2
|
+
export declare const breakpoints: {
|
|
3
|
+
[key in Breakpoint]: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const useResponsive: () => {
|
|
6
|
+
width: number | undefined;
|
|
7
|
+
breakpoint: Breakpoint;
|
|
8
|
+
isMobile: boolean;
|
|
9
|
+
isTablet: boolean;
|
|
10
|
+
isLaptop: boolean;
|
|
11
|
+
isDesktop: boolean;
|
|
12
|
+
};
|
package/dist/index.d.ts
CHANGED