@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,7 +14,7 @@
14
14
  * along with this program. If not, see https://www.gnu.org/licenses/.
15
15
  */
16
16
 
17
- import React, { InputHTMLAttributes } from "react";
17
+ import React, { FC, InputHTMLAttributes, Ref } from "react";
18
18
  import classNames from "classnames";
19
19
  import { createVariantClass, Variant } from "../variants";
20
20
  import { createAttributesForTesting } from "../../helpers";
@@ -22,9 +22,10 @@ import { createAttributesForTesting } from "../../helpers";
22
22
  type Props = {
23
23
  variant?: Variant;
24
24
  testId?: string;
25
+ ref?: Ref<HTMLInputElement>;
25
26
  } & InputHTMLAttributes<HTMLInputElement>;
26
27
 
27
- const Input = React.forwardRef<HTMLInputElement, Props>(({ variant, className, testId, ...props }, ref) => {
28
+ const Input: FC<Props> = ({ variant, className, testId, ref, ...props }) => {
28
29
  return (
29
30
  <input
30
31
  ref={ref}
@@ -33,6 +34,6 @@ const Input = React.forwardRef<HTMLInputElement, Props>(({ variant, className, t
33
34
  {...createAttributesForTesting(testId)}
34
35
  />
35
36
  );
36
- });
37
+ };
37
38
 
38
39
  export default Input;
@@ -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 from "react";
17
+ import React, { FC, Ref } from "react";
18
18
  import classNames from "classnames";
19
19
  import Field from "../base/Field";
20
20
  import Control from "../base/Control";
@@ -36,52 +36,64 @@ export type InputFieldProps = {
36
36
  extendedText?: string;
37
37
  error?: string;
38
38
  icon?: string;
39
+ ref?: Ref<HTMLInputElement>;
39
40
  } & React.ComponentProps<typeof Input>;
40
41
 
41
42
  /**
42
43
  * @see https://bulma.io/documentation/form/input/
43
44
  */
44
- const InputField = React.forwardRef<HTMLInputElement, InputFieldProps>(
45
- ({ name, label, helpText, descriptionText, extendedText, error, icon, className, id, ...props }, ref) => {
46
- const inputId = useAriaId(id ?? props.testId);
47
- const helpTextId = helpText ? `input-helptext-${name}` : undefined;
48
- const descriptionId = descriptionText ? `input-description-${name}` : undefined;
49
- const errorId = error ? `input-error-${name}` : undefined;
50
- const variant = error ? "danger" : undefined;
51
- return (
52
- <Field className={className}>
53
- <Label htmlFor={inputId}>
54
- {label}
55
- {helpText ? <Help className="ml-1" text={helpText} /> : null}
56
- </Label>
57
- {extendedText && descriptionText ? (
58
- <ExpandableText id={descriptionId} descriptionText={descriptionText} extendedDescriptionText={extendedText} />
59
- ) : (
60
- <p className="mb-2" id={descriptionId}>
61
- {descriptionText}
62
- </p>
63
- )}
64
- <Control className={classNames({ "has-icons-left": icon })}>
65
- <Input
66
- variant={variant}
67
- ref={ref}
68
- id={inputId}
69
- aria-describedby={descriptionId || helpTextId}
70
- {...props}
71
- ></Input>
72
- {icon ? (
73
- <span className="icon is-small is-left">
74
- <i className={icon} />
75
- </span>
76
- ) : null}
77
- </Control>
78
- {error ? (
79
- <FieldMessage id={errorId} variant={variant}>
80
- {error}
81
- </FieldMessage>
45
+ const InputField: FC<InputFieldProps> = ({
46
+ name,
47
+ label,
48
+ helpText,
49
+ descriptionText,
50
+ extendedText,
51
+ error,
52
+ icon,
53
+ className,
54
+ id,
55
+ ref,
56
+ ...props
57
+ }) => {
58
+ const inputId = useAriaId(id ?? props.testId);
59
+ const helpTextId = helpText ? `input-helptext-${name}` : undefined;
60
+ const descriptionId = descriptionText ? `input-description-${name}` : undefined;
61
+ const errorId = error ? `input-error-${name}` : undefined;
62
+ const variant = error ? "danger" : undefined;
63
+ return (
64
+ <Field className={className}>
65
+ <Label htmlFor={inputId}>
66
+ {label}
67
+ {helpText ? <Help className="ml-1" text={helpText} /> : null}
68
+ </Label>
69
+ {extendedText && descriptionText ? (
70
+ <ExpandableText id={descriptionId} descriptionText={descriptionText} extendedDescriptionText={extendedText} />
71
+ ) : (
72
+ <p className="mb-2" id={descriptionId}>
73
+ {descriptionText}
74
+ </p>
75
+ )}
76
+ <Control className={classNames({ "has-icons-left": icon })}>
77
+ <Input
78
+ variant={variant}
79
+ ref={ref}
80
+ id={inputId}
81
+ aria-describedby={descriptionId || helpTextId}
82
+ {...props}
83
+ ></Input>
84
+ {icon ? (
85
+ <span className="icon is-small is-left">
86
+ <i className={icon} />
87
+ </span>
82
88
  ) : null}
83
- </Field>
84
- );
85
- }
86
- );
89
+ </Control>
90
+ {error ? (
91
+ <FieldMessage id={errorId} variant={variant}>
92
+ {error}
93
+ </FieldMessage>
94
+ ) : null}
95
+ </Field>
96
+ );
97
+ };
98
+
87
99
  export default InputField;
@@ -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, { InputHTMLAttributes } from "react";
17
+ import React, { FC, InputHTMLAttributes, Ref } from "react";
18
18
  import classNames from "classnames";
19
19
  import { createVariantClass, Variant } from "../variants";
20
20
  import { createAttributesForTesting } from "../../helpers";
@@ -22,9 +22,10 @@ import { createAttributesForTesting } from "../../helpers";
22
22
  type Props = {
23
23
  variant?: Variant;
24
24
  testId?: string;
25
+ ref?: Ref<HTMLTextAreaElement>;
25
26
  } & InputHTMLAttributes<HTMLTextAreaElement>;
26
27
 
27
- const Textarea = React.forwardRef<HTMLTextAreaElement, Props>(({ variant, className, testId, ...props }, ref) => {
28
+ const Textarea: FC<Props> = ({ variant, className, testId, ref, ...props }) => {
28
29
  return (
29
30
  <textarea
30
31
  ref={ref}
@@ -33,6 +34,6 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, Props>(({ variant, classN
33
34
  {...createAttributesForTesting(testId)}
34
35
  />
35
36
  );
36
- });
37
+ };
37
38
 
38
39
  export default Textarea;
@@ -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 from "react";
17
+ import React, { FC, Ref } from "react";
18
18
  import classNames from "classnames";
19
19
  import Help from "../base/help/Help";
20
20
  import * as RadioGroup from "@radix-ui/react-radio-group";
@@ -65,7 +65,7 @@ const StyledIndicator = styled(RadioGroup.Indicator)`
65
65
  }
66
66
  `;
67
67
 
68
- type RadioGroupItemElement = React.ElementRef<typeof RadioGroup.Item>;
68
+ type RadioGroupItemElement = React.ComponentRef<typeof RadioGroup.Item>;
69
69
  type RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroup.Item>;
70
70
 
71
71
  type Props = {
@@ -76,37 +76,47 @@ type Props = {
76
76
  label?: string;
77
77
  labelClassName?: string;
78
78
  helpText?: string;
79
+ ref?: Ref<RadioGroupItemElement>;
79
80
  } & RadioGroupItemProps;
80
81
 
81
82
  /**
82
83
  * @beta
83
84
  * @since 2.48.0
84
85
  */
85
- const RadioButton = React.forwardRef<RadioGroupItemElement, Props>(
86
- ({ id, testId, indicatorClassName, label, labelClassName, className, helpText, value, ...props }, ref) => {
87
- const context = useRadioButtonContext();
88
- const inputId = useAriaId(id);
89
- const labelKey = `${context?.prefix}.radio.${value}`;
90
- const displayLabel = label ?? context?.t(labelKey) ?? value ?? "";
86
+ const RadioButton: FC<Props> = ({
87
+ id,
88
+ testId,
89
+ indicatorClassName,
90
+ label,
91
+ labelClassName,
92
+ className,
93
+ helpText,
94
+ value,
95
+ ref,
96
+ ...props
97
+ }) => {
98
+ const context = useRadioButtonContext();
99
+ const inputId = useAriaId(id);
100
+ const labelKey = `${context?.prefix}.radio.${value}`;
101
+ const displayLabel = label ?? context?.t(labelKey) ?? value ?? "";
91
102
 
92
- return (
93
- <div className={classNames("radio is-flex is-align-items-center", labelClassName)}>
94
- <StyledRadioButton
95
- form={context?.formId}
96
- id={inputId}
97
- value={value}
98
- ref={ref}
99
- className={classNames("mr-3 mt-3 mb-3", className)}
100
- {...props}
101
- {...createAttributesForTesting(testId)}
102
- >
103
- <StyledIndicator className={indicatorClassName} />
104
- </StyledRadioButton>
105
- <label htmlFor={inputId}>{displayLabel}</label>
106
- {helpText ? <Help className="ml-3" text={helpText} /> : null}
107
- </div>
108
- );
109
- }
110
- );
103
+ return (
104
+ <div className={classNames("radio is-flex is-align-items-center", labelClassName)}>
105
+ <StyledRadioButton
106
+ form={context?.formId}
107
+ id={inputId}
108
+ value={value}
109
+ ref={ref}
110
+ className={classNames("mr-3 mt-3 mb-3", className)}
111
+ {...props}
112
+ {...createAttributesForTesting(testId)}
113
+ >
114
+ <StyledIndicator className={indicatorClassName} />
115
+ </StyledRadioButton>
116
+ <label htmlFor={inputId}>{displayLabel}</label>
117
+ {helpText ? <Help className="ml-3" text={helpText} /> : null}
118
+ </div>
119
+ );
120
+ };
111
121
 
112
122
  export default RadioButton;
@@ -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, { ComponentProps } from "react";
17
+ import React, { ComponentProps, FC, Ref } from "react";
18
18
  import Control from "../base/Control";
19
19
  import * as RadixRadio from "@radix-ui/react-radio-group";
20
20
  import RadioButton from "./RadioButton";
21
21
 
22
22
  type Props = {
23
23
  options?: { value: string; label?: string; helpText?: string }[];
24
+ ref?: Ref<HTMLDivElement>;
24
25
  } & ComponentProps<typeof RadixRadio.Root>;
25
26
 
26
27
  /**
27
28
  * @beta
28
29
  * @since 2.48.0
29
30
  */
30
- const RadioGroup = React.forwardRef<HTMLDivElement, Props>(({ options, children, className, ...props }, ref) => (
31
+ const RadioGroup: FC<Props> = ({ options, children, className, ref, ...props }) => (
31
32
  <RadixRadio.Root {...props} asChild>
32
33
  <Control ref={ref} className={className}>
33
34
  {children ??
@@ -36,6 +37,6 @@ const RadioGroup = React.forwardRef<HTMLDivElement, Props>(({ options, children,
36
37
  ))}
37
38
  </Control>
38
39
  </RadixRadio.Root>
39
- ));
40
+ );
40
41
 
41
42
  export default RadioGroup;
@@ -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 } from "react";
17
+ import React, { ComponentProps, FC, Ref } from "react";
18
18
  import Field from "../base/Field";
19
19
  import Label from "../base/label/Label";
20
20
  import Help from "../base/help/Help";
@@ -25,26 +25,25 @@ type Props = {
25
25
  labelClassName?: string;
26
26
  label: string;
27
27
  helpText?: string;
28
+ ref?: Ref<HTMLDivElement>;
28
29
  } & ComponentProps<typeof RadioGroup>;
29
30
 
30
31
  /**
31
32
  * @beta
32
33
  * @since 2.48.0
33
34
  */
34
- const RadioGroupField = React.forwardRef<HTMLDivElement, Props>(
35
- ({ fieldClassName, labelClassName, label, helpText, children, ...props }, ref) => {
36
- return (
37
- <Field className={fieldClassName} as="fieldset">
38
- <Label className={labelClassName} as="legend">
39
- {label}
40
- {helpText ? <Help className="ml-1" text={helpText} /> : null}
41
- </Label>
42
- <RadioGroup ref={ref} {...props}>
43
- {children}
44
- </RadioGroup>
45
- </Field>
46
- );
47
- }
48
- );
35
+ const RadioGroupField: FC<Props> = ({ fieldClassName, labelClassName, label, helpText, children, ref, ...props }) => {
36
+ return (
37
+ <Field className={fieldClassName} as="fieldset">
38
+ <Label className={labelClassName} as="legend">
39
+ {label}
40
+ {helpText ? <Help className="ml-1" text={helpText} /> : null}
41
+ </Label>
42
+ <RadioGroup ref={ref} {...props}>
43
+ {children}
44
+ </RadioGroup>
45
+ </Field>
46
+ );
47
+ };
49
48
 
50
49
  export default RadioGroupField;
@@ -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, { InputHTMLAttributes, Key, OptionHTMLAttributes } from "react";
17
+ import React, { FC, InputHTMLAttributes, Key, OptionHTMLAttributes, Ref } from "react";
18
18
  import classNames from "classnames";
19
19
  import { createVariantClass, Variant } from "../variants";
20
20
  import { createAttributesForTesting } from "../../helpers";
@@ -23,27 +23,26 @@ type Props = {
23
23
  variant?: Variant;
24
24
  options?: Array<OptionHTMLAttributes<HTMLOptionElement> & { label: string }>;
25
25
  testId?: string;
26
+ ref?: Ref<HTMLSelectElement>;
26
27
  } & InputHTMLAttributes<HTMLSelectElement>;
27
28
 
28
29
  /**
29
30
  * @beta
30
31
  * @since 2.44.0
31
32
  */
32
- const Select = React.forwardRef<HTMLSelectElement, Props>(
33
- ({ variant, children, className, options, testId, ...props }, ref) => (
34
- <div className={classNames("select", { "is-multiple": props.multiple }, createVariantClass(variant), className)}>
35
- <select ref={ref} {...props} {...createAttributesForTesting(testId)} className={className}>
36
- {options
37
- ? options.map((opt) => (
38
- <option {...opt} key={opt.value as Key}>
39
- {opt.label}
40
- {opt.children}
41
- </option>
42
- ))
43
- : children}
44
- </select>
45
- </div>
46
- )
33
+ const Select: FC<Props> = ({ variant, children, className, options, testId, ref, ...props }) => (
34
+ <div className={classNames("select", { "is-multiple": props.multiple }, createVariantClass(variant), className)}>
35
+ <select ref={ref} {...props} {...createAttributesForTesting(testId)} className={className}>
36
+ {options
37
+ ? options.map((opt) => (
38
+ <option {...opt} key={opt.value as Key}>
39
+ {opt.label}
40
+ {opt.children}
41
+ </option>
42
+ ))
43
+ : children}
44
+ </select>
45
+ </div>
47
46
  );
48
47
 
49
48
  export default Select;
@@ -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 from "react";
17
+ import React, { FC, Ref } from "react";
18
18
  import Field from "../base/Field";
19
19
  import Control from "../base/Control";
20
20
  import Label from "../base/label/Label";
@@ -27,6 +27,7 @@ type Props = {
27
27
  label: string;
28
28
  helpText?: string;
29
29
  error?: string;
30
+ ref?: Ref<HTMLSelectElement>;
30
31
  } & React.ComponentProps<typeof Select>;
31
32
 
32
33
  /**
@@ -34,22 +35,21 @@ type Props = {
34
35
  * @beta
35
36
  * @since 2.44.0
36
37
  */
37
- const SelectField = React.forwardRef<HTMLSelectElement, Props>(
38
- ({ label, helpText, error, className, id, ...props }, ref) => {
39
- const selectId = useAriaId(id ?? props.testId);
40
- const variant = error ? "danger" : undefined;
41
- return (
42
- <Field className={className}>
43
- <Label htmlFor={selectId}>
44
- {label}
45
- {helpText ? <Help className="ml-1" text={helpText} /> : null}
46
- </Label>
47
- <Control>
48
- <Select id={selectId} variant={variant} ref={ref} className="is-full-width" {...props}></Select>
49
- </Control>
50
- {error ? <FieldMessage variant={variant}>{error}</FieldMessage> : null}
51
- </Field>
52
- );
53
- }
54
- );
38
+ const SelectField: FC<Props> = ({ label, helpText, error, className, id, ref, ...props }) => {
39
+ const selectId = useAriaId(id ?? props.testId);
40
+ const variant = error ? "danger" : undefined;
41
+ return (
42
+ <Field className={className}>
43
+ <Label htmlFor={selectId}>
44
+ {label}
45
+ {helpText ? <Help className="ml-1" text={helpText} /> : null}
46
+ </Label>
47
+ <Control>
48
+ <Select id={selectId} variant={variant} ref={ref} className="is-full-width" {...props}></Select>
49
+ </Control>
50
+ {error ? <FieldMessage variant={variant}>{error}</FieldMessage> : null}
51
+ </Field>
52
+ );
53
+ };
54
+
55
55
  export default SelectField;
@@ -14,20 +14,23 @@
14
14
  * along with this program. If not, see https://www.gnu.org/licenses/.
15
15
  */
16
16
 
17
- import React, { ComponentProps, ElementRef, ForwardRefExoticComponent, ReactElement } from "react";
17
+ import React, { ComponentProps, ElementRef, ForwardRefExoticComponent, ReactElement, Ref } from "react";
18
18
  import classNames from "classnames";
19
19
  import { Slot } from "@radix-ui/react-slot";
20
20
 
21
- const withClasses = <Element extends React.ElementType | ForwardRefExoticComponent<any>>(
22
- typ: Element,
23
- additionalClassNames: string[],
24
- additionalProps?: Partial<ComponentProps<Element>>
25
- ) =>
26
- React.forwardRef<
27
- ElementRef<Element>,
28
- | (ComponentProps<Element> & { asChild?: false; className?: string })
29
- | { asChild: true; children: ReactElement<{ className?: string }> }
30
- >((props, ref) => {
21
+ type Props<Element extends React.ElementType | ForwardRefExoticComponent<any>> = (
22
+ | (ComponentProps<Element> & { asChild?: false; className?: string })
23
+ | { asChild: true; children: ReactElement<{ className?: string }> }
24
+ ) & { ref?: Ref<Element> };
25
+
26
+ const withClasses =
27
+ <Element extends React.ElementType | ForwardRefExoticComponent<any>>(
28
+ typ: Element,
29
+ additionalClassNames: string[],
30
+ additionalProps?: Partial<ComponentProps<Element>>,
31
+ ) =>
32
+ // @ts-ignore TypeScript for some reason does not understand that ref will always be part of the Props
33
+ ({ ref, ...props }: Props<Element>) => {
31
34
  // @ts-ignore Typescript doesn't get it for some reason
32
35
  if (props.asChild) {
33
36
  return <Slot {...props} className={classNames(...additionalClassNames)} />;
@@ -39,6 +42,6 @@ const withClasses = <Element extends React.ElementType | ForwardRefExoticCompone
39
42
  ref,
40
43
  });
41
44
  }
42
- });
45
+ };
43
46
 
44
47
  export default withClasses;
@@ -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, { ComponentType, HTMLAttributes, JSX, Ref } from "react";
17
+ import React, { ComponentType, FC, HTMLAttributes, JSX, Ref } from "react";
18
18
  import classNames from "classnames";
19
19
  import styled from "styled-components";
20
20
 
@@ -31,12 +31,12 @@ type Props = HTMLAttributes<HTMLElement> & {
31
31
  * @default "div"
32
32
  */
33
33
  as?: keyof JSX.IntrinsicElements | ComponentType<HTMLAttributes<HTMLElement> & { ref?: Ref<HTMLElement> }>;
34
-
35
34
  /**
36
35
  * @default "0.5rem"
37
36
  * @since 2.46.0
38
37
  */
39
38
  rowGap?: Gap;
39
+ ref?: Ref<HTMLElement>;
40
40
  };
41
41
 
42
42
  /**
@@ -46,24 +46,31 @@ type Props = HTMLAttributes<HTMLElement> & {
46
46
  * @beta
47
47
  * @since 2.44.0
48
48
  */
49
- const Card = React.forwardRef<HTMLElement, Props>(
50
- ({ className, avatar, rowGap = "0.25rem", children, as: Comp = "div", action, ...props }, ref) =>
51
- React.createElement(
52
- Comp,
53
- {
54
- className: classNames(className, "is-relative", "is-flex", "scmm-card"),
55
- ref,
56
- ...props,
57
- },
58
- avatar ? avatar : null,
59
- <RowsContainer
60
- className="is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
61
- style={{ gap: rowGap }}
62
- >
63
- {children}
64
- </RowsContainer>,
65
- action ? action : null,
66
- ),
67
- );
49
+ const Card: FC<Props> = ({
50
+ className,
51
+ avatar,
52
+ rowGap = "0.25rem",
53
+ children,
54
+ as: Comp = "div",
55
+ action,
56
+ ref,
57
+ ...props
58
+ }) =>
59
+ React.createElement(
60
+ Comp,
61
+ {
62
+ className: classNames(className, "is-relative", "is-flex", "scmm-card"),
63
+ ref,
64
+ ...props,
65
+ },
66
+ avatar ? avatar : null,
67
+ <RowsContainer
68
+ className="is-flex is-flex-direction-column is-justify-content-center is-flex-grow-1 is-overflow-hidden is-overflow-wrap-anywhere"
69
+ style={{ gap: rowGap }}
70
+ >
71
+ {children}
72
+ </RowsContainer>,
73
+ action ? action : null,
74
+ );
68
75
 
69
76
  export default Card;