@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.
Files changed (130) hide show
  1. package/package.json +45 -50
  2. package/src/BranchSelector.stories.tsx +60 -11
  3. package/src/Breadcrumb.stories.tsx +131 -57
  4. package/src/Breadcrumb.tsx +3 -3
  5. package/src/CardColumn.stories.tsx +94 -27
  6. package/src/CardColumnSmall.stories.tsx +102 -27
  7. package/src/CommaSeparatedList.tsx +2 -2
  8. package/src/Date.stories.tsx +64 -17
  9. package/src/Duration.stories.tsx +92 -45
  10. package/src/ErrorBoundary.tsx +38 -58
  11. package/src/ErrorNotification.tsx +1 -1
  12. package/src/Help.stories.tsx +61 -17
  13. package/src/Help.tsx +5 -11
  14. package/src/Icon.stories.tsx +93 -13
  15. package/src/Image.tsx +2 -3
  16. package/src/LinkPaginator.tsx +9 -6
  17. package/src/Loading.stories.tsx +26 -6
  18. package/src/Logo.stories.tsx +44 -13
  19. package/src/Notification.stories.tsx +111 -23
  20. package/src/OverviewPageActions.tsx +5 -5
  21. package/src/Paginator.test.tsx +115 -94
  22. package/src/PdfViewer.stories.tsx +83 -5
  23. package/src/PreformattedCodeBlock.stories.tsx +97 -26
  24. package/src/ProtectedRoute.tsx +14 -39
  25. package/src/SmallLoadingSpinner.stories.tsx +26 -6
  26. package/src/SyntaxHighlighter.stories.tsx +122 -40
  27. package/src/SyntaxHighlighterRenderer.tsx +7 -7
  28. package/src/Tag.stories.tsx +135 -18
  29. package/src/Tag.tsx +2 -1
  30. package/src/Tooltip.stories.tsx +147 -34
  31. package/src/__snapshots__/storyshots.test.ts.snap +21 -144
  32. package/src/avatar/Avatar.ts +1 -1
  33. package/src/avatar/AvatarImage.tsx +2 -2
  34. package/src/avatar/AvatarWrapper.tsx +2 -2
  35. package/src/buttons/Button.stories.tsx +159 -0
  36. package/src/buttons/Button.tsx +5 -5
  37. package/src/config/ConfigurationBinder.tsx +39 -39
  38. package/src/config/ConfigurationForm.tsx +2 -1
  39. package/src/config/TitledSettings.tsx +4 -1
  40. package/src/forms/AddKeyValueEntryToTableField.stories.tsx +60 -25
  41. package/src/forms/Checkbox.stories.tsx +165 -27
  42. package/src/forms/Checkbox.tsx +1 -0
  43. package/src/forms/DropDown.stories.tsx +81 -35
  44. package/src/forms/FileInput.stories.tsx +85 -10
  45. package/src/forms/InputField.stories.tsx +210 -37
  46. package/src/forms/InputField.tsx +1 -0
  47. package/src/forms/Radio.stories.tsx +181 -34
  48. package/src/forms/Radio.tsx +1 -0
  49. package/src/forms/Select.stories.tsx +266 -46
  50. package/src/forms/Select.tsx +1 -0
  51. package/src/forms/Textarea.stories.tsx +99 -53
  52. package/src/forms/Textarea.tsx +1 -0
  53. package/src/forms/index.ts +3 -1
  54. package/src/index.ts +5 -5
  55. package/src/jest-dom.d.ts +17 -0
  56. package/src/layout/Footer.stories.tsx +114 -22
  57. package/src/layout/Footer.tsx +11 -7
  58. package/src/layout/FooterSection.tsx +1 -0
  59. package/src/layout/Header.tsx +2 -1
  60. package/src/layout/Page.tsx +1 -3
  61. package/src/layout/PrimaryContentColumn.tsx +2 -2
  62. package/src/layout/SecondaryNavigationColumn.tsx +3 -3
  63. package/src/layout/SubSubtitle.tsx +2 -1
  64. package/src/layout/Subtitle.tsx +2 -1
  65. package/src/layout/Title.tsx +2 -5
  66. package/src/markdown/LazyMarkdownView.tsx +16 -5
  67. package/src/markdown/MarkdownHeadingRenderer.test.ts +9 -1
  68. package/src/markdown/MarkdownHeadingRenderer.tsx +3 -3
  69. package/src/markdown/MarkdownImageRenderer.test.ts +8 -1
  70. package/src/markdown/MarkdownImageRenderer.tsx +2 -1
  71. package/src/markdown/MarkdownLinkRenderer.test.tsx +9 -0
  72. package/src/markdown/MarkdownLinkRenderer.tsx +6 -4
  73. package/src/markdown/MarkdownView.stories.tsx +224 -72
  74. package/src/markdown/markdownExtensions.ts +6 -4
  75. package/src/modals/ActiveModalCountContextProvider.tsx +2 -2
  76. package/src/modals/ConfirmAlert.stories.tsx +133 -44
  77. package/src/modals/ConfirmAlert.tsx +5 -4
  78. package/src/modals/Modal.stories.tsx +461 -252
  79. package/src/modals/Modal.tsx +12 -11
  80. package/src/modals/useRegisterModal.test.tsx +5 -4
  81. package/src/navigation/MenuContext.tsx +2 -2
  82. package/src/navigation/NavLink.tsx +4 -7
  83. package/src/navigation/PrimaryNavigation.tsx +2 -2
  84. package/src/navigation/PrimaryNavigationLink.tsx +6 -5
  85. package/src/navigation/RoutingProps.ts +1 -3
  86. package/src/navigation/SecondaryNavigation.stories.tsx +157 -45
  87. package/src/navigation/SecondaryNavigation.tsx +17 -16
  88. package/src/navigation/SecondaryNavigationItem.tsx +2 -1
  89. package/src/navigation/SubNavigation.tsx +4 -8
  90. package/src/navigation/useActiveMatch.ts +20 -22
  91. package/src/navigation/useNavigationLock.ts +1 -0
  92. package/src/popover/Popover.stories.tsx +111 -41
  93. package/src/popover/Popover.tsx +2 -5
  94. package/src/repos/Diff.stories.tsx +418 -223
  95. package/src/repos/Diff.tsx +1 -5
  96. package/src/repos/DiffTypes.ts +2 -14
  97. package/src/repos/HunkExpandDivider.tsx +2 -2
  98. package/src/repos/LoadingDiff.tsx +11 -6
  99. package/src/repos/RepositoryEntry.stories.tsx +217 -53
  100. package/src/repos/RepositoryFlag.tsx +2 -1
  101. package/src/repos/TokenizedDiffView.tsx +4 -2
  102. package/src/repos/annotate/Annotate.stories.tsx +225 -111
  103. package/src/repos/annotate/AnnotateLine.tsx +2 -1
  104. package/src/repos/changesets/ChangesetAuthor.tsx +4 -4
  105. package/src/repos/changesets/ChangesetButtonGroup.test.tsx +9 -5
  106. package/src/repos/changesets/ChangesetDiff.test.ts +10 -2
  107. package/src/repos/changesets/Changesets.stories.tsx +388 -197
  108. package/src/repos/changesets/Contributor.tsx +1 -1
  109. package/src/repos/changesets/ContributorRow.tsx +2 -2
  110. package/src/repos/changesets/SignatureIcon.tsx +1 -0
  111. package/src/repos/changesets/SingleChangeset.tsx +0 -1
  112. package/src/repos/diff/DiffFileTree.tsx +37 -89
  113. package/src/repos/diff/styledElements.tsx +4 -3
  114. package/src/repos/index.ts +15 -15
  115. package/src/search/Hit.tsx +3 -2
  116. package/src/search/TextHitField.stories.tsx +131 -43
  117. package/src/search/TextHitField.tsx +3 -2
  118. package/src/search/index.ts +1 -1
  119. package/src/storyshots.test.ts +66 -60
  120. package/src/table/Table.stories.tsx +146 -48
  121. package/src/table/Table.tsx +7 -8
  122. package/src/table/TextColumn.tsx +0 -9
  123. package/src/toast/Toast.tsx +2 -1
  124. package/src/toast/ToastArea.tsx +2 -2
  125. package/src/toast/ToastButton.tsx +2 -1
  126. package/src/toast/ToastButtons.tsx +4 -2
  127. package/src/toast/ToastNotification.tsx +2 -1
  128. package/src/toast/index.stories.tsx +144 -39
  129. package/src/toast/index.ts +1 -1
  130. 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
- });