@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
|
@@ -14,54 +14,124 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { storiesOf } from "@storybook/react";
|
|
17
|
+
// import { storiesOf } from "@storybook/react";
|
|
18
|
+
// import React from "react";
|
|
19
|
+
// import styled from "styled-components";
|
|
20
|
+
// import usePopover from "./usePopover";
|
|
21
|
+
// import Popover from "./Popover";
|
|
22
|
+
//
|
|
23
|
+
// const Wrapper = styled.div`
|
|
24
|
+
// width: 100%;
|
|
25
|
+
// margin: 20rem;
|
|
26
|
+
// `;
|
|
27
|
+
//
|
|
28
|
+
// storiesOf("Popover", module)
|
|
29
|
+
// .addDecorator((storyFn) => <Wrapper>{storyFn()}</Wrapper>)
|
|
30
|
+
// .add("Default", () =>
|
|
31
|
+
// React.createElement(() => {
|
|
32
|
+
// const { triggerProps, popoverProps } = usePopover();
|
|
33
|
+
//
|
|
34
|
+
// return (
|
|
35
|
+
// <div>
|
|
36
|
+
// <Popover title={<strong>Spaceship Heart of Gold</strong>} width={512} {...popoverProps}>
|
|
37
|
+
// <p>
|
|
38
|
+
// The Heart of Gold is the sleekest, most advanced, coolest spaceship in the galaxy. Its stunning good looks
|
|
39
|
+
// mirror its awesome speed and power. It is powered by the revolutionary new Infinite Improbability Drive,
|
|
40
|
+
// which lets the ship pass through every point in every universe simultaneously.
|
|
41
|
+
// </p>
|
|
42
|
+
// </Popover>
|
|
43
|
+
// <button className="button" {...triggerProps}>
|
|
44
|
+
// Trigger
|
|
45
|
+
// </button>
|
|
46
|
+
// </div>
|
|
47
|
+
// );
|
|
48
|
+
// })
|
|
49
|
+
// )
|
|
50
|
+
// .add("Link", () =>
|
|
51
|
+
// React.createElement(() => {
|
|
52
|
+
// const { triggerProps, popoverProps } = usePopover();
|
|
53
|
+
//
|
|
54
|
+
// return (
|
|
55
|
+
// <div>
|
|
56
|
+
// <Popover title={<strong>Spaceship Heart of Gold</strong>} width={512} {...popoverProps}>
|
|
57
|
+
// <p>
|
|
58
|
+
// The Heart of Gold is the sleekest, most advanced, coolest spaceship in the galaxy. Its stunning good looks
|
|
59
|
+
// mirror its awesome speed and power. It is powered by the revolutionary new Infinite Improbability Drive,
|
|
60
|
+
// which lets the ship pass through every point in every universe simultaneously.
|
|
61
|
+
// </p>
|
|
62
|
+
// </Popover>
|
|
63
|
+
// <button {...triggerProps}>Trigger</button>
|
|
64
|
+
// </div>
|
|
65
|
+
// );
|
|
66
|
+
// })
|
|
67
|
+
// );
|
|
68
|
+
|
|
18
69
|
import React from "react";
|
|
19
70
|
import styled from "styled-components";
|
|
20
|
-
import
|
|
71
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
72
|
+
|
|
21
73
|
import Popover from "./Popover";
|
|
74
|
+
import usePopover from "./usePopover";
|
|
22
75
|
|
|
23
76
|
const Wrapper = styled.div`
|
|
24
|
-
|
|
77
|
+
/* A large margin is used to ensure the popover has space to render in all directions */
|
|
25
78
|
margin: 20rem;
|
|
79
|
+
width: 100%;
|
|
26
80
|
`;
|
|
27
81
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
82
|
+
const popoverContent = (
|
|
83
|
+
<p>
|
|
84
|
+
The Heart of Gold is the sleekest, most advanced, coolest spaceship in the galaxy. Its stunning good looks mirror
|
|
85
|
+
its awesome speed and power. It is powered by the revolutionary new Infinite Improbability Drive, which lets the
|
|
86
|
+
ship pass through every point in every universe simultaneously.
|
|
87
|
+
</p>
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const meta: Meta<typeof Popover> = {
|
|
91
|
+
title: "Components/Popover",
|
|
92
|
+
component: Popover,
|
|
93
|
+
decorators: [(Story) => <Wrapper>{Story()}</Wrapper>],
|
|
94
|
+
tags: ["autodocs"],
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default meta;
|
|
98
|
+
|
|
99
|
+
type Story = StoryObj<typeof meta>;
|
|
100
|
+
|
|
101
|
+
export const Default: Story = {
|
|
102
|
+
render: (args) => {
|
|
103
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
104
|
+
const { triggerProps, popoverProps } = usePopover();
|
|
33
105
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
);
|
|
48
|
-
})
|
|
49
|
-
)
|
|
50
|
-
.add("Link", () =>
|
|
51
|
-
React.createElement(() => {
|
|
52
|
-
const { triggerProps, popoverProps } = usePopover();
|
|
106
|
+
return (
|
|
107
|
+
<div>
|
|
108
|
+
<Popover title={<strong>Spaceship Heart of Gold</strong>} width={512} {...popoverProps}>
|
|
109
|
+
{popoverContent}
|
|
110
|
+
</Popover>
|
|
111
|
+
{/* @ts-ignore */}
|
|
112
|
+
<button className="button" {...triggerProps}>
|
|
113
|
+
Trigger
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
};
|
|
53
119
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
120
|
+
export const WithLinkTrigger: Story = {
|
|
121
|
+
name: "With Link as Trigger",
|
|
122
|
+
render: () => {
|
|
123
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
124
|
+
const { triggerProps, popoverProps } = usePopover();
|
|
125
|
+
return (
|
|
126
|
+
<div>
|
|
127
|
+
<Popover title={<strong>Spaceship Heart of Gold</strong>} width={512} {...popoverProps}>
|
|
128
|
+
{popoverContent}
|
|
129
|
+
</Popover>
|
|
130
|
+
{/* @ts-ignore */}
|
|
131
|
+
<a href="#" {...triggerProps}>
|
|
132
|
+
Trigger
|
|
133
|
+
</a>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
},
|
|
137
|
+
};
|
package/src/popover/Popover.tsx
CHANGED
|
@@ -26,6 +26,7 @@ type Props = {
|
|
|
26
26
|
offsetLeft?: number;
|
|
27
27
|
show: boolean;
|
|
28
28
|
dispatch: Dispatch<Action>;
|
|
29
|
+
children?: ReactNode;
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
type ContainerProps = {
|
|
@@ -73,7 +74,7 @@ const Popover: FC<Props> = (props) => {
|
|
|
73
74
|
return <InnerPopover {...props} />;
|
|
74
75
|
};
|
|
75
76
|
|
|
76
|
-
const InnerPopover: FC<Props> = ({ title, show, width, offsetTop, offsetLeft, dispatch, children }) => {
|
|
77
|
+
const InnerPopover: FC<Props> = ({ title, show, width = 120, offsetTop, offsetLeft, dispatch, children }) => {
|
|
77
78
|
const [height, setHeight] = useState(125);
|
|
78
79
|
const ref = useRef<HTMLDivElement>(null);
|
|
79
80
|
useLayoutEffect(() => {
|
|
@@ -112,8 +113,4 @@ const InnerPopover: FC<Props> = ({ title, show, width, offsetTop, offsetLeft, di
|
|
|
112
113
|
);
|
|
113
114
|
};
|
|
114
115
|
|
|
115
|
-
Popover.defaultProps = {
|
|
116
|
-
width: 120,
|
|
117
|
-
};
|
|
118
|
-
|
|
119
116
|
export default Popover;
|