mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-29 18:03:45 +08:00
feat: create simple checkbox
This commit is contained in:
@@ -27,8 +27,6 @@
|
||||
cursor: not-allowed;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
@import '../index.css';
|
||||
|
||||
.checkbox {
|
||||
accent-color: var(--checkbox-background);
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.checkbox-label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: --spacing(1);
|
||||
margin-left: 0.5rem;
|
||||
color: var(--checkbox-foreground);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Checkbox as AriaCheckbox, type CheckboxProps } from '@ariakit/react';
|
||||
import './Checkbox.css';
|
||||
|
||||
interface UIKitCheckboxProps extends CheckboxProps {
|
||||
children?: React.ReactNode;
|
||||
Label?: React.ReactNode;
|
||||
}
|
||||
|
||||
export function Checkbox({ className, children, ...props }: CheckboxProps) {
|
||||
return (
|
||||
<label className="checkbox-label">
|
||||
<AriaCheckbox className={className ?? '' + ' ' + 'checkbox'} {...props} />
|
||||
{children}
|
||||
</label>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { Checkbox } from './Checkbox.js';
|
||||
|
||||
export const CheckboxStory = () => <Checkbox> Checkbox </Checkbox>;
|
||||
@@ -7,4 +7,5 @@
|
||||
*/
|
||||
import './index.css';
|
||||
|
||||
export { Button } from './Button/Button.js';
|
||||
export { Button } from './Button/Button.js';
|
||||
export { Checkbox } from './Checkbox/Checkbox.js';
|
||||
Reference in New Issue
Block a user