@innovaccer/design-system 2.13.1 → 2.13.2

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.
@@ -3,7 +3,7 @@ import { scrollIntoView, _isEqual, _isSelectAllPresent } from './utility';
3
3
  import { Popover, Checkbox, Button, Text, Input } from '@/index';
4
4
  import { PopoverProps } from '@/index.type';
5
5
  import DropdownButton, { TriggerProps } from './DropdownButton';
6
- import Option, { ClickEvent, OptionRendererProps, OptionSchema } from './option';
6
+ import Option, { OptionRendererProps, OptionSchema } from './option';
7
7
  import classNames from 'classnames';
8
8
  import Loading from './Loading';
9
9
  import { BaseProps, extractBaseProps } from '@/utils/types';
@@ -322,7 +322,7 @@ const DropdownList = (props: OptionsProps) => {
322
322
 
323
323
  const SelectAllClass = classNames(
324
324
  {
325
- ['Option-checkbox']: !selected,
325
+ ['Option-checkbox']: true,
326
326
  ['Option-checkbox--active']: cursor === 0,
327
327
  ['OptionWrapper']: true,
328
328
  },
@@ -347,10 +347,6 @@ const DropdownList = (props: OptionsProps) => {
347
347
 
348
348
  const optionClickHandler = (item: any) => {
349
349
  props.onOptionSelect(item);
350
- if (withCheckbox) {
351
- const optionIsSelected = tempSelected.findIndex((option) => option.value === item.value) !== -1;
352
- props.onSelect(item, !optionIsSelected);
353
- }
354
350
  dropdownTriggerRef.current?.focus();
355
351
  };
356
352
 
@@ -512,11 +508,7 @@ const DropdownList = (props: OptionsProps) => {
512
508
  active={active}
513
509
  checkboxes={withCheckbox}
514
510
  menu={menu}
515
- onClick={(e: ClickEvent) => {
516
- e.preventDefault();
517
- e.stopPropagation();
518
- optionClickHandler(item);
519
- }}
511
+ onClick={() => optionClickHandler(item)}
520
512
  onChange={(e) => props.onSelect(item, e.target.checked)}
521
513
  optionType={props.optionType}
522
514
  />
@@ -5,7 +5,7 @@ import { Text, MetaList } from '@/index';
5
5
  import { MetaListProps } from '@/index.type';
6
6
 
7
7
  const CheckboxOption = (props: OptionTypeProps) => {
8
- const { className, selected, optionData, onClickHandler, onChangeHandler, onUpdateActiveOption, dataTest } = props;
8
+ const { className, selected, optionData, onChangeHandler, onUpdateActiveOption, dataTest } = props;
9
9
  const { subInfo, label, disabled } = optionData;
10
10
 
11
11
  const renderSubInfo = (subInfo: string | MetaListProps) => {
@@ -39,19 +39,12 @@ const CheckboxOption = (props: OptionTypeProps) => {
39
39
  };
40
40
 
41
41
  return (
42
- //eslint-disable-next-line
43
- <div
44
- onClick={onClickHandler}
45
- className={className}
46
- onMouseEnter={onUpdateActiveOption}
47
- data-test={dataTest}
48
- data-disabled={disabled}
49
- >
42
+ <div className={className} onMouseEnter={onUpdateActiveOption} data-test={dataTest} data-disabled={disabled}>
50
43
  <Checkbox
51
- onChange={onChangeHandler}
52
44
  label={label}
53
45
  disabled={disabled}
54
46
  checked={selected}
47
+ onChange={onChangeHandler}
55
48
  tabIndex={-1}
56
49
  className={`OptionCheckbox ${subInfo ? 'pb-0' : ''}`}
57
50
  data-test={`${dataTest}--Checkbox`}
@@ -66,7 +66,7 @@ interface OptionProps extends OptionRendererProps {
66
66
  index: number;
67
67
  active?: boolean;
68
68
  menu?: boolean;
69
- onClick?: (event: ClickEvent) => void;
69
+ onClick?: () => void;
70
70
  onChange?: (event: ChangeEvent) => void;
71
71
  updateActiveOption?: (index: number) => void;
72
72
  }
@@ -94,7 +94,7 @@ const Option = (props: OptionProps) => {
94
94
  });
95
95
 
96
96
  const CheckboxClassName = classNames({
97
- ['Option-checkbox']: !selected,
97
+ ['Option-checkbox']: true,
98
98
  ['Option-checkbox--active']: active,
99
99
  ['OptionWrapper']: true,
100
100
  });
@@ -119,7 +119,7 @@ const Option = (props: OptionProps) => {
119
119
  e.stopPropagation();
120
120
  if (disabled) return;
121
121
 
122
- if (onClick) onClick(e);
122
+ if (onClick) onClick();
123
123
  };
124
124
 
125
125
  const onChangeHandler = (e: ChangeEvent) => {
@@ -2155,14 +2155,6 @@ body {
2155
2155
  padding-right: var(--spacing-l);
2156
2156
  }
2157
2157
 
2158
- .Option:active {
2159
- background-color: var(--jal-lighter);
2160
- }
2161
-
2162
- .Option > .Checkbox-input {
2163
- background-color: var(--white);
2164
- }
2165
-
2166
2158
  .OptionCheckbox {
2167
2159
  width: 100%;
2168
2160
  padding-left: var(--spacing-l);
@@ -2170,18 +2162,6 @@ body {
2170
2162
  padding-bottom: 6px;
2171
2163
  }
2172
2164
 
2173
- .Option-checkbox > .OptionCheckbox > .Checkbox-outerWrapper {
2174
- background-color: var(--shadow-0);
2175
- }
2176
-
2177
- .Option-checkbox:hover > .OptionCheckbox > .Checkbox-outerWrapper > .Checkbox-input ~ .Checkbox-wrapper {
2178
- border: var(--spacing-xs) solid var(--stone-dark);
2179
- }
2180
-
2181
- .Option-checkbox:active > .OptionCheckbox > .Checkbox-outerWrapper > .Checkbox-input ~ .Checkbox-wrapper {
2182
- background-color: var(--secondary-light);
2183
- }
2184
-
2185
2165
  .Option--active,
2186
2166
  .Option-checkbox--active {
2187
2167
  background-color: var(--secondary-lightest);