@sproutsocial/racine 9.1.0-token-beta.0 → 9.1.1-theme-extension.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 (64) hide show
  1. package/CHANGELOG.md +0 -28
  2. package/__flow__/Breadcrumb/styles.js +5 -0
  3. package/__flow__/Button/styles.js +1 -1
  4. package/__flow__/Card/index.stories.js +1 -0
  5. package/__flow__/Card/styles.js +1 -1
  6. package/__flow__/CustomThemeProvider/index.js +16 -0
  7. package/__flow__/Drawer/index.stories.js +3 -3
  8. package/__flow__/Drawer/styles.js +1 -1
  9. package/__flow__/KeyboardKey/styles.js +1 -1
  10. package/__flow__/Menu/index.stories.js +1 -1
  11. package/__flow__/Modal/__snapshots__/index.test.js.snap +1 -1
  12. package/__flow__/Modal/styles.js +1 -1
  13. package/__flow__/Popout/index.js +1 -1
  14. package/__flow__/ThemeProvider/index.js +2 -2
  15. package/__flow__/Token/index.js +1 -4
  16. package/__flow__/Token/index.stories.js +0 -11
  17. package/__flow__/Token/styles.js +33 -43
  18. package/__flow__/Tooltip/index.js +1 -1
  19. package/__flow__/index.js +1 -0
  20. package/__flow__/themes/dark/theme.js +156 -180
  21. package/__flow__/themes/default/theme.js +8 -19
  22. package/__flow__/themes/sprout/theme.js +22 -0
  23. package/__flow__/types/system-props.flow.js +2 -1
  24. package/__flow__/utils/extendTheme.js +17 -0
  25. package/commonjs/Breadcrumb/styles.js +1 -1
  26. package/commonjs/Button/styles.js +1 -1
  27. package/commonjs/Card/styles.js +1 -1
  28. package/commonjs/CustomThemeProvider/index.js +23 -0
  29. package/commonjs/Drawer/styles.js +1 -1
  30. package/commonjs/KeyboardKey/styles.js +1 -1
  31. package/commonjs/Modal/styles.js +1 -1
  32. package/commonjs/Popout/index.js +1 -1
  33. package/commonjs/Token/index.js +2 -5
  34. package/commonjs/Token/styles.js +50 -19
  35. package/commonjs/Tooltip/index.js +1 -1
  36. package/commonjs/index.js +5 -1
  37. package/commonjs/themes/dark/theme.js +154 -179
  38. package/commonjs/themes/default/theme.js +8 -19
  39. package/commonjs/themes/sprout/theme.js +29 -0
  40. package/commonjs/utils/extendTheme.js +22 -0
  41. package/lib/Breadcrumb/styles.js +1 -1
  42. package/lib/Button/styles.js +1 -1
  43. package/lib/Card/styles.js +1 -1
  44. package/lib/CustomThemeProvider/index.js +12 -0
  45. package/lib/Drawer/styles.js +1 -1
  46. package/lib/KeyboardKey/styles.js +1 -1
  47. package/lib/Modal/styles.js +1 -1
  48. package/lib/Popout/index.js +1 -1
  49. package/lib/Token/index.js +2 -5
  50. package/lib/Token/styles.js +50 -19
  51. package/lib/Tooltip/index.js +1 -1
  52. package/lib/index.js +1 -0
  53. package/lib/themes/dark/theme.js +153 -174
  54. package/lib/themes/default/theme.js +8 -18
  55. package/lib/themes/sprout/theme.js +19 -0
  56. package/lib/utils/extendTheme.js +12 -0
  57. package/package.json +9 -6
  58. package/__flow__/themes/_themes.scss +0 -138
  59. package/__flow__/themes/utils/interact.js +0 -12
  60. package/commonjs/themes/utils/interact.js +0 -19
  61. package/dist/themes/_themes.scss +0 -138
  62. package/dist/themes/dark.scss +0 -601
  63. package/dist/themes/default.scss +0 -692
  64. 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.low : "none"};
54
+ props.appearance === "placeholder" ? props.theme.shadows[100] : "none"};
55
55
  }
56
56
 
57
57
  &:active {
@@ -15,6 +15,7 @@ export const AsButton = () => (
15
15
  px={400}
16
16
  py={350}
17
17
  ariaLabel="Click to do something"
18
+ bg="container.background.error.hover"
18
19
  >
19
20
  This is an interactive Card.
20
21
  </Card>
@@ -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.low};
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,16 @@
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
+ theme?: TypeTheme,
9
+ children: React.Node,
10
+ |};
11
+
12
+ const CustomThemeProvider = (props: TypeProps) => (
13
+ <ThemeProvider theme={props.theme} {...props} />
14
+ );
15
+
16
+ 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="icon.inverse" name="notifications" />
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="icon.base" name="notifications" />
108
+ <Icon color="neutral.800" name="notifications" />
109
109
  </Button>
110
110
  <Button onClick={isPoplarOpen ? closePoplar : openPoplar} mt={400}>
111
- <Icon color="icon.base" name="link" />
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.high};
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.low};
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;
@@ -213,7 +213,7 @@ export const MenuWithIcons = (props) => {
213
213
  border={500}
214
214
  borderRadius="outer"
215
215
  borderColor="container.border.base"
216
- boxShadow="medium"
216
+ boxShadow={300}
217
217
  backgroundColor="container.background.base"
218
218
  >
219
219
  <Menu {...props}>
@@ -45,7 +45,7 @@ exports[`Modal should render properly 1`] = `
45
45
  flex-direction: column;
46
46
  background: #FFFFFF;
47
47
  border-radius: 6px;
48
- box-shadow: 0px 8px 16px #2733333D;
48
+ box-shadow: 0px 8px 16px rgba(39,51,51,.24);
49
49
  -webkit-filter: blur(0);
50
50
  filter: blur(0);
51
51
  color: #364141;
@@ -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.medium};
87
+ box-shadow: ${(props) => props.theme.shadows[300]};
88
88
  filter: blur(0);
89
89
  color: ${(props) => props.theme.colors.text.body};
90
90
 
@@ -395,7 +395,7 @@ Popout.Content = ({ children, ...rest }: TypePopoutContentProps) => (
395
395
  border={500}
396
396
  borderColor="container.border.base"
397
397
  borderRadius="outer"
398
- boxShadow="medium"
398
+ boxShadow={300}
399
399
  p={400}
400
400
  m={300}
401
401
  {...rest}
@@ -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 = $ReadOnly<{|
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} />
@@ -15,7 +15,6 @@ export type TypeProps = {
15
15
  valid?: boolean,
16
16
  /** Indicates whether the token is disabled */
17
17
  disabled?: boolean,
18
- palette?: "neutral" | "blue",
19
18
  };
20
19
 
21
20
  const Token = ({
@@ -25,7 +24,6 @@ const Token = ({
25
24
  qa,
26
25
  valid = true,
27
26
  disabled = false,
28
- palette = "neutral",
29
27
  ...rest
30
28
  }: TypeProps) => {
31
29
  const textContainer = useTextContent("");
@@ -34,9 +32,8 @@ const Token = ({
34
32
  <Container
35
33
  ref={textContainer}
36
34
  valid={valid}
37
- palette={palette}
38
- type={closeable || onClick ? "button" : undefined}
39
35
  as={closeable || onClick ? "button" : "div"}
36
+ type={closeable || onClick ? "button" : undefined}
40
37
  closeable={closeable || onClick}
41
38
  disabled={disabled}
42
39
  onClick={onClick}
@@ -80,14 +80,3 @@ export const staticWithIcon = () => (
80
80
  staticWithIcon.story = {
81
81
  name: "Static with icon",
82
82
  };
83
-
84
- export const bluePalette = () => (
85
- <Token palette="blue" closeable={boolean("closeable", false)}>
86
- <Icon size="mini" name="twitter" pr={300} />
87
- <span>I'm blue</span>
88
- </Token>
89
- );
90
-
91
- bluePalette.story = {
92
- name: "Palette Variation",
93
- };
@@ -6,78 +6,68 @@ import { focusRing } from "../utils/mixins";
6
6
  import type { TypeTheme } from "../types/theme.flow";
7
7
 
8
8
  const Container: StyledComponent<any, TypeTheme, *> = styled.button`
9
+ font-family: ${(props) => props.theme.fontFamily};
10
+ ${(props) => props.theme.typography[200]};
9
11
  position: relative;
10
12
  display: inline-block;
13
+ padding: ${(props) => props.theme.space[200]}
14
+ ${(props) => props.theme.space[300]};
11
15
  margin: 0;
16
+ color: ${(props) => props.theme.colors.text.body};
17
+ background: ${(props) => props.theme.colors.container.background.base};
18
+ border: 1px solid ${(props) => props.theme.colors.container.border.base};
19
+ font-weight: ${(props) => props.theme.fontWeights.normal};
12
20
  line-height: 1;
13
21
  vertical-align: middle;
22
+ border-radius: ${(props) => props.theme.radii[500]};
14
23
  outline: none;
15
- /* Theme Properties */
16
- ${({ theme }) => css`
17
- ${theme.typography[200]}
18
- font-family: ${theme.fontFamily};
19
- font-weight: ${theme.fontWeights.normal};
20
- border: 1px solid ${theme.colors.container.border.base};
21
- border-radius: ${theme.radii[500]};
22
- color: ${theme.colors.text.body};
23
- background: ${theme.colors.container.background.base};
24
- padding: ${theme.space[200]} ${theme.space[300]};
25
- transition: all ${theme.duration.fast} ${theme.easing.ease_inout};
26
- `}
24
+ transition: all ${(props) => props.theme.duration.fast}
25
+ ${(props) => props.theme.easing.ease_inout};
27
26
 
28
27
  &:focus {
29
28
  ${focusRing}
30
29
  }
31
30
 
32
- ${({ theme, palette }) =>
33
- palette === "blue" &&
34
- css`
35
- color: ${theme.colors.text.body};
36
- background: ${theme.colors.container.background.decorative.blue};
37
- border: 1px solid ${theme.colors.container.border.decorative.blue};
38
- &:hover,
39
- &:active {
40
- cursor: pointer;
41
- box-shadow: ${theme.shadows.low};
42
- border: 1px solid
43
- ${theme.utils.interact(theme.colors.container.border.decorative.blue)};
44
- }
45
- `}
46
-
47
- ${({ closeable, theme }) =>
48
- closeable &&
31
+ ${(props) =>
32
+ props.closeable &&
49
33
  css`
50
34
  cursor: pointer;
35
+
51
36
  &:hover,
52
37
  &:active {
53
- box-shadow: ${theme.shadows.low};
38
+ color: ${(props) => props.theme.colors.text.body};
54
39
  border: 1px solid
55
- ${theme.utils.interact(theme.colors.container.border.base)};
40
+ ${(props) => props.theme.colors.container.border.decorative.neutral};
41
+ background-color: ${(props) =>
42
+ props.theme.colors.container.background.decorative.neutral};
56
43
  }
57
44
  `}
58
45
 
59
- ${({ disabled, theme }) =>
60
- disabled &&
46
+ ${(props) =>
47
+ props.disabled &&
61
48
  css`
62
49
  opacity: 0.4;
63
50
  cursor: not-allowed;
64
51
  &:hover,
65
52
  &:active {
66
- box-shadow: none;
67
- border: 1px solid ${theme.colors.container.border.base};
53
+ background: ${(props) => props.theme.colors.container.background.base};
54
+ border: 1px solid ${(props) => props.theme.colors.container.border.base};
68
55
  }
69
56
  `}
70
-
71
- ${({ valid, theme }) =>
72
- !valid &&
57
+
58
+ ${(props) =>
59
+ !props.valid &&
73
60
  css`
74
- color: ${theme.colors.text.error};
75
- background: ${theme.colors.container.background.error};
76
- border: 1px solid ${theme.colors.container.border.error};
61
+ color: ${(props) => props.theme.colors.text.body};
62
+ border-color: ${(props) => props.theme.colors.container.border.error};
63
+ background: ${(props) => props.theme.colors.container.background.error};
64
+
77
65
  &:hover {
78
- box-shadow: ${theme.shadows.low};
66
+ color: ${(props) => props.theme.colors.text.body};
79
67
  border: 1px solid
80
- ${theme.utils.interact(theme.colors.container.border.error)};
68
+ ${(props) => props.theme.colors.container.border.error};
69
+ background-color: ${(props) =>
70
+ props.theme.colors.container.background.error};
81
71
  }
82
72
  `}
83
73
 
@@ -159,7 +159,7 @@ const Content = ({
159
159
  m={200}
160
160
  color="text.body"
161
161
  bg="container.background.base"
162
- boxShadow="medium"
162
+ boxShadow={300}
163
163
  border={500}
164
164
  borderColor="container.border.base"
165
165
  // $FlowIssue - upgrade v0.112.0
package/__flow__/index.js CHANGED
@@ -43,6 +43,7 @@ export { default as Modal } from "./Modal";
43
43
  export { default as Popout } from "./Popout";
44
44
  export type { EnumPlacements } from "./Popout";
45
45
  export { default as ThemeProvider } from "./ThemeProvider";
46
+ export { default as CustomThemeProvider } from "./CustomThemeProvider";
46
47
  export { default as Tooltip } from "./Tooltip";
47
48
  export { default as Drawer } from "./Drawer";
48
49
  export { default as LoaderButton } from "./LoaderButton";