@xanui/core 1.1.5 → 1.1.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.
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { TagComponentType, TagProps } from '../Tag/types.js';
3
+
4
+ type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {
5
+ theme: string;
6
+ resetCss?: boolean;
7
+ scrollbarCss?: boolean;
8
+ isRootProvider?: boolean;
9
+ renderIsRoot?: React.ReactElement;
10
+ };
11
+ declare const ThemeProvider: ({ children, theme, resetCss, scrollbarCss, isRootProvider, renderIsRoot, ...props }: ThemeProviderProps) => React.JSX.Element;
12
+
13
+ export { ThemeProvider as default };
14
+ export type { ThemeProviderProps };
@@ -0,0 +1,6 @@
1
+ import { ThemeOptions } from './types.js';
2
+
3
+ declare const getTheme: (theme: string) => ThemeOptions | undefined;
4
+ declare const useTheme: () => ThemeOptions;
5
+
6
+ export { getTheme, useTheme };
@@ -0,0 +1,9 @@
1
+ import { ThemeOptions } from './types.js';
2
+
3
+ declare const createThemeSwitcher: (defaultTheme: string, store?: "session" | "local") => () => {
4
+ name: string;
5
+ theme: ThemeOptions | undefined;
6
+ change: (theme: string) => void;
7
+ };
8
+
9
+ export { createThemeSwitcher as default };
@@ -0,0 +1,127 @@
1
+ import { GlobalCSS, BreakpointKeys } from '../css/types.js';
2
+
3
+ type ObjectType = {
4
+ [key: string]: any;
5
+ };
6
+ type ThemeColorItem = {
7
+ primary: string;
8
+ secondary: string;
9
+ text: string;
10
+ alpha: string;
11
+ template: {
12
+ outline: {
13
+ bgcolor: string;
14
+ color: string;
15
+ border: number;
16
+ borderColor: string;
17
+ hover: {
18
+ bgcolor: string;
19
+ color: string;
20
+ };
21
+ };
22
+ fill: {
23
+ bgcolor: string;
24
+ color: string;
25
+ hover: {
26
+ bgcolor: string;
27
+ color: string;
28
+ };
29
+ };
30
+ text: {
31
+ bgcolor: string;
32
+ color: string;
33
+ hover: {
34
+ bgcolor: string;
35
+ color: string;
36
+ };
37
+ };
38
+ alpha: {
39
+ bgcolor: string;
40
+ color: string;
41
+ hover: {
42
+ bgcolor: string;
43
+ color: string;
44
+ };
45
+ };
46
+ };
47
+ };
48
+ type ThemeTypographyItem = {
49
+ fontSize: number;
50
+ lineHeight: number;
51
+ fontWeight: number;
52
+ };
53
+ type ThemeColor = {
54
+ background: Omit<ThemeColorItem, "text">;
55
+ text: Omit<ThemeColorItem, "text" | "alpha" | "template">;
56
+ divider: string;
57
+ brand: ThemeColorItem;
58
+ accent: ThemeColorItem;
59
+ success: ThemeColorItem;
60
+ info: ThemeColorItem;
61
+ warning: ThemeColorItem;
62
+ danger: ThemeColorItem;
63
+ };
64
+ type ThemeTypographyType = {
65
+ fontFamily: string;
66
+ h1: ThemeTypographyItem;
67
+ h2: ThemeTypographyItem;
68
+ h3: ThemeTypographyItem;
69
+ h4: ThemeTypographyItem;
70
+ h5: ThemeTypographyItem;
71
+ h6: ThemeTypographyItem;
72
+ text: ThemeTypographyItem;
73
+ button: ThemeTypographyItem;
74
+ small: ThemeTypographyItem;
75
+ };
76
+ interface ThemeOptions {
77
+ name: string;
78
+ rtl: boolean;
79
+ globalStyle: GlobalCSS;
80
+ breakpoints: {
81
+ [key in BreakpointKeys]: number;
82
+ };
83
+ shadow: string[];
84
+ interfaces: {
85
+ [name: string]: <P extends object>(defaultProps: P, theme: ThemeOptions) => P;
86
+ };
87
+ colors: ThemeColor;
88
+ typography: ThemeTypographyType;
89
+ }
90
+ type ThemeColorItemInput = Partial<Omit<ThemeColorItem, "alpha">>;
91
+ type ThemeTypographyItemInput = Partial<ThemeTypographyItem>;
92
+ type ThemeColorInput = {
93
+ background?: Omit<ThemeColorItemInput, "text">;
94
+ text?: Omit<ThemeColorItemInput, "text">;
95
+ divider?: string;
96
+ brand?: ThemeColorItemInput;
97
+ accent?: ThemeColorItemInput;
98
+ success?: ThemeColorItemInput;
99
+ info?: ThemeColorItemInput;
100
+ warning?: ThemeColorItemInput;
101
+ danger?: ThemeColorItemInput;
102
+ };
103
+ type ThemeTypographyInputType = {
104
+ fontFamily?: string;
105
+ h1?: ThemeTypographyItemInput;
106
+ h2?: ThemeTypographyItemInput;
107
+ h3?: ThemeTypographyItemInput;
108
+ h4?: ThemeTypographyItemInput;
109
+ h5?: ThemeTypographyItemInput;
110
+ h6?: ThemeTypographyItemInput;
111
+ text?: ThemeTypographyItemInput;
112
+ button?: ThemeTypographyItemInput;
113
+ small?: ThemeTypographyItemInput;
114
+ };
115
+ interface ThemeOptionInput {
116
+ rtl?: boolean;
117
+ globalStyle?: GlobalCSS;
118
+ interfaces?: {
119
+ [name: string]: <P extends object>(defaultProps: P, theme: ThemeOptions) => P;
120
+ };
121
+ colors?: ThemeColorInput;
122
+ typography?: ThemeTypographyInputType;
123
+ }
124
+ type TypographyRefTypes = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "text" | "button" | "small";
125
+ type ColorsRefTypes = "text" | "text.primary" | "text.secondary" | "background" | "background.primary" | "background.secondary" | "background.alpha" | "brand" | "brand.primary" | "brand.secondary" | "brand.alpha" | "brand.text" | "accent" | "accent.primary" | "accent.secondary" | "accent.alpha" | "accent.text" | "info" | "info.primary" | "info.secondary" | "info.alpha" | "info.text" | "success" | "success.primary" | "success.secondary" | "success.alpha" | "success.text" | "warning" | "warning.primary" | "warning.secondary" | "warning.alpha" | "warning.text" | "danger" | "danger.primary" | "danger.secondary" | "danger.alpha" | "danger.text";
126
+
127
+ export type { ColorsRefTypes, ObjectType, ThemeColor, ThemeColorInput, ThemeColorItem, ThemeColorItemInput, ThemeOptionInput, ThemeOptions, ThemeTypographyInputType, ThemeTypographyItem, ThemeTypographyItemInput, ThemeTypographyType, TypographyRefTypes };
@@ -0,0 +1,21 @@
1
+ import { CSSProps } from './css/types.js';
2
+
3
+ declare const animationEases: {
4
+ easeInOut: string;
5
+ easeOut: string;
6
+ easeIn: string;
7
+ sharp: string;
8
+ linear: string;
9
+ easeBounceOut: string;
10
+ };
11
+ interface UseAnimationProps {
12
+ delay?: number;
13
+ duration?: number;
14
+ from: CSSProps;
15
+ to: CSSProps;
16
+ ease?: keyof typeof animationEases;
17
+ }
18
+ declare const useAnimation: ({ from, to, delay, ease, duration }: UseAnimationProps) => string;
19
+
20
+ export { animationEases, useAnimation as default };
21
+ export type { UseAnimationProps };
@@ -0,0 +1,6 @@
1
+ type ColorTemplateColors = "default" | "brand" | "accent" | "info" | "success" | "warning" | "danger";
2
+ type ColorTemplateType = "fill" | "outline" | "text" | "alpha";
3
+ declare const useColorTemplate: (color: ColorTemplateColors, type: ColorTemplateType) => any;
4
+
5
+ export { useColorTemplate as default };
6
+ export type { ColorTemplateColors, ColorTemplateType };
@@ -0,0 +1,5 @@
1
+ import { ThemeOptions } from './theme/types.js';
2
+
3
+ declare const useInterface: <P extends object>(name: string, userPorps: P, defaultProps: P) => (P | ThemeOptions)[];
4
+
5
+ export { useInterface as default };