@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.
- package/CHANGELOG.md +12 -0
- package/__flow__/Button/index.js +2 -0
- package/__flow__/Button/index.stories.js +51 -67
- package/__flow__/Button/styles.js +1 -1
- package/__flow__/Checkbox/styles.js +75 -75
- package/__flow__/Collapsible/index.js +2 -3
- package/__flow__/EmptyState/index.test.js +1 -1
- package/__flow__/Image/index.js +2 -10
- package/__flow__/Menu/__snapshots__/index.test.js.snap +2 -2
- package/__flow__/SegmentedControl/index.js +2 -3
- package/__flow__/TableCell/index.js +2 -9
- package/__flow__/ThemeProvider/index.js +6 -2
- package/__flow__/ToggleHint/index.js +2 -9
- package/__flow__/index.js +5 -0
- package/__flow__/setupTests.js +1 -1
- package/__flow__/systemProps/color.js +2 -1
- package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +0 -14
- package/__flow__/systemProps/tests/layout.test.js +0 -9
- package/__flow__/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +17 -0
- package/__flow__/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +36 -0
- package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +23 -0
- package/__flow__/themes/extendedThemes/sproutTheme/index.js +4 -0
- package/__flow__/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +36 -0
- package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +23 -0
- package/__flow__/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +36 -0
- package/__flow__/types/theme.flow.js +17 -0
- package/__flow__/utils/responsiveProps/index.test.js +2 -10
- package/commonjs/Avatar/index.js +7 -4
- package/commonjs/Badge/index.js +3 -1
- package/commonjs/Badge/styles.js +1 -1
- package/commonjs/Banner/index.js +3 -1
- package/commonjs/Banner/styles.js +1 -1
- package/commonjs/Box/styles.js +1 -1
- package/commonjs/Breadcrumb/index.js +5 -2
- package/commonjs/Button/index.js +4 -1
- package/commonjs/Button/styles.js +1 -0
- package/commonjs/Card/index.js +3 -1
- package/commonjs/Card/styles.js +3 -3
- package/commonjs/CharacterCounter/index.js +3 -1
- package/commonjs/CharacterCounter/styles.js +1 -1
- package/commonjs/ChartLegend/index.js +3 -1
- package/commonjs/ChartLegend/styles.js +3 -3
- package/commonjs/Checkbox/index.js +3 -1
- package/commonjs/Checkbox/styles.js +1 -1
- package/commonjs/Collapsible/index.js +5 -2
- package/commonjs/DatePicker/DateRangePicker.js +3 -1
- package/commonjs/DatePicker/SingleDatePicker.js +3 -1
- package/commonjs/DatePicker/StatefulDateRangePicker.js +3 -1
- package/commonjs/DatePicker/StatefulSingleDatePicker.js +3 -1
- package/commonjs/DatePicker/common.js +1 -1
- package/commonjs/DatePicker/styles.js +2 -6
- package/commonjs/Drawer/SlideTransition.js +3 -1
- package/commonjs/Drawer/index.js +9 -4
- package/commonjs/Drawer/styles.js +2 -2
- package/commonjs/EmptyState/index.js +3 -1
- package/commonjs/Fieldset/index.js +7 -3
- package/commonjs/FormField/index.js +3 -1
- package/commonjs/Icon/index.js +5 -2
- package/commonjs/Icon/styles.js +1 -1
- package/commonjs/Image/index.js +3 -1
- package/commonjs/Image/styles.js +1 -1
- package/commonjs/Indicator/index.js +3 -1
- package/commonjs/Input/index.js +3 -1
- package/commonjs/Input/styles.js +2 -2
- package/commonjs/KeyboardKey/index.js +3 -1
- package/commonjs/Label/index.js +4 -2
- package/commonjs/Link/index.js +3 -1
- package/commonjs/Link/styles.js +1 -1
- package/commonjs/Listbox/index.js +7 -4
- package/commonjs/Loader/index.js +3 -1
- package/commonjs/Loader/styles.js +2 -2
- package/commonjs/LoaderButton/index.js +3 -1
- package/commonjs/Menu/constants.js +1 -1
- package/commonjs/Menu/descendants.js +10 -7
- package/commonjs/Menu/hooks.js +1 -1
- package/commonjs/Menu/index.js +22 -16
- package/commonjs/Menu/styles.js +2 -2
- package/commonjs/Message/index.js +3 -1
- package/commonjs/Message/styles.js +2 -2
- package/commonjs/Modal/index.js +7 -3
- package/commonjs/Modal/styles.js +4 -6
- package/commonjs/Numeral/constants.js +1 -1
- package/commonjs/Numeral/index.js +3 -1
- package/commonjs/Numeral/styles.js +3 -3
- package/commonjs/OverflowList/styles.js +1 -1
- package/commonjs/Popout/index.js +7 -3
- package/commonjs/Popout/styles.js +1 -1
- package/commonjs/Radio/index.js +3 -1
- package/commonjs/Radio/styles.js +4 -4
- package/commonjs/SegmentedControl/index.js +5 -2
- package/commonjs/Select/index.js +3 -1
- package/commonjs/Stack/index.js +3 -1
- package/commonjs/Switch/index.js +3 -1
- package/commonjs/Switch/styles.js +1 -1
- package/commonjs/Table/index.js +10 -5
- package/commonjs/TableCell/index.js +3 -1
- package/commonjs/TableHeaderCell/index.js +3 -1
- package/commonjs/TableRowAccordion/index.js +3 -1
- package/commonjs/Tabs/index.js +5 -2
- package/commonjs/Tabs/styles.js +4 -4
- package/commonjs/Text/index.js +3 -1
- package/commonjs/Text/styles.js +1 -1
- package/commonjs/Textarea/index.js +3 -1
- package/commonjs/Toast/index.js +15 -15
- package/commonjs/Toast/styles.js +4 -7
- package/commonjs/ToggleHint/index.js +3 -1
- package/commonjs/Token/index.js +3 -1
- package/commonjs/Token/styles.js +1 -1
- package/commonjs/TokenInput/index.js +3 -1
- package/commonjs/Tooltip/index.js +5 -2
- package/commonjs/Tooltip/styles.js +1 -1
- package/commonjs/VisuallyHidden/index.js +1 -1
- package/commonjs/index.js +8 -1
- package/commonjs/themes/dark/decorative-palettes.js +1 -1
- package/commonjs/themes/dark/theme.js +1 -1
- package/commonjs/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +16 -0
- package/commonjs/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +39 -0
- package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +28 -0
- package/commonjs/themes/extendedThemes/sproutTheme/index.js +14 -0
- package/commonjs/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +39 -0
- package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +28 -0
- package/commonjs/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +1 -0
- package/commonjs/themes/light/decorative-palettes.js +1 -1
- package/commonjs/themes/light/theme.js +1 -1
- package/commonjs/utils/hooks.js +3 -2
- package/commonjs/utils/mixins.js +1 -1
- package/commonjs/utils/system-props.js +1 -1
- package/dist/themes/dark/dark.scss +5 -5
- package/dist/themes/light/light.scss +95 -95
- package/lib/Avatar/index.js +7 -4
- package/lib/Badge/index.js +3 -1
- package/lib/Badge/styles.js +1 -1
- package/lib/Banner/index.js +3 -1
- package/lib/Banner/styles.js +1 -1
- package/lib/Box/styles.js +1 -1
- package/lib/Breadcrumb/index.js +5 -2
- package/lib/Button/index.js +4 -1
- package/lib/Button/styles.js +1 -0
- package/lib/Card/index.js +3 -1
- package/lib/Card/styles.js +2 -2
- package/lib/CharacterCounter/index.js +3 -1
- package/lib/CharacterCounter/styles.js +1 -1
- package/lib/ChartLegend/index.js +3 -1
- package/lib/ChartLegend/styles.js +3 -3
- package/lib/Checkbox/index.js +3 -1
- package/lib/Collapsible/index.js +5 -2
- package/lib/DatePicker/DateRangePicker.js +3 -1
- package/lib/DatePicker/SingleDatePicker.js +3 -1
- package/lib/DatePicker/StatefulDateRangePicker.js +3 -1
- package/lib/DatePicker/StatefulSingleDatePicker.js +3 -1
- package/lib/DatePicker/styles.js +2 -6
- package/lib/Drawer/SlideTransition.js +3 -1
- package/lib/Drawer/index.js +9 -4
- package/lib/Drawer/styles.js +2 -2
- package/lib/EmptyState/index.js +3 -1
- package/lib/Fieldset/index.js +7 -3
- package/lib/FormField/index.js +3 -1
- package/lib/Icon/index.js +5 -2
- package/lib/Icon/styles.js +1 -1
- package/lib/Image/index.js +3 -1
- package/lib/Image/styles.js +1 -1
- package/lib/Indicator/index.js +3 -1
- package/lib/Input/index.js +3 -1
- package/lib/Input/styles.js +2 -2
- package/lib/KeyboardKey/index.js +3 -1
- package/lib/Label/index.js +4 -2
- package/lib/Link/index.js +3 -1
- package/lib/Link/styles.js +1 -1
- package/lib/Listbox/index.js +6 -3
- package/lib/Loader/index.js +3 -1
- package/lib/Loader/styles.js +2 -2
- package/lib/LoaderButton/index.js +3 -1
- package/lib/Menu/descendants.js +5 -2
- package/lib/Menu/index.js +20 -16
- package/lib/Menu/styles.js +2 -2
- package/lib/Message/index.js +3 -1
- package/lib/Message/styles.js +1 -1
- package/lib/Modal/index.js +7 -3
- package/lib/Modal/styles.js +3 -5
- package/lib/Numeral/index.js +3 -1
- package/lib/Numeral/styles.js +2 -2
- package/lib/OverflowList/styles.js +1 -1
- package/lib/Popout/index.js +7 -3
- package/lib/Popout/styles.js +1 -1
- package/lib/Radio/index.js +3 -1
- package/lib/Radio/styles.js +4 -4
- package/lib/SegmentedControl/index.js +5 -2
- package/lib/Select/index.js +3 -1
- package/lib/Stack/index.js +3 -1
- package/lib/Switch/index.js +3 -1
- package/lib/Switch/styles.js +1 -1
- package/lib/Table/index.js +9 -4
- package/lib/TableCell/index.js +3 -1
- package/lib/TableHeaderCell/index.js +3 -1
- package/lib/TableRowAccordion/index.js +3 -1
- package/lib/Tabs/index.js +5 -2
- package/lib/Tabs/styles.js +3 -3
- package/lib/Text/index.js +3 -1
- package/lib/Text/styles.js +1 -1
- package/lib/Textarea/index.js +3 -1
- package/lib/Toast/index.js +14 -14
- package/lib/Toast/styles.js +3 -7
- package/lib/ToggleHint/index.js +3 -1
- package/lib/Token/index.js +3 -1
- package/lib/Token/styles.js +1 -1
- package/lib/TokenInput/index.js +3 -1
- package/lib/Tooltip/index.js +5 -2
- package/lib/Tooltip/styles.js +1 -1
- package/lib/VisuallyHidden/index.js +1 -1
- package/lib/index.js +1 -0
- package/lib/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +12 -0
- package/lib/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +34 -0
- package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +16 -0
- package/lib/themes/extendedThemes/sproutTheme/index.js +2 -0
- package/lib/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +34 -0
- package/lib/themes/extendedThemes/sproutTheme/light/theme.js +16 -0
- package/lib/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +0 -0
- package/package.json +25 -20
- package/__flow__/Button/__snapshots__/index.test.js.snap +0 -511
- package/__flow__/Button/index.test.js +0 -113
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 11.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 43adc28: Added a sprout theme to racine
|
|
8
|
+
|
|
9
|
+
## 11.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- fa8a45d: Dependency upgrades: upgraded severe vulnerabilities as well as storybook and jest suite fixes. Upgraded styled components from beta to stable v5.2.3.
|
|
14
|
+
|
|
3
15
|
## 11.4.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/__flow__/Button/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { boolean, text, number } from "@storybook/addon-knobs";
|
|
3
2
|
import Button from "./index";
|
|
4
3
|
import Icon from "../Icon";
|
|
5
4
|
import Box from "../Box";
|
|
@@ -8,155 +7,140 @@ export default {
|
|
|
8
7
|
title: "Button",
|
|
9
8
|
};
|
|
10
9
|
|
|
11
|
-
export const defaultStory = () => (
|
|
12
|
-
<Button
|
|
13
|
-
appearance={text("appearance", "default")}
|
|
14
|
-
onClick={() => alert("Testing...")}
|
|
15
|
-
>
|
|
10
|
+
export const defaultStory = (args) => (
|
|
11
|
+
<Button {...args} onClick={() => alert("Testing...")}>
|
|
16
12
|
Default
|
|
17
13
|
</Button>
|
|
18
14
|
);
|
|
19
15
|
|
|
16
|
+
defaultStory.args = { appearance: "default" };
|
|
17
|
+
|
|
20
18
|
defaultStory.story = {
|
|
21
19
|
name: "Default",
|
|
22
20
|
};
|
|
23
21
|
|
|
24
|
-
export const primary = () => (
|
|
25
|
-
<Button
|
|
26
|
-
appearance={text("appearance", "primary")}
|
|
27
|
-
onClick={() => alert("Testing...")}
|
|
28
|
-
>
|
|
22
|
+
export const primary = (args) => (
|
|
23
|
+
<Button {...args} onClick={() => alert("Testing...")}>
|
|
29
24
|
Primary Button
|
|
30
25
|
</Button>
|
|
31
26
|
);
|
|
32
27
|
|
|
28
|
+
primary.args = { appearance: "primary" };
|
|
29
|
+
|
|
33
30
|
primary.story = {
|
|
34
31
|
name: "Primary",
|
|
35
32
|
};
|
|
36
33
|
|
|
37
|
-
export const secondary = () =>
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
export const secondary = (args) => <Button {...args}>Secondary Button</Button>;
|
|
35
|
+
|
|
36
|
+
secondary.args = { appearance: "secondary" };
|
|
40
37
|
|
|
41
38
|
secondary.story = {
|
|
42
39
|
name: "Secondary",
|
|
43
40
|
};
|
|
44
41
|
|
|
45
|
-
export const destructive = () => (
|
|
46
|
-
<Button
|
|
47
|
-
Destructive Button
|
|
48
|
-
</Button>
|
|
42
|
+
export const destructive = (args) => (
|
|
43
|
+
<Button {...args}>Destructive Button</Button>
|
|
49
44
|
);
|
|
50
45
|
|
|
46
|
+
destructive.args = { appearance: "destructive" };
|
|
51
47
|
destructive.story = {
|
|
52
48
|
name: "Destructive",
|
|
53
49
|
};
|
|
54
50
|
|
|
55
|
-
export const placeholder = () => (
|
|
56
|
-
<Button
|
|
57
|
-
Placeholder Button
|
|
58
|
-
</Button>
|
|
51
|
+
export const placeholder = (args) => (
|
|
52
|
+
<Button {...args}>Placeholder Button</Button>
|
|
59
53
|
);
|
|
60
54
|
|
|
55
|
+
placeholder.args = { appearance: "placeholder" };
|
|
61
56
|
placeholder.story = {
|
|
62
57
|
name: "Placeholder",
|
|
63
58
|
};
|
|
64
59
|
|
|
65
|
-
export const largeButton = () =>
|
|
66
|
-
|
|
67
|
-
appearance={text("appearance", "primary")}
|
|
68
|
-
size={text("size", "large")}
|
|
69
|
-
>
|
|
70
|
-
Large Button
|
|
71
|
-
</Button>
|
|
72
|
-
);
|
|
60
|
+
export const largeButton = (args) => <Button {...args}>Large Button</Button>;
|
|
61
|
+
largeButton.args = { size: "large", appearance: "primary" };
|
|
73
62
|
|
|
74
63
|
largeButton.story = {
|
|
75
64
|
name: "Large button",
|
|
76
65
|
};
|
|
77
66
|
|
|
78
|
-
export const pillButton = () => (
|
|
67
|
+
export const pillButton = (args) => (
|
|
79
68
|
<Box bg="container.background.base" p={400}>
|
|
80
|
-
<Button
|
|
69
|
+
<Button {...args}>
|
|
81
70
|
<Icon name="reply" mr={350} />
|
|
82
71
|
Pill Button
|
|
83
72
|
</Button>
|
|
84
73
|
</Box>
|
|
85
74
|
);
|
|
86
|
-
|
|
75
|
+
pillButton.args = { appearance: "pill" };
|
|
87
76
|
pillButton.story = {
|
|
88
77
|
name: "Pill button",
|
|
89
78
|
};
|
|
90
79
|
|
|
91
|
-
export const pillIconOnlyButton = () => (
|
|
80
|
+
export const pillIconOnlyButton = (args) => (
|
|
92
81
|
<Box bg="container.background.base" p={400}>
|
|
93
|
-
<Button
|
|
82
|
+
<Button {...args} ariaLabel="This is a label">
|
|
94
83
|
<Icon name="circle-check-outline" />
|
|
95
84
|
</Button>
|
|
96
85
|
</Box>
|
|
97
86
|
);
|
|
98
87
|
|
|
88
|
+
pillIconOnlyButton.args = { appearance: "pill" };
|
|
99
89
|
pillIconOnlyButton.story = {
|
|
100
90
|
name: "Pill icon only button",
|
|
101
91
|
};
|
|
102
92
|
|
|
103
|
-
export const activeButton = () =>
|
|
104
|
-
<Button
|
|
105
|
-
appearance={text("appearance", "secondary")}
|
|
106
|
-
active={boolean("active", true)}
|
|
107
|
-
>
|
|
108
|
-
Active Button
|
|
109
|
-
</Button>
|
|
110
|
-
);
|
|
93
|
+
export const activeButton = (args) => <Button {...args}>Active Button</Button>;
|
|
111
94
|
|
|
95
|
+
activeButton.args = { appearance: "secondary", active: true };
|
|
112
96
|
activeButton.story = {
|
|
113
97
|
name: "Active button",
|
|
114
98
|
};
|
|
115
99
|
|
|
116
|
-
export const buttonAsALink = () => (
|
|
117
|
-
<Button
|
|
118
|
-
href={text("href", "http://sproutsocial.style")}
|
|
119
|
-
external={boolean("external", true)}
|
|
120
|
-
appearance={text("appearance", "primary")}
|
|
121
|
-
>
|
|
122
|
-
Button using anchor element
|
|
123
|
-
</Button>
|
|
100
|
+
export const buttonAsALink = (args) => (
|
|
101
|
+
<Button {...args}>Button using anchor element</Button>
|
|
124
102
|
);
|
|
125
|
-
|
|
103
|
+
buttonAsALink.args = {
|
|
104
|
+
appearance: "primary",
|
|
105
|
+
external: true,
|
|
106
|
+
href: "http://sproutsocial.style",
|
|
107
|
+
};
|
|
126
108
|
buttonAsALink.story = {
|
|
127
109
|
name: "Button as a link",
|
|
128
110
|
};
|
|
129
111
|
|
|
130
|
-
export const disabledButton = () => (
|
|
131
|
-
<Button
|
|
132
|
-
appearance={text("appearance", "primary")}
|
|
133
|
-
disabled={text("disabled", "true")}
|
|
134
|
-
>
|
|
135
|
-
This Button is disabled
|
|
136
|
-
</Button>
|
|
112
|
+
export const disabledButton = (args) => (
|
|
113
|
+
<Button {...args}>This Button is disabled</Button>
|
|
137
114
|
);
|
|
138
|
-
|
|
115
|
+
disabledButton.args = {
|
|
116
|
+
appearance: "primary",
|
|
117
|
+
disabled: true,
|
|
118
|
+
};
|
|
139
119
|
disabledButton.story = {
|
|
140
120
|
name: "Disabled button",
|
|
141
121
|
};
|
|
142
122
|
|
|
143
|
-
export const fullWidthButton = () => (
|
|
144
|
-
<Button
|
|
145
|
-
Full-Width Button
|
|
146
|
-
</Button>
|
|
123
|
+
export const fullWidthButton = (args) => (
|
|
124
|
+
<Button {...args}>Full-Width Button</Button>
|
|
147
125
|
);
|
|
148
|
-
|
|
126
|
+
fullWidthButton.args = {
|
|
127
|
+
appearance: "primary",
|
|
128
|
+
width: 1,
|
|
129
|
+
};
|
|
149
130
|
fullWidthButton.story = {
|
|
150
131
|
name: "Full width button",
|
|
151
132
|
};
|
|
152
133
|
|
|
153
|
-
export const withIcon = () => (
|
|
154
|
-
<Button
|
|
134
|
+
export const withIcon = (args) => (
|
|
135
|
+
<Button {...args}>
|
|
155
136
|
<Icon name="twitter" mr={350} />
|
|
156
137
|
Secondary Button
|
|
157
138
|
</Button>
|
|
158
139
|
);
|
|
159
140
|
|
|
141
|
+
withIcon.args = {
|
|
142
|
+
appearance: "secondary",
|
|
143
|
+
};
|
|
160
144
|
withIcon.story = {
|
|
161
145
|
name: "With icon",
|
|
162
146
|
};
|
|
@@ -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
|
|
@@ -3,10 +3,14 @@ import * as React from "react";
|
|
|
3
3
|
import { ThemeProvider as BaseThemeProvider } from "styled-components";
|
|
4
4
|
import theme from "../themes/light/theme";
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import type { TypeTheme } from "../types/theme.flow";
|
|
7
|
+
import type { TypeSproutTheme } from "../themes/extendedThemes/sproutTheme/sproutThemeType.flow";
|
|
8
|
+
|
|
9
|
+
// We can append additional themes types here
|
|
10
|
+
type TypeAllThemes = TypeTheme | TypeSproutTheme;
|
|
7
11
|
|
|
8
12
|
type TypeProps = $ReadOnly<{|
|
|
9
|
-
theme?:
|
|
13
|
+
theme?: TypeAllThemes,
|
|
10
14
|
children: React.Node,
|
|
11
15
|
|}>;
|
|
12
16
|
|
|
@@ -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
|
package/__flow__/index.js
CHANGED
|
@@ -6,6 +6,11 @@ export { visuallyHidden, focusRing, disabled } from "./utils/mixins";
|
|
|
6
6
|
export { useSelect, useMultiselect, useTextContent } from "./utils/hooks";
|
|
7
7
|
export { default as theme } from "./themes/light/theme";
|
|
8
8
|
export { default as darkTheme } from "./themes/dark/theme";
|
|
9
|
+
export {
|
|
10
|
+
sproutLightTheme,
|
|
11
|
+
sproutDarkTheme,
|
|
12
|
+
} from "./themes/extendedThemes/sproutTheme";
|
|
13
|
+
export type { TypeSproutTheme } from "./themes/extendedThemes/sproutTheme";
|
|
9
14
|
export { default as Icon } from "./Icon";
|
|
10
15
|
// DEPRECATED: Alert has been renamed to Banner
|
|
11
16
|
export { default as Alert } from "./Banner";
|
package/__flow__/setupTests.js
CHANGED
|
@@ -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,
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`layout system props display 1`] = `
|
|
4
|
-
.c0 {
|
|
5
|
-
display: -webkit-string;
|
|
6
|
-
display: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
<div>
|
|
10
|
-
<div
|
|
11
|
-
class="c0"
|
|
12
|
-
display="string"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
3
|
exports[`layout system props height 1`] = `
|
|
18
4
|
.c0 {
|
|
19
5
|
height: string;
|
|
@@ -10,15 +10,6 @@ describe("layout system props", () => {
|
|
|
10
10
|
${layoutSystemProps}
|
|
11
11
|
`;
|
|
12
12
|
|
|
13
|
-
test("display", () => {
|
|
14
|
-
const { container } = render(
|
|
15
|
-
<>
|
|
16
|
-
<Component display="string" />
|
|
17
|
-
</>
|
|
18
|
-
);
|
|
19
|
-
expect(container).toMatchSnapshot();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
13
|
test("height", () => {
|
|
23
14
|
const { container } = render(
|
|
24
15
|
<>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
import type {
|
|
3
|
+
TypeNonColorThemeValues,
|
|
4
|
+
TypeTheme,
|
|
5
|
+
} from "../../../../types/theme.flow.js";
|
|
6
|
+
|
|
7
|
+
export function getNonColorThemeValues(
|
|
8
|
+
theme: TypeTheme
|
|
9
|
+
): TypeNonColorThemeValues {
|
|
10
|
+
const { colors, ...otherThemeValues } = theme;
|
|
11
|
+
return {
|
|
12
|
+
...otherThemeValues,
|
|
13
|
+
/**
|
|
14
|
+
* You can add your own theme values or overrides here.
|
|
15
|
+
*/
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
import type { TypeColors } from "../../../../types/theme.colors.flow.js";
|
|
3
|
+
|
|
4
|
+
export function getDarkThemeColors(themeColors: TypeColors) {
|
|
5
|
+
return {
|
|
6
|
+
...themeColors,
|
|
7
|
+
navigation: {
|
|
8
|
+
main: {
|
|
9
|
+
background: {
|
|
10
|
+
base: themeColors.neutral[1000],
|
|
11
|
+
gradient: themeColors.neutral[1100],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
secondary: {
|
|
15
|
+
background: {
|
|
16
|
+
base: themeColors.neutral[900],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
text: {
|
|
20
|
+
base: themeColors.neutral[0],
|
|
21
|
+
hover: themeColors.neutral[0],
|
|
22
|
+
},
|
|
23
|
+
icon: {
|
|
24
|
+
base: themeColors.neutral[0],
|
|
25
|
+
hover: themeColors.neutral[0],
|
|
26
|
+
},
|
|
27
|
+
listItem: {
|
|
28
|
+
background: {
|
|
29
|
+
base: themeColors.neutral[1000],
|
|
30
|
+
hover: themeColors.neutral[1100],
|
|
31
|
+
active: themeColors.neutral[700],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|