Remove backwards compatibility
This commit is contained in:
@@ -14,8 +14,7 @@ const MultiSelectContainer = memo<MultiSelectProps>(
|
||||
options,
|
||||
onChipClick,
|
||||
onAddClick,
|
||||
showAddButton: showAddButtonProp,
|
||||
addButton: addButtonProp,
|
||||
addButton: addButtonProp = true,
|
||||
addButtonText = "Add organization type",
|
||||
formHeader = true,
|
||||
onCustomChipConfirm,
|
||||
@@ -24,8 +23,6 @@ const MultiSelectContainer = memo<MultiSelectProps>(
|
||||
}) => {
|
||||
const size = normalizeMultiSelectSize(sizeProp);
|
||||
const palette = normalizeChipPalette(paletteProp);
|
||||
// Backward compatibility: if addButton is provided, use it; otherwise use showAddButton
|
||||
const showAddButton = addButtonProp !== undefined ? addButtonProp : (showAddButtonProp !== undefined ? showAddButtonProp : true);
|
||||
|
||||
return (
|
||||
<MultiSelectView
|
||||
@@ -36,7 +33,7 @@ const MultiSelectContainer = memo<MultiSelectProps>(
|
||||
options={options}
|
||||
onChipClick={onChipClick}
|
||||
onAddClick={onAddClick}
|
||||
showAddButton={showAddButton}
|
||||
addButton={addButtonProp}
|
||||
addButtonText={addButtonText}
|
||||
formHeader={formHeader}
|
||||
onCustomChipConfirm={onCustomChipConfirm}
|
||||
|
||||
@@ -39,10 +39,6 @@ export interface MultiSelectProps {
|
||||
* Callback when add button is clicked
|
||||
*/
|
||||
onAddClick?: () => void;
|
||||
/**
|
||||
* Show the add button (backward compatibility - use addButton instead)
|
||||
*/
|
||||
showAddButton?: boolean;
|
||||
/**
|
||||
* Whether to show add button (Figma prop).
|
||||
* @default true
|
||||
@@ -76,7 +72,7 @@ export interface MultiSelectViewProps {
|
||||
options: ChipOption[];
|
||||
onChipClick?: (chipId: string) => void;
|
||||
onAddClick?: () => void;
|
||||
showAddButton: boolean;
|
||||
addButton: boolean;
|
||||
addButtonText: string;
|
||||
formHeader: boolean;
|
||||
onCustomChipConfirm?: (chipId: string, value: string) => void;
|
||||
|
||||
@@ -13,7 +13,7 @@ function MultiSelectView({
|
||||
options,
|
||||
onChipClick,
|
||||
onAddClick,
|
||||
showAddButton,
|
||||
addButton,
|
||||
addButtonText,
|
||||
formHeader = true,
|
||||
onCustomChipConfirm,
|
||||
@@ -75,7 +75,7 @@ function MultiSelectView({
|
||||
))}
|
||||
|
||||
{/* Add button - Circular button with border (not ghost) when no text, ghost style when text provided */}
|
||||
{showAddButton && (
|
||||
{addButton && (
|
||||
<button
|
||||
type="button"
|
||||
aria-label={addButtonText || "Add option"}
|
||||
|
||||
Reference in New Issue
Block a user