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.
Files changed (69) hide show
  1. package/Button/index.d.ts +2 -2
  2. package/Button/index.js +5 -2
  3. package/Button/index.props.d.ts +15 -5
  4. package/Button/index.props.js +14 -0
  5. package/Button/styles.d.ts +2 -2
  6. package/Button/styles.js +15 -12
  7. package/DotsLoader/index.d.ts +5 -0
  8. package/DotsLoader/index.js +27 -0
  9. package/DotsLoader/package.json +6 -0
  10. package/DotsLoader/styles.d.ts +15 -0
  11. package/DotsLoader/styles.js +41 -0
  12. package/README.md +5 -1
  13. package/Switch/index.d.ts +4 -0
  14. package/Switch/index.js +22 -0
  15. package/Switch/index.props.d.ts +18 -0
  16. package/Switch/package.json +6 -0
  17. package/Switch/styles.d.ts +19 -0
  18. package/Switch/styles.js +58 -0
  19. package/Theme/breakpoints.d.ts +1 -0
  20. package/Theme/color.d.ts +51 -46
  21. package/Theme/color.js +53 -49
  22. package/Theme/index.d.ts +64 -0
  23. package/Theme/index.props.d.ts +4 -0
  24. package/Theme/themes/buenos_aires.d.ts +65 -1
  25. package/Theme/themes/buenos_aires.js +78 -42
  26. package/Theme/themes/default.d.ts +65 -1
  27. package/Theme/themes/default.js +78 -42
  28. package/Typography/index.d.ts +4 -0
  29. package/Typography/index.js +47 -0
  30. package/Typography/index.props.d.ts +30 -0
  31. package/Typography/index.props.js +10 -0
  32. package/Typography/package.json +6 -0
  33. package/Typography/styles.d.ts +11 -0
  34. package/Typography/styles.js +78 -0
  35. package/esm/Button/index.d.ts +2 -2
  36. package/esm/Button/index.js +5 -2
  37. package/esm/Button/index.props.d.ts +15 -5
  38. package/esm/Button/index.props.js +14 -0
  39. package/esm/Button/styles.d.ts +2 -2
  40. package/esm/Button/styles.js +15 -12
  41. package/esm/DotsLoader/index.d.ts +5 -0
  42. package/esm/DotsLoader/index.js +23 -0
  43. package/esm/DotsLoader/styles.d.ts +15 -0
  44. package/esm/DotsLoader/styles.js +34 -0
  45. package/esm/Switch/index.d.ts +4 -0
  46. package/esm/Switch/index.js +18 -0
  47. package/esm/Switch/index.props.d.ts +18 -0
  48. package/esm/Switch/styles.d.ts +19 -0
  49. package/esm/Switch/styles.js +49 -0
  50. package/esm/Theme/breakpoints.d.ts +1 -0
  51. package/esm/Theme/color.d.ts +51 -46
  52. package/esm/Theme/color.js +52 -49
  53. package/esm/Theme/index.d.ts +64 -0
  54. package/esm/Theme/index.props.d.ts +4 -0
  55. package/esm/Theme/themes/buenos_aires.d.ts +65 -1
  56. package/esm/Theme/themes/buenos_aires.js +38 -4
  57. package/esm/Theme/themes/default.d.ts +65 -1
  58. package/esm/Theme/themes/default.js +38 -4
  59. package/esm/Typography/index.d.ts +4 -0
  60. package/esm/Typography/index.js +43 -0
  61. package/esm/Typography/index.props.d.ts +30 -0
  62. package/esm/Typography/index.props.js +10 -0
  63. package/esm/Typography/styles.d.ts +11 -0
  64. package/esm/Typography/styles.js +72 -0
  65. package/esm/index.d.ts +3 -0
  66. package/esm/index.js +3 -0
  67. package/index.d.ts +3 -0
  68. package/index.js +9 -3
  69. package/package.json +3 -1
@@ -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;
@@ -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,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 = {}));
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../esm/Typography/index.js",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -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>, {}>;