@sikka/hawa 0.0.220 → 0.0.221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.220",
3
+ "version": "0.0.221",
4
4
  "description": "SaaS Oriented UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -7,16 +7,17 @@ type TCheckBoxTypes = {
7
7
  helperText?: any
8
8
  id: string
9
9
  onChange?: (e) => void
10
+ val?: boolean
10
11
  }
11
12
 
12
13
  export const HawaCheckbox: React.FunctionComponent<TCheckBoxTypes> = (
13
14
  props
14
15
  ) => {
15
- const [val, setVal] = useState(false)
16
+ const [isChecked, setVal] = useState(props.val)
16
17
 
17
18
  useEffect(() => {
18
- props.onChange(val)
19
- }, [val])
19
+ props.onChange(isChecked)
20
+ }, [isChecked])
20
21
  return (
21
22
  <div
22
23
  className={clsx(
@@ -27,7 +28,7 @@ export const HawaCheckbox: React.FunctionComponent<TCheckBoxTypes> = (
27
28
  >
28
29
  <input
29
30
  type="checkbox"
30
- checked={val}
31
+ checked={isChecked}
31
32
  onChange={(e) => setVal(e.target.checked)}
32
33
  id={props.id}
33
34
  aria-label={props.label}
@@ -36,7 +37,7 @@ export const HawaCheckbox: React.FunctionComponent<TCheckBoxTypes> = (
36
37
  {(props.label || props.helperText) && (
37
38
  <div
38
39
  className=" flex cursor-pointer flex-col py-2"
39
- onClick={(e) => setVal(!val)}
40
+ onClick={(e) => setVal(!isChecked)}
40
41
  >
41
42
  {props.label && (
42
43
  <label className="mx-2 text-sm font-medium text-gray-900 dark:text-gray-300">