@thecb/components 2.3.0 → 3.1.3

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 (55) hide show
  1. package/.github/workflows/bump-version.yml +30 -0
  2. package/.github/workflows/create-release/build-body.sh +35 -0
  3. package/.github/workflows/create-release.yml +52 -0
  4. package/.github/workflows/disabled-workflows/publish-update.yml +73 -0
  5. package/.storybook/main.js +4 -0
  6. package/.storybook/page.js +61 -0
  7. package/.storybook/themes/apc.theme.js +1 -0
  8. package/.storybook/themes/index.js +2 -0
  9. package/.storybook/themes/sf.theme.js +1 -0
  10. package/README.md +68 -90
  11. package/dist/index.cjs.js +690 -13571
  12. package/package.json +12 -4
  13. package/rollup.config.js +0 -2
  14. package/src/components/atoms/breadcrumb/Breadcrumb.js +7 -2
  15. package/src/components/atoms/breadcrumb/Breadcrumb.theme.js +3 -1
  16. package/src/components/atoms/button-with-action/ButtonWithAction.js +6 -1
  17. package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +31 -122
  18. package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +20 -7
  19. package/src/components/atoms/button-with-link/ButtonWithLink.js +17 -3
  20. package/src/components/atoms/dropdown/Dropdown.js +3 -6
  21. package/src/components/atoms/dropdown/Dropdown.stories.js +70 -0
  22. package/src/components/atoms/layouts/Box.js +0 -2
  23. package/src/components/atoms/layouts/Box.styled.js +1 -17
  24. package/src/components/atoms/layouts/Motion.styled.js +2 -5
  25. package/src/components/atoms/link/ExternalLink.js +3 -3
  26. package/src/components/atoms/link/ExternalLink.styled.js +10 -3
  27. package/src/components/atoms/link/InternalLink.js +2 -4
  28. package/src/components/atoms/link/InternalLink.styled.js +16 -15
  29. package/src/components/atoms/link/Link.theme.js +7 -1
  30. package/src/components/atoms/placeholder/Placeholder.js +2 -1
  31. package/src/components/atoms/radio-button/RadioButton.stories.js +69 -0
  32. package/src/components/atoms/text/Text.js +0 -2
  33. package/src/components/atoms/text/Text.styled.js +2 -8
  34. package/src/components/atoms/toggle-switch/ToggleSwitch.js +1 -1
  35. package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +70 -0
  36. package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +0 -1
  37. package/src/components/molecules/address-form/AddressForm.stories.js +21 -0
  38. package/src/components/molecules/change-password-form/ChangePasswordForm.stories.js +22 -0
  39. package/src/components/molecules/collapsible-section/CollapsibleSection.js +1 -1
  40. package/src/components/molecules/edit-name-form/EdidNameForm.stories.js +24 -0
  41. package/src/components/molecules/email-form/EmailForm.stories.js +24 -0
  42. package/src/components/molecules/forgot-password-form/ForgotPasswordForm.stories.js +24 -0
  43. package/src/components/molecules/login-form/LoginForm.stories.js +24 -0
  44. package/src/components/molecules/phone-form/PhoneForm.stories.js +24 -0
  45. package/src/components/molecules/radio-section/RadioSection.js +1 -1
  46. package/src/components/molecules/registration-form/RegistrationForm.stories.js +24 -0
  47. package/src/components/molecules/reset-confirmation-form/ResetConfirmationForm.stories.js +11 -0
  48. package/src/components/molecules/reset-password-form/ResetPasswordForm.stories.js +24 -0
  49. package/src/components/molecules/reset-password-success/ResetPasswordSuccess.stories.js +11 -0
  50. package/src/components/molecules/tab-sidebar/TabSidebar.js +11 -5
  51. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +0 -1
  52. package/src/constants/index.js +4 -2
  53. package/src/index.js +3 -2
  54. package/src/util/index.js +4 -2
  55. package/stats.html +0 -2652
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "2.3.0",
3
+ "version": "3.1.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "source": "src/index.js",
8
8
  "scripts": {
9
+ "storybook": "start-storybook",
9
10
  "build": "rollup -c"
10
11
  },
11
12
  "repository": {
@@ -27,12 +28,14 @@
27
28
  "@storybook/addon-a11y": "^5.3.14",
28
29
  "@storybook/addon-actions": "^5.3.14",
29
30
  "@storybook/addon-console": "^1.2.1",
31
+ "@storybook/addon-docs": "^5.3.19",
30
32
  "@storybook/addon-knobs": "^5.3.14",
31
33
  "@storybook/addon-storysource": "^5.3.14",
32
34
  "@storybook/addon-viewport": "^5.3.14",
33
35
  "@storybook/react": "^5.3.14",
34
36
  "babel-core": "^6.26.3",
35
37
  "babel-eslint": "^10.1.0",
38
+ "babel-loader": "^8.1.0",
36
39
  "babel-preset-env": "^1.7.0",
37
40
  "babel-preset-react": "^6.24.1",
38
41
  "eslint": "^6.8.0",
@@ -40,16 +43,22 @@
40
43
  "eslint-plugin-babel": "^5.3.0",
41
44
  "eslint-plugin-prettier": "^3.1.3",
42
45
  "eslint-plugin-react": "^7.20.0",
46
+ "history": "^5.0.0",
43
47
  "husky": "^4.2.3",
44
48
  "prettier": "^1.19.1",
45
49
  "pretty-quick": "^2.0.1",
50
+ "react-redux": "^7.2.0",
51
+ "react-router-dom": "^5.2.0",
52
+ "redux": "^4.0.5",
46
53
  "rollup": "^1.21.4",
47
54
  "rollup-plugin-babel": "^4.3.3",
48
55
  "rollup-plugin-commonjs": "^10.0.0",
49
56
  "rollup-plugin-json": "^4.0.0",
50
57
  "rollup-plugin-node-resolve": "^5.1.0",
51
58
  "rollup-plugin-visualizer": "^4.0.4",
52
- "storybook": "^5.3.14"
59
+ "storybook": "^5.3.14",
60
+ "styled-components": "^5.1.1",
61
+ "styled-theming": "^2.2.0"
53
62
  },
54
63
  "peerDependencies": {
55
64
  "ramda": "^0.27.0",
@@ -70,7 +79,6 @@
70
79
  "numeral": "^2.0.6",
71
80
  "react-aria-modal": "^4.0.0",
72
81
  "react-pose": "^4.0.10",
73
- "redux-freeform": "^4.1.3",
74
- "sanctuary": "^3.0.0"
82
+ "redux-freeform": "^4.1.3"
75
83
  }
76
84
  }
package/rollup.config.js CHANGED
@@ -5,7 +5,6 @@ import json from "rollup-plugin-json";
5
5
  import visualizer from "rollup-plugin-visualizer";
6
6
  import pkg from "./package.json";
7
7
 
8
- import * as sanctuary from "sanctuary";
9
8
  import * as formattedInput from "formatted-input";
10
9
 
11
10
  const globals = {
@@ -23,7 +22,6 @@ const plugins = [
23
22
  commonjs({
24
23
  include: "node_modules/**",
25
24
  namedExports: {
26
- sanctuary: Object.keys(sanctuary),
27
25
  "formatted-input": Object.keys(formattedInput)
28
26
  }
29
27
  }),
@@ -24,16 +24,21 @@ const Breadcrumbs = ({ breadcrumbsList = [] }) => {
24
24
  to={linkDestination}
25
25
  active={isActive.toString()}
26
26
  color={themeValues.color}
27
- activeStyles={themeValues.activeColor}
28
27
  fontSize={themeValues.fontSize}
29
28
  lineheight={themeValues.lineHeight}
30
29
  fontWeight={themeValues.fontWeight}
31
30
  margin={themeValues.margin}
32
- hoverStyles={themeValues.hover}
33
31
  extraStyles={`
34
32
  text-transform: uppercase;
33
+ ${isActive.toString() === "true" &&
34
+ `pointer-events: none;
35
+ color: ${themeValues.activeBreadcrumbColor};
36
+ `}
35
37
  &:first-child {
36
38
  margin-left: 0;
39
+ }
40
+ &:active {
41
+ color: ${themeValues.activeColor};
37
42
  }`}
38
43
  >
39
44
  {linkText}
@@ -7,7 +7,8 @@ import { MATISSE_BLUE, STORM_GREY } from "../../../constants/colors";
7
7
  */
8
8
 
9
9
  const color = `${MATISSE_BLUE}`;
10
- const activeColor = `color: ${STORM_GREY};`;
10
+ const activeColor = `${STORM_GREY}`;
11
+ const activeBreadcrumbColor = `${STORM_GREY}`;
11
12
  const fontSize = "0.875rem";
12
13
  const lineHeight = "1.25rem";
13
14
  const fontWeight = "400";
@@ -17,6 +18,7 @@ const hover = `text-decoration: none;`;
17
18
  export const fallbackValues = {
18
19
  color,
19
20
  activeColor,
21
+ activeBreadcrumbColor,
20
22
  fontSize,
21
23
  lineHeight,
22
24
  fontWeight,
@@ -88,12 +88,18 @@ const ButtonWithAction = ({
88
88
  background-color: ${themeValues.hoverBackgroundColor};
89
89
  border-color: ${themeValues.hoverBorderColor};
90
90
  color: ${themeValues.hoverColor};
91
+ text-decoration: ${
92
+ variant === "ghost" || variant === "smallGhost" ? "underline" : "none"
93
+ };
91
94
  `;
92
95
  const activeStyles = `
93
96
  outline: none;
94
97
  background-color: ${themeValues.activeBackgroundColor};
95
98
  border-color: ${themeValues.activeBorderColor};
96
99
  color: ${themeValues.activeColor};
100
+ text-decoration: ${
101
+ variant === "ghost" || variant === "smallGhost" ? "underline" : "none"
102
+ };
97
103
  `;
98
104
  const disabledStyles = `
99
105
  background-clor: #6E727E;
@@ -114,7 +120,6 @@ const ButtonWithAction = ({
114
120
  background={themeValues.backgroundColor}
115
121
  border={themeValues.border}
116
122
  hoverStyles={hoverStyles}
117
- focusStyles={hoverStyles}
118
123
  activeStyles={activeStyles}
119
124
  disabledStyles={disabledStyles}
120
125
  as="button"
@@ -1,125 +1,34 @@
1
1
  import React from "react";
2
- import { withKnobs, text } from "@storybook/addon-knobs";
2
+ import { text, select, boolean } from "@storybook/addon-knobs";
3
3
  import ButtonWithAction from "./ButtonWithAction";
4
- import { Cover, Center } from "../layouts";
5
- import { ThemeProvider } from "styled-components";
6
-
7
- const fakeTheme = {
8
- Button: {
9
- backgroundColor: {
10
- primary: `#357FB8`,
11
- secondary: `transparent`,
12
- small: `#357FB8`,
13
- smallSecondary: `transparent`
14
- },
15
- color: {
16
- primary: `#FFFFFF`,
17
- secondary: `#357FB8`,
18
- small: `#FFFFFF`,
19
- smallSecondary: `#357FB8`
20
- },
21
- fontWeight: `600`,
22
- fontSize: `1.125rem`,
23
- border: {
24
- primary: `1px solid #357FB8`,
25
- secondary: `2px solid #357FB8`,
26
- small: `1px solid #357FB8`,
27
- smallSecondary: `2px solid #357FB8`
28
- },
29
- height: {
30
- primary: `3rem`,
31
- secondary: `3rem`,
32
- small: `2.5rem`,
33
- smallSecondary: `2.5rem`
34
- },
35
- padding: {
36
- primary: `0.75rem 2rem`,
37
- secondary: `0.75rem 2rem`,
38
- small: `0.625rem 1rem`,
39
- smallSecondary: `0.625rem 1rem`
40
- },
41
- focus: `outline: none; box-shadow: 0 0 4px #357FB8`,
42
- active: {
43
- primary: `background-color: #182848; border: 1px solid #182848; box-shadow: 0 0 4px #357FB8`,
44
- secondary: `background-color: #357FB8; color: #FFFFFF; box-shadow: 0 0 4px #357FB8`,
45
- small: `background-color: #182848; border: 1px solid #182848; box-shadow: 0 0 4px #357FB8`,
46
- smallSecondary: `background-color: #357FB8; color: #FFFFFF; box-shadow: 0 0 4px #357FB8`
47
- },
48
- disabled: {
49
- primary: `background-color: #6E727E; border: 1px solid #6E727E; &:focus { box-shadow: 0 0 4px #6E727E }`,
50
- secondary: `color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 4px #6E727E }`,
51
- small: `background-color: #6E727E; border: 1px solid #6E727E; &:focus { box-shadow: 0 0 4px #6E727E`,
52
- smallSecondary: `color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 4px #6E727E }`
53
- }
54
- }
55
- };
56
-
57
- export default {
58
- title: "Themed Button",
59
- component: ButtonWithAction,
60
- decorators: [
61
- withKnobs,
62
- storyFn => (
63
- <ThemeProvider
64
- theme={{
65
- name: text("Theme Name", "default"),
66
- values: fakeTheme
67
- }}
68
- >
69
- <Cover>
70
- <div />
71
- <Center>{storyFn()}</Center>
72
- <div />
73
- </Cover>
74
- </ThemeProvider>
75
- )
76
- ]
4
+ import page from "../../../../.storybook/page";
5
+
6
+ const variantsLabel = "variant";
7
+ const variants = {
8
+ primary: "primary",
9
+ secondary: "secondary",
10
+ back: "back",
11
+ smallPrimary: "smallPrimary",
12
+ smallSecondary: "smallSecondary",
13
+ ghost: "ghost",
14
+ smallGhost: "smallGhost",
15
+ danger: "danger",
16
+ None: undefined
77
17
  };
78
-
79
- export const primaryButtonDefault = () => (
80
- <ButtonWithAction variant="primary" text="Primary Button" />
81
- );
82
-
83
- primaryButtonDefault.story = { name: "Default Primary Button" };
84
-
85
- export const secondaryButtonDefault = () => (
86
- <ButtonWithAction variant="secondary" text="Secondary Button" />
87
- );
88
-
89
- secondaryButtonDefault.story = { name: "Default Secondary Button" };
90
-
91
- export const smallButtonDefault = () => (
92
- <ButtonWithAction variant="small" text="Small Button" />
93
- );
94
-
95
- smallButtonDefault.story = { name: "Default Small Button" };
96
-
97
- export const smallSecondaryButtonDefault = () => (
98
- <ButtonWithAction variant="smallSecondary" text="Small Secondary" />
99
- );
100
-
101
- smallSecondaryButtonDefault.story = { name: "Default Small Secondary Button" };
102
-
103
- export const primaryButtonThemed = () => (
104
- <ButtonWithAction variant="primary" text="Primary Themed" />
105
- );
106
-
107
- primaryButtonThemed.story = { name: "Themed Primary Button" };
108
-
109
- export const secondaryButtonThemed = () => (
110
- <ButtonWithAction variant="secondary" text="Themed Secondary" />
111
- );
112
-
113
- secondaryButtonThemed.story = { name: "Themed Secondary Button" };
114
-
115
- export const smallButtonThemed = () => (
116
- <ButtonWithAction variant="small" text="Themed Small" />
117
- );
118
-
119
- smallButtonThemed.story = { name: "Themed Small Button" };
120
-
121
- export const smallSecondaryButtonThemed = () => (
122
- <ButtonWithAction variant="smallSecondary" text="Small Secondary" />
123
- );
124
-
125
- smallSecondaryButtonThemed.story = { name: "Themed Small Secondary Button" };
18
+ const defaultValue = "primary";
19
+ const groupId = "props";
20
+
21
+ export const buttonWithAction = () => (
22
+ <ButtonWithAction
23
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
24
+ text={text("text", "button", "props")}
25
+ isLoading={boolean("isLoading", false, "props")}
26
+ action={text("action", undefined, "props")}
27
+ />
28
+ );
29
+
30
+ const story = page({
31
+ title: "Components|Atoms/ButtonWithAction",
32
+ Component: ButtonWithAction
33
+ });
34
+ export default story;
@@ -51,7 +51,8 @@ const fontWeight = {
51
51
  smallGhost: "400",
52
52
  ghost: "600",
53
53
  danger: "600",
54
- whiteSecondary: "600"
54
+ whiteSecondary: "600",
55
+ whitePrimary: "600"
55
56
  };
56
57
 
57
58
  const height = {
@@ -114,7 +115,9 @@ const hoverBackgroundColor = {
114
115
  smallSecondary: "transparent",
115
116
  ghost: "transparent",
116
117
  smallGhost: "transparent",
117
- danger: "#BA002C"
118
+ danger: "#BA002C",
119
+ whiteSecondary: "transparent",
120
+ whitePrimary: "transparent"
118
121
  };
119
122
 
120
123
  const hoverBorderColor = {
@@ -125,7 +128,9 @@ const hoverBorderColor = {
125
128
  smallSecondary: "#DCEAF1",
126
129
  ghost: "transparent",
127
130
  smallGhost: "transparent",
128
- danger: "#BA002C"
131
+ danger: "#BA002C",
132
+ whiteSecondary: "2px solid transparent",
133
+ whitePrimary: "2px solid transparent"
129
134
  };
130
135
 
131
136
  const hoverColor = {
@@ -136,7 +141,9 @@ const hoverColor = {
136
141
  smallSecondary: "#116285",
137
142
  ghost: "#116285",
138
143
  smallGhost: "#116285",
139
- danger: "#FFFFFF"
144
+ danger: "#FFFFFF",
145
+ whiteSecondary: "#FFFFFF",
146
+ whitePrimary: "#FFFFFF"
140
147
  };
141
148
 
142
149
  const activeBackgroundColor = {
@@ -147,7 +154,9 @@ const activeBackgroundColor = {
147
154
  smallSecondary: "transparent",
148
155
  ghost: "transparent",
149
156
  smallGhost: "transparent",
150
- danger: "#870000"
157
+ danger: "#870000",
158
+ whiteSecondary: "transparent",
159
+ whitePrimary: "transparent"
151
160
  };
152
161
 
153
162
  const activeBorderColor = {
@@ -158,7 +167,9 @@ const activeBorderColor = {
158
167
  smallSecondary: "#0E506D",
159
168
  ghost: "transparent",
160
169
  smallGhost: "transparent",
161
- danger: "#870000"
170
+ danger: "#870000",
171
+ whiteSecondary: "2px solid transparent",
172
+ whitePrimary: "2px solid transparent"
162
173
  };
163
174
 
164
175
  const activeColor = {
@@ -169,7 +180,9 @@ const activeColor = {
169
180
  smallSecondary: "#0E506D",
170
181
  ghost: "#0E506D",
171
182
  smallGhost: "#0E506D",
172
- danger: "#FFFFFF"
183
+ danger: "#FFFFFF",
184
+ whiteSecondary: "#FFFFFF",
185
+ whitePrimary: "#FFFFFF"
173
186
  };
174
187
 
175
188
  export const fallbackValues = {
@@ -9,14 +9,26 @@ const ButtonWithLink = ({
9
9
  url = "/",
10
10
  disabled = false,
11
11
  extraStyles,
12
+ newTab = false,
12
13
  ...otherProps
13
14
  }) => {
14
- const ButtonWithLinkWrapper = ({ children, url, disabled, extraStyles }) => {
15
+ const ButtonWithLinkWrapper = ({
16
+ children,
17
+ url,
18
+ disabled,
19
+ newTab,
20
+ extraStyles
21
+ }) => {
15
22
  if (disabled) {
16
23
  return safeChildren(children, <span />);
17
24
  }
18
25
  return R.test(URL_TEST, url) ? (
19
- <ExternalLink href={url} tabIndex="-1" extraStyles={extraStyles}>
26
+ <ExternalLink
27
+ href={url}
28
+ tabIndex="-1"
29
+ newTab={newTab}
30
+ extraStyles={extraStyles}
31
+ >
20
32
  {safeChildren(children, <span />)}
21
33
  </ExternalLink>
22
34
  ) : (
@@ -30,7 +42,9 @@ const ButtonWithLink = ({
30
42
  <ButtonWithLinkWrapper
31
43
  url={url}
32
44
  disabled={disabled}
33
- extraStyles={extraStyles}
45
+ newTab={newTab}
46
+ extraStyles={`text-decoration: none; ${extraStyles} &:hover {
47
+ text-decoration: none; }`}
34
48
  >
35
49
  <ButtonWithAction {...otherProps} extraStyles={extraStyles} />
36
50
  </ButtonWithLinkWrapper>
@@ -1,5 +1,4 @@
1
1
  import React, { useEffect, Fragment, useState, useRef, createRef } from "react";
2
- import { pipe, find, map, prop, fromMaybe } from "sanctuary";
3
2
  import { Box, Stack } from "../layouts";
4
3
  import Text from "../text";
5
4
  import { noop } from "../../../util/general";
@@ -9,6 +8,7 @@ import styled from "styled-components";
9
8
  import {
10
9
  WHITE,
11
10
  GREY_CHATEAU,
11
+ STORM_GREY,
12
12
  MINESHAFT_GREY,
13
13
  ERROR_COLOR
14
14
  } from "../../../constants/colors";
@@ -50,6 +50,7 @@ const DropdownItemWrapper = styled.div`
50
50
  padding: 1rem;
51
51
  box-sizing: border-box;
52
52
  width: 100%;
53
+ cursor: ${({ disabled }) => (disabled ? "default" : "pointer")};
53
54
 
54
55
  &:hover {
55
56
  background-color: ${({ selected, disabled, themeValues }) =>
@@ -232,11 +233,7 @@ const Dropdown = ({
232
233
  ) : (
233
234
  <Text variant="p">
234
235
  {value
235
- ? pipe([
236
- find(option => option.value === value),
237
- map(prop("text")),
238
- fromMaybe(placeholder)
239
- ])(options)
236
+ ? options.find(option => option.value === value)?.text
240
237
  : placeholder}
241
238
  </Text>
242
239
  )}
@@ -0,0 +1,70 @@
1
+ import React, { useState, useEffect } from "react";
2
+ import { withKnobs, text } from "@storybook/addon-knobs";
3
+ import Dropdown from "./Dropdown";
4
+ import { Cover, Center } from "../layouts";
5
+ import { ThemeProvider } from "styled-components";
6
+
7
+ const fakeTheme = {
8
+ Dropdown: {
9
+ selectedColor: "#15749D",
10
+ hoverColor: "#EFFAFF"
11
+ }
12
+ };
13
+
14
+ export default {
15
+ title: "Dropdown",
16
+ component: Dropdown,
17
+ decorators: [
18
+ withKnobs,
19
+ storyFn => (
20
+ <ThemeProvider
21
+ theme={{
22
+ name: text("Theme Name", "default"),
23
+ values: fakeTheme
24
+ }}
25
+ >
26
+ <Cover>
27
+ <div />
28
+ <Center>{storyFn()}</Center>
29
+ <div />
30
+ </Cover>
31
+ </ThemeProvider>
32
+ )
33
+ ]
34
+ };
35
+
36
+ const options = [
37
+ { text: "Please select an option", value: "" },
38
+ { text: "OPTION_1", value: "OPTION_1" },
39
+ { text: "OPTION_2", value: "OPTION_2" },
40
+ { text: "DISABLED_OPTION", value: "DISABLED_OPTION" }
41
+ ];
42
+
43
+ const disabledValues = ["DISABLED_OPTION"];
44
+
45
+ export const dropdownDefault = () => {
46
+ const [isOpen, setOpen] = useState(false);
47
+ const [value, setValue] = useState(null);
48
+ const [isError, setError] = useState(false);
49
+
50
+ useEffect(() => {
51
+ if (value === options[0].value) {
52
+ setError(true);
53
+ } else {
54
+ setError(false);
55
+ }
56
+ }, [value]);
57
+
58
+ return (
59
+ <Dropdown
60
+ placeholder={options[0].text}
61
+ options={options}
62
+ disabledValues={disabledValues}
63
+ value={value}
64
+ isOpen={isOpen}
65
+ isError={isError}
66
+ onSelect={setValue}
67
+ onClick={() => setOpen(!isOpen)}
68
+ />
69
+ );
70
+ };
@@ -23,7 +23,6 @@ const Box = ({
23
23
  border,
24
24
  textAlign,
25
25
  hoverStyles,
26
- focusStyles,
27
26
  activeStyles,
28
27
  disabledStyles,
29
28
  variant,
@@ -57,7 +56,6 @@ const Box = ({
57
56
  borderWidthOverride={borderWidthOverride}
58
57
  border={border}
59
58
  hoverStyles={hoverStyles}
60
- focusStyles={focusStyles}
61
59
  activeStyles={activeStyles}
62
60
  disabledStyles={disabledStyles}
63
61
  variant={variant}
@@ -13,7 +13,6 @@ import styled, { css } from "styled-components";
13
13
  export const BoxWrapper = styled(
14
14
  ({
15
15
  activeStyles,
16
- focusStyles,
17
16
  hoverStyles,
18
17
  disabledStyles,
19
18
  extraStyles,
@@ -48,7 +47,7 @@ export const BoxWrapper = styled(
48
47
  border: ${({ border }) => border};
49
48
  text-align: ${({ textAlign }) => textAlign};
50
49
 
51
- &:hover {
50
+ &:hover, &:focus {
52
51
  ${({ hoverStyles, as }) =>
53
52
  css`
54
53
  ${hoverStyles}
@@ -63,21 +62,6 @@ export const BoxWrapper = styled(
63
62
  `}
64
63
  }
65
64
 
66
- &:focus {
67
- ${({ focusStyles, as }) =>
68
- css`
69
- ${focusStyles}
70
- ${as === "button"
71
- ? `> * > span {
72
- ${focusStyles}
73
- border: none;
74
- outline: none;
75
- box-shadow: none;
76
- }`
77
- : ``}
78
- `}
79
- }
80
-
81
65
  &:active {
82
66
  ${({ activeStyles, as }) =>
83
67
  css`
@@ -21,7 +21,8 @@ export const MotionWrapper = styled(motion.div)`
21
21
  text-align: ${({ textAlign }) => textAlign};
22
22
  margin: ${({ margin }) => margin};
23
23
 
24
- &:hover {
24
+ &:hover,
25
+ &:focus {
25
26
  ${({ hoverStyles }) => hoverStyles};
26
27
  }
27
28
 
@@ -29,10 +30,6 @@ export const MotionWrapper = styled(motion.div)`
29
30
  ${({ activeStyles }) => activeStyles};
30
31
  }
31
32
 
32
- &:focus {
33
- ${({ focusStyles }) => focusStyles};
34
- }
35
-
36
33
  &:disabled {
37
34
  ${({ disabledStyles }) => disabledStyles};
38
35
  }
@@ -4,7 +4,7 @@ import { fallbackValues } from "./Link.theme";
4
4
  import { createThemeValues } from "../../../util/themeUtils";
5
5
  import { StyledExternalLink } from "./ExternalLink.styled";
6
6
  import { FONT_WEIGHT_REGULAR } from "../../../constants/style_constants";
7
- import { CONGRESS_BLUE, SCIENCE_BLUE } from "../../../constants/colors";
7
+ import { CONGRESS_BLUE } from "../../../constants/colors";
8
8
  import { safeChildren } from "../../../util/general";
9
9
 
10
10
  const ExternalLink = ({
@@ -14,7 +14,6 @@ const ExternalLink = ({
14
14
  size = "1rem",
15
15
  lineHeight = "1.5rem",
16
16
  weight = FONT_WEIGHT_REGULAR,
17
- hoverColor = SCIENCE_BLUE,
18
17
  extraStyles = ``,
19
18
  variant = "primary",
20
19
  tabIndex = "0",
@@ -36,7 +35,8 @@ const ExternalLink = ({
36
35
  size={size}
37
36
  lineheight={lineHeight}
38
37
  weight={weight}
39
- hovercolor={hoverColor}
38
+ hovercolor={themeValues.hoverColor}
39
+ activeColor={themeValues.activeColor}
40
40
  fontFamily={themeValues.fontFamily}
41
41
  tabIndex={tabIndex}
42
42
  extrastyles={extraStyles}
@@ -8,7 +8,7 @@ import styled from "styled-components";
8
8
 
9
9
  /* eslint-disable no-unused-vars */
10
10
  export const StyledExternalLink = styled(
11
- ({ hoverColor, extraStyles, ...props }) => <a {...props} />
11
+ ({ hoverColor, activeColor, extrastyles, ...props }) => <a {...props} />
12
12
  )`
13
13
  display: flex;
14
14
  font-size: ${({ size }) => size};
@@ -17,8 +17,15 @@ export const StyledExternalLink = styled(
17
17
  font-family: ${({ fontFamily }) => fontFamily};
18
18
  line-height: ${({ lineheight }) => lineheight};
19
19
 
20
- &:hover {
21
- color: ${({ hovercolor }) => hovercolor};
20
+ &:hover,
21
+ &:focus {
22
+ color: ${({ hoverColor }) => hoverColor};
23
+ text-decoration: underline;
24
+ }
25
+
26
+ &:active {
27
+ text-decoration: underline;
28
+ color: ${({ activeColor }) => activeColor};
22
29
  }
23
30
 
24
31
  ${({ extrastyles }) => extrastyles}