colibri-ui 0.7.4 → 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.
Files changed (55) hide show
  1. package/Button/index.d.ts +2 -2
  2. package/Button/index.props.d.ts +2 -2
  3. package/Button/index.props.js +1 -1
  4. package/Button/styles.d.ts +2 -2
  5. package/Button/styles.js +12 -12
  6. package/DotsLoader/index.js +27 -0
  7. package/DotsLoader/styles.js +41 -0
  8. package/README.md +5 -1
  9. package/Switch/index.d.ts +4 -0
  10. package/Switch/index.js +22 -0
  11. package/Switch/index.props.d.ts +18 -0
  12. package/Switch/package.json +6 -0
  13. package/Switch/styles.d.ts +19 -0
  14. package/Switch/styles.js +58 -0
  15. package/Theme/index.d.ts +60 -10
  16. package/Theme/index.props.d.ts +2 -0
  17. package/Theme/themes/buenos_aires.d.ts +60 -10
  18. package/Theme/themes/buenos_aires.js +33 -6
  19. package/Theme/themes/default.d.ts +60 -10
  20. package/Theme/themes/default.js +33 -6
  21. package/Typography/index.d.ts +2 -2
  22. package/Typography/index.js +47 -0
  23. package/Typography/index.props.d.ts +18 -6
  24. package/Typography/index.props.js +10 -0
  25. package/Typography/styles.d.ts +1 -1
  26. package/Typography/styles.js +78 -0
  27. package/esm/Button/index.d.ts +2 -2
  28. package/esm/Button/index.props.d.ts +2 -2
  29. package/esm/Button/index.props.js +1 -1
  30. package/esm/Button/styles.d.ts +2 -2
  31. package/esm/Button/styles.js +12 -12
  32. package/esm/DotsLoader/index.js +23 -0
  33. package/esm/DotsLoader/styles.js +34 -0
  34. package/esm/Switch/index.d.ts +4 -0
  35. package/esm/Switch/index.js +18 -0
  36. package/esm/Switch/index.props.d.ts +18 -0
  37. package/esm/Switch/styles.d.ts +19 -0
  38. package/esm/Switch/styles.js +49 -0
  39. package/esm/Theme/index.d.ts +60 -10
  40. package/esm/Theme/index.props.d.ts +2 -0
  41. package/esm/Theme/themes/buenos_aires.d.ts +60 -10
  42. package/esm/Theme/themes/buenos_aires.js +33 -7
  43. package/esm/Theme/themes/default.d.ts +60 -10
  44. package/esm/Theme/themes/default.js +33 -7
  45. package/esm/Typography/index.d.ts +2 -2
  46. package/esm/Typography/index.js +43 -0
  47. package/esm/Typography/index.props.d.ts +18 -6
  48. package/esm/Typography/index.props.js +10 -0
  49. package/esm/Typography/styles.d.ts +1 -1
  50. package/esm/Typography/styles.js +72 -0
  51. package/esm/index.d.ts +3 -0
  52. package/esm/index.js +3 -0
  53. package/index.d.ts +3 -0
  54. package/index.js +9 -3
  55. package/package.json +3 -1
@@ -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
  };
@@ -80,16 +80,42 @@ var ButtonThemeDefault = {
80
80
  }
81
81
  };
82
82
  var TypographyThemeDefault = {
83
- primary: Color.TYPOGRAPHY_PRIMARY,
84
- secondary: Color.TYPOGRAPHY_SECONDARY,
85
- alert: Color.TYPOGRAPHY_ALERT,
86
- success: Color.TYPOGRAPHY_SUCCESS,
87
- link: Color.TYPOGRAPHY_LINK
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
+ }
88
113
  };
89
114
  var THEME_DEFAULT = {
90
115
  breakpoints: Breakpoints,
91
116
  button: ButtonThemeDefault,
92
- typography: TypographyThemeDefault
117
+ typography: TypographyThemeDefault,
118
+ "switch": SwitchThemeDefault
93
119
  };
94
120
 
95
- export { ButtonThemeDefault, THEME_DEFAULT, TypographyThemeDefault };
121
+ export { ButtonThemeDefault, SwitchThemeDefault, THEME_DEFAULT, 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,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 };
@@ -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
+ var VARIANT;
2
+ (function (VARIANT) {
3
+ VARIANT["PRIMARY"] = "primary";
4
+ VARIANT["SECONDARY"] = "secondary";
5
+ VARIANT["ALERT"] = "alert";
6
+ VARIANT["SUCCESS"] = "success";
7
+ VARIANT["LINK"] = "link";
8
+ })(VARIANT || (VARIANT = {}));
9
+
10
+ export { 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;