add some missing stories for ui-components

This commit is contained in:
Eduard Heimbuch
2020-05-06 15:58:00 +02:00
parent cb2916a58e
commit abcbc6beac
11 changed files with 952 additions and 30 deletions

View File

@@ -0,0 +1,47 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { storiesOf } from "@storybook/react";
import { BranchSelector } from "./index";
import { Branch } from "@scm-manager/ui-types/src";
import * as React from "react";
import styled from "styled-components";
const master = { name: "master", revision: "1", defaultBranch: true, _links: {} };
const develop = { name: "develop", revision: "2", defaultBranch: false, _links: {} };
const branchSelected = (branch?: Branch) => {};
const branches = [master, develop];
const Wrapper = styled.div`
margin: 2rem;
max-width: 400px;
`;
storiesOf("BranchSelector", module)
.addDecorator(storyFn => <Wrapper>{storyFn()}</Wrapper>)
.add("Default", () => (
<BranchSelector branches={branches} onSelectBranch={branchSelected} label="Select branch:" />
));

View File

@@ -0,0 +1,57 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { storiesOf } from "@storybook/react";
import * as React from "react";
import styled from "styled-components";
import Breadcrumb from "./Breadcrumb";
import repository from "./__resources__/repository";
// @ts-ignore ignore unknown png
import Git from "./__resources__/git-logo.png";
import { MemoryRouter } from "react-router-dom";
const Wrapper = styled.div`
margin: 2rem;
max-width: 800px;
`;
const master = { name: "master", revision: "1", defaultBranch: true, _links: {} };
const path = "src/main/java/com/cloudogu";
const baseUrl = "scm-manager.org/scm/repo/hitchhiker/heartOfGold/sources";
const sources = Git;
storiesOf("BreadCrumb", module)
.addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
.addDecorator(storyFn => <Wrapper>{storyFn()}</Wrapper>)
.add("Default", () => (
<Breadcrumb
repository={repository}
defaultBranch={master}
branch={master}
path={path}
baseUrl={baseUrl}
sources={sources}
revision={"1"}
/>
));

View File

@@ -59,24 +59,23 @@ class Breadcrumb extends React.Component<Props> {
if (path) {
const paths = path.split("/");
const map = paths.map((path, index) => {
return paths.map((pathFragment, index) => {
const currPath = paths.slice(0, index + 1).join("/");
if (paths.length - 1 === index) {
return (
<li className="is-active" key={index}>
<Link to="#" aria-current="page">
{path}
{pathFragment}
</Link>
</li>
);
}
return (
<li key={index}>
<Link to={baseUrl + "/" + revision + "/" + currPath}>{path}</Link>
<Link to={baseUrl + "/" + revision + "/" + currPath}>{pathFragment}</Link>
</li>
);
});
return map;
}
return null;
}

View File

@@ -0,0 +1,71 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import styled from "styled-components";
import * as React from "react";
import { ReactNode, useState } from "react";
import { MemoryRouter } from "react-router-dom";
import { storiesOf } from "@storybook/react";
import Notification from "./Notification";
const Wrapper = styled.div`
margin: 2rem;
max-width: 400px;
`;
const content =
"Cleverness nuclear genuine static irresponsibility invited President Zaphod\n" +
"Beeblebrox hyperspace ship. Another custard through computer-generated universe\n" +
"shapes field strong disaster parties Russells ancestors infinite colour\n" +
"imaginative generator sweep.";
const RoutingDecorator = (story: () => ReactNode) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
storiesOf("Notification", module)
.addDecorator(RoutingDecorator)
.addDecorator(storyFn => <Wrapper>{storyFn()}</Wrapper>)
.add("Primary", () => <Notification type="primary">{content}</Notification>)
.add("Success", () => <Notification type="success">{content}</Notification>)
.add("Info", () => <Notification type="info">{content}</Notification>)
.add("Warning", () => <Notification type="warning">{content}</Notification>)
.add("Danger", () => <Notification type="danger">{content}</Notification>)
.add("Closeable", () => <Closeable />);
const Closeable = () => {
const [show, setShow] = useState(true);
const hide = () => {
setShow(false);
};
if (!show) {
return null;
}
return (
<Notification type="warning" onClose={() => hide()}>
{content}
</Notification>
);
};

View File

@@ -0,0 +1,60 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import styled from "styled-components";
import { storiesOf } from "@storybook/react";
import * as React from "react";
import Tag from "./Tag";
import { ReactNode } from "react";
import { MemoryRouter } from "react-router-dom";
const Wrapper = styled.div`
margin: 2rem;
max-width: 400px;
`;
const Spacing = styled.div`
padding: 1em;
`;
const colors = ["primary", "link", "info", "success", "warning", "danger"];
const RoutingDecorator = (story: () => ReactNode) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
storiesOf("Tag", module)
.addDecorator(RoutingDecorator)
.addDecorator(storyFn => <Wrapper>{storyFn()}</Wrapper>)
.add("Default", () => <Tag label="Default tag" />)
.add("With Icon", () => <Tag label="System" icon="bolt" />)
.add("Colors", () => (
<div>
{colors.map(color => (
<Spacing>
<Tag color={color} label={color} />
</Spacing>
))}
</div>
))
.add("With title", () => <Tag label="hover me" title="good job"/>)
.add("Clickable", () => <Tag label="Click here" onClick={() => alert("Not so fast")}/>);

View File

@@ -0,0 +1,61 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import styled from "styled-components";
import * as React from "react";
import { ReactNode } from "react";
import { MemoryRouter } from "react-router-dom";
import { storiesOf } from "@storybook/react";
import Tooltip from "./Tooltip";
import Button from "./buttons/Button";
const Wrapper = styled.div`
margin: 2rem;
max-width: 400px;
`;
const Spacing = styled.div`
padding: 2em 6em;
`;
const positions = ["right", "top", "left", "bottom"];
const message = "Heart of Gold";
const RoutingDecorator = (story: () => ReactNode) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
storiesOf("Tooltip", module)
.addDecorator(RoutingDecorator)
.addDecorator(storyFn => <Wrapper>{storyFn()}</Wrapper>)
.add("Default", () => (
<div>
{positions.map(position => (
<Spacing>
<Tooltip message={message} location={position}>
<Button label={position} color="info" />{" "}
</Tooltip>
</Spacing>
))}
</div>
));

View File

@@ -22,12 +22,12 @@
* SOFTWARE.
*/
export default {
contact: "heart-of-gold@hitchhiher.com",
contact: "heart-of-gold@hitchhiker.com",
creationDate: "2020-03-23T08:26:01.164Z",
description: "The starship Heart of Gold was the first spacecraft to make use of the Infinite Improbability Drive",
healthCheckFailures: [],
lastModified: "2020-03-23T08:26:01.876Z",
namespace: "hitchhiher",
namespace: "hitchhiker",
name: "heartOfGold",
type: "git",
_links: {

View File

@@ -1,5 +1,134 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Storyshots BranchSelector Default 1`] = `
<div
className="BranchSelectorstories__Wrapper-cg4ke7-0 fJnRhY"
>
<div
className="field is-horizontal"
>
<div
className="BranchSelector__ZeroflexFieldLabel-sc-1120xyr-0 jDDnkZ field-label is-normal"
>
<label
className="label is-size-6"
>
Select branch:
</label>
</div>
<div
className="field-body"
>
<div
className="BranchSelector__NoBottomMarginField-sc-1120xyr-2 dwGRxk field is-narrow"
>
<div
className="BranchSelector__MinWidthControl-sc-1120xyr-1 ejZRKS control"
>
<div
className="is-fullwidth select"
>
<select
disabled={false}
onChange={[Function]}
value=""
>
<option
selected={false}
value="master"
>
master
</option>
<option
selected={false}
value="develop"
>
develop
</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
`;
exports[`Storyshots BreadCrumb Default 1`] = `
<div
className="Breadcrumbstories__Wrapper-sc-1eq8sgz-0 iQWHhZ"
>
<div
className="is-flex"
>
<nav
aria-label="breadcrumbs"
className="Breadcrumb__FlexStartNav-zvtb4t-0 iSVqtO breadcrumb sources-breadcrumb"
>
<ul>
<li>
<a
href="/scm-manager.org/scm/repo/hitchhiker/heartOfGold/sources/1/"
onClick={[Function]}
>
<i
className="fas fa-fw fa-home has-text-inherit Breadcrumb__HomeIcon-zvtb4t-1 dXzWcx"
title="breadcrumb.home"
/>
</a>
</li>
<li>
<a
href="/scm-manager.org/scm/repo/hitchhiker/heartOfGold/sources/1/src"
onClick={[Function]}
>
src
</a>
</li>
<li>
<a
href="/scm-manager.org/scm/repo/hitchhiker/heartOfGold/sources/1/src/main"
onClick={[Function]}
>
main
</a>
</li>
<li>
<a
href="/scm-manager.org/scm/repo/hitchhiker/heartOfGold/sources/1/src/main/java"
onClick={[Function]}
>
java
</a>
</li>
<li>
<a
href="/scm-manager.org/scm/repo/hitchhiker/heartOfGold/sources/1/src/main/java/com"
onClick={[Function]}
>
com
</a>
</li>
<li
className="is-active"
>
<a
aria-current="page"
href="/"
onClick={[Function]}
>
cloudogu
</a>
</li>
</ul>
</nav>
</div>
<hr
className="is-marginless"
/>
</div>
`;
exports[`Storyshots Buttons|AddButton Default 1`] = `
<div
className="indexstories__Spacing-bpoict-0 FnHDe"
@@ -34607,6 +34736,105 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
</div>
`;
exports[`Storyshots Modal|ConfirmAlert Default 1`] = `
<div
className="modal is-active"
>
<div
className="modal-background"
/>
<div
className="modal-card"
>
<header
className="modal-card-head has-background-light"
>
<p
className="modal-card-title is-marginless"
>
Are you sure about that?
</p>
<button
aria-label="close"
className="delete"
onClick={[Function]}
/>
</header>
<section
className="modal-card-body"
>
Mind-paralyzing change needed improbability vortex machine sorts sought same theory upending job just allows
hostesss really oblong Infinite Improbability thing into the starship against which behavior accordance with
Kakrafoon humanoid undergarment ship powered by GPP-guided bowl of petunias nothing was frequently away incredibly
ordinary mob.
</section>
<footer
className="modal-card-foot"
>
<div
className="field is-grouped"
>
<p
className="control"
>
<a
className="button is-info is-outlined"
onClick={[Function]}
>
Cancel
</a>
</p>
<p
className="control"
>
<a
className="button is-info"
onClick={[Function]}
>
Submit
</a>
</p>
</div>
</footer>
</div>
</div>
`;
exports[`Storyshots Modal|Modal Default 1`] = `
<div
className="modal is-active"
>
<div
className="modal-background"
/>
<div
className="modal-card"
>
<header
className="modal-card-head has-background-light"
>
<p
className="modal-card-title is-marginless"
>
Hitchhiker Modal
</p>
<button
aria-label="close"
className="delete"
onClick={[Function]}
/>
</header>
<section
className="modal-card-body"
>
<p>
Mind-paralyzing change needed improbability vortex machine sorts sought same theory upending job just allows hostesss really oblong Infinite Improbability thing into the starship against which behavior accordance.with Kakrafoon humanoid undergarment ship powered by GPP-guided bowl of petunias nothing was frequently away incredibly ordinary mob.
</p>
</section>
</div>
</div>
`;
exports[`Storyshots Navigation|Secondary Default 1`] = `
<div
className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns"
@@ -34819,13 +35047,112 @@ exports[`Storyshots Navigation|Secondary Sub Navigation 1`] = `
</div>
`;
exports[`Storyshots Notification Closeable 1`] = `
<div
className="Notificationstories__Wrapper-sc-8fx7tr-0 drTbYl"
>
<div
className="notification is-warning"
>
<button
className="delete"
onClick={[Function]}
/>
Cleverness nuclear genuine static irresponsibility invited President Zaphod
Beeblebrox hyperspace ship. Another custard through computer-generated universe
shapes field strong disaster parties Russells ancestors infinite colour
imaginative generator sweep.
</div>
</div>
`;
exports[`Storyshots Notification Danger 1`] = `
<div
className="Notificationstories__Wrapper-sc-8fx7tr-0 drTbYl"
>
<div
className="notification is-danger"
>
Cleverness nuclear genuine static irresponsibility invited President Zaphod
Beeblebrox hyperspace ship. Another custard through computer-generated universe
shapes field strong disaster parties Russells ancestors infinite colour
imaginative generator sweep.
</div>
</div>
`;
exports[`Storyshots Notification Info 1`] = `
<div
className="Notificationstories__Wrapper-sc-8fx7tr-0 drTbYl"
>
<div
className="notification is-info"
>
Cleverness nuclear genuine static irresponsibility invited President Zaphod
Beeblebrox hyperspace ship. Another custard through computer-generated universe
shapes field strong disaster parties Russells ancestors infinite colour
imaginative generator sweep.
</div>
</div>
`;
exports[`Storyshots Notification Primary 1`] = `
<div
className="Notificationstories__Wrapper-sc-8fx7tr-0 drTbYl"
>
<div
className="notification is-primary"
>
Cleverness nuclear genuine static irresponsibility invited President Zaphod
Beeblebrox hyperspace ship. Another custard through computer-generated universe
shapes field strong disaster parties Russells ancestors infinite colour
imaginative generator sweep.
</div>
</div>
`;
exports[`Storyshots Notification Success 1`] = `
<div
className="Notificationstories__Wrapper-sc-8fx7tr-0 drTbYl"
>
<div
className="notification is-success"
>
Cleverness nuclear genuine static irresponsibility invited President Zaphod
Beeblebrox hyperspace ship. Another custard through computer-generated universe
shapes field strong disaster parties Russells ancestors infinite colour
imaginative generator sweep.
</div>
</div>
`;
exports[`Storyshots Notification Warning 1`] = `
<div
className="Notificationstories__Wrapper-sc-8fx7tr-0 drTbYl"
>
<div
className="notification is-warning"
>
Cleverness nuclear genuine static irresponsibility invited President Zaphod
Beeblebrox hyperspace ship. Another custard through computer-generated universe
shapes field strong disaster parties Russells ancestors infinite colour
imaginative generator sweep.
</div>
</div>
`;
exports[`Storyshots RepositoryEntry Avatar EP 1`] = `
<div
className="RepositoryEntrystories__Spacing-toppdg-0 khfzcK box box-link-shadow"
>
<a
className="overlay-column"
href="/repo/hitchhiher/heartOfGold"
href="/repo/hitchhiker/heartOfGold"
onClick={[Function]}
/>
<article
@@ -34875,7 +35202,7 @@ exports[`Storyshots RepositoryEntry Avatar EP 1`] = `
>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/branches"
href="/repo/hitchhiker/heartOfGold/branches"
onClick={[Function]}
>
<i
@@ -34884,7 +35211,7 @@ exports[`Storyshots RepositoryEntry Avatar EP 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/code/changesets/"
href="/repo/hitchhiker/heartOfGold/code/changesets/"
onClick={[Function]}
>
<i
@@ -34893,7 +35220,7 @@ exports[`Storyshots RepositoryEntry Avatar EP 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/code/sources/"
href="/repo/hitchhiker/heartOfGold/code/sources/"
onClick={[Function]}
>
<i
@@ -34902,7 +35229,7 @@ exports[`Storyshots RepositoryEntry Avatar EP 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/settings/general"
href="/repo/hitchhiker/heartOfGold/settings/general"
onClick={[Function]}
>
<i
@@ -34936,7 +35263,7 @@ exports[`Storyshots RepositoryEntry Before Title EP 1`] = `
>
<a
className="overlay-column"
href="/repo/hitchhiher/heartOfGold"
href="/repo/hitchhiker/heartOfGold"
onClick={[Function]}
/>
<article
@@ -34967,7 +35294,7 @@ exports[`Storyshots RepositoryEntry Before Title EP 1`] = `
className="shorten-text is-marginless"
>
<i
className="fas fa-star"
className="far fa-star"
/>
<strong>
@@ -34989,7 +35316,7 @@ exports[`Storyshots RepositoryEntry Before Title EP 1`] = `
>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/branches"
href="/repo/hitchhiker/heartOfGold/branches"
onClick={[Function]}
>
<i
@@ -34998,7 +35325,7 @@ exports[`Storyshots RepositoryEntry Before Title EP 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/code/changesets/"
href="/repo/hitchhiker/heartOfGold/code/changesets/"
onClick={[Function]}
>
<i
@@ -35007,7 +35334,7 @@ exports[`Storyshots RepositoryEntry Before Title EP 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/code/sources/"
href="/repo/hitchhiker/heartOfGold/code/sources/"
onClick={[Function]}
>
<i
@@ -35016,7 +35343,7 @@ exports[`Storyshots RepositoryEntry Before Title EP 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/settings/general"
href="/repo/hitchhiker/heartOfGold/settings/general"
onClick={[Function]}
>
<i
@@ -35050,7 +35377,7 @@ exports[`Storyshots RepositoryEntry Default 1`] = `
>
<a
className="overlay-column"
href="/repo/hitchhiher/heartOfGold"
href="/repo/hitchhiker/heartOfGold"
onClick={[Function]}
/>
<article
@@ -35100,7 +35427,7 @@ exports[`Storyshots RepositoryEntry Default 1`] = `
>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/branches"
href="/repo/hitchhiker/heartOfGold/branches"
onClick={[Function]}
>
<i
@@ -35109,7 +35436,7 @@ exports[`Storyshots RepositoryEntry Default 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/code/changesets/"
href="/repo/hitchhiker/heartOfGold/code/changesets/"
onClick={[Function]}
>
<i
@@ -35118,7 +35445,7 @@ exports[`Storyshots RepositoryEntry Default 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/code/sources/"
href="/repo/hitchhiker/heartOfGold/code/sources/"
onClick={[Function]}
>
<i
@@ -35127,7 +35454,7 @@ exports[`Storyshots RepositoryEntry Default 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/settings/general"
href="/repo/hitchhiker/heartOfGold/settings/general"
onClick={[Function]}
>
<i
@@ -35161,7 +35488,7 @@ exports[`Storyshots RepositoryEntry Quick Link EP 1`] = `
>
<a
className="overlay-column"
href="/repo/hitchhiher/heartOfGold"
href="/repo/hitchhiker/heartOfGold"
onClick={[Function]}
/>
<article
@@ -35211,7 +35538,7 @@ exports[`Storyshots RepositoryEntry Quick Link EP 1`] = `
>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/branches"
href="/repo/hitchhiker/heartOfGold/branches"
onClick={[Function]}
>
<i
@@ -35220,7 +35547,7 @@ exports[`Storyshots RepositoryEntry Quick Link EP 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/code/changesets/"
href="/repo/hitchhiker/heartOfGold/code/changesets/"
onClick={[Function]}
>
<i
@@ -35229,7 +35556,7 @@ exports[`Storyshots RepositoryEntry Quick Link EP 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/code/sources/"
href="/repo/hitchhiker/heartOfGold/code/sources/"
onClick={[Function]}
>
<i
@@ -35245,7 +35572,7 @@ exports[`Storyshots RepositoryEntry Quick Link EP 1`] = `
</a>
<a
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item"
href="/repo/hitchhiher/heartOfGold/settings/general"
href="/repo/hitchhiker/heartOfGold/settings/general"
onClick={[Function]}
>
<i
@@ -36484,6 +36811,123 @@ exports[`Storyshots Table|Table TextColumn 1`] = `
</table>
`;
exports[`Storyshots Tag Clickable 1`] = `
<div
className="Tagstories__Wrapper-wsn8kx-0 cHkekU"
>
<span
className="tag is-light"
onClick={[Function]}
>
Click here
</span>
</div>
`;
exports[`Storyshots Tag Colors 1`] = `
<div
className="Tagstories__Wrapper-wsn8kx-0 cHkekU"
>
<div>
<div
className="Tagstories__Spacing-wsn8kx-1 hLVcdx"
>
<span
className="tag is-primary"
>
primary
</span>
</div>
<div
className="Tagstories__Spacing-wsn8kx-1 hLVcdx"
>
<span
className="tag is-link"
>
link
</span>
</div>
<div
className="Tagstories__Spacing-wsn8kx-1 hLVcdx"
>
<span
className="tag is-info"
>
info
</span>
</div>
<div
className="Tagstories__Spacing-wsn8kx-1 hLVcdx"
>
<span
className="tag is-success"
>
success
</span>
</div>
<div
className="Tagstories__Spacing-wsn8kx-1 hLVcdx"
>
<span
className="tag is-warning"
>
warning
</span>
</div>
<div
className="Tagstories__Spacing-wsn8kx-1 hLVcdx"
>
<span
className="tag is-danger"
>
danger
</span>
</div>
</div>
</div>
`;
exports[`Storyshots Tag Default 1`] = `
<div
className="Tagstories__Wrapper-wsn8kx-0 cHkekU"
>
<span
className="tag is-light"
>
Default tag
</span>
</div>
`;
exports[`Storyshots Tag With Icon 1`] = `
<div
className="Tagstories__Wrapper-wsn8kx-0 cHkekU"
>
<span
className="tag is-light"
>
<i
className="fas fa-bolt"
/>
 
System
</span>
</div>
`;
exports[`Storyshots Tag With title 1`] = `
<div
className="Tagstories__Wrapper-wsn8kx-0 cHkekU"
>
<span
className="tag is-light"
title="good job"
>
hover me
</span>
</div>
`;
exports[`Storyshots Toast Click to close 1`] = `null`;
exports[`Storyshots Toast Danger 1`] = `null`;
@@ -36513,3 +36957,84 @@ exports[`Storyshots Toast Primary 1`] = `null`;
exports[`Storyshots Toast Success 1`] = `null`;
exports[`Storyshots Toast Warning 1`] = `null`;
exports[`Storyshots Tooltip Default 1`] = `
<div
className="Tooltipstories__Wrapper-sc-1c34uq-0 cmZvab"
>
<div>
<div
className="Tooltipstories__Spacing-sc-1c34uq-1 ghDLyA"
>
<span
className="tooltip has-tooltip-right"
data-tooltip="Heart of Gold"
>
<button
className="button is-info"
onClick={[Function]}
type="button"
>
right
</button>
</span>
</div>
<div
className="Tooltipstories__Spacing-sc-1c34uq-1 ghDLyA"
>
<span
className="tooltip has-tooltip-top"
data-tooltip="Heart of Gold"
>
<button
className="button is-info"
onClick={[Function]}
type="button"
>
top
</button>
</span>
</div>
<div
className="Tooltipstories__Spacing-sc-1c34uq-1 ghDLyA"
>
<span
className="tooltip has-tooltip-left"
data-tooltip="Heart of Gold"
>
<button
className="button is-info"
onClick={[Function]}
type="button"
>
left
</button>
</span>
</div>
<div
className="Tooltipstories__Spacing-sc-1c34uq-1 ghDLyA"
>
<span
className="tooltip has-tooltip-bottom"
data-tooltip="Heart of Gold"
>
<button
className="button is-info"
onClick={[Function]}
type="button"
>
bottom
</button>
</span>
</div>
</div>
</div>
`;

View File

@@ -0,0 +1,50 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { storiesOf } from "@storybook/react";
import { MemoryRouter } from "react-router-dom";
import * as React from "react";
import ConfirmAlert from "./ConfirmAlert";
const body =
"Mind-paralyzing change needed improbability vortex machine sorts sought same theory upending job just allows\n " +
"hostesss really oblong Infinite Improbability thing into the starship against which behavior accordance with\n " +
"Kakrafoon humanoid undergarment ship powered by GPP-guided bowl of petunias nothing was frequently away incredibly\n " +
"ordinary mob.";
const buttons = [
{
className: "is-outlined",
label: "Cancel",
onClick: () => null
},
{
label: "Submit",
onClick: () => {}
}
];
storiesOf("Modal|ConfirmAlert", module)
.addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
.add("Default", () => <ConfirmAlert message={body} title={"Are you sure about that?"} buttons={buttons} />);

View File

@@ -0,0 +1,52 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { storiesOf } from "@storybook/react";
import { MemoryRouter } from "react-router-dom";
import * as React from "react";
import { useState } from "react";
import Modal from "./Modal";
const body = (
<p>
Mind-paralyzing change needed improbability vortex machine sorts sought same theory upending job just allows
hostesss really oblong Infinite Improbability thing into the starship against which behavior accordance.with
Kakrafoon humanoid undergarment ship powered by GPP-guided bowl of petunias nothing was frequently away incredibly
ordinary mob.
</p>
);
storiesOf("Modal|Modal", module)
.addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
.add("Default", () => <CloseableModal />);
const CloseableModal = () => {
const [show, setShow] = useState(true);
const toggleModal = () => {
setShow(!show);
};
return <Modal body={body} closeFunction={toggleModal} active={show} title={"Hitchhiker Modal"} />;
};

View File

@@ -60,10 +60,10 @@ const bindQuickLink = (binder: Binder, extension: ReactNode) => {
});
};
const withBinder = (binder: Binder, repository: Repository) => {
const withBinder = (binder: Binder, repo: Repository) => {
return (
<BinderContext.Provider value={binder}>
<RepositoryEntry repository={repository} baseDate={baseDate} />
<RepositoryEntry repository={repo} baseDate={baseDate} />
</BinderContext.Provider>
);
};
@@ -87,7 +87,7 @@ storiesOf("RepositoryEntry", module)
})
.add("Before Title EP", () => {
const binder = new Binder("title");
bindBeforeTitle(binder, <i className="fas fa-star" />);
bindBeforeTitle(binder, <i className="far fa-star" />);
return withBinder(binder, repository);
})
.add("Quick Link EP", () => {