@xfers/design-system 4.1.1-dev.2c52cf86b5 → 4.1.1-dev.2e0066cfba

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfers/design-system",
3
- "version": "4.1.1-dev.2c52cf86b5",
3
+ "version": "4.1.1-dev.2e0066cfba",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "xfers",
@@ -29,7 +29,7 @@
29
29
  "lint/ci:changed": "eslint $@ --cache",
30
30
  "clean": "rimraf dist cjs es",
31
31
  "prebuild": "yarn clean",
32
- "build:prod": "tsc --module commonjs && rollup -c rollup.config.js",
32
+ "build:prod": "tsc --module commonjs && rollup -c rollup.config.js && rimraf node_modules/react node_modules/react-dom",
33
33
  "start": "rollup -c rollup.config.js -w",
34
34
  "test": "jest --coverage",
35
35
  "test:watch": "jest --coverage --watch",
@@ -160,5 +160,13 @@
160
160
  "peerDependencies": {
161
161
  "react": ">=16.8.0",
162
162
  "react-dom": ">=16.8.0"
163
+ },
164
+ "peerDependenciesMeta": {
165
+ "react": {
166
+ "optional": false
167
+ },
168
+ "react-dom": {
169
+ "optional": false
170
+ }
163
171
  }
164
172
  }
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var react_1 = require("react");
4
- require("antd/es/alert/style/css");
5
- var icons_1 = require("src/icons");
6
- var Typography_1 = require("src/constants/Typography/Typography");
7
- var colors_1 = require("src/constants/colors");
8
- var styles_1 = require("./styles");
9
- var CustomAlert = function (_a) {
10
- var type = _a.type, message = _a.message, closable = _a.closable, icon = _a.icon, showIcon = _a.showIcon, onClose = _a.onClose, title = _a.title;
11
- var _b = (0, react_1.useState)(true), isVisible = _b[0], setIsVisible = _b[1];
12
- var getIcon = function () {
13
- var iconElement = icon ? (react_1.default.cloneElement(icon, {
14
- width: 20,
15
- height: 20
16
- }))
17
- : (react_1.default.createElement(icons_1.Bell, { width: 20, height: 20 }));
18
- return react_1.default.createElement(styles_1.AlertIconContainer, null, iconElement);
19
- };
20
- var Message = function () {
21
- var textColor = type === 'info' ? colors_1.WHITE.DEFAULT : colors_1.BLACK.DEFAULT;
22
- return (react_1.default.createElement(styles_1.StyledAlertMessageContainer, null,
23
- title && (react_1.default.createElement(Typography_1.Typography.Label, { color: textColor, size: "md" }, title)),
24
- react_1.default.createElement(Typography_1.Typography.Body, { color: textColor, size: "md" }, message)));
25
- };
26
- var CloseIcon = function () { return react_1.default.createElement(icons_1.Cross, { width: 14, height: 14 }); };
27
- var handleClose = function () {
28
- setIsVisible(false);
29
- if (onClose) {
30
- onClose();
31
- }
32
- };
33
- if (!isVisible)
34
- return null;
35
- return (react_1.default.createElement(styles_1.StyledAlert, { type: type || 'warning', message: react_1.default.createElement(Message, null), closable: closable, icon: getIcon(), showIcon: showIcon, onClose: handleClose, closeIcon: react_1.default.createElement(CloseIcon, null) }));
36
- };
37
- exports.default = CustomAlert;
38
- //# sourceMappingURL=Alert.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":";;AAAA,+BAAuC;AACvC,mCAAgC;AAChC,mCAAuC;AACvC,kEAAgE;AAChE,+CAAmD;AAEnD,mCAIiB;AAEjB,IAAM,WAAW,GAAG,UAAC,EAQF;QAPjB,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,KAAK,WAAA;IAEC,IAAA,KAA4B,IAAA,gBAAQ,EAAC,IAAI,CAAC,EAAzC,SAAS,QAAA,EAAE,YAAY,QAAkB,CAAA;IAEhD,IAAM,OAAO,GAAG;QACd,IAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,CACzB,eAAK,CAAC,YAAY,CAAC,IAA0B,EAAE;YAC7C,KAAK,EAAE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,kBAAe,WAAW,CAAA"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = void 0;
4
- var Alert_1 = require("./Alert");
5
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return Alert_1.default; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Alert/index.tsx"],"names":[],"mappings":";;;AAAA,iCAAiC;AAAxB,gGAAA,OAAO,OAAA"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.AlertIconContainer = exports.StyledAlertMessageContainer = exports.StyledAlert = void 0;
8
- var styled_1 = require("@emotion/styled");
9
- var alert_1 = require("antd/es/alert");
10
- var colors_1 = require("src/constants/colors");
11
- var ColorStyles_1 = require("src/shared/ColorStyles");
12
- var baseAlertStyles = "\n width: 328px !important;\n min-height: 52px !important;\n border-radius: 8px !important;\n padding: 8px 12px !important;\n \n .ant-alert-icon {\n align-self: flex-start !important;\n margin-top: 0 !important;\n }\n";
13
- var getThemeStyles = function (borderColor, iconColor, backgroundColor) { return "\n border: 1px solid ".concat(borderColor, " !important;\n background-color: ").concat(backgroundColor, " !important;\n \n .ant-alert-icon {\n color: ").concat(iconColor, " !important;\n }\n \n .ant-alert-close-icon {\n color: ").concat(iconColor, " !important;\n }\n"); };
14
- var SuccessStyle = getThemeStyles(ColorStyles_1.GREEN_COLORS.G400, ColorStyles_1.GREEN_COLORS.G400, ColorStyles_1.GREEN_COLORS.G100);
15
- var WarningStyle = getThemeStyles(ColorStyles_1.YELLOW_COLORS.Y400, ColorStyles_1.YELLOW_COLORS.Y400, ColorStyles_1.YELLOW_COLORS.Y100);
16
- var ErrorStyle = getThemeStyles(ColorStyles_1.RED_COLORS.R400, ColorStyles_1.RED_COLORS.R400, ColorStyles_1.RED_COLORS.R100);
17
- var InfoStyle = "\n border: none !important;\n background-color: ".concat(colors_1.GREEN.CONTRAST, " !important;\n \n .ant-alert-icon {\n color: ").concat(colors_1.WHITE.DEFAULT, " !important;\n }\n \n .ant-alert-close-icon {\n color: ").concat(colors_1.WHITE.DEFAULT, " !important;\n }\n");
18
- exports.StyledAlert = (0, styled_1.default)(alert_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.ant-alert {\n ", "\n \n ", "\n ", "\n ", "\n ", "\n }\n"], ["\n &.ant-alert {\n ", "\n \n ", "\n ", "\n ", "\n ", "\n }\n"])), baseAlertStyles, function (_a) {
19
- var type = _a.type;
20
- return type === 'success' && SuccessStyle;
21
- }, function (_a) {
22
- var type = _a.type;
23
- return type === 'warning' && WarningStyle;
24
- }, function (_a) {
25
- var type = _a.type;
26
- return type === 'error' && ErrorStyle;
27
- }, function (_a) {
28
- var type = _a.type;
29
- return type === 'info' && InfoStyle;
30
- });
31
- exports.StyledAlertMessageContainer = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n span,\n p,\n div {\n font-family: 'Hanken Grotesk', 'Inter', sans-serif !important;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-family: 'Red Hat Display', 'Inter', sans-serif !important;\n }\n"], ["\n display: flex;\n flex-direction: column;\n\n span,\n p,\n div {\n font-family: 'Hanken Grotesk', 'Inter', sans-serif !important;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-family: 'Red Hat Display', 'Inter', sans-serif !important;\n }\n"])));
32
- exports.AlertIconContainer = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 24px;\n height: 24px;\n"], ["\n width: 24px;\n height: 24px;\n"])));
33
- var templateObject_1, templateObject_2, templateObject_3;
34
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Alert/styles.ts"],"names":[],"mappings":";;;;;;;AAAA,0CAAoC;AACpC,uCAAiC;AACjC,+CAAmD;AACnD,sDAAgF;AAEhF,IAAM,eAAe,GAAG,wOAUvB,CAAA;AAED,IAAM,cAAc,GAAG,UACrB,WAAmB,EACnB,SAAiB,EACjB,eAAuB,IACpB,OAAA,gCACiB,WAAW,+CACX,eAAe,+DAGxB,SAAS,0EAIT,SAAS,wBAErB,EAXI,CAWJ,CAAA;AAED,IAAM,YAAY,GAAG,cAAc,CACjC,0BAAY,CAAC,IAAI,EACjB,0BAAY,CAAC,IAAI,EACjB,0BAAY,CAAC,IAAI,CAClB,CAAA;AACD,IAAM,YAAY,GAAG,cAAc,CACjC,2BAAa,CAAC,IAAI,EAClB,2BAAa,CAAC,IAAI,EAClB,2BAAa,CAAC,IAAI,CACnB,CAAA;AACD,IAAM,UAAU,GAAG,cAAc,CAC/B,wBAAU,CAAC,IAAI,EACf,wBAAU,CAAC,IAAI,EACf,wBAAU,CAAC,IAAI,CAChB,CAAA;AACD,IAAM,SAAS,GAAG,4DAEI,cAAK,CAAC,QAAQ,+DAGvB,cAAK,CAAC,OAAO,0EAIb,cAAK,CAAC,OAAO,wBAEzB,CAAA;AAEY,QAAA,WAAW,GAAG,IAAA,gBAAM,EAAC,eAAK,CAAC,qJAEtC,yBAEI,EAAe,cAEf,EAAgD,QAChD,EAAgD,QAChD,EAA4C,QAC5C,EAA0C,SAE/C,KAPK,eAAe,EAEf,UAAC,EAAQ;QAAN,IAAI,UAAA;IAAO,OAAA,IAAI,KAAK,SAAS,IAAI,YAAY;AAAlC,CAAkC,EAChD,UAAC,EAAQ;QAAN,IAAI,UAAA;IAAO,OAAA,IAAI,KAAK,SAAS,IAAI,YAAY;AAAlC,CAAkC,EAChD,UAAC,EAAQ;QAAN,IAAI,UAAA;IAAO,OAAA,IAAI,KAAK,OAAO,IAAI,UAAU;AAA9B,CAA8B,EAC5C,UAAC,EAAQ;QAAN,IAAI,UAAA;IAAO,OAAA,IAAI,KAAK,MAAM,IAAI,SAAS;AAA5B,CAA4B,EAE/C;AAEY,QAAA,2BAA2B,GAAG,gBAAM,CAAC,GAAG,8UAAA,2QAkBpD,KAAA;AAEY,QAAA,kBAAkB,GAAG,gBAAM,CAAC,GAAG,wGAAA,qCAG3C,KAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/Alert/types.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import 'antd/es/alert/style/css';
3
- import { CustomAlertProps } from './types';
4
- declare const CustomAlert: ({ type, message, closable, icon, showIcon, onClose, title }: CustomAlertProps) => JSX.Element | null;
5
- export default CustomAlert;
@@ -1 +0,0 @@
1
- export { default } from './Alert';
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const StyledAlert: import("@emotion/styled-base").StyledComponent<import("antd/es/alert").AlertProps & {
3
- children?: import("react").ReactNode;
4
- }, {
5
- type: 'success' | 'warning' | 'error' | 'info';
6
- }, object>;
7
- export declare const StyledAlertMessageContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
8
- export declare const AlertIconContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { AlertProps } from 'antd/es/alert';
3
- export type CustomAlertProps = Pick<AlertProps, 'type' | 'closable' | 'icon' | 'showIcon'> & {
4
- title?: React.ReactNode;
5
- onClose?: () => void;
6
- message?: React.ReactNode;
7
- };