Skip to content

Commit

Permalink
Minor changes to the check field
Browse files Browse the repository at this point in the history
  • Loading branch information
benmerckx committed Nov 2, 2023
1 parent 8c24335 commit 97635ff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
13 changes: 10 additions & 3 deletions src/input/check/CheckField.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ function CheckInput({state, field}: CheckInputProps) {
return (
<InputLabel
asLabel
label={label}
{...options}
label={options.label ? label : undefined}
focused={focus}
icon={IcRoundTextFields}
>
<HStack gap={8} style={{position: 'relative', display: 'inline-flex'}}>
<HStack
center
gap={10}
style={{position: 'relative', display: 'inline-flex'}}
>
<input
className={styles.root.input()}
type="checkbox"
Expand All @@ -51,7 +55,10 @@ function CheckInput({state, field}: CheckInputProps) {
/>
)}
</span>
<TextLabel label={label} className={styles.root.label()} />
<TextLabel
label={options.label ?? label}
className={styles.root.label()}
/>
</HStack>
</InputLabel>
)
Expand Down
5 changes: 1 addition & 4 deletions src/input/check/CheckField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ export interface CheckOptions extends FieldOptions {
export class CheckField extends Field.Scalar<boolean, CheckOptions> {}

/** Create a text field configuration */
export function check(
label: Label,
options: CheckOptions = {label}
): CheckField {
export function check(label: Label, options: CheckOptions = {}): CheckField {
return new CheckField({
hint: Hint.Boolean(),
label,
Expand Down
8 changes: 4 additions & 4 deletions src/input/check/CheckInput.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.root {
&-input {
accent-color: var(--alinea-accent);
accent-color: var(--alinea-button-background);
position: absolute;
width: 0;
height: 0;
Expand All @@ -10,10 +10,10 @@
&-checkmark {
cursor: pointer;
position: relative;
width: 24px;
height: 24px;
width: 16px;
height: 16px;
flex: 0 0 auto;
color: var(--alinea-accent);
color: var(--alinea-button-background);
background: var(--alinea-fields);
box-shadow: var(--alinea-fields-shadow);
border-radius: 4px;
Expand Down

0 comments on commit 97635ff

Please sign in to comment.