@thecb/components 10.4.0-beta.5 → 10.4.0-beta.7

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": "10.4.0-beta.5",
3
+ "version": "10.4.0-beta.7",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -1,5 +1,6 @@
1
- import React from "react";
1
+ import React, { Fragment, useState } from "react";
2
2
  import { text, select, boolean } from "@storybook/addon-knobs";
3
+ import { Box } from "../layouts";
3
4
  import ButtonWithAction from "./ButtonWithAction";
4
5
  import page from "../../../../.storybook/page";
5
6
 
@@ -14,21 +15,38 @@ const variants = {
14
15
  smallGhost: "smallGhost",
15
16
  tertiary: "tertiary",
16
17
  danger: "danger",
18
+ dangerSecondary: "dangerSecondary",
19
+ whiteSecondary: "whiteSecondary",
20
+ whitePrimary: "whitePrimary",
17
21
  None: undefined
18
22
  };
19
23
  const defaultValue = "primary";
20
24
  const groupId = "props";
21
25
 
22
- const buttonHandler = () => console.log("Button selected");
26
+ const buttonHandler = () => window.alert("Button click!");
23
27
 
24
28
  export const buttonWithAction = () => (
25
- <ButtonWithAction
26
- variant={select(variantsLabel, variants, defaultValue, groupId)}
27
- disabled={boolean("disabled", false, "props")}
28
- text={text("text", "button", "props")}
29
- isLoading={boolean("isLoading", false, "props")}
30
- action={text("action", buttonHandler, "props")}
31
- />
29
+ <Fragment>
30
+ {/* Uncomment to view buttons on a dark background */}
31
+ {/* <Box extraStyles="background-color: #000;">
32
+ <ButtonWithAction
33
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
34
+ disabled={boolean("disabled", false, "props")}
35
+ text={text("text", "button", "props")}
36
+ isLoading={boolean("isLoading", false, "props")}
37
+ action={text("action", buttonHandler, "props")}
38
+ />
39
+ </Box> */}
40
+ <Box extraStyles="background-color: #fff;">
41
+ <ButtonWithAction
42
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
43
+ disabled={boolean("disabled", false, "props")}
44
+ text={text("text", "button", "props")}
45
+ isLoading={boolean("isLoading", false, "props")}
46
+ action={text("action", buttonHandler, "props")}
47
+ />
48
+ </Box>
49
+ </Fragment>
32
50
  );
33
51
 
34
52
  const story = page({
@@ -8,25 +8,24 @@ const {
8
8
  MANATEE_GREY,
9
9
  MATISSE_BLUE,
10
10
  RASPBERRY,
11
- ERROR_COLOR,
12
- STORM_GREY
11
+ ERROR_COLOR
13
12
  } = colors;
14
13
 
15
14
  const { LINK_TEXT_DECORATION } = styleConstants;
16
15
 
17
16
  const disabledBorderColor = {
18
- primary: STORM_GREY,
19
- secondary: STORM_GREY,
17
+ primary: MANATEE_GREY,
18
+ secondary: MANATEE_GREY,
20
19
  back: TRANSPARENT,
21
- smallPrimary: STORM_GREY,
22
- smallSecondary: STORM_GREY,
20
+ smallPrimary: MANATEE_GREY,
21
+ smallSecondary: MANATEE_GREY,
23
22
  smallGhost: TRANSPARENT,
24
23
  ghost: TRANSPARENT,
25
24
  tertiary: TRANSPARENT,
26
- danger: STORM_GREY,
27
- dangerSecondary: STORM_GREY,
28
- whiteSecondary: TRANSPARENT,
29
- whitePrimary: TRANSPARENT
25
+ danger: MANATEE_GREY,
26
+ dangerSecondary: MANATEE_GREY,
27
+ whiteSecondary: MANATEE_GREY,
28
+ whitePrimary: MANATEE_GREY
30
29
  };
31
30
 
32
31
  const disabledColor = {
@@ -40,7 +40,7 @@ const LinkCard = ({
40
40
  hoverStyles={extraHoverStyles}
41
41
  activeStyles={extraActiveStyles}
42
42
  onClick={disabled ? noop : onClick}
43
- disabled={disabled}
43
+ aria-disabled={disabled}
44
44
  >
45
45
  <Stack
46
46
  childGap={0}