@thecb/components 3.1.4-beta.0 → 3.1.10

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 (76) hide show
  1. package/.storybook/page.js +5 -4
  2. package/.tool-versions +1 -0
  3. package/dist/index.cjs.js +113 -100
  4. package/package.json +5 -5
  5. package/src/components/atoms/alert/Alert.stories.js +28 -0
  6. package/src/components/atoms/amount-callout/AmountCallout.stories.js +41 -0
  7. package/src/components/atoms/amount-callout/AmountCallout.theme.js +4 -4
  8. package/src/components/atoms/breadcrumb/Breadcrumb.stories.js +38 -0
  9. package/src/components/atoms/button-with-link/ButtonWithLink.stories.js +32 -0
  10. package/src/components/atoms/checkbox/Checkbox.stories.js +29 -0
  11. package/src/components/atoms/checkbox-list/CheckboxList.stories.js +50 -0
  12. package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +42 -0
  13. package/src/components/atoms/display-box/DisplayBox.stories.js +25 -0
  14. package/src/components/atoms/display-card/DisplayCard.js +2 -0
  15. package/src/components/atoms/display-card/DisplayCard.stories.js +24 -0
  16. package/src/components/atoms/form-layouts/FormLayouts.stories.js +72 -0
  17. package/src/components/atoms/form-select/FormSelect.stories.js +44 -0
  18. package/src/components/atoms/formatted-address/FormattedAddress.js +1 -3
  19. package/src/components/atoms/formatted-address/FormattedAddress.stories.js +32 -0
  20. package/src/components/atoms/hamburger-button/HamburgerButton.js +7 -1
  21. package/src/components/atoms/hamburger-button/HamburgerButton.stories.js +21 -0
  22. package/src/components/atoms/heading/Heading.stories.js +20 -0
  23. package/src/components/atoms/icons/icons.stories.js +50 -0
  24. package/src/components/atoms/labeled-amount/LabeledAmount.js +1 -1
  25. package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +29 -0
  26. package/src/components/atoms/layouts/Cluster.js +2 -0
  27. package/src/components/atoms/layouts/Cluster.styled.js +1 -1
  28. package/src/components/atoms/layouts/examples/ResizingContainer.js +3 -1
  29. package/src/components/atoms/layouts/examples/ResizingContainer.styled.js +1 -1
  30. package/src/components/atoms/layouts/examples/box-example/BoxExample.stories.js +58 -0
  31. package/src/components/atoms/layouts/examples/center-example/CenterExample.stories.js +28 -0
  32. package/src/components/atoms/layouts/examples/cover-example/CoverExample.stories.js +53 -0
  33. package/src/components/atoms/layouts/examples/frame-example/FrameExample.stories.js +22 -0
  34. package/src/components/atoms/layouts/examples/imposter-example/ImposterExample.stories.js +35 -0
  35. package/src/components/atoms/layouts/examples/motion-example/MotionExample.stories.js +62 -0
  36. package/src/components/atoms/layouts/examples/reel-example/ReelExample.stories.js +57 -0
  37. package/src/components/atoms/line-item/LineItem.js +2 -2
  38. package/src/components/atoms/line-item/LineItem.stories.js +19 -0
  39. package/src/components/atoms/link/ExternalLink.js +1 -3
  40. package/src/components/atoms/link/InternalLink.styled.js +0 -2
  41. package/src/components/atoms/link/Link.stories.js +57 -0
  42. package/src/components/atoms/link/Link.theme.js +3 -2
  43. package/src/components/atoms/nav-footer/NavFooter.stories.js +31 -0
  44. package/src/components/atoms/nav-header/NavHeader.stories.js +29 -0
  45. package/src/components/atoms/paragraph/Paragraph.stories.js +34 -0
  46. package/src/components/atoms/paragraph/Paragraph.theme.js +6 -2
  47. package/src/components/atoms/password-requirements/PasswordRequirements.stories.js +75 -0
  48. package/src/components/atoms/placeholder/Placeholder.js +16 -16
  49. package/src/components/atoms/placeholder/Placeholder.stories.js +38 -0
  50. package/src/components/atoms/processing-fee/ProcessingFee.stories.js +28 -0
  51. package/src/components/atoms/solid-divider/SolidDivider.stories.js +11 -0
  52. package/src/components/atoms/spinner/Spinner.stories.js +17 -0
  53. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +52 -0
  54. package/src/components/atoms/text/Text.stories.js +34 -0
  55. package/src/components/atoms/text/Text.theme.js +6 -2
  56. package/src/components/molecules/collapsible-section/CollapsibleSection.js +2 -1
  57. package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +68 -0
  58. package/src/components/molecules/highlight-tab-row/HighlightTabRow.js +8 -3
  59. package/src/components/molecules/highlight-tab-row/HighlightTabRow.stories.js +30 -0
  60. package/src/components/molecules/highlight-tab-row/index.js +1 -6
  61. package/src/components/molecules/modal/Modal.stories.js +44 -0
  62. package/src/components/molecules/module/Module.js +6 -2
  63. package/src/components/molecules/module/Module.stories.js +31 -0
  64. package/src/components/molecules/module/index.js +1 -6
  65. package/src/components/molecules/obligation/Obligation.js +1 -1
  66. package/src/components/molecules/obligation/modules/AmountModule.js +6 -2
  67. package/src/components/molecules/payment-button-bar/PaymentButtonBar.stories.js +20 -0
  68. package/src/components/molecules/payment-details/PaymentDetails.stories.js +71 -0
  69. package/src/components/molecules/radio-section/RadioSection.stories.js +31 -0
  70. package/src/components/molecules/tab-sidebar/TabSidebar.stories.js +59 -0
  71. package/src/components/molecules/terms-and-conditions/TermsAndConditions.stories.js +24 -0
  72. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +31 -0
  73. package/src/components/molecules/workflow-tile/WorkflowTile.stories.js +25 -0
  74. package/dist/cb-components.esm.js +0 -23576
  75. package/dist/cb-components.js +0 -94714
  76. package/dist/index.esm.js +0 -36084
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ import { text, select, boolean } from "@storybook/addon-knobs";
3
+ import ButtonWithLink from "./ButtonWithLink";
4
+ import page from "../../../../.storybook/page";
5
+
6
+ const variants = {
7
+ primary: "primary",
8
+ secondary: "secondary",
9
+ back: "back",
10
+ smallPrimary: "smallPrimary",
11
+ smallSecondary: "smallSecondary",
12
+ ghost: "ghost",
13
+ smallGhost: "smallGhost",
14
+ danger: "danger",
15
+ None: undefined
16
+ };
17
+
18
+ export const buttonWithLink = () => (
19
+ <ButtonWithLink
20
+ variant={select("variant", variants, "primary", "props")}
21
+ url={text("url", "/login", "props")}
22
+ disabled={boolean("disabled", false, "props")}
23
+ extraStyles={text("extraStyles", "", "props")}
24
+ text={text("text", "Lorem", "props")}
25
+ />
26
+ );
27
+
28
+ const story = page({
29
+ title: "Components|Atoms/ButtonWithLink",
30
+ Component: ButtonWithLink
31
+ });
32
+ export default story;
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import { text, select, boolean } from "@storybook/addon-knobs";
3
+ import Checkbox from "./Checkbox";
4
+ import page from "../../../../.storybook/page";
5
+
6
+ const variantsLabel = "variant";
7
+ const variants = {
8
+ default: "default"
9
+ };
10
+ const defaultValue = "default";
11
+ const groupId = "props";
12
+
13
+ export const checkbox = () => (
14
+ <Checkbox
15
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
16
+ title={text("title", "Checkbox", "props")}
17
+ name={text("name", "Checkbox", "props")}
18
+ checked={boolean("checked", false, "props")}
19
+ error={boolean("error", false, "props")}
20
+ disabled={boolean("disabled", false, "props")}
21
+ focused={boolean("focused", false, "props")}
22
+ />
23
+ );
24
+
25
+ const story = page({
26
+ title: "Components|Atoms/Checkbox",
27
+ Component: Checkbox
28
+ });
29
+ export default story;
@@ -0,0 +1,50 @@
1
+ import React, { useState } from "react";
2
+ import { select } from "@storybook/addon-knobs";
3
+ import CheckboxList from "./CheckboxList";
4
+ import page from "../../../../.storybook/page";
5
+
6
+ const variantsLabel = "variant";
7
+ const variants = {
8
+ default: "default",
9
+ disabled: "disabled"
10
+ };
11
+ const defaultValue = "default";
12
+ const groupId = "props";
13
+ const imageUrl = `https://picsum.photos/seed/picsum/200/300`;
14
+ const items = [
15
+ {
16
+ text: "item 1",
17
+ name: "item 1 name",
18
+ imageUrl: imageUrl
19
+ },
20
+ {
21
+ text: "item 2",
22
+ name: "item 2 name",
23
+ imageUrl: imageUrl
24
+ },
25
+ {
26
+ text: "item 3",
27
+ name: "item 3 name",
28
+ imageUrl: imageUrl
29
+ }
30
+ ];
31
+ export const checkboxList = () => {
32
+ const [selected, setSelected] = useState(false);
33
+ const setSelectedItem = (e, item) => {
34
+ setSelected(item.name);
35
+ };
36
+ return (
37
+ <CheckboxList
38
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
39
+ items={items}
40
+ selectedName={selected}
41
+ onSelect={setSelectedItem}
42
+ />
43
+ );
44
+ };
45
+
46
+ const story = page({
47
+ title: "Components|Atoms/CheckboxList",
48
+ Component: CheckboxList
49
+ });
50
+ export default story;
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { connect } from "react-redux";
3
+ import { createFormState, required } from "redux-freeform";
4
+ import { Box } from "../../atoms/layouts";
5
+ import CountryDropdown from "./CountryDropdown";
6
+ import { options } from "./options";
7
+ import page from "../../../../.storybook/page";
8
+
9
+ const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
10
+ country: {
11
+ validators: [required()]
12
+ }
13
+ });
14
+ const errorMessages = {
15
+ [required.error]: "country is required"
16
+ };
17
+
18
+ const story = page({
19
+ title: "Components|Atoms/CountryDropdown",
20
+ Component: CountryDropdown,
21
+ reducer,
22
+ mapStateToProps,
23
+ mapDispatchToProps
24
+ });
25
+
26
+ const CountryFormWrapper = ({ fields, actions }) => (
27
+ <Box minHeight="300px">
28
+ <CountryDropdown
29
+ errorMessages={errorMessages}
30
+ options={options}
31
+ field={fields.country}
32
+ fieldActions={actions.fields.country}
33
+ />
34
+ </Box>
35
+ );
36
+
37
+ export default story;
38
+ const ConnectedForm = connect(
39
+ mapStateToProps,
40
+ mapDispatchToProps
41
+ )(CountryFormWrapper);
42
+ export const countryDropdown = () => <ConnectedForm />;
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { boolean } from "@storybook/addon-knobs";
3
+ import DisplayBox from "./DisplayBox";
4
+ import FormattedAddress from "../formatted-address";
5
+ import page from "../../../../.storybook/page";
6
+
7
+ export const displayBox = () => (
8
+ <DisplayBox showError={boolean("showError", false, "props")}>
9
+ <FormattedAddress
10
+ qaPrefix="billing-info"
11
+ name="Citybase"
12
+ street1="30 North Lasalle"
13
+ city="Chicago"
14
+ country="USA"
15
+ stateProvince="Illinois"
16
+ zip="60606"
17
+ />
18
+ </DisplayBox>
19
+ );
20
+
21
+ const story = page({
22
+ title: "Components|Atoms/DisplayBox",
23
+ Component: DisplayBox
24
+ });
25
+ export default story;
@@ -46,6 +46,7 @@ const DisplayCard = ({
46
46
  url={url}
47
47
  variant="smallGhost"
48
48
  dataQa={buttonText}
49
+ extraStyles={`min-width: 0;`}
49
50
  />
50
51
  ) : (
51
52
  <ButtonWithAction
@@ -53,6 +54,7 @@ const DisplayCard = ({
53
54
  action={buttonAction}
54
55
  variant="smallGhost"
55
56
  dataQa={buttonText}
57
+ extraStyles={`min-width: 0;`}
56
58
  />
57
59
  )}
58
60
  </Cluster>
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { text, boolean } from "@storybook/addon-knobs";
3
+
4
+ import DisplayCard from "./DisplayCard";
5
+ import page from "../../../../.storybook/page";
6
+
7
+ const story = page({
8
+ title: "Components|Atoms/DisplayCard",
9
+ Component: DisplayCard
10
+ });
11
+ export default story;
12
+
13
+ export const displayCard = () => (
14
+ <DisplayCard
15
+ title={text("title", "Title", "props")}
16
+ buttonText={text("buttonText", "Lorem", "props")}
17
+ url={text("url", "http://google.com", "props")}
18
+ link={boolean("link", false, "props")}
19
+ buttonAction={text("buttonAction", () => {}, "props")}
20
+ item={text("item", "Foo", "props")}
21
+ >
22
+ {text("children", "Lorem Ipsum", "props")}
23
+ </DisplayCard>
24
+ );
@@ -0,0 +1,72 @@
1
+ import React from "react";
2
+ import { select, text } from "@storybook/addon-knobs";
3
+ import FormContainer from "./FormContainer";
4
+ import FormInput from "./FormInput";
5
+ import FormInputColumn from "./FormInputColumn";
6
+ import FormInputRow from "./FormInputRow";
7
+ import page from "../../../../.storybook/page";
8
+
9
+ const variantsLabel = "variant";
10
+ const variants = {
11
+ default: "default",
12
+ disabled: "disabled",
13
+ checkout: "checkout",
14
+ collapsible: "collapsible"
15
+ };
16
+ const defaultValue = "primary";
17
+ const groupId = "props";
18
+
19
+ const data = {
20
+ test: {
21
+ rawValue: "Form Layouts"
22
+ }
23
+ };
24
+ export const formLayouts = () => {
25
+ return (
26
+ <FormContainer
27
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
28
+ role="form"
29
+ aria-label="Storybook Form"
30
+ >
31
+ <FormInputRow childGap={text("rowChildGap", "1rem", "props")}>
32
+ <FormInput
33
+ labelTextWhenNoError="Form Layouts"
34
+ errorMessages="Error"
35
+ field={data.test}
36
+ />
37
+ </FormInputRow>
38
+ <FormInputRow childGap={text("rowChildGap", "1rem", "props")}>
39
+ <FormInputColumn childGap={text("columnChildGap", "0.5rem", "props")}>
40
+ <FormInput
41
+ labelTextWhenNoError="Form Layouts"
42
+ errorMessages="Error"
43
+ field={data.test}
44
+ />
45
+ <FormInput
46
+ labelTextWhenNoError="Form Layouts"
47
+ errorMessages="Error"
48
+ field={data.test}
49
+ />
50
+ </FormInputColumn>
51
+ <FormInputColumn childGap={text("columnChildGap", "0.5rem", "props")}>
52
+ <FormInput
53
+ labelTextWhenNoError="Form Layouts"
54
+ errorMessages="Error"
55
+ field={data.test}
56
+ />
57
+ <FormInput
58
+ labelTextWhenNoError="Form Layouts"
59
+ errorMessages="Error"
60
+ field={data.test}
61
+ />
62
+ </FormInputColumn>
63
+ </FormInputRow>
64
+ </FormContainer>
65
+ );
66
+ };
67
+
68
+ const story = page({
69
+ title: "Components|Atoms/FormContainer",
70
+ Component: FormContainer
71
+ });
72
+ export default story;
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { connect } from "react-redux";
3
+ import { boolean } from "@storybook/addon-knobs";
4
+ import { createFormState, required } from "redux-freeform";
5
+
6
+ import FormSelect from "./FormSelect";
7
+ import page from "../../../../.storybook/page";
8
+
9
+ const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
10
+ thing: {
11
+ validators: [required()]
12
+ }
13
+ });
14
+ const errorMessages = {
15
+ [required.error]: "thing is required"
16
+ };
17
+ const options = [
18
+ { value: "", text: "choose name" },
19
+ { value: "foo", text: "foo" },
20
+ { value: "bar", text: "bar" },
21
+ { value: "baz", text: "baz" }
22
+ ];
23
+
24
+ const story = page({
25
+ title: "Components|Atoms/FormSelect",
26
+ Component: FormSelect,
27
+ reducer,
28
+ mapStateToProps,
29
+ mapDispatchToProps,
30
+ height: "500px"
31
+ });
32
+
33
+ const FormWrapper = ({ fields, actions }) => (
34
+ <FormSelect
35
+ errorMessages={errorMessages}
36
+ options={options}
37
+ field={fields.thing}
38
+ fieldActions={actions.fields.thing}
39
+ />
40
+ );
41
+
42
+ export default story;
43
+ const ConnectedForm = connect(mapStateToProps, mapDispatchToProps)(FormWrapper);
44
+ export const formSelect = () => <ConnectedForm />;
@@ -5,7 +5,6 @@ import { fallbackValues } from "./FormattedAddress.theme";
5
5
  import { themeComponent } from "../../../util/themeUtils";
6
6
 
7
7
  const FormattedAddress = ({
8
- isActive,
9
8
  street1,
10
9
  city,
11
10
  stateProvince,
@@ -13,12 +12,11 @@ const FormattedAddress = ({
13
12
  zip,
14
13
  street2 = null,
15
14
  name = null,
16
- isRadio,
17
15
  themeValues,
18
16
  qaPrefix = "address"
19
17
  }) => {
20
18
  return (
21
- <Box padding={themeValues.padding} isActive={isActive} isRadio={isRadio}>
19
+ <Box padding={themeValues.padding}>
22
20
  {name && (
23
21
  <Text variant="p" color={themeValues.color} dataQa={`${qaPrefix}-name`}>
24
22
  {name}
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ import { select, text } from "@storybook/addon-knobs";
3
+ import FormattedAddress from "./FormattedAddress";
4
+ import page from "../../../../.storybook/page";
5
+
6
+ const variantsLabel = "variant";
7
+ const variants = {
8
+ default: "default",
9
+ radio: "radio",
10
+ None: undefined
11
+ };
12
+ const defaultValue = "default";
13
+ const groupId = "props";
14
+
15
+ export const formattedAddress = () => (
16
+ <FormattedAddress
17
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
18
+ street1={text("street1", "30 North Lasalle", groupId)}
19
+ city={text("city", "Chicago", groupId)}
20
+ stateProvince={text("stateProvince", "Illinois", groupId)}
21
+ country={text("country", "USA", groupId)}
22
+ zip={text("zip", "60606", groupId)}
23
+ street2={text("street2", "", groupId)}
24
+ name={text("name", "Citybase", groupId)}
25
+ />
26
+ );
27
+
28
+ const story = page({
29
+ title: "Components|Atoms/FormattedAddress",
30
+ Component: FormattedAddress
31
+ });
32
+ export default story;
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import styled from "styled-components";
3
+ import { noop } from "../../../util/general";
3
4
 
4
5
  const Hamburger = styled.button`
5
6
  padding: 8px;
@@ -92,7 +93,12 @@ const HamburgerInner = styled.span`
92
93
  }
93
94
  `;
94
95
 
95
- const HamburgerButton = ({ activeColor, inactiveColor, isActive, onClick }) => (
96
+ const HamburgerButton = ({
97
+ activeColor,
98
+ inactiveColor,
99
+ isActive,
100
+ onClick = noop
101
+ }) => (
96
102
  <Hamburger
97
103
  className={isActive === true ? "active" : ""}
98
104
  onClick={onClick}
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { text, boolean, select } from "@storybook/addon-knobs";
3
+
4
+ import HamburgerButton from "./HamburgerButton";
5
+ import page from "../../../../.storybook/page";
6
+
7
+ import * as colors from "../../../constants/colors";
8
+
9
+ const story = page({
10
+ title: "Components|Atoms/HamburgerButton",
11
+ Component: HamburgerButton
12
+ });
13
+ export default story;
14
+
15
+ export const hamburgerButton = () => (
16
+ <HamburgerButton
17
+ activeColor={select("activeColor", colors, "black", "props")}
18
+ inactiveColor={select("inactiveColor", colors, "black", "props")}
19
+ isActive={boolean("isActive", false, "props")}
20
+ />
21
+ );
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { text } from "@storybook/addon-knobs";
3
+
4
+ import Heading from "./Heading";
5
+ import page from "../../../../.storybook/page";
6
+
7
+ const story = page({
8
+ title: "Components|Atoms/Heading",
9
+ Component: Heading
10
+ });
11
+ export default story;
12
+
13
+ export const heading = () => (
14
+ <Heading
15
+ textAlign={text("textAlign", "center", "props")}
16
+ extraStyles={text("extraStyles", "", "props")}
17
+ >
18
+ {text("children", "Foo", "props")}
19
+ </Heading>
20
+ );
@@ -0,0 +1,50 @@
1
+ import React from "react";
2
+
3
+ import page from "../../../../.storybook/page";
4
+ import {
5
+ AccountsIcon,
6
+ AccountsAddIcon,
7
+ ForgotPasswordIcon,
8
+ GoToEmailIcon,
9
+ VerifiedEmailIcon,
10
+ PaymentMethodIcon,
11
+ AccountsIconSmall,
12
+ PaymentsIconSmall,
13
+ ProfileIconSmall,
14
+ SettingsIconSmall,
15
+ ChevronIcon,
16
+ PropertiesAddIcon,
17
+ PropertiesIconSmall,
18
+ AccountNumberImage,
19
+ RoutingNumberImage,
20
+ CheckmarkIcon,
21
+ BankIcon,
22
+ GenericCard,
23
+ PaymentIcon
24
+ } from "./index";
25
+
26
+ const story = page({
27
+ title: "Components|atoms/Icons",
28
+ Component: AccountsIcon
29
+ });
30
+ export default story;
31
+
32
+ export const accountsIcon = () => <AccountsIcon />;
33
+ export const accountsAddIcon = () => <AccountsAddIcon />;
34
+ export const forgotPasswordIcon = () => <ForgotPasswordIcon />;
35
+ export const goToEmailIcon = () => <GoToEmailIcon />;
36
+ export const verifiedEmailIcon = () => <VerifiedEmailIcon />;
37
+ export const paymentMethodIcon = () => <PaymentMethodIcon />;
38
+ export const accountsIconSmall = () => <AccountsIconSmall />;
39
+ export const paymentsIconSmall = () => <PaymentsIconSmall />;
40
+ export const profileIconSmall = () => <ProfileIconSmall />;
41
+ export const settingsIconSmall = () => <SettingsIconSmall />;
42
+ export const chevronIcon = () => <ChevronIcon />;
43
+ export const propertiesAddIcon = () => <PropertiesAddIcon />;
44
+ export const propertiesIconSmall = () => <PropertiesIconSmall />;
45
+ export const accountNumberImage = () => <AccountNumberImage />;
46
+ export const routingNumberImage = () => <RoutingNumberImage />;
47
+ export const checkmarkIcon = () => <CheckmarkIcon />;
48
+ export const bankIcon = () => <BankIcon />;
49
+ export const genericCard = () => <GenericCard />;
50
+ export const paymentIco = () => <PaymentIcon />;
@@ -12,7 +12,7 @@ const LabeledAmount = ({ variant = "pL", label, amount, themeValues }) => {
12
12
  <LabeledAmountText
13
13
  variant={variant}
14
14
  weight={themeValues.fontWeight}
15
- extraStyles="text-align: end; flex: 3;"
15
+ extraStyles="text-align: start; flex: 3;"
16
16
  >
17
17
  {label}:
18
18
  </LabeledAmountText>
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import { text, select } from "@storybook/addon-knobs";
3
+ import LabeledAmount from "./LabeledAmount";
4
+ import page from "../../../../.storybook/page";
5
+
6
+ const variantsLabel = "variant";
7
+ const variants = {
8
+ default: "default",
9
+ p: "p",
10
+ pL: "pL",
11
+ h6: "h6",
12
+ None: undefined
13
+ };
14
+ const defaultValue = "default";
15
+ const groupId = "props";
16
+
17
+ export const labeledAmount = () => (
18
+ <LabeledAmount
19
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
20
+ label={text("label", "Amount", groupId)}
21
+ amount={text("amount", "$1.23", groupId)}
22
+ />
23
+ );
24
+
25
+ const story = page({
26
+ title: "Components|Atoms/LabeledAmount",
27
+ Component: LabeledAmount
28
+ });
29
+ export default story;
@@ -17,6 +17,7 @@ const Cluster = ({
17
17
  childGap,
18
18
  minHeight,
19
19
  minWidth,
20
+ nowrap,
20
21
  overflow = false,
21
22
  children,
22
23
  ...rest
@@ -28,6 +29,7 @@ const Cluster = ({
28
29
  childGap={childGap}
29
30
  minHeight={minHeight}
30
31
  minWidth={minWidth}
32
+ nowrap={nowrap}
31
33
  >
32
34
  {safeChildren(children, <Fragment />)}
33
35
  </ClusterInnerWrapper>
@@ -8,7 +8,7 @@ export const ClusterWrapper = styled.div`
8
8
  export const ClusterInnerWrapper = styled.div`
9
9
  box-sizing: border-box;
10
10
  display: flex;
11
- flex-wrap: wrap;
11
+ flex-wrap: ${({ nowrap }) => (nowrap ? "nowrap" : "wrap")};
12
12
  justify-content: ${({ justify }) => justify};
13
13
  align-items: ${({ align }) => align};
14
14
  margin: calc(${({ childGap }) => childGap} / 2 * -1);
@@ -10,7 +10,8 @@ const ResizeContainer = ({
10
10
  animate = "pause",
11
11
  containerMax = "500px",
12
12
  containerMin = "100%",
13
- padding = "0.5rem"
13
+ padding = "0.5rem",
14
+ height = "auto"
14
15
  }) => {
15
16
  const ref = useRef();
16
17
  const [width, setWidth] = useState(0);
@@ -39,6 +40,7 @@ const ResizeContainer = ({
39
40
  containerMax={containerMax}
40
41
  containerMin={containerMin}
41
42
  padding={padding}
43
+ height={height}
42
44
  >
43
45
  {safeChildren(children, <Fragment />)}
44
46
  </ResizeInnerContainer>
@@ -23,7 +23,7 @@ export const ResizeInnerContainer = styled.div`
23
23
  box-sizing: border-box;
24
24
  margin-left: auto;
25
25
  margin-right: auto;
26
- height: auto;
26
+ height: ${({ height }) => height};
27
27
  overflow-y: auto;
28
28
  display: flex;
29
29
  flex-direction: column;
@@ -0,0 +1,58 @@
1
+ import React from "react";
2
+ import { text, radios, select } from "@storybook/addon-knobs";
3
+
4
+ import page from "../../../../../../.storybook/page";
5
+ import Box from "../../Box";
6
+ import LayoutContentBlock from "../LayoutContentBlock";
7
+
8
+ const as = { default: "", button: "button" };
9
+ const textAlign = {
10
+ left: "left",
11
+ center: "center",
12
+ right: "right"
13
+ };
14
+ const groupId = "props";
15
+
16
+ export default page({
17
+ title: "Layouts|Basic Layouts/Box",
18
+ Component: Box
19
+ });
20
+
21
+ export const box = () => (
22
+ <Box
23
+ padding={text("padding", "16px", groupId)}
24
+ borderSize={text("borderSize", "0px", groupId)}
25
+ borderColor={text("borderColor", "transparent", groupId)}
26
+ borderRadius={text("borderRadius", "0px", groupId)}
27
+ boxShadow={text("boxShadow", "none", groupId)}
28
+ background={text("background", "", groupId)}
29
+ color={text("color", "", groupId)}
30
+ minHeight={text("minHeight", "", groupId)}
31
+ width={text("width", "", groupId)}
32
+ minWidth={text("minWidth", "", groupId)}
33
+ maxWidth={text("maxWidth", "", groupId)}
34
+ borderWidthOverride={text("borderWidthOverride", "", groupId)}
35
+ border={text("border", "", groupId)}
36
+ as={radios("as", as, "default", groupId)}
37
+ textAlign={select("textAlign", textAlign, "left", groupId)}
38
+ hoverStyles={text("hoverStyles", "", groupId)}
39
+ activeStyles={text("activeStyles", "", groupId)}
40
+ disabledStyles={text("disabledStyles", "", groupId)}
41
+ hiddenStyles={text("hiddenStyles", "", groupId)}
42
+ extraStyles={text("extraStyles", "", groupId)}
43
+ onClick={text("onClick", () => {}, groupId)}
44
+ onKeyDown={text("onKeyDown", () => {}, groupId)}
45
+ onMouseEnter={text("onMouseEnter", () => {}, groupId)}
46
+ onMouseLeave={text("onMouseLeave", () => {}, groupId)}
47
+ onFocus={text("onFocus", () => {}, groupId)}
48
+ onBlur={text("onBlur", () => {}, groupId)}
49
+ onTouchEnd={text("onTouchEnd", () => {}, groupId)}
50
+ >
51
+ Text Child
52
+ <LayoutContentBlock
53
+ height="3.5rem"
54
+ width="8rem"
55
+ layoutName="Component Child"
56
+ />
57
+ </Box>
58
+ );