@sproutsocial/racine 15.1.0 → 17.0.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.
Files changed (164) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/__flow__/Badge/Badge.flow.js +3 -1
  3. package/__flow__/Badge/constants.flow.js +14 -1
  4. package/__flow__/Banner/Banner.flow.js +7 -0
  5. package/__flow__/DatePicker/DateRangePicker/DateRangePicker.flow.js +1 -0
  6. package/__flow__/DatePicker/SingleDatePicker/SingleDatePicker.flow.js +1 -0
  7. package/__flow__/EnumIconNames.flow.js +1 -1
  8. package/__flow__/EnumIllustrationNames.flow.js +1 -1
  9. package/__flow__/EnumLogoNames.flow.js +1 -1
  10. package/__flow__/Icon/Icon.flow.js +2 -2
  11. package/__flow__/IconViewBoxes.js +1 -0
  12. package/__flow__/IllustrationViewBoxes.js +1 -0
  13. package/__flow__/LogoViewBoxes.js +14 -0
  14. package/__flow__/PartnerLogo/PartnerLogo.flow.js +7 -2
  15. package/__flow__/PartnerLogo/index.flow.js +1 -2
  16. package/__flow__/Switch/Switch.flow.js +2 -21
  17. package/__flow__/Switch/SwitchTypes.flow.js +16 -0
  18. package/__flow__/Switch/index.flow.js +2 -1
  19. package/__flow__/Toast/Toast.flow.js +2 -2
  20. package/__flow__/index.flow.js +2 -4
  21. package/commonjs/Badge/Badge.flow.js +1 -0
  22. package/commonjs/Badge/constants.flow.js +20 -1
  23. package/commonjs/Badge/constants.js +16 -2
  24. package/commonjs/Banner/Banner.js +4 -3
  25. package/commonjs/Card/Card.js +14 -9
  26. package/commonjs/Card/index.js +8 -1
  27. package/commonjs/Card/styles.js +40 -12
  28. package/commonjs/Card/subComponents.js +38 -5
  29. package/commonjs/Card/utils.js +9 -5
  30. package/commonjs/DatePicker/DateRangePicker/DateRangePicker.js +30 -5
  31. package/commonjs/DatePicker/SingleDatePicker/SingleDatePicker.js +29 -5
  32. package/commonjs/DatePicker/common.js +18 -2
  33. package/commonjs/Icon/Icon.js +3 -2
  34. package/commonjs/IconViewBoxes.js +1 -0
  35. package/commonjs/IllustrationViewBoxes.js +1 -0
  36. package/commonjs/LogoViewBoxes.js +14 -0
  37. package/commonjs/PartnerLogo/PartnerLogo.js +34 -29
  38. package/commonjs/PartnerLogo/PartnerLogoTypes.js +14 -3
  39. package/commonjs/PartnerLogo/index.flow.js +0 -11
  40. package/commonjs/Popout/Popout.js +4 -3
  41. package/commonjs/SpotIllustration/illustrationNames.js +1 -1
  42. package/commonjs/Switch/Switch.js +43 -77
  43. package/commonjs/Switch/index.flow.js +11 -0
  44. package/commonjs/Switch/styles.js +61 -37
  45. package/commonjs/Table/Table.js +20 -13
  46. package/commonjs/TableHeaderCell/TableHeaderCell.js +17 -4
  47. package/commonjs/TableHeaderCell/styles.js +6 -1
  48. package/commonjs/Tabs/Tabs.js +7 -2
  49. package/commonjs/iconNames.js +8 -0
  50. package/commonjs/illustrationNames.js +8 -0
  51. package/commonjs/index.flow.js +12 -8
  52. package/commonjs/index.js +24 -0
  53. package/commonjs/logoNames.js +8 -0
  54. package/dist/icon.svg +1 -1
  55. package/dist/iconList.js +1 -1
  56. package/dist/illustration.svg +1 -1
  57. package/dist/illustrationList.js +1 -1
  58. package/dist/logo.svg +1 -1
  59. package/dist/logoList.js +1 -1
  60. package/dist/types/Badge/BadgeTypes.d.ts +3 -1
  61. package/dist/types/Badge/BadgeTypes.d.ts.map +1 -1
  62. package/dist/types/Badge/constants.d.ts +13 -0
  63. package/dist/types/Badge/constants.d.ts.map +1 -1
  64. package/dist/types/Banner/Banner.d.ts +1 -1
  65. package/dist/types/Banner/Banner.d.ts.map +1 -1
  66. package/dist/types/Banner/BannerTypes.d.ts +3 -0
  67. package/dist/types/Banner/BannerTypes.d.ts.map +1 -1
  68. package/dist/types/Banner/__tests__/BannerTypes.d.ts +2 -0
  69. package/dist/types/Banner/__tests__/BannerTypes.d.ts.map +1 -0
  70. package/dist/types/Card/Card.d.ts.map +1 -1
  71. package/dist/types/Card/CardTypes.d.ts +9 -0
  72. package/dist/types/Card/CardTypes.d.ts.map +1 -1
  73. package/dist/types/Card/index.d.ts +1 -1
  74. package/dist/types/Card/index.d.ts.map +1 -1
  75. package/dist/types/Card/styles.d.ts +8 -0
  76. package/dist/types/Card/styles.d.ts.map +1 -1
  77. package/dist/types/Card/subComponents.d.ts +5 -0
  78. package/dist/types/Card/subComponents.d.ts.map +1 -1
  79. package/dist/types/Card/utils.d.ts +2 -1
  80. package/dist/types/Card/utils.d.ts.map +1 -1
  81. package/dist/types/DatePicker/DateRangePicker/DateRangePicker.d.ts +1 -1
  82. package/dist/types/DatePicker/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  83. package/dist/types/DatePicker/DateRangePicker/DateRangePickerTypes.d.ts +2 -1
  84. package/dist/types/DatePicker/DateRangePicker/DateRangePickerTypes.d.ts.map +1 -1
  85. package/dist/types/DatePicker/SingleDatePicker/SingleDatePicker.d.ts.map +1 -1
  86. package/dist/types/DatePicker/SingleDatePicker/SingleDatePickerTypes.d.ts +2 -1
  87. package/dist/types/DatePicker/SingleDatePicker/SingleDatePickerTypes.d.ts.map +1 -1
  88. package/dist/types/DatePicker/common.d.ts +2 -0
  89. package/dist/types/DatePicker/common.d.ts.map +1 -1
  90. package/dist/types/EnumIconNames.d.ts +1 -1
  91. package/dist/types/EnumIconNames.d.ts.map +1 -1
  92. package/dist/types/EnumIllustrationNames.d.ts +1 -1
  93. package/dist/types/EnumIllustrationNames.d.ts.map +1 -1
  94. package/dist/types/EnumLogoNames.d.ts +1 -1
  95. package/dist/types/EnumLogoNames.d.ts.map +1 -1
  96. package/dist/types/Icon/Icon.d.ts.map +1 -1
  97. package/dist/types/Icon/IconTypes.d.ts +2 -2
  98. package/dist/types/Icon/IconTypes.d.ts.map +1 -1
  99. package/dist/types/PartnerLogo/PartnerLogo.d.ts.map +1 -1
  100. package/dist/types/PartnerLogo/PartnerLogoTypes.d.ts +13 -4
  101. package/dist/types/PartnerLogo/PartnerLogoTypes.d.ts.map +1 -1
  102. package/dist/types/Popout/Popout.d.ts +1 -1
  103. package/dist/types/Popout/Popout.d.ts.map +1 -1
  104. package/dist/types/SpotIllustration/illustrationNames.d.ts.map +1 -1
  105. package/dist/types/Switch/Switch.d.ts +15 -12
  106. package/dist/types/Switch/Switch.d.ts.map +1 -1
  107. package/dist/types/Switch/SwitchTypes.d.ts +4 -11
  108. package/dist/types/Switch/SwitchTypes.d.ts.map +1 -1
  109. package/dist/types/Switch/styles.d.ts +4 -5
  110. package/dist/types/Switch/styles.d.ts.map +1 -1
  111. package/dist/types/Table/Table.d.ts.map +1 -1
  112. package/dist/types/TableHeaderCell/TableHeaderCell.d.ts +2 -2
  113. package/dist/types/TableHeaderCell/TableHeaderCell.d.ts.map +1 -1
  114. package/dist/types/TableHeaderCell/styles.d.ts +1 -0
  115. package/dist/types/TableHeaderCell/styles.d.ts.map +1 -1
  116. package/dist/types/Tabs/Tabs.d.ts.map +1 -1
  117. package/dist/types/Toast/ToastTypes.d.ts +2 -2
  118. package/dist/types/Toast/ToastTypes.d.ts.map +1 -1
  119. package/dist/types/iconNames.d.ts +3 -0
  120. package/dist/types/iconNames.d.ts.map +1 -0
  121. package/dist/types/illustrationNames.d.ts +3 -0
  122. package/dist/types/illustrationNames.d.ts.map +1 -0
  123. package/dist/types/index.d.ts +3 -0
  124. package/dist/types/index.d.ts.map +1 -1
  125. package/dist/types/logoNames.d.ts +3 -0
  126. package/dist/types/logoNames.d.ts.map +1 -0
  127. package/icons/quotes-solid.svg +3 -0
  128. package/lib/Badge/Badge.flow.js +2 -1
  129. package/lib/Badge/constants.flow.js +13 -0
  130. package/lib/Badge/constants.js +13 -0
  131. package/lib/Banner/Banner.js +4 -3
  132. package/lib/Card/Card.js +15 -10
  133. package/lib/Card/index.js +1 -1
  134. package/lib/Card/styles.js +38 -12
  135. package/lib/Card/subComponents.js +34 -4
  136. package/lib/Card/utils.js +9 -5
  137. package/lib/DatePicker/DateRangePicker/DateRangePicker.js +32 -7
  138. package/lib/DatePicker/SingleDatePicker/SingleDatePicker.js +31 -7
  139. package/lib/DatePicker/common.js +14 -0
  140. package/lib/Icon/Icon.js +3 -2
  141. package/lib/IconViewBoxes.js +1 -0
  142. package/lib/IllustrationViewBoxes.js +1 -0
  143. package/lib/LogoViewBoxes.js +14 -0
  144. package/lib/PartnerLogo/PartnerLogo.js +34 -27
  145. package/lib/PartnerLogo/PartnerLogoTypes.js +13 -2
  146. package/lib/PartnerLogo/index.flow.js +1 -2
  147. package/lib/Popout/Popout.js +4 -3
  148. package/lib/SpotIllustration/illustrationNames.js +1 -1
  149. package/lib/Switch/Switch.js +41 -77
  150. package/lib/Switch/index.flow.js +2 -1
  151. package/lib/Switch/styles.js +60 -35
  152. package/lib/Table/Table.js +20 -13
  153. package/lib/TableHeaderCell/TableHeaderCell.js +18 -5
  154. package/lib/TableHeaderCell/styles.js +4 -0
  155. package/lib/Tabs/Tabs.js +7 -2
  156. package/lib/iconNames.js +1 -0
  157. package/lib/illustrationNames.js +1 -0
  158. package/lib/index.flow.js +1 -1
  159. package/lib/index.js +4 -0
  160. package/lib/logoNames.js +1 -0
  161. package/package.json +6 -3
  162. package/__flow__/PartnerLogo/TypePartnerNames.flow.js +0 -3
  163. /package/commonjs/{PartnerLogo/TypePartnerNames.flow.js → Switch/SwitchTypes.flow.js} +0 -0
  164. /package/lib/{PartnerLogo/TypePartnerNames.flow.js → Switch/SwitchTypes.flow.js} +0 -0
@@ -1,27 +1,51 @@
1
- var _excluded = ["onDateChange", "date", "focused", "onFocusChange"];
1
+ var _excluded = ["onDateChange", "setStatusText", "date", "focused", "onFocusChange", "initialVisibleMonth", "numberOfMonths"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
7
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
8
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
3
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
- import React, { Fragment } from 'react';
11
+ import React, { Fragment, useState } from 'react';
6
12
  import DayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController';
7
13
  import { ReactDatesCssOverrides } from "../styles";
8
- import { commonDatePickerProps } from "../common";
14
+ import { commonDatePickerProps, DefaultSetStatusText, getVisibleMonths } from "../common";
15
+ import { VisuallyHidden } from "../../VisuallyHidden";
16
+ import moment from 'moment';
9
17
  var SingleDatePicker = function SingleDatePicker(_ref) {
10
18
  var onDateChange = _ref.onDateChange,
19
+ _ref$setStatusText = _ref.setStatusText,
20
+ setStatusText = _ref$setStatusText === void 0 ? DefaultSetStatusText : _ref$setStatusText,
11
21
  _ref$date = _ref.date,
12
22
  date = _ref$date === void 0 ? null : _ref$date,
13
23
  _ref$focused = _ref.focused,
14
24
  focused = _ref$focused === void 0 ? false : _ref$focused,
15
25
  _ref$onFocusChange = _ref.onFocusChange,
16
26
  onFocusChange = _ref$onFocusChange === void 0 ? function () {} : _ref$onFocusChange,
27
+ initialVisibleMonth = _ref.initialVisibleMonth,
28
+ _ref$numberOfMonths = _ref.numberOfMonths,
29
+ numberOfMonths = _ref$numberOfMonths === void 0 ? 1 : _ref$numberOfMonths,
17
30
  rest = _objectWithoutProperties(_ref, _excluded);
18
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ReactDatesCssOverrides, null), /*#__PURE__*/React.createElement(DayPickerSingleDateController, _extends({}, commonDatePickerProps, {
31
+ var _useState = useState(setStatusText(getVisibleMonths(moment((initialVisibleMonth === null || initialVisibleMonth === void 0 ? void 0 : initialVisibleMonth()) || date || undefined), numberOfMonths))),
32
+ _useState2 = _slicedToArray(_useState, 2),
33
+ statusText = _useState2[0],
34
+ updateStatusText = _useState2[1];
35
+ var handleMonthClick = function handleMonthClick(date) {
36
+ updateStatusText(setStatusText(getVisibleMonths(date, numberOfMonths)));
37
+ };
38
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ReactDatesCssOverrides, null), /*#__PURE__*/React.createElement(VisuallyHidden, null, /*#__PURE__*/React.createElement("div", {
39
+ role: "status"
40
+ }, statusText)), /*#__PURE__*/React.createElement(DayPickerSingleDateController, _extends({}, commonDatePickerProps, {
19
41
  date: date,
20
- numberOfMonths: 1,
42
+ numberOfMonths: numberOfMonths,
21
43
  onDateChange: onDateChange,
22
- initialVisibleMonth: null,
44
+ initialVisibleMonth: initialVisibleMonth || null,
23
45
  focused: focused,
24
- onFocusChange: onFocusChange
46
+ onFocusChange: onFocusChange,
47
+ onPrevMonthClick: handleMonthClick,
48
+ onNextMonthClick: handleMonthClick
25
49
  }, rest)));
26
50
  };
27
51
  export default /*#__PURE__*/React.memo(SingleDatePicker);
@@ -43,4 +43,18 @@ export var formatDateAsCalendarDay = function formatDateAsCalendarDay(date) {
43
43
  export var getVisibleMonthWithReactDatesInternalApi = function getVisibleMonthWithReactDatesInternalApi(container) {
44
44
  var _container$querySelec, _container$querySelec2;
45
45
  return (_container$querySelec = (_container$querySelec2 = container.querySelector('[data-visible=true] strong')) === null || _container$querySelec2 === void 0 ? void 0 : _container$querySelec2.textContent) !== null && _container$querySelec !== void 0 ? _container$querySelec : '';
46
+ };
47
+
48
+ // Receives a single Moment and returns an array of Moments, one for each currently visible month.
49
+ export var getVisibleMonths = function getVisibleMonths(initialMonth, numberOfMonths) {
50
+ var months = [initialMonth];
51
+ for (var i = 1; i < numberOfMonths; i++) {
52
+ months.push(initialMonth.clone().add(i, 'month'));
53
+ }
54
+ return months;
55
+ };
56
+
57
+ // Default setStatusText prop for both SingleDatePicker and DateRangePicker
58
+ export var DefaultSetStatusText = function DefaultSetStatusText(dates) {
59
+ return dates.map(formatDateAsCalendarHeader).join(', ');
46
60
  };
package/lib/Icon/Icon.js CHANGED
@@ -7,8 +7,9 @@ import * as React from 'react';
7
7
  import styled, { css } from 'styled-components';
8
8
  import iconViewBoxes from "../IconViewBoxes";
9
9
  import Box from "../Box";
10
- import PartnerLogo, { PartnerNames } from "../PartnerLogo";
10
+ import PartnerLogo from "../PartnerLogo";
11
11
  import { includes } from "../utils";
12
+ import PartnerLogoNames from "../logoNames";
12
13
 
13
14
  // TODO: get json file working in flow so this can be shared
14
15
  // import deprecatedIcons from './deprecatedIcons.json';
@@ -24,7 +25,7 @@ var Icon = function Icon(_ref) {
24
25
  color = _ref.color,
25
26
  svgProps = _ref.svgProps,
26
27
  rest = _objectWithoutProperties(_ref, _excluded);
27
- if (includes(PartnerNames, name)) {
28
+ if (includes(PartnerLogoNames, name)) {
28
29
  // Icon's "default" size is equivalent to PartnerLogo's "small" size
29
30
  var logoSize = size === 'default' ? 'small' : size;
30
31
  var logoProps = {
@@ -276,6 +276,7 @@ module.exports = {
276
276
  "puzzle-piece": "0 0 18 16",
277
277
  "qr-code": "0 0 16 16",
278
278
  "queue": "0 0 16 16",
279
+ "quotes-solid": "0 0 18 18",
279
280
  "recommendation": "0 0 16 16",
280
281
  "reddit-alien": "0 0 16 16",
281
282
  "reddit": "0 0 16 16",
@@ -22,6 +22,7 @@ module.exports = {
22
22
  "contact": "0 0 305 145",
23
23
  "conversation": "0 0 330 236",
24
24
  "custom-branding": "0 0 168 164",
25
+ "custom-post-variables": "0 0 87 57",
25
26
  "customer-service": "0 0 302 155",
26
27
  "dashboard": "0 0 337 195",
27
28
  "exclamation-mark": "0 0 219 143",
@@ -1,8 +1,12 @@
1
1
  module.exports = {
2
2
  "adobe-experience-manager-dark": "0 0 16 17",
3
3
  "adobe-experience-manager": "0 0 16 17",
4
+ "android-dark": "0 0 18 18",
5
+ "android": "0 0 18 18",
4
6
  "apple-app-store-dark": "0 0 140 140",
5
7
  "apple-app-store": "0 0 140 140",
8
+ "apple-dark": "0 0 18 18",
9
+ "apple": "0 0 18 18",
6
10
  "bigcommerce-dark": "0 0 140 140",
7
11
  "bigcommerce-lockup-dark": "0 0 291 66",
8
12
  "bigcommerce-lockup": "0 0 291 66",
@@ -29,6 +33,8 @@ module.exports = {
29
33
  "facebook": "0 0 141 139",
30
34
  "feedly-dark": "0 0 141 123",
31
35
  "feedly": "0 0 141 123",
36
+ "github-dark": "0 0 18 18",
37
+ "github": "0 0 18 18",
32
38
  "glassdoor-dark": "0 0 140 196",
33
39
  "glassdoor": "0 0 140 196",
34
40
  "google-analytics-dark": "0 0 140 160",
@@ -57,8 +63,12 @@ module.exports = {
57
63
  "microsoft-dynamics": "0 0 140 227",
58
64
  "pinterest-dark": "0 0 140 141",
59
65
  "pinterest": "0 0 140 141",
66
+ "reddit-alien-dark": "0 0 18 18",
67
+ "reddit-alien": "0 0 18 18",
60
68
  "reddit-dark": "0 0 140 140",
61
69
  "reddit": "0 0 140 140",
70
+ "salesforce-cloud-dark": "0 0 20 18",
71
+ "salesforce-cloud": "0 0 20 18",
62
72
  "salesforce-dark": "0 0 140 99",
63
73
  "salesforce": "0 0 140 99",
64
74
  "shopify-dark": "0 0 140 159",
@@ -71,6 +81,10 @@ module.exports = {
71
81
  "sproutsocial-wordmark-dark": "0 0 320 52",
72
82
  "sproutsocial-wordmark": "0 0 320 52",
73
83
  "sproutsocial": "0 0 140 174",
84
+ "tableau-dark": "0 0 18 18",
85
+ "tableau-lockup-dark": "0 0 291 56",
86
+ "tableau-lockup": "0 0 291 56",
87
+ "tableau": "0 0 18 18",
74
88
  "tiktok-dark": "0 0 140 159",
75
89
  "tiktok": "0 0 140 159",
76
90
  "tripadvisor-dark": "0 0 140 140",
@@ -4,35 +4,42 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React from 'react';
6
6
  import { useTheme } from 'styled-components';
7
- // eslint-disable-next-line no-restricted-syntax
8
- import * as logoViewBoxes from "../LogoViewBoxes";
7
+ import logoViewBoxes from "../LogoViewBoxes";
9
8
  import Container from "./styles";
10
- var PartnerLogo = function PartnerLogo(_ref) {
11
- var partnerName = _ref.partnerName,
12
- backgroundType = _ref.backgroundType,
13
- _ref$logoType = _ref.logoType,
14
- logoType = _ref$logoType === void 0 ? 'symbol' : _ref$logoType,
15
- height = _ref.height,
16
- width = _ref.width,
17
- size = _ref.size,
18
- ariaLabel = _ref['aria-label'],
19
- svgProps = _ref.svgProps,
20
- rest = _objectWithoutProperties(_ref, _excluded);
9
+ var whichLogo = function whichLogo(_ref, mode) {
10
+ var backgroundType = _ref.backgroundType,
11
+ logoType = _ref.logoType,
12
+ partnerName = _ref.partnerName;
13
+ var logo = logoType && logoType !== 'symbol' ? partnerName + '-' + logoType : partnerName;
14
+ if (backgroundType && backgroundType === 'dark') {
15
+ return "".concat(logo, "-dark");
16
+ } else if (backgroundType && backgroundType === 'light') {
17
+ return logo;
18
+ } else if (mode === 'dark') {
19
+ return "".concat(logo, "-dark");
20
+ } else {
21
+ return logo;
22
+ }
23
+ };
24
+ var PartnerLogo = function PartnerLogo(_ref2) {
25
+ var partnerName = _ref2.partnerName,
26
+ backgroundType = _ref2.backgroundType,
27
+ _ref2$logoType = _ref2.logoType,
28
+ logoType = _ref2$logoType === void 0 ? 'symbol' : _ref2$logoType,
29
+ height = _ref2.height,
30
+ width = _ref2.width,
31
+ size = _ref2.size,
32
+ ariaLabel = _ref2['aria-label'],
33
+ svgProps = _ref2.svgProps,
34
+ rest = _objectWithoutProperties(_ref2, _excluded);
21
35
  var _useTheme = useTheme(),
22
36
  mode = _useTheme.mode;
23
- var whichLogo = function whichLogo(type) {
24
- var logo = logoType && logoType !== 'symbol' ? partnerName + '-' + logoType : partnerName;
25
- if (type && type === 'dark') {
26
- return "".concat(logo, "-dark");
27
- } else if (type && type === 'light') {
28
- return logo;
29
- } else if (mode === 'dark') {
30
- return "".concat(logo, "-dark");
31
- } else {
32
- return logo;
33
- }
34
- };
35
- var logoViewBox = logoViewBoxes[whichLogo(backgroundType)];
37
+ var logo = whichLogo({
38
+ backgroundType: backgroundType,
39
+ logoType: logoType,
40
+ partnerName: partnerName
41
+ }, mode);
42
+ var logoViewBox = logoViewBoxes[logo];
36
43
  var viewBoxCoordinates = (logoViewBox === null || logoViewBox === void 0 ? void 0 : logoViewBox.split(' ')) || [];
37
44
  var defaultWidth = viewBoxCoordinates[2];
38
45
  var defaultHeight = viewBoxCoordinates[3];
@@ -52,7 +59,7 @@ var PartnerLogo = function PartnerLogo(_ref) {
52
59
  "data-qa-logo-svg": "".concat(partnerName, "-svg")
53
60
  }, svgProps), /*#__PURE__*/React.createElement("use", {
54
61
  xmlnsXlink: "http://www.w3.org/1999/xlink",
55
- xlinkHref: "#sslogosvg-".concat(whichLogo(backgroundType))
62
+ xlinkHref: "#sslogosvg-".concat(logo)
56
63
  })));
57
64
  };
58
65
  export default PartnerLogo;
@@ -1,8 +1,19 @@
1
- export var PartnerNames = ['apple-app-store', 'bigcommerce', 'bitly', 'bynder', 'canva', 'dropbox', 'facebook', 'facebook-audience-network', 'facebook-groups', 'facebook-shops', 'feedly', 'glassdoor', 'google-analytics', 'google-business-messages', 'google-drive', 'google-my-business', 'google-play-store', 'hubspot', 'instagram', 'linkedin', 'linkedin-audience-network', 'marketo', 'messenger', 'microsoft-dynamics', 'pinterest', 'reddit', 'salesforce', 'shopify', 'slack', 'sproutsocial', 'tiktok', 'tripadvisor', 'tumblr', 'twitter', 'twitter-audience-network', 'whatsapp', 'woocommerce', 'yelp', 'youtube', 'zendesk'];
1
+ import PartnerLogoNames from "../logoNames";
2
+
3
+ /**
4
+ * @deprecated Use PartnerLogoNames instead
5
+ */
6
+ export var PartnerNames = PartnerLogoNames;
7
+
8
+ /**
9
+ * @deprecated Use EnumLogoNames instead
10
+ */
11
+
2
12
  export var PartnerLogoSizes = {
3
13
  mini: '12px',
4
14
  small: '16px',
5
15
  medium: '24px',
6
16
  large: '32px',
7
17
  jumbo: '64px'
8
- };
18
+ };
19
+ export var PartnerLogoTypes = ['symbol', 'wordmark', 'lockup'];
@@ -1,2 +1 @@
1
- export * from "./PartnerLogo.flow";
2
- export * from "./TypePartnerNames.flow";
1
+ export * from "./PartnerLogo.flow";
@@ -1,5 +1,5 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- var _excluded = ["isOpen", "setIsOpen", "content", "children", "placement", "fullWidth", "zIndex", "focusOnContent", "onOpen", "onClose", "qa", "popperProps", "scheduleUpdateRef", "appendToBody", "focusLockProps", "color"],
2
+ var _excluded = ["isOpen", "setIsOpen", "content", "children", "placement", "fullWidth", "zIndex", "focusOnContent", "onOpen", "onClose", "qa", "popperProps", "scheduleUpdateRef", "appendToBody", "focusLockProps", "color", "aria-haspopup"],
3
3
  _excluded2 = ["autoFocus", "returnFocus"],
4
4
  _excluded3 = ["children"];
5
5
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -86,6 +86,7 @@ export function Popout(_ref) {
86
86
  _ref$focusLockProps = _ref.focusLockProps,
87
87
  focusLockProps = _ref$focusLockProps === void 0 ? {} : _ref$focusLockProps,
88
88
  color = _ref.color,
89
+ ariaHasPopup = _ref['aria-haspopup'],
89
90
  rest = _objectWithoutProperties(_ref, _excluded);
90
91
  var PopoutComponentWrapper = appendToBody ? Portal : React.Fragment;
91
92
  var _useState = useState(false),
@@ -184,9 +185,9 @@ export function Popout(_ref) {
184
185
  var ariaProps = useMemo(function () {
185
186
  return {
186
187
  'aria-expanded': isShown,
187
- 'aria-haspopup': true
188
+ 'aria-haspopup': ariaHasPopup ? ariaHasPopup : true
188
189
  };
189
- }, [isShown]);
190
+ }, [isShown, ariaHasPopup]);
190
191
 
191
192
  // In cases where a controlled popout is used (e.g. props.isOpen is true), we need
192
193
  // to wait for the targetRef to receive a value before rendering the popout. Otherwise,
@@ -1 +1 @@
1
- export var illustrationNames = Object.freeze(["abacus", "analytics-offering", "asset-cards", "astronaut", "binoculars", "brand-keyword", "browser-doc", "business", "calendar-event", "calendar-reporting", "cat-error", "cat-no-access", "cat", "checkbox-alert", "coffee-cup", "competitors", "compose-window", "compose", "computer-error", "connect", "contact", "conversation", "custom-branding", "customer-service", "dashboard", "exclamation-mark", "face-happy", "find-bookmark", "flask", "general-topic", "global-features", "global-trend", "grow-large", "grow", "hands-raised", "headset", "heartbeat-connection", "instagram-links", "invoice", "jewel", "keyword-tracking", "lightbulb-alt", "lightbulb", "like-conversation", "link-broken", "link-messages", "link-sections", "link-upload", "listening-pendo", "listening-sentiment", "listening-topic-templates", "listening-tour", "listening", "loading", "mailbox-empty", "mailbox-full", "megaphone", "message", "molecule", "network-data", "no-messages-found", "no-notifications", "note", "notification", "notifications-onboarding", "notifications", "organize-message", "outbox-queue", "outbox-reviews", "pdf", "planning", "podium", "pointer", "publish-assets", "publish-links", "publishing-notifications", "publishing", "puzzle-piece", "question-mark", "reporting-folder", "reporting", "review-location", "review", "robot-assembly", "robot-error", "robot-happy", "rocket", "schedule-date", "schedule-messages", "search-keywords", "search-success", "search-trends", "search", "security", "sentiment", "shopping-bag", "spark-line", "sprout-mobile-app", "stamp", "storefront", "success", "tag-message", "tag", "team-roles", "team", "telescope", "tha-mel", "thumbs-up", "toggle-switch", "toolset-strength", "tracking-time", "twitter-messages", "twitter-profiles", "under-construction", "unsubscribe", "upward-trend", "user-task", "user-team", "variable-table", "view-connections", "vip-list", "warning", "wifi", "workflow-steps"]);
1
+ export var illustrationNames = Object.freeze(["abacus", "analytics-offering", "asset-cards", "astronaut", "binoculars", "brand-keyword", "browser-doc", "business", "calendar-event", "calendar-reporting", "cat-error", "cat-no-access", "cat", "checkbox-alert", "coffee-cup", "competitors", "compose-window", "compose", "computer-error", "connect", "contact", "conversation", "custom-branding", "custom-post-variables", "customer-service", "dashboard", "exclamation-mark", "face-happy", "find-bookmark", "flask", "general-topic", "global-features", "global-trend", "grow-large", "grow", "hands-raised", "headset", "heartbeat-connection", "instagram-links", "invoice", "jewel", "keyword-tracking", "lightbulb-alt", "lightbulb", "like-conversation", "link-broken", "link-messages", "link-sections", "link-upload", "listening-pendo", "listening-sentiment", "listening-topic-templates", "listening-tour", "listening", "loading", "mailbox-empty", "mailbox-full", "megaphone", "message", "molecule", "network-data", "no-messages-found", "no-notifications", "note", "notification", "notifications-onboarding", "notifications", "organize-message", "outbox-queue", "outbox-reviews", "pdf", "planning", "podium", "pointer", "publish-assets", "publish-links", "publishing-notifications", "publishing", "puzzle-piece", "question-mark", "reporting-folder", "reporting", "review-location", "review", "robot-assembly", "robot-error", "robot-happy", "rocket", "schedule-date", "schedule-messages", "search-keywords", "search-success", "search-trends", "search", "security", "sentiment", "shopping-bag", "spark-line", "sprout-mobile-app", "stamp", "storefront", "success", "tag-message", "tag", "team-roles", "team", "telescope", "tha-mel", "thumbs-up", "toggle-switch", "toolset-strength", "tracking-time", "twitter-messages", "twitter-profiles", "under-construction", "unsubscribe", "upward-trend", "user-task", "user-team", "variable-table", "view-connections", "vip-list", "warning", "wifi", "workflow-steps"]);
@@ -1,83 +1,47 @@
1
- var _excluded = ["checked", "disabled", "name", "a11yLabels", "onClick", "qa"];
2
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
+ var _excluded = ["onClick", "loading", "checked", "disabled"];
3
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
5
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
11
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
13
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
14
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
15
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
16
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
18
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
19
5
  import * as React from 'react';
20
6
  import Icon from "../Icon";
21
- import { VisuallyHidden } from "../VisuallyHidden";
22
- import Container from "./styles";
23
- // Switch acts as a toggle, enabling users to turn a particular action on or off.
24
- var Switch = /*#__PURE__*/function (_React$Component) {
25
- _inherits(Switch, _React$Component);
26
- var _super = _createSuper(Switch);
27
- function Switch() {
28
- var _this;
29
- _classCallCheck(this, Switch);
30
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
31
- args[_key] = arguments[_key];
7
+ import { StyledSwitchButton } from "./styles";
8
+ /**
9
+ * @link https://seeds.sproutsocial.com/components/switch/
10
+ *
11
+ * Switch should always have an accessible label. Use aria-label, aria-labelledby or a `Label` component.
12
+ * The accessible label should not change when the checked state changes.
13
+ * The component uses role="switch" and the `checked` prop will be used to set the aria-checked attribute.
14
+ *
15
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/switch/
16
+ *
17
+ * @example
18
+ * <Switch checked={true} onClick={_onClick} aria-label="Switch Example" />
19
+ */
20
+
21
+ var Switch = function Switch(_ref) {
22
+ var onClick = _ref.onClick,
23
+ _ref$loading = _ref.loading,
24
+ loading = _ref$loading === void 0 ? false : _ref$loading,
25
+ checked = _ref.checked,
26
+ _ref$disabled = _ref.disabled,
27
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
28
+ rest = _objectWithoutProperties(_ref, _excluded);
29
+ var handleClick = function handleClick(e) {
30
+ if (!disabled) {
31
+ onClick(e, !checked);
32
32
  }
33
- _this = _super.call.apply(_super, [this].concat(args));
34
- _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
35
- var _this$props = _this.props,
36
- checked = _this$props.checked,
37
- onClick = _this$props.onClick,
38
- disabled = _this$props.disabled;
39
- if (!disabled) {
40
- onClick(e, !checked);
41
- }
42
- });
43
- return _this;
44
- }
45
- _createClass(Switch, [{
46
- key: "render",
47
- value: function render() {
48
- var _this$props2 = this.props,
49
- checked = _this$props2.checked,
50
- disabled = _this$props2.disabled,
51
- name = _this$props2.name,
52
- a11yLabels = _this$props2.a11yLabels,
53
- onClick = _this$props2.onClick,
54
- _this$props2$qa = _this$props2.qa,
55
- qa = _this$props2$qa === void 0 ? {} : _this$props2$qa,
56
- rest = _objectWithoutProperties(_this$props2, _excluded);
57
- return /*#__PURE__*/React.createElement(Container, _extends({
58
- role: "button",
59
- type: "button",
60
- "aria-pressed": checked,
61
- disabled: disabled,
62
- onClick: this.handleClick,
63
- "data-qa-switch": name || '',
64
- "data-qa-switch-ischecked": checked === true,
65
- "data-qa-switch-isdisabled": disabled === true,
66
- checked: checked
67
- }, qa, rest), /*#__PURE__*/React.createElement(VisuallyHidden, null, checked ? a11yLabels.on : a11yLabels.off), checked ? /*#__PURE__*/React.createElement(Icon, {
68
- "aria-hidden": true,
69
- size: "mini",
70
- name: "check"
71
- }) : null);
72
- }
73
- }]);
74
- return Switch;
75
- }(React.Component);
76
- _defineProperty(Switch, "defaultProps", {
77
- disabled: false,
78
- a11yLabels: {
79
- on: 'on',
80
- off: 'off'
81
- }
82
- });
83
- export { Switch as default };
33
+ };
34
+ return /*#__PURE__*/React.createElement(StyledSwitchButton, _extends({
35
+ type: "button",
36
+ role: "switch",
37
+ "aria-checked": checked,
38
+ disabled: disabled,
39
+ onClick: handleClick,
40
+ className: loading ? 'loading' : ''
41
+ }, rest), checked ? /*#__PURE__*/React.createElement(Icon, {
42
+ "aria-hidden": true,
43
+ size: "mini",
44
+ name: "check"
45
+ }) : null);
46
+ };
47
+ export default Switch;
@@ -1 +1,2 @@
1
- export * from "./Switch.flow";
1
+ export * from "./Switch.flow";
2
+ export * from "./SwitchTypes.flow";
@@ -1,37 +1,62 @@
1
- import styled, { css } from 'styled-components';
1
+ import styled, { keyframes } from 'styled-components';
2
2
  import { focusRing } from "../utils/mixins";
3
- import { COMMON } from "../utils/system-props";
4
- import Icon from "../Icon/styles";
5
- var Container = styled.button.withConfig({
6
- displayName: "styles__Container",
3
+ import { color, layout, space } from 'styled-system';
4
+ var loadingKeyFrame = keyframes(["0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}"]);
5
+ export var StyledSwitchButton = styled.button.withConfig({
6
+ displayName: "styles__StyledSwitchButton",
7
7
  componentId: "sc-ku462j-0"
8
- })(["position:relative;display:inline-block;width:36px;height:22px;margin:0;padding:", " ", ";vertical-align:middle;appearance:none;background-color:", ";border-radius:11px;outline:none;cursor:pointer;transition:background-color ", " ", ";border:1px solid ", ";white-space:nowrap;overflow:hidden;&::after{position:absolute;top:50%;left:0;width:14px;height:14px;background-color:", ";opacity:0.64;border-radius:50%;content:'';transition:transform ", " ", ";transform:translate(4px,-50%);}&:focus{", "}", " ", " ", ""], function (props) {
9
- return props.theme.space[100];
10
- }, function (props) {
11
- return props.theme.space[200];
12
- }, function (props) {
13
- return props.theme.colors.form.background.base;
14
- }, function (props) {
15
- return props.theme.duration.fast;
16
- }, function (props) {
17
- return props.theme.easing.ease_inout;
18
- }, function (props) {
19
- return props.theme.colors.form.border.base;
20
- }, function (props) {
21
- return props.theme.colors.icon.base;
22
- }, function (props) {
23
- return props.theme.duration.fast;
24
- }, function (props) {
25
- return props.theme.easing.ease_inout;
26
- }, focusRing, function (props) {
27
- if (props.checked) {
28
- return css(["color:", ";text-align:left;border-color:", ";background-color:", ";&::after{background-color:", ";opacity:1;transform:translate(17px,-50%);}", "{position:absolute;top:50%;left:4px;transform:translate(0,-50%);color:", ";}"], props.theme.colors.text.body, props.theme.colors.form.border.selected, props.theme.colors.form.background.selected, props.theme.colors.icon.inverse, Icon, props.theme.colors.icon.inverse);
29
- } else {
30
- return "\n &:hover,\n &:focus {\n border-color: ".concat(props.theme.colors.form.border.base, ";\n background-color: ").concat(props.theme.colors.form.background.base, ";\n }\n &:hover {\n &::after {\n transform: translate(6px, -50%);\n }\n }\n ");
31
- }
32
- }, function (props) {
33
- return props.disabled && css(["opacity:0.4;cursor:not-allowed;&[aria-pressed='true']{&:hover,&:focus{background-color:", ";}}"], function (props) {
34
- return props.theme.colors.container.background.selected;
35
- });
36
- }, COMMON);
37
- export default Container;
8
+ })(["position:relative;display:inline-flex;align-self:center;width:40px;height:24px;margin:0;padding:", " ", ";vertical-align:middle;appearance:none;background-color:", ";border-radius:16px;outline:none;cursor:pointer;transition:background-color ", " ", ";border:1px solid ", ";white-space:nowrap;overflow:hidden;&:focus{", "}&[aria-checked]{&::after{display:block;width:16px;height:16px;border-radius:50%;content:'';transition:transform ", " ", ";}&.loading{cursor:not-allowed;pointer-events:none;background-size:contain;background-color:", ";&::after{position:absolute;box-sizing:content-box;width:8px;height:8px;border-radius:", ";border:3px dotted ", ";background-color:transparent;animation:", " 2s linear infinite;}}}&[aria-checked='true']{color:", ";text-align:left;border-color:", ";background-color:", ";.Icon{position:absolute;top:50%;left:4px;transform:translate(0,-50%);color:", ";}&::after{background-color:", ";opacity:1;transform:translate(100%,6%);}&.loading::after{top:4px;right:5px;}&:hover,&:focus{&::after{transform:translate(90%,6%);}}}&[aria-checked='false']{&::after{background-color:", ";opacity:0.64;transform:translate(0%,6%);}&.loading::after{top:4px;left:5px;}&:hover,&:focus{&::after{transform:translate(10%,6%);}}}&:disabled{opacity:0.4;pointer-events:none;cursor:not-allowed;&[aria-checked='true']{&:hover,&:focus{background-color:", ";}}}", " ", " ", ""], function (_ref) {
9
+ var theme = _ref.theme;
10
+ return theme.space[100];
11
+ }, function (_ref2) {
12
+ var theme = _ref2.theme;
13
+ return theme.space[200];
14
+ }, function (_ref3) {
15
+ var theme = _ref3.theme;
16
+ return theme.colors.form.background.base;
17
+ }, function (_ref4) {
18
+ var theme = _ref4.theme;
19
+ return theme.duration.fast;
20
+ }, function (_ref5) {
21
+ var theme = _ref5.theme;
22
+ return theme.easing.ease_inout;
23
+ }, function (_ref6) {
24
+ var theme = _ref6.theme;
25
+ return theme.colors.form.border.base;
26
+ }, focusRing, function (_ref7) {
27
+ var theme = _ref7.theme;
28
+ return theme.duration.fast;
29
+ }, function (_ref8) {
30
+ var theme = _ref8.theme;
31
+ return theme.easing.ease_inout;
32
+ }, function (_ref9) {
33
+ var theme = _ref9.theme;
34
+ return theme.colors.form.background.base;
35
+ }, function (_ref10) {
36
+ var theme = _ref10.theme;
37
+ return theme.radii.pill;
38
+ }, function (_ref11) {
39
+ var theme = _ref11.theme;
40
+ return theme.colors.icon.base;
41
+ }, loadingKeyFrame, function (_ref12) {
42
+ var theme = _ref12.theme;
43
+ return theme.colors.text.body;
44
+ }, function (_ref13) {
45
+ var theme = _ref13.theme;
46
+ return theme.colors.form.border.selected;
47
+ }, function (_ref14) {
48
+ var theme = _ref14.theme;
49
+ return theme.colors.form.background.selected;
50
+ }, function (_ref15) {
51
+ var theme = _ref15.theme;
52
+ return theme.colors.icon.inverse;
53
+ }, function (_ref16) {
54
+ var theme = _ref16.theme;
55
+ return theme.colors.icon.inverse;
56
+ }, function (_ref17) {
57
+ var theme = _ref17.theme;
58
+ return theme.colors.icon.base;
59
+ }, function (_ref18) {
60
+ var theme = _ref18.theme;
61
+ return theme.colors.container.background.selected;
62
+ }, color, layout, space);
@@ -48,11 +48,18 @@ export var Table = function Table(_ref) {
48
48
  // @ts-ignore
49
49
  ,
50
50
  color: color
51
- }), head.length > 0 && /*#__PURE__*/React.createElement("thead", {
51
+ }), /*#__PURE__*/React.createElement("colgroup", null, head.map(function (_ref2) {
52
+ var _ref2$colSpan = _ref2.colSpan,
53
+ colSpan = _ref2$colSpan === void 0 ? 1 : _ref2$colSpan;
54
+ return /*#__PURE__*/React.createElement("col", {
55
+ key: colSpan,
56
+ span: colSpan
57
+ });
58
+ })), head.length > 0 && /*#__PURE__*/React.createElement("thead", {
52
59
  "data-qa-table-header": ""
53
- }, /*#__PURE__*/React.createElement("tr", null, head.map(function (_ref2) {
54
- var color = _ref2.color,
55
- th = _objectWithoutProperties(_ref2, _excluded2);
60
+ }, /*#__PURE__*/React.createElement("tr", null, head.map(function (_ref3) {
61
+ var color = _ref3.color,
62
+ th = _objectWithoutProperties(_ref3, _excluded2);
56
63
  return /*#__PURE__*/React.createElement(TableHeaderCell, _extends({}, th, {
57
64
  key: th.id,
58
65
  onSort: onSort,
@@ -68,19 +75,19 @@ export var Table = function Table(_ref) {
68
75
  return rowRender ? rowRender(row) : renderTableRow(row);
69
76
  }));
70
77
  };
71
- export var TableHead = function TableHead(_ref3) {
72
- var children = _ref3.children,
73
- props = _objectWithoutProperties(_ref3, _excluded3);
78
+ export var TableHead = function TableHead(_ref4) {
79
+ var children = _ref4.children,
80
+ props = _objectWithoutProperties(_ref4, _excluded3);
74
81
  return /*#__PURE__*/React.createElement("thead", props, children);
75
82
  };
76
- export var TableBody = function TableBody(_ref4) {
77
- var children = _ref4.children,
78
- props = _objectWithoutProperties(_ref4, _excluded4);
83
+ export var TableBody = function TableBody(_ref5) {
84
+ var children = _ref5.children,
85
+ props = _objectWithoutProperties(_ref5, _excluded4);
79
86
  return /*#__PURE__*/React.createElement("tbody", props, children);
80
87
  };
81
- export var TableRow = function TableRow(_ref5) {
82
- var children = _ref5.children,
83
- props = _objectWithoutProperties(_ref5, _excluded5);
88
+ export var TableRow = function TableRow(_ref6) {
89
+ var children = _ref6.children,
90
+ props = _objectWithoutProperties(_ref6, _excluded5);
84
91
  return /*#__PURE__*/React.createElement("tr", props, children);
85
92
  };
86
93
  TableHead.displayName = 'Table.TableHead';