@occmundial/occ-atomic 2.0.0-beta.1 → 2.0.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (284) hide show
  1. package/.prettierrc +6 -0
  2. package/.whitesource +12 -0
  3. package/CHANGELOG.md +1283 -584
  4. package/CONTRIBUTING.md +24 -0
  5. package/README.md +21 -21
  6. package/build/Autocomplete/Autocomplete.js +217 -117
  7. package/build/Autocomplete/Autocomplete.test.js +90 -74
  8. package/build/Autocomplete/__snapshots__/Autocomplete.test.js.snap +20 -0
  9. package/build/Autocomplete/index.js +6 -1
  10. package/build/Autocomplete/styles.js +2 -5
  11. package/build/Avatar/Avatar.js +66 -28
  12. package/build/Avatar/Avatar.test.js +36 -13
  13. package/build/Avatar/AvatarContent/AvatarContent.js +11 -14
  14. package/build/Avatar/AvatarContent/AvatarContent.test.js +55 -50
  15. package/build/Avatar/AvatarContent/__snapshots__/AvatarContent.test.js.snap +41 -0
  16. package/build/Avatar/AvatarContent/index.js +6 -1
  17. package/build/Avatar/AvatarContent/styles.js +12 -11
  18. package/build/Avatar/__snapshots__/Avatar.test.js.snap +17 -0
  19. package/build/Avatar/index.js +22 -1
  20. package/build/Avatar/styles.js +2 -6
  21. package/build/Banner/Banner.js +76 -0
  22. package/build/Banner/Banner.test.js +40 -0
  23. package/build/Banner/__snapshots__/Banner.test.js.snap +33 -0
  24. package/build/Banner/index.js +18 -0
  25. package/build/Banner/styles.js +41 -0
  26. package/build/Button/Button.js +123 -62
  27. package/build/Button/Button.test.js +67 -18
  28. package/build/Button/Loading.js +89 -0
  29. package/build/Button/__snapshots__/Button.test.js.snap +334 -0
  30. package/build/Button/index.js +22 -1
  31. package/build/Button/styles.js +176 -160
  32. package/build/ButtonAlign/ButtonAlign.js +20 -16
  33. package/build/ButtonAlign/ButtonAlign.test.js +3 -3
  34. package/build/ButtonAlign/__snapshots__/ButtonAlign.test.js.snap +19 -0
  35. package/build/Card/Card.js +4 -5
  36. package/build/Card/Card.test.js +40 -35
  37. package/build/Card/__snapshots__/Card.test.js.snap +46 -0
  38. package/build/Card/index.js +22 -1
  39. package/build/Card/styles.js +2 -4
  40. package/build/Check/Check.js +18 -14
  41. package/build/Check/Check.test.js +7 -7
  42. package/build/Check/__snapshots__/Check.test.js.snap +92 -0
  43. package/build/Check/styles.js +2 -2
  44. package/build/Checkbox/Checkbox.js +106 -60
  45. package/build/Checkbox/Checkbox.test.js +58 -42
  46. package/build/Checkbox/__snapshots__/Checkbox.test.js.snap +92 -0
  47. package/build/Checkbox/index.js +4 -2
  48. package/build/Checkbox/styles.js +2 -5
  49. package/build/Column/Column.js +1 -1
  50. package/build/Column/Column.test.js +3 -3
  51. package/build/Column/__snapshots__/Column.test.js.snap +647 -0
  52. package/build/Container/Container.js +1 -1
  53. package/build/Container/Container.test.js +4 -4
  54. package/build/Container/__snapshots__/Container.test.js.snap +43 -0
  55. package/build/Droplist/Droplist.js +474 -227
  56. package/build/Droplist/Droplist.test.js +111 -87
  57. package/build/Droplist/__snapshots__/Droplist.test.js.snap +65 -0
  58. package/build/Droplist/functions.js +9 -2
  59. package/build/Droplist/index.js +22 -1
  60. package/build/Droplist/styles.js +41 -15
  61. package/build/Flexbox/Flexbox.js +64 -29
  62. package/build/Flexbox/Flexbox.test.js +32 -14
  63. package/build/Flexbox/__snapshots__/Flexbox.test.js.snap +106 -0
  64. package/build/Flexbox/index.js +22 -1
  65. package/build/Flexbox/styles.js +2 -6
  66. package/build/Footer/Footer.js +42 -30
  67. package/build/Footer/Footer.test.js +2 -2
  68. package/build/Footer/List/List.js +32 -25
  69. package/build/Footer/__snapshots__/Footer.test.js.snap +90 -0
  70. package/build/Footer/styles.js +5 -0
  71. package/build/Grid/Col/Col.js +15 -22
  72. package/build/Grid/Col/Col.test.js +33 -13
  73. package/build/Grid/Col/__snapshots__/Col.test.js.snap +963 -0
  74. package/build/Grid/Col/index.js +22 -1
  75. package/build/Grid/Col/styles.js +97 -116
  76. package/build/Grid/Grid.js +18 -12
  77. package/build/Grid/Row/Row.js +1 -1
  78. package/build/Grid/Row/Row.test.js +2 -2
  79. package/build/Grid/Row/__snapshots__/Row.test.js.snap +22 -0
  80. package/build/Grid/Row/index.js +4 -2
  81. package/build/Grid/index.js +4 -2
  82. package/build/Header/Header.js +35 -31
  83. package/build/Header/Header.test.js +8 -8
  84. package/build/Header/Menu/Menu.js +23 -19
  85. package/build/Header/Menu/Menu.test.js +7 -7
  86. package/build/Header/Menu/__snapshots__/Menu.test.js.snap +113 -0
  87. package/build/Header/Nav/Nav.js +19 -15
  88. package/build/Header/Nav/Nav.test.js +5 -5
  89. package/build/Header/Nav/__snapshots__/Nav.test.js.snap +101 -0
  90. package/build/Header/__snapshots__/Header.test.js.snap +79 -0
  91. package/build/Hidden/Hidden.js +17 -13
  92. package/build/Hidden/Hidden.test.js +6 -6
  93. package/build/Hidden/__snapshots__/Hidden.test.js.snap +3 -0
  94. package/build/Hidden/index.js +4 -2
  95. package/build/Icon/Icon.js +65 -21
  96. package/build/Icon/Icon.test.js +47 -56
  97. package/build/Icon/__snapshots__/Icon.test.js.snap +26 -0
  98. package/build/Icon/index.js +22 -1
  99. package/build/Icon/styles.js +2 -5
  100. package/build/Input/Input.js +29 -25
  101. package/build/Input/Input.test.js +21 -21
  102. package/build/Input/__snapshots__/Input.test.js.snap +194 -0
  103. package/build/Input/index.js +17 -13
  104. package/build/Label/Label.js +17 -13
  105. package/build/Label/Label.test.js +6 -6
  106. package/build/Label/__snapshots__/Label.test.js.snap +82 -0
  107. package/build/LayerApp/LayerApp.js +22 -18
  108. package/build/LayerApp/LayerApp.test.js +4 -4
  109. package/build/LayerApp/__snapshots__/LayerApp.test.js.snap +37 -0
  110. package/build/Modal/Modal.js +55 -37
  111. package/build/Modal/Modal.test.js +10 -10
  112. package/build/Modal/__snapshots__/Modal.test.js.snap +208 -0
  113. package/build/Modal/index.js +19 -13
  114. package/build/Modal/styles.js +43 -31
  115. package/build/NavAside/NavAside.js +22 -18
  116. package/build/NavAside/NavAside.test.js +12 -12
  117. package/build/NavAside/__snapshots__/NavAside.test.js.snap +116 -0
  118. package/build/NavAside/index.js +16 -12
  119. package/build/NavIcon/NavIcon.js +31 -19
  120. package/build/NavItem/NavItem.js +29 -16
  121. package/build/NavTab/NavTab.js +36 -29
  122. package/build/NavTop/NavTop.js +20 -16
  123. package/build/OrderBy/OrderBy.js +23 -19
  124. package/build/OrderBy/OrderBy.test.js +6 -6
  125. package/build/OrderBy/__snapshots__/OrderBy.test.js.snap +54 -0
  126. package/build/Pager/Break/Break.js +1 -1
  127. package/build/Pager/Break/Break.test.js +4 -4
  128. package/build/Pager/Break/__snapshots__/Break.test.js.snap +13 -0
  129. package/build/Pager/Page/Page.js +1 -1
  130. package/build/Pager/Page/Page.test.js +5 -5
  131. package/build/Pager/Page/__snapshots__/Page.test.js.snap +27 -0
  132. package/build/Pager/Pager.js +21 -17
  133. package/build/Pager/Pager.test.js +12 -12
  134. package/build/Pager/__snapshots__/Pager.test.js.snap +50 -0
  135. package/build/Pager/styles.js +1 -1
  136. package/build/Pill/Choice/Choice.js +23 -18
  137. package/build/Pill/Choice/styles.js +8 -3
  138. package/build/Pill/Group/Group.js +7 -4
  139. package/build/Pill/Group/styles.js +7 -4
  140. package/build/Pill/Pill.js +36 -23
  141. package/build/Pill/Pill.test.js +12 -12
  142. package/build/Pill/Stack/Stack.js +10 -7
  143. package/build/Pill/Stack/styles.js +4 -1
  144. package/build/Pill/__snapshots__/Pill.test.js.snap +62 -0
  145. package/build/Pill/styles.js +6 -2
  146. package/build/Placeholder/Placeholder.js +2 -2
  147. package/build/Placeholder/Placeholder.test.js +3 -3
  148. package/build/Placeholder/__snapshots__/Placeholder.test.js.snap +130 -0
  149. package/build/Placeholder/styles.js +23 -16
  150. package/build/Radio/Radio.js +29 -15
  151. package/build/Radio/Radio.test.js +6 -6
  152. package/build/Radio/__snapshots__/Radio.test.js.snap +83 -0
  153. package/build/RangeCounter/RangeCounter.js +17 -13
  154. package/build/RangeCounter/RangeCounter.test.js +3 -3
  155. package/build/RangeCounter/__snapshots__/RangeCounter.test.js.snap +20 -0
  156. package/build/RangeCounter/styles.js +1 -1
  157. package/build/Row/Row.js +1 -1
  158. package/build/Row/Row.test.js +2 -2
  159. package/build/Row/__snapshots__/Row.test.js.snap +22 -0
  160. package/build/SightLogo/SightLogo.js +2 -2
  161. package/build/SightLogo/SightLogo.test.js +2 -2
  162. package/build/SightLogo/__snapshots__/SightLogo.test.js.snap +24 -0
  163. package/build/SlideDown/SlideDown.js +37 -26
  164. package/build/SlideDown/SlideDown.test.js +9 -9
  165. package/build/SlideDown/__snapshots__/SlideDown.test.js.snap +42 -0
  166. package/build/SlideToggle/SlideToggle.js +31 -17
  167. package/build/SlideToggle/SlideToggle.test.js +7 -7
  168. package/build/SlideToggle/__snapshots__/SlideToggle.test.js.snap +62 -0
  169. package/build/SubHeader/SubHeader.js +20 -16
  170. package/build/SubHeader/SubHeader.test.js +7 -7
  171. package/build/SubHeader/__snapshots__/SubHeader.test.js.snap +50 -0
  172. package/build/SwitchGroup/SwitchGroup.js +17 -13
  173. package/build/SwitchGroup/SwitchGroup.test.js +6 -6
  174. package/build/SwitchGroup/__snapshots__/SwitchGroup.test.js.snap +52 -0
  175. package/build/SwitchGroup/styles.js +1 -1
  176. package/build/Tag/Tag.js +27 -10
  177. package/build/Tag/Tag.test.js +8 -8
  178. package/build/Tag/__snapshots__/Tag.test.js.snap +137 -0
  179. package/build/Tag/styles.js +72 -27
  180. package/build/Text/Text.js +30 -15
  181. package/build/Text/Text.test.js +8 -8
  182. package/build/Text/__snapshots__/Text.test.js.snap +158 -0
  183. package/build/Text/styles.js +32 -23
  184. package/build/TextField/TextField.js +455 -302
  185. package/build/TextField/TextField.test.js +138 -146
  186. package/build/TextField/__snapshots__/TextField.test.js.snap +258 -0
  187. package/build/TextField/index.js +6 -1
  188. package/build/TextField/styles.js +99 -33
  189. package/build/Tip/Tip.js +91 -27
  190. package/build/Tip/Tip.test.js +5 -5
  191. package/build/Tip/__snapshots__/Tip.test.js.snap +49 -0
  192. package/build/Tip/styles.js +32 -12
  193. package/build/Title/Title.js +16 -12
  194. package/build/Title/Title.test.js +3 -3
  195. package/build/Title/__snapshots__/Title.test.js.snap +31 -0
  196. package/build/Toaster/Toast/Toast.js +11 -11
  197. package/build/Toaster/Toaster.js +27 -23
  198. package/build/Toaster/Toaster.test.js +6 -6
  199. package/build/Toaster/__snapshots__/Toaster.test.js.snap +5 -0
  200. package/build/Tooltip/Tooltip.js +210 -0
  201. package/build/Tooltip/Tooltip.test.js +35 -0
  202. package/build/Tooltip/__snapshots__/Tooltip.test.js.snap +33 -0
  203. package/build/Tooltip/hooks.js +132 -0
  204. package/build/Tooltip/index.js +18 -0
  205. package/build/Tooltip/styles.js +44 -0
  206. package/build/TourTip/TourTip.js +15 -11
  207. package/build/TourTip/TourTip.test.js +2 -2
  208. package/build/TourTip/__snapshots__/TourTip.test.js.snap +74 -0
  209. package/build/Visible/Visible.js +16 -12
  210. package/build/Visible/Visible.test.js +4 -4
  211. package/build/Visible/__snapshots__/Visible.test.js.snap +3 -0
  212. package/build/WindowSize/WindowSize.js +17 -11
  213. package/build/WindowSize/WindowSize.test.js +4 -4
  214. package/build/WindowSize/__snapshots__/WindowSize.test.js.snap +3 -0
  215. package/build/index.js +79 -8
  216. package/build/plugin/babel.js +59 -0
  217. package/build/subatomic/colors.js +8 -3
  218. package/build/subatomic/fonts.js +1 -1
  219. package/build/subatomic/icons/attachment.js +23 -0
  220. package/build/subatomic/icons/attachmentSolid.js +23 -0
  221. package/build/subatomic/icons/avatarSmile.js +23 -0
  222. package/build/subatomic/icons/book.js +23 -0
  223. package/build/subatomic/icons/cash.js +23 -0
  224. package/build/subatomic/icons/copy.js +23 -0
  225. package/build/subatomic/icons/copySolid.js +23 -0
  226. package/build/subatomic/icons/crossSolid.js +23 -0
  227. package/build/subatomic/icons/dislike.js +1 -1
  228. package/build/subatomic/icons/dislikeSolid.js +23 -0
  229. package/build/subatomic/icons/energy.js +23 -0
  230. package/build/subatomic/icons/energySolid.js +23 -0
  231. package/build/subatomic/icons/eye.js +1 -1
  232. package/build/subatomic/icons/eyeClosed.js +1 -1
  233. package/build/subatomic/icons/eyeClosedSolid.js +23 -0
  234. package/build/subatomic/icons/eyeSolid.js +23 -0
  235. package/build/subatomic/icons/hourGlass.js +23 -0
  236. package/build/subatomic/icons/like.js +1 -1
  237. package/build/subatomic/icons/likeSolid.js +23 -0
  238. package/build/subatomic/icons/location.js +23 -0
  239. package/build/subatomic/icons/locationSolid.js +23 -0
  240. package/build/subatomic/icons/matchJob.js +23 -0
  241. package/build/subatomic/icons/messages.js +1 -1
  242. package/build/subatomic/icons/messagesSolid.js +1 -1
  243. package/build/subatomic/icons/moreOptionsHorizontal.js +23 -0
  244. package/build/subatomic/icons/noMessages.js +23 -0
  245. package/build/subatomic/icons/noMessagesSolid.js +23 -0
  246. package/build/subatomic/icons/occDart.js +23 -8
  247. package/build/subatomic/icons/occHorizontal.js +23 -8
  248. package/build/subatomic/icons/occLogo.js +63 -0
  249. package/build/subatomic/icons/occVertical.js +23 -8
  250. package/build/subatomic/icons/profile.js +23 -0
  251. package/build/subatomic/icons/profileSolid.js +23 -0
  252. package/build/subatomic/icons/profileView.js +23 -0
  253. package/build/subatomic/icons/refresh.js +23 -0
  254. package/build/subatomic/icons/refreshSolid.js +23 -0
  255. package/build/subatomic/icons/sendMessage.js +23 -0
  256. package/build/subatomic/icons/sendMessageSolid.js +23 -0
  257. package/build/subatomic/icons/starsSolid.js +23 -0
  258. package/build/subatomic/icons/suitcase.js +23 -0
  259. package/build/subatomic/icons/suitcaseSolid.js +23 -0
  260. package/build/subatomic/icons/tag.js +1 -1
  261. package/build/subatomic/icons/tagSolid.js +23 -0
  262. package/build/subatomic/icons/trash.js +1 -1
  263. package/build/subatomic/icons/trashSolid.js +1 -1
  264. package/build/subatomic/icons/warning.js +23 -0
  265. package/build/subatomic/icons/warningSolid.js +23 -0
  266. package/build/subatomic/icons/webSite.js +23 -0
  267. package/build/subatomic/icons/webSiteSolid.js +23 -0
  268. package/build/subatomic/icons.js +230 -112
  269. package/build/tokens/borderRadius.json +8 -0
  270. package/build/tokens/colors.json +567 -0
  271. package/build/tokens/fonts.json +231 -0
  272. package/build/tokens/index.js +47 -0
  273. package/build/tokens/shadows.json +13 -0
  274. package/build/tokens/spacing.json +16 -0
  275. package/commitlint.config.js +6 -0
  276. package/package.json +124 -113
  277. package/playroom/FrameComponent.js +31 -0
  278. package/playroom/styles.js +14 -0
  279. package/playroom.config.js +7 -7
  280. package/build/Grid/Grid.test.js +0 -22
  281. package/build/Grid/Row/Rowdsd.js +0 -39
  282. package/build/hooks/useEventListener.js +0 -23
  283. package/build/hooks/usePrevious.js +0 -19
  284. package/yarn-error.log +0 -10737
@@ -0,0 +1,50 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Pager matches the snapshot 1`] = `ShallowWrapper {}`;
4
+
5
+ exports[`Pager styles matches the snapshot 1`] = `
6
+ Object {
7
+ "btn": Object {
8
+ "& span": Object {
9
+ "marginBottom": "-2px",
10
+ },
11
+ "&:hover": Object {
12
+ "background": "#ECECEE",
13
+ "borderColor": "#ECECEE",
14
+ },
15
+ "border": "1px solid #bfbfbf",
16
+ "borderRadius": "5px",
17
+ "cursor": "pointer",
18
+ "display": "inline-block",
19
+ "fontFamily": "'OccText', sans-serif",
20
+ "outline": "0",
21
+ "padding": "3px 13px",
22
+ "transition": "0.3s all",
23
+ },
24
+ "disabled": Object {
25
+ "opacity": "0.4",
26
+ "pointerEvents": "none",
27
+ },
28
+ "next": Object {
29
+ "& span": Object {
30
+ "transform": "rotate(-90deg)",
31
+ },
32
+ "marginLeft": "15px",
33
+ },
34
+ "pager": Object {
35
+ "color": "#727272",
36
+ "fontFamily": "'OccText', sans-serif",
37
+ "fontSize": "14px",
38
+ "listStyle": "none",
39
+ "paddingLeft": "0",
40
+ },
41
+ "prev": Object {
42
+ "& span": Object {
43
+ "transform": "rotate(90deg)",
44
+ },
45
+ "marginRight": "15px",
46
+ },
47
+ }
48
+ `;
49
+
50
+ exports[`PagerJSS matches the snapshot 1`] = `ShallowWrapper {}`;
@@ -17,7 +17,7 @@ var _default = {
17
17
  paddingLeft: '0',
18
18
  fontFamily: _fonts["default"].body,
19
19
  color: _colors["default"].grey7,
20
- fontSize: '13px'
20
+ fontSize: '14px'
21
21
  },
22
22
  btn: {
23
23
  display: 'inline-block',
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -19,35 +21,37 @@ var _iconSizes = _interopRequireDefault(require("../../subatomic/iconSizes"));
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
23
-
24
24
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
25
 
26
26
  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, descriptor.key, descriptor); } }
27
27
 
28
28
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
29
29
 
30
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
30
+ 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
+
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
33
 
32
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
34
+ 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); }; }
35
+
36
+ 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); }
33
37
 
34
38
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
39
 
36
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
40
+ 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; } }
37
41
 
38
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
42
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
43
 
40
- var Choice =
41
- /*#__PURE__*/
42
- function (_React$Component) {
44
+ var Choice = /*#__PURE__*/function (_React$Component) {
43
45
  _inherits(Choice, _React$Component);
44
46
 
47
+ var _super = _createSuper(Choice);
48
+
45
49
  function Choice(props) {
46
50
  var _this;
47
51
 
48
52
  _classCallCheck(this, Choice);
49
53
 
50
- _this = _possibleConstructorReturn(this, _getPrototypeOf(Choice).call(this, props));
54
+ _this = _super.call(this, props);
51
55
  _this.handleOnClick = _this.handleOnClick.bind(_assertThisInitialized(_this));
52
56
  return _this;
53
57
  }
@@ -69,27 +73,27 @@ function (_React$Component) {
69
73
  selected = _this$props2.selected,
70
74
  disabled = _this$props2.disabled,
71
75
  idPrefix = _this$props2.idPrefix,
76
+ testId = _this$props2.testId,
72
77
  leftIcon = _this$props2.leftIcon,
73
78
  rightIcon = _this$props2.rightIcon,
74
79
  id = _this$props2.id;
75
80
  var iconColor = disabled ? _colors["default"].grey200 : selected ? _colors["default"].prim : _colors["default"].grey900;
76
- return _react["default"].createElement("button", {
81
+ return /*#__PURE__*/_react["default"].createElement("button", {
77
82
  className: "".concat(classes.pill).concat(selected ? " ".concat(classes.selected) : disabled ? " ".concat(classes.disabled) : ''),
78
83
  onClick: this.handleOnClick,
79
- id: idPrefix ? "".concat(idPrefix).concat(id) : null
80
- }, leftIcon && _react["default"].createElement(_Icon["default"], {
81
- className: classes.icon,
84
+ id: idPrefix ? "".concat(idPrefix).concat(id) : null,
85
+ "data-testid": testId ? "".concat(testId).concat(id) : null
86
+ }, leftIcon && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
82
87
  iconName: leftIcon,
83
88
  colors: [iconColor],
84
89
  width: _iconSizes["default"].small,
85
90
  height: _iconSizes["default"].small
86
- }), children && _react["default"].createElement(_Text["default"], {
91
+ }), children && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
87
92
  tag: "span",
88
93
  className: classes.text,
89
94
  primary: selected,
90
95
  disabled: disabled
91
- }, children), rightIcon && _react["default"].createElement(_Icon["default"], {
92
- className: classes.icon,
96
+ }, children), rightIcon && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
93
97
  iconName: rightIcon,
94
98
  colors: [iconColor],
95
99
  width: _iconSizes["default"].small,
@@ -110,7 +114,8 @@ Choice.propTypes = {
110
114
  disabled: _propTypes["default"].bool,
111
115
  leftIcon: _propTypes["default"].string,
112
116
  rightIcon: _propTypes["default"].string,
113
- idPrefix: _propTypes["default"].string
117
+ idPrefix: _propTypes["default"].string,
118
+ testId: _propTypes["default"].string
114
119
  };
115
120
  var _default = Choice;
116
121
  exports["default"] = _default;
@@ -24,6 +24,10 @@ var _default = {
24
24
  transition: '0.3s all',
25
25
  cursor: 'pointer',
26
26
  borderRadius: _spacing["default"].small,
27
+ maxWidth: '100%',
28
+ display: 'inline-flex',
29
+ alignItems: 'center',
30
+ minWidth: 'auto',
27
31
  '&:not(:last-child)': {
28
32
  marginRight: _spacing["default"].tiny
29
33
  },
@@ -44,11 +48,12 @@ var _default = {
44
48
  pointerEvents: 'none'
45
49
  },
46
50
  text: {
51
+ flex: 1,
52
+ overflow: 'hidden',
53
+ textOverflow: 'ellipsis',
54
+ whiteSpace: 'nowrap',
47
55
  marginLeft: _spacing["default"].xTiny,
48
56
  marginRight: _spacing["default"].xTiny
49
- },
50
- icon: {
51
- marginBottom: -_spacing["default"].xTiny
52
57
  }
53
58
  };
54
59
  exports["default"] = _default;
@@ -16,13 +16,15 @@ var Group = function Group(_ref) {
16
16
  items = _ref.items,
17
17
  selected = _ref.selected,
18
18
  onSelect = _ref.onSelect,
19
- idPrefix = _ref.idPrefix;
20
- return _react["default"].createElement("div", {
19
+ idPrefix = _ref.idPrefix,
20
+ testId = _ref.testId;
21
+ return /*#__PURE__*/_react["default"].createElement("div", {
21
22
  className: classes.pillGroup
22
23
  }, items.map(function (item, index) {
23
- return _react["default"].createElement("button", {
24
+ return /*#__PURE__*/_react["default"].createElement("button", {
24
25
  key: item.id,
25
26
  id: idPrefix ? "".concat(idPrefix).concat(item.id) : null,
27
+ "data-testid": testId ? "".concat(testId).concat(index) : null,
26
28
  className: "".concat(classes.pill).concat(selected == item.id ? " ".concat(classes.selected) : item.disabled ? " ".concat(classes.disabled) : ''),
27
29
  onClick: selected != item.id ? function () {
28
30
  onSelect(item.id, index);
@@ -36,7 +38,8 @@ Group.propTypes = {
36
38
  items: _propTypes["default"].array,
37
39
  onSelect: _propTypes["default"].func,
38
40
  selected: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
39
- idPrefix: _propTypes["default"].string
41
+ idPrefix: _propTypes["default"].string,
42
+ testId: _propTypes["default"].string
40
43
  };
41
44
  var _default = Group;
42
45
  exports["default"] = _default;
@@ -22,15 +22,18 @@ var _default = {
22
22
  border: "1px solid ".concat(_colors["default"].grey200),
23
23
  color: _colors["default"].ink,
24
24
  fontFamily: _fonts["default"].body,
25
- fontSize: 14,
25
+ fontSize: 15,
26
26
  fontWeight: 400,
27
- lineHeight: '24px',
28
- height: 32,
29
- padding: 0,
27
+ lineHeight: "".concat(_spacing["default"].base, "px"),
28
+ height: _spacing["default"].medium,
29
+ padding: [0, _spacing["default"].small],
30
30
  position: 'relative',
31
31
  zIndex: 1,
32
32
  outline: 0,
33
33
  flex: 1,
34
+ overflow: 'hidden',
35
+ textOverflow: 'ellipsis',
36
+ whiteSpace: 'nowrap',
34
37
  transition: '0.3s all',
35
38
  cursor: 'pointer',
36
39
  '&:first-child': {
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -19,9 +21,9 @@ var _Choice = _interopRequireDefault(require("./Choice"));
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
25
 
24
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
27
 
26
28
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
29
 
@@ -29,30 +31,34 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
29
31
 
30
32
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
31
33
 
32
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
34
+ 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
33
35
 
34
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
36
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
37
+
38
+ 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); }; }
39
+
40
+ 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); }
35
41
 
36
42
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
37
43
 
38
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
44
+ 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; } }
39
45
 
40
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
46
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
47
 
42
48
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
43
49
 
44
50
  /** Group of buttons to toggle. */
45
- var Pill =
46
- /*#__PURE__*/
47
- function (_Component) {
51
+ var Pill = /*#__PURE__*/function (_Component) {
48
52
  _inherits(Pill, _Component);
49
53
 
54
+ var _super = _createSuper(Pill);
55
+
50
56
  function Pill(props) {
51
57
  var _this;
52
58
 
53
59
  _classCallCheck(this, Pill);
54
60
 
55
- _this = _possibleConstructorReturn(this, _getPrototypeOf(Pill).call(this, props));
61
+ _this = _super.call(this, props);
56
62
  _this.state = {
57
63
  status: 'default',
58
64
  touched: false,
@@ -128,6 +134,7 @@ function (_Component) {
128
134
  disabled = _this$props.disabled,
129
135
  lockHeight = _this$props.lockHeight,
130
136
  idPrefix = _this$props.idPrefix,
137
+ testId = _this$props.testId,
131
138
  onClick = _this$props.onClick,
132
139
  onClose = _this$props.onClose,
133
140
  id = _this$props.id,
@@ -136,49 +143,52 @@ function (_Component) {
136
143
  var realStatus = status;
137
144
  var errorStatus = error && (touched || allowError);
138
145
  if (disabled) realStatus = 'disabled';else if (errorStatus) realStatus = 'error';
139
- return _react["default"].createElement("div", {
146
+ return /*#__PURE__*/_react["default"].createElement("div", {
140
147
  className: "".concat(classes.container).concat(realStatus == 'disabled' ? " ".concat(classes.disabled) : '').concat(className ? " ".concat(className) : ''),
141
148
  id: id,
142
149
  style: style
143
- }, (label || lockHeight) && _react["default"].createElement("div", {
150
+ }, (label || lockHeight) && /*#__PURE__*/_react["default"].createElement("div", {
144
151
  className: classes.top
145
- }, label && _react["default"].createElement("label", {
152
+ }, label && /*#__PURE__*/_react["default"].createElement("label", {
146
153
  className: "".concat(classes.label, " ").concat(classes.left)
147
- }, label)), group ? _react["default"].createElement(_Group["default"], {
154
+ }, label)), group ? /*#__PURE__*/_react["default"].createElement(_Group["default"], {
148
155
  items: group,
149
156
  onSelect: this.handleGroupOnSelect,
150
157
  selected: selected,
151
- idPrefix: idPrefix
152
- }) : stack ? _react["default"].createElement("div", {
158
+ idPrefix: idPrefix,
159
+ testId: testId
160
+ }) : stack ? /*#__PURE__*/_react["default"].createElement("div", {
153
161
  className: classes.stackGroup
154
162
  }, stack.map(function (pill) {
155
- return _react["default"].createElement(_Stack["default"], {
163
+ return /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
156
164
  key: pill.id,
157
165
  idPrefix: idPrefix,
158
166
  id: pill.id,
167
+ testId: testId,
159
168
  disabled: pill.disabled,
160
169
  onClick: onClick ? _this2.handleStackItemOnClick : null,
161
170
  onClose: onClose ? _this2.handleStackItemOnClose : null
162
171
  }, pill.label);
163
- })) : choice ? _react["default"].createElement("div", {
172
+ })) : choice ? /*#__PURE__*/_react["default"].createElement("div", {
164
173
  className: classes.choiceGroup
165
174
  }, choice.map(function (pill) {
166
- return _react["default"].createElement(_Choice["default"], {
175
+ return /*#__PURE__*/_react["default"].createElement(_Choice["default"], {
167
176
  key: pill.id,
168
177
  idPrefix: idPrefix,
169
178
  id: pill.id,
179
+ testId: testId,
170
180
  disabled: pill.disabled,
171
181
  selected: pill.selected,
172
182
  onClick: _this2.handleChoiceOnSelect,
173
183
  leftIcon: pill.leftIcon,
174
184
  rightIcon: pill.rightIcon
175
185
  }, pill.label);
176
- })) : null, (assistiveText || lockHeight) && _react["default"].createElement("div", {
186
+ })) : null, (assistiveText || lockHeight) && /*#__PURE__*/_react["default"].createElement("div", {
177
187
  className: classes.bottom
178
- }, assistiveText && _react["default"].createElement("label", {
188
+ }, assistiveText && /*#__PURE__*/_react["default"].createElement("label", {
179
189
  className: "".concat(classes.label, " ").concat(classes.left, " ").concat(realStatus == 'error' ? classes.errorAssistiveText : classes.assistiveText)
180
- }, realStatus == 'error' ? _react["default"].createElement(_Icon["default"], {
181
- iconName: "warning",
190
+ }, realStatus == 'error' ? /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
191
+ iconName: "warningSolid",
182
192
  width: 14,
183
193
  height: 14,
184
194
  className: classes.errorIcon
@@ -254,6 +264,9 @@ Pill.propTypes = {
254
264
 
255
265
  /** Prefix for the id of every pill. If you don't specify a prefix they will not have an id. */
256
266
  idPrefix: _propTypes["default"].string,
267
+
268
+ /** Data test id used for automated testing. */
269
+ testId: _propTypes["default"].string,
257
270
  id: _propTypes["default"].string,
258
271
  className: _propTypes["default"].string,
259
272
  style: _propTypes["default"].object
@@ -35,21 +35,21 @@ var pills = [{
35
35
  describe("Pill", function () {
36
36
  // Group tests
37
37
  it('matches the group snapshot', function () {
38
- var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Pill["default"], {
38
+ var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
39
39
  group: pills,
40
40
  classes: classes
41
41
  }));
42
42
  expect(wrapper).toMatchSnapshot();
43
43
  });
44
44
  it('shows four buttons', function () {
45
- var wrapper = (0, _enzyme.mount)(_react["default"].createElement(_Pill["default"], {
45
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
46
46
  group: pills,
47
47
  classes: classes
48
48
  }));
49
49
  expect(wrapper.find('button').length).toBe(4);
50
50
  });
51
51
  it('selects the right options', function () {
52
- var wrapper = (0, _enzyme.mount)(_react["default"].createElement(_Pill["default"], {
52
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
53
53
  group: pills,
54
54
  classes: classes
55
55
  }));
@@ -59,7 +59,7 @@ describe("Pill", function () {
59
59
  });
60
60
  it('calls the onChange function', function () {
61
61
  var onChange = jest.fn();
62
- var wrapper = (0, _enzyme.mount)(_react["default"].createElement(_Pill["default"], {
62
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
63
63
  group: pills,
64
64
  onChange: onChange,
65
65
  classes: classes
@@ -69,14 +69,14 @@ describe("Pill", function () {
69
69
  }); // Stack tests
70
70
 
71
71
  it('matches the stack snapshot', function () {
72
- var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Pill["default"], {
72
+ var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
73
73
  stack: pills,
74
74
  classes: classes
75
75
  }));
76
76
  expect(wrapper).toMatchSnapshot();
77
77
  });
78
78
  it('shows four buttons', function () {
79
- var wrapper = (0, _enzyme.mount)(_react["default"].createElement(_Pill["default"], {
79
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
80
80
  stack: pills,
81
81
  classes: classes
82
82
  }));
@@ -84,7 +84,7 @@ describe("Pill", function () {
84
84
  });
85
85
  it('calls the onClick function', function () {
86
86
  var onClick = jest.fn();
87
- var wrapper = (0, _enzyme.mount)(_react["default"].createElement(_Pill["default"], {
87
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
88
88
  stack: pills,
89
89
  onClick: onClick,
90
90
  classes: classes
@@ -94,7 +94,7 @@ describe("Pill", function () {
94
94
  });
95
95
  it('calls the onClose function', function () {
96
96
  var onClose = jest.fn();
97
- var wrapper = (0, _enzyme.mount)(_react["default"].createElement(_Pill["default"], {
97
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
98
98
  stack: pills,
99
99
  onClose: onClose,
100
100
  classes: classes
@@ -104,14 +104,14 @@ describe("Pill", function () {
104
104
  }); // Choice tests
105
105
 
106
106
  it('matches the choice snapshot', function () {
107
- var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Pill["default"], {
107
+ var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
108
108
  choice: pills,
109
109
  classes: classes
110
110
  }));
111
111
  expect(wrapper).toMatchSnapshot();
112
112
  });
113
113
  it('shows four buttons', function () {
114
- var wrapper = (0, _enzyme.mount)(_react["default"].createElement(_Pill["default"], {
114
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
115
115
  choice: pills,
116
116
  classes: classes
117
117
  }));
@@ -119,7 +119,7 @@ describe("Pill", function () {
119
119
  });
120
120
  it('calls the onChange function', function () {
121
121
  var onChange = jest.fn();
122
- var wrapper = (0, _enzyme.mount)(_react["default"].createElement(_Pill["default"], {
122
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Pill["default"], {
123
123
  choice: pills,
124
124
  onChange: onChange,
125
125
  classes: classes
@@ -130,7 +130,7 @@ describe("Pill", function () {
130
130
  });
131
131
  describe("PillJSS", function () {
132
132
  it('matches the snapshot', function () {
133
- var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_index["default"], {
133
+ var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
134
134
  group: pills
135
135
  }));
136
136
  expect(wrapper).toMatchSnapshot();
@@ -35,23 +35,25 @@ var Stack = function Stack(_ref) {
35
35
  disabled = _ref.disabled,
36
36
  _onClick = _ref.onClick,
37
37
  onClose = _ref.onClose,
38
- idPrefix = _ref.idPrefix;
39
- return _react["default"].createElement("button", {
38
+ idPrefix = _ref.idPrefix,
39
+ testId = _ref.testId;
40
+ return /*#__PURE__*/_react["default"].createElement("button", {
40
41
  className: "".concat(classes.pill).concat(disabled ? " ".concat(classes.disabled) : ''),
41
42
  onClick: function onClick() {
42
43
  handleOnClick(id, _onClick);
43
44
  },
44
- id: idPrefix ? "".concat(idPrefix).concat(id) : null
45
- }, children && _react["default"].createElement(_Text["default"], {
45
+ id: idPrefix ? "".concat(idPrefix).concat(id) : null,
46
+ "data-testid": testId ? "".concat(testId).concat(id) : null
47
+ }, children && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
46
48
  className: classes.text,
47
49
  tag: "span",
48
50
  disabled: disabled
49
- }, children), onClose && _react["default"].createElement("span", {
51
+ }, children), onClose && /*#__PURE__*/_react["default"].createElement("span", {
50
52
  className: classes.closeCont,
51
53
  onClick: function onClick(e) {
52
54
  return handleOnClose(e, id, onClose);
53
55
  }
54
- }, _react["default"].createElement(_Icon["default"], {
56
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
55
57
  className: classes.close,
56
58
  iconName: "cross",
57
59
  colors: [_colors["default"].grey300],
@@ -67,7 +69,8 @@ Stack.propTypes = {
67
69
  disabled: _propTypes["default"].bool,
68
70
  onClick: _propTypes["default"].func,
69
71
  onClose: _propTypes["default"].func,
70
- idPrefix: _propTypes["default"].string
72
+ idPrefix: _propTypes["default"].string,
73
+ testId: _propTypes["default"].string
71
74
  };
72
75
  var _default = Stack;
73
76
  exports["default"] = _default;
@@ -24,6 +24,7 @@ var _default = {
24
24
  outline: 0,
25
25
  flex: 1,
26
26
  display: 'inline-flex',
27
+ alignItems: 'center',
27
28
  transition: '0.3s all',
28
29
  cursor: 'pointer',
29
30
  borderRadius: _spacing["default"].small,
@@ -47,7 +48,6 @@ var _default = {
47
48
  pointerEvents: 'none'
48
49
  },
49
50
  closeCont: {
50
- marginBottom: -_spacing["default"].xTiny,
51
51
  width: _spacing["default"].base,
52
52
  height: _spacing["default"].base,
53
53
  display: 'inline-flex',
@@ -57,6 +57,9 @@ var _default = {
57
57
  marginLeft: -_spacing["default"].xTiny
58
58
  },
59
59
  text: {
60
+ overflow: 'hidden',
61
+ textOverflow: 'ellipsis',
62
+ whiteSpace: 'nowrap',
60
63
  marginLeft: _spacing["default"].xTiny,
61
64
  marginRight: _spacing["default"].xTiny
62
65
  }
@@ -0,0 +1,62 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Pill matches the choice snapshot 1`] = `ShallowWrapper {}`;
4
+
5
+ exports[`Pill matches the group snapshot 1`] = `ShallowWrapper {}`;
6
+
7
+ exports[`Pill matches the stack snapshot 1`] = `ShallowWrapper {}`;
8
+
9
+ exports[`Pill styles matches the snapshot 1`] = `
10
+ Object {
11
+ "assistiveText": Object {
12
+ "color": "#aaaaaa",
13
+ },
14
+ "bottom": Object {
15
+ "height": 20,
16
+ "marginTop": 4,
17
+ },
18
+ "choiceGroup": Object {
19
+ "display": "flex",
20
+ "flexWrap": "wrap",
21
+ },
22
+ "container": Object {
23
+ "marginBottom": 8,
24
+ "position": "relative",
25
+ },
26
+ "disabled": Object {
27
+ "& $label": Object {
28
+ "color": "#dddddd",
29
+ },
30
+ },
31
+ "errorAssistiveText": Object {
32
+ "color": "#db3737",
33
+ },
34
+ "errorIcon": Object {
35
+ "marginBottom": -2,
36
+ },
37
+ "label": Object {
38
+ "& a": Object {
39
+ "color": "#1476fb",
40
+ "outline": "none",
41
+ "textDecoration": "none",
42
+ },
43
+ "color": "#222222",
44
+ "fontFamily": "'OccText', sans-serif",
45
+ "fontSize": 14,
46
+ "lineHeight": 1.5,
47
+ "transition": "0.3s all",
48
+ },
49
+ "left": Object {
50
+ "float": "left",
51
+ },
52
+ "top": Object {
53
+ "&:after": Object {
54
+ "clear": "both",
55
+ "content": "\\"\\"",
56
+ },
57
+ "height": 24,
58
+ },
59
+ }
60
+ `;
61
+
62
+ exports[`PillJSS matches the snapshot 1`] = `ShallowWrapper {}`;