react-restyle-components 0.2.39 → 0.2.40

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/README.md CHANGED
@@ -9,10 +9,6 @@ yarn add react-restyle-components
9
9
 
10
10
  ```
11
11
 
12
- ## IMP : Please use before 0.2.34 version.
13
-
14
- Currently WIP
15
-
16
12
  ### 📚 Storybook
17
13
 
18
14
  https://appasaheb4.github.io/react-restyle-components
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.2.38",
3
+ "version": "0.2.39",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {
@@ -31,7 +31,7 @@ declare const meta: {
31
31
  suppressContentEditableWarning?: boolean | undefined;
32
32
  suppressHydrationWarning?: boolean | undefined;
33
33
  accessKey?: string | undefined;
34
- autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | (string & {}) | undefined;
34
+ autoCapitalize?: (string & {}) | "off" | "on" | "none" | "sentences" | "words" | "characters" | undefined;
35
35
  autoFocus?: boolean | undefined;
36
36
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
37
37
  contextMenu?: string | undefined;
@@ -72,7 +72,7 @@ declare const meta: {
72
72
  results?: number | undefined;
73
73
  security?: string | undefined;
74
74
  unselectable?: "off" | "on" | undefined;
75
- inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
75
+ inputMode?: "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined;
76
76
  is?: string | undefined;
77
77
  "aria-activedescendant"?: string | undefined;
78
78
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -86,7 +86,7 @@ declare const meta: {
86
86
  "aria-colindextext"?: string | undefined;
87
87
  "aria-colspan"?: number | undefined;
88
88
  "aria-controls"?: string | undefined;
89
- "aria-current"?: boolean | "time" | "true" | "false" | "date" | "page" | "step" | "location" | undefined;
89
+ "aria-current"?: boolean | "time" | "date" | "true" | "false" | "page" | "step" | "location" | undefined;
90
90
  "aria-describedby"?: string | undefined;
91
91
  "aria-description"?: string | undefined;
92
92
  "aria-details"?: string | undefined;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { Style } from '@react-pdf/types';
3
+ interface PdfImageProps {
4
+ src?: string | any;
5
+ style?: Style | Style[];
6
+ fixed?: boolean;
7
+ }
8
+ export declare const PdfImage: ({ src, style, }: PdfImageProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Image } from '@react-pdf/renderer';
3
+ export const PdfImage = ({ src = 'https://picsum.photos/200/300', style, }) => {
4
+ return (React.createElement(React.Fragment, null,
5
+ React.createElement(Image, { style: {
6
+ ...style,
7
+ }, src: src })));
8
+ };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { Style } from '@react-pdf/types';
3
+ interface PdfTableProps {
4
+ style?: Style;
5
+ headerStyle?: Style;
6
+ headerFixed?: boolean;
7
+ fields: Array<any>;
8
+ data: Array<any>;
9
+ }
10
+ export declare const PdfTable: ({ headerFixed, fields, data, style, headerStyle, }: PdfTableProps) => React.JSX.Element;
11
+ export {};
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import { Text, View, StyleSheet } from '@react-pdf/renderer';
3
+ import { PdfSmall } from './pdf-typography.components';
4
+ import { PdfBorderView } from './pdf-wrapped-view.components';
5
+ const styles = StyleSheet.create({
6
+ table: {
7
+ borderColor: '#000000',
8
+ borderWidth: 1,
9
+ marginHorizontal: 20,
10
+ flexFlow: 1,
11
+ },
12
+ tableRow: {
13
+ flexDirection: 'row',
14
+ },
15
+ headerBg: {
16
+ backgroundColor: '#aaa',
17
+ borderStyle: 'solid',
18
+ borderColor: '#000000',
19
+ borderWidth: 1,
20
+ },
21
+ tableCellHeader: {
22
+ margin: 2,
23
+ fontSize: 10,
24
+ fontWeight: 'bold',
25
+ textAlign: 'center',
26
+ },
27
+ tableCell: {
28
+ margin: 2,
29
+ fontSize: 12,
30
+ },
31
+ textCenter: {
32
+ textAlign: 'center',
33
+ },
34
+ });
35
+ export const PdfTable = ({ headerFixed = false, fields, data, style, headerStyle, }) => (React.createElement(View, { style: [styles.table, { ...style }] },
36
+ React.createElement(View, { style: [styles.tableRow, styles.headerBg, { ...headerStyle }], fixed: headerFixed }, fields.map((item, index) => (React.createElement(View, { key: index, style: [{ width: item.width + '%' }] },
37
+ React.createElement(Text, { style: [styles.tableCellHeader] }, item?.title))))),
38
+ data?.map((item, index) => (React.createElement(View, { key: index, style: styles.tableRow }, Object.entries(item).map((_item, _idx) => (React.createElement(PdfBorderView, { key: _idx, style: {
39
+ width: fields[_idx]?.width + '%',
40
+ borderStyle: 'solid',
41
+ }, mh: 0, mv: 0, p: 0, bw: 1, borderColor: "#000000" }, typeof _item[1] == 'object' ? (React.createElement(React.Fragment, null,
42
+ React.createElement(PdfSmall, { style: { textAlign: 'center' } }, _item[1]?.panelDesc
43
+ ? `Panel Description : ${_item[1]?.panelDesc} \n`
44
+ : ''),
45
+ React.createElement(PdfSmall, { style: { textAlign: 'center' } }, _item[1]?.panelMethodName
46
+ ? `Panel Method Name: ${_item[1]?.panelMethodName} \n`
47
+ : ''),
48
+ React.createElement(PdfSmall, { style: { textAlign: 'center' } }, _item[1]?.testMethodName
49
+ ? `Test Method Name: ${_item[1]?.testMethodName} \n`
50
+ : ''),
51
+ React.createElement(PdfSmall, { style: { textAlign: 'center' } }, _item[1]?.analyteDesc
52
+ ? `Analyte Description: ${_item[1]?.analyteDesc} \n`
53
+ : ''),
54
+ React.createElement(PdfSmall, { style: { textAlign: 'center' } }, _item[1]?.analyteMethodName
55
+ ? `Analyte Method Name: ${_item[1]?.analyteMethodName}`
56
+ : ''))) : (React.createElement(PdfSmall, { style: { textAlign: 'center' } }, _item[1] || ''))))))))));
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { Style } from '@react-pdf/types';
3
+ interface PdfTextProps {
4
+ fontWeight?: 'bold' | 'medium' | 'normal';
5
+ fontSize?: number;
6
+ fontFamily?: 'ArimaRegular' | 'ArimaBold' | string;
7
+ textAlign?: 'center' | 'left' | 'right';
8
+ style?: Style | Style[];
9
+ lineHeight?: number;
10
+ bottom?: number;
11
+ fixed?: boolean;
12
+ children?: React.ReactNode;
13
+ }
14
+ export declare const PdfHeading: ({ fontWeight, fontSize, fontFamily, style, children, }: PdfTextProps) => React.JSX.Element;
15
+ export declare const PdfSubHeading: ({ fontWeight, fontSize, fontFamily, style, children, }: PdfTextProps) => React.JSX.Element;
16
+ export declare const PdfMedium: ({ fontWeight, fontSize, textAlign, fontFamily, style, children, }: PdfTextProps) => React.JSX.Element;
17
+ export declare const PdfRegular: ({ fontWeight, fontSize, textAlign, fontFamily, style, children, }: PdfTextProps) => React.JSX.Element;
18
+ export declare const PdfSmall: ({ fontSize, fontFamily, fontWeight, textAlign, lineHeight, fixed, style, children, }: PdfTextProps) => React.JSX.Element;
19
+ export declare const PdfPageNumber: ({ style, bottom }: PdfTextProps) => React.JSX.Element;
20
+ export {};
@@ -0,0 +1,70 @@
1
+ import React from 'react';
2
+ import { Text, Font } from '@react-pdf/renderer';
3
+ Font.register({
4
+ family: 'ArimaBold',
5
+ fonts: [
6
+ {
7
+ src: '../../../library/assets/fonts/arima/arima-bold.ttf',
8
+ fontStyle: 'normal',
9
+ fontWeight: 'bold',
10
+ },
11
+ ],
12
+ });
13
+ Font.register({
14
+ family: 'ArimaRegular',
15
+ src: '../../../library/assets/fonts/arima/arima-regular.ttf',
16
+ });
17
+ export const PdfHeading = ({ fontWeight = 'bold', fontSize = 22, fontFamily = 'ArimaRegular', style, children, }) => {
18
+ return (React.createElement(Text, { style: {
19
+ fontWeight: fontWeight,
20
+ fontSize: fontSize,
21
+ fontFamily: fontFamily,
22
+ ...style,
23
+ } }, children));
24
+ };
25
+ export const PdfSubHeading = ({ fontWeight = 'bold', fontSize = 20, fontFamily = 'ArimaRegular', style, children, }) => {
26
+ return (React.createElement(Text, { style: {
27
+ fontWeight: fontWeight,
28
+ fontSize: fontSize,
29
+ fontFamily: fontFamily,
30
+ ...style,
31
+ } }, children));
32
+ };
33
+ export const PdfMedium = ({ fontWeight = 'medium', fontSize = 16, textAlign = 'left', fontFamily = 'ArimaRegular', style, children, }) => {
34
+ return (React.createElement(Text, { style: {
35
+ fontWeight: fontWeight,
36
+ fontSize: fontSize,
37
+ fontFamily: fontFamily,
38
+ textAlign: textAlign,
39
+ ...style,
40
+ } }, children));
41
+ };
42
+ export const PdfRegular = ({ fontWeight = 'normal', fontSize = 12, textAlign = 'left', fontFamily = 'ArimaRegular', style, children, }) => {
43
+ return (React.createElement(Text, { style: {
44
+ fontWeight: fontWeight,
45
+ fontSize: fontSize,
46
+ fontFamily: fontFamily,
47
+ textAlign: textAlign,
48
+ ...style,
49
+ } }, children));
50
+ };
51
+ export const PdfSmall = ({ fontSize = 10, fontFamily = 'ArimaRegular', fontWeight = 'normal', textAlign = 'left', lineHeight = 0, fixed = false, style, children, }) => {
52
+ return (React.createElement(Text, { style: {
53
+ fontSize: fontSize,
54
+ fontFamily: fontFamily,
55
+ fontWeight: fontWeight,
56
+ lineHeight: lineHeight,
57
+ textAlign: textAlign,
58
+ ...style,
59
+ }, fixed: fixed }, children));
60
+ };
61
+ export const PdfPageNumber = ({ style, bottom = 55 }) => {
62
+ return (React.createElement(Text, { style: {
63
+ position: 'absolute',
64
+ bottom: bottom,
65
+ right: 14,
66
+ fontSize: 10,
67
+ color: 'black',
68
+ ...style,
69
+ }, render: ({ pageNumber, totalPages }) => `Page ${pageNumber} of ${totalPages}`, fixed: true }));
70
+ };
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { Style } from '@react-pdf/types';
3
+ interface PdfViewProps {
4
+ mh?: number;
5
+ mt?: number;
6
+ mv?: number;
7
+ p?: number;
8
+ borderColor?: string;
9
+ bg?: string;
10
+ bw?: number;
11
+ height?: string | number;
12
+ alignItems?: 'flex-end' | 'flex-start' | 'center';
13
+ flexDirection?: 'row' | 'column';
14
+ fixed?: boolean;
15
+ isBreak?: boolean;
16
+ isWrap?: boolean;
17
+ style?: Style | Style[] | any;
18
+ children?: React.ReactNode;
19
+ }
20
+ export declare const PdfView: ({ mh, p, flexDirection, style, fixed, isBreak, alignItems, mt, isWrap, children, }: PdfViewProps) => React.JSX.Element;
21
+ export declare const PdfBorderView: ({ mh, mv, p, borderColor, bw, style, flexDirection, fixed, isBreak, children, }: PdfViewProps) => React.JSX.Element;
22
+ interface PdfHeaderProps {
23
+ bg?: string;
24
+ p?: number;
25
+ alignItems?: React.CSSProperties['alignItems'] | any;
26
+ fixed?: boolean;
27
+ style?: React.CSSProperties | any;
28
+ children?: React.ReactNode;
29
+ }
30
+ export declare const PdfHeader: ({ bg, p, alignItems, fixed, style, children, }: PdfHeaderProps) => React.JSX.Element;
31
+ export declare const PdfSubHeader: ({ bg, p, alignItems, fixed, style, children, }: PdfViewProps) => React.JSX.Element;
32
+ interface PdfFooterViewProps {
33
+ bottom?: number;
34
+ left?: number;
35
+ right?: number;
36
+ bg?: string;
37
+ p?: number;
38
+ alignItems?: React.CSSProperties['alignItems'];
39
+ fixed?: boolean;
40
+ height?: string | number;
41
+ style?: React.CSSProperties | any;
42
+ children: React.ReactNode;
43
+ }
44
+ export declare const PdfFooterView: ({ bottom, left, right, bg, p, alignItems, fixed, height, style, children, }: PdfFooterViewProps) => React.JSX.Element;
45
+ interface GridProps {
46
+ cols?: number;
47
+ bg?: 'transparent' | string;
48
+ style?: Style | Style[];
49
+ children?: React.ReactNode;
50
+ }
51
+ export declare const PdfGrid: React.FunctionComponent<GridProps>;
52
+ export {};
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import { View } from '@react-pdf/renderer';
3
+ export const PdfView = ({ mh = 20, p = 2, flexDirection = 'column', style, fixed = false, isBreak = false, alignItems, mt, isWrap = true, children, }) => {
4
+ return (React.createElement(View, { break: isBreak, style: {
5
+ marginHorizontal: mh,
6
+ marginTop: mt,
7
+ padding: p,
8
+ flexDirection: flexDirection,
9
+ alignItems: alignItems,
10
+ ...style,
11
+ }, fixed: fixed, wrap: isWrap }, children));
12
+ };
13
+ export const PdfBorderView = ({ mh = 20, mv = 50, p = 2, borderColor = 'gray', bw = 2, style, flexDirection = 'column', fixed = false, isBreak = false, children, }) => {
14
+ return (React.createElement(View, { break: isBreak, style: {
15
+ flexDirection: flexDirection,
16
+ marginHorizontal: mh,
17
+ marginVertical: mv,
18
+ padding: p,
19
+ borderColor: borderColor,
20
+ borderWidth: bw,
21
+ ...style,
22
+ }, fixed: fixed }, children));
23
+ };
24
+ export const PdfHeader = ({ bg = 'orange', p = 10, alignItems = 'flex-start', fixed = false, style, children, }) => {
25
+ return (React.createElement(View, { style: {
26
+ backgroundColor: bg,
27
+ alignItems: alignItems,
28
+ padding: p,
29
+ ...style,
30
+ }, fixed: fixed }, children));
31
+ };
32
+ export const PdfSubHeader = ({ bg = 'yellow', p = 4, alignItems = 'flex-end', fixed = false, style, children, }) => {
33
+ return (React.createElement(View, { style: {
34
+ backgroundColor: bg,
35
+ alignItems: alignItems,
36
+ padding: p,
37
+ ...style,
38
+ }, fixed: fixed }, children));
39
+ };
40
+ export const PdfFooterView = ({ bottom = 0, left = 0, right = 0, bg = 'orange', p = 10, alignItems = 'center', fixed = false, height = '100%', style, children, }) => {
41
+ return (React.createElement(View, { style: [
42
+ { position: 'absolute', bottom, left, right, height },
43
+ { backgroundColor: bg, padding: p, alignItems: alignItems, ...style },
44
+ ], fixed: fixed }, children));
45
+ };
46
+ export const PdfGrid = ({ cols = 1, bg = 'white', style, children, }) => (React.createElement(View, { style: {
47
+ width: `${100 / cols}%`,
48
+ backgroundColor: bg,
49
+ ...style,
50
+ } }, children));
@@ -1,2 +1,33 @@
1
+ import * as Form from './atoms/form/form.component';
1
2
  export * from './atoms/button/button.component';
3
+ export * from './atoms/button/buttonGroup/buttonGroup.component';
4
+ export * from './atoms/check-box/checkBox.component';
5
+ export * from './atoms/date-picker/date-picker.component';
6
+ export * from './atoms/input/input-otp.component';
7
+ export * from './atoms/input/input-pin.component';
8
+ export * from './atoms/input/input.component';
9
+ export * from './atoms/input-dropdown/input-dropdown.component';
10
+ export * from './atoms/loader/loader.component';
11
+ export * from './atoms/radio/radio.component';
12
+ export * from './atoms/stepper/stepper.component';
13
+ export * from './atoms/timer/timer.component';
14
+ export * from './atoms/tooltip/tooltip.component';
15
+ export * from './atoms/icons/icons.component';
2
16
  export * from './atoms/tabs/tabs.component';
17
+ export * from './atoms/grid/grid.component';
18
+ export * from './atoms/list/list.component';
19
+ export * from './atoms/pdf/pdf-images.components';
20
+ export * from './atoms/pdf/pdf-table.components';
21
+ export * from './atoms/pdf/pdf-typography.components';
22
+ export * from './atoms/pdf/pdf-wrapped-view.components';
23
+ export * from './molecules/css-multiline-input/css-multiline-input.component';
24
+ export * from './molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component';
25
+ export * from './molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component';
26
+ export * from './molecules/multi-select/multi-select.component';
27
+ export * from './molecules/multi-select-with-field/multi-select-with-field.component';
28
+ export * from './molecules/modal-confirm/modal-confirm.component';
29
+ export * from './molecules/autocomplete/autocomplete';
30
+ export * from './molecules/auto-complete-group-by/auto-complete-group-by.component';
31
+ export * from './molecules/color-picker/color-picker.component';
32
+ export * from './molecules/color-picker-modal/color-picker-modal.component';
33
+ export { Form };
@@ -1,33 +1,33 @@
1
- // import * as Form from './atoms/form/form.component';
1
+ import * as Form from './atoms/form/form.component';
2
2
  export * from './atoms/button/button.component';
3
- // export * from './atoms/button/buttonGroup/buttonGroup.component';
4
- // export * from './atoms/check-box/checkBox.component';
5
- // export * from './atoms/date-picker/date-picker.component';
6
- // export * from './atoms/input/input-otp.component';
7
- // export * from './atoms/input/input-pin.component';
8
- // export * from './atoms/input/input.component';
9
- // export * from './atoms/input-dropdown/input-dropdown.component';
10
- // export * from './atoms/loader/loader.component';
11
- // export * from './atoms/radio/radio.component';
12
- // export * from './atoms/stepper/stepper.component';
13
- // export * from './atoms/timer/timer.component';
14
- // export * from './atoms/tooltip/tooltip.component';
15
- // export * from './atoms/icons/icons.component';
3
+ export * from './atoms/button/buttonGroup/buttonGroup.component';
4
+ export * from './atoms/check-box/checkBox.component';
5
+ export * from './atoms/date-picker/date-picker.component';
6
+ export * from './atoms/input/input-otp.component';
7
+ export * from './atoms/input/input-pin.component';
8
+ export * from './atoms/input/input.component';
9
+ export * from './atoms/input-dropdown/input-dropdown.component';
10
+ export * from './atoms/loader/loader.component';
11
+ export * from './atoms/radio/radio.component';
12
+ export * from './atoms/stepper/stepper.component';
13
+ export * from './atoms/timer/timer.component';
14
+ export * from './atoms/tooltip/tooltip.component';
15
+ export * from './atoms/icons/icons.component';
16
16
  export * from './atoms/tabs/tabs.component';
17
- // export * from './atoms/grid/grid.component';
18
- // export * from './atoms/list/list.component';
19
- // export * from './atoms/pdf/pdf-images.components';
20
- // export * from './atoms/pdf/pdf-table.components';
21
- // export * from './atoms/pdf/pdf-typography.components';
22
- // export * from './atoms/pdf/pdf-wrapped-view.components';
23
- // export * from './molecules/css-multiline-input/css-multiline-input.component';
24
- // export * from './molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component';
25
- // export * from './molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component';
26
- // export * from './molecules/multi-select/multi-select.component';
27
- // export * from './molecules/multi-select-with-field/multi-select-with-field.component';
28
- // export * from './molecules/modal-confirm/modal-confirm.component';
29
- // export * from './molecules/autocomplete/autocomplete';
30
- // export * from './molecules/auto-complete-group-by/auto-complete-group-by.component';
31
- // export * from './molecules/color-picker/color-picker.component';
32
- // export * from './molecules/color-picker-modal/color-picker-modal.component';
33
- // export {Form};
17
+ export * from './atoms/grid/grid.component';
18
+ export * from './atoms/list/list.component';
19
+ export * from './atoms/pdf/pdf-images.components';
20
+ export * from './atoms/pdf/pdf-table.components';
21
+ export * from './atoms/pdf/pdf-typography.components';
22
+ export * from './atoms/pdf/pdf-wrapped-view.components';
23
+ export * from './molecules/css-multiline-input/css-multiline-input.component';
24
+ export * from './molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component';
25
+ export * from './molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component';
26
+ export * from './molecules/multi-select/multi-select.component';
27
+ export * from './molecules/multi-select-with-field/multi-select-with-field.component';
28
+ export * from './molecules/modal-confirm/modal-confirm.component';
29
+ export * from './molecules/autocomplete/autocomplete';
30
+ export * from './molecules/auto-complete-group-by/auto-complete-group-by.component';
31
+ export * from './molecules/color-picker/color-picker.component';
32
+ export * from './molecules/color-picker-modal/color-picker-modal.component';
33
+ export { Form };
@@ -37,7 +37,6 @@
37
37
  } .block { display: block;
38
38
  } .inline-block { display: inline-block;
39
39
  } .flex { display: flex;
40
- } .table { display: table;
41
40
  } .grid { display: grid;
42
41
  } .hidden { display: none;
43
42
  } .h-0\.5 { height: 0.125rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.2.39",
3
+ "version": "0.2.40",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {