armtek-uikit-react 1.0.105 → 1.0.106

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.
@@ -157,6 +157,7 @@
157
157
  }
158
158
  &.checkbox_secondary{
159
159
  &:before{
160
+ background: transparent;
160
161
  border-color: $color-secondary;
161
162
  }
162
163
  &:after{
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"armtek-uikit-react","version":"1.0.105","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
1
+ {"name":"armtek-uikit-react","version":"1.0.106","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
@@ -1,6 +1,6 @@
1
1
  import { InputHTMLAttributes, ReactNode } from 'react';
2
2
  import { ColorType, SizeType, ThemeType, VariantType } from '../../../types/theme';
3
- type BaseCheckboxPropsType = {
3
+ type BaseCheckboxProps = {
4
4
  label?: string | ReactNode;
5
5
  size?: Exclude<SizeType, 'extraLarge'>;
6
6
  color?: ColorType;
@@ -8,6 +8,6 @@ type BaseCheckboxPropsType = {
8
8
  variant?: Exclude<VariantType, 'transparent'>;
9
9
  intermediate?: boolean;
10
10
  };
11
- export type CheckboxPropsType = BaseCheckboxPropsType & Omit<InputHTMLAttributes<any>, 'size'>;
12
- declare const Checkbox: (props: CheckboxPropsType) => import("react/jsx-runtime").JSX.Element;
11
+ export type CheckboxProps = BaseCheckboxProps & Omit<InputHTMLAttributes<any>, 'size'>;
12
+ declare const Checkbox: (props: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
13
13
  export default Checkbox;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
- import clsx from 'clsx';
4
3
  import { useState } from 'react';
4
+ import clsx from 'clsx';
5
5
  import css from "./Checkbox.module.scss";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -22,34 +22,31 @@ const Checkbox = props => {
22
22
  ...inputProps
23
23
  } = props;
24
24
  let [checked, setChecked] = useState(!!props.defaultChecked);
25
- const handleClick = e => {
26
- if (!inputProps.disabled) {
27
- if (inputProps.checked === undefined) setChecked(prev => !prev);
28
- if (onChange) onChange(e);
29
- }
25
+ const handleChange = e => {
26
+ if (inputProps.checked === undefined) setChecked(prev => !prev);
27
+ if (onChange) onChange(e);
30
28
  };
31
29
  return /*#__PURE__*/_jsx(_Fragment, {
32
- children: /*#__PURE__*/_jsxs("div", {
30
+ children: /*#__PURE__*/_jsx("div", {
33
31
  className: clsx(css.checkbox, className),
34
- children: [/*#__PURE__*/_jsx("input", {
35
- ...inputProps,
36
- className: clsx(css.checkbox__input, {
37
- '_checked': !!inputProps.checked
38
- }),
39
- onChange: onChange,
40
- type: props.type || 'checkbox'
41
- }), /*#__PURE__*/_jsx("label", {
42
- onClick: handleClick,
32
+ children: /*#__PURE__*/_jsxs("label", {
43
33
  className: clsx(css.checkbox__label, css['checkbox_' + size], css['checkbox_' + variant], css['checkbox_' + color], {
44
34
  [css.checkbox__label_checked]: inputProps.checked !== undefined ? inputProps.checked : checked,
45
35
  [css.checkbox__label_intermediate]: !!intermediate,
46
36
  [css.checkbox__label_disabled]: !!inputProps.disabled
47
37
  }),
48
- children: label && /*#__PURE__*/_jsx("span", {
38
+ children: [/*#__PURE__*/_jsx("input", {
39
+ ...inputProps,
40
+ className: clsx(css.checkbox__input, {
41
+ '_checked': !!inputProps.checked
42
+ }),
43
+ onChange: handleChange,
44
+ type: props.type || 'checkbox'
45
+ }), label && /*#__PURE__*/_jsx("span", {
49
46
  className: css.checkbox__text,
50
47
  children: label
51
- })
52
- })]
48
+ })]
49
+ })
53
50
  })
54
51
  });
55
52
  };
@@ -1,3 +1,3 @@
1
- import { CheckboxPropsType } from '../Checkbox/Checkbox';
2
- declare const Radio: (props: CheckboxPropsType) => import("react/jsx-runtime").JSX.Element;
1
+ import { CheckboxProps } from '../Checkbox/Checkbox';
2
+ declare const Radio: (props: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Radio;