Skip to content

Commit a9ff133

Browse files
committed
fix: correct cursor for checkbox, spacing between checkboxes and disable border for spacer
1 parent 64c0c6e commit a9ff133

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

src/components/ui/form/ui/blocks/checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function CheckboxFabric(props: {
110110
return (
111111
<div className="w-full">
112112
<label
113-
className="relative inline-flex min-h-5 select-none items-center"
113+
className="relative inline-flex min-h-5 cursor-pointer select-none items-center"
114114
>
115115
<input
116116
className="absolute size-0 cursor-pointer opacity-0"

src/components/ui/form/ui/blocks/checkboxes.tsx

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,34 @@ function CheckboxesFabric(props: {
2121
<>
2222
{props.checkboxes.map(
2323
(checkbox, index) => (props.view === 'preview' || checkbox.label) && (
24-
<CheckboxFabric
25-
key={checkbox.id || index}
26-
label={checkbox.label}
27-
description={checkbox.description}
28-
required={checkbox.required}
29-
disabled={checkbox.disabled}
30-
readOnly={checkbox.readOnly}
31-
error={checkbox.error}
32-
tabIndex={checkbox.tabIndex || props.tabIndex}
33-
tabSubmit={index + 1 === props.checkboxes.length}
34-
value={checkbox.value}
35-
ariaDescribedBy={props.ariaDescribedBy}
36-
onChange={checkbox.onChange}
37-
onAutoFocus={(index === 0 && props.onAutoFocus) || undefined}
38-
onFocus={props.onFocus}
39-
onBlur={props.onBlur}
40-
onSubmit={props.onSubmit}
41-
onCancel={(index === 0 && props.onCancel) || undefined}
42-
/>
24+
<>
25+
<CheckboxFabric
26+
key={checkbox.id || index}
27+
label={checkbox.label}
28+
description={checkbox.description}
29+
required={checkbox.required}
30+
disabled={checkbox.disabled}
31+
readOnly={checkbox.readOnly}
32+
error={checkbox.error}
33+
tabIndex={checkbox.tabIndex || props.tabIndex}
34+
tabSubmit={index + 1 === props.checkboxes.length}
35+
value={checkbox.value}
36+
ariaDescribedBy={props.ariaDescribedBy}
37+
onChange={checkbox.onChange}
38+
onAutoFocus={(index === 0 && props.onAutoFocus) || undefined}
39+
onFocus={props.onFocus}
40+
onBlur={props.onBlur}
41+
onSubmit={props.onSubmit}
42+
onCancel={(index === 0 && props.onCancel) || undefined}
43+
/>
44+
<hr className="my-2 border-none" />
45+
</>
4346
),
4447
)}
4548
</>
4649
);
4750
}
51+
4852
/* eslint-enable */
4953

5054
@tripetto({
@@ -58,6 +62,7 @@ export default class CheckboxesBlock extends Checkboxes implements IFormNodeBloc
5862
<>
5963
{props.name}
6064
{props.description}
65+
<hr className="mt-3 border-none" />
6166
<CheckboxesFabric
6267
checkboxes={this.checkboxes(props)}
6368
ariaDescribedBy={props.ariaDescribedBy}

src/components/ui/form/ui/blocks/spacer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IFormNodeBlock } from '@/components/ui/form/interfaces/block';
99
export default class SpacerBlock extends Spacer implements IFormNodeBlock {
1010
render() {
1111
return (
12-
<hr style={{ height: `${this.size}em` }} className="min-w-1" />
12+
<hr style={{ height: `${this.size}em` }} className="min-w-1 border-none" />
1313
);
1414
}
1515
}

0 commit comments

Comments
 (0)