@sproutsocial/racine 11.4.0 → 11.4.2-input-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.
Files changed (180) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/__flow__/Input/index.js +34 -9
  3. package/__flow__/Input/index.stories.js +14 -0
  4. package/__flow__/Input/index.test.js +18 -0
  5. package/__flow__/utils/index.js +23 -0
  6. package/commonjs/Avatar/index.js +7 -4
  7. package/commonjs/Badge/index.js +3 -1
  8. package/commonjs/Badge/styles.js +1 -1
  9. package/commonjs/Banner/index.js +3 -1
  10. package/commonjs/Banner/styles.js +1 -1
  11. package/commonjs/Box/styles.js +1 -1
  12. package/commonjs/Breadcrumb/index.js +5 -2
  13. package/commonjs/Button/index.js +3 -1
  14. package/commonjs/Card/index.js +3 -1
  15. package/commonjs/Card/styles.js +3 -3
  16. package/commonjs/CharacterCounter/index.js +3 -1
  17. package/commonjs/CharacterCounter/styles.js +1 -1
  18. package/commonjs/ChartLegend/index.js +3 -1
  19. package/commonjs/ChartLegend/styles.js +3 -3
  20. package/commonjs/Checkbox/index.js +3 -1
  21. package/commonjs/Checkbox/styles.js +1 -1
  22. package/commonjs/Collapsible/index.js +5 -2
  23. package/commonjs/DatePicker/DateRangePicker.js +3 -1
  24. package/commonjs/DatePicker/SingleDatePicker.js +3 -1
  25. package/commonjs/DatePicker/StatefulDateRangePicker.js +3 -1
  26. package/commonjs/DatePicker/StatefulSingleDatePicker.js +3 -1
  27. package/commonjs/DatePicker/common.js +1 -1
  28. package/commonjs/DatePicker/styles.js +2 -6
  29. package/commonjs/Drawer/SlideTransition.js +3 -1
  30. package/commonjs/Drawer/index.js +9 -4
  31. package/commonjs/Drawer/styles.js +2 -2
  32. package/commonjs/EmptyState/index.js +3 -1
  33. package/commonjs/Fieldset/index.js +7 -3
  34. package/commonjs/FormField/index.js +3 -1
  35. package/commonjs/Icon/index.js +5 -2
  36. package/commonjs/Icon/styles.js +1 -1
  37. package/commonjs/Image/index.js +3 -1
  38. package/commonjs/Image/styles.js +1 -1
  39. package/commonjs/Indicator/index.js +3 -1
  40. package/commonjs/Input/index.js +32 -18
  41. package/commonjs/Input/styles.js +2 -2
  42. package/commonjs/KeyboardKey/index.js +3 -1
  43. package/commonjs/Label/index.js +4 -2
  44. package/commonjs/Link/index.js +3 -1
  45. package/commonjs/Link/styles.js +1 -1
  46. package/commonjs/Listbox/index.js +7 -4
  47. package/commonjs/Loader/index.js +3 -1
  48. package/commonjs/Loader/styles.js +2 -2
  49. package/commonjs/LoaderButton/index.js +3 -1
  50. package/commonjs/Menu/constants.js +1 -1
  51. package/commonjs/Menu/descendants.js +10 -7
  52. package/commonjs/Menu/hooks.js +1 -1
  53. package/commonjs/Menu/index.js +22 -16
  54. package/commonjs/Menu/styles.js +2 -2
  55. package/commonjs/Message/index.js +3 -1
  56. package/commonjs/Message/styles.js +1 -1
  57. package/commonjs/Modal/index.js +7 -3
  58. package/commonjs/Modal/styles.js +4 -6
  59. package/commonjs/Numeral/constants.js +1 -1
  60. package/commonjs/Numeral/index.js +3 -1
  61. package/commonjs/Numeral/styles.js +3 -3
  62. package/commonjs/OverflowList/styles.js +1 -1
  63. package/commonjs/Popout/index.js +7 -3
  64. package/commonjs/Popout/styles.js +1 -1
  65. package/commonjs/Radio/index.js +3 -1
  66. package/commonjs/Radio/styles.js +4 -4
  67. package/commonjs/SegmentedControl/index.js +5 -2
  68. package/commonjs/Select/index.js +3 -1
  69. package/commonjs/Stack/index.js +3 -1
  70. package/commonjs/Switch/index.js +3 -1
  71. package/commonjs/Switch/styles.js +1 -1
  72. package/commonjs/Table/index.js +10 -5
  73. package/commonjs/TableCell/index.js +3 -1
  74. package/commonjs/TableHeaderCell/index.js +3 -1
  75. package/commonjs/TableRowAccordion/index.js +3 -1
  76. package/commonjs/Tabs/index.js +5 -2
  77. package/commonjs/Tabs/styles.js +4 -4
  78. package/commonjs/Text/index.js +3 -1
  79. package/commonjs/Text/styles.js +1 -1
  80. package/commonjs/Textarea/index.js +3 -1
  81. package/commonjs/Toast/index.js +15 -15
  82. package/commonjs/Toast/styles.js +4 -7
  83. package/commonjs/ToggleHint/index.js +3 -1
  84. package/commonjs/Token/index.js +3 -1
  85. package/commonjs/Token/styles.js +1 -1
  86. package/commonjs/TokenInput/index.js +3 -1
  87. package/commonjs/Tooltip/index.js +5 -2
  88. package/commonjs/Tooltip/styles.js +1 -1
  89. package/commonjs/VisuallyHidden/index.js +1 -1
  90. package/commonjs/index.js +1 -1
  91. package/commonjs/themes/dark/decorative-palettes.js +1 -1
  92. package/commonjs/themes/dark/theme.js +1 -1
  93. package/commonjs/themes/light/decorative-palettes.js +1 -1
  94. package/commonjs/themes/light/theme.js +1 -1
  95. package/commonjs/utils/hooks.js +3 -2
  96. package/commonjs/utils/index.js +29 -2
  97. package/commonjs/utils/mixins.js +1 -1
  98. package/commonjs/utils/system-props.js +1 -1
  99. package/dist/themes/dark/dark.scss +5 -5
  100. package/dist/themes/light/light.scss +95 -95
  101. package/lib/Avatar/index.js +7 -4
  102. package/lib/Badge/index.js +3 -1
  103. package/lib/Badge/styles.js +1 -1
  104. package/lib/Banner/index.js +3 -1
  105. package/lib/Banner/styles.js +1 -1
  106. package/lib/Box/styles.js +1 -1
  107. package/lib/Breadcrumb/index.js +5 -2
  108. package/lib/Button/index.js +3 -1
  109. package/lib/Card/index.js +3 -1
  110. package/lib/Card/styles.js +2 -2
  111. package/lib/CharacterCounter/index.js +3 -1
  112. package/lib/CharacterCounter/styles.js +1 -1
  113. package/lib/ChartLegend/index.js +3 -1
  114. package/lib/ChartLegend/styles.js +3 -3
  115. package/lib/Checkbox/index.js +3 -1
  116. package/lib/Collapsible/index.js +5 -2
  117. package/lib/DatePicker/DateRangePicker.js +3 -1
  118. package/lib/DatePicker/SingleDatePicker.js +3 -1
  119. package/lib/DatePicker/StatefulDateRangePicker.js +3 -1
  120. package/lib/DatePicker/StatefulSingleDatePicker.js +3 -1
  121. package/lib/DatePicker/styles.js +2 -6
  122. package/lib/Drawer/SlideTransition.js +3 -1
  123. package/lib/Drawer/index.js +9 -4
  124. package/lib/Drawer/styles.js +2 -2
  125. package/lib/EmptyState/index.js +3 -1
  126. package/lib/Fieldset/index.js +7 -3
  127. package/lib/FormField/index.js +3 -1
  128. package/lib/Icon/index.js +5 -2
  129. package/lib/Icon/styles.js +1 -1
  130. package/lib/Image/index.js +3 -1
  131. package/lib/Image/styles.js +1 -1
  132. package/lib/Indicator/index.js +3 -1
  133. package/lib/Input/index.js +31 -18
  134. package/lib/Input/styles.js +2 -2
  135. package/lib/KeyboardKey/index.js +3 -1
  136. package/lib/Label/index.js +4 -2
  137. package/lib/Link/index.js +3 -1
  138. package/lib/Link/styles.js +1 -1
  139. package/lib/Listbox/index.js +6 -3
  140. package/lib/Loader/index.js +3 -1
  141. package/lib/Loader/styles.js +2 -2
  142. package/lib/LoaderButton/index.js +3 -1
  143. package/lib/Menu/descendants.js +5 -2
  144. package/lib/Menu/index.js +20 -16
  145. package/lib/Menu/styles.js +2 -2
  146. package/lib/Message/index.js +3 -1
  147. package/lib/Modal/index.js +7 -3
  148. package/lib/Modal/styles.js +3 -5
  149. package/lib/Numeral/index.js +3 -1
  150. package/lib/Numeral/styles.js +2 -2
  151. package/lib/OverflowList/styles.js +1 -1
  152. package/lib/Popout/index.js +7 -3
  153. package/lib/Popout/styles.js +1 -1
  154. package/lib/Radio/index.js +3 -1
  155. package/lib/Radio/styles.js +4 -4
  156. package/lib/SegmentedControl/index.js +5 -2
  157. package/lib/Select/index.js +3 -1
  158. package/lib/Stack/index.js +3 -1
  159. package/lib/Switch/index.js +3 -1
  160. package/lib/Switch/styles.js +1 -1
  161. package/lib/Table/index.js +9 -4
  162. package/lib/TableCell/index.js +3 -1
  163. package/lib/TableHeaderCell/index.js +3 -1
  164. package/lib/TableRowAccordion/index.js +3 -1
  165. package/lib/Tabs/index.js +5 -2
  166. package/lib/Tabs/styles.js +3 -3
  167. package/lib/Text/index.js +3 -1
  168. package/lib/Text/styles.js +1 -1
  169. package/lib/Textarea/index.js +3 -1
  170. package/lib/Toast/index.js +14 -14
  171. package/lib/Toast/styles.js +3 -7
  172. package/lib/ToggleHint/index.js +3 -1
  173. package/lib/Token/index.js +3 -1
  174. package/lib/Token/styles.js +1 -1
  175. package/lib/TokenInput/index.js +3 -1
  176. package/lib/Tooltip/index.js +5 -2
  177. package/lib/Tooltip/styles.js +1 -1
  178. package/lib/VisuallyHidden/index.js +1 -1
  179. package/lib/utils/index.js +24 -0
  180. package/package.json +1 -1
@@ -1,3 +1,5 @@
1
+ var _excluded = ["autoFocus", "autocomplete", "disabled", "isInvalid", "hasWarning", "id", "name", "placeholder", "required", "value", "elemBefore", "elemAfter", "maxLength", "ariaDescribedby", "ariaLabel", "innerRef", "onAddToken", "onRemoveToken", "onChangeTokens", "onClickToken", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "onPaste", "inputProps", "qa", "tokens"];
2
+
1
3
  function _extends() { _extends = Object.assign || 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); }
2
4
 
3
5
  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; }
@@ -264,7 +266,7 @@ var TokenInput = /*#__PURE__*/function (_React$Component) {
264
266
  _this$props5$qa = _this$props5.qa,
265
267
  qa = _this$props5$qa === void 0 ? {} : _this$props5$qa,
266
268
  tokens = _this$props5.tokens,
267
- rest = _objectWithoutPropertiesLoose(_this$props5, ["autoFocus", "autocomplete", "disabled", "isInvalid", "hasWarning", "id", "name", "placeholder", "required", "value", "elemBefore", "elemAfter", "maxLength", "ariaDescribedby", "ariaLabel", "innerRef", "onAddToken", "onRemoveToken", "onChangeTokens", "onClickToken", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "onPaste", "inputProps", "qa", "tokens"]);
269
+ rest = _objectWithoutPropertiesLoose(_this$props5, _excluded);
268
270
 
269
271
  var state = this.state;
270
272
  return /*#__PURE__*/React.createElement(Container, _extends({
@@ -1,3 +1,6 @@
1
+ var _excluded = ["content", "children", "enterDelay", "placement", "appearance", "zIndex", "qa", "popoutProps", "truncated"],
2
+ _excluded2 = ["appearance", "children"];
3
+
1
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; }
2
5
 
3
6
  function _extends() { _extends = Object.assign || 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); }
@@ -34,7 +37,7 @@ var Tooltip = function Tooltip(_ref) {
34
37
  popoutProps = _ref.popoutProps,
35
38
  _ref$truncated = _ref.truncated,
36
39
  truncated = _ref$truncated === void 0 ? false : _ref$truncated,
37
- rest = _objectWithoutPropertiesLoose(_ref, ["content", "children", "enterDelay", "placement", "appearance", "zIndex", "qa", "popoutProps", "truncated"]);
40
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
38
41
 
39
42
  var _useState = useState(false),
40
43
  shouldShow = _useState[0],
@@ -108,7 +111,7 @@ var Content = function Content(_ref2) {
108
111
  var _ref2$appearance = _ref2.appearance,
109
112
  appearance = _ref2$appearance === void 0 ? "pill" : _ref2$appearance,
110
113
  children = _ref2.children,
111
- rest = _objectWithoutPropertiesLoose(_ref2, ["appearance", "children"]);
114
+ rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
112
115
 
113
116
  return /*#__PURE__*/React.createElement(TooltipContent, _extends({
114
117
  appearance: appearance,
@@ -3,7 +3,7 @@ import Box from "../Box";
3
3
  // eslint-disable-next-line prettier/prettier
4
4
  export var TooltipContent = styled(Box).withConfig({
5
5
  displayName: "styles__TooltipContent",
6
- componentId: "t1xjnk-0"
6
+ componentId: "sc-t1xjnk-0"
7
7
  })(["font-family:", ";", " text-align:", ";"], function (props) {
8
8
  return props.theme.fontFamily;
9
9
  }, function (props) {
@@ -2,5 +2,5 @@ import { visuallyHidden } from "../utils/mixins";
2
2
  import styled from "styled-components";
3
3
  export var VisuallyHidden = styled.span.withConfig({
4
4
  displayName: "VisuallyHidden",
5
- componentId: "rxkbyc-0"
5
+ componentId: "sc-rxkbyc-0"
6
6
  })(["", ""], visuallyHidden);
@@ -1,3 +1,27 @@
1
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2
+
3
+ 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); }
4
+
5
+ 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; }
6
+
1
7
  export var canUseDOM = function canUseDOM() {
2
8
  return Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
9
+ };
10
+ // Allows a component to pass its own ref *and* a ref prop to the same element.
11
+ // Via https://www.davedrinks.coffee/how-do-i-use-two-react-refs/
12
+ export var mergeRefs = function mergeRefs(refs) {
13
+ var filteredRefs = refs.filter(Boolean);
14
+ if (!filteredRefs.length) return null;
15
+ if (filteredRefs.length === 0) return filteredRefs[0];
16
+ return function (inst) {
17
+ for (var _iterator = _createForOfIteratorHelperLoose(filteredRefs), _step; !(_step = _iterator()).done;) {
18
+ var ref = _step.value;
19
+
20
+ if (typeof ref === "function") {
21
+ ref(inst);
22
+ } else if (ref) {
23
+ ref.current = inst;
24
+ }
25
+ }
26
+ };
3
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "11.4.0",
3
+ "version": "11.4.2-input-beta.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",