@tui-cruises/mein-schiff-web-react-component-library 3.1.4 → 3.1.5
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [3.1.5](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v3.1.4...v3.1.5) (2025-12-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **ChoiceBox:** fix ChoiceBox active state (EC-2490) ([d9322fc](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/commit/d9322fc8526dd6d99e1bda989ea9722c5a778427))
|
|
11
|
+
|
|
5
12
|
### [3.1.4](https://bitbucket.org/yours_truly/tuic-mein-schiff-web-react-component-library/compare/v3.1.3...v3.1.4) (2025-12-09)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
|
@@ -25,21 +25,22 @@ export const ChoiceBox: FC<ChoiceBoxProps> = ({
|
|
|
25
25
|
...radioProps
|
|
26
26
|
}) => {
|
|
27
27
|
const [invalid, setInvalid] = useState(invalidProp);
|
|
28
|
-
|
|
28
|
+
const [active, setActive] = useState(radioProps.defaultChecked ?? false);
|
|
29
29
|
const radioId = id ?? `choicebox-${Math.random().toString(36).slice(2)}`;
|
|
30
30
|
|
|
31
31
|
const handleChange: RadioProps['onChange'] = e => {
|
|
32
|
-
|
|
33
|
-
if (
|
|
32
|
+
const checked = e.target.checked;
|
|
33
|
+
if (checked) {
|
|
34
34
|
setInvalid(false);
|
|
35
35
|
}
|
|
36
|
+
setActive(checked);
|
|
36
37
|
onChange?.(e);
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
const classList = twMerge(
|
|
40
41
|
'inline-flex w-full cursor-pointer rounded-md border border-stroke-secondary-20 bg-surface-white px-4 py-6 text-marine-high-emphasis',
|
|
41
42
|
'hover:border-stroke-primary-100 hover:shadow-[inset_0_0_0_2px_theme(colors.stroke.primary-100)]',
|
|
42
|
-
|
|
43
|
+
active &&
|
|
43
44
|
'border-stroke-primary-100 shadow-[inset_0_0_0_2px_theme(colors.stroke.primary-100)]',
|
|
44
45
|
invalid && 'border-stroke-error-100',
|
|
45
46
|
disabled &&
|
|
@@ -59,7 +60,6 @@ export const ChoiceBox: FC<ChoiceBoxProps> = ({
|
|
|
59
60
|
{...radioProps}
|
|
60
61
|
/>
|
|
61
62
|
</div>
|
|
62
|
-
|
|
63
63
|
<div className="flex flex-col gap-2 text-base">
|
|
64
64
|
<div className="font-semibold">{label}</div>
|
|
65
65
|
{copy && <div>{copy}</div>}
|