@instructure/ui-modal 11.7.3-snapshot-25 → 11.7.3-snapshot-26

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +5 -2
  2. package/es/Modal/v1/ModalBody/index.js +53 -54
  3. package/es/Modal/v1/ModalBody/styles.js +3 -1
  4. package/es/Modal/v1/ModalBody/theme.js +4 -3
  5. package/es/Modal/v1/ModalContext.js +1 -1
  6. package/es/Modal/v1/ModalFooter/index.js +20 -23
  7. package/es/Modal/v1/ModalFooter/styles.js +3 -1
  8. package/es/Modal/v1/ModalFooter/theme.js +12 -11
  9. package/es/Modal/v1/ModalHeader/index.js +47 -50
  10. package/es/Modal/v1/ModalHeader/styles.js +7 -3
  11. package/es/Modal/v1/ModalHeader/theme.js +10 -9
  12. package/es/Modal/v1/index.js +88 -84
  13. package/es/Modal/v1/styles.js +5 -3
  14. package/es/Modal/v1/theme.js +19 -18
  15. package/es/Modal/v2/ModalBody/index.js +54 -55
  16. package/es/Modal/v2/ModalBody/styles.js +4 -2
  17. package/es/Modal/v2/ModalContext.js +1 -1
  18. package/es/Modal/v2/ModalFooter/index.js +20 -23
  19. package/es/Modal/v2/ModalFooter/styles.js +4 -2
  20. package/es/Modal/v2/ModalHeader/index.js +47 -50
  21. package/es/Modal/v2/ModalHeader/styles.js +7 -3
  22. package/es/Modal/v2/index.js +88 -84
  23. package/es/Modal/v2/styles.js +5 -3
  24. package/lib/Modal/v1/ModalBody/index.js +53 -54
  25. package/lib/Modal/v1/ModalBody/styles.js +3 -1
  26. package/lib/Modal/v1/ModalBody/theme.js +4 -3
  27. package/lib/Modal/v1/ModalContext.js +1 -1
  28. package/lib/Modal/v1/ModalFooter/index.js +20 -23
  29. package/lib/Modal/v1/ModalFooter/styles.js +3 -1
  30. package/lib/Modal/v1/ModalFooter/theme.js +12 -11
  31. package/lib/Modal/v1/ModalHeader/index.js +47 -50
  32. package/lib/Modal/v1/ModalHeader/styles.js +7 -3
  33. package/lib/Modal/v1/ModalHeader/theme.js +10 -9
  34. package/lib/Modal/v1/index.js +88 -84
  35. package/lib/Modal/v1/styles.js +5 -3
  36. package/lib/Modal/v1/theme.js +19 -18
  37. package/lib/Modal/v2/ModalBody/index.js +54 -55
  38. package/lib/Modal/v2/ModalBody/styles.js +4 -2
  39. package/lib/Modal/v2/ModalContext.js +1 -1
  40. package/lib/Modal/v2/ModalFooter/index.js +20 -23
  41. package/lib/Modal/v2/ModalFooter/styles.js +4 -2
  42. package/lib/Modal/v2/ModalHeader/index.js +47 -50
  43. package/lib/Modal/v2/ModalHeader/styles.js +7 -3
  44. package/lib/Modal/v2/index.js +88 -84
  45. package/lib/Modal/v2/styles.js +5 -3
  46. package/package.json +18 -18
  47. package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -3,9 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [11.7.3-snapshot-25](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-25) (2026-04-30)
6
+ ## [11.7.3-snapshot-26](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-26) (2026-05-05)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-modal
8
+
9
+ ### Bug Fixes
10
+
11
+ * **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
9
12
 
10
13
 
11
14
 
@@ -1,6 +1,4 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- const _excluded = ["as", "elementRef", "overflow", "variant", "padding", "children"];
3
- var _dec, _class, _ModalBody;
1
+ var _dec, _class;
4
2
  /*
5
3
  * The MIT License (MIT)
6
4
  *
@@ -41,21 +39,30 @@ id: Modal.Body
41
39
  ---
42
40
  **/
43
41
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
44
- let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_ModalBody = class ModalBody extends Component {
42
+ let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ModalBody extends Component {
43
+ static displayName = "ModalBody";
44
+ static componentId = 'Modal.Body';
45
+ static allowedProps = allowedProps;
46
+ static defaultProps = {
47
+ padding: 'medium',
48
+ as: 'div',
49
+ variant: 'default'
50
+ };
51
+ ref = null;
52
+ handleRef = el => {
53
+ const {
54
+ elementRef
55
+ } = this.props;
56
+ this.ref = el;
57
+ if (typeof elementRef === 'function') {
58
+ elementRef(el);
59
+ }
60
+ };
45
61
  constructor(props) {
46
62
  super(props);
47
- this.ref = null;
48
- this.handleRef = el => {
49
- const elementRef = this.props.elementRef;
50
- this.ref = el;
51
- if (typeof elementRef === 'function') {
52
- elementRef(el);
53
- }
54
- };
55
63
  }
56
64
  componentDidMount() {
57
- var _this$props$makeStyle, _this$props;
58
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
65
+ this.props.makeStyles?.();
59
66
 
60
67
  // We detect if -moz- prefixed style is present to identify whether we are in Firefox browser
61
68
  const style = this.ref && getCSSStyleDeclaration(this.ref);
@@ -67,12 +74,11 @@ let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
67
74
  }
68
75
  }
69
76
  componentDidUpdate() {
70
- var _this$props$makeStyle2, _this$props2;
71
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
77
+ this.props.makeStyles?.();
72
78
  }
73
79
  getFinalRef(el) {
74
80
  if (!el) {
75
- return void 0;
81
+ return undefined;
76
82
  }
77
83
  if (el instanceof Element) {
78
84
  return el;
@@ -80,53 +86,46 @@ let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
80
86
  if (el.ref) {
81
87
  return this.getFinalRef(el.ref);
82
88
  }
83
- return void 0;
89
+ return undefined;
84
90
  }
85
91
  render() {
86
- var _finalRef$scrollHeigh, _finalRef$getBounding, _finalRef$getBounding2;
87
- const _this$props3 = this.props,
88
- as = _this$props3.as,
89
- elementRef = _this$props3.elementRef,
90
- overflow = _this$props3.overflow,
91
- variant = _this$props3.variant,
92
- padding = _this$props3.padding,
93
- children = _this$props3.children,
94
- rest = _objectWithoutProperties(_this$props3, _excluded);
92
+ const {
93
+ as,
94
+ elementRef,
95
+ overflow,
96
+ variant,
97
+ padding,
98
+ children,
99
+ ...rest
100
+ } = this.props;
95
101
  const passthroughProps = View.omitViewProps(omitProps(rest, ModalBody.allowedProps), ModalBody);
96
102
  const isFit = overflow === 'fit';
97
103
  // this recursive function is needed because `ref` can be a React component.
98
104
  // TODO rethink, the 'as' prop, likely its not a good idea to allow React
99
105
  // components. See INSTUI-4674
100
106
  const finalRef = this.getFinalRef(this.ref);
101
- const hasScrollbar = finalRef && Math.abs(((_finalRef$scrollHeigh = finalRef.scrollHeight) !== null && _finalRef$scrollHeigh !== void 0 ? _finalRef$scrollHeigh : 0) - ((_finalRef$getBounding = (_finalRef$getBounding2 = finalRef.getBoundingClientRect()) === null || _finalRef$getBounding2 === void 0 ? void 0 : _finalRef$getBounding2.height) !== null && _finalRef$getBounding !== void 0 ? _finalRef$getBounding : 0)) > 1;
107
+ const hasScrollbar = finalRef && Math.abs((finalRef.scrollHeight ?? 0) - (finalRef.getBoundingClientRect()?.height ?? 0)) > 1;
102
108
  return _jsx(ModalContext.Consumer, {
103
- children: value => {
104
- var _this$props$styles;
105
- return _jsx(View, {
106
- ...passthroughProps,
107
- display: "block",
108
- "data-cid": "ModalBody",
109
- width: isFit ? '100%' : void 0,
110
- height: isFit ? '100%' : void 0,
111
- elementRef: this.handleRef,
112
- as: as,
113
- css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalBody,
114
- padding: padding
115
- // check if there is a scrollbar, if so, the element has to be tabbable
116
- ,
117
- ...(hasScrollbar ? {
118
- tabIndex: 0,
119
- 'aria-label': value.bodyScrollAriaLabel
120
- } : {}),
121
- children: children
122
- });
123
- }
109
+ children: value => _jsx(View, {
110
+ ...passthroughProps,
111
+ display: "block",
112
+ "data-cid": "ModalBody",
113
+ width: isFit ? '100%' : undefined,
114
+ height: isFit ? '100%' : undefined,
115
+ elementRef: this.handleRef,
116
+ as: as,
117
+ css: this.props.styles?.modalBody,
118
+ padding: padding
119
+ // check if there is a scrollbar, if so, the element has to be tabbable
120
+ ,
121
+ ...(hasScrollbar ? {
122
+ tabIndex: 0,
123
+ 'aria-label': value.bodyScrollAriaLabel
124
+ } : {}),
125
+ children: children
126
+ })
124
127
  });
125
128
  }
126
- }, _ModalBody.displayName = "ModalBody", _ModalBody.componentId = 'Modal.Body', _ModalBody.allowedProps = allowedProps, _ModalBody.defaultProps = {
127
- padding: 'medium',
128
- as: 'div',
129
- variant: 'default'
130
- }, _ModalBody)) || _class);
129
+ }) || _class);
131
130
  export default ModalBody;
132
131
  export { ModalBody };
@@ -33,7 +33,9 @@
33
33
  * @return {Object} The final style object, which will be used in the component
34
34
  */
35
35
  const generateStyle = (componentTheme, props) => {
36
- const variant = props.variant;
36
+ const {
37
+ variant
38
+ } = props;
37
39
  const backgroundStyle = variant === 'inverse' ? {
38
40
  background: componentTheme.inverseBackground
39
41
  } : {};
@@ -28,10 +28,11 @@
28
28
  * @return {Object} The final theme object with the overrides and component variables
29
29
  */
30
30
  const generateComponentTheme = theme => {
31
- var _colors$contrasts;
32
- const colors = theme.colors;
31
+ const {
32
+ colors
33
+ } = theme;
33
34
  return {
34
- inverseBackground: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey100100
35
+ inverseBackground: colors?.contrasts?.grey100100
35
36
  };
36
37
  };
37
38
  export default generateComponentTheme;
@@ -28,7 +28,7 @@ import { createContext } from 'react';
28
28
  * @private
29
29
  */
30
30
  const ModalContext = /*#__PURE__*/createContext({
31
- bodyScrollAriaLabel: void 0
31
+ bodyScrollAriaLabel: undefined
32
32
  });
33
33
  export default ModalContext;
34
34
  export { ModalContext };
@@ -1,6 +1,4 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- const _excluded = ["children"];
3
- var _dec, _class, _ModalFooter;
1
+ var _dec, _class;
4
2
  /*
5
3
  * The MIT License (MIT)
6
4
  *
@@ -38,37 +36,36 @@ parent: Modal
38
36
  id: Modal.Footer
39
37
  ---
40
38
  **/
41
- let ModalFooter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_ModalFooter = class ModalFooter extends Component {
42
- constructor(...args) {
43
- super(...args);
44
- this.ref = null;
45
- this.handleRef = el => {
46
- this.ref = el;
47
- };
48
- }
39
+ let ModalFooter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ModalFooter extends Component {
40
+ static displayName = "ModalFooter";
41
+ static componentId = 'Modal.Footer';
42
+ static allowedProps = allowedProps;
43
+ static defaultProps = {
44
+ variant: 'default'
45
+ };
46
+ ref = null;
47
+ handleRef = el => {
48
+ this.ref = el;
49
+ };
49
50
  componentDidMount() {
50
- var _this$props$makeStyle, _this$props;
51
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
51
+ this.props.makeStyles?.();
52
52
  }
53
53
  componentDidUpdate() {
54
- var _this$props$makeStyle2, _this$props2;
55
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
54
+ this.props.makeStyles?.();
56
55
  }
57
56
  render() {
58
- var _this$props$styles;
59
- const _this$props3 = this.props,
60
- children = _this$props3.children,
61
- rest = _objectWithoutProperties(_this$props3, _excluded);
57
+ const {
58
+ children,
59
+ ...rest
60
+ } = this.props;
62
61
  return _jsx("div", {
63
- css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalFooter,
62
+ css: this.props.styles?.modalFooter,
64
63
  ...passthroughProps(rest),
65
64
  ref: this.handleRef,
66
65
  "data-cid": "ModalFooter",
67
66
  children: children
68
67
  });
69
68
  }
70
- }, _ModalFooter.displayName = "ModalFooter", _ModalFooter.componentId = 'Modal.Footer', _ModalFooter.allowedProps = allowedProps, _ModalFooter.defaultProps = {
71
- variant: 'default'
72
- }, _ModalFooter)) || _class);
69
+ }) || _class);
73
70
  export default ModalFooter;
74
71
  export { ModalFooter };
@@ -33,7 +33,9 @@
33
33
  * @return {Object} The final style object, which will be used in the component
34
34
  */
35
35
  const generateStyle = (componentTheme, props) => {
36
- const variant = props.variant;
36
+ const {
37
+ variant
38
+ } = props;
37
39
  const backgroundStyle = variant === 'inverse' ? {
38
40
  background: componentTheme.inverseBackground,
39
41
  borderTop: `${componentTheme.borderWidth} solid ${componentTheme.inverseBorderColor}`
@@ -28,18 +28,19 @@
28
28
  * @return {Object} The final theme object with the overrides and component variables
29
29
  */
30
30
  const generateComponentTheme = theme => {
31
- var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4;
32
- const colors = theme.colors,
33
- spacing = theme.spacing,
34
- borders = theme.borders;
31
+ const {
32
+ colors,
33
+ spacing,
34
+ borders
35
+ } = theme;
35
36
  const componentVariables = {
36
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey1111,
37
- borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.grey1424,
38
- borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
39
- borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
40
- padding: spacing === null || spacing === void 0 ? void 0 : spacing.small,
41
- inverseBackground: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey100100,
42
- inverseBorderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.grey100100
37
+ background: colors?.contrasts?.grey1111,
38
+ borderColor: colors?.contrasts?.grey1424,
39
+ borderWidth: borders?.widthSmall,
40
+ borderRadius: borders?.radiusMedium,
41
+ padding: spacing?.small,
42
+ inverseBackground: colors?.contrasts?.grey100100,
43
+ inverseBorderColor: colors?.contrasts?.grey100100
43
44
  };
44
45
  return {
45
46
  ...componentVariables
@@ -1,6 +1,4 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- const _excluded = ["children"];
3
- var _dec, _class, _ModalHeader;
1
+ var _dec, _class;
4
2
  /*
5
3
  * The MIT License (MIT)
6
4
  *
@@ -40,49 +38,51 @@ parent: Modal
40
38
  id: Modal.Header
41
39
  ---
42
40
  **/
43
- let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_ModalHeader = class ModalHeader extends Component {
44
- constructor(...args) {
45
- super(...args);
46
- this.ref = null;
47
- /**
48
- * Gets all text in a DOM subtree, text under <button> nodes is excluded
49
- */
50
- this.getTextExcludingButtons = root => {
51
- const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, {
52
- acceptNode(node) {
53
- var _node$parentElement;
54
- return (_node$parentElement = node.parentElement) !== null && _node$parentElement !== void 0 && _node$parentElement.closest('button') ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
55
- }
56
- });
57
- let text = '';
58
- let current;
59
- while (current = walker.nextNode()) {
60
- text += current.nodeValue;
61
- }
62
- return text;
63
- };
64
- this.handleRef = el => {
65
- this.ref = el;
66
- if (el) {
67
- var _this$context$setBody, _this$context;
68
- const txt = this.getTextExcludingButtons(el);
69
- (_this$context$setBody = (_this$context = this.context).setBodyScrollAriaLabel) === null || _this$context$setBody === void 0 ? void 0 : _this$context$setBody.call(_this$context, txt);
41
+ let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ModalHeader extends Component {
42
+ static displayName = "ModalHeader";
43
+ static componentId = 'Modal.Header';
44
+ static allowedProps = allowedProps;
45
+ static defaultProps = {
46
+ variant: 'default',
47
+ spacing: 'default'
48
+ };
49
+ ref = null;
50
+ static contextType = ModalContext;
51
+
52
+ /**
53
+ * Gets all text in a DOM subtree, text under <button> nodes is excluded
54
+ */
55
+ getTextExcludingButtons = root => {
56
+ const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, {
57
+ acceptNode(node) {
58
+ return node.parentElement?.closest('button') ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
70
59
  }
71
- };
72
- this.makeStyleProps = () => {
73
- return {
74
- withCloseButton: this.usesCloseButton
75
- };
76
- };
77
- }
60
+ });
61
+ let text = '';
62
+ let current;
63
+ while (current = walker.nextNode()) {
64
+ text += current.nodeValue;
65
+ }
66
+ return text;
67
+ };
68
+ handleRef = el => {
69
+ this.ref = el;
70
+ if (el) {
71
+ const txt = this.getTextExcludingButtons(el);
72
+ this.context.setBodyScrollAriaLabel?.(txt);
73
+ }
74
+ };
78
75
  componentDidMount() {
79
- var _this$props$makeStyle, _this$props;
80
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStyleProps());
76
+ this.props.makeStyles?.(this.makeStyleProps());
81
77
  }
82
78
  componentDidUpdate() {
83
- var _this$props$makeStyle2, _this$props2;
84
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleProps());
79
+ this.props.makeStyles?.(this.makeStyleProps());
85
80
  }
81
+ makeStyleProps = () => {
82
+ return {
83
+ withCloseButton: this.usesCloseButton
84
+ };
85
+ };
86
86
  get usesCloseButton() {
87
87
  let hasCloseButton = false;
88
88
  Children.forEach(this.props.children, child => {
@@ -93,21 +93,18 @@ let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
93
93
  return hasCloseButton;
94
94
  }
95
95
  render() {
96
- var _this$props$styles;
97
- const _this$props3 = this.props,
98
- children = _this$props3.children,
99
- rest = _objectWithoutProperties(_this$props3, _excluded);
96
+ const {
97
+ children,
98
+ ...rest
99
+ } = this.props;
100
100
  return _jsx("div", {
101
- css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalHeader,
101
+ css: this.props.styles?.modalHeader,
102
102
  ...passthroughProps(rest),
103
103
  ref: this.handleRef,
104
104
  "data-cid": "ModalHeader",
105
105
  children: children
106
106
  });
107
107
  }
108
- }, _ModalHeader.displayName = "ModalHeader", _ModalHeader.componentId = 'Modal.Header', _ModalHeader.allowedProps = allowedProps, _ModalHeader.defaultProps = {
109
- variant: 'default',
110
- spacing: 'default'
111
- }, _ModalHeader.contextType = ModalContext, _ModalHeader)) || _class);
108
+ }) || _class);
112
109
  export default ModalHeader;
113
110
  export { ModalHeader };
@@ -33,9 +33,13 @@
33
33
  * @return {Object} The final style object, which will be used in the component
34
34
  */
35
35
  const generateStyle = (componentTheme, props, state) => {
36
- const variant = props.variant,
37
- spacing = props.spacing;
38
- const withCloseButton = state.withCloseButton;
36
+ const {
37
+ variant,
38
+ spacing
39
+ } = props;
40
+ const {
41
+ withCloseButton
42
+ } = state;
39
43
  const sizeVariants = {
40
44
  default: {
41
45
  padding: componentTheme.padding,
@@ -28,16 +28,17 @@
28
28
  * @return {Object} The final theme object with the overrides and component variables
29
29
  */
30
30
  const generateComponentTheme = theme => {
31
- var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4;
32
- const colors = theme.colors,
33
- spacing = theme.spacing;
31
+ const {
32
+ colors,
33
+ spacing
34
+ } = theme;
34
35
  const componentVariables = {
35
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.white1010,
36
- borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.grey1424,
37
- padding: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
38
- paddingCompact: spacing === null || spacing === void 0 ? void 0 : spacing.small,
39
- inverseBackground: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey100100,
40
- inverseBorderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.grey125125
36
+ background: colors?.contrasts?.white1010,
37
+ borderColor: colors?.contrasts?.grey1424,
38
+ padding: spacing?.medium,
39
+ paddingCompact: spacing?.small,
40
+ inverseBackground: colors?.contrasts?.grey100100,
41
+ inverseBorderColor: colors?.contrasts?.grey125125
41
42
  };
42
43
  return {
43
44
  ...componentVariables