@sproutsocial/racine 8.3.0 → 8.4.0-menu-button-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.
@@ -4,8 +4,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
4
4
 
5
5
  import * as React from "react";
6
6
  import { useState, useCallback, useMemo, memo } from "react";
7
- import styled, { css } from "styled-components";
8
- import classnames from "classnames";
7
+ import styled from "styled-components";
9
8
  import Box from "../Box";
10
9
  import Image from "../Image";
11
10
  import Text from "../Text";
@@ -17,20 +16,8 @@ var AvatarText = styled(function (_ref) {
17
16
  }).withConfig({
18
17
  displayName: "Avatar__AvatarText",
19
18
  componentId: "yx873f-0"
20
- })(["font-size:", "px;color:", "px;"], function (props) {
19
+ })(["font-size:", "px;"], function (props) {
21
20
  return props.fontSize;
22
- }, function (props) {
23
- return props.color;
24
- });
25
- var Container = styled(Box).withConfig({
26
- displayName: "Avatar__Container",
27
- componentId: "yx873f-1"
28
- })(["", ""], function (_ref2) {
29
- var theme = _ref2.theme,
30
- type = _ref2.type,
31
- variant = _ref2.variant,
32
- bg = _ref2.bg;
33
- return css(["color:", ";background:", ";"], theme.colors[type][variant === "dark" ? "200" : "900"], bg ? bg : theme.colors[type][variant === "dark" ? "900" : "200"]);
34
21
  });
35
22
 
36
23
  var getInitials = function getInitials(name, fallback) {
@@ -46,20 +33,14 @@ var getInitials = function getInitials(name, fallback) {
46
33
  .join("");
47
34
  };
48
35
 
49
- export var Avatar = function Avatar(_ref3) {
50
- var _ref3$appearance = _ref3.appearance,
51
- appearance = _ref3$appearance === void 0 ? "circle" : _ref3$appearance,
52
- name = _ref3.name,
53
- src = _ref3.src,
54
- _ref3$variant = _ref3.variant,
55
- variant = _ref3$variant === void 0 ? "light" : _ref3$variant,
56
- _ref3$type = _ref3.type,
57
- type = _ref3$type === void 0 ? "neutral" : _ref3$type,
58
- _ref3$size = _ref3.size,
59
- size = _ref3$size === void 0 ? "40px" : _ref3$size,
60
- bg = _ref3.bg,
61
- color = _ref3.color,
62
- rest = _objectWithoutPropertiesLoose(_ref3, ["appearance", "name", "src", "variant", "type", "size", "bg", "color"]);
36
+ export var Avatar = function Avatar(_ref2) {
37
+ var _ref2$appearance = _ref2.appearance,
38
+ appearance = _ref2$appearance === void 0 ? "circle" : _ref2$appearance,
39
+ name = _ref2.name,
40
+ src = _ref2.src,
41
+ _ref2$size = _ref2.size,
42
+ size = _ref2$size === void 0 ? "40px" : _ref2$size,
43
+ rest = _objectWithoutPropertiesLoose(_ref2, ["appearance", "name", "src", "size"]);
63
44
 
64
45
  var _useState = useState(false),
65
46
  imageFailedLoading = _useState[0],
@@ -73,8 +54,7 @@ export var Avatar = function Avatar(_ref3) {
73
54
  }, [setImageFailedLoading]); // Font size for initials is half the size of the avatar, rounded down.
74
55
 
75
56
  var fontSize = Math.floor(Number(size.replace("px", "")) * 0.4);
76
- return /*#__PURE__*/React.createElement(Container, _extends({
77
- className: classnames(variant),
57
+ return /*#__PURE__*/React.createElement(Box, _extends({
78
58
  size: size,
79
59
  overflow: "hidden",
80
60
  borderRadius: appearance === "leaf" ? "40% 0 40% 0" : "50%",
@@ -84,16 +64,13 @@ export var Avatar = function Avatar(_ref3) {
84
64
  justifyContent: "center",
85
65
  alignItems: "center",
86
66
  title: name,
87
- bg: bg,
88
- variant: variant,
89
- type: type,
67
+ bg: "neutral.200",
90
68
  "data-qa-user-avatar": name // $FlowIssue - upgrade v0.112.0
91
69
 
92
70
  }, rest), !src || imageFailedLoading ? /*#__PURE__*/React.createElement(AvatarText, {
93
71
  lineHeight: size,
94
72
  fontWeight: "semibold",
95
- fontSize: fontSize,
96
- color: color
73
+ fontSize: fontSize
97
74
  }, initials) : /*#__PURE__*/React.createElement(Image, {
98
75
  alt: name,
99
76
  width: "auto",
@@ -32,7 +32,6 @@ module.exports = {
32
32
  "barcode": "0 0 18 16",
33
33
  "basketball": "0 0 16 16",
34
34
  "bell-outline": "0 0 14 16",
35
- "bigcommerce": "0 0 16 16",
36
35
  "bitly": "0 0 16 16",
37
36
  "bold": "0 0 16 16",
38
37
  "book": "0 0 14 16",
@@ -338,7 +337,6 @@ module.exports = {
338
337
  "window-minimize": "0 0 16 16",
339
338
  "window-regular": "0 0 16 16",
340
339
  "window-restore": "0 0 16 16",
341
- "woocommerce": "0 0 16 16",
342
340
  "x": "0 0 16 18",
343
341
  "yelp-full-star": "0 0 16 16",
344
342
  "yelp-half-star": "0 0 16 16",
@@ -1,11 +1,11 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import { focusRing, disabled } from "../utils/mixins";
3
3
  import Text from "../Text";
4
- import { TYPOGRAPHY, COMMON, FLEXBOX } from "../utils/system-props";
4
+ import { TYPOGRAPHY, COMMON } from "../utils/system-props";
5
5
  var Container = styled(Text).withConfig({
6
6
  displayName: "styles__Container",
7
7
  componentId: "adcw4a-0"
8
- })(["border:0;font-family:", ";text-decoration:", ";appearance:none;cursor:pointer;", " font-weight:", ";color:", ";&:hover{color:", ";text-decoration:underline;}&:active{color:", ";}&:focus{", "}&:focus:active{box-shadow:none;}", " ", " ", " ", " ", ""], function (props) {
8
+ })(["border:0;font-family:", ";text-decoration:", ";appearance:none;cursor:pointer;", " font-weight:", ";color:", ";&:hover{color:", ";text-decoration:underline;}&:active{color:", ";}&:focus{", "}&:focus:active{box-shadow:none;}", " ", " ", " ", ""], function (props) {
9
9
  return props.theme.fontFamily;
10
10
  }, function (props) {
11
11
  return props.underline ? "underline" : "none";
@@ -23,5 +23,5 @@ var Container = styled(Text).withConfig({
23
23
  return !props.href && css(["background:none;"]);
24
24
  }, function (props) {
25
25
  return props.disabled && disabled;
26
- }, COMMON, TYPOGRAPHY, FLEXBOX);
26
+ }, COMMON, TYPOGRAPHY);
27
27
  export default Container;
package/lib/Menu/index.js CHANGED
@@ -370,7 +370,9 @@ export var MenuButton = function MenuButton(_ref5) {
370
370
  closeOnItemClick = _ref5$closeOnItemClic === void 0 ? true : _ref5$closeOnItemClic,
371
371
  _ref5$id = _ref5.id,
372
372
  id = _ref5$id === void 0 ? uniqueId("MenuButton-") : _ref5$id,
373
- props = _objectWithoutPropertiesLoose(_ref5, ["content", "popoutProps", "children", "onClick", "closeOnItemClick", "id"]);
373
+ _ref5$placement = _ref5.placement,
374
+ placement = _ref5$placement === void 0 ? "bottom-start" : _ref5$placement,
375
+ props = _objectWithoutPropertiesLoose(_ref5, ["content", "popoutProps", "children", "onClick", "closeOnItemClick", "id", "placement"]);
374
376
 
375
377
  var _useState2 = useState(false),
376
378
  isOpen = _useState2[0],
@@ -390,7 +392,7 @@ export var MenuButton = function MenuButton(_ref5) {
390
392
  isOpen: isOpen,
391
393
  setIsOpen: setIsOpen,
392
394
  content: /*#__PURE__*/React.createElement(CustomPopoutContent, null, content),
393
- placement: "bottom"
395
+ placement: placement
394
396
  }, popoutProps, {
395
397
  // $FlowIssue
396
398
  width: props.width
@@ -2,7 +2,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import List from "./styles";
4
4
  import React, { useCallback, useMemo } from "react";
5
- import { AutoSizer, CellMeasurer, CellMeasurerCache } from "react-virtualized";
5
+ import { CellMeasurer, CellMeasurerCache } from "react-virtualized"; // imported separately so it can be mocked separately (otherwise height and width will always be 0 in jsdom)
6
+
7
+ import AutoSizer from "react-virtualized/dist/es/AutoSizer";
6
8
  import Box from "../Box";
7
9
 
8
10
  var VirtualizedList = function VirtualizedList(_ref) {