@scm-manager/ui-core 4.0.0-REACT19-20250825-073633 → 4.0.0-REACT19-20250910-124634
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/.turbo/turbo-test.log +174 -0
- package/.turbo/turbo-typecheck.log +1 -1
- package/package.json +4 -4
- package/src/base/buttons/Button.tsx +74 -60
- package/src/base/buttons/Icon.tsx +4 -3
- package/src/base/forms/ConfigurationForm.tsx +7 -7
- package/src/base/forms/FormRow.tsx +9 -9
- package/src/base/forms/base/Control.tsx +7 -3
- package/src/base/forms/base/ExpandableText.tsx +11 -12
- package/src/base/forms/checkbox/Checkbox.tsx +63 -65
- package/src/base/forms/checkbox/CheckboxField.tsx +4 -4
- package/src/base/forms/chip-input/ChipInputField.tsx +28 -30
- package/src/base/forms/chip-input/ControlledChipInputField.tsx +20 -22
- package/src/base/forms/combobox/Combobox.tsx +3 -13
- package/src/base/forms/combobox/ComboboxField.tsx +11 -14
- package/src/base/forms/headless-chip-input/ChipInput.tsx +49 -46
- package/src/base/forms/helpers.ts +3 -7
- package/src/base/forms/input/Input.tsx +4 -3
- package/src/base/forms/input/InputField.tsx +55 -43
- package/src/base/forms/input/Textarea.tsx +4 -3
- package/src/base/forms/radio-button/RadioButton.tsx +37 -27
- package/src/base/forms/radio-button/RadioGroup.tsx +4 -3
- package/src/base/forms/radio-button/RadioGroupField.tsx +15 -16
- package/src/base/forms/select/Select.tsx +15 -16
- package/src/base/forms/select/SelectField.tsx +19 -19
- package/src/base/layout/_helpers/with-classes.tsx +15 -12
- package/src/base/layout/card/Card.tsx +28 -21
- package/src/base/layout/card/CardDetail.tsx +65 -76
- package/src/base/layout/card/CardRow.tsx +9 -9
- package/src/base/layout/card/CardTitle.tsx +5 -5
- package/src/base/layout/card-list/CardList.tsx +9 -9
- package/src/base/layout/collapsible/Collapsible.tsx +42 -35
- package/src/base/layout/tabs/TabTrigger.tsx +5 -4
- package/src/base/layout/tabs/Tabs.tsx +4 -4
- package/src/base/layout/tabs/TabsList.tsx +5 -3
- package/src/base/layout/templates/data-page/DataPageHeader.tsx +10 -11
- package/src/base/misc/Image.tsx +5 -5
- package/src/base/misc/Level.tsx +4 -3
- package/src/base/misc/Loading.tsx +25 -25
- package/src/base/misc/SubSubtitle.tsx +9 -9
- package/src/base/misc/Subtitle.tsx +10 -10
- package/src/base/misc/Title.tsx +22 -14
- package/src/base/notifications/Notification.tsx +12 -13
- package/src/base/overlays/dialog/Dialog.tsx +39 -40
- package/src/base/overlays/menu/Menu.tsx +49 -52
- package/src/base/overlays/menu/MenuTrigger.tsx +6 -6
- package/src/base/overlays/popover/Popover.tsx +4 -6
- package/src/base/overlays/tooltip/ExpandableHint.tsx +7 -8
- package/src/base/overlays/tooltip/Tooltip.tsx +5 -3
- package/src/base/status/StatusIcon.tsx +46 -39
- package/src/index.ts +1 -0
- package/src/routing/admin.ts +38 -0
- package/src/routing/group.ts +22 -0
- package/src/routing/help.ts +21 -0
- package/src/routing/import.ts +17 -0
- package/src/routing/index.ts +24 -0
- package/src/routing/me.ts +26 -0
- package/src/routing/namespace.ts +39 -0
- package/src/routing/repository.ts +91 -0
- package/src/routing/user.ts +22 -0
|
@@ -14,13 +14,7 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, {
|
|
18
|
-
ButtonHTMLAttributes,
|
|
19
|
-
ComponentProps,
|
|
20
|
-
ComponentPropsWithoutRef,
|
|
21
|
-
HTMLAttributes,
|
|
22
|
-
ReactNode,
|
|
23
|
-
} from "react";
|
|
17
|
+
import React, { ButtonHTMLAttributes, ComponentProps, FC, HTMLAttributes, ReactNode, Ref } from "react";
|
|
24
18
|
import classNames from "classnames";
|
|
25
19
|
import { useAriaId } from "../../helpers";
|
|
26
20
|
import styled from "styled-components";
|
|
@@ -35,7 +29,7 @@ export const CardVariants = {
|
|
|
35
29
|
WARNING: "warning",
|
|
36
30
|
} as const;
|
|
37
31
|
|
|
38
|
-
export type CardVariant = typeof CardVariants[keyof typeof CardVariants];
|
|
32
|
+
export type CardVariant = (typeof CardVariants)[keyof typeof CardVariants];
|
|
39
33
|
|
|
40
34
|
const createCardVariantClasses = (variant?: string | undefined) =>
|
|
41
35
|
classNames({
|
|
@@ -48,6 +42,7 @@ const createCardVariantClasses = (variant?: string | undefined) =>
|
|
|
48
42
|
|
|
49
43
|
type CardDetailProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
50
44
|
children: ReactNode | ((props: { labelId: string }) => ReactNode);
|
|
45
|
+
ref?: Ref<HTMLSpanElement>;
|
|
51
46
|
};
|
|
52
47
|
|
|
53
48
|
type CardVariantProps = {
|
|
@@ -58,16 +53,14 @@ type CardVariantProps = {
|
|
|
58
53
|
* @beta
|
|
59
54
|
* @since 2.46.0
|
|
60
55
|
*/
|
|
61
|
-
export const CardDetail =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
);
|
|
56
|
+
export const CardDetail: FC<CardDetailProps> = ({ children, className, ref, ...props }) => {
|
|
57
|
+
const labelId = useAriaId();
|
|
58
|
+
return (
|
|
59
|
+
<span {...props} className={classNames("is-flex is-align-items-center has-gap-1 p-1", className)} ref={ref}>
|
|
60
|
+
{typeof children === "function" ? children({ labelId }) : children}
|
|
61
|
+
</span>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
71
64
|
|
|
72
65
|
const InteractiveDetailStyles = `
|
|
73
66
|
&:focus {
|
|
@@ -84,23 +77,23 @@ const StyledCardButtonDetail = styled.button`
|
|
|
84
77
|
}
|
|
85
78
|
`;
|
|
86
79
|
|
|
80
|
+
type CardButtonDetailProps = ButtonHTMLAttributes<HTMLButtonElement> & { ref?: Ref<HTMLButtonElement> };
|
|
81
|
+
|
|
87
82
|
/**
|
|
88
83
|
* @beta
|
|
89
84
|
* @since 2.47.0
|
|
90
85
|
*/
|
|
91
|
-
export const CardButtonDetail =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
</StyledCardButtonDetail>
|
|
103
|
-
)
|
|
86
|
+
export const CardButtonDetail: FC<CardButtonDetailProps> = ({ children, className, ref, ...props }) => (
|
|
87
|
+
<StyledCardButtonDetail
|
|
88
|
+
{...props}
|
|
89
|
+
className={classNames(
|
|
90
|
+
"is-flex is-align-items-center has-gap-1 p-1 is-borderless has-background-transparent is-relative has-hover-background-blue has-rounded-border is-clickable",
|
|
91
|
+
className,
|
|
92
|
+
)}
|
|
93
|
+
ref={ref}
|
|
94
|
+
>
|
|
95
|
+
{children}
|
|
96
|
+
</StyledCardButtonDetail>
|
|
104
97
|
);
|
|
105
98
|
|
|
106
99
|
const StyledCardLinkDetail = styled(Link)`
|
|
@@ -113,59 +106,55 @@ const StyledCardLinkDetail = styled(Link)`
|
|
|
113
106
|
* @beta
|
|
114
107
|
* @since 2.47.0
|
|
115
108
|
*/
|
|
116
|
-
export const CardLinkDetail
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
</StyledCardLinkDetail>
|
|
128
|
-
)
|
|
109
|
+
export const CardLinkDetail: FC<ComponentProps<typeof Link>> = ({ children, className, ref, ...props }) => (
|
|
110
|
+
<StyledCardLinkDetail
|
|
111
|
+
{...props}
|
|
112
|
+
className={classNames(
|
|
113
|
+
"is-flex is-align-items-center has-gap-1 p-1 is-borderless has-background-transparent is-relative has-hover-background-blue has-rounded-border is-clickable",
|
|
114
|
+
className,
|
|
115
|
+
)}
|
|
116
|
+
ref={ref}
|
|
117
|
+
>
|
|
118
|
+
{children}
|
|
119
|
+
</StyledCardLinkDetail>
|
|
129
120
|
);
|
|
130
121
|
|
|
122
|
+
type CardDetailsLabelProps = HTMLAttributes<HTMLSpanElement> & { ref?: Ref<HTMLSpanElement> };
|
|
123
|
+
|
|
131
124
|
/**
|
|
132
125
|
* @beta
|
|
133
126
|
* @since 2.46.0
|
|
134
127
|
*/
|
|
135
|
-
export const CardDetailLabel =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</span>
|
|
140
|
-
)
|
|
128
|
+
export const CardDetailLabel: FC<CardDetailsLabelProps> = ({ children, className, ref, ...props }) => (
|
|
129
|
+
<span {...props} className={classNames("has-text-secondary is-size-7", className)} ref={ref}>
|
|
130
|
+
{children}
|
|
131
|
+
</span>
|
|
141
132
|
);
|
|
142
133
|
|
|
134
|
+
type CardDetailTagProps = HTMLAttributes<HTMLSpanElement> & CardVariantProps & { ref?: Ref<HTMLSpanElement> };
|
|
135
|
+
|
|
143
136
|
/**
|
|
144
137
|
* @beta
|
|
145
138
|
* @since 2.46.0
|
|
146
139
|
*/
|
|
147
|
-
export const CardDetailTag =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
</span>
|
|
156
|
-
)
|
|
140
|
+
export const CardDetailTag: FC<CardDetailTagProps> = ({ children, className, ref, ...props }) => (
|
|
141
|
+
<span
|
|
142
|
+
{...props}
|
|
143
|
+
className={classNames("tag is-rounded", createCardVariantClasses(props.cardVariant), className)}
|
|
144
|
+
ref={ref}
|
|
145
|
+
>
|
|
146
|
+
{children}
|
|
147
|
+
</span>
|
|
157
148
|
);
|
|
158
149
|
|
|
159
150
|
/**
|
|
160
151
|
* @beta
|
|
161
152
|
* @since 2.47.0
|
|
162
153
|
*/
|
|
163
|
-
export const CardDetailIcon
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
</Icon>
|
|
168
|
-
)
|
|
154
|
+
export const CardDetailIcon: FC<ComponentProps<typeof Icon>> = ({ children, className, ref, ...props }) => (
|
|
155
|
+
<Icon {...props} className={classNames("is-size-5", className)} ref={ref}>
|
|
156
|
+
{children}
|
|
157
|
+
</Icon>
|
|
169
158
|
);
|
|
170
159
|
|
|
171
160
|
const CardDetailsRowContainer = styled.div`
|
|
@@ -176,18 +165,18 @@ const CardDetailsRowContainer = styled.div`
|
|
|
176
165
|
}
|
|
177
166
|
`;
|
|
178
167
|
|
|
168
|
+
type CardDetailsProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> };
|
|
169
|
+
|
|
179
170
|
/**
|
|
180
171
|
* @beta
|
|
181
172
|
* @since 2.46.0
|
|
182
173
|
*/
|
|
183
|
-
export const CardDetails =
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
</CardDetailsRowContainer>
|
|
192
|
-
)
|
|
174
|
+
export const CardDetails: FC<CardDetailsProps> = ({ children, className, ref, ...props }) => (
|
|
175
|
+
<CardDetailsRowContainer
|
|
176
|
+
{...props}
|
|
177
|
+
className={classNames("is-flex is-flex-wrap-wrap is-align-items-center", className)}
|
|
178
|
+
ref={ref}
|
|
179
|
+
>
|
|
180
|
+
{children}
|
|
181
|
+
</CardDetailsRowContainer>
|
|
193
182
|
);
|
|
@@ -14,25 +14,25 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { ComponentProps, HTMLAttributes } from "react";
|
|
17
|
+
import React, { ComponentProps, FC, HTMLAttributes, Ref } from "react";
|
|
18
18
|
import classNames from "classnames";
|
|
19
19
|
|
|
20
|
+
type CardRowProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> };
|
|
21
|
+
|
|
20
22
|
/**
|
|
21
23
|
* @beta
|
|
22
24
|
* @since 2.44.0
|
|
23
25
|
*/
|
|
24
|
-
const CardRow =
|
|
26
|
+
const CardRow: FC<CardRowProps> = ({ className, ref, ...props }) => (
|
|
25
27
|
<div className={classNames(className, "ml-1")} {...props} ref={ref} />
|
|
26
|
-
)
|
|
28
|
+
);
|
|
27
29
|
|
|
28
30
|
export default CardRow;
|
|
29
31
|
|
|
30
|
-
export const SecondaryRow
|
|
31
|
-
|
|
32
|
+
export const SecondaryRow: FC<ComponentProps<typeof CardRow>> = ({ className, ref, ...props }) => (
|
|
33
|
+
<CardRow className={classNames(className, "is-size-7")} {...props} ref={ref} />
|
|
32
34
|
);
|
|
33
35
|
|
|
34
|
-
export const TertiaryRow
|
|
35
|
-
|
|
36
|
-
<CardRow className={classNames(className, "is-size-7", "has-text-secondary")} {...props} ref={ref} />
|
|
37
|
-
)
|
|
36
|
+
export const TertiaryRow: FC<ComponentProps<typeof CardRow>> = ({ className, ref, ...props }) => (
|
|
37
|
+
<CardRow className={classNames(className, "is-size-7", "has-text-secondary")} {...props} ref={ref} />
|
|
38
38
|
);
|
|
@@ -14,13 +14,14 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { HTMLAttributes } from "react";
|
|
17
|
+
import React, { FC, HTMLAttributes, Ref } from "react";
|
|
18
18
|
|
|
19
19
|
type Props = HTMLAttributes<HTMLHeadingElement> & {
|
|
20
20
|
/**
|
|
21
21
|
* @default 3
|
|
22
22
|
*/
|
|
23
23
|
level?: number;
|
|
24
|
+
ref?: Ref<HTMLHeadingElement>;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
/**
|
|
@@ -37,15 +38,14 @@ type Props = HTMLAttributes<HTMLHeadingElement> & {
|
|
|
37
38
|
* @beta
|
|
38
39
|
* @since 2.44.0
|
|
39
40
|
*/
|
|
40
|
-
const CardTitle
|
|
41
|
+
const CardTitle: FC<Props> = ({ children, level = 3, ref, ...props }) =>
|
|
41
42
|
React.createElement(
|
|
42
43
|
`h${level}`,
|
|
43
44
|
{
|
|
44
45
|
ref,
|
|
45
46
|
...props,
|
|
46
47
|
},
|
|
47
|
-
children
|
|
48
|
-
)
|
|
49
|
-
);
|
|
48
|
+
children,
|
|
49
|
+
);
|
|
50
50
|
|
|
51
51
|
export default CardTitle;
|
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { ComponentProps, HTMLAttributes } from "react";
|
|
17
|
+
import React, { ComponentProps, FC, HTMLAttributes, Ref } from "react";
|
|
18
18
|
import classNames from "classnames";
|
|
19
19
|
import styled from "styled-components";
|
|
20
20
|
import Card from "../card/Card";
|
|
21
21
|
|
|
22
|
+
type CardListCardProps = Omit<ComponentProps<typeof Card>, "as">;
|
|
23
|
+
|
|
22
24
|
/**
|
|
23
25
|
* @beta
|
|
24
26
|
* @since 2.44.0
|
|
25
27
|
* @see Card
|
|
26
28
|
*/
|
|
27
|
-
export const CardListCard =
|
|
28
|
-
<Card ref={ref} {...props} as="li" />
|
|
29
|
-
));
|
|
29
|
+
export const CardListCard: FC<CardListCardProps> = ({ ref, ...props }) => <Card ref={ref} {...props} as="li" />;
|
|
30
30
|
|
|
31
31
|
const CardListElement = styled.ul`
|
|
32
32
|
> * + * {
|
|
@@ -43,26 +43,26 @@ const CardListElement = styled.ul`
|
|
|
43
43
|
}
|
|
44
44
|
`;
|
|
45
45
|
|
|
46
|
-
type Props = HTMLAttributes<HTMLUListElement
|
|
46
|
+
type Props = HTMLAttributes<HTMLUListElement> & { ref?: Ref<HTMLUListElement> };
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* @beta
|
|
50
50
|
* @since 2.44.0
|
|
51
51
|
*/
|
|
52
|
-
const CardList
|
|
52
|
+
const CardList: FC<Props> = ({ children, className, ref, ...props }) => (
|
|
53
53
|
<CardListElement ref={ref} {...props} className={classNames(className, "is-flex", "is-flex-direction-column")}>
|
|
54
54
|
{children}
|
|
55
55
|
</CardListElement>
|
|
56
|
-
)
|
|
56
|
+
);
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* @beta
|
|
60
60
|
* @since 2.44.0
|
|
61
61
|
*/
|
|
62
|
-
export const CardListBox
|
|
62
|
+
export const CardListBox: FC<Props> = ({ className, children, ref, ...props }) => (
|
|
63
63
|
<CardList className={classNames(className, "p-2 box")} ref={ref} {...props}>
|
|
64
64
|
{children}
|
|
65
65
|
</CardList>
|
|
66
|
-
)
|
|
66
|
+
);
|
|
67
67
|
|
|
68
68
|
export default CardList;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { ComponentProps, ReactNode, useEffect, useState } from "react";
|
|
17
|
+
import React, { ComponentProps, FC, ReactNode, Ref, useEffect, useState } from "react";
|
|
18
18
|
import * as RadixCollapsible from "@radix-ui/react-collapsible";
|
|
19
19
|
import { Icon } from "../../buttons";
|
|
20
20
|
import styled from "styled-components";
|
|
@@ -34,46 +34,53 @@ type Props = {
|
|
|
34
34
|
defaultCollapsed?: boolean;
|
|
35
35
|
collapsed?: boolean;
|
|
36
36
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
37
|
+
ref?: Ref<HTMLButtonElement>;
|
|
37
38
|
} & Pick<ComponentProps<typeof RadixCollapsible.Root>, "className" | "children">;
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* @beta
|
|
41
42
|
* @since 2.46.0
|
|
42
43
|
*/
|
|
43
|
-
const Collapsible
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
const Collapsible: FC<Props> = ({
|
|
45
|
+
children,
|
|
46
|
+
header,
|
|
47
|
+
className,
|
|
48
|
+
defaultCollapsed,
|
|
49
|
+
collapsed,
|
|
50
|
+
onCollapsedChange,
|
|
51
|
+
ref,
|
|
52
|
+
}) => {
|
|
53
|
+
const [isCollapsed, setCollapsed] = useState(defaultCollapsed);
|
|
54
|
+
const titleId = useAriaId();
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (collapsed !== undefined) {
|
|
57
|
+
setCollapsed(collapsed);
|
|
58
|
+
}
|
|
59
|
+
}, [collapsed]);
|
|
52
60
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
);
|
|
61
|
+
return (
|
|
62
|
+
<RadixCollapsible.Root
|
|
63
|
+
className={classNames("card", className)}
|
|
64
|
+
open={!isCollapsed}
|
|
65
|
+
onOpenChange={(o) => {
|
|
66
|
+
setCollapsed(!o);
|
|
67
|
+
if (onCollapsedChange) {
|
|
68
|
+
onCollapsedChange(!o);
|
|
69
|
+
}
|
|
70
|
+
}}
|
|
71
|
+
defaultOpen={!defaultCollapsed}
|
|
72
|
+
>
|
|
73
|
+
<StyledCollapsibleHeader className="card-header is-flex is-justify-content-space-between is-shadowless">
|
|
74
|
+
<span id={titleId} className="card-header-title">
|
|
75
|
+
{header}
|
|
76
|
+
</span>
|
|
77
|
+
<StyledTrigger aria-labelledby={titleId} className="card-header-icon" ref={ref}>
|
|
78
|
+
<Icon>{isCollapsed ? "angle-left" : "angle-down"}</Icon>
|
|
79
|
+
</StyledTrigger>
|
|
80
|
+
</StyledCollapsibleHeader>
|
|
81
|
+
<RadixCollapsible.Content className="card-content p-2">{children}</RadixCollapsible.Content>
|
|
82
|
+
</RadixCollapsible.Root>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
78
85
|
|
|
79
86
|
export default Collapsible;
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { ComponentProps } from "react";
|
|
17
|
+
import React, { ComponentProps, FC, Ref } from "react";
|
|
18
18
|
import classNames from "classnames";
|
|
19
19
|
import * as HeadlessTabs from "@radix-ui/react-tabs";
|
|
20
20
|
|
|
21
|
-
type Props = ComponentProps<typeof HeadlessTabs.Trigger
|
|
21
|
+
type Props = ComponentProps<typeof HeadlessTabs.Trigger> & { ref?: Ref<HTMLButtonElement> };
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* @beta
|
|
25
25
|
* @since 2.47.0
|
|
26
26
|
*/
|
|
27
|
-
const TabTrigger
|
|
27
|
+
const TabTrigger: FC<Props> = ({ children, className, ref, ...props }) => (
|
|
28
28
|
<li>
|
|
29
29
|
<HeadlessTabs.Trigger
|
|
30
30
|
className={classNames("has-background-transparent is-borderless", className)}
|
|
@@ -34,5 +34,6 @@ const TabTrigger = React.forwardRef<HTMLButtonElement, Props>(({ children, class
|
|
|
34
34
|
{children}
|
|
35
35
|
</HeadlessTabs.Trigger>
|
|
36
36
|
</li>
|
|
37
|
-
)
|
|
37
|
+
);
|
|
38
|
+
|
|
38
39
|
export default TabTrigger;
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { ComponentProps, useCallback, useState } from "react";
|
|
17
|
+
import React, { ComponentProps, FC, Ref, useCallback, useState } from "react";
|
|
18
18
|
import * as HeadlessTabs from "@radix-ui/react-tabs";
|
|
19
19
|
|
|
20
|
-
type Props = Omit<ComponentProps<typeof HeadlessTabs.Root>, "value"
|
|
20
|
+
type Props = Omit<ComponentProps<typeof HeadlessTabs.Root>, "value"> & { ref?: Ref<HTMLDivElement> };
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @beta
|
|
24
24
|
* @since 2.47.0
|
|
25
25
|
*/
|
|
26
|
-
const Tabs
|
|
26
|
+
const Tabs: FC<Props> = ({ defaultValue, onValueChange, children, ref, ...props }) => {
|
|
27
27
|
const [value, setValue] = useState(defaultValue);
|
|
28
28
|
const handleValueChange = useCallback(
|
|
29
29
|
(newValue: string) => {
|
|
@@ -39,6 +39,6 @@ const Tabs = React.forwardRef<HTMLDivElement, Props>(({ defaultValue, onValueCha
|
|
|
39
39
|
{children}
|
|
40
40
|
</HeadlessTabs.Root>
|
|
41
41
|
);
|
|
42
|
-
}
|
|
42
|
+
};
|
|
43
43
|
|
|
44
44
|
export default Tabs;
|
|
@@ -14,20 +14,22 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { HTMLAttributes } from "react";
|
|
17
|
+
import React, { FC, HTMLAttributes, Ref } from "react";
|
|
18
18
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
19
19
|
import classNames from "classnames";
|
|
20
20
|
|
|
21
|
+
type Props = HTMLAttributes<HTMLUListElement> & { ref?: Ref<HTMLUListElement> };
|
|
22
|
+
|
|
21
23
|
/**
|
|
22
24
|
* @beta
|
|
23
25
|
* @since 2.47.0
|
|
24
26
|
*/
|
|
25
|
-
const TabsList =
|
|
27
|
+
const TabsList: FC<Props> = ({ children, ref, ...props }) => (
|
|
26
28
|
<RadixTabs.List className={classNames("tabs", /* required for focus-outline */ "p-1")}>
|
|
27
29
|
<ul {...props} ref={ref}>
|
|
28
30
|
{children}
|
|
29
31
|
</ul>
|
|
30
32
|
</RadixTabs.List>
|
|
31
|
-
)
|
|
33
|
+
);
|
|
32
34
|
|
|
33
35
|
export default TabsList;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import withClasses from "../../_helpers/with-classes";
|
|
18
|
-
import React, { HTMLAttributes } from "react";
|
|
18
|
+
import React, { FC, HTMLAttributes, Ref } from "react";
|
|
19
19
|
import classNames from "classnames";
|
|
20
20
|
import { useAriaId } from "../../../helpers";
|
|
21
21
|
import { LinkButton } from "../../../buttons";
|
|
@@ -50,22 +50,21 @@ export const DataPageHeaderSettings = withClasses("div", [
|
|
|
50
50
|
|
|
51
51
|
type DataPageHeaderSettingProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
52
52
|
children?: React.ReactNode | ((props: { formFieldId: string }) => React.ReactNode);
|
|
53
|
+
ref?: Ref<HTMLSpanElement>;
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
/**
|
|
56
57
|
* @beta
|
|
57
58
|
* @since 2.47.0
|
|
58
59
|
*/
|
|
59
|
-
export const DataPageHeaderSetting =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
);
|
|
60
|
+
export const DataPageHeaderSetting: FC<DataPageHeaderSettingProps> = ({ className, children, ref, ...props }) => {
|
|
61
|
+
const formFieldId = useAriaId();
|
|
62
|
+
return (
|
|
63
|
+
<span {...props} className={classNames(className, "is-flex", "is-align-items-center", "has-gap-2")} ref={ref}>
|
|
64
|
+
{typeof children === "function" ? children({ formFieldId }) : children}
|
|
65
|
+
</span>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
69
68
|
|
|
70
69
|
/**
|
|
71
70
|
* @beta
|
package/src/base/misc/Image.tsx
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { ImgHTMLAttributes } from "react";
|
|
17
|
+
import React, { FC, ImgHTMLAttributes, Ref } from "react";
|
|
18
18
|
import { urls } from "@scm-manager/ui-api";
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
)
|
|
20
|
+
type Props = ImgHTMLAttributes<HTMLImageElement> & { src: string; ref?: Ref<HTMLImageElement> };
|
|
21
|
+
|
|
22
|
+
const Image: FC<Props> = ({ src, alt, ref, ...props }) => (
|
|
23
|
+
<img src={src?.startsWith("http") ? src : urls.withContextPath(src)} {...props} ref={ref} alt={alt} />
|
|
24
24
|
);
|
|
25
25
|
export default Image;
|
package/src/base/misc/Level.tsx
CHANGED
|
@@ -14,20 +14,21 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { HTMLAttributes, ReactNode } from "react";
|
|
17
|
+
import React, { FC, HTMLAttributes, ReactNode, Ref } from "react";
|
|
18
18
|
import classNames from "classnames";
|
|
19
19
|
|
|
20
20
|
type Props = HTMLAttributes<HTMLDivElement> & {
|
|
21
21
|
left?: ReactNode;
|
|
22
22
|
right?: ReactNode;
|
|
23
|
+
ref?: Ref<HTMLDivElement>;
|
|
23
24
|
};
|
|
24
25
|
|
|
25
|
-
const Level
|
|
26
|
+
const Level: FC<Props> = ({ right, left, children, className, ref, ...props }) => (
|
|
26
27
|
<div className={classNames("level", className)} {...props} ref={ref}>
|
|
27
28
|
<div className="level-left">{left}</div>
|
|
28
29
|
{children ? <div className="level-item">{children}</div> : null}
|
|
29
30
|
<div className="level-right">{right}</div>
|
|
30
31
|
</div>
|
|
31
|
-
)
|
|
32
|
+
);
|
|
32
33
|
|
|
33
34
|
export default Level;
|