From 68aaa036c8ef73b630e3d9fe3a644c7f17a10c9a Mon Sep 17 00:00:00 2001 From: bhenique Date: Mon, 2 Sep 2024 15:33:35 +0200 Subject: [PATCH] feat: remove qwik hack for Input/Checkbox/Radio --- packages/lib/package.json | 2 +- .../lib/src/components/Checkbox/Checkbox.tsx | 16 +++++++------- packages/lib/src/components/Input/Input.tsx | 21 ++++++------------- packages/lib/src/components/Radio/Radio.tsx | 20 ++++++++++++------ 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/packages/lib/package.json b/packages/lib/package.json index 101d5bc8..e5679790 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -1,6 +1,6 @@ { "name": "flowbite-qwik", - "version": "0.36.1", + "version": "0.36.2", "description": "Unofficial Qwik components built for Flowbite and Tailwind CSS", "keywords": [ "design-system", diff --git a/packages/lib/src/components/Checkbox/Checkbox.tsx b/packages/lib/src/components/Checkbox/Checkbox.tsx index 321af18d..c4dd2307 100644 --- a/packages/lib/src/components/Checkbox/Checkbox.tsx +++ b/packages/lib/src/components/Checkbox/Checkbox.tsx @@ -1,4 +1,4 @@ -import { QRL, Slot, component$, useComputed$, PropsOf, JSXChildren } from '@builder.io/qwik' +import { QRL, Slot, component$, useComputed$, PropsOf, JSXChildren, useSignal, useTask$ } from '@builder.io/qwik' import clsx from 'clsx' import { useCheckboxClasses } from './composables/use-checkbox-classes' import { twMerge } from 'tailwind-merge' @@ -15,19 +15,19 @@ export const Checkbox = component$(({ color, class: classNames, o const internalColor = useComputed$(() => color) const { checkboxClasses, labelClasses } = useCheckboxClasses(internalColor) + const checked = useSignal(Boolean(props.checked)) + useTask$(({ track }) => { + const innerChecked = track(() => props.checked) + checked.value = Boolean(innerChecked) + }) + return (