@spothero/ui 24.0.4-beta.0 → 24.0.5-beta.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/index.cjs.js CHANGED
@@ -49957,7 +49957,7 @@ RadioGroup.propTypes = {
49957
49957
  direction: PropTypes__default.default.oneOf(['row', 'column'])
49958
49958
  };
49959
49959
 
49960
- var _excluded$6 = ["isChecked", "isDisabled", "value", "helperText", "expandableChildren", "defaultChecked", "isRadio", "label", "isExpandable", "size"];
49960
+ var _excluded$6 = ["isChecked", "isDisabled", "value", "helperText", "expandableChildren", "defaultChecked", "isRadio", "label", "isExpandable", "size", "expandableChildrenStyles"];
49961
49961
  var SelectionCard = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
49962
49962
  var isChecked = _ref.isChecked,
49963
49963
  isDisabled = _ref.isDisabled,
@@ -49970,10 +49970,13 @@ var SelectionCard = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
49970
49970
  isExpandable = _ref.isExpandable,
49971
49971
  _ref$size = _ref.size,
49972
49972
  size = _ref$size === void 0 ? 'md' : _ref$size,
49973
+ _ref$expandableChildr = _ref.expandableChildrenStyles,
49974
+ expandableChildrenStyles = _ref$expandableChildr === void 0 ? {} : _ref$expandableChildr,
49973
49975
  props = _objectWithoutProperties$1(_ref, _excluded$6);
49974
49976
  var Component = isRadio ? Radio : Checkbox;
49975
49977
  var expandableTextSize = size === 'sm' || size === 'md' ? 'xs' : 'sm';
49976
49978
  var hasExpandableContent = isExpandable && isChecked && expandableChildren;
49979
+ var prefersReducedMotion = usePrefersReducedMotion();
49977
49980
  return /*#__PURE__*/React__namespace.default.createElement(Box, {
49978
49981
  paddingBottom: hasExpandableContent ? 3 : 0,
49979
49982
  borderRadius: "lg",
@@ -49997,12 +50000,22 @@ var SelectionCard = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
49997
50000
  width: "100%",
49998
50001
  paddingX: 4,
49999
50002
  paddingY: 3
50000
- }, props), label)), hasExpandableContent && /*#__PURE__*/React__namespace.default.createElement(Box, {
50003
+ }, props), label)), /*#__PURE__*/React__namespace.default.createElement(Box, {
50004
+ overflow: "hidden",
50005
+ display: "grid"
50006
+ // Using this as a pseudo height transition to get around no height auto transition
50007
+ ,
50008
+ gridTemplateRows: hasExpandableContent ? '1fr' : '0fr',
50009
+ opacity: hasExpandableContent ? '100%' : '0%',
50010
+ transition: prefersReducedMotion ? '' : 'all 150ms ease-out'
50011
+ }, /*#__PURE__*/React__namespace.default.createElement(Box, {
50012
+ overflow: "hidden"
50013
+ }, hasExpandableContent && /*#__PURE__*/React__namespace.default.createElement(Box, _extends$7({
50001
50014
  color: "gray.600",
50002
50015
  fontSize: expandableTextSize,
50003
50016
  paddingTop: 3,
50004
50017
  paddingX: 4
50005
- }, expandableChildren));
50018
+ }, expandableChildrenStyles), expandableChildren))));
50006
50019
  });
50007
50020
  SelectionCard.propTypes = {
50008
50021
  label: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.element]).isRequired,
@@ -50014,6 +50027,7 @@ SelectionCard.propTypes = {
50014
50027
  helperText: PropTypes__default.default.string,
50015
50028
  isRadio: PropTypes__default.default.bool,
50016
50029
  isExpandable: PropTypes__default.default.bool,
50030
+ expandableChildrenStyles: PropTypes__default.default.object,
50017
50031
  size: PropTypes__default.default.oneOf(['sm', 'md', 'lg'])
50018
50032
  };
50019
50033