@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.
- package/CHANGELOG.md +18 -0
- package/__flow__/Box/styles.js +5 -5
- package/__flow__/ChartLegend/styles.js +6 -6
- package/__flow__/Collapsible/index.js +6 -24
- package/__flow__/Collapsible/index.stories.js +0 -77
- package/__flow__/Collapsible/styles.js +2 -28
- package/__flow__/EnumIconNames.js +1 -1
- package/__flow__/IconViewBoxes.js +1 -1
- package/__flow__/Modal/index.js +11 -9
- package/__flow__/Token/styles.js +2 -0
- package/commonjs/Collapsible/index.js +6 -15
- package/commonjs/Collapsible/styles.js +1 -8
- package/commonjs/IconViewBoxes.js +2 -0
- package/commonjs/Modal/index.js +5 -5
- package/commonjs/Token/styles.js +5 -1
- package/commonjs/include-icons.js +1 -1
- package/dist/iconList.js +1 -1
- package/dist/icons.svg +1 -1
- package/icons/add-variable.svg +3 -0
- package/icons/extreme-negative-sentiment.svg +2 -2
- package/icons/fb-reactions-angry.svg +2 -2
- package/icons/fb-reactions-sad.svg +2 -2
- package/icons/fb-reactions-wow.svg +2 -2
- package/icons/gears.svg +2 -2
- package/icons/messenger.svg +1 -1
- package/icons/show-navigation.svg +3 -0
- package/icons/tripadvisor-circle.svg +2 -2
- package/icons/whatsapp.svg +4 -4
- package/icons/yelp.svg +2 -2
- package/includeIcons.js +1 -1
- package/lib/Collapsible/index.js +6 -15
- package/lib/Collapsible/styles.js +1 -8
- package/lib/IconViewBoxes.js +2 -0
- package/lib/Modal/index.js +5 -5
- package/lib/Token/styles.js +5 -1
- package/lib/include-icons.js +1 -1
- package/package.json +2 -2
package/lib/Collapsible/index.js
CHANGED
|
@@ -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 =
|
|
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
|
-
|
|
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
|
|
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;
|
|
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
|
});
|
package/lib/IconViewBoxes.js
CHANGED
|
@@ -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",
|
package/lib/Modal/index.js
CHANGED
|
@@ -68,9 +68,8 @@ var ModalFooter = function ModalFooter(props) {
|
|
|
68
68
|
ModalFooter.defaultProps = {
|
|
69
69
|
bg: "background.container"
|
|
70
70
|
};
|
|
71
|
-
|
|
72
|
-
|
|
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
|
package/lib/Token/styles.js
CHANGED
|
@@ -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;
|