@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.
Files changed (60) hide show
  1. package/.turbo/turbo-test.log +174 -0
  2. package/.turbo/turbo-typecheck.log +1 -1
  3. package/package.json +4 -4
  4. package/src/base/buttons/Button.tsx +74 -60
  5. package/src/base/buttons/Icon.tsx +4 -3
  6. package/src/base/forms/ConfigurationForm.tsx +7 -7
  7. package/src/base/forms/FormRow.tsx +9 -9
  8. package/src/base/forms/base/Control.tsx +7 -3
  9. package/src/base/forms/base/ExpandableText.tsx +11 -12
  10. package/src/base/forms/checkbox/Checkbox.tsx +63 -65
  11. package/src/base/forms/checkbox/CheckboxField.tsx +4 -4
  12. package/src/base/forms/chip-input/ChipInputField.tsx +28 -30
  13. package/src/base/forms/chip-input/ControlledChipInputField.tsx +20 -22
  14. package/src/base/forms/combobox/Combobox.tsx +3 -13
  15. package/src/base/forms/combobox/ComboboxField.tsx +11 -14
  16. package/src/base/forms/headless-chip-input/ChipInput.tsx +49 -46
  17. package/src/base/forms/helpers.ts +3 -7
  18. package/src/base/forms/input/Input.tsx +4 -3
  19. package/src/base/forms/input/InputField.tsx +55 -43
  20. package/src/base/forms/input/Textarea.tsx +4 -3
  21. package/src/base/forms/radio-button/RadioButton.tsx +37 -27
  22. package/src/base/forms/radio-button/RadioGroup.tsx +4 -3
  23. package/src/base/forms/radio-button/RadioGroupField.tsx +15 -16
  24. package/src/base/forms/select/Select.tsx +15 -16
  25. package/src/base/forms/select/SelectField.tsx +19 -19
  26. package/src/base/layout/_helpers/with-classes.tsx +15 -12
  27. package/src/base/layout/card/Card.tsx +28 -21
  28. package/src/base/layout/card/CardDetail.tsx +65 -76
  29. package/src/base/layout/card/CardRow.tsx +9 -9
  30. package/src/base/layout/card/CardTitle.tsx +5 -5
  31. package/src/base/layout/card-list/CardList.tsx +9 -9
  32. package/src/base/layout/collapsible/Collapsible.tsx +42 -35
  33. package/src/base/layout/tabs/TabTrigger.tsx +5 -4
  34. package/src/base/layout/tabs/Tabs.tsx +4 -4
  35. package/src/base/layout/tabs/TabsList.tsx +5 -3
  36. package/src/base/layout/templates/data-page/DataPageHeader.tsx +10 -11
  37. package/src/base/misc/Image.tsx +5 -5
  38. package/src/base/misc/Level.tsx +4 -3
  39. package/src/base/misc/Loading.tsx +25 -25
  40. package/src/base/misc/SubSubtitle.tsx +9 -9
  41. package/src/base/misc/Subtitle.tsx +10 -10
  42. package/src/base/misc/Title.tsx +22 -14
  43. package/src/base/notifications/Notification.tsx +12 -13
  44. package/src/base/overlays/dialog/Dialog.tsx +39 -40
  45. package/src/base/overlays/menu/Menu.tsx +49 -52
  46. package/src/base/overlays/menu/MenuTrigger.tsx +6 -6
  47. package/src/base/overlays/popover/Popover.tsx +4 -6
  48. package/src/base/overlays/tooltip/ExpandableHint.tsx +7 -8
  49. package/src/base/overlays/tooltip/Tooltip.tsx +5 -3
  50. package/src/base/status/StatusIcon.tsx +46 -39
  51. package/src/index.ts +1 -0
  52. package/src/routing/admin.ts +38 -0
  53. package/src/routing/group.ts +22 -0
  54. package/src/routing/help.ts +21 -0
  55. package/src/routing/import.ts +17 -0
  56. package/src/routing/index.ts +24 -0
  57. package/src/routing/me.ts +26 -0
  58. package/src/routing/namespace.ts +39 -0
  59. package/src/routing/repository.ts +91 -0
  60. 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 = React.forwardRef<HTMLSpanElement, CardDetailProps>(
62
- ({ children, className, ...props }, ref) => {
63
- const labelId = useAriaId();
64
- return (
65
- <span {...props} className={classNames("is-flex is-align-items-center has-gap-1 p-1", className)} ref={ref}>
66
- {typeof children === "function" ? children({ labelId }) : children}
67
- </span>
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 = React.forwardRef<HTMLButtonElement, ButtonHTMLAttributes<HTMLButtonElement>>(
92
- ({ children, className, ...props }, ref) => (
93
- <StyledCardButtonDetail
94
- {...props}
95
- className={classNames(
96
- "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",
97
- className
98
- )}
99
- ref={ref}
100
- >
101
- {children}
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 = React.forwardRef<HTMLAnchorElement, ComponentPropsWithoutRef<typeof Link>>(
117
- ({ children, className, ...props }, ref) => (
118
- <StyledCardLinkDetail
119
- {...props}
120
- className={classNames(
121
- "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",
122
- className
123
- )}
124
- ref={ref}
125
- >
126
- {children}
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 = React.forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(
136
- ({ children, className, ...props }, ref) => (
137
- <span {...props} className={classNames("has-text-secondary is-size-7", className)} ref={ref}>
138
- {children}
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 = React.forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement> & CardVariantProps>(
148
- ({ children, className, ...props }, ref) => (
149
- <span
150
- {...props}
151
- className={classNames("tag is-rounded", createCardVariantClasses(props.cardVariant), className)}
152
- ref={ref}
153
- >
154
- {children}
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 = React.forwardRef<HTMLElement, ComponentProps<typeof Icon>>(
164
- ({ children, className, ...props }, ref) => (
165
- <Icon {...props} className={classNames("is-size-5", className)} ref={ref}>
166
- {children}
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 = React.forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(
184
- ({ children, className, ...props }, ref) => (
185
- <CardDetailsRowContainer
186
- {...props}
187
- className={classNames("is-flex is-flex-wrap-wrap is-align-items-center", className)}
188
- ref={ref}
189
- >
190
- {children}
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 = React.forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
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 = React.forwardRef<HTMLDivElement, ComponentProps<typeof CardRow>>(
31
- ({ className, ...props }, ref) => <CardRow className={classNames(className, "is-size-7")} {...props} ref={ref} />
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 = React.forwardRef<HTMLDivElement, ComponentProps<typeof CardRow>>(
35
- ({ className, ...props }, ref) => (
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 = React.forwardRef<HTMLHeadingElement, Props>(({ children, level = 3, ...props }, ref) =>
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 = React.forwardRef<HTMLElement, Omit<ComponentProps<typeof Card>, "as">>((props, ref) => (
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 = React.forwardRef<HTMLUListElement, Props>(({ children, className, ...props }, ref) => (
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 = React.forwardRef<HTMLUListElement, Props>(({ className, children, ...props }, ref) => (
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 = React.forwardRef<HTMLButtonElement, Props>(
44
- ({ children, header, className, defaultCollapsed, collapsed, onCollapsedChange }, ref) => {
45
- const [isCollapsed, setCollapsed] = useState(defaultCollapsed);
46
- const titleId = useAriaId();
47
- useEffect(() => {
48
- if (collapsed !== undefined) {
49
- setCollapsed(collapsed);
50
- }
51
- }, [collapsed]);
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
- return (
54
- <RadixCollapsible.Root
55
- className={classNames("card", className)}
56
- open={!isCollapsed}
57
- onOpenChange={(o) => {
58
- setCollapsed(!o);
59
- if (onCollapsedChange) {
60
- onCollapsedChange(!o);
61
- }
62
- }}
63
- defaultOpen={!defaultCollapsed}
64
- >
65
- <StyledCollapsibleHeader className="card-header is-flex is-justify-content-space-between is-shadowless">
66
- <span id={titleId} className="card-header-title">
67
- {header}
68
- </span>
69
- <StyledTrigger aria-labelledby={titleId} className="card-header-icon" ref={ref}>
70
- <Icon>{isCollapsed ? "angle-left" : "angle-down"}</Icon>
71
- </StyledTrigger>
72
- </StyledCollapsibleHeader>
73
- <RadixCollapsible.Content className="card-content p-2">{children}</RadixCollapsible.Content>
74
- </RadixCollapsible.Root>
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 = React.forwardRef<HTMLButtonElement, Props>(({ children, className, ...props }, ref) => (
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 = React.forwardRef<HTMLDivElement, Props>(({ defaultValue, onValueChange, children, ...props }, ref) => {
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 = React.forwardRef<HTMLUListElement, HTMLAttributes<HTMLUListElement>>(({ children, ...props }, ref) => (
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 = React.forwardRef<HTMLSpanElement, DataPageHeaderSettingProps>(
60
- ({ className, children, ...props }, ref) => {
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
- }
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
@@ -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
- const Image = React.forwardRef<HTMLImageElement, ImgHTMLAttributes<HTMLImageElement> & { src: string }>(
21
- ({ src, alt, ...props }, ref) => (
22
- <img src={src?.startsWith("http") ? src : urls.withContextPath(src)} {...props} ref={ref} alt={alt} />
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;
@@ -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 = React.forwardRef<HTMLDivElement, Props>(({ right, left, children, className, ...props }, ref) => (
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;