@thecb/components 3.1.1 → 3.1.3
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/.storybook/main.js +4 -0
- package/.storybook/page.js +61 -0
- package/.storybook/themes/apc.theme.js +1 -0
- package/.storybook/themes/index.js +2 -0
- package/.storybook/themes/sf.theme.js +1 -0
- package/.tool-versions +1 -0
- package/dist/index.cjs.js +174 -13039
- package/package.json +12 -4
- package/rollup.config.js +0 -2
- package/src/components/atoms/breadcrumb/Breadcrumb.js +7 -0
- package/src/components/atoms/breadcrumb/Breadcrumb.theme.js +3 -1
- package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +31 -122
- package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +20 -7
- package/src/components/atoms/button-with-link/ButtonWithLink.js +17 -3
- package/src/components/atoms/dropdown/Dropdown.js +3 -6
- package/src/components/atoms/dropdown/Dropdown.stories.js +70 -0
- package/src/components/atoms/link/ExternalLink.styled.js +2 -2
- package/src/components/atoms/link/InternalLink.styled.js +7 -4
- package/src/components/atoms/radio-button/RadioButton.stories.js +69 -0
- package/src/components/atoms/toggle-switch/ToggleSwitch.js +1 -1
- package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +70 -0
- package/src/components/molecules/address-form/AddressForm.stories.js +21 -0
- package/src/components/molecules/change-password-form/ChangePasswordForm.stories.js +22 -0
- package/src/components/molecules/edit-name-form/EdidNameForm.stories.js +24 -0
- package/src/components/molecules/email-form/EmailForm.stories.js +24 -0
- package/src/components/molecules/forgot-password-form/ForgotPasswordForm.stories.js +24 -0
- package/src/components/molecules/login-form/LoginForm.stories.js +24 -0
- package/src/components/molecules/phone-form/PhoneForm.stories.js +24 -0
- package/src/components/molecules/registration-form/RegistrationForm.stories.js +24 -0
- package/src/components/molecules/reset-confirmation-form/ResetConfirmationForm.stories.js +11 -0
- package/src/components/molecules/reset-password-form/ResetPasswordForm.stories.js +24 -0
- package/src/components/molecules/reset-password-success/ResetPasswordSuccess.stories.js +11 -0
- package/src/components/molecules/tab-sidebar/TabSidebar.js +2 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { ThemeProvider } from "styled-components"
|
|
3
|
+
import { withKnobs, select, radios, text } from "@storybook/addon-knobs";
|
|
4
|
+
import { Provider } from 'react-redux';
|
|
5
|
+
import { createStore } from "redux";
|
|
6
|
+
import { Router } from "react-router-dom";
|
|
7
|
+
import { createBrowserHistory } from "history";
|
|
8
|
+
|
|
9
|
+
import ResizingContainer from "../src/components/atoms/layouts/examples/ResizingContainer";
|
|
10
|
+
import { SFTheme, APCTheme } from "./themes";
|
|
11
|
+
|
|
12
|
+
const themesLabel = "Theme";
|
|
13
|
+
const themes = {
|
|
14
|
+
SF: SFTheme,
|
|
15
|
+
APC: APCTheme,
|
|
16
|
+
None: {},
|
|
17
|
+
};
|
|
18
|
+
const defaultValue = SFTheme;
|
|
19
|
+
const groupId = "Theme";
|
|
20
|
+
|
|
21
|
+
const animateLabel = "Animate";
|
|
22
|
+
const animateOptions = {
|
|
23
|
+
play: "play",
|
|
24
|
+
pause: "pause"
|
|
25
|
+
};
|
|
26
|
+
const animateDefaultValue = "pause";
|
|
27
|
+
const animateGroupID = "Container";
|
|
28
|
+
|
|
29
|
+
const themeDecorator = storyFn => (
|
|
30
|
+
<ThemeProvider theme={select(themesLabel, themes, defaultValue, groupId)}>{storyFn()}</ThemeProvider>
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
export default ({ title, Component, reducer = () => { }}) => {
|
|
34
|
+
const history = createBrowserHistory();
|
|
35
|
+
const store =createStore(
|
|
36
|
+
reducer,
|
|
37
|
+
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
|
38
|
+
)
|
|
39
|
+
return {
|
|
40
|
+
title,
|
|
41
|
+
component: Component,
|
|
42
|
+
decorators: [
|
|
43
|
+
themeDecorator,
|
|
44
|
+
withKnobs,
|
|
45
|
+
storyFn => (
|
|
46
|
+
<Router history={history} >
|
|
47
|
+
<Provider store={store}>
|
|
48
|
+
<div style={{ height: "600px", display: "flex", justifyContent: "center", flexDirection: "column" }}>
|
|
49
|
+
<ResizingContainer
|
|
50
|
+
animate={radios(animateLabel, animateOptions, animateDefaultValue, animateGroupID)}
|
|
51
|
+
containerMax={text("Container Max", "40rem", animateGroupID)}
|
|
52
|
+
containerMin={text("Container Min", "20rem", animateGroupID)}>
|
|
53
|
+
{storyFn()}
|
|
54
|
+
</ResizingContainer >
|
|
55
|
+
</div>
|
|
56
|
+
</Provider>
|
|
57
|
+
</Router>
|
|
58
|
+
)
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const APCTheme = {values: {"Button":{"active":{"primary":"background-color: #C8171E; border: 2px solid #C8171E; box-shadow: 0 0 10px #E30100;","secondary":"background-color: #F58D91; color: #FF0000; box-shadow: 0 0 10px #FF0000","smallPrimary":"background-color: #C8171E; border: 2px solid #C8171E; box-shadow: 0 0 10px #E30100","smallSecondary":"background-color: #F58D91; color: #FF0000; box-shadow: 0 0 10px #FF0000"},"backgroundColor":{"primary":"#EC1C24","secondary":"#F6F6F9","smallPrimary":"#EC1C24","smallSecondary":"#F6F6F9"},"border":{"primary":"2px solid #EC1C24;","secondary":"2px solid #EC1C24;","smallPrimary":"2px solid %#EC1C24;","smallSecondary":"2px solid #EC1C24;"},"color":{"primary":"#F6F6F9","secondary":"#EC1C24","smallPrimary":"#F6F6F9","smallSecondary":"#EC1C24"},"focus":{"primary":"outline: none; background-color: #C8171E; border: 2px solid #C8171E; box-shadow: 0 0 10px #E30100","secondary":"outline: none; background-color: #F58D91; color: #FF0000; box-shadow: 0 0 10px #FF0000;","smallPrimary":"outline: none; background-color: #C8171E; border: 2px solid #C8171E; box-shadow: 0 0 10px #E30100","smallSecondary":"outline: none; background-color: #F58D91; color: #FF0000; box-shadow: 0 0 10px #FF0000;"},"hover":{"primary":"cursor: pointer; background-color: #E30100; border: 2px solid #E30100; box-shadow: 0 0 10px #E30100;","secondary":"cursor: pointer; background-color: #FBD9D9; box-shadow: 0 0 10px #EC1C24; color: #EC1C24;","smallPrimary":"cursor: pointer; background-color: #E30100; border: 2px solid #E30100; box-shadow: 0 0 10px #E30100;","smallSecondary":"cursor: pointer; background-color: #FBD9D9; box-shadow: 0 0 10px #EC1C24; color: #EC1C24;"}},"Footer":{"backgroundColor":"#56575B"},"Header":{"backgroundColor":"#FFFFFF"},"HighlightTabRow":{"backgroundColor":"#215B9E"},"linkColor":"#15749D","logo":"logo.png","primaryColor":"#3B414D","secondaryColor":"#E5E7EC","textColor":"#000000"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SFTheme = {values: {"AmountCallout":{"color":"#347BB2"},"Breadcrumb":{"color":"#347BB2"},"Button":{"active":{"danger":"background-color: #870000; border: 2px solid #870000; box-shadow: 0 0 10px #ED125F;","ghost":"background-color: $(transparent)s; color: #001952; box-shadow: none;","primary":"background-color: #001952; border: 2px solid #001952; box-shadow: 0 0 10px #347BB2","secondary":"background-color: #D8E5F2; box-shadow: 0 0 10px #D8E5F2;","smallGhost":"background-color: $(transparent)s; color: #001952; box-shadow: none;","smallPrimary":"background-color: #001952; border: 2px solid #001952; box-shadow: 0 0 10px #347BB2;","smallSecondary":"background-color: #D8E5F2; box-shadow: 0 0 10px #D8E5F2;"},"backgroundColor":{"danger":"#ED125F","ghost":"transparent","primary":"#347BB2","secondary":"transparent","smallGhost":"transparent","smallPrimary":"#347BB2","smallSecondary":"transparent"},"border":{"danger":"2px solid #ED125F;","ghost":"none","primary":"2px solid #347BB2;","secondary":"2px solid #347BB2;","smallGhost":"none","smallPrimary":"2px solid #347BB2;","smallSecondary":"2px solid #347BB2;"},"color":{"danger":"#FFFFFF","ghost":"#347BB2","primary":"#FFFFFF","secondary":"#347BB2","smallGhost":"#347BB2","smallPrimary":"#FFFFFF","smallSecondary":"#347BB2"},"disabled":{"danger":"background-color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 10px #6E727E; }","ghost":"color: #6E727E; border: none","primary":"background-color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 10px #6E727E; }","secondary":"background-color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 10px #6E727E; }","smallGhost":"color: #6E727E; border: none;","smallPrimary":"background-color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 10px #6E727E; }","smallSecondary":"background-color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 10px #6E727E; }"},"focus":{"danger":"outline: none; background-color: #BA002C; border: 2px solid #BA002C; box-shadow: 0 0 10px #ED125F","ghost":"outline: none; box-shadow: none; color: #024C85;","primary":"outline: none; background-color: #024C85; border: 2px solid #024C85; box-shadow: 0 0 10px #347BB2","secondary":"outline: none; background-color: #EAF2F8; box-shadow: 0 0 10px #EAF2F8;","smallGhost":"outline: none; box-shadow: none; color: #024C85;","smallPrimary":"outline: none; background-color: #024C85; border: 2px solid #024C85; box-shadow: 0 0 10px #347BB2","smallSecondary":"outline: none; background-color: #EAF2F8; box-shadow: 0 0 10px #EAF2F8;"},"hover":{"danger":"background-color: #BA002C; border: 2px solid #BA002C; box-shadow: 0 0 10px #ED125F;","ghost":"cursor: pointer; color: #024C85;","primary":"cursor: pointer; background-color: #024C85; border: 2px solid #024C85; box-shadow: 0 0 10px #347BB2","secondary":"cursor: pointer; background-color: #EAF2F8; box-shadow: 0 0 10px #EAF2F8;","smallGhost":"cursor: pointer; color: #024C85;","smallPrimary":"cursor: pointer; background-color: #024C85; border: 2px solid #024C85; box-shadow: 0 0 10px #347BB2","smallSecondary":"cursor: pointer; background-color: #EAF2F8; box-shadow: 0 0 10px #EAF2F8;"}},"Checkbox":{"boxShadow":{"default":"0 0 0 3px #D8E5F2;"},"checkedStyles":{"default":"background: #347BB2; border: 1px solid #347BB2;"}},"Dropdown":{"hoverColor":"#EFFAFF","selectedColor":"#347BB2"},"Footer":{"backgroundColor":"#182848","logoHeight":"52px","subfooterColor":"#347BB2"},"FormInput":{"hoverFocusStyles":{"default":"outline: none; text-decoration: underline; color: #024C85;"},"linkColor":{"default":"#347BB2"}},"Global":{"baseFontSize":"16px","baseMobileFontSize":"14px","pageBackground":"#F6F6F9"},"Header":{"backgroundColor":"#347BB2"},"Icons":{"accentColor":{"error":"#3B414D","info":"#3B414D","success":"#3B414D"},"primaryColor":{"error":"#FFFFFF","info":"#FFFFFF","success":"#FFFFFF"},"singleIconColor":{"darkMode":"#FFFFFF","primary":"#347BB2","secondary":"#3B414D"},"subIconColor":{"error":"#ED125F","info":"#347BB2","success":"#317D4F"}},"ModalLink":{"linkColor":"#347BB2"},"NavMenu":{"backgroundColor":"#347BB2"},"ProfileTab":{"activeTabAccent":"#347BB2","activeTabBackground":"#FFFFFF","activeTabHover":"#D8E5F2"},"RadioButton":{"activeColor":"#347BB2"},"Spinner":{"color":"#347BB2"},"ToggleSwitch":{"onBackground":"#347BB2"},"Workflow":{"accentColor":"#214566","fontFamily":"Open Sans, sans-serif","linkColor":"#214566","primaryButtonColor":"#347BB2","secondaryButtonColor":"#347BB2","textColor":"#091325","workflowFooterColor":"#182848","workflowHeaderColor":"#347BB2"},"linkColor":"#15749D","logo":"logo.png","primaryColor":"#3B414D","secondaryColor":"#E5E7EC","textColor":"#000000"}}
|
package/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodejs 10.13.0
|