@sproutsocial/racine 7.7.0-beta-collapsible.0 → 7.7.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.
@@ -15,10 +15,7 @@ var Collapsible = function Collapsible(_ref) {
15
15
  _ref$isOpen = _ref.isOpen,
16
16
  isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
17
17
  _ref$offset = _ref.offset,
18
- offset = _ref$offset === void 0 ? 0 : _ref$offset,
19
- _ref$collapsedHeight = _ref.collapsedHeight,
20
- collapsedHeight = _ref$collapsedHeight === void 0 ? 0 : _ref$collapsedHeight,
21
- openHeight = _ref.openHeight;
18
+ offset = _ref$offset === void 0 ? 0 : _ref$offset;
22
19
 
23
20
  var _useState = useState("Racine-collapsible-" + idCounter++),
24
21
  id = _useState[0];
@@ -27,9 +24,7 @@ var Collapsible = function Collapsible(_ref) {
27
24
  value: {
28
25
  isOpen: isOpen,
29
26
  id: id,
30
- offset: offset,
31
- collapsedHeight: collapsedHeight,
32
- openHeight: openHeight
27
+ offset: offset
33
28
  }
34
29
  }, children);
35
30
  };
@@ -55,9 +50,7 @@ var Panel = function Panel(_ref3) {
55
50
  var _useContext2 = useContext(CollapsibleContext),
56
51
  isOpen = _useContext2.isOpen,
57
52
  id = _useContext2.id,
58
- offset = _useContext2.offset,
59
- collapsedHeight = _useContext2.collapsedHeight,
60
- openHeight = _useContext2.openHeight;
53
+ offset = _useContext2.offset;
61
54
 
62
55
  var ref = useRef();
63
56
  var measurement = useMeasure(ref);
@@ -70,7 +63,7 @@ var Panel = function Panel(_ref3) {
70
63
  // There is no animation because css is not changing the maxHeight property after mount
71
64
 
72
65
 
73
- var maxHeight = typeof openHeight !== "undefined" ? openHeight : measurement.height + offset;
66
+ var maxHeight = isHidden === undefined ? undefined : measurement.height + offset;
74
67
  /* We use the "hidden" attribute to remove the contents of the panel from the tab order of the page, but it fucks with the animation. This logic sets a slight timeout on setting the prop so that the animation has time to complete before the attribute is set. */
75
68
 
76
69
  useEffect(function () {
@@ -96,14 +89,12 @@ var Panel = function Panel(_ref3) {
96
89
  }
97
90
  }, [isOpen]);
98
91
  return /*#__PURE__*/React.createElement(CollapsingBox, _extends({
99
- scrollable: isOpen,
100
- maxHeight: isOpen ? maxHeight : collapsedHeight,
101
- minHeight: collapsedHeight,
92
+ maxHeight: isOpen ? maxHeight : "0",
102
93
  "data-qa-collapsible": "",
103
94
  "data-qa-collapsible-isopen": isOpen === true
104
95
  }, rest), /*#__PURE__*/React.createElement(Box, {
105
96
  width: "100%",
106
- hidden: isHidden && collapsedHeight === 0,
97
+ hidden: isHidden,
107
98
  "aria-hidden": !isOpen,
108
99
  id: id,
109
100
  ref: ref
@@ -3,15 +3,8 @@ import Box from "../Box";
3
3
  export var CollapsingBox = styled(Box).withConfig({
4
4
  displayName: "styles__CollapsingBox",
5
5
  componentId: "sc-1xvfbl7-0"
6
- })(["transition:max-height ", " ", ";will-change:max-height;position:relative;overflow:auto;background:linear-gradient( ", " 30%,rgba(255,255,255,0) ),linear-gradient( rgba(255,255,255,0),", " 70% ) 0 100%,radial-gradient( farthest-side at 50% 0,rgb(39 51 51 / 5%),rgba(0,0,0,0) ),radial-gradient( farthest-side at 50% 100%,rgb(39 51 51 / 5%),rgba(0,0,0,0) ) 0 100%;background-repeat:no-repeat;background-size:100% 40px,100% 40px,100% 14px,100% 14px;background-attachment:local,local,scroll,scroll;", ";"], function (p) {
6
+ })(["transition:max-height ", " ", ";will-change:max-height;overflow:hidden;"], function (p) {
7
7
  return p.theme.duration.medium;
8
8
  }, function (p) {
9
9
  return p.theme.easing.ease_inout;
10
- }, function (p) {
11
- return p.theme.colors.neutral[100];
12
- }, function (p) {
13
- return p.theme.colors.neutral[100];
14
- }, function (_ref) {
15
- var scrollable = _ref.scrollable;
16
- return scrollable ? "overflow: auto" : "overflow: hidden";
17
10
  });
@@ -3,6 +3,7 @@ module.exports = {
3
3
  "add-item": "0 0 16 16",
4
4
  "add-keyword": "0 0 16 16",
5
5
  "add-team-member": "0 0 18 13",
6
+ "add-variable": "0 0 18 14",
6
7
  "address-card-solid": "0 0 18 16",
7
8
  "adobe-experience-manager": "0 0 16 18",
8
9
  "ads": "0 0 9 16",
@@ -275,6 +276,7 @@ module.exports = {
275
276
  "sent-message": "0 0 16 14",
276
277
  "share": "0 0 16 14",
277
278
  "shopify": "0 0 16 18",
279
+ "show-navigation": "0 0 18 14",
278
280
  "slack": "0 0 16 16",
279
281
  "small-density": "0 0 16 16",
280
282
  "smiley": "0 0 16 16",
@@ -68,9 +68,8 @@ var ModalFooter = function ModalFooter(props) {
68
68
  ModalFooter.defaultProps = {
69
69
  bg: "background.container"
70
70
  };
71
-
72
- // $FlowIssue - upgrade v0.112.0
73
- var ModalContent = function ModalContent(_ref) {
71
+ var ModalContent = /*#__PURE__*/React.forwardRef( // $FlowIssue - upgrade v0.112.0
72
+ function (_ref, ref) {
74
73
  var children = _ref.children,
75
74
  rest = _objectWithoutPropertiesLoose(_ref, ["children"]);
76
75
 
@@ -79,9 +78,10 @@ var ModalContent = function ModalContent(_ref) {
79
78
 
80
79
  return /*#__PURE__*/React.createElement(Content, _extends({
81
80
  "data-qa-modal": true,
82
- "data-qa-label": label
81
+ "data-qa-label": label,
82
+ ref: ref
83
83
  }, rest), children);
84
- };
84
+ });
85
85
 
86
86
  /**
87
87
  * The modal you want
@@ -37,7 +37,7 @@ var Container = styled.button.withConfig({
37
37
  }, function (props) {
38
38
  return props.disabled && css(["opacity:0.4;cursor:not-allowed;"]);
39
39
  }, function (props) {
40
- return !props.valid && css(["color:", ";border-color:", ";background:", ";&:hover{color:", ";}"], function (props) {
40
+ return !props.valid && css(["color:", ";border-color:", ";background:", ";&:hover{color:", ";border-color:", ";background:", ";}"], function (props) {
41
41
  return props.theme.colors.text.inverse;
42
42
  }, function (props) {
43
43
  return props.theme.colors.error.color;
@@ -45,6 +45,10 @@ var Container = styled.button.withConfig({
45
45
  return props.theme.colors.error.color;
46
46
  }, function (props) {
47
47
  return props.theme.colors.text.inverse;
48
+ }, function (props) {
49
+ return props.theme.colors.red[900];
50
+ }, function (props) {
51
+ return props.theme.colors.red[900];
48
52
  });
49
53
  }, COMMON);
50
54
  export default Container;