@balena/ui-shared-components 0.13.2 → 0.13.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.
@@ -23,7 +23,7 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import Form from '@rjsf/mui';
25
25
  import ajvValidator from '@rjsf/validator-ajv8';
26
- import { Box, Button } from '@mui/material';
26
+ import { Box, Button, styled } from '@mui/material';
27
27
  import { PasswordWidget } from './Widgets/PasswordWidget';
28
28
  import { SelectWidget } from './Widgets/SelectWidget';
29
29
  import { FileWidget } from './Widgets/FileWidget';
@@ -34,10 +34,16 @@ var internalWidgets = {
34
34
  SelectWidget: SelectWidget,
35
35
  FileWidget: FileWidget,
36
36
  };
37
+ var FormWrapper = styled('div')({
38
+ // Target the Paper component within the array container
39
+ '& .field-array .MuiPaper-root.MuiPaper-elevation': {
40
+ boxShadow: 'none',
41
+ },
42
+ });
37
43
  export var RJSForm = function (_a) {
38
44
  var hideSubmitButton = _a.hideSubmitButton, submitButtonProps = _a.submitButtonProps, actionButtons = _a.actionButtons, _b = _a.validator, validator = _b === void 0 ? ajvValidator : _b, widgets = _a.widgets, children = _a.children, ref = _a.ref, sx = _a.sx, onFocus = _a.onFocus, onBlur = _a.onBlur, templates = _a.templates, otherProps = __rest(_a, ["hideSubmitButton", "submitButtonProps", "actionButtons", "validator", "widgets", "children", "ref", "sx", "onFocus", "onBlur", "templates"]);
39
45
  // paddingY is resolving an outline glitch that is truncated when inside a container.
40
- return (_jsx(Box, __assign({ sx: __assign({ paddingY: '1px' }, sx), onFocus: onFocus, onBlur: onBlur }, { children: _jsxs(Form, __assign({ ref: ref, validator: validator, showErrorList: false, widgets: __assign(__assign({}, internalWidgets), (widgets || {})), templates: __assign({ ObjectFieldTemplate: ObjectFieldTemplate }, templates) }, otherProps, { children: [hideSubmitButton && _jsx(Fragment, {}), actionButtons === null || actionButtons === void 0 ? void 0 : actionButtons.map(function (buttonProps) { return (_jsx(Button, __assign({}, buttonProps))); }), !hideSubmitButton && (_jsx(Button, __assign({ children: 'Submit',
41
- // TODO: remove once we migrate buttons
42
- disableRipple: true }, submitButtonProps, { color: "customBlue", variant: "contained", type: "submit" }))), children] })) })));
46
+ return (_jsx(FormWrapper, { children: _jsx(Box, __assign({ sx: __assign({ paddingY: '1px' }, sx), onFocus: onFocus, onBlur: onBlur }, { children: _jsxs(Form, __assign({ ref: ref, validator: validator, showErrorList: false, widgets: __assign(__assign({}, internalWidgets), (widgets || {})), templates: __assign({ ObjectFieldTemplate: ObjectFieldTemplate }, templates) }, otherProps, { children: [hideSubmitButton && _jsx(Fragment, {}), actionButtons === null || actionButtons === void 0 ? void 0 : actionButtons.map(function (buttonProps) { return (_jsx(Button, __assign({}, buttonProps))); }), !hideSubmitButton && (_jsx(Button, __assign({ children: 'Submit',
47
+ // TODO: remove once we migrate buttons
48
+ disableRipple: true }, submitButtonProps, { color: "customBlue", variant: "contained", type: "submit" }))), children] })) })) }));
43
49
  };
package/dist/theme.js CHANGED
@@ -316,14 +316,6 @@ export var theme = createTheme({
316
316
  },
317
317
  },
318
318
  },
319
- // This is needed for RJSForm. If it gives any problem, we can remove this rule and override the behavior using the ArrayField field.
320
- MuiPaper: {
321
- styleOverrides: {
322
- root: {
323
- boxShadow: 'none',
324
- },
325
- },
326
- },
327
319
  MuiTooltip: {
328
320
  defaultProps: {
329
321
  arrow: true,
@@ -2,7 +2,7 @@ import { __assign, __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import Form from '@rjsf/mui';
4
4
  import ajvValidator from '@rjsf/validator-ajv8';
5
- import { Box, Button } from '@mui/material';
5
+ import { Box, Button, styled } from '@mui/material';
6
6
  import { PasswordWidget } from './Widgets/PasswordWidget';
7
7
  import { SelectWidget } from './Widgets/SelectWidget';
8
8
  import { FileWidget } from './Widgets/FileWidget';
@@ -13,10 +13,16 @@ var internalWidgets = {
13
13
  SelectWidget: SelectWidget,
14
14
  FileWidget: FileWidget,
15
15
  };
16
+ var FormWrapper = styled('div')({
17
+ // Target the Paper component within the array container
18
+ '& .field-array .MuiPaper-root.MuiPaper-elevation': {
19
+ boxShadow: 'none',
20
+ },
21
+ });
16
22
  export var RJSForm = function (_a) {
17
23
  var hideSubmitButton = _a.hideSubmitButton, submitButtonProps = _a.submitButtonProps, actionButtons = _a.actionButtons, _b = _a.validator, validator = _b === void 0 ? ajvValidator : _b, widgets = _a.widgets, children = _a.children, ref = _a.ref, sx = _a.sx, onFocus = _a.onFocus, onBlur = _a.onBlur, templates = _a.templates, otherProps = __rest(_a, ["hideSubmitButton", "submitButtonProps", "actionButtons", "validator", "widgets", "children", "ref", "sx", "onFocus", "onBlur", "templates"]);
18
24
  // paddingY is resolving an outline glitch that is truncated when inside a container.
19
- return (_jsx(Box, __assign({ sx: __assign({ paddingY: '1px' }, sx), onFocus: onFocus, onBlur: onBlur }, { children: _jsxs(Form, __assign({ ref: ref, validator: validator, showErrorList: false, widgets: __assign(__assign({}, internalWidgets), (widgets || {})), templates: __assign({ ObjectFieldTemplate: ObjectFieldTemplate }, templates) }, otherProps, { children: [hideSubmitButton && _jsx(Fragment, {}), actionButtons === null || actionButtons === void 0 ? void 0 : actionButtons.map(function (buttonProps) { return (_jsx(Button, __assign({}, buttonProps))); }), !hideSubmitButton && (_jsx(Button, __assign({ children: 'Submit',
20
- // TODO: remove once we migrate buttons
21
- disableRipple: true }, submitButtonProps, { color: "customBlue", variant: "contained", type: "submit" }))), children] })) })));
25
+ return (_jsx(FormWrapper, { children: _jsx(Box, __assign({ sx: __assign({ paddingY: '1px' }, sx), onFocus: onFocus, onBlur: onBlur }, { children: _jsxs(Form, __assign({ ref: ref, validator: validator, showErrorList: false, widgets: __assign(__assign({}, internalWidgets), (widgets || {})), templates: __assign({ ObjectFieldTemplate: ObjectFieldTemplate }, templates) }, otherProps, { children: [hideSubmitButton && _jsx(Fragment, {}), actionButtons === null || actionButtons === void 0 ? void 0 : actionButtons.map(function (buttonProps) { return (_jsx(Button, __assign({}, buttonProps))); }), !hideSubmitButton && (_jsx(Button, __assign({ children: 'Submit',
26
+ // TODO: remove once we migrate buttons
27
+ disableRipple: true }, submitButtonProps, { color: "customBlue", variant: "contained", type: "submit" }))), children] })) })) }));
22
28
  };
@@ -316,14 +316,6 @@ export var theme = createTheme({
316
316
  },
317
317
  },
318
318
  },
319
- // This is needed for RJSForm. If it gives any problem, we can remove this rule and override the behavior using the ArrayField field.
320
- MuiPaper: {
321
- styleOverrides: {
322
- root: {
323
- boxShadow: 'none',
324
- },
325
- },
326
- },
327
319
  MuiTooltip: {
328
320
  defaultProps: {
329
321
  arrow: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/ui-shared-components",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist_esm5/index.js",
6
6
  "sideEffects": false,
@@ -112,6 +112,6 @@
112
112
  },
113
113
  "homepage": "https://github.com/balena-io/ui-shared-components#readme",
114
114
  "versionist": {
115
- "publishedAt": "2023-11-28T10:34:39.906Z"
115
+ "publishedAt": "2023-11-28T13:42:45.922Z"
116
116
  }
117
117
  }