@carto/ps-react-ui 4.11.2 → 4.11.3

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.
@@ -103,11 +103,12 @@ export function Wrapper({
103
103
  const effectiveCollapsed = isControlled ? collapsed : internalCollapsed
104
104
  const handleAccordionToggle = useCallback(
105
105
  (_: unknown, expanded: boolean) => {
106
+ if (disabled) return
106
107
  const next = !expanded
107
108
  onCollapseChange?.(next)
108
109
  setInternalCollapsed(next)
109
110
  },
110
- [onCollapseChange],
111
+ [disabled, onCollapseChange],
111
112
  )
112
113
  const _labels = { ...DEFAULT_WRAPPER_LABELS, ...labels }
113
114
 
@@ -121,7 +122,6 @@ export function Wrapper({
121
122
  data-collapsed={effectiveCollapsed ? 'true' : undefined}
122
123
  expanded={!effectiveCollapsed}
123
124
  onChange={handleAccordionToggle}
124
- disabled={disabled}
125
125
  disableGutters
126
126
  elevation={0}
127
127
  variant={variant}
@@ -136,9 +136,12 @@ export function Wrapper({
136
136
  ) : null}
137
137
 
138
138
  <AccordionSummary
139
- expandIcon={<ExpandIcon fontSize='small' {...iconProps} />}
139
+ expandIcon={
140
+ disabled ? null : <ExpandIcon fontSize='small' {...iconProps} />
141
+ }
140
142
  aria-label={ariaLabel}
141
- sx={styles.summary}
143
+ aria-disabled={disabled || undefined}
144
+ sx={{ ...styles.summary, ...(disabled ? styles.summaryDisabled : null) }}
142
145
  >
143
146
  <SmartTooltip title={title}>
144
147
  {({ ref }) => (