@sproutsocial/racine 9.1.0-beta-pr-1290.0 → 9.1.1-theme-extension.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 +0 -28
- package/__flow__/Breadcrumb/styles.js +5 -0
- package/__flow__/Button/styles.js +1 -1
- package/__flow__/Card/index.stories.js +1 -0
- package/__flow__/Card/styles.js +1 -1
- package/__flow__/CustomThemeProvider/index.js +17 -0
- package/__flow__/Drawer/index.stories.js +3 -3
- package/__flow__/Drawer/styles.js +1 -1
- package/__flow__/KeyboardKey/styles.js +1 -1
- package/__flow__/Listbox/__snapshots__/index.test.js.snap +34 -40
- package/__flow__/Menu/__snapshots__/index.test.js.snap +12 -15
- package/__flow__/Menu/index.js +7 -3
- package/__flow__/Menu/index.stories.js +1 -1
- package/__flow__/Menu/styles.js +18 -1
- package/__flow__/Modal/__snapshots__/index.test.js.snap +80 -0
- package/__flow__/Modal/index.test.js +16 -0
- package/__flow__/Modal/styles.js +1 -1
- package/__flow__/Popout/index.js +1 -1
- package/__flow__/ThemeProvider/index.js +2 -2
- package/__flow__/Token/index.js +1 -4
- package/__flow__/Token/index.stories.js +0 -11
- package/__flow__/Token/styles.js +33 -43
- package/__flow__/Tooltip/index.js +1 -1
- package/__flow__/index.js +1 -0
- package/__flow__/themes/dark/theme.js +156 -180
- package/__flow__/themes/default/theme.js +8 -19
- package/__flow__/themes/sprout/theme.js +22 -0
- package/__flow__/types/system-props.flow.js +2 -1
- package/__flow__/utils/extendTheme.js +17 -0
- package/commonjs/Breadcrumb/styles.js +1 -1
- package/commonjs/Button/styles.js +1 -1
- package/commonjs/Card/styles.js +1 -1
- package/commonjs/CustomThemeProvider/index.js +23 -0
- package/commonjs/Drawer/styles.js +1 -1
- package/commonjs/KeyboardKey/styles.js +1 -1
- package/commonjs/Menu/index.js +1 -3
- package/commonjs/Menu/styles.js +16 -3
- package/commonjs/Modal/styles.js +1 -1
- package/commonjs/Popout/index.js +1 -1
- package/commonjs/Token/index.js +2 -5
- package/commonjs/Token/styles.js +50 -19
- package/commonjs/Tooltip/index.js +1 -1
- package/commonjs/index.js +5 -1
- package/commonjs/themes/dark/theme.js +154 -179
- package/commonjs/themes/default/theme.js +8 -19
- package/commonjs/themes/sprout/theme.js +29 -0
- package/commonjs/utils/extendTheme.js +22 -0
- package/lib/Breadcrumb/styles.js +1 -1
- package/lib/Button/styles.js +1 -1
- package/lib/Card/styles.js +1 -1
- package/lib/CustomThemeProvider/index.js +12 -0
- package/lib/Drawer/styles.js +1 -1
- package/lib/KeyboardKey/styles.js +1 -1
- package/lib/Menu/index.js +2 -4
- package/lib/Menu/styles.js +13 -2
- package/lib/Modal/styles.js +1 -1
- package/lib/Popout/index.js +1 -1
- package/lib/Token/index.js +2 -5
- package/lib/Token/styles.js +50 -19
- package/lib/Tooltip/index.js +1 -1
- package/lib/index.js +1 -0
- package/lib/themes/dark/theme.js +153 -174
- package/lib/themes/default/theme.js +8 -18
- package/lib/themes/sprout/theme.js +19 -0
- package/lib/utils/extendTheme.js +12 -0
- package/package.json +3 -3
- package/__flow__/themes/_themes.scss +0 -138
- package/__flow__/themes/utils/interact.js +0 -12
- package/commonjs/themes/utils/interact.js +0 -19
- package/dist/themes/_themes.scss +0 -138
- package/dist/themes/dark.scss +0 -601
- package/dist/themes/default.scss +0 -692
- package/lib/themes/utils/interact.js +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,33 +1,5 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 9.0.0
|
|
4
|
-
|
|
5
|
-
### Major Changes
|
|
6
|
-
|
|
7
|
-
- a71802f: convert shadow tokens to semantic tokens
|
|
8
|
-
|
|
9
|
-
## 8.8.0
|
|
10
|
-
|
|
11
|
-
### Minor Changes
|
|
12
|
-
|
|
13
|
-
- 2746920: Add SCSS themed mixin and functions
|
|
14
|
-
|
|
15
|
-
### Patch Changes
|
|
16
|
-
|
|
17
|
-
- 69ddb8e: Replace instances of Icon colors with semantic names
|
|
18
|
-
|
|
19
|
-
## 8.7.1
|
|
20
|
-
|
|
21
|
-
### Patch Changes
|
|
22
|
-
|
|
23
|
-
- 1cf97da: Remove font weight rule from Breadcrumbs styles
|
|
24
|
-
|
|
25
|
-
## 8.7.0
|
|
26
|
-
|
|
27
|
-
### Minor Changes
|
|
28
|
-
|
|
29
|
-
- bcfb6eb: Export themes as scss variables
|
|
30
|
-
|
|
31
3
|
## 8.6.3
|
|
32
4
|
|
|
33
5
|
### Patch Changes
|
|
@@ -42,6 +42,11 @@ const Nav: StyledComponent<{ ... }, TypeTheme, *> = styled.nav`
|
|
|
42
42
|
font-weight: bold;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
li:not(:last-child) a,
|
|
46
|
+
li:not(:last-child) button {
|
|
47
|
+
font-weight: normal;
|
|
48
|
+
}
|
|
49
|
+
|
|
45
50
|
li:not(:last-child)::after {
|
|
46
51
|
content: "/";
|
|
47
52
|
color: ${(props) => props.theme.colors.text.body};
|
|
@@ -51,7 +51,7 @@ const Container: StyledComponent<any, TypeTheme, *> = styled.button`
|
|
|
51
51
|
props.theme.colors.button[props.appearance].background.hover};
|
|
52
52
|
text-decoration: none;
|
|
53
53
|
box-shadow: ${(props) =>
|
|
54
|
-
props.appearance === "placeholder" ? props.theme.shadows
|
|
54
|
+
props.appearance === "placeholder" ? props.theme.shadows[100] : "none"};
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
&:active {
|
package/__flow__/Card/styles.js
CHANGED
|
@@ -19,7 +19,7 @@ const Container = styled<typeof Box, *>(Box)`
|
|
|
19
19
|
width: 100%;
|
|
20
20
|
height: 100%;
|
|
21
21
|
opacity: 0;
|
|
22
|
-
box-shadow: ${(props) => props.theme.shadows
|
|
22
|
+
box-shadow: ${(props) => props.theme.shadows[100]};
|
|
23
23
|
transition: opacity ${(props) => props.theme.duration.medium}
|
|
24
24
|
${(props) => props.theme.easing.ease_inout};
|
|
25
25
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { ThemeProvider } from "styled-components";
|
|
4
|
+
|
|
5
|
+
import typeof { default as TypeTheme } from "../themes/default/theme";
|
|
6
|
+
|
|
7
|
+
type TypeProps = {|
|
|
8
|
+
// Not sure how to type acceptance of a custom function to override theme
|
|
9
|
+
theme?: TypeTheme | ((customTheme: TypeTheme) => ?TypeTheme),
|
|
10
|
+
children: React.Node,
|
|
11
|
+
|};
|
|
12
|
+
|
|
13
|
+
const CustomThemeProvider = (props: TypeProps) => (
|
|
14
|
+
<ThemeProvider theme={props.theme} {...props} />
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export default CustomThemeProvider;
|
|
@@ -51,7 +51,7 @@ const DrawerComponent = ({ direction, offset }) => {
|
|
|
51
51
|
padding={300}
|
|
52
52
|
>
|
|
53
53
|
<Button onClick={onOpen}>
|
|
54
|
-
<Icon color="
|
|
54
|
+
<Icon color="neutral.0" name="notifications" />
|
|
55
55
|
</Button>
|
|
56
56
|
</Box>
|
|
57
57
|
<Drawer
|
|
@@ -105,10 +105,10 @@ const NectarDrawerComponent = ({ direction, offset }) => {
|
|
|
105
105
|
<Button
|
|
106
106
|
onClick={isNotificationsOpen ? closeNotifications : openNotifications}
|
|
107
107
|
>
|
|
108
|
-
<Icon color="
|
|
108
|
+
<Icon color="neutral.800" name="notifications" />
|
|
109
109
|
</Button>
|
|
110
110
|
<Button onClick={isPoplarOpen ? closePoplar : openPoplar} mt={400}>
|
|
111
|
-
<Icon color="
|
|
111
|
+
<Icon color="neutral.800" name="link" />
|
|
112
112
|
</Button>
|
|
113
113
|
</Box>
|
|
114
114
|
<Drawer
|
|
@@ -17,7 +17,7 @@ const Container: StyledComponent<any, TypeTheme, *> = styled.div`
|
|
|
17
17
|
height: 100%;
|
|
18
18
|
width: ${(props) => props.width}px;
|
|
19
19
|
background-color: ${(props) => props.theme.colors.container.background.base};
|
|
20
|
-
box-shadow: ${(props) => props.theme.shadows
|
|
20
|
+
box-shadow: ${(props) => props.theme.shadows[400]};
|
|
21
21
|
filter: blur(0);
|
|
22
22
|
|
|
23
23
|
${(props) => css`
|
|
@@ -10,7 +10,7 @@ const Container: StyledComponent<{ ... }, TypeTheme, *> = styled.div`
|
|
|
10
10
|
background-color: ${(props) => props.theme.colors.container.background.base};
|
|
11
11
|
border: 1px solid ${(props) => props.theme.colors.container.border.base};
|
|
12
12
|
border-radius: ${(props) => props.theme.radii[500]};
|
|
13
|
-
box-shadow: ${(props) => props.theme.shadows
|
|
13
|
+
box-shadow: ${(props) => props.theme.shadows[100]};
|
|
14
14
|
padding: 0 ${(props) => props.theme.space[200]};
|
|
15
15
|
min-width: 20px;
|
|
16
16
|
justify-content: center;
|
|
@@ -388,13 +388,6 @@ exports[`Listbox AsListbox with checkboxes should match snapshot 1`] = `
|
|
|
388
388
|
.c2 {
|
|
389
389
|
box-sizing: border-box;
|
|
390
390
|
font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
|
|
391
|
-
margin: 8px;
|
|
392
|
-
padding: 8px;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.c3 {
|
|
396
|
-
box-sizing: border-box;
|
|
397
|
-
font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
|
|
398
391
|
}
|
|
399
392
|
|
|
400
393
|
.c6 {
|
|
@@ -467,6 +460,10 @@ exports[`Listbox AsListbox with checkboxes should match snapshot 1`] = `
|
|
|
467
460
|
cursor: pointer;
|
|
468
461
|
}
|
|
469
462
|
|
|
463
|
+
.c3 {
|
|
464
|
+
padding: 8px;
|
|
465
|
+
}
|
|
466
|
+
|
|
470
467
|
.c1 {
|
|
471
468
|
list-style-type: none;
|
|
472
469
|
outline: 0;
|
|
@@ -561,12 +558,12 @@ exports[`Listbox AsListbox with checkboxes should match snapshot 1`] = `
|
|
|
561
558
|
width="200px"
|
|
562
559
|
>
|
|
563
560
|
<div
|
|
564
|
-
class="c2"
|
|
561
|
+
class="c2 c3"
|
|
565
562
|
role="group"
|
|
566
563
|
>
|
|
567
564
|
<li
|
|
568
565
|
aria-checked="false"
|
|
569
|
-
class="
|
|
566
|
+
class="c2 c4"
|
|
570
567
|
data-qa-menu-item="Apple"
|
|
571
568
|
data-value="Apple"
|
|
572
569
|
id="MenuItem-28"
|
|
@@ -600,7 +597,7 @@ exports[`Listbox AsListbox with checkboxes should match snapshot 1`] = `
|
|
|
600
597
|
</li>
|
|
601
598
|
<li
|
|
602
599
|
aria-checked="false"
|
|
603
|
-
class="
|
|
600
|
+
class="c2 c6"
|
|
604
601
|
data-qa-menu-item="Banana"
|
|
605
602
|
data-value="Banana"
|
|
606
603
|
id="MenuItem-29"
|
|
@@ -634,7 +631,7 @@ exports[`Listbox AsListbox with checkboxes should match snapshot 1`] = `
|
|
|
634
631
|
</li>
|
|
635
632
|
<li
|
|
636
633
|
aria-checked="false"
|
|
637
|
-
class="
|
|
634
|
+
class="c2 c6"
|
|
638
635
|
data-qa-menu-item="Orange"
|
|
639
636
|
data-value="Orange"
|
|
640
637
|
id="MenuItem-30"
|
|
@@ -686,13 +683,6 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
686
683
|
.c2 {
|
|
687
684
|
box-sizing: border-box;
|
|
688
685
|
font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
|
|
689
|
-
margin: 8px;
|
|
690
|
-
padding: 8px;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
.c4 {
|
|
694
|
-
box-sizing: border-box;
|
|
695
|
-
font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
|
|
696
686
|
}
|
|
697
687
|
|
|
698
688
|
.c7 {
|
|
@@ -765,6 +755,10 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
765
755
|
cursor: pointer;
|
|
766
756
|
}
|
|
767
757
|
|
|
758
|
+
.c3 {
|
|
759
|
+
padding: 8px;
|
|
760
|
+
}
|
|
761
|
+
|
|
768
762
|
.c1 {
|
|
769
763
|
list-style-type: none;
|
|
770
764
|
outline: 0;
|
|
@@ -786,12 +780,12 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
786
780
|
margin-right: 8px;
|
|
787
781
|
}
|
|
788
782
|
|
|
789
|
-
.
|
|
783
|
+
.c4 {
|
|
790
784
|
box-sizing: border-box;
|
|
791
785
|
position: relative;
|
|
792
786
|
}
|
|
793
787
|
|
|
794
|
-
.
|
|
788
|
+
.c4 input {
|
|
795
789
|
box-sizing: border-box;
|
|
796
790
|
width: 100%;
|
|
797
791
|
border: 1px solid transparent;
|
|
@@ -812,34 +806,34 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
812
806
|
font-size: 13px;
|
|
813
807
|
}
|
|
814
808
|
|
|
815
|
-
.
|
|
809
|
+
.c4 input::-ms-clear {
|
|
816
810
|
display: none;
|
|
817
811
|
}
|
|
818
812
|
|
|
819
|
-
.
|
|
813
|
+
.c4 input::-webkit-search-cancel-button {
|
|
820
814
|
-webkit-appearance: none;
|
|
821
815
|
-moz-appearance: none;
|
|
822
816
|
appearance: none;
|
|
823
817
|
}
|
|
824
818
|
|
|
825
|
-
.
|
|
819
|
+
.c4 input:focus {
|
|
826
820
|
box-shadow: 0 0 0 1px #2079c3,0 0px 0px 4px rgba(32,121,195,0.3);
|
|
827
821
|
outline: none;
|
|
828
822
|
}
|
|
829
823
|
|
|
830
|
-
.
|
|
824
|
+
.c4 input:focus::-moz-focus-inner {
|
|
831
825
|
border: 0;
|
|
832
826
|
}
|
|
833
827
|
|
|
834
|
-
.
|
|
828
|
+
.c4 input:not(output):not(:focus):-moz-ui-invalid {
|
|
835
829
|
box-shadow: none;
|
|
836
830
|
}
|
|
837
831
|
|
|
838
|
-
.
|
|
832
|
+
.c4 input:placeholder {
|
|
839
833
|
color: #6e797a;
|
|
840
834
|
}
|
|
841
835
|
|
|
842
|
-
.
|
|
836
|
+
.c4 input {
|
|
843
837
|
border: 1px solid #b0b6b7;
|
|
844
838
|
}
|
|
845
839
|
|
|
@@ -916,11 +910,11 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
916
910
|
width="200px"
|
|
917
911
|
>
|
|
918
912
|
<div
|
|
919
|
-
class="c2"
|
|
913
|
+
class="c2 c3"
|
|
920
914
|
role="group"
|
|
921
915
|
>
|
|
922
916
|
<div
|
|
923
|
-
class="
|
|
917
|
+
class="c4"
|
|
924
918
|
>
|
|
925
919
|
<input
|
|
926
920
|
aria-invalid="false"
|
|
@@ -937,7 +931,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
937
931
|
</div>
|
|
938
932
|
<li
|
|
939
933
|
aria-checked="false"
|
|
940
|
-
class="
|
|
934
|
+
class="c2 c5"
|
|
941
935
|
data-qa-menu-item="Apple"
|
|
942
936
|
data-value="Apple"
|
|
943
937
|
id="MenuItem-34"
|
|
@@ -971,7 +965,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
971
965
|
</li>
|
|
972
966
|
<li
|
|
973
967
|
aria-checked="false"
|
|
974
|
-
class="
|
|
968
|
+
class="c2 c7"
|
|
975
969
|
data-qa-menu-item="Banana"
|
|
976
970
|
data-value="Banana"
|
|
977
971
|
id="MenuItem-35"
|
|
@@ -1005,7 +999,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
1005
999
|
</li>
|
|
1006
1000
|
<li
|
|
1007
1001
|
aria-checked="false"
|
|
1008
|
-
class="
|
|
1002
|
+
class="c2 c7"
|
|
1009
1003
|
data-qa-menu-item="Orange"
|
|
1010
1004
|
data-value="Orange"
|
|
1011
1005
|
id="MenuItem-36"
|
|
@@ -1039,7 +1033,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
1039
1033
|
</li>
|
|
1040
1034
|
<li
|
|
1041
1035
|
aria-checked="false"
|
|
1042
|
-
class="
|
|
1036
|
+
class="c2 c7"
|
|
1043
1037
|
data-qa-menu-item="Tomato"
|
|
1044
1038
|
data-value="Tomato"
|
|
1045
1039
|
id="MenuItem-37"
|
|
@@ -1073,7 +1067,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
1073
1067
|
</li>
|
|
1074
1068
|
<li
|
|
1075
1069
|
aria-checked="false"
|
|
1076
|
-
class="
|
|
1070
|
+
class="c2 c7"
|
|
1077
1071
|
data-qa-menu-item="Cucumber"
|
|
1078
1072
|
data-value="Cucumber"
|
|
1079
1073
|
id="MenuItem-38"
|
|
@@ -1107,7 +1101,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
1107
1101
|
</li>
|
|
1108
1102
|
<li
|
|
1109
1103
|
aria-checked="false"
|
|
1110
|
-
class="
|
|
1104
|
+
class="c2 c7"
|
|
1111
1105
|
data-qa-menu-item="Squash"
|
|
1112
1106
|
data-value="Squash"
|
|
1113
1107
|
id="MenuItem-39"
|
|
@@ -1141,7 +1135,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
1141
1135
|
</li>
|
|
1142
1136
|
<li
|
|
1143
1137
|
aria-checked="false"
|
|
1144
|
-
class="
|
|
1138
|
+
class="c2 c7"
|
|
1145
1139
|
data-qa-menu-item="Cantaloupe"
|
|
1146
1140
|
data-value="Cantaloupe"
|
|
1147
1141
|
id="MenuItem-40"
|
|
@@ -1175,7 +1169,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
1175
1169
|
</li>
|
|
1176
1170
|
<li
|
|
1177
1171
|
aria-checked="false"
|
|
1178
|
-
class="
|
|
1172
|
+
class="c2 c7"
|
|
1179
1173
|
data-qa-menu-item="Jackalope"
|
|
1180
1174
|
data-value="Jackalope"
|
|
1181
1175
|
id="MenuItem-41"
|
|
@@ -1209,7 +1203,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
1209
1203
|
</li>
|
|
1210
1204
|
<li
|
|
1211
1205
|
aria-checked="false"
|
|
1212
|
-
class="
|
|
1206
|
+
class="c2 c7"
|
|
1213
1207
|
data-qa-menu-item="Lingonberry"
|
|
1214
1208
|
data-value="Lingonberry"
|
|
1215
1209
|
id="MenuItem-42"
|
|
@@ -1243,7 +1237,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
1243
1237
|
</li>
|
|
1244
1238
|
<li
|
|
1245
1239
|
aria-checked="false"
|
|
1246
|
-
class="
|
|
1240
|
+
class="c2 c7"
|
|
1247
1241
|
data-qa-menu-item="Dingleberry"
|
|
1248
1242
|
data-value="Dingleberry"
|
|
1249
1243
|
id="MenuItem-43"
|
|
@@ -1277,7 +1271,7 @@ exports[`Listbox AsListbox with filter input should match snapshot 1`] = `
|
|
|
1277
1271
|
</li>
|
|
1278
1272
|
<li
|
|
1279
1273
|
aria-checked="false"
|
|
1280
|
-
class="
|
|
1274
|
+
class="c2 c7"
|
|
1281
1275
|
data-qa-menu-item="Kaffir Lime"
|
|
1282
1276
|
data-value="Kaffir Lime"
|
|
1283
1277
|
id="MenuItem-44"
|
|
@@ -22,13 +22,6 @@ exports[`Menu AsMenu should match snapshot 1`] = `
|
|
|
22
22
|
.c4 {
|
|
23
23
|
box-sizing: border-box;
|
|
24
24
|
font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
|
|
25
|
-
margin: 8px;
|
|
26
|
-
padding: 8px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.c5 {
|
|
30
|
-
box-sizing: border-box;
|
|
31
|
-
font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
|
|
32
25
|
}
|
|
33
26
|
|
|
34
27
|
.c7 {
|
|
@@ -101,6 +94,10 @@ exports[`Menu AsMenu should match snapshot 1`] = `
|
|
|
101
94
|
cursor: pointer;
|
|
102
95
|
}
|
|
103
96
|
|
|
97
|
+
.c5 {
|
|
98
|
+
padding: 8px;
|
|
99
|
+
}
|
|
100
|
+
|
|
104
101
|
.c1 {
|
|
105
102
|
list-style-type: none;
|
|
106
103
|
outline: 0;
|
|
@@ -141,11 +138,11 @@ exports[`Menu AsMenu should match snapshot 1`] = `
|
|
|
141
138
|
</div>
|
|
142
139
|
</div>
|
|
143
140
|
<div
|
|
144
|
-
class="c4"
|
|
141
|
+
class="c4 c5"
|
|
145
142
|
role="group"
|
|
146
143
|
>
|
|
147
144
|
<li
|
|
148
|
-
class="
|
|
145
|
+
class="c4 c6"
|
|
149
146
|
data-qa-menu-item="Apple"
|
|
150
147
|
id="MenuItem-1"
|
|
151
148
|
role="menuitem"
|
|
@@ -162,7 +159,7 @@ exports[`Menu AsMenu should match snapshot 1`] = `
|
|
|
162
159
|
</div>
|
|
163
160
|
</li>
|
|
164
161
|
<li
|
|
165
|
-
class="
|
|
162
|
+
class="c4 c7"
|
|
166
163
|
data-qa-menu-item="Banana"
|
|
167
164
|
id="MenuItem-2"
|
|
168
165
|
role="menuitem"
|
|
@@ -179,7 +176,7 @@ exports[`Menu AsMenu should match snapshot 1`] = `
|
|
|
179
176
|
</div>
|
|
180
177
|
</li>
|
|
181
178
|
<li
|
|
182
|
-
class="
|
|
179
|
+
class="c4 c7"
|
|
183
180
|
data-qa-menu-item="Orange"
|
|
184
181
|
id="MenuItem-3"
|
|
185
182
|
role="menuitem"
|
|
@@ -209,11 +206,11 @@ exports[`Menu AsMenu should match snapshot 1`] = `
|
|
|
209
206
|
</div>
|
|
210
207
|
</div>
|
|
211
208
|
<div
|
|
212
|
-
class="c4"
|
|
209
|
+
class="c4 c5"
|
|
213
210
|
role="group"
|
|
214
211
|
>
|
|
215
212
|
<li
|
|
216
|
-
class="
|
|
213
|
+
class="c4 c7"
|
|
217
214
|
data-qa-menu-item="Tomato"
|
|
218
215
|
id="MenuItem-4"
|
|
219
216
|
role="menuitem"
|
|
@@ -230,7 +227,7 @@ exports[`Menu AsMenu should match snapshot 1`] = `
|
|
|
230
227
|
</div>
|
|
231
228
|
</li>
|
|
232
229
|
<li
|
|
233
|
-
class="
|
|
230
|
+
class="c4 c7"
|
|
234
231
|
data-qa-menu-item="Cucumber"
|
|
235
232
|
id="MenuItem-5"
|
|
236
233
|
role="menuitem"
|
|
@@ -247,7 +244,7 @@ exports[`Menu AsMenu should match snapshot 1`] = `
|
|
|
247
244
|
</div>
|
|
248
245
|
</li>
|
|
249
246
|
<li
|
|
250
|
-
class="
|
|
247
|
+
class="c4 c7"
|
|
251
248
|
data-qa-menu-item="Squash"
|
|
252
249
|
id="MenuItem-6"
|
|
253
250
|
role="menuitem"
|
package/__flow__/Menu/index.js
CHANGED
|
@@ -10,7 +10,11 @@ import {
|
|
|
10
10
|
useState,
|
|
11
11
|
} from "react";
|
|
12
12
|
import uniqueId from "lodash.uniqueid";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
MenuGroupContainer,
|
|
15
|
+
MenuItemContainer,
|
|
16
|
+
MenuItemsContainer,
|
|
17
|
+
} from "./styles";
|
|
14
18
|
import { MENU_ITEM_ROLES, MENU_ROLES } from "./constants";
|
|
15
19
|
|
|
16
20
|
import Box from "../Box";
|
|
@@ -287,9 +291,9 @@ export const MenuGroup = ({
|
|
|
287
291
|
</Text>
|
|
288
292
|
</Box>
|
|
289
293
|
)}
|
|
290
|
-
<
|
|
294
|
+
<MenuGroupContainer {...props} role="group">
|
|
291
295
|
{children}
|
|
292
|
-
</
|
|
296
|
+
</MenuGroupContainer>
|
|
293
297
|
</>
|
|
294
298
|
);
|
|
295
299
|
|
package/__flow__/Menu/styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import styled, { css } from "styled-components";
|
|
3
3
|
import Box from "../Box";
|
|
4
|
-
import type { TypeMenuItemProps } from "./index.flow";
|
|
4
|
+
import type { TypeMenuGroupProps, TypeMenuItemProps } from "./index.flow";
|
|
5
5
|
import type { TypeTheme } from "../types/theme.flow";
|
|
6
6
|
import { disabled } from "../utils/mixins";
|
|
7
7
|
|
|
@@ -84,7 +84,24 @@ export const MenuItemContainer = styled<
|
|
|
84
84
|
${(props) => props.disabled && disabled}
|
|
85
85
|
`;
|
|
86
86
|
|
|
87
|
+
export const MenuGroupContainer = styled<
|
|
88
|
+
typeof Box,
|
|
89
|
+
TypeTheme,
|
|
90
|
+
TypeMenuGroupProps
|
|
91
|
+
>(Box)`
|
|
92
|
+
${(props) =>
|
|
93
|
+
props.appearance === "flush"
|
|
94
|
+
? css`
|
|
95
|
+
margin: 0 -${(props) => props.theme.space[300]};
|
|
96
|
+
`
|
|
97
|
+
: css`
|
|
98
|
+
padding: ${(props) => props.theme.space[300]};
|
|
99
|
+
`};
|
|
100
|
+
`;
|
|
101
|
+
|
|
87
102
|
export const MenuItemsContainer = styled<typeof Box, TypeTheme>(Box)`
|
|
88
103
|
list-style-type: none;
|
|
89
104
|
outline: 0;
|
|
90
105
|
`;
|
|
106
|
+
|
|
107
|
+
export default MenuGroupContainer;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Modal should render properly 1`] = `
|
|
4
|
+
.c0__Overlay {
|
|
5
|
+
position: fixed;
|
|
6
|
+
top: 0px;
|
|
7
|
+
left: 0px;
|
|
8
|
+
right: 0px;
|
|
9
|
+
bottom: 0px;
|
|
10
|
+
display: -webkit-box;
|
|
11
|
+
display: -webkit-flex;
|
|
12
|
+
display: -ms-flexbox;
|
|
13
|
+
display: flex;
|
|
14
|
+
-webkit-align-items: center;
|
|
15
|
+
-webkit-box-align: center;
|
|
16
|
+
-ms-flex-align: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
-webkit-box-pack: center;
|
|
19
|
+
-webkit-justify-content: center;
|
|
20
|
+
-ms-flex-pack: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
background-color: rgba(22,32,32,0.68);
|
|
23
|
+
opacity: 0;
|
|
24
|
+
will-change: opacity;
|
|
25
|
+
-webkit-transition: opacity .3s cubic-bezier(.4,0,.2,1);
|
|
26
|
+
transition: opacity .3s cubic-bezier(.4,0,.2,1);
|
|
27
|
+
z-index: 6;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.c0__Overlay.ReactModal__Overlay--after-open {
|
|
31
|
+
opacity: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.c0__Overlay.ReactModal__Overlay--before-close {
|
|
35
|
+
opacity: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.c0__Content {
|
|
39
|
+
display: -webkit-box;
|
|
40
|
+
display: -webkit-flex;
|
|
41
|
+
display: -ms-flexbox;
|
|
42
|
+
display: flex;
|
|
43
|
+
-webkit-flex-direction: column;
|
|
44
|
+
-ms-flex-direction: column;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
background: #FFFFFF;
|
|
47
|
+
border-radius: 6px;
|
|
48
|
+
box-shadow: 0px 8px 16px rgba(39,51,51,.24);
|
|
49
|
+
-webkit-filter: blur(0);
|
|
50
|
+
filter: blur(0);
|
|
51
|
+
color: #364141;
|
|
52
|
+
outline: none;
|
|
53
|
+
max-width: calc(100vw - 64px);
|
|
54
|
+
max-height: calc(100vh - 64px);
|
|
55
|
+
width: 800px;
|
|
56
|
+
background-color: #c1c1f7;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none) {
|
|
60
|
+
.c0__Content {
|
|
61
|
+
height: calc(100vh - 64px);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
<div
|
|
66
|
+
class="ReactModal__Overlay ReactModal__Overlay--after-open styles__Container-sc-9lom4g-0__Overlay c0 c0__Overlay"
|
|
67
|
+
>
|
|
68
|
+
<div
|
|
69
|
+
aria-label="Label"
|
|
70
|
+
aria-modal="true"
|
|
71
|
+
class="ReactModal__Content ReactModal__Content--after-open styles__Container-sc-9lom4g-0__Content c0 c0__Content"
|
|
72
|
+
data-qa-modal=""
|
|
73
|
+
data-qa-modal-isopen="true"
|
|
74
|
+
role="dialog"
|
|
75
|
+
tabindex="-1"
|
|
76
|
+
>
|
|
77
|
+
ajdsfljasdlfjlasdjf
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
`;
|
|
@@ -7,6 +7,22 @@ import { COLOR_PURPLE_300 } from "@sproutsocial/seeds-color";
|
|
|
7
7
|
afterEach(() => cleanup());
|
|
8
8
|
|
|
9
9
|
describe("Modal", () => {
|
|
10
|
+
it("should render properly", () => {
|
|
11
|
+
// Use baseElement since it renders in a Portal
|
|
12
|
+
const { baseElement } = render(
|
|
13
|
+
<Modal
|
|
14
|
+
isOpen={true}
|
|
15
|
+
label="Label"
|
|
16
|
+
bg={COLOR_PURPLE_300}
|
|
17
|
+
onClose={() => {}}
|
|
18
|
+
closeButtonLabel="Close this dialog"
|
|
19
|
+
>
|
|
20
|
+
ajdsfljasdlfjlasdjf
|
|
21
|
+
</Modal>
|
|
22
|
+
);
|
|
23
|
+
expect(baseElement.querySelector(".ReactModal__Overlay")).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
|
|
10
26
|
it("renders a custom background color", () => {
|
|
11
27
|
// Use baseElement since it renders in a Portal
|
|
12
28
|
const { baseElement } = render(
|
package/__flow__/Modal/styles.js
CHANGED
|
@@ -84,7 +84,7 @@ export const Container: StyledComponent<any, TypeTheme, *> = styled(ReactModalAd
|
|
|
84
84
|
flex-direction: column;
|
|
85
85
|
background: ${(props) => props.theme.colors.container.background.base};
|
|
86
86
|
border-radius: ${(props) => props.theme.radii[500]};
|
|
87
|
-
box-shadow: ${(props) => props.theme.shadows
|
|
87
|
+
box-shadow: ${(props) => props.theme.shadows[300]};
|
|
88
88
|
filter: blur(0);
|
|
89
89
|
color: ${(props) => props.theme.colors.text.body};
|
|
90
90
|
|
package/__flow__/Popout/index.js
CHANGED
|
@@ -5,10 +5,10 @@ import theme from "../themes/default/theme";
|
|
|
5
5
|
|
|
6
6
|
import typeof { default as TypeTheme } from "../themes/default/theme";
|
|
7
7
|
|
|
8
|
-
type TypeProps =
|
|
8
|
+
type TypeProps = {|
|
|
9
9
|
theme?: TypeTheme,
|
|
10
10
|
children: React.Node,
|
|
11
|
-
|}
|
|
11
|
+
|};
|
|
12
12
|
|
|
13
13
|
const ThemeProvider = (props: TypeProps) => (
|
|
14
14
|
<BaseThemeProvider {...props} theme={props.theme || theme} />
|