@maif/react-forms 1.0.3 → 1.0.7

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/lib/style.d.ts ADDED
@@ -0,0 +1,156 @@
1
+ export namespace style {
2
+ const input: {
3
+ display: string;
4
+ width: string;
5
+ padding: string;
6
+ fontSize: string;
7
+ color: string;
8
+ border: string;
9
+ borderRadius: number;
10
+ "&[readonly]": {
11
+ backgroundColor: string;
12
+ opacity: number;
13
+ };
14
+ };
15
+ namespace btn {
16
+ const borderRadius: number;
17
+ const padding: number;
18
+ const fontSize: string;
19
+ const cursor: string;
20
+ const border: number;
21
+ }
22
+ namespace btn_sm {
23
+ const fontSize_1: string;
24
+ export { fontSize_1 as fontSize };
25
+ const padding_1: string;
26
+ export { padding_1 as padding };
27
+ }
28
+ const btn_group: {
29
+ "& > button:not(:last-child)": {
30
+ borderTopRightRadius: number;
31
+ borderBottomRightRadius: number;
32
+ };
33
+ "& > button:not(:first-child)": {
34
+ borderTopLeftRadius: number;
35
+ borderBottomLeftRadius: number;
36
+ };
37
+ };
38
+ const btn_red: {
39
+ color: string;
40
+ backgroundColor: string;
41
+ borderColor: string;
42
+ "&:hover": {
43
+ backgroundColor: string;
44
+ borderColor: string;
45
+ };
46
+ };
47
+ const btn_green: {
48
+ color: string;
49
+ backgroundColor: string;
50
+ borderColor: string;
51
+ "&:hover": {
52
+ backgroundColor: string;
53
+ borderColor: string;
54
+ };
55
+ };
56
+ const btn_blue: {
57
+ color: string;
58
+ backgroundColor: string;
59
+ borderColor: string;
60
+ "&:hover": {
61
+ backgroundColor: string;
62
+ borderColor: string;
63
+ };
64
+ };
65
+ const btn_grey: {
66
+ color: string;
67
+ backgroundColor: string;
68
+ borderColor: string;
69
+ "&:hover": {
70
+ backgroundColor: string;
71
+ borderColor: string;
72
+ };
73
+ };
74
+ namespace txt_red {
75
+ const color: string;
76
+ }
77
+ namespace ml_5 {
78
+ const marginLeft: number;
79
+ }
80
+ namespace ml_10 {
81
+ const marginLeft_1: number;
82
+ export { marginLeft_1 as marginLeft };
83
+ }
84
+ namespace mt_5 {
85
+ const marginTop: number;
86
+ }
87
+ namespace mt_10 {
88
+ const marginTop_1: number;
89
+ export { marginTop_1 as marginTop };
90
+ }
91
+ namespace mt_20 {
92
+ const marginTop_2: number;
93
+ export { marginTop_2 as marginTop };
94
+ }
95
+ namespace mb_5 {
96
+ const marginBottom: number;
97
+ }
98
+ namespace p_15 {
99
+ const padding_2: number;
100
+ export { padding_2 as padding };
101
+ }
102
+ namespace pr_15 {
103
+ const paddingRight: number;
104
+ }
105
+ namespace d_none {
106
+ const display: string;
107
+ }
108
+ namespace flex {
109
+ const display_1: string;
110
+ export { display_1 as display };
111
+ }
112
+ namespace flexDirection {
113
+ const flexDirection_1: string;
114
+ export { flexDirection_1 as flexDirection };
115
+ }
116
+ namespace jc_end {
117
+ const justifyContent: string;
118
+ }
119
+ namespace ac_center {
120
+ const alignContent: string;
121
+ }
122
+ namespace ai_center {
123
+ const alignItems: string;
124
+ }
125
+ namespace cursor_pointer {
126
+ const cursor_1: string;
127
+ export { cursor_1 as cursor };
128
+ }
129
+ namespace collapse {
130
+ const display_2: string;
131
+ export { display_2 as display };
132
+ const justifyContent_1: string;
133
+ export { justifyContent_1 as justifyContent };
134
+ const cursor_2: string;
135
+ export { cursor_2 as cursor };
136
+ }
137
+ namespace collapse_label {
138
+ export const fontWeight: string;
139
+ const marginTop_3: number;
140
+ export { marginTop_3 as marginTop };
141
+ }
142
+ const datepicker: {
143
+ "& input": {
144
+ borderRadius: string;
145
+ };
146
+ };
147
+ const code: {};
148
+ namespace input__boolean__on {
149
+ const color_1: string;
150
+ export { color_1 as color };
151
+ }
152
+ namespace input__boolean__off {
153
+ const color_2: string;
154
+ export { color_2 as color };
155
+ }
156
+ }
package/lib/style.js ADDED
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.style = void 0;
7
+ var style = {
8
+ input: {
9
+ display: "block",
10
+ width: "100%",
11
+ padding: "8px 12px",
12
+ fontSize: "1rem",
13
+ color: "#495057",
14
+ border: "1px solid #ced4da",
15
+ borderRadius: 4,
16
+ "&[readonly]": {
17
+ backgroundColor: "#e9ecef",
18
+ opacity: 1
19
+ }
20
+ },
21
+ btn: {
22
+ borderRadius: 5,
23
+ padding: 10,
24
+ fontSize: "1rem",
25
+ cursor: "pointer",
26
+ border: 0
27
+ },
28
+ btn_sm: {
29
+ fontSize: "0.875rem",
30
+ padding: ".25rem .5rem"
31
+ },
32
+ btn_group: {
33
+ "& > button:not(:last-child)": {
34
+ borderTopRightRadius: 0,
35
+ borderBottomRightRadius: 0
36
+ },
37
+ "& > button:not(:first-child)": {
38
+ borderTopLeftRadius: 0,
39
+ borderBottomLeftRadius: 0
40
+ }
41
+ },
42
+ btn_red: {
43
+ color: "#fff",
44
+ backgroundColor: "#dc3545",
45
+ borderColor: "#dc3545",
46
+ "&:hover": {
47
+ backgroundColor: "#c82333",
48
+ borderColor: "#bd2130"
49
+ }
50
+ },
51
+ btn_green: {
52
+ color: "#fff",
53
+ backgroundColor: "#28a745",
54
+ borderColor: "#28a745",
55
+ "&:hover": {
56
+ backgroundColor: "#218838",
57
+ borderColor: "#1e7e34"
58
+ }
59
+ },
60
+ btn_blue: {
61
+ color: "#fff",
62
+ backgroundColor: "#007bff",
63
+ borderColor: "#007bff",
64
+ "&:hover": {
65
+ backgroundColor: "#0069d9",
66
+ borderColor: "#0062cc"
67
+ }
68
+ },
69
+ btn_grey: {
70
+ color: "#fff",
71
+ backgroundColor: "#6c757d",
72
+ borderColor: "#6c757d",
73
+ "&:hover": {
74
+ backgroundColor: "#5c636a",
75
+ borderColor: "#5c636a"
76
+ }
77
+ },
78
+ txt_red: {
79
+ color: "#dc3545"
80
+ },
81
+ ml_5: {
82
+ marginLeft: 5
83
+ },
84
+ ml_10: {
85
+ marginLeft: 10
86
+ },
87
+ mt_5: {
88
+ marginTop: 5
89
+ },
90
+ mt_10: {
91
+ marginTop: 10
92
+ },
93
+ mt_20: {
94
+ marginTop: 20
95
+ },
96
+ mb_5: {
97
+ marginBottom: 5
98
+ },
99
+ p_15: {
100
+ padding: 15
101
+ },
102
+ pr_15: {
103
+ paddingRight: 15
104
+ },
105
+ d_none: {
106
+ display: "none"
107
+ },
108
+ flex: {
109
+ display: "flex"
110
+ },
111
+ flexDirection: {
112
+ flexDirection: "column"
113
+ },
114
+ jc_end: {
115
+ justifyContent: "end"
116
+ },
117
+ ac_center: {
118
+ alignContent: "center"
119
+ },
120
+ ai_center: {
121
+ alignItems: "center"
122
+ },
123
+ cursor_pointer: {
124
+ cursor: "pointer"
125
+ },
126
+ collapse: {
127
+ display: "flex",
128
+ justifyContent: "space-between",
129
+ cursor: "pointer"
130
+ },
131
+ collapse_label: {
132
+ fontWeight: "bold",
133
+ marginTop: 7
134
+ },
135
+ datepicker: {
136
+ "& input": {
137
+ borderRadius: "4px"
138
+ }
139
+ },
140
+ code: {},
141
+ input__boolean__on: {
142
+ color: "MediumSeaGreen"
143
+ },
144
+ input__boolean__off: {
145
+ color: "tomato"
146
+ }
147
+ };
148
+ exports.style = style;
@@ -0,0 +1 @@
1
+ export function useCustomStyle(overrideStyle?: {}): import("jss").Classes<"code" | "flex" | "flexDirection" | "input" | "btn" | "btn_sm" | "btn_group" | "btn_red" | "btn_green" | "btn_blue" | "btn_grey" | "txt_red" | "ml_5" | "ml_10" | "mt_5" | "mt_10" | "mt_20" | "mb_5" | "p_15" | "pr_15" | "d_none" | "jc_end" | "ac_center" | "ai_center" | "cursor_pointer" | "collapse" | "collapse_label" | "datepicker" | "input__boolean__on" | "input__boolean__off">;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useCustomStyle = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _reactJss = require("react-jss");
11
+
12
+ var _style = require("./style");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19
+
20
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
+
22
+ var useCustomStyle = function useCustomStyle() {
23
+ var overrideStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
24
+ var useStyle = (0, _reactJss.createUseStyles)(_objectSpread(_objectSpread({}, _style.style), overrideStyle));
25
+ var classes = useStyle();
26
+ return classes;
27
+ };
28
+
29
+ exports.useCustomStyle = useCustomStyle;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maif/react-forms",
3
3
  "description": "Build react safe forms as fast as possible",
4
- "version": "1.0.3",
4
+ "version": "1.0.7",
5
5
  "main": "lib/index.js",
6
6
  "author": "MAIF team",
7
7
  "keywords": [
@@ -113,8 +113,9 @@
113
113
  "react-ace": "9.4.3",
114
114
  "react-feather": "2.0.9",
115
115
  "react-hook-form": "7.17.1",
116
+ "react-jss": "10.8.2",
116
117
  "react-rainbow-components": "1.26.0",
117
- "react-select": "4.3.1",
118
+ "react-select": "5.2.1",
118
119
  "react-tooltip": "4.2.21",
119
120
  "showdown": "1.9.1",
120
121
  "typescript": "^4.3.5",