@scm-manager/ui-core 3.7.2-20250123-163137 → 3.7.3

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.
@@ -1,2 +1,2 @@
1
- @scm-manager/ui-core:typecheck: cache hit, replaying output da6c5a5f5d08b764
1
+ @scm-manager/ui-core:typecheck: cache hit, replaying output 466dc99013690e25
2
2
  @scm-manager/ui-core:typecheck: $ tsc
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-manager/ui-core",
3
- "version": "3.7.2-20250123-163137",
3
+ "version": "3.7.3",
4
4
  "main": "./src/index.ts",
5
5
  "license": "AGPL-3.0-only",
6
6
  "scripts": {
@@ -20,7 +20,7 @@
20
20
  "styled-components": "5"
21
21
  },
22
22
  "dependencies": {
23
- "@scm-manager/ui-api": "3.7.2-20250123-163137",
23
+ "@scm-manager/ui-api": "3.7.3",
24
24
  "@radix-ui/react-radio-group": "^1.1.3",
25
25
  "@radix-ui/react-slot": "^1.0.1",
26
26
  "@radix-ui/react-visually-hidden": "^1.0.3",
@@ -37,7 +37,7 @@
37
37
  "@scm-manager/eslint-config": "^2.17.0",
38
38
  "@scm-manager/tsconfig": "^2.12.0",
39
39
  "@scm-manager/babel-preset": "^2.13.1",
40
- "@scm-manager/ui-types": "3.7.2-20250123-163137",
40
+ "@scm-manager/ui-types": "3.7.3",
41
41
  "@types/mousetrap": "1.6.5",
42
42
  "@testing-library/react-hooks": "8.0.1",
43
43
  "@testing-library/react": "12.1.5",
@@ -17,7 +17,7 @@
17
17
  import React, { FC, useCallback, useEffect, useState } from "react";
18
18
  import { DeepPartial, SubmitHandler, useForm, UseFormReturn } from "react-hook-form";
19
19
  import { ErrorNotification } from "../notifications";
20
- import { Level } from "../misc";
20
+ import { Level } from "../misc";
21
21
  import { ScmFormContextProvider } from "./ScmFormContext";
22
22
  import { useTranslation } from "react-i18next";
23
23
  import { Button } from "../buttons";
@@ -135,10 +135,10 @@ function Form<FormType extends Record<string, unknown>, DefaultValues extends Fo
135
135
 
136
136
  // See https://react-hook-form.com/api/useform/reset/
137
137
  useEffect(() => {
138
- if (isSubmitSuccessful && !error) {
138
+ if (isSubmitSuccessful) {
139
139
  setShowSuccessNotification(true);
140
140
  }
141
- }, [isSubmitSuccessful, error]);
141
+ }, [isSubmitSuccessful]);
142
142
 
143
143
  useEffect(() => reset(defaultValues as never), [defaultValues, reset]);
144
144
 
@@ -33,7 +33,6 @@ const StyledLabel = styled.label`
33
33
  type InputFieldProps = {
34
34
  label: string;
35
35
  helpText?: string;
36
- descriptionText?: string;
37
36
  testId?: string;
38
37
  labelClassName?: string;
39
38
  } & Omit<InputHTMLAttributes<HTMLInputElement>, "type">;
@@ -46,7 +45,6 @@ const Checkbox = React.forwardRef<HTMLInputElement, InputFieldProps>(
46
45
  {
47
46
  readOnly,
48
47
  label,
49
- descriptionText,
50
48
  className,
51
49
  labelClassName,
52
50
  value,
@@ -59,63 +57,54 @@ const Checkbox = React.forwardRef<HTMLInputElement, InputFieldProps>(
59
57
  ...props
60
58
  },
61
59
  ref
62
- ) => {
63
- const descriptionId = descriptionText ? `checkbox-description-${name}` : undefined;
64
- return (
65
- <>
66
- {descriptionText ? <p id={descriptionId}>{descriptionText}</p> : null}
67
- <StyledLabel
68
- className={classNames("checkbox is-align-items-center", labelClassName)}
69
- // @ts-ignore bulma uses the disabled attribute on labels, although it is not part of the html spec
70
- disabled={readOnly || props.disabled}
71
- >
72
- {readOnly ? (
73
- <>
74
- <input
75
- type="hidden"
76
- name={name}
77
- value={value}
78
- defaultValue={defaultValue}
79
- checked={checked}
80
- defaultChecked={defaultChecked}
81
- aria-describedby={descriptionId}
82
- readOnly
83
- />
84
- <StyledInput
85
- type="checkbox"
86
- className={classNames("m-3", className)}
87
- ref={ref}
88
- value={value}
89
- defaultValue={defaultValue}
90
- checked={checked}
91
- defaultChecked={defaultChecked}
92
- aria-describedby={descriptionId}
93
- {...props}
94
- {...createAttributesForTesting(testId)}
95
- disabled
96
- />
97
- </>
98
- ) : (
99
- <StyledInput
100
- type="checkbox"
101
- className={classNames("m-3", className)}
102
- ref={ref}
103
- name={name}
104
- value={value}
105
- defaultValue={defaultValue}
106
- checked={checked}
107
- defaultChecked={defaultChecked}
108
- aria-describedby={descriptionId}
109
- {...props}
110
- {...createAttributesForTesting(testId)}
111
- />
112
- )}
60
+ ) => (
61
+ <StyledLabel
62
+ className={classNames("checkbox is-align-items-center", labelClassName)}
63
+ // @ts-ignore bulma uses the disabled attribute on labels, although it is not part of the html spec
64
+ disabled={readOnly || props.disabled}
65
+ >
66
+ {readOnly ? (
67
+ <>
68
+ <input
69
+ type="hidden"
70
+ name={name}
71
+ value={value}
72
+ defaultValue={defaultValue}
73
+ checked={checked}
74
+ defaultChecked={defaultChecked}
75
+ readOnly
76
+ />
77
+ <StyledInput
78
+ type="checkbox"
79
+ className={classNames("m-3", className)}
80
+ ref={ref}
81
+ value={value}
82
+ defaultValue={defaultValue}
83
+ checked={checked}
84
+ defaultChecked={defaultChecked}
85
+ {...props}
86
+ {...createAttributesForTesting(testId)}
87
+ disabled
88
+ />
89
+ </>
90
+ ) : (
91
+ <StyledInput
92
+ type="checkbox"
93
+ className={classNames("m-3", className)}
94
+ ref={ref}
95
+ name={name}
96
+ value={value}
97
+ defaultValue={defaultValue}
98
+ checked={checked}
99
+ defaultChecked={defaultChecked}
100
+ {...props}
101
+ {...createAttributesForTesting(testId)}
102
+ />
103
+ )}
113
104
 
114
- {label}
115
- {helpText ? <Help className="ml-1" text={helpText} /> : null}
116
- </StyledLabel>
117
- </>
118
- );
119
- }
105
+ {label}
106
+ {helpText ? <Help className="ml-1" text={helpText} /> : null}
107
+ </StyledLabel>
108
+ )
120
109
  );
121
110
  export default Checkbox;
@@ -35,7 +35,6 @@ function ControlledInputField<T extends Record<string, unknown>>({
35
35
  name,
36
36
  label,
37
37
  helpText,
38
- descriptionText,
39
38
  rules,
40
39
  testId,
41
40
  defaultChecked,
@@ -49,8 +48,6 @@ function ControlledInputField<T extends Record<string, unknown>>({
49
48
  const prefixedNameWithoutIndices = prefixWithoutIndices(nameWithPrefix);
50
49
  const labelTranslation = label || t(`${prefixedNameWithoutIndices}.label`) || "";
51
50
  const helpTextTranslation = helpText || t(`${prefixedNameWithoutIndices}.helpText`);
52
- const descriptionTextTranslation = descriptionText || t(`${prefixedNameWithoutIndices}.descriptionText`);
53
-
54
51
  return (
55
52
  <Controller
56
53
  control={control}
@@ -67,7 +64,6 @@ function ControlledInputField<T extends Record<string, unknown>>({
67
64
  {...field}
68
65
  label={labelTranslation}
69
66
  helpText={helpTextTranslation}
70
- descriptionText={descriptionTextTranslation}
71
67
  testId={testId ?? `checkbox-${nameWithPrefix}`}
72
68
  />
73
69
  )}
@@ -28,6 +28,7 @@ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
28
28
  import { useTranslation } from "react-i18next";
29
29
  import { withForwardRef } from "../helpers";
30
30
  import { Option } from "@scm-manager/ui-types";
31
+ import { waitForRestartAfter } from "@scm-manager/ui-api";
31
32
 
32
33
  const StyledChipInput: typeof ChipInput = styled(ChipInput)`
33
34
  min-height: 40px;
@@ -35,7 +35,6 @@ function ControlledInputField<T extends Record<string, unknown>>({
35
35
  name,
36
36
  label,
37
37
  helpText,
38
- descriptionText,
39
38
  rules,
40
39
  testId,
41
40
  defaultValue,
@@ -49,8 +48,6 @@ function ControlledInputField<T extends Record<string, unknown>>({
49
48
  const prefixedNameWithoutIndices = prefixWithoutIndices(nameWithPrefix);
50
49
  const labelTranslation = label || t(`${prefixedNameWithoutIndices}.label`) || "";
51
50
  const helpTextTranslation = helpText || t(`${prefixedNameWithoutIndices}.helpText`);
52
- const descriptionTextTranslation = descriptionText || t(`${prefixedNameWithoutIndices}.descriptionText`);
53
-
54
51
  return (
55
52
  <Controller
56
53
  control={control}
@@ -67,7 +64,6 @@ function ControlledInputField<T extends Record<string, unknown>>({
67
64
  form={formId}
68
65
  label={labelTranslation}
69
66
  helpText={helpTextTranslation}
70
- descriptionText={descriptionTextTranslation}
71
67
  error={
72
68
  fieldState.error
73
69
  ? fieldState.error.message || t(`${prefixedNameWithoutIndices}.error.${fieldState.error.type}`)
@@ -26,7 +26,6 @@ import { useAriaId } from "../../helpers";
26
26
  type InputFieldProps = {
27
27
  label: string;
28
28
  helpText?: string;
29
- descriptionText?: string;
30
29
  error?: string;
31
30
  } & React.ComponentProps<typeof Input>;
32
31
 
@@ -34,9 +33,8 @@ type InputFieldProps = {
34
33
  * @see https://bulma.io/documentation/form/input/
35
34
  */
36
35
  const InputField = React.forwardRef<HTMLInputElement, InputFieldProps>(
37
- ({ name, label, helpText, descriptionText, error, className, id, ...props }, ref) => {
36
+ ({ label, helpText, error, className, id, ...props }, ref) => {
38
37
  const inputId = useAriaId(id ?? props.testId);
39
- const descriptionId = descriptionText ? `input-description-${name}` : undefined;
40
38
  const variant = error ? "danger" : undefined;
41
39
  return (
42
40
  <Field className={className}>
@@ -44,13 +42,8 @@ const InputField = React.forwardRef<HTMLInputElement, InputFieldProps>(
44
42
  {label}
45
43
  {helpText ? <Help className="ml-1" text={helpText} /> : null}
46
44
  </Label>
47
- {descriptionText ? (
48
- <p className="mb-2" id={descriptionId}>
49
- {descriptionText}
50
- </p>
51
- ) : null}
52
45
  <Control>
53
- <Input variant={variant} ref={ref} id={inputId} aria-describedby={descriptionId} {...props}></Input>
46
+ <Input variant={variant} ref={ref} id={inputId} {...props}></Input>
54
47
  </Control>
55
48
  {error ? <FieldMessage variant={variant}>{error}</FieldMessage> : null}
56
49
  </Field>