Skip to content

Commit

Permalink
chore: remove knobs, fix some styles
Browse files Browse the repository at this point in the history
  • Loading branch information
timrbula committed Aug 16, 2022
1 parent 4069a36 commit 7c9fe75
Show file tree
Hide file tree
Showing 22 changed files with 170 additions and 191 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"@commitlint/config-conventional": "^17.0.3",
"@storybook/addon-a11y": "^6.5.9",
"@storybook/addon-essentials": "^6.5.9",
"@storybook/addon-knobs": "^6.4.0",
"@storybook/addon-links": "^6.5.9",
"@storybook/addon-storysource": "^6.5.9",
"@storybook/builder-vite": "^0.1.41",
Expand Down
23 changes: 11 additions & 12 deletions src/components/ComboBoxMultiSelect/ComboBoxMultiSelect.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { action } from "@storybook/addon-actions";
import { object, text } from "@storybook/addon-knobs";
import MultiSelect from "./ComboBoxMultiSelect";

export default {
Expand Down Expand Up @@ -43,11 +42,11 @@ export const Default = (args) => {
<MultiSelect
id="multi-select"
initialSelectedItems={initialDefaultAnimals}
items={object("items", animals)}
items={animals}
itemToString={(item) => item.label}
onChange={action("Multiselect changed")}
titleText={text("titleText", "Select some animals")}
placeholder={text("placeholder", "Select an animal")}
titleText={"Select some animals"}
placeholder={"Select an animal"}
{...args}
/>
);
Expand All @@ -57,11 +56,11 @@ export const NoSelectedItems = (args) => {
return (
<MultiSelect
id="multi-select"
items={object("items", animals)}
items={animals}
itemToString={(item) => item.label}
onChange={action("Multiselect changed")}
titleText={text("titleText", "Select some animals")}
placeholder={text("placeholder", "Select an animal")}
titleText={"Select some animals"}
placeholder={"Select an animal"}
{...args}
/>
);
Expand All @@ -80,13 +79,13 @@ export const KitchenSink = (args) => {
{ label: "Cat", value: "cat" },
{ label: "Cheetah", value: "cheetah" },
]}
items={object("items", animals)}
items={animals}
itemToString={(item) => item.label}
onChange={action("Multiselect changed")}
titleText={text("titleText", "Select some animals")}
placeholder={text("placeholder", "Select an animal")}
helperText={text("helperText", "Some helper text")}
tooltipContent={text("tooltipContent", "Tooltip for multiSelect")}
titleText={"Select some animals"}
placeholder={"Select an animal"}
helperText={"Some helper text"}
tooltipContent={"Tooltip for multiSelect"}
tooltipProps={{ direction: "top" }}
{...args}
/>
Expand Down
31 changes: 15 additions & 16 deletions src/components/Creatable/Creatable.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { action } from "@storybook/addon-actions";
import { text } from "@storybook/addon-knobs";
import Creatable from "./Creatable";

export default {
Expand All @@ -25,10 +24,10 @@ export const Default = (args) => {
return (
<Creatable
id="text-input-creatable"
labelText={text("labelText", "Creatable")}
labelText={"Creatable"}
onChange={action("creatable change")}
helperText="Test helperText"
placeholder={text("placeholder", "Create some values")}
placeholder={"Create some values"}
type="text"
{...args}
/>
Expand All @@ -39,10 +38,10 @@ export const NonDeletable = (args) => {
return (
<Creatable
id="text-input-creatable"
labelText={text("labelText", "Creatable")}
labelText={"Creatable"}
onChange={action("creatable change")}
helperText="Test helperText"
placeholder={text("placeholder", "Create some values")}
placeholder={"Create some values"}
initialValues="test,test2"
nonDeletable={true}
type="text"
Expand All @@ -56,13 +55,13 @@ export const KeyValuePair = (args) => {
<Creatable
createKeyValuePair
id="key-value-creatable"
keyLabelText={text("keyLabelText", "Creatable Key")}
valueLabelText={text("valueLabelText", "Creatable Value")}
keyLabelText={"Creatable Key"}
valueLabelText={"Creatable Value"}
onChange={action("creatable change")}
keyPlaceholder={text("keyPlaceholder", "Key")}
valuePlaceholder={text("valuePlaceholder", "Value")}
keyHelperText={text("keyHelperText", "Key Helper")}
valueHelperText={text("valueHelperText", "Value Helper")}
keyPlaceholder={"Key"}
valuePlaceholder={"Value"}
keyHelperText={"Key Helper"}
valueHelperText={"Value Helper"}
type="text"
{...args}
/>
Expand All @@ -73,10 +72,10 @@ export const LimitTheNumberOfAddedValues = (args) => {
return (
<Creatable
id="limit-values-creatable"
labelText={text("labelText", "Creatable with added items limited")}
labelText={"Creatable with added items limited"}
onChange={action("creatable change")}
helperText="Items added limited by 3"
placeholder={text("placeholder", "Create some values")}
placeholder={"Create some values"}
type="text"
max={3}
{...args}
Expand All @@ -89,11 +88,11 @@ export const KitchenSink = (args) => {
<Creatable
id="tooltip-creatable"
helperText="Example helper text for creatable"
labelText={text("labelText", "Controlled Creatable")}
placeholder={text("placeholder", "Create some values")}
labelText={"Controlled Creatable"}
placeholder={"Create some values"}
onChange={action("creatable change")}
type="text"
tooltipContent={text("tooltipContent", "Tooltip for creatable")}
tooltipContent={"Tooltip for creatable"}
tooltipProps={{ direction: "top" }}
{...args}
/>
Expand Down
25 changes: 12 additions & 13 deletions src/components/DateInput/DateInput.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { action } from "@storybook/addon-actions";
import { object, text } from "@storybook/addon-knobs";
import DateInput from "./DateInput";

export default {
Expand All @@ -20,7 +19,7 @@ export const Default = (args) => {
id="default-date-input"
onCalendarChange={action("date input calendar change")}
onChange={action("date input change")}
placeholder={text("placeholder", "yyyy-mm-dd")}
placeholder={"yyyy-mm-dd"}
autoComplete="off"
dateFormat="Y-m-d"
max="2020-01-31T13:10:20.219+00:00"
Expand All @@ -36,7 +35,7 @@ export const ReadOnly = (args) => {
id="read-only-date-input"
onCalendarChange={action("date input calendar change")}
onChange={action("date input change")}
placeholder={text("placeholder", "yyyy-mm-dd")}
placeholder={"yyyy-mm-dd"}
autoComplete="off"
dateFormat="Y-m-d"
max="2020-01-31T13:10:20.219+00:00"
Expand All @@ -55,11 +54,11 @@ export const Range = (args) => {
id="range-date-input"
dateFormat="Y-m-d"
onChange={action("date input change")}
placeholder={text("placeholder", "mm/dd/yyyy")}
helperText={text("helperText", "Some helper text")}
labelText={text("labelText", "Label for text input")}
tooltipContent={text("tooltipContent", "Tooltip for text input")}
tooltipProps={object("tooltipProps", { placement: "top" })}
placeholder={"mm/dd/yyyy"}
helperText={"Some helper text"}
labelText={"Label for text input"}
tooltipContent={"Tooltip for text input"}
tooltipProps={{ placement: "top" }}
max="2021-10-31T13:10:20.219+00:00"
min="2021-01-01T13:10:20.219+00:00"
value="2021-08-15T13:10:20.219+00:00,2021-09-19T13:10:20.219+00:00"
Expand All @@ -77,12 +76,12 @@ export const KitchenSink = (args) => {
id="tooltip-label-date-input"
onCalendarChange={action("date input calendar change")}
onChange={action("date input change")}
placeholder={text("placeholder", "mm/dd/yyyy")}
placeholder={"mm/dd/yyyy"}
autoComplete="off"
helperText={text("helperText", "Some helper text")}
labelText={text("labelText", "Label for text input")}
tooltipContent={text("tooltipContent", "Tooltip for text input")}
tooltipProps={object("tooltipProps", { placement: "top" })}
helperText={"Some helper text"}
labelText={"Label for text input"}
tooltipContent={"Tooltip for text input"}
tooltipProps={{ placement: "top" }}
{...args}
/>
</div>
Expand Down
9 changes: 4 additions & 5 deletions src/components/DecisionButtons/DecisionButtons.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import { action } from "@storybook/addon-actions";
import { text } from "@storybook/addon-knobs";
import { Button } from "@carbon/react";
import { Help, ThumbsUp, ThumbsDown } from "@carbon/react/icons";
import DecisionButtons from "./DecisionButtons";
Expand Down Expand Up @@ -56,11 +55,11 @@ export const Default = (args) => {
defaultSelected="radio 2"
name="radio buttons 1"
onChange={action("Change radio button")}
labelText={text("labelText", "Example label text")}
helperText={text("helperText", "Example helper text")}
labelText={"Example label text"}
helperText={"Example helper text"}
items={items1}
orientation="vertical"
tooltipContent={text("tooltipContent", "Tooltip for DecisionButtons")}
tooltipContent={"Tooltip for DecisionButtons"}
tooltipProps={{ direction: "right" }}
{...args}
/>
Expand All @@ -72,7 +71,7 @@ export const PositiveAndNegativeButtonsAndHorizontal = (args) => {
<DecisionButtons
defaultSelected="no"
name="radio buttons 2"
helperText={text("helperText", "Example helper text")}
helperText={"Example helper text"}
onChange={action("Change radio button")}
orientation="horizontal"
items={items2}
Expand Down
4 changes: 3 additions & 1 deletion src/components/DelayedRender/DelayedRender.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ DelayedRender.defaultProps = {
};

DelayedRender.propTypes = {
/**
* What to render after the delay
*/
children: PropTypes.node.isRequired,
/**
* Time to delay in milliseconds before rendering the component
*/

delay: PropTypes.number,
};

Expand Down
1 change: 0 additions & 1 deletion src/components/Error403/Error403.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { text } from "@storybook/addon-knobs";
import Error403Component from "./index";

export default {
Expand Down
2 changes: 0 additions & 2 deletions src/components/Error404/Error404.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { text } from "@storybook/addon-knobs";

import Error404Component from "./index";

export default {
Expand Down
9 changes: 4 additions & 5 deletions src/components/ErrorPage/ErrorPage.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { text } from "@storybook/addon-knobs";
import GraphicWrangler from "../GraphicWrangler";
import ErrorPage from "./ErrorPage";

Expand All @@ -18,9 +17,9 @@ export default {
export const Default = (args) => {
return (
<ErrorPage
header={text("header", "Header")}
title={text("title", "Title")}
message={text("message", "Message")}
header={"Header"}
title={"Title"}
message={"Message"}
graphic={<GraphicWrangler />}
{...args}
/>
Expand All @@ -30,7 +29,7 @@ export const Default = (args) => {
export const MessageLink = (args) => {
return (
<ErrorPage
title={text("title", "Title")}
title={"Title"}
message={
<p>
Hello there, <a href="https://useboomerang.io">use Boomerang!</a>
Expand Down
10 changes: 4 additions & 6 deletions src/components/ErrorPageCore/ErrorPageCore.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { text } from "@storybook/addon-knobs";

import ErrorPageCore from "./ErrorPageCore";

export default {
Expand All @@ -18,9 +16,9 @@ export default {
export const Default = (args) => {
return (
<ErrorPageCore
header={text("header", "Header")}
title={text("title", "Title")}
message={text("message", "Message")}
header={"Header"}
title={"Title"}
message={"Message"}
{...args}
/>
);
Expand All @@ -29,7 +27,7 @@ export const Default = (args) => {
export const MessageLink = (args) => {
return (
<ErrorPageCore
title={text("title", "Title")}
title={"Title"}
message={
<p>
Hello there, <a href="https://useboomerang.io">use Boomerang!</a>
Expand Down
5 changes: 3 additions & 2 deletions src/components/GdprRedirectModal/_gdprRedirectModal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
.#{$prefix}--bmrg-redirect__img {
width: 100%;
height: 10rem;
margin-top: 1.5rem;
margin: 1.5rem 0rem;
}

.#{$prefix}--bmrg-redirect__body {
display: block;
height: 1.25rem;
font-size: 0.875rem;
font-weight: 600;
line-height: 1.25rem;
text-transform: initial;
margin-bottom: 1.45rem;
max-width: 72ch;
}

.#{$prefix}--bmrg-redirect-container {
Expand Down
29 changes: 14 additions & 15 deletions src/components/Header/Header.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { text, boolean, object } from "@storybook/addon-knobs";
import { Link, Router } from "react-router-dom";
import { ServiceDesk } from "@carbon/react/icons";
import { Modal, SideNav, SideNavLink, SideNavItems, SideNavMenu, SideNavMenuItem } from "@carbon/react";
Expand All @@ -15,13 +14,13 @@ export default {
component: Header,
};

export const Default = () => (
export const Default = (args) => (
<Header
renderLogo={boolean("renderLogo", true)}
appName={text("appName", "")}
platformName={text("platformName", "")}
enableNotifications={boolean("enableNotifications", true)}
navLinks={object("navLinks", [
renderLogo={false}
appName={"App"}
platformName={"Boomerang"}
enableNotifications={true}
navLinks={[
{
name: "Launchpad",
url: "https://servicesessentials.ibm.com/launchpad/",
Expand All @@ -42,7 +41,7 @@ export const Default = () => (
name: "Admin",
url: "https://servicesessentials.ibm.com/admin/",
},
])}
]}
notificationsConfig={{
wsUrl: mockSocketUrl,
}}
Expand Down Expand Up @@ -74,14 +73,14 @@ export const Default = () => (
/>
);

export const WithIntegratedSidenav = () => (
export const WithIntegratedSidenav = (args) => (
<Router history={createMemoryHistory({ initialEntries: ["/"] })}>
<Header
renderLogo={boolean("renderLogo", true)}
enableNotifications={boolean("enableNotifications", true)}
companyName={text("companyName", "")}
productName={text("productName", "")}
navLinks={object("navLinks", [
renderLogo={false}
enableNotifications={true}
companyName={"Boomerang"}
productName={"Flow"}
navLinks={[
{
name: "Launchpad",
url: "https://servicesessentials.ibm.com/launchpad/",
Expand All @@ -102,7 +101,7 @@ export const WithIntegratedSidenav = () => (
name: "Admin",
url: "https://servicesessentials.ibm.com/admin/",
},
])}
]}
notificationsConfig={{
wsUrl: mockSocketUrl,
}}
Expand Down
Loading

0 comments on commit 7c9fe75

Please sign in to comment.