@sproutsocial/racine 10.0.2-menuCSS.0 → 10.0.3-menuhotfix.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.
@@ -165,6 +165,10 @@ describe("Listbox", () => {
165
165
  });
166
166
 
167
167
  describe("AsListbox", () => {
168
+ it("should match snapshot", () => {
169
+ expect(render(<AsListbox />).baseElement).toMatchSnapshot();
170
+ });
171
+
168
172
  it("should render items with option role", async () => {
169
173
  const { findByText, queryByLabelText, queryByRole } = render(
170
174
  <AsListbox />
@@ -207,6 +211,10 @@ describe("Listbox", () => {
207
211
  });
208
212
 
209
213
  describe("AsListbox multiselect", () => {
214
+ it("should match snapshot", () => {
215
+ expect(render(<AsListboxMultiselect />).baseElement).toMatchSnapshot();
216
+ });
217
+
210
218
  it("should render items with option role", async () => {
211
219
  const { queryByLabelText, queryByText, queryByRole } = render(
212
220
  <AsListboxMultiselect />
@@ -236,6 +244,10 @@ describe("Listbox", () => {
236
244
  });
237
245
 
238
246
  describe("AsListbox with checkboxes", () => {
247
+ it("should match snapshot", () => {
248
+ expect(render(<AsListboxWithCheckboxes />).baseElement).toMatchSnapshot();
249
+ });
250
+
239
251
  it("should render items with checkbox role", async () => {
240
252
  const { queryByRole } = render(<AsListboxWithCheckboxes />);
241
253
  const firstItem = queryByRole(MENU_ITEM_ROLES.CHECKBOX, {
@@ -255,6 +267,12 @@ describe("Listbox", () => {
255
267
  });
256
268
 
257
269
  describe("AsListbox with filter input", () => {
270
+ it("should match snapshot", () => {
271
+ expect(
272
+ render(<AsListboxWithFilterInput />).baseElement
273
+ ).toMatchSnapshot();
274
+ });
275
+
258
276
  it("should allow filtering", async () => {
259
277
  const { queryByLabelText, queryAllByRole } = render(
260
278
  <AsListboxWithFilterInput />
@@ -1,7 +1,276 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Menu AsMenuButton should match snapshot 1`] = `
3
+ exports[`Menu AsMenu should match snapshot 1`] = `
4
+ .c0 {
5
+ box-sizing: border-box;
6
+ font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
7
+ margin: 0px;
8
+ padding: 0px;
9
+ width: 200px;
10
+ overflow: hidden;
11
+ }
12
+
13
+ .c2 {
14
+ box-sizing: border-box;
15
+ font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
16
+ padding-left: 16px;
17
+ margin-top: -1px;
18
+ border-top: 1px solid;
19
+ border-color: #dee1e1;
20
+ }
21
+
22
+ .c4 {
23
+ box-sizing: border-box;
24
+ font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
25
+ padding: 8px;
26
+ }
27
+
28
+ .c5 {
29
+ box-sizing: border-box;
30
+ font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
31
+ }
32
+
33
+ .c7 {
34
+ display: block;
35
+ width: 100%;
36
+ border-radius: 6px;
37
+ background-color: transparent;
38
+ border: none;
39
+ text-align: left;
40
+ color: #364141;
41
+ font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
42
+ font-weight: 400;
43
+ padding: 6px 8px;
44
+ list-style-type: none;
45
+ outline: 0;
46
+ font-size: 13px;
47
+ line-height: 21.333333333333332px;
48
+ }
49
+
50
+ .c7:focus,
51
+ .c7:hover {
52
+ color: #364141;
53
+ background-color: #f3f4f4;
54
+ }
55
+
56
+ .c7:focus .Icon-svg,
57
+ .c7:hover .Icon-svg {
58
+ color: unset;
59
+ }
60
+
61
+ .c7:hover {
62
+ cursor: pointer;
63
+ }
64
+
65
+ .c6 {
66
+ display: block;
67
+ width: 100%;
68
+ border-radius: 6px;
69
+ background-color: transparent;
70
+ border: none;
71
+ text-align: left;
72
+ color: #364141;
73
+ font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
74
+ font-weight: 400;
75
+ padding: 6px 8px;
76
+ list-style-type: none;
77
+ outline: 0;
78
+ font-size: 13px;
79
+ line-height: 21.333333333333332px;
80
+ color: #FFFFFF;
81
+ background-color: #364141;
82
+ }
83
+
84
+ .c6 .Icon-svg {
85
+ color: #FFFFFF;
86
+ }
87
+
88
+ .c6:focus,
89
+ .c6:hover {
90
+ color: #364141;
91
+ background-color: #f3f4f4;
92
+ }
93
+
94
+ .c6:focus .Icon-svg,
95
+ .c6:hover .Icon-svg {
96
+ color: unset;
97
+ }
98
+
99
+ .c6:hover {
100
+ cursor: pointer;
101
+ }
102
+
103
+ .c1 {
104
+ list-style-type: none;
105
+ outline: 0;
106
+ }
107
+
4
108
  .c3 {
109
+ margin: 0;
110
+ padding-left: 0;
111
+ padding-right: 0;
112
+ font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
113
+ margin-top: 12px;
114
+ color: #273333;
115
+ font-size: 13px;
116
+ line-height: 21.333333333333332px;
117
+ font-weight: 600;
118
+ }
119
+
120
+ <body>
121
+ <div>
122
+ <ul
123
+ aria-activedescendant="MenuItem-1"
124
+ class="c0 c1"
125
+ overflow="hidden"
126
+ role="menu"
127
+ tabindex="0"
128
+ width="200px"
129
+ >
130
+ <div
131
+ class="c2"
132
+ >
133
+ <div
134
+ class="c3 "
135
+ color="text.headline"
136
+ data-qa-text="Fruit"
137
+ font-weight="600"
138
+ >
139
+ Fruit
140
+ </div>
141
+ </div>
142
+ <div
143
+ class="c4"
144
+ role="group"
145
+ >
146
+ <li
147
+ class="c5 c6"
148
+ data-qa-menu-item="Apple"
149
+ id="MenuItem-1"
150
+ role="menuitem"
151
+ tabindex="-1"
152
+ >
153
+ <div
154
+ style="display: flex; align-items: center; justify-content: space-between;"
155
+ >
156
+ <div
157
+ style="flex-grow: 1; word-break: break-word; min-width: 0;"
158
+ >
159
+ Apple
160
+ </div>
161
+ </div>
162
+ </li>
163
+ <li
164
+ class="c5 c7"
165
+ data-qa-menu-item="Banana"
166
+ id="MenuItem-2"
167
+ role="menuitem"
168
+ tabindex="-1"
169
+ >
170
+ <div
171
+ style="display: flex; align-items: center; justify-content: space-between;"
172
+ >
173
+ <div
174
+ style="flex-grow: 1; word-break: break-word; min-width: 0;"
175
+ >
176
+ Banana
177
+ </div>
178
+ </div>
179
+ </li>
180
+ <li
181
+ class="c5 c7"
182
+ data-qa-menu-item="Orange"
183
+ id="MenuItem-3"
184
+ role="menuitem"
185
+ tabindex="-1"
186
+ >
187
+ <div
188
+ style="display: flex; align-items: center; justify-content: space-between;"
189
+ >
190
+ <div
191
+ style="flex-grow: 1; word-break: break-word; min-width: 0;"
192
+ >
193
+ Orange
194
+ </div>
195
+ </div>
196
+ </li>
197
+ </div>
198
+ <div
199
+ class="c2"
200
+ >
201
+ <div
202
+ class="c3 "
203
+ color="text.headline"
204
+ data-qa-text="Maybe Fruit"
205
+ font-weight="600"
206
+ >
207
+ Maybe Fruit
208
+ </div>
209
+ </div>
210
+ <div
211
+ class="c4"
212
+ role="group"
213
+ >
214
+ <li
215
+ class="c5 c7"
216
+ data-qa-menu-item="Tomato"
217
+ id="MenuItem-4"
218
+ role="menuitem"
219
+ tabindex="-1"
220
+ >
221
+ <div
222
+ style="display: flex; align-items: center; justify-content: space-between;"
223
+ >
224
+ <div
225
+ style="flex-grow: 1; word-break: break-word; min-width: 0;"
226
+ >
227
+ Tomato
228
+ </div>
229
+ </div>
230
+ </li>
231
+ <li
232
+ class="c5 c7"
233
+ data-qa-menu-item="Cucumber"
234
+ id="MenuItem-5"
235
+ role="menuitem"
236
+ tabindex="-1"
237
+ >
238
+ <div
239
+ style="display: flex; align-items: center; justify-content: space-between;"
240
+ >
241
+ <div
242
+ style="flex-grow: 1; word-break: break-word; min-width: 0;"
243
+ >
244
+ Cucumber
245
+ </div>
246
+ </div>
247
+ </li>
248
+ <li
249
+ class="c5 c7"
250
+ data-qa-menu-item="Squash"
251
+ id="MenuItem-6"
252
+ role="menuitem"
253
+ tabindex="-1"
254
+ >
255
+ <div
256
+ style="display: flex; align-items: center; justify-content: space-between;"
257
+ >
258
+ <div
259
+ style="flex-grow: 1; word-break: break-word; min-width: 0;"
260
+ >
261
+ Squash
262
+ </div>
263
+ </div>
264
+ </li>
265
+ </div>
266
+ </ul>
267
+ </div>
268
+ </body>
269
+ `;
270
+
271
+ exports[`Menu AsMenuButton should match snapshot 1`] = `
272
+ <body>
273
+ .c3 {
5
274
  display: inline-block;
6
275
  color: inherit;
7
276
  vertical-align: middle;
@@ -87,8 +356,7 @@ html .c3 {
87
356
  display: inline-block;
88
357
  }
89
358
 
90
- <body>
91
- <div>
359
+ <div>
92
360
  <div
93
361
  class="c0"
94
362
  >
@@ -99,7 +367,7 @@ html .c3 {
99
367
  class="c1"
100
368
  data-qa-button=""
101
369
  data-qa-button-isdisabled="false"
102
- id="MenuButton-7"
370
+ id="MenuButton-13"
103
371
  type="button"
104
372
  >
105
373
  <span
@@ -287,7 +287,7 @@ export const MenuGroup = ({
287
287
  </Text>
288
288
  </Box>
289
289
  )}
290
- <Box {...props} m={300} p={300} role="group">
290
+ <Box {...props} p={300} role="group">
291
291
  {children}
292
292
  </Box>
293
293
  </>
@@ -54,6 +54,10 @@ describe("Menu", () => {
54
54
  });
55
55
 
56
56
  describe("AsMenu", () => {
57
+ it("should match snapshot", () => {
58
+ expect(render(<AsMenu />).baseElement).toMatchSnapshot();
59
+ });
60
+
57
61
  it("should render items with menuitem role", () => {
58
62
  const { queryByRole, queryByDataQaLabel } = render(<AsMenu />);
59
63
  const firstItem = queryByRole(MENU_ITEM_ROLES.MENUITEM, {
@@ -3,7 +3,7 @@ import styled, { css } from "styled-components";
3
3
  import Box from "../Box";
4
4
  import type { TypeMenuItemProps } from "./index.flow";
5
5
  import type { TypeTheme } from "../types/theme.flow";
6
- import { disabled, focusRing } from "../utils/mixins";
6
+ import { disabled } from "../utils/mixins";
7
7
 
8
8
  export const MenuItemContainer = styled<
9
9
  typeof Box,
@@ -86,13 +86,5 @@ export const MenuItemContainer = styled<
86
86
 
87
87
  export const MenuItemsContainer = styled<typeof Box, TypeTheme>(Box)`
88
88
  list-style-type: none;
89
- &:focus {
90
- ${focusRing}
91
- }
92
- &:not(:focus) {
93
- & li:not(:hover) {
94
- color: #364141;
95
- background-color: transparent;
96
- }
97
- }
89
+ outline: 0;
98
90
  `;
@@ -278,7 +278,6 @@ var MenuGroup = function MenuGroup(_ref2) {
278
278
  color: "text.headline",
279
279
  _css: isDisabled && _mixins.disabled
280
280
  }, title)), /*#__PURE__*/React.createElement(_Box.default, _extends({}, props, {
281
- m: 300,
282
281
  p: 300,
283
282
  role: "group"
284
283
  }), children));
@@ -59,5 +59,5 @@ exports.MenuItemContainer = MenuItemContainer;
59
59
  var MenuItemsContainer = (0, _styledComponents.default)(_Box.default).withConfig({
60
60
  displayName: "styles__MenuItemsContainer",
61
61
  componentId: "fjvae4-1"
62
- })(["list-style-type:none;&:focus{", "}&:not(:focus){& li:not(:hover){color:#364141;background-color:transparent;}}"], _mixins.focusRing);
62
+ })(["list-style-type:none;outline:0;"]);
63
63
  exports.MenuItemsContainer = MenuItemsContainer;
package/lib/Menu/index.js CHANGED
@@ -245,7 +245,6 @@ export var MenuGroup = function MenuGroup(_ref2) {
245
245
  color: "text.headline",
246
246
  _css: isDisabled && disabled
247
247
  }, title)), /*#__PURE__*/React.createElement(Box, _extends({}, props, {
248
- m: 300,
249
248
  p: 300,
250
249
  role: "group"
251
250
  }), children));
@@ -1,6 +1,6 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import Box from "../Box";
3
- import { disabled, focusRing } from "../utils/mixins";
3
+ import { disabled } from "../utils/mixins";
4
4
  export var MenuItemContainer = styled(Box).withConfig({
5
5
  displayName: "styles__MenuItemContainer",
6
6
  componentId: "fjvae4-0"
@@ -44,4 +44,4 @@ export var MenuItemContainer = styled(Box).withConfig({
44
44
  export var MenuItemsContainer = styled(Box).withConfig({
45
45
  displayName: "styles__MenuItemsContainer",
46
46
  componentId: "fjvae4-1"
47
- })(["list-style-type:none;&:focus{", "}&:not(:focus){& li:not(:hover){color:#364141;background-color:transparent;}}"], focusRing);
47
+ })(["list-style-type:none;outline:0;"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "10.0.2-menuCSS.0",
3
+ "version": "10.0.3-menuhotfix.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",