@scm-manager/ui-components 3.10.4-20250824-132529 → 4.0.0-REACT18-20250824-143504
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/package.json +45 -50
- package/src/BranchSelector.stories.tsx +60 -11
- package/src/Breadcrumb.stories.tsx +131 -57
- package/src/Breadcrumb.tsx +3 -3
- package/src/CardColumn.stories.tsx +94 -27
- package/src/CardColumnSmall.stories.tsx +102 -27
- package/src/CommaSeparatedList.tsx +2 -2
- package/src/Date.stories.tsx +64 -17
- package/src/Duration.stories.tsx +92 -45
- package/src/ErrorBoundary.tsx +38 -58
- package/src/ErrorNotification.tsx +1 -1
- package/src/Help.stories.tsx +61 -17
- package/src/Help.tsx +5 -11
- package/src/Icon.stories.tsx +93 -13
- package/src/Image.tsx +2 -3
- package/src/LinkPaginator.tsx +9 -6
- package/src/Loading.stories.tsx +26 -6
- package/src/Logo.stories.tsx +44 -13
- package/src/Notification.stories.tsx +111 -23
- package/src/OverviewPageActions.tsx +5 -5
- package/src/Paginator.test.tsx +115 -94
- package/src/PdfViewer.stories.tsx +83 -5
- package/src/PreformattedCodeBlock.stories.tsx +97 -26
- package/src/ProtectedRoute.tsx +14 -39
- package/src/SmallLoadingSpinner.stories.tsx +26 -6
- package/src/SyntaxHighlighter.stories.tsx +122 -40
- package/src/SyntaxHighlighterRenderer.tsx +7 -7
- package/src/Tag.stories.tsx +135 -18
- package/src/Tag.tsx +2 -1
- package/src/Tooltip.stories.tsx +147 -34
- package/src/__snapshots__/storyshots.test.ts.snap +21 -144
- package/src/avatar/Avatar.ts +1 -1
- package/src/avatar/AvatarImage.tsx +2 -2
- package/src/avatar/AvatarWrapper.tsx +2 -2
- package/src/buttons/Button.stories.tsx +159 -0
- package/src/buttons/Button.tsx +5 -5
- package/src/config/ConfigurationBinder.tsx +39 -39
- package/src/config/ConfigurationForm.tsx +2 -1
- package/src/config/TitledSettings.tsx +4 -1
- package/src/forms/AddKeyValueEntryToTableField.stories.tsx +60 -25
- package/src/forms/Checkbox.stories.tsx +165 -27
- package/src/forms/Checkbox.tsx +1 -0
- package/src/forms/DropDown.stories.tsx +81 -35
- package/src/forms/FileInput.stories.tsx +85 -10
- package/src/forms/InputField.stories.tsx +210 -37
- package/src/forms/InputField.tsx +1 -0
- package/src/forms/Radio.stories.tsx +181 -34
- package/src/forms/Radio.tsx +1 -0
- package/src/forms/Select.stories.tsx +266 -46
- package/src/forms/Select.tsx +1 -0
- package/src/forms/Textarea.stories.tsx +99 -53
- package/src/forms/Textarea.tsx +1 -0
- package/src/forms/index.ts +3 -1
- package/src/index.ts +5 -5
- package/src/jest-dom.d.ts +17 -0
- package/src/layout/Footer.stories.tsx +114 -22
- package/src/layout/Footer.tsx +11 -7
- package/src/layout/FooterSection.tsx +1 -0
- package/src/layout/Header.tsx +2 -1
- package/src/layout/Page.tsx +1 -3
- package/src/layout/PrimaryContentColumn.tsx +2 -2
- package/src/layout/SecondaryNavigationColumn.tsx +3 -3
- package/src/layout/SubSubtitle.tsx +2 -1
- package/src/layout/Subtitle.tsx +2 -1
- package/src/layout/Title.tsx +2 -5
- package/src/markdown/LazyMarkdownView.tsx +16 -5
- package/src/markdown/MarkdownHeadingRenderer.test.ts +9 -1
- package/src/markdown/MarkdownHeadingRenderer.tsx +3 -3
- package/src/markdown/MarkdownImageRenderer.test.ts +8 -1
- package/src/markdown/MarkdownImageRenderer.tsx +2 -1
- package/src/markdown/MarkdownLinkRenderer.test.tsx +9 -0
- package/src/markdown/MarkdownLinkRenderer.tsx +6 -4
- package/src/markdown/MarkdownView.stories.tsx +224 -72
- package/src/markdown/markdownExtensions.ts +6 -4
- package/src/modals/ActiveModalCountContextProvider.tsx +2 -2
- package/src/modals/ConfirmAlert.stories.tsx +133 -44
- package/src/modals/ConfirmAlert.tsx +5 -4
- package/src/modals/Modal.stories.tsx +461 -252
- package/src/modals/Modal.tsx +12 -11
- package/src/modals/useRegisterModal.test.tsx +5 -4
- package/src/navigation/MenuContext.tsx +2 -2
- package/src/navigation/NavLink.tsx +4 -7
- package/src/navigation/PrimaryNavigation.tsx +2 -2
- package/src/navigation/PrimaryNavigationLink.tsx +6 -5
- package/src/navigation/RoutingProps.ts +1 -3
- package/src/navigation/SecondaryNavigation.stories.tsx +157 -45
- package/src/navigation/SecondaryNavigation.tsx +17 -16
- package/src/navigation/SecondaryNavigationItem.tsx +2 -1
- package/src/navigation/SubNavigation.tsx +4 -8
- package/src/navigation/useActiveMatch.ts +20 -22
- package/src/navigation/useNavigationLock.ts +1 -0
- package/src/popover/Popover.stories.tsx +111 -41
- package/src/popover/Popover.tsx +2 -5
- package/src/repos/Diff.stories.tsx +418 -223
- package/src/repos/Diff.tsx +1 -5
- package/src/repos/DiffTypes.ts +2 -14
- package/src/repos/HunkExpandDivider.tsx +2 -2
- package/src/repos/LoadingDiff.tsx +11 -6
- package/src/repos/RepositoryEntry.stories.tsx +217 -53
- package/src/repos/RepositoryFlag.tsx +2 -1
- package/src/repos/TokenizedDiffView.tsx +4 -2
- package/src/repos/annotate/Annotate.stories.tsx +225 -111
- package/src/repos/annotate/AnnotateLine.tsx +2 -1
- package/src/repos/changesets/ChangesetAuthor.tsx +4 -4
- package/src/repos/changesets/ChangesetButtonGroup.test.tsx +9 -5
- package/src/repos/changesets/ChangesetDiff.test.ts +10 -2
- package/src/repos/changesets/Changesets.stories.tsx +388 -197
- package/src/repos/changesets/Contributor.tsx +1 -1
- package/src/repos/changesets/ContributorRow.tsx +2 -2
- package/src/repos/changesets/SignatureIcon.tsx +1 -0
- package/src/repos/changesets/SingleChangeset.tsx +0 -1
- package/src/repos/diff/DiffFileTree.tsx +37 -89
- package/src/repos/diff/styledElements.tsx +4 -3
- package/src/repos/index.ts +15 -15
- package/src/search/Hit.tsx +3 -2
- package/src/search/TextHitField.stories.tsx +131 -43
- package/src/search/TextHitField.tsx +3 -2
- package/src/search/index.ts +1 -1
- package/src/storyshots.test.ts +66 -60
- package/src/table/Table.stories.tsx +146 -48
- package/src/table/Table.tsx +7 -8
- package/src/table/TextColumn.tsx +0 -9
- package/src/toast/Toast.tsx +2 -1
- package/src/toast/ToastArea.tsx +2 -2
- package/src/toast/ToastButton.tsx +2 -1
- package/src/toast/ToastButtons.tsx +4 -2
- package/src/toast/ToastNotification.tsx +2 -1
- package/src/toast/index.stories.tsx +144 -39
- package/src/toast/index.ts +1 -1
- package/src/buttons/index.stories.tsx +0 -85
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
|
-
*
|
|
4
|
-
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
-
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
-
* Software Foundation, version 3.
|
|
7
|
-
*
|
|
8
|
-
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
-
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
-
* details.
|
|
12
|
-
*
|
|
13
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
-
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import React, { ReactElement, ReactNode, useEffect, useState } from "react";
|
|
18
|
-
import Button from "./Button";
|
|
19
|
-
import { storiesOf } from "@storybook/react";
|
|
20
|
-
import styled from "styled-components";
|
|
21
|
-
import AddButton from "./AddButton";
|
|
22
|
-
import CreateButton from "./CreateButton";
|
|
23
|
-
import DeleteButton from "./DeleteButton";
|
|
24
|
-
import DownloadButton from "./DownloadButton";
|
|
25
|
-
import EditButton from "./EditButton";
|
|
26
|
-
import SubmitButton from "./SubmitButton";
|
|
27
|
-
import { MemoryRouter } from "react-router-dom";
|
|
28
|
-
|
|
29
|
-
const colors = ["primary", "link", "info", "success", "warning", "danger", "white", "light", "dark", "black", "text"];
|
|
30
|
-
|
|
31
|
-
const Spacing = styled.div`
|
|
32
|
-
padding: 1em;
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
const SpacingDecorator = (story: () => ReactNode) => <Spacing>{story()}</Spacing>;
|
|
36
|
-
const RoutingDecorator = (story: () => ReactNode) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
|
|
37
|
-
|
|
38
|
-
storiesOf("Buttons/Button", module)
|
|
39
|
-
.addDecorator(RoutingDecorator)
|
|
40
|
-
.add("Colors", () => (
|
|
41
|
-
<div>
|
|
42
|
-
{colors.map((color) => (
|
|
43
|
-
<Spacing key={color}>
|
|
44
|
-
<Button color={color} label={color} />
|
|
45
|
-
</Spacing>
|
|
46
|
-
))}
|
|
47
|
-
</div>
|
|
48
|
-
))
|
|
49
|
-
.add("Loading", () => (
|
|
50
|
-
<Spacing>
|
|
51
|
-
<Button color={"primary"} loading={true}>
|
|
52
|
-
Loading Button
|
|
53
|
-
</Button>
|
|
54
|
-
</Spacing>
|
|
55
|
-
))
|
|
56
|
-
.add("Disabled", () => (
|
|
57
|
-
<div>
|
|
58
|
-
{colors.map((color) => (
|
|
59
|
-
<Spacing key={color}>
|
|
60
|
-
<Button color={color} label={color} disabled={true} />
|
|
61
|
-
</Spacing>
|
|
62
|
-
))}
|
|
63
|
-
</div>
|
|
64
|
-
));
|
|
65
|
-
|
|
66
|
-
const buttonStory = (name: string, storyFn: () => ReactElement) => {
|
|
67
|
-
return storiesOf("Buttons/" + name, module)
|
|
68
|
-
.addDecorator(RoutingDecorator)
|
|
69
|
-
.addDecorator(SpacingDecorator)
|
|
70
|
-
.add("Default", storyFn);
|
|
71
|
-
};
|
|
72
|
-
buttonStory("AddButton", () => <AddButton>Add</AddButton>);
|
|
73
|
-
buttonStory("CreateButton", () => <CreateButton>Create</CreateButton>);
|
|
74
|
-
buttonStory("DeleteButton", () => <DeleteButton>Delete</DeleteButton>);
|
|
75
|
-
buttonStory("DownloadButton", () => <DownloadButton displayName="Download" disabled={false} url="" />).add(
|
|
76
|
-
"Disabled",
|
|
77
|
-
() => <DownloadButton displayName="Download" disabled={true} url="" />
|
|
78
|
-
);
|
|
79
|
-
buttonStory("EditButton", () => <EditButton>Edit</EditButton>);
|
|
80
|
-
buttonStory("SubmitButton", () => <SubmitButton>Submit</SubmitButton>);
|
|
81
|
-
buttonStory("Button Ref", () => {
|
|
82
|
-
const [ref, setRef] = useState<HTMLButtonElement | HTMLAnchorElement | null>();
|
|
83
|
-
useEffect(() => ref?.focus(), [ref]);
|
|
84
|
-
return <Button ref={setRef}>Focus me!</Button>;
|
|
85
|
-
});
|