@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/dist/index.cjs.js +13 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +13 -14
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +27 -9
- package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +9 -10
- package/src/components/molecules/link-card/LinkCard.js +1 -1
package/package.json
CHANGED
|
@@ -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 = () =>
|
|
26
|
+
const buttonHandler = () => window.alert("Button click!");
|
|
23
27
|
|
|
24
28
|
export const buttonWithAction = () => (
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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:
|
|
19
|
-
secondary:
|
|
17
|
+
primary: MANATEE_GREY,
|
|
18
|
+
secondary: MANATEE_GREY,
|
|
20
19
|
back: TRANSPARENT,
|
|
21
|
-
smallPrimary:
|
|
22
|
-
smallSecondary:
|
|
20
|
+
smallPrimary: MANATEE_GREY,
|
|
21
|
+
smallSecondary: MANATEE_GREY,
|
|
23
22
|
smallGhost: TRANSPARENT,
|
|
24
23
|
ghost: TRANSPARENT,
|
|
25
24
|
tertiary: TRANSPARENT,
|
|
26
|
-
danger:
|
|
27
|
-
dangerSecondary:
|
|
28
|
-
whiteSecondary:
|
|
29
|
-
whitePrimary:
|
|
25
|
+
danger: MANATEE_GREY,
|
|
26
|
+
dangerSecondary: MANATEE_GREY,
|
|
27
|
+
whiteSecondary: MANATEE_GREY,
|
|
28
|
+
whitePrimary: MANATEE_GREY
|
|
30
29
|
};
|
|
31
30
|
|
|
32
31
|
const disabledColor = {
|