react-restyle-components 0.3.1 → 0.3.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"auto-complete-group-by.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/molecules/auto-complete-group-by/auto-complete-group-by.component.tsx"],"names":[],"mappings":"AAMA,UAAU,wBAAwB;IAChC,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,mBAAmB,yDAM7B,wBAAwB,4CAmP1B,CAAC"}
1
+ {"version":3,"file":"auto-complete-group-by.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/molecules/auto-complete-group-by/auto-complete-group-by.component.tsx"],"names":[],"mappings":"AAMA,UAAU,wBAAwB;IAChC,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,mBAAmB,yDAM7B,wBAAwB,4CAiP1B,CAAC"}
@@ -101,8 +101,7 @@ export const AutocompleteGroupBy = ({ data = [], hasError = false, displayValue
101
101
  onChange(selectedItem, selectedChildren);
102
102
  }
103
103
  setIsListOpen(false);
104
- setValue(value); // Set the value to what the user entered
105
- setOptions([]);
104
+ setValue(value);
106
105
  }
107
106
  } }), isListOpen ? (_jsx(Icon, { nameIcon: "FaChevronUp", propsIcon: {
108
107
  color: '#000000',
@@ -114,6 +113,5 @@ export const AutocompleteGroupBy = ({ data = [], hasError = false, displayValue
114
113
  onChange && onChange(item, children);
115
114
  setIsListOpen(false);
116
115
  setValue(children.title);
117
- setOptions([]);
118
116
  }, children: children.title }, childrenIndex))) })] }))) }) }) })) : (_jsx("div", { className: cn(s['mt-1'], s['absolute'], s['bg-gray-200'], s['p-2'], s['rounded-md']), style: { zIndex: 80, width: '100%' }, children: _jsx("span", { children: "Not Found Result!!" }) }))) : null] }) }));
119
117
  };
@@ -5,7 +5,9 @@ interface CSSMultilineProps {
5
5
  className?: string;
6
6
  style?: any;
7
7
  onChange(item: any): void;
8
+ onReset?(): void;
9
+ onMoreInfo?(): void;
8
10
  }
9
- export declare const CSSMultiline: ({ label, defaultValue, className, style, placeholder, onChange, }: CSSMultilineProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const CSSMultiline: ({ label, defaultValue, className, style, placeholder, onChange, onReset, onMoreInfo, }: CSSMultilineProps) => import("react/jsx-runtime").JSX.Element;
10
12
  export {};
11
13
  //# sourceMappingURL=css-multiline-input.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"css-multiline-input.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/molecules/css-multiline-input/css-multiline-input.component.tsx"],"names":[],"mappings":"AAOA,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,IAAI,KAAA,GAAG,IAAI,CAAC;CACtB;AAWD,eAAO,MAAM,YAAY,sEAOtB,iBAAiB,4CA8HnB,CAAC"}
1
+ {"version":3,"file":"css-multiline-input.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/molecules/css-multiline-input/css-multiline-input.component.tsx"],"names":[],"mappings":"AAQA,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,IAAI,KAAA,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,IAAI,IAAI,CAAC;IACjB,UAAU,CAAC,IAAI,IAAI,CAAC;CACrB;AAWD,eAAO,MAAM,YAAY,2FAStB,iBAAiB,4CAyInB,CAAC"}
@@ -4,6 +4,7 @@ import * as Form from '../../atoms/form/form.component';
4
4
  import { properties as propertiesObj } from './css-properties';
5
5
  import s from '../../tc.module.css';
6
6
  import { cn } from '../../utils';
7
+ import { Icon } from '../../..';
7
8
  const mapToArray = (arr) => {
8
9
  const res = [];
9
10
  arr.forEach(function (obj, index) {
@@ -14,7 +15,7 @@ const mapToArray = (arr) => {
14
15
  return res;
15
16
  };
16
17
  const data = mapToArray(propertiesObj);
17
- export const CSSMultiline = ({ label = 'Main Box CSS', defaultValue = '', className = '', style = {}, placeholder = "Like fontSize: 12,backgroundColor:'#000000',", onChange, }) => {
18
+ export const CSSMultiline = ({ label = 'Main Box CSS', defaultValue = '', className = '', style = {}, placeholder = "fontSize: 12,backgroundColor:'#000000'", onChange, onReset, onMoreInfo, }) => {
18
19
  const value = useRef('');
19
20
  const [properties, setProperties] = useState([]);
20
21
  const [isListOpen, setIsListOpen] = useState(false);
@@ -40,7 +41,7 @@ export const CSSMultiline = ({ label = 'Main Box CSS', defaultValue = '', classN
40
41
  useOutsideAlerter(wrapperRef);
41
42
  const list = [];
42
43
  const filter = (css) => {
43
- let matchString = css?.split(',');
44
+ let matchString = css?.split(/,\s*/);
44
45
  matchString = matchString[matchString?.length - 1];
45
46
  matchString = matchString?.split(':')[0];
46
47
  matchString = matchString?.split("'")[0];
@@ -61,10 +62,10 @@ export const CSSMultiline = ({ label = 'Main Box CSS', defaultValue = '', classN
61
62
  const onKeyUp = (e) => {
62
63
  setIsListOpen(true);
63
64
  };
64
- return (_jsxs("div", { className: cn(s['flex'], s['flex-col'], s['w-full']), ref: wrapperRef, children: [_jsx(Form.MultilineInput, { label: label, style: { color: '#ffffff', backgroundColor: '#000000', ...style }, placeholder: placeholder, value: value.current, className: cn(className), onKeyUp: onKeyUp, onChange: (css) => {
65
+ return (_jsxs("div", { className: cn(s['flex'], s['flex-col'], s['w-full']), ref: wrapperRef, children: [_jsxs("div", { className: "flex absolute gap-2 right-6", children: [onReset && (_jsx(Icon, { nameIcon: "MdLockReset", propsIcon: { color: '#000000', size: 24 }, onClick: onReset, tooltip: "Reset CSS" })), onMoreInfo && (_jsx(Icon, { nameIcon: "MdInfoOutline", propsIcon: { color: '#000000', size: 24 }, onClick: onMoreInfo, tooltip: "More Info" }))] }), _jsx(Form.MultilineInput, { label: label, style: { color: '#ffffff', backgroundColor: '#000000', ...style }, placeholder: placeholder, value: value.current, className: cn(className), onKeyUp: onKeyUp, onChange: (css) => {
65
66
  value.current = css;
66
67
  filter(css);
67
- } }), isListOpen && (_jsx("div", { style: { marginTop: -10 }, children: _jsx("ul", { className: cn(s['flex'], s['flex-col'], s['max-h-40'], s['bg-black'], s['m-2'], s['text-white'], s['overflow-y-scroll']), children: properties?.map((item, index) => (_jsxs("li", { className: cn(s['flex'], s['flex-col'], s['gap-4'], s['p-2']), children: [_jsx("span", { className: cn(s['underline']), children: item[0] }), item[1]?.map((prop) => (_jsxs("li", { className: cn(s['flex'], s['-mt-2'], s['px-2'], s['h-8'], s['bg-slate-800'], s['rounded-md'], s['items-center'], s['cursor-pointer']), onClick: () => {
68
+ } }), isListOpen && (_jsx("div", { children: _jsx("ul", { className: cn(s['flex'], s['flex-col'], s['bg-black'], s['text-white'], s['overflow-y-scroll']), style: { maxHeight: 'calc(100vh - 20vh)' }, children: properties?.map((item, index) => (_jsxs("li", { className: cn(s['flex'], s['gap-4'], s['p-2']), children: [_jsx("span", { className: cn(s['underline']), children: item[0] }), item[1]?.map((prop) => (_jsxs("li", { className: cn(s['flex'], s['bg-slate-800'], s['rounded-md'], s['items-center'], s['cursor-pointer']), onClick: () => {
68
69
  let existsString = value.current?.split(',');
69
70
  if (value.current.includes(',')) {
70
71
  existsString = existsString.map((item) => {
@@ -21,13 +21,13 @@ export const properties = [
21
21
  'stretch',
22
22
  ],
23
23
  },
24
- { flex: ['number', 'string'] },
24
+ { flex: ['number'] },
25
25
  { flexDirection: ['row', 'row-reverse', 'column', 'column-reverse'] },
26
26
  { flexWrap: ['nowrap', 'wrap', 'wrap-reverse'] },
27
27
  { flexFlow: ['number'] },
28
28
  { flexGrow: ['number'] },
29
29
  { flexShrink: ['number'] },
30
- { flexBasis: ['number', 'string'] },
30
+ { flexBasis: ['number'] },
31
31
  {
32
32
  justifyContent: [
33
33
  ,
@@ -39,32 +39,32 @@ export const properties = [
39
39
  'space-evenly',
40
40
  ],
41
41
  },
42
- { gap: ['number', 'string'] },
42
+ { gap: ['number'] },
43
43
  { rowGap: ['number'] },
44
44
  { columnGap: ['number'] },
45
45
  // Layout
46
- { aspectRatio: ['number', 'string'] },
47
- { bottom: ['number', 'string'] },
46
+ { aspectRatio: ['number'] },
47
+ { bottom: ['number'] },
48
48
  { display: ['flex', 'none'] },
49
- { left: ['number', 'string'] },
49
+ { left: ['number'] },
50
50
  { position: ['absolute', 'relative'] },
51
- { right: ['number', 'string'] },
52
- { top: ['number', 'string'] },
51
+ { right: ['number'] },
52
+ { top: ['number'] },
53
53
  { overflow: ['hidden'] },
54
- { zIndex: ['number', 'string'] },
54
+ { zIndex: ['number'] },
55
55
  // Dimension
56
- { height: ['number', 'string'] },
57
- { maxHeight: ['number', 'string'] },
58
- { maxWidth: ['number', 'string'] },
59
- { minHeight: ['number', 'string'] },
60
- { minWidth: ['number', 'string'] },
61
- { width: ['number', 'string'] },
56
+ { height: ['number'] },
57
+ { maxHeight: ['number'] },
58
+ { maxWidth: ['number'] },
59
+ { minHeight: ['number'] },
60
+ { minWidth: ['number'] },
61
+ { width: ['number'] },
62
62
  // Color
63
63
  { backgroundColor: ['string'] },
64
64
  { color: ['string'] },
65
65
  { opacity: ['number'] },
66
66
  // Text
67
- { fontSize: ['number', 'string'] },
67
+ { fontSize: ['number'] },
68
68
  { fontFamily: ['string'] },
69
69
  { fontStyle: ['string', 'normal'] },
70
70
  {
@@ -87,8 +87,8 @@ export const properties = [
87
87
  'black',
88
88
  ],
89
89
  },
90
- { letterSpacing: ['number', 'string'] },
91
- { lineHeight: ['number', 'string'] },
90
+ { letterSpacing: ['number'] },
91
+ { lineHeight: ['number'] },
92
92
  { maxLines: ['number'] },
93
93
  { textAlign: ['left', 'right', 'center', 'justify'] },
94
94
  {
@@ -109,53 +109,53 @@ export const properties = [
109
109
  { verticalAlign: ['sub', 'super'] },
110
110
  // Sizing/positioning
111
111
  { objectFit: ['string'] },
112
- { objectPosition: ['number', 'string'] },
113
- { objectPositionX: ['number', 'string'] },
114
- { objectPositionY: ['number', 'string'] },
112
+ { objectPosition: ['number'] },
113
+ { objectPositionX: ['number'] },
114
+ { objectPositionY: ['number'] },
115
115
  // Margin/padding
116
- { margin: ['number', 'string'] },
117
- { marginHorizontal: ['number', 'string'] },
118
- { marginVertical: ['number', 'string'] },
119
- { marginTop: ['number', 'string'] },
120
- { marginRight: ['number', 'string'] },
121
- { marginBottom: ['number', 'string'] },
122
- { marginLeft: ['number', 'string'] },
123
- { padding: ['number', 'string'] },
124
- { paddingHorizontal: ['number', 'string'] },
125
- { paddingVertical: ['number', 'string'] },
126
- { paddingTop: ['number', 'string'] },
127
- { paddingRight: ['number', 'string'] },
128
- { paddingBottom: ['number', 'string'] },
129
- { paddingLeft: ['number', 'string'] },
116
+ { margin: ['number'] },
117
+ { marginHorizontal: ['number'] },
118
+ { marginVertical: ['number'] },
119
+ { marginTop: ['number'] },
120
+ { marginRight: ['number'] },
121
+ { marginBottom: ['number'] },
122
+ { marginLeft: ['number'] },
123
+ { padding: ['number'] },
124
+ { paddingHorizontal: ['number'] },
125
+ { paddingVertical: ['number'] },
126
+ { paddingTop: ['number'] },
127
+ { paddingRight: ['number'] },
128
+ { paddingBottom: ['number'] },
129
+ { paddingLeft: ['number'] },
130
130
  // Transformations
131
131
  { transform: ['string'] },
132
- { transformOrigin: ['number', 'string'] },
133
- { transformOriginX: ['number', 'string'] },
134
- { transformOriginY: ['number', 'string'] },
132
+ { transformOrigin: ['number'] },
133
+ { transformOriginX: ['number'] },
134
+ { transformOriginY: ['number'] },
135
135
  // Borders
136
- { border: ['number', 'string'] },
137
- { borderWidth: ['number', 'string'] },
136
+ { border: ['number'] },
137
+ { borderWidth: ['number'] },
138
138
  { borderColor: ['string'] },
139
139
  { borderStyle: ['dashed', 'dotted', 'solid'] },
140
- { borderTop: ['number', 'string'] },
140
+ { borderTop: ['number'] },
141
141
  { borderTopColor: ['string'] },
142
142
  { borderTopStyle: ['dashed', 'dotted', 'solid'] },
143
- { borderTopWidth: ['number', 'string'] },
144
- { borderRight: ['number', 'string'] },
143
+ { borderTopWidth: ['number'] },
144
+ { borderRight: ['number'] },
145
145
  { borderRightColor: ['string'] },
146
146
  { borderRightStyle: ['dashed', 'dotted', 'solid'] },
147
- { borderRightWidth: ['number', 'string'] },
148
- { borderBottom: ['number', 'string'] },
147
+ { borderRightWidth: ['number'] },
148
+ { borderBottom: ['number'] },
149
149
  { borderBottomColor: ['string'] },
150
150
  { borderBottomStyle: ['dashed', 'dotted', 'solid'] },
151
- { borderBottomWidth: ['number', 'string'] },
152
- { borderLeft: ['number', 'string'] },
151
+ { borderBottomWidth: ['number'] },
152
+ { borderLeft: ['number'] },
153
153
  { borderLeftColor: ['string'] },
154
154
  { borderLeftStyle: ['dashed', 'dotted', 'solid'] },
155
- { borderLeftWidth: ['number', 'string'] },
156
- { borderTopLeftRadius: ['number', 'string'] },
157
- { borderTopRightRadius: ['number', 'string'] },
158
- { borderBottomRightRadius: ['number', 'string'] },
159
- { borderBottomLeftRadius: ['number', 'string'] },
160
- { borderRadius: ['number', 'string'] },
155
+ { borderLeftWidth: ['number'] },
156
+ { borderTopLeftRadius: ['number'] },
157
+ { borderTopRightRadius: ['number'] },
158
+ { borderBottomRightRadius: ['number'] },
159
+ { borderBottomLeftRadius: ['number'] },
160
+ { borderRadius: ['number'] },
161
161
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {