@tecsinapse/react-charts 0.0.2 → 1.0.0

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 (101) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +78 -0
  3. package/dist/cjs/components/Dot/Dot.js +10 -0
  4. package/dist/cjs/components/Dot/styled.js +24 -0
  5. package/dist/cjs/components/Label/Label.js +14 -0
  6. package/dist/cjs/components/Label/styled.js +35 -0
  7. package/dist/cjs/components/PieChart/PieChart.js +95 -0
  8. package/dist/cjs/components/PieChart/functions.js +42 -0
  9. package/dist/cjs/components/PieChart/styled.js +22 -0
  10. package/dist/cjs/index.js +17 -0
  11. package/dist/cjs/styles/constants.js +65 -0
  12. package/dist/cjs/styles/functions.js +14 -0
  13. package/dist/esm/components/Dot/Dot.js +8 -0
  14. package/{src/components/Dot/styled.ts → dist/esm/components/Dot/styled.js} +5 -4
  15. package/dist/esm/components/Label/Label.js +12 -0
  16. package/dist/esm/components/Label/styled.js +32 -0
  17. package/dist/esm/components/PieChart/PieChart.js +93 -0
  18. package/dist/esm/components/PieChart/functions.js +38 -0
  19. package/{src/components/PieChart/styled.ts → dist/esm/components/PieChart/styled.js} +4 -3
  20. package/dist/esm/index.js +3 -0
  21. package/dist/esm/styles/constants.js +57 -0
  22. package/dist/esm/styles/functions.js +12 -0
  23. package/dist/types/components/Dot/styled.d.ts +16 -0
  24. package/dist/types/components/Label/styled.d.ts +23 -0
  25. package/dist/{components → types/components}/PieChart/functions.d.ts +4 -4
  26. package/dist/types/components/PieChart/styled.d.ts +14 -0
  27. package/dist/types/index.d.ts +3 -3
  28. package/{src/types/font.ts → dist/types/types/font.d.ts} +3 -4
  29. package/dist/types/{pie.d.ts → types/pie.d.ts} +1 -1
  30. package/dist/types/types/svg.d.ts +11 -0
  31. package/package.json +24 -79
  32. package/dist/components/Dot/Dot.js +0 -24
  33. package/dist/components/Dot/Dot.js.map +0 -1
  34. package/dist/components/Dot/index.js +0 -16
  35. package/dist/components/Dot/index.js.map +0 -1
  36. package/dist/components/Dot/styled.d.ts +0 -16
  37. package/dist/components/Dot/styled.js +0 -35
  38. package/dist/components/Dot/styled.js.map +0 -1
  39. package/dist/components/Label/Label.js +0 -40
  40. package/dist/components/Label/Label.js.map +0 -1
  41. package/dist/components/Label/index.js +0 -16
  42. package/dist/components/Label/index.js.map +0 -1
  43. package/dist/components/Label/styled.d.ts +0 -23
  44. package/dist/components/Label/styled.js +0 -59
  45. package/dist/components/Label/styled.js.map +0 -1
  46. package/dist/components/PieChart/PieChart.js +0 -97
  47. package/dist/components/PieChart/PieChart.js.map +0 -1
  48. package/dist/components/PieChart/functions.js +0 -50
  49. package/dist/components/PieChart/functions.js.map +0 -1
  50. package/dist/components/PieChart/index.js +0 -16
  51. package/dist/components/PieChart/index.js.map +0 -1
  52. package/dist/components/PieChart/styled.d.ts +0 -14
  53. package/dist/components/PieChart/styled.js +0 -30
  54. package/dist/components/PieChart/styled.js.map +0 -1
  55. package/dist/components/index.js +0 -14
  56. package/dist/components/index.js.map +0 -1
  57. package/dist/index.d.ts +0 -3
  58. package/dist/index.js +0 -45
  59. package/dist/index.js.map +0 -1
  60. package/dist/styles/constants.js +0 -63
  61. package/dist/styles/constants.js.map +0 -1
  62. package/dist/styles/functions.js +0 -21
  63. package/dist/styles/functions.js.map +0 -1
  64. package/dist/styles/index.js +0 -32
  65. package/dist/styles/index.js.map +0 -1
  66. package/dist/types/font.d.ts +0 -6
  67. package/dist/types/font.js +0 -6
  68. package/dist/types/font.js.map +0 -1
  69. package/dist/types/index.js +0 -45
  70. package/dist/types/index.js.map +0 -1
  71. package/dist/types/pie.js +0 -6
  72. package/dist/types/pie.js.map +0 -1
  73. package/dist/types/svg.d.ts +0 -11
  74. package/dist/types/svg.js +0 -6
  75. package/dist/types/svg.js.map +0 -1
  76. package/src/components/Dot/Dot.tsx +0 -12
  77. package/src/components/Dot/index.ts +0 -1
  78. package/src/components/Label/Label.tsx +0 -31
  79. package/src/components/Label/index.ts +0 -1
  80. package/src/components/Label/styled.ts +0 -47
  81. package/src/components/PieChart/PieChart.tsx +0 -122
  82. package/src/components/PieChart/functions.ts +0 -70
  83. package/src/components/PieChart/index.ts +0 -1
  84. package/src/components/index.ts +0 -1
  85. package/src/index.ts +0 -3
  86. package/src/styles/constants.ts +0 -55
  87. package/src/styles/functions.ts +0 -17
  88. package/src/styles/index.ts +0 -2
  89. package/src/types/pie.ts +0 -7
  90. package/src/types/svg.ts +0 -31
  91. /package/dist/{components → types/components}/Dot/Dot.d.ts +0 -0
  92. /package/dist/{components → types/components}/Dot/index.d.ts +0 -0
  93. /package/dist/{components → types/components}/Label/Label.d.ts +0 -0
  94. /package/dist/{components → types/components}/Label/index.d.ts +0 -0
  95. /package/dist/{components → types/components}/PieChart/PieChart.d.ts +0 -0
  96. /package/dist/{components → types/components}/PieChart/index.d.ts +0 -0
  97. /package/dist/{components → types/components}/index.d.ts +0 -0
  98. /package/dist/{styles → types/styles}/constants.d.ts +0 -0
  99. /package/dist/{styles → types/styles}/functions.d.ts +0 -0
  100. /package/dist/{styles → types/styles}/index.d.ts +0 -0
  101. /package/{src/types/index.ts → dist/types/types/index.d.ts} +0 -0
@@ -1,18 +1,19 @@
1
1
  import styled from '@emotion/native';
2
2
  import { View } from 'react-native';
3
3
 
4
- export const Container = styled(View)`
4
+ const Container = styled(View)`
5
5
  display: flex;
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  justify-content: space-between;
9
9
  flex: 1;
10
10
  `;
11
-
12
- export const LabelsContainer = styled(View)`
11
+ const LabelsContainer = styled(View)`
13
12
  display: flex;
14
13
  flex-direction: row;
15
14
  flex-wrap: wrap;
16
15
  justify-content: space-between;
17
16
  width: 100%;
18
17
  `;
18
+
19
+ export { Container, LabelsContainer };
@@ -0,0 +1,3 @@
1
+ export { default as PieChart } from './components/PieChart/PieChart.js';
2
+ export { borderRadius, fontColor, fontStack, fontWeight, iconSize, nativeFontStack, spacing } from './styles/constants.js';
3
+ export { getFontFamilyAndWeight } from './styles/functions.js';
@@ -0,0 +1,57 @@
1
+ const fontColor = {
2
+ light: "#fff",
3
+ medium: "#85807a",
4
+ dark: "#353231",
5
+ // default
6
+ orange: "#f89907"
7
+ };
8
+ const spacing = {
9
+ nano: "2px",
10
+ micro: "4px",
11
+ mili: "8px",
12
+ centi: "12px",
13
+ deca: "16px",
14
+ kilo: "24px",
15
+ mega: "32px",
16
+ giga: "40px",
17
+ tera: "48px",
18
+ peta: "56px",
19
+ hexa: "64px"
20
+ };
21
+ const iconSize = {
22
+ micro: "12px",
23
+ mili: "14px",
24
+ centi: "16px",
25
+ // '1rem'
26
+ deca: "18px",
27
+ // '1.5rem'
28
+ kilo: "24px",
29
+ // '1.6rem'
30
+ mega: "32px"
31
+ // '2rem'
32
+ };
33
+ const borderRadius = {
34
+ nano: "2px",
35
+ micro: "4px",
36
+ mili: "8px",
37
+ centi: "16px",
38
+ deca: "24px",
39
+ pill: "999999px"
40
+ // also circle
41
+ };
42
+ const fontStack = {
43
+ default: "Lato",
44
+ mono: "Consolas, monaco, monospace"
45
+ };
46
+ const fontWeight = {
47
+ regular: "400",
48
+ bold: "700",
49
+ black: "900"
50
+ };
51
+ const nativeFontStack = {
52
+ black: "Lato-Black",
53
+ bold: "Lato-Bold",
54
+ regular: "Lato-Regular"
55
+ };
56
+
57
+ export { borderRadius, fontColor, fontStack, fontWeight, iconSize, nativeFontStack, spacing };
@@ -0,0 +1,12 @@
1
+ import { Platform } from 'react-native';
2
+ import { fontStack, fontWeight, nativeFontStack } from './constants.js';
3
+
4
+ const getFontFamilyAndWeight = (fontFamily, weight) => Platform.OS === "web" ? {
5
+ fontFamily: fontFamily ? fontFamily[weight] : fontStack.default,
6
+ fontWeight: fontWeight[weight]
7
+ } : {
8
+ fontFamily: fontFamily ? fontFamily[weight] : nativeFontStack[weight],
9
+ fontWeight: fontWeight[weight]
10
+ };
11
+
12
+ export { getFontFamilyAndWeight };
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { View } from 'react-native';
3
+ export declare const Circle: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ } & {
7
+ color: string;
8
+ }, {}, {
9
+ ref?: import("react").Ref<View> | undefined;
10
+ }>;
11
+ export declare const CircleDot: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
12
+ theme?: import("@emotion/react").Theme | undefined;
13
+ as?: import("react").ElementType<any> | undefined;
14
+ }, {}, {
15
+ ref?: import("react").Ref<View> | undefined;
16
+ }>;
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ import { Text as RNText, View } from 'react-native';
3
+ export declare const Container: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ } & {
7
+ columns: number;
8
+ }, {}, {
9
+ ref?: import("react").Ref<View> | undefined;
10
+ }>;
11
+ export declare const Text: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
12
+ theme?: import("@emotion/react").Theme | undefined;
13
+ as?: import("react").ElementType<any> | undefined;
14
+ } & {
15
+ font: {
16
+ fontFamily: string;
17
+ fontWeight: string;
18
+ };
19
+ expand?: boolean | undefined;
20
+ flexEnd?: boolean | undefined;
21
+ }, {}, {
22
+ ref?: import("react").Ref<RNText> | undefined;
23
+ }>;
@@ -1,17 +1,17 @@
1
1
  import { AlignmentBaseline, FontFamily, FontWeight, SvgTextType, TextAnchor } from '../../types';
2
- declare type CallbackReturn = Record<string, unknown> | {
2
+ type CallbackReturn = Record<string, unknown> | {
3
3
  onClick: () => undefined;
4
4
  } | {
5
5
  onPress: () => undefined;
6
6
  };
7
- export declare const getCallback: (value: number, label?: string | undefined, fn?: ((value: number, label?: string | undefined) => void) | undefined) => CallbackReturn;
8
- declare type FeaturedType = {
7
+ export declare const getCallback: (value: number, label?: string, fn?: ((value: number, label?: string) => void) | undefined) => CallbackReturn;
8
+ type FeaturedType = {
9
9
  arc: {
10
10
  outerRadius: string;
11
11
  };
12
12
  };
13
13
  export declare const getFeatured: (featured: boolean) => FeaturedType;
14
- declare type TextStylesReturn = {
14
+ type TextStylesReturn = {
15
15
  fontFamily: string;
16
16
  y: number | undefined;
17
17
  fontSize: number | undefined;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { View } from 'react-native';
3
+ export declare const Container: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ }, {}, {
7
+ ref?: import("react").Ref<View> | undefined;
8
+ }>;
9
+ export declare const LabelsContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ as?: import("react").ElementType<any> | undefined;
12
+ }, {}, {
13
+ ref?: import("react").Ref<View> | undefined;
14
+ }>;
@@ -1,3 +1,3 @@
1
- export * from './svg';
2
- export * from './pie';
3
- export * from './font';
1
+ export * from './components';
2
+ export * from './types';
3
+ export * from './styles';
@@ -1,7 +1,6 @@
1
1
  export type FontWeight = 'regular' | 'bold' | 'black';
2
-
3
2
  export type FontFamily = {
4
- regular: string;
5
- bold: string;
6
- black: string;
3
+ regular: string;
4
+ bold: string;
5
+ black: string;
7
6
  };
@@ -1,4 +1,4 @@
1
- export declare type PieChartData = {
1
+ export type PieChartData = {
2
2
  value: number;
3
3
  label: string;
4
4
  featured?: boolean;
@@ -0,0 +1,11 @@
1
+ import { FontWeight } from './font';
2
+ export type AlignmentBaseline = 'baseline' | 'text-bottom' | 'alphabetic' | 'ideographic' | 'middle' | 'central' | 'mathematical' | 'text-top' | 'bottom' | 'center' | 'top' | 'text-before-edge' | 'text-after-edge' | 'before-edge' | 'after-edge' | 'hanging';
3
+ export type TextAnchor = 'start' | 'middle' | 'end';
4
+ export type SvgTextType = {
5
+ textAnchor?: TextAnchor;
6
+ alignmentBaseline?: AlignmentBaseline;
7
+ fontSize?: number;
8
+ fontWeight?: FontWeight;
9
+ fill?: string;
10
+ y?: number;
11
+ };
package/package.json CHANGED
@@ -1,96 +1,41 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-charts",
3
- "version": "0.0.2",
3
+ "version": "1.0.0",
4
+ "description": "Charts for React and React Native",
5
+ "homepage": "https://github.com/tecsinapse/design-system/",
4
6
  "license": "MIT",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "files": ["dist", "src"],
8
- "scripts": {
9
- "start": "expo start",
10
- "android": "expo start --android",
11
- "ios": "expo start --ios",
12
- "web": "expo start --web",
13
- "prebuild": "rimraf -rf dist/",
14
- "build": "yarn build:es",
15
- "postbuild": "yarn build:ts",
16
- "build:ts": "tsc --project tsconfig.build.json",
17
- "build:es": "cross-env BABEL_ENV=build babel src --root-mode upward --out-dir dist --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
18
- "eject": "expo eject",
19
- "prepublish": "yarn build",
20
- "prettify": "prettier --write ./src/**/*.{ts,tsx,json} && prettier --write *.{ts,tsx,json}",
21
- "lint:ts": "eslint 'src/**/*.ts{,x}'",
22
- "tsc": "tsc"
7
+ "main": "dist/esm/index.js",
8
+ "module": "dist/esm/index.js",
9
+ "types": "dist/types/index.d.ts",
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "directory": "packages/react-charts",
16
+ "url": "git+https://github.com/tecsinapse/design-system.git"
23
17
  },
24
18
  "dependencies": {
25
- "@emotion/native": "^11.0.0",
26
- "@emotion/react": "^11.4.1",
27
- "@types/react-native-svg-charts": "^5.0.9",
19
+ "@emotion/native": "~11.11.0",
20
+ "@emotion/react": "~11.11.0",
28
21
  "react-native-svg-charts": "^5.4.0"
29
22
  },
30
23
  "devDependencies": {
31
- "@babel/cli": "^7.9.0",
32
- "@babel/core": "^7.9.0",
33
- "@babel/preset-env": "^7.9.0",
34
- "@babel/preset-react": "^7.9.0",
35
- "@babel/preset-typescript": "^7.9.0",
36
- "@expo-google-fonts/lato": "^0.2.0",
37
- "@types/react": "~16.9.35",
38
- "@types/react-native": "~0.63.2",
39
- "@typescript-eslint/eslint-plugin": "^4.21.0",
40
- "@typescript-eslint/parser": "^4.21.0",
41
- "babel-core": "^7.0.0-bridge.0",
42
- "babel-plugin-module-resolver": "^4.1.0",
43
- "cross-env": "^7.0.3",
44
- "eslint": "^7.24.0",
45
- "eslint-config-prettier": "^8.1.0",
46
- "eslint-plugin-import": "^2.22.1",
47
- "eslint-plugin-prettier": "^3.3.1",
48
- "eslint-plugin-react": "^7.23.2",
49
- "expo": "~42.0.1",
50
- "expo-app-loading": "^1.1.2",
51
- "expo-font": "~9.2.1",
52
- "expo-status-bar": "~1.0.4",
53
- "husky": "^4.3.8",
54
- "lint-staged": "^10.5.4",
55
- "prettier": "^2.4.1",
56
- "react": "16.13.1",
57
- "react-dom": "16.13.1",
58
- "react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz",
59
- "react-native-svg": "^12.1.1",
60
- "react-native-web": "~0.13.12",
61
- "rimraf": "^3.0.2",
62
- "typescript": "~4.0.0"
24
+ "react-native-svg": "13.9.0"
63
25
  },
64
- "engines": {
65
- "node": ">=14"
66
- },
67
- "resolutions": {
68
- "babel-core": "^7.0.0-bridge.0"
26
+ "scripts": {
27
+ "dev": "rollup --watch",
28
+ "build:es": "rollup --config",
29
+ "build:declaration": "tsc --project tsconfig.build.json",
30
+ "build:declaration:watch": "tsc --project tsconfig.build.json --watch"
69
31
  },
70
32
  "peerDependencies": {
71
33
  "react": ">=16.8.0",
72
34
  "react-native": ">=0.64.0",
73
35
  "react-native-svg": ">=12.0.0"
74
36
  },
75
- "husky": {
76
- "hooks": {
77
- "pre-commit": "lint-staged",
78
- "post-commit": "git update-index --again"
79
- }
80
- },
81
- "lint-staged": {
82
- ".{ts,tsx}": [
83
- "yarn lint",
84
- "yarn prettify",
85
- "git add ."
86
- ]
87
- },
88
- "repository": {
89
- "type": "git",
90
- "directory": "src",
91
- "url": "git+ssh://git@github.com/tecsinapse/react-charts.git"
92
- },
93
37
  "bugs": {
94
- "url": "https://github.com/tecsinapse/react-charts/issues"
95
- }
38
+ "url": "https://github.com/tecsinapse/design-system/issues"
39
+ },
40
+ "gitHead": "59db148f23b2b94e8db779e035b43e58a0104fed"
96
41
  }
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _styled = require("./styled");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- const Dot = ({
15
- color
16
- }) => {
17
- return _react.default.createElement(_styled.Circle, {
18
- color: color
19
- }, _react.default.createElement(_styled.CircleDot, null));
20
- };
21
-
22
- var _default = Dot;
23
- exports.default = _default;
24
- //# sourceMappingURL=Dot.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Dot/Dot.tsx"],"names":["Dot","color"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA,MAAMA,GAAG,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAA+C;AACzD,SACE,6BAAC,cAAD;AAAQ,IAAA,KAAK,EAAEA;AAAf,KACE,6BAAC,iBAAD,OADF,CADF;AAKD,CAND;;eAQeD,G","sourcesContent":["import React from 'react';\nimport { CircleDot, Circle } from './styled';\n\nconst Dot = ({ color }: { color: string }): JSX.Element => {\n return (\n <Circle color={color}>\n <CircleDot />\n </Circle>\n );\n};\n\nexport default Dot;\n"],"file":"Dot.js"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Dot", {
7
- enumerable: true,
8
- get: function () {
9
- return _Dot.default;
10
- }
11
- });
12
-
13
- var _Dot = _interopRequireDefault(require("./Dot"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Dot/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA","sourcesContent":["export { default as Dot } from './Dot';\n"],"file":"index.js"}
@@ -1,16 +0,0 @@
1
- /// <reference types="react" />
2
- import { View } from 'react-native';
3
- export declare const Circle: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
- theme?: import("@emotion/react").Theme | undefined;
5
- as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
6
- } & {
7
- color: string;
8
- }, {}, {
9
- ref?: ((instance: View | null) => void) | import("react").RefObject<View> | null | undefined;
10
- }>;
11
- export declare const CircleDot: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
12
- theme?: import("@emotion/react").Theme | undefined;
13
- as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
14
- }, {}, {
15
- ref?: ((instance: View | null) => void) | import("react").RefObject<View> | null | undefined;
16
- }>;
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CircleDot = exports.Circle = void 0;
7
-
8
- var _native = _interopRequireDefault(require("@emotion/native"));
9
-
10
- var _reactNative = require("react-native");
11
-
12
- var _styles = require("../../styles");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- const Circle = (0, _native.default)(_reactNative.View)`
17
- background-color: ${({
18
- color
19
- }) => color};
20
- width: ${_styles.iconSize.micro};
21
- height: ${_styles.iconSize.micro};
22
- border-radius: ${_styles.borderRadius.pill};
23
- justify-content: center;
24
- align-items: center;
25
- margin-right: ${_styles.spacing.centi};
26
- `;
27
- exports.Circle = Circle;
28
- const CircleDot = (0, _native.default)(_reactNative.View)`
29
- background-color: #fff;
30
- width: 4px;
31
- height: 4px;
32
- border-radius: ${_styles.borderRadius.pill};
33
- `;
34
- exports.CircleDot = CircleDot;
35
- //# sourceMappingURL=styled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Dot/styled.ts"],"names":["Circle","View","color","iconSize","micro","borderRadius","pill","spacing","centi","CircleDot"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEO,MAAMA,MAAM,GAAG,qBAAOC,iBAAP,CAAgC;AACtD,sBAAsB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAM;AAC3C,WAAWC,iBAASC,KAAM;AAC1B,YAAYD,iBAASC,KAAM;AAC3B,mBAAmBC,qBAAaC,IAAK;AACrC;AACA;AACA,kBAAkBC,gBAAQC,KAAM;AAChC,CARO;;AAUA,MAAMC,SAAS,GAAG,qBAAOR,iBAAP,CAAa;AACtC;AACA;AACA;AACA,mBAAmBI,qBAAaC,IAAK;AACrC,CALO","sourcesContent":["import styled from '@emotion/native';\nimport { View } from 'react-native';\nimport { borderRadius, iconSize, spacing } from '../../styles';\n\nexport const Circle = styled(View)<{ color: string }>`\n background-color: ${({ color }) => color};\n width: ${iconSize.micro};\n height: ${iconSize.micro};\n border-radius: ${borderRadius.pill};\n justify-content: center;\n align-items: center;\n margin-right: ${spacing.centi};\n`;\n\nexport const CircleDot = styled(View)`\n background-color: #fff;\n width: 4px;\n height: 4px;\n border-radius: ${borderRadius.pill};\n`;\n"],"file":"styled.js"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _Dot = require("../Dot");
11
-
12
- var _styled = require("./styled");
13
-
14
- var _styles = require("../../styles");
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- const Label = ({
19
- columns,
20
- data,
21
- chartConfig
22
- }) => {
23
- const valueFont = (0, _styles.getFontFamilyAndWeight)(chartConfig === null || chartConfig === void 0 ? void 0 : chartConfig.fontFamily, 'bold');
24
- const labelFont = (0, _styles.getFontFamilyAndWeight)(chartConfig === null || chartConfig === void 0 ? void 0 : chartConfig.fontFamily, 'regular');
25
- return _react.default.createElement(_styled.Container, {
26
- columns: columns
27
- }, _react.default.createElement(_Dot.Dot, {
28
- color: data.color
29
- }), _react.default.createElement(_styled.Text, {
30
- font: labelFont,
31
- expand: true
32
- }, data.label), _react.default.createElement(_styled.Text, {
33
- font: valueFont,
34
- flexEnd: true
35
- }, data.value));
36
- };
37
-
38
- var _default = Label;
39
- exports.default = _default;
40
- //# sourceMappingURL=Label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Label/Label.tsx"],"names":["Label","columns","data","chartConfig","valueFont","fontFamily","labelFont","color","label","value"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;AAUA,MAAMA,KAA2B,GAAG,CAAC;AAAEC,EAAAA,OAAF;AAAWC,EAAAA,IAAX;AAAiBC,EAAAA;AAAjB,CAAD,KAAoC;AACtE,QAAMC,SAAS,GAAG,oCAAuBD,WAAvB,aAAuBA,WAAvB,uBAAuBA,WAAW,CAAEE,UAApC,EAAgD,MAAhD,CAAlB;AACA,QAAMC,SAAS,GAAG,oCAAuBH,WAAvB,aAAuBA,WAAvB,uBAAuBA,WAAW,CAAEE,UAApC,EAAgD,SAAhD,CAAlB;AACA,SACE,6BAAC,iBAAD;AAAW,IAAA,OAAO,EAAEJ;AAApB,KACE,6BAAC,QAAD;AAAK,IAAA,KAAK,EAAEC,IAAI,CAACK;AAAjB,IADF,EAEE,6BAAC,YAAD;AAAM,IAAA,IAAI,EAAED,SAAZ;AAAuB,IAAA,MAAM;AAA7B,KACGJ,IAAI,CAACM,KADR,CAFF,EAKE,6BAAC,YAAD;AAAM,IAAA,IAAI,EAAEJ,SAAZ;AAAuB,IAAA,OAAO;AAA9B,KACGF,IAAI,CAACO,KADR,CALF,CADF;AAWD,CAdD;;eAgBeT,K","sourcesContent":["import React from 'react';\nimport { Dot } from '../Dot';\nimport { FontFamily, PieChartData } from '../../types';\nimport { Container, Text } from './styled';\nimport { getFontFamilyAndWeight } from '../../styles';\n\ninterface LabelProps {\n columns: number;\n data: PieChartData;\n chartConfig?: {\n fontFamily: FontFamily;\n };\n}\n\nconst Label: React.FC<LabelProps> = ({ columns, data, chartConfig }) => {\n const valueFont = getFontFamilyAndWeight(chartConfig?.fontFamily, 'bold');\n const labelFont = getFontFamilyAndWeight(chartConfig?.fontFamily, 'regular');\n return (\n <Container columns={columns}>\n <Dot color={data.color} />\n <Text font={labelFont} expand>\n {data.label}\n </Text>\n <Text font={valueFont} flexEnd>\n {data.value}\n </Text>\n </Container>\n );\n};\n\nexport default Label;\n"],"file":"Label.js"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Label", {
7
- enumerable: true,
8
- get: function () {
9
- return _Label.default;
10
- }
11
- });
12
-
13
- var _Label = _interopRequireDefault(require("./Label"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Label/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA","sourcesContent":["export { default as Label } from './Label';\n"],"file":"index.js"}
@@ -1,23 +0,0 @@
1
- /// <reference types="react" />
2
- import { Text as RNText, View } from 'react-native';
3
- export declare const Container: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
- theme?: import("@emotion/react").Theme | undefined;
5
- as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
6
- } & {
7
- columns: number;
8
- }, {}, {
9
- ref?: ((instance: View | null) => void) | import("react").RefObject<View> | null | undefined;
10
- }>;
11
- export declare const Text: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
12
- theme?: import("@emotion/react").Theme | undefined;
13
- as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
14
- } & {
15
- font: {
16
- fontFamily: string;
17
- fontWeight: string;
18
- };
19
- expand?: boolean | undefined;
20
- flexEnd?: boolean | undefined;
21
- }, {}, {
22
- ref?: ((instance: RNText | null) => void) | import("react").RefObject<RNText> | null | undefined;
23
- }>;
@@ -1,59 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Text = exports.Container = void 0;
7
-
8
- var _native = _interopRequireWildcard(require("@emotion/native"));
9
-
10
- var _reactNative = require("react-native");
11
-
12
- var _styles = require("../../styles");
13
-
14
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
-
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
-
18
- const flexBasis = columns => (0, _native.css)({
19
- flexBasis: `${100 / columns - 2}%`
20
- });
21
-
22
- const Container = (0, _native.default)(_reactNative.View)(({
23
- columns
24
- }) => (0, _native.css)`
25
- display: flex;
26
- flex-direction: row;
27
- align-items: center;
28
- margin-bottom: ${_styles.spacing.centi};
29
- ${flexBasis(columns)}
30
- `);
31
- exports.Container = Container;
32
-
33
- const expandStyles = expand => expand && (0, _native.css)`
34
- flex: 1;
35
- `;
36
-
37
- const flexEndStyles = flexEnd => flexEnd && (0, _native.css)`
38
- justify-content: flex-end;
39
- `;
40
-
41
- const Text = (0, _native.default)(_reactNative.Text)(({
42
- font,
43
- expand = false,
44
- flexEnd = false
45
- }) => {
46
- const {
47
- fontFamily,
48
- fontWeight
49
- } = font;
50
- return (0, _native.css)`
51
- font-size: 14px;
52
- font-family: ${fontFamily};
53
- font-weight: ${fontWeight};
54
- ${expandStyles(expand)}
55
- ${flexEndStyles(flexEnd)}
56
- `;
57
- });
58
- exports.Text = Text;
59
- //# sourceMappingURL=styled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Label/styled.ts"],"names":["flexBasis","columns","Container","View","spacing","centi","expandStyles","expand","flexEndStyles","flexEnd","Text","RNText","font","fontFamily","fontWeight"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAEA,MAAMA,SAAS,GAAIC,OAAD,IAChB,iBAAI;AAAED,EAAAA,SAAS,EAAG,GAAE,MAAMC,OAAN,GAAgB,CAAE;AAAlC,CAAJ,CADF;;AAGO,MAAMC,SAAS,GAAG,qBAAOC,iBAAP,EACvB,CAAC;AAAEF,EAAAA;AAAF,CAAD,KACE,gBAAI;AACR;AACA;AACA;AACA,uBAAuBG,gBAAQC,KAAM;AACrC,QAAQL,SAAS,CAACC,OAAD,CAAU;AAC3B,KARyB,CAAlB;;;AAWP,MAAMK,YAAY,GAAIC,MAAD,IACnBA,MAAM,IACN,gBAAI;AACN;AACA,GAJA;;AAMA,MAAMC,aAAa,GAAIC,OAAD,IACpBA,OAAO,IACP,gBAAI;AACN;AACA,GAJA;;AAMO,MAAMC,IAAI,GAAG,qBAAOC,iBAAP,EAOjB,CAAC;AAAEC,EAAAA,IAAF;AAAQL,EAAAA,MAAM,GAAG,KAAjB;AAAwBE,EAAAA,OAAO,GAAG;AAAlC,CAAD,KAA+C;AAChD,QAAM;AAAEI,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA6BF,IAAnC;AACA,SAAO,gBAAI;AACb;AACA,mBAAmBC,UAAW;AAC9B,mBAAmBC,UAAW;AAC9B,MAAMR,YAAY,CAACC,MAAD,CAAS;AAC3B,MAAMC,aAAa,CAACC,OAAD,CAAU;AAC7B,GANE;AAOD,CAhBmB,CAAb","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { Text as RNText, View } from 'react-native';\nimport { spacing } from '../../styles';\n\nconst flexBasis = (columns: number) =>\n css({ flexBasis: `${100 / columns - 2}%` });\n\nexport const Container = styled(View)<{ columns: number }>(\n ({ columns }) =>\n css`\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: ${spacing.centi};\n ${flexBasis(columns)}\n `\n);\n\nconst expandStyles = (expand?: boolean) =>\n expand &&\n css`\n flex: 1;\n `;\n\nconst flexEndStyles = (flexEnd?: boolean) =>\n flexEnd &&\n css`\n justify-content: flex-end;\n `;\n\nexport const Text = styled(RNText)<{\n font: {\n fontFamily: string;\n fontWeight: string;\n };\n expand?: boolean;\n flexEnd?: boolean;\n}>(({ font, expand = false, flexEnd = false }) => {\n const { fontFamily, fontWeight } = font;\n return css`\n font-size: 14px;\n font-family: ${fontFamily};\n font-weight: ${fontWeight};\n ${expandStyles(expand)}\n ${flexEndStyles(flexEnd)}\n `;\n});\n"],"file":"styled.js"}