@thecb/components 6.3.1-beta.8 → 7.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "6.3.1-beta.8",
3
+ "version": "7.0.0",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -43,3 +43,4 @@ export { default as ToggleSwitch } from "./toggle-switch";
43
43
  export { default as TypeaheadInput } from "./typeahead-input";
44
44
  export { default as Card } from "./card";
45
45
  export { default as NavTabs } from "./nav-tabs";
46
+ export { default as LoadingLine } from "./loading-line";
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { LoadingPill } from "./LoadingPill.styled";
3
+
4
+ const LoadingLine = ({
5
+ minWidth,
6
+ maxWidth,
7
+ exactWidth = null,
8
+ height = "16px",
9
+ margin = "0px"
10
+ }) => (
11
+ <LoadingPill
12
+ margin={margin}
13
+ height={height}
14
+ width={
15
+ exactWidth ||
16
+ Math.floor(Math.random() * (maxWidth - minWidth + 1)) + minWidth
17
+ }
18
+ />
19
+ );
20
+
21
+ export default LoadingLine;
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import page from "../../../../.storybook/page";
3
+ import LoadingLine from "../../atoms/loading-line";
4
+
5
+ const numberOfRows = 10;
6
+ const rowWidths = [50, 100, 50, 100, 50];
7
+
8
+ export const loadingLine = () => (
9
+ <table>
10
+ {[...Array(numberOfRows)].map(r => (
11
+ <tr>
12
+ {rowWidths.map(rw => (
13
+ <td>
14
+ <LoadingLine exactWidth={rw} />
15
+ </td>
16
+ ))}
17
+ </tr>
18
+ ))}
19
+ </table>
20
+ );
21
+
22
+ loadingLine.storyName = "Loading Line";
23
+
24
+ const story = page({
25
+ title: "Components|Atoms/LoadingLine",
26
+ Component: LoadingLine
27
+ });
28
+ export default story;
@@ -0,0 +1,32 @@
1
+ import styled, { keyframes } from "styled-components";
2
+ import { colors } from "../../../constants";
3
+
4
+ const shineFrames = keyframes`{
5
+ 0 {
6
+ background-position: 0 0;
7
+ }
8
+ 20% {
9
+ background-position: 100% 100%;
10
+ }
11
+ 100% {
12
+ background-position: 100% 100%;
13
+ }
14
+ }`;
15
+
16
+ export const LoadingPill = styled.div`
17
+ width: ${({ width }) => width}px;
18
+ background-color: ${colors.SEASHELL_WHITE};
19
+ margin: ${({ margin }) => margin};
20
+ height: ${({ height }) => height};
21
+ border-radius: 16px;
22
+ background-image: linear-gradient(
23
+ 135deg,
24
+ ${colors.SEASHELL_WHITE} 0%,
25
+ ${colors.ALABASTER_WHITE} 40%,
26
+ ${colors.SEASHELL_WHITE} 60%,
27
+ ${colors.SEASHELL_WHITE} 100%
28
+ );
29
+ background-size: 400%;
30
+ animation: ${shineFrames} 2s infinite ease-in-out;
31
+ animation-direction: reverse;
32
+ `;
@@ -0,0 +1,3 @@
1
+ import LoadingLine from "./LoadingLine";
2
+
3
+ export default LoadingLine;
@@ -103,10 +103,10 @@ const ToggleSwitch = ({
103
103
  },
104
104
  on: {
105
105
  backgroundColor: themeValues.white,
106
- right: "2px",
106
+ right: "1px",
107
107
  top: "2px",
108
108
  bottom: "2px",
109
- left: "24px",
109
+ left: "25px",
110
110
  transition: {
111
111
  ease: "backIn"
112
112
  }
@@ -162,7 +162,7 @@ const ToggleSwitch = ({
162
162
  }
163
163
  >
164
164
  <Center>
165
- <Cluster justify="stretch" align="center">
165
+ <Cluster justify="stretch" align="center" overflow="visible">
166
166
  <Cover minHeight="100%" singleChild>
167
167
  <Box
168
168
  minWidth="100%"
@@ -26,7 +26,7 @@ const FooterWithSubfooter = ({
26
26
  <NavFooter
27
27
  backgroundColor={themeValues.subfooterBackgroundColor}
28
28
  footerMinHeight="45px"
29
- footerPadding="0 1rem"
29
+ footerPadding="0 16px"
30
30
  aria-label="subfooter"
31
31
  leftContent={leftSubfooterContent}
32
32
  rightContent={rightSubfooterContent}
@@ -1,2 +1 @@
1
- export * from "./collapsible-section";
2
1
  export * from "./footer-with-subfooter";
@@ -43,7 +43,7 @@ const Popover = ({
43
43
  }
44
44
  };
45
45
 
46
- const triggerRef = useOutsideClickHook(() => handleTogglePopover(false));
46
+ const triggerRef = useOutsideClick(() => handleTogglePopover(false));
47
47
 
48
48
  return (
49
49
  <Box padding="0" extraStyles={`position: relative; ${extraStyles}`}>
@@ -1,22 +0,0 @@
1
- import React from "react";
2
- import Expand from "../../../util/expand";
3
-
4
- export interface CollapsibleSectionProps {
5
- isOpen: boolean;
6
- toggleSection?: () => void;
7
- isMobile?: boolean;
8
- supportsTouch?: boolean;
9
- title?: string;
10
- customPadding?: string;
11
- initiallyOpen?: boolean;
12
- openHeight?: string;
13
- customTitle?: boolean;
14
- stackTitle?: boolean;
15
- stackTitleContent?: JSX.Element;
16
- sectionGap?: string;
17
- name?: string;
18
- index?: number;
19
- }
20
-
21
- export const CollapsibleSection: React.FC<Expand<CollapsibleSectionProps> &
22
- React.HTMLAttributes<HTMLElement>>;
@@ -1,24 +0,0 @@
1
- import React from "react";
2
- import Expand from "../../../util/expand";
3
-
4
- export interface EditableTableProps {
5
- title?: any;
6
- renderItem?: (items: any) => JSX.Element;
7
- items: any;
8
- isMobile?: boolean;
9
- }
10
-
11
- export const EditableTable: React.FC<Expand<EditableTableProps> &
12
- React.HTMLAttributes<HTMLElement>>;
13
-
14
- export interface TableListItemProps {
15
- borderTopItem?: boolean;
16
- canEdit?: boolean;
17
- canRemove?: boolean;
18
- isMobile?: boolean;
19
- title?: any;
20
- value?: any;
21
- }
22
-
23
- export const TableListItem: React.FC<Expand<TableListItemProps> &
24
- React.HTMLAttributes<HTMLElement>>;