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
|
@@ -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,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>, {}>;
|