Skip to content

feat(PopoverConfirm): new component#381

Open
HaykKirakosyanSoft wants to merge 22 commits intorelease/3.0.0from
feature/add-popover-confirm-component
Open

feat(PopoverConfirm): new component#381
HaykKirakosyanSoft wants to merge 22 commits intorelease/3.0.0from
feature/add-popover-confirm-component

Conversation

@HaykKirakosyanSoft
Copy link
Collaborator

@HaykKirakosyanSoft HaykKirakosyanSoft commented Feb 19, 2026

@@ -0,0 +1,9 @@
.popoverConfirm__title_icon {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename popoverConfirm__title_icon to a valid BEM-style semantic name.

open: controlledOpen,
defaultOpen = false,
status = "warning",
...popoverProps
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 I think spreading all Popover props into PopoverConfirm makes this component too open and weakens its contract. PopoverConfirm is a specific UX pattern and should expose only the props it actually supports by design. For example, allowed sizes seem limited (small/medium), margin should be internal constant, hasCloseButton appears fixed (false), and options like fitReference are not part of the current design. Could we remove broad prop spreading and define an explicit, constrained PopoverConfirm API instead?


const primaryButtonAppearance = status === "error" ? "danger" : "primary";

const IconComponent = status === "error" ? ErrorFilled : TriangleAlert;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use a status-to-icon map instead of a ternary for better scalability/readability? Example:

const iconByStatus = { error: ErrorFilled, warning: TriangleAlert }; 
const IconComponent = iconByStatus[status];

[popoverRef.current.floatingElement]
);

const primaryButtonAppearance = status === "error" ? "danger" : "primary";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we align this with the same mapping approach to keep status-driven values consistent? Example:

const appearanceByStatus = { error: "danger", warning: "primary" }; 
const primaryButtonAppearance = appearanceByStatus[status];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: new PopoverConfirm component

2 participants