@codeleap/web 3.23.3 → 3.23.5

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": "@codeleap/web",
3
- "version": "3.23.3",
3
+ "version": "3.23.5",
4
4
  "main": "src/index.ts",
5
5
  "repository": {
6
6
  "url": "https://github.com/codeleap-uk/internal-libs-monorepo.git",
@@ -22,6 +22,11 @@ const ItemOption = (props: OptionProps) => {
22
22
  canSelectMultiple,
23
23
  } = props
24
24
 
25
+ let buttonProps = {
26
+ ...item?.itemProps,
27
+ ...option?.itemProps,
28
+ }
29
+
25
30
  const isItemSelected = useMemo(() => {
26
31
  if (item?.options && selectedItems) {
27
32
  if (canSelectMultiple) {
@@ -34,9 +39,11 @@ const ItemOption = (props: OptionProps) => {
34
39
  }
35
40
  }, [item?.options, option, selectedItems, item?.id, canSelectMultiple])
36
41
 
37
- const buttonProps = {
38
- ...item?.itemProps,
39
- ...option?.itemProps,
42
+ if (isItemSelected) {
43
+ buttonProps = {
44
+ ...buttonProps,
45
+ ...item?.selectedItemProps,
46
+ }
40
47
  }
41
48
 
42
49
  return (
@@ -23,6 +23,7 @@ export type ItemProps = {
23
23
  showDescriptionLabel?: boolean
24
24
  options?: ItemOptionProps[]
25
25
  itemProps?: Omit<PropsOf<typeof Button>, 'debugName'>
26
+ selectedItemProps?: Omit<PropsOf<typeof Button>, 'debugName'>
26
27
  }
27
28
 
28
29
  export type onSelectItemProps = {