@tecsinapse/react-charts 1.3.7 → 1.4.1-beta.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.
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 TecSinapse
3
+ Copyright (c) 2024 TecSinapse
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -4,8 +4,7 @@
4
4
 
5
5
  [![Stars](https://img.shields.io/github/stars/tecsinapse/design-system?style=social)](https://github.com/tecsinapse/design-system/) [![License](https://img.shields.io/github/license/tecsinapse/design-system)](./LICENSE.md) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE_OF_CONDUCT.md)![build workflow](https://github.com/tecsinapse/design-system/actions/workflows/ci.yml/badge.svg)
6
6
 
7
-
8
- [TecSinapse Design System](https://tecsinapse.github.io/design-system) is the hybrid implementation of the [TecSinapse](https://www.tecsinapse.com.br/) Design System.
7
+ [TecSinapse Design System](https://tecsinapse.github.io/design-system) is the hybrid implementation of the [TecSinapse](https://www.tecsinapse.com.br/) Design System.
9
8
  Our primary goal is to create a system that can be used to build a wide variety of TecSinapase websites and apps, while providing a consistent and inclusive user experience to our end users.
10
9
  In addition, the design system and component library should be easy to use for developers and designers.
11
10
 
@@ -24,11 +23,12 @@ Here are a few helpful links for getting started:
24
23
  ## Packages
25
24
 
26
25
  | Package | Content | Version |
27
- |-----------------------------------------------------------------|------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
26
+ | --------------------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
28
27
  | **[@tecsinapse/react-core](./packages/react-core)** | the core hybrid React component library | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-core.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-core) |
29
28
  | **[@tecsinapse/react-web-kit](./packages/react-web-kit)** | the React component library focused on web | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-web-kit.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-web-kit) |
30
29
  | **[@tecsinapse/react-native-kit](./packages/react-native-kit)** | the React native component library focused on mobile | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-native-kit.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-native-kit) |
31
30
  | **[@tecsinapse/react-charts](./packages/react-charts)** | Charts for React based on SVG | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-charts.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-charts) |
31
+ | **[@tecsinapse/cortex-core](./packages/cortex-core)** | The core library for tailwindcss based design | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Fcortex-core.svg)](https://badge.fury.io/js/%40tecsinapse%2Fcortex-core) |
32
32
 
33
33
  ## Code of conduct
34
34
 
@@ -41,27 +41,29 @@ If you feel another member of the community violated our code or you are experie
41
41
  At times, it may be necessary to test changes directly in a product, and not in the design system, and for this to work in a less laborious way, we can follow the steps below:
42
42
 
43
43
  3 terminal tabs should open:
44
+
44
45
  - In one run the JS code watch:
46
+
45
47
  ```
46
48
  yarn build:watch
47
49
  ```
50
+
48
51
  - In another run the watch of the TS code watch
52
+
49
53
  ```
50
54
  yarn build:declarations:watch
51
55
  ```
56
+
52
57
  - On another run yalc push (this script updates linked local projects)
58
+
53
59
  ```
54
60
  yarn yalc:push
55
61
  ```
56
62
 
57
63
  With that, all changes will be in yalc locally.
58
64
 
59
- To access in your application, see this [example](https://github.com/tecsinapse/vendas-web-poc-playground#tools) in topic "**Yalc link Design System:**"
60
-
61
-
62
65
  ### Maintainers
63
66
 
64
- - [Beatriz Silva](mailto:beatriz.silva@tecsinapse.com.br)
65
67
  - [Denner Vidal](mailto:denner.vidal@tecsinapse.com.br)
66
68
  - [Gabriel Sanches](mailto:gabriel.sanches@tecsinapse.com.br)
67
69
  - [Lucas Ramos](mailto:lucas.ramos@tecsinapse.com.br)
@@ -5,8 +5,7 @@ var constants = require('../../styles/constants.js');
5
5
  var functions = require('../../styles/functions.js');
6
6
 
7
7
  const getCallback = (value, label, fn) => {
8
- if (!fn)
9
- return {};
8
+ if (!fn) return {};
10
9
  return reactNative.Platform.OS === "web" ? {
11
10
  onClick: () => fn?.(value, label)
12
11
  } : {
@@ -3,8 +3,7 @@ import { fontColor } from '../../styles/constants.js';
3
3
  import { getFontFamilyAndWeight } from '../../styles/functions.js';
4
4
 
5
5
  const getCallback = (value, label, fn) => {
6
- if (!fn)
7
- return {};
6
+ if (!fn) return {};
8
7
  return Platform.OS === "web" ? {
9
8
  onClick: () => fn?.(value, label)
10
9
  } : {
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const Dot: ({ color }: {
3
+ color: string;
4
+ }) => JSX.Element;
5
+ export default Dot;
@@ -0,0 +1 @@
1
+ export { default as Dot } from './Dot';
@@ -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,11 @@
1
+ import React from 'react';
2
+ import { FontFamily, PieChartData } from '../../types';
3
+ interface LabelProps {
4
+ columns: number;
5
+ data: PieChartData;
6
+ chartConfig?: {
7
+ fontFamily: FontFamily;
8
+ };
9
+ }
10
+ declare const Label: React.FC<LabelProps>;
11
+ export default Label;
@@ -0,0 +1 @@
1
+ export { default as Label } from './Label';
@@ -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
+ }>;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { FontFamily, PieChartData, SvgTextType } from '../../types';
3
+ export interface PieChartProps {
4
+ data: PieChartData[];
5
+ dimension?: number;
6
+ radius?: number;
7
+ label?: string;
8
+ labelProps?: SvgTextType;
9
+ sub?: string;
10
+ subProps?: SvgTextType;
11
+ columns?: number;
12
+ chartConfig?: {
13
+ fontFamily: FontFamily;
14
+ };
15
+ }
16
+ declare const PieChart: React.FC<PieChartProps>;
17
+ export default PieChart;
@@ -0,0 +1,26 @@
1
+ import { AlignmentBaseline, FontFamily, FontWeight, SvgTextType, TextAnchor } from '../../types';
2
+ type CallbackReturn = Record<string, unknown> | {
3
+ onClick: () => undefined;
4
+ } | {
5
+ onPress: () => undefined;
6
+ };
7
+ export declare const getCallback: (value: number, label?: string, fn?: (value: number, label?: string) => void) => CallbackReturn;
8
+ type FeaturedType = {
9
+ arc: {
10
+ outerRadius: string;
11
+ };
12
+ };
13
+ export declare const getFeatured: (featured: boolean) => FeaturedType;
14
+ type TextStylesReturn = {
15
+ fontFamily: string;
16
+ y: number | undefined;
17
+ fontSize: number | undefined;
18
+ textAnchor: TextAnchor;
19
+ fill: string;
20
+ alignmentBaseline: AlignmentBaseline;
21
+ fontWeight: string;
22
+ };
23
+ export declare const getTextStyles: (styles: SvgTextType | undefined, defaultFontWeight: FontWeight, chartConfig: {
24
+ fontFamily: FontFamily;
25
+ } | undefined) => TextStylesReturn;
26
+ export {};
@@ -0,0 +1 @@
1
+ export { default as PieChart } from './PieChart';
@@ -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
+ }>;
@@ -0,0 +1 @@
1
+ export { PieChart } from './PieChart';
@@ -0,0 +1,3 @@
1
+ export * from './components';
2
+ export * from './types';
3
+ export * from './styles';
@@ -0,0 +1,49 @@
1
+ export declare const fontColor: {
2
+ light: string;
3
+ medium: string;
4
+ dark: string;
5
+ orange: string;
6
+ };
7
+ export declare const spacing: {
8
+ nano: string;
9
+ micro: string;
10
+ mili: string;
11
+ centi: string;
12
+ deca: string;
13
+ kilo: string;
14
+ mega: string;
15
+ giga: string;
16
+ tera: string;
17
+ peta: string;
18
+ hexa: string;
19
+ };
20
+ export declare const iconSize: {
21
+ micro: string;
22
+ mili: string;
23
+ centi: string;
24
+ deca: string;
25
+ kilo: string;
26
+ mega: string;
27
+ };
28
+ export declare const borderRadius: {
29
+ nano: string;
30
+ micro: string;
31
+ mili: string;
32
+ centi: string;
33
+ deca: string;
34
+ pill: string;
35
+ };
36
+ export declare const fontStack: {
37
+ default: string;
38
+ mono: string;
39
+ };
40
+ export declare const fontWeight: {
41
+ regular: string;
42
+ bold: string;
43
+ black: string;
44
+ };
45
+ export declare const nativeFontStack: {
46
+ black: string;
47
+ bold: string;
48
+ regular: string;
49
+ };
@@ -0,0 +1,5 @@
1
+ import { FontFamily, FontWeight } from '../types';
2
+ export declare const getFontFamilyAndWeight: (fontFamily: FontFamily | undefined, weight: FontWeight) => {
3
+ fontFamily: string;
4
+ fontWeight: string;
5
+ };
@@ -0,0 +1,2 @@
1
+ export * from './constants';
2
+ export * from './functions';
@@ -0,0 +1,6 @@
1
+ export type FontWeight = 'regular' | 'bold' | 'black';
2
+ export type FontFamily = {
3
+ regular: string;
4
+ bold: string;
5
+ black: string;
6
+ };
@@ -0,0 +1,3 @@
1
+ export * from './svg';
2
+ export * from './pie';
3
+ export * from './font';
@@ -0,0 +1,7 @@
1
+ export type PieChartData = {
2
+ value: number;
3
+ label: string;
4
+ featured?: boolean;
5
+ color: string;
6
+ onPress?: (value: number, label?: string) => void;
7
+ };
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-charts",
3
- "version": "1.3.7",
3
+ "version": "1.4.1-beta.0",
4
4
  "description": "Charts for React and React Native",
5
5
  "homepage": "https://github.com/tecsinapse/design-system/",
6
6
  "license": "MIT",
@@ -24,10 +24,10 @@
24
24
  "react-native-svg": "13.9.0"
25
25
  },
26
26
  "scripts": {
27
- "dev": "yarn build:es --watch",
27
+ "dev": "rollup --config --watch",
28
+ "dev:dts": "tsc --project tsconfig.build.json --watch",
28
29
  "build:es": "rollup --config",
29
- "build:declaration": "tsc --project tsconfig.build.json",
30
- "build:declaration:watch": "tsc --project tsconfig.build.json --watch"
30
+ "build:dts": "tsc --project tsconfig.build.json"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "react": ">=16.8.0",
@@ -37,5 +37,5 @@
37
37
  "bugs": {
38
38
  "url": "https://github.com/tecsinapse/design-system/issues"
39
39
  },
40
- "gitHead": "0f89f7320ecbcee514b03329d97f224171d51933"
40
+ "gitHead": "1218e25f944ce08275fdb79e411883667a0a3e45"
41
41
  }