forked from external-repos/squoosh
* Improve .gitattributes * Add disabled checkbox style * Update Makefile * Update jxl_enc.cpp * add -O3 flag to skia compilation for optimization's sake * Bump libjxl revision to 9f544641ec83f6abd9da598bdd08178ee8a003e0 Change use of EncodeFile from `EncodeFile(cparams, &io, &passes_enc_state, &bytes, /*aux=*/nullptr, pool_ptr)` to `EncodeFile(cparams, &io, &passes_enc_state, &bytes, /*cms=*/nullptr, /*aux=*/jxl::GetJxlCms(), pool_ptr)` * JPEG XL: Add lossy Modular option Co-authored-by: CanadianBaconBoi <beamconnor@gmail.com> Co-authored-by: CanadianBaconBoi <bc.bacon.bits@gmail.com>
28 lines
861 B
TypeScript
28 lines
861 B
TypeScript
import { h, Component } from 'preact';
|
|
import * as style from './style.css';
|
|
import 'add-css:./style.css';
|
|
import { UncheckedIcon, CheckedIcon } from '../../../icons';
|
|
|
|
interface Props extends preact.JSX.HTMLAttributes {}
|
|
interface State {}
|
|
|
|
export default class Checkbox extends Component<Props, State> {
|
|
render(props: Props) {
|
|
return (
|
|
<div class={style.checkbox}>
|
|
{props.checked ? (
|
|
props.disabled ? (
|
|
<CheckedIcon class={`${style.icon} ${style.disabled}`} />
|
|
) : (
|
|
<CheckedIcon class={`${style.icon} ${style.checked}`} />
|
|
)
|
|
) : (
|
|
<UncheckedIcon class={style.icon} />
|
|
)}
|
|
{/* @ts-ignore - TS bug https://github.com/microsoft/TypeScript/issues/16019 */}
|
|
<input class={style.realCheckbox} type="checkbox" {...props} />
|
|
</div>
|
|
);
|
|
}
|
|
}
|