Skip to content

Conversation

@slizhevskyv-semrush
Copy link
Contributor

@slizhevskyv-semrush slizhevskyv-semrush commented Jan 15, 2026

Changelog

@semcore/feedback-form

Added

  • illustrationElement, NoticeComponent for FeedbackRating component.

@semcore/feature-highlight

Added

  • Advanced mode for Notice.

Motivation and Context

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Nice improve.

Checklist:

  • I have updated the documentation accordingly.
  • I have added new tests on added of fixed functionality.

@slizhevskyv-semrush slizhevskyv-semrush marked this pull request as ready for review January 16, 2026 09:39
@slizhevskyv-semrush slizhevskyv-semrush marked this pull request as draft January 16, 2026 10:03
@slizhevskyv-semrush slizhevskyv-semrush marked this pull request as ready for review January 16, 2026 10:55

class FeedbackRatingRoot extends Component<
FeedbackRatingProps,
FeedbackRatingProps & { NoticeComponent: typeof FeedbackRatingRoot.defaultProps['NoticeComponent'] },
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, you shouldn't set type here if you have NoticeComponent in the FeedbackRatingProps

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

/** Illustration element */
illustrationElement?: React.ReactElement;
/** Notice smart component like NoticeSmart/NoticeFH */
NoticeComponent?: React.ComponentType<NoticeSmartProps>;
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think about just Illustration and Notice - both from upper case and with specifics in type?

Copy link
Contributor

Choose a reason for hiding this comment

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

P.S.

Illustration?: Intergalactic.Component<'svg', IllustrationProps>;
Notice?: typeof Notice;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

Copy link
Contributor Author

@slizhevskyv-semrush slizhevskyv-semrush Jan 16, 2026

Choose a reason for hiding this comment

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

additionally noticed one thing, jfyi

we have to be care with Intergalactic.Compoent type as prop. That is why React.ComponentType<NoticeSmartProps> is used in that context. The downside of that approach is that it could miss internal props like tag render, etc...

Example:

type Props = {
  Test: Intergalactic.Component<'div', NoticeSmartProps>;
}

I expect that only components that implement NoticeSmartProps will be a valid input (yeah, I know that NoticeSmartProps is extended by BoxProps and vast majority of components are extended too..., but...)

POV:

<Component Test={Box} />

and TS won't tell anything :)

<Notice.Close onClick={onNotificationClose} />
</Notice>

<Notice.Text tag={Flex} gap={3} alignItems={notificationTitle ? 'flex-start' : 'center'}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think - this is incorrect to use Notice.Text here - it should be NoticeComponent.Text.
I see the problem, maybe we need to transform a little Notice in FeatureHighlight - add some advanced mode or something like this to use advanced Notice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

}

SFeedbackRatingNoticeComponent > *[data-ui-name="Notice.Label"] {
margin-right: var(--intergalactic-spacing-3x, 12px);
Copy link
Contributor

Choose a reason for hiding this comment

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

And after replacing the Notice, you don't need to use this style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted

… advanced mode/update FeedbackRating component to accept Notice & Illustration components/updated snapshots
const { styles, Children } = this.asProps;

const advancedMode = isAdvanceMode(Children, [
NoticeFH.Label.displayName,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ilyabrower idk, shall we check all inner component to enable advanced mode?

Title: typeof Text;
Text: typeof Text;
Close: typeof Button;
/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be added as well just to preserve the same type as Notice has

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants