colibri-ui 0.7.3 → 0.7.5
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/Button/index.d.ts +2 -2
- package/Button/index.js +5 -2
- package/Button/index.props.d.ts +15 -5
- package/Button/index.props.js +14 -0
- package/Button/styles.d.ts +2 -2
- package/Button/styles.js +15 -12
- package/DotsLoader/index.d.ts +5 -0
- package/DotsLoader/index.js +27 -0
- package/DotsLoader/package.json +6 -0
- package/DotsLoader/styles.d.ts +15 -0
- package/DotsLoader/styles.js +41 -0
- package/README.md +5 -1
- package/Switch/index.d.ts +4 -0
- package/Switch/index.js +22 -0
- package/Switch/index.props.d.ts +18 -0
- package/Switch/package.json +6 -0
- package/Switch/styles.d.ts +19 -0
- package/Switch/styles.js +58 -0
- package/Theme/breakpoints.d.ts +1 -0
- package/Theme/color.d.ts +51 -46
- package/Theme/color.js +53 -49
- package/Theme/index.d.ts +64 -0
- package/Theme/index.props.d.ts +4 -0
- package/Theme/themes/buenos_aires.d.ts +65 -1
- package/Theme/themes/buenos_aires.js +78 -42
- package/Theme/themes/default.d.ts +65 -1
- package/Theme/themes/default.js +78 -42
- package/Typography/index.d.ts +4 -0
- package/Typography/index.js +47 -0
- package/Typography/index.props.d.ts +30 -0
- package/Typography/index.props.js +10 -0
- package/Typography/package.json +6 -0
- package/Typography/styles.d.ts +11 -0
- package/Typography/styles.js +78 -0
- package/esm/Button/index.d.ts +2 -2
- package/esm/Button/index.js +5 -2
- package/esm/Button/index.props.d.ts +15 -5
- package/esm/Button/index.props.js +14 -0
- package/esm/Button/styles.d.ts +2 -2
- package/esm/Button/styles.js +15 -12
- package/esm/DotsLoader/index.d.ts +5 -0
- package/esm/DotsLoader/index.js +23 -0
- package/esm/DotsLoader/styles.d.ts +15 -0
- package/esm/DotsLoader/styles.js +34 -0
- package/esm/Switch/index.d.ts +4 -0
- package/esm/Switch/index.js +18 -0
- package/esm/Switch/index.props.d.ts +18 -0
- package/esm/Switch/styles.d.ts +19 -0
- package/esm/Switch/styles.js +49 -0
- package/esm/Theme/breakpoints.d.ts +1 -0
- package/esm/Theme/color.d.ts +51 -46
- package/esm/Theme/color.js +52 -49
- package/esm/Theme/index.d.ts +64 -0
- package/esm/Theme/index.props.d.ts +4 -0
- package/esm/Theme/themes/buenos_aires.d.ts +65 -1
- package/esm/Theme/themes/buenos_aires.js +38 -4
- package/esm/Theme/themes/default.d.ts +65 -1
- package/esm/Theme/themes/default.js +38 -4
- package/esm/Typography/index.d.ts +4 -0
- package/esm/Typography/index.js +43 -0
- package/esm/Typography/index.props.d.ts +30 -0
- package/esm/Typography/index.props.js +10 -0
- package/esm/Typography/styles.d.ts +11 -0
- package/esm/Typography/styles.js +72 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.js +3 -0
- package/index.d.ts +3 -0
- package/index.js +9 -3
- package/package.json +3 -1
package/esm/Theme/index.d.ts
CHANGED
|
@@ -4,10 +4,74 @@ export declare const THEMES: {
|
|
|
4
4
|
DEFAULT: {
|
|
5
5
|
breakpoints: import("./breakpoints").BreakpointsTheme;
|
|
6
6
|
button: import("../Button/index.props").ButtonVariant & import("../Button/index.props").ButtonBase;
|
|
7
|
+
typography: {
|
|
8
|
+
primary: {
|
|
9
|
+
color: string;
|
|
10
|
+
};
|
|
11
|
+
secondary: {
|
|
12
|
+
color: string;
|
|
13
|
+
};
|
|
14
|
+
alert: {
|
|
15
|
+
color: string;
|
|
16
|
+
};
|
|
17
|
+
success: {
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
link: {
|
|
21
|
+
color: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
switch: {
|
|
25
|
+
circle: {
|
|
26
|
+
backgroundColor: string;
|
|
27
|
+
};
|
|
28
|
+
state: {
|
|
29
|
+
normal: {
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
borderColor: string;
|
|
32
|
+
};
|
|
33
|
+
checked: {
|
|
34
|
+
backgroundColor: string;
|
|
35
|
+
borderColor: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
7
39
|
};
|
|
8
40
|
BA: {
|
|
9
41
|
breakpoints: import("./breakpoints").BreakpointsTheme;
|
|
10
42
|
button: import("../Button/index.props").ButtonVariant & import("../Button/index.props").ButtonBase;
|
|
43
|
+
typography: {
|
|
44
|
+
primary: {
|
|
45
|
+
color: string;
|
|
46
|
+
};
|
|
47
|
+
secondary: {
|
|
48
|
+
color: string;
|
|
49
|
+
};
|
|
50
|
+
alert: {
|
|
51
|
+
color: string;
|
|
52
|
+
};
|
|
53
|
+
success: {
|
|
54
|
+
color: string;
|
|
55
|
+
};
|
|
56
|
+
link: {
|
|
57
|
+
color: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
switch: {
|
|
61
|
+
circle: {
|
|
62
|
+
backgroundColor: string;
|
|
63
|
+
};
|
|
64
|
+
state: {
|
|
65
|
+
normal: {
|
|
66
|
+
backgroundColor: string;
|
|
67
|
+
borderColor: string;
|
|
68
|
+
};
|
|
69
|
+
checked: {
|
|
70
|
+
backgroundColor: string;
|
|
71
|
+
borderColor: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
11
75
|
};
|
|
12
76
|
};
|
|
13
77
|
export declare const ThemeProvider: FC<{
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { BreakpointsTheme } from "./breakpoints";
|
|
2
2
|
import type { ButtonBase, ButtonVariant } from "../Button/index.props";
|
|
3
|
+
import type { TypographyVariant } from "../Typography/index.props";
|
|
4
|
+
import type { SwitchStates } from "../Switch/index.props";
|
|
3
5
|
export type ThemeProps = {
|
|
4
6
|
button: ButtonVariant & ButtonBase;
|
|
5
7
|
breakpoints: BreakpointsTheme;
|
|
8
|
+
typography: TypographyVariant;
|
|
9
|
+
switch: SwitchStates;
|
|
6
10
|
};
|
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
import type { ButtonBase, ButtonVariant } from "../../Button/index.props";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ButtonThemeBA: ButtonVariant & ButtonBase;
|
|
3
|
+
export declare const TypographyThemeBA: {
|
|
4
|
+
primary: {
|
|
5
|
+
color: string;
|
|
6
|
+
};
|
|
7
|
+
secondary: {
|
|
8
|
+
color: string;
|
|
9
|
+
};
|
|
10
|
+
alert: {
|
|
11
|
+
color: string;
|
|
12
|
+
};
|
|
13
|
+
success: {
|
|
14
|
+
color: string;
|
|
15
|
+
};
|
|
16
|
+
link: {
|
|
17
|
+
color: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const SwitchThemeDefault: {
|
|
21
|
+
circle: {
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
};
|
|
24
|
+
state: {
|
|
25
|
+
normal: {
|
|
26
|
+
backgroundColor: string;
|
|
27
|
+
borderColor: string;
|
|
28
|
+
};
|
|
29
|
+
checked: {
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
borderColor: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
3
35
|
export declare const THEME_BA: {
|
|
4
36
|
breakpoints: import("../breakpoints").BreakpointsTheme;
|
|
5
37
|
button: ButtonVariant & ButtonBase;
|
|
38
|
+
typography: {
|
|
39
|
+
primary: {
|
|
40
|
+
color: string;
|
|
41
|
+
};
|
|
42
|
+
secondary: {
|
|
43
|
+
color: string;
|
|
44
|
+
};
|
|
45
|
+
alert: {
|
|
46
|
+
color: string;
|
|
47
|
+
};
|
|
48
|
+
success: {
|
|
49
|
+
color: string;
|
|
50
|
+
};
|
|
51
|
+
link: {
|
|
52
|
+
color: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
switch: {
|
|
56
|
+
circle: {
|
|
57
|
+
backgroundColor: string;
|
|
58
|
+
};
|
|
59
|
+
state: {
|
|
60
|
+
normal: {
|
|
61
|
+
backgroundColor: string;
|
|
62
|
+
borderColor: string;
|
|
63
|
+
};
|
|
64
|
+
checked: {
|
|
65
|
+
backgroundColor: string;
|
|
66
|
+
borderColor: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
6
70
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Color from '../color.js';
|
|
1
|
+
import { Color } from '../color.js';
|
|
2
2
|
import Breakpoints from '../breakpoints.js';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var ButtonThemeBA = {
|
|
5
5
|
base: {
|
|
6
6
|
color: Color.WHITE,
|
|
7
7
|
borderRadius: "26px",
|
|
@@ -80,9 +80,43 @@ var ButtonBA = {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
+
var TypographyThemeBA = {
|
|
84
|
+
primary: {
|
|
85
|
+
color: Color.TYPOGRAPHY_PRIMARY
|
|
86
|
+
},
|
|
87
|
+
secondary: {
|
|
88
|
+
color: Color.TYPOGRAPHY_SECONDARY
|
|
89
|
+
},
|
|
90
|
+
alert: {
|
|
91
|
+
color: Color.TYPOGRAPHY_ALERT
|
|
92
|
+
},
|
|
93
|
+
success: {
|
|
94
|
+
color: Color.TYPOGRAPHY_SUCCESS
|
|
95
|
+
},
|
|
96
|
+
link: {
|
|
97
|
+
color: Color.TYPOGRAPHY_LINK
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var SwitchThemeDefault = {
|
|
101
|
+
circle: {
|
|
102
|
+
backgroundColor: Color.WHITE
|
|
103
|
+
},
|
|
104
|
+
state: {
|
|
105
|
+
normal: {
|
|
106
|
+
backgroundColor: Color.GRAPHITE_6,
|
|
107
|
+
borderColor: Color.GRAPHITE_6
|
|
108
|
+
},
|
|
109
|
+
checked: {
|
|
110
|
+
backgroundColor: Color.GRAPHITE_10,
|
|
111
|
+
borderColor: Color.GRAPHITE_10
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
83
115
|
var THEME_BA = {
|
|
84
116
|
breakpoints: Breakpoints,
|
|
85
|
-
button:
|
|
117
|
+
button: ButtonThemeBA,
|
|
118
|
+
typography: TypographyThemeBA,
|
|
119
|
+
"switch": SwitchThemeDefault
|
|
86
120
|
};
|
|
87
121
|
|
|
88
|
-
export {
|
|
122
|
+
export { ButtonThemeBA, SwitchThemeDefault, THEME_BA, TypographyThemeBA };
|
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
import type { ButtonBase, ButtonVariant } from "../../Button/index.props";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ButtonThemeDefault: ButtonVariant & ButtonBase;
|
|
3
|
+
export declare const TypographyThemeDefault: {
|
|
4
|
+
primary: {
|
|
5
|
+
color: string;
|
|
6
|
+
};
|
|
7
|
+
secondary: {
|
|
8
|
+
color: string;
|
|
9
|
+
};
|
|
10
|
+
alert: {
|
|
11
|
+
color: string;
|
|
12
|
+
};
|
|
13
|
+
success: {
|
|
14
|
+
color: string;
|
|
15
|
+
};
|
|
16
|
+
link: {
|
|
17
|
+
color: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const SwitchThemeDefault: {
|
|
21
|
+
circle: {
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
};
|
|
24
|
+
state: {
|
|
25
|
+
normal: {
|
|
26
|
+
backgroundColor: string;
|
|
27
|
+
borderColor: string;
|
|
28
|
+
};
|
|
29
|
+
checked: {
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
borderColor: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
3
35
|
export declare const THEME_DEFAULT: {
|
|
4
36
|
breakpoints: import("../breakpoints").BreakpointsTheme;
|
|
5
37
|
button: ButtonVariant & ButtonBase;
|
|
38
|
+
typography: {
|
|
39
|
+
primary: {
|
|
40
|
+
color: string;
|
|
41
|
+
};
|
|
42
|
+
secondary: {
|
|
43
|
+
color: string;
|
|
44
|
+
};
|
|
45
|
+
alert: {
|
|
46
|
+
color: string;
|
|
47
|
+
};
|
|
48
|
+
success: {
|
|
49
|
+
color: string;
|
|
50
|
+
};
|
|
51
|
+
link: {
|
|
52
|
+
color: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
switch: {
|
|
56
|
+
circle: {
|
|
57
|
+
backgroundColor: string;
|
|
58
|
+
};
|
|
59
|
+
state: {
|
|
60
|
+
normal: {
|
|
61
|
+
backgroundColor: string;
|
|
62
|
+
borderColor: string;
|
|
63
|
+
};
|
|
64
|
+
checked: {
|
|
65
|
+
backgroundColor: string;
|
|
66
|
+
borderColor: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
6
70
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Color from '../color.js';
|
|
1
|
+
import { Color } from '../color.js';
|
|
2
2
|
import Breakpoints from '../breakpoints.js';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var ButtonThemeDefault = {
|
|
5
5
|
base: {
|
|
6
6
|
color: Color.BLACK,
|
|
7
7
|
borderRadius: "26px"
|
|
@@ -79,9 +79,43 @@ var ButtonDefault = {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
+
var TypographyThemeDefault = {
|
|
83
|
+
primary: {
|
|
84
|
+
color: Color.TYPOGRAPHY_PRIMARY
|
|
85
|
+
},
|
|
86
|
+
secondary: {
|
|
87
|
+
color: Color.TYPOGRAPHY_SECONDARY
|
|
88
|
+
},
|
|
89
|
+
alert: {
|
|
90
|
+
color: Color.TYPOGRAPHY_ALERT
|
|
91
|
+
},
|
|
92
|
+
success: {
|
|
93
|
+
color: Color.TYPOGRAPHY_SUCCESS
|
|
94
|
+
},
|
|
95
|
+
link: {
|
|
96
|
+
color: Color.TYPOGRAPHY_LINK
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var SwitchThemeDefault = {
|
|
100
|
+
circle: {
|
|
101
|
+
backgroundColor: Color.WHITE
|
|
102
|
+
},
|
|
103
|
+
state: {
|
|
104
|
+
normal: {
|
|
105
|
+
backgroundColor: Color.BLUE_6,
|
|
106
|
+
borderColor: Color.BLUE_6
|
|
107
|
+
},
|
|
108
|
+
checked: {
|
|
109
|
+
backgroundColor: Color.BLUE_10,
|
|
110
|
+
borderColor: Color.BLUE_10
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
82
114
|
var THEME_DEFAULT = {
|
|
83
115
|
breakpoints: Breakpoints,
|
|
84
|
-
button:
|
|
116
|
+
button: ButtonThemeDefault,
|
|
117
|
+
typography: TypographyThemeDefault,
|
|
118
|
+
"switch": SwitchThemeDefault
|
|
85
119
|
};
|
|
86
120
|
|
|
87
|
-
export {
|
|
121
|
+
export { ButtonThemeDefault, SwitchThemeDefault, THEME_DEFAULT, TypographyThemeDefault };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { __assign } from 'tslib';
|
|
2
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import { useMemo, Children } from 'react';
|
|
4
|
+
import { BaseTypography } from './styles.js';
|
|
5
|
+
import { VARIANT } from './index.props.js';
|
|
6
|
+
|
|
7
|
+
var Typography = function Typography(_a) {
|
|
8
|
+
var _b = _a.tag,
|
|
9
|
+
Element = _b === void 0 ? "span" : _b,
|
|
10
|
+
children = _a.children,
|
|
11
|
+
_c = _a.variant,
|
|
12
|
+
variant = _c === void 0 ? VARIANT.PRIMARY : _c,
|
|
13
|
+
size = _a.size,
|
|
14
|
+
fontWeight = _a.fontWeight,
|
|
15
|
+
className = _a.className,
|
|
16
|
+
_d = _a.nowrap,
|
|
17
|
+
nowrap = _d === void 0 ? false : _d;
|
|
18
|
+
var isNotComponent = typeof children === "string";
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
var child = useMemo(function () {
|
|
21
|
+
return Children.only(isNotComponent ? jsx(Element, {
|
|
22
|
+
children: children
|
|
23
|
+
}) : children);
|
|
24
|
+
}, [children, Element, isNotComponent]);
|
|
25
|
+
var Component = useMemo(function () {
|
|
26
|
+
return BaseTypography.withComponent(child.type, process.env.NODE_ENV === "production" ? {
|
|
27
|
+
target: "en3tlk10"
|
|
28
|
+
} : {
|
|
29
|
+
target: "en3tlk10",
|
|
30
|
+
label: "Component"
|
|
31
|
+
});
|
|
32
|
+
}, [child.type]);
|
|
33
|
+
return jsx(Component, __assign({}, child.props, {
|
|
34
|
+
ref: child.ref,
|
|
35
|
+
size: size,
|
|
36
|
+
variant: variant,
|
|
37
|
+
fontWeight: fontWeight,
|
|
38
|
+
nowrap: nowrap,
|
|
39
|
+
className: className
|
|
40
|
+
}));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { Typography as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CSSObject } from "@emotion/react";
|
|
2
|
+
export declare enum VARIANT {
|
|
3
|
+
PRIMARY = "primary",
|
|
4
|
+
SECONDARY = "secondary",
|
|
5
|
+
ALERT = "alert",
|
|
6
|
+
SUCCESS = "success",
|
|
7
|
+
LINK = "link"
|
|
8
|
+
}
|
|
9
|
+
type VariantStyles = {
|
|
10
|
+
color?: CSSObject["color"];
|
|
11
|
+
};
|
|
12
|
+
export type TypographyVariant = {
|
|
13
|
+
[VARIANT.PRIMARY]: VariantStyles;
|
|
14
|
+
[VARIANT.SECONDARY]: VariantStyles;
|
|
15
|
+
[VARIANT.ALERT]: VariantStyles;
|
|
16
|
+
[VARIANT.SUCCESS]: VariantStyles;
|
|
17
|
+
[VARIANT.LINK]: VariantStyles;
|
|
18
|
+
};
|
|
19
|
+
export type TypographyFontWeight = "normal" | "medium" | "bold";
|
|
20
|
+
export type TypographySize = "xs" | "s" | "m" | "l" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
21
|
+
export type TypographyTag = "span" | "legend" | "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "s";
|
|
22
|
+
export type TypographyProps = {
|
|
23
|
+
className?: string;
|
|
24
|
+
tag?: TypographyTag;
|
|
25
|
+
variant?: keyof TypographyVariant;
|
|
26
|
+
size?: TypographySize;
|
|
27
|
+
fontWeight?: TypographyFontWeight;
|
|
28
|
+
nowrap?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type TypographyFontWeight, type TypographySize, type TypographyVariant } from "./index.props";
|
|
3
|
+
export declare const BaseTypography: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
6
|
+
} & {
|
|
7
|
+
variant: keyof TypographyVariant;
|
|
8
|
+
size?: TypographySize | undefined;
|
|
9
|
+
fontWeight?: TypographyFontWeight | undefined;
|
|
10
|
+
nowrap?: boolean | undefined;
|
|
11
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|