@megha-ui/react 1.2.201 → 1.2.202

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.
@@ -12,6 +12,7 @@ interface RadioInputProps {
12
12
  label?: string;
13
13
  value?: string;
14
14
  disabled?: boolean;
15
+ id?: string;
15
16
  }
16
17
  declare const Checkbox: React.FC<RadioInputProps>;
17
18
  export default Checkbox;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef } from "react";
3
- const Checkbox = ({ onChange, disabled, wrapperClass, name, width, noLabel, label, value, labelMargin, style, indeterminate, selected = false, }) => {
3
+ const Checkbox = ({ onChange, disabled, wrapperClass, name, width, noLabel, label, value, labelMargin, style, indeterminate, selected = false, id }) => {
4
4
  const checkboxWrapper = useRef(null);
5
5
  useEffect(() => {
6
6
  let checkbox = null;
@@ -16,10 +16,10 @@ const Checkbox = ({ onChange, disabled, wrapperClass, name, width, noLabel, labe
16
16
  }, [indeterminate]);
17
17
  return (_jsx("div", { ref: checkboxWrapper, className: wrapperClass, style: style, children: _jsxs("label", { style: {
18
18
  width: width,
19
- display: "inline-flex",
19
+ display: "flex",
20
20
  alignItems: "center",
21
21
  margin: labelMargin,
22
- }, children: [_jsx("input", { type: "checkbox", id: "checkbox", name: name, value: value, checked: selected, disabled: disabled, onChange: (event) => onChange(event.target.checked) }), _jsx("span", { style: {
22
+ }, children: [_jsx("input", { type: "checkbox", className: "checkbox", id: id, name: name, value: value, checked: selected, disabled: disabled, onChange: (event) => onChange(event.target.checked) }), _jsx("span", { style: {
23
23
  marginRight: !noLabel ? "0.5rem" : "",
24
24
  display: "flex",
25
25
  alignItems: "center",
@@ -351,7 +351,7 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
351
351
  if (!option.disabled) {
352
352
  setHighlightIndex(index);
353
353
  }
354
- }, children: [isMultiple && (_jsx("div", { style: { marginLeft: "0.5rem" }, children: _jsx(Checkbox, { selected: intermediateValues.includes(option.value), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }) })), _jsxs("div", { style: {
354
+ }, children: [isMultiple && (_jsx("div", { style: { marginRight: "0.5rem" }, children: _jsx(Checkbox, { selected: intermediateValues.includes(option.value), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }) })), _jsxs("div", { style: {
355
355
  display: "flex",
356
356
  alignItems: "start",
357
357
  width: "100%",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.201",
3
+ "version": "1.2.202",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",