@thecb/components 5.6.9 → 5.7.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "5.6.9",
3
+ "version": "5.7.0-beta.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -38,10 +38,6 @@
38
38
  "@storybook/addon-storysource": "^5.3.14",
39
39
  "@storybook/addon-viewport": "^5.3.14",
40
40
  "@storybook/react": "^5.3.14",
41
- "babel-core": "^6.26.3",
42
- "babel-loader": "^8.1.0",
43
- "babel-preset-env": "^1.7.0",
44
- "babel-preset-react": "^6.24.1",
45
41
  "eslint": "^6.8.0",
46
42
  "eslint-config-prettier": "^6.11.0",
47
43
  "eslint-plugin-babel": "^5.3.0",
@@ -85,6 +81,6 @@
85
81
  "ramda": "^0.27.0",
86
82
  "react-aria-modal": "^4.0.0",
87
83
  "react-pose": "^4.0.10",
88
- "redux-freeform": "^5.4.0"
84
+ "redux-freeform": "^5.3.0"
89
85
  }
90
86
  }
package/src/.DS_Store ADDED
Binary file
Binary file
@@ -15,7 +15,7 @@ const InputField = styled.input`
15
15
  ? ERROR_COLOR
16
16
  : themeValues.borderColor};
17
17
  border-radius: 2px;
18
- height: ${({ $customHeight }) => ($customHeight ? $customHeight : "48px")};
18
+ height: ${({ customHeight }) => (customHeight ? customHeight : "48px")};
19
19
  width: 100%;
20
20
  padding: 1rem;
21
21
  min-width: 100px;
@@ -47,9 +47,9 @@ const InputField = styled.input`
47
47
  background-color: #f7f7f7;
48
48
  `}
49
49
 
50
- ${({ $extraStyles }) =>
50
+ ${({ extraStyles }) =>
51
51
  css`
52
- ${$extraStyles}
52
+ ${extraStyles}
53
53
  `}
54
54
  `;
55
55
 
@@ -63,7 +63,7 @@ const FormattedInputField = styled(({ showErrors, themeValues, ...props }) => (
63
63
  ? ERROR_COLOR
64
64
  : themeValues.borderColor};
65
65
  border-radius: 2px;
66
- height: ${({ $customHeight }) => ($customHeight ? $customHeight : "48px")};
66
+ height: ${({ customHeight }) => (customHeight ? customHeight : "48px")};
67
67
  width: 100%;
68
68
  padding: 1rem;
69
69
  min-width: 100px;
@@ -199,8 +199,8 @@ const FormInput = ({
199
199
  showErrors={showErrors}
200
200
  data-qa={labelTextWhenNoError}
201
201
  themeValues={themeValues}
202
- $customHeight={customHeight}
203
- $extraStyles={extraStyles}
202
+ customHeight={customHeight}
203
+ extraStyles={extraStyles}
204
204
  {...props}
205
205
  />
206
206
  ) : (
@@ -216,8 +216,8 @@ const FormInput = ({
216
216
  data-qa={labelTextWhenNoError}
217
217
  themeValues={themeValues}
218
218
  background={background}
219
- $customHeight={customHeight}
220
- $extraStyles={extraStyles}
219
+ customHeight={customHeight}
220
+ extraStyles={extraStyles}
221
221
  {...props}
222
222
  />
223
223
  )}
@@ -1,13 +1,10 @@
1
1
  import React, { Fragment } from "react";
2
2
  import { BoxWrapper } from "./Box.styled";
3
- import { safeChildren, screenReaderOnlyStyle } from "../../../util/general";
3
+ import { safeChildren } from "../../../util/general";
4
4
 
5
5
  /*
6
6
  Box component to create generic boxes
7
7
  Supply padding, border, background, and color values
8
-
9
- srOnly prop enables special screen-reader style that is used to position content
10
- completely off screen (only for users of screen readers)
11
8
  */
12
9
 
13
10
  const Box = ({
@@ -40,7 +37,6 @@ const Box = ({
40
37
  theme,
41
38
  hiddenStyles,
42
39
  extraStyles,
43
- srOnly = false,
44
40
  dataQa,
45
41
  children,
46
42
  ...rest
@@ -67,9 +63,7 @@ const Box = ({
67
63
  onClick={onClick}
68
64
  hiddenStyles={hiddenStyles}
69
65
  onKeyDown={onKeyDown}
70
- extraStyles={
71
- srOnly ? `${screenReaderOnlyStyle}${extraStyles}` : extraStyles
72
- }
66
+ extraStyles={extraStyles}
73
67
  theme={theme}
74
68
  textAlign={textAlign}
75
69
  data-qa={dataQa}
@@ -29,10 +29,10 @@ const Cluster = ({
29
29
  <ClusterWrapper
30
30
  overflow={overflow}
31
31
  {...rest}
32
- $justifySelf={justifySelf}
33
- $alignSelf={alignSelf}
34
- $flexGrow={flexGrow}
35
- $extraStyles={extraStyles}
32
+ justifySelf={justifySelf}
33
+ alignSelf={alignSelf}
34
+ flexGrow={flexGrow}
35
+ extraStyles={extraStyles}
36
36
  >
37
37
  <ClusterInnerWrapper
38
38
  justify={justify}
@@ -7,10 +7,10 @@ export const ClusterWrapper = styled(({ overflow, ...props }) => (
7
7
  ))`
8
8
  overflow: ${({ overflow }) => (overflow ? "visible" : "hidden")};
9
9
  box-sizing: border-box;
10
- justify-self: ${({ $justifySelf }) => $justifySelf};
11
- align-self: ${({ $alignSelf }) => $alignSelf};
12
- flex-grow: ${({ $flexGrow }) => $flexGrow};
13
- ${({ $extraStyles }) => $extraStyles};
10
+ justify-self: ${({ justifySelf }) => justifySelf};
11
+ align-self: ${({ alignSelf }) => alignSelf};
12
+ flex-grow: ${({ flexGrow }) => flexGrow};
13
+ ${({ extraStyles }) => extraStyles};
14
14
  `;
15
15
 
16
16
  export const ClusterInnerWrapper = styled.div`
@@ -23,7 +23,7 @@ export const navFooter = () => (
23
23
  <NavFooter
24
24
  leftContent={<Left />}
25
25
  rightContent={<Right />}
26
- $headerHeight={text("headerHeight", "105px", "props")}
26
+ headerHeight={text("headerHeight", "105px", "props")}
27
27
  backgroundColor={select("activeColor", colors, "white", "props")}
28
28
  footerPadding={text("footerPadding", "1.5rem 1rem", "props")}
29
29
  isMobile={boolean("isMobile", false, "props")}
@@ -33,4 +33,3 @@ export { default as TermsAndConditionsModal } from "./terms-and-conditions-modal
33
33
  export { default as Timeout } from "./timeout";
34
34
  export { default as WelcomeModule } from "./welcome-module";
35
35
  export { default as WorkflowTile } from "./workflow-tile";
36
- export { default as PeriscopeDashboardIframe } from "./periscope-dashboard-iframe";
@@ -1,4 +1,4 @@
1
- import React, { useState, Fragment } from "react";
1
+ import React, { useState } from "react";
2
2
  import { Stack, Box, Cluster } from "../../atoms/layouts";
3
3
  import { themeComponent } from "../../../util/themeUtils";
4
4
  import { fallbackValues } from "./Tabs.theme";
@@ -46,9 +46,9 @@ const Tabs = ({
46
46
  </Box>
47
47
  <Box className="tab-content">
48
48
  <Box>
49
- {tabsConfig.tabs.map((tab, idx) => {
49
+ {tabsConfig.tabs.map(tab => {
50
50
  if (tab.label !== activeTab) return undefined;
51
- return <Fragment key={idx}>{tab.content}</Fragment>;
51
+ return tab.content;
52
52
  })}
53
53
  </Box>
54
54
  </Box>
Binary file
@@ -79,20 +79,3 @@ export const checkDeniedCards = name => {
79
79
  return "";
80
80
  }
81
81
  };
82
-
83
- /*
84
- An optional style for layout atoms that positions the atom completely off screen
85
- This will *not* be visible or accessible to sighted users
86
- Use to contain text content or a11y interactive content (skip links when not visible)
87
- that is only for users of assistive technologies (screen readers)
88
-
89
- Currently implemented on the Box atom via the srOnly prop
90
- */
91
- export const screenReaderOnlyStyle = `
92
- position: absolute;
93
- left: -10000px;
94
- top: auto;
95
- width: 1px;
96
- height: 1px;
97
- overflow: hidden;
98
- `;
@@ -1,77 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
-
7
- var React = _interopDefault(require('react'));
8
- var styled = _interopDefault(require('styled-components'));
9
-
10
- function _taggedTemplateLiteral(strings, raw) {
11
- if (!raw) {
12
- raw = strings.slice(0);
13
- }
14
-
15
- return Object.freeze(Object.defineProperties(strings, {
16
- raw: {
17
- value: Object.freeze(raw)
18
- }
19
- }));
20
- }
21
-
22
- /*
23
- Need to add a new color? Visit http://chir.ag/projects/name-that-color to generate a color name.
24
-
25
- Name already taken? If you can't use the existing color, then use thesaurus.com to pick a similar name
26
- to the one generated by name-that-color.
27
- */
28
- var PEWTER_GREY = "#DFE1E4";
29
- var MARINER_BLUE = "#2E75D2";
30
-
31
- function _templateObject2() {
32
- var data = _taggedTemplateLiteral(["\n height: 16px;\n width: 16px;\n background-color: ", ";\n border-radius: 8px;\n"]);
33
-
34
- _templateObject2 = function _templateObject2() {
35
- return data;
36
- };
37
-
38
- return data;
39
- }
40
-
41
- function _templateObject() {
42
- var data = _taggedTemplateLiteral(["\n height: 24px;\n width: 24px;\n border: 1px solid\n ", ";\n border-radius: 12px;\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px;\n min-width: 24px;\n min-height: 24px;\n"]);
43
-
44
- _templateObject = function _templateObject() {
45
- return data;
46
- };
47
-
48
- return data;
49
- }
50
- var defaultTheme = {
51
- theme: {
52
- accentColor: MARINER_BLUE,
53
- inactiveColor: PEWTER_GREY
54
- }
55
- };
56
- var RadioButtonBorder = styled.div(_templateObject(), function (_ref) {
57
- var isSelected = _ref.isSelected,
58
- theme = _ref.theme;
59
- return isSelected ? theme.accentColor : theme.inactiveColor;
60
- });
61
- RadioButtonBorder.defaultProps = defaultTheme;
62
- var RadioButtonCenter = styled.div(_templateObject2(), function (_ref2) {
63
- var theme = _ref2.theme;
64
- return theme.accentColor;
65
- });
66
- RadioButtonCenter.defaultProps = defaultTheme;
67
-
68
- var RadioButton = function RadioButton(_ref3) {
69
- var isSelected = _ref3.isSelected,
70
- name = _ref3.name;
71
- return React.createElement(RadioButtonBorder, {
72
- isSelected: isSelected,
73
- name: name
74
- }, isSelected && React.createElement(RadioButtonCenter, null));
75
- };
76
-
77
- exports.RadioButton = RadioButton;