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