@portnet/ui 3.1.6 → 4.0.1
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/buttons/PuiButton.js +96 -103
- package/dist/components/common/StyledMuiButton.js +3 -5
- package/dist/components/common/StyledMuiTextField.js +103 -59
- package/dist/components/inputs/PuiDateField.js +176 -52
- package/dist/components/inputs/PuiDateTimeField.js +204 -195
- package/dist/components/inputs/PuiSelect.js +124 -82
- package/dist/components/others/DateTimePickerField.js +210 -0
- package/dist/components/others/PuiSection.js +88 -31
- package/dist/components/referentiel/components/PuiSpecificReferentielField.js +6 -24
- package/dist/components/table/PuiTable.js +124 -50
- package/dist/components/table/PuiTableAction.js +12 -2
- package/dist/components/typography/PuiMainTitle.js +124 -35
- package/dist/components/ui/pages/general/PuiSearchPage.js +56 -34
- package/dist/config/apperance.js +13 -95
- package/dist/index.js +0 -42
- package/package.json +20 -25
- package/dist/components/providers/PuiAntdProvider.js +0 -70
- package/dist/components/providers/PuiThemeProvider.js +0 -230
- package/dist/components/stepper/PuiStepContent.js +0 -66
- package/dist/components/stepper/PuiStepper.js +0 -184
- package/dist/components/stepper/PuiStepperActions.js +0 -105
- package/dist/components/table/PuiModernTable.js +0 -541
- package/dist/components-antd-optional/PuiAntdForm.js +0 -328
- package/dist/components-antd-optional/PuiAntdStepper.js +0 -317
- package/dist/components-antd-optional/PuiAntdTable.js +0 -352
- package/dist/config/antdTheme.js +0 -227
- package/dist/hooks/useCustomAxios.js +0 -36
|
@@ -24,78 +24,93 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
24
24
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25
25
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
26
26
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
27
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Helper function to get palette from theme or fallback to appearance
|
|
28
|
+
const getPalette = theme => {
|
|
29
|
+
// Check if theme has our custom palette properties
|
|
30
|
+
if (theme && theme.palette && theme.palette.gray && theme.palette.gray.darker) {
|
|
31
|
+
// Theme has our custom structure, now normalize it
|
|
32
|
+
return {
|
|
33
|
+
primary: theme.palette.primary.main || theme.palette.primary,
|
|
34
|
+
secondary: theme.palette.secondary.main || theme.palette.secondary,
|
|
35
|
+
error: theme.palette.error ? theme.palette.error.main || theme.palette.error : _apperance.palette.error,
|
|
36
|
+
warning: theme.palette.warning ? theme.palette.warning.main || theme.palette.warning : _apperance.palette.warning,
|
|
37
|
+
success: theme.palette.success ? theme.palette.success.main || theme.palette.success : _apperance.palette.success,
|
|
38
|
+
info: theme.palette.info ? theme.palette.info.main || theme.palette.info : _apperance.palette.info,
|
|
39
|
+
white: theme.palette.white || _apperance.palette.white,
|
|
40
|
+
dark: theme.palette.dark || _apperance.palette.dark,
|
|
41
|
+
gray: theme.palette.gray,
|
|
42
|
+
blue: theme.palette.blue || _apperance.palette.blue,
|
|
43
|
+
background: theme.palette.background || _apperance.palette.background,
|
|
44
|
+
border: theme.palette.border || _apperance.palette.border,
|
|
45
|
+
shadow: theme.palette.shadow || _apperance.palette.shadow
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// Check if theme object itself has gray (root level)
|
|
49
|
+
if (theme && theme.gray && theme.gray.darker) {
|
|
50
|
+
return {
|
|
51
|
+
primary: theme.primary,
|
|
52
|
+
secondary: theme.secondary,
|
|
53
|
+
error: theme.error || _apperance.palette.error,
|
|
54
|
+
warning: theme.warning || _apperance.palette.warning,
|
|
55
|
+
success: theme.success || _apperance.palette.success,
|
|
56
|
+
info: theme.info || _apperance.palette.info,
|
|
57
|
+
white: theme.white || _apperance.palette.white,
|
|
58
|
+
dark: theme.dark || _apperance.palette.dark,
|
|
59
|
+
gray: theme.gray,
|
|
60
|
+
blue: theme.blue || _apperance.palette.blue,
|
|
61
|
+
background: theme.background || _apperance.palette.background,
|
|
62
|
+
border: theme.border || _apperance.palette.border,
|
|
63
|
+
shadow: theme.shadow || _apperance.palette.shadow
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return _apperance.palette;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// Helper function to get button styles from theme
|
|
70
|
+
const getButtonStyles = theme => {
|
|
71
|
+
if (theme && theme.components && theme.components.PuiButton) {
|
|
72
|
+
return theme.components.PuiButton;
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
height: "25px",
|
|
76
|
+
borderRadius: "4px",
|
|
77
|
+
borderWidth: "2px",
|
|
78
|
+
fontFamily: "inherit",
|
|
79
|
+
fontWeight: "500",
|
|
80
|
+
tertiaryBorderColor: _apperance.palette.gray.dark,
|
|
81
|
+
boxShadow: "0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)"
|
|
82
|
+
};
|
|
83
|
+
};
|
|
28
84
|
const BaseMuiButton = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_StyledMuiButton.default, _objectSpread({
|
|
29
85
|
ref: ref
|
|
30
|
-
}, props))))(
|
|
86
|
+
}, props))))(props => {
|
|
87
|
+
const buttonStyles = getButtonStyles(props.theme);
|
|
31
88
|
return {
|
|
32
89
|
"&.MuiButton-root": {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
transition: "all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)",
|
|
40
|
-
boxShadow: _apperance.palette.shadow.light,
|
|
41
|
-
minHeight: "40px",
|
|
42
|
-
padding: "8px 16px",
|
|
43
|
-
"&.MuiButton-sizeLarge": {
|
|
44
|
-
minHeight: "48px",
|
|
45
|
-
padding: "12px 24px",
|
|
46
|
-
fontSize: "16px",
|
|
47
|
-
borderRadius: "10px"
|
|
48
|
-
},
|
|
49
|
-
"&.MuiButton-sizeSmall": {
|
|
50
|
-
minHeight: "32px",
|
|
51
|
-
padding: "6px 12px",
|
|
52
|
-
fontSize: "12px",
|
|
53
|
-
borderRadius: "6px"
|
|
54
|
-
},
|
|
55
|
-
"&:hover": {
|
|
56
|
-
boxShadow: _apperance.palette.shadow.medium,
|
|
57
|
-
transform: "translateY(-1px)"
|
|
58
|
-
},
|
|
59
|
-
"&:active": {
|
|
60
|
-
boxShadow: _apperance.palette.shadow.light,
|
|
61
|
-
transform: "translateY(0)"
|
|
62
|
-
},
|
|
63
|
-
"&:focus": {
|
|
64
|
-
outline: "2px solid ".concat(_apperance.palette.primary, "40"),
|
|
65
|
-
outlineOffset: "2px"
|
|
66
|
-
},
|
|
67
|
-
"&:disabled": {
|
|
68
|
-
transform: "none",
|
|
69
|
-
boxShadow: "none",
|
|
70
|
-
opacity: 0.6
|
|
71
|
-
}
|
|
90
|
+
height: buttonStyles.height || "37px",
|
|
91
|
+
borderRadius: buttonStyles.borderRadius || "10px",
|
|
92
|
+
fontFamily: buttonStyles.fontFamily || "inherit",
|
|
93
|
+
fontWeight: buttonStyles.fontWeight || "500",
|
|
94
|
+
boxShadow: buttonStyles.boxShadow !== undefined && buttonStyles.boxShadow !== "none" ? buttonStyles.boxShadow : buttonStyles.boxShadow === "none" ? "none" : "0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)",
|
|
95
|
+
textTransform: "none"
|
|
72
96
|
}
|
|
73
97
|
};
|
|
74
98
|
});
|
|
75
99
|
const PrimaryButton = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(BaseMuiButton, _objectSpread({
|
|
76
100
|
ref: ref,
|
|
77
|
-
variant: "
|
|
78
|
-
}, props))))(
|
|
101
|
+
variant: "outlined"
|
|
102
|
+
}, props))))(props => {
|
|
103
|
+
const themePalette = getPalette(props.theme);
|
|
104
|
+
const buttonStyles = getButtonStyles(props.theme);
|
|
105
|
+
const borderWidth = buttonStyles.borderWidth || "2px";
|
|
79
106
|
return {
|
|
80
107
|
"&.MuiButton-root": {
|
|
81
|
-
|
|
82
|
-
border: "
|
|
83
|
-
color:
|
|
84
|
-
boxShadow: "0 2px 8px ".concat(_apperance.palette.primary, "40"),
|
|
108
|
+
backgroundColor: themePalette.primary,
|
|
109
|
+
border: "".concat(borderWidth, " solid ").concat(themePalette.primary),
|
|
110
|
+
color: themePalette.white,
|
|
85
111
|
"&:hover": {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
"&:active": {
|
|
90
|
-
background: "linear-gradient(135deg, ".concat(_apperance.palette.blue.darker, " 0%, ").concat(_apperance.palette.blue.darker, " 100%)")
|
|
91
|
-
},
|
|
92
|
-
"&:focus": {
|
|
93
|
-
boxShadow: "0 0 0 3px ".concat(_apperance.palette.primary, "30, 0 2px 8px ").concat(_apperance.palette.primary, "40")
|
|
94
|
-
},
|
|
95
|
-
"&:disabled": {
|
|
96
|
-
background: _apperance.palette.gray[300],
|
|
97
|
-
color: _apperance.palette.gray[500],
|
|
98
|
-
boxShadow: "none"
|
|
112
|
+
backgroundColor: themePalette.primary,
|
|
113
|
+
opacity: 0.9
|
|
99
114
|
}
|
|
100
115
|
}
|
|
101
116
|
};
|
|
@@ -103,60 +118,38 @@ const PrimaryButton = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
103
118
|
const SecondaryButton = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(BaseMuiButton, _objectSpread({
|
|
104
119
|
ref: ref,
|
|
105
120
|
variant: "outlined"
|
|
106
|
-
}, props))))(
|
|
121
|
+
}, props))))(props => {
|
|
122
|
+
const themePalette = getPalette(props.theme);
|
|
123
|
+
const buttonStyles = getButtonStyles(props.theme);
|
|
124
|
+
const borderWidth = buttonStyles.borderWidth || "2px";
|
|
107
125
|
return {
|
|
108
126
|
"&.MuiButton-root": {
|
|
109
|
-
backgroundColor:
|
|
110
|
-
border: "
|
|
111
|
-
color:
|
|
112
|
-
boxShadow: "none",
|
|
127
|
+
backgroundColor: themePalette.secondary,
|
|
128
|
+
border: "".concat(borderWidth, " solid ").concat(themePalette.gray.dark),
|
|
129
|
+
color: themePalette.gray.darker,
|
|
113
130
|
"&:hover": {
|
|
114
|
-
backgroundColor:
|
|
115
|
-
|
|
116
|
-
color: _apperance.palette.primary,
|
|
117
|
-
boxShadow: "0 2px 8px ".concat(_apperance.palette.primary, "20")
|
|
118
|
-
},
|
|
119
|
-
"&:active": {
|
|
120
|
-
backgroundColor: _apperance.palette.gray[100],
|
|
121
|
-
borderColor: _apperance.palette.blue.dark
|
|
122
|
-
},
|
|
123
|
-
"&:focus": {
|
|
124
|
-
boxShadow: "0 0 0 3px ".concat(_apperance.palette.primary, "20"),
|
|
125
|
-
borderColor: _apperance.palette.primary
|
|
126
|
-
},
|
|
127
|
-
"&:disabled": {
|
|
128
|
-
backgroundColor: _apperance.palette.gray[50],
|
|
129
|
-
borderColor: _apperance.palette.gray[200],
|
|
130
|
-
color: _apperance.palette.gray[400]
|
|
131
|
+
backgroundColor: themePalette.secondary,
|
|
132
|
+
opacity: 0.9
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
135
|
};
|
|
134
136
|
});
|
|
135
137
|
const TertiaryButton = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(BaseMuiButton, _objectSpread({
|
|
136
138
|
ref: ref,
|
|
137
|
-
variant: "
|
|
138
|
-
}, props))))(
|
|
139
|
+
variant: "outlined"
|
|
140
|
+
}, props))))(props => {
|
|
141
|
+
const themePalette = getPalette(props.theme);
|
|
142
|
+
const buttonStyles = getButtonStyles(props.theme);
|
|
143
|
+
const borderWidth = buttonStyles.borderWidth || "2px";
|
|
144
|
+
const tertiaryBorderColor = buttonStyles.tertiaryBorderColor || themePalette.primary;
|
|
139
145
|
return {
|
|
140
146
|
"&.MuiButton-root": {
|
|
141
|
-
backgroundColor:
|
|
142
|
-
border: "
|
|
143
|
-
color:
|
|
144
|
-
boxShadow: "none",
|
|
147
|
+
backgroundColor: themePalette.white,
|
|
148
|
+
border: "".concat(borderWidth, " solid ").concat(tertiaryBorderColor),
|
|
149
|
+
color: themePalette.primary,
|
|
145
150
|
"&:hover": {
|
|
146
|
-
backgroundColor:
|
|
147
|
-
|
|
148
|
-
boxShadow: "none"
|
|
149
|
-
},
|
|
150
|
-
"&:active": {
|
|
151
|
-
backgroundColor: "".concat(_apperance.palette.primary, "15")
|
|
152
|
-
},
|
|
153
|
-
"&:focus": {
|
|
154
|
-
boxShadow: "0 0 0 3px ".concat(_apperance.palette.primary, "20"),
|
|
155
|
-
backgroundColor: "".concat(_apperance.palette.primary, "08")
|
|
156
|
-
},
|
|
157
|
-
"&:disabled": {
|
|
158
|
-
backgroundColor: "transparent",
|
|
159
|
-
color: _apperance.palette.gray[400]
|
|
151
|
+
backgroundColor: themePalette.white,
|
|
152
|
+
opacity: 0.9
|
|
160
153
|
}
|
|
161
154
|
}
|
|
162
155
|
};
|
|
@@ -194,7 +187,7 @@ const PuiButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
194
187
|
id,
|
|
195
188
|
className,
|
|
196
189
|
sx,
|
|
197
|
-
size: "
|
|
190
|
+
size: "small",
|
|
198
191
|
disabled,
|
|
199
192
|
loading,
|
|
200
193
|
loadingPosition,
|
|
@@ -33,14 +33,12 @@ const StyledMuiButton = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((_ref,
|
|
|
33
33
|
}))(() => {
|
|
34
34
|
return {
|
|
35
35
|
"&.MuiButton-root": {
|
|
36
|
-
fontSize: "0.
|
|
36
|
+
fontSize: "0.75rem",
|
|
37
37
|
lineSpacing: "-0.03em",
|
|
38
38
|
textTransform: "initial",
|
|
39
|
-
height: "
|
|
40
|
-
padding: "0px
|
|
39
|
+
height: "25px",
|
|
40
|
+
padding: "0px 12px",
|
|
41
41
|
fontWeight: "600",
|
|
42
|
-
borderRadius: "6px",
|
|
43
|
-
transition: "all 0.2s ease-in-out",
|
|
44
42
|
"&.Mui-disabled": {
|
|
45
43
|
opacity: 0.7
|
|
46
44
|
}
|
|
@@ -17,7 +17,7 @@ var _apperance = require("../../config/apperance");
|
|
|
17
17
|
var _PuiIcon = _interopRequireDefault(require("../others/PuiIcon"));
|
|
18
18
|
var _PuiIndication = _interopRequireDefault(require("../typography/PuiIndication"));
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["className", "required", "error", "helperText", "name", "disabled"];
|
|
20
|
+
const _excluded = ["className", "required", "error", "helperText", "name", "disabled"]; // Helper function to get palette from theme or fallback to appearance
|
|
21
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
23
23
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -27,6 +27,73 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
27
27
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
28
28
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
29
29
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
30
|
+
const getPalette = theme => {
|
|
31
|
+
// Check if theme has our custom palette properties
|
|
32
|
+
if (theme && theme.palette && theme.palette.gray && theme.palette.gray.darker) {
|
|
33
|
+
// Theme has our custom structure, now normalize it
|
|
34
|
+
return {
|
|
35
|
+
primary: theme.palette.primary.main || theme.palette.primary,
|
|
36
|
+
secondary: theme.palette.secondary.main || theme.palette.secondary,
|
|
37
|
+
error: theme.palette.error ? theme.palette.error.main || theme.palette.error : _apperance.palette.error,
|
|
38
|
+
warning: theme.palette.warning ? theme.palette.warning.main || theme.palette.warning : _apperance.palette.warning,
|
|
39
|
+
success: theme.palette.success ? theme.palette.success.main || theme.palette.success : _apperance.palette.success,
|
|
40
|
+
info: theme.palette.info ? theme.palette.info.main || theme.palette.info : _apperance.palette.info,
|
|
41
|
+
white: theme.palette.white || _apperance.palette.white,
|
|
42
|
+
dark: theme.palette.dark || _apperance.palette.dark,
|
|
43
|
+
gray: theme.palette.gray,
|
|
44
|
+
blue: theme.palette.blue || _apperance.palette.blue,
|
|
45
|
+
background: theme.palette.background || _apperance.palette.background,
|
|
46
|
+
border: theme.palette.border || _apperance.palette.border,
|
|
47
|
+
shadow: theme.palette.shadow || _apperance.palette.shadow
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// Check if theme object itself has gray (root level)
|
|
51
|
+
if (theme && theme.gray && theme.gray.darker) {
|
|
52
|
+
return {
|
|
53
|
+
primary: theme.primary,
|
|
54
|
+
secondary: theme.secondary,
|
|
55
|
+
error: theme.error || _apperance.palette.error,
|
|
56
|
+
warning: theme.warning || _apperance.palette.warning,
|
|
57
|
+
success: theme.success || _apperance.palette.success,
|
|
58
|
+
info: theme.info || _apperance.palette.info,
|
|
59
|
+
white: theme.white || _apperance.palette.white,
|
|
60
|
+
dark: theme.dark || _apperance.palette.dark,
|
|
61
|
+
gray: theme.gray,
|
|
62
|
+
blue: theme.blue || _apperance.palette.blue,
|
|
63
|
+
background: theme.background || _apperance.palette.background,
|
|
64
|
+
border: theme.border || _apperance.palette.border,
|
|
65
|
+
shadow: theme.shadow || _apperance.palette.shadow
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return _apperance.palette;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Helper function to get TextField styles from theme
|
|
72
|
+
const getTextFieldStyles = theme => {
|
|
73
|
+
if (theme && theme.components && theme.components.PuiTextField) {
|
|
74
|
+
return theme.components.PuiTextField;
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
inputRoot: {
|
|
78
|
+
backgroundColor: _apperance.palette.white,
|
|
79
|
+
border: "2px solid ".concat(_apperance.palette.gray.dark),
|
|
80
|
+
borderRadius: "5px",
|
|
81
|
+
height: "auto",
|
|
82
|
+
lineHeight: "1"
|
|
83
|
+
},
|
|
84
|
+
label: {
|
|
85
|
+
color: _apperance.palette.gray.darker,
|
|
86
|
+
marginBottom: "4px",
|
|
87
|
+
fontSize: "0.8rem"
|
|
88
|
+
},
|
|
89
|
+
disabled: {
|
|
90
|
+
backgroundColor: "#f5f5f5",
|
|
91
|
+
// Light grey background for disabled
|
|
92
|
+
border: "1px solid #cecdd3",
|
|
93
|
+
labelColor: "#97969b"
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
};
|
|
30
97
|
const StyledMuiTextField = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
31
98
|
let {
|
|
32
99
|
className,
|
|
@@ -55,92 +122,69 @@ const StyledMuiTextField = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((_r
|
|
|
55
122
|
},
|
|
56
123
|
ref: ref
|
|
57
124
|
}, rest));
|
|
58
|
-
}))(
|
|
125
|
+
}))(props => {
|
|
126
|
+
var _themePalette$backgro, _textFieldStyles$disa, _themePalette$backgro2, _textFieldStyles$disa2, _textFieldStyles$disa3;
|
|
127
|
+
const themePalette = getPalette(props.theme);
|
|
128
|
+
const textFieldStyles = getTextFieldStyles(props.theme);
|
|
59
129
|
return {
|
|
60
130
|
"&.MuiFormControl-root": {
|
|
61
131
|
"&.required .MuiInputBase-root": {
|
|
62
|
-
backgroundColor: _apperance.palette.background.required
|
|
132
|
+
backgroundColor: ((_themePalette$backgro = themePalette.background) === null || _themePalette$backgro === void 0 ? void 0 : _themePalette$backgro.required) || _apperance.palette.background.required
|
|
63
133
|
},
|
|
64
134
|
"& .MuiFormLabel-root": {
|
|
65
135
|
zIndex: 0,
|
|
66
136
|
lineSpacing: "-0.03em",
|
|
67
137
|
position: "initial",
|
|
68
138
|
transform: "none",
|
|
69
|
-
fontSize: "
|
|
139
|
+
fontSize: "".concat(textFieldStyles.label.fontSize, " !important"),
|
|
70
140
|
fontWeight: "600",
|
|
71
|
-
marginBottom: "
|
|
72
|
-
color:
|
|
73
|
-
"&.Mui-focused": {
|
|
74
|
-
color:
|
|
141
|
+
marginBottom: "".concat(textFieldStyles.label.marginBottom, " !important"),
|
|
142
|
+
color: "".concat(textFieldStyles.label.color, " !important"),
|
|
143
|
+
"&.Mui-focused ": {
|
|
144
|
+
color: "".concat(themePalette.primary, " !important")
|
|
75
145
|
},
|
|
76
146
|
"&.Mui-disabled": {
|
|
77
|
-
color:
|
|
147
|
+
color: "".concat(((_textFieldStyles$disa = textFieldStyles.disabled) === null || _textFieldStyles$disa === void 0 ? void 0 : _textFieldStyles$disa.labelColor) || "#97969b", " !important")
|
|
78
148
|
},
|
|
79
149
|
"&.Mui-error": {
|
|
80
|
-
color:
|
|
150
|
+
color: "".concat(themePalette.error, " !important")
|
|
81
151
|
}
|
|
82
152
|
},
|
|
83
153
|
"& .MuiInputBase-root": {
|
|
84
|
-
backgroundColor:
|
|
85
|
-
border: "
|
|
86
|
-
borderRadius: "
|
|
87
|
-
|
|
88
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
89
|
-
transition: "all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)",
|
|
90
|
-
"&:hover": {
|
|
91
|
-
borderColor: _apperance.palette.gray[400],
|
|
92
|
-
boxShadow: "0 0 0 2px ".concat(_apperance.palette.primary, "10")
|
|
93
|
-
},
|
|
154
|
+
backgroundColor: "".concat(textFieldStyles.inputRoot.backgroundColor, " !important"),
|
|
155
|
+
border: "".concat(textFieldStyles.inputRoot.border, " !important"),
|
|
156
|
+
borderRadius: "".concat(textFieldStyles.inputRoot.borderRadius, " !important"),
|
|
157
|
+
height: "".concat(textFieldStyles.inputRoot.height, " !important"),
|
|
94
158
|
"&.MuiInputBase-multiline": {
|
|
95
159
|
padding: "8px 0",
|
|
96
|
-
|
|
160
|
+
height: "auto !important"
|
|
97
161
|
},
|
|
98
|
-
"&.Mui-focused": {
|
|
99
|
-
border: "2px solid ".concat(
|
|
100
|
-
boxShadow: "0 0 0 3px ".concat(_apperance.palette.primary, "20"),
|
|
101
|
-
outline: "none"
|
|
162
|
+
"&.Mui-focused ": {
|
|
163
|
+
border: "2px solid ".concat(themePalette.primary, " !important")
|
|
102
164
|
},
|
|
103
|
-
"&.Mui-error": {
|
|
104
|
-
border: "2px solid ".concat(
|
|
105
|
-
backgroundColor: _apperance.palette.background.error,
|
|
106
|
-
boxShadow: "0 0 0 2px ".concat(_apperance.palette.error, "20")
|
|
165
|
+
"&.Mui-error ": {
|
|
166
|
+
border: "2px solid ".concat(themePalette.error, " !important"),
|
|
167
|
+
backgroundColor: "".concat(((_themePalette$backgro2 = themePalette.background) === null || _themePalette$backgro2 === void 0 ? void 0 : _themePalette$backgro2.error) || _apperance.palette.background.error, " !important")
|
|
107
168
|
},
|
|
108
|
-
"&.Mui-disabled": {
|
|
169
|
+
"&.Mui-disabled ": {
|
|
170
|
+
backgroundColor: "".concat(((_textFieldStyles$disa2 = textFieldStyles.disabled) === null || _textFieldStyles$disa2 === void 0 ? void 0 : _textFieldStyles$disa2.backgroundColor) || "#f5f5f5", " !important"),
|
|
171
|
+
border: "".concat(((_textFieldStyles$disa3 = textFieldStyles.disabled) === null || _textFieldStyles$disa3 === void 0 ? void 0 : _textFieldStyles$disa3.border) || "1px solid #cecdd3", " !important"),
|
|
172
|
+
borderRadius: "".concat(textFieldStyles.inputRoot.borderRadius, " !important"),
|
|
109
173
|
"& input": {
|
|
110
|
-
color:
|
|
111
|
-
WebkitTextFillColor:
|
|
112
|
-
},
|
|
113
|
-
backgroundColor: _apperance.palette.gray[50],
|
|
114
|
-
borderColor: _apperance.palette.gray[200],
|
|
115
|
-
cursor: "not-allowed"
|
|
116
|
-
},
|
|
117
|
-
"& .MuiInputBase-input": {
|
|
118
|
-
lineHeight: "1.5",
|
|
119
|
-
padding: "10px 14px",
|
|
120
|
-
fontSize: "14px",
|
|
121
|
-
fontWeight: 400,
|
|
122
|
-
"&::placeholder": {
|
|
123
|
-
color: _apperance.palette.gray[400],
|
|
124
|
-
opacity: 1,
|
|
125
|
-
fontStyle: "italic"
|
|
174
|
+
color: "".concat(themePalette.gray.darker),
|
|
175
|
+
WebkitTextFillColor: "".concat(themePalette.gray.darker)
|
|
126
176
|
}
|
|
127
177
|
},
|
|
128
|
-
"& .MuiInputBase-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"& .MuiInputAdornment-root": {
|
|
133
|
-
color: _apperance.palette.gray[500],
|
|
134
|
-
"& .MuiSvgIcon-root": {
|
|
135
|
-
fontSize: "1.2rem"
|
|
136
|
-
}
|
|
178
|
+
"& .MuiInputBase-input": {
|
|
179
|
+
lineHeight: "".concat(textFieldStyles.inputRoot.lineHeight, " !important"),
|
|
180
|
+
padding: "1px 6px",
|
|
181
|
+
fontSize: "0.7rem"
|
|
137
182
|
}
|
|
138
183
|
},
|
|
139
184
|
"& .MuiFormHelperText-root": {
|
|
140
|
-
fontWeight: "
|
|
141
|
-
fontSize: "
|
|
142
|
-
|
|
143
|
-
color: _apperance.palette.gray[600]
|
|
185
|
+
fontWeight: "bold",
|
|
186
|
+
fontSize: ".7rem",
|
|
187
|
+
color: themePalette.gray.darker
|
|
144
188
|
},
|
|
145
189
|
"& fieldset": {
|
|
146
190
|
display: "none"
|