@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
@@ -0,0 +1,174 @@
1
+ yarn run v1.22.22
2
+ $ jest
3
+ PASS src/base/shortcuts/iterator/keyboardIterator.test.tsx (11.405 s)
4
+ PASS src/base/helpers/useDocumentTitle.test.ts (11.394 s)
5
+ PASS src/base/text/textSplitAndReplace.test.ts (13.148 s)
6
+ ----------------------------------------|---------|----------|---------|---------|-------------------
7
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
8
+ ----------------------------------------|---------|----------|---------|---------|-------------------
9
+ All files | 2.3 | 2.15 | 1.33 | 2.27 |
10
+ src | 0 | 0 | 0 | 0 |
11
+ index.ts | 0 | 0 | 0 | 0 |
12
+ src/base | 0 | 0 | 0 | 0 |
13
+ index.ts | 0 | 0 | 0 | 0 |
14
+ src/base/buttons | 0 | 0 | 0 | 0 |
15
+ Button.stories.tsx | 0 | 100 | 0 | 0 | 141-229
16
+ Button.tsx | 0 | 0 | 0 | 0 | 27-231
17
+ Icon.tsx | 0 | 0 | 0 | 0 | 38-39
18
+ index.ts | 0 | 0 | 0 | 0 |
19
+ src/base/forms | 0 | 0 | 0 | 0 |
20
+ AddListEntryForm.tsx | 0 | 0 | 0 | 0 | 27-97
21
+ ConfigurationForm.tsx | 0 | 0 | 0 | 0 | 40-47
22
+ Form.stories.tsx | 0 | 100 | 0 | 0 | 477-756
23
+ Form.tsx | 0 | 0 | 0 | 0 | 32-171
24
+ FormPathContext.tsx | 0 | 0 | 0 | 0 | 19-64
25
+ FormRow.tsx | 0 | 0 | 0 | 0 | 22-23
26
+ ScmFormContext.tsx | 0 | 100 | 0 | 0 | 27-37
27
+ ScmFormListContext.tsx | 0 | 0 | 0 | 0 | 24-57
28
+ helpers.ts | 0 | 0 | 0 | 0 | 21-61
29
+ index.ts | 0 | 100 | 100 | 0 | 53-64
30
+ resourceHooks.ts | 0 | 0 | 0 | 0 | 23-151
31
+ variants.ts | 0 | 0 | 0 | 0 | 17-19
32
+ src/base/forms/base | 0 | 0 | 0 | 0 |
33
+ Control.tsx | 0 | 100 | 0 | 0 | 24-25
34
+ ExpandableText.tsx | 0 | 100 | 0 | 0 | 40-41
35
+ Field.tsx | 0 | 0 | 0 | 0 | 20-25
36
+ src/base/forms/base/field-message | 0 | 100 | 0 | 0 |
37
+ FieldMessage.tsx | 0 | 100 | 0 | 0 | 23-24
38
+ src/base/forms/base/help | 0 | 100 | 0 | 0 |
39
+ Help.tsx | 0 | 100 | 0 | 0 | 21-22
40
+ src/base/forms/base/label | 0 | 0 | 0 | 0 |
41
+ Label.tsx | 0 | 0 | 0 | 0 | 20-25
42
+ src/base/forms/checkbox | 0 | 0 | 0 | 0 |
43
+ Checkbox.tsx | 0 | 0 | 0 | 0 | 23-62
44
+ CheckboxField.tsx | 0 | 100 | 0 | 0 | 24-25
45
+ ControlledCheckboxField.tsx | 0 | 0 | 0 | 0 | 46-61
46
+ src/base/forms/chip-input | 0 | 0 | 0 | 0 |
47
+ ChipInputField.stories.tsx | 0 | 0 | 0 | 0 | 77-147
48
+ ChipInputField.tsx | 0 | 0 | 0 | 0 | 31-152
49
+ ControlledChipInputField.tsx | 0 | 0 | 0 | 0 | 59-83
50
+ src/base/forms/combobox | 0 | 0 | 0 | 0 |
51
+ Combobox.stories.tsx | 0 | 100 | 0 | 0 | 128-144
52
+ Combobox.tsx | 0 | 0 | 0 | 0 | 24-205
53
+ ComboboxField.tsx | 0 | 0 | 0 | 0 | 30-41
54
+ ControlledComboboxField.tsx | 0 | 0 | 0 | 0 | 52-74
55
+ src/base/forms/headless-chip-input | 0 | 0 | 0 | 0 |
56
+ ChipInput.tsx | 0 | 0 | 0 | 0 | 48-221
57
+ src/base/forms/input | 0 | 0 | 0 | 0 |
58
+ ControlledInputField.tsx | 0 | 0 | 0 | 0 | 48-63
59
+ ControlledSecretConfirmationField.tsx | 0 | 0 | 0 | 0 | 55-113
60
+ Input.tsx | 0 | 100 | 0 | 0 | 28-29
61
+ InputField.tsx | 0 | 0 | 0 | 0 | 45-63
62
+ Textarea.tsx | 0 | 100 | 0 | 0 | 28-29
63
+ src/base/forms/list | 0 | 0 | 0 | 0 |
64
+ ControlledList.tsx | 0 | 0 | 0 | 0 | 47-68
65
+ src/base/forms/misc | 0 | 100 | 0 | 0 |
66
+ RequiredMarker.tsx | 0 | 100 | 0 | 0 | 19-20
67
+ src/base/forms/radio-button | 0 | 0 | 0 | 0 |
68
+ ControlledRadioGroupField.tsx | 0 | 0 | 0 | 0 | 51-65
69
+ RadioButton.stories.tsx | 0 | 100 | 0 | 0 | 236-379
70
+ RadioButton.tsx | 0 | 0 | 0 | 0 | 25-103
71
+ RadioButtonContext.tsx | 0 | 100 | 0 | 0 | 27-34
72
+ RadioGroup.tsx | 0 | 0 | 0 | 0 | 31-36
73
+ RadioGroupField.tsx | 0 | 0 | 0 | 0 | 35-36
74
+ src/base/forms/select | 0 | 0 | 0 | 0 |
75
+ ControlledSelectField.tsx | 0 | 0 | 0 | 0 | 45-58
76
+ Select.tsx | 0 | 0 | 0 | 0 | 33-38
77
+ SelectField.tsx | 0 | 0 | 0 | 0 | 38-41
78
+ src/base/forms/table | 0 | 0 | 0 | 0 |
79
+ ControlledColumn.tsx | 0 | 0 | 0 | 0 | 31-38
80
+ ControlledTable.tsx | 0 | 0 | 0 | 0 | 49-84
81
+ src/base/helpers | 0 | 0 | 0 | 0 |
82
+ devbuild.ts | 0 | 0 | 0 | 0 | 17-35
83
+ index.ts | 0 | 0 | 0 | 0 |
84
+ useAriaId.tsx | 0 | 0 | 0 | 0 | 19-22
85
+ useDocumentTitle.ts | 0 | 0 | 0 | 0 | 29-52
86
+ src/base/layout | 0 | 100 | 100 | 0 |
87
+ index.ts | 0 | 100 | 100 | 0 | 44-80
88
+ src/base/layout/_helpers | 0 | 0 | 0 | 0 |
89
+ with-classes.tsx | 0 | 0 | 0 | 0 | 27-38
90
+ src/base/layout/card | 0 | 0 | 0 | 0 |
91
+ Card.stories.tsx | 0 | 100 | 0 | 0 | 126-147
92
+ Card.tsx | 0 | 0 | 0 | 0 | 21-59
93
+ CardDetail.tsx | 0 | 0 | 0 | 0 | 24-175
94
+ CardRow.tsx | 0 | 100 | 0 | 0 | 26-37
95
+ CardTitle.tsx | 0 | 0 | 0 | 0 | 41-42
96
+ src/base/layout/card-list | 0 | 100 | 0 | 0 |
97
+ CardList.stories.tsx | 0 | 100 | 0 | 0 | 205-279
98
+ CardList.tsx | 0 | 100 | 0 | 0 | 29-63
99
+ src/base/layout/collapsible | 0 | 0 | 0 | 0 |
100
+ Collapsible.stories.tsx | 0 | 100 | 0 | 0 | 44-61
101
+ Collapsible.tsx | 0 | 0 | 0 | 0 | 24-68
102
+ src/base/layout/tabs | 0 | 0 | 0 | 0 |
103
+ TabTrigger.tsx | 0 | 100 | 0 | 0 | 27-28
104
+ Tabs.stories.tsx | 0 | 100 | 0 | 0 | 50-69
105
+ Tabs.tsx | 0 | 0 | 0 | 0 | 26-37
106
+ TabsContent.tsx | 0 | 100 | 100 | 0 | 23
107
+ TabsList.tsx | 0 | 100 | 0 | 0 | 27-28
108
+ src/base/layout/templates/data-page | 0 | 0 | 0 | 0 |
109
+ DataPage.stories.tsx | 0 | 100 | 0 | 0 | 215-322
110
+ DataPageHeader.tsx | 0 | 0 | 0 | 0 | 27-89
111
+ src/base/misc | 0 | 0 | 0 | 0 |
112
+ Image.tsx | 0 | 0 | 0 | 0 | 22-23
113
+ Level.tsx | 0 | 0 | 0 | 0 | 26-27
114
+ Loading.tsx | 0 | 100 | 0 | 0 | 23-36
115
+ SubSubtitle.tsx | 0 | 0 | 0 | 0 | 22-23
116
+ Subtitle.tsx | 0 | 0 | 0 | 0 | 22-23
117
+ Title.tsx | 0 | 0 | 0 | 0 | 27-44
118
+ index.ts | 0 | 0 | 0 | 0 |
119
+ src/base/notifications | 0 | 0 | 0 | 0 |
120
+ BackendErrorNotification.tsx | 0 | 0 | 0 | 0 | 26-136
121
+ ErrorNotification.tsx | 0 | 0 | 0 | 0 | 28-63
122
+ Notification.tsx | 0 | 0 | 0 | 0 | 29-32
123
+ index.tsx | 0 | 0 | 0 | 0 |
124
+ src/base/overlays | 0 | 100 | 100 | 0 |
125
+ index.ts | 0 | 100 | 100 | 0 | 23-32
126
+ src/base/overlays/dialog | 0 | 0 | 0 | 0 |
127
+ Dialog.stories.tsx | 0 | 100 | 0 | 0 | 69-86
128
+ Dialog.tsx | 0 | 0 | 0 | 0 | 25-49
129
+ src/base/overlays/menu | 0 | 0 | 0 | 0 |
130
+ Menu.stories.tsx | 0 | 100 | 0 | 0 | 79-103
131
+ Menu.tsx | 0 | 0 | 0 | 0 | 37-185
132
+ MenuTrigger.tsx | 0 | 100 | 0 | 0 | 29-43
133
+ src/base/overlays/popover | 0 | 100 | 0 | 0 |
134
+ Popover.stories.tsx | 0 | 100 | 0 | 0 | 21-46
135
+ Popover.tsx | 0 | 100 | 0 | 0 | 23-63
136
+ src/base/overlays/tooltip | 0 | 0 | 0 | 0 |
137
+ ExpandableHint.tsx | 0 | 0 | 0 | 0 | 29-59
138
+ Tooltip.examples.js | 0 | 100 | 100 | 0 | 18-25
139
+ Tooltip.tsx | 0 | 100 | 0 | 0 | 22-62
140
+ src/base/shortcuts | 0 | 0 | 0 | 0 |
141
+ index.ts | 0 | 0 | 0 | 0 |
142
+ usePauseShortcuts.ts | 0 | 0 | 0 | 0 | 27-33
143
+ useShortcut.ts | 0 | 0 | 0 | 0 | 76-99
144
+ useShortcutDocs.tsx | 0 | 100 | 0 | 0 | 25-44
145
+ src/base/shortcuts/iterator | 0 | 0 | 0 | 0 |
146
+ callbackIterator.ts | 0 | 0 | 0 | 0 | 19-252
147
+ keyboardIterator.tsx | 0 | 0 | 0 | 0 | 28-193
148
+ src/base/status | 0 | 0 | 0 | 0 |
149
+ StatusIcon.stories.tsx | 0 | 100 | 0 | 0 | 71-106
150
+ StatusIcon.tsx | 0 | 0 | 0 | 0 | 21-109
151
+ index.ts | 0 | 0 | 0 | 0 |
152
+ src/base/text | 56.52 | 66.66 | 45.45 | 55.55 |
153
+ SplitAndReplace.stories.tsx | 0 | 100 | 0 | 0 | 82-141
154
+ SplitAndReplace.tsx | 0 | 0 | 0 | 0 | 32-52
155
+ index.ts | 0 | 0 | 0 | 0 |
156
+ textSplitAndReplace.ts | 100 | 100 | 100 | 100 |
157
+ src/routing | 0 | 0 | 0 | 0 |
158
+ admin.ts | 0 | 100 | 100 | 0 | 17-35
159
+ group.ts | 0 | 100 | 100 | 0 | 17-20
160
+ help.ts | 0 | 100 | 100 | 0 | 17-19
161
+ import.ts | 0 | 100 | 100 | 0 | 17
162
+ index.ts | 0 | 0 | 0 | 0 |
163
+ me.ts | 0 | 100 | 100 | 0 | 17-19
164
+ namespace.ts | 0 | 0 | 0 | 0 | 20-38
165
+ repository.ts | 0 | 0 | 0 | 0 | 21-89
166
+ user.ts | 0 | 100 | 100 | 0 | 17-20
167
+ ----------------------------------------|---------|----------|---------|---------|-------------------
168
+
169
+ Test Suites: 3 passed, 3 total
170
+ Tests: 9 passed, 9 total
171
+ Snapshots: 0 total
172
+ Time: 39.472 s
173
+ Ran all test suites.
174
+ Done in 41.88s.
@@ -1,3 +1,3 @@
1
1
  yarn run v1.22.22
2
2
  $ tsc
3
- Done in 31.61s.
3
+ Done in 32.70s.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-manager/ui-core",
3
- "version": "4.0.0-REACT19-20250825-073633",
3
+ "version": "4.0.0-REACT19-20250910-124634",
4
4
  "main": "./src/index.ts",
5
5
  "license": "AGPL-3.0-only",
6
6
  "scripts": {
@@ -30,16 +30,16 @@
30
30
  "@radix-ui/react-tabs": "^1.0.4",
31
31
  "@radix-ui/react-tooltip": "1.0.2",
32
32
  "@radix-ui/react-visually-hidden": "^1.0.3",
33
- "@scm-manager/ui-api": "4.0.0-REACT19-20250825-073633",
33
+ "@scm-manager/ui-api": "4.0.0-REACT19-20250910-124634",
34
34
  "mousetrap": "1.6.5"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@babel/core": "^7.19.0",
38
38
  "@scm-manager/babel-preset": "^2.13.1",
39
- "@scm-manager/eslint-config": "^2.17.0",
39
+ "@scm-manager/eslint-config": "^2.18.2",
40
40
  "@scm-manager/prettier-config": "^2.12.0",
41
41
  "@scm-manager/tsconfig": "^2.12.0",
42
- "@scm-manager/ui-types": "4.0.0-REACT19-20250825-073633",
42
+ "@scm-manager/ui-types": "4.0.0-REACT19-20250910-124634",
43
43
  "@storybook/addon-actions": "^9.0.8",
44
44
  "@storybook/addon-docs": "^9.1.5",
45
45
  "@storybook/addon-essentials": "^9.0.0-alpha.12",
@@ -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, { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from "react";
17
+ import React, { AnchorHTMLAttributes, ButtonHTMLAttributes, FC, ReactNode, Ref } from "react";
18
18
  import { Link as ReactRouterLink, LinkProps as ReactRouterLinkProps } from "react-router";
19
19
  import classNames from "classnames";
20
20
  import { createAttributesForTesting } from "../helpers";
@@ -54,7 +54,10 @@ type BaseButtonProps = {
54
54
  testId?: string;
55
55
  };
56
56
 
57
- type ButtonProps = BaseButtonProps & ButtonHTMLAttributes<HTMLButtonElement>;
57
+ type ButtonProps = BaseButtonProps &
58
+ ButtonHTMLAttributes<HTMLButtonElement> & {
59
+ ref?: Ref<HTMLButtonElement>;
60
+ };
58
61
 
59
62
  /**
60
63
  * Styled html button.
@@ -64,21 +67,19 @@ type ButtonProps = BaseButtonProps & ButtonHTMLAttributes<HTMLButtonElement>;
64
67
  * @beta
65
68
  * @since 2.41.0
66
69
  */
67
- export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
68
- ({ className, variant, isLoading, testId, type, children, ...props }, ref) => (
69
- <button
70
- type={type ?? "button"}
71
- {...props}
72
- className={classNames(createButtonClasses(variant, isLoading), className)}
73
- ref={ref}
74
- {...createAttributesForTesting(testId)}
75
- >
76
- {children}
77
- </button>
78
- ),
70
+ export const Button: FC<ButtonProps> = ({ className, variant, isLoading, testId, type, children, ref, ...props }) => (
71
+ <button
72
+ type={type ?? "button"}
73
+ {...props}
74
+ className={classNames(createButtonClasses(variant, isLoading), className)}
75
+ ref={ref}
76
+ {...createAttributesForTesting(testId)}
77
+ >
78
+ {children}
79
+ </button>
79
80
  );
80
81
 
81
- type LinkButtonProps = BaseButtonProps & ReactRouterLinkProps;
82
+ type LinkButtonProps = BaseButtonProps & ReactRouterLinkProps & { ref?: Ref<HTMLAnchorElement> };
82
83
 
83
84
  /**
84
85
  * Styled react router link.
@@ -88,34 +89,33 @@ type LinkButtonProps = BaseButtonProps & ReactRouterLinkProps;
88
89
  * @beta
89
90
  * @since 2.41.0
90
91
  */
91
- export const LinkButton = React.forwardRef<HTMLAnchorElement, LinkButtonProps>(
92
- ({ className, variant, isLoading, testId, children, ...props }, ref) => (
93
- <ReactRouterLink
94
- {...props}
95
- className={classNames(createButtonClasses(variant, isLoading), className)}
96
- ref={ref}
97
- {...createAttributesForTesting(testId)}
98
- >
99
- {children}
100
- </ReactRouterLink>
101
- ),
92
+ export const LinkButton: FC<LinkButtonProps> = ({ className, variant, isLoading, testId, children, ref, ...props }) => (
93
+ <ReactRouterLink
94
+ {...props}
95
+ className={classNames(createButtonClasses(variant, isLoading), className)}
96
+ ref={ref}
97
+ {...createAttributesForTesting(testId)}
98
+ >
99
+ {children}
100
+ </ReactRouterLink>
102
101
  );
103
102
 
103
+ type ExternalLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & { ref?: Ref<HTMLAnchorElement> };
104
+
104
105
  /**
105
106
  * External links open in a new browser tab with rel flags "noopener" and "noreferrer" set by default.
106
107
  *
107
108
  * @beta
108
109
  * @since 2.44.0
109
110
  */
110
- export const ExternalLink = React.forwardRef<HTMLAnchorElement, AnchorHTMLAttributes<HTMLAnchorElement>>(
111
- ({ children, ...props }, ref) => (
112
- <a target="_blank" rel="noreferrer noopener" {...props} ref={ref}>
113
- {children}
114
- </a>
115
- ),
111
+ export const ExternalLink: FC<ExternalLinkProps> = ({ children, ref, ...props }) => (
112
+ <a target="_blank" rel="noreferrer noopener" {...props} ref={ref}>
113
+ {children}
114
+ </a>
116
115
  );
117
116
 
118
- type ExternalLinkButtonProps = BaseButtonProps & AnchorHTMLAttributes<HTMLAnchorElement>;
117
+ type ExternalLinkButtonProps = BaseButtonProps &
118
+ AnchorHTMLAttributes<HTMLAnchorElement> & { ref?: Ref<HTMLAnchorElement> };
119
119
 
120
120
  /**
121
121
  * Styled {@link ExternalLink}.
@@ -126,17 +126,23 @@ type ExternalLinkButtonProps = BaseButtonProps & AnchorHTMLAttributes<HTMLAnchor
126
126
  * @since 2.41.0
127
127
  * @see ExternalLink
128
128
  */
129
- export const ExternalLinkButton = React.forwardRef<HTMLAnchorElement, ExternalLinkButtonProps>(
130
- ({ className, variant, isLoading, testId, children, ...props }, ref) => (
131
- <ExternalLink
132
- {...props}
133
- className={classNames(createButtonClasses(variant, isLoading), className)}
134
- ref={ref}
135
- {...createAttributesForTesting(testId)}
136
- >
137
- {children}
138
- </ExternalLink>
139
- ),
129
+ export const ExternalLinkButton: FC<ExternalLinkButtonProps> = ({
130
+ className,
131
+ variant,
132
+ isLoading,
133
+ testId,
134
+ children,
135
+ ref,
136
+ ...props
137
+ }) => (
138
+ <ExternalLink
139
+ {...props}
140
+ className={classNames(createButtonClasses(variant, isLoading), className)}
141
+ ref={ref}
142
+ {...createAttributesForTesting(testId)}
143
+ >
144
+ {children}
145
+ </ExternalLink>
140
146
  );
141
147
 
142
148
  const StyledIconButton = styled.button`
@@ -194,6 +200,7 @@ type IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
194
200
  variant?: IconButtonVariant;
195
201
  children: ReactNode;
196
202
  size?: IconButtonSize;
203
+ ref?: Ref<HTMLButtonElement>;
197
204
  };
198
205
 
199
206
  /**
@@ -204,19 +211,26 @@ type IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
204
211
  * @beta
205
212
  * @since 3.2.0
206
213
  */
207
- export const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
208
- ({ className, variant = "default", size = "medium", testId, type, children, ...props }, ref) => {
209
- const elementAttributes = {
210
- type: type ?? "button",
211
- ...props,
212
- className: classNames(createIconButtonClasses(variant), "button", "has-background-transparent"),
213
- ref: ref,
214
- ...createAttributesForTesting(testId),
215
- };
216
- return size === "small" ? (
217
- <StyledIconButtonCircle {...elementAttributes}>{children}</StyledIconButtonCircle>
218
- ) : (
219
- <StyledIconButton {...elementAttributes}>{children}</StyledIconButton>
220
- );
221
- },
222
- );
214
+ export const IconButton: FC<IconButtonProps> = ({
215
+ className,
216
+ variant = "default",
217
+ size = "medium",
218
+ testId,
219
+ type,
220
+ ref,
221
+ children,
222
+ ...props
223
+ }) => {
224
+ const elementAttributes = {
225
+ type: type ?? "button",
226
+ ...props,
227
+ className: classNames(createIconButtonClasses(variant), "button", "has-background-transparent"),
228
+ ref: ref,
229
+ ...createAttributesForTesting(testId),
230
+ };
231
+ return size === "small" ? (
232
+ <StyledIconButtonCircle {...elementAttributes}>{children}</StyledIconButtonCircle>
233
+ ) : (
234
+ <StyledIconButton {...elementAttributes}>{children}</StyledIconButton>
235
+ );
236
+ };
@@ -14,12 +14,13 @@
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, { Ref, FC } from "react";
18
18
  import classNames from "classnames";
19
19
 
20
20
  type Props = React.HTMLProps<HTMLElement> & {
21
21
  children?: string;
22
22
  type?: string;
23
+ ref?: Ref<HTMLElement>;
23
24
  };
24
25
 
25
26
  /**
@@ -34,7 +35,7 @@ type Props = React.HTMLProps<HTMLElement> & {
34
35
  * @see https://bulma.io/documentation/elements/icon/
35
36
  * @see https://fontawesome.com/search?o=r&m=free
36
37
  */
37
- const Icon = React.forwardRef<HTMLElement, Props>(({ children, className, type = "fas", ...props }, ref) => {
38
+ const Icon: FC<Props> = ({ children, className, type = "fas", ref, ...props }) => {
38
39
  return (
39
40
  <span className={classNames(className, "icon")} aria-hidden="true" {...props} ref={ref}>
40
41
  <i
@@ -46,6 +47,6 @@ const Icon = React.forwardRef<HTMLElement, Props>(({ children, className, type =
46
47
  />
47
48
  </span>
48
49
  );
49
- });
50
+ };
50
51
 
51
52
  export default Icon;
@@ -23,20 +23,20 @@ import { useTranslation } from "react-i18next";
23
23
  import { DefaultValues, FieldValues } from "react-hook-form";
24
24
 
25
25
  type Props<T extends HalRepresentation> =
26
- // eslint-disable-next-line prettier/prettier
26
+ // eslint-disable-next-line prettier/prettier
27
27
  Omit<ComponentProps<typeof Form<T>>, "onSubmit" | "defaultValues" | "readOnly" | "successMessageFallback"> & {
28
- link: string;
29
- };
28
+ link: string;
29
+ };
30
30
 
31
31
  /**
32
32
  * @beta
33
33
  * @since 2.41.0
34
34
  */
35
35
  export function ConfigurationForm<T extends HalRepresentation & FieldValues>({
36
- link,
37
- children,
38
- ...formProps
39
- }: Props<T>) {
36
+ link,
37
+ children,
38
+ ...formProps
39
+ }: Props<T>) {
40
40
  const { initialConfiguration, isReadOnly, update, isLoading } = useConfigLink<T>(link);
41
41
  const [t] = useTranslation("commons", { keyPrefix: "form" });
42
42
 
@@ -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, { HTMLProps } from "react";
17
+ import React, { FC, HTMLProps, Ref } from "react";
18
18
  import classNames from "classnames";
19
19
 
20
- const FormRow = React.forwardRef<HTMLDivElement, HTMLProps<HTMLDivElement>>(
21
- ({ className, children, hidden, ...rest }, ref) =>
22
- hidden ? null : (
23
- <div ref={ref} className={classNames("columns", className)} {...rest}>
24
- {children}
25
- </div>
26
- )
27
- );
20
+ type Props = HTMLProps<HTMLDivElement> & { ref?: Ref<HTMLDivElement> };
21
+
22
+ const FormRow: FC<Props> = ({ className, children, hidden, ref, ...rest }) =>
23
+ hidden ? null : (
24
+ <div ref={ref} className={classNames("columns", className)} {...rest}>
25
+ {children}
26
+ </div>
27
+ );
28
28
 
29
29
  export default FormRow;
@@ -14,13 +14,17 @@
14
14
  * along with this program. If not, see https://www.gnu.org/licenses/.
15
15
  */
16
16
 
17
- import React, { HTMLProps } from "react";
17
+ import React, { HTMLProps, Ref, FC } from "react";
18
18
  import classNames from "classnames";
19
19
 
20
- const Control = React.forwardRef<HTMLDivElement, HTMLProps<HTMLDivElement>>(({ className, children, ...rest }, ref) => (
20
+ type ControlProps = HTMLProps<HTMLDivElement> & {
21
+ ref?: Ref<HTMLDivElement>;
22
+ };
23
+
24
+ const Control: FC<ControlProps> = ({ className, children, ref, ...rest }) => (
21
25
  <div className={classNames("control", className)} {...rest} ref={ref}>
22
26
  {children}
23
27
  </div>
24
- ));
28
+ );
25
29
 
26
30
  export default Control;
@@ -14,12 +14,13 @@
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, { HTMLAttributes, FC, Ref } from "react";
18
18
 
19
19
  interface Props extends HTMLAttributes<HTMLParagraphElement> {
20
20
  descriptionText: string;
21
21
  extendedDescriptionText: string;
22
22
  id?: string;
23
+ ref?: Ref<HTMLDetailsElement>;
23
24
  }
24
25
 
25
26
  /**
@@ -29,22 +30,20 @@ interface Props extends HTMLAttributes<HTMLParagraphElement> {
29
30
  * with an icon to toggle the visibility of the extended text.
30
31
  *
31
32
  * @param desription - The text content that will always be displayed.
32
- * @param extended - The text content that will be displayed after you toggle details.
33
+ * @param extendedDescriptionText - The text content that will be displayed after you toggle details.
33
34
  * @param id - Additional props to pass to the `<details>` element.
34
35
  * @param ref - A ref to the `<details>` element.
35
36
  *
36
37
  * @beta
37
38
  * @since 3.9.0
38
39
  */
39
- const ExpandableText = React.forwardRef<HTMLDetailsElement, Props>(
40
- ({ descriptionText, extendedDescriptionText, id }, ref) => {
41
- return (
42
- <details className="mb-2" id={id} ref={ref}>
43
- <summary>{descriptionText}</summary>
44
- <span>{extendedDescriptionText}</span>
45
- </details>
46
- );
47
- }
48
- );
40
+ const ExpandableText: FC<Props> = ({ descriptionText, extendedDescriptionText, id, ref }) => {
41
+ return (
42
+ <details className="mb-2" id={id} ref={ref}>
43
+ <summary>{descriptionText}</summary>
44
+ <span>{extendedDescriptionText}</span>
45
+ </details>
46
+ );
47
+ };
49
48
 
50
49
  export default ExpandableText;