@firedesktop/react-base 1.17.3 → 1.18.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/dist/components/AppInput.d.ts +17 -0
- package/dist/components/AppInput.js +10 -0
- package/dist/components/AppInput.js.map +1 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/styles/base.css +23 -2
- package/package.json +7 -3
- package/src/App.tsx +6 -0
- package/src/lib/components/AppInput.tsx +60 -0
- package/src/lib/components/index.ts +2 -1
- package/src/lib/styles/base.css +23 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type AppInputType_Type = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'url' | 'week';
|
|
3
|
+
declare type Proptype = {
|
|
4
|
+
appIcon: any;
|
|
5
|
+
ariadescribedby?: string;
|
|
6
|
+
autoComplete?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
classNameWrapper?: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
type?: AppInputType_Type;
|
|
14
|
+
value?: string | number;
|
|
15
|
+
};
|
|
16
|
+
declare function AppInput({ appIcon, ariadescribedby, autoComplete, className, classNameWrapper, id, name, onChange, placeholder, type, value }: Proptype): JSX.Element;
|
|
17
|
+
export default AppInput;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
function AppInput(_a) {
|
|
3
|
+
var appIcon = _a.appIcon, ariadescribedby = _a.ariadescribedby, _b = _a.autoComplete, autoComplete = _b === void 0 ? true : _b, className = _a.className, classNameWrapper = _a.classNameWrapper, id = _a.id, name = _a.name, onChange = _a.onChange, placeholder = _a.placeholder, _c = _a.type, type = _c === void 0 ? 'text' : _c, value = _a.value;
|
|
4
|
+
var classWrap = classNameWrapper ? "form-group AppInput_form " + classNameWrapper : 'form-group AppInput_form';
|
|
5
|
+
return (React.createElement("div", { className: classWrap },
|
|
6
|
+
React.createElement("input", { autoComplete: autoComplete ? 'on' : 'off', "aria-describedby": ariadescribedby, className: "form-control " + (className !== null && className !== void 0 ? className : ''), id: id, name: name, onChange: onChange, placeholder: placeholder, type: type, value: value }),
|
|
7
|
+
appIcon));
|
|
8
|
+
}
|
|
9
|
+
export default AppInput;
|
|
10
|
+
//# sourceMappingURL=AppInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppInput.js","sourceRoot":"","sources":["../../src/lib/components/AppInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAwC1B,SAAS,QAAQ,CAAC,EAA+I;QAA7I,OAAO,aAAA,EAAE,eAAe,qBAAA,EAAE,oBAAmB,EAAnB,YAAY,mBAAG,IAAI,KAAA,EAAE,SAAS,eAAA,EAAE,gBAAgB,sBAAA,EAAE,EAAE,QAAA,EAAE,IAAI,UAAA,EAAE,QAAQ,cAAA,EAAE,WAAW,iBAAA,EAAE,YAAa,EAAb,IAAI,mBAAG,MAAM,KAAA,EAAE,KAAK,WAAA;IACnJ,IAAM,SAAS,GAAG,gBAAgB,CAAC,CAAC,CAAC,8BAA4B,gBAAkB,CAAC,CAAC,CAAC,0BAA0B,CAAC;IACjH,OAAO,CACL,6BAAK,SAAS,EAAE,SAAS;QACvB,+BACE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,sBACvB,eAAe,EACjC,SAAS,EAAE,mBAAgB,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAE,EAC5C,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,GAAI;QACjB,OAAO,CACJ,CACP,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import AppIcon from './AppIcon';
|
|
2
|
+
import AppInput from './AppInput';
|
|
2
3
|
import Spin from './Spin';
|
|
3
4
|
import Toaster from './Toaster/Toaster';
|
|
4
5
|
import * as Toaster_Types from './Toaster/Types';
|
|
5
|
-
export { AppIcon, Spin, Toaster, Toaster_Types };
|
|
6
|
+
export { AppIcon, AppInput, Spin, Toaster, Toaster_Types };
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import AppIcon from './AppIcon';
|
|
2
|
+
import AppInput from './AppInput';
|
|
2
3
|
import Spin from './Spin';
|
|
3
4
|
import Toaster from './Toaster/Toaster';
|
|
4
5
|
import * as Toaster_Types from './Toaster/Types';
|
|
5
|
-
export { AppIcon, Spin, Toaster, Toaster_Types };
|
|
6
|
+
export { AppIcon, AppInput, Spin, Toaster, Toaster_Types };
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/styles/base.css
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
body {
|
|
44
|
-
background: #f7f7f7
|
|
44
|
+
background: #f7f7f7;
|
|
45
45
|
font-family: var(--font-Roboto);
|
|
46
46
|
overflow-x: hidden;
|
|
47
47
|
}
|
|
@@ -344,4 +344,25 @@
|
|
|
344
344
|
|
|
345
345
|
.MuiAutocomplete-proper *{
|
|
346
346
|
transition: none !important;
|
|
347
|
-
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/*******************************************************************************/
|
|
350
|
+
/* AppInput */
|
|
351
|
+
.AppInput_form {
|
|
352
|
+
position: relative;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.AppInput_form input {
|
|
356
|
+
padding: 10px 0px 10px 10px;
|
|
357
|
+
border: 2px solid var(--primary-color);
|
|
358
|
+
box-sizing: border-box;
|
|
359
|
+
border-radius: 15px;
|
|
360
|
+
font-size: 17px;
|
|
361
|
+
height: 42px;
|
|
362
|
+
width: 100%;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.AppInput_form svg{
|
|
366
|
+
position: absolute;
|
|
367
|
+
}
|
|
368
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firedesktop/react-base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"description": "This is the FireDesktop base package used to support every React Project in this Company.",
|
|
@@ -34,7 +34,11 @@
|
|
|
34
34
|
"typescript": "^4.0.5",
|
|
35
35
|
"web-vitals": "^1.0.1"
|
|
36
36
|
},
|
|
37
|
-
"peerDependencies": {
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": ">=16.8.*",
|
|
39
|
+
"react-dom": ">=16.8.*",
|
|
40
|
+
"react-redux": ">=7.*"
|
|
41
|
+
},
|
|
38
42
|
"scripts": {
|
|
39
43
|
"distribute_not_working": "rmdir /s /q dist & mkdir dist && npx babel src/lib --out-dir dist --extensions \".js,.ts,.tsx\" --source-maps inline",
|
|
40
44
|
"start": "react-scripts start",
|
|
@@ -58,4 +62,4 @@
|
|
|
58
62
|
"last 1 safari version"
|
|
59
63
|
]
|
|
60
64
|
}
|
|
61
|
-
}
|
|
65
|
+
}
|
package/src/App.tsx
CHANGED
|
@@ -91,6 +91,12 @@ function App() {
|
|
|
91
91
|
{options ? options.map((x: any) => {
|
|
92
92
|
return (<li key={x.value}>ID: {x.value} Post: {x.label}</li>);
|
|
93
93
|
}) : ''}
|
|
94
|
+
|
|
95
|
+
<br />
|
|
96
|
+
<Components.AppInput appIcon={<Components.AppIcon name={'user'} className={'tertiary-svg'} iconClassName='login_form_svg' />}
|
|
97
|
+
type='text'
|
|
98
|
+
placeholder='username---'
|
|
99
|
+
name='username' />
|
|
94
100
|
</Provider >
|
|
95
101
|
);
|
|
96
102
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
type AppInputType_Type =
|
|
5
|
+
'button'
|
|
6
|
+
| 'checkbox'
|
|
7
|
+
| 'color'
|
|
8
|
+
| 'date'
|
|
9
|
+
| 'datetime-local'
|
|
10
|
+
| 'email'
|
|
11
|
+
| 'file'
|
|
12
|
+
| 'hidden'
|
|
13
|
+
| 'image'
|
|
14
|
+
| 'month'
|
|
15
|
+
| 'number'
|
|
16
|
+
| 'password'
|
|
17
|
+
| 'radio'
|
|
18
|
+
| 'range'
|
|
19
|
+
| 'reset'
|
|
20
|
+
| 'search'
|
|
21
|
+
| 'submit'
|
|
22
|
+
| 'tel'
|
|
23
|
+
| 'text'
|
|
24
|
+
| 'url'
|
|
25
|
+
| 'week';
|
|
26
|
+
|
|
27
|
+
type Proptype = {
|
|
28
|
+
appIcon: any;
|
|
29
|
+
ariadescribedby?: string;
|
|
30
|
+
autoComplete?: boolean,
|
|
31
|
+
className?: string;
|
|
32
|
+
classNameWrapper?: string,
|
|
33
|
+
id?: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
type?: AppInputType_Type;
|
|
38
|
+
value?: string | number;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function AppInput({ appIcon, ariadescribedby, autoComplete = true, className, classNameWrapper, id, name, onChange, placeholder, type = 'text', value }: Proptype) {
|
|
42
|
+
const classWrap = classNameWrapper ? `form-group AppInput_form ${classNameWrapper}` : 'form-group AppInput_form';
|
|
43
|
+
return (
|
|
44
|
+
<div className={classWrap}>
|
|
45
|
+
<input
|
|
46
|
+
autoComplete={autoComplete ? 'on' : 'off'}
|
|
47
|
+
aria-describedby={ariadescribedby}
|
|
48
|
+
className={`form-control ${className ?? ''}`}
|
|
49
|
+
id={id}
|
|
50
|
+
name={name}
|
|
51
|
+
onChange={onChange}
|
|
52
|
+
placeholder={placeholder}
|
|
53
|
+
type={type}
|
|
54
|
+
value={value} />
|
|
55
|
+
{appIcon}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default AppInput;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import AppIcon from './AppIcon';
|
|
2
|
+
import AppInput from './AppInput';
|
|
2
3
|
import Spin from './Spin';
|
|
3
4
|
import Toaster from './Toaster/Toaster';
|
|
4
5
|
import * as Toaster_Types from './Toaster/Types';
|
|
5
6
|
|
|
6
|
-
export { AppIcon, Spin, Toaster, Toaster_Types };
|
|
7
|
+
export { AppIcon, AppInput, Spin, Toaster, Toaster_Types };
|
package/src/lib/styles/base.css
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
body {
|
|
44
|
-
background: #f7f7f7
|
|
44
|
+
background: #f7f7f7;
|
|
45
45
|
font-family: var(--font-Roboto);
|
|
46
46
|
overflow-x: hidden;
|
|
47
47
|
}
|
|
@@ -344,4 +344,25 @@
|
|
|
344
344
|
|
|
345
345
|
.MuiAutocomplete-proper *{
|
|
346
346
|
transition: none !important;
|
|
347
|
-
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/*******************************************************************************/
|
|
350
|
+
/* AppInput */
|
|
351
|
+
.AppInput_form {
|
|
352
|
+
position: relative;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.AppInput_form input {
|
|
356
|
+
padding: 10px 0px 10px 10px;
|
|
357
|
+
border: 2px solid var(--primary-color);
|
|
358
|
+
box-sizing: border-box;
|
|
359
|
+
border-radius: 15px;
|
|
360
|
+
font-size: 17px;
|
|
361
|
+
height: 42px;
|
|
362
|
+
width: 100%;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.AppInput_form svg{
|
|
366
|
+
position: absolute;
|
|
367
|
+
}
|
|
368
|
+
|