Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Checkbox): simple width #5786

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,24 @@ import {
} from '@vkui-e2e/playground-helpers';
import { Checkbox, type CheckboxProps } from './Checkbox';

const baseRender = ({ children = 'label', ...restProps }: CheckboxProps) => (
<Checkbox {...restProps}>{children}</Checkbox>
);
const baseRender = (props: CheckboxProps) => <Checkbox {...props} />;

export const CheckboxPlayground = (props: ComponentPlaygroundProps) => {
return (
<ComponentPlayground
{...props}
propSets={[
{
children: ['label'],
checked: [false, true],
disabled: [undefined, true],
$adaptivity: 'y',
},
{
children: ['label'],
indeterminate: [true],
disabled: [undefined, true],
$adaptivity: 'y',
},
]}
>
Expand Down
48 changes: 32 additions & 16 deletions packages/vkui/src/components/Checkbox/Checkbox.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,28 @@
opacity: var(--vkui--opacity_disable_accessibility);
}

/**
* simple
*/

.Checkbox--simple {
display: flex;
justify-content: center;
align-items: center;
padding: 0;
border-radius: 50%;
width: var(--vkui--size_field_height--regular);
height: var(--vkui--size_field_height--regular);
}

.Checkbox--simple .Checkbox__content {
display: none;
}

.Checkbox--simple .Checkbox__icon {
margin: 0;
}

/**
* sizeY COMPACT
*/
Expand All @@ -104,6 +126,11 @@
min-height: var(--vkui--size_field_height--compact);
}

.Checkbox--sizeY-compact.Checkbox--simple {
width: var(--vkui--size_field_height--compact);
height: var(--vkui--size_field_height--compact);
}

.Checkbox--sizeY-compact .Checkbox__title {
margin-top: 8px;
}
Expand All @@ -122,6 +149,11 @@
min-height: var(--vkui--size_field_height--compact);
}

.Checkbox--sizeY-none.Checkbox--simple {
width: var(--vkui--size_field_height--compact);
height: var(--vkui--size_field_height--compact);
}

.Checkbox--sizeY-none .Checkbox__title {
margin-top: 8px;
}
Expand All @@ -134,19 +166,3 @@
margin-bottom: 8px;
}
}

.Checkbox--simple {
display: flex;
justify-content: center;
align-items: center;
padding: 0;
border-radius: 50%;
}

.Checkbox--simple .Checkbox__content {
display: none;
}

.Checkbox--simple .Checkbox__icon {
margin: 0;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading