@sproutsocial/racine 11.6.1-theme-beta.1 → 11.6.1
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.
- package/CHANGELOG.md +13 -0
- package/__flow__/Checkbox/styles.js +75 -75
- package/__flow__/Collapsible/index.js +2 -3
- package/__flow__/Image/index.js +2 -10
- package/__flow__/SegmentedControl/index.js +2 -3
- package/__flow__/TableCell/index.js +2 -9
- package/__flow__/ToggleHint/index.js +2 -9
- package/__flow__/systemProps/color.js +2 -1
- package/__flow__/utils/responsiveProps/index.test.js +2 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 11.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- eb27d01: Fix interact util in dark mode themes
|
|
8
|
+
- The `interact` util was located at a different location in the light and dark mode base theme objects. It was at the base level of the light theme and nested inside of `colors` for the dark theme.
|
|
9
|
+
- `interact` was seemingly available at the base level of the theme in both modes, because we spread the light theme as the basis of the dark theme. However, the `interact` util accessible at the base level of the theme would behave like light mode in either mode.
|
|
10
|
+
- The `interact` util located inside the `colors` object inside the dark mode theme object was not usable, due to only being defined in that location for dark mode, and has been removed.
|
|
11
|
+
- eb27d01: Remove 'just-clone' dependency
|
|
12
|
+
- eb27d01: Fix "navigation" colors in SproutTheme
|
|
13
|
+
- The "navigation" colors were not available in the theme due to being spread in incorrectly.
|
|
14
|
+
- eb27d01: Improve theme types to be more accurate
|
|
15
|
+
|
|
3
16
|
## 11.6.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -182,90 +182,90 @@ const getIcon = (type, color) => {
|
|
|
182
182
|
|
|
183
183
|
// eslint-disable-next-line prettier/prettier
|
|
184
184
|
export const CheckboxContainer: StyledComponent<any, TypeTheme, *> = styled.span(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
&:hover:before {
|
|
216
|
-
opacity: ${props.disabled && !props.checked ? 0 : 1};
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
${props.disabled &&
|
|
220
|
-
css`
|
|
221
|
-
opacity: 0.4;
|
|
222
|
-
`}
|
|
223
|
-
|
|
224
|
-
input[type='checkbox'] {
|
|
225
|
-
box-sizing: border-box;
|
|
226
|
-
appearance: none;
|
|
227
|
-
margin: 0;
|
|
228
|
-
padding: 0;
|
|
229
|
-
width: ${props.theme.space[400]};
|
|
230
|
-
height: ${props.theme.space[400]};
|
|
231
|
-
border: 1px solid ${props.theme.colors.form.border.base};
|
|
232
|
-
border-radius: 4px;
|
|
233
|
-
background-color: ${props.theme.colors.form.background.base};
|
|
234
|
-
transition: all ${props.theme.duration.fast}
|
|
235
|
-
${props.theme.easing.ease_in};
|
|
236
|
-
cursor: ${props.disabled ? "not-allowed" : "pointer"};
|
|
237
|
-
flex-shrink: 0;
|
|
238
|
-
|
|
239
|
-
&:not(:checked) {
|
|
240
|
-
${!props.indeterminate &&
|
|
241
|
-
css`
|
|
242
|
-
border-color: ${props.theme.colors
|
|
243
|
-
.neutral[300]} !important; /* We don't want the focus ring to remove the border */
|
|
244
|
-
background-color: ${props.theme.colors.form.background.base};
|
|
245
|
-
`}
|
|
185
|
+
(props) => css`
|
|
186
|
+
display: inline-flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
box-sizing: border-box;
|
|
189
|
+
position: relative;
|
|
190
|
+
transition: all ${props.theme.duration.fast} ${props.theme.easing.ease_in};
|
|
191
|
+
|
|
192
|
+
@supports (-webkit-appearance: none) {
|
|
193
|
+
&:before {
|
|
194
|
+
/* stylelint-disable */
|
|
195
|
+
content: url("data:image/svg+xml;utf8,${getIcon(
|
|
196
|
+
props.indeterminate ? "indeterminate" : "check",
|
|
197
|
+
|
|
198
|
+
props.checked
|
|
199
|
+
? props.theme.colors.form.background.base
|
|
200
|
+
: props.theme.colors.form.border.base
|
|
201
|
+
)}");
|
|
202
|
+
opacity: ${props.checked ? 1 : 0};
|
|
203
|
+
position: absolute;
|
|
204
|
+
width: ${props.theme.space[400]};
|
|
205
|
+
height: ${props.theme.space[400]};
|
|
206
|
+
text-align: center;
|
|
207
|
+
transform: translateY(1px);
|
|
208
|
+
line-height: 1;
|
|
209
|
+
margin: auto;
|
|
210
|
+
pointer-events: none;
|
|
211
|
+
transition: ${props.theme.duration.fast}
|
|
212
|
+
${props.theme.easing.ease_inout};
|
|
246
213
|
}
|
|
247
214
|
|
|
248
|
-
&:
|
|
249
|
-
|
|
250
|
-
background-color: ${props.theme.colors.form.background.selected};
|
|
215
|
+
&:hover:before {
|
|
216
|
+
opacity: ${props.disabled && !props.checked ? 0 : 1};
|
|
251
217
|
}
|
|
252
218
|
|
|
253
|
-
${props.
|
|
254
|
-
props.checked &&
|
|
219
|
+
${props.disabled &&
|
|
255
220
|
css`
|
|
256
|
-
|
|
257
|
-
background-color: ${props.theme.colors.form.background
|
|
258
|
-
.selected} !important;
|
|
221
|
+
opacity: 0.4;
|
|
259
222
|
`}
|
|
260
223
|
|
|
261
|
-
|
|
262
|
-
|
|
224
|
+
input[type='checkbox'] {
|
|
225
|
+
box-sizing: border-box;
|
|
226
|
+
appearance: none;
|
|
227
|
+
margin: 0;
|
|
228
|
+
padding: 0;
|
|
229
|
+
width: ${props.theme.space[400]};
|
|
230
|
+
height: ${props.theme.space[400]};
|
|
231
|
+
border: 1px solid ${props.theme.colors.form.border.base};
|
|
232
|
+
border-radius: 4px;
|
|
233
|
+
background-color: ${props.theme.colors.form.background.base};
|
|
234
|
+
transition: all ${props.theme.duration.fast}
|
|
235
|
+
${props.theme.easing.ease_in};
|
|
236
|
+
cursor: ${props.disabled ? "not-allowed" : "pointer"};
|
|
237
|
+
flex-shrink: 0;
|
|
238
|
+
|
|
239
|
+
&:not(:checked) {
|
|
240
|
+
${!props.indeterminate &&
|
|
241
|
+
css`
|
|
242
|
+
border-color: ${props.theme.colors
|
|
243
|
+
.neutral[300]} !important; /* We don't want the focus ring to remove the border */
|
|
244
|
+
background-color: ${props.theme.colors.form.background.base};
|
|
245
|
+
`}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&:checked {
|
|
249
|
+
border-color: ${props.theme.colors.form.border.selected};
|
|
250
|
+
background-color: ${props.theme.colors.form.background.selected};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
${props.indeterminate &&
|
|
254
|
+
props.checked &&
|
|
255
|
+
css`
|
|
256
|
+
border-color: ${props.theme.colors.form.border.selected} !important;
|
|
257
|
+
background-color: ${props.theme.colors.form.background
|
|
258
|
+
.selected} !important;
|
|
259
|
+
`}
|
|
260
|
+
|
|
261
|
+
&:focus {
|
|
262
|
+
${focusRing}
|
|
263
|
+
}
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
|
-
}
|
|
266
266
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
);
|
|
267
|
+
${COMMON}
|
|
268
|
+
`
|
|
269
|
+
);
|
|
270
270
|
|
|
271
271
|
export default Container;
|
|
@@ -73,9 +73,8 @@ const Trigger = ({ children, ...rest }) => {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const Panel = ({ children, ...rest }) => {
|
|
76
|
-
const { isOpen, id, offset, collapsedHeight, openHeight } =
|
|
77
|
-
CollapsibleContext
|
|
78
|
-
);
|
|
76
|
+
const { isOpen, id, offset, collapsedHeight, openHeight } =
|
|
77
|
+
useContext(CollapsibleContext);
|
|
79
78
|
const ref = useRef();
|
|
80
79
|
const measurement = useMeasure(ref);
|
|
81
80
|
const [isHidden, setIsHidden] = useState(undefined);
|
package/__flow__/Image/index.js
CHANGED
|
@@ -80,16 +80,8 @@ export default class Image extends React.Component<TypeProps, TypeState> {
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
render() {
|
|
83
|
-
const {
|
|
84
|
-
|
|
85
|
-
title,
|
|
86
|
-
onClick,
|
|
87
|
-
onError,
|
|
88
|
-
onLoad,
|
|
89
|
-
src,
|
|
90
|
-
qa,
|
|
91
|
-
...rest
|
|
92
|
-
} = this.props;
|
|
83
|
+
const { alt, title, onClick, onError, onLoad, src, qa, ...rest } =
|
|
84
|
+
this.props;
|
|
93
85
|
|
|
94
86
|
return (
|
|
95
87
|
<ImageContainer
|
|
@@ -17,9 +17,8 @@ type TypeSegmentedControlContext = {
|
|
|
17
17
|
onChange: (e: SyntheticInputEvent<HTMLInputElement>) => void,
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
const SegmentedControlContext =
|
|
21
|
-
null
|
|
22
|
-
);
|
|
20
|
+
const SegmentedControlContext =
|
|
21
|
+
React.createContext<?TypeSegmentedControlContext>(null);
|
|
23
22
|
|
|
24
23
|
type TypeSegmentedControlItemProps = {
|
|
25
24
|
/** The value of this item. Should be unique among sibling items. */
|
|
@@ -22,15 +22,8 @@ export type TypeTableCell = {
|
|
|
22
22
|
*/
|
|
23
23
|
export default class TableCell extends React.Component<TypeTableCell> {
|
|
24
24
|
render() {
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
content,
|
|
28
|
-
colSpan,
|
|
29
|
-
width,
|
|
30
|
-
align,
|
|
31
|
-
children,
|
|
32
|
-
...rest
|
|
33
|
-
} = this.props;
|
|
25
|
+
const { id, content, colSpan, width, align, children, ...rest } =
|
|
26
|
+
this.props;
|
|
34
27
|
|
|
35
28
|
return (
|
|
36
29
|
<Container
|
|
@@ -32,15 +32,8 @@ export default class ToggleHint extends React.Component<TypeProps> {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
render() {
|
|
35
|
-
const {
|
|
36
|
-
|
|
37
|
-
isOpen,
|
|
38
|
-
openString,
|
|
39
|
-
closeString,
|
|
40
|
-
qa,
|
|
41
|
-
className,
|
|
42
|
-
...rest
|
|
43
|
-
} = this.props;
|
|
35
|
+
const { icon, isOpen, openString, closeString, qa, className, ...rest } =
|
|
36
|
+
this.props;
|
|
44
37
|
|
|
45
38
|
return (
|
|
46
39
|
<Container
|
|
@@ -14,7 +14,8 @@ import type {
|
|
|
14
14
|
|
|
15
15
|
// https://styled-system.com/table#color
|
|
16
16
|
|
|
17
|
-
type TypeBackgroundColorSystemProp =
|
|
17
|
+
type TypeBackgroundColorSystemProp =
|
|
18
|
+
TypeResponsiveBaseSystemProp<BackgroundColorProperty>;
|
|
18
19
|
export type TypeColorSystemProps = $ReadOnly<{|
|
|
19
20
|
backgroundColor?: TypeBackgroundColorSystemProp,
|
|
20
21
|
bg?: TypeBackgroundColorSystemProp,
|
|
@@ -19,21 +19,13 @@ describe("normalizeResponsiveProp", () => {
|
|
|
19
19
|
|
|
20
20
|
it("should handle arrays with 4 values", () => {
|
|
21
21
|
expect(normalizeResponsiveProp([0, 1, 2, 3])).toMatchObject([
|
|
22
|
-
0,
|
|
23
|
-
1,
|
|
24
|
-
2,
|
|
25
|
-
3,
|
|
26
|
-
3,
|
|
22
|
+
0, 1, 2, 3, 3,
|
|
27
23
|
]);
|
|
28
24
|
});
|
|
29
25
|
|
|
30
26
|
it("should handle arrays with 5 values", () => {
|
|
31
27
|
expect(normalizeResponsiveProp([0, 1, 2, 3, 4])).toMatchObject([
|
|
32
|
-
0,
|
|
33
|
-
1,
|
|
34
|
-
2,
|
|
35
|
-
3,
|
|
36
|
-
4,
|
|
28
|
+
0, 1, 2, 3, 4,
|
|
37
29
|
]);
|
|
38
30
|
});
|
|
39
31
|
});
|