@sproutsocial/racine 11.4.1 → 11.6.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 (220) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/__flow__/Button/index.js +2 -0
  3. package/__flow__/Button/index.stories.js +51 -67
  4. package/__flow__/Button/styles.js +1 -1
  5. package/__flow__/Checkbox/styles.js +75 -75
  6. package/__flow__/Collapsible/index.js +2 -3
  7. package/__flow__/EmptyState/index.test.js +1 -1
  8. package/__flow__/Image/index.js +2 -10
  9. package/__flow__/Menu/__snapshots__/index.test.js.snap +2 -2
  10. package/__flow__/SegmentedControl/index.js +2 -3
  11. package/__flow__/TableCell/index.js +2 -9
  12. package/__flow__/ThemeProvider/index.js +6 -2
  13. package/__flow__/ToggleHint/index.js +2 -9
  14. package/__flow__/index.js +5 -0
  15. package/__flow__/setupTests.js +1 -1
  16. package/__flow__/systemProps/color.js +2 -1
  17. package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +0 -14
  18. package/__flow__/systemProps/tests/layout.test.js +0 -9
  19. package/__flow__/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +17 -0
  20. package/__flow__/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +36 -0
  21. package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +23 -0
  22. package/__flow__/themes/extendedThemes/sproutTheme/index.js +4 -0
  23. package/__flow__/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +36 -0
  24. package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +23 -0
  25. package/__flow__/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +36 -0
  26. package/__flow__/types/theme.flow.js +17 -0
  27. package/__flow__/utils/responsiveProps/index.test.js +2 -10
  28. package/commonjs/Avatar/index.js +7 -4
  29. package/commonjs/Badge/index.js +3 -1
  30. package/commonjs/Badge/styles.js +1 -1
  31. package/commonjs/Banner/index.js +3 -1
  32. package/commonjs/Banner/styles.js +1 -1
  33. package/commonjs/Box/styles.js +1 -1
  34. package/commonjs/Breadcrumb/index.js +5 -2
  35. package/commonjs/Button/index.js +4 -1
  36. package/commonjs/Button/styles.js +1 -0
  37. package/commonjs/Card/index.js +3 -1
  38. package/commonjs/Card/styles.js +3 -3
  39. package/commonjs/CharacterCounter/index.js +3 -1
  40. package/commonjs/CharacterCounter/styles.js +1 -1
  41. package/commonjs/ChartLegend/index.js +3 -1
  42. package/commonjs/ChartLegend/styles.js +3 -3
  43. package/commonjs/Checkbox/index.js +3 -1
  44. package/commonjs/Checkbox/styles.js +1 -1
  45. package/commonjs/Collapsible/index.js +5 -2
  46. package/commonjs/DatePicker/DateRangePicker.js +3 -1
  47. package/commonjs/DatePicker/SingleDatePicker.js +3 -1
  48. package/commonjs/DatePicker/StatefulDateRangePicker.js +3 -1
  49. package/commonjs/DatePicker/StatefulSingleDatePicker.js +3 -1
  50. package/commonjs/DatePicker/common.js +1 -1
  51. package/commonjs/DatePicker/styles.js +2 -6
  52. package/commonjs/Drawer/SlideTransition.js +3 -1
  53. package/commonjs/Drawer/index.js +9 -4
  54. package/commonjs/Drawer/styles.js +2 -2
  55. package/commonjs/EmptyState/index.js +3 -1
  56. package/commonjs/Fieldset/index.js +7 -3
  57. package/commonjs/FormField/index.js +3 -1
  58. package/commonjs/Icon/index.js +5 -2
  59. package/commonjs/Icon/styles.js +1 -1
  60. package/commonjs/Image/index.js +3 -1
  61. package/commonjs/Image/styles.js +1 -1
  62. package/commonjs/Indicator/index.js +3 -1
  63. package/commonjs/Input/index.js +3 -1
  64. package/commonjs/Input/styles.js +2 -2
  65. package/commonjs/KeyboardKey/index.js +3 -1
  66. package/commonjs/Label/index.js +4 -2
  67. package/commonjs/Link/index.js +3 -1
  68. package/commonjs/Link/styles.js +1 -1
  69. package/commonjs/Listbox/index.js +7 -4
  70. package/commonjs/Loader/index.js +3 -1
  71. package/commonjs/Loader/styles.js +2 -2
  72. package/commonjs/LoaderButton/index.js +3 -1
  73. package/commonjs/Menu/constants.js +1 -1
  74. package/commonjs/Menu/descendants.js +10 -7
  75. package/commonjs/Menu/hooks.js +1 -1
  76. package/commonjs/Menu/index.js +22 -16
  77. package/commonjs/Menu/styles.js +2 -2
  78. package/commonjs/Message/index.js +3 -1
  79. package/commonjs/Message/styles.js +2 -2
  80. package/commonjs/Modal/index.js +7 -3
  81. package/commonjs/Modal/styles.js +4 -6
  82. package/commonjs/Numeral/constants.js +1 -1
  83. package/commonjs/Numeral/index.js +3 -1
  84. package/commonjs/Numeral/styles.js +3 -3
  85. package/commonjs/OverflowList/styles.js +1 -1
  86. package/commonjs/Popout/index.js +7 -3
  87. package/commonjs/Popout/styles.js +1 -1
  88. package/commonjs/Radio/index.js +3 -1
  89. package/commonjs/Radio/styles.js +4 -4
  90. package/commonjs/SegmentedControl/index.js +5 -2
  91. package/commonjs/Select/index.js +3 -1
  92. package/commonjs/Stack/index.js +3 -1
  93. package/commonjs/Switch/index.js +3 -1
  94. package/commonjs/Switch/styles.js +1 -1
  95. package/commonjs/Table/index.js +10 -5
  96. package/commonjs/TableCell/index.js +3 -1
  97. package/commonjs/TableHeaderCell/index.js +3 -1
  98. package/commonjs/TableRowAccordion/index.js +3 -1
  99. package/commonjs/Tabs/index.js +5 -2
  100. package/commonjs/Tabs/styles.js +4 -4
  101. package/commonjs/Text/index.js +3 -1
  102. package/commonjs/Text/styles.js +1 -1
  103. package/commonjs/Textarea/index.js +3 -1
  104. package/commonjs/Toast/index.js +15 -15
  105. package/commonjs/Toast/styles.js +4 -7
  106. package/commonjs/ToggleHint/index.js +3 -1
  107. package/commonjs/Token/index.js +3 -1
  108. package/commonjs/Token/styles.js +1 -1
  109. package/commonjs/TokenInput/index.js +3 -1
  110. package/commonjs/Tooltip/index.js +5 -2
  111. package/commonjs/Tooltip/styles.js +1 -1
  112. package/commonjs/VisuallyHidden/index.js +1 -1
  113. package/commonjs/index.js +8 -1
  114. package/commonjs/themes/dark/decorative-palettes.js +1 -1
  115. package/commonjs/themes/dark/theme.js +1 -1
  116. package/commonjs/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +16 -0
  117. package/commonjs/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +39 -0
  118. package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +28 -0
  119. package/commonjs/themes/extendedThemes/sproutTheme/index.js +14 -0
  120. package/commonjs/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +39 -0
  121. package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +28 -0
  122. package/commonjs/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +1 -0
  123. package/commonjs/themes/light/decorative-palettes.js +1 -1
  124. package/commonjs/themes/light/theme.js +1 -1
  125. package/commonjs/utils/hooks.js +3 -2
  126. package/commonjs/utils/mixins.js +1 -1
  127. package/commonjs/utils/system-props.js +1 -1
  128. package/dist/themes/dark/dark.scss +5 -5
  129. package/dist/themes/light/light.scss +95 -95
  130. package/lib/Avatar/index.js +7 -4
  131. package/lib/Badge/index.js +3 -1
  132. package/lib/Badge/styles.js +1 -1
  133. package/lib/Banner/index.js +3 -1
  134. package/lib/Banner/styles.js +1 -1
  135. package/lib/Box/styles.js +1 -1
  136. package/lib/Breadcrumb/index.js +5 -2
  137. package/lib/Button/index.js +4 -1
  138. package/lib/Button/styles.js +1 -0
  139. package/lib/Card/index.js +3 -1
  140. package/lib/Card/styles.js +2 -2
  141. package/lib/CharacterCounter/index.js +3 -1
  142. package/lib/CharacterCounter/styles.js +1 -1
  143. package/lib/ChartLegend/index.js +3 -1
  144. package/lib/ChartLegend/styles.js +3 -3
  145. package/lib/Checkbox/index.js +3 -1
  146. package/lib/Collapsible/index.js +5 -2
  147. package/lib/DatePicker/DateRangePicker.js +3 -1
  148. package/lib/DatePicker/SingleDatePicker.js +3 -1
  149. package/lib/DatePicker/StatefulDateRangePicker.js +3 -1
  150. package/lib/DatePicker/StatefulSingleDatePicker.js +3 -1
  151. package/lib/DatePicker/styles.js +2 -6
  152. package/lib/Drawer/SlideTransition.js +3 -1
  153. package/lib/Drawer/index.js +9 -4
  154. package/lib/Drawer/styles.js +2 -2
  155. package/lib/EmptyState/index.js +3 -1
  156. package/lib/Fieldset/index.js +7 -3
  157. package/lib/FormField/index.js +3 -1
  158. package/lib/Icon/index.js +5 -2
  159. package/lib/Icon/styles.js +1 -1
  160. package/lib/Image/index.js +3 -1
  161. package/lib/Image/styles.js +1 -1
  162. package/lib/Indicator/index.js +3 -1
  163. package/lib/Input/index.js +3 -1
  164. package/lib/Input/styles.js +2 -2
  165. package/lib/KeyboardKey/index.js +3 -1
  166. package/lib/Label/index.js +4 -2
  167. package/lib/Link/index.js +3 -1
  168. package/lib/Link/styles.js +1 -1
  169. package/lib/Listbox/index.js +6 -3
  170. package/lib/Loader/index.js +3 -1
  171. package/lib/Loader/styles.js +2 -2
  172. package/lib/LoaderButton/index.js +3 -1
  173. package/lib/Menu/descendants.js +5 -2
  174. package/lib/Menu/index.js +20 -16
  175. package/lib/Menu/styles.js +2 -2
  176. package/lib/Message/index.js +3 -1
  177. package/lib/Message/styles.js +1 -1
  178. package/lib/Modal/index.js +7 -3
  179. package/lib/Modal/styles.js +3 -5
  180. package/lib/Numeral/index.js +3 -1
  181. package/lib/Numeral/styles.js +2 -2
  182. package/lib/OverflowList/styles.js +1 -1
  183. package/lib/Popout/index.js +7 -3
  184. package/lib/Popout/styles.js +1 -1
  185. package/lib/Radio/index.js +3 -1
  186. package/lib/Radio/styles.js +4 -4
  187. package/lib/SegmentedControl/index.js +5 -2
  188. package/lib/Select/index.js +3 -1
  189. package/lib/Stack/index.js +3 -1
  190. package/lib/Switch/index.js +3 -1
  191. package/lib/Switch/styles.js +1 -1
  192. package/lib/Table/index.js +9 -4
  193. package/lib/TableCell/index.js +3 -1
  194. package/lib/TableHeaderCell/index.js +3 -1
  195. package/lib/TableRowAccordion/index.js +3 -1
  196. package/lib/Tabs/index.js +5 -2
  197. package/lib/Tabs/styles.js +3 -3
  198. package/lib/Text/index.js +3 -1
  199. package/lib/Text/styles.js +1 -1
  200. package/lib/Textarea/index.js +3 -1
  201. package/lib/Toast/index.js +14 -14
  202. package/lib/Toast/styles.js +3 -7
  203. package/lib/ToggleHint/index.js +3 -1
  204. package/lib/Token/index.js +3 -1
  205. package/lib/Token/styles.js +1 -1
  206. package/lib/TokenInput/index.js +3 -1
  207. package/lib/Tooltip/index.js +5 -2
  208. package/lib/Tooltip/styles.js +1 -1
  209. package/lib/VisuallyHidden/index.js +1 -1
  210. package/lib/index.js +1 -0
  211. package/lib/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +12 -0
  212. package/lib/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +34 -0
  213. package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +16 -0
  214. package/lib/themes/extendedThemes/sproutTheme/index.js +2 -0
  215. package/lib/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +34 -0
  216. package/lib/themes/extendedThemes/sproutTheme/light/theme.js +16 -0
  217. package/lib/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +0 -0
  218. package/package.json +25 -20
  219. package/__flow__/Button/__snapshots__/index.test.js.snap +0 -511
  220. package/__flow__/Button/index.test.js +0 -113
@@ -1,511 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Racine Button should render in active state 1`] = `
4
- .c0 {
5
- display: inline-block;
6
- box-sizing: border-box;
7
- text-align: center;
8
- font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
9
- border: 1px solid #364141;
10
- border-radius: 6px;
11
- border-style: solid;
12
- background: transparent;
13
- color: #364141;
14
- cursor: pointer;
15
- -webkit-text-decoration: none;
16
- text-decoration: none;
17
- line-height: 16px;
18
- white-space: nowrap;
19
- font-weight: 700;
20
- -webkit-transition: all .15s linear;
21
- transition: all .15s linear;
22
- margin: 0;
23
- padding: 8px;
24
- font-size: 13px;
25
- color: #FFFFFF !important;
26
- background: #273333 !important;
27
- }
28
-
29
- .c0:visited {
30
- color: #364141;
31
- }
32
-
33
- .c0:hover {
34
- color: #FFFFFF;
35
- background: #364141;
36
- -webkit-text-decoration: none;
37
- text-decoration: none;
38
- box-shadow: none;
39
- }
40
-
41
- .c0:active {
42
- color: #FFFFFF;
43
- background: #273333;
44
- -webkit-transform: translateY(1px);
45
- -ms-transform: translateY(1px);
46
- transform: translateY(1px);
47
- }
48
-
49
- .c0:focus {
50
- box-shadow: 0 0 0 1px #2079c3,0 0px 0px 4px rgba(32,121,195,0.3);
51
- outline: none;
52
- }
53
-
54
- .c0:focus::-moz-focus-inner {
55
- border: 0;
56
- }
57
-
58
- .c0:focus:active {
59
- box-shadow: none;
60
- }
61
-
62
- .c0 .styles__Container-x0vwa5-0 {
63
- vertical-align: text-bottom;
64
- }
65
-
66
- <div>
67
- <button
68
- class="c0"
69
- data-qa-button=""
70
- data-qa-button-isdisabled="false"
71
- type="button"
72
- >
73
- Button
74
- </button>
75
- </div>
76
- `;
77
-
78
- exports[`Racine Button should render in an anchor tag with external target 1`] = `
79
- .c0 {
80
- display: inline-block;
81
- box-sizing: border-box;
82
- text-align: center;
83
- font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
84
- border: 1px solid transparent;
85
- border-radius: 6px;
86
- border-style: solid;
87
- background: transparent;
88
- color: #515e5f;
89
- cursor: pointer;
90
- -webkit-text-decoration: none;
91
- text-decoration: none;
92
- line-height: 16px;
93
- white-space: nowrap;
94
- font-weight: 700;
95
- -webkit-transition: all .15s linear;
96
- transition: all .15s linear;
97
- margin: 0;
98
- padding: 8px;
99
- font-size: 13px;
100
- }
101
-
102
- .c0:visited {
103
- color: #515e5f;
104
- }
105
-
106
- .c0:hover {
107
- color: #273333;
108
- -webkit-text-decoration: none;
109
- text-decoration: none;
110
- box-shadow: none;
111
- }
112
-
113
- .c0:active {
114
- color: #273333;
115
- -webkit-transform: translateY(1px);
116
- -ms-transform: translateY(1px);
117
- transform: translateY(1px);
118
- }
119
-
120
- .c0:focus {
121
- box-shadow: 0 0 0 1px #2079c3,0 0px 0px 4px rgba(32,121,195,0.3);
122
- outline: none;
123
- }
124
-
125
- .c0:focus::-moz-focus-inner {
126
- border: 0;
127
- }
128
-
129
- .c0:focus:active {
130
- box-shadow: none;
131
- }
132
-
133
- .c0 .styles__Container-x0vwa5-0 {
134
- vertical-align: text-bottom;
135
- }
136
-
137
- <div>
138
- <a
139
- class="c0"
140
- data-qa-button=""
141
- data-qa-button-isdisabled="false"
142
- href="http://sproutsocial.style"
143
- rel="noopener noreferrer"
144
- target="_blank"
145
- >
146
- Button
147
- </a>
148
- </div>
149
- `;
150
-
151
- exports[`Racine Button should render in default style 1`] = `
152
- .c0 {
153
- display: inline-block;
154
- box-sizing: border-box;
155
- text-align: center;
156
- font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
157
- border: 1px solid transparent;
158
- border-radius: 6px;
159
- border-style: solid;
160
- background: transparent;
161
- color: #515e5f;
162
- cursor: pointer;
163
- -webkit-text-decoration: none;
164
- text-decoration: none;
165
- line-height: 16px;
166
- white-space: nowrap;
167
- font-weight: 700;
168
- -webkit-transition: all .15s linear;
169
- transition: all .15s linear;
170
- margin: 0;
171
- padding: 8px;
172
- font-size: 13px;
173
- }
174
-
175
- .c0:visited {
176
- color: #515e5f;
177
- }
178
-
179
- .c0:hover {
180
- color: #273333;
181
- -webkit-text-decoration: none;
182
- text-decoration: none;
183
- box-shadow: none;
184
- }
185
-
186
- .c0:active {
187
- color: #273333;
188
- -webkit-transform: translateY(1px);
189
- -ms-transform: translateY(1px);
190
- transform: translateY(1px);
191
- }
192
-
193
- .c0:focus {
194
- box-shadow: 0 0 0 1px #2079c3,0 0px 0px 4px rgba(32,121,195,0.3);
195
- outline: none;
196
- }
197
-
198
- .c0:focus::-moz-focus-inner {
199
- border: 0;
200
- }
201
-
202
- .c0:focus:active {
203
- box-shadow: none;
204
- }
205
-
206
- .c0 .styles__Container-x0vwa5-0 {
207
- vertical-align: text-bottom;
208
- }
209
-
210
- <div>
211
- <button
212
- class="c0"
213
- data-qa-button=""
214
- data-qa-button-isdisabled="false"
215
- type="button"
216
- >
217
- Button
218
- </button>
219
- </div>
220
- `;
221
-
222
- exports[`Racine Button should render in large size 1`] = `
223
- .c0 {
224
- display: inline-block;
225
- box-sizing: border-box;
226
- text-align: center;
227
- font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
228
- border: 1px solid #364141;
229
- border-radius: 6px;
230
- border-style: solid;
231
- background: transparent;
232
- color: #364141;
233
- cursor: pointer;
234
- -webkit-text-decoration: none;
235
- text-decoration: none;
236
- line-height: 16px;
237
- white-space: nowrap;
238
- font-weight: 700;
239
- -webkit-transition: all .15s linear;
240
- transition: all .15s linear;
241
- margin: 0;
242
- padding: 12px;
243
- font-size: 16px;
244
- }
245
-
246
- .c0:visited {
247
- color: #364141;
248
- }
249
-
250
- .c0:hover {
251
- color: #FFFFFF;
252
- background: #364141;
253
- -webkit-text-decoration: none;
254
- text-decoration: none;
255
- box-shadow: none;
256
- }
257
-
258
- .c0:active {
259
- color: #FFFFFF;
260
- background: #273333;
261
- -webkit-transform: translateY(1px);
262
- -ms-transform: translateY(1px);
263
- transform: translateY(1px);
264
- }
265
-
266
- .c0:focus {
267
- box-shadow: 0 0 0 1px #2079c3,0 0px 0px 4px rgba(32,121,195,0.3);
268
- outline: none;
269
- }
270
-
271
- .c0:focus::-moz-focus-inner {
272
- border: 0;
273
- }
274
-
275
- .c0:focus:active {
276
- box-shadow: none;
277
- }
278
-
279
- .c0 .styles__Container-x0vwa5-0 {
280
- vertical-align: text-bottom;
281
- }
282
-
283
- <div>
284
- <button
285
- class="c0"
286
- data-qa-button=""
287
- data-qa-button-isdisabled="false"
288
- type="button"
289
- >
290
- Button
291
- </button>
292
- </div>
293
- `;
294
-
295
- exports[`Racine Button should render in pill style 1`] = `
296
- .c0 {
297
- display: inline-block;
298
- box-sizing: border-box;
299
- text-align: center;
300
- font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
301
- border: 1px solid transparent;
302
- border-radius: 6px;
303
- border-style: solid;
304
- background: transparent;
305
- color: #515e5f;
306
- cursor: pointer;
307
- -webkit-text-decoration: none;
308
- text-decoration: none;
309
- line-height: 16px;
310
- white-space: nowrap;
311
- font-weight: 700;
312
- -webkit-transition: all .15s linear;
313
- transition: all .15s linear;
314
- margin: 0;
315
- padding: 8px;
316
- font-size: 13px;
317
- }
318
-
319
- .c0:visited {
320
- color: #515e5f;
321
- }
322
-
323
- .c0:hover {
324
- color: #273333;
325
- -webkit-text-decoration: none;
326
- text-decoration: none;
327
- box-shadow: none;
328
- }
329
-
330
- .c0:active {
331
- color: #273333;
332
- -webkit-transform: translateY(1px);
333
- -ms-transform: translateY(1px);
334
- transform: translateY(1px);
335
- }
336
-
337
- .c0:focus {
338
- box-shadow: 0 0 0 1px #2079c3,0 0px 0px 4px rgba(32,121,195,0.3);
339
- outline: none;
340
- }
341
-
342
- .c0:focus::-moz-focus-inner {
343
- border: 0;
344
- }
345
-
346
- .c0:focus:active {
347
- box-shadow: none;
348
- }
349
-
350
- .c0 .styles__Container-x0vwa5-0 {
351
- vertical-align: text-bottom;
352
- }
353
-
354
- <div>
355
- <button
356
- class="c0"
357
- data-qa-button=""
358
- data-qa-button-isdisabled="false"
359
- shape="pill"
360
- type="button"
361
- >
362
- Button
363
- </button>
364
- </div>
365
- `;
366
-
367
- exports[`Racine Button should render in primary style 1`] = `
368
- .c0 {
369
- display: inline-block;
370
- box-sizing: border-box;
371
- text-align: center;
372
- font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
373
- border: 1px solid transparent;
374
- border-radius: 6px;
375
- border-style: solid;
376
- background: #2079c3;
377
- color: #FFFFFF;
378
- cursor: pointer;
379
- -webkit-text-decoration: none;
380
- text-decoration: none;
381
- line-height: 16px;
382
- white-space: nowrap;
383
- font-weight: 700;
384
- -webkit-transition: all .15s linear;
385
- transition: all .15s linear;
386
- margin: 0;
387
- padding: 8px;
388
- font-size: 13px;
389
- }
390
-
391
- .c0:visited {
392
- color: #FFFFFF;
393
- }
394
-
395
- .c0:hover {
396
- color: #FFFFFF;
397
- background: #116daa;
398
- -webkit-text-decoration: none;
399
- text-decoration: none;
400
- box-shadow: none;
401
- }
402
-
403
- .c0:active {
404
- color: #FFFFFF;
405
- background: #0c5689;
406
- -webkit-transform: translateY(1px);
407
- -ms-transform: translateY(1px);
408
- transform: translateY(1px);
409
- }
410
-
411
- .c0:focus {
412
- box-shadow: 0 0 0 1px #2079c3,0 0px 0px 4px rgba(32,121,195,0.3);
413
- outline: none;
414
- }
415
-
416
- .c0:focus::-moz-focus-inner {
417
- border: 0;
418
- }
419
-
420
- .c0:focus:active {
421
- box-shadow: none;
422
- }
423
-
424
- .c0 .styles__Container-x0vwa5-0 {
425
- vertical-align: text-bottom;
426
- }
427
-
428
- <div>
429
- <button
430
- class="c0"
431
- data-qa-button=""
432
- data-qa-button-isdisabled="false"
433
- type="button"
434
- >
435
- Button
436
- </button>
437
- </div>
438
- `;
439
-
440
- exports[`Racine Button should render in secondary style 1`] = `
441
- .c0 {
442
- display: inline-block;
443
- box-sizing: border-box;
444
- text-align: center;
445
- font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
446
- border: 1px solid #364141;
447
- border-radius: 6px;
448
- border-style: solid;
449
- background: transparent;
450
- color: #364141;
451
- cursor: pointer;
452
- -webkit-text-decoration: none;
453
- text-decoration: none;
454
- line-height: 16px;
455
- white-space: nowrap;
456
- font-weight: 700;
457
- -webkit-transition: all .15s linear;
458
- transition: all .15s linear;
459
- margin: 0;
460
- padding: 8px;
461
- font-size: 13px;
462
- }
463
-
464
- .c0:visited {
465
- color: #364141;
466
- }
467
-
468
- .c0:hover {
469
- color: #FFFFFF;
470
- background: #364141;
471
- -webkit-text-decoration: none;
472
- text-decoration: none;
473
- box-shadow: none;
474
- }
475
-
476
- .c0:active {
477
- color: #FFFFFF;
478
- background: #273333;
479
- -webkit-transform: translateY(1px);
480
- -ms-transform: translateY(1px);
481
- transform: translateY(1px);
482
- }
483
-
484
- .c0:focus {
485
- box-shadow: 0 0 0 1px #2079c3,0 0px 0px 4px rgba(32,121,195,0.3);
486
- outline: none;
487
- }
488
-
489
- .c0:focus::-moz-focus-inner {
490
- border: 0;
491
- }
492
-
493
- .c0:focus:active {
494
- box-shadow: none;
495
- }
496
-
497
- .c0 .styles__Container-x0vwa5-0 {
498
- vertical-align: text-bottom;
499
- }
500
-
501
- <div>
502
- <button
503
- class="c0"
504
- data-qa-button=""
505
- data-qa-button-isdisabled="false"
506
- type="button"
507
- >
508
- Button
509
- </button>
510
- </div>
511
- `;
@@ -1,113 +0,0 @@
1
- import React from "react";
2
- import { fireEvent, render } from "../utils/react-testing-library";
3
- import "jest-styled-components";
4
- import Button from "./";
5
-
6
- describe("Racine Button", () => {
7
- it("should render in default style", () => {
8
- const { container } = render(<Button>Button</Button>);
9
- expect(container).toMatchSnapshot();
10
- });
11
- it("should render in primary style", () => {
12
- const { container } = render(<Button appearance="primary">Button</Button>);
13
- expect(container).toMatchSnapshot();
14
- });
15
- it("should render in secondary style", () => {
16
- const { container } = render(
17
- <Button appearance="secondary">Button</Button>
18
- );
19
- expect(container).toMatchSnapshot();
20
- });
21
-
22
- it("should render in pill style", () => {
23
- const { container } = render(<Button shape="pill">Button</Button>);
24
- expect(container).toMatchSnapshot();
25
- });
26
-
27
- it("should render in an anchor tag with external target", () => {
28
- const { container } = render(
29
- <Button href="http://sproutsocial.style" external>
30
- Button
31
- </Button>
32
- );
33
- expect(container).toMatchSnapshot();
34
- });
35
-
36
- it("should render in large size", () => {
37
- const { container } = render(
38
- <Button appearance="secondary" size="large">
39
- Button
40
- </Button>
41
- );
42
- expect(container).toMatchSnapshot();
43
- });
44
-
45
- it("should render in active state", () => {
46
- const { container } = render(
47
- <Button appearance="secondary" active>
48
- Button
49
- </Button>
50
- );
51
- expect(container).toMatchSnapshot();
52
- });
53
-
54
- it("setting external to prop true should add target blank attribute to anchor", () => {
55
- const { getByText } = render(
56
- <Button href="http://sproutsocial.com" external>
57
- Link
58
- </Button>
59
- );
60
- expect(getByText("Link").target).toEqual("_blank");
61
- });
62
-
63
- it("setting external to prop true should add rel='noopener noreferrer' attribute", () => {
64
- const { getByText } = render(
65
- <Button href="http://sproutsocial.com" external>
66
- Link
67
- </Button>
68
- );
69
- expect(getByText("Link").rel).toEqual("noopener noreferrer");
70
- });
71
-
72
- it("setting a URL renders component as an Anchor", () => {
73
- const { getByText } = render(
74
- <Button href="http://sproutsocial.com">Am I an anchor?</Button>
75
- );
76
- // expect(wrapper.find("a").length).toEqual(1);
77
- expect(getByText("Am I an anchor?").tagName).toEqual("A");
78
- });
79
-
80
- it("should only submit a form when given type=submit", () => {
81
- const onSubmit = jest.fn();
82
- const { queryByText } = render(
83
- <form onSubmit={onSubmit}>
84
- <Button>Not Submit</Button>
85
- <Button type="submit">Submit</Button>
86
- </form>
87
- );
88
- fireEvent.click(queryByText("Not Submit"));
89
- expect(onSubmit).not.toHaveBeenCalled();
90
- fireEvent.click(queryByText("Submit"));
91
- expect(onSubmit).toHaveBeenCalled();
92
- });
93
-
94
- it("Has type attribute as button by default", () => {
95
- const { getByText } = render(<Button>My Button</Button>);
96
- expect(getByText("My Button").type).toEqual("button");
97
- });
98
-
99
- it("Does not have type attribute when given href attribute", () => {
100
- const { getByText } = render(<Button href="google.com">My Button</Button>);
101
- expect(getByText("My Button").type).toBeFalsy();
102
- expect(getByText("My Button").type).not.toEqual("button");
103
- });
104
-
105
- it("Had overriden type attribute", () => {
106
- const { getByText } = render(
107
- <Button href="google.com" type="button">
108
- My Button
109
- </Button>
110
- );
111
- expect(getByText("My Button").type).toEqual("button");
112
- });
113
- });